likec4 1.42.1 → 1.43.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.
- package/__app__/src/likec4.js +278 -106
- package/__app__/src/main.js +3 -3
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +142 -81
- package/config/schema.json +149 -105
- package/dist/cli/index.mjs +234 -233
- package/dist/config/index.d.mts +1 -1
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/shared/{likec4.BCSBNe4z.d.mts → likec4.CQWzqezS.d.mts} +144 -144
- package/dist/shared/{likec4.BEwUtMsL.mjs → likec4.CWfMOOnG.mjs} +1 -1
- package/dist/shared/{likec4.B5Q51Z1F.mjs → likec4.DtL27jG4.mjs} +85 -80
- package/dist/shared/{likec4.D51sTGt6.mjs → likec4.DvPKV9S-.mjs} +2381 -2376
- package/dist/shared/{likec4.CaOUU1HJ.d.mts → likec4.VWjIqhhl.d.mts} +36 -19
- package/dist/vite-plugin/index.d.mts +2 -2
- package/dist/vite-plugin/index.mjs +1 -1
- package/package.json +28 -28
- package/react/index.d.ts +37 -13
- package/react/index.js +477 -211
package/dist/cli/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as Te,r as kf,k as tt,l as mn,m as wt,u as j,w as No,o as Tf,p as Nf,q as Ae,s as
|
|
2
|
+
import{h as Te,r as kf,k as tt,l as mn,m as wt,u as j,w as No,o as Tf,p as Nf,q as Ae,s as Io,v as Mt,x as We,y as If,d as Oo,z as jo,A as Of,c as jf,L as Pe,B as Lf,j as Lo,C as Df,D as Do,E as De,F as qf,G as xf,e as Mf,H as at,U as yn,I as it,J as gn,K as $n,M as qo,Q as xo}from"../shared/likec4.DvPKV9S-.mjs";import se,{existsSync as He,copyFileSync as Mo,readdirSync as Hf,rmSync as vn,statSync as Uf}from"node:fs";import me,{hrtime as Ff,cwd as Ht,exit as Ho,argv as Vf,stdout as zf}from"node:process";
|
|
3
3
|
import{b as Uo,t as Fo,a as Gf,d as bt}from"../shared/likec4.CB2-Uaub.mjs";import{isMinimal as Bf,nodeENV as Kf,isDevelopment as Wf}from"std-env";import Xf from"yargs";import{hideBin as Jf}from"yargs/helpers";import ie,{resolve as oe,dirname as qe,join as Et,relative as Ue,sep as Vo,extname as St,isAbsolute as _n,basename as Ut}from"node:path";import zo,{mkdtemp as Ft,writeFile as Xe,mkdir as xe,stat as wn,copyFile as Yf,rm as Qf}from"node:fs/promises";import Rt,{tmpdir as Vt}from"node:os";import{
|
|
4
|
-
fileURLToPath as Go}from"node:url";import bn from"@vitejs/plugin-react";import Bo from"util";import En,{resolve as ct}from"path";import{j as Ko,e as Wo,C as Zf,t as Xo,N as ut,L as Sn,g as ed,a as td,b as rd}from"../shared/likec4.
|
|
5
|
-
import Pt from"node:crypto";import ud from"node:assert";import{
|
|
4
|
+
fileURLToPath as Go}from"node:url";import bn from"@vitejs/plugin-react";import Bo from"util";import En,{resolve as ct}from"path";import{j as Ko,e as Wo,C as Zf,t as Xo,N as ut,L as Sn,g as ed,a as td,b as rd}from"../shared/likec4.CWfMOOnG.mjs";import{build as At,createServer as nd,preview as sd}from"vite";import od from"node:module";import ad from"node:net";import{setTimeout as id}from"node:timers/promises";import{invariant as Rn,nonexhaustive as An}from"@likec4/core";import{promisify as $e,isDeepStrictEqual as cd}from"node:util";
|
|
5
|
+
import Pt from"node:crypto";import ud from"node:assert";import{b as lt}from"../shared/likec4.DtL27jG4.mjs";import{isDeploymentRelationModel as ld,isRelationModel as fd,isDeploymentElementModel as dd,isLikeC4ViewModel as pd,isElementModel as hd}from"@likec4/core/model";import{compareNatural as md,sortNaturalByFqn as yd,invariant as gd,delay as Jo}from"@likec4/core/utils";let Pn;function $d(){try{return se.statSync("/.dockerenv"),!0}catch{return!1}}function vd(){try{return se.readFileSync("/proc/s\
|
|
6
6
|
elf/cgroup","utf8").includes("docker")}catch{return!1}}function _d(){return Pn===void 0&&(Pn=$d()||vd()),Pn}let Cn;const wd=()=>{try{return se.statSync("/run/.containerenv"),!0}catch{return!1}};function Fe(){return Cn===void 0&&(Cn=wd()||_d()),Cn}const be={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:oe},Re={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:Fe()?"enabled in container, disable by --no-use-dot":'use graphviz b\
|
|
7
7
|
inaries ("dot" should be on PATH)',default:Fe()},Yo={boolean:!0,type:"boolean",desc:"use `@likec4/core` package in types",default:!1},Qo={boolean:!0,type:"boolean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},zt={alias:"o",type:"string",desc:"output directory",normalize:!0,nargs:1,coerce:oe},kn={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4",nargs:1},Zo={alias:"t",type:"string",desc:'base title of the app p\
|
|
8
8
|
ages (default is "LikeC4")',default:"LikeC4",nargs:1},ea={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"',nargs:1},bd={boolean:!0,type:"boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},Ed={alias:"l",type:"string",desc:Fe()?"listen 0.0.0.0 by default in container":"ip address of the network interface to listen on",default:Fe()?"0.0.0.0":"localhost",nargs:1},Gt={alias:"p",type:"string",desc:'LikeC4 p\
|
|
@@ -21,35 +21,35 @@ roject, name eg. "my-project" or path to the project folder',nargs:1},ta=e=>e in
|
|
|
21
21
|
/* prettier-ignore-end */
|
|
22
22
|
`,Tn={banner:Pd,footer:Cd};function ra(){const e=Rd({cwd:Bt});if(!e)throw new Error("likec4 package folder not found");return qe(e)}function Nn(){const e=ra(),t=[oe(e,"__app__"),oe(Bt,"../__app__"),oe(Bt,"../../__app__"),oe(Bt,"../../dist/__app__")],r=kf(t,He);if(!r)throw tt.error(`likec4 app root does not exist, tried:
|
|
23
23
|
${t.join(`
|
|
24
|
-
`)}`),new Error("likec4 app root does not exist");return r}async function
|
|
25
|
-
`),e}const
|
|
24
|
+
`)}`),new Error("likec4 app root does not exist");return r}async function In(){const e=await Ft(Et(Vt(),".likec4-public-"));return await Xe(Et(e,"likec4-views.js"),`// generated by likec4
|
|
25
|
+
`),e}const On=1e4;function jn(){const e=ra();return{"likec4/icons":oe(e,"icons"),"likec4/react":oe(e,"react/index.js"),"likec4/model":oe(e,"dist/model/index.mjs"),"likec4/vite-plugin/internal":oe(e,"dist/vite-plugin/internal.mjs")}}var Ln={},na;function Dn(){return na||(na=1,(function(e){e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1,e.find=(t,r)=>t.nodes.find(n=>n.type===r),e.exceedsLimit=(t,r,n=1,i)=>i===!1||!e.isInteger(t)||
|
|
26
26
|
!e.isInteger(r)?!1:(Number(r)-Number(t))/Number(n)>=i,e.escapeNode=(t,r=0,n)=>{const i=t.nodes[r];i&&(n&&i.type===n||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},e.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1,e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1,e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===
|
|
27
27
|
!0||t.close===!0,e.reduce=t=>t.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type==="range"&&(n.type="text"),r),[]),e.flatten=(...t)=>{const r=[],n=i=>{for(let s=0;s<i.length;s++){const o=i[s];if(Array.isArray(o)){n(o);continue}o!==void 0&&r.push(o)}return r};return n(t),r}})(Ln)),Ln}var qn,sa;function xn(){if(sa)return qn;sa=1;const e=Dn();return qn=(t,r={})=>{const n=(i,s={})=>{const o=r.escapeInvalid&&e.isInvalidBrace(s),a=i.invalid===!0&&r.escapeInvalid===!0;let u="";if(i.value)return(o||
|
|
28
28
|
a)&&e.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(const c of i.nodes)u+=n(c);return u};return n(t)},qn}var Mn,oa;function kd(){return oa||(oa=1,Mn=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}),Mn}var Hn,aa;function Td(){if(aa)return Hn;aa=1;const e=kd(),t=(p,m,f)=>{if(e(p)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(m===void 0||p===
|
|
29
|
-
m)return String(p);if(e(m)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let d={relaxZeros:!0,...f};typeof d.strictZeros=="boolean"&&(d.relaxZeros=d.strictZeros===!1);let g=String(d.relaxZeros),v=String(d.shorthand),w=String(d.capture),E=String(d.wrap),P=p+":"+m+"="+g+v+w+E;if(t.cache.hasOwnProperty(P))return t.cache[P].result;let
|
|
30
|
-
p)||S(m),H={min:p,max:m,a:
|
|
31
|
-
g=l(p,f),v=new Set([m]);for(;p<=g&&g<=m;)v.add(g),f+=1,g=l(p,f);for(g=h(m+1,d)-1;p<g&&g<=m;)v.add(g),d+=1,g=h(m+1,d)-1;return v=[...v],v.sort(u),v}function i(p,m,f){if(p===m)return{pattern:p,count:[],digits:0};let d=a(p,m),g=d.length,v="",w=0;for(let E=0;E<g;E++){let[P,
|
|
32
|
-
|
|
29
|
+
m)return String(p);if(e(m)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let d={relaxZeros:!0,...f};typeof d.strictZeros=="boolean"&&(d.relaxZeros=d.strictZeros===!1);let g=String(d.relaxZeros),v=String(d.shorthand),w=String(d.capture),E=String(d.wrap),P=p+":"+m+"="+g+v+w+E;if(t.cache.hasOwnProperty(P))return t.cache[P].result;let I=Math.min(p,m),U=Math.max(p,m);if(Math.abs(I-U)===1){let M=p+"|"+m;return d.capture?`(${M})`:d.wrap===!1?M:`(?:${M})`}let x=S(
|
|
30
|
+
p)||S(m),H={min:p,max:m,a:I,b:U},D=[],O=[];if(x&&(H.isPadded=x,H.maxLen=String(H.max).length),I<0){let M=U<0?Math.abs(U):1;O=s(M,Math.abs(I),H,d),I=H.a=0}return U>=0&&(D=s(I,U,H,d)),H.negatives=O,H.positives=D,H.result=r(O,D),d.capture===!0?H.result=`(${H.result})`:d.wrap!==!1&&D.length+O.length>1&&(H.result=`(?:${H.result})`),t.cache[P]=H,H.result};function r(p,m,f){let d=o(p,m,"-",!1)||[],g=o(m,p,"",!1)||[],v=o(p,m,"-?",!0)||[];return d.concat(v).concat(g).join("|")}function n(p,m){let f=1,d=1,
|
|
31
|
+
g=l(p,f),v=new Set([m]);for(;p<=g&&g<=m;)v.add(g),f+=1,g=l(p,f);for(g=h(m+1,d)-1;p<g&&g<=m;)v.add(g),d+=1,g=h(m+1,d)-1;return v=[...v],v.sort(u),v}function i(p,m,f){if(p===m)return{pattern:p,count:[],digits:0};let d=a(p,m),g=d.length,v="",w=0;for(let E=0;E<g;E++){let[P,I]=d[E];P===I?v+=P:P!=="0"||I!=="9"?v+=_(P,I):w++}return w&&(v+=f.shorthand===!0?"\\d":"[0-9]"),{pattern:v,count:[w],digits:g}}function s(p,m,f,d){let g=n(p,m),v=[],w=p,E;for(let P=0;P<g.length;P++){let I=g[P],U=i(String(w),String(
|
|
32
|
+
I),d),x="";if(!f.isPadded&&E&&E.pattern===U.pattern){E.count.length>1&&E.count.pop(),E.count.push(U.count[0]),E.string=E.pattern+y(E.count),w=I+1;continue}f.isPadded&&(x=$(I,f,d)),U.string=x+U.pattern+y(U.count),v.push(U),w=I+1,E=U}return v}function o(p,m,f,d,g){let v=[];for(let w of p){let{string:E}=w;!d&&!c(m,"string",E)&&v.push(f+E),d&&c(m,"string",E)&&v.push(f+E)}return v}function a(p,m){let f=[];for(let d=0;d<p.length;d++)f.push([p[d],m[d]]);return f}function u(p,m){return p>m?1:m>p?-1:0}function c(p,m,f){
|
|
33
33
|
return p.some(d=>d[m]===f)}function l(p,m){return Number(String(p).slice(0,-m)+"9".repeat(m))}function h(p,m){return p-p%Math.pow(10,m)}function y(p){let[m=0,f=""]=p;return f||m>1?`{${m+(f?","+f:"")}}`:""}function _(p,m,f){return`[${p}${m-p===1?"":"-"}${m}]`}function S(p){return/^-?(0+)\d/.test(p)}function $(p,m,f){if(!m.isPadded)return p;let d=Math.abs(m.maxLen-String(p).length),g=f.relaxZeros!==!1;switch(d){case 0:return"";case 1:return g?"0?":"0";case 2:return g?"0{0,2}":"00";default:return g?
|
|
34
34
|
`0{0,${d}}`:`0{${d}}`}}return t.cache={},t.clearCache=()=>t.cache={},Hn=t,Hn}var Un,ia;function ca(){if(ia)return Un;ia=1;const e=Bo,t=Td(),r=d=>d!==null&&typeof d=="object"&&!Array.isArray(d),n=d=>g=>d===!0?Number(g):String(g),i=d=>typeof d=="number"||typeof d=="string"&&d!=="",s=d=>Number.isInteger(+d),o=d=>{let g=`${d}`,v=-1;if(g[0]==="-"&&(g=g.slice(1)),g==="0")return!1;for(;g[++v]==="0";);return v>0},a=(d,g,v)=>typeof d=="string"||typeof g=="string"?!0:v.stringify===!0,u=(d,g,v)=>{if(g>0){let w=d[0]===
|
|
35
|
-
"-"?"-":"";w&&(d=d.slice(1)),d=w+d.padStart(w?g-1:g,"0")}return v===!1?String(d):d},c=(d,g)=>{let v=d[0]==="-"?"-":"";for(v&&(d=d.slice(1),g--);d.length<g;)d="0"+d;return v?"-"+d:d},l=(d,g,v)=>{d.negatives.sort((U,x)=>U<x?-1:U>x?1:0),d.positives.sort((U,x)=>U<x?-1:U>x?1:0);let w=g.capture?"":"?:",E="",P="",
|
|
36
|
-
`(${w}${
|
|
37
|
-
be a number`);return[]},p=(d,g,v=1,w={})=>{let E=Number(d),P=Number(g);if(!Number.isInteger(E)||!Number.isInteger(P)){if(w.strictRanges===!0)throw _([d,g]);return[]}E===0&&(E=0),P===0&&(P=0);let
|
|
38
|
-
abs(A)),Q=[],q=0;for(;
|
|
35
|
+
"-"?"-":"";w&&(d=d.slice(1)),d=w+d.padStart(w?g-1:g,"0")}return v===!1?String(d):d},c=(d,g)=>{let v=d[0]==="-"?"-":"";for(v&&(d=d.slice(1),g--);d.length<g;)d="0"+d;return v?"-"+d:d},l=(d,g,v)=>{d.negatives.sort((U,x)=>U<x?-1:U>x?1:0),d.positives.sort((U,x)=>U<x?-1:U>x?1:0);let w=g.capture?"":"?:",E="",P="",I;return d.positives.length&&(E=d.positives.map(U=>c(String(U),v)).join("|")),d.negatives.length&&(P=`-(${w}${d.negatives.map(U=>c(String(U),v)).join("|")})`),E&&P?I=`${E}|${P}`:I=E||P,g.wrap?
|
|
36
|
+
`(${w}${I})`:I},h=(d,g,v,w)=>{if(v)return t(d,g,{wrap:!1,...w});let E=String.fromCharCode(d);if(d===g)return E;let P=String.fromCharCode(g);return`[${E}-${P}]`},y=(d,g,v)=>{if(Array.isArray(d)){let w=v.wrap===!0,E=v.capture?"":"?:";return w?`(${E}${d.join("|")})`:d.join("|")}return t(d,g,v)},_=(...d)=>new RangeError("Invalid range arguments: "+e.inspect(...d)),S=(d,g,v)=>{if(v.strictRanges===!0)throw _([d,g]);return[]},$=(d,g)=>{if(g.strictRanges===!0)throw new TypeError(`Expected step "${d}" to\
|
|
37
|
+
be a number`);return[]},p=(d,g,v=1,w={})=>{let E=Number(d),P=Number(g);if(!Number.isInteger(E)||!Number.isInteger(P)){if(w.strictRanges===!0)throw _([d,g]);return[]}E===0&&(E=0),P===0&&(P=0);let I=E>P,U=String(d),x=String(g),H=String(v);v=Math.max(Math.abs(v),1);let D=o(U)||o(x)||o(H),O=D?Math.max(U.length,x.length,H.length):0,M=D===!1&&a(d,g,w)===!1,z=w.transform||n(M);if(w.toRegex&&v===1)return h(c(d,O),c(g,O),!0,w);let F={negatives:[],positives:[]},G=A=>F[A<0?"negatives":"positives"].push(Math.
|
|
38
|
+
abs(A)),Q=[],q=0;for(;I?E>=P:E<=P;)w.toRegex===!0&&v>1?G(E):Q.push(u(z(E,q),O,M)),E=I?E-v:E+v,q++;return w.toRegex===!0?v>1?l(F,w,O):y(Q,null,{wrap:!1,...w}):Q},m=(d,g,v=1,w={})=>{if(!s(d)&&d.length>1||!s(g)&&g.length>1)return S(d,g,w);let E=w.transform||(M=>String.fromCharCode(M)),P=`${d}`.charCodeAt(0),I=`${g}`.charCodeAt(0),U=P>I,x=Math.min(P,I),H=Math.max(P,I);if(w.toRegex&&v===1)return h(x,H,!1,w);let D=[],O=0;for(;U?P>=I:P<=I;)D.push(E(P,O)),P=U?P-v:P+v,O++;return w.toRegex===!0?y(D,null,{
|
|
39
39
|
wrap:!1,options:w}):D},f=(d,g,v,w={})=>{if(g==null&&i(d))return[d];if(!i(d)||!i(g))return S(d,g,w);if(typeof v=="function")return f(d,g,1,{transform:v});if(r(v))return f(d,g,0,v);let E={...w};return E.capture===!0&&(E.wrap=!0),v=v||E.step||1,s(v)?s(d)&&s(g)?p(d,g,v,E):m(d,g,Math.max(Math.abs(v),1),E):v!=null&&!r(v)?$(v,E):f(d,g,1,v)};return Un=f,Un}var Fn,ua;function Nd(){if(ua)return Fn;ua=1;const e=ca(),t=Dn();return Fn=(n,i={})=>{const s=(o,a={})=>{const u=t.isInvalidBrace(a),c=o.invalid===!0&&
|
|
40
40
|
i.escapeInvalid===!0,l=u===!0||c===!0,h=i.escapeInvalid===!0?"\\":"";let y="";if(o.isOpen===!0)return h+o.value;if(o.isClose===!0)return console.log("node.isClose",h,o.value),h+o.value;if(o.type==="open")return l?h+o.value:"(";if(o.type==="close")return l?h+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":l?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const _=t.reduce(o.nodes),S=e(..._,{...i,wrap:!1,toRegex:!0,strictZeros:!0});if(S.length!==0)return _.length>1&&S.
|
|
41
|
-
length>1?`(${S})`:S}if(o.nodes)for(const _ of o.nodes)y+=s(_,o);return y};return s(n)},Fn}var Vn,la;function
|
|
41
|
+
length>1?`(${S})`:S}if(o.nodes)for(const _ of o.nodes)y+=s(_,o);return y};return s(n)},Fn}var Vn,la;function Id(){if(la)return Vn;la=1;const e=ca(),t=xn(),r=Dn(),n=(s="",o="",a=!1)=>{const u=[];if(s=[].concat(s),o=[].concat(o),!o.length)return s;if(!s.length)return a?r.flatten(o).map(c=>`{${c}}`):o;for(const c of s)if(Array.isArray(c))for(const l of c)u.push(n(l,o,a));else for(let l of o)a===!0&&typeof l=="string"&&(l=`{${l}}`),u.push(Array.isArray(l)?n(c,l,a):c+l);return r.flatten(u)};return Vn=
|
|
42
42
|
(s,o={})=>{const a=o.rangeLimit===void 0?1e3:o.rangeLimit,u=(c,l={})=>{c.queue=[];let h=l,y=l.queue;for(;h.type!=="brace"&&h.type!=="root"&&h.parent;)h=h.parent,y=h.queue;if(c.invalid||c.dollar){y.push(n(y.pop(),t(c,o)));return}if(c.type==="brace"&&c.invalid!==!0&&c.nodes.length===2){y.push(n(y.pop(),["{}"]));return}if(c.nodes&&c.ranges>0){const p=r.reduce(c.nodes);if(r.exceedsLimit(...p,o.step,a))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase\
|
|
43
43
|
or disable the limit.");let m=e(...p,o);m.length===0&&(m=t(c,o)),y.push(n(y.pop(),m)),c.nodes=[];return}const _=r.encloseBrace(c);let S=c.queue,$=c;for(;$.type!=="brace"&&$.type!=="root"&&$.parent;)$=$.parent,S=$.queue;for(let p=0;p<c.nodes.length;p++){const m=c.nodes[p];if(m.type==="comma"&&c.type==="brace"){p===1&&S.push(""),S.push("");continue}if(m.type==="close"){y.push(n(y.pop(),S,_));continue}if(m.value&&m.type!=="open"){S.push(n(S.pop(),m.value));continue}m.nodes&&u(m,c)}return S};return r.
|
|
44
|
-
flatten(u(s))},Vn}var zn,fa;function
|
|
44
|
+
flatten(u(s))},Vn}var zn,fa;function Od(){return fa||(fa=1,zn={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\
|
|
45
45
|
\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
46
46
|
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),zn}var Gn,da;function jd(){if(da)return Gn;da=1;const e=xn(),{MAX_LENGTH:t,CHAR_BACKSLASH:r,CHAR_BACKTICK:n,CHAR_COMMA:i,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:a,
|
|
47
|
-
CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:h,CHAR_DOUBLE_QUOTE:y,CHAR_SINGLE_QUOTE:_,CHAR_NO_BREAK_SPACE:S,CHAR_ZERO_WIDTH_NOBREAK_SPACE:$}=
|
|
48
|
-
let E=v,P=v,
|
|
49
|
-
|
|
47
|
+
CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:h,CHAR_DOUBLE_QUOTE:y,CHAR_SINGLE_QUOTE:_,CHAR_NO_BREAK_SPACE:S,CHAR_ZERO_WIDTH_NOBREAK_SPACE:$}=Od();return Gn=(m,f={})=>{if(typeof m!="string")throw new TypeError("Expected a string");const d=f||{},g=typeof d.maxLength=="number"?Math.min(t,d.maxLength):t;if(m.length>g)throw new SyntaxError(`Input length (${m.length}), exceeds max characters (${g})`);const v={type:"root",input:m,nodes:[]},w=[v];
|
|
48
|
+
let E=v,P=v,I=0;const U=m.length;let x=0,H=0,D;const O=()=>m[x++],M=z=>{if(z.type==="text"&&P.type==="dot"&&(P.type="text"),P&&P.type==="text"&&z.type==="text"){P.value+=z.value;return}return E.nodes.push(z),z.parent=E,z.prev=P,P=z,z};for(M({type:"bos"});x<U;)if(E=w[w.length-1],D=O(),!(D===$||D===S)){if(D===r){M({type:"text",value:(f.keepEscaping?D:"")+O()});continue}if(D===h){M({type:"text",value:"\\"+D});continue}if(D===l){I++;let z;for(;x<U&&(z=O());){if(D+=z,z===l){I++;continue}if(z===r){D+=
|
|
49
|
+
O();continue}if(z===h&&(I--,I===0))break}M({type:"text",value:D});continue}if(D===o){E=M({type:"paren",nodes:[]}),w.push(E),M({type:"text",value:D});continue}if(D===a){if(E.type!=="paren"){M({type:"text",value:D});continue}E=w.pop(),M({type:"text",value:D}),E=w[w.length-1];continue}if(D===y||D===_||D===n){const z=D;let F;for(f.keepQuotes!==!0&&(D="");x<U&&(F=O());){if(F===r){D+=F+O();continue}if(F===z){f.keepQuotes===!0&&(D+=F);break}D+=F}M({type:"text",value:D});continue}if(D===u){H++;const F={
|
|
50
50
|
type:"brace",open:!0,close:!1,dollar:P.value&&P.value.slice(-1)==="$"||E.dollar===!0,depth:H,commas:0,ranges:0,nodes:[]};E=M(F),w.push(E),M({type:"open",value:D});continue}if(D===c){if(E.type!=="brace"){M({type:"text",value:D});continue}const z="close";E=w.pop(),E.close=!0,M({type:z,value:D}),H--,E=w[w.length-1];continue}if(D===i&&H>0){if(E.ranges>0){E.ranges=0;const z=E.nodes.shift();E.nodes=[z,{type:"text",value:e(E)}]}M({type:"comma",value:D}),E.commas++;continue}if(D===s&&H>0&&E.commas===0){
|
|
51
51
|
const z=E.nodes;if(H===0||z.length===0){M({type:"text",value:D});continue}if(P.type==="dot"){if(E.range=[],P.value+=D,P.type="range",E.nodes.length!==3&&E.nodes.length!==5){E.invalid=!0,E.ranges=0,P.type="text";continue}E.ranges++,E.args=[];continue}if(P.type==="range"){z.pop();const F=z[z.length-1];F.value+=P.value+D,P=F,E.ranges--;continue}M({type:"dot",value:D});continue}M({type:"text",value:D})}do if(E=w.pop(),E.type!=="root"){E.nodes.forEach(G=>{G.nodes||(G.type==="open"&&(G.isOpen=!0),G.type===
|
|
52
|
-
"close"&&(G.isClose=!0),G.nodes||(G.type="text"),G.invalid=!0)});const z=w[w.length-1],F=z.nodes.indexOf(E);z.nodes.splice(F,1,...E.nodes)}while(w.length>0);return M({type:"eos"}),v},Gn}var Bn,pa;function Ld(){if(pa)return Bn;pa=1;const e=xn(),t=Nd(),r=
|
|
52
|
+
"close"&&(G.isClose=!0),G.nodes||(G.type="text"),G.invalid=!0)});const z=w[w.length-1],F=z.nodes.indexOf(E);z.nodes.splice(F,1,...E.nodes)}while(w.length>0);return M({type:"eos"}),v},Gn}var Bn,pa;function Ld(){if(pa)return Bn;pa=1;const e=xn(),t=Nd(),r=Id(),n=jd(),i=(s,o={})=>{let a=[];if(Array.isArray(s))for(const u of s){const c=i.create(u,o);Array.isArray(c)?a.push(...c):a.push(c)}else a=[].concat(i.create(s,o));return o&&o.expand===!0&&o.nodupes===!0&&(a=[...new Set(a)]),a};return i.parse=(s,o={})=>n(
|
|
53
53
|
s,o),i.stringify=(s,o={})=>e(typeof s=="string"?i.parse(s,o):s,o),i.compile=(s,o={})=>(typeof s=="string"&&(s=i.parse(s,o)),t(s,o)),i.expand=(s,o={})=>{typeof s=="string"&&(s=i.parse(s,o));let a=r(s,o);return o.noempty===!0&&(a=a.filter(Boolean)),o.nodupes===!0&&(a=[...new Set(a)]),a},i.create=(s,o={})=>s===""||s.length<3?[s]:o.expand!==!0?i.compile(s,o):i.expand(s,o),Bn=i,Bn}var Kn={},Wn,ha;function Kt(){if(ha)return Wn;ha=1;const e=En,t="\\\\/",r=`[^${t}]`,n="\\.",i="\\+",s="\\?",o="\\/",a="(?\
|
|
54
54
|
=.)",u="[^/]",c=`(?:${o}|$)`,l=`(?:^|${o})`,h=`${n}{1,2}${c}`,y=`(?!${n})`,_=`(?!${l}${h})`,S=`(?!${n}{0,1}${c})`,$=`(?!${h})`,p=`[^.${o}]`,m=`${u}*?`,f={DOT_LITERAL:n,PLUS_LITERAL:i,QMARK_LITERAL:s,SLASH_LITERAL:o,ONE_CHAR:a,QMARK:u,END_ANCHOR:c,DOTS_SLASH:h,NO_DOT:y,NO_DOTS:_,NO_DOT_SLASH:S,NO_DOTS_SLASH:$,QMARK_NO_DOT:p,STAR:m,START_ANCHOR:l},d={...f,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,
|
|
55
55
|
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`},g={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Wn={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:g,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,
|
|
@@ -58,15 +58,15 @@ CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CH
|
|
|
58
58
|
CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars(v){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${v.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(v){return v===!0?d:f}},Wn}var ma;function Wt(){return ma||(ma=1,(function(e){const t=En,r=process.
|
|
59
59
|
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:o}=Kt();e.isObject=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),e.hasRegexChars=a=>s.test(a),e.isRegexChar=a=>a.length===1&&e.hasRegexChars(a),e.escapeRegex=a=>a.replace(o,"\\$1"),e.toPosixSlashes=a=>a.replace(n,"/"),e.removeBackslashes=a=>a.replace(i,u=>u==="\\"?"":u),e.supportsLookbehinds=()=>{const a=process.version.slice(1).split(".").map(Number);return a.length===3&&a[0]>=9||
|
|
60
60
|
a[0]===8&&a[1]>=10},e.isWindows=a=>a&&typeof a.windows=="boolean"?a.windows:r===!0||t.sep==="\\",e.escapeLast=(a,u,c)=>{const l=a.lastIndexOf(u,c);return l===-1?a:a[l-1]==="\\"?e.escapeLast(a,u,l-1):`${a.slice(0,l)}\\${a.slice(l)}`},e.removePrefix=(a,u={})=>{let c=a;return c.startsWith("./")&&(c=c.slice(2),u.prefix="./"),c},e.wrapOutput=(a,u={},c={})=>{const l=c.contains?"":"^",h=c.contains?"":"$";let y=`${l}(?:${a})${h}`;return u.negated===!0&&(y=`(?:^(?!${y}).*$)`),y}})(Kn)),Kn}var Xn,ya;function Dd(){
|
|
61
|
-
if(ya)return Xn;ya=1;const e=Wt(),{CHAR_ASTERISK:t,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:h,CHAR_QUESTION_MARK:y,CHAR_RIGHT_CURLY_BRACE:_,CHAR_RIGHT_PARENTHESES:S,CHAR_RIGHT_SQUARE_BRACKET:$}=Kt(),p=d=>d===a||d===n,m=d=>{d.isPrefix!==!0&&(d.depth=d.isGlobstar?1/0:1)};return Xn=(d,g)=>{const v=g||{},w=d.length-1,E=v.parts===!0||v.scanToEnd===!0,P=[],
|
|
62
|
-
U=[];let x=d,H=-1,D=0,
|
|
63
|
-
!0,F=K.isGlob=!0,R=!0,E===!0)continue;break}if(B===_&&(b--,b===0)){q=!1,M=K.isBrace=!0,R=!0;break}}if(E===!0)continue;break}if(B===a){if(P.push(H),
|
|
61
|
+
if(ya)return Xn;ya=1;const e=Wt(),{CHAR_ASTERISK:t,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:h,CHAR_QUESTION_MARK:y,CHAR_RIGHT_CURLY_BRACE:_,CHAR_RIGHT_PARENTHESES:S,CHAR_RIGHT_SQUARE_BRACKET:$}=Kt(),p=d=>d===a||d===n,m=d=>{d.isPrefix!==!0&&(d.depth=d.isGlobstar?1/0:1)};return Xn=(d,g)=>{const v=g||{},w=d.length-1,E=v.parts===!0||v.scanToEnd===!0,P=[],I=[],
|
|
62
|
+
U=[];let x=d,H=-1,D=0,O=0,M=!1,z=!1,F=!1,G=!1,Q=!1,q=!1,A=!1,L=!1,T=!1,R=!1,b=0,C,B,K={value:"",depth:0,isGlob:!1};const ee=()=>H>=w,re=()=>x.charCodeAt(H+1),k=()=>(C=B,x.charCodeAt(++H));for(;H<w;){B=k();let J;if(B===n){A=K.backslashes=!0,B=k(),B===u&&(q=!0);continue}if(q===!0||B===u){for(b++;ee()!==!0&&(B=k());){if(B===n){A=K.backslashes=!0,k();continue}if(B===u){b++;continue}if(q!==!0&&B===s&&(B=k())===s){if(M=K.isBrace=!0,F=K.isGlob=!0,R=!0,E===!0)continue;break}if(q!==!0&&B===i){if(M=K.isBrace=
|
|
63
|
+
!0,F=K.isGlob=!0,R=!0,E===!0)continue;break}if(B===_&&(b--,b===0)){q=!1,M=K.isBrace=!0,R=!0;break}}if(E===!0)continue;break}if(B===a){if(P.push(H),I.push(K),K={value:"",depth:0,isGlob:!1},R===!0)continue;if(C===s&&H===D+1){D+=2;continue}O=H+1;continue}if(v.noext!==!0&&(B===h||B===r||B===t||B===y||B===o)===!0&&re()===c){if(F=K.isGlob=!0,G=K.isExtglob=!0,R=!0,B===o&&H===D&&(T=!0),E===!0){for(;ee()!==!0&&(B=k());){if(B===n){A=K.backslashes=!0,B=k();continue}if(B===S){F=K.isGlob=!0,R=!0;break}}continue}
|
|
64
64
|
break}if(B===t){if(C===t&&(Q=K.isGlobstar=!0),F=K.isGlob=!0,R=!0,E===!0)continue;break}if(B===y){if(F=K.isGlob=!0,R=!0,E===!0)continue;break}if(B===l){for(;ee()!==!0&&(J=k());){if(J===n){A=K.backslashes=!0,k();continue}if(J===$){z=K.isBracket=!0,F=K.isGlob=!0,R=!0;break}}if(E===!0)continue;break}if(v.nonegate!==!0&&B===o&&H===D){L=K.negated=!0,D++;continue}if(v.noparen!==!0&&B===c){if(F=K.isGlob=!0,E===!0){for(;ee()!==!0&&(B=k());){if(B===c){A=K.backslashes=!0,B=k();continue}if(B===S){R=!0;break}}
|
|
65
|
-
continue}break}if(F===!0){if(R=!0,E===!0)continue;break}}v.noext===!0&&(G=!1,F=!1);let N=x,V="",X="";D>0&&(V=x.slice(0,D),x=x.slice(D),
|
|
66
|
-
if(v.tokens===!0&&(Z.maxDepth=0,p(B)||
|
|
65
|
+
continue}break}if(F===!0){if(R=!0,E===!0)continue;break}}v.noext===!0&&(G=!1,F=!1);let N=x,V="",X="";D>0&&(V=x.slice(0,D),x=x.slice(D),O-=D),N&&F===!0&&O>0?(N=x.slice(0,O),X=x.slice(O)):F===!0?(N="",X=x):N=x,N&&N!==""&&N!=="/"&&N!==x&&p(N.charCodeAt(N.length-1))&&(N=N.slice(0,-1)),v.unescape===!0&&(X&&(X=e.removeBackslashes(X)),N&&A===!0&&(N=e.removeBackslashes(N)));const Z={prefix:V,input:d,start:D,base:N,glob:X,isBrace:M,isBracket:z,isGlob:F,isExtglob:G,isGlobstar:Q,negated:L,negatedExtglob:T};
|
|
66
|
+
if(v.tokens===!0&&(Z.maxDepth=0,p(B)||I.push(K),Z.tokens=I),v.parts===!0||v.tokens===!0){let J;for(let ue=0;ue<P.length;ue++){const we=J?J+1:D,Y=P[ue],ne=d.slice(we,Y);v.tokens&&(ue===0&&D!==0?(I[ue].isPrefix=!0,I[ue].value=V):I[ue].value=ne,m(I[ue]),Z.maxDepth+=I[ue].depth),(ue!==0||ne!=="")&&U.push(ne),J=Y}if(J&&J+1<d.length){const ue=d.slice(J+1);U.push(ue),v.tokens&&(I[I.length-1].value=ue,m(I[I.length-1]),Z.maxDepth+=I[I.length-1].depth)}Z.slashes=P,Z.parts=U}return Z},Xn}var Jn,ga;function qd(){
|
|
67
67
|
if(ga)return Jn;ga=1;const e=Kt(),t=Wt(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=e,a=(l,h)=>{if(typeof h.expandRange=="function")return h.expandRange(...l,h);l.sort();const y=`[${l.join("-")}]`;try{new RegExp(y)}catch{return l.map(S=>t.escapeRegex(S)).join("..")}return y},u=(l,h)=>`Missing ${l}: "${h}" - use "\\\\${h}" to match literal characters`,c=(l,h)=>{if(typeof l!="string")throw new TypeError("Expected a string");l=o[l]||l;
|
|
68
|
-
const y={...h},_=typeof y.maxLength=="number"?Math.min(r,y.maxLength):r;let S=l.length;if(S>_)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${_}`);const $={type:"bos",value:"",output:y.prepend||""},p=[$],m=y.capture?"":"?:",f=t.isWindows(h),d=e.globChars(f),g=e.extglobChars(d),{DOT_LITERAL:v,PLUS_LITERAL:w,SLASH_LITERAL:E,ONE_CHAR:P,DOTS_SLASH:
|
|
69
|
-
)*?)`,G=y.dot?"":U,Q=y.dot?D:
|
|
68
|
+
const y={...h},_=typeof y.maxLength=="number"?Math.min(r,y.maxLength):r;let S=l.length;if(S>_)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${_}`);const $={type:"bos",value:"",output:y.prepend||""},p=[$],m=y.capture?"":"?:",f=t.isWindows(h),d=e.globChars(f),g=e.extglobChars(d),{DOT_LITERAL:v,PLUS_LITERAL:w,SLASH_LITERAL:E,ONE_CHAR:P,DOTS_SLASH:I,NO_DOT:U,NO_DOT_SLASH:x,NO_DOTS_SLASH:H,QMARK:D,QMARK_NO_DOT:O,STAR:M,START_ANCHOR:z}=d,F=Y=>`(${m}(?:(?!${z}${Y.dot?I:v}).\
|
|
69
|
+
)*?)`,G=y.dot?"":U,Q=y.dot?D:O;let q=y.bash===!0?F(y):M;y.capture&&(q=`(${q})`),typeof y.noext=="boolean"&&(y.noextglob=y.noext);const A={input:l,index:-1,start:0,dot:y.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:p};l=t.removePrefix(l,A),S=l.length;const L=[],T=[],R=[];let b=$,C;const B=()=>A.index===S-1,K=A.peek=(Y=1)=>l[A.index+Y],ee=A.advance=()=>l[++A.index]||"",re=()=>l.slice(A.index+1),k=(Y="",ne=0)=>{A.consumed+=
|
|
70
70
|
Y,A.index+=ne},N=Y=>{A.output+=Y.output!=null?Y.output:Y.value,k(Y.value)},V=()=>{let Y=1;for(;K()==="!"&&(K(2)!=="("||K(3)==="?");)ee(),A.start++,Y++;return Y%2===0?!1:(A.negated=!0,A.start++,!0)},X=Y=>{A[Y]++,R.push(Y)},Z=Y=>{A[Y]--,R.pop()},J=Y=>{if(b.type==="globstar"){const ne=A.braces>0&&(Y.type==="comma"||Y.type==="brace"),W=Y.extglob===!0||L.length&&(Y.type==="pipe"||Y.type==="paren");Y.type!=="slash"&&Y.type!=="paren"&&!ne&&!W&&(A.output=A.output.slice(0,-b.output.length),b.type="star",
|
|
71
71
|
b.value="*",b.output=q,A.output+=b.output)}if(L.length&&Y.type!=="paren"&&(L[L.length-1].inner+=Y.value),(Y.value||Y.output)&&N(Y),b&&b.type==="text"&&Y.type==="text"){b.value+=Y.value,b.output=(b.output||"")+Y.value;return}Y.prev=b,p.push(Y),b=Y},ue=(Y,ne)=>{const W={...g[ne],conditions:1,inner:""};W.prev=b,W.parens=A.parens,W.output=A.output;const te=(y.capture?"(":"")+W.open;X("parens"),J({type:Y,value:ne,output:A.output?"":P}),J({type:"paren",extglob:!0,value:ee(),output:te}),L.push(W)},we=Y=>{
|
|
72
72
|
let ne=Y.close+(y.capture?")":""),W;if(Y.type==="negate"){let te=q;if(Y.inner&&Y.inner.length>1&&Y.inner.includes("/")&&(te=F(y)),(te!==q||B()||/^\)+$/.test(re()))&&(ne=Y.close=`)$))${te}`),Y.inner.includes("*")&&(W=re())&&/^\.[^\\/.]+$/.test(W)){const le=c(W,{...h,fastpaths:!1}).output;ne=Y.close=`)${le})${te})`}Y.prev.type==="bos"&&(A.negatedExtglob=!0)}J({type:"paren",extglob:!0,value:C,output:ne}),Z("parens")};if(y.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let Y=!1,ne=l.replace(s,(W,te,le,ye,he,Me)=>ye===
|
|
@@ -78,7 +78,7 @@ he,A.backtrack=!0,ee(),!$.output&&p.indexOf(b)===1&&($.output=P);continue}}}(C==
|
|
|
78
78
|
`(${m}${te}|${b.value})`,A.output+=b.value;continue}if(C==="{"&&y.nobrace!==!0){X("braces");const W={type:"brace",value:C,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};T.push(W),J(W);continue}if(C==="}"){const W=T[T.length-1];if(y.nobrace===!0||!W){J({type:"text",value:C,output:C});continue}let te=")";if(W.dots===!0){const le=p.slice(),ye=[];for(let he=le.length-1;he>=0&&(p.pop(),le[he].type!=="brace");he--)le[he].type!=="dots"&&ye.unshift(le[he].value);te=a(ye,y),A.backtrack=
|
|
79
79
|
!0}if(W.comma!==!0&&W.dots!==!0){const le=A.output.slice(0,W.outputIndex),ye=A.tokens.slice(W.tokensIndex);W.value=W.output="\\{",C=te="\\}",A.output=le;for(const he of ye)A.output+=he.output||he.value}J({type:"brace",value:C,output:te}),Z("braces"),T.pop();continue}if(C==="|"){L.length>0&&L[L.length-1].conditions++,J({type:"text",value:C});continue}if(C===","){let W=C;const te=T[T.length-1];te&&R[R.length-1]==="braces"&&(te.comma=!0,W="|"),J({type:"comma",value:C,output:W});continue}if(C==="/"){
|
|
80
80
|
if(b.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",p.pop(),b=$;continue}J({type:"slash",value:C,output:E});continue}if(C==="."){if(A.braces>0&&b.type==="dot"){b.value==="."&&(b.output=v);const W=T[T.length-1];b.type="dots",b.output+=C,b.value+=C,W.dots=!0;continue}if(A.braces+A.parens===0&&b.type!=="bos"&&b.type!=="slash"){J({type:"text",value:C,output:v});continue}J({type:"dot",value:C,output:v});continue}if(C==="?"){if(!(b&&b.value==="(")&&y.noextglob!==!0&&K()===
|
|
81
|
-
"("&&K(2)!=="?"){ue("qmark",C);continue}if(b&&b.type==="paren"){const te=K();let le=C;if(te==="<"&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(b.value==="("&&!/[!=<:]/.test(te)||te==="<"&&!/<([!=]|\w+>)/.test(re()))&&(le=`\\${C}`),J({type:"text",value:C,output:le});continue}if(y.dot!==!0&&(b.type==="slash"||b.type==="bos")){J({type:"qmark",value:C,output:
|
|
81
|
+
"("&&K(2)!=="?"){ue("qmark",C);continue}if(b&&b.type==="paren"){const te=K();let le=C;if(te==="<"&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(b.value==="("&&!/[!=<:]/.test(te)||te==="<"&&!/<([!=]|\w+>)/.test(re()))&&(le=`\\${C}`),J({type:"text",value:C,output:le});continue}if(y.dot!==!0&&(b.type==="slash"||b.type==="bos")){J({type:"qmark",value:C,output:O});continue}J({type:"qmark",value:C,output:D});continue}if(C==="!"){if(y.noextglob!==
|
|
82
82
|
!0&&K()==="("&&(K(2)!=="?"||!/[!=<:]/.test(K(3)))){ue("negate",C);continue}if(y.nonegate!==!0&&A.index===0){V();continue}}if(C==="+"){if(y.noextglob!==!0&&K()==="("&&K(2)!=="?"){ue("plus",C);continue}if(b&&b.value==="("||y.regex===!1){J({type:"plus",value:C,output:w});continue}if(b&&(b.type==="bracket"||b.type==="paren"||b.type==="brace")||A.parens>0){J({type:"plus",value:C});continue}J({type:"plus",value:w});continue}if(C==="@"){if(y.noextglob!==!0&&K()==="("&&K(2)!=="?"){J({type:"at",extglob:!0,
|
|
83
83
|
value:C,output:""});continue}J({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);const W=i.exec(re());W&&(C+=W[0],A.index+=W[0].length),J({type:"text",value:C});continue}if(b&&(b.type==="globstar"||b.star===!0)){b.type="star",b.star=!0,b.value+=C,b.output=q,A.backtrack=!0,A.globstar=!0,k(C);continue}let Y=re();if(y.noextglob!==!0&&/^\([^?]/.test(Y)){ue("star",C);continue}if(b.type==="star"){if(y.noglobstar===!0){k(C);continue}const W=b.prev,te=W.prev,le=W.type==="slash"||
|
|
84
84
|
W.type==="bos",ye=te&&(te.type==="star"||te.type==="globstar");if(y.bash===!0&&(!le||Y[0]&&Y[0]!=="/")){J({type:"star",value:C,output:""});continue}const he=A.braces>0&&(W.type==="comma"||W.type==="brace"),Me=L.length&&(W.type==="pipe"||W.type==="paren");if(!le&&W.type!=="paren"&&!he&&!Me){J({type:"star",value:C,output:""});continue}for(;Y.slice(0,3)==="/**";){const Ke=l[A.index+4];if(Ke&&Ke!=="/")break;Y=Y.slice(3),k("/**",3)}if(W.type==="bos"&&B()){b.type="globstar",b.value+=C,b.output=F(y),A.
|
|
@@ -86,8 +86,8 @@ output=b.output,A.globstar=!0,k(C);continue}if(W.type==="slash"&&W.prev.type!=="
|
|
|
86
86
|
y)}${E}|${E}${Ke})`,b.value+=C,A.output+=W.output+b.output,A.globstar=!0,k(C+ee()),J({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&Y[0]==="/"){b.type="globstar",b.value+=C,b.output=`(?:^|${E}|${F(y)}${E})`,A.output=b.output,A.globstar=!0,k(C+ee()),J({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-b.output.length),b.type="globstar",b.output=F(y),b.value+=C,A.output+=b.output,A.globstar=!0,k(C);continue}const ne={type:"star",value:C,output:q};if(y.bash===!0){
|
|
87
87
|
ne.output=".*?",(b.type==="bos"||b.type==="slash")&&(ne.output=G+ne.output),J(ne);continue}if(b&&(b.type==="bracket"||b.type==="paren")&&y.regex===!0){ne.output=C,J(ne);continue}(A.index===A.start||b.type==="slash"||b.type==="dot")&&(b.type==="dot"?(A.output+=x,b.output+=x):y.dot===!0?(A.output+=H,b.output+=H):(A.output+=G,b.output+=G),K()!=="*"&&(A.output+=P,b.output+=P)),J(ne)}for(;A.brackets>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing","]"));A.output=t.escapeLast(A.output,"["),
|
|
88
88
|
Z("brackets")}for(;A.parens>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing",")"));A.output=t.escapeLast(A.output,"("),Z("parens")}for(;A.braces>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing","}"));A.output=t.escapeLast(A.output,"{"),Z("braces")}if(y.strictSlashes!==!0&&(b.type==="star"||b.type==="bracket")&&J({type:"maybe_slash",value:"",output:`${E}?`}),A.backtrack===!0){A.output="";for(const Y of A.tokens)A.output+=Y.output!=null?Y.output:Y.value,Y.suffix&&(A.output+=
|
|
89
|
-
Y.suffix)}return A};return c.fastpaths=(l,h)=>{const y={...h},_=typeof y.maxLength=="number"?Math.min(r,y.maxLength):r,S=l.length;if(S>_)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${_}`);l=o[l]||l;const $=t.isWindows(h),{DOT_LITERAL:p,SLASH_LITERAL:m,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:v,NO_DOTS_SLASH:w,STAR:E,START_ANCHOR:P}=e.globChars($),
|
|
90
|
-
noglobstar===!0?D:`(${x}(?:(?!${P}${G.dot?d:p}).)*?)`,M=G=>{switch(G){case"*":return`${
|
|
89
|
+
Y.suffix)}return A};return c.fastpaths=(l,h)=>{const y={...h},_=typeof y.maxLength=="number"?Math.min(r,y.maxLength):r,S=l.length;if(S>_)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${_}`);l=o[l]||l;const $=t.isWindows(h),{DOT_LITERAL:p,SLASH_LITERAL:m,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:g,NO_DOTS:v,NO_DOTS_SLASH:w,STAR:E,START_ANCHOR:P}=e.globChars($),I=y.dot?v:g,U=y.dot?w:g,x=y.capture?"":"?:",H={negated:!1,prefix:""};let D=y.bash===!0?".*?":E;y.capture&&(D=`(${D})`);const O=G=>G.
|
|
90
|
+
noglobstar===!0?D:`(${x}(?:(?!${P}${G.dot?d:p}).)*?)`,M=G=>{switch(G){case"*":return`${I}${f}${D}`;case".*":return`${p}${f}${D}`;case"*.*":return`${I}${D}${p}${f}${D}`;case"*/*":return`${I}${D}${m}${f}${U}${D}`;case"**":return I+O(y);case"**/*":return`(?:${I}${O(y)}${m})?${U}${f}${D}`;case"**/*.*":return`(?:${I}${O(y)}${m})?${U}${D}${p}${f}${D}`;case"**/.*":return`(?:${I}${O(y)}${m})?${p}${f}${D}`;default:{const Q=/^(.*?)\.(\w+)$/.exec(G);if(!Q)return;const q=M(Q[1]);return q?q+p+Q[2]:void 0}}},
|
|
91
91
|
z=t.removePrefix(l,H);let F=M(z);return F&&y.strictSlashes!==!0&&(F+=`${m}?`),F},Jn=c,Jn}var Yn,$a;function xd(){if($a)return Yn;$a=1;const e=En,t=Dd(),r=qd(),n=Wt(),i=Kt(),s=a=>a&&typeof a=="object"&&!Array.isArray(a),o=(a,u,c=!1)=>{if(Array.isArray(a)){const m=a.map(d=>o(d,u,c));return d=>{for(const g of m){const v=g(d);if(v)return v}return!1}}const l=s(a)&&a.tokens&&a.input;if(a===""||typeof a!="string"&&!l)throw new TypeError("Expected pattern to be a non-empty string");const h=u||{},y=n.isWindows(
|
|
92
92
|
u),_=l?o.compileRe(a,u):o.makeRe(a,u,!1,!0),S=_.state;delete _.state;let $=()=>!1;if(h.ignore){const m={...u,ignore:null,onMatch:null,onResult:null};$=o(h.ignore,m,c)}const p=(m,f=!1)=>{const{isMatch:d,match:g,output:v}=o.test(m,_,u,{glob:a,posix:y}),w={glob:a,state:S,regex:_,posix:y,input:m,output:v,match:g,isMatch:d};return typeof h.onResult=="function"&&h.onResult(w),d===!1?(w.isMatch=!1,f?w:!1):$(m)?(typeof h.onIgnore=="function"&&h.onIgnore(w),w.isMatch=!1,f?w:!1):(typeof h.onMatch=="functi\
|
|
93
93
|
on"&&h.onMatch(w),f?w:!0)};return c&&(p.state=S),p};return o.test=(a,u,c,{glob:l,posix:h}={})=>{if(typeof a!="string")throw new TypeError("Expected input to be a string");if(a==="")return{isMatch:!1,output:""};const y=c||{},_=y.format||(h?n.toPosixSlashes:null);let S=a===l,$=S&&_?_(a):a;return S===!1&&($=_?_(a):a,S=$===l),(S===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?S=o.matchBase(a,u,c,h):S=u.exec($)),{isMatch:!!S,match:S,output:$}},o.matchBase=(a,u,c,l=n.isWindows(c))=>(u instanceof
|
|
@@ -242,11 +242,11 @@ export {
|
|
|
242
242
|
/* prettier-ignore-end */
|
|
243
243
|
`.trimStart()}const es=async({languageServices:e,likec4AssetsDir:t,...r})=>{const n=r.customLogger??Ad,i=Nn(),s=r?.useOverviewGraph===!0;n.info(`${j.cyan("likec4 app root")} ${j.dim(i)}`);const o=r.outputDir??oe(e.workspace,"dist");n.info(j.cyan("outDir")+" "+j.dim(o));let a="/";r.base&&(a=No(r.base),!Tf(a)&&a!=="./"&&(a=Nf(a))),a!=="/"&&n.info(`${j.green("app base url")} ${j.dim(a)}`);const u=r.webcomponentPrefix??"likec4",c=r.title??"LikeC4",l=r.outputSingleFile??!1;return{isDev:!1,likec4AssetsDir:t,
|
|
244
244
|
webcomponentPrefix:u,title:c,root:i,languageServices:e,clearScreen:!1,base:a,resolve:{conditions:["production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...jn(),"likec4/previews":t}},configFile:!1,mode:"production",optimizeDeps:{include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client","@likec4/core/types","@likec4/core/model","@likec4/core/compute-view/relationships","@likec4/core/utils","@likec4/core","\
|
|
245
|
-
likec4/model","likec4/react","likec4/vite-plugin/internal"],noDiscovery:!0},esbuild:{tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},define:{WEBCOMPONENT_PREFIX:JSON.stringify(u),PAGE_TITLE:JSON.stringify(c),__USE_OVERVIEW_GRAPH__:s?"true":"false",__USE_HASH_HISTORY__:r?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},build:{outDir:o,emptyOutDir:!1,sourcemap:!1,cssMinify:!1,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:
|
|
245
|
+
likec4/model","likec4/react","likec4/vite-plugin/internal"],noDiscovery:!0},esbuild:{tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},define:{WEBCOMPONENT_PREFIX:JSON.stringify(u),PAGE_TITLE:JSON.stringify(c),__USE_OVERVIEW_GRAPH__:s?"true":"false",__USE_HASH_HISTORY__:r?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},build:{outDir:o,emptyOutDir:!1,sourcemap:!1,cssMinify:!1,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:On,rollupOptions:{treeshake:{preset:"\
|
|
246
246
|
recommended"},...!l&&{input:[oe(i,"index.html"),oe(i,"src","main.js"),oe(i,"src","fonts.css"),oe(i,"src","style.css")],output:{manualChunks:h=>{if(!(h.endsWith(".css")||h.endsWith(".html")||h.includes("likec4/icons"))){if(h.includes("__app__")){let y=h.match(/__app__\/src\/([\w]+)\.js/)?.[1];return y?y[1]:void 0}if(h.includes("node_modules/likec4")||h.includes("node_modules/@likec4"))return"likec4";if(h.includes("node_modules"))return"vendors"}}}}}},customLogger:n,plugins:[bn(),Sn({languageServices:e.
|
|
247
247
|
languageServices,useOverviewGraph:s}),l?Wd():void 0].filter(Boolean)}};async function ts({languageServices:e,outDir:t,base:r,webcomponentPrefix:n="likec4",filename:i="likec4-views.js"}){const s=Te(["vite","webcomponent"]),o=Nn();return s.info(j.cyan("outDir")+" "+j.dim(t)),{root:o,clearScreen:!1,base:r,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:jn(),dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"]},define:{WEBCOMPONENT_PREFIX:JSON.
|
|
248
|
-
stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...Tn,tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},build:{outDir:t,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:
|
|
249
|
-
useOverviewGraph:!1})]}}const tp=["favicon.ico","robots.txt"],rp=async({buildWebcomponent:e=!0,webcomponentPrefix:t="likec4",title:r,languageServices:n,likec4AssetsDir:i,outputSingleFile:s,...o})=>{i??=await Ft(Et(Vt(),".likec4-assets-"));const{isDev:a,...u}=await es({...o,languageServices:n,likec4AssetsDir:i,webcomponentPrefix:t,title:r,outputSingleFile:s}),c=await
|
|
248
|
+
stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...Tn,tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},build:{outDir:t,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:On,lib:{entry:"src/webcomponent.js",fileName(a,u){return i},formats:["iife"],name:"LikeC4Views"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:s,plugins:[bn(),Sn({languageServices:e.languageServices,
|
|
249
|
+
useOverviewGraph:!1})]}}const tp=["favicon.ico","robots.txt"],rp=async({buildWebcomponent:e=!0,webcomponentPrefix:t="likec4",title:r,languageServices:n,likec4AssetsDir:i,outputSingleFile:s,...o})=>{i??=await Ft(Et(Vt(),".likec4-assets-"));const{isDev:a,...u}=await es({...o,languageServices:n,likec4AssetsDir:i,webcomponentPrefix:t,title:r,outputSingleFile:s}),c=await In();for(const h of tp){const y=oe(u.root,h);He(y)&&Mo(y,oe(c,h))}const l=n.languageServices.projects();if(l.length===1){const h=await n.
|
|
250
250
|
viewsService.computedViews(),y=await n.diagrams();if(y.length===0)throw process.exitCode=1,new Error("no views found");y.length===h.length?u.customLogger.info(`${j.dim("workspace:")} ${j.green("\u2713 all views layouted")}`):u.customLogger.warn(`${j.dim("workspace:")} ${j.yellow(`\u2717 layouted ${y.length} of ${h.length} views`)}`),y.forEach(_=>{_.hasLayoutDrift&&u.customLogger.warn(j.yellow("drift detected, manual layout can not be applied, view:")+" "+j.red(_.id))})}else for(const h of l){const y=await n.
|
|
251
251
|
viewsService.computedViews(h.id);y.length===0?u.customLogger.warn(`${j.dim("project:")} ${h.id} ${j.yellow("\u2717 no views found")}`):u.customLogger.info(`${j.dim("project:")} ${h.id} ${j.green(`${y.length} views`)}`)}if(e){const h=await ts({webcomponentPrefix:t,languageServices:n,outDir:c,base:u.base});await At(h)}if(await At({...u,publicDir:c,mode:"production"}),s)for(let h of Hf(oe(u.build.outDir)).filter(y=>y!=="index.html"))vn(oe(u.build.outDir,h),{recursive:!0});else{const h=oe(u.build.outDir,
|
|
252
252
|
"index.html");He(h)&&Mo(h,oe(u.build.outDir,"404.html"))}};function rs(e,t){return r=>r.length>1?[e,t,r[0],"--",...r.slice(1)]:[e,t,r[0]]}function np(){return e=>["deno","run",`npm:${e[0]}`,...e.slice(1)]}const sp={agent:["npm",0],run:rs("npm","run"),install:["npm","i",0],frozen:["npm","ci",0],global:["npm","i","-g",0],add:["npm","i",0],upgrade:["npm","update",0],"upgrade-interactive":null,execute:["npx",0],"execute-local":["npx",0],uninstall:["npm","uninstall",0],global_uninstall:["npm","uninst\
|
|
@@ -259,19 +259,19 @@ install","-g",0],add:["deno","add",0],upgrade:["deno","outdated","--update",0],"
|
|
|
259
259
|
resolve(e.stopDir);i=o=>o===s}else i=e.stopDir;for(const s of dp(t)){for(const o of r)switch(o){case"lockfile":{for(const a of Object.keys(Aa))if(await ns(ie.join(s,a),"file")){const u=Aa[a],c=await Ca(ie.join(s,"package.json"),n);return c||{name:u,agent:u}}break}case"packageManager-field":case"devEngines-field":{const a=await Ca(ie.join(s,"package.json"),n);if(a)return a;break}case"install-metadata":{for(const a of Object.keys(Pa)){const u=a.endsWith("/")?"dir":"file";if(await ns(ie.join(s,a),u)){
|
|
260
260
|
const c=Pa[a],l=c==="yarn"?yp(a)?"yarn":"yarn@berry":c;return{name:c,agent:l}}}break}}if(i?.(s))break}return null}function hp(e){const t=r=>r?.match(/\d+(\.\d+){0,2}/)?.[0]??r;if(typeof e.packageManager=="string"){const[r,n]=e.packageManager.replace(/^\^/,"").split("@");return{name:r,ver:t(n)}}if(typeof e.devEngines?.packageManager?.name=="string")return{name:e.devEngines.packageManager.name,ver:t(e.devEngines.packageManager.version)}}async function mp(e,t){try{const r=JSON.parse(await zo.readFile(
|
|
261
261
|
e,"utf8"));let n;const i=hp(r);if(i){const s=i.name,o=i.ver;let a=o;return s==="yarn"&&o&&Number.parseInt(o)>1?(n="yarn@berry",a="berry",{name:s,agent:n,version:a}):s==="pnpm"&&o&&Number.parseInt(o)<7?(n="pnpm@6",{name:s,agent:n,version:a}):fp.includes(s)?(n=s,{name:s,agent:n,version:a}):t?.(r.packageManager)??null}}catch{}return null}function yp(e){return e.endsWith(".yarn_integrity")}function ka(e){try{return!!od.createRequire(import.meta.url).resolve(e)}catch(t){return Ae.debug(Mt(t)),!1}}async function Ct(){
|
|
262
|
-
if(ka("react")&&ka("react-dom")){Ae.debug("react already installed");return}Ae.debug("react not installed");const e=await pp();e||(Ae.error`Package manager not detected, please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));const t=up(e.agent,"add",["react","react-dom"]);t||(Ae.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));try{await
|
|
263
|
-
react"} ${"react-dom"}`,process.exit(1)}}function Ta(e){if(e.resolvedUrls)return
|
|
262
|
+
if(ka("react")&&ka("react-dom")){Ae.debug("react already installed");return}Ae.debug("react not installed");const e=await pp();e||(Ae.error`Package manager not detected, please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));const t=up(e.agent,"add",["react","react-dom"]);t||(Ae.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));try{await Io(t.command,t.args,{stdio:"inherit"})}catch(r){Ae.debug(Mt(r)),Ae.error`Please install dependencies manually: ${"\
|
|
263
|
+
react"} ${"react-dom"}`,process.exit(1)}}function Ta(e){if(e.resolvedUrls)return Oo(e.resolvedUrls.network)??Oo(e.resolvedUrls.local)}function Na(e){if(!e.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");We([j.green("LikeC4 served at:"),"",j.dim("Local: ")+e.resolvedUrls.local.join(`
|
|
264
264
|
`+"".padEnd(9," ")),e.resolvedUrls.network.length?j.dim("Network: ")+e.resolvedUrls.network.join(`
|
|
265
|
-
`+"".padEnd(9," ")):void 0].filter(t=>
|
|
266
|
-
`))}class
|
|
267
|
-
try{await
|
|
268
|
-
responding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}kt===void 0&&(kt=setTimeout(()=>{kt=void 0,dt.old=dt.young,dt.young=new Set},gp),kt.unref&&kt.unref());const n=$p();for(const i of vp(t))try{if(r.has(i))continue;let s=await ja({...e,port:i},n);for(;dt.old.has(s)||dt.young.has(s);){if(i!==0)throw new
|
|
269
|
-
if(!["EADDRINUSE","EACCES"].includes(s.code)&&!(s instanceof
|
|
270
|
-
i;s++)yield s}(e,t)}async function La({buildWebcomponent:e=!0,hmr:t=!0,webcomponentPrefix:r="likec4",title:n,languageServices:i,likec4AssetsDir:s,openBrowser:o,listen:a,...u}){s??=await Ft(Et(Vt(),".likec4-assets-"));const{isDev:c,...l}=await es({...u,languageServices:i,likec4AssetsDir:s,webcomponentPrefix:r,title:n}),h=l.customLogger,y=await ss({port:[5173,...Yt(61e3,61010),...Yt(62002,62010)]}),_=await ss({port:Yt(24678,24690)}),S=await
|
|
265
|
+
`+"".padEnd(9," ")):void 0].filter(t=>If(t)).join(`
|
|
266
|
+
`))}class Ia extends Error{constructor(t){super(`${t} is locked`)}}const dt={old:new Set,young:new Set},gp=1e3*15,Xt=1024,Jt=65535;let kt;const $p=()=>{const e=Rt.networkInterfaces(),t=new Set([void 0,"0.0.0.0"]);for(const r of Object.values(e))for(const n of r)t.add(n.address);return t},Oa=e=>new Promise((t,r)=>{const n=ad.createServer();n.unref(),n.on("error",r),n.listen(e,()=>{const{port:i}=n.address();n.close(()=>{t(i)})})}),ja=async(e,t)=>{if(e.host||e.port===0)return Oa(e);for(const r of t)
|
|
267
|
+
try{await Oa({port:e.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return e.port},vp=function*(e){e&&(yield*e),yield 0};async function ss(e){let t,r=new Set;if(e&&(e.port&&(t=typeof e.port=="number"?[e.port]:e.port),e.exclude)){const i=e.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const s of i){if(typeof s!="number")throw new TypeError("Each item in the `exclude` option must be a number cor\
|
|
268
|
+
responding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}kt===void 0&&(kt=setTimeout(()=>{kt=void 0,dt.old=dt.young,dt.young=new Set},gp),kt.unref&&kt.unref());const n=$p();for(const i of vp(t))try{if(r.has(i))continue;let s=await ja({...e,port:i},n);for(;dt.old.has(s)||dt.young.has(s);){if(i!==0)throw new Ia(i);s=await ja({...e,port:i},n)}return dt.young.add(s),s}catch(s){
|
|
269
|
+
if(!["EADDRINUSE","EACCES"].includes(s.code)&&!(s instanceof Ia))throw s}throw new Error("No available ports found")}function Yt(e,t){if(!Number.isInteger(e)||!Number.isInteger(t))throw new TypeError("`from` and `to` must be integer numbers");if(e<Xt||e>Jt)throw new RangeError(`'from' must be between ${Xt} and ${Jt}`);if(t<Xt||t>Jt)throw new RangeError(`'to' must be between ${Xt} and ${Jt}`);if(e>t)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,i){for(let s=n;s<=
|
|
270
|
+
i;s++)yield s}(e,t)}async function La({buildWebcomponent:e=!0,hmr:t=!0,webcomponentPrefix:r="likec4",title:n,languageServices:i,likec4AssetsDir:s,openBrowser:o,listen:a,...u}){s??=await Ft(Et(Vt(),".likec4-assets-"));const{isDev:c,...l}=await es({...u,languageServices:i,likec4AssetsDir:s,webcomponentPrefix:r,title:n}),h=l.customLogger,y=await ss({port:[5173,...Yt(61e3,61010),...Yt(62002,62010)]}),_=await ss({port:Yt(24678,24690)}),S=await In(),$=a??(Fe()?"0.0.0.0":"localhost");t?(h.info(`Enablin\
|
|
271
271
|
g HMR: localhost:${_}`),Fe()&&h.info(j.yellow(`ensure port ${_} is published from container`))):h.info("Disabling HMR");const p=await nd({...l,define:t?{...l.define,"process.env.NODE_ENV":'"development"'}:l.define,mode:t?"development":l.mode,publicDir:S,server:{host:$,allowedHosts:!0,port:y,hmr:t&&{overlay:!0,port:_},fs:{strict:!1},open:o??(!c&&!Fe())}});return await p.listen(),e?(h.info("Building webcomponent"),(async()=>{try{const m=await ts({webcomponentPrefix:r,languageServices:i,outDir:S,base:l.
|
|
272
272
|
base});await At({...m,logLevel:"warn"})}catch(m){h.warn(Mt(m)),h.warn("webcomponent build failed, ignoring error and continue")}})()):h.info("Skip webcomponent build"),p}async function _p({browserContext:e,views:t,output:r,logger:n,timeout:i,maxAttempts:s,dynamicVariant:o,outputType:a,theme:u}){let c;const l=t.map(_=>({view:_,attempt:1})),h=[];let y;for(;y=l.shift();){const{view:_,attempt:S}=y,$=`export/${encodeURIComponent(_.id)}/`;try{if(S>1){c&&(c.close({runBeforeUnload:!0}).catch(v=>n.error(
|
|
273
273
|
`failed to close page: ${v}`)),c=void 0);const g=jo(S*200,{min:200,max:1e3});n.info(j.cyan($)+j.dim(` attempt ${S} of ${s} after ${g}ms`)),await id(g)}else _.hasLayoutDrift&&n.warn(j.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+j.red(_.id));let p=".";a==="relative"&&(p=_.sourcePath??".",p.includes("/")?p=p.slice(0,p.lastIndexOf("/")):p=".");const m=oe(r,p,`${_.id}.png`);c??=await e.newPage();let f=_.bounds;o==="sequence"&&_._type==="dynamic"&&(f=_.sequenceLayout.
|
|
274
|
-
bounds);const d=20;await c.setViewportSize({width:f.width+40+d,height:f.height+40+d}),await c.goto(
|
|
274
|
+
bounds);const d=20;await c.setViewportSize({width:f.width+40+d,height:f.height+40+d}),await c.goto(Of($,{padding:20,theme:u,dynamic:o})),n.info(j.cyan($)+j.dim(` -> ${Ue(r,m)}`)),await c.waitForSelector(".react-flow.initialized"),_.nodes.some(g=>jf(g.icon)&&g.icon.toLowerCase().startsWith("http"))&&await wp(c,i),await c.getByTestId("export-page").screenshot({animations:"disabled",path:m,omitBackground:!0}),h.push({view:_,path:m})}catch(p){c?.close({runBeforeUnload:!0}).catch(m=>n.error(`failed t\
|
|
275
275
|
o close page: ${m}`)),n.error(j.red("failed "+$+`
|
|
276
276
|
`+p)),S<s&&(l.push({view:_,attempt:S+1}),n.info(j.dim(`retry ${$}`))),c=void 0}}return h}async function wp(e,t){let r=await e.locator("//img").all();if(!r.length)return;const n=r.map(i=>i.evaluate(s=>s.complete||new Promise(o=>{s.onload=o,s.onerror=o}),{timeout:Math.max(15e3,t)}));await Promise.allSettled(n)}var Da=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),qa=e=>{throw TypeError(e)},bp=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&qa("Object expected");var n,i;n=t[Da("asyn\
|
|
277
277
|
cDispose")],n===void 0&&(n=t[Da("dispose")],i=n),typeof n!="function"&&qa("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.push([r,n,t])}else e.push([r]);return t},Ep=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])
|
|
@@ -280,8 +280,8 @@ return Promise.resolve(a).then(s,u=>(i(u),s()))}catch(u){i(u)}if(r)throw t};retu
|
|
|
280
280
|
`);const _=await y.newContext({deviceScaleFactor:2,colorScheme:r,baseURL:t,bypassCSP:!0,ignoreHTTPSErrors:!0,isMobile:!1});_.setDefaultNavigationTimeout(n),_.setDefaultTimeout(n);try{return await _p({browserContext:_,views:i,output:s,outputType:o,logger:e,maxAttempts:a,dynamicVariant:c?"sequence":"diagram",timeout:n,theme:r})}finally{e.info(j.cyan("close chromium")),await _.close(),await y.close()}}async function Ma({path:e,useDotBin:t,theme:r="light",output:n,outputType:i,serverUrl:s,ignore:o=!1,
|
|
281
281
|
timeoutMs:a=1e4,maxAttempts:u=3,filter:c,sequence:l=!1,chromiumSandbox:h=!1}){var y=[];try{const p=Te("export"),m=Ff(),f=bp(y,await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1}),!0);n??=f.workspace;let d;const g=f.languageServices.projects();if(!s&&(p.info(j.cyan("start preview server")),d=await La({languageServices:f,buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,hmr:!1}),s=Ta(d),!s))throw p.error("Vite server is not ready, no resolvedUrls"),new Error("Vite se\
|
|
282
282
|
rver is not ready, no resolvedUrls");for(const v of g){g.length>1&&(p.info(j.dim("---------")),p.info(`${j.dim("project:")} ${v.id}`),p.info(`${j.dim("folder:")} ${v.folder.fsPath}`));let w=await f.diagrams(v.id);if(c&&bt(c,1)&&bt(w,1)){const x=Lf(c);p.info(`${j.cyan("filter")} ${j.dim(JSON.stringify(c))}`),w=w.filter(H=>x(H.id)?(p.info(`${j.green("include")} ${H.id} \u2705`),!0):(p.info(`${j.gray("skip")} ${j.dim(H.id)}`),!1))}if(!bt(w,1)){p.warn("no views found");continue}let E=g.length>1?No(Lo(
|
|
283
|
-
s,"project",v.id)):s,P=g.length>1?Lo(n,v.id):n;const
|
|
284
|
-
`),
|
|
283
|
+
s,"project",v.id)):s,P=g.length>1?Lo(n,v.id):n;const I=await xa({logger:p,serverUrl:E,theme:r,timeoutMs:a,views:w,output:P,outputType:i,maxAttempts:u,sequence:l,chromiumSandbox:h}),{pretty:U}=Df(m);if(I.length>0&&p.info(j.green(`exported ${I.length} views in ${U}`)+`
|
|
284
|
+
`),I.length!==w.length&&(o&&I.length>0?p.info(j.dim("ignore")+" "+j.red(`failed ${w.length-I.length} out of ${w.length} views`)):p.error(j.red(`failed ${w.length-I.length} out of ${w.length} views`))),I.length!==w.length&&(I.length===0||!o))throw new Error(`Failed ${w.length-I.length} out of ${w.length} views`)}d&&(p.info(j.cyan("stop server")),await d.close().catch(v=>{p.error(v)}))}catch(p){var _=p,S=!0}finally{var $=Ep(y,_,S);$&&await $}}var Ha=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ua=e=>{
|
|
285
285
|
throw TypeError(e)},Sp=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Ua("Object expected");var n,i;n=t[Ha("asyncDispose")],n===void 0&&(n=t[Ha("dispose")],i=n),typeof n!="function"&&Ua("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.push([r,n,t])}else e.push([r]);return t},Rp=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},
|
|
286
286
|
i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(s,u=>(i(u),s()))}catch(u){i(u)}if(r)throw t};return s()};const{cyan:Fa,dim:Va}=j;async function Ap({path:e,useDotBin:t,useHashHistory:r,webcomponentPrefix:n,title:i,useOverview:s=!1,output:o,outputSingleFile:a,base:u}){var c=[];try{await Ct();const _=Te("c4:build"),S=Sp(c,await Pe.fromWorkspace(e,{graphviz:t?"binary":"wasm",logger:"vi\
|
|
287
287
|
te",watch:!1}),!0),$=o??oe(S.workspace,"dist");let p=oe($,"assets");if(s)try{p=oe($,"assets","previews"),await xe(p,{recursive:!0}),_.info(`${Fa("Generate previews")} ${Va(p)}
|
|
@@ -292,9 +292,9 @@ switch(s){case"\\":{if(n==="index")throw new Error("Invalid character in an inde
|
|
|
292
292
|
break}if(n==="property"){if(os.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Cp.has(s))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=s}}switch(i&&(r+="\\"),n){case"property":{if(os.has(r))return[];t.push(
|
|
293
293
|
r);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}function as(e,t){if(typeof t!="number"&&Array.isArray(e)){const r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function za(e,t){if(as(e,t))throw new Error("Cannot use string index")}function kp(e,t,r){if(!rt(e)||typeof t!="string")return r===void 0?e:r;const n=Qt(t);if(n.length===0)return r;for(let i=0;i<n.length;i++){const s=n[i];if(as(e,s)?e=i===n.length-1?void 0:null:
|
|
294
294
|
e=e[s],e==null){if(i!==n.length-1)return r;break}}return e===void 0?r:e}function Ga(e,t,r){if(!rt(e)||typeof t!="string")return e;const n=e,i=Qt(t);for(let s=0;s<i.length;s++){const o=i[s];za(e,o),s===i.length-1?e[o]=r:rt(e[o])||(e[o]=typeof i[s+1]=="number"?[]:{}),e=e[o]}return n}function Tp(e,t){if(!rt(e)||typeof t!="string")return!1;const r=Qt(t);for(let n=0;n<r.length;n++){const i=r[n];if(za(e,i),n===r.length-1)return delete e[i],!0;if(e=e[i],!rt(e))return!1}}function Np(e,t){if(!rt(e)||typeof t!=
|
|
295
|
-
"string")return!1;const r=Qt(t);if(r.length===0)return!1;for(const n of r){if(!rt(e)||!(n in e)||as(e,n))return!1;e=e[n]}return!0}const Je=Rt.homedir(),is=Rt.tmpdir(),{env:pt}=me,
|
|
295
|
+
"string")return!1;const r=Qt(t);if(r.length===0)return!1;for(const n of r){if(!rt(e)||!(n in e)||as(e,n))return!1;e=e[n]}return!0}const Je=Rt.homedir(),is=Rt.tmpdir(),{env:pt}=me,Ip=e=>{const t=ie.join(Je,"Library");return{data:ie.join(t,"Application Support",e),config:ie.join(t,"Preferences",e),cache:ie.join(t,"Caches",e),log:ie.join(t,"Logs",e),temp:ie.join(is,e)}},Op=e=>{const t=pt.APPDATA||ie.join(Je,"AppData","Roaming"),r=pt.LOCALAPPDATA||ie.join(Je,"AppData","Local");return{data:ie.join(r,
|
|
296
296
|
e,"Data"),config:ie.join(t,e,"Config"),cache:ie.join(r,e,"Cache"),log:ie.join(r,e,"Log"),temp:ie.join(is,e)}},jp=e=>{const t=ie.basename(Je);return{data:ie.join(pt.XDG_DATA_HOME||ie.join(Je,".local","share"),e),config:ie.join(pt.XDG_CONFIG_HOME||ie.join(Je,".config"),e),cache:ie.join(pt.XDG_CACHE_HOME||ie.join(Je,".cache"),e),log:ie.join(pt.XDG_STATE_HOME||ie.join(Je,".local","state"),e),temp:ie.join(is,t,e)}};function Lp(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw new TypeError(`Expec\
|
|
297
|
-
ted a string, got ${typeof e}`);return t&&(e+=`-${t}`),me.platform==="darwin"?
|
|
297
|
+
ted a string, got ${typeof e}`);return t&&(e+=`-${t}`),me.platform==="darwin"?Ip(e):me.platform==="win32"?Op(e):jp(e)}const Ye=(e,t)=>function(...n){return e.apply(void 0,n).catch(t)},Ve=(e,t)=>function(...n){try{return e.apply(void 0,n)}catch(i){return t(i)}},Dp=me.getuid?!me.getuid():!1,qp=1e4,Ce=()=>{},pe={isChangeErrorOk:e=>{if(!pe.isNodeError(e))return!1;const{code:t}=e;return t==="ENOSYS"||!Dp&&(t==="EINVAL"||t==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!pe.isNodeError(
|
|
298
298
|
e))return!1;const{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!pe.isNodeError(e))throw e;if(!pe.isChangeErrorOk(e))throw e}};class xp{constructor(){this.interval=25,this.intervalId=void 0,this.limit=qp,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),
|
|
299
299
|
delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{const r=()=>this.remove(n),n=()=>t(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t),this.queueActive.
|
|
300
300
|
add(t),t()}}}}}const Mp=new xp,Qe=(e,t)=>function(n){return function i(...s){return Mp.schedule().then(o=>{const a=c=>(o(),c),u=c=>{if(o(),Date.now()>=n)throw c;if(t(c)){const l=Math.round(100*Math.random());return new Promise(y=>setTimeout(y,l)).then(()=>i.apply(void 0,s))}throw c};return e.apply(void 0,s).then(a,u)})}},Ze=(e,t)=>function(n){return function i(...s){try{return e.apply(void 0,s)}catch(o){if(Date.now()>n)throw o;if(t(o))return i.apply(void 0,s);throw o}}},ve={attempt:{chmod:Ye($e(
|
|
@@ -320,30 +320,30 @@ opts._n}`}else if(f=y?.(m))_=(0,t._)`${_}${f}${this.opts._n}`;else throw new r(m
|
|
|
320
320
|
_}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.
|
|
321
321
|
regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=Za();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t.
|
|
322
322
|
_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(R,b){return this}}class o extends s{constructor(R,b,C){super(),this.varKind=R,this.name=b,this.rhs=C}render({es5:R,_n:b}){const C=R?r.varKinds.var:this.varKind,B=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${B};`+b}optimizeNames(R,b){if(R[this.name.
|
|
323
|
-
str])return this.rhs&&(this.rhs=
|
|
323
|
+
str])return this.rhs&&(this.rhs=O(this.rhs,R,b)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends s{constructor(R,b,C){super(),this.lhs=R,this.rhs=b,this.sideEffects=C}render({_n:R}){return`${this.lhs} = ${this.rhs};`+R}optimizeNames(R,b){if(!(this.lhs instanceof t.Name&&!R[this.lhs.str]&&!this.sideEffects))return this.rhs=O(this.rhs,R,b),this}get names(){const R=this.lhs instanceof t.Name?{}:{...this.lhs.names};return D(R,this.rhs)}}class u extends a{constructor(R,b,C,B){
|
|
324
324
|
super(R,C,B),this.op=b}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}}class c extends s{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`${this.label}:`+R}}class l extends s{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`break${this.label?` ${this.label}`:""};`+R}}class h extends s{constructor(R){super(),this.error=R}render({_n:R}){return`throw ${this.error};`+R}get names(){return this.error.names}}class y extends s{constructor(R){super(),
|
|
325
|
-
this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,b){return this.code=
|
|
325
|
+
this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,b){return this.code=O(this.code,R,b),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class _ extends s{constructor(R=[]){super(),this.nodes=R}render(R){return this.nodes.reduce((b,C)=>b+C.render(R),"")}optimizeNodes(){const{nodes:R}=this;let b=R.length;for(;b--;){const C=R[b].optimizeNodes();Array.isArray(C)?R.splice(b,1,...C):C?R[b]=C:R.splice(b,1)}return R.
|
|
326
326
|
length>0?this:void 0}optimizeNames(R,b){const{nodes:C}=this;let B=C.length;for(;B--;){const K=C[B];K.optimizeNames(R,b)||(M(R,K.names),C.splice(B,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((R,b)=>H(R,b.names),{})}}class S extends _{render(R){return"{"+R._n+super.render(R)+"}"+R._n}}class $ extends _{}class p extends S{}p.kind="else";class m extends S{constructor(R,b){super(b),this.condition=R}render(R){let b=`if(${this.condition})`+super.render(R);return this.else&&(b+=
|
|
327
327
|
"else "+this.else.render(R)),b}optimizeNodes(){super.optimizeNodes();const R=this.condition;if(R===!0)return this.nodes;let b=this.else;if(b){const C=b.optimizeNodes();b=this.else=Array.isArray(C)?new p(C):C}if(b)return R===!1?b instanceof m?b:b.nodes:this.nodes.length?this:new m(z(R),b instanceof m?[b]:b.nodes);if(!(R===!1||!this.nodes.length))return this}optimizeNames(R,b){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(R,b),!!(super.optimizeNames(R,b)||this.else))return this.
|
|
328
|
-
condition=
|
|
328
|
+
condition=O(this.condition,R,b),this}get names(){const R=super.names;return D(R,this.condition),this.else&&H(R,this.else.names),R}}m.kind="if";class f extends S{}f.kind="for";class d extends f{constructor(R){super(),this.iteration=R}render(R){return`for(${this.iteration})`+super.render(R)}optimizeNames(R,b){if(super.optimizeNames(R,b))return this.iteration=O(this.iteration,R,b),this}get names(){return H(super.names,this.iteration.names)}}class g extends f{constructor(R,b,C,B){super(),this.varKind=
|
|
329
329
|
R,this.name=b,this.from=C,this.to=B}render(R){const b=R.es5?r.varKinds.var:this.varKind,{name:C,from:B,to:K}=this;return`for(${b} ${C}=${B}; ${C}<${K}; ${C}++)`+super.render(R)}get names(){const R=D(super.names,this.from);return D(R,this.to)}}class v extends f{constructor(R,b,C,B){super(),this.loop=R,this.varKind=b,this.name=C,this.iterable=B}render(R){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(R)}optimizeNames(R,b){if(super.optimizeNames(R,b))return this.
|
|
330
|
-
iterable=
|
|
331
|
-
b}optimizeNodes(){var R,b;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(b=this.finally)===null||b===void 0||b.optimizeNodes(),this}optimizeNames(R,b){var C,B;return super.optimizeNames(R,b),(C=this.catch)===null||C===void 0||C.optimizeNames(R,b),(B=this.finally)===null||B===void 0||B.optimizeNames(R,b),this}get names(){const R=super.names;return this.catch&&H(R,this.catch.names),this.finally&&H(R,this.finally.names),R}}class
|
|
332
|
-
this.error=R}render(R){return`catch(${this.error})`+super.render(R)}}
|
|
330
|
+
iterable=O(this.iterable,R,b),this}get names(){return H(super.names,this.iterable.names)}}class w extends S{constructor(R,b,C){super(),this.name=R,this.args=b,this.async=C}render(R){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(R)}}w.kind="func";class E extends _{render(R){return"return "+super.render(R)}}E.kind="return";class P extends S{render(R){let b="try"+super.render(R);return this.catch&&(b+=this.catch.render(R)),this.finally&&(b+=this.finally.render(R)),
|
|
331
|
+
b}optimizeNodes(){var R,b;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(b=this.finally)===null||b===void 0||b.optimizeNodes(),this}optimizeNames(R,b){var C,B;return super.optimizeNames(R,b),(C=this.catch)===null||C===void 0||C.optimizeNames(R,b),(B=this.finally)===null||B===void 0||B.optimizeNames(R,b),this}get names(){const R=super.names;return this.catch&&H(R,this.catch.names),this.finally&&H(R,this.finally.names),R}}class I extends S{constructor(R){super(),
|
|
332
|
+
this.error=R}render(R){return`catch(${this.error})`+super.render(R)}}I.kind="catch";class U extends S{render(R){return"finally"+super.render(R)}}U.kind="finally";class x{constructor(R,b={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...b,_n:b.lines?`
|
|
333
333
|
`:""},this._extScope=R,this._scope=new r.Scope({parent:R}),this._nodes=[new $]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,b){const C=this._extScope.value(R,b);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(R,b){return this._extScope.getValue(R,b)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,b,C,B){
|
|
334
334
|
const K=this._scope.toName(b);return C!==void 0&&B&&(this._constants[K.str]=C),this._leafNode(new o(R,K,C)),K}const(R,b,C){return this._def(r.varKinds.const,R,b,C)}let(R,b,C){return this._def(r.varKinds.let,R,b,C)}var(R,b,C){return this._def(r.varKinds.var,R,b,C)}assign(R,b,C){return this._leafNode(new a(R,b,C))}add(R,b){return this._leafNode(new u(R,e.operators.ADD,b))}code(R){return typeof R=="function"?R():R!==t.nil&&this._leafNode(new y(R)),this}object(...R){const b=["{"];for(const[C,B]of R)
|
|
335
335
|
b.length>1&&b.push(","),b.push(C),(C!==B||this.opts.es5)&&(b.push(":"),(0,t.addCodeArg)(b,B));return b.push("}"),new t._Code(b)}if(R,b,C){if(this._blockNode(new m(R)),b&&C)this.code(b).else().code(C).endIf();else if(b)this.code(b).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new m(R))}else(){return this._elseNode(new p)}endIf(){return this._endBlockNode(m,p)}_for(R,b){return this._blockNode(R),b&&this.code(b).endFor(),this}for(R,b){
|
|
336
336
|
return this._for(new d(R),b)}forRange(R,b,C,B,K=this.opts.es5?r.varKinds.var:r.varKinds.let){const ee=this._scope.toName(R);return this._for(new g(K,ee,b,C),()=>B(ee))}forOf(R,b,C,B=r.varKinds.const){const K=this._scope.toName(R);if(this.opts.es5){const ee=b instanceof t.Name?b:this.var("_arr",b);return this.forRange("_i",0,(0,t._)`${ee}.length`,re=>{this.var(K,(0,t._)`${ee}[${re}]`),C(K)})}return this._for(new v("of",B,K,b),()=>C(K))}forIn(R,b,C,B=this.opts.es5?r.varKinds.var:r.varKinds.const){
|
|
337
337
|
if(this.opts.ownProperties)return this.forOf(R,(0,t._)`Object.keys(${b})`,C);const K=this._scope.toName(R);return this._for(new v("in",B,K,b),()=>C(K))}endFor(){return this._endBlockNode(f)}label(R){return this._leafNode(new c(R))}break(R){return this._leafNode(new l(R))}return(R){const b=new E;if(this._blockNode(b),this.code(R),b.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(R,b,C){if(!b&&!C)throw new Error('CodeGen: "try" without "c\
|
|
338
|
-
atch" and "finally"');const B=new P;if(this._blockNode(B),this.code(R),b){const K=this.name("e");this._currNode=B.catch=new
|
|
338
|
+
atch" and "finally"');const B=new P;if(this._blockNode(B),this.code(R),b){const K=this.name("e");this._currNode=B.catch=new I(K),b(K)}return C&&(this._currNode=B.finally=new U,this.code(C)),this._endBlockNode(I,U)}throw(R){return this._leafNode(new h(R))}block(R,b){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(b),this}endBlock(R){const b=this._blockStarts.pop();if(b===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-b;if(C<0||
|
|
339
339
|
R!==void 0&&C!==R)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${R} expected`);return this._nodes.length=b,this}func(R,b=t.nil,C,B){return this._blockNode(new w(R,b,C)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,b){
|
|
340
340
|
const C=this._currNode;if(C instanceof R||b&&C instanceof b)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${b?`${R.kind}/${b.kind}`:R.kind}"`)}_elseNode(R){const b=this._currNode;if(!(b instanceof m))throw new Error('CodeGen: "else" without "if"');return this._currNode=b.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const b=this._nodes;b[b.length-1]=R}}e.CodeGen=x;function H(T,R){for(const b in R)T[b]=
|
|
341
|
-
(T[b]||0)+(R[b]||0);return T}function D(T,R){return R instanceof t._CodeOrName?H(T,R.names):T}function
|
|
341
|
+
(T[b]||0)+(R[b]||0);return T}function D(T,R){return R instanceof t._CodeOrName?H(T,R.names):T}function O(T,R,b){if(T instanceof t.Name)return C(T);if(!B(T))return T;return new t._Code(T._items.reduce((K,ee)=>(ee instanceof t.Name&&(ee=C(ee)),ee instanceof t._Code?K.push(...ee._items):K.push(ee),K),[]));function C(K){const ee=b[K.str];return ee===void 0||R[K.str]!==1?K:(delete R[K.str],ee)}function B(K){return K instanceof t._Code&&K._items.some(ee=>ee instanceof t.Name&&R[ee.str]===1&&b[ee.str]!==
|
|
342
342
|
void 0)}}function M(T,R){for(const b in R)T[b]=(T[b]||0)-(R[b]||0)}function z(T){return typeof T=="boolean"||typeof T=="number"||T===null?!T:(0,t._)`!${L(T)}`}e.not=z;const F=A(e.operators.AND);function G(...T){return T.reduce(F)}e.and=G;const Q=A(e.operators.OR);function q(...T){return T.reduce(Q)}e.or=q;function A(T){return(R,b)=>R===t.nil?b:b===t.nil?R:(0,t._)`${L(R)} ${T} ${L(b)}`}function L(T){return T instanceof t.Name?T:(0,t._)`(${T})`}})(ds)),ds}var ce={},ti;function fe(){if(ti)return ce;
|
|
343
343
|
ti=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.checkStrictMode=ce.getErrorPath=ce.Type=ce.useFunc=ce.setEvaluated=ce.evaluatedPropsToName=ce.mergeEvaluated=ce.eachItem=ce.unescapeJsonPointer=ce.escapeJsonPointer=ce.escapeFragment=ce.unescapeFragment=ce.schemaRefOrVal=ce.schemaHasRulesButRef=ce.schemaHasRules=ce.checkUnknownRules=ce.alwaysValidSchema=ce.toHash=void 0;const e=ae(),t=er();function r(v){const w={};for(const E of v)w[E]=!0;return w}ce.toHash=r;function n(v,w){return typeof w==
|
|
344
|
-
"boolean"?w:Object.keys(w).length===0?!0:(i(v,w),!s(w,v.self.RULES.all))}ce.alwaysValidSchema=n;function i(v,w=v.schema){const{opts:E,self:P}=v;if(!E.strictSchema||typeof w=="boolean")return;const
|
|
345
|
-
return!1}ce.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:w},E,P,
|
|
346
|
-
return v.replace(/~1/g,"/").replace(/~0/g,"~")}ce.unescapeJsonPointer=h;function y(v,w){if(Array.isArray(v))for(const E of v)w(E);else w(v)}ce.eachItem=y;function _({mergeNames:v,mergeToName:w,mergeValues:E,resultToName:P}){return(
|
|
344
|
+
"boolean"?w:Object.keys(w).length===0?!0:(i(v,w),!s(w,v.self.RULES.all))}ce.alwaysValidSchema=n;function i(v,w=v.schema){const{opts:E,self:P}=v;if(!E.strictSchema||typeof w=="boolean")return;const I=P.RULES.keywords;for(const U in w)I[U]||g(v,`unknown keyword: "${U}"`)}ce.checkUnknownRules=i;function s(v,w){if(typeof v=="boolean")return!v;for(const E in v)if(w[E])return!0;return!1}ce.schemaHasRules=s;function o(v,w){if(typeof v=="boolean")return!v;for(const E in v)if(E!=="$ref"&&w.all[E])return!0;
|
|
345
|
+
return!1}ce.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:w},E,P,I){if(!I){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,e._)`${E}`}return(0,e._)`${v}${w}${(0,e.getProperty)(P)}`}ce.schemaRefOrVal=a;function u(v){return h(decodeURIComponent(v))}ce.unescapeFragment=u;function c(v){return encodeURIComponent(l(v))}ce.escapeFragment=c;function l(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}ce.escapeJsonPointer=l;function h(v){
|
|
346
|
+
return v.replace(/~1/g,"/").replace(/~0/g,"~")}ce.unescapeJsonPointer=h;function y(v,w){if(Array.isArray(v))for(const E of v)w(E);else w(v)}ce.eachItem=y;function _({mergeNames:v,mergeToName:w,mergeValues:E,resultToName:P}){return(I,U,x,H)=>{const D=x===void 0?U:x instanceof e.Name?(U instanceof e.Name?v(I,U,x):w(I,U,x),x):U instanceof e.Name?(w(I,x,U),U):E(U,x);return H===e.Name&&!(D instanceof e.Name)?P(I,D):D}}ce.mergeEvaluated={props:_({mergeNames:(v,w,E)=>v.if((0,e._)`${E} !== true && ${w} !== undefined`,
|
|
347
347
|
()=>{v.if((0,e._)`${w} === true`,()=>v.assign(E,!0),()=>v.assign(E,(0,e._)`${E} || {}`).code((0,e._)`Object.assign(${E}, ${w})`))}),mergeToName:(v,w,E)=>v.if((0,e._)`${E} !== true`,()=>{w===!0?v.assign(E,!0):(v.assign(E,(0,e._)`${E} || {}`),$(v,E,w))}),mergeValues:(v,w)=>v===!0?!0:{...v,...w},resultToName:S}),items:_({mergeNames:(v,w,E)=>v.if((0,e._)`${E} !== true && ${w} !== undefined`,()=>v.assign(E,(0,e._)`${w} === true ? true : ${E} > ${w} ? ${E} : ${w}`)),mergeToName:(v,w,E)=>v.if((0,e._)`${E} !== true`,
|
|
348
348
|
()=>v.assign(E,w===!0?!0:(0,e._)`${E} > ${w} ? ${E} : ${w}`)),mergeValues:(v,w)=>v===!0?!0:Math.max(v,w),resultToName:(v,w)=>v.var("items",w)})};function S(v,w){if(w===!0)return v.var("props",!0);const E=v.var("props",(0,e._)`{}`);return w!==void 0&&$(v,E,w),E}ce.evaluatedPropsToName=S;function $(v,w,E){Object.keys(E).forEach(P=>v.assign((0,e._)`${w}${(0,e.getProperty)(P)}`,!0))}ce.setEvaluated=$;const p={};function m(v,w){return v.scopeValue("func",{ref:w,code:p[w.code]||(p[w.code]=new t._Code(
|
|
349
349
|
w.code))})}ce.useFunc=m;var f;(function(v){v[v.Num=0]="Num",v[v.Str=1]="Str"})(f||(ce.Type=f={}));function d(v,w,E){if(v instanceof e.Name){const P=w===f.Num;return E?P?(0,e._)`"[" + ${v} + "]"`:(0,e._)`"['" + ${v} + "']"`:P?(0,e._)`"/" + ${v}`:(0,e._)`"/" + ${v}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,e.getProperty)(v).toString():"/"+l(v)}ce.getErrorPath=d;function g(v,w,E=v.opts.strictSchema){if(E){if(w=`strict mode: ${w}`,E===!0)throw new Error(w);v.self.logger.warn(w)}}return ce.
|
|
@@ -353,34 +353,34 @@ keyword:p,schemaType:m})=>m?(0,t.str)`"${p}" keyword must be ${m} ($data)`:(0,t.
|
|
|
353
353
|
()=>p.if(m,()=>p.assign((0,t._)`${n.default.vErrors}.length`,m),()=>p.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;function a({gen:p,keyword:m,schemaValue:f,data:d,errsCount:g,it:v}){if(g===void 0)throw new Error("ajv implementation error");const w=p.name("err");p.forRange("i",g,n.default.errors,E=>{p.const(w,(0,t._)`${n.default.vErrors}[${E}]`),p.if((0,t._)`${w}.instancePath === undefined`,()=>p.assign((0,t._)`${w}.instancePath`,(0,t.strConcat)(n.default.instancePath,v.errorPath))),p.assign(
|
|
354
354
|
(0,t._)`${w}.schemaPath`,(0,t.str)`${v.errSchemaPath}/${m}`),v.opts.verbose&&(p.assign((0,t._)`${w}.schema`,f),p.assign((0,t._)`${w}.data`,d))})}e.extendErrors=a;function u(p,m){const f=p.const("err",m);p.if((0,t._)`${n.default.vErrors} === null`,()=>p.assign(n.default.vErrors,(0,t._)`[${f}]`),(0,t._)`${n.default.vErrors}.push(${f})`),p.code((0,t._)`${n.default.errors}++`)}function c(p,m){const{gen:f,validateName:d,schemaEnv:g}=p;g.$async?f.throw((0,t._)`new ${p.ValidationError}(${m})`):(f.assign(
|
|
355
355
|
(0,t._)`${d}.errors`,m),f.return(!1))}const l={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 h(p,m,f){const{createErrors:d}=p.it;return d===!1?(0,t._)`{}`:y(p,m,f)}function y(p,m,f={}){const{gen:d,it:g}=p,v=[_(g,f),S(p,f)];return $(p,m,v),d.object(...v)}function _({errorPath:p},{instancePath:m}){const f=m?
|
|
356
|
-
(0,t.str)`${p}${(0,r.getErrorPath)(m,r.Type.Str)}`:p;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,f)]}function S({keyword:p,it:{errSchemaPath:m}},{schemaPath:f,parentSchema:d}){let g=d?m:(0,t.str)`${m}/${p}`;return f&&(g=(0,t.str)`${g}${(0,r.getErrorPath)(f,r.Type.Str)}`),[l.schemaPath,g]}function $(p,{params:m,message:f},d){const{keyword:g,data:v,schemaValue:w,it:E}=p,{opts:P,propertyName:
|
|
357
|
-
m(p):m||(0,t._)`{}`]),P.messages&&d.push([l.message,typeof f=="function"?f(p):f]),P.verbose&&d.push([l.schema,w],[l.parentSchema,(0,t._)`${U}${x}`],[n.default.data,v]),
|
|
356
|
+
(0,t.str)`${p}${(0,r.getErrorPath)(m,r.Type.Str)}`:p;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,f)]}function S({keyword:p,it:{errSchemaPath:m}},{schemaPath:f,parentSchema:d}){let g=d?m:(0,t.str)`${m}/${p}`;return f&&(g=(0,t.str)`${g}${(0,r.getErrorPath)(f,r.Type.Str)}`),[l.schemaPath,g]}function $(p,{params:m,message:f},d){const{keyword:g,data:v,schemaValue:w,it:E}=p,{opts:P,propertyName:I,topSchemaRef:U,schemaPath:x}=E;d.push([l.keyword,g],[l.params,typeof m=="function"?
|
|
357
|
+
m(p):m||(0,t._)`{}`]),P.messages&&d.push([l.message,typeof f=="function"?f(p):f]),P.verbose&&d.push([l.schema,w],[l.parentSchema,(0,t._)`${U}${x}`],[n.default.data,v]),I&&d.push([l.propertyName,I])}})(fs)),fs}var si;function Qp(){if(si)return nt;si=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.boolOrEmptySchema=nt.topBoolOrEmptySchema=void 0;const e=rr(),t=ae(),r=Ne(),n={message:"boolean schema is false"};function i(a){const{gen:u,schema:c,validateName:l}=a;c===!1?o(a,!1):typeof c=="obj\
|
|
358
358
|
ect"&&c.$async===!0?u.return(r.default.data):(u.assign((0,t._)`${l}.errors`,null),u.return(!0))}nt.topBoolOrEmptySchema=i;function s(a,u){const{gen:c,schema:l}=a;l===!1?(c.var(u,!1),o(a)):c.var(u,!0)}nt.boolOrEmptySchema=s;function o(a,u){const{gen:c,data:l}=a,h={gen:c,keyword:"false schema",data:l,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(h,n,void 0,u)}return nt}var ge={},st={},oi;function ai(){if(oi)return st;oi=1,Object.defineProperty(st,"__esModule",{value:!0}),
|
|
359
359
|
st.getRules=st.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(i){return typeof i=="string"&&t.has(i)}st.isJSONType=r;function n(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return st.getRules=n,st}var Ge={},
|
|
360
360
|
ii;function ci(){if(ii)return Ge;ii=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.shouldUseRule=Ge.shouldUseGroup=Ge.schemaHasRulesForType=void 0;function e({schema:n,self:i},s){const o=i.RULES.types[s];return o&&o!==!0&&t(n,o)}Ge.schemaHasRulesForType=e;function t(n,i){return i.rules.some(s=>r(n,s))}Ge.shouldUseGroup=t;function r(n,i){var s;return n[i.keyword]!==void 0||((s=i.definition.implements)===null||s===void 0?void 0:s.some(o=>n[o]!==void 0))}return Ge.shouldUseRule=r,Ge}var ui;
|
|
361
361
|
function nr(){if(ui)return ge;ui=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.reportTypeError=ge.checkDataTypes=ge.checkDataType=ge.coerceAndCheckDataType=ge.getJSONTypes=ge.getSchemaTypes=ge.DataType=void 0;const e=ai(),t=ci(),r=rr(),n=ae(),i=fe();var s;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(s||(ge.DataType=s={}));function o(f){const d=a(f.type);if(d.includes("null")){if(f.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!d.length&&
|
|
362
|
-
f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&d.push("null")}return d}ge.getSchemaTypes=o;function a(f){const d=Array.isArray(f)?f:f?[f]:[];if(d.every(e.isJSONType))return d;throw new Error("type must be JSONType or JSONType[]: "+d.join(","))}ge.getJSONTypes=a;function u(f,d){const{gen:g,data:v,opts:w}=f,E=l(d,w.coerceTypes),P=d.length>0&&!(E.length===0&&d.length===1&&(0,t.schemaHasRulesForType)(f,d[0]));if(P){const
|
|
363
|
-
g.if(
|
|
364
|
-
if(S(d,w,E.strictNumbers),()=>v.assign(
|
|
365
|
-
|| (${P} == "string" && ${w} && ${w} == +${w})`).assign(
|
|
366
|
-
|| (${P} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(
|
|
367
|
-
|| ${P} === "boolean" || ${w} === null`).assign(
|
|
368
|
-
P((0,n._)`!(${d} % 1) && !isNaN(${d})`);break;case"number":E=P();break;default:return(0,n._)`typeof ${d} ${w} ${f}`}return v===s.Correct?E:(0,n.not)(E);function P(
|
|
362
|
+
f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&d.push("null")}return d}ge.getSchemaTypes=o;function a(f){const d=Array.isArray(f)?f:f?[f]:[];if(d.every(e.isJSONType))return d;throw new Error("type must be JSONType or JSONType[]: "+d.join(","))}ge.getJSONTypes=a;function u(f,d){const{gen:g,data:v,opts:w}=f,E=l(d,w.coerceTypes),P=d.length>0&&!(E.length===0&&d.length===1&&(0,t.schemaHasRulesForType)(f,d[0]));if(P){const I=S(d,v,w.strictNumbers,s.Wrong);
|
|
363
|
+
g.if(I,()=>{E.length?h(f,d,E):p(f)})}return P}ge.coerceAndCheckDataType=u;const c=new Set(["string","number","integer","boolean","null"]);function l(f,d){return d?f.filter(g=>c.has(g)||d==="array"&&g==="array"):[]}function h(f,d,g){const{gen:v,data:w,opts:E}=f,P=v.let("dataType",(0,n._)`typeof ${w}`),I=v.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&v.if((0,n._)`${P} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>v.assign(w,(0,n._)`${w}[0]`).assign(P,(0,n._)`typeof ${w}`).
|
|
364
|
+
if(S(d,w,E.strictNumbers),()=>v.assign(I,w))),v.if((0,n._)`${I} !== undefined`);for(const x of g)(c.has(x)||x==="array"&&E.coerceTypes==="array")&&U(x);v.else(),p(f),v.endIf(),v.if((0,n._)`${I} !== undefined`,()=>{v.assign(w,I),y(f,I)});function U(x){switch(x){case"string":v.elseIf((0,n._)`${P} == "number" || ${P} == "boolean"`).assign(I,(0,n._)`"" + ${w}`).elseIf((0,n._)`${w} === null`).assign(I,(0,n._)`""`);return;case"number":v.elseIf((0,n._)`${P} == "boolean" || ${w} === null
|
|
365
|
+
|| (${P} == "string" && ${w} && ${w} == +${w})`).assign(I,(0,n._)`+${w}`);return;case"integer":v.elseIf((0,n._)`${P} === "boolean" || ${w} === null
|
|
366
|
+
|| (${P} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(I,(0,n._)`+${w}`);return;case"boolean":v.elseIf((0,n._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(I,!1).elseIf((0,n._)`${w} === "true" || ${w} === 1`).assign(I,!0);return;case"null":v.elseIf((0,n._)`${w} === "" || ${w} === 0 || ${w} === false`),v.assign(I,null);return;case"array":v.elseIf((0,n._)`${P} === "string" || ${P} === "number"
|
|
367
|
+
|| ${P} === "boolean" || ${w} === null`).assign(I,(0,n._)`[${w}]`)}}}function y({gen:f,parentData:d,parentDataProperty:g},v){f.if((0,n._)`${d} !== undefined`,()=>f.assign((0,n._)`${d}[${g}]`,v))}function _(f,d,g,v=s.Correct){const w=v===s.Correct?n.operators.EQ:n.operators.NEQ;let E;switch(f){case"null":return(0,n._)`${d} ${w} null`;case"array":E=(0,n._)`Array.isArray(${d})`;break;case"object":E=(0,n._)`${d} && typeof ${d} == "object" && !Array.isArray(${d})`;break;case"integer":E=
|
|
368
|
+
P((0,n._)`!(${d} % 1) && !isNaN(${d})`);break;case"number":E=P();break;default:return(0,n._)`typeof ${d} ${w} ${f}`}return v===s.Correct?E:(0,n.not)(E);function P(I=n.nil){return(0,n.and)((0,n._)`typeof ${d} == "number"`,I,g?(0,n._)`isFinite(${d})`:n.nil)}}ge.checkDataType=_;function S(f,d,g,v){if(f.length===1)return _(f[0],d,g,v);let w;const E=(0,i.toHash)(f);if(E.array&&E.object){const P=(0,n._)`typeof ${d} != "object"`;w=E.null?P:(0,n._)`!${d} || ${P}`,delete E.null,delete E.array,delete E.object}else
|
|
369
369
|
w=n.nil;E.number&&delete E.integer;for(const P in E)w=(0,n.and)(w,_(P,d,g,v));return w}ge.checkDataTypes=S;const $={message:({schema:f})=>`must be ${f}`,params:({schema:f,schemaValue:d})=>typeof f=="string"?(0,n._)`{type: ${f}}`:(0,n._)`{type: ${d}}`};function p(f){const d=m(f);(0,r.reportError)(d,$)}ge.reportTypeError=p;function m(f){const{gen:d,data:g,schema:v}=f,w=(0,i.schemaRefOrVal)(f,v,"type");return{gen:d,keyword:"type",data:g,schema:v.type,schemaCode:w,schemaValue:w,parentSchema:v,params:{},
|
|
370
370
|
it:f}}return ge}var Tt={},li;function Zp(){if(li)return Tt;li=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.assignDefaults=void 0;const e=ae(),t=fe();function r(i,s){const{properties:o,items:a}=i.schema;if(s==="object"&&o)for(const u in o)n(i,u,o[u].default);else s==="array"&&Array.isArray(a)&&a.forEach((u,c)=>n(i,c,u.default))}Tt.assignDefaults=r;function n(i,s,o){const{gen:a,compositeRule:u,data:c,opts:l}=i;if(o===void 0)return;const h=(0,e._)`${c}${(0,e.getProperty)(s)}`;if(u){(0,t.checkStrictMode)(
|
|
371
|
-
i,`default is ignored for: ${h}`);return}let y=(0,e._)`${h} === undefined`;l.useDefaults==="empty"&&(y=(0,e._)`${y} || ${h} === null || ${h} === ""`),a.if(y,(0,e._)`${h} = ${(0,e.stringify)(o)}`)}return Tt}var
|
|
371
|
+
i,`default is ignored for: ${h}`);return}let y=(0,e._)`${h} === undefined`;l.useDefaults==="empty"&&(y=(0,e._)`${y} || ${h} === null || ${h} === ""`),a.if(y,(0,e._)`${h} = ${(0,e.stringify)(o)}`)}return Tt}var Ie={},de={},fi;function Oe(){if(fi)return de;fi=1,Object.defineProperty(de,"__esModule",{value:!0}),de.validateUnion=de.validateArray=de.usePattern=de.callValidateCode=de.schemaProperties=de.allSchemaProperties=de.noPropertyInData=de.propertyInData=de.isOwnProperty=de.hasPropFunc=de.reportMissingProp=
|
|
372
372
|
de.checkMissingProp=de.checkReportMissingProp=void 0;const e=ae(),t=fe(),r=Ne(),n=fe();function i(f,d){const{gen:g,data:v,it:w}=f;g.if(l(g,v,d,w.opts.ownProperties),()=>{f.setParams({missingProperty:(0,e._)`${d}`},!0),f.error()})}de.checkReportMissingProp=i;function s({gen:f,data:d,it:{opts:g}},v,w){return(0,e.or)(...v.map(E=>(0,e.and)(l(f,d,E,g.ownProperties),(0,e._)`${w} = ${E}`)))}de.checkMissingProp=s;function o(f,d){f.setParams({missingProperty:d},!0),f.error()}de.reportMissingProp=o;function a(f){
|
|
373
373
|
return f.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}de.hasPropFunc=a;function u(f,d,g){return(0,e._)`${a(f)}.call(${d}, ${g})`}de.isOwnProperty=u;function c(f,d,g,v){const w=(0,e._)`${d}${(0,e.getProperty)(g)} !== undefined`;return v?(0,e._)`${w} && ${u(f,d,g)}`:w}de.propertyInData=c;function l(f,d,g,v){const w=(0,e._)`${d}${(0,e.getProperty)(g)} === undefined`;return v?(0,e.or)(w,(0,e.not)(u(f,d,g))):w}de.noPropertyInData=l;function h(f){
|
|
374
|
-
return f?Object.keys(f).filter(d=>d!=="__proto__"):[]}de.allSchemaProperties=h;function y(f,d){return h(d).filter(g=>!(0,t.alwaysValidSchema)(f,d[g]))}de.schemaProperties=y;function _({schemaCode:f,data:d,it:{gen:g,topSchemaRef:v,schemaPath:w,errorPath:E},it:P},
|
|
375
|
-
P.opts.dynamicRef&&D.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const
|
|
376
|
-
data:g,keyword:v,it:w}=f,E=d.name("valid");if(w.allErrors){const
|
|
377
|
-
!w.opts.unevaluated)return;const P=d.let("valid",!1),
|
|
378
|
-
const e=ae(),t=Ne(),r=
|
|
379
|
-
_.compile.call(g.self,m,f,g):_.validate,w=c($,p,v),E=$.let("valid");y.block$data(E,P),y.ok((S=_.valid)!==null&&S!==void 0?S:E);function P(){if(_.errors===!1)x(),_.modifying&&o(y),H(()=>y.error());else{const D=_.async?
|
|
380
|
-
return $.assign(D,null),x(e.nil),D}function x(D=_.async?(0,e._)`await `:e.nil){const
|
|
374
|
+
return f?Object.keys(f).filter(d=>d!=="__proto__"):[]}de.allSchemaProperties=h;function y(f,d){return h(d).filter(g=>!(0,t.alwaysValidSchema)(f,d[g]))}de.schemaProperties=y;function _({schemaCode:f,data:d,it:{gen:g,topSchemaRef:v,schemaPath:w,errorPath:E},it:P},I,U,x){const H=x?(0,e._)`${f}, ${d}, ${v}${w}`:d,D=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,E)],[r.default.parentData,P.parentData],[r.default.parentDataProperty,P.parentDataProperty],[r.default.rootData,r.default.rootData]];
|
|
375
|
+
P.opts.dynamicRef&&D.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const O=(0,e._)`${H}, ${g.object(...D)}`;return U!==e.nil?(0,e._)`${I}.call(${U}, ${O})`:(0,e._)`${I}(${O})`}de.callValidateCode=_;const S=(0,e._)`new RegExp`;function $({gen:f,it:{opts:d}},g){const v=d.unicodeRegExp?"u":"",{regExp:w}=d.code,E=w(g,v);return f.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,e._)`${w.code==="new RegExp"?S:(0,n.useFunc)(f,w)}(${g}, ${v})`})}de.usePattern=$;function p(f){const{gen:d,
|
|
376
|
+
data:g,keyword:v,it:w}=f,E=d.name("valid");if(w.allErrors){const I=d.let("valid",!0);return P(()=>d.assign(I,!1)),I}return d.var(E,!0),P(()=>d.break()),E;function P(I){const U=d.const("len",(0,e._)`${g}.length`);d.forRange("i",0,U,x=>{f.subschema({keyword:v,dataProp:x,dataPropType:t.Type.Num},E),d.if((0,e.not)(E),I)})}}de.validateArray=p;function m(f){const{gen:d,schema:g,keyword:v,it:w}=f;if(!Array.isArray(g))throw new Error("ajv implementation error");if(g.some(U=>(0,t.alwaysValidSchema)(w,U))&&
|
|
377
|
+
!w.opts.unevaluated)return;const P=d.let("valid",!1),I=d.name("_valid");d.block(()=>g.forEach((U,x)=>{const H=f.subschema({keyword:v,schemaProp:x,compositeRule:!0},I);d.assign(P,(0,e._)`${P} || ${I}`),f.mergeValidEvaluated(H,I)||d.if((0,e.not)(P))})),f.result(P,()=>f.reset(),()=>f.error(!0))}return de.validateUnion=m,de}var di;function eh(){if(di)return Ie;di=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.validateKeywordUsage=Ie.validSchemaType=Ie.funcKeywordCode=Ie.macroKeywordCode=void 0;
|
|
378
|
+
const e=ae(),t=Ne(),r=Oe(),n=rr();function i(y,_){const{gen:S,keyword:$,schema:p,parentSchema:m,it:f}=y,d=_.macro.call(f.self,p,m,f),g=c(S,$,d);f.opts.validateSchema!==!1&&f.self.validateSchema(d,!0);const v=S.name("valid");y.subschema({schema:d,schemaPath:e.nil,errSchemaPath:`${f.errSchemaPath}/${$}`,topSchemaRef:g,compositeRule:!0},v),y.pass(v,()=>y.error(!0))}Ie.macroKeywordCode=i;function s(y,_){var S;const{gen:$,keyword:p,schema:m,parentSchema:f,$data:d,it:g}=y;u(g,_);const v=!d&&_.compile?
|
|
379
|
+
_.compile.call(g.self,m,f,g):_.validate,w=c($,p,v),E=$.let("valid");y.block$data(E,P),y.ok((S=_.valid)!==null&&S!==void 0?S:E);function P(){if(_.errors===!1)x(),_.modifying&&o(y),H(()=>y.error());else{const D=_.async?I():U();_.modifying&&o(y),H(()=>a(y,D))}}function I(){const D=$.let("ruleErrs",null);return $.try(()=>x((0,e._)`await `),O=>$.assign(E,!1).if((0,e._)`${O} instanceof ${g.ValidationError}`,()=>$.assign(D,(0,e._)`${O}.errors`),()=>$.throw(O))),D}function U(){const D=(0,e._)`${w}.errors`;
|
|
380
|
+
return $.assign(D,null),x(e.nil),D}function x(D=_.async?(0,e._)`await `:e.nil){const O=g.opts.passContext?t.default.this:t.default.self,M=!("compile"in _&&!d||_.schema===!1);$.assign(E,(0,e._)`${D}${(0,r.callValidateCode)(y,w,O,M)}`,_.modifying)}function H(D){var O;$.if((0,e.not)((O=_.valid)!==null&&O!==void 0?O:E),D)}}Ie.funcKeywordCode=s;function o(y){const{gen:_,data:S,it:$}=y;_.if($.parentData,()=>_.assign(S,(0,e._)`${$.parentData}[${$.parentDataProperty}]`))}function a(y,_){const{gen:S}=y;S.
|
|
381
381
|
if((0,e._)`Array.isArray(${_})`,()=>{S.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${_} : ${t.default.vErrors}.concat(${_})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(y)},()=>y.error())}function u({schemaEnv:y},_){if(_.async&&!y.$async)throw new Error("async keyword in sync schema")}function c(y,_,S){if(S===void 0)throw new Error(`keyword "${_}" failed to compile`);return y.scopeValue("keyword",typeof S=="function"?{ref:S}:{ref:S,code:(0,e.
|
|
382
|
-
stringify)(S)})}function l(y,_,S=!1){return!_.length||_.some($=>$==="array"?Array.isArray(y):$==="object"?y&&typeof y=="object"&&!Array.isArray(y):typeof y==$||S&&typeof y>"u")}
|
|
383
|
-
f ${m}: ${f.join(",")}`);if(p.validateSchema&&!p.validateSchema(y[m])){const g=`keyword "${m}" value is invalid at path "${$}": `+S.errorsText(p.validateSchema.errors);if(_.validateSchema==="log")S.logger.error(g);else throw new Error(g)}}return
|
|
382
|
+
stringify)(S)})}function l(y,_,S=!1){return!_.length||_.some($=>$==="array"?Array.isArray(y):$==="object"?y&&typeof y=="object"&&!Array.isArray(y):typeof y==$||S&&typeof y>"u")}Ie.validSchemaType=l;function h({schema:y,opts:_,self:S,errSchemaPath:$},p,m){if(Array.isArray(p.keyword)?!p.keyword.includes(m):p.keyword!==m)throw new Error("ajv implementation error");const f=p.dependencies;if(f?.some(d=>!Object.prototype.hasOwnProperty.call(y,d)))throw new Error(`parent schema must have dependencies o\
|
|
383
|
+
f ${m}: ${f.join(",")}`);if(p.validateSchema&&!p.validateSchema(y[m])){const g=`keyword "${m}" value is invalid at path "${$}": `+S.errorsText(p.validateSchema.errors);if(_.validateSchema==="log")S.logger.error(g);else throw new Error(g)}}return Ie.validateKeywordUsage=h,Ie}var Be={},pi;function th(){if(pi)return Be;pi=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.extendSubschemaMode=Be.extendSubschemaData=Be.getSubschema=void 0;const e=ae(),t=fe();function r(s,{keyword:o,schemaProp:a,schema:u,
|
|
384
384
|
schemaPath:c,errSchemaPath:l,topSchemaRef:h}){if(o!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const y=s.schema[o];return a===void 0?{schema:y,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(o)}`,errSchemaPath:`${s.errSchemaPath}/${o}`}:{schema:y[a],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(o)}${(0,e.getProperty)(a)}`,errSchemaPath:`${s.errSchemaPath}/${o}/${(0,t.escapeFragment)(a)}`}}if(u!==void 0){if(c===void 0||
|
|
385
385
|
l===void 0||h===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:c,topSchemaRef:h,errSchemaPath:l}}throw new Error('either "keyword" or "schema" must be passed')}Be.getSubschema=r;function n(s,o,{dataProp:a,dataPropType:u,data:c,dataTypes:l,propertyName:h}){if(c!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:y}=o;if(a!==void 0){const{errorPath:S,dataPathArr:$,opts:p}=o,
|
|
386
386
|
m=y.let("data",(0,e._)`${o.data}${(0,e.getProperty)(a)}`,!0);_(m),s.errorPath=(0,e.str)`${S}${(0,t.getErrorPath)(a,u,p.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${a}`,s.dataPathArr=[...$,s.parentDataProperty]}if(c!==void 0){const S=c instanceof e.Name?c:y.let("data",c,!0);_(S),h!==void 0&&(s.propertyName=h)}l&&(s.dataTypes=l);function _(S){s.data=S,s.dataLevel=o.dataLevel+1,s.dataTypes=[],o.definedProperties=new Set,s.parentData=o.data,s.dataNames=[...o.dataNames,S]}}Be.extendSubschemaData=
|
|
@@ -389,16 +389,16 @@ n;function i(s,{jtdDiscriminator:o,jtdMetadata:a,compositeRule:u,createErrors:c,
|
|
|
389
389
|
function t(n,i,s,o,a,u,c,l,h,y){if(o&&typeof o=="object"&&!Array.isArray(o)){i(o,a,u,c,l,h,y);for(var _ in o){var S=o[_];if(Array.isArray(S)){if(_ in e.arrayKeywords)for(var $=0;$<S.length;$++)t(n,i,s,S[$],a+"/"+_+"/"+$,u,a,_,o,$)}else if(_ in e.propsKeywords){if(S&&typeof S=="object")for(var p in S)t(n,i,s,S[p],a+"/"+_+"/"+r(p),u,a,_,o,p)}else(_ in e.keywords||n.allKeys&&!(_ in e.skipKeywords))&&t(n,i,s,S,a+"/"+_,u,a,_,o)}s(o,a,u,c,l,h,y)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,
|
|
390
390
|
"~1")}return ms.exports}var mi;function sr(){if(mi)return Ee;mi=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.getSchemaRefs=Ee.resolveUrl=Ee.normalizeId=Ee._getFullPath=Ee.getFullPath=Ee.inlineRef=void 0;const e=fe(),t=Do(),r=rh(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i($,p=!0){return typeof $=="boolean"?!0:p===!0?!o($):p?a($)<=
|
|
391
391
|
p:!1}Ee.inlineRef=i;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o($){for(const p in $){if(s.has(p))return!0;const m=$[p];if(Array.isArray(m)&&m.some(o)||typeof m=="object"&&o(m))return!0}return!1}function a($){let p=0;for(const m in $){if(m==="$ref")return 1/0;if(p++,!n.has(m)&&(typeof $[m]=="object"&&(0,e.eachItem)($[m],f=>p+=a(f)),p===1/0))return 1/0}return p}function u($,p="",m){m!==!1&&(p=h(p));const f=$.parse(p);return c($,f)}Ee.getFullPath=
|
|
392
|
-
u;function c($,p){return $.serialize(p).split("#")[0]+"#"}Ee._getFullPath=c;const l=/#\/?$/;function h($){return $?$.replace(l,""):""}Ee.normalizeId=h;function y($,p,m){return m=h(m),$.resolve(p,m)}Ee.resolveUrl=y;const _=/^[a-z_][-a-z0-9._]*$/i;function S($,p){if(typeof $=="boolean")return{};const{schemaId:m,uriResolver:f}=this.opts,d=h($[m]||p),g={"":d},v=u(f,d,!1),w={},E=new Set;return r($,{allKeys:!0},(U,x,H,D)=>{if(D===void 0)return;const
|
|
393
|
-
U[m])),F.call(this,U.$anchor),F.call(this,U.$dynamicAnchor),g[x]=M;function z(G){const Q=this.opts.uriResolver.resolve;if(G=h(M?Q(M,G):G),E.has(G))throw
|
|
392
|
+
u;function c($,p){return $.serialize(p).split("#")[0]+"#"}Ee._getFullPath=c;const l=/#\/?$/;function h($){return $?$.replace(l,""):""}Ee.normalizeId=h;function y($,p,m){return m=h(m),$.resolve(p,m)}Ee.resolveUrl=y;const _=/^[a-z_][-a-z0-9._]*$/i;function S($,p){if(typeof $=="boolean")return{};const{schemaId:m,uriResolver:f}=this.opts,d=h($[m]||p),g={"":d},v=u(f,d,!1),w={},E=new Set;return r($,{allKeys:!0},(U,x,H,D)=>{if(D===void 0)return;const O=v+x;let M=g[D];typeof U[m]=="string"&&(M=z.call(this,
|
|
393
|
+
U[m])),F.call(this,U.$anchor),F.call(this,U.$dynamicAnchor),g[x]=M;function z(G){const Q=this.opts.uriResolver.resolve;if(G=h(M?Q(M,G):G),E.has(G))throw I(G);E.add(G);let q=this.refs[G];return typeof q=="string"&&(q=this.refs[q]),typeof q=="object"?P(U,q.schema,G):G!==h(O)&&(G[0]==="#"?(P(U,w[G],G),w[G]=U):this.refs[G]=O),G}function F(G){if(typeof G=="string"){if(!_.test(G))throw new Error(`invalid anchor "${G}"`);z.call(this,`#${G}`)}}}),w;function P(U,x,H){if(x!==void 0&&!t(U,x))throw I(H)}function I(U){
|
|
394
394
|
return new Error(`reference "${U}" resolves to more than one schema`)}}return Ee.getSchemaRefs=S,Ee}var yi;function Nt(){if(yi)return ze;yi=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.getData=ze.KeywordCxt=ze.validateFunctionCode=void 0;const e=Qp(),t=nr(),r=ci(),n=nr(),i=Zp(),s=eh(),o=th(),a=ae(),u=Ne(),c=sr(),l=fe(),h=rr();function y(k){if(v(k)&&(E(k),g(k))){p(k);return}_(k,()=>(0,e.topBoolOrEmptySchema)(k))}ze.validateFunctionCode=y;function _({gen:k,validateName:N,schema:V,schemaEnv:X,
|
|
395
395
|
opts:Z},J){Z.code.es5?k.func(N,(0,a._)`${u.default.data}, ${u.default.valCxt}`,X.$async,()=>{k.code((0,a._)`"use strict"; ${f(V,Z)}`),$(k,Z),k.code(J)}):k.func(N,(0,a._)`${u.default.data}, ${S(Z)}`,X.$async,()=>k.code(f(V,Z)).code(J))}function S(k){return(0,a._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${k.dynamicRef?(0,a._)`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}function $(k,N){k.if(u.default.valCxt,()=>{
|
|
396
396
|
k.var(u.default.instancePath,(0,a._)`${u.default.valCxt}.${u.default.instancePath}`),k.var(u.default.parentData,(0,a._)`${u.default.valCxt}.${u.default.parentData}`),k.var(u.default.parentDataProperty,(0,a._)`${u.default.valCxt}.${u.default.parentDataProperty}`),k.var(u.default.rootData,(0,a._)`${u.default.valCxt}.${u.default.rootData}`),N.dynamicRef&&k.var(u.default.dynamicAnchors,(0,a._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{k.var(u.default.instancePath,(0,a._)`""`),k.var(u.default.
|
|
397
|
-
parentData,(0,a._)`undefined`),k.var(u.default.parentDataProperty,(0,a._)`undefined`),k.var(u.default.rootData,u.default.data),N.dynamicRef&&k.var(u.default.dynamicAnchors,(0,a._)`{}`)})}function p(k){const{schema:N,opts:V,gen:X}=k;_(k,()=>{V.$comment&&N.$comment&&D(k),U(k),X.let(u.default.vErrors,null),X.let(u.default.errors,0),V.unevaluated&&m(k),P(k),
|
|
397
|
+
parentData,(0,a._)`undefined`),k.var(u.default.parentDataProperty,(0,a._)`undefined`),k.var(u.default.rootData,u.default.data),N.dynamicRef&&k.var(u.default.dynamicAnchors,(0,a._)`{}`)})}function p(k){const{schema:N,opts:V,gen:X}=k;_(k,()=>{V.$comment&&N.$comment&&D(k),U(k),X.let(u.default.vErrors,null),X.let(u.default.errors,0),V.unevaluated&&m(k),P(k),O(k)})}function m(k){const{gen:N,validateName:V}=k;k.evaluated=N.const("evaluated",(0,a._)`${V}.evaluated`),N.if((0,a._)`${k.evaluated}.dynamicProps`,
|
|
398
398
|
()=>N.assign((0,a._)`${k.evaluated}.props`,(0,a._)`undefined`)),N.if((0,a._)`${k.evaluated}.dynamicItems`,()=>N.assign((0,a._)`${k.evaluated}.items`,(0,a._)`undefined`))}function f(k,N){const V=typeof k=="object"&&k[N.schemaId];return V&&(N.code.source||N.code.process)?(0,a._)`/*# sourceURL=${V} */`:a.nil}function d(k,N){if(v(k)&&(E(k),g(k))){w(k,N);return}(0,e.boolOrEmptySchema)(k,N)}function g({schema:k,self:N}){if(typeof k=="boolean")return!k;for(const V in k)if(N.RULES.all[V])return!0;return!1}
|
|
399
|
-
function v(k){return typeof k.schema!="boolean"}function w(k,N){const{schema:V,gen:X,opts:Z}=k;Z.$comment&&V.$comment&&D(k),x(k),H(k);const J=X.const("_errs",u.default.errors);P(k,J),X.var(N,(0,a._)`${J} === ${u.default.errors}`)}function E(k){(0,l.checkUnknownRules)(k),
|
|
399
|
+
function v(k){return typeof k.schema!="boolean"}function w(k,N){const{schema:V,gen:X,opts:Z}=k;Z.$comment&&V.$comment&&D(k),x(k),H(k);const J=X.const("_errs",u.default.errors);P(k,J),X.var(N,(0,a._)`${J} === ${u.default.errors}`)}function E(k){(0,l.checkUnknownRules)(k),I(k)}function P(k,N){if(k.opts.jtd)return z(k,[],!1,N);const V=(0,t.getSchemaTypes)(k.schema),X=(0,t.coerceAndCheckDataType)(k,V);z(k,V,!X,N)}function I(k){const{schema:N,errSchemaPath:V,opts:X,self:Z}=k;N.$ref&&X.ignoreKeywordsWithRef&&
|
|
400
400
|
(0,l.schemaHasRulesButRef)(N,Z.RULES)&&Z.logger.warn(`$ref: keywords ignored in schema at path "${V}"`)}function U(k){const{schema:N,opts:V}=k;N.default!==void 0&&V.useDefaults&&V.strictSchema&&(0,l.checkStrictMode)(k,"default is ignored in the schema root")}function x(k){const N=k.schema[k.opts.schemaId];N&&(k.baseId=(0,c.resolveUrl)(k.opts.uriResolver,k.baseId,N))}function H(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function D({gen:k,schemaEnv:N,
|
|
401
|
-
schema:V,errSchemaPath:X,opts:Z}){const J=V.$comment;if(Z.$comment===!0)k.code((0,a._)`${u.default.self}.logger.log(${J})`);else if(typeof Z.$comment=="function"){const ue=(0,a.str)`${X}/$comment`,we=k.scopeValue("root",{ref:N.root});k.code((0,a._)`${u.default.self}.opts.$comment(${J}, ${ue}, ${we}.schema)`)}}function
|
|
401
|
+
schema:V,errSchemaPath:X,opts:Z}){const J=V.$comment;if(Z.$comment===!0)k.code((0,a._)`${u.default.self}.logger.log(${J})`);else if(typeof Z.$comment=="function"){const ue=(0,a.str)`${X}/$comment`,we=k.scopeValue("root",{ref:N.root});k.code((0,a._)`${u.default.self}.opts.$comment(${J}, ${ue}, ${we}.schema)`)}}function O(k){const{gen:N,schemaEnv:V,validateName:X,ValidationError:Z,opts:J}=k;V.$async?N.if((0,a._)`${u.default.errors} === 0`,()=>N.return(u.default.data),()=>N.throw((0,a._)`new ${Z}(${u.
|
|
402
402
|
default.vErrors})`)):(N.assign((0,a._)`${X}.errors`,u.default.vErrors),J.unevaluated&&M(k),N.return((0,a._)`${u.default.errors} === 0`))}function M({gen:k,evaluated:N,props:V,items:X}){V instanceof a.Name&&k.assign((0,a._)`${N}.props`,V),X instanceof a.Name&&k.assign((0,a._)`${N}.items`,X)}function z(k,N,V,X){const{gen:Z,schema:J,data:ue,allErrors:we,opts:Y,self:ne}=k,{RULES:W}=ne;if(J.$ref&&(Y.ignoreKeywordsWithRef||!(0,l.schemaHasRulesButRef)(J,W))){Z.block(()=>B(k,"$ref",W.all.$ref.definition));
|
|
403
403
|
return}Y.jtd||G(k,N),Z.block(()=>{for(const le of W.rules)te(le);te(W.post)});function te(le){(0,r.shouldUseGroup)(J,le)&&(le.type?(Z.if((0,n.checkDataType)(le.type,ue,Y.strictNumbers)),F(k,le),N.length===1&&N[0]===le.type&&V&&(Z.else(),(0,n.reportTypeError)(k)),Z.endIf()):F(k,le),we||Z.if((0,a._)`${u.default.errors} === ${X||0}`))}}function F(k,N){const{gen:V,schema:X,opts:{useDefaults:Z}}=k;Z&&(0,i.assignDefaults)(k,N.type),V.block(()=>{for(const J of N.rules)(0,r.shouldUseRule)(X,J)&&B(k,J.keyword,
|
|
404
404
|
J.definition,N.type)})}function G(k,N){k.schemaEnv.meta||!k.opts.strictTypes||(Q(k,N),k.opts.allowUnionTypes||q(k,N),A(k,k.dataTypes))}function Q(k,N){if(N.length){if(!k.dataTypes.length){k.dataTypes=N;return}N.forEach(V=>{T(k.dataTypes,V)||b(k,`type "${V}" not allowed by context "${k.dataTypes.join(",")}"`)}),R(k,N)}}function q(k,N){N.length>1&&!(N.length===2&&N.includes("null"))&&b(k,"use allowUnionTypes to allow union type keyword")}function A(k,N){const V=k.self.RULES.all;for(const X in V){const Z=V[X];
|
|
@@ -411,45 +411,45 @@ def:ue}=this;X.if((0,a.or)((0,a._)`${Z} === undefined`,V)),N!==a.nil&&X.assign(N
|
|
|
411
411
|
return a.nil}function we(){if(Z.validateSchema){const Y=N.scopeValue("validate$data",{ref:Z.validateSchema});return(0,a._)`!${Y}(${V})`}return a.nil}}subschema(N,V){const X=(0,o.getSubschema)(this.it,N);(0,o.extendSubschemaData)(X,this.it,N),(0,o.extendSubschemaMode)(X,N);const Z={...this.it,...X,items:void 0,props:void 0};return d(Z,V),Z}mergeEvaluated(N,V){const{it:X,gen:Z}=this;X.opts.unevaluated&&(X.props!==!0&&N.props!==void 0&&(X.props=l.mergeEvaluated.props(Z,N.props,X.props,V)),X.items!==
|
|
412
412
|
!0&&N.items!==void 0&&(X.items=l.mergeEvaluated.items(Z,N.items,X.items,V)))}mergeValidEvaluated(N,V){const{it:X,gen:Z}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return Z.if(V,()=>this.mergeEvaluated(N,a.Name)),!0}}ze.KeywordCxt=C;function B(k,N,V,X){const Z=new C(k,V,N);"code"in V?V.code(Z,X):Z.$data&&V.validate?(0,s.funcKeywordCode)(Z,V):"macro"in V?(0,s.macroKeywordCode)(Z,V):(V.compile||V.validate)&&(0,s.funcKeywordCode)(Z,V)}const K=/^\/(?:[^~]|~0|~1)*$/,ee=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
413
413
|
function re(k,{dataLevel:N,dataNames:V,dataPathArr:X}){let Z,J;if(k==="")return u.default.rootData;if(k[0]==="/"){if(!K.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);Z=k,J=u.default.rootData}else{const ne=ee.exec(k);if(!ne)throw new Error(`Invalid JSON-pointer: ${k}`);const W=+ne[1];if(Z=ne[2],Z==="#"){if(W>=N)throw new Error(Y("property/index",W));return X[N-W]}if(W>N)throw new Error(Y("data",W));if(J=V[N-W],!Z)return J}let ue=J;const we=Z.split("/");for(const ne of we)ne&&(J=(0,a._)`${J}${(0,a.
|
|
414
|
-
getProperty)((0,l.unescapeJsonPointer)(ne))}`,ue=(0,a._)`${ue} && ${J}`);return ue;function Y(ne,W){return`Cannot access ${ne} ${W} levels up, current level is ${N}`}}return ze.getData=re,ze}var or={},gi;function ar(){if(gi)return or;gi=1,Object.defineProperty(or,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return or.default=e,or}var ir={},$i;function
|
|
414
|
+
getProperty)((0,l.unescapeJsonPointer)(ne))}`,ue=(0,a._)`${ue} && ${J}`);return ue;function Y(ne,W){return`Cannot access ${ne} ${W} levels up, current level is ${N}`}}return ze.getData=re,ze}var or={},gi;function ar(){if(gi)return or;gi=1,Object.defineProperty(or,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return or.default=e,or}var ir={},$i;function It(){if($i)return ir;$i=1,Object.defineProperty(ir,"__esMod\
|
|
415
415
|
ule",{value:!0});const e=sr();class t extends Error{constructor(n,i,s,o){super(o||`can't resolve reference ${s} from id ${i}`),this.missingRef=(0,e.resolveUrl)(n,i,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return ir.default=t,ir}var ke={},vi;function cr(){if(vi)return ke;vi=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.resolveSchema=ke.getCompilingSchema=ke.resolveRef=ke.compileSchema=ke.SchemaEnv=void 0;const e=ae(),t=ar(),r=Ne(),n=sr(),i=fe(),s=Nt();
|
|
416
416
|
class o{constructor(m){var f;this.refs={},this.dynamicAnchors={};let d;typeof m.schema=="object"&&(d=m.schema),this.schema=m.schema,this.schemaId=m.schemaId,this.root=m.root||this,this.baseId=(f=m.baseId)!==null&&f!==void 0?f:(0,n.normalizeId)(d?.[m.schemaId||"$id"]),this.schemaPath=m.schemaPath,this.localRefs=m.localRefs,this.meta=m.meta,this.$async=d?.$async,this.refs={}}}ke.SchemaEnv=o;function a(p){const m=l.call(this,p);if(m)return m;const f=(0,n.getFullPath)(this.opts.uriResolver,p.root.baseId),
|
|
417
|
-
{es5:d,lines:g}=this.opts.code,{ownProperties:v}=this.opts,w=new e.CodeGen(this.scope,{es5:d,lines:g,ownProperties:v});let E;p.$async&&(E=w.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const P=w.scopeName("validate");p.validateName=P;const
|
|
418
|
-
definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,e.stringify)(p.schema)}:{ref:p.schema}),validateName:P,ValidationError:E,schema:p.schema,schemaEnv:p,rootId:f,baseId:p.baseId||f,schemaPath:e.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let U;try{this._compilations.add(p),(0,s.validateFunctionCode)(
|
|
419
|
-
scope)}return ${x}`,this.opts.code.process&&(U=this.opts.code.process(U,p));const D=new Function(`${r.default.self}`,`${r.default.scope}`,U)(this,this.scope.get());if(this.scope.value(P,{ref:D}),D.errors=null,D.schema=p.schema,D.schemaEnv=p,p.$async&&(D.$async=!0),this.opts.code.source===!0&&(D.source={validateName:P,validateCode:x,scopeValues:w._values}),this.opts.unevaluated){const{props:
|
|
417
|
+
{es5:d,lines:g}=this.opts.code,{ownProperties:v}=this.opts,w=new e.CodeGen(this.scope,{es5:d,lines:g,ownProperties:v});let E;p.$async&&(E=w.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const P=w.scopeName("validate");p.validateName=P;const I={gen:w,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],
|
|
418
|
+
definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:p.schema,code:(0,e.stringify)(p.schema)}:{ref:p.schema}),validateName:P,ValidationError:E,schema:p.schema,schemaEnv:p,rootId:f,baseId:p.baseId||f,schemaPath:e.nil,errSchemaPath:p.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let U;try{this._compilations.add(p),(0,s.validateFunctionCode)(I),w.optimize(this.opts.code.optimize);const x=w.toString();U=`${w.scopeRefs(r.default.
|
|
419
|
+
scope)}return ${x}`,this.opts.code.process&&(U=this.opts.code.process(U,p));const D=new Function(`${r.default.self}`,`${r.default.scope}`,U)(this,this.scope.get());if(this.scope.value(P,{ref:D}),D.errors=null,D.schema=p.schema,D.schemaEnv=p,p.$async&&(D.$async=!0),this.opts.code.source===!0&&(D.source={validateName:P,validateCode:x,scopeValues:w._values}),this.opts.unevaluated){const{props:O,items:M}=I;D.evaluated={props:O instanceof e.Name?void 0:O,items:M instanceof e.Name?void 0:M,dynamicProps:O instanceof
|
|
420
420
|
e.Name,dynamicItems:M instanceof e.Name},D.source&&(D.source.evaluated=(0,e.stringify)(D.evaluated))}return p.validate=D,p}catch(x){throw delete p.validate,delete p.validateName,U&&this.logger.error("Error compiling schema, function code:",U),x}finally{this._compilations.delete(p)}}ke.compileSchema=a;function u(p,m,f){var d;f=(0,n.resolveUrl)(this.opts.uriResolver,m,f);const g=p.refs[f];if(g)return g;let v=y.call(this,p,f);if(v===void 0){const w=(d=p.localRefs)===null||d===void 0?void 0:d[f],{schemaId:E}=this.
|
|
421
421
|
opts;w&&(v=new o({schema:w,schemaId:E,root:p,baseId:m}))}if(v!==void 0)return p.refs[f]=c.call(this,v)}ke.resolveRef=u;function c(p){return(0,n.inlineRef)(p.schema,this.opts.inlineRefs)?p.schema:p.validate?p:a.call(this,p)}function l(p){for(const m of this._compilations)if(h(m,p))return m}ke.getCompilingSchema=l;function h(p,m){return p.schema===m.schema&&p.root===m.root&&p.baseId===m.baseId}function y(p,m){let f;for(;typeof(f=this.refs[m])=="string";)m=f;return f||this.schemas[m]||_.call(this,p,
|
|
422
422
|
m)}function _(p,m){const f=this.opts.uriResolver.parse(m),d=(0,n._getFullPath)(this.opts.uriResolver,f);let g=(0,n.getFullPath)(this.opts.uriResolver,p.baseId,void 0);if(Object.keys(p.schema).length>0&&d===g)return $.call(this,f,p);const v=(0,n.normalizeId)(d),w=this.refs[v]||this.schemas[v];if(typeof w=="string"){const E=_.call(this,p,w);return typeof E?.schema!="object"?void 0:$.call(this,f,E)}if(typeof w?.schema=="object"){if(w.validate||a.call(this,w),v===(0,n.normalizeId)(m)){const{schema:E}=w,
|
|
423
|
-
{schemaId:P}=this.opts,
|
|
424
|
-
return;f=P;const
|
|
425
|
-
eta-schema for $data reference (JSON AnySchema extension proposal)",bi="object",Ei=["$data"],Si={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Ri=!1,nh={$id:_i,description:wi,type:bi,required:Ei,properties:Si,additionalProperties:Ri},sh={__proto__:null,$id:_i,additionalProperties:Ri,default:nh,description:wi,properties:Si,required:Ei,type:bi},oh=De(sh);var ur={},
|
|
423
|
+
{schemaId:P}=this.opts,I=E[P];return I&&(g=(0,n.resolveUrl)(this.opts.uriResolver,g,I)),new o({schema:E,schemaId:P,root:p,baseId:g})}return $.call(this,f,w)}}ke.resolveSchema=_;const S=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function $(p,{baseId:m,schema:f,root:d}){var g;if(((g=p.fragment)===null||g===void 0?void 0:g[0])!=="/")return;for(const E of p.fragment.slice(1).split("/")){if(typeof f=="boolean")return;const P=f[(0,i.unescapeFragment)(E)];if(P===void 0)
|
|
424
|
+
return;f=P;const I=typeof f=="object"&&f[this.opts.schemaId];!S.has(E)&&I&&(m=(0,n.resolveUrl)(this.opts.uriResolver,m,I))}let v;if(typeof f!="boolean"&&f.$ref&&!(0,i.schemaHasRulesButRef)(f,this.RULES)){const E=(0,n.resolveUrl)(this.opts.uriResolver,m,f.$ref);v=_.call(this,d,E)}const{schemaId:w}=this.opts;if(v=v||new o({schema:f,schemaId:w,root:d,baseId:m}),v.schema!==v.root.schema)return v}return ke}const _i="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",wi="M\
|
|
425
|
+
eta-schema for $data reference (JSON AnySchema extension proposal)",bi="object",Ei=["$data"],Si={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Ri=!1,nh={$id:_i,description:wi,type:bi,required:Ei,properties:Si,additionalProperties:Ri},sh={__proto__:null,$id:_i,additionalProperties:Ri,default:nh,description:wi,properties:Si,required:Ei,type:bi},oh=De(sh);var ur={},Ot={exports:{}},ys,Ai;function ah(){return Ai||(Ai=1,ys={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,
|
|
426
426
|
8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}),ys}var gs,Pi;function ih(){if(Pi)return gs;Pi=1;const{HEX:e}=ah(),t=/^(?:(?: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 r($){if(a($,".")<3)return{host:$,isIPV4:!1};const p=$.match(t)||[],[m]=p;return m?{host:o(m,"."),isIPV4:!0}:{host:$,isIPV4:!1}}function n($,p=!1){let m="",f=!0;for(const d of $){if(e[d]===void 0)return;d!=="0"&&f===!0&&(f=!1),f||(m+=d)}return p&&m.length===0&&(m=
|
|
427
|
-
"0"),m}function i($){let p=0;const m={error:!1,address:"",zone:""},f=[],d=[];let g=!1,v=!1,w=!1;function E(){if(d.length){if(g===!1){const P=n(d);if(P!==void 0)f.push(P);else return m.error=!0,!1}d.length=0}return!0}for(let P=0;P<$.length;P++){const
|
|
427
|
+
"0"),m}function i($){let p=0;const m={error:!1,address:"",zone:""},f=[],d=[];let g=!1,v=!1,w=!1;function E(){if(d.length){if(g===!1){const P=n(d);if(P!==void 0)f.push(P);else return m.error=!0,!1}d.length=0}return!0}for(let P=0;P<$.length;P++){const I=$[P];if(!(I==="["||I==="]"))if(I===":"){if(v===!0&&(w=!0),!E())break;if(p++,f.push(":"),p>7){m.error=!0;break}P-1>=0&&$[P-1]===":"&&(v=!0);continue}else if(I==="%"){if(!E())break;g=!0}else{d.push(I);continue}}return d.length&&(g?m.zone=d.join(""):w?
|
|
428
428
|
f.push(d.join("")):f.push(n(d))),m.address=f.join(""),m}function s($){if(a($,":")<2)return{host:$,isIPV6:!1};const p=i($);if(p.error)return{host:$,isIPV6:!1};{let m=p.address,f=p.address;return p.zone&&(m+="%"+p.zone,f+="%25"+p.zone),{host:m,escapedHost:f,isIPV6:!0}}}function o($,p){let m="",f=!0;const d=$.length;for(let g=0;g<d;g++){const v=$[g];v==="0"&&f?(g+1<=d&&$[g+1]===p||g+1===d)&&(m+=v,f=!1):(v===p?f=!0:f=!1,m+=v)}return m}function a($,p){let m=0;for(let f=0;f<$.length;f++)$[f]===p&&m++;
|
|
429
429
|
return m}const u=/^\.\.?\//u,c=/^\/\.(?:\/|$)/u,l=/^\/\.\.(?:\/|$)/u,h=/^\/?(?:.|\n)*?(?=\/|$)/u;function y($){const p=[];for(;$.length;)if($.match(u))$=$.replace(u,"");else if($.match(c))$=$.replace(c,"/");else if($.match(l))$=$.replace(l,"/"),p.pop();else if($==="."||$==="..")$="";else{const m=$.match(h);if(m){const f=m[0];$=$.slice(f.length),p.push(f)}else throw new Error("Unexpected dot segment condition")}return p.join("")}function _($,p){const m=p!==!0?escape:unescape;return $.scheme!==void 0&&
|
|
430
430
|
($.scheme=m($.scheme)),$.userinfo!==void 0&&($.userinfo=m($.userinfo)),$.host!==void 0&&($.host=m($.host)),$.path!==void 0&&($.path=m($.path)),$.query!==void 0&&($.query=m($.query)),$.fragment!==void 0&&($.fragment=m($.fragment)),$}function S($){const p=[];if($.userinfo!==void 0&&(p.push($.userinfo),p.push("@")),$.host!==void 0){let m=unescape($.host);const f=r(m);if(f.isIPV4)m=f.host;else{const d=s(f.host);d.isIPV6===!0?m=`[${d.escapedHost}]`:m=$.host}p.push(m)}return(typeof $.port=="number"||typeof $.
|
|
431
431
|
port=="string")&&(p.push(":"),p.push(String($.port))),p.length?p.join(""):void 0}return gs={recomposeAuthority:S,normalizeComponentEncoding:_,removeDotSegments:y,normalizeIPv4:r,normalizeIPv6:s,stringArrayToHexStripped:n},gs}var $s,Ci;function ch(){if(Ci)return $s;Ci=1;const e=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(f){return typeof f.secure=="boolean"?f.secure:String(f.scheme).toLowerCase()===
|
|
432
432
|
"wss"}function n(f){return f.host||(f.error=f.error||"HTTP URIs must have a host."),f}function i(f){const d=String(f.scheme).toLowerCase()==="https";return(f.port===(d?443:80)||f.port==="")&&(f.port=void 0),f.path||(f.path="/"),f}function s(f){return f.secure=r(f),f.resourceName=(f.path||"/")+(f.query?"?"+f.query:""),f.path=void 0,f.query=void 0,f}function o(f){if((f.port===(r(f)?443:80)||f.port==="")&&(f.port=void 0),typeof f.secure=="boolean"&&(f.scheme=f.secure?"wss":"ws",f.secure=void 0),f.resourceName){
|
|
433
433
|
const[d,g]=f.resourceName.split("?");f.path=d&&d!=="/"?d:void 0,f.query=g,f.resourceName=void 0}return f.fragment=void 0,f}function a(f,d){if(!f.path)return f.error="URN can not be parsed",f;const g=f.path.match(t);if(g){const v=d.scheme||f.scheme||"urn";f.nid=g[1].toLowerCase(),f.nss=g[2];const w=`${v}:${d.nid||f.nid}`,E=m[w];f.path=void 0,E&&(f=E.parse(f,d))}else f.error=f.error||"URN can not be parsed.";return f}function u(f,d){const g=d.scheme||f.scheme||"urn",v=f.nid.toLowerCase(),w=`${g}:${d.
|
|
434
|
-
nid||v}`,E=m[w];E&&(f=E.serialize(f,d));const P=f,
|
|
435
|
-
ss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},m={http:h,https:y,ws:_,wss:S,urn:{scheme:"urn",parse:a,serialize:u,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:c,serialize:l,skipNormalize:!0}};return $s=m,$s}var ki;function uh(){if(ki)return
|
|
434
|
+
nid||v}`,E=m[w];E&&(f=E.serialize(f,d));const P=f,I=f.nss;return P.path=`${v||d.nid}:${I}`,d.skipEscape=!0,P}function c(f,d){const g=f;return g.uuid=g.nss,g.nss=void 0,!d.tolerant&&(!g.uuid||!e.test(g.uuid))&&(g.error=g.error||"UUID is not valid."),g}function l(f){const d=f;return d.nss=(f.uuid||"").toLowerCase(),d}const h={scheme:"http",domainHost:!0,parse:n,serialize:i},y={scheme:"https",domainHost:h.domainHost,parse:n,serialize:i},_={scheme:"ws",domainHost:!0,parse:s,serialize:o},S={scheme:"w\
|
|
435
|
+
ss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},m={http:h,https:y,ws:_,wss:S,urn:{scheme:"urn",parse:a,serialize:u,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:c,serialize:l,skipNormalize:!0}};return $s=m,$s}var ki;function uh(){if(ki)return Ot.exports;ki=1;const{normalizeIPv6:e,normalizeIPv4:t,removeDotSegments:r,recomposeAuthority:n,normalizeComponentEncoding:i}=ih(),s=ch();function o(p,m){return typeof p=="string"?p=l(S(p,m),m):typeof p=="object"&&(p=S(l(p,m),m)),p}function a(p,m,f){
|
|
436
436
|
const d=Object.assign({scheme:"null"},f),g=u(S(p,d),S(m,d),d,!0);return l(g,{...d,skipEscape:!0})}function u(p,m,f,d){const g={};return d||(p=S(l(p,f),f),m=S(l(m,f),f)),f=f||{},!f.tolerant&&m.scheme?(g.scheme=m.scheme,g.userinfo=m.userinfo,g.host=m.host,g.port=m.port,g.path=r(m.path||""),g.query=m.query):(m.userinfo!==void 0||m.host!==void 0||m.port!==void 0?(g.userinfo=m.userinfo,g.host=m.host,g.port=m.port,g.path=r(m.path||""),g.query=m.query):(m.path?(m.path.charAt(0)==="/"?g.path=r(m.path):((p.
|
|
437
437
|
userinfo!==void 0||p.host!==void 0||p.port!==void 0)&&!p.path?g.path="/"+m.path:p.path?g.path=p.path.slice(0,p.path.lastIndexOf("/")+1)+m.path:g.path=m.path,g.path=r(g.path)),g.query=m.query):(g.path=p.path,m.query!==void 0?g.query=m.query:g.query=p.query),g.userinfo=p.userinfo,g.host=p.host,g.port=p.port),g.scheme=p.scheme),g.fragment=m.fragment,g}function c(p,m,f){return typeof p=="string"?(p=unescape(p),p=l(i(S(p,f),!0),{...f,skipEscape:!0})):typeof p=="object"&&(p=l(i(p,!0),{...f,skipEscape:!0})),
|
|
438
438
|
typeof m=="string"?(m=unescape(m),m=l(i(S(m,f),!0),{...f,skipEscape:!0})):typeof m=="object"&&(m=l(i(m,!0),{...f,skipEscape:!0})),p.toLowerCase()===m.toLowerCase()}function l(p,m){const f={host:p.host,scheme:p.scheme,userinfo:p.userinfo,port:p.port,path:p.path,query:p.query,nid:p.nid,nss:p.nss,uuid:p.uuid,fragment:p.fragment,reference:p.reference,resourceName:p.resourceName,secure:p.secure,error:""},d=Object.assign({},m),g=[],v=s[(d.scheme||f.scheme||"").toLowerCase()];v&&v.serialize&&v.serialize(
|
|
439
439
|
f,d),f.path!==void 0&&(d.skipEscape?f.path=unescape(f.path):(f.path=escape(f.path),f.scheme!==void 0&&(f.path=f.path.split("%3A").join(":")))),d.reference!=="suffix"&&f.scheme&&g.push(f.scheme,":");const w=n(f);if(w!==void 0&&(d.reference!=="suffix"&&g.push("//"),g.push(w),f.path&&f.path.charAt(0)!=="/"&&g.push("/")),f.path!==void 0){let E=f.path;!d.absolutePath&&(!v||!v.absolutePath)&&(E=r(E)),w===void 0&&(E=E.replace(/^\/\//u,"/%2F")),g.push(E)}return f.query!==void 0&&g.push("?",f.query),f.fragment!==
|
|
440
440
|
void 0&&g.push("#",f.fragment),g.join("")}const h=Array.from({length:127},(p,m)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(m)));function y(p){let m=0;for(let f=0,d=p.length;f<d;++f)if(m=p.charCodeAt(f),m>126||h[m])return!0;return!1}const _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function S(p,m){const f=Object.assign({},m),d={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},
|
|
441
|
-
g=p.indexOf("%")!==-1;let v=!1;f.reference==="suffix"&&(p=(f.scheme?f.scheme+":":"")+"//"+p);const w=p.match(_);if(w){if(d.scheme=w[1],d.userinfo=w[3],d.host=w[4],d.port=parseInt(w[5],10),d.path=w[6]||"",d.query=w[7],d.fragment=w[8],isNaN(d.port)&&(d.port=w[5]),d.host){const P=t(d.host);if(P.isIPV4===!1){const
|
|
441
|
+
g=p.indexOf("%")!==-1;let v=!1;f.reference==="suffix"&&(p=(f.scheme?f.scheme+":":"")+"//"+p);const w=p.match(_);if(w){if(d.scheme=w[1],d.userinfo=w[3],d.host=w[4],d.port=parseInt(w[5],10),d.path=w[6]||"",d.query=w[7],d.fragment=w[8],isNaN(d.port)&&(d.port=w[5]),d.host){const P=t(d.host);if(P.isIPV4===!1){const I=e(P.host);d.host=I.host.toLowerCase(),v=I.isIPV6}else d.host=P.host,v=!0}d.scheme===void 0&&d.userinfo===void 0&&d.host===void 0&&d.port===void 0&&d.query===void 0&&!d.path?d.reference="\
|
|
442
442
|
same-document":d.scheme===void 0?d.reference="relative":d.fragment===void 0?d.reference="absolute":d.reference="uri",f.reference&&f.reference!=="suffix"&&f.reference!==d.reference&&(d.error=d.error||"URI is not a "+f.reference+" reference.");const E=s[(f.scheme||d.scheme||"").toLowerCase()];if(!f.unicodeSupport&&(!E||!E.unicodeSupport)&&d.host&&(f.domainHost||E&&E.domainHost)&&v===!1&&y(d.host))try{d.host=URL.domainToASCII(d.host.toLowerCase())}catch(P){d.error=d.error||"Host's domain name can n\
|
|
443
|
-
ot be converted to ASCII: "+P}(!E||E&&!E.skipNormalize)&&(g&&d.scheme!==void 0&&(d.scheme=unescape(d.scheme)),g&&d.host!==void 0&&(d.host=unescape(d.host)),d.path&&(d.path=escape(unescape(d.path))),d.fragment&&(d.fragment=encodeURI(decodeURIComponent(d.fragment)))),E&&E.parse&&E.parse(d,f)}else d.error=d.error||"URI can not be parsed.";return d}const $={SCHEMES:s,normalize:o,resolve:a,resolveComponents:u,equal:c,serialize:l,parse:S};return
|
|
444
|
-
exports}var Ti;function lh(){if(Ti)return ur;Ti=1,Object.defineProperty(ur,"__esModule",{value:!0});const e=uh();return e.code='require("ajv/dist/runtime/uri").default',ur.default=e,ur}var Ni;function
|
|
445
|
-
get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=ar(),i=
|
|
443
|
+
ot be converted to ASCII: "+P}(!E||E&&!E.skipNormalize)&&(g&&d.scheme!==void 0&&(d.scheme=unescape(d.scheme)),g&&d.host!==void 0&&(d.host=unescape(d.host)),d.path&&(d.path=escape(unescape(d.path))),d.fragment&&(d.fragment=encodeURI(decodeURIComponent(d.fragment)))),E&&E.parse&&E.parse(d,f)}else d.error=d.error||"URI can not be parsed.";return d}const $={SCHEMES:s,normalize:o,resolve:a,resolveComponents:u,equal:c,serialize:l,parse:S};return Ot.exports=$,Ot.exports.default=$,Ot.exports.fastUri=$,Ot.
|
|
444
|
+
exports}var Ti;function lh(){if(Ti)return ur;Ti=1,Object.defineProperty(ur,"__esModule",{value:!0});const e=uh();return e.code='require("ajv/dist/runtime/uri").default',ur.default=e,ur}var Ni;function Ii(){return Ni||(Ni=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=Nt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ae();Object.defineProperty(e,"_",{enumerable:!0,
|
|
445
|
+
get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=ar(),i=It(),s=ai(),o=cr(),a=ae(),u=sr(),c=nr(),l=fe(),h=oh,y=lh(),
|
|
446
446
|
_=(q,A)=>new RegExp(q,A);_.code="new RegExp";const S=["removeAdditional","useDefaults","coerceTypes"],$=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),p={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.",
|
|
447
447
|
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 cach\
|
|
448
448
|
e, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},m={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},f=200;function d(q){var A,L,T,R,b,C,B,K,ee,re,k,N,V,X,Z,J,ue,we,Y,ne,W,te,le,ye,he;const Me=q.strict,Ke=(A=q.code)===null||A===void 0?void 0:A.optimize,ko=Ke===!0||Ke===void 0?1:Ke||0,To=(T=(L=q.code)===null||L===void 0?void 0:L.regExp)!==null&&T!==void 0?T:_,
|
|
449
449
|
Cf=(R=q.uriResolver)!==null&&R!==void 0?R:y.default;return{strictSchema:(C=(b=q.strictSchema)!==null&&b!==void 0?b:Me)!==null&&C!==void 0?C:!0,strictNumbers:(K=(B=q.strictNumbers)!==null&&B!==void 0?B:Me)!==null&&K!==void 0?K:!0,strictTypes:(re=(ee=q.strictTypes)!==null&&ee!==void 0?ee:Me)!==null&&re!==void 0?re:"log",strictTuples:(N=(k=q.strictTuples)!==null&&k!==void 0?k:Me)!==null&&N!==void 0?N:"log",strictRequired:(X=(V=q.strictRequired)!==null&&V!==void 0?V:Me)!==null&&X!==void 0?X:!1,code:q.
|
|
450
450
|
code?{...q.code,optimize:ko,regExp:To}:{optimize:ko,regExp:To},loopRequired:(Z=q.loopRequired)!==null&&Z!==void 0?Z:f,loopEnum:(J=q.loopEnum)!==null&&J!==void 0?J:f,meta:(ue=q.meta)!==null&&ue!==void 0?ue:!0,messages:(we=q.messages)!==null&&we!==void 0?we:!0,inlineRefs:(Y=q.inlineRefs)!==null&&Y!==void 0?Y:!0,schemaId:(ne=q.schemaId)!==null&&ne!==void 0?ne:"$id",addUsedSchema:(W=q.addUsedSchema)!==null&&W!==void 0?W:!0,validateSchema:(te=q.validateSchema)!==null&&te!==void 0?te:!0,validateFormats:(le=
|
|
451
451
|
q.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(ye=q.unicodeRegExp)!==null&&ye!==void 0?ye:!0,int32range:(he=q.int32range)!==null&&he!==void 0?he:!0,uriResolver:Cf}}class g{constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts={...A,...d(A)};const{es5:L,lines:T}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:$,es5:L,lines:T}),this.logger=H(A.logger);const R=A.validateFormats;A.validateFormats=
|
|
452
|
-
!1,this.RULES=(0,s.getRules)(),v.call(this,p,A,"NOT SUPPORTED"),v.call(this,m,A,"DEPRECATED","warn"),this._metaOpts=U.call(this),A.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords&&
|
|
452
|
+
!1,this.RULES=(0,s.getRules)(),v.call(this,p,A,"NOT SUPPORTED"),v.call(this,m,A,"DEPRECATED","warn"),this._metaOpts=U.call(this),A.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords&&I.call(this,A.keywords),typeof A.meta=="object"&&this.addMetaSchema(A.meta),E.call(this),A.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:A,meta:L,schemaId:T}=this.opts;let R=h;T==="id"&&(R={...h},R.id=R.$id,delete R.$id),L&&A&&this.
|
|
453
453
|
addMetaSchema(R,R[T],!1)}defaultMeta(){const{meta:A,schemaId:L}=this.opts;return this.opts.defaultMeta=typeof A=="object"?A[L]||A:void 0}validate(A,L){let T;if(typeof A=="string"){if(T=this.getSchema(A),!T)throw new Error(`no schema with key or ref "${A}"`)}else T=this.compile(A);const R=T(L);return"$async"in T||(this.errors=T.errors),R}compile(A,L){const T=this._addSchema(A,L);return T.validate||this._compileSchemaEnv(T)}compileAsync(A,L){if(typeof this.opts.loadSchema!="function")throw new Error(
|
|
454
454
|
"options.loadSchema should be a function");const{loadSchema:T}=this.opts;return R.call(this,A,L);async function R(re,k){await b.call(this,re.$schema);const N=this._addSchema(re,k);return N.validate||C.call(this,N)}async function b(re){re&&!this.getSchema(re)&&await R.call(this,{$ref:re},!0)}async function C(re){try{return this._compileSchemaEnv(re)}catch(k){if(!(k instanceof i.default))throw k;return B.call(this,k),await K.call(this,k.missingSchema),C.call(this,re)}}function B({missingSchema:re,
|
|
455
455
|
missingRef:k}){if(this.refs[re])throw new Error(`AnySchema ${re} is loaded but ${k} cannot be resolved`)}async function K(re){const k=await ee.call(this,re);this.refs[re]||await b.call(this,k.$schema),this.refs[re]||this.addSchema(k,re,L)}async function ee(re){const k=this._loading[re];if(k)return k;try{return await(this._loading[re]=T(re))}finally{delete this._loading[re]}}}addSchema(A,L,T,R=this.opts.validateSchema){if(Array.isArray(A)){for(const C of A)this.addSchema(C,void 0,T,R);return this}
|
|
@@ -457,28 +457,28 @@ let b;if(typeof A=="object"){const{schemaId:C}=this.opts;if(b=A[C],b!==void 0&&t
|
|
|
457
457
|
this.defaultMeta(),!T)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const R=this.validate(T,A);if(!R&&L){const b="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(b);else throw new Error(b)}return R}getSchema(A){let L;for(;typeof(L=w.call(this,A))=="string";)A=L;if(L===void 0){const{schemaId:T}=this.opts,R=new o.SchemaEnv({schema:{},schemaId:T});if(L=o.resolveSchema.call(this,R,A),!L)return;this.refs[A]=L}return L.validate||this.
|
|
458
458
|
_compileSchemaEnv(L)}removeSchema(A){if(A instanceof RegExp)return this._removeAllSchemas(this.schemas,A),this._removeAllSchemas(this.refs,A),this;switch(typeof A){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const L=w.call(this,A);return typeof L=="object"&&this._cache.delete(L.schema),delete this.schemas[A],delete this.refs[A],this}case"object":{const L=A;this._cache.delete(L);let T=A[this.opts.schemaId];return T&&
|
|
459
459
|
(T=(0,u.normalizeId)(T),delete this.schemas[T],delete this.refs[T]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(A){for(const L of A)this.addKeyword(L);return this}addKeyword(A,L){let T;if(typeof A=="string")T=A,typeof L=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),L.keyword=T);else if(typeof A=="object"&&L===void 0){if(L=A,T=L.keyword,Array.isArray(T)&&!T.length)throw new Error("addKeywords: keyword must be string\
|
|
460
|
-
or non-empty array")}else throw new Error("invalid addKeywords parameters");if(
|
|
460
|
+
or non-empty array")}else throw new Error("invalid addKeywords parameters");if(O.call(this,T,L),!L)return(0,l.eachItem)(T,b=>M.call(this,b)),this;F.call(this,L);const R={...L,type:(0,c.getJSONTypes)(L.type),schemaType:(0,c.getJSONTypes)(L.schemaType)};return(0,l.eachItem)(T,R.type.length===0?b=>M.call(this,b,R):b=>R.type.forEach(C=>M.call(this,b,R,C))),this}getKeyword(A){const L=this.RULES.all[A];return typeof L=="object"?L.definition:!!L}removeKeyword(A){const{RULES:L}=this;delete L.keywords[A],
|
|
461
461
|
delete L.all[A];for(const T of L.rules){const R=T.rules.findIndex(b=>b.keyword===A);R>=0&&T.rules.splice(R,1)}return this}addFormat(A,L){return typeof L=="string"&&(L=new RegExp(L)),this.formats[A]=L,this}errorsText(A=this.errors,{separator:L=", ",dataVar:T="data"}={}){return!A||A.length===0?"No errors":A.map(R=>`${T}${R.instancePath} ${R.message}`).reduce((R,b)=>R+L+b)}$dataMetaSchema(A,L){const T=this.RULES.all;A=JSON.parse(JSON.stringify(A));for(const R of L){const b=R.split("/").slice(1);let C=A;
|
|
462
462
|
for(const B of b)C=C[B];for(const B in T){const K=T[B];if(typeof K!="object")continue;const{$data:ee}=K.definition,re=C[B];ee&&re&&(C[B]=Q(re))}}return A}_removeAllSchemas(A,L){for(const T in A){const R=A[T];(!L||L.test(T))&&(typeof R=="string"?delete A[T]:R&&!R.meta&&(this._cache.delete(R.schema),delete A[T]))}}_addSchema(A,L,T,R=this.opts.validateSchema,b=this.opts.addUsedSchema){let C;const{schemaId:B}=this.opts;if(typeof A=="object")C=A[B];else{if(this.opts.jtd)throw new Error("schema must b\
|
|
463
463
|
e object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let K=this._cache.get(A);if(K!==void 0)return K;T=(0,u.normalizeId)(C||T);const ee=u.getSchemaRefs.call(this,A,T);return K=new o.SchemaEnv({schema:A,schemaId:B,meta:L,baseId:T,localRefs:ee}),this._cache.set(K.schema,K),b&&!T.startsWith("#")&&(T&&this._checkUnique(T),this.refs[T]=K),R&&this.validateSchema(A,!0),K}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw new Error(`schema with key or id "${A}" alrea\
|
|
464
464
|
dy exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):o.compileSchema.call(this,A),!A.validate)throw new Error("ajv implementation error");return A.validate}_compileMetaSchema(A){const L=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,A)}finally{this.opts=L}}}g.ValidationError=n.default,g.MissingRefError=i.default,e.default=g;function v(q,A,L,T="error"){for(const R in q){const b=R;b in A&&this.logger[T](`${L}: option ${R}. ${q[b]}`)}}function w(q){return q=(0,u.normalizeId)(
|
|
465
|
-
q),this.schemas[q]||this.refs[q]}function E(){const q=this.opts.schemas;if(q)if(Array.isArray(q))this.addSchema(q);else for(const A in q)this.addSchema(q[A],A)}function P(){for(const q in this.opts.formats){const A=this.opts.formats[q];A&&this.addFormat(q,A)}}function
|
|
466
|
-
for(const A of S)delete q[A];return q}const x={log(){},warn(){},error(){}};function H(q){if(q===!1)return x;if(q===void 0)return console;if(q.log&&q.warn&&q.error)return q;throw new Error("logger must implement log, warn and error methods")}const D=/^[a-z_$][a-z0-9_$:-]*$/i;function
|
|
465
|
+
q),this.schemas[q]||this.refs[q]}function E(){const q=this.opts.schemas;if(q)if(Array.isArray(q))this.addSchema(q);else for(const A in q)this.addSchema(q[A],A)}function P(){for(const q in this.opts.formats){const A=this.opts.formats[q];A&&this.addFormat(q,A)}}function I(q){if(Array.isArray(q)){this.addVocabulary(q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const A in q){const L=q[A];L.keyword||(L.keyword=A),this.addKeyword(L)}}function U(){const q={...this.opts};
|
|
466
|
+
for(const A of S)delete q[A];return q}const x={log(){},warn(){},error(){}};function H(q){if(q===!1)return x;if(q===void 0)return console;if(q.log&&q.warn&&q.error)return q;throw new Error("logger must implement log, warn and error methods")}const D=/^[a-z_$][a-z0-9_$:-]*$/i;function O(q,A){const{RULES:L}=this;if((0,l.eachItem)(q,T=>{if(L.keywords[T])throw new Error(`Keyword ${T} is already defined`);if(!D.test(T))throw new Error(`Keyword ${T} has invalid name`)}),!!A&&A.$data&&!("code"in A||"val\
|
|
467
467
|
idate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function M(q,A,L){var T;const R=A?.post;if(L&&R)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:b}=this;let C=R?b.post:b.rules.find(({type:K})=>K===L);if(C||(C={type:L,rules:[]},b.rules.push(C)),b.keywords[q]=!0,!A)return;const B={keyword:q,definition:{...A,type:(0,c.getJSONTypes)(A.type),schemaType:(0,c.getJSONTypes)(A.schemaType)}};A.before?z.call(this,C,B,A.before):C.rules.push(B),b.
|
|
468
468
|
all[q]=B,(T=A.implements)===null||T===void 0||T.forEach(K=>this.addKeyword(K))}function z(q,A,L){const T=q.rules.findIndex(R=>R.keyword===L);T>=0?q.rules.splice(T,0,A):(q.rules.push(A),this.logger.warn(`rule ${L} is not defined`))}function F(q){let{metaSchema:A}=q;A!==void 0&&(q.$data&&this.opts.$data&&(A=Q(A)),q.validateSchema=this.compile(A,!0))}const G={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Q(q){return{anyOf:[q,G]}}})(ls)),ls}var lr={},
|
|
469
|
-
fr={},dr={},
|
|
469
|
+
fr={},dr={},Oi;function fh(){if(Oi)return dr;Oi=1,Object.defineProperty(dr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return dr.default=e,dr}var et={},ji;function vs(){if(ji)return et;ji=1,Object.defineProperty(et,"__esModule",{value:!0}),et.callRef=et.getValidate=void 0;const e=It(),t=Oe(),r=ae(),n=Ne(),i=cr(),s=fe(),o={keyword:"$ref",schemaType:"string",code(c){const{gen:l,schema:h,it:y}=c,{baseId:_,schemaEnv:S,
|
|
470
470
|
validateName:$,opts:p,self:m}=y,{root:f}=S;if((h==="#"||h==="#/")&&_===f.baseId)return g();const d=i.resolveRef.call(m,f,_,h);if(d===void 0)throw new e.default(y.opts.uriResolver,_,h);if(d instanceof i.SchemaEnv)return v(d);return w(d);function g(){if(S===f)return u(c,$,S,S.$async);const E=l.scopeValue("root",{ref:f});return u(c,(0,r._)`${E}.validate`,f,f.$async)}function v(E){const P=a(c,E);u(c,P,E,E.$async)}function w(E){const P=l.scopeValue("schema",p.code.source===!0?{ref:E,code:(0,r.stringify)(
|
|
471
|
-
E)}:{ref:E}),
|
|
471
|
+
E)}:{ref:E}),I=l.name("valid"),U=c.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:P,errSchemaPath:h},I);c.mergeEvaluated(U),c.ok(I)}}};function a(c,l){const{gen:h}=c;return l.validate?h.scopeValue("validate",{ref:l.validate}):(0,r._)`${h.scopeValue("wrapper",{ref:l})}.validate`}et.getValidate=a;function u(c,l,h,y){const{gen:_,it:S}=c,{allErrors:$,schemaEnv:p,opts:m}=S,f=m.passContext?n.default.this:r.nil;y?d():g();function d(){if(!p.$async)throw new Error("async schema referenced\
|
|
472
472
|
by sync schema");const E=_.let("valid");_.try(()=>{_.code((0,r._)`await ${(0,t.callValidateCode)(c,l,f)}`),w(l),$||_.assign(E,!0)},P=>{_.if((0,r._)`!(${P} instanceof ${S.ValidationError})`,()=>_.throw(P)),v(P),$||_.assign(E,!1)}),c.ok(E)}function g(){c.result((0,t.callValidateCode)(c,l,f),()=>w(l),()=>v(l))}function v(E){const P=(0,r._)`${E}.errors`;_.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${P} : ${n.default.vErrors}.concat(${P})`),_.assign(n.default.errors,(0,r._)`${n.
|
|
473
|
-
default.vErrors}.length`)}function w(E){var P;if(!S.opts.unevaluated)return;const
|
|
473
|
+
default.vErrors}.length`)}function w(E){var P;if(!S.opts.unevaluated)return;const I=(P=h?.validate)===null||P===void 0?void 0:P.evaluated;if(S.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(S.props=s.mergeEvaluated.props(_,I.props,S.props));else{const U=_.var("props",(0,r._)`${E}.evaluated.props`);S.props=s.mergeEvaluated.props(_,U,S.props,r.Name)}if(S.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(S.items=s.mergeEvaluated.items(_,I.items,S.items));else{const U=_.var("items",(0,r._)`${E}.evaluated.items`);
|
|
474
474
|
S.items=s.mergeEvaluated.items(_,U,S.items,r.Name)}}}return et.callRef=u,et.default=o,et}var Li;function Di(){if(Li)return fr;Li=1,Object.defineProperty(fr,"__esModule",{value:!0});const e=fh(),t=vs(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return fr.default=r,fr}var pr={},hr={},qi;function dh(){if(qi)return hr;qi=1,Object.defineProperty(hr,"__esModule",{value:!0});const e=ae(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{
|
|
475
475
|
okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:s,schemaCode:o})=>(0,e.str)`must be ${r[s].okStr} ${o}`,params:({keyword:s,schemaCode:o})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${o}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:o,data:a,schemaCode:u}=s;s.fail$data((0,e._)`${a} ${r[o].fail} ${u} || isNaN(${a})`)}};return hr.default=i,hr}
|
|
476
476
|
var mr={},xi;function ph(){if(xi)return mr;xi=1,Object.defineProperty(mr,"__esModule",{value:!0});const e=ae(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:i,data:s,schemaCode:o,it:a}=n,u=a.opts.multipleOfPrecision,c=i.let("res"),l=u?(0,e._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${u}`:(0,e._)`${c} !== parseInt(${c})`;n.fail$data((0,e.
|
|
477
477
|
_)`(${o} === 0 || (${c} = ${s}/${o}, ${l}))`)}};return mr.default=r,mr}var yr={},gr={},Mi;function hh(){if(Mi)return gr;Mi=1,Object.defineProperty(gr,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,i=0,s;for(;i<r;)n++,s=t.charCodeAt(i++),s>=55296&&s<=56319&&i<r&&(s=t.charCodeAt(i),(s&64512)===56320&&i++);return n}return gr.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',gr}var Hi;function mh(){if(Hi)return yr;Hi=1,Object.defineProperty(yr,"__esModule",{value:!0});
|
|
478
478
|
const e=ae(),t=fe(),r=hh(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:o}){const a=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:o,data:a,schemaCode:u,it:c}=s,l=o==="maxLength"?e.operators.GT:e.operators.LT,h=c.opts.unicode===!1?(0,e._)`${a}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${a})`;s.fail$data((0,e.
|
|
479
|
-
_)`${h} ${l} ${u}`)}};return yr.default=i,yr}var $r={},Ui;function yh(){if(Ui)return $r;Ui=1,Object.defineProperty($r,"__esModule",{value:!0});const e=
|
|
479
|
+
_)`${h} ${l} ${u}`)}};return yr.default=i,yr}var $r={},Ui;function yh(){if(Ui)return $r;Ui=1,Object.defineProperty($r,"__esModule",{value:!0});const e=Oe(),t=ae(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,t.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,t._)`{pattern: ${i}}`},code(i){const{data:s,$data:o,schema:a,schemaCode:u,it:c}=i,l=c.opts.unicodeRegExp?"u":"",h=o?(0,t._)`(new RegExp(${u}, ${l}))`:(0,e.usePattern)(i,a);i.fail$data(
|
|
480
480
|
(0,t._)`!${h}.test(${s})`)}};return $r.default=n,$r}var vr={},Fi;function gh(){if(Fi)return vr;Fi=1,Object.defineProperty(vr,"__esModule",{value:!0});const e=ae(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:o}=n,a=i==="maxP\
|
|
481
|
-
roperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${s}).length ${a} ${o}`)}};return vr.default=r,vr}var _r={},Vi;function $h(){if(Vi)return _r;Vi=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=
|
|
481
|
+
roperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${s}).length ${a} ${o}`)}};return vr.default=r,vr}var _r={},Vi;function $h(){if(Vi)return _r;Vi=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=Oe(),t=ae(),r=fe(),i={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:o,schema:a,
|
|
482
482
|
schemaCode:u,data:c,$data:l,it:h}=s,{opts:y}=h;if(!l&&a.length===0)return;const _=a.length>=y.loopRequired;if(h.allErrors?S():$(),y.strictRequired){const f=s.parentSchema.properties,{definedProperties:d}=s.it;for(const g of a)if(f?.[g]===void 0&&!d.has(g)){const v=h.schemaEnv.baseId+h.errSchemaPath,w=`required property "${g}" is not defined at "${v}" (strictRequired)`;(0,r.checkStrictMode)(h,w,h.opts.strictRequired)}}function S(){if(_||l)s.block$data(t.nil,p);else for(const f of a)(0,e.checkReportMissingProp)(
|
|
483
483
|
s,f)}function $(){const f=o.let("missing");if(_||l){const d=o.let("valid",!0);s.block$data(d,()=>m(f,d)),s.ok(d)}else o.if((0,e.checkMissingProp)(s,a,f)),(0,e.reportMissingProp)(s,f),o.else()}function p(){o.forOf("prop",u,f=>{s.setParams({missingProperty:f}),o.if((0,e.noPropertyInData)(o,c,f,y.ownProperties),()=>s.error())})}function m(f,d){s.setParams({missingProperty:f}),o.forOf(f,u,()=>{o.assign(d,(0,e.propertyInData)(o,c,f,y.ownProperties)),o.if((0,t.not)(d),()=>{s.error(),o.break()})},t.nil)}}};
|
|
484
484
|
return _r.default=i,_r}var wr={},zi;function vh(){if(zi)return wr;zi=1,Object.defineProperty(wr,"__esModule",{value:!0});const e=ae(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:o}=n,a=i==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e.
|
|
@@ -491,36 +491,36 @@ c.length===0)throw new Error("enum must have non-empty array");const y=c.length>
|
|
|
491
491
|
ect"&&g!==null?(0,e._)`${S()}(${a}, ${f}[${d}])`:(0,e._)`${a} === ${g}`}}};return Rr.default=i,Rr}var Xi;function Ji(){if(Xi)return pr;Xi=1,Object.defineProperty(pr,"__esModule",{value:!0});const e=dh(),t=ph(),r=mh(),n=yh(),i=gh(),s=$h(),o=vh(),a=_h(),u=wh(),c=bh(),l=[e.default,t.default,r.default,n.default,i.default,s.default,o.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,c.default];return pr.default=l,pr}var Ar={},ht={},Yi;
|
|
492
492
|
function Qi(){if(Yi)return ht;Yi=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.validateAdditionalItems=void 0;const e=ae(),t=fe(),n={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:o,it:a}=s,{items:u}=o;if(!Array.isArray(u)){(0,t.checkStrictMode)(a,'"additionalItems" is ignored when "ite\
|
|
493
493
|
ms" is not an array of schemas');return}i(s,u)}};function i(s,o){const{gen:a,schema:u,data:c,keyword:l,it:h}=s;h.items=!0;const y=a.const("len",(0,e._)`${c}.length`);if(u===!1)s.setParams({len:o.length}),s.pass((0,e._)`${y} <= ${o.length}`);else if(typeof u=="object"&&!(0,t.alwaysValidSchema)(h,u)){const S=a.var("valid",(0,e._)`${y} <= ${o.length}`);a.if((0,e.not)(S),()=>_(S)),s.ok(S)}function _(S){a.forRange("i",o.length,y,$=>{s.subschema({keyword:l,dataProp:$,dataPropType:t.Type.Num},S),h.allErrors||
|
|
494
|
-
a.if((0,e.not)(S),()=>a.break())})}}return ht.validateAdditionalItems=i,ht.default=n,ht}var Pr={},mt={},Zi;function ec(){if(Zi)return mt;Zi=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.validateTuple=void 0;const e=ae(),t=fe(),r=
|
|
494
|
+
a.if((0,e.not)(S),()=>a.break())})}}return ht.validateAdditionalItems=i,ht.default=n,ht}var Pr={},mt={},Zi;function ec(){if(Zi)return mt;Zi=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.validateTuple=void 0;const e=ae(),t=fe(),r=Oe(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:o,it:a}=s;if(Array.isArray(o))return i(s,"additionalItems",o);a.items=!0,!(0,t.alwaysValidSchema)(a,o)&&s.ok((0,r.validateArray)(s))}};function i(s,o,a=s.
|
|
495
495
|
schema){const{gen:u,parentSchema:c,data:l,keyword:h,it:y}=s;$(c),y.opts.unevaluated&&a.length&&y.items!==!0&&(y.items=t.mergeEvaluated.items(u,a.length,y.items));const _=u.name("valid"),S=u.const("len",(0,e._)`${l}.length`);a.forEach((p,m)=>{(0,t.alwaysValidSchema)(y,p)||(u.if((0,e._)`${S} > ${m}`,()=>s.subschema({keyword:h,schemaProp:m,dataProp:m},_)),s.ok(_))});function $(p){const{opts:m,errSchemaPath:f}=y,d=a.length,g=d===p.minItems&&(d===p.maxItems||p[o]===!1);if(m.strictTuples&&!g){const v=`\
|
|
496
496
|
"${h}" is ${d}-tuple, but minItems or maxItems/${o} are not specified or different at path "${f}"`;(0,t.checkStrictMode)(y,v,m.strictTuples)}}}return mt.validateTuple=i,mt.default=n,mt}var tc;function Eh(){if(tc)return Pr;tc=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=ec(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return Pr.default=t,Pr}var Cr={},rc;function Sh(){if(rc)return Cr;rc=1,Object.defineProperty(
|
|
497
|
-
Cr,"__esModule",{value:!0});const e=ae(),t=fe(),r=
|
|
497
|
+
Cr,"__esModule",{value:!0});const e=ae(),t=fe(),r=Oe(),n=Qi(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{schema:a,parentSchema:u,it:c}=o,{prefixItems:l}=u;c.items=!0,!(0,t.alwaysValidSchema)(c,a)&&(l?(0,n.validateAdditionalItems)(o,l):o.ok((0,r.validateArray)(o)))}};return Cr.default=s,Cr}var kr={},nc;function Rh(){
|
|
498
498
|
if(nc)return kr;nc=1,Object.defineProperty(kr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:s}})=>s===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${s} valid item(s)`,params:({params:{min:i,max:s}})=>s===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${s}}`},code(i){
|
|
499
499
|
const{gen:s,schema:o,parentSchema:a,data:u,it:c}=i;let l,h;const{minContains:y,maxContains:_}=a;c.opts.next?(l=y===void 0?1:y,h=_):l=1;const S=s.const("len",(0,e._)`${u}.length`);if(i.setParams({min:l,max:h}),h===void 0&&l===0){(0,t.checkStrictMode)(c,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(h!==void 0&&l>h){(0,t.checkStrictMode)(c,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(c,o)){let d=(0,e._)`${S} >= ${l}`;
|
|
500
500
|
h!==void 0&&(d=(0,e._)`${d} && ${S} <= ${h}`),i.pass(d);return}c.items=!0;const $=s.name("valid");h===void 0&&l===1?m($,()=>s.if($,()=>s.break())):l===0?(s.let($,!0),h!==void 0&&s.if((0,e._)`${u}.length > 0`,p)):(s.let($,!1),p()),i.result($,()=>i.reset());function p(){const d=s.name("_valid"),g=s.let("count",0);m(d,()=>s.if(d,()=>f(g)))}function m(d,g){s.forRange("i",0,S,v=>{i.subschema({keyword:"contains",dataProp:v,dataPropType:t.Type.Num,compositeRule:!0},d),g()})}function f(d){s.code((0,e._)`${d}++`),
|
|
501
|
-
h===void 0?s.if((0,e._)`${d} >= ${l}`,()=>s.assign($,!0).break()):(s.if((0,e._)`${d} > ${h}`,()=>s.assign($,!1).break()),l===1?s.assign($,!0):s.if((0,e._)`${d} >= ${l}`,()=>s.assign($,!0)))}}};return kr.default=n,kr}var ws={},sc;function bs(){return sc||(sc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ae(),r=fe(),n=
|
|
501
|
+
h===void 0?s.if((0,e._)`${d} >= ${l}`,()=>s.assign($,!0).break()):(s.if((0,e._)`${d} > ${h}`,()=>s.assign($,!1).break()),l===1?s.assign($,!0):s.if((0,e._)`${d} >= ${l}`,()=>s.assign($,!0)))}}};return kr.default=n,kr}var ws={},sc;function bs(){return sc||(sc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ae(),r=fe(),n=Oe();e.error={message:({params:{property:u,depsCount:c,deps:l}})=>{const h=c===1?"property":"prop\
|
|
502
502
|
erties";return(0,t.str)`must have ${h} ${l} when property ${u} is present`},params:({params:{property:u,depsCount:c,deps:l,missingProperty:h}})=>(0,t._)`{property: ${u},
|
|
503
503
|
missingProperty: ${h},
|
|
504
504
|
depsCount: ${c},
|
|
505
505
|
deps: ${l}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[c,l]=s(u);o(u,c),a(u,l)}};function s({schema:u}){const c={},l={};for(const h in u){if(h==="__proto__")continue;const y=Array.isArray(u[h])?c:l;y[h]=u[h]}return[c,l]}function o(u,c=u.schema){const{gen:l,data:h,it:y}=u;if(Object.keys(c).length===0)return;const _=l.let("missing");for(const S in c){const $=c[S];if($.length===0)continue;const p=(0,n.propertyInData)(l,h,S,y.opts.ownProperties);
|
|
506
506
|
u.setParams({property:S,depsCount:$.length,deps:$.join(", ")}),y.allErrors?l.if(p,()=>{for(const m of $)(0,n.checkReportMissingProp)(u,m)}):(l.if((0,t._)`${p} && (${(0,n.checkMissingProp)(u,$,_)})`),(0,n.reportMissingProp)(u,_),l.else())}}e.validatePropertyDeps=o;function a(u,c=u.schema){const{gen:l,data:h,keyword:y,it:_}=u,S=l.name("valid");for(const $ in c)(0,r.alwaysValidSchema)(_,c[$])||(l.if((0,n.propertyInData)(l,h,$,_.opts.ownProperties),()=>{const p=u.subschema({keyword:y,schemaProp:$},S);
|
|
507
507
|
u.mergeValidEvaluated(p,S)},()=>l.var(S,!0)),u.ok(S))}e.validateSchemaDeps=a,e.default=i})(ws)),ws}var Tr={},oc;function Ah(){if(oc)return Tr;oc=1,Object.defineProperty(Tr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:s,schema:o,data:a,it:u}=i;if((0,t.alwaysValidSchema)(u,o))return;const c=s.name("v\
|
|
508
|
-
alid");s.forIn("key",a,l=>{i.setParams({propertyName:l}),i.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},c),s.if((0,e.not)(c),()=>{i.error(!0),u.allErrors||s.break()})}),i.ok(c)}};return Tr.default=n,Tr}var Nr={},ac;function ic(){if(ac)return Nr;ac=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=
|
|
508
|
+
alid");s.forIn("key",a,l=>{i.setParams({propertyName:l}),i.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},c),s.if((0,e.not)(c),()=>{i.error(!0),u.allErrors||s.break()})}),i.ok(c)}};return Tr.default=n,Tr}var Nr={},ac;function ic(){if(ac)return Nr;ac=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=Oe(),t=ae(),r=Ne(),n=fe(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,
|
|
509
509
|
error:{message:"must NOT have additional properties",params:({params:o})=>(0,t._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:a,schema:u,parentSchema:c,data:l,errsCount:h,it:y}=o;if(!h)throw new Error("ajv implementation error");const{allErrors:_,opts:S}=y;if(y.props=!0,S.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(y,u))return;const $=(0,e.allSchemaProperties)(c.properties),p=(0,e.allSchemaProperties)(c.patternProperties);m(),o.ok((0,t._)`${h} === ${r.default.errors}`);
|
|
510
510
|
function m(){a.forIn("key",l,w=>{!$.length&&!p.length?g(w):a.if(f(w),()=>g(w))})}function f(w){let E;if($.length>8){const P=(0,n.schemaRefOrVal)(y,c.properties,"properties");E=(0,e.isOwnProperty)(a,P,w)}else $.length?E=(0,t.or)(...$.map(P=>(0,t._)`${w} === ${P}`)):E=t.nil;return p.length&&(E=(0,t.or)(E,...p.map(P=>(0,t._)`${(0,e.usePattern)(o,P)}.test(${w})`))),(0,t.not)(E)}function d(w){a.code((0,t._)`delete ${l}[${w}]`)}function g(w){if(S.removeAdditional==="all"||S.removeAdditional&&u===!1){d(
|
|
511
|
-
w);return}if(u===!1){o.setParams({additionalProperty:w}),o.error(),_||a.break();return}if(typeof u=="object"&&!(0,n.alwaysValidSchema)(y,u)){const E=a.name("valid");S.removeAdditional==="failing"?(v(w,E,!1),a.if((0,t.not)(E),()=>{o.reset(),d(w)})):(v(w,E),_||a.if((0,t.not)(E),()=>a.break()))}}function v(w,E,P){const
|
|
512
|
-
Nr}var
|
|
511
|
+
w);return}if(u===!1){o.setParams({additionalProperty:w}),o.error(),_||a.break();return}if(typeof u=="object"&&!(0,n.alwaysValidSchema)(y,u)){const E=a.name("valid");S.removeAdditional==="failing"?(v(w,E,!1),a.if((0,t.not)(E),()=>{o.reset(),d(w)})):(v(w,E),_||a.if((0,t.not)(E),()=>a.break()))}}function v(w,E,P){const I={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};P===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(I,E)}}};return Nr.default=s,
|
|
512
|
+
Nr}var Ir={},cc;function Ph(){if(cc)return Ir;cc=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=Nt(),t=Oe(),r=fe(),n=ic(),i={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:o,schema:a,parentSchema:u,data:c,it:l}=s;l.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(l,n.default,"additionalProperties"));const h=(0,t.allSchemaProperties)(a);for(const p of h)l.definedProperties.add(p);l.opts.unevaluated&&h.length&&l.
|
|
513
513
|
props!==!0&&(l.props=r.mergeEvaluated.props(o,(0,r.toHash)(h),l.props));const y=h.filter(p=>!(0,r.alwaysValidSchema)(l,a[p]));if(y.length===0)return;const _=o.name("valid");for(const p of y)S(p)?$(p):(o.if((0,t.propertyInData)(o,c,p,l.opts.ownProperties)),$(p),l.allErrors||o.else().var(_,!0),o.endIf()),s.it.definedProperties.add(p),s.ok(_);function S(p){return l.opts.useDefaults&&!l.compositeRule&&a[p].default!==void 0}function $(p){s.subschema({keyword:"properties",schemaProp:p,dataProp:p},_)}}};
|
|
514
|
-
return
|
|
514
|
+
return Ir.default=i,Ir}var Or={},uc;function Ch(){if(uc)return Or;uc=1,Object.defineProperty(Or,"__esModule",{value:!0});const e=Oe(),t=ae(),r=fe(),n=fe(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:o,schema:a,data:u,parentSchema:c,it:l}=s,{opts:h}=l,y=(0,e.allSchemaProperties)(a),_=y.filter(g=>(0,r.alwaysValidSchema)(l,a[g]));if(y.length===0||_.length===y.length&&(!l.opts.unevaluated||l.props===!0))return;const S=h.strictSchema&&!h.allowMatchingProperties&&
|
|
515
515
|
c.properties,$=o.name("valid");l.props!==!0&&!(l.props instanceof t.Name)&&(l.props=(0,n.evaluatedPropsToName)(o,l.props));const{props:p}=l;m();function m(){for(const g of y)S&&f(g),l.allErrors?d(g):(o.var($,!0),d(g),o.if($))}function f(g){for(const v in S)new RegExp(g).test(v)&&(0,r.checkStrictMode)(l,`property ${v} matches pattern ${g} (use allowMatchingProperties)`)}function d(g){o.forIn("key",u,v=>{o.if((0,t._)`${(0,e.usePattern)(s,g)}.test(${v})`,()=>{const w=_.includes(g);w||s.subschema({keyword:"\
|
|
516
|
-
patternProperties",schemaProp:g,dataProp:v,dataPropType:n.Type.Str},$),l.opts.unevaluated&&p!==!0?o.assign((0,t._)`${p}[${v}]`,!0):!w&&!l.allErrors&&o.if((0,t.not)($),()=>o.break())})})}}};return
|
|
517
|
-
{keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return jr.default=t,jr}var Lr={},fc;function Th(){if(fc)return Lr;fc=1,Object.defineProperty(Lr,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:
|
|
516
|
+
patternProperties",schemaProp:g,dataProp:v,dataPropType:n.Type.Str},$),l.opts.unevaluated&&p!==!0?o.assign((0,t._)`${p}[${v}]`,!0):!w&&!l.allErrors&&o.if((0,t.not)($),()=>o.break())})})}}};return Or.default=i,Or}var jr={},lc;function kh(){if(lc)return jr;lc=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=fe(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:i,it:s}=r;if((0,e.alwaysValidSchema)(s,i)){r.fail();return}const o=n.name("valid");r.subschema(
|
|
517
|
+
{keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return jr.default=t,jr}var Lr={},fc;function Th(){if(fc)return Lr;fc=1,Object.defineProperty(Lr,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Oe().validateUnion,error:{message:"must match a schema in anyOf"}};return Lr.default=t,Lr}var Dr={},dc;function Nh(){if(dc)return Dr;dc=1,Object.defineProperty(Dr,"__es\
|
|
518
518
|
Module",{value:!0});const e=ae(),t=fe(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:s,schema:o,parentSchema:a,it:u}=i;if(!Array.isArray(o))throw new Error("ajv implementation error");if(u.opts.discriminator&&a.discriminator)return;const c=o,l=s.let("valid",!1),h=s.let("passing",null),y=s.name("_valid");i.setParams({passing:h}),s.block(_),i.result(l,()=>i.
|
|
519
|
-
reset(),()=>i.error(!0));function _(){c.forEach((S,$)=>{let p;(0,t.alwaysValidSchema)(u,S)?s.var(y,!0):p=i.subschema({keyword:"oneOf",schemaProp:$,compositeRule:!0},y),$>0&&s.if((0,e._)`${y} && ${l}`).assign(l,!1).assign(h,(0,e._)`[${h}, ${$}]`).else(),s.if(y,()=>{s.assign(l,!0),s.assign(h,$),p&&i.mergeEvaluated(p,e.Name)})})}}};return Dr.default=n,Dr}var qr={},pc;function
|
|
520
|
-
y",code(r){const{gen:n,schema:i,it:s}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const o=n.name("valid");i.forEach((a,u)=>{if((0,e.alwaysValidSchema)(s,a))return;const c=r.subschema({keyword:"allOf",schemaProp:u},o);r.ok(o),r.mergeEvaluated(c)})}};return qr.default=t,qr}var xr={},hc;function
|
|
519
|
+
reset(),()=>i.error(!0));function _(){c.forEach((S,$)=>{let p;(0,t.alwaysValidSchema)(u,S)?s.var(y,!0):p=i.subschema({keyword:"oneOf",schemaProp:$,compositeRule:!0},y),$>0&&s.if((0,e._)`${y} && ${l}`).assign(l,!1).assign(h,(0,e._)`[${h}, ${$}]`).else(),s.if(y,()=>{s.assign(l,!0),s.assign(h,$),p&&i.mergeEvaluated(p,e.Name)})})}}};return Dr.default=n,Dr}var qr={},pc;function Ih(){if(pc)return qr;pc=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=fe(),t={keyword:"allOf",schemaType:"arra\
|
|
520
|
+
y",code(r){const{gen:n,schema:i,it:s}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const o=n.name("valid");i.forEach((a,u)=>{if((0,e.alwaysValidSchema)(s,a))return;const c=r.subschema({keyword:"allOf",schemaProp:u},o);r.ok(o),r.mergeEvaluated(c)})}};return qr.default=t,qr}var xr={},hc;function Oh(){if(hc)return xr;hc=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.
|
|
521
521
|
str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:o,parentSchema:a,it:u}=s;a.then===void 0&&a.else===void 0&&(0,t.checkStrictMode)(u,'"if" without "then" and "else" is ignored');const c=i(u,"then"),l=i(u,"else");if(!c&&!l)return;const h=o.let("valid",!0),y=o.name("_valid");if(_(),s.reset(),c&&l){const $=o.let("ifClause");s.setParams({ifClause:$}),o.if(y,S("then",$),S("else",$))}else c?o.if(y,S("then")):o.if((0,e.not)(y),S("el\
|
|
522
522
|
se"));s.pass(h,()=>s.error(!0));function _(){const $=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},y);s.mergeEvaluated($)}function S($,p){return()=>{const m=s.subschema({keyword:$},y);o.assign(h,y),s.mergeValidEvaluated(m,h),p?o.assign(p,(0,e._)`${$}`):s.setParams({ifClause:$})}}}};function i(s,o){const a=s.schema[o];return a!==void 0&&!(0,t.alwaysValidSchema)(s,a)}return xr.default=n,xr}var Mr={},mc;function jh(){if(mc)return Mr;mc=1,Object.defineProperty(Mr,"__esModu\
|
|
523
|
-
le",{value:!0});const e=fe(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return Mr.default=t,Mr}var yc;function gc(){if(yc)return Ar;yc=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=Qi(),t=Eh(),r=ec(),n=Sh(),i=Rh(),s=bs(),o=Ah(),a=ic(),u=Ph(),c=Ch(),l=kh(),h=Th(),y=Nh(),_=
|
|
523
|
+
le",{value:!0});const e=fe(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return Mr.default=t,Mr}var yc;function gc(){if(yc)return Ar;yc=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=Qi(),t=Eh(),r=ec(),n=Sh(),i=Rh(),s=bs(),o=Ah(),a=ic(),u=Ph(),c=Ch(),l=kh(),h=Th(),y=Nh(),_=Ih(),S=Oh(),$=jh();function p(m=!1){const f=[l.default,h.default,y.default,_.default,
|
|
524
524
|
S.default,$.default,o.default,a.default,s.default,u.default,c.default];return m?f.push(t.default,n.default):f.push(e.default,r.default),f.push(i.default),f}return Ar.default=p,Ar}var Hr={},yt={},$c;function vc(){if($c)return yt;$c=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.dynamicAnchor=void 0;const e=ae(),t=Ne(),r=cr(),n=vs(),i={keyword:"$dynamicAnchor",schemaType:"string",code:a=>s(a,a.schema)};function s(a,u){const{gen:c,it:l}=a;l.schemaEnv.root.dynamicAnchors[u]=!0;const h=(0,e._)`${t.
|
|
525
525
|
default.dynamicAnchors}${(0,e.getProperty)(u)}`,y=l.errSchemaPath==="#"?l.validateName:o(a);c.if((0,e._)`!${h}`,()=>c.assign(h,y))}yt.dynamicAnchor=s;function o(a){const{schemaEnv:u,schema:c,self:l}=a.it,{root:h,baseId:y,localRefs:_,meta:S}=u.root,{schemaId:$}=l.opts,p=new r.SchemaEnv({schema:c,schemaId:$,root:h,baseId:y,localRefs:_,meta:S});return r.compileSchema.call(l,p),(0,n.getValidate)(a,p)}return yt.default=i,yt}var gt={},_c;function wc(){if(_c)return gt;_c=1,Object.defineProperty(gt,"__e\
|
|
526
526
|
sModule",{value:!0}),gt.dynamicRef=void 0;const e=ae(),t=Ne(),r=vs(),n={keyword:"$dynamicRef",schemaType:"string",code:s=>i(s,s.schema)};function i(s,o){const{gen:a,keyword:u,it:c}=s;if(o[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);const l=o.slice(1);if(c.allErrors)h();else{const _=a.let("valid",!1);h(_),s.ok(_)}function h(_){if(c.schemaEnv.root.dynamicAnchors[l]){const S=a.let("_v",(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(l)}`);a.if(S,y(S,_),y(c.validateName,
|
|
@@ -532,16 +532,16 @@ i={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"]
|
|
|
532
532
|
o.if($(y,p),()=>_(p))),l.props=!0,s.ok((0,e._)`${c} === ${r.default.errors}`);function _(p){if(a===!1){s.setParams({unevaluatedProperty:p}),s.error(),h||o.break();return}if(!(0,t.alwaysValidSchema)(l,a)){const m=o.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:p,dataPropType:t.Type.Str},m),h||o.if((0,e.not)(m),()=>o.break())}}function S(p,m){return(0,e._)`!${p} || !${p}[${m}]`}function $(p,m){const f=[];for(const d in p)p[d]===!0&&f.push((0,e._)`${m} !== ${d}`);return(0,e.and)(
|
|
533
533
|
...f)}}};return Wr.default=i,Wr}var Xr={},Tc;function Vh(){if(Tc)return Xr;Tc=1,Object.defineProperty(Xr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{gen:s,schema:o,data:a,it:u}=i,c=u.items||0;if(c===!0)return;const l=s.const("len",(0,e._)`${a}.length`);if(o===!1)i.setParams({len:c}),
|
|
534
534
|
i.fail((0,e._)`${l} > ${c}`);else if(typeof o=="object"&&!(0,t.alwaysValidSchema)(u,o)){const y=s.var("valid",(0,e._)`${l} <= ${c}`);s.if((0,e.not)(y),()=>h(y,c)),i.ok(y)}u.items=!0;function h(y,_){s.forRange("i",_,l,S=>{i.subschema({keyword:"unevaluatedItems",dataProp:S,dataPropType:t.Type.Num},y),u.allErrors||s.if((0,e.not)(y),()=>s.break())})}}};return Xr.default=n,Xr}var Nc;function zh(){if(Nc)return Kr;Nc=1,Object.defineProperty(Kr,"__esModule",{value:!0});const e=Fh(),t=Vh(),r=[e.default,t.
|
|
535
|
-
default];return Kr.default=r,Kr}var Jr={},Yr={},
|
|
535
|
+
default];return Kr.default=r,Kr}var Jr={},Yr={},Ic;function Gh(){if(Ic)return Yr;Ic=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=ae(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,i){const{gen:s,data:o,$data:a,schema:u,schemaCode:c,it:l}=n,{opts:h,errSchemaPath:y,schemaEnv:_,self:S}=l;if(!h.validateFormats)return;a?$():p();function $(){
|
|
536
536
|
const m=s.scopeValue("formats",{ref:S.formats,code:h.code.formats}),f=s.const("fDef",(0,e._)`${m}[${c}]`),d=s.let("fType"),g=s.let("format");s.if((0,e._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>s.assign(d,(0,e._)`${f}.type || "string"`).assign(g,(0,e._)`${f}.validate`),()=>s.assign(d,(0,e._)`"string"`).assign(g,f)),n.fail$data((0,e.or)(v(),w()));function v(){return h.strictSchema===!1?e.nil:(0,e._)`${c} && !${g}`}function w(){const E=_.$async?(0,e._)`(${f}.async ? await ${g}(${o}) : ${g}(${o}))`:
|
|
537
|
-
(0,e._)`${g}(${o})`,P=(0,e._)`(typeof ${g} == "function" ? ${E} : ${g}.test(${o}))`;return(0,e._)`${g} && ${g} !== true && ${d} === ${i} && !${P}`}}function p(){const m=S.formats[u];if(!m){v();return}if(m===!0)return;const[f,d,g]=w(m);f===i&&n.pass(E());function v(){if(h.strictSchema===!1){S.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${u}" ignored in schema at path "${y}"`}}function w(P){const
|
|
538
|
-
code.formats}${(0,e.getProperty)(u)}`:void 0,U=s.scopeValue("formats",{key:u,ref:P,code:
|
|
539
|
-
|
|
537
|
+
(0,e._)`${g}(${o})`,P=(0,e._)`(typeof ${g} == "function" ? ${E} : ${g}.test(${o}))`;return(0,e._)`${g} && ${g} !== true && ${d} === ${i} && !${P}`}}function p(){const m=S.formats[u];if(!m){v();return}if(m===!0)return;const[f,d,g]=w(m);f===i&&n.pass(E());function v(){if(h.strictSchema===!1){S.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${u}" ignored in schema at path "${y}"`}}function w(P){const I=P instanceof RegExp?(0,e.regexpCode)(P):h.code.formats?(0,e._)`${h.
|
|
538
|
+
code.formats}${(0,e.getProperty)(u)}`:void 0,U=s.scopeValue("formats",{key:u,ref:P,code:I});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,e._)`${U}.validate`]:["string",P,U]}function E(){if(typeof m=="object"&&!(m instanceof RegExp)&&m.async){if(!_.$async)throw new Error("async format in sync schema");return(0,e._)`await ${g}(${o})`}return typeof d=="function"?(0,e._)`${g}(${o})`:(0,e._)`${g}.test(${o})`}}}};return Yr.default=r,Yr}var Oc;function jc(){if(Oc)return Jr;
|
|
539
|
+
Oc=1,Object.defineProperty(Jr,"__esModule",{value:!0});const t=[Gh().default];return Jr.default=t,Jr}var ot={},Lc;function Dc(){return Lc||(Lc=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.contentVocabulary=ot.metadataVocabulary=void 0,ot.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],ot.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),ot}var qc;function Bh(){if(qc)return lr;qc=1,Object.defineProperty(lr,"__es\
|
|
540
540
|
Module",{value:!0});const e=Di(),t=Ji(),r=gc(),n=qh(),i=Uh(),s=zh(),o=jc(),a=Dc(),u=[n.default,e.default,t.default,(0,r.default)(!0),o.default,a.metadataVocabulary,a.contentVocabulary,i.default,s.default];return lr.default=u,lr}var Qr={},jt={},xc;function Kh(){if(xc)return jt;xc=1,Object.defineProperty(jt,"__esModule",{value:!0}),jt.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(jt.DiscrError=e={})),jt}var Mc;function Hc(){if(Mc)return Qr;Mc=1,Object.defineProperty(
|
|
541
|
-
Qr,"__esModule",{value:!0});const e=ae(),t=Kh(),r=cr(),n=
|
|
541
|
+
Qr,"__esModule",{value:!0});const e=ae(),t=Kh(),r=cr(),n=It(),i=fe(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:u}})=>a===t.DiscrError.Tag?`tag "${u}" must be string`:`value of tag "${u}" must be in oneOf`,params:({params:{discrError:a,tag:u,tagName:c}})=>(0,e._)`{error: ${a}, tag: ${c}, tagValue: ${u}}`},code(a){const{gen:u,data:c,schema:l,parentSchema:h,it:y}=a,{oneOf:_}=h;if(!y.opts.discriminator)throw new Error("discriminator: r\
|
|
542
542
|
equires discriminator option");const S=l.propertyName;if(typeof S!="string")throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!_)throw new Error("discriminator: requires oneOf keyword");const $=u.let("valid",!1),p=u.const("tag",(0,e._)`${c}${(0,e.getProperty)(S)}`);u.if((0,e._)`typeof ${p} == "string"`,()=>m(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:p,tagName:S})),a.ok($);function m(){const g=d();u.if(!1);for(const v in g)
|
|
543
|
-
u.elseIf((0,e._)`${p} === ${v}`),u.assign($,f(g[v]));u.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:p,tagName:S}),u.endIf()}function f(g){const v=u.name("valid"),w=a.subschema({keyword:"oneOf",schemaProp:g},v);return a.mergeEvaluated(w,e.Name),v}function d(){var g;const v={},w=P(h);let E=!0;for(let x=0;x<_.length;x++){let H=_[x];if(H?.$ref&&!(0,i.schemaHasRulesButRef)(H,y.self.RULES)){const
|
|
544
|
-
H.schema),H===void 0)throw new n.default(y.opts.uriResolver,y.baseId,
|
|
543
|
+
u.elseIf((0,e._)`${p} === ${v}`),u.assign($,f(g[v]));u.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:p,tagName:S}),u.endIf()}function f(g){const v=u.name("valid"),w=a.subschema({keyword:"oneOf",schemaProp:g},v);return a.mergeEvaluated(w,e.Name),v}function d(){var g;const v={},w=P(h);let E=!0;for(let x=0;x<_.length;x++){let H=_[x];if(H?.$ref&&!(0,i.schemaHasRulesButRef)(H,y.self.RULES)){const O=H.$ref;if(H=r.resolveRef.call(y.self,y.schemaEnv.root,y.baseId,O),H instanceof r.SchemaEnv&&(H=
|
|
544
|
+
H.schema),H===void 0)throw new n.default(y.opts.uriResolver,y.baseId,O)}const D=(g=H?.properties)===null||g===void 0?void 0:g[S];if(typeof D!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${S}"`);E=E&&(w||P(H)),I(D,x)}if(!E)throw new Error(`discriminator: "${S}" must be required`);return v;function P({required:x}){return Array.isArray(x)&&x.includes(S)}function I(x,H){if(x.const)U(x.const,H);else if(x.enum)for(const D of x.enum)U(D,H);else
|
|
545
545
|
throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`)}function U(x,H){if(typeof x!="string"||x in v)throw new Error(`discriminator: "${S}" values must be unique strings`);v[x]=H}}}};return Qr.default=o,Qr}var Zr={};const Uc="https://json-schema.org/draft/2020-12/schema",Fc="https://json-schema.org/draft/2020-12/schema",Vc={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020\
|
|
546
546
|
-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},zc="meta",Gc="Core and Validation specifications meta-schema",Bc=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/c\
|
|
547
547
|
ontent"}],Kc=["object","boolean"],Wc="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",Xc={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantic\
|
|
@@ -553,42 +553,42 @@ tps://json-schema.org/draft/2020-12/vocab/unevaluated":!0},iu="meta",cu="Unevalu
|
|
|
553
553
|
s://json-schema.org/draft/2020-12/meta/content",pu={"https://json-schema.org/draft/2020-12/vocab/content":!0},hu="meta",mu="Content vocabulary meta-schema",yu=["object","boolean"],gu={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},nm={$schema:fu,$id:du,$vocabulary:pu,$dynamicAnchor:hu,title:mu,type:yu,properties:gu},sm={__proto__:null,$dynamicAnchor:hu,$id:du,$schema:fu,$vocabulary:pu,default:nm,properties:gu,title:mu,type:yu},om=De(sm),$u="\
|
|
554
554
|
https://json-schema.org/draft/2020-12/schema",vu="https://json-schema.org/draft/2020-12/meta/core",_u={"https://json-schema.org/draft/2020-12/vocab/core":!0},wu="meta",bu="Core vocabulary meta-schema",Eu=["object","boolean"],Su={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{
|
|
555
555
|
$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},Ru={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},am={$schema:$u,$id:vu,$vocabulary:_u,$dynamicAnchor:wu,title:bu,type:Eu,properties:Su,$defs:Ru},im={__proto__:null,
|
|
556
|
-
$defs:Ru,$dynamicAnchor:wu,$id:vu,$schema:$u,$vocabulary:_u,default:am,properties:Su,title:bu,type:Eu},cm=De(im),Au="https://json-schema.org/draft/2020-12/schema",Pu="https://json-schema.org/draft/2020-12/meta/format-annotation",Cu={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},ku="meta",Tu="Format vocabulary meta-schema for annotation results",Nu=["object","boolean"],
|
|
557
|
-
lm={__proto__:null,$dynamicAnchor:ku,$id:Pu,$schema:Au,$vocabulary:Cu,default:um,properties:
|
|
558
|
-
writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},dm={$schema:
|
|
556
|
+
$defs:Ru,$dynamicAnchor:wu,$id:vu,$schema:$u,$vocabulary:_u,default:am,properties:Su,title:bu,type:Eu},cm=De(im),Au="https://json-schema.org/draft/2020-12/schema",Pu="https://json-schema.org/draft/2020-12/meta/format-annotation",Cu={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},ku="meta",Tu="Format vocabulary meta-schema for annotation results",Nu=["object","boolean"],Iu={format:{type:"string"}},um={$schema:Au,$id:Pu,$vocabulary:Cu,$dynamicAnchor:ku,title:Tu,type:Nu,properties:Iu},
|
|
557
|
+
lm={__proto__:null,$dynamicAnchor:ku,$id:Pu,$schema:Au,$vocabulary:Cu,default:um,properties:Iu,title:Tu,type:Nu},fm=De(lm),Ou="https://json-schema.org/draft/2020-12/schema",ju="https://json-schema.org/draft/2020-12/meta/meta-data",Lu={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},Du="meta",qu="Meta-data vocabulary meta-schema",xu=["object","boolean"],Mu={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},
|
|
558
|
+
writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},dm={$schema:Ou,$id:ju,$vocabulary:Lu,$dynamicAnchor:Du,title:qu,type:xu,properties:Mu},pm={__proto__:null,$dynamicAnchor:Du,$id:ju,$schema:Ou,$vocabulary:Lu,default:dm,properties:Mu,title:qu,type:xu},hm=De(pm),Hu="https://json-schema.org/draft/2020-12/schema",Uu="https://json-schema.org/draft/2020-12/meta/validation",Fu={"https://json-schema.org/draft/2020-12/vocab/validation":!0},Vu="meta",zu="Validation vocabulary meta-sch\
|
|
559
559
|
ema",Gu=["object","boolean"],Bu={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{
|
|
560
560
|
$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},Ku={nonNegativeInteger:{type:"integ\
|
|
561
561
|
er",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},mm={$schema:Hu,$id:Uu,$vocabulary:Fu,$dynamicAnchor:Vu,title:zu,type:Gu,properties:Bu,$defs:Ku},ym={__proto__:null,$defs:Ku,$dynamicAnchor:Vu,$id:Uu,$schema:Hu,$vocabulary:Fu,default:mm,properties:Bu,title:zu,type:Gu},gm=De(ym);var Wu;function $m(){if(Wu)
|
|
562
562
|
return Zr;Wu=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=Jh,t=Zh,r=rm,n=om,i=cm,s=fm,o=hm,a=gm,u=["/properties"];function c(l){return[e,t,r,n,i,h(this,s),o,h(this,a)].forEach(y=>this.addMetaSchema(y,void 0,!1)),this;function h(y,_){return l?y.$dataMetaSchema(_,u):_}}return Zr.default=c,Zr}var Xu;function vm(){return Xu||(Xu=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=
|
|
563
|
-
t.Ajv2020=void 0;const r=
|
|
563
|
+
t.Ajv2020=void 0;const r=Ii(),n=Bh(),i=Hc(),s=$m(),o="https://json-schema.org/draft/2020-12/schema";class a extends r.default{constructor(_={}){super({..._,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:_,meta:S}=this.opts;S&&(s.default.call(this,_),this.refs["http://json-schema.org/schema"]=o)}defaultMeta(){
|
|
564
564
|
return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var u=Nt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var c=ae();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){
|
|
565
|
-
return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var l=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var h=
|
|
565
|
+
return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var l=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var h=It();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})})(Zt,Zt.exports)),Zt.exports}var _m=vm(),
|
|
566
566
|
en={exports:{}},Es={},Ju;function wm(){return Ju||(Ju=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(x,H){return{validate:x,compare:H}}e.fullFormats={date:t(s,o),time:t(u(!0),c),"date-time":t(y(!0),_),"iso-time":t(u(),l),"iso-date-time":t(y(),S),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:m,"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,
|
|
567
567
|
"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,
|
|
568
568
|
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|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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,
|
|
569
569
|
regex:U,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:d,int32:{type:"number",validate:w},int64:{type:"number",validate:E},float:{type:"number",validate:P},double:{type:"number",validate:P},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,
|
|
570
570
|
o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"iso-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,S),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
571
|
-
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 r(x){return x%4===0&&(x%100!==0||x%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(x){const H=n.exec(x);if(!H)return!1;const D=+H[1],
|
|
572
|
-
function u(x){return function(D){const
|
|
573
|
-
D[1]+D[2]+D[3],H=
|
|
574
|
-
function m(x){return $.test(x)&&p.test(x)}const f=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function d(x){return f.lastIndex=0,f.test(x)}const g=-2147483648,v=2**31-1;function w(x){return Number.isInteger(x)&&x<=v&&x>=g}function E(x){return Number.isInteger(x)}function P(){return!0}const
|
|
571
|
+
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 r(x){return x%4===0&&(x%100!==0||x%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(x){const H=n.exec(x);if(!H)return!1;const D=+H[1],O=+H[2],M=+H[3];return O>=1&&O<=12&&M>=1&&M<=(O===2&&r(D)?29:i[O])}function o(x,H){if(x&&H)return x>H?1:x<H?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
572
|
+
function u(x){return function(D){const O=a.exec(D);if(!O)return!1;const M=+O[1],z=+O[2],F=+O[3],G=O[4],Q=O[5]==="-"?-1:1,q=+(O[6]||0),A=+(O[7]||0);if(q>23||A>59||x&&!G)return!1;if(M<=23&&z<=59&&F<60)return!0;const L=z-A*Q,T=M-q*Q-(L<0?1:0);return(T===23||T===-1)&&(L===59||L===-1)&&F<61}}function c(x,H){if(!(x&&H))return;const D=new Date("2020-01-01T"+x).valueOf(),O=new Date("2020-01-01T"+H).valueOf();if(D&&O)return D-O}function l(x,H){if(!(x&&H))return;const D=a.exec(x),O=a.exec(H);if(D&&O)return x=
|
|
573
|
+
D[1]+D[2]+D[3],H=O[1]+O[2]+O[3],x>H?1:x<H?-1:0}const h=/t|\s/i;function y(x){const H=u(x);return function(O){const M=O.split(h);return M.length===2&&s(M[0])&&H(M[1])}}function _(x,H){if(!(x&&H))return;const D=new Date(x).valueOf(),O=new Date(H).valueOf();if(D&&O)return D-O}function S(x,H){if(!(x&&H))return;const[D,O]=x.split(h),[M,z]=H.split(h),F=o(D,M);if(F!==void 0)return F||c(O,z)}const $=/\/|:/,p=/^(?:[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;
|
|
574
|
+
function m(x){return $.test(x)&&p.test(x)}const f=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function d(x){return f.lastIndex=0,f.test(x)}const g=-2147483648,v=2**31-1;function w(x){return Number.isInteger(x)&&x<=v&&x>=g}function E(x){return Number.isInteger(x)}function P(){return!0}const I=/[^\\]\\Z/;function U(x){if(I.test(x))return!1;try{return new RegExp(x),!0}catch{return!1}}})(Es)),Es}var Ss={},tn={exports:{}},rn={},Yu;function bm(){if(Yu)return rn;Yu=1,Object.defineProperty(
|
|
575
575
|
rn,"__esModule",{value:!0});const e=Di(),t=Ji(),r=gc(),n=jc(),i=Dc(),s=[e.default,t.default,(0,r.default)(),n.default,i.metadataVocabulary,i.contentVocabulary];return rn.default=s,rn}const Qu="http://json-schema.org/draft-07/schema#",Zu="http://json-schema.org/draft-07/schema#",el="Core schema meta-schema",tl={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},
|
|
576
576
|
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},rl=["object","boolean"],nl={$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},
|
|
577
577
|
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:"boolea\
|
|
578
578
|
n",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:"\
|
|
579
579
|
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:"#/def\
|
|
580
|
-
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Em={$schema:Qu,$id:Zu,title:el,definitions:tl,type:rl,properties:nl,default:!0},Sm={__proto__:null,$id:Zu,$schema:Qu,default:Em,definitions:tl,properties:nl,title:el,type:rl},Rm=De(Sm);var sl;function Am(){return sl||(sl=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 r=
|
|
580
|
+
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Em={$schema:Qu,$id:Zu,title:el,definitions:tl,type:rl,properties:nl,default:!0},Sm={__proto__:null,$id:Zu,$schema:Qu,default:Em,definitions:tl,properties:nl,title:el,type:rl},Rm=De(Sm);var sl;function Am(){return sl||(sl=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 r=Ii(),n=bm(),i=Hc(),
|
|
581
581
|
s=Rm,o=["/properties"],a="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(S=>this.addVocabulary(S)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const S=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema(S,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||
|
|
582
582
|
(this.getSchema(a)?a:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var c=Nt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=ae();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(t,
|
|
583
|
-
"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var h=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var y=
|
|
583
|
+
"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var h=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var y=It();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return y.default}})})(tn,tn.exports)),tn.exports}var ol;function Pm(){return ol||(ol=1,(function(e){
|
|
584
584
|
Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Am(),r=ae(),n=r.operators,i={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},s={message:({keyword:a,schemaCode:u})=>(0,r.str)`should be ${i[a].okStr} ${u}`,params:({keyword:a,schemaCode:u})=>(0,r._)`{comparison: ${i[a].okStr}, limit: ${u}}`};e.formatLimitDefinition=
|
|
585
585
|
{keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:s,code(a){const{gen:u,data:c,schemaCode:l,keyword:h,it:y}=a,{opts:_,self:S}=y;if(!_.validateFormats)return;const $=new t.KeywordCxt(y,S.RULES.all.format.definition,"format");$.$data?p():m();function p(){const d=u.scopeValue("formats",{ref:S.formats,code:_.code.formats}),g=u.const("fmt",(0,r._)`${d}[${$.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${g} != "object"`,(0,r._)`${g} instanceof RegExp`,(0,r._)`typeof ${g}.compare != "function"`,
|
|
586
586
|
f(g)))}function m(){const d=$.schema,g=S.formats[d];if(!g||g===!0)return;if(typeof g!="object"||g instanceof RegExp||typeof g.compare!="function")throw new Error(`"${h}": format "${d}" does not define "compare" function`);const v=u.scopeValue("formats",{key:d,ref:g,code:_.code.formats?(0,r._)`${_.code.formats}${(0,r.getProperty)(d)}`:void 0});a.fail$data(f(v))}function f(d){return(0,r._)`${d}.compare(${c}, ${l}) ${i[h].fail} 0`}},dependencies:["format"]};const o=a=>(a.addKeyword(e.formatLimitDefinition),
|
|
587
587
|
a);e.default=o})(Ss)),Ss}var al;function Cm(){return al||(al=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=wm(),n=Pm(),i=ae(),s=new i.Name("fullFormats"),o=new i.Name("fastFormats"),a=(c,l={keywords:!0})=>{if(Array.isArray(l))return u(c,l,r.fullFormats,s),c;const[h,y]=l.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,s],_=l.formats||r.formatNames;return u(c,_,h,y),l.keywords&&(0,n.default)(c),c};a.get=(c,l="full")=>{const y=(l==="fast"?r.fastFormats:r.fullFormats)[c];if(!y)
|
|
588
588
|
throw new Error(`Unknown format "${c}"`);return y};function u(c,l,h,y){var _,S;(_=(S=c.opts.code).formats)!==null&&_!==void 0||(S.formats=(0,i._)`require("ajv-formats/dist/formats").${y}`);for(const $ of l)c.addFormat($,h[$])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(en,en.exports)),en.exports}var km=Cm();const Tm=mn(km),Nm=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const i=Object.getOwnPropertyDescriptor(e,r),s=Object.getOwnPropertyDescriptor(
|
|
589
|
-
t,r);!
|
|
589
|
+
t,r);!Im(i,s)&&n||Object.defineProperty(e,r,s)},Im=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Om=(e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},jm=(e,t)=>`/* Wrapped ${e}*/
|
|
590
590
|
${t}`,Lm=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Dm=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),qm=(e,t,r)=>{const n=r===""?"":`with ${r.trim()}() `,i=jm.bind(null,n,t.toString());Object.defineProperty(i,"name",Dm);const{writable:s,enumerable:o,configurable:a}=Lm;Object.defineProperty(e,"toString",{value:i,writable:s,enumerable:o,configurable:a})};function xm(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:n}=e;for(const i of Reflect.ownKeys(t))Nm(e,
|
|
591
|
-
t,i,r);return
|
|
591
|
+
t,i,r);return Om(e,t),qm(e,t,n),e}const il=(e,t={})=>{if(typeof e!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:i=!1,after:s=!0}=t;if(r<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!s)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,u;const c=function(...l){const h=this,y=()=>{o=void 0,a&&(clearTimeout(a),a=
|
|
592
592
|
void 0),s&&(u=e.apply(h,l))},_=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),s&&(u=e.apply(h,l))},S=i&&!o;return clearTimeout(o),o=setTimeout(y,r),n>0&&n!==Number.POSITIVE_INFINITY&&!a&&(a=setTimeout(_,n)),S&&(u=e.apply(h,l)),u};return xm(c,e),c.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},c};var nn={exports:{}},Rs,cl;function sn(){if(cl)return Rs;cl=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=t-6;return Rs={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,
|
|
593
593
|
MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Rs}var As,ul;function on(){return ul||(ul=1,As=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),As}var ll;function Lt(){return ll||(ll=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,
|
|
594
594
|
MAX_LENGTH:i}=sn(),s=on();t=e.exports={};const o=t.re=[],a=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],l=t.t={};let h=0;const y="[a-zA-Z0-9-]",_=[["\\s",1],["\\d",i],[y,n]],S=p=>{for(const[m,f]of _)p=p.split(`${m}*`).join(`${m}{0,${f}}`).split(`${m}+`).join(`${m}{1,${f}}`);return p},$=(p,m,f)=>{const d=S(m),g=h++;s(p,g,m),l[p]=g,u[g]=m,c[g]=d,o[g]=new RegExp(m,f?"g":void 0),a[g]=new RegExp(d,f?"g":void 0)};$("NUMERICIDENTIFIER","0|[1-9]\\d*"),$("NUMERICIDENTIFIERLOOSE","\\d+"),$("NONNUMERICIDENTIFIER",
|
|
@@ -598,109 +598,110 @@ GEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),$("XRANGEIDENTIFIER
|
|
|
598
598
|
$`),$("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),$("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),$("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),$("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),$("COERCERTL",u[l.COERCE],!0),$("COERCERTLFULL",u[l.COERCEFULL],!0),$("LONETILDE","(?:~>?)"),$("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",$("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}\
|
|
599
599
|
$`),$("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),$("LONECARET","(?:\\^)"),$("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",$("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),$("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),$("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),$("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),$("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace=
|
|
600
600
|
"$1$2$3",$("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),$("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),$("STAR","(<|>)?=?\\s*\\*"),$("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),$("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(nn,nn.exports)),nn.exports}var Ps,fl;function Cs(){if(fl)return Ps;fl=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Ps=n=>n?typeof n!="object"?e:n:t,Ps}var ks,dl;function pl(){if(dl)return ks;
|
|
601
|
-
dl=1;const e=/^[0-9]+$/,t=(n,i)=>{const s=e.test(n),o=e.test(i);return s&&o&&(n=+n,i=+i),n===i?0:s&&!o?-1:o&&!s?1:n<i?-1:1};return ks={compareIdentifiers:t,rcompareIdentifiers:(n,i)=>t(i,n)},ks}var Ts,hl;function Se(){if(hl)return Ts;hl=1;const e=on(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=sn(),{safeRe:n,t:i}=Lt(),s=Cs(),{compareIdentifiers:o}=pl();class a{constructor(c,l){if(l=s(l),c instanceof a){if(c.loose===!!l.loose&&c.includePrerelease
|
|
602
|
-
"string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const h=c.trim().match(l.loose?n[i.LOOSE]:n[i.FULL]);if(!h)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+h[1],this.minor=+h[2],this.patch=+h[3],this.major>
|
|
603
|
-
|
|
604
|
-
return this.version}compare(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof a)){if(typeof c=="string"&&c===this.version)return 0;c=new a(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof a||(c=new a(c,this.options)),
|
|
605
|
-
prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let l=0;do{const h=this.prerelease[l],y=c.prerelease[l];if(e("prerelease compare",l,h,y),h===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(h===void 0)return-1;if(h===y)continue;return o(h,y)}while(++l)}compareBuild(c){c instanceof a||(c=new a(c,this.options));let l=0;do{const h=this.
|
|
606
|
-
if(h===void 0)return-1;if(h===y)continue;return o(h,y)}while(++l)}inc(c,l,h){if(c.startsWith("pre")){if(!l&&h===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const y=`-${l}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!y||y[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.
|
|
607
|
-
minor++,this.inc("pre",l,h);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,h),this.inc("pre",l,h);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,h),this.inc("pre",l,h);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.
|
|
608
|
-
patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(h)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let _=this.prerelease.length;for(;--_>=0;)typeof this.prerelease[_]=="number"&&(this.prerelease[_]++,_=-2);if(_===-1){if(l===this.prerelease.
|
|
609
|
-
push(y)}}if(l){let _=[l,y];h===!1&&(_=[l]),o(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=_):this.prerelease=_}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ts=a,Ts}var Ns,ml;function $t(){if(ml)return Ns;ml=1;const e=Se();return Ns=(r,n,i=!1)=>{if(r instanceof
|
|
610
|
-
if(yl)return
|
|
611
|
-
return Ls=(r,n)=>{const i=e(r,null,!0),s=e(n,null,!0),o=i.compare(s);if(o===0)return null;const a=o>0,u=a?i:s,c=a?s:i,l=!!u.prerelease.length;if(!!c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(c.compareMain(u)===0)return c.minor&&!c.patch?"minor":"patch"}const y=l?"pre":"";return i.major!==s.major?y+"major":i.minor!==s.minor?y+"minor":i.patch!==s.patch?y+"patch":"prerelease"},
|
|
612
|
-
wl;function zm(){if(wl)return qs;wl=1;const e=Se();return qs=(r,n)=>new e(r,n).minor,qs}var xs,bl;function Gm(){if(bl)return xs;bl=1;const e=Se();return xs=(r,n)=>new e(r,n).patch,xs}var Ms,El;function Bm(){if(El)return Ms;El=1;const e=$t();return Ms=(r,n)=>{const i=e(r,n);return i&&i.prerelease.length?i.prerelease:null},Ms}var Hs,Sl;function je(){if(Sl)return Hs;Sl=1;const e=Se();return Hs=(r,n,i)=>new e(
|
|
613
|
-
(r,n,i)=>e(n,r,i),Us}var Fs,Al;function Wm(){if(Al)return Fs;Al=1;const e=je();return Fs=(r,n)=>e(r,n,!0),Fs}var Vs,Pl;function zs(){if(Pl)return Vs;Pl=1;const e=Se();return Vs=(r,n,i)=>{const s=new e(r,i),o=new e(n,i);return s.compare(o)||s.compareBuild(o)},Vs}var Gs,Cl;function Xm(){if(Cl)return Gs;Cl=1;const e=zs();return Gs=(r,n)=>r.sort((i,s)=>e(i,s,n)),Gs}var Bs,kl;function Jm(){if(kl)return Bs;
|
|
614
|
-
|
|
615
|
-
n,i)<=0,eo}var ro,xl;function Ml(){if(xl)return ro;xl=1;const e=
|
|
616
|
-
`Invalid operator: ${u}`)}},ro}var no,Hl;function Ym(){if(Hl)return no;Hl=1;const e=Se(),t=$t(),{safeRe:r,t:n}=Lt();return no=(s,o)=>{if(s instanceof e)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;o=o||{};let a=null;if(!o.rtl)a=s.match(o.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const _=o.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let S;for(;(S=_.exec(
|
|
617
|
-
S),_.lastIndex=S.index+S[1].length+S[2].length;_.lastIndex=-1}if(a===null)return null;const u=a[2],c=a[3]||"0",l=a[4]||"0",h=o.includePrerelease&&a[5]?`-${a[5]}`:"",y=o.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${u}.${c}.${l}${h}${y}`,o)},no}var so,Ul;function Qm(){if(Ul)return so;Ul=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.
|
|
618
|
-
n!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(r,n)}return this}}return so=e,so}var oo,Fl;function Le(){if(Fl)return oo;Fl=1;const e=/\s+/g;class t{constructor(M,z){if(z=i(z),M instanceof t)return M.loose===!!z.loose&&M.includePrerelease===!!z.includePrerelease?M:new t(M.raw,z);if(M instanceof s)return this.raw=M.value,this.set=[[M]],this.formatted=
|
|
619
|
-
this.raw=M.trim().replace(e," "),this.set=this.raw.split("||").map(F=>this.parseRange(F.trim())).filter(F=>F.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const F=this.set[0];if(this.set=this.set.filter(G=>!$(G[0])),this.set.length===0)this.set=[F];else if(this.set.length>1){for(const G of this.set)if(G.length===1&&p(G[0])){this.set=[G];break}}}
|
|
620
|
-
set.length;M++){M>0&&(this.formatted+="||");const z=this.set[M];for(let F=0;F<z.length;F++)F>0&&(this.formatted+=" "),this.formatted+=z[F].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const F=((this.options.includePrerelease&&_)|(this.options.loose&&S))+":"+M,G=n.get(F);if(G)return G;const Q=this.options.loose,q=Q?u[c.HYPHENRANGELOOSE]:
|
|
621
|
-
u[c.COMPARATORTRIM],l),o("comparator trim",M),M=M.replace(u[c.TILDETRIM],h),o("tilde trim",M),M=M.replace(u[c.CARETTRIM],y),o("caret trim",M);let A=M.split(" ").map(b=>f(b,this.options)).join(" ").split(/\s+/).map(b=>x(b,this.options));Q&&(A=A.filter(b=>(o("loose invalid filter",b,this.options),!!b.match(u[c.COMPARATORLOOSE])))),o("range list",A);const L=new Map,T=A.map(b=>new s(b,this.options));for(const b of T){
|
|
622
|
-
values()];return n.set(F,R),R}intersects(M,z){if(!(M instanceof t))throw new TypeError("a Range is required");return this.set.some(F=>m(F,z)&&M.set.some(G=>m(G,z)&&F.every(Q=>G.every(q=>Q.intersects(q,z)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new a(M,this.options)}catch{return!1}for(let z=0;z<this.set.length;z++)if(D(this.set[z],M,this.options))return!0;return!1}}oo=t;const r=Qm(),n=new r,i=Cs(),s=cn(),
|
|
623
|
-
{FLAG_INCLUDE_PRERELEASE:_,FLAG_LOOSE:S}=sn(),$=
|
|
624
|
-
o("tilde",
|
|
625
|
-
.0.0${F} <${+Q+1}.0.0-0`:d(A)?Q==="0"?T=`>=${Q}.${q}.0${F} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.0${F} <${+Q+1}.0.0-0`:L?(o("replaceCaret pr",L),Q==="0"?q==="0"?T=`>=${Q}.${q}.${A}-${L} <${Q}.${q}.${+A+1}-0`:T=`>=${Q}.${q}.${A}-${L} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.${A}-${L} <${+Q+1}.0.0-0`):(o("no pr"),Q==="0"?q==="0"?T=`>=${Q}.${q}.${A}${F} <${Q}.${q}.${+A+1}-0`:T
|
|
626
|
-
M),
|
|
627
|
-
.0${L} <${Q}.${+q+1}.0-0`),o("xRange return",F),F})},U=(
|
|
628
|
-
D=(
|
|
629
|
-
return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,h),this.options=h,this.loose=!!h.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const h=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],y=l.match(h);if(!y)throw new TypeError(`Invalid comparator: ${l}`);this.operator=
|
|
630
|
-
return this.value}test(l){if(o("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,h){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(l.value,h).
|
|
631
|
-
-0"||l.value==="<0.0.0-0")||!h.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,h)&&this.
|
|
632
|
-
">")))}}ao=t;const r=Cs(),{safeRe:n,t:i}=Lt(),s=Ml(),o=on(),a=Se(),u=Le();return ao}var io,zl;function un(){if(zl)return io;zl=1;const e=Le();return io=(r,n,i)=>{try{n=new e(n,i)}catch{return!1}return n.test(r)},io}var co,Gl;function Zm(){if(Gl)return co;Gl=1;const e=Le();return co=(r,n)=>new e(r,n).set.map(i=>i.map(s=>s.value).join(" ").trim().split(" ")),co}
|
|
633
|
-
return n.forEach(c=>{u.test(c)&&(!o||a.compare(c)===-1)&&(o=c,a=new e(o,s))}),o},uo}var lo,Kl;function ty(){if(Kl)return lo;Kl=1;const e=Se(),t=Le();return lo=(n,i,s)=>{let o=null,a=null,u=null;try{u=new t(i,s)}catch{return null}return n.forEach(c=>{u.test(c)&&(!o||a.compare(c)===1)&&(o=c,a=new e(o,s))}),o},lo}var fo,Wl;function ry(){if(Wl)return fo;Wl=
|
|
634
|
-
i.set.length;++a){const u=i.set[a];let c=null;u.forEach(l=>{const h=new e(l.semver.version);switch(l.operator){case">":h.prerelease.length===0?h.patch++:h.prerelease.push(0),h.raw=h.format();case"":case">=":(!c||r(h,c))&&(c=h);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),c&&(!o||r(o,c))&&(o=c)}
|
|
635
|
-
po}var ho,Jl;function mo(){if(Jl)return ho;Jl=1;const e=Se(),t=cn(),{ANY:r}=t,n=Le(),i=un(),s=an(),o=Xs(),a=to(),u=Zs();return ho=(l,h,y,_)=>{l=new e(l,_),h=new n(h,_);let S,$,p,m,f;switch(y){case">":S=s,$=a,p=o,m=">",f=">=";break;case"<":S=o,$=u,p=s,m="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(
|
|
636
|
-
v.semver,_)?v=E:p(E.semver,w.semver,_)&&(w=E)}),v.operator===m||v.operator===f||(!w.operator||w.operator===m)&&$(l,w.semver))return!1;if(w.operator===f&&p(l,w.semver))return!1}return!0},ho}var yo,Yl;function sy(){if(Yl)return yo;Yl=1;const e=mo();return yo=(r,n,i)=>e(r,n,">",i),yo}var go,Ql;function oy(){if(Ql)return go;Ql=1;const e=mo();
|
|
637
|
-
var vo,ef;function iy(){if(ef)return vo;ef=1;const e=un(),t=je();return vo=(r,n,i)=>{const s=[];let o=null,a=null;const u=r.sort((y,_)=>t(y,_,i));for(const y of u)e(y,n,i)?(a=y,o||(o=y)):(a&&s.push([o,a]),a=null,o=null);o&&s.push([o,null]);const c=[];for(const[y,_]of s)y===_?c.push(y):!_&&y===u[0]?c.push("*"):_?y===u[0]?c.push(`<=${_}`):
|
|
638
|
-
return _o;tf=1;const e=Le(),t=cn(),{ANY:r}=t,n=un(),i=je(),s=(h,y,_={})=>{if(h===y)return!0;h=new e(h,_),y=new e(y,_);let S=!1;e:for(const $ of h.set){for(const p of y.set){const m=u($,p,_);if(S=S||m!==null,m)continue e}if(S)return!1}return!0},o=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],u=(h,y,_)=>{if(h===y)return!0;if(h.length===1&&
|
|
639
|
-
let $,p;for(const P of h)P.operator===">"||P.operator===">="?$=c($,P,_):P.operator==="<"||P.operator==="<="?p=l(p,P,_):S.add(P.semver);if(S.size>1)return null;let m;if($&&p){if(m=i($.semver,p.semver,_),m>0)return null;if(m===0&&($.operator!==">="||p.operator!=="<="))return null}for(const P of S){if($&&!n(P,String($),_)||p&&!n(
|
|
640
|
-
|
|
641
|
-
P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===w.major&&P.semver.minor===w.minor&&P.semver.patch===w.patch&&(w=!1),P.operator==="<"||P.operator==="<="){if(d=l(p,P,_),d===P&&d!==p)return!1}else if(p.operator==="<="&&!n(p.semver,String(P),_))return!1}if(!P.operator&&(p||$)&&m!==0)return!1}return!($&&
|
|
642
|
-
const S=i(h.semver,y.semver,_);return S<0?h:S>0||y.operator==="<"&&h.operator==="<="?y:h};return _o=s,_o}var wo,rf;function uy(){if(rf)return wo;rf=1;const e=Lt(),t=sn(),r=Se(),n=pl(),i=$t(),s=Mm(),o=Hm(),a=Um(),u=Fm(),c=Vm(),l=zm(),h=Gm(),y=Bm(),_=je(),S=Km(),$=Wm(),p=zs(),m=Xm(),f=Jm(),d=an(),g=Xs(),v=
|
|
643
|
-
patch:h,prerelease:y,compare:_,rcompare:S,compareLoose:$,compareBuild:p,sort:m,rsort:f,gt:d,lt:g,eq:v,neq:w,gte:E,lte:P,cmp:
|
|
644
|
-
const vt=mn(bo),ly=Object.prototype.toString,fy="[object Uint8Array]",dy="[object ArrayBuffer]";function nf(e,t,r){return e?e.constructor===t?!0:ly.call(e)===r:!1}function sf(e){return nf(e,Uint8Array,fy)}function py(e){return nf(e,ArrayBuffer,dy)}function hy(e){return sf(e)||py(e)}function my(e){if(!sf(e))throw new TypeError(
|
|
645
|
-
if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,s)=>i+s.length,0);const r=new Uint8Array(t);let n=0;for(const i of e)my(i),r.set(i,n),n+=i.length;return r}const af={utf8:new globalThis.TextDecoder("utf8")};function cf(e,t="utf8"){return yy(e),af[t]??=new globalThis.TextDecoder(t),af[t].decode(e)}function gy(e){if(typeof e!=
|
|
646
|
-
(e,t)=>t.toString(16).padStart(2,"0"));const vy=Tm.default,uf="aes-256-cbc",_t=()=>Object.create(null),_y=e=>e!=null,wy=(e,t)=>{const r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},ln="
|
|
647
|
-
accessPropertiesByDotNotation:!0,configFileMode:438,...t};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=Lp(r.projectName,{suffix:r.projectSuffix}).config}if(this.#e=r,r.schema??r.ajvOptions??r.rootSchema){if(r.schema&&typeof r.schema!="object")throw new TypeError(
|
|
648
|
-
compile(a);for(const[u,c]of Object.entries(r.schema??{}))c?.default&&(this.#r[u]=c.default)}r.defaults&&(this.#r={...this.#r,...r.defaults}),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new EventTarget,this.#t=r.encryptionKey;const n=r.fileExtension?`.${r.
|
|
649
|
-
"Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(s);try{ud.deepEqual(i,s)}catch{this.store=s}r.watch&&this._watch()}get(t,r){if(this.#e.accessPropertiesByDotNotation)return this._get(t,r);const{store:n}=this;return t in n?n[t]:r}set(t,r){
|
|
650
|
-
"Use `delete()` to clear values");if(this._containsReservedKey(t))throw new TypeError(`Please don't use the ${ln} key, as it's used to manage this module internal operations.`);const{store:n}=this,i=(s,o)=>{wy(s,o),this.#e.accessPropertiesByDotNotation?Ga(n,s,o):n[s]=o};if(typeof t=="object"){const s=t;for(const[
|
|
651
|
-
this.set(r,this.#r[r])}delete(t){const{store:r}=this;this.#e.accessPropertiesByDotNotation?Tp(r,t):delete r[t],this.store=r}clear(){this.store=_t();for(const t of Object.keys(this.#r))this.reset(t)}onDidChange(t,r){if(typeof t!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof t}`);
|
|
652
|
-
"function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.store,t)}get size(){return Object.keys(this.store).length}get store(){try{const t=se.readFileSync(this.path,this.#t?null:"utf8"),r=this._encryptData(t),n=this._deserialize(r);return this.
|
|
653
|
-
this._ensureDirectory(),this._validate(t),this._write(t),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[t,r]of Object.entries(this.store))yield[t,r]}_encryptData(t){if(!this.#t)return typeof t=="string"?t:cf(t);try{const r=t.slice(0,16),n=Pt.pbkdf2Sync(this.#t,r.toString(),1e4,32,
|
|
654
|
-
const s=n,o=t();cd(o,s)||(n=o,r.call(this,o,s))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=t=>JSON.parse(t);_serialize=t=>JSON.stringify(t,void 0," ");_validate(t){if(!this.#n||this.#n(t)||!this.#n.errors)return;const n=this.#n.errors.map(({
|
|
655
|
-
let r=this._serialize(t);if(this.#t){const n=Pt.randomBytes(16),i=Pt.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),s=Pt.createCipheriv(uf,i,n);r=of([n,Eo(":"),s.update(Eo(r)),s.final()])}if(me.env.SNAP)se.writeFileSync(this.path,r,{mode:this.#e.configFileMode});else try{Ja(this.path,r,{mode:this.#e.configFileMode})}catch(n){
|
|
656
|
-
me.platform==="win32"?se.watch(this.path,{persistent:!1},il(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):se.watchFile(this.path,{persistent:!1},il(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(t,r,n){let i=this._get(So,"0.0.0");const s=Object.keys(t).filter(a=>this._shouldPerformMigration(
|
|
657
|
-
{...this.store}}catch(u){throw this.store=o,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${u}`)}(this._isVersionInRangeFormat(i)||!vt.eq(i,r))&&this._set(So,r)}_containsReservedKey(t){return typeof t=="object"&&Object.keys(t)[0]===ln?!0:typeof t!="string"
|
|
658
|
-
_isVersionInRangeFormat(t)?r!=="0.0.0"&&vt.satisfies(r,t)?!1:vt.satisfies(n,t):!(vt.lte(t,r)||vt.gt(t,n))}_get(t,r){return kp(this.store,t,r)}_set(t,r){const{store:n}=this;Ga(n,t,r),this.store=n}}class lf extends Error{response;request;options;constructor(t,r,n){const i=t.status||t.status===0?t.status:"",s=t.statusText||"",o=`${i} ${s}`.
|
|
659
|
-
options=n}}class ff extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}const df=(()=>{let e=!1,t=!1;const r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.
|
|
660
|
-
BodyInit type")return!1;throw i}return e&&!t})(),Ey=typeof globalThis.AbortController=="function",Sy=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Ry=typeof globalThis.ReadableStream=="function",Ay=typeof globalThis.FormData=="function",pf=["get","post","put","patch","head","delete"],Py={json:"application/
|
|
661
|
-
|
|
662
|
-
encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).
|
|
663
|
-
t).length}catch{return 0}return 0},
|
|
664
|
-
u.byteLength;const c=r===0?0:n/r;t({percent:c,transferredBytes:n,totalBytes:r},u)}i.enqueue(u),await o()}await o()}}),{status:e.status,statusText:e.statusText,headers:e.headers})},
|
|
665
|
-
max(r,n)},new Uint8Array),i.close();return}n+=u.byteLength;let c=r===0?0:n/r;(r<n||c===1)&&(c=.99),t&&t({percent:Number(c.toFixed(2)),transferredBytes:n,totalBytes:r},u),i.enqueue(u),await o()}await o()}})})},Dt=e=>e!==null&&typeof e=="object",fn=(...e)=>{for(const t of e)if((!Dt(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be
|
|
666
|
-
Headers(t);for(const[s,o]of i.entries())n&&o==="undefined"||o===void 0?r.delete(s):r.set(s,o);return r};function dn(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:Ao(e[r]??[],t[r]??[])}const yf=(e={},t={})=>({beforeRequest:dn(e,t,"beforeRequest"),beforeRetry:dn(e,t,"beforeRetry"),afterResponse:dn(e,t,"afterResponse"),beforeError:dn(e,t,"beforeError")}),Ao=(...e)=>{
|
|
667
|
-
entries(i))Dt(o)&&s in t&&(o=Ao(t[s],o)),t={...t,[s]:o};Dt(i.hooks)&&(n=yf(n,i.hooks),t.hooks=n),Dt(i.headers)&&(r=mf(r,i.headers),t.headers=r)}return t},jy=e=>pf.includes(e)?e.toUpperCase():e,Ly=["get","put","head","delete","options","trace"],Dy=[408,413,429,500,502,503,504],qy=[413,429,503],gf={limit:2,methods:Ly,statusCodes:Dy,afterStatusCodes:qy,maxRetryAfter:Number.
|
|
668
|
-
limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...gf,...e}};async function My(e,t,r,n){return new Promise((i,s)=>{const o=setTimeout(()=>{r&&r.abort(),s(new ff(e))},n.timeout);n.fetch(e,t).then(i).catch(s).then(
|
|
669
|
-
|
|
670
|
-
hooks.afterResponse){const c=await u(n.request,n._options,n._decorateResponse(a.clone()));c instanceof globalThis.Response&&(a=c)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new lf(a,n.request,n._options);for(const c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="
|
|
671
|
-
|
|
672
|
-
parseJson)return r.parseJson(await c.text())}return c[a]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(t,r={}){if(this._input=t,this._options={...r,headers:mf(this._input.headers,r.headers),hooks:yf({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:jy(r.method??this._input.method??"GET"),prefixUrl:String(r.
|
|
673
|
-
globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.
|
|
674
|
-
this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(df&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.
|
|
675
|
-
_options),this._options.searchParams){const i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),s=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(Ay&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.
|
|
676
|
-
Request(s,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!df)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&
|
|
677
|
-
limit||t instanceof ff)throw t;if(t instanceof lf){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;const n=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(
|
|
678
|
-
retry.maxRetryAfter??i;return i<s?i:s}if(t.response.status===413)throw t}const r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){const n=Math.min(
|
|
679
|
-
if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===hf)return;return this._retry(t)}}async _fetch(){for(const n of this._options.hooks.beforeRequest){const i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}const t=Uy(this.request,this._options),
|
|
680
|
-
const t=(r,n)=>hn.create(r,fn(e,n));for(const r of pf)t[r]=(n,i)=>hn.create(n,fn(e,i,{method:r}));return t.create=r=>Po(fn(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Po(fn(e,r))),t.stop=hf,t},Fy=Po(),Co=new by({projectName:qf,serialize:e=>lt.stringify(e,null,2),deserialize:e=>lt.parse(e)}),Vy=1e3*60*60*24,$f="check-update";function zy(){
|
|
681
|
-
ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:$f}}).catch(()=>{})}catch{}t&&bo.gt(t,at)&&We(["Update available: ",j.dim(at),j.reset(" \u2192 "),j.green(t)].join(""))}async function Gy(){try{const e=await By();Rn(e,"No version found in latest npm"),Co.set({lastUpdateCheck:Date.now(),latestVersion:e}),bo.gt(e,at)?We(["Update available: ",j.dim(
|
|
682
|
-
|
|
683
|
-
const n=yn.file(r.endsWith(Vo)?r:r+Vo),i=e.languageServices.projects().find(s=>s.folder.fsPath===n.fsPath);if(i)return Ae.debug`Found project ${i.id} at path: ${r}`,i.id;Ae.debug`No project registered at path: ${r}`}return e.languageServices.projectsManager.ensureProjectId(t)}function pn(e,t){const r=Wy(e,t),n=e.languageServices.projectsManager.
|
|
684
|
-
Symbol[e])?t:Symbol.for("Symbol."+e),_f=e=>{throw TypeError(e)},Xy=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&_f("Object expected");var n,i;n=t[vf("asyncDispose")],n===void 0&&(n=t[vf("dispose")],i=n),typeof n!="function"&&_f("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.
|
|
685
|
-
SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(s,u=>(i(u),s()))}catch(u){i(u)}if(r)throw t};return s()};const qt=Ae.getChild("generator");async function wf({name:e,path:t,useDotBin:r,
|
|
686
|
-
c,n);n&&qt.info(`${j.dim("project")} ${j.green(l)}`);const y=h.generators?.[e];if(!y)throw qt.error(j.red(`generator ${e} does not exist in project config`)),new Error(`generator ${e} does not exist in project config`);qt.info(`${j.dim("generator")} ${j.green(e)}`);const _=await c.layoutedModel(l);await Yy({likec4:c,model:_,generator:y,logger:qt.
|
|
687
|
-
languageServices,s=new Set,o=i.project(t.project.id),a=t.project.id;n.debug(`${j.dim("runnig for project:")} ${j.green(o.id)}`),await Promise.resolve().then(()=>r({likec4model:t,ctx:{workspace:e.languageServices.workspaceUri,project:o,locate:u=>{let c=null;switch(!0){case hd(u):c=i.locate({element:u.id,projectId:a});break;case pd(u):c=i.locate(
|
|
688
|
-
An(u)}if(!c)throw n.error(`Cannot locate ${u.id}`,{target:u}),new Error(`Cannot locate ${u.id}`);const l=yn.parse(c.uri);return{range:c.range,document:l,relativePath:gn.relative(o.folder,l),folder:gn.dirname(l).fsPath,filename:gn.basename(l)}},write:async({path:u,content:c})=>{let l;yn.isUri(u)?l=u.fsPath:l=oe(o.folder.fsPath,...Array.
|
|
689
|
-
await Xe(l,c)},abort:u=>{throw n.error(u||"Generator aborted"),new Error(u||"Generator aborted")}}}))}async function Qy(e,t,r){t=t??oe(e.workspace,"likec4.generated.ts"),St(t)!==".ts"&&(t=t+".ts"),await xe(qe(t),{recursive:!0});const n=await e.diagrams(),i=Zd([...n]);await Xe(t,i),r.info(`${j.dim("generated")} ${Ue(process.cwd(),t)}`)}
|
|
690
|
-
s=Uo(i.$data.views);let o=0;for(const a of s)try{const u=await e.viewsService.layouter.dot({view:a,styles:i.$styles});let c=".";a.sourcePath&&(c=qe(a.sourcePath)),c=oe(t,c),n.has(c)||(await xe(c,{recursive:!0}),n.add(c));const l=oe(c,a.id+".dot");await Xe(l,u),r.info(`${j.dim("generated")} ${Ue(process.cwd(),l)}`),o++}catch(u){Ae.
|
|
691
|
-
|
|
692
|
-
`error while generating ${l.id}`,{error:h})}}u>0&&n.info(`${j.dim("total")} ${u} files`)}async function xt({path:e,useDotBin:t,...r}){const n=Te("c4:codegen"),i=it(n),s=await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm"});if(s.ensureSingleProject(),(await s.viewsService.computedViews()).length===0)throw n.warn("
|
|
693
|
-
d2":case"mermaid":case"plantuml":{await eg(s,r.format,r.outdir??e,n);break}default:An(r)}i.stopAndLog()}var bf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ef=e=>{throw TypeError(e)},tg=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Ef("Object expected");var n,i;n=t[bf("asyncDispose")],n===void 0&&(n=t[bf("
|
|
694
|
-
rg=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(
|
|
695
|
-
c),h=tg(s,await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1}),!0),{projectId:y,projectFolder:_}=pn(h,i);i&&c.info(`${j.dim("project")} ${j.green(y)}`),c.info(`${j.dim("format")} ${j.green("model")}`);const S=await h.layoutedModel(y);for(const d of S.views())d.$view.hasLayoutDrift&&c.warn(j.yellow(
|
|
696
|
-
n),He(n)&&(await wn(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const p=Ut($);c.info(`${j.dim("filename")} ${p}`);const m=St(p).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(m))throw c.error(`output file ${n} has extension "${m}"`),new Error(`output file ${n} must be a .ts, .mts or .
|
|
601
|
+
dl=1;const e=/^[0-9]+$/,t=(n,i)=>{if(typeof n=="number"&&typeof i=="number")return n===i?0:n<i?-1:1;const s=e.test(n),o=e.test(i);return s&&o&&(n=+n,i=+i),n===i?0:s&&!o?-1:o&&!s?1:n<i?-1:1};return ks={compareIdentifiers:t,rcompareIdentifiers:(n,i)=>t(i,n)},ks}var Ts,hl;function Se(){if(hl)return Ts;hl=1;const e=on(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=sn(),{safeRe:n,t:i}=Lt(),s=Cs(),{compareIdentifiers:o}=pl();class a{constructor(c,l){if(l=s(l),c instanceof a){if(c.loose===!!l.loose&&c.includePrerelease===
|
|
602
|
+
!!l.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const h=c.trim().match(l.loose?n[i.LOOSE]:n[i.FULL]);if(!h)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+h[1],this.minor=+h[2],this.patch=+h[3],this.major>
|
|
603
|
+
r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");h[4]?this.prerelease=h[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const _=+y;if(_>=0&&_<r)return _}return y}):this.prerelease=[],this.build=h[5]?h[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=
|
|
604
|
+
`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof a)){if(typeof c=="string"&&c===this.version)return 0;c=new a(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof a||(c=new a(c,this.options)),this.major<c.major?-1:this.major>c.major?1:this.minor<c.minor?-1:this.minor>c.minor?1:this.patch<c.patch?-1:this.patch>c.patch?1:0}comparePre(c){
|
|
605
|
+
if(c instanceof a||(c=new a(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let l=0;do{const h=this.prerelease[l],y=c.prerelease[l];if(e("prerelease compare",l,h,y),h===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(h===void 0)return-1;if(h===y)continue;return o(h,y)}while(++l)}compareBuild(c){c instanceof a||(c=new a(c,this.options));let l=0;do{const h=this.
|
|
606
|
+
build[l],y=c.build[l];if(e("build compare",l,h,y),h===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(h===void 0)return-1;if(h===y)continue;return o(h,y)}while(++l)}inc(c,l,h){if(c.startsWith("pre")){if(!l&&h===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const y=`-${l}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!y||y[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.
|
|
607
|
+
minor=0,this.major++,this.inc("pre",l,h);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,h);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,h),this.inc("pre",l,h);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,h),this.inc("pre",l,h);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.
|
|
608
|
+
prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(h)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let _=this.prerelease.length;for(;--_>=0;)typeof this.prerelease[_]=="number"&&(this.prerelease[_]++,_=-2);if(_===-1){if(l===this.prerelease.
|
|
609
|
+
join(".")&&h===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(l){let _=[l,y];h===!1&&(_=[l]),o(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=_):this.prerelease=_}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ts=a,Ts}var Ns,ml;function $t(){if(ml)return Ns;ml=1;const e=Se();return Ns=(r,n,i=!1)=>{if(r instanceof
|
|
610
|
+
e)return r;try{return new e(r,n)}catch(s){if(!i)return null;throw s}},Ns}var Is,yl;function Mm(){if(yl)return Is;yl=1;const e=$t();return Is=(r,n)=>{const i=e(r,n);return i?i.version:null},Is}var Os,gl;function Hm(){if(gl)return Os;gl=1;const e=$t();return Os=(r,n)=>{const i=e(r.trim().replace(/^[=v]+/,""),n);return i?i.version:null},Os}var js,$l;function Um(){if($l)return js;$l=1;const e=Se();return js=(r,n,i,s,o)=>{typeof i=="string"&&(o=s,s=i,i=void 0);try{return new e(r instanceof e?r.version:
|
|
611
|
+
r,i).inc(n,s,o).version}catch{return null}},js}var Ls,vl;function Fm(){if(vl)return Ls;vl=1;const e=$t();return Ls=(r,n)=>{const i=e(r,null,!0),s=e(n,null,!0),o=i.compare(s);if(o===0)return null;const a=o>0,u=a?i:s,c=a?s:i,l=!!u.prerelease.length;if(!!c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(c.compareMain(u)===0)return c.minor&&!c.patch?"minor":"patch"}const y=l?"pre":"";return i.major!==s.major?y+"major":i.minor!==s.minor?y+"minor":i.patch!==s.patch?y+"patch":"prerelease"},
|
|
612
|
+
Ls}var Ds,_l;function Vm(){if(_l)return Ds;_l=1;const e=Se();return Ds=(r,n)=>new e(r,n).major,Ds}var qs,wl;function zm(){if(wl)return qs;wl=1;const e=Se();return qs=(r,n)=>new e(r,n).minor,qs}var xs,bl;function Gm(){if(bl)return xs;bl=1;const e=Se();return xs=(r,n)=>new e(r,n).patch,xs}var Ms,El;function Bm(){if(El)return Ms;El=1;const e=$t();return Ms=(r,n)=>{const i=e(r,n);return i&&i.prerelease.length?i.prerelease:null},Ms}var Hs,Sl;function je(){if(Sl)return Hs;Sl=1;const e=Se();return Hs=(r,n,i)=>new e(
|
|
613
|
+
r,i).compare(new e(n,i)),Hs}var Us,Rl;function Km(){if(Rl)return Us;Rl=1;const e=je();return Us=(r,n,i)=>e(n,r,i),Us}var Fs,Al;function Wm(){if(Al)return Fs;Al=1;const e=je();return Fs=(r,n)=>e(r,n,!0),Fs}var Vs,Pl;function zs(){if(Pl)return Vs;Pl=1;const e=Se();return Vs=(r,n,i)=>{const s=new e(r,i),o=new e(n,i);return s.compare(o)||s.compareBuild(o)},Vs}var Gs,Cl;function Xm(){if(Cl)return Gs;Cl=1;const e=zs();return Gs=(r,n)=>r.sort((i,s)=>e(i,s,n)),Gs}var Bs,kl;function Jm(){if(kl)return Bs;
|
|
614
|
+
kl=1;const e=zs();return Bs=(r,n)=>r.sort((i,s)=>e(s,i,n)),Bs}var Ks,Tl;function an(){if(Tl)return Ks;Tl=1;const e=je();return Ks=(r,n,i)=>e(r,n,i)>0,Ks}var Ws,Nl;function Xs(){if(Nl)return Ws;Nl=1;const e=je();return Ws=(r,n,i)=>e(r,n,i)<0,Ws}var Js,Il;function Ol(){if(Il)return Js;Il=1;const e=je();return Js=(r,n,i)=>e(r,n,i)===0,Js}var Ys,jl;function Ll(){if(jl)return Ys;jl=1;const e=je();return Ys=(r,n,i)=>e(r,n,i)!==0,Ys}var Qs,Dl;function Zs(){if(Dl)return Qs;Dl=1;const e=je();return Qs=(r,n,i)=>e(
|
|
615
|
+
r,n,i)>=0,Qs}var eo,ql;function to(){if(ql)return eo;ql=1;const e=je();return eo=(r,n,i)=>e(r,n,i)<=0,eo}var ro,xl;function Ml(){if(xl)return ro;xl=1;const e=Ol(),t=Ll(),r=an(),n=Zs(),i=Xs(),s=to();return ro=(a,u,c,l)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a===c;case"!==":return typeof a=="object"&&(a=a.version),typeof c=="object"&&(c=c.version),a!==c;case"":case"=":case"==":return e(a,c,l);case"!=":return t(a,c,l);case">":return r(a,c,l);case"\
|
|
616
|
+
>=":return n(a,c,l);case"<":return i(a,c,l);case"<=":return s(a,c,l);default:throw new TypeError(`Invalid operator: ${u}`)}},ro}var no,Hl;function Ym(){if(Hl)return no;Hl=1;const e=Se(),t=$t(),{safeRe:r,t:n}=Lt();return no=(s,o)=>{if(s instanceof e)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;o=o||{};let a=null;if(!o.rtl)a=s.match(o.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const _=o.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let S;for(;(S=_.exec(
|
|
617
|
+
s))&&(!a||a.index+a[0].length!==s.length);)(!a||S.index+S[0].length!==a.index+a[0].length)&&(a=S),_.lastIndex=S.index+S[1].length+S[2].length;_.lastIndex=-1}if(a===null)return null;const u=a[2],c=a[3]||"0",l=a[4]||"0",h=o.includePrerelease&&a[5]?`-${a[5]}`:"",y=o.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${u}.${c}.${l}${h}${y}`,o)},no}var so,Ul;function Qm(){if(Ul)return so;Ul=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.
|
|
618
|
+
delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(r,n)}return this}}return so=e,so}var oo,Fl;function Le(){if(Fl)return oo;Fl=1;const e=/\s+/g;class t{constructor(M,z){if(z=i(z),M instanceof t)return M.loose===!!z.loose&&M.includePrerelease===!!z.includePrerelease?M:new t(M.raw,z);if(M instanceof s)return this.raw=M.value,this.set=[[M]],this.formatted=
|
|
619
|
+
void 0,this;if(this.options=z,this.loose=!!z.loose,this.includePrerelease=!!z.includePrerelease,this.raw=M.trim().replace(e," "),this.set=this.raw.split("||").map(F=>this.parseRange(F.trim())).filter(F=>F.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const F=this.set[0];if(this.set=this.set.filter(G=>!$(G[0])),this.set.length===0)this.set=[F];else if(this.set.length>1){for(const G of this.set)if(G.length===1&&p(G[0])){this.set=[G];break}}}
|
|
620
|
+
this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const z=this.set[M];for(let F=0;F<z.length;F++)F>0&&(this.formatted+=" "),this.formatted+=z[F].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const F=((this.options.includePrerelease&&_)|(this.options.loose&&S))+":"+M,G=n.get(F);if(G)return G;const Q=this.options.loose,q=Q?u[c.HYPHENRANGELOOSE]:
|
|
621
|
+
u[c.HYPHENRANGE];M=M.replace(q,H(this.options.includePrerelease)),o("hyphen replace",M),M=M.replace(u[c.COMPARATORTRIM],l),o("comparator trim",M),M=M.replace(u[c.TILDETRIM],h),o("tilde trim",M),M=M.replace(u[c.CARETTRIM],y),o("caret trim",M);let A=M.split(" ").map(b=>f(b,this.options)).join(" ").split(/\s+/).map(b=>x(b,this.options));Q&&(A=A.filter(b=>(o("loose invalid filter",b,this.options),!!b.match(u[c.COMPARATORLOOSE])))),o("range list",A);const L=new Map,T=A.map(b=>new s(b,this.options));for(const b of T){
|
|
622
|
+
if($(b))return[b];L.set(b.value,b)}L.size>1&&L.has("")&&L.delete("");const R=[...L.values()];return n.set(F,R),R}intersects(M,z){if(!(M instanceof t))throw new TypeError("a Range is required");return this.set.some(F=>m(F,z)&&M.set.some(G=>m(G,z)&&F.every(Q=>G.every(q=>Q.intersects(q,z)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new a(M,this.options)}catch{return!1}for(let z=0;z<this.set.length;z++)if(D(this.set[z],M,this.options))return!0;return!1}}oo=t;const r=Qm(),n=new r,i=Cs(),s=cn(),
|
|
623
|
+
o=on(),a=Se(),{safeRe:u,t:c,comparatorTrimReplace:l,tildeTrimReplace:h,caretTrimReplace:y}=Lt(),{FLAG_INCLUDE_PRERELEASE:_,FLAG_LOOSE:S}=sn(),$=O=>O.value==="<0.0.0-0",p=O=>O.value==="",m=(O,M)=>{let z=!0;const F=O.slice();let G=F.pop();for(;z&&F.length;)z=F.every(Q=>G.intersects(Q,M)),G=F.pop();return z},f=(O,M)=>(O=O.replace(u[c.BUILD],""),o("comp",O,M),O=w(O,M),o("caret",O),O=g(O,M),o("tildes",O),O=P(O,M),o("xrange",O),O=U(O,M),o("stars",O),O),d=O=>!O||O.toLowerCase()==="x"||O==="*",g=(O,M)=>O.
|
|
624
|
+
trim().split(/\s+/).map(z=>v(z,M)).join(" "),v=(O,M)=>{const z=M.loose?u[c.TILDELOOSE]:u[c.TILDE];return O.replace(z,(F,G,Q,q,A)=>{o("tilde",O,F,G,Q,q,A);let L;return d(G)?L="":d(Q)?L=`>=${G}.0.0 <${+G+1}.0.0-0`:d(q)?L=`>=${G}.${Q}.0 <${G}.${+Q+1}.0-0`:A?(o("replaceTilde pr",A),L=`>=${G}.${Q}.${q}-${A} <${G}.${+Q+1}.0-0`):L=`>=${G}.${Q}.${q} <${G}.${+Q+1}.0-0`,o("tilde return",L),L})},w=(O,M)=>O.trim().split(/\s+/).map(z=>E(z,M)).join(" "),E=(O,M)=>{o("caret",O,M);const z=M.loose?u[c.CARETLOOSE]:
|
|
625
|
+
u[c.CARET],F=M.includePrerelease?"-0":"";return O.replace(z,(G,Q,q,A,L)=>{o("caret",O,G,Q,q,A,L);let T;return d(Q)?T="":d(q)?T=`>=${Q}.0.0${F} <${+Q+1}.0.0-0`:d(A)?Q==="0"?T=`>=${Q}.${q}.0${F} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.0${F} <${+Q+1}.0.0-0`:L?(o("replaceCaret pr",L),Q==="0"?q==="0"?T=`>=${Q}.${q}.${A}-${L} <${Q}.${q}.${+A+1}-0`:T=`>=${Q}.${q}.${A}-${L} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.${A}-${L} <${+Q+1}.0.0-0`):(o("no pr"),Q==="0"?q==="0"?T=`>=${Q}.${q}.${A}${F} <${Q}.${q}.${+A+1}-0`:T=
|
|
626
|
+
`>=${Q}.${q}.${A}${F} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.${A} <${+Q+1}.0.0-0`),o("caret return",T),T})},P=(O,M)=>(o("replaceXRanges",O,M),O.split(/\s+/).map(z=>I(z,M)).join(" ")),I=(O,M)=>{O=O.trim();const z=M.loose?u[c.XRANGELOOSE]:u[c.XRANGE];return O.replace(z,(F,G,Q,q,A,L)=>{o("xRange",O,F,G,Q,q,A,L);const T=d(Q),R=T||d(q),b=R||d(A),C=b;return G==="="&&C&&(G=""),L=M.includePrerelease?"-0":"",T?G===">"||G==="<"?F="<0.0.0-0":F="*":G&&C?(R&&(q=0),A=0,G===">"?(G=">=",R?(Q=+Q+1,q=0,A=0):(q=+q+1,A=
|
|
627
|
+
0)):G==="<="&&(G="<",R?Q=+Q+1:q=+q+1),G==="<"&&(L="-0"),F=`${G+Q}.${q}.${A}${L}`):R?F=`>=${Q}.0.0${L} <${+Q+1}.0.0-0`:b&&(F=`>=${Q}.${q}.0${L} <${Q}.${+q+1}.0-0`),o("xRange return",F),F})},U=(O,M)=>(o("replaceStars",O,M),O.trim().replace(u[c.STAR],"")),x=(O,M)=>(o("replaceGTE0",O,M),O.trim().replace(u[M.includePrerelease?c.GTE0PRE:c.GTE0],"")),H=O=>(M,z,F,G,Q,q,A,L,T,R,b,C)=>(d(F)?z="":d(G)?z=`>=${F}.0.0${O?"-0":""}`:d(Q)?z=`>=${F}.${G}.0${O?"-0":""}`:q?z=`>=${z}`:z=`>=${z}${O?"-0":""}`,d(T)?L="":
|
|
628
|
+
d(R)?L=`<${+T+1}.0.0-0`:d(b)?L=`<${T}.${+R+1}.0-0`:C?L=`<=${T}.${R}.${b}-${C}`:O?L=`<${T}.${R}.${+b+1}-0`:L=`<=${L}`,`${z} ${L}`.trim()),D=(O,M,z)=>{for(let F=0;F<O.length;F++)if(!O[F].test(M))return!1;if(M.prerelease.length&&!z.includePrerelease){for(let F=0;F<O.length;F++)if(o(O[F].semver),O[F].semver!==s.ANY&&O[F].semver.prerelease.length>0){const G=O[F].semver;if(G.major===M.major&&G.minor===M.minor&&G.patch===M.patch)return!0}return!1}return!0};return oo}var ao,Vl;function cn(){if(Vl)return ao;
|
|
629
|
+
Vl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,h){if(h=r(h),l instanceof t){if(l.loose===!!h.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,h),this.options=h,this.loose=!!h.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const h=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],y=l.match(h);if(!y)throw new TypeError(`Invalid comparator: ${l}`);this.operator=
|
|
630
|
+
y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new a(y[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(o("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,h){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(l.value,h).
|
|
631
|
+
test(this.value):l.operator===""?l.value===""?!0:new u(this.value,h).test(l.semver):(h=r(h),h.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!h.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,h)&&this.
|
|
632
|
+
operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,h)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}ao=t;const r=Cs(),{safeRe:n,t:i}=Lt(),s=Ml(),o=on(),a=Se(),u=Le();return ao}var io,zl;function un(){if(zl)return io;zl=1;const e=Le();return io=(r,n,i)=>{try{n=new e(n,i)}catch{return!1}return n.test(r)},io}var co,Gl;function Zm(){if(Gl)return co;Gl=1;const e=Le();return co=(r,n)=>new e(r,n).set.map(i=>i.map(s=>s.value).join(" ").trim().split(" ")),co}
|
|
633
|
+
var uo,Bl;function ey(){if(Bl)return uo;Bl=1;const e=Se(),t=Le();return uo=(n,i,s)=>{let o=null,a=null,u=null;try{u=new t(i,s)}catch{return null}return n.forEach(c=>{u.test(c)&&(!o||a.compare(c)===-1)&&(o=c,a=new e(o,s))}),o},uo}var lo,Kl;function ty(){if(Kl)return lo;Kl=1;const e=Se(),t=Le();return lo=(n,i,s)=>{let o=null,a=null,u=null;try{u=new t(i,s)}catch{return null}return n.forEach(c=>{u.test(c)&&(!o||a.compare(c)===1)&&(o=c,a=new e(o,s))}),o},lo}var fo,Wl;function ry(){if(Wl)return fo;Wl=
|
|
634
|
+
1;const e=Se(),t=Le(),r=an();return fo=(i,s)=>{i=new t(i,s);let o=new e("0.0.0");if(i.test(o)||(o=new e("0.0.0-0"),i.test(o)))return o;o=null;for(let a=0;a<i.set.length;++a){const u=i.set[a];let c=null;u.forEach(l=>{const h=new e(l.semver.version);switch(l.operator){case">":h.prerelease.length===0?h.patch++:h.prerelease.push(0),h.raw=h.format();case"":case">=":(!c||r(h,c))&&(c=h);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),c&&(!o||r(o,c))&&(o=c)}
|
|
635
|
+
return o&&i.test(o)?o:null},fo}var po,Xl;function ny(){if(Xl)return po;Xl=1;const e=Le();return po=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},po}var ho,Jl;function mo(){if(Jl)return ho;Jl=1;const e=Se(),t=cn(),{ANY:r}=t,n=Le(),i=un(),s=an(),o=Xs(),a=to(),u=Zs();return ho=(l,h,y,_)=>{l=new e(l,_),h=new n(h,_);let S,$,p,m,f;switch(y){case">":S=s,$=a,p=o,m=">",f=">=";break;case"<":S=o,$=u,p=s,m="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(
|
|
636
|
+
l,h,_))return!1;for(let d=0;d<h.set.length;++d){const g=h.set[d];let v=null,w=null;if(g.forEach(E=>{E.semver===r&&(E=new t(">=0.0.0")),v=v||E,w=w||E,S(E.semver,v.semver,_)?v=E:p(E.semver,w.semver,_)&&(w=E)}),v.operator===m||v.operator===f||(!w.operator||w.operator===m)&&$(l,w.semver))return!1;if(w.operator===f&&p(l,w.semver))return!1}return!0},ho}var yo,Yl;function sy(){if(Yl)return yo;Yl=1;const e=mo();return yo=(r,n,i)=>e(r,n,">",i),yo}var go,Ql;function oy(){if(Ql)return go;Ql=1;const e=mo();
|
|
637
|
+
return go=(r,n,i)=>e(r,n,"<",i),go}var $o,Zl;function ay(){if(Zl)return $o;Zl=1;const e=Le();return $o=(r,n,i)=>(r=new e(r,i),n=new e(n,i),r.intersects(n,i)),$o}var vo,ef;function iy(){if(ef)return vo;ef=1;const e=un(),t=je();return vo=(r,n,i)=>{const s=[];let o=null,a=null;const u=r.sort((y,_)=>t(y,_,i));for(const y of u)e(y,n,i)?(a=y,o||(o=y)):(a&&s.push([o,a]),a=null,o=null);o&&s.push([o,null]);const c=[];for(const[y,_]of s)y===_?c.push(y):!_&&y===u[0]?c.push("*"):_?y===u[0]?c.push(`<=${_}`):
|
|
638
|
+
c.push(`${y} - ${_}`):c.push(`>=${y}`);const l=c.join(" || "),h=typeof n.raw=="string"?n.raw:String(n);return l.length<h.length?l:n},vo}var _o,tf;function cy(){if(tf)return _o;tf=1;const e=Le(),t=cn(),{ANY:r}=t,n=un(),i=je(),s=(h,y,_={})=>{if(h===y)return!0;h=new e(h,_),y=new e(y,_);let S=!1;e:for(const $ of h.set){for(const p of y.set){const m=u($,p,_);if(S=S||m!==null,m)continue e}if(S)return!1}return!0},o=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],u=(h,y,_)=>{if(h===y)return!0;if(h.length===1&&
|
|
639
|
+
h[0].semver===r){if(y.length===1&&y[0].semver===r)return!0;_.includePrerelease?h=o:h=a}if(y.length===1&&y[0].semver===r){if(_.includePrerelease)return!0;y=a}const S=new Set;let $,p;for(const P of h)P.operator===">"||P.operator===">="?$=c($,P,_):P.operator==="<"||P.operator==="<="?p=l(p,P,_):S.add(P.semver);if(S.size>1)return null;let m;if($&&p){if(m=i($.semver,p.semver,_),m>0)return null;if(m===0&&($.operator!==">="||p.operator!=="<="))return null}for(const P of S){if($&&!n(P,String($),_)||p&&!n(
|
|
640
|
+
P,String(p),_))return null;for(const I of y)if(!n(P,String(I),_))return!1;return!0}let f,d,g,v,w=p&&!_.includePrerelease&&p.semver.prerelease.length?p.semver:!1,E=$&&!_.includePrerelease&&$.semver.prerelease.length?$.semver:!1;w&&w.prerelease.length===1&&p.operator==="<"&&w.prerelease[0]===0&&(w=!1);for(const P of y){if(v=v||P.operator===">"||P.operator===">=",g=g||P.operator==="<"||P.operator==="<=",$){if(E&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===E.major&&P.semver.minor===
|
|
641
|
+
E.minor&&P.semver.patch===E.patch&&(E=!1),P.operator===">"||P.operator===">="){if(f=c($,P,_),f===P&&f!==$)return!1}else if($.operator===">="&&!n($.semver,String(P),_))return!1}if(p){if(w&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===w.major&&P.semver.minor===w.minor&&P.semver.patch===w.patch&&(w=!1),P.operator==="<"||P.operator==="<="){if(d=l(p,P,_),d===P&&d!==p)return!1}else if(p.operator==="<="&&!n(p.semver,String(P),_))return!1}if(!P.operator&&(p||$)&&m!==0)return!1}return!($&&
|
|
642
|
+
g&&!p&&m!==0||p&&v&&!$&&m!==0||E||w)},c=(h,y,_)=>{if(!h)return y;const S=i(h.semver,y.semver,_);return S>0?h:S<0||y.operator===">"&&h.operator===">="?y:h},l=(h,y,_)=>{if(!h)return y;const S=i(h.semver,y.semver,_);return S<0?h:S>0||y.operator==="<"&&h.operator==="<="?y:h};return _o=s,_o}var wo,rf;function uy(){if(rf)return wo;rf=1;const e=Lt(),t=sn(),r=Se(),n=pl(),i=$t(),s=Mm(),o=Hm(),a=Um(),u=Fm(),c=Vm(),l=zm(),h=Gm(),y=Bm(),_=je(),S=Km(),$=Wm(),p=zs(),m=Xm(),f=Jm(),d=an(),g=Xs(),v=Ol(),w=Ll(),E=Zs(),
|
|
643
|
+
P=to(),I=Ml(),U=Ym(),x=cn(),H=Le(),D=un(),O=Zm(),M=ey(),z=ty(),F=ry(),G=ny(),Q=mo(),q=sy(),A=oy(),L=ay(),T=iy(),R=cy();return wo={parse:i,valid:s,clean:o,inc:a,diff:u,major:c,minor:l,patch:h,prerelease:y,compare:_,rcompare:S,compareLoose:$,compareBuild:p,sort:m,rsort:f,gt:d,lt:g,eq:v,neq:w,gte:E,lte:P,cmp:I,coerce:U,Comparator:x,Range:H,satisfies:D,toComparators:O,maxSatisfying:M,minSatisfying:z,minVersion:F,validRange:G,outside:Q,gtr:q,ltr:A,intersects:L,simplifyRange:T,subset:R,SemVer:r,re:e.re,
|
|
644
|
+
src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},wo}var bo=uy();const vt=mn(bo),ly=Object.prototype.toString,fy="[object Uint8Array]",dy="[object ArrayBuffer]";function nf(e,t,r){return e?e.constructor===t?!0:ly.call(e)===r:!1}function sf(e){return nf(e,Uint8Array,fy)}function py(e){return nf(e,ArrayBuffer,dy)}function hy(e){return sf(e)||py(e)}function my(e){if(!sf(e))throw new TypeError(
|
|
645
|
+
`Expected \`Uint8Array\`, got \`${typeof e}\``)}function yy(e){if(!hy(e))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function of(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,s)=>i+s.length,0);const r=new Uint8Array(t);let n=0;for(const i of e)my(i),r.set(i,n),n+=i.length;return r}const af={utf8:new globalThis.TextDecoder("utf8")};function cf(e,t="utf8"){return yy(e),af[t]??=new globalThis.TextDecoder(t),af[t].decode(e)}function gy(e){if(typeof e!=
|
|
646
|
+
"string")throw new TypeError(`Expected \`string\`, got \`${typeof e}\``)}const $y=new globalThis.TextEncoder;function Eo(e){return gy(e),$y.encode(e)}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const vy=Tm.default,uf="aes-256-cbc",_t=()=>Object.create(null),_y=e=>e!=null,wy=(e,t)=>{const r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},ln="_\
|
|
647
|
+
_internal__",So=`${ln}.migrations.version`;class by{path;events;#n;#t;#e;#r={};constructor(t={}){const r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...t};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=Lp(r.projectName,{suffix:r.projectSuffix}).config}if(this.#e=r,r.schema??r.ajvOptions??r.rootSchema){if(r.schema&&typeof r.schema!="object")throw new TypeError(
|
|
648
|
+
"The `schema` option must be an object.");const o=new _m.Ajv2020({allErrors:!0,useDefaults:!0,...r.ajvOptions});vy(o);const a={...r.rootSchema,type:"object",properties:r.schema};this.#n=o.compile(a);for(const[u,c]of Object.entries(r.schema??{}))c?.default&&(this.#r[u]=c.default)}r.defaults&&(this.#r={...this.#r,...r.defaults}),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new EventTarget,this.#t=r.encryptionKey;const n=r.fileExtension?`.${r.
|
|
649
|
+
fileExtension}`:"";this.path=ie.resolve(r.cwd,`${r.configName??"config"}${n}`);const i=this.store,s=Object.assign(_t(),r.defaults,i);if(r.migrations){if(!r.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(s);try{ud.deepEqual(i,s)}catch{this.store=s}r.watch&&this._watch()}get(t,r){if(this.#e.accessPropertiesByDotNotation)return this._get(t,r);const{store:n}=this;return t in n?n[t]:r}set(t,r){
|
|
650
|
+
if(typeof t!="string"&&typeof t!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof t}`);if(typeof t!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(t))throw new TypeError(`Please don't use the ${ln} key, as it's used to manage this module internal operations.`);const{store:n}=this,i=(s,o)=>{wy(s,o),this.#e.accessPropertiesByDotNotation?Ga(n,s,o):n[s]=o};if(typeof t=="object"){const s=t;for(const[
|
|
651
|
+
o,a]of Object.entries(s))i(o,a)}else i(t,r);this.store=n}has(t){return this.#e.accessPropertiesByDotNotation?Np(this.store,t):t in this.store}reset(...t){for(const r of t)_y(this.#r[r])&&this.set(r,this.#r[r])}delete(t){const{store:r}=this;this.#e.accessPropertiesByDotNotation?Tp(r,t):delete r[t],this.store=r}clear(){this.store=_t();for(const t of Object.keys(this.#r))this.reset(t)}onDidChange(t,r){if(typeof t!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof t}`);
|
|
652
|
+
if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);return this._handleChange(()=>this.get(t),r)}onDidAnyChange(t){if(typeof t!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.store,t)}get size(){return Object.keys(this.store).length}get store(){try{const t=se.readFileSync(this.path,this.#t?null:"utf8"),r=this._encryptData(t),n=this._deserialize(r);return this.
|
|
653
|
+
_validate(n),Object.assign(_t(),n)}catch(t){if(t?.code==="ENOENT")return this._ensureDirectory(),_t();if(this.#e.clearInvalidConfig&&t.name==="SyntaxError")return _t();throw t}}set store(t){this._ensureDirectory(),this._validate(t),this._write(t),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[t,r]of Object.entries(this.store))yield[t,r]}_encryptData(t){if(!this.#t)return typeof t=="string"?t:cf(t);try{const r=t.slice(0,16),n=Pt.pbkdf2Sync(this.#t,r.toString(),1e4,32,
|
|
654
|
+
"sha512"),i=Pt.createDecipheriv(uf,n,r),s=t.slice(17),o=typeof s=="string"?Eo(s):s;return cf(of([i.update(o),i.final()]))}catch{}return t.toString()}_handleChange(t,r){let n=t();const i=()=>{const s=n,o=t();cd(o,s)||(n=o,r.call(this,o,s))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=t=>JSON.parse(t);_serialize=t=>JSON.stringify(t,void 0," ");_validate(t){if(!this.#n||this.#n(t)||!this.#n.errors)return;const n=this.#n.errors.map(({
|
|
655
|
+
instancePath:i,message:s=""})=>`\`${i.slice(1)}\` ${s}`);throw new Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){se.mkdirSync(ie.dirname(this.path),{recursive:!0})}_write(t){let r=this._serialize(t);if(this.#t){const n=Pt.randomBytes(16),i=Pt.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),s=Pt.createCipheriv(uf,i,n);r=of([n,Eo(":"),s.update(Eo(r)),s.final()])}if(me.env.SNAP)se.writeFileSync(this.path,r,{mode:this.#e.configFileMode});else try{Ja(this.path,r,{mode:this.#e.configFileMode})}catch(n){
|
|
656
|
+
if(n?.code==="EXDEV"){se.writeFileSync(this.path,r,{mode:this.#e.configFileMode});return}throw n}}_watch(){this._ensureDirectory(),se.existsSync(this.path)||this._write(_t()),me.platform==="win32"?se.watch(this.path,{persistent:!1},il(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):se.watchFile(this.path,{persistent:!1},il(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(t,r,n){let i=this._get(So,"0.0.0");const s=Object.keys(t).filter(a=>this._shouldPerformMigration(
|
|
657
|
+
a,i,r));let o={...this.store};for(const a of s)try{n&&n(this,{fromVersion:i,toVersion:a,finalVersion:r,versions:s});const u=t[a];u?.(this),this._set(So,a),i=a,o={...this.store}}catch(u){throw this.store=o,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${u}`)}(this._isVersionInRangeFormat(i)||!vt.eq(i,r))&&this._set(So,r)}_containsReservedKey(t){return typeof t=="object"&&Object.keys(t)[0]===ln?!0:typeof t!="string"?
|
|
658
|
+
!1:this.#e.accessPropertiesByDotNotation?!!t.startsWith(`${ln}.`):!1}_isVersionInRangeFormat(t){return vt.clean(t)===null}_shouldPerformMigration(t,r,n){return this._isVersionInRangeFormat(t)?r!=="0.0.0"&&vt.satisfies(r,t)?!1:vt.satisfies(n,t):!(vt.lte(t,r)||vt.gt(t,n))}_get(t,r){return kp(this.store,t,r)}_set(t,r){const{store:n}=this;Ga(n,t,r),this.store=n}}class lf extends Error{response;request;options;constructor(t,r,n){const i=t.status||t.status===0?t.status:"",s=t.statusText||"",o=`${i} ${s}`.
|
|
659
|
+
trim(),a=o?`status code ${o}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=n}}class ff extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}const df=(()=>{let e=!1,t=!1;const r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.
|
|
660
|
+
ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return e&&!t})(),Ey=typeof globalThis.AbortController=="function",Sy=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Ry=typeof globalThis.ReadableStream=="function",Ay=typeof globalThis.FormData=="function",pf=["get","post","put","patch","head","delete"],Py={json:"application/j\
|
|
661
|
+
son",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Ro=2147483647,Cy=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,hf=Symbol("stop"),ky={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Ty={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,
|
|
662
|
+
window:!0,dispatcher:!0,duplex:!0,priority:!0},Ny=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,n]of e)t+=Cy,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).
|
|
663
|
+
length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{const t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},Iy=(e,t)=>{const r=Number(e.headers.get("content-length"))||0;let n=0;return e.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:n},new Uint8Array),new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new Response(new ReadableStream({async start(i){const s=e.body.getReader();t&&t({percent:0,
|
|
664
|
+
transferredBytes:0,totalBytes:r},new Uint8Array);async function o(){const{done:a,value:u}=await s.read();if(a){i.close();return}if(t){n+=u.byteLength;const c=r===0?0:n/r;t({percent:c,transferredBytes:n,totalBytes:r},u)}i.enqueue(u),await o()}await o()}}),{status:e.status,statusText:e.statusText,headers:e.headers})},Oy=(e,t)=>{const r=Ny(e.body);let n=0;return new Request(e,{duplex:"half",body:new ReadableStream({async start(i){const s=e.body instanceof ReadableStream?e.body.getReader():new Response(
|
|
665
|
+
"").body.getReader();async function o(){const{done:a,value:u}=await s.read();if(a){t&&t({percent:1,transferredBytes:n,totalBytes:Math.max(r,n)},new Uint8Array),i.close();return}n+=u.byteLength;let c=r===0?0:n/r;(r<n||c===1)&&(c=.99),t&&t({percent:Number(c.toFixed(2)),transferredBytes:n,totalBytes:r},u),i.enqueue(u),await o()}await o()}})})},Dt=e=>e!==null&&typeof e=="object",fn=(...e)=>{for(const t of e)if((!Dt(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be\
|
|
666
|
+
an object");return Ao({},...e)},mf=(e={},t={})=>{const r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(const[s,o]of i.entries())n&&o==="undefined"||o===void 0?r.delete(s):r.set(s,o);return r};function dn(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:Ao(e[r]??[],t[r]??[])}const yf=(e={},t={})=>({beforeRequest:dn(e,t,"beforeRequest"),beforeRetry:dn(e,t,"beforeRetry"),afterResponse:dn(e,t,"afterResponse"),beforeError:dn(e,t,"beforeError")}),Ao=(...e)=>{
|
|
667
|
+
let t={},r={},n={};for(const i of e)if(Array.isArray(i))Array.isArray(t)||(t=[]),t=[...t,...i];else if(Dt(i)){for(let[s,o]of Object.entries(i))Dt(o)&&s in t&&(o=Ao(t[s],o)),t={...t,[s]:o};Dt(i.hooks)&&(n=yf(n,i.hooks),t.hooks=n),Dt(i.headers)&&(r=mf(r,i.headers),t.headers=r)}return t},jy=e=>pf.includes(e)?e.toUpperCase():e,Ly=["get","put","head","delete","options","trace"],Dy=[408,413,429,500,502,503,504],qy=[413,429,503],gf={limit:2,methods:Ly,statusCodes:Dy,afterStatusCodes:qy,maxRetryAfter:Number.
|
|
668
|
+
POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},xy=(e={})=>{if(typeof e=="number")return{...gf,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...gf,...e}};async function My(e,t,r,n){return new Promise((i,s)=>{const o=setTimeout(()=>{r&&r.abort(),s(new ff(e))},n.timeout);n.fetch(e,t).then(i).catch(s).then(
|
|
669
|
+
()=>{clearTimeout(o)})})}async function Hy(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(s),n(t.reason)}const s=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e)})}const Uy=(e,t)=>{const r={};for(const n in t)!(n in Ty)&&!(n in ky)&&!(n in e)&&(r[n]=t[n]);return r};class hn{static create(t,r){const n=new hn(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Ro)throw new RangeError(
|
|
670
|
+
`The \`timeout\` option cannot be greater than ${Ro}`);await Promise.resolve();let a=await n._fetch();for(const u of n._options.hooks.afterResponse){const c=await u(n.request,n._options,n._decorateResponse(a.clone()));c instanceof globalThis.Response&&(a=c)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new lf(a,n.request,n._options);for(const c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="fun\
|
|
671
|
+
ction")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Ry)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return Iy(a.clone(),n._options.onDownloadProgress)}return a},o=(n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i()).finally(async()=>{n.request.bodyUsed||await n.request.body?.cancel()});for(const[a,u]of Object.entries(Py))o[a]=async()=>{n.request.headers.set("accept",n.request.headers.
|
|
672
|
+
get("accept")||u);const c=await o;if(a==="json"){if(c.status===204||(await c.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await c.text())}return c[a]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(t,r={}){if(this._input=t,this._options={...r,headers:mf(this._input.headers,r.headers),hooks:yf({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:jy(r.method??this._input.method??"GET"),prefixUrl:String(r.
|
|
673
|
+
prefixUrl||""),retry:xy(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.
|
|
674
|
+
endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Ey&&Sy){const n=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(df&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.
|
|
675
|
+
set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),s=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(Ay&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.
|
|
676
|
+
headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(s,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!df)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&
|
|
677
|
+
(this.request=Oy(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof ff)throw t;if(t instanceof lf){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;const n=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(
|
|
678
|
+
t.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());const s=this._options.retry.maxRetryAfter??i;return i<s?i:s}if(t.response.status===413)throw t}const r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){const n=Math.min(
|
|
679
|
+
this._calculateRetryDelay(r),Ro);if(this._retryCount<1)throw r;await Hy(n,{signal:this._options.signal});for(const i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===hf)return;return this._retry(t)}}async _fetch(){for(const n of this._options.hooks.beforeRequest){const i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}const t=Uy(this.request,this._options),
|
|
680
|
+
r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):My(r,t,this.abortController,this._options)}}const Po=e=>{const t=(r,n)=>hn.create(r,fn(e,n));for(const r of pf)t[r]=(n,i)=>hn.create(n,fn(e,i,{method:r}));return t.create=r=>Po(fn(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Po(fn(e,r))),t.stop=hf,t},Fy=Po(),Co=new by({projectName:qf,serialize:e=>lt.stringify(e,null,2),deserialize:e=>lt.parse(e)}),Vy=1e3*60*60*24,$f="check-update";function zy(){
|
|
681
|
+
if(Bf||Kf===$f)return;const e=Co.get("lastUpdateCheck"),t=Co.get("latestVersion");if(xf(t)||Mf(e)||e+Vy<Date.now())try{Io("likec4",["check-update"],{stdio:"ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:$f}}).catch(()=>{})}catch{}t&&bo.gt(t,at)&&We(["Update available: ",j.dim(at),j.reset(" \u2192 "),j.green(t)].join(""))}async function Gy(){try{const e=await By();Rn(e,"No version found in latest npm"),Co.set({lastUpdateCheck:Date.now(),latestVersion:e}),bo.gt(e,at)?We(["Update available: ",j.dim(
|
|
682
|
+
at),j.reset(" \u2192 "),j.green(e)].join("")):We(j.dim("Up to date: ")+" "+j.green(at))}catch(e){Ae.error(Mt(e))}}async function By(){return(await Fy("https://registry.npmjs.org/likec4/latest",{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},keepalive:!0}).json()).version}const Ky=e=>e.command({command:"check-update",describe:"Check for updates",handler:async()=>{await Gy()}});function Wy(e,t){if(!t)return e.languageServices.projectsManager.ensureProjectId();
|
|
683
|
+
const r=oe(t);if(r===e.workspace)return e.languageServices.projectsManager.ensureProjectId();if(He(r)&&Uf(r).isDirectory()){Ae.debug`Project path exists: ${r}`;const n=yn.file(r.endsWith(Vo)?r:r+Vo),i=e.languageServices.projects().find(s=>s.folder.fsPath===n.fsPath);if(i)return Ae.debug`Found project ${i.id} at path: ${r}`,i.id;Ae.debug`No project registered at path: ${r}`}return e.languageServices.projectsManager.ensureProjectId(t)}function pn(e,t){const r=Wy(e,t),n=e.languageServices.projectsManager.
|
|
684
|
+
getProject(r);return e.languageServices.projectsManager.defaultProjectId=r,{projectId:r,projectFolder:n.folderUri.fsPath,config:n.config}}var vf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),_f=e=>{throw TypeError(e)},Xy=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&_f("Object expected");var n,i;n=t[vf("asyncDispose")],n===void 0&&(n=t[vf("dispose")],i=n),typeof n!="function"&&_f("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.
|
|
685
|
+
push([r,n,t])}else e.push([r]);return t},Jy=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(s,u=>(i(u),s()))}catch(u){i(u)}if(r)throw t};return s()};const qt=Ae.getChild("generator");async function wf({name:e,path:t,useDotBin:r,
|
|
686
|
+
project:n}){var i=[];try{const u=it(qt),c=Xy(i,await Pe.fromWorkspace(t,{logger:"vite",graphviz:r?"binary":"wasm",watch:!1}),!0),{projectId:l,config:h}=pn(c,n);n&&qt.info(`${j.dim("project")} ${j.green(l)}`);const y=h.generators?.[e];if(!y)throw qt.error(j.red(`generator ${e} does not exist in project config`)),new Error(`generator ${e} does not exist in project config`);qt.info(`${j.dim("generator")} ${j.green(e)}`);const _=await c.layoutedModel(l);await Yy({likec4:c,model:_,generator:y,logger:qt.
|
|
687
|
+
getChild(e)}),u.stopAndLog()}catch(u){var s=u,o=!0}finally{var a=Jy(i,s,o);a&&await a}}async function Yy({likec4:e,model:t,generator:r,logger:n}){const i=e.languageServices,s=new Set,o=i.project(t.project.id),a=t.project.id;n.debug(`${j.dim("runnig for project:")} ${j.green(o.id)}`),await Promise.resolve().then(()=>r({likec4model:t,ctx:{workspace:e.languageServices.workspaceUri,project:o,locate:u=>{let c=null;switch(!0){case hd(u):c=i.locate({element:u.id,projectId:a});break;case pd(u):c=i.locate(
|
|
688
|
+
{view:u.id,projectId:a});break;case dd(u):c=i.locate({deployment:u.id,projectId:a});break;case fd(u):case ld(u):c=i.locate({relation:u.id,projectId:a});break;default:An(u)}if(!c)throw n.error(`Cannot locate ${u.id}`,{target:u}),new Error(`Cannot locate ${u.id}`);const l=yn.parse(c.uri);return{range:c.range,document:l,relativePath:gn.relative(o.folder,l),folder:gn.dirname(l).fsPath,filename:gn.basename(l)}},write:async({path:u,content:c})=>{let l;yn.isUri(u)?l=u.fsPath:l=oe(o.folder.fsPath,...Array.
|
|
689
|
+
isArray(u)?u:[u]);const h=qe(l);s.has(h)||(He(h)||(n.debug(`${j.dim("create directory")} ${h}`),await xe(h,{recursive:!0})),s.add(h)),n.debug(`${j.dim("write")} ${l}`),await Xe(l,c)},abort:u=>{throw n.error(u||"Generator aborted"),new Error(u||"Generator aborted")}}}))}async function Qy(e,t,r){t=t??oe(e.workspace,"likec4.generated.ts"),St(t)!==".ts"&&(t=t+".ts"),await xe(qe(t),{recursive:!0});const n=await e.diagrams(),i=Zd([...n]);await Xe(t,i),r.info(`${j.dim("generated")} ${Ue(process.cwd(),t)}`)}
|
|
690
|
+
async function Zy(e,t,r){await xe(t,{recursive:!0}),r.info(`${j.dim("format")} ${j.green("dot")}`),r.info(`${j.dim("outdir")} ${t}`);const n=new Set,i=e.computedModel(),s=Uo(i.$data.views);let o=0;for(const a of s)try{const u=await e.viewsService.layouter.dot({view:a,styles:i.$styles});let c=".";a.sourcePath&&(c=qe(a.sourcePath)),c=oe(t,c),n.has(c)||(await xe(c,{recursive:!0}),n.add(c));const l=oe(c,a.id+".dot");await Xe(l,u),r.info(`${j.dim("generated")} ${Ue(process.cwd(),l)}`),o++}catch(u){Ae.
|
|
691
|
+
error(`error while generating ${a.id}`,{error:u})}o>0&&r.info(`${j.dim("total")} ${o} files`)}async function eg(e,t,r,n){await xe(r,{recursive:!0}),n.info(`${j.dim("format")} ${j.green(t)}`),n.info(`${j.dim("outdir")} ${r}`);let i,s;switch(t){case"d2":i=".d2",s=rd;break;case"mermaid":i=".mmd",s=td;break;case"plantuml":i=".puml",s=ed;break;default:An(t)}const o=new Set,a=await e.layoutedModel();let u=0;for(const c of a.views()){const l=c.$view;try{let h=".";l.sourcePath&&(h=qe(l.sourcePath)),h=oe(
|
|
692
|
+
r,h),o.has(h)||(await xe(h,{recursive:!0}),o.add(h));const y=oe(h,l.id+i),_=s(c);await Xe(y,_),n.info(`${j.dim("generated")} ${Ue(process.cwd(),y)}`),u++}catch(h){n.error(`error while generating ${l.id}`,{error:h})}}u>0&&n.info(`${j.dim("total")} ${u} files`)}async function xt({path:e,useDotBin:t,...r}){const n=Te("c4:codegen"),i=it(n),s=await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm"});if(s.ensureSingleProject(),(await s.viewsService.computedViews()).length===0)throw n.warn("\
|
|
693
|
+
no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"views":{await Qy(s,r.outfile,n);break}case"dot":{await Zy(s,r.outdir??e,n);break}case"d2":case"mermaid":case"plantuml":{await eg(s,r.format,r.outdir??e,n);break}default:An(r)}i.stopAndLog()}var bf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ef=e=>{throw TypeError(e)},tg=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Ef("Object expected");var n,i;n=t[bf("asyncDispose")],n===void 0&&(n=t[bf("d\
|
|
694
|
+
ispose")],i=n),typeof n!="function"&&Ef("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.push([r,n,t])}else e.push([r]);return t},rg=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(
|
|
695
|
+
s,u=>(i(u),s()))}catch(u){i(u)}if(r)throw t};return s()};async function ng({path:e,useDotBin:t,useCorePackage:r,outfile:n,project:i}){var s=[];try{const c=Te("c4:codegen"),l=it(c),h=tg(s,await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1}),!0),{projectId:y,projectFolder:_}=pn(h,i);i&&c.info(`${j.dim("project")} ${j.green(y)}`),c.info(`${j.dim("format")} ${j.green("model")}`);const S=await h.layoutedModel(y);for(const d of S.views())d.$view.hasLayoutDrift&&c.warn(j.yellow(
|
|
696
|
+
"drift detected, manual layout can not be applied, view:")+" "+j.red(d.id));let $=oe(h.projectsManager.hasMultipleProjects()?_:h.workspace,"likec4-model.ts");if(n&&($=_n(n)?n:oe(n),He(n)&&(await wn(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const p=Ut($);c.info(`${j.dim("filename")} ${p}`);const m=St(p).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(m))throw c.error(`output file ${n} has extension "${m}"`),new Error(`output file ${n} must be a .ts, .mts or .ct\
|
|
697
|
+
s file`);const f=qe($);c.info(`${j.dim("outdir")} ${f}`),await xe(f,{recursive:!0}),await Xe($,Yd(S,{useCorePackage:r}),{encoding:"utf-8"}),l.stopAndLog(),We($n(`
|
|
697
698
|
${j.dim("Source generated:")}
|
|
698
699
|
${Ue(Ht(),$)}
|
|
699
700
|
|
|
700
701
|
${j.dim("How to use:")}
|
|
701
702
|
${j.underline("https://likec4.dev/tooling/code-generation/model/")}
|
|
702
703
|
`).trim(),{padding:1,borderColor:"green",borderStyle:"round"})}catch(c){var o=c,a=!0}finally{var u=rg(s,o,a);u&&await u}}async function sg({languageServices:e,outDir:t,filename:r="likec4-react.mjs"}){const n=Te(["vite","react"]),i=Nn();return n.info(`${j.cyan("likec4 app root")} ${j.dim(i)}`),n.info(j.cyan("outDir")+" "+j.dim(t)),{customLogger:n,root:i,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:jn()},esbuild:{banner:`'use client'
|
|
703
|
-
`+Tn.banner,footer:Tn.footer,jsx:"transform",jsxDev:!1,jsxSideEffects:!1,minifyIdentifiers:!1,minifySyntax:!1,minifyWhitespace:!1,tsconfigRaw:{compilerOptions:{target:"ES2022",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:t,emptyOutDir:!1,sourcemap:!1,minify:!1,copyPublicDir:!1,chunkSizeWarningLimit:
|
|
704
|
+
`+Tn.banner,footer:Tn.footer,jsx:"transform",jsxDev:!1,jsxSideEffects:!1,minifyIdentifiers:!1,minifySyntax:!1,minifyWhitespace:!1,tsconfigRaw:{compilerOptions:{target:"ES2022",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:t,emptyOutDir:!1,sourcemap:!1,minify:!1,copyPublicDir:!1,chunkSizeWarningLimit:On,lib:{entry:"react/likec4.tsx",fileName(s,o){return r},formats:["es"]},rollupOptions:{output:{compact:!1,exports:"named"},external:["likec4/react","likec4/mode\
|
|
704
705
|
l","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/,/@likec4\/core.*/],onwarn(s,o){s.code!=="SOURCEMAP_ERROR"&&o(s)}}},plugins:[bn({}),Sn({languageServices:e.languageServices,useOverviewGraph:!1})]}}var Sf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Rf=e=>{throw TypeError(e)},og=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Rf("Object expected");var n,i;n=t[Sf("asyncDispose")],n===void 0&&(n=t[Sf("dispose")],i=n),typeof n!=
|
|
705
706
|
"function"&&Rf("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.push([r,n,t])}else e.push([r]);return t},ag=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(s,u=>(i(u),s()))}catch(u){
|
|
706
707
|
i(u)}if(r)throw t};return s()};async function ig({path:e,useDotBin:t,useCorePackage:r,outfile:n,project:i}){var s=[];try{await Ct();const c=Te("c4:codegen"),l=it(c),h=og(s,await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1}),!0),{projectId:y,projectFolder:_}=pn(h,i);i&&c.info(`${j.dim("project")} ${j.green(y)}`),c.info(`${j.dim("format")} ${j.green("react")}`);const S=await h.diagrams(y);if(S.length===0)throw process.exitCode=1,new Error("no views found");S.forEach(w=>{w.
|
|
@@ -715,7 +716,7 @@ hasLayoutDrift&&c.warn(j.yellow("drift detected, manual layout can not be applie
|
|
|
715
716
|
`),{padding:1,borderColor:"green",borderStyle:"round"})}catch(c){var o=c,a=!0}finally{var u=ag(s,o,a);u&&await u}}var Af=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Pf=e=>{throw TypeError(e)},cg=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Pf("Object expected");var n,i;n=t[Af("asyncDispose")],n===void 0&&(n=t[Af("dispose")],i=n),typeof n!="function"&&Pf("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.push([r,n,t])}else e.push(
|
|
716
717
|
[r]);return t},ug=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,a,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=a,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),s=o=>{for(;o=e.pop();)try{var a=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(a).then(s,u=>(i(u),s()))}catch(u){i(u)}if(r)throw t};return s()};async function lg({project:e,path:t,useDotBin:r,webcomponentPrefix:n="likec4",outfile:i}){var s=[];try{await Ct();
|
|
717
718
|
const c=Te("c4:codegen"),l=it(c),h=cg(s,await Pe.fromWorkspace(t,{logger:"vite",graphviz:r?"binary":"wasm",watch:!1}),!0),{projectId:y,projectFolder:_}=pn(h,e);e&&c.info(`${j.dim("project")} ${j.green(y)}`),c.info(`${j.dim("format")} ${j.green("webcomponent")}`);const S=await h.diagrams(y);if(!bt(S,1))throw c.warn("no views found"),process.exitCode=1,new Error("no views found");S.forEach(v=>{v.hasLayoutDrift&&c.warn(j.yellow("drift detected, manual layout can not be applied, view:")+" "+j.red(v.
|
|
718
|
-
id))});let $=oe(h.projectsManager.hasMultipleProjects()?_:h.workspace,"likec4-views.js");if(i&&($=_n(i)?i:oe(i),He(i)&&(await wn(i)).isDirectory()))throw new Error(`output file is a directory: ${i}`);tt.debug(`${j.dim("outfilepath")} ${$}`);const p=Ut($);tt.debug(`${j.dim("filename")} ${p}`);const m=St(p).toLocaleLowerCase();if(m!==".js"&&m!==".mjs")throw tt.warn(`output file ${i} has extension "${m}"`),new Error(`output file ${i} must be a .js or .mjs`);const f=await
|
|
719
|
+
id))});let $=oe(h.projectsManager.hasMultipleProjects()?_:h.workspace,"likec4-views.js");if(i&&($=_n(i)?i:oe(i),He(i)&&(await wn(i)).isDirectory()))throw new Error(`output file is a directory: ${i}`);tt.debug(`${j.dim("outfilepath")} ${$}`);const p=Ut($);tt.debug(`${j.dim("filename")} ${p}`);const m=St(p).toLocaleLowerCase();if(m!==".js"&&m!==".mjs")throw tt.warn(`output file ${i} has extension "${m}"`),new Error(`output file ${i} must be a .js or .mjs`);const f=await In();tt.debug(`${j.dim("cre\
|
|
719
720
|
ated temp public")} ${f}`);const d=await ts({languageServices:h,outDir:f,filename:p,webcomponentPrefix:n,base:"/"});tt.debug(`${j.dim("vite build webcomponent")}`),await At({...d,logLevel:"warn"});const g=oe(f,p);if(!He(g))throw new Error(`output file not found: ${g}`);await xe(qe($),{recursive:!0}),await Yf(g,$),c.info(`${j.dim("generated")} ${$}`),tt.debug(`${j.dim("remove temp public")}`),await Qf(f,{recursive:!0,force:!0}),l.stopAndLog(),We($n(`
|
|
720
721
|
${j.dim("Webcomponents generated to:")}
|
|
721
722
|
${Ue(Ht(),$)}
|