@recursica/adapter-tester 2.2.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +47 -16
  2. package/dist/adapter-tester.schema.json.d.ts +14 -10
  3. package/dist/cli.cjs +20 -24
  4. package/dist/cli.cjs.map +1 -1
  5. package/dist/cli.js +235 -4842
  6. package/dist/cli.js.map +1 -1
  7. package/dist/config.d.ts +46 -6
  8. package/dist/config.d.ts.map +1 -1
  9. package/dist/fileConfig.d.ts +9 -2
  10. package/dist/fileConfig.d.ts.map +1 -1
  11. package/dist/golden/diffPng.d.ts +8 -0
  12. package/dist/golden/diffPng.d.ts.map +1 -0
  13. package/dist/golden/manifest.schema.json.d.ts +27 -0
  14. package/dist/golden/manifestStore.d.ts +15 -0
  15. package/dist/golden/manifestStore.d.ts.map +1 -0
  16. package/dist/golden/resolveSourceOfTruthGolden.d.ts +29 -0
  17. package/dist/golden/resolveSourceOfTruthGolden.d.ts.map +1 -0
  18. package/dist/golden/validateManifest.d.ts +7 -0
  19. package/dist/golden/validateManifest.d.ts.map +1 -0
  20. package/dist/index-C6uYPRmx.cjs +9 -0
  21. package/dist/index-C6uYPRmx.cjs.map +1 -0
  22. package/dist/index-DqQzFSAH.js +4667 -0
  23. package/dist/index-DqQzFSAH.js.map +1 -0
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.js +21 -6
  27. package/dist/index.js.map +1 -1
  28. package/dist/testing/runVisualRegression.d.ts +22 -5
  29. package/dist/testing/runVisualRegression.d.ts.map +1 -1
  30. package/dist/testing.cjs +4 -1
  31. package/dist/testing.cjs.map +1 -1
  32. package/dist/testing.js +221 -151
  33. package/dist/testing.js.map +1 -1
  34. package/package.json +3 -2
  35. package/src/adapter-tester.schema.json +14 -10
  36. package/src/golden/manifest.schema.json +24 -0
  37. package/dist/config-B0Eop8Az.cjs +0 -2
  38. package/dist/config-B0Eop8Az.cjs.map +0 -1
  39. package/dist/config-CDxTeSAY.js +0 -21
  40. package/dist/config-CDxTeSAY.js.map +0 -1
package/dist/cli.cjs CHANGED
@@ -1,39 +1,35 @@
1
1
  #!/usr/bin/env node
2
- "use strict";const Lt=require("node:child_process"),ge=require("node:fs"),se=require("node:path"),Kt=require("node:url"),Tn=require("node:net"),jn=require("express"),In=require("http-proxy-middleware"),qn=require("./mantineSourceOfTruth-BUb5MZy0.cjs");var Re=typeof document<"u"?document.currentScript:null;const Yt=se.dirname(Kt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:Re&&Re.tagName.toUpperCase()==="SCRIPT"&&Re.src||new URL("cli.cjs",document.baseURI).href));function zt(e){return new Promise(t=>{const m=new Tn.Socket;m.setTimeout(200),m.once("connect",()=>{m.destroy(),t(!0)}),m.once("timeout",()=>{m.destroy(),t(!1)}),m.once("error",()=>{m.destroy(),t(!1)}),m.connect(e,"127.0.0.1")})}async function Zt(e,t=6e4){const m=Date.now();for(;Date.now()-m<t;){if(await zt(e))return!0;await new Promise(c=>setTimeout(c,500))}return!1}function Qt(e){return Number(new URL(e).port)}function Xt(e,t){var c,b;console.log(`[Dev Launcher] Port ${t.port} is inactive. Launching Storybook for ${e}...`);const m=Lt.spawn(t.command,{cwd:t.cwd,stdio:"pipe",shell:!0});return(c=m.stdout)==null||c.on("data",s=>{for(const l of s.toString().split(`
3
- `))l.trim()&&console.log(`[${e} SB] ${l.trim()}`)}),(b=m.stderr)==null||b.on("data",s=>{for(const l of s.toString().split(`
4
- `))l.trim()&&console.error(`[${e} SB ERROR] ${l.trim()}`)}),m.on("error",s=>{console.error(`[${e} SB ERROR] Failed to start process:`,s)}),m}function Cn(e){const t=process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open";console.log(`[Dev Launcher] Auto-launching browser: ${e}`),Lt.spawn(t,[e],{shell:process.platform==="win32"}).on("error",m=>{console.error("[Dev Launcher] Failed to auto-launch browser:",m)})}function Dn(e,t,m={}){const[c,b]=e.targets,[s,l]=t;if(!(c!=null&&c.sourceOfTruth)||!b||b.sourceOfTruth||!s||!l)throw new Error("adapter-tester dev mode requires exactly two targets: [sourceOfTruth, target] — check adapter-tester.config.json.");const u=m.port??6010,h=Qt(c.url),$=Qt(b.url),_=jn(),P=se.join(Yt,"../public"),v=se.join(Yt,"../report-header.txt");_.get("/",(a,i,r)=>{if(a.query.path){r();return}const o=ge.readFileSync(se.join(P,"index.html"),"utf8").replace("<head>",`<head>
5
- <script>window.__ADAPTER_TESTER__ = ${JSON.stringify({ownName:b.name,sourceOfTruthName:c.name,sourceOfTruthPort:h})};<\/script>`);i.send(o)}),_.get("/report-header.txt",(a,i)=>{try{i.type("text/plain").send(ge.readFileSync(v,"utf8"))}catch{i.status(500).send("Error loading report-header.txt")}}),_.use("/",In.createProxyMiddleware({target:`http://localhost:${$}`,changeOrigin:!0,ws:!0}));const y=[];let g=!1;const w=()=>{if(!g){g=!0,console.log(`
6
- [Dev Launcher] Shutting down Dev Mode server and spawned Storybooks...`);for(const a of y)a.kill("SIGINT");process.exit(0)}};process.on("SIGINT",w),process.on("SIGTERM",w),_.listen(u,async()=>{console.log(`
2
+ "use strict";const x=require("node:child_process"),l=require("node:fs"),s=require("node:path"),D=require("node:url"),U=require("node:net"),q=require("express"),M=require("http-proxy-middleware"),G=require("./mantineSourceOfTruth-BUb5MZy0.cjs"),L=require("./index-C6uYPRmx.cjs");var w=typeof document<"u"?document.currentScript:null;const A=s.dirname(D.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:w&&w.tagName.toUpperCase()==="SCRIPT"&&w.src||new URL("cli.cjs",document.baseURI).href));function k(t){return new Promise(o=>{const e=new U.Socket;e.setTimeout(200),e.once("connect",()=>{e.destroy(),o(!0)}),e.once("timeout",()=>{e.destroy(),o(!1)}),e.once("error",()=>{e.destroy(),o(!1)}),e.connect(t,"127.0.0.1")})}async function _(t,o=6e4){const e=Date.now();for(;Date.now()-e<o;){if(await k(t))return!0;await new Promise(r=>setTimeout(r,500))}return!1}function R(t){return Number(new URL(t).port)}function E(t,o){var r,n;console.log(`[Dev Launcher] Port ${o.port} is inactive. Launching Storybook for ${t}...`);const e=x.spawn(o.command,{cwd:o.cwd,stdio:"pipe",shell:!0});return(r=e.stdout)==null||r.on("data",a=>{for(const c of a.toString().split(`
3
+ `))c.trim()&&console.log(`[${t} SB] ${c.trim()}`)}),(n=e.stderr)==null||n.on("data",a=>{for(const c of a.toString().split(`
4
+ `))c.trim()&&console.error(`[${t} SB ERROR] ${c.trim()}`)}),e.on("error",a=>{console.error(`[${t} SB ERROR] Failed to start process:`,a)}),e}function J(t){const o=process.platform==="darwin"?"open":process.platform==="win32"?"start":"xdg-open";console.log(`[Dev Launcher] Auto-launching browser: ${t}`),x.spawn(o,[t],{shell:process.platform==="win32"}).on("error",e=>{console.error("[Dev Launcher] Failed to auto-launch browser:",e)})}function V(t,o,e={}){const[r,n]=t.targets,[a,c]=o;if(!(r!=null&&r.sourceOfTruth)||!n||n.sourceOfTruth||!a||!c)throw new Error("adapter-tester dev mode requires exactly two targets: [sourceOfTruth, target] — check adapter-tester.config.json.");const m=e.port??6010,h=R(r.url),i=R(n.url),u=q(),g=s.join(A,"../public"),S=s.join(A,"../report-header.txt");u.get("/",(d,p,y)=>{if(d.query.path){y();return}const P=l.readFileSync(s.join(g,"index.html"),"utf8").replace("<head>",`<head>
5
+ <script>window.__ADAPTER_TESTER__ = ${JSON.stringify({ownName:n.name,sourceOfTruthName:r.name,sourceOfTruthPort:h})};<\/script>`);p.send(P)}),u.get("/report-header.txt",(d,p)=>{try{p.type("text/plain").send(l.readFileSync(S,"utf8"))}catch{p.status(500).send("Error loading report-header.txt")}}),u.use("/",M.createProxyMiddleware({target:`http://localhost:${i}`,changeOrigin:!0,ws:!0}));const f=[];let b=!1;const T=()=>{if(!b){b=!0,console.log(`
6
+ [Dev Launcher] Shutting down Dev Mode server and spawned Storybooks...`);for(const d of f)d.kill("SIGINT");process.exit(0)}};process.on("SIGINT",T),process.on("SIGTERM",T),u.listen(m,async()=>{console.log(`
7
7
  ====================================================
8
8
  🚀 Adapter Dev Mode proxy running at:
9
- http://localhost:${u}
9
+ http://localhost:${m}
10
10
  ====================================================
11
- `);const[a,i]=await Promise.all([zt(h),zt($)]);a?console.log(`[Dev Launcher] ${c.name} is already running on port ${h}.`):y.push(Xt(c.name,s)),i?console.log(`[Dev Launcher] ${b.name} is already running on port ${$}.`):y.push(Xt(b.name,l));const r=[];a||r.push(Zt(h)),i||r.push(Zt($)),r.length>0?(console.log("[Dev Launcher] Waiting for Storybooks to be responsive..."),(await Promise.all(r)).every(Boolean)?console.log("[Dev Launcher] All Storybooks are active and responsive!"):console.warn("[Dev Launcher] Warning: some Storybooks timed out during startup, but proceeding...")):console.log("[Dev Launcher] Both Storybooks already active."),Cn(`http://localhost:${u}`)})}function An(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ie={exports:{}},Nt={},me={},we={},Rt={},kt={},Ot={},xt;function gt(){return xt||(xt=1,(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 m extends t{constructor(r){if(super(),!e.IDENTIFIER.test(r))throw new Error("CodeGen: name must be a valid identifier");this.str=r}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=m;class c extends t{constructor(r){super(),this._items=typeof r=="string"?[r]:r}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const r=this._items[0];return r===""||r==='""'}get str(){var r;return(r=this._str)!==null&&r!==void 0?r:this._str=this._items.reduce((o,p)=>`${o}${p}`,"")}get names(){var r;return(r=this._names)!==null&&r!==void 0?r:this._names=this._items.reduce((o,p)=>(p instanceof m&&(o[p.str]=(o[p.str]||0)+1),o),{})}}e._Code=c,e.nil=new c("");function b(i,...r){const o=[i[0]];let p=0;for(;p<r.length;)u(o,r[p]),o.push(i[++p]);return new c(o)}e._=b;const s=new c("+");function l(i,...r){const o=[y(i[0])];let p=0;for(;p<r.length;)o.push(s),u(o,r[p]),o.push(s,y(i[++p]));return h(o),new c(o)}e.str=l;function u(i,r){r instanceof c?i.push(...r._items):r instanceof m?i.push(r):i.push(P(r))}e.addCodeArg=u;function h(i){let r=1;for(;r<i.length-1;){if(i[r]===s){const o=$(i[r-1],i[r+1]);if(o!==void 0){i.splice(r-1,3,o);continue}i[r++]="+"}r++}}function $(i,r){if(r==='""')return i;if(i==='""')return r;if(typeof i=="string")return r instanceof m||i[i.length-1]!=='"'?void 0:typeof r!="string"?`${i.slice(0,-1)}${r}"`:r[0]==='"'?i.slice(0,-1)+r.slice(1):void 0;if(typeof r=="string"&&r[0]==='"'&&!(i instanceof m))return`"${i}${r.slice(1)}`}function _(i,r){return r.emptyStr()?i:i.emptyStr()?r:l`${i}${r}`}e.strConcat=_;function P(i){return typeof i=="number"||typeof i=="boolean"||i===null?i:y(Array.isArray(i)?i.join(","):i)}function v(i){return new c(y(i))}e.stringify=v;function y(i){return JSON.stringify(i).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=y;function g(i){return typeof i=="string"&&e.IDENTIFIER.test(i)?new c(`.${i}`):b`[${i}]`}e.getProperty=g;function w(i){if(typeof i=="string"&&e.IDENTIFIER.test(i))return new c(`${i}`);throw new Error(`CodeGen: invalid export name: ${i}, use explicit $id name mapping`)}e.getEsmExportName=w;function a(i){return new c(i.toString())}e.regexpCode=a})(Ot)),Ot}var Tt={},er;function tr(){return er||(er=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=gt();class m extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`),this.value=$.value}}var c;(function(h){h[h.Started=0]="Started",h[h.Completed=1]="Completed"})(c||(e.UsedValueState=c={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class b{constructor({prefixes:$,parent:_}={}){this._names={},this._prefixes=$,this._parent=_}toName($){return $ instanceof t.Name?$:this.name($)}name($){return new t.Name(this._newName($))}_newName($){const _=this._names[$]||this._nameGroup($);return`${$}${_.index++}`}_nameGroup($){var _,P;if(!((P=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||P===void 0)&&P.has($)||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}e.Scope=b;class s extends t.Name{constructor($,_){super(_),this.prefix=$}setValue($,{property:_,itemIndex:P}){this.value=$,this.scopePath=(0,t._)`.${new t.Name(_)}[${P}]`}}e.ValueScopeName=s;const l=(0,t._)`\n`;class u extends b{constructor($){super($),this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?l:t.nil}}get(){return this._scope}name($){return new s($,this._newName($))}value($,_){var P;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName($),{prefix:y}=v,g=(P=_.key)!==null&&P!==void 0?P:_.ref;let w=this._values[y];if(w){const r=w.get(g);if(r)return r}else w=this._values[y]=new Map;w.set(g,v);const a=this._scope[y]||(this._scope[y]=[]),i=a.length;return a[i]=_.ref,v.setValue(_,{property:y,itemIndex:i}),v}getValue($,_){const P=this._values[$];if(P)return P.get(_)}scopeRefs($,_=this._values){return this._reduceValues(_,P=>{if(P.scopePath===void 0)throw new Error(`CodeGen: name "${P}" has no value`);return(0,t._)`${$}${P.scopePath}`})}scopeCode($=this._values,_,P){return this._reduceValues($,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},_,P)}_reduceValues($,_,P={},v){let y=t.nil;for(const g in $){const w=$[g];if(!w)continue;const a=P[g]=P[g]||new Map;w.forEach(i=>{if(a.has(i))return;a.set(i,c.Started);let r=_(i);if(r){const o=this.opts.es5?e.varKinds.var:e.varKinds.const;y=(0,t._)`${y}${o} ${i} = ${r};${this.opts._n}`}else if(r=v==null?void 0:v(i))y=(0,t._)`${y}${r}${this.opts._n}`;else throw new m(i);a.set(i,c.Completed)})}return y}}e.ValueScope=u})(Tt)),Tt}var rr;function H(){return rr||(rr=1,(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=gt(),m=tr();var c=gt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return c.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return c.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return c.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return c.Name}});var b=tr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return b.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return b.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return b.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return b.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 s{optimizeNodes(){return this}optimizeNames(d,E){return this}}class l extends s{constructor(d,E,I){super(),this.varKind=d,this.name=E,this.rhs=I}render({es5:d,_n:E}){const I=d?m.varKinds.var:this.varKind,F=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${F};`+E}optimizeNames(d,E){if(d[this.name.str])return this.rhs&&(this.rhs=J(this.rhs,d,E)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends s{constructor(d,E,I){super(),this.lhs=d,this.rhs=E,this.sideEffects=I}render({_n:d}){return`${this.lhs} = ${this.rhs};`+d}optimizeNames(d,E){if(!(this.lhs instanceof t.Name&&!d[this.lhs.str]&&!this.sideEffects))return this.rhs=J(this.rhs,d,E),this}get names(){const d=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(d,this.rhs)}}class h extends u{constructor(d,E,I,F){super(d,I,F),this.op=E}render({_n:d}){return`${this.lhs} ${this.op}= ${this.rhs};`+d}}class $ extends s{constructor(d){super(),this.label=d,this.names={}}render({_n:d}){return`${this.label}:`+d}}class _ extends s{constructor(d){super(),this.label=d,this.names={}}render({_n:d}){return`break${this.label?` ${this.label}`:""};`+d}}class P extends s{constructor(d){super(),this.error=d}render({_n:d}){return`throw ${this.error};`+d}get names(){return this.error.names}}class v extends s{constructor(d){super(),this.code=d}render({_n:d}){return`${this.code};`+d}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(d,E){return this.code=J(this.code,d,E),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class y extends s{constructor(d=[]){super(),this.nodes=d}render(d){return this.nodes.reduce((E,I)=>E+I.render(d),"")}optimizeNodes(){const{nodes:d}=this;let E=d.length;for(;E--;){const I=d[E].optimizeNodes();Array.isArray(I)?d.splice(E,1,...I):I?d[E]=I:d.splice(E,1)}return d.length>0?this:void 0}optimizeNames(d,E){const{nodes:I}=this;let F=I.length;for(;F--;){const K=I[F];K.optimizeNames(d,E)||(x(d,K.names),I.splice(F,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((d,E)=>V(d,E.names),{})}}class g extends y{render(d){return"{"+d._n+super.render(d)+"}"+d._n}}class w extends y{}class a extends g{}a.kind="else";class i extends g{constructor(d,E){super(E),this.condition=d}render(d){let E=`if(${this.condition})`+super.render(d);return this.else&&(E+="else "+this.else.render(d)),E}optimizeNodes(){super.optimizeNodes();const d=this.condition;if(d===!0)return this.nodes;let E=this.else;if(E){const I=E.optimizeNodes();E=this.else=Array.isArray(I)?new a(I):I}if(E)return d===!1?E instanceof i?E:E.nodes:this.nodes.length?this:new i(fe(d),E instanceof i?[E]:E.nodes);if(!(d===!1||!this.nodes.length))return this}optimizeNames(d,E){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(d,E),!!(super.optimizeNames(d,E)||this.else))return this.condition=J(this.condition,d,E),this}get names(){const d=super.names;return U(d,this.condition),this.else&&V(d,this.else.names),d}}i.kind="if";class r extends g{}r.kind="for";class o extends r{constructor(d){super(),this.iteration=d}render(d){return`for(${this.iteration})`+super.render(d)}optimizeNames(d,E){if(super.optimizeNames(d,E))return this.iteration=J(this.iteration,d,E),this}get names(){return V(super.names,this.iteration.names)}}class p extends r{constructor(d,E,I,F){super(),this.varKind=d,this.name=E,this.from=I,this.to=F}render(d){const E=d.es5?m.varKinds.var:this.varKind,{name:I,from:F,to:K}=this;return`for(${E} ${I}=${F}; ${I}<${K}; ${I}++)`+super.render(d)}get names(){const d=U(super.names,this.from);return U(d,this.to)}}class n extends r{constructor(d,E,I,F){super(),this.loop=d,this.varKind=E,this.name=I,this.iterable=F}render(d){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(d)}optimizeNames(d,E){if(super.optimizeNames(d,E))return this.iterable=J(this.iterable,d,E),this}get names(){return V(super.names,this.iterable.names)}}class f extends g{constructor(d,E,I){super(),this.name=d,this.args=E,this.async=I}render(d){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(d)}}f.kind="func";class S extends y{render(d){return"return "+super.render(d)}}S.kind="return";class T extends g{render(d){let E="try"+super.render(d);return this.catch&&(E+=this.catch.render(d)),this.finally&&(E+=this.finally.render(d)),E}optimizeNodes(){var d,E;return super.optimizeNodes(),(d=this.catch)===null||d===void 0||d.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(d,E){var I,F;return super.optimizeNames(d,E),(I=this.catch)===null||I===void 0||I.optimizeNames(d,E),(F=this.finally)===null||F===void 0||F.optimizeNames(d,E),this}get names(){const d=super.names;return this.catch&&V(d,this.catch.names),this.finally&&V(d,this.finally.names),d}}class j extends g{constructor(d){super(),this.error=d}render(d){return`catch(${this.error})`+super.render(d)}}j.kind="catch";class D extends g{render(d){return"finally"+super.render(d)}}D.kind="finally";class z{constructor(d,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
12
- `:""},this._extScope=d,this._scope=new m.Scope({parent:d}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(d){return this._scope.name(d)}scopeName(d){return this._extScope.name(d)}scopeValue(d,E){const I=this._extScope.value(d,E);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(d,E){return this._extScope.getValue(d,E)}scopeRefs(d){return this._extScope.scopeRefs(d,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(d,E,I,F){const K=this._scope.toName(E);return I!==void 0&&F&&(this._constants[K.str]=I),this._leafNode(new l(d,K,I)),K}const(d,E,I){return this._def(m.varKinds.const,d,E,I)}let(d,E,I){return this._def(m.varKinds.let,d,E,I)}var(d,E,I){return this._def(m.varKinds.var,d,E,I)}assign(d,E,I){return this._leafNode(new u(d,E,I))}add(d,E){return this._leafNode(new h(d,e.operators.ADD,E))}code(d){return typeof d=="function"?d():d!==t.nil&&this._leafNode(new v(d)),this}object(...d){const E=["{"];for(const[I,F]of d)E.length>1&&E.push(","),E.push(I),(I!==F||this.opts.es5)&&(E.push(":"),(0,t.addCodeArg)(E,F));return E.push("}"),new t._Code(E)}if(d,E,I){if(this._blockNode(new i(d)),E&&I)this.code(E).else().code(I).endIf();else if(E)this.code(E).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(d){return this._elseNode(new i(d))}else(){return this._elseNode(new a)}endIf(){return this._endBlockNode(i,a)}_for(d,E){return this._blockNode(d),E&&this.code(E).endFor(),this}for(d,E){return this._for(new o(d),E)}forRange(d,E,I,F,K=this.opts.es5?m.varKinds.var:m.varKinds.let){const Z=this._scope.toName(d);return this._for(new p(K,Z,E,I),()=>F(Z))}forOf(d,E,I,F=m.varKinds.const){const K=this._scope.toName(d);if(this.opts.es5){const Z=E instanceof t.Name?E:this.var("_arr",E);return this.forRange("_i",0,(0,t._)`${Z}.length`,B=>{this.var(K,(0,t._)`${Z}[${B}]`),I(K)})}return this._for(new n("of",F,K,E),()=>I(K))}forIn(d,E,I,F=this.opts.es5?m.varKinds.var:m.varKinds.const){if(this.opts.ownProperties)return this.forOf(d,(0,t._)`Object.keys(${E})`,I);const K=this._scope.toName(d);return this._for(new n("in",F,K,E),()=>I(K))}endFor(){return this._endBlockNode(r)}label(d){return this._leafNode(new $(d))}break(d){return this._leafNode(new _(d))}return(d){const E=new S;if(this._blockNode(E),this.code(d),E.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(d,E,I){if(!E&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const F=new T;if(this._blockNode(F),this.code(d),E){const K=this.name("e");this._currNode=F.catch=new j(K),E(K)}return I&&(this._currNode=F.finally=new D,this.code(I)),this._endBlockNode(j,D)}throw(d){return this._leafNode(new P(d))}block(d,E){return this._blockStarts.push(this._nodes.length),d&&this.code(d).endBlock(E),this}endBlock(d){const E=this._blockStarts.pop();if(E===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-E;if(I<0||d!==void 0&&I!==d)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${d} expected`);return this._nodes.length=E,this}func(d,E=t.nil,I,F){return this._blockNode(new f(d,E,I)),F&&this.code(F).endFunc(),this}endFunc(){return this._endBlockNode(f)}optimize(d=1){for(;d-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(d){return this._currNode.nodes.push(d),this}_blockNode(d){this._currNode.nodes.push(d),this._nodes.push(d)}_endBlockNode(d,E){const I=this._currNode;if(I instanceof d||E&&I instanceof E)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${E?`${d.kind}/${E.kind}`:d.kind}"`)}_elseNode(d){const E=this._currNode;if(!(E instanceof i))throw new Error('CodeGen: "else" without "if"');return this._currNode=E.else=d,this}get _root(){return this._nodes[0]}get _currNode(){const d=this._nodes;return d[d.length-1]}set _currNode(d){const E=this._nodes;E[E.length-1]=d}}e.CodeGen=z;function V(O,d){for(const E in d)O[E]=(O[E]||0)+(d[E]||0);return O}function U(O,d){return d instanceof t._CodeOrName?V(O,d.names):O}function J(O,d,E){if(O instanceof t.Name)return I(O);if(!F(O))return O;return new t._Code(O._items.reduce((K,Z)=>(Z instanceof t.Name&&(Z=I(Z)),Z instanceof t._Code?K.push(...Z._items):K.push(Z),K),[]));function I(K){const Z=E[K.str];return Z===void 0||d[K.str]!==1?K:(delete d[K.str],Z)}function F(K){return K instanceof t._Code&&K._items.some(Z=>Z instanceof t.Name&&d[Z.str]===1&&E[Z.str]!==void 0)}}function x(O,d){for(const E in d)O[E]=(O[E]||0)-(d[E]||0)}function fe(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,t._)`!${C(O)}`}e.not=fe;const he=R(e.operators.AND);function X(...O){return O.reduce(he)}e.and=X;const _e=R(e.operators.OR);function A(...O){return O.reduce(_e)}e.or=A;function R(O){return(d,E)=>d===t.nil?E:E===t.nil?d:(0,t._)`${C(d)} ${O} ${C(E)}`}function C(O){return O instanceof t.Name?O:(0,t._)`(${O})`}})(kt)),kt}var G={},nr;function Y(){if(nr)return G;nr=1,Object.defineProperty(G,"__esModule",{value:!0}),G.checkStrictMode=G.getErrorPath=G.Type=G.useFunc=G.setEvaluated=G.evaluatedPropsToName=G.mergeEvaluated=G.eachItem=G.unescapeJsonPointer=G.escapeJsonPointer=G.escapeFragment=G.unescapeFragment=G.schemaRefOrVal=G.schemaHasRulesButRef=G.schemaHasRules=G.checkUnknownRules=G.alwaysValidSchema=G.toHash=void 0;const e=H(),t=gt();function m(n){const f={};for(const S of n)f[S]=!0;return f}G.toHash=m;function c(n,f){return typeof f=="boolean"?f:Object.keys(f).length===0?!0:(b(n,f),!s(f,n.self.RULES.all))}G.alwaysValidSchema=c;function b(n,f=n.schema){const{opts:S,self:T}=n;if(!S.strictSchema||typeof f=="boolean")return;const j=T.RULES.keywords;for(const D in f)j[D]||p(n,`unknown keyword: "${D}"`)}G.checkUnknownRules=b;function s(n,f){if(typeof n=="boolean")return!n;for(const S in n)if(f[S])return!0;return!1}G.schemaHasRules=s;function l(n,f){if(typeof n=="boolean")return!n;for(const S in n)if(S!=="$ref"&&f.all[S])return!0;return!1}G.schemaHasRulesButRef=l;function u({topSchemaRef:n,schemaPath:f},S,T,j){if(!j){if(typeof S=="number"||typeof S=="boolean")return S;if(typeof S=="string")return(0,e._)`${S}`}return(0,e._)`${n}${f}${(0,e.getProperty)(T)}`}G.schemaRefOrVal=u;function h(n){return P(decodeURIComponent(n))}G.unescapeFragment=h;function $(n){return encodeURIComponent(_(n))}G.escapeFragment=$;function _(n){return typeof n=="number"?`${n}`:n.replace(/~/g,"~0").replace(/\//g,"~1")}G.escapeJsonPointer=_;function P(n){return n.replace(/~1/g,"/").replace(/~0/g,"~")}G.unescapeJsonPointer=P;function v(n,f){if(Array.isArray(n))for(const S of n)f(S);else f(n)}G.eachItem=v;function y({mergeNames:n,mergeToName:f,mergeValues:S,resultToName:T}){return(j,D,z,V)=>{const U=z===void 0?D:z instanceof e.Name?(D instanceof e.Name?n(j,D,z):f(j,D,z),z):D instanceof e.Name?(f(j,z,D),D):S(D,z);return V===e.Name&&!(U instanceof e.Name)?T(j,U):U}}G.mergeEvaluated={props:y({mergeNames:(n,f,S)=>n.if((0,e._)`${S} !== true && ${f} !== undefined`,()=>{n.if((0,e._)`${f} === true`,()=>n.assign(S,!0),()=>n.assign(S,(0,e._)`${S} || {}`).code((0,e._)`Object.assign(${S}, ${f})`))}),mergeToName:(n,f,S)=>n.if((0,e._)`${S} !== true`,()=>{f===!0?n.assign(S,!0):(n.assign(S,(0,e._)`${S} || {}`),w(n,S,f))}),mergeValues:(n,f)=>n===!0?!0:{...n,...f},resultToName:g}),items:y({mergeNames:(n,f,S)=>n.if((0,e._)`${S} !== true && ${f} !== undefined`,()=>n.assign(S,(0,e._)`${f} === true ? true : ${S} > ${f} ? ${S} : ${f}`)),mergeToName:(n,f,S)=>n.if((0,e._)`${S} !== true`,()=>n.assign(S,f===!0?!0:(0,e._)`${S} > ${f} ? ${S} : ${f}`)),mergeValues:(n,f)=>n===!0?!0:Math.max(n,f),resultToName:(n,f)=>n.var("items",f)})};function g(n,f){if(f===!0)return n.var("props",!0);const S=n.var("props",(0,e._)`{}`);return f!==void 0&&w(n,S,f),S}G.evaluatedPropsToName=g;function w(n,f,S){Object.keys(S).forEach(T=>n.assign((0,e._)`${f}${(0,e.getProperty)(T)}`,!0))}G.setEvaluated=w;const a={};function i(n,f){return n.scopeValue("func",{ref:f,code:a[f.code]||(a[f.code]=new t._Code(f.code))})}G.useFunc=i;var r;(function(n){n[n.Num=0]="Num",n[n.Str=1]="Str"})(r||(G.Type=r={}));function o(n,f,S){if(n instanceof e.Name){const T=f===r.Num;return S?T?(0,e._)`"[" + ${n} + "]"`:(0,e._)`"['" + ${n} + "']"`:T?(0,e._)`"/" + ${n}`:(0,e._)`"/" + ${n}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return S?(0,e.getProperty)(n).toString():"/"+_(n)}G.getErrorPath=o;function p(n,f,S=n.opts.strictSchema){if(S){if(f=`strict mode: ${f}`,S===!0)throw new Error(f);n.self.logger.warn(f)}}return G.checkStrictMode=p,G}var qe={},sr;function $e(){if(sr)return qe;sr=1,Object.defineProperty(qe,"__esModule",{value:!0});const e=H(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return qe.default=t,qe}var ar;function vt(){return ar||(ar=1,(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=H(),m=Y(),c=$e();e.keywordError={message:({keyword:a})=>(0,t.str)`must pass "${a}" keyword validation`},e.keyword$DataError={message:({keyword:a,schemaType:i})=>i?(0,t.str)`"${a}" keyword must be ${i} ($data)`:(0,t.str)`"${a}" keyword is invalid ($data)`};function b(a,i=e.keywordError,r,o){const{it:p}=a,{gen:n,compositeRule:f,allErrors:S}=p,T=P(a,i,r);o??(f||S)?h(n,T):$(p,(0,t._)`[${T}]`)}e.reportError=b;function s(a,i=e.keywordError,r){const{it:o}=a,{gen:p,compositeRule:n,allErrors:f}=o,S=P(a,i,r);h(p,S),n||f||$(o,c.default.vErrors)}e.reportExtraError=s;function l(a,i){a.assign(c.default.errors,i),a.if((0,t._)`${c.default.vErrors} !== null`,()=>a.if(i,()=>a.assign((0,t._)`${c.default.vErrors}.length`,i),()=>a.assign(c.default.vErrors,null)))}e.resetErrorsCount=l;function u({gen:a,keyword:i,schemaValue:r,data:o,errsCount:p,it:n}){if(p===void 0)throw new Error("ajv implementation error");const f=a.name("err");a.forRange("i",p,c.default.errors,S=>{a.const(f,(0,t._)`${c.default.vErrors}[${S}]`),a.if((0,t._)`${f}.instancePath === undefined`,()=>a.assign((0,t._)`${f}.instancePath`,(0,t.strConcat)(c.default.instancePath,n.errorPath))),a.assign((0,t._)`${f}.schemaPath`,(0,t.str)`${n.errSchemaPath}/${i}`),n.opts.verbose&&(a.assign((0,t._)`${f}.schema`,r),a.assign((0,t._)`${f}.data`,o))})}e.extendErrors=u;function h(a,i){const r=a.const("err",i);a.if((0,t._)`${c.default.vErrors} === null`,()=>a.assign(c.default.vErrors,(0,t._)`[${r}]`),(0,t._)`${c.default.vErrors}.push(${r})`),a.code((0,t._)`${c.default.errors}++`)}function $(a,i){const{gen:r,validateName:o,schemaEnv:p}=a;p.$async?r.throw((0,t._)`new ${a.ValidationError}(${i})`):(r.assign((0,t._)`${o}.errors`,i),r.return(!1))}const _={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 P(a,i,r){const{createErrors:o}=a.it;return o===!1?(0,t._)`{}`:v(a,i,r)}function v(a,i,r={}){const{gen:o,it:p}=a,n=[y(p,r),g(a,r)];return w(a,i,n),o.object(...n)}function y({errorPath:a},{instancePath:i}){const r=i?(0,t.str)`${a}${(0,m.getErrorPath)(i,m.Type.Str)}`:a;return[c.default.instancePath,(0,t.strConcat)(c.default.instancePath,r)]}function g({keyword:a,it:{errSchemaPath:i}},{schemaPath:r,parentSchema:o}){let p=o?i:(0,t.str)`${i}/${a}`;return r&&(p=(0,t.str)`${p}${(0,m.getErrorPath)(r,m.Type.Str)}`),[_.schemaPath,p]}function w(a,{params:i,message:r},o){const{keyword:p,data:n,schemaValue:f,it:S}=a,{opts:T,propertyName:j,topSchemaRef:D,schemaPath:z}=S;o.push([_.keyword,p],[_.params,typeof i=="function"?i(a):i||(0,t._)`{}`]),T.messages&&o.push([_.message,typeof r=="function"?r(a):r]),T.verbose&&o.push([_.schema,f],[_.parentSchema,(0,t._)`${D}${z}`],[c.default.data,n]),j&&o.push([_.propertyName,j])}})(Rt)),Rt}var or;function Mn(){if(or)return we;or=1,Object.defineProperty(we,"__esModule",{value:!0}),we.boolOrEmptySchema=we.topBoolOrEmptySchema=void 0;const e=vt(),t=H(),m=$e(),c={message:"boolean schema is false"};function b(u){const{gen:h,schema:$,validateName:_}=u;$===!1?l(u,!1):typeof $=="object"&&$.$async===!0?h.return(m.default.data):(h.assign((0,t._)`${_}.errors`,null),h.return(!0))}we.topBoolOrEmptySchema=b;function s(u,h){const{gen:$,schema:_}=u;_===!1?($.var(h,!1),l(u)):$.var(h,!0)}we.boolOrEmptySchema=s;function l(u,h){const{gen:$,data:_}=u,P={gen:$,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(P,c,void 0,h)}return we}var re={},be={},ir;function vn(){if(ir)return be;ir=1,Object.defineProperty(be,"__esModule",{value:!0}),be.getRules=be.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function m(b){return typeof b=="string"&&t.has(b)}be.isJSONType=m;function c(){const b={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...b,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},b.number,b.string,b.array,b.object],post:{rules:[]},all:{},keywords:{}}}return be.getRules=c,be}var pe={},ur;function $n(){if(ur)return pe;ur=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.shouldUseRule=pe.shouldUseGroup=pe.schemaHasRulesForType=void 0;function e({schema:c,self:b},s){const l=b.RULES.types[s];return l&&l!==!0&&t(c,l)}pe.schemaHasRulesForType=e;function t(c,b){return b.rules.some(s=>m(c,s))}pe.shouldUseGroup=t;function m(c,b){var s;return c[b.keyword]!==void 0||((s=b.definition.implements)===null||s===void 0?void 0:s.some(l=>c[l]!==void 0))}return pe.shouldUseRule=m,pe}var cr;function _t(){if(cr)return re;cr=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=vn(),t=$n(),m=vt(),c=H(),b=Y();var s;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(s||(re.DataType=s={}));function l(r){const o=u(r.type);if(o.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!o.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&o.push("null")}return o}re.getSchemaTypes=l;function u(r){const o=Array.isArray(r)?r:r?[r]:[];if(o.every(e.isJSONType))return o;throw new Error("type must be JSONType or JSONType[]: "+o.join(","))}re.getJSONTypes=u;function h(r,o){const{gen:p,data:n,opts:f}=r,S=_(o,f.coerceTypes),T=o.length>0&&!(S.length===0&&o.length===1&&(0,t.schemaHasRulesForType)(r,o[0]));if(T){const j=g(o,n,f.strictNumbers,s.Wrong);p.if(j,()=>{S.length?P(r,o,S):a(r)})}return T}re.coerceAndCheckDataType=h;const $=new Set(["string","number","integer","boolean","null"]);function _(r,o){return o?r.filter(p=>$.has(p)||o==="array"&&p==="array"):[]}function P(r,o,p){const{gen:n,data:f,opts:S}=r,T=n.let("dataType",(0,c._)`typeof ${f}`),j=n.let("coerced",(0,c._)`undefined`);S.coerceTypes==="array"&&n.if((0,c._)`${T} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,()=>n.assign(f,(0,c._)`${f}[0]`).assign(T,(0,c._)`typeof ${f}`).if(g(o,f,S.strictNumbers),()=>n.assign(j,f))),n.if((0,c._)`${j} !== undefined`);for(const z of p)($.has(z)||z==="array"&&S.coerceTypes==="array")&&D(z);n.else(),a(r),n.endIf(),n.if((0,c._)`${j} !== undefined`,()=>{n.assign(f,j),v(r,j)});function D(z){switch(z){case"string":n.elseIf((0,c._)`${T} == "number" || ${T} == "boolean"`).assign(j,(0,c._)`"" + ${f}`).elseIf((0,c._)`${f} === null`).assign(j,(0,c._)`""`);return;case"number":n.elseIf((0,c._)`${T} == "boolean" || ${f} === null
13
- || (${T} == "string" && ${f} && ${f} == +${f})`).assign(j,(0,c._)`+${f}`);return;case"integer":n.elseIf((0,c._)`${T} === "boolean" || ${f} === null
14
- || (${T} === "string" && ${f} && ${f} == +${f} && !(${f} % 1))`).assign(j,(0,c._)`+${f}`);return;case"boolean":n.elseIf((0,c._)`${f} === "false" || ${f} === 0 || ${f} === null`).assign(j,!1).elseIf((0,c._)`${f} === "true" || ${f} === 1`).assign(j,!0);return;case"null":n.elseIf((0,c._)`${f} === "" || ${f} === 0 || ${f} === false`),n.assign(j,null);return;case"array":n.elseIf((0,c._)`${T} === "string" || ${T} === "number"
15
- || ${T} === "boolean" || ${f} === null`).assign(j,(0,c._)`[${f}]`)}}}function v({gen:r,parentData:o,parentDataProperty:p},n){r.if((0,c._)`${o} !== undefined`,()=>r.assign((0,c._)`${o}[${p}]`,n))}function y(r,o,p,n=s.Correct){const f=n===s.Correct?c.operators.EQ:c.operators.NEQ;let S;switch(r){case"null":return(0,c._)`${o} ${f} null`;case"array":S=(0,c._)`Array.isArray(${o})`;break;case"object":S=(0,c._)`${o} && typeof ${o} == "object" && !Array.isArray(${o})`;break;case"integer":S=T((0,c._)`!(${o} % 1) && !isNaN(${o})`);break;case"number":S=T();break;default:return(0,c._)`typeof ${o} ${f} ${r}`}return n===s.Correct?S:(0,c.not)(S);function T(j=c.nil){return(0,c.and)((0,c._)`typeof ${o} == "number"`,j,p?(0,c._)`isFinite(${o})`:c.nil)}}re.checkDataType=y;function g(r,o,p,n){if(r.length===1)return y(r[0],o,p,n);let f;const S=(0,b.toHash)(r);if(S.array&&S.object){const T=(0,c._)`typeof ${o} != "object"`;f=S.null?T:(0,c._)`!${o} || ${T}`,delete S.null,delete S.array,delete S.object}else f=c.nil;S.number&&delete S.integer;for(const T in S)f=(0,c.and)(f,y(T,o,p,n));return f}re.checkDataTypes=g;const w={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:o})=>typeof r=="string"?(0,c._)`{type: ${r}}`:(0,c._)`{type: ${o}}`};function a(r){const o=i(r);(0,m.reportError)(o,w)}re.reportTypeError=a;function i(r){const{gen:o,data:p,schema:n}=r,f=(0,b.schemaRefOrVal)(r,n,"type");return{gen:o,keyword:"type",data:p,schema:n.type,schemaCode:f,schemaValue:f,parentSchema:n,params:{},it:r}}return re}var Oe={},dr;function zn(){if(dr)return Oe;dr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.assignDefaults=void 0;const e=H(),t=Y();function m(b,s){const{properties:l,items:u}=b.schema;if(s==="object"&&l)for(const h in l)c(b,h,l[h].default);else s==="array"&&Array.isArray(u)&&u.forEach((h,$)=>c(b,$,h.default))}Oe.assignDefaults=m;function c(b,s,l){const{gen:u,compositeRule:h,data:$,opts:_}=b;if(l===void 0)return;const P=(0,e._)`${$}${(0,e.getProperty)(s)}`;if(h){(0,t.checkStrictMode)(b,`default is ignored for: ${P}`);return}let v=(0,e._)`${P} === undefined`;_.useDefaults==="empty"&&(v=(0,e._)`${v} || ${P} === null || ${P} === ""`),u.if(v,(0,e._)`${P} = ${(0,e.stringify)(l)}`)}return Oe}var de={},Q={},lr;function le(){if(lr)return Q;lr=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.validateUnion=Q.validateArray=Q.usePattern=Q.callValidateCode=Q.schemaProperties=Q.allSchemaProperties=Q.noPropertyInData=Q.propertyInData=Q.isOwnProperty=Q.hasPropFunc=Q.reportMissingProp=Q.checkMissingProp=Q.checkReportMissingProp=void 0;const e=H(),t=Y(),m=$e(),c=Y();function b(r,o){const{gen:p,data:n,it:f}=r;p.if(_(p,n,o,f.opts.ownProperties),()=>{r.setParams({missingProperty:(0,e._)`${o}`},!0),r.error()})}Q.checkReportMissingProp=b;function s({gen:r,data:o,it:{opts:p}},n,f){return(0,e.or)(...n.map(S=>(0,e.and)(_(r,o,S,p.ownProperties),(0,e._)`${f} = ${S}`)))}Q.checkMissingProp=s;function l(r,o){r.setParams({missingProperty:o},!0),r.error()}Q.reportMissingProp=l;function u(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Q.hasPropFunc=u;function h(r,o,p){return(0,e._)`${u(r)}.call(${o}, ${p})`}Q.isOwnProperty=h;function $(r,o,p,n){const f=(0,e._)`${o}${(0,e.getProperty)(p)} !== undefined`;return n?(0,e._)`${f} && ${h(r,o,p)}`:f}Q.propertyInData=$;function _(r,o,p,n){const f=(0,e._)`${o}${(0,e.getProperty)(p)} === undefined`;return n?(0,e.or)(f,(0,e.not)(h(r,o,p))):f}Q.noPropertyInData=_;function P(r){return r?Object.keys(r).filter(o=>o!=="__proto__"):[]}Q.allSchemaProperties=P;function v(r,o){return P(o).filter(p=>!(0,t.alwaysValidSchema)(r,o[p]))}Q.schemaProperties=v;function y({schemaCode:r,data:o,it:{gen:p,topSchemaRef:n,schemaPath:f,errorPath:S},it:T},j,D,z){const V=z?(0,e._)`${r}, ${o}, ${n}${f}`:o,U=[[m.default.instancePath,(0,e.strConcat)(m.default.instancePath,S)],[m.default.parentData,T.parentData],[m.default.parentDataProperty,T.parentDataProperty],[m.default.rootData,m.default.rootData]];T.opts.dynamicRef&&U.push([m.default.dynamicAnchors,m.default.dynamicAnchors]);const J=(0,e._)`${V}, ${p.object(...U)}`;return D!==e.nil?(0,e._)`${j}.call(${D}, ${J})`:(0,e._)`${j}(${J})`}Q.callValidateCode=y;const g=(0,e._)`new RegExp`;function w({gen:r,it:{opts:o}},p){const n=o.unicodeRegExp?"u":"",{regExp:f}=o.code,S=f(p,n);return r.scopeValue("pattern",{key:S.toString(),ref:S,code:(0,e._)`${f.code==="new RegExp"?g:(0,c.useFunc)(r,f)}(${p}, ${n})`})}Q.usePattern=w;function a(r){const{gen:o,data:p,keyword:n,it:f}=r,S=o.name("valid");if(f.allErrors){const j=o.let("valid",!0);return T(()=>o.assign(j,!1)),j}return o.var(S,!0),T(()=>o.break()),S;function T(j){const D=o.const("len",(0,e._)`${p}.length`);o.forRange("i",0,D,z=>{r.subschema({keyword:n,dataProp:z,dataPropType:t.Type.Num},S),o.if((0,e.not)(S),j)})}}Q.validateArray=a;function i(r){const{gen:o,schema:p,keyword:n,it:f}=r;if(!Array.isArray(p))throw new Error("ajv implementation error");if(p.some(D=>(0,t.alwaysValidSchema)(f,D))&&!f.opts.unevaluated)return;const T=o.let("valid",!1),j=o.name("_valid");o.block(()=>p.forEach((D,z)=>{const V=r.subschema({keyword:n,schemaProp:z,compositeRule:!0},j);o.assign(T,(0,e._)`${T} || ${j}`),r.mergeValidEvaluated(V,j)||o.if((0,e.not)(T))})),r.result(T,()=>r.reset(),()=>r.error(!0))}return Q.validateUnion=i,Q}var fr;function Vn(){if(fr)return de;fr=1,Object.defineProperty(de,"__esModule",{value:!0}),de.validateKeywordUsage=de.validSchemaType=de.funcKeywordCode=de.macroKeywordCode=void 0;const e=H(),t=$e(),m=le(),c=vt();function b(v,y){const{gen:g,keyword:w,schema:a,parentSchema:i,it:r}=v,o=y.macro.call(r.self,a,i,r),p=$(g,w,o);r.opts.validateSchema!==!1&&r.self.validateSchema(o,!0);const n=g.name("valid");v.subschema({schema:o,schemaPath:e.nil,errSchemaPath:`${r.errSchemaPath}/${w}`,topSchemaRef:p,compositeRule:!0},n),v.pass(n,()=>v.error(!0))}de.macroKeywordCode=b;function s(v,y){var g;const{gen:w,keyword:a,schema:i,parentSchema:r,$data:o,it:p}=v;h(p,y);const n=!o&&y.compile?y.compile.call(p.self,i,r,p):y.validate,f=$(w,a,n),S=w.let("valid");v.block$data(S,T),v.ok((g=y.valid)!==null&&g!==void 0?g:S);function T(){if(y.errors===!1)z(),y.modifying&&l(v),V(()=>v.error());else{const U=y.async?j():D();y.modifying&&l(v),V(()=>u(v,U))}}function j(){const U=w.let("ruleErrs",null);return w.try(()=>z((0,e._)`await `),J=>w.assign(S,!1).if((0,e._)`${J} instanceof ${p.ValidationError}`,()=>w.assign(U,(0,e._)`${J}.errors`),()=>w.throw(J))),U}function D(){const U=(0,e._)`${f}.errors`;return w.assign(U,null),z(e.nil),U}function z(U=y.async?(0,e._)`await `:e.nil){const J=p.opts.passContext?t.default.this:t.default.self,x=!("compile"in y&&!o||y.schema===!1);w.assign(S,(0,e._)`${U}${(0,m.callValidateCode)(v,f,J,x)}`,y.modifying)}function V(U){var J;w.if((0,e.not)((J=y.valid)!==null&&J!==void 0?J:S),U)}}de.funcKeywordCode=s;function l(v){const{gen:y,data:g,it:w}=v;y.if(w.parentData,()=>y.assign(g,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function u(v,y){const{gen:g}=v;g.if((0,e._)`Array.isArray(${y})`,()=>{g.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${y} : ${t.default.vErrors}.concat(${y})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,c.extendErrors)(v)},()=>v.error())}function h({schemaEnv:v},y){if(y.async&&!v.$async)throw new Error("async keyword in sync schema")}function $(v,y,g){if(g===void 0)throw new Error(`keyword "${y}" failed to compile`);return v.scopeValue("keyword",typeof g=="function"?{ref:g}:{ref:g,code:(0,e.stringify)(g)})}function _(v,y,g=!1){return!y.length||y.some(w=>w==="array"?Array.isArray(v):w==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==w||g&&typeof v>"u")}de.validSchemaType=_;function P({schema:v,opts:y,self:g,errSchemaPath:w},a,i){if(Array.isArray(a.keyword)?!a.keyword.includes(i):a.keyword!==i)throw new Error("ajv implementation error");const r=a.dependencies;if(r!=null&&r.some(o=>!Object.prototype.hasOwnProperty.call(v,o)))throw new Error(`parent schema must have dependencies of ${i}: ${r.join(",")}`);if(a.validateSchema&&!a.validateSchema(v[i])){const p=`keyword "${i}" value is invalid at path "${w}": `+g.errorsText(a.validateSchema.errors);if(y.validateSchema==="log")g.logger.error(p);else throw new Error(p)}}return de.validateKeywordUsage=P,de}var ye={},hr;function Fn(){if(hr)return ye;hr=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.extendSubschemaMode=ye.extendSubschemaData=ye.getSubschema=void 0;const e=H(),t=Y();function m(s,{keyword:l,schemaProp:u,schema:h,schemaPath:$,errSchemaPath:_,topSchemaRef:P}){if(l!==void 0&&h!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(l!==void 0){const v=s.schema[l];return u===void 0?{schema:v,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(l)}`,errSchemaPath:`${s.errSchemaPath}/${l}`}:{schema:v[u],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(l)}${(0,e.getProperty)(u)}`,errSchemaPath:`${s.errSchemaPath}/${l}/${(0,t.escapeFragment)(u)}`}}if(h!==void 0){if($===void 0||_===void 0||P===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:h,schemaPath:$,topSchemaRef:P,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}ye.getSubschema=m;function c(s,l,{dataProp:u,dataPropType:h,data:$,dataTypes:_,propertyName:P}){if($!==void 0&&u!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:v}=l;if(u!==void 0){const{errorPath:g,dataPathArr:w,opts:a}=l,i=v.let("data",(0,e._)`${l.data}${(0,e.getProperty)(u)}`,!0);y(i),s.errorPath=(0,e.str)`${g}${(0,t.getErrorPath)(u,h,a.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${u}`,s.dataPathArr=[...w,s.parentDataProperty]}if($!==void 0){const g=$ instanceof e.Name?$:v.let("data",$,!0);y(g),P!==void 0&&(s.propertyName=P)}_&&(s.dataTypes=_);function y(g){s.data=g,s.dataLevel=l.dataLevel+1,s.dataTypes=[],l.definedProperties=new Set,s.parentData=l.data,s.dataNames=[...l.dataNames,g]}}ye.extendSubschemaData=c;function b(s,{jtdDiscriminator:l,jtdMetadata:u,compositeRule:h,createErrors:$,allErrors:_}){h!==void 0&&(s.compositeRule=h),$!==void 0&&(s.createErrors=$),_!==void 0&&(s.allErrors=_),s.jtdDiscriminator=l,s.jtdMetadata=u}return ye.extendSubschemaMode=b,ye}var ne={},jt,mr;function wn(){return mr||(mr=1,jt=function e(t,m){if(t===m)return!0;if(t&&m&&typeof t=="object"&&typeof m=="object"){if(t.constructor!==m.constructor)return!1;var c,b,s;if(Array.isArray(t)){if(c=t.length,c!=m.length)return!1;for(b=c;b--!==0;)if(!e(t[b],m[b]))return!1;return!0}if(t.constructor===RegExp)return t.source===m.source&&t.flags===m.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===m.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===m.toString();if(s=Object.keys(t),c=s.length,c!==Object.keys(m).length)return!1;for(b=c;b--!==0;)if(!Object.prototype.hasOwnProperty.call(m,s[b]))return!1;for(b=c;b--!==0;){var l=s[b];if(!e(t[l],m[l]))return!1}return!0}return t!==t&&m!==m}),jt}var It={exports:{}},pr;function Un(){if(pr)return It.exports;pr=1;var e=It.exports=function(c,b,s){typeof b=="function"&&(s=b,b={}),s=b.cb||s;var l=typeof s=="function"?s:s.pre||function(){},u=s.post||function(){};t(b,l,u,c,"",c)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.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 t(c,b,s,l,u,h,$,_,P,v){if(l&&typeof l=="object"&&!Array.isArray(l)){b(l,u,h,$,_,P,v);for(var y in l){var g=l[y];if(Array.isArray(g)){if(y in e.arrayKeywords)for(var w=0;w<g.length;w++)t(c,b,s,g[w],u+"/"+y+"/"+w,h,u,y,l,w)}else if(y in e.propsKeywords){if(g&&typeof g=="object")for(var a in g)t(c,b,s,g[a],u+"/"+y+"/"+m(a),h,u,y,l,a)}else(y in e.keywords||c.allKeys&&!(y in e.skipKeywords))&&t(c,b,s,g,u+"/"+y,h,u,y,l)}s(l,u,h,$,_,P,v)}}function m(c){return c.replace(/~/g,"~0").replace(/\//g,"~1")}return It.exports}var yr;function $t(){if(yr)return ne;yr=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.getSchemaRefs=ne.resolveUrl=ne.normalizeId=ne._getFullPath=ne.getFullPath=ne.inlineRef=void 0;const e=Y(),t=wn(),m=Un(),c=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function b(w,a=!0){return typeof w=="boolean"?!0:a===!0?!l(w):a?u(w)<=a:!1}ne.inlineRef=b;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(w){for(const a in w){if(s.has(a))return!0;const i=w[a];if(Array.isArray(i)&&i.some(l)||typeof i=="object"&&l(i))return!0}return!1}function u(w){let a=0;for(const i in w){if(i==="$ref")return 1/0;if(a++,!c.has(i)&&(typeof w[i]=="object"&&(0,e.eachItem)(w[i],r=>a+=u(r)),a===1/0))return 1/0}return a}function h(w,a="",i){i!==!1&&(a=P(a));const r=w.parse(a);return $(w,r)}ne.getFullPath=h;function $(w,a){return w.serialize(a).split("#")[0]+"#"}ne._getFullPath=$;const _=/#\/?$/;function P(w){return w?w.replace(_,""):""}ne.normalizeId=P;function v(w,a,i){return i=P(i),w.resolve(a,i)}ne.resolveUrl=v;const y=/^[a-z_][-a-z0-9._]*$/i;function g(w,a){if(typeof w=="boolean")return{};const{schemaId:i,uriResolver:r}=this.opts,o=P(w[i]||a),p={"":o},n=h(r,o,!1),f={},S=new Set;return m(w,{allKeys:!0},(D,z,V,U)=>{if(U===void 0)return;const J=n+z;let x=p[U];typeof D[i]=="string"&&(x=fe.call(this,D[i])),he.call(this,D.$anchor),he.call(this,D.$dynamicAnchor),p[z]=x;function fe(X){const _e=this.opts.uriResolver.resolve;if(X=P(x?_e(x,X):X),S.has(X))throw j(X);S.add(X);let A=this.refs[X];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?T(D,A.schema,X):X!==P(J)&&(X[0]==="#"?(T(D,f[X],X),f[X]=D):this.refs[X]=J),X}function he(X){if(typeof X=="string"){if(!y.test(X))throw new Error(`invalid anchor "${X}"`);fe.call(this,`#${X}`)}}}),f;function T(D,z,V){if(z!==void 0&&!t(D,z))throw j(V)}function j(D){return new Error(`reference "${D}" resolves to more than one schema`)}}return ne.getSchemaRefs=g,ne}var gr;function wt(){if(gr)return me;gr=1,Object.defineProperty(me,"__esModule",{value:!0}),me.getData=me.KeywordCxt=me.validateFunctionCode=void 0;const e=Mn(),t=_t(),m=$n(),c=_t(),b=zn(),s=Vn(),l=Fn(),u=H(),h=$e(),$=$t(),_=Y(),P=vt();function v(N){if(n(N)&&(S(N),p(N))){a(N);return}y(N,()=>(0,e.topBoolOrEmptySchema)(N))}me.validateFunctionCode=v;function y({gen:N,validateName:k,schema:q,schemaEnv:M,opts:L},W){L.code.es5?N.func(k,(0,u._)`${h.default.data}, ${h.default.valCxt}`,M.$async,()=>{N.code((0,u._)`"use strict"; ${r(q,L)}`),w(N,L),N.code(W)}):N.func(k,(0,u._)`${h.default.data}, ${g(L)}`,M.$async,()=>N.code(r(q,L)).code(W))}function g(N){return(0,u._)`{${h.default.instancePath}="", ${h.default.parentData}, ${h.default.parentDataProperty}, ${h.default.rootData}=${h.default.data}${N.dynamicRef?(0,u._)`, ${h.default.dynamicAnchors}={}`:u.nil}}={}`}function w(N,k){N.if(h.default.valCxt,()=>{N.var(h.default.instancePath,(0,u._)`${h.default.valCxt}.${h.default.instancePath}`),N.var(h.default.parentData,(0,u._)`${h.default.valCxt}.${h.default.parentData}`),N.var(h.default.parentDataProperty,(0,u._)`${h.default.valCxt}.${h.default.parentDataProperty}`),N.var(h.default.rootData,(0,u._)`${h.default.valCxt}.${h.default.rootData}`),k.dynamicRef&&N.var(h.default.dynamicAnchors,(0,u._)`${h.default.valCxt}.${h.default.dynamicAnchors}`)},()=>{N.var(h.default.instancePath,(0,u._)`""`),N.var(h.default.parentData,(0,u._)`undefined`),N.var(h.default.parentDataProperty,(0,u._)`undefined`),N.var(h.default.rootData,h.default.data),k.dynamicRef&&N.var(h.default.dynamicAnchors,(0,u._)`{}`)})}function a(N){const{schema:k,opts:q,gen:M}=N;y(N,()=>{q.$comment&&k.$comment&&U(N),D(N),M.let(h.default.vErrors,null),M.let(h.default.errors,0),q.unevaluated&&i(N),T(N),J(N)})}function i(N){const{gen:k,validateName:q}=N;N.evaluated=k.const("evaluated",(0,u._)`${q}.evaluated`),k.if((0,u._)`${N.evaluated}.dynamicProps`,()=>k.assign((0,u._)`${N.evaluated}.props`,(0,u._)`undefined`)),k.if((0,u._)`${N.evaluated}.dynamicItems`,()=>k.assign((0,u._)`${N.evaluated}.items`,(0,u._)`undefined`))}function r(N,k){const q=typeof N=="object"&&N[k.schemaId];return q&&(k.code.source||k.code.process)?(0,u._)`/*# sourceURL=${q} */`:u.nil}function o(N,k){if(n(N)&&(S(N),p(N))){f(N,k);return}(0,e.boolOrEmptySchema)(N,k)}function p({schema:N,self:k}){if(typeof N=="boolean")return!N;for(const q in N)if(k.RULES.all[q])return!0;return!1}function n(N){return typeof N.schema!="boolean"}function f(N,k){const{schema:q,gen:M,opts:L}=N;L.$comment&&q.$comment&&U(N),z(N),V(N);const W=M.const("_errs",h.default.errors);T(N,W),M.var(k,(0,u._)`${W} === ${h.default.errors}`)}function S(N){(0,_.checkUnknownRules)(N),j(N)}function T(N,k){if(N.opts.jtd)return fe(N,[],!1,k);const q=(0,t.getSchemaTypes)(N.schema),M=(0,t.coerceAndCheckDataType)(N,q);fe(N,q,!M,k)}function j(N){const{schema:k,errSchemaPath:q,opts:M,self:L}=N;k.$ref&&M.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(k,L.RULES)&&L.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function D(N){const{schema:k,opts:q}=N;k.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,_.checkStrictMode)(N,"default is ignored in the schema root")}function z(N){const k=N.schema[N.opts.schemaId];k&&(N.baseId=(0,$.resolveUrl)(N.opts.uriResolver,N.baseId,k))}function V(N){if(N.schema.$async&&!N.schemaEnv.$async)throw new Error("async schema in sync schema")}function U({gen:N,schemaEnv:k,schema:q,errSchemaPath:M,opts:L}){const W=q.$comment;if(L.$comment===!0)N.code((0,u._)`${h.default.self}.logger.log(${W})`);else if(typeof L.$comment=="function"){const ee=(0,u.str)`${M}/$comment`,ce=N.scopeValue("root",{ref:k.root});N.code((0,u._)`${h.default.self}.opts.$comment(${W}, ${ee}, ${ce}.schema)`)}}function J(N){const{gen:k,schemaEnv:q,validateName:M,ValidationError:L,opts:W}=N;q.$async?k.if((0,u._)`${h.default.errors} === 0`,()=>k.return(h.default.data),()=>k.throw((0,u._)`new ${L}(${h.default.vErrors})`)):(k.assign((0,u._)`${M}.errors`,h.default.vErrors),W.unevaluated&&x(N),k.return((0,u._)`${h.default.errors} === 0`))}function x({gen:N,evaluated:k,props:q,items:M}){q instanceof u.Name&&N.assign((0,u._)`${k}.props`,q),M instanceof u.Name&&N.assign((0,u._)`${k}.items`,M)}function fe(N,k,q,M){const{gen:L,schema:W,data:ee,allErrors:ce,opts:ae,self:oe}=N,{RULES:te}=oe;if(W.$ref&&(ae.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(W,te))){L.block(()=>F(N,"$ref",te.all.$ref.definition));return}ae.jtd||X(N,k),L.block(()=>{for(const ue of te.rules)Ee(ue);Ee(te.post)});function Ee(ue){(0,m.shouldUseGroup)(W,ue)&&(ue.type?(L.if((0,c.checkDataType)(ue.type,ee,ae.strictNumbers)),he(N,ue),k.length===1&&k[0]===ue.type&&q&&(L.else(),(0,c.reportTypeError)(N)),L.endIf()):he(N,ue),ce||L.if((0,u._)`${h.default.errors} === ${M||0}`))}}function he(N,k){const{gen:q,schema:M,opts:{useDefaults:L}}=N;L&&(0,b.assignDefaults)(N,k.type),q.block(()=>{for(const W of k.rules)(0,m.shouldUseRule)(M,W)&&F(N,W.keyword,W.definition,k.type)})}function X(N,k){N.schemaEnv.meta||!N.opts.strictTypes||(_e(N,k),N.opts.allowUnionTypes||A(N,k),R(N,N.dataTypes))}function _e(N,k){if(k.length){if(!N.dataTypes.length){N.dataTypes=k;return}k.forEach(q=>{O(N.dataTypes,q)||E(N,`type "${q}" not allowed by context "${N.dataTypes.join(",")}"`)}),d(N,k)}}function A(N,k){k.length>1&&!(k.length===2&&k.includes("null"))&&E(N,"use allowUnionTypes to allow union type keyword")}function R(N,k){const q=N.self.RULES.all;for(const M in q){const L=q[M];if(typeof L=="object"&&(0,m.shouldUseRule)(N.schema,L)){const{type:W}=L.definition;W.length&&!W.some(ee=>C(k,ee))&&E(N,`missing type "${W.join(",")}" for keyword "${M}"`)}}}function C(N,k){return N.includes(k)||k==="number"&&N.includes("integer")}function O(N,k){return N.includes(k)||k==="integer"&&N.includes("number")}function d(N,k){const q=[];for(const M of N.dataTypes)O(k,M)?q.push(M):k.includes("integer")&&M==="number"&&q.push("integer");N.dataTypes=q}function E(N,k){const q=N.schemaEnv.baseId+N.errSchemaPath;k+=` at "${q}" (strictTypes)`,(0,_.checkStrictMode)(N,k,N.opts.strictTypes)}class I{constructor(k,q,M){if((0,s.validateKeywordUsage)(k,q,M),this.gen=k.gen,this.allErrors=k.allErrors,this.keyword=M,this.data=k.data,this.schema=k.schema[M],this.$data=q.$data&&k.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(k,this.schema,M,this.$data),this.schemaType=q.schemaType,this.parentSchema=k.schema,this.params={},this.it=k,this.def=q,this.$data)this.schemaCode=k.gen.const("vSchema",B(this.$data,k));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${M} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=k.gen.const("_errs",h.default.errors))}result(k,q,M){this.failResult((0,u.not)(k),q,M)}failResult(k,q,M){this.gen.if(k),M?M():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(k,q){this.failResult((0,u.not)(k),void 0,q)}fail(k){if(k===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(k),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(k){if(!this.$data)return this.fail(k);const{schemaCode:q}=this;this.fail((0,u._)`${q} !== undefined && (${(0,u.or)(this.invalid$data(),k)})`)}error(k,q,M){if(q){this.setParams(q),this._error(k,M),this.setParams({});return}this._error(k,M)}_error(k,q){(k?P.reportExtraError:P.reportError)(this,this.def.error,q)}$dataError(){(0,P.reportError)(this,this.def.$dataError||P.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,P.resetErrorsCount)(this.gen,this.errsCount)}ok(k){this.allErrors||this.gen.if(k)}setParams(k,q){q?Object.assign(this.params,k):this.params=k}block$data(k,q,M=u.nil){this.gen.block(()=>{this.check$data(k,M),q()})}check$data(k=u.nil,q=u.nil){if(!this.$data)return;const{gen:M,schemaCode:L,schemaType:W,def:ee}=this;M.if((0,u.or)((0,u._)`${L} === undefined`,q)),k!==u.nil&&M.assign(k,!0),(W.length||ee.validateSchema)&&(M.elseIf(this.invalid$data()),this.$dataError(),k!==u.nil&&M.assign(k,!1)),M.else()}invalid$data(){const{gen:k,schemaCode:q,schemaType:M,def:L,it:W}=this;return(0,u.or)(ee(),ce());function ee(){if(M.length){if(!(q instanceof u.Name))throw new Error("ajv implementation error");const ae=Array.isArray(M)?M:[M];return(0,u._)`${(0,c.checkDataTypes)(ae,q,W.opts.strictNumbers,c.DataType.Wrong)}`}return u.nil}function ce(){if(L.validateSchema){const ae=k.scopeValue("validate$data",{ref:L.validateSchema});return(0,u._)`!${ae}(${q})`}return u.nil}}subschema(k,q){const M=(0,l.getSubschema)(this.it,k);(0,l.extendSubschemaData)(M,this.it,k),(0,l.extendSubschemaMode)(M,k);const L={...this.it,...M,items:void 0,props:void 0};return o(L,q),L}mergeEvaluated(k,q){const{it:M,gen:L}=this;M.opts.unevaluated&&(M.props!==!0&&k.props!==void 0&&(M.props=_.mergeEvaluated.props(L,k.props,M.props,q)),M.items!==!0&&k.items!==void 0&&(M.items=_.mergeEvaluated.items(L,k.items,M.items,q)))}mergeValidEvaluated(k,q){const{it:M,gen:L}=this;if(M.opts.unevaluated&&(M.props!==!0||M.items!==!0))return L.if(q,()=>this.mergeEvaluated(k,u.Name)),!0}}me.KeywordCxt=I;function F(N,k,q,M){const L=new I(N,q,k);"code"in q?q.code(L,M):L.$data&&q.validate?(0,s.funcKeywordCode)(L,q):"macro"in q?(0,s.macroKeywordCode)(L,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(L,q)}const K=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(N,{dataLevel:k,dataNames:q,dataPathArr:M}){let L,W;if(N==="")return h.default.rootData;if(N[0]==="/"){if(!K.test(N))throw new Error(`Invalid JSON-pointer: ${N}`);L=N,W=h.default.rootData}else{const oe=Z.exec(N);if(!oe)throw new Error(`Invalid JSON-pointer: ${N}`);const te=+oe[1];if(L=oe[2],L==="#"){if(te>=k)throw new Error(ae("property/index",te));return M[k-te]}if(te>k)throw new Error(ae("data",te));if(W=q[k-te],!L)return W}let ee=W;const ce=L.split("/");for(const oe of ce)oe&&(W=(0,u._)`${W}${(0,u.getProperty)((0,_.unescapeJsonPointer)(oe))}`,ee=(0,u._)`${ee} && ${W}`);return ee;function ae(oe,te){return`Cannot access ${oe} ${te} levels up, current level is ${k}`}}return me.getData=B,me}var Ce={},_r;function Gt(){if(_r)return Ce;_r=1,Object.defineProperty(Ce,"__esModule",{value:!0});class e extends Error{constructor(m){super("validation failed"),this.errors=m,this.ajv=this.validation=!0}}return Ce.default=e,Ce}var De={},vr;function bt(){if(vr)return De;vr=1,Object.defineProperty(De,"__esModule",{value:!0});const e=$t();class t extends Error{constructor(c,b,s,l){super(l||`can't resolve reference ${s} from id ${b}`),this.missingRef=(0,e.resolveUrl)(c,b,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(c,this.missingRef))}}return De.default=t,De}var ie={},$r;function Ht(){if($r)return ie;$r=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.resolveSchema=ie.getCompilingSchema=ie.resolveRef=ie.compileSchema=ie.SchemaEnv=void 0;const e=H(),t=Gt(),m=$e(),c=$t(),b=Y(),s=wt();class l{constructor(i){var r;this.refs={},this.dynamicAnchors={};let o;typeof i.schema=="object"&&(o=i.schema),this.schema=i.schema,this.schemaId=i.schemaId,this.root=i.root||this,this.baseId=(r=i.baseId)!==null&&r!==void 0?r:(0,c.normalizeId)(o==null?void 0:o[i.schemaId||"$id"]),this.schemaPath=i.schemaPath,this.localRefs=i.localRefs,this.meta=i.meta,this.$async=o==null?void 0:o.$async,this.refs={}}}ie.SchemaEnv=l;function u(a){const i=_.call(this,a);if(i)return i;const r=(0,c.getFullPath)(this.opts.uriResolver,a.root.baseId),{es5:o,lines:p}=this.opts.code,{ownProperties:n}=this.opts,f=new e.CodeGen(this.scope,{es5:o,lines:p,ownProperties:n});let S;a.$async&&(S=f.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const T=f.scopeName("validate");a.validateName=T;const j={gen:f,allErrors:this.opts.allErrors,data:m.default.data,parentData:m.default.parentData,parentDataProperty:m.default.parentDataProperty,dataNames:[m.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",this.opts.code.source===!0?{ref:a.schema,code:(0,e.stringify)(a.schema)}:{ref:a.schema}),validateName:T,ValidationError:S,schema:a.schema,schemaEnv:a,rootId:r,baseId:a.baseId||r,schemaPath:e.nil,errSchemaPath:a.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let D;try{this._compilations.add(a),(0,s.validateFunctionCode)(j),f.optimize(this.opts.code.optimize);const z=f.toString();D=`${f.scopeRefs(m.default.scope)}return ${z}`,this.opts.code.process&&(D=this.opts.code.process(D,a));const U=new Function(`${m.default.self}`,`${m.default.scope}`,D)(this,this.scope.get());if(this.scope.value(T,{ref:U}),U.errors=null,U.schema=a.schema,U.schemaEnv=a,a.$async&&(U.$async=!0),this.opts.code.source===!0&&(U.source={validateName:T,validateCode:z,scopeValues:f._values}),this.opts.unevaluated){const{props:J,items:x}=j;U.evaluated={props:J instanceof e.Name?void 0:J,items:x instanceof e.Name?void 0:x,dynamicProps:J instanceof e.Name,dynamicItems:x instanceof e.Name},U.source&&(U.source.evaluated=(0,e.stringify)(U.evaluated))}return a.validate=U,a}catch(z){throw delete a.validate,delete a.validateName,D&&this.logger.error("Error compiling schema, function code:",D),z}finally{this._compilations.delete(a)}}ie.compileSchema=u;function h(a,i,r){var o;r=(0,c.resolveUrl)(this.opts.uriResolver,i,r);const p=a.refs[r];if(p)return p;let n=v.call(this,a,r);if(n===void 0){const f=(o=a.localRefs)===null||o===void 0?void 0:o[r],{schemaId:S}=this.opts;f&&(n=new l({schema:f,schemaId:S,root:a,baseId:i}))}if(n!==void 0)return a.refs[r]=$.call(this,n)}ie.resolveRef=h;function $(a){return(0,c.inlineRef)(a.schema,this.opts.inlineRefs)?a.schema:a.validate?a:u.call(this,a)}function _(a){for(const i of this._compilations)if(P(i,a))return i}ie.getCompilingSchema=_;function P(a,i){return a.schema===i.schema&&a.root===i.root&&a.baseId===i.baseId}function v(a,i){let r;for(;typeof(r=this.refs[i])=="string";)i=r;return r||this.schemas[i]||y.call(this,a,i)}function y(a,i){const r=this.opts.uriResolver.parse(i),o=(0,c._getFullPath)(this.opts.uriResolver,r);let p=(0,c.getFullPath)(this.opts.uriResolver,a.baseId,void 0);if(Object.keys(a.schema).length>0&&o===p)return w.call(this,r,a);const n=(0,c.normalizeId)(o),f=this.refs[n]||this.schemas[n];if(typeof f=="string"){const S=y.call(this,a,f);return typeof(S==null?void 0:S.schema)!="object"?void 0:w.call(this,r,S)}if(typeof(f==null?void 0:f.schema)=="object"){if(f.validate||u.call(this,f),n===(0,c.normalizeId)(i)){const{schema:S}=f,{schemaId:T}=this.opts,j=S[T];return j&&(p=(0,c.resolveUrl)(this.opts.uriResolver,p,j)),new l({schema:S,schemaId:T,root:a,baseId:p})}return w.call(this,r,f)}}ie.resolveSchema=y;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(a,{baseId:i,schema:r,root:o}){var p;if(((p=a.fragment)===null||p===void 0?void 0:p[0])!=="/")return;for(const S of a.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const T=r[(0,b.unescapeFragment)(S)];if(T===void 0)return;r=T;const j=typeof r=="object"&&r[this.opts.schemaId];!g.has(S)&&j&&(i=(0,c.resolveUrl)(this.opts.uriResolver,i,j))}let n;if(typeof r!="boolean"&&r.$ref&&!(0,b.schemaHasRulesButRef)(r,this.RULES)){const S=(0,c.resolveUrl)(this.opts.uriResolver,i,r.$ref);n=y.call(this,o,S)}const{schemaId:f}=this.opts;if(n=n||new l({schema:r,schemaId:f,root:o,baseId:i}),n.schema!==n.root.schema)return n}return ie}const Ln="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Kn="Meta-schema for $data reference (JSON AnySchema extension proposal)",Gn="object",Hn=["$data"],Jn={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Wn=!1,Bn={$id:Ln,description:Kn,type:Gn,required:Hn,properties:Jn,additionalProperties:Wn};var Ae={},Te={exports:{}},qt,wr;function bn(){if(wr)return qt;wr=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function m(v){let y="",g=0,w=0;for(w=0;w<v.length;w++)if(g=v[w].charCodeAt(0),g!==48){if(!(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102))return"";y+=v[w];break}for(w+=1;w<v.length;w++){if(g=v[w].charCodeAt(0),!(g>=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102))return"";y+=v[w]}return y}const c=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function b(v){return v.length=0,!0}function s(v,y,g){if(v.length){const w=m(v);if(w!=="")y.push(w);else return g.error=!0,!1;v.length=0}return!0}function l(v){let y=0;const g={error:!1,address:"",zone:""},w=[],a=[];let i=!1,r=!1,o=s;for(let p=0;p<v.length;p++){const n=v[p];if(!(n==="["||n==="]"))if(n===":"){if(i===!0&&(r=!0),!o(a,w,g))break;if(++y>7){g.error=!0;break}p>0&&v[p-1]===":"&&(i=!0),w.push(":");continue}else if(n==="%"){if(!o(a,w,g))break;o=b}else{a.push(n);continue}}return a.length&&(o===b?g.zone=a.join(""):r?w.push(a.join("")):w.push(m(a))),g.address=w.join(""),g}function u(v){if(h(v,":")<2)return{host:v,isIPV6:!1};const y=l(v);if(y.error)return{host:v,isIPV6:!1};{let g=y.address,w=y.address;return y.zone&&(g+="%"+y.zone,w+="%25"+y.zone),{host:g,isIPV6:!0,escapedHost:w}}}function h(v,y){let g=0;for(let w=0;w<v.length;w++)v[w]===y&&g++;return g}function $(v){let y=v;const g=[];let w=-1,a=0;for(;a=y.length;){if(a===1){if(y===".")break;if(y==="/"){g.push("/");break}else{g.push(y);break}}else if(a===2){if(y[0]==="."){if(y[1]===".")break;if(y[1]==="/"){y=y.slice(2);continue}}else if(y[0]==="/"&&(y[1]==="."||y[1]==="/")){g.push("/");break}}else if(a===3&&y==="/.."){g.length!==0&&g.pop(),g.push("/");break}if(y[0]==="."){if(y[1]==="."){if(y[2]==="/"){y=y.slice(3);continue}}else if(y[1]==="/"){y=y.slice(2);continue}}else if(y[0]==="/"&&y[1]==="."){if(y[2]==="/"){y=y.slice(2);continue}else if(y[2]==="."&&y[3]==="/"){y=y.slice(3),g.length!==0&&g.pop();continue}}if((w=y.indexOf("/",1))===-1){g.push(y);break}else g.push(y.slice(0,w)),y=y.slice(w)}return g.join("")}function _(v,y){const g=y!==!0?escape:unescape;return v.scheme!==void 0&&(v.scheme=g(v.scheme)),v.userinfo!==void 0&&(v.userinfo=g(v.userinfo)),v.host!==void 0&&(v.host=g(v.host)),v.path!==void 0&&(v.path=g(v.path)),v.query!==void 0&&(v.query=g(v.query)),v.fragment!==void 0&&(v.fragment=g(v.fragment)),v}function P(v){const y=[];if(v.userinfo!==void 0&&(y.push(v.userinfo),y.push("@")),v.host!==void 0){let g=unescape(v.host);if(!t(g)){const w=u(g);w.isIPV6===!0?g=`[${w.escapedHost}]`:g=v.host}y.push(g)}return(typeof v.port=="number"||typeof v.port=="string")&&(y.push(":"),y.push(String(v.port))),y.length?y.join(""):void 0}return qt={nonSimpleDomain:c,recomposeAuthority:P,normalizeComponentEncoding:_,removeDotSegments:$,isIPv4:t,isUUID:e,normalizeIPv6:u,stringArrayToHexStripped:m},qt}var Ct,br;function Yn(){if(br)return Ct;br=1;const{isUUID:e}=bn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,m=["http","https","ws","wss","urn","urn:uuid"];function c(n){return m.indexOf(n)!==-1}function b(n){return n.secure===!0?!0:n.secure===!1?!1:n.scheme?n.scheme.length===3&&(n.scheme[0]==="w"||n.scheme[0]==="W")&&(n.scheme[1]==="s"||n.scheme[1]==="S")&&(n.scheme[2]==="s"||n.scheme[2]==="S"):!1}function s(n){return n.host||(n.error=n.error||"HTTP URIs must have a host."),n}function l(n){const f=String(n.scheme).toLowerCase()==="https";return(n.port===(f?443:80)||n.port==="")&&(n.port=void 0),n.path||(n.path="/"),n}function u(n){return n.secure=b(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=void 0,n.query=void 0,n}function h(n){if((n.port===(b(n)?443:80)||n.port==="")&&(n.port=void 0),typeof n.secure=="boolean"&&(n.scheme=n.secure?"wss":"ws",n.secure=void 0),n.resourceName){const[f,S]=n.resourceName.split("?");n.path=f&&f!=="/"?f:void 0,n.query=S,n.resourceName=void 0}return n.fragment=void 0,n}function $(n,f){if(!n.path)return n.error="URN can not be parsed",n;const S=n.path.match(t);if(S){const T=f.scheme||n.scheme||"urn";n.nid=S[1].toLowerCase(),n.nss=S[2];const j=`${T}:${f.nid||n.nid}`,D=p(j);n.path=void 0,D&&(n=D.parse(n,f))}else n.error=n.error||"URN can not be parsed.";return n}function _(n,f){if(n.nid===void 0)throw new Error("URN without nid cannot be serialized");const S=f.scheme||n.scheme||"urn",T=n.nid.toLowerCase(),j=`${S}:${f.nid||T}`,D=p(j);D&&(n=D.serialize(n,f));const z=n,V=n.nss;return z.path=`${T||f.nid}:${V}`,f.skipEscape=!0,z}function P(n,f){const S=n;return S.uuid=S.nss,S.nss=void 0,!f.tolerant&&(!S.uuid||!e(S.uuid))&&(S.error=S.error||"UUID is not valid."),S}function v(n){const f=n;return f.nss=(n.uuid||"").toLowerCase(),f}const y={scheme:"http",domainHost:!0,parse:s,serialize:l},g={scheme:"https",domainHost:y.domainHost,parse:s,serialize:l},w={scheme:"ws",domainHost:!0,parse:u,serialize:h},a={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},o={http:y,https:g,ws:w,wss:a,urn:{scheme:"urn",parse:$,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:P,serialize:v,skipNormalize:!0}};Object.setPrototypeOf(o,null);function p(n){return n&&(o[n]||o[n.toLowerCase()])||void 0}return Ct={wsIsSecure:b,SCHEMES:o,isValidSchemeName:c,getSchemeHandler:p},Ct}var Sr;function Zn(){if(Sr)return Te.exports;Sr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:m,normalizeComponentEncoding:c,isIPv4:b,nonSimpleDomain:s}=bn(),{SCHEMES:l,getSchemeHandler:u}=Yn();function h(a,i){return typeof a=="string"?a=v(g(a,i),i):typeof a=="object"&&(a=g(v(a,i),i)),a}function $(a,i,r){const o=r?Object.assign({scheme:"null"},r):{scheme:"null"},p=_(g(a,o),g(i,o),o,!0);return o.skipEscape=!0,v(p,o)}function _(a,i,r,o){const p={};return o||(a=g(v(a,r),r),i=g(v(i,r),r)),r=r||{},!r.tolerant&&i.scheme?(p.scheme=i.scheme,p.userinfo=i.userinfo,p.host=i.host,p.port=i.port,p.path=t(i.path||""),p.query=i.query):(i.userinfo!==void 0||i.host!==void 0||i.port!==void 0?(p.userinfo=i.userinfo,p.host=i.host,p.port=i.port,p.path=t(i.path||""),p.query=i.query):(i.path?(i.path[0]==="/"?p.path=t(i.path):((a.userinfo!==void 0||a.host!==void 0||a.port!==void 0)&&!a.path?p.path="/"+i.path:a.path?p.path=a.path.slice(0,a.path.lastIndexOf("/")+1)+i.path:p.path=i.path,p.path=t(p.path)),p.query=i.query):(p.path=a.path,i.query!==void 0?p.query=i.query:p.query=a.query),p.userinfo=a.userinfo,p.host=a.host,p.port=a.port),p.scheme=a.scheme),p.fragment=i.fragment,p}function P(a,i,r){return typeof a=="string"?(a=unescape(a),a=v(c(g(a,r),!0),{...r,skipEscape:!0})):typeof a=="object"&&(a=v(c(a,!0),{...r,skipEscape:!0})),typeof i=="string"?(i=unescape(i),i=v(c(g(i,r),!0),{...r,skipEscape:!0})):typeof i=="object"&&(i=v(c(i,!0),{...r,skipEscape:!0})),a.toLowerCase()===i.toLowerCase()}function v(a,i){const r={host:a.host,scheme:a.scheme,userinfo:a.userinfo,port:a.port,path:a.path,query:a.query,nid:a.nid,nss:a.nss,uuid:a.uuid,fragment:a.fragment,reference:a.reference,resourceName:a.resourceName,secure:a.secure,error:""},o=Object.assign({},i),p=[],n=u(o.scheme||r.scheme);n&&n.serialize&&n.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&p.push(r.scheme,":");const f=m(r);if(f!==void 0&&(o.reference!=="suffix"&&p.push("//"),p.push(f),r.path&&r.path[0]!=="/"&&p.push("/")),r.path!==void 0){let S=r.path;!o.absolutePath&&(!n||!n.absolutePath)&&(S=t(S)),f===void 0&&S[0]==="/"&&S[1]==="/"&&(S="/%2F"+S.slice(2)),p.push(S)}return r.query!==void 0&&p.push("?",r.query),r.fragment!==void 0&&p.push("#",r.fragment),p.join("")}const y=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function g(a,i){const r=Object.assign({},i),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let p=!1;r.reference==="suffix"&&(r.scheme?a=r.scheme+":"+a:a="//"+a);const n=a.match(y);if(n){if(o.scheme=n[1],o.userinfo=n[3],o.host=n[4],o.port=parseInt(n[5],10),o.path=n[6]||"",o.query=n[7],o.fragment=n[8],isNaN(o.port)&&(o.port=n[5]),o.host)if(b(o.host)===!1){const T=e(o.host);o.host=T.host.toLowerCase(),p=T.isIPV6}else p=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");const f=u(r.scheme||o.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&o.host&&(r.domainHost||f&&f.domainHost)&&p===!1&&s(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(S){o.error=o.error||"Host's domain name can not be converted to ASCII: "+S}(!f||f&&!f.skipNormalize)&&(a.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),f&&f.parse&&f.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return o}const w={SCHEMES:l,normalize:h,resolve:$,resolveComponent:_,equal:P,serialize:v,parse:g};return Te.exports=w,Te.exports.default=w,Te.exports.fastUri=w,Te.exports}var Er;function Qn(){if(Er)return Ae;Er=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=Zn();return e.code='require("ajv/dist/runtime/uri").default',Ae.default=e,Ae}var Pr;function Xn(){return Pr||(Pr=1,(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=wt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var m=H();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});const c=Gt(),b=bt(),s=vn(),l=Ht(),u=H(),h=$t(),$=_t(),_=Y(),P=Bn,v=Qn(),y=(A,R)=>new RegExp(A,R);y.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),a={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."},i={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},r=200;function o(A){var R,C,O,d,E,I,F,K,Z,B,N,k,q,M,L,W,ee,ce,ae,oe,te,Ee,ue,St,Et;const ke=A.strict,Pt=(R=A.code)===null||R===void 0?void 0:R.optimize,Wt=Pt===!0||Pt===void 0?1:Pt||0,Bt=(O=(C=A.code)===null||C===void 0?void 0:C.regExp)!==null&&O!==void 0?O:y,On=(d=A.uriResolver)!==null&&d!==void 0?d:v.default;return{strictSchema:(I=(E=A.strictSchema)!==null&&E!==void 0?E:ke)!==null&&I!==void 0?I:!0,strictNumbers:(K=(F=A.strictNumbers)!==null&&F!==void 0?F:ke)!==null&&K!==void 0?K:!0,strictTypes:(B=(Z=A.strictTypes)!==null&&Z!==void 0?Z:ke)!==null&&B!==void 0?B:"log",strictTuples:(k=(N=A.strictTuples)!==null&&N!==void 0?N:ke)!==null&&k!==void 0?k:"log",strictRequired:(M=(q=A.strictRequired)!==null&&q!==void 0?q:ke)!==null&&M!==void 0?M:!1,code:A.code?{...A.code,optimize:Wt,regExp:Bt}:{optimize:Wt,regExp:Bt},loopRequired:(L=A.loopRequired)!==null&&L!==void 0?L:r,loopEnum:(W=A.loopEnum)!==null&&W!==void 0?W:r,meta:(ee=A.meta)!==null&&ee!==void 0?ee:!0,messages:(ce=A.messages)!==null&&ce!==void 0?ce:!0,inlineRefs:(ae=A.inlineRefs)!==null&&ae!==void 0?ae:!0,schemaId:(oe=A.schemaId)!==null&&oe!==void 0?oe:"$id",addUsedSchema:(te=A.addUsedSchema)!==null&&te!==void 0?te:!0,validateSchema:(Ee=A.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(ue=A.validateFormats)!==null&&ue!==void 0?ue:!0,unicodeRegExp:(St=A.unicodeRegExp)!==null&&St!==void 0?St:!0,int32range:(Et=A.int32range)!==null&&Et!==void 0?Et:!0,uriResolver:On}}class p{constructor(R={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,R=this.opts={...R,...o(R)};const{es5:C,lines:O}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:w,es5:C,lines:O}),this.logger=V(R.logger);const d=R.validateFormats;R.validateFormats=!1,this.RULES=(0,s.getRules)(),n.call(this,a,R,"NOT SUPPORTED"),n.call(this,i,R,"DEPRECATED","warn"),this._metaOpts=D.call(this),R.formats&&T.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),R.keywords&&j.call(this,R.keywords),typeof R.meta=="object"&&this.addMetaSchema(R.meta),S.call(this),R.validateFormats=d}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:R,meta:C,schemaId:O}=this.opts;let d=P;O==="id"&&(d={...P},d.id=d.$id,delete d.$id),C&&R&&this.addMetaSchema(d,d[O],!1)}defaultMeta(){const{meta:R,schemaId:C}=this.opts;return this.opts.defaultMeta=typeof R=="object"?R[C]||R:void 0}validate(R,C){let O;if(typeof R=="string"){if(O=this.getSchema(R),!O)throw new Error(`no schema with key or ref "${R}"`)}else O=this.compile(R);const d=O(C);return"$async"in O||(this.errors=O.errors),d}compile(R,C){const O=this._addSchema(R,C);return O.validate||this._compileSchemaEnv(O)}compileAsync(R,C){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:O}=this.opts;return d.call(this,R,C);async function d(B,N){await E.call(this,B.$schema);const k=this._addSchema(B,N);return k.validate||I.call(this,k)}async function E(B){B&&!this.getSchema(B)&&await d.call(this,{$ref:B},!0)}async function I(B){try{return this._compileSchemaEnv(B)}catch(N){if(!(N instanceof b.default))throw N;return F.call(this,N),await K.call(this,N.missingSchema),I.call(this,B)}}function F({missingSchema:B,missingRef:N}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${N} cannot be resolved`)}async function K(B){const N=await Z.call(this,B);this.refs[B]||await E.call(this,N.$schema),this.refs[B]||this.addSchema(N,B,C)}async function Z(B){const N=this._loading[B];if(N)return N;try{return await(this._loading[B]=O(B))}finally{delete this._loading[B]}}}addSchema(R,C,O,d=this.opts.validateSchema){if(Array.isArray(R)){for(const I of R)this.addSchema(I,void 0,O,d);return this}let E;if(typeof R=="object"){const{schemaId:I}=this.opts;if(E=R[I],E!==void 0&&typeof E!="string")throw new Error(`schema ${I} must be string`)}return C=(0,h.normalizeId)(C||E),this._checkUnique(C),this.schemas[C]=this._addSchema(R,O,C,d,!0),this}addMetaSchema(R,C,O=this.opts.validateSchema){return this.addSchema(R,C,!0,O),this}validateSchema(R,C){if(typeof R=="boolean")return!0;let O;if(O=R.$schema,O!==void 0&&typeof O!="string")throw new Error("$schema must be a string");if(O=O||this.opts.defaultMeta||this.defaultMeta(),!O)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const d=this.validate(O,R);if(!d&&C){const E="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(E);else throw new Error(E)}return d}getSchema(R){let C;for(;typeof(C=f.call(this,R))=="string";)R=C;if(C===void 0){const{schemaId:O}=this.opts,d=new l.SchemaEnv({schema:{},schemaId:O});if(C=l.resolveSchema.call(this,d,R),!C)return;this.refs[R]=C}return C.validate||this._compileSchemaEnv(C)}removeSchema(R){if(R instanceof RegExp)return this._removeAllSchemas(this.schemas,R),this._removeAllSchemas(this.refs,R),this;switch(typeof R){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const C=f.call(this,R);return typeof C=="object"&&this._cache.delete(C.schema),delete this.schemas[R],delete this.refs[R],this}case"object":{const C=R;this._cache.delete(C);let O=R[this.opts.schemaId];return O&&(O=(0,h.normalizeId)(O),delete this.schemas[O],delete this.refs[O]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(R){for(const C of R)this.addKeyword(C);return this}addKeyword(R,C){let O;if(typeof R=="string")O=R,typeof C=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),C.keyword=O);else if(typeof R=="object"&&C===void 0){if(C=R,O=C.keyword,Array.isArray(O)&&!O.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(J.call(this,O,C),!C)return(0,_.eachItem)(O,E=>x.call(this,E)),this;he.call(this,C);const d={...C,type:(0,$.getJSONTypes)(C.type),schemaType:(0,$.getJSONTypes)(C.schemaType)};return(0,_.eachItem)(O,d.type.length===0?E=>x.call(this,E,d):E=>d.type.forEach(I=>x.call(this,E,d,I))),this}getKeyword(R){const C=this.RULES.all[R];return typeof C=="object"?C.definition:!!C}removeKeyword(R){const{RULES:C}=this;delete C.keywords[R],delete C.all[R];for(const O of C.rules){const d=O.rules.findIndex(E=>E.keyword===R);d>=0&&O.rules.splice(d,1)}return this}addFormat(R,C){return typeof C=="string"&&(C=new RegExp(C)),this.formats[R]=C,this}errorsText(R=this.errors,{separator:C=", ",dataVar:O="data"}={}){return!R||R.length===0?"No errors":R.map(d=>`${O}${d.instancePath} ${d.message}`).reduce((d,E)=>d+C+E)}$dataMetaSchema(R,C){const O=this.RULES.all;R=JSON.parse(JSON.stringify(R));for(const d of C){const E=d.split("/").slice(1);let I=R;for(const F of E)I=I[F];for(const F in O){const K=O[F];if(typeof K!="object")continue;const{$data:Z}=K.definition,B=I[F];Z&&B&&(I[F]=_e(B))}}return R}_removeAllSchemas(R,C){for(const O in R){const d=R[O];(!C||C.test(O))&&(typeof d=="string"?delete R[O]:d&&!d.meta&&(this._cache.delete(d.schema),delete R[O]))}}_addSchema(R,C,O,d=this.opts.validateSchema,E=this.opts.addUsedSchema){let I;const{schemaId:F}=this.opts;if(typeof R=="object")I=R[F];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof R!="boolean")throw new Error("schema must be object or boolean")}let K=this._cache.get(R);if(K!==void 0)return K;O=(0,h.normalizeId)(I||O);const Z=h.getSchemaRefs.call(this,R,O);return K=new l.SchemaEnv({schema:R,schemaId:F,meta:C,baseId:O,localRefs:Z}),this._cache.set(K.schema,K),E&&!O.startsWith("#")&&(O&&this._checkUnique(O),this.refs[O]=K),d&&this.validateSchema(R,!0),K}_checkUnique(R){if(this.schemas[R]||this.refs[R])throw new Error(`schema with key or id "${R}" already exists`)}_compileSchemaEnv(R){if(R.meta?this._compileMetaSchema(R):l.compileSchema.call(this,R),!R.validate)throw new Error("ajv implementation error");return R.validate}_compileMetaSchema(R){const C=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,R)}finally{this.opts=C}}}p.ValidationError=c.default,p.MissingRefError=b.default,e.default=p;function n(A,R,C,O="error"){for(const d in A){const E=d;E in R&&this.logger[O](`${C}: option ${d}. ${A[E]}`)}}function f(A){return A=(0,h.normalizeId)(A),this.schemas[A]||this.refs[A]}function S(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const R in A)this.addSchema(A[R],R)}function T(){for(const A in this.opts.formats){const R=this.opts.formats[A];R&&this.addFormat(A,R)}}function j(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const R in A){const C=A[R];C.keyword||(C.keyword=R),this.addKeyword(C)}}function D(){const A={...this.opts};for(const R of g)delete A[R];return A}const z={log(){},warn(){},error(){}};function V(A){if(A===!1)return z;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function J(A,R){const{RULES:C}=this;if((0,_.eachItem)(A,O=>{if(C.keywords[O])throw new Error(`Keyword ${O} is already defined`);if(!U.test(O))throw new Error(`Keyword ${O} has invalid name`)}),!!R&&R.$data&&!("code"in R||"validate"in R))throw new Error('$data keyword must have "code" or "validate" function')}function x(A,R,C){var O;const d=R==null?void 0:R.post;if(C&&d)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:E}=this;let I=d?E.post:E.rules.find(({type:K})=>K===C);if(I||(I={type:C,rules:[]},E.rules.push(I)),E.keywords[A]=!0,!R)return;const F={keyword:A,definition:{...R,type:(0,$.getJSONTypes)(R.type),schemaType:(0,$.getJSONTypes)(R.schemaType)}};R.before?fe.call(this,I,F,R.before):I.rules.push(F),E.all[A]=F,(O=R.implements)===null||O===void 0||O.forEach(K=>this.addKeyword(K))}function fe(A,R,C){const O=A.rules.findIndex(d=>d.keyword===C);O>=0?A.rules.splice(O,0,R):(A.rules.push(R),this.logger.warn(`rule ${C} is not defined`))}function he(A){let{metaSchema:R}=A;R!==void 0&&(A.$data&&this.opts.$data&&(R=_e(R)),A.validateSchema=this.compile(R,!0))}const X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function _e(A){return{anyOf:[A,X]}}})(Nt)),Nt}var Me={},ze={},Ve={},Nr;function xn(){if(Nr)return Ve;Nr=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ve.default=e,Ve}var ve={},Rr;function es(){if(Rr)return ve;Rr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.callRef=ve.getValidate=void 0;const e=bt(),t=le(),m=H(),c=$e(),b=Ht(),s=Y(),l={keyword:"$ref",schemaType:"string",code($){const{gen:_,schema:P,it:v}=$,{baseId:y,schemaEnv:g,validateName:w,opts:a,self:i}=v,{root:r}=g;if((P==="#"||P==="#/")&&y===r.baseId)return p();const o=b.resolveRef.call(i,r,y,P);if(o===void 0)throw new e.default(v.opts.uriResolver,y,P);if(o instanceof b.SchemaEnv)return n(o);return f(o);function p(){if(g===r)return h($,w,g,g.$async);const S=_.scopeValue("root",{ref:r});return h($,(0,m._)`${S}.validate`,r,r.$async)}function n(S){const T=u($,S);h($,T,S,S.$async)}function f(S){const T=_.scopeValue("schema",a.code.source===!0?{ref:S,code:(0,m.stringify)(S)}:{ref:S}),j=_.name("valid"),D=$.subschema({schema:S,dataTypes:[],schemaPath:m.nil,topSchemaRef:T,errSchemaPath:P},j);$.mergeEvaluated(D),$.ok(j)}}};function u($,_){const{gen:P}=$;return _.validate?P.scopeValue("validate",{ref:_.validate}):(0,m._)`${P.scopeValue("wrapper",{ref:_})}.validate`}ve.getValidate=u;function h($,_,P,v){const{gen:y,it:g}=$,{allErrors:w,schemaEnv:a,opts:i}=g,r=i.passContext?c.default.this:m.nil;v?o():p();function o(){if(!a.$async)throw new Error("async schema referenced by sync schema");const S=y.let("valid");y.try(()=>{y.code((0,m._)`await ${(0,t.callValidateCode)($,_,r)}`),f(_),w||y.assign(S,!0)},T=>{y.if((0,m._)`!(${T} instanceof ${g.ValidationError})`,()=>y.throw(T)),n(T),w||y.assign(S,!1)}),$.ok(S)}function p(){$.result((0,t.callValidateCode)($,_,r),()=>f(_),()=>n(_))}function n(S){const T=(0,m._)`${S}.errors`;y.assign(c.default.vErrors,(0,m._)`${c.default.vErrors} === null ? ${T} : ${c.default.vErrors}.concat(${T})`),y.assign(c.default.errors,(0,m._)`${c.default.vErrors}.length`)}function f(S){var T;if(!g.opts.unevaluated)return;const j=(T=P==null?void 0:P.validate)===null||T===void 0?void 0:T.evaluated;if(g.props!==!0)if(j&&!j.dynamicProps)j.props!==void 0&&(g.props=s.mergeEvaluated.props(y,j.props,g.props));else{const D=y.var("props",(0,m._)`${S}.evaluated.props`);g.props=s.mergeEvaluated.props(y,D,g.props,m.Name)}if(g.items!==!0)if(j&&!j.dynamicItems)j.items!==void 0&&(g.items=s.mergeEvaluated.items(y,j.items,g.items));else{const D=y.var("items",(0,m._)`${S}.evaluated.items`);g.items=s.mergeEvaluated.items(y,D,g.items,m.Name)}}}return ve.callRef=h,ve.default=l,ve}var kr;function ts(){if(kr)return ze;kr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=xn(),t=es(),m=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return ze.default=m,ze}var Fe={},Ue={},Or;function rs(){if(Or)return Ue;Or=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e=H(),t=e.operators,m={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},c={message:({keyword:s,schemaCode:l})=>(0,e.str)`must be ${m[s].okStr} ${l}`,params:({keyword:s,schemaCode:l})=>(0,e._)`{comparison: ${m[s].okStr}, limit: ${l}}`},b={keyword:Object.keys(m),type:"number",schemaType:"number",$data:!0,error:c,code(s){const{keyword:l,data:u,schemaCode:h}=s;s.fail$data((0,e._)`${u} ${m[l].fail} ${h} || isNaN(${u})`)}};return Ue.default=b,Ue}var Le={},Tr;function ns(){if(Tr)return Le;Tr=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=H(),m={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:c})=>(0,e.str)`must be multiple of ${c}`,params:({schemaCode:c})=>(0,e._)`{multipleOf: ${c}}`},code(c){const{gen:b,data:s,schemaCode:l,it:u}=c,h=u.opts.multipleOfPrecision,$=b.let("res"),_=h?(0,e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${h}`:(0,e._)`${$} !== parseInt(${$})`;c.fail$data((0,e._)`(${l} === 0 || (${$} = ${s}/${l}, ${_}))`)}};return Le.default=m,Le}var Ke={},Ge={},jr;function ss(){if(jr)return Ge;jr=1,Object.defineProperty(Ge,"__esModule",{value:!0});function e(t){const m=t.length;let c=0,b=0,s;for(;b<m;)c++,s=t.charCodeAt(b++),s>=55296&&s<=56319&&b<m&&(s=t.charCodeAt(b),(s&64512)===56320&&b++);return c}return Ge.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Ge}var Ir;function as(){if(Ir)return Ke;Ir=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=H(),t=Y(),m=ss(),b={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:l}){const u=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${u} than ${l} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:l,data:u,schemaCode:h,it:$}=s,_=l==="maxLength"?e.operators.GT:e.operators.LT,P=$.opts.unicode===!1?(0,e._)`${u}.length`:(0,e._)`${(0,t.useFunc)(s.gen,m.default)}(${u})`;s.fail$data((0,e._)`${P} ${_} ${h}`)}};return Ke.default=b,Ke}var He={},qr;function os(){if(qr)return He;qr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=le(),t=Y(),m=H(),b={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,m.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,m._)`{pattern: ${s}}`},code(s){const{gen:l,data:u,$data:h,schema:$,schemaCode:_,it:P}=s,v=P.opts.unicodeRegExp?"u":"";if(h){const{regExp:y}=P.opts.code,g=y.code==="new RegExp"?(0,m._)`new RegExp`:(0,t.useFunc)(l,y),w=l.let("valid");l.try(()=>l.assign(w,(0,m._)`${g}(${_}, ${v}).test(${u})`),()=>l.assign(w,!1)),s.fail$data((0,m._)`!${w}`)}else{const y=(0,e.usePattern)(s,$);s.fail$data((0,m._)`!${y}.test(${u})`)}}};return He.default=b,He}var Je={},Cr;function is(){if(Cr)return Je;Cr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=H(),m={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:c,schemaCode:b}){const s=c==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${b} properties`},params:({schemaCode:c})=>(0,e._)`{limit: ${c}}`},code(c){const{keyword:b,data:s,schemaCode:l}=c,u=b==="maxProperties"?e.operators.GT:e.operators.LT;c.fail$data((0,e._)`Object.keys(${s}).length ${u} ${l}`)}};return Je.default=m,Je}var We={},Dr;function us(){if(Dr)return We;Dr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=le(),t=H(),m=Y(),b={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:l,schema:u,schemaCode:h,data:$,$data:_,it:P}=s,{opts:v}=P;if(!_&&u.length===0)return;const y=u.length>=v.loopRequired;if(P.allErrors?g():w(),v.strictRequired){const r=s.parentSchema.properties,{definedProperties:o}=s.it;for(const p of u)if((r==null?void 0:r[p])===void 0&&!o.has(p)){const n=P.schemaEnv.baseId+P.errSchemaPath,f=`required property "${p}" is not defined at "${n}" (strictRequired)`;(0,m.checkStrictMode)(P,f,P.opts.strictRequired)}}function g(){if(y||_)s.block$data(t.nil,a);else for(const r of u)(0,e.checkReportMissingProp)(s,r)}function w(){const r=l.let("missing");if(y||_){const o=l.let("valid",!0);s.block$data(o,()=>i(r,o)),s.ok(o)}else l.if((0,e.checkMissingProp)(s,u,r)),(0,e.reportMissingProp)(s,r),l.else()}function a(){l.forOf("prop",h,r=>{s.setParams({missingProperty:r}),l.if((0,e.noPropertyInData)(l,$,r,v.ownProperties),()=>s.error())})}function i(r,o){s.setParams({missingProperty:r}),l.forOf(r,h,()=>{l.assign(o,(0,e.propertyInData)(l,$,r,v.ownProperties)),l.if((0,t.not)(o),()=>{s.error(),l.break()})},t.nil)}}};return We.default=b,We}var Be={},Ar;function cs(){if(Ar)return Be;Ar=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=H(),m={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:c,schemaCode:b}){const s=c==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${b} items`},params:({schemaCode:c})=>(0,e._)`{limit: ${c}}`},code(c){const{keyword:b,data:s,schemaCode:l}=c,u=b==="maxItems"?e.operators.GT:e.operators.LT;c.fail$data((0,e._)`${s}.length ${u} ${l}`)}};return Be.default=m,Be}var Ye={},Ze={},Mr;function Jt(){if(Mr)return Ze;Mr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=wn();return e.code='require("ajv/dist/runtime/equal").default',Ze.default=e,Ze}var zr;function ds(){if(zr)return Ye;zr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=_t(),t=H(),m=Y(),c=Jt(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:l,j:u}})=>(0,t.str)`must NOT have duplicate items (items ## ${u} and ${l} are identical)`,params:({params:{i:l,j:u}})=>(0,t._)`{i: ${l}, j: ${u}}`},code(l){const{gen:u,data:h,$data:$,schema:_,parentSchema:P,schemaCode:v,it:y}=l;if(!$&&!_)return;const g=u.let("valid"),w=P.items?(0,e.getSchemaTypes)(P.items):[];l.block$data(g,a,(0,t._)`${v} === false`),l.ok(g);function a(){const p=u.let("i",(0,t._)`${h}.length`),n=u.let("j");l.setParams({i:p,j:n}),u.assign(g,!0),u.if((0,t._)`${p} > 1`,()=>(i()?r:o)(p,n))}function i(){return w.length>0&&!w.some(p=>p==="object"||p==="array")}function r(p,n){const f=u.name("item"),S=(0,e.checkDataTypes)(w,f,y.opts.strictNumbers,e.DataType.Wrong),T=u.const("indices",(0,t._)`{}`);u.for((0,t._)`;${p}--;`,()=>{u.let(f,(0,t._)`${h}[${p}]`),u.if(S,(0,t._)`continue`),w.length>1&&u.if((0,t._)`typeof ${f} == "string"`,(0,t._)`${f} += "_"`),u.if((0,t._)`typeof ${T}[${f}] == "number"`,()=>{u.assign(n,(0,t._)`${T}[${f}]`),l.error(),u.assign(g,!1).break()}).code((0,t._)`${T}[${f}] = ${p}`)})}function o(p,n){const f=(0,m.useFunc)(u,c.default),S=u.name("outer");u.label(S).for((0,t._)`;${p}--;`,()=>u.for((0,t._)`${n} = ${p}; ${n}--;`,()=>u.if((0,t._)`${f}(${h}[${p}], ${h}[${n}])`,()=>{l.error(),u.assign(g,!1).break(S)})))}}};return Ye.default=s,Ye}var Qe={},Vr;function ls(){if(Vr)return Qe;Vr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=H(),t=Y(),m=Jt(),b={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:l,data:u,$data:h,schemaCode:$,schema:_}=s;h||_&&typeof _=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(l,m.default)}(${u}, ${$})`):s.fail((0,e._)`${_} !== ${u}`)}};return Qe.default=b,Qe}var Xe={},Fr;function fs(){if(Fr)return Xe;Fr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=H(),t=Y(),m=Jt(),b={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:l,data:u,$data:h,schema:$,schemaCode:_,it:P}=s;if(!h&&$.length===0)throw new Error("enum must have non-empty array");const v=$.length>=P.opts.loopEnum;let y;const g=()=>y??(y=(0,t.useFunc)(l,m.default));let w;if(v||h)w=l.let("valid"),s.block$data(w,a);else{if(!Array.isArray($))throw new Error("ajv implementation error");const r=l.const("vSchema",_);w=(0,e.or)(...$.map((o,p)=>i(r,p)))}s.pass(w);function a(){l.assign(w,!1),l.forOf("v",_,r=>l.if((0,e._)`${g()}(${u}, ${r})`,()=>l.assign(w,!0).break()))}function i(r,o){const p=$[o];return typeof p=="object"&&p!==null?(0,e._)`${g()}(${u}, ${r}[${o}])`:(0,e._)`${u} === ${p}`}}};return Xe.default=b,Xe}var Ur;function hs(){if(Ur)return Fe;Ur=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=rs(),t=ns(),m=as(),c=os(),b=is(),s=us(),l=cs(),u=ds(),h=ls(),$=fs(),_=[e.default,t.default,m.default,c.default,b.default,s.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},h.default,$.default];return Fe.default=_,Fe}var xe={},Pe={},Lr;function Sn(){if(Lr)return Pe;Lr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.validateAdditionalItems=void 0;const e=H(),t=Y(),c={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:l,it:u}=s,{items:h}=l;if(!Array.isArray(h)){(0,t.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}b(s,h)}};function b(s,l){const{gen:u,schema:h,data:$,keyword:_,it:P}=s;P.items=!0;const v=u.const("len",(0,e._)`${$}.length`);if(h===!1)s.setParams({len:l.length}),s.pass((0,e._)`${v} <= ${l.length}`);else if(typeof h=="object"&&!(0,t.alwaysValidSchema)(P,h)){const g=u.var("valid",(0,e._)`${v} <= ${l.length}`);u.if((0,e.not)(g),()=>y(g)),s.ok(g)}function y(g){u.forRange("i",l.length,v,w=>{s.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},g),P.allErrors||u.if((0,e.not)(g),()=>u.break())})}}return Pe.validateAdditionalItems=b,Pe.default=c,Pe}var et={},Ne={},Kr;function En(){if(Kr)return Ne;Kr=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.validateTuple=void 0;const e=H(),t=Y(),m=le(),c={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:l,it:u}=s;if(Array.isArray(l))return b(s,"additionalItems",l);u.items=!0,!(0,t.alwaysValidSchema)(u,l)&&s.ok((0,m.validateArray)(s))}};function b(s,l,u=s.schema){const{gen:h,parentSchema:$,data:_,keyword:P,it:v}=s;w($),v.opts.unevaluated&&u.length&&v.items!==!0&&(v.items=t.mergeEvaluated.items(h,u.length,v.items));const y=h.name("valid"),g=h.const("len",(0,e._)`${_}.length`);u.forEach((a,i)=>{(0,t.alwaysValidSchema)(v,a)||(h.if((0,e._)`${g} > ${i}`,()=>s.subschema({keyword:P,schemaProp:i,dataProp:i},y)),s.ok(y))});function w(a){const{opts:i,errSchemaPath:r}=v,o=u.length,p=o===a.minItems&&(o===a.maxItems||a[l]===!1);if(i.strictTuples&&!p){const n=`"${P}" is ${o}-tuple, but minItems or maxItems/${l} are not specified or different at path "${r}"`;(0,t.checkStrictMode)(v,n,i.strictTuples)}}}return Ne.validateTuple=b,Ne.default=c,Ne}var Gr;function ms(){if(Gr)return et;Gr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=En(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:m=>(0,e.validateTuple)(m,"items")};return et.default=t,et}var tt={},Hr;function ps(){if(Hr)return tt;Hr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=H(),t=Y(),m=le(),c=Sn(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:l}})=>(0,e.str)`must NOT have more than ${l} items`,params:({params:{len:l}})=>(0,e._)`{limit: ${l}}`},code(l){const{schema:u,parentSchema:h,it:$}=l,{prefixItems:_}=h;$.items=!0,!(0,t.alwaysValidSchema)($,u)&&(_?(0,c.validateAdditionalItems)(l,_):l.ok((0,m.validateArray)(l)))}};return tt.default=s,tt}var rt={},Jr;function ys(){if(Jr)return rt;Jr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=H(),t=Y(),c={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:b,max:s}})=>s===void 0?(0,e.str)`must contain at least ${b} valid item(s)`:(0,e.str)`must contain at least ${b} and no more than ${s} valid item(s)`,params:({params:{min:b,max:s}})=>s===void 0?(0,e._)`{minContains: ${b}}`:(0,e._)`{minContains: ${b}, maxContains: ${s}}`},code(b){const{gen:s,schema:l,parentSchema:u,data:h,it:$}=b;let _,P;const{minContains:v,maxContains:y}=u;$.opts.next?(_=v===void 0?1:v,P=y):_=1;const g=s.const("len",(0,e._)`${h}.length`);if(b.setParams({min:_,max:P}),P===void 0&&_===0){(0,t.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(P!==void 0&&_>P){(0,t.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),b.fail();return}if((0,t.alwaysValidSchema)($,l)){let o=(0,e._)`${g} >= ${_}`;P!==void 0&&(o=(0,e._)`${o} && ${g} <= ${P}`),b.pass(o);return}$.items=!0;const w=s.name("valid");P===void 0&&_===1?i(w,()=>s.if(w,()=>s.break())):_===0?(s.let(w,!0),P!==void 0&&s.if((0,e._)`${h}.length > 0`,a)):(s.let(w,!1),a()),b.result(w,()=>b.reset());function a(){const o=s.name("_valid"),p=s.let("count",0);i(o,()=>s.if(o,()=>r(p)))}function i(o,p){s.forRange("i",0,g,n=>{b.subschema({keyword:"contains",dataProp:n,dataPropType:t.Type.Num,compositeRule:!0},o),p()})}function r(o){s.code((0,e._)`${o}++`),P===void 0?s.if((0,e._)`${o} >= ${_}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${o} > ${P}`,()=>s.assign(w,!1).break()),_===1?s.assign(w,!0):s.if((0,e._)`${o} >= ${_}`,()=>s.assign(w,!0)))}}};return rt.default=c,rt}var Dt={},Wr;function gs(){return Wr||(Wr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=H(),m=Y(),c=le();e.error={message:({params:{property:h,depsCount:$,deps:_}})=>{const P=$===1?"property":"properties";return(0,t.str)`must have ${P} ${_} when property ${h} is present`},params:({params:{property:h,depsCount:$,deps:_,missingProperty:P}})=>(0,t._)`{property: ${h},
16
- missingProperty: ${P},
17
- depsCount: ${$},
18
- deps: ${_}}`};const b={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(h){const[$,_]=s(h);l(h,$),u(h,_)}};function s({schema:h}){const $={},_={};for(const P in h){if(P==="__proto__")continue;const v=Array.isArray(h[P])?$:_;v[P]=h[P]}return[$,_]}function l(h,$=h.schema){const{gen:_,data:P,it:v}=h;if(Object.keys($).length===0)return;const y=_.let("missing");for(const g in $){const w=$[g];if(w.length===0)continue;const a=(0,c.propertyInData)(_,P,g,v.opts.ownProperties);h.setParams({property:g,depsCount:w.length,deps:w.join(", ")}),v.allErrors?_.if(a,()=>{for(const i of w)(0,c.checkReportMissingProp)(h,i)}):(_.if((0,t._)`${a} && (${(0,c.checkMissingProp)(h,w,y)})`),(0,c.reportMissingProp)(h,y),_.else())}}e.validatePropertyDeps=l;function u(h,$=h.schema){const{gen:_,data:P,keyword:v,it:y}=h,g=_.name("valid");for(const w in $)(0,m.alwaysValidSchema)(y,$[w])||(_.if((0,c.propertyInData)(_,P,w,y.opts.ownProperties),()=>{const a=h.subschema({keyword:v,schemaProp:w},g);h.mergeValidEvaluated(a,g)},()=>_.var(g,!0)),h.ok(g))}e.validateSchemaDeps=u,e.default=b})(Dt)),Dt}var nt={},Br;function _s(){if(Br)return nt;Br=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=H(),t=Y(),c={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:b})=>(0,e._)`{propertyName: ${b.propertyName}}`},code(b){const{gen:s,schema:l,data:u,it:h}=b;if((0,t.alwaysValidSchema)(h,l))return;const $=s.name("valid");s.forIn("key",u,_=>{b.setParams({propertyName:_}),b.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},$),s.if((0,e.not)($),()=>{b.error(!0),h.allErrors||s.break()})}),b.ok($)}};return nt.default=c,nt}var st={},Yr;function Pn(){if(Yr)return st;Yr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=le(),t=H(),m=$e(),c=Y(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:l})=>(0,t._)`{additionalProperty: ${l.additionalProperty}}`},code(l){const{gen:u,schema:h,parentSchema:$,data:_,errsCount:P,it:v}=l;if(!P)throw new Error("ajv implementation error");const{allErrors:y,opts:g}=v;if(v.props=!0,g.removeAdditional!=="all"&&(0,c.alwaysValidSchema)(v,h))return;const w=(0,e.allSchemaProperties)($.properties),a=(0,e.allSchemaProperties)($.patternProperties);i(),l.ok((0,t._)`${P} === ${m.default.errors}`);function i(){u.forIn("key",_,f=>{!w.length&&!a.length?p(f):u.if(r(f),()=>p(f))})}function r(f){let S;if(w.length>8){const T=(0,c.schemaRefOrVal)(v,$.properties,"properties");S=(0,e.isOwnProperty)(u,T,f)}else w.length?S=(0,t.or)(...w.map(T=>(0,t._)`${f} === ${T}`)):S=t.nil;return a.length&&(S=(0,t.or)(S,...a.map(T=>(0,t._)`${(0,e.usePattern)(l,T)}.test(${f})`))),(0,t.not)(S)}function o(f){u.code((0,t._)`delete ${_}[${f}]`)}function p(f){if(g.removeAdditional==="all"||g.removeAdditional&&h===!1){o(f);return}if(h===!1){l.setParams({additionalProperty:f}),l.error(),y||u.break();return}if(typeof h=="object"&&!(0,c.alwaysValidSchema)(v,h)){const S=u.name("valid");g.removeAdditional==="failing"?(n(f,S,!1),u.if((0,t.not)(S),()=>{l.reset(),o(f)})):(n(f,S),y||u.if((0,t.not)(S),()=>u.break()))}}function n(f,S,T){const j={keyword:"additionalProperties",dataProp:f,dataPropType:c.Type.Str};T===!1&&Object.assign(j,{compositeRule:!0,createErrors:!1,allErrors:!1}),l.subschema(j,S)}}};return st.default=s,st}var at={},Zr;function vs(){if(Zr)return at;Zr=1,Object.defineProperty(at,"__esModule",{value:!0});const e=wt(),t=le(),m=Y(),c=Pn(),b={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:l,schema:u,parentSchema:h,data:$,it:_}=s;_.opts.removeAdditional==="all"&&h.additionalProperties===void 0&&c.default.code(new e.KeywordCxt(_,c.default,"additionalProperties"));const P=(0,t.allSchemaProperties)(u);for(const a of P)_.definedProperties.add(a);_.opts.unevaluated&&P.length&&_.props!==!0&&(_.props=m.mergeEvaluated.props(l,(0,m.toHash)(P),_.props));const v=P.filter(a=>!(0,m.alwaysValidSchema)(_,u[a]));if(v.length===0)return;const y=l.name("valid");for(const a of v)g(a)?w(a):(l.if((0,t.propertyInData)(l,$,a,_.opts.ownProperties)),w(a),_.allErrors||l.else().var(y,!0),l.endIf()),s.it.definedProperties.add(a),s.ok(y);function g(a){return _.opts.useDefaults&&!_.compositeRule&&u[a].default!==void 0}function w(a){s.subschema({keyword:"properties",schemaProp:a,dataProp:a},y)}}};return at.default=b,at}var ot={},Qr;function $s(){if(Qr)return ot;Qr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=le(),t=H(),m=Y(),c=Y(),b={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:l,schema:u,data:h,parentSchema:$,it:_}=s,{opts:P}=_,v=(0,e.allSchemaProperties)(u),y=v.filter(p=>(0,m.alwaysValidSchema)(_,u[p]));if(v.length===0||y.length===v.length&&(!_.opts.unevaluated||_.props===!0))return;const g=P.strictSchema&&!P.allowMatchingProperties&&$.properties,w=l.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,c.evaluatedPropsToName)(l,_.props));const{props:a}=_;i();function i(){for(const p of v)g&&r(p),_.allErrors?o(p):(l.var(w,!0),o(p),l.if(w))}function r(p){for(const n in g)new RegExp(p).test(n)&&(0,m.checkStrictMode)(_,`property ${n} matches pattern ${p} (use allowMatchingProperties)`)}function o(p){l.forIn("key",h,n=>{l.if((0,t._)`${(0,e.usePattern)(s,p)}.test(${n})`,()=>{const f=y.includes(p);f||s.subschema({keyword:"patternProperties",schemaProp:p,dataProp:n,dataPropType:c.Type.Str},w),_.opts.unevaluated&&a!==!0?l.assign((0,t._)`${a}[${n}]`,!0):!f&&!_.allErrors&&l.if((0,t.not)(w),()=>l.break())})})}}};return ot.default=b,ot}var it={},Xr;function ws(){if(Xr)return it;Xr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(m){const{gen:c,schema:b,it:s}=m;if((0,e.alwaysValidSchema)(s,b)){m.fail();return}const l=c.name("valid");m.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),m.failResult(l,()=>m.reset(),()=>m.error())},error:{message:"must NOT be valid"}};return it.default=t,it}var ut={},xr;function bs(){if(xr)return ut;xr=1,Object.defineProperty(ut,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:le().validateUnion,error:{message:"must match a schema in anyOf"}};return ut.default=t,ut}var ct={},en;function Ss(){if(en)return ct;en=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=H(),t=Y(),c={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:b})=>(0,e._)`{passingSchemas: ${b.passing}}`},code(b){const{gen:s,schema:l,parentSchema:u,it:h}=b;if(!Array.isArray(l))throw new Error("ajv implementation error");if(h.opts.discriminator&&u.discriminator)return;const $=l,_=s.let("valid",!1),P=s.let("passing",null),v=s.name("_valid");b.setParams({passing:P}),s.block(y),b.result(_,()=>b.reset(),()=>b.error(!0));function y(){$.forEach((g,w)=>{let a;(0,t.alwaysValidSchema)(h,g)?s.var(v,!0):a=b.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},v),w>0&&s.if((0,e._)`${v} && ${_}`).assign(_,!1).assign(P,(0,e._)`[${P}, ${w}]`).else(),s.if(v,()=>{s.assign(_,!0),s.assign(P,w),a&&b.mergeEvaluated(a,e.Name)})})}}};return ct.default=c,ct}var dt={},tn;function Es(){if(tn)return dt;tn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(m){const{gen:c,schema:b,it:s}=m;if(!Array.isArray(b))throw new Error("ajv implementation error");const l=c.name("valid");b.forEach((u,h)=>{if((0,e.alwaysValidSchema)(s,u))return;const $=m.subschema({keyword:"allOf",schemaProp:h},l);m.ok(l),m.mergeEvaluated($)})}};return dt.default=t,dt}var lt={},rn;function Ps(){if(rn)return lt;rn=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=H(),t=Y(),c={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:l,parentSchema:u,it:h}=s;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(h,'"if" without "then" and "else" is ignored');const $=b(h,"then"),_=b(h,"else");if(!$&&!_)return;const P=l.let("valid",!0),v=l.name("_valid");if(y(),s.reset(),$&&_){const w=l.let("ifClause");s.setParams({ifClause:w}),l.if(v,g("then",w),g("else",w))}else $?l.if(v,g("then")):l.if((0,e.not)(v),g("else"));s.pass(P,()=>s.error(!0));function y(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);s.mergeEvaluated(w)}function g(w,a){return()=>{const i=s.subschema({keyword:w},v);l.assign(P,v),s.mergeValidEvaluated(i,P),a?l.assign(a,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function b(s,l){const u=s.schema[l];return u!==void 0&&!(0,t.alwaysValidSchema)(s,u)}return lt.default=c,lt}var ft={},nn;function Ns(){if(nn)return ft;nn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:m,parentSchema:c,it:b}){c.if===void 0&&(0,e.checkStrictMode)(b,`"${m}" without "if" is ignored`)}};return ft.default=t,ft}var sn;function Rs(){if(sn)return xe;sn=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=Sn(),t=ms(),m=En(),c=ps(),b=ys(),s=gs(),l=_s(),u=Pn(),h=vs(),$=$s(),_=ws(),P=bs(),v=Ss(),y=Es(),g=Ps(),w=Ns();function a(i=!1){const r=[_.default,P.default,v.default,y.default,g.default,w.default,l.default,u.default,s.default,h.default,$.default];return i?r.push(t.default,c.default):r.push(e.default,m.default),r.push(b.default),r}return xe.default=a,xe}var ht={},mt={},an;function ks(){if(an)return mt;an=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=H(),m={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:c})=>(0,e.str)`must match format "${c}"`,params:({schemaCode:c})=>(0,e._)`{format: ${c}}`},code(c,b){const{gen:s,data:l,$data:u,schema:h,schemaCode:$,it:_}=c,{opts:P,errSchemaPath:v,schemaEnv:y,self:g}=_;if(!P.validateFormats)return;u?w():a();function w(){const i=s.scopeValue("formats",{ref:g.formats,code:P.code.formats}),r=s.const("fDef",(0,e._)`${i}[${$}]`),o=s.let("fType"),p=s.let("format");s.if((0,e._)`typeof ${r} == "object" && !(${r} instanceof RegExp)`,()=>s.assign(o,(0,e._)`${r}.type || "string"`).assign(p,(0,e._)`${r}.validate`),()=>s.assign(o,(0,e._)`"string"`).assign(p,r)),c.fail$data((0,e.or)(n(),f()));function n(){return P.strictSchema===!1?e.nil:(0,e._)`${$} && !${p}`}function f(){const S=y.$async?(0,e._)`(${r}.async ? await ${p}(${l}) : ${p}(${l}))`:(0,e._)`${p}(${l})`,T=(0,e._)`(typeof ${p} == "function" ? ${S} : ${p}.test(${l}))`;return(0,e._)`${p} && ${p} !== true && ${o} === ${b} && !${T}`}}function a(){const i=g.formats[h];if(!i){n();return}if(i===!0)return;const[r,o,p]=f(i);r===b&&c.pass(S());function n(){if(P.strictSchema===!1){g.logger.warn(T());return}throw new Error(T());function T(){return`unknown format "${h}" ignored in schema at path "${v}"`}}function f(T){const j=T instanceof RegExp?(0,e.regexpCode)(T):P.code.formats?(0,e._)`${P.code.formats}${(0,e.getProperty)(h)}`:void 0,D=s.scopeValue("formats",{key:h,ref:T,code:j});return typeof T=="object"&&!(T instanceof RegExp)?[T.type||"string",T.validate,(0,e._)`${D}.validate`]:["string",T,D]}function S(){if(typeof i=="object"&&!(i instanceof RegExp)&&i.async){if(!y.$async)throw new Error("async format in sync schema");return(0,e._)`await ${p}(${l})`}return typeof o=="function"?(0,e._)`${p}(${l})`:(0,e._)`${p}.test(${l})`}}}};return mt.default=m,mt}var on;function Os(){if(on)return ht;on=1,Object.defineProperty(ht,"__esModule",{value:!0});const t=[ks().default];return ht.default=t,ht}var Se={},un;function Ts(){return un||(un=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.contentVocabulary=Se.metadataVocabulary=void 0,Se.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Se.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Se}var cn;function js(){if(cn)return Me;cn=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=ts(),t=hs(),m=Rs(),c=Os(),b=Ts(),s=[e.default,t.default,(0,m.default)(),c.default,b.metadataVocabulary,b.contentVocabulary];return Me.default=s,Me}var pt={},je={},dn;function Is(){if(dn)return je;dn=1,Object.defineProperty(je,"__esModule",{value:!0}),je.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(je.DiscrError=e={})),je}var ln;function qs(){if(ln)return pt;ln=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=H(),t=Is(),m=Ht(),c=bt(),b=Y(),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:h}})=>u===t.DiscrError.Tag?`tag "${h}" must be string`:`value of tag "${h}" must be in oneOf`,params:({params:{discrError:u,tag:h,tagName:$}})=>(0,e._)`{error: ${u}, tag: ${$}, tagValue: ${h}}`},code(u){const{gen:h,data:$,schema:_,parentSchema:P,it:v}=u,{oneOf:y}=P;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const g=_.propertyName;if(typeof g!="string")throw new Error("discriminator: requires propertyName");if(_.mapping)throw new Error("discriminator: mapping is not supported");if(!y)throw new Error("discriminator: requires oneOf keyword");const w=h.let("valid",!1),a=h.const("tag",(0,e._)`${$}${(0,e.getProperty)(g)}`);h.if((0,e._)`typeof ${a} == "string"`,()=>i(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:a,tagName:g})),u.ok(w);function i(){const p=o();h.if(!1);for(const n in p)h.elseIf((0,e._)`${a} === ${n}`),h.assign(w,r(p[n]));h.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:a,tagName:g}),h.endIf()}function r(p){const n=h.name("valid"),f=u.subschema({keyword:"oneOf",schemaProp:p},n);return u.mergeEvaluated(f,e.Name),n}function o(){var p;const n={},f=T(P);let S=!0;for(let z=0;z<y.length;z++){let V=y[z];if(V!=null&&V.$ref&&!(0,b.schemaHasRulesButRef)(V,v.self.RULES)){const J=V.$ref;if(V=m.resolveRef.call(v.self,v.schemaEnv.root,v.baseId,J),V instanceof m.SchemaEnv&&(V=V.schema),V===void 0)throw new c.default(v.opts.uriResolver,v.baseId,J)}const U=(p=V==null?void 0:V.properties)===null||p===void 0?void 0:p[g];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${g}"`);S=S&&(f||T(V)),j(U,z)}if(!S)throw new Error(`discriminator: "${g}" must be required`);return n;function T({required:z}){return Array.isArray(z)&&z.includes(g)}function j(z,V){if(z.const)D(z.const,V);else if(z.enum)for(const U of z.enum)D(U,V);else throw new Error(`discriminator: "properties/${g}" must have "const" or "enum"`)}function D(z,V){if(typeof z!="string"||z in n)throw new Error(`discriminator: "${g}" values must be unique strings`);n[z]=V}}}};return pt.default=l,pt}const Cs="http://json-schema.org/draft-07/schema#",Ds="http://json-schema.org/draft-07/schema#",As="Core schema meta-schema",Ms={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:[]}},zs=["object","boolean"],Vs={$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:"#"}},Fs={$schema:Cs,$id:Ds,title:As,definitions:Ms,type:zs,properties:Vs,default:!0};var fn;function Nn(){return fn||(fn=1,(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=t.Ajv=void 0;const m=Xn(),c=js(),b=qs(),s=Fs,l=["/properties"],u="http://json-schema.org/draft-07/schema";class h extends m.default{_addVocabularies(){super._addVocabularies(),c.default.forEach(g=>this.addVocabulary(g)),this.opts.discriminator&&this.addKeyword(b.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const g=this.opts.$data?this.$dataMetaSchema(s,l):s;this.addMetaSchema(g,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=h,e.exports=t=h,e.exports.Ajv=h,Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var $=wt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return $.KeywordCxt}});var _=H();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var P=Gt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return P.default}});var v=bt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(Ie,Ie.exports)),Ie.exports}var Us=Nn(),yt={exports:{}},At={},hn;function Ls(){return hn||(hn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,D){return{validate:j,compare:D}}e.fullFormats={date:t(s,l),time:t(h,$),"date-time":t(P,v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:w,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:T,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:i,int32:{type:"number",validate:p},int64:{type:"number",validate:n},float:{type:"number",validate:f},double:{type:"number",validate:f},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,l),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,$),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function m(j){return j%4===0&&(j%100!==0||j%400===0)}const c=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,b=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(j){const D=c.exec(j);if(!D)return!1;const z=+D[1],V=+D[2],U=+D[3];return V>=1&&V<=12&&U>=1&&U<=(V===2&&m(z)?29:b[V])}function l(j,D){if(j&&D)return j>D?1:j<D?-1:0}const u=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function h(j,D){const z=u.exec(j);if(!z)return!1;const V=+z[1],U=+z[2],J=+z[3],x=z[5];return(V<=23&&U<=59&&J<=59||V===23&&U===59&&J===60)&&(!D||x!=="")}function $(j,D){if(!(j&&D))return;const z=u.exec(j),V=u.exec(D);if(z&&V)return j=z[1]+z[2]+z[3]+(z[4]||""),D=V[1]+V[2]+V[3]+(V[4]||""),j>D?1:j<D?-1:0}const _=/t|\s/i;function P(j){const D=j.split(_);return D.length===2&&s(D[0])&&h(D[1],!0)}function v(j,D){if(!(j&&D))return;const[z,V]=j.split(_),[U,J]=D.split(_),x=l(z,U);if(x!==void 0)return x||$(V,J)}const y=/\/|:/,g=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function w(j){return y.test(j)&&g.test(j)}const a=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function i(j){return a.lastIndex=0,a.test(j)}const r=-2147483648,o=2**31-1;function p(j){return Number.isInteger(j)&&j<=o&&j>=r}function n(j){return Number.isInteger(j)}function f(){return!0}const S=/[^\\]\\Z/;function T(j){if(S.test(j))return!1;try{return new RegExp(j),!0}catch{return!1}}})(At)),At}var Mt={},mn;function Ks(){return mn||(mn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Nn(),m=H(),c=m.operators,b={formatMaximum:{okStr:"<=",ok:c.LTE,fail:c.GT},formatMinimum:{okStr:">=",ok:c.GTE,fail:c.LT},formatExclusiveMaximum:{okStr:"<",ok:c.LT,fail:c.GTE},formatExclusiveMinimum:{okStr:">",ok:c.GT,fail:c.LTE}},s={message:({keyword:u,schemaCode:h})=>m.str`should be ${b[u].okStr} ${h}`,params:({keyword:u,schemaCode:h})=>m._`{comparison: ${b[u].okStr}, limit: ${h}}`};e.formatLimitDefinition={keyword:Object.keys(b),type:"string",schemaType:"string",$data:!0,error:s,code(u){const{gen:h,data:$,schemaCode:_,keyword:P,it:v}=u,{opts:y,self:g}=v;if(!y.validateFormats)return;const w=new t.KeywordCxt(v,g.RULES.all.format.definition,"format");w.$data?a():i();function a(){const o=h.scopeValue("formats",{ref:g.formats,code:y.code.formats}),p=h.const("fmt",m._`${o}[${w.schemaCode}]`);u.fail$data(m.or(m._`typeof ${p} != "object"`,m._`${p} instanceof RegExp`,m._`typeof ${p}.compare != "function"`,r(p)))}function i(){const o=w.schema,p=g.formats[o];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${P}": format "${o}" does not define "compare" function`);const n=h.scopeValue("formats",{key:o,ref:p,code:y.code.formats?m._`${y.code.formats}${m.getProperty(o)}`:void 0});u.fail$data(r(n))}function r(o){return m._`${o}.compare(${$}, ${_}) ${b[P].fail} 0`}},dependencies:["format"]};const l=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=l})(Mt)),Mt}var pn;function Gs(){return pn||(pn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const m=Ls(),c=Ks(),b=H(),s=new b.Name("fullFormats"),l=new b.Name("fastFormats"),u=($,_={keywords:!0})=>{if(Array.isArray(_))return h($,_,m.fullFormats,s),$;const[P,v]=_.mode==="fast"?[m.fastFormats,l]:[m.fullFormats,s],y=_.formats||m.formatNames;return h($,y,P,v),_.keywords&&c.default($),$};u.get=($,_="full")=>{const v=(_==="fast"?m.fastFormats:m.fullFormats)[$];if(!v)throw new Error(`Unknown format "${$}"`);return v};function h($,_,P,v){var y,g;(y=(g=$.opts.code).formats)!==null&&y!==void 0||(g.formats=b._`require("ajv-formats/dist/formats").${v}`);for(const w of _)$.addFormat(w,P[w])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u})(yt,yt.exports)),yt.exports}var Hs=Gs();const Js=An(Hs),Ws="http://json-schema.org/draft-07/schema#",Bs="https://github.com/borderux/recursica/tree/main/packages/adapter-tester/src/adapter-tester.schema.json",Ys="adapter-tester.config.json",Zs="Configuration for @recursica/adapter-tester. All fields are optional — an adapter repo with a normal `storybook` npm script needs no config file at all.",Qs="object",Xs=!1,xs={$schema:{type:"string",description:'Optional pointer to this schema for editor autocomplete, e.g. "./node_modules/@recursica/adapter-tester/src/adapter-tester.schema.json".'},name:{type:"string",description:`Label for this project's own target. Defaults to the unscoped name in this project's package.json (e.g. "@recursica/mui-adapter" -> "mui-adapter").`},storybook:{type:"object",additionalProperties:!1,description:"This project's own Storybook target.",properties:{port:{type:"integer",minimum:1,maximum:65535,description:"Port the target's Storybook is served on. Auto-detected from this project's own `scripts.storybook` (a `-p <port>`/`--port <port>` flag) when omitted, falling back to Storybook's own default of 6006."},command:{type:"string",description:"Command that boots the target's Storybook. Defaults to `npm run storybook`."},cwd:{type:"string",description:'Directory the command runs in, relative to the config file. Defaults to ".".'}}},sourceOfTruth:{description:'The comparison target. Defaults to `{ "type": "mantine-harness" }`.',oneOf:[{type:"object",additionalProperties:!1,description:"Default mode: boots a throwaway harness that installs the published @recursica/mantine-adapter from npm — no monorepo checkout required.",properties:{type:{const:"mantine-harness"},port:{type:"integer",minimum:1,maximum:65535,description:"Port the throwaway harness's Storybook is served on. Defaults to 6011."},mantineAdapterVersion:{type:"string",description:"npm version/tag of @recursica/mantine-adapter to install in the harness. Defaults to `latest`."},storybookTemplateVersion:{type:"string",description:"npm version/tag of @recursica/storybook-template to install in the harness. Defaults to `latest`."}}},{type:"object",additionalProperties:!1,description:"Non-standard mode: points at an already-addressable Storybook — e.g. a sibling workspace package's own Storybook inside this monorepo.",required:["type","port"],properties:{type:{const:"url"},name:{type:"string",description:'Label for the source-of-truth target. Defaults to "Mantine".'},port:{type:"integer",minimum:1,maximum:65535,description:"Port the source-of-truth Storybook is served on."},command:{type:"string",description:"Command that boots the source-of-truth Storybook. Defaults to `npm run storybook`."},cwd:{type:"string",description:'Directory the command runs in, relative to the config file. Defaults to ".".'}}}]},diffThresholdPixels:{type:"number",minimum:0,description:"Global visual diff threshold, in mismatched pixels, before a story is considered a failure. Defaults to 3500. AI agents must not modify this field — see AGENT.md."},relaxedThresholdStoryIds:{type:"array",items:{type:"string"},description:"Story id prefixes that use `relaxedThresholdPixels` instead of the global `diffThresholdPixels`."},relaxedThresholdPixels:{type:"number",minimum:0,description:"Diff threshold applied to stories matching `relaxedThresholdStoryIds`."},excludeTitlePrefixes:{type:"array",items:{type:"string"},description:"Storybook title prefixes to exclude from comparison, in addition to the built-in denylist (`Theme/*`, `Tokens/*`, `Introduction`)."}},ea={$schema:Ws,$id:Bs,title:Ys,description:Zs,type:Qs,additionalProperties:Xs,properties:xs},ta=Js,Rn=new Us.Ajv({allErrors:!0,strict:!0});ta(Rn);const yn=Rn.compile(ea);function ra(e,t){if(yn(e))return;const m=(yn.errors??[]).map(c=>{var s;const b=(s=c.params)!=null&&s.additionalProperty?` '${c.params.additionalProperty}'`:"";return` - ${c.instancePath||"root"} ${c.message}${b}`}).join(`
19
- `);throw new Error(`Invalid ${t}:
20
- ${m}`)}const na="adapter-tester.config.json",gn="npm run storybook",sa=6006,aa=6011,_n="Mantine",oa=3500;function kn(e){const t=se.join(e,"package.json");if(!ge.existsSync(t))throw new Error(`No package.json found in ${e} — run adapter-tester from the root of the project being tested.`);return JSON.parse(ge.readFileSync(t,"utf8"))}function ia(e){var b;const m=(b=kn(e).scripts)==null?void 0:b.storybook,c=m==null?void 0:m.match(/(?:-p|--port)[ =](\d+)/);return c?Number(c[1]):sa}function ua(e){const m=kn(e).name;return m?m.split("/").pop():"Adapter"}function ca(e){const t=se.join(e,na);if(!ge.existsSync(t))return{};const m=JSON.parse(ge.readFileSync(t,"utf8"));return ra(m,t),m}function da(e){var v,y,g;const t=ca(e),m=t.name??ua(e),c=((v=t.storybook)==null?void 0:v.port)??ia(e),b=((y=t.storybook)==null?void 0:y.command)??gn,s=se.resolve(e,((g=t.storybook)==null?void 0:g.cwd)??"."),l=t.sourceOfTruth??{type:"mantine-harness"};let u,h,$;l.type==="url"?(u=l.name??_n,h=l.port,$={command:l.command??gn,port:l.port,cwd:se.resolve(e,l.cwd??"."),reuseExistingServer:!process.env.CI,timeout:120*1e3}):(u=_n,h=l.port??aa,$=qn.mantineSourceOfTruthWebServer({dir:se.join(e,".adapter-tester/mantine-harness"),port:h,mantineAdapterVersion:l.mantineAdapterVersion,storybookTemplateVersion:l.storybookTemplateVersion}));const _={targets:[{name:u,url:`http://localhost:${h}`,sourceOfTruth:!0},{name:m,url:`http://localhost:${c}`}],diffThresholdPixels:t.diffThresholdPixels??oa,relaxedThresholdStoryIds:t.relaxedThresholdStoryIds,relaxedThresholdPixels:t.relaxedThresholdPixels,excludeTitlePrefixes:t.excludeTitlePrefixes},P=[$,{command:b,port:c,cwd:s,reuseExistingServer:!process.env.CI,timeout:120*1e3}];return{engineConfig:_,webServers:P}}const la=se.dirname(Kt.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:Re&&Re.tagName.toUpperCase()==="SCRIPT"&&Re.src||new URL("cli.cjs",document.baseURI).href)),fa=Kt.pathToFileURL(se.join(la,"testing.js")).href,Vt=process.cwd(),{engineConfig:Ft,webServers:Ut}=da(Vt);process.argv.includes("--dry-run")&&(console.log(JSON.stringify({engineConfig:Ft,webServers:Ut},null,2)),process.exit(0));const ha=new Set(["--dry-run","--serve"]),ma=process.argv.slice(2).filter(e=>!ha.has(e));process.argv.includes("--serve")?Dn(Ft,Ut):pa(Ut,Ft);function pa(e,t){const m=se.join(Vt,".adapter-tester/run");ge.mkdirSync(m,{recursive:!0}),ge.writeFileSync(se.join(m,"playwright.config.js"),`// Generated by \`adapter-tester\` — do not edit, regenerated on every run.
11
+ `);const[d,p]=await Promise.all([k(h),k(i)]);d?console.log(`[Dev Launcher] ${r.name} is already running on port ${h}.`):f.push(E(r.name,a)),p?console.log(`[Dev Launcher] ${n.name} is already running on port ${i}.`):f.push(E(n.name,c));const y=[];d||y.push(_(h)),p||y.push(_(i)),y.length>0?(console.log("[Dev Launcher] Waiting for Storybooks to be responsive..."),(await Promise.all(y)).every(Boolean)?console.log("[Dev Launcher] All Storybooks are active and responsive!"):console.warn("[Dev Launcher] Warning: some Storybooks timed out during startup, but proceeding...")):console.log("[Dev Launcher] Both Storybooks already active."),J(`http://localhost:${m}`)})}const B="http://json-schema.org/draft-07/schema#",W="https://github.com/borderux/recursica/tree/main/packages/adapter-tester/src/adapter-tester.schema.json",H="adapter-tester.config.json",K="Configuration for @recursica/adapter-tester. All fields are optional — an adapter repo with a normal `storybook` npm script needs no config file at all.",Y="object",X=!1,z={$schema:{type:"string",description:'Optional pointer to this schema for editor autocomplete, e.g. "./node_modules/@recursica/adapter-tester/src/adapter-tester.schema.json".'},name:{type:"string",description:`Label for this project's own target. Defaults to the unscoped name in this project's package.json (e.g. "@recursica/some-adapter" -> "some-adapter").`},storybook:{type:"object",additionalProperties:!1,description:"This project's own Storybook target.",properties:{port:{type:"integer",minimum:1,maximum:65535,description:"Port the target's Storybook is served on. Auto-detected from this project's own `scripts.storybook` (a `-p <port>`/`--port <port>` flag) when omitted, falling back to Storybook's own default of 6006."},command:{type:"string",description:"Command that boots the target's Storybook. Defaults to `npm run storybook`."},cwd:{type:"string",description:'Directory the command runs in, relative to the config file. Defaults to ".".'}}},sourceOfTruth:{description:'The comparison target. Defaults to `{ "type": "mantine-harness" }`.',oneOf:[{type:"object",additionalProperties:!1,description:"Default mode: boots a throwaway harness that installs the published @recursica/mantine-adapter from npm — no monorepo checkout required.",properties:{type:{const:"mantine-harness"},port:{type:"integer",minimum:1,maximum:65535,description:"Port the throwaway harness's Storybook is served on. Defaults to 6011."},mantineAdapterVersion:{type:"string",description:"npm version/tag of @recursica/mantine-adapter to install in the harness. Defaults to `latest`."},storybookTemplateVersion:{type:"string",description:"npm version/tag of @recursica/storybook-template to install in the harness. Defaults to `latest`."}}},{type:"object",additionalProperties:!1,description:"Non-standard mode: points at an already-addressable Storybook — e.g. a sibling workspace package's own Storybook inside this monorepo.",required:["type","port"],properties:{type:{const:"url"},name:{type:"string",description:'Label for the source-of-truth target. Defaults to "Mantine".'},port:{type:"integer",minimum:1,maximum:65535,description:"Port the source-of-truth Storybook is served on."},command:{type:"string",description:"Command that boots the source-of-truth Storybook. Defaults to `npm run storybook`."},cwd:{type:"string",description:'Directory the command runs in, relative to the config file. Defaults to ".".'}}}]},isSourceOfTruthAdapter:{type:"boolean",description:"True only for the source-of-truth adapter's own config (mantine-adapter). Skips `sourceOfTruth` entirely — there's nothing above it to diverge from — and runs the own-drift golden check standalone, against just this project's own Storybook. Defaults to false."},diffThresholdPixels:{type:"number",minimum:0,description:"Global visual diff threshold, in mismatched pixels, before a story is considered a failure. Defaults to 3500. AI agents must not modify this field — see AGENT.md."},storyThresholds:{type:"object",additionalProperties:{type:"number",minimum:0},description:"Per-story diff threshold overrides, keyed by story id prefix (a story matches if its id equals the key or starts with it). Overrides `diffThresholdPixels` for matching stories. When more than one key matches a story, the longest (most specific) key wins."},excludeTitlePrefixes:{type:"array",items:{type:"string"},description:"Storybook title prefixes to exclude from comparison, in addition to the built-in denylist (`Theme/*`, `Tokens/*`, `Introduction`)."},excludeStoryIds:{type:"array",items:{type:"string"},description:"Story id prefixes to skip entirely — no own-drift check, no divergence check, no golden captured. For excluding individual stories that don't have a cross-adapter counterpart; use `excludeTitlePrefixes` to drop a whole title instead."}},Q={$schema:B,$id:W,title:H,description:K,type:Y,additionalProperties:X,properties:z},Z=L.index,F=new L.ajvExports.Ajv({allErrors:!0,strict:!0});Z(F);const $=F.compile(Q);function ee(t,o){if($(t))return;const e=($.errors??[]).map(r=>{var a;const n=(a=r.params)!=null&&a.additionalProperty?` '${r.params.additionalProperty}'`:"";return` - ${r.instancePath||"root"} ${r.message}${n}`}).join(`
12
+ `);throw new Error(`Invalid ${o}:
13
+ ${e}`)}const te="@recursica/mantine-adapter",oe="adapter-tester.config.json",C="npm run storybook",re=6006,ne=6011,N="Mantine",se=3500;function I(t){const o=s.join(t,"package.json");if(!l.existsSync(o))throw new Error(`No package.json found in ${t} run adapter-tester from the root of the project being tested.`);return JSON.parse(l.readFileSync(o,"utf8"))}function ie(t){var n;const e=(n=I(t).scripts)==null?void 0:n.storybook,r=e==null?void 0:e.match(/(?:-p|--port)[ =](\d+)/);return r?Number(r[1]):re}function ae(t){const e=I(t).name;return e?e.split("/").pop():"Adapter"}function ce(t){const o=s.join(t,oe);if(!l.existsSync(o))return{};const e=JSON.parse(l.readFileSync(o,"utf8"));return ee(e,o),e}function de(t){var b,T,d;const o=ce(t),e=o.isSourceOfTruthAdapter??!1,r=o.name??ae(t),n=((b=o.storybook)==null?void 0:b.port)??ie(t),a=((T=o.storybook)==null?void 0:T.command)??C,c=s.resolve(t,((d=o.storybook)==null?void 0:d.cwd)??"."),m={command:a,port:n,cwd:c,reuseExistingServer:!process.env.CI,timeout:120*1e3},h={diffThresholdPixels:o.diffThresholdPixels??se,storyThresholds:o.storyThresholds,excludeTitlePrefixes:o.excludeTitlePrefixes,excludeStoryIds:o.excludeStoryIds,goldenDir:s.join(c,"test","golden"),isSourceOfTruthAdapter:e,goldenMode:"check"};if(e)return{engineConfig:{...h,targets:[{name:r,url:`http://localhost:${n}`}]},webServers:[m]};const i=o.sourceOfTruth??{type:"mantine-harness"};let u,g,S,f;if(i.type==="url"){u=i.name??N,g=i.port;const p=s.resolve(t,i.cwd??".");S={command:i.command??C,port:i.port,cwd:p,reuseExistingServer:!process.env.CI,timeout:120*1e3},f={type:"local",dir:s.join(p,"test","golden")}}else u=N,g=i.port??ne,S=G.mantineSourceOfTruthWebServer({dir:s.join(t,".adapter-tester/mantine-harness"),port:g,mantineAdapterVersion:i.mantineAdapterVersion,storybookTemplateVersion:i.storybookTemplateVersion}),f={type:"npm",packageName:te,versionSpec:i.mantineAdapterVersion??"latest",cacheDir:s.join(t,".adapter-tester/mantine-golden-cache")};return{engineConfig:{...h,targets:[{name:u,url:`http://localhost:${g}`,sourceOfTruth:!0},{name:r,url:`http://localhost:${n}`}],sourceOfTruthGolden:f},webServers:[S,m]}}const pe=s.dirname(D.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:w&&w.tagName.toUpperCase()==="SCRIPT"&&w.src||new URL("cli.cjs",document.baseURI).href)),le=D.pathToFileURL(s.join(pe,"testing.js")).href,O=process.cwd(),{engineConfig:v,webServers:j}=de(O);process.argv.includes("--update-golden")?v.goldenMode="update-golden":process.argv.includes("--approve-divergence")&&(v.goldenMode="approve-divergence");process.argv.includes("--dry-run")&&(console.log(JSON.stringify({engineConfig:v,webServers:j},null,2)),process.exit(0));const ue=new Set(["--dry-run","--serve","--update-golden","--approve-divergence"]),he=process.argv.slice(2).filter(t=>!ue.has(t));if(process.argv.includes("--serve")){if(v.isSourceOfTruthAdapter)throw new Error("Dev Mode (--serve) has nothing to sync this project's Storybook against — isSourceOfTruthAdapter is true in this project's adapter-tester.config.json.");V(v,j)}else fe(j.slice(-1),v);function fe(t,o){const e=s.join(O,".adapter-tester/run");l.mkdirSync(e,{recursive:!0}),l.writeFileSync(s.join(e,"playwright.config.js"),`// Generated by \`adapter-tester\` — do not edit, regenerated on every run.
21
14
  import { defineConfig, devices } from "@playwright/test";
22
15
 
23
16
  export default defineConfig({
24
- testDir: ${JSON.stringify(m)},
25
- fullyParallel: true,
17
+ testDir: ${JSON.stringify(e)},
18
+ // Golden checks read-modify-write the same manifest.json across every
19
+ // story's test body — forced sequential (no worker parallelism) so those
20
+ // writes never race each other.
21
+ fullyParallel: false,
26
22
  forbidOnly: !!process.env.CI,
27
23
  retries: process.env.CI ? 2 : 0,
28
- workers: process.env.CI ? 1 : undefined,
24
+ workers: 1,
29
25
  reporter: [["html", { open: "never" }], ["list"]],
30
26
  use: { trace: "on-first-retry" },
31
27
  projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
32
- webServer: ${JSON.stringify(e,null,2)},
28
+ webServer: ${JSON.stringify(t,null,2)},
33
29
  });
34
- `),ge.writeFileSync(se.join(m,"visual-regression.spec.js"),`// Generated by \`adapter-tester\` — do not edit, regenerated on every run.
35
- import { runVisualRegression } from ${JSON.stringify(fa)};
30
+ `),l.writeFileSync(s.join(e,"visual-regression.spec.js"),`// Generated by \`adapter-tester\` — do not edit, regenerated on every run.
31
+ import { runVisualRegression } from ${JSON.stringify(le)};
36
32
 
37
- await runVisualRegression(${JSON.stringify(t,null,2)});
38
- `);const c=Lt.spawnSync("npx",["playwright","test","--config",se.join(m,"playwright.config.js"),...ma],{stdio:"inherit",cwd:Vt,shell:process.platform==="win32"});process.exit(c.status??1)}
33
+ await runVisualRegression(${JSON.stringify(o,null,2)});
34
+ `);const r=x.spawnSync("npx",["playwright","test","--config",s.join(e,"playwright.config.js"),...he],{stdio:"inherit",cwd:O,shell:process.platform==="win32"});process.exit(r.status??1)}
39
35
  //# sourceMappingURL=cli.cjs.map