"use strict";var e=require("node:fs"),t=require("yaml"),r=require("node:path"),s=require("picocolors"),n=require("node:net"),o=require("node:crypto");const i="LINTER";class a{static instance;debugMode=!1;constructor(e){void 0!==e&&(this.debugMode=e)}static init(e){a.instance||(a.instance=new a(e))}static getInstance(){if(!a.instance)throw new Error("Logger is not initialized. Call Logger.init() first.");return a.instance}static formatMessage(e,t){const r=a.getColoredLevel(e);return t?`${r} [${t}]`:r}static getColoredLevel(e){switch(e){case"DEBUG":return s.blue("[DEBUG]");case"INFO":return s.green("[INFO]");case"WARN":return s.yellow("[WARN]");case"ERROR":return s.red("[ERROR]");default:return`[${e}]`}}debug(e,...t){if(this.debugMode){const r=a.formatMessage("DEBUG",e);console.debug(r,...t)}}info(...e){const t=a.formatMessage("INFO");console.info(t,...e)}warn(...e){const t=a.formatMessage("WARN");console.warn(t,...e)}error(...e){const t=a.formatMessage("ERROR");console.error(t,...e)}}class c extends Error{constructor(e){super(),this.message=`File or directory not found: ${e}`,this.name="FileNotFoundError"}}function l(t,s,n){const o=a.getInstance();o.debug("UTIL",`Looking for compose files in ${t.toString()}`);let i=[];const u=new Set(["node_modules",".git",".idea",".tsimp"]);n&&n.length>0&&n.forEach((e=>u.add(e)));const d=[...u];o.debug("UTIL",`Paths to exclude: ${d.toString()}`);const p=/^(docker-)?compose.*\.ya?ml$/;return t.forEach((t=>{if(!e.existsSync(t))throw o.debug("UTIL",`File or directory not found: ${t}`),new c(t);let n=[];const a=e.statSync(t);if(a.isDirectory()){try{n=e.readdirSync(r.resolve(t)).map((e=>r.join(t,e)))}catch(e){o.debug("UTIL",`Error reading directory: ${t}`,e),n=[]}n.forEach((t=>{if(d.some((e=>t.includes(e))))return void o.debug("UTIL",`Excluding ${t}`);const n=e.statSync(r.resolve(t));if(n.isDirectory()){if(s){o.debug("UTIL",`Recursive search is enabled, search within the directory: ${t}`);const e=l([t],s,d);i=[...i,...e]}}else n.isFile()&&p.test(r.basename(t))&&i.push(t)}))}else a.isFile()&&i.push(t)})),o.debug("UTIL",`Found compose files in ${t.toString()}: ${i.length>0?i.join(", "):"None"}`),i}function u(e,t){const r=e.split("\n"),s=new RegExp(`^\\s*${t}:`,"i");let n=1;for(const e of r){if(s.test(e))return n;n+=1}return 1}function d(e,t){const r=e.split("\n").findIndex((e=>e.includes(t)));return-1===r?1:r+1}function p(e,r,s,n,o){const i=e.get("services");if(!t.isMap(i))return 1;const a=i.get(s);if(!t.isMap(a))return 1;if(!n)return function(e,t){if(e.range){const[r]=e.range;return t.slice(0,r).split("\n").length-1}return 1}(a,r);const c=a.get(n,!0);if(!c)return 1;if(!o)return function(e,r){if(e.range){const[s]=e.range,n=r.slice(0,s).split("\n").length;return t.isScalar(e)?n:n-1}return 1}(c,r);if(t.isSeq(c)){let e=1;return c.items.forEach((s=>{if(t.isScalar(s)&&String(s.value)===String(o)&&s.range){const[t]=s.range;e=r.slice(0,t).split("\n").length}})),e}if(t.isMap(c)){let e=1;return c.items.forEach((s=>{const n=s.key,i=s.value;if(t.isScalar(n)&&t.isScalar(i)&&String(i.value)===String(o)&&i.range){const[t]=i.range;e=r.slice(0,t).split("\n").length}})),e}return 1}function f(e){if(t.isScalar(e)){const t=String(e.value).split(/:(?![^[]*])/);return t[0].startsWith("[")&&t[0].endsWith("]")&&(t[0]=t[0].slice(1,-1)),n.isIP(t[0])?String(t[1]):t[0]}return t.isMap(e)&&e.get("published")?.toString()||""}class m{name="no-quotes-in-volumes";type="warning";category="style";severity="info";meta={description:"Ensure that quotes are not used in volume names in Docker Compose files.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/no-quotes-in-volumes-rule.md"};fixable=!0;getMessage(){return"Quotes should not be used in volume names."}static extractVolumes(e,r){e&&t.isMap(e)&&e.items.forEach((e=>{if(!t.isMap(e.value))return;e.value.items.forEach((e=>{if(!t.isMap(e.value))return;const s=e.value.items.find((e=>t.isScalar(e.key)&&"volumes"===e.key.value));s&&t.isSeq(s.value)&&s.value.items.forEach((e=>{t.isScalar(e)&&r(e)}))}))}))}check(e){const r=[],s=t.parseDocument(e.sourceCode);return m.extractVolumes(s.contents,(t=>{"PLAIN"!==t.type&&r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage(),line:d(e.sourceCode,String(t.value)),column:1,meta:this.meta,fixable:this.fixable})})),r}fix(e){const r=t.parseDocument(e);return m.extractVolumes(r.contents,(e=>{"PLAIN"!==e.type&&(e.type="PLAIN")})),r.toString()}}class h{name="require-quotes-in-ports";type="warning";category="best-practice";severity="minor";meta={description:"Ensure that ports (in `ports` and `expose` sections) are enclosed in quotes in Docker Compose files.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/require-quotes-in-ports-rule.md"};fixable=!0;getMessage(){return"Ports in `ports` and `expose` sections should be enclosed in quotes."}quoteType;portsSections;constructor(e){this.quoteType=e?.quoteType||"single",this.portsSections=["ports","expose"]}getQuoteType(){return"single"===this.quoteType?"QUOTE_SINGLE":"QUOTE_DOUBLE"}static extractValues(e,r,s){e&&t.isMap(e)&&e.items.forEach((e=>{if(!t.isMap(e.value))return;e.value.items.forEach((e=>{if(!t.isMap(e.value))return;const n=e.value.items.find((e=>t.isScalar(e.key)&&e.key.value===r));n&&t.isSeq(n.value)&&n.value.items.forEach((r=>{t.isScalar(r)&&s(e,r)}))}))}))}check(e){const r=[],s=t.parseDocument(e.sourceCode);return this.portsSections.forEach((t=>{h.extractValues(s.contents,t,((n,o)=>{o.type!==this.getQuoteType()&&r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage(),line:p(s,e.sourceCode,String(n.key),t,String(o.value)),column:1,meta:this.meta,fixable:this.fixable})}))})),r}fix(e){const r=t.parseDocument(e);return this.portsSections.forEach((e=>{h.extractValues(r.contents,e,((e,r)=>{if(r.type!==this.getQuoteType()){const e=new t.Scalar(String(r.value));e.type=this.getQuoteType(),Object.assign(r,e)}}))})),r.toString()}}class y{name="service-container-name-regex";type="error";category="security";severity="critical";message="Container names must match the regex pattern [a-zA-Z0-9][a-zA-Z0-9_.-]+.";meta={description:"Ensure that container names in Docker Compose match the required regex pattern to avoid invalid names.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/service-container-name-regex-rule.md"};fixable=!1;getMessage({serviceName:e,containerName:t}){return`Service "${e}" has an invalid container name "${t}". It must match the regex pattern ${y.containerNameRegex}.`}static containerNameRegex=/^[a-zA-Z0-9][a-zA-Z0-9_.-]+$/;check(e){const r=[],s=t.parseDocument(e.sourceCode),n=s.get("services");return t.isMap(n)?(n.items.forEach((n=>{if(!t.isScalar(n.key))return;const o=String(n.key.value),i=n.value;if(!t.isMap(i)||!i.has("container_name"))return;const a=String(i.get("container_name"));if(!y.containerNameRegex.test(a)){const t=p(s,e.sourceCode,o,"container_name");r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage({serviceName:o,containerName:a}),line:t,column:1,meta:this.meta,fixable:this.fixable})}})),r):[]}}class g{name="service-dependencies-alphabetical-order";type="warning";category="style";severity="info";meta={description:"Ensure that the services listed in the depends_on directive are sorted alphabetically.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/service-dependencies-alphabetical-order-rule.md"};fixable=!0;getMessage=({serviceName:e})=>`Services in "depends_on" for service "${e}" should be in alphabetical order.`;static extractServiceName(e){return t.isScalar(e)?String(e.value):t.isPair(e)?String(e.key):""}check(e){const r=[],s=t.parseDocument(e.sourceCode),n=s.get("services");return t.isMap(n)?(n.items.forEach((n=>{if(!t.isScalar(n.key))return;const o=String(n.key.value),i=n.value;if(!i||!t.isMap(i))return;const a=i.get("depends_on");if(!t.isSeq(a)&&!t.isMap(a))return;const c=a.items.map((e=>g.extractServiceName(e))),l=[...c].sort(((e,t)=>e.localeCompare(t)));if(JSON.stringify(c)!==JSON.stringify(l)){const t=p(s,e.sourceCode,o,"depends_on");r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage({serviceName:o}),line:t,column:1,meta:this.meta,fixable:this.fixable})}})),r):[]}fix(e){const r=t.parseDocument(e),s=r.get("services");return t.isMap(s)?(s.items.forEach((e=>{const r=e.value;if(!r||!t.isMap(r))return;const s=r.get("depends_on");(t.isSeq(s)||t.isMap(s))&&s.items.sort(((e,t)=>{const r=g.extractServiceName(e),s=g.extractServiceName(t);return r.localeCompare(s)}))})),r.toString()):e}}var v;!function(e){e.CoreDefinitions="Core Definitions",e.ServiceDependencies="Service Dependencies",e.DataManagementAndConfiguration="Data Management and Configuration",e.EnvironmentConfiguration="Environment Configuration",e.Networking="Networking",e.RuntimeBehavior="Runtime Behavior",e.OperationalMetadata="Operational Metadata",e.SecurityAndExecutionContext="Security and Execution Context",e.Other="Other"}(v||(v={}));const $=[v.CoreDefinitions,v.ServiceDependencies,v.DataManagementAndConfiguration,v.EnvironmentConfiguration,v.Networking,v.RuntimeBehavior,v.OperationalMetadata,v.SecurityAndExecutionContext,v.Other],b={[v.CoreDefinitions]:["image","build","container_name"],[v.ServiceDependencies]:["depends_on"],[v.DataManagementAndConfiguration]:["volumes","volumes_from","configs","secrets"],[v.EnvironmentConfiguration]:["environment","env_file"],[v.Networking]:["ports","networks","network_mode","extra_hosts"],[v.RuntimeBehavior]:["command","entrypoint","working_dir","restart","healthcheck"],[v.OperationalMetadata]:["logging","labels"],[v.SecurityAndExecutionContext]:["user","isolation"],[v.Other]:[]};class _{name="services-alphabetical-order";type="warning";category="style";severity="minor";message="Services should be listed in alphabetical order.";meta={description:"Ensure that services in the Docker Compose file are listed in alphabetical order.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/services-alphabetical-order-rule.md"};fixable=!0;getMessage({serviceName:e,misplacedBefore:t}){return`Service "${e}" should be before "${t}".`}static findMisplacedService(e,t){let r="";return e.forEach((e=>{e.localeCompare(t)>0&&(!r||e.localeCompare(r)<0)&&(r=e)})),r}check(e){const r=[],s=t.parseDocument(e.sourceCode),n=s.get("services");if(!t.isMap(n))return[];const o=[];return n.items.forEach((n=>{if(!t.isScalar(n.key))return;const i=String(n.key.value),a=_.findMisplacedService(o,i);if(a){const t=p(s,e.sourceCode,i);r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage({serviceName:i,misplacedBefore:a}),line:t,column:1,meta:this.meta,fixable:this.fixable})}o.push(i)})),r}fix(e){const r=t.parseDocument(e),s=r.get("services");if(!t.isMap(s))return e;const n=new t.YAMLMap;return s.items.sort(((e,r)=>t.isScalar(e.key)&&t.isScalar(r.key)?String(e.key.value).localeCompare(String(r.key.value)):0)).forEach((e=>{n.add(e)})),r.set("services",n),r.toString()}}var w;!function(e){e.XProperties="x-properties",e.Version="version",e.Name="name",e.Include="include",e.Services="services",e.Networks="networks",e.Volumes="volumes",e.Secrets="secrets",e.Configs="configs"}(w||(w={}));const P=[w.XProperties,w.Version,w.Name,w.Include,w.Services,w.Networks,w.Volumes,w.Secrets,w.Configs];var S={NoBuildAndImageRule:class{name="no-build-and-image";type="error";category="best-practice";severity="major";meta={description:'Ensure that each service uses either "build" or "image", but not both, to prevent ambiguity in Docker Compose configurations.',url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/no-build-and-image-rule.md"};fixable=!1;checkPullPolicy;constructor(e){this.checkPullPolicy=e?.checkPullPolicy??!0}getMessage({serviceName:e}){return`Service "${e}" is using both "build" and "image". Use either "build" or "image" but not both.`}check(e){const r=[],s=t.parseDocument(e.sourceCode),n=s.get("services");return t.isMap(n)?(n.items.forEach((n=>{if(!t.isScalar(n.key))return;const o=String(n.key.value),i=n.value;if(!t.isMap(i))return;const a=i.has("build"),c=i.has("image"),l=i.has("pull_policy");if(a&&c&&(!this.checkPullPolicy||!l)){const t=p(s,e.sourceCode,o,"build");r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage({serviceName:o}),line:t,column:1,meta:this.meta,fixable:this.fixable})}})),r):[]}},NoDuplicateContainerNamesRule:class{name="no-duplicate-container-names";type="error";category="security";severity="critical";meta={description:"Ensure that container names in Docker Compose are unique to prevent name conflicts and ensure proper container management.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/no-duplicate-container-names-rule.md"};fixable=!1;getMessage({serviceName:e,containerName:t,anotherService:r}){return`Service "${e}" has a duplicate container name "${t}" with service "${r}". Container names MUST BE unique.`}check(e){const r=[],s=t.parseDocument(e.sourceCode),n=s.get("services");if(!t.isMap(n))return[];const o=new Map;return n.items.forEach((n=>{if(!t.isScalar(n.key))return;const i=String(n.key.value),a=n.value;if(t.isMap(a)&&a.has("container_name")){const t=String(a.get("container_name"));if(o.has(t)){const n=p(s,e.sourceCode,i,"container_name");r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage({serviceName:i,containerName:t,anotherService:String(o.get(t))}),line:n,column:1,meta:this.meta,fixable:this.fixable})}else o.set(t,i)}})),r}},NoDuplicateExportedPortsRule:class{name="no-duplicate-exported-ports";type="error";category="security";severity="critical";meta={description:"Ensure that exported ports in Docker Compose are unique to prevent port conflicts and ensure proper network behavior.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/no-duplicate-exported-ports-rule.md"};fixable=!1;getMessage({serviceName:e,publishedPort:t,anotherService:r}){return`Service "${e}" is exporting port "${t}" which is already used by service "${r}".`}check(e){const r=[],s=t.parseDocument(e.sourceCode),n=s.get("services");if(!t.isMap(n))return[];const o=new Map;return n.items.forEach((n=>{if(!t.isScalar(n.key))return;const i=String(n.key.value),a=n.value;if(!t.isMap(a)||!a.has("ports"))return;const c=a.get("ports");t.isSeq(c)&&c.items.forEach((t=>{const n=f(t),a=function(e){const[t,r]=e.split("-").map(Number);if(Number.isNaN(t)||Number.isNaN(r))return[];if(!r)return[t.toString()];if(t>r)return[];const s=[];for(let e=t;e<=r;e++)s.push(e.toString());return s}(n);a.some((t=>{if(o.has(t)){const a=p(s,e.sourceCode,i,"ports");return r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage({serviceName:i,publishedPort:n,anotherService:String(o.get(t))}),line:a,column:1,meta:this.meta,fixable:this.fixable}),!0}return!1})),a.forEach((e=>!o.has(e)&&o.set(e,i)))}))})),r}},NoQuotesInVolumesRule:m,NoUnboundPortInterfacesRule:class{name="no-unbound-port-interfaces";type="error";category="security";severity="major";meta={description:"Ensure that exported ports in Docker Compose are bound to specific Interfaces to prevent unintentional exposing services to the network.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/no-unbound-port-interfaces-rule.md"};fixable=!1;getMessage({serviceName:e,port:t}){return`Service "${e}" is exporting port "${t}" without specifying the interface to listen on.`}check(e){const r=[],s=t.parseDocument(e.sourceCode),o=s.get("services");return t.isMap(o)?(o.items.forEach((o=>{if(!t.isScalar(o.key))return;const i=String(o.key.value),a=o.value;if(!t.isMap(a)||!a.has("ports"))return;const c=a.get("ports");t.isSeq(c)&&c.items.forEach((o=>{if(""===function(e){if(t.isScalar(e)){const t=String(e.value).split(/:(?![^[]*])/);return t[0].startsWith("[")&&t[0].endsWith("]")&&(t[0]=t[0].slice(1,-1)),n.isIP(t[0])?String(t[0]):""}return t.isMap(e)&&e.get("host_ip")?.toString()||""}(o)){const n=p(s,e.sourceCode,i,"ports");r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage({serviceName:i,port:t.isSeq(o)?o.toString():String(o)}),line:n,column:1,meta:this.meta,fixable:this.fixable})}}))})),r):[]}},NoVersionFieldRule:class{name="no-version-field";type="error";category="best-practice";severity="minor";meta={description:'Ensure that the "version" field is not present in the Docker Compose file.',url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/no-version-field-rule.md"};fixable=!0;getMessage(){return'The "version" field should not be present.'}check(e){const t=[];return e.content&&"version"in e.content&&t.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage(),line:u(e.sourceCode,"version"),column:1,meta:this.meta,fixable:this.fixable}),t}fix(e){const t=e.split("\n"),r=t.findIndex((e=>e.trim().startsWith("version:")));return-1!==r&&t.splice(r,1),t.join("\n")}},RequireProjectNameFieldRule:class{name="require-project-name-field";type="warning";category="best-practice";severity="minor";meta={description:'Ensure that the "name" field is present in the Docker Compose file.',url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/require-project-name-field-rule.md"};fixable=!1;getMessage(){return'The "name" field should be present.'}check(e){const t=[];return e.content&&!("name"in e.content)&&t.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage(),line:1,column:1,meta:this.meta,fixable:this.fixable}),t}},RequireQuotesInPortsRule:h,ServiceContainerNameRegexRule:y,ServiceDependenciesAlphabeticalOrderRule:g,ServiceImageRequireExplicitTagRule:class{name="service-image-require-explicit-tag";type="error";category="security";severity="major";meta={description:'Avoid using unspecific image tags like "latest" or "stable" in Docker Compose files to prevent unpredictable behavior. Specify a specific image version.',url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/service-image-require-explicit-tag-rule.md"};fixable=!1;getMessage({serviceName:e,image:t}){return`Service "${e}" is using the image "${t}", which does not have a concrete version tag. Specify a concrete version tag.`}prohibitedTags;constructor(e){this.prohibitedTags=e?.prohibitedTags||["latest","stable","edge","test","nightly","dev","beta","canary"]}isImageTagExplicit(e){const t=e.split("/").pop();if(!t||!t.includes(":"))return!1;const[,r]=t.split(":");return!this.prohibitedTags.includes(r)}check(e){const r=[],s=t.parseDocument(e.sourceCode),n=s.get("services");return t.isMap(n)?(n.items.forEach((n=>{if(!t.isScalar(n.key))return;const o=String(n.key.value),i=n.value;if(!t.isMap(i)||!i.has("image"))return;const a=String(i.get("image"));if(!this.isImageTagExplicit(a)){const t=p(s,e.sourceCode,o,"image");r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:this.getMessage({serviceName:o,image:a}),line:t,column:1,meta:this.meta,fixable:this.fixable})}})),r):[]}},ServiceKeysOrderRule:class{name="service-keys-order";type="warning";category="style";severity="minor";message="Keys within each service should follow the predefined order.";meta={description:"Ensure that keys within each service in the Docker Compose file are ordered correctly.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/service-keys-order-rule.md"};fixable=!0;getMessage({serviceName:e,key:t,correctOrder:r}){return`Key "${t}" in service "${e}" is out of order. Expected order is: ${r.join(", ")}.`}groupOrder;groups;constructor(e){this.groupOrder=e?.groupOrder?.length?e.groupOrder:$,this.groups={...b},e?.groups&&Object.keys(e.groups).forEach((t=>{const r=t;b[r]&&e.groups&&(this.groups[r]=e.groups[r])}))}getCorrectOrder(e){const t=e.filter((e=>!Object.values(this.groups).flat().includes(e))).sort();return[...this.groupOrder.flatMap((e=>this.groups[e])),...t]}check(e){const r=[],s=t.parseDocument(e.sourceCode),n=s.get("services");return t.isMap(n)?(n.items.forEach((n=>{if(!t.isScalar(n.key))return;const o=String(n.key.value),i=n.value;if(!t.isMap(i))return;const a=i.items.map((e=>String(e.key))),c=this.getCorrectOrder(a);let l=-1;a.forEach((t=>{const n=c.indexOf(t);if(-1!==n){if(n{if(!t.isScalar(e.key))return;const r=String(e.key.value),n=e.value;if(!t.isMap(n))return;const o=n.items.map((e=>t.isScalar(e.key)?String(e.key.value):"")).filter(Boolean),i=this.getCorrectOrder(o),a=new t.YAMLMap;i.forEach((e=>{const r=n.items.find((r=>t.isScalar(r.key)&&r.key.value===e));r&&a.add(r)})),o.forEach((e=>{if(!i.includes(e)){const r=n.items.find((r=>t.isScalar(r.key)&&r.key.value===e));r&&a.add(r)}})),s.set(r,a)})),r.toString()):e}},ServicePortsAlphabeticalOrderRule:class{name="service-ports-alphabetical-order";type="warning";category="style";severity="info";meta={description:"Ensure that the list of ports in the Docker Compose service is alphabetically sorted.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/service-ports-alphabetical-order-rule.md"};fixable=!0;getMessage({serviceName:e}){return`Ports in service "${e}" should be in alphabetical order.`}check(e){const r=[],s=t.parseDocument(e.sourceCode),n=s.get("services");return t.isMap(n)?(n.items.forEach((n=>{if(!t.isScalar(n.key))return;const o=String(n.key.value),i=n.value;if(!t.isMap(i)||!t.isSeq(i.get("ports")))return;const a=i.get("ports");if(!t.isSeq(a))return;const c=a.items.map((e=>f(e))),l=[...c].sort(((e,t)=>e.localeCompare(t,void 0,{numeric:!0})));if(JSON.stringify(c)!==JSON.stringify(l)){const t=p(s,e.sourceCode,o,"ports");r.push({rule:this.name,type:this.type,category:this.category,severity:this.severity,message:`Ports in service "${o}" should be in alphabetical order.`,line:t,column:1,meta:this.meta,fixable:this.fixable})}})),r):[]}fix(e){const r=t.parseDocument(e),s=r.get("services");return t.isMap(s)?(s.items.forEach((e=>{const r=e.value;if(!t.isMap(r)||!t.isSeq(r.get("ports")))return;const s=r.get("ports");t.isSeq(s)&&s.items.sort(((e,t)=>{const r=f(e),s=f(t);return r.localeCompare(s,void 0,{numeric:!0})}))})),r.toString()):e}},ServicesAlphabeticalOrderRule:_,TopLevelPropertiesOrderRule:class{name="top-level-properties-order";type="warning";category="style";severity="major";message="Top-level properties should follow the predefined order.";meta={description:"Ensure that top-level properties in the Docker Compose file are ordered correctly.",url:"https://github.com/zavoloklom/docker-compose-linter/blob/main/docs/rules/top-level-properties-order-rule.md"};fixable=!0;getMessage({key:e,correctOrder:t}){return`Property "${e}" is out of order. Expected order is: ${t.join(", ")}.`}expectedOrder;constructor(e){this.expectedOrder=e?.customOrder??P}check(e){const t=[],r=Object.keys(e.content),s=r.filter((e=>e.startsWith("x-"))).sort(),n=this.expectedOrder.flatMap((e=>e===w.XProperties?s:[e]));let o=-1;return r.forEach((r=>{const s=n.indexOf(r);if(-1===s||st.isScalar(e.key)?String(e.key.value):"")).filter(Boolean).filter((e=>e.startsWith("x-"))).sort(),o=this.expectedOrder.flatMap((e=>e===w.XProperties?n:[e])),i=new t.YAMLMap;return o.forEach((e=>{const r=s.items.find((r=>t.isScalar(r.key)&&String(r.key.value)===e));r&&i.items.push(r)})),r.contents=i,r.toString()}}};var k,E={exports:{}},j={},x={},N={},C={},O={},I={};function R(){return k||(k=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class s extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function n(e,...t){const r=[e[0]];let n=0;for(;n{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(n,o,i={},a){let c=t.nil;for(const l in n){const u=n[l];if(!u)continue;const d=i[l]=i[l]||new Map;u.forEach((n=>{if(d.has(n))return;d.set(n,s.Started);let i=o(n);if(i){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${n} = ${i};${this.opts._n}`}else{if(!(i=null==a?void 0:a(n)))throw new r(n);c=t._`${c}${i}${this.opts._n}`}d.set(n,s.Completed)}))}return c}}}(A)),A}function q(){return T||(T=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=R(),r=D();var s=R();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return s.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return s.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return s.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return s.Name}});var n=D();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class i extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const s=e?r.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${s} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=N(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=N(this.rhs,e,r),this}get names(){return x(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends a{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class l extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=N(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class f extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let s=r.length;for(;s--;){const n=r[s];n.optimizeNames(e,t)||(C(e,n.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>j(e,t.names)),{})}}class m extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class h extends f{}class y extends m{}y.kind="else";class g extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new y(e):e}return t?!1===e?t instanceof g?t:t.nodes:this.nodes.length?this:new g(O(e),t instanceof g?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=N(this.condition,e,t),this}get names(){const e=super.names;return x(e,this.condition),this.else&&j(e,this.else.names),e}}g.kind="if";class v extends m{}v.kind="for";class $ extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=N(this.iteration,e,t),this}get names(){return j(super.names,this.iteration.names)}}class b extends v{constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:s,from:n,to:o}=this;return`for(${t} ${s}=${n}; ${s}<${o}; ${s}++)`+super.render(e)}get names(){const e=x(super.names,this.from);return x(e,this.to)}}class _ extends v{constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=N(this.iterable,e,t),this}get names(){return j(super.names,this.iterable.names)}}class w extends m{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}w.kind="func";class P extends f{render(e){return"return "+super.render(e)}}P.kind="return";class S extends m{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(s=this.finally)||void 0===s||s.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&j(e,this.catch.names),this.finally&&j(e,this.finally.names),e}}class k extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}k.kind="catch";class E extends m{render(e){return"finally"+super.render(e)}}E.kind="finally";function j(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function x(e,r){return r instanceof t._CodeOrName?j(e,r.names):e}function N(e,r,s){return e instanceof t.Name?o(e):(n=e)instanceof t._Code&&n._items.some((e=>e instanceof t.Name&&1===r[e.str]&&void 0!==s[e.str]))?new t._Code(e._items.reduce(((e,r)=>(r instanceof t.Name&&(r=o(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e)),[])):e;var n;function o(e){const t=s[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function C(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function O(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${A(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){const n=this._scope.toName(t);return void 0!==r&&s&&(this._constants[n.str]=r),this._leafNode(new i(e,n,r)),n}const(e,t,s){return this._def(r.varKinds.const,e,t,s)}let(e,t,s){return this._def(r.varKinds.let,e,t,s)}var(e,t,s){return this._def(r.varKinds.var,e,t,s)}assign(e,t,r){return this._leafNode(new a(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new p(e)),this}object(...e){const r=["{"];for(const[s,n]of e)r.length>1&&r.push(","),r.push(s),(s!==n||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,n));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new g(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new g(e))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new $(e),t)}forRange(e,t,s,n,o=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const i=this._scope.toName(e);return this._for(new b(o,i,t,s),(()=>n(i)))}forOf(e,s,n,o=r.varKinds.const){const i=this._scope.toName(e);if(this.opts.es5){const e=s instanceof t.Name?s:this.var("_arr",s);return this.forRange("_i",0,t._`${e}.length`,(r=>{this.var(i,t._`${e}[${r}]`),n(i)}))}return this._for(new _("of",o,i,s),(()=>n(i)))}forIn(e,s,n,o=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${s})`,n);const i=this._scope.toName(e);return this._for(new _("in",o,i,s),(()=>n(i)))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){const t=new P;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const s=new S;if(this._blockNode(s),this.code(e),t){const e=this.name("e");this._currNode=s.catch=new k(e),t(e)}return r&&(this._currNode=s.finally=new E,this.code(r)),this._endBlockNode(k,E)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,s,n){return this._blockNode(new w(e,r,s)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=O;const I=T(e.operators.AND);e.and=function(...e){return e.reduce(I)};const M=T(e.operators.OR);function T(e){return(r,s)=>r===t.nil?s:s===t.nil?r:t._`${A(r)} ${e} ${A(s)}`}function A(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(M)}}(O)),O}var V,z={};function U(){if(V)return z;V=1,Object.defineProperty(z,"__esModule",{value:!0}),z.checkStrictMode=z.getErrorPath=z.Type=z.useFunc=z.setEvaluated=z.evaluatedPropsToName=z.mergeEvaluated=z.eachItem=z.unescapeJsonPointer=z.escapeJsonPointer=z.escapeFragment=z.unescapeFragment=z.schemaRefOrVal=z.schemaHasRulesButRef=z.schemaHasRules=z.checkUnknownRules=z.alwaysValidSchema=z.toHash=void 0;const e=q(),t=R();function r(e,t=e.schema){const{opts:r,self:s}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const n=s.RULES.keywords;for(const r in t)n[r]||d(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function n(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function o(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function i({mergeNames:t,mergeToName:r,mergeValues:s,resultToName:n}){return(o,i,a,c)=>{const l=void 0===a?i:a instanceof e.Name?(i instanceof e.Name?t(o,i,a):r(o,i,a),a):i instanceof e.Name?(r(o,a,i),i):s(i,a);return c!==e.Name||l instanceof e.Name?l:n(o,l)}}function a(t,r){if(!0===r)return t.var("props",!0);const s=t.var("props",e._`{}`);return void 0!==r&&c(t,s,r),s}function c(t,r,s){Object.keys(s).forEach((s=>t.assign(e._`${r}${(0,e.getProperty)(s)}`,!0)))}z.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},z.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(r(e,t),!s(t,e.self.RULES.all))},z.checkUnknownRules=r,z.schemaHasRules=s,z.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},z.schemaRefOrVal=function({topSchemaRef:t,schemaPath:r},s,n,o){if(!o){if("number"==typeof s||"boolean"==typeof s)return s;if("string"==typeof s)return e._`${s}`}return e._`${t}${r}${(0,e.getProperty)(n)}`},z.unescapeFragment=function(e){return o(decodeURIComponent(e))},z.escapeFragment=function(e){return encodeURIComponent(n(e))},z.escapeJsonPointer=n,z.unescapeJsonPointer=o,z.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},z.mergeEvaluated={props:i({mergeNames:(t,r,s)=>t.if(e._`${s} !== true && ${r} !== undefined`,(()=>{t.if(e._`${r} === true`,(()=>t.assign(s,!0)),(()=>t.assign(s,e._`${s} || {}`).code(e._`Object.assign(${s}, ${r})`)))})),mergeToName:(t,r,s)=>t.if(e._`${s} !== true`,(()=>{!0===r?t.assign(s,!0):(t.assign(s,e._`${s} || {}`),c(t,s,r))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:a}),items:i({mergeNames:(t,r,s)=>t.if(e._`${s} !== true && ${r} !== undefined`,(()=>t.assign(s,e._`${r} === true ? true : ${s} > ${r} ? ${s} : ${r}`))),mergeToName:(t,r,s)=>t.if(e._`${s} !== true`,(()=>t.assign(s,!0===r||e._`${s} > ${r} ? ${s} : ${r}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},z.evaluatedPropsToName=a,z.setEvaluated=c;const l={};var u;function d(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}return z.useFunc=function(e,r){return e.scopeValue("func",{ref:r,code:l[r.code]||(l[r.code]=new t._Code(r.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(u||(z.Type=u={})),z.getErrorPath=function(t,r,s){if(t instanceof e.Name){const n=r===u.Num;return s?n?e._`"[" + ${t} + "]"`:e._`"['" + ${t} + "']"`:n?e._`"/" + ${t}`:e._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return s?(0,e.getProperty)(t).toString():"/"+n(t)},z.checkStrictMode=d,z}var L,F,K,G={};function B(){if(L)return G;L=1,Object.defineProperty(G,"__esModule",{value:!0});const e=q(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return G.default=t,G}function H(){return F||(F=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=q(),r=U(),s=B();function n(e,r){const n=e.const("err",r);e.if(t._`${s.default.vErrors} === null`,(()=>e.assign(s.default.vErrors,t._`[${n}]`)),t._`${s.default.vErrors}.push(${n})`),e.code(t._`${s.default.errors}++`)}function o(e,r){const{gen:s,validateName:n,schemaEnv:o}=e;o.$async?s.throw(t._`new ${e.ValidationError}(${r})`):(s.assign(t._`${n}.errors`,r),s.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,s=e.keywordError,i,c){const{it:l}=r,{gen:u,compositeRule:d,allErrors:p}=l,f=a(r,s,i);(null!=c?c:d||p)?n(u,f):o(l,t._`[${f}]`)},e.reportExtraError=function(t,r=e.keywordError,i){const{it:c}=t,{gen:l,compositeRule:u,allErrors:d}=c;n(l,a(t,r,i)),u||d||o(c,s.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(s.default.errors,r),e.if(t._`${s.default.vErrors} !== null`,(()=>e.if(r,(()=>e.assign(t._`${s.default.vErrors}.length`,r)),(()=>e.assign(s.default.vErrors,null)))))},e.extendErrors=function({gen:e,keyword:r,schemaValue:n,data:o,errsCount:i,it:a}){if(void 0===i)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",i,s.default.errors,(i=>{e.const(c,t._`${s.default.vErrors}[${i}]`),e.if(t._`${c}.instancePath === undefined`,(()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(s.default.instancePath,a.errorPath)))),e.assign(t._`${c}.schemaPath`,t.str`${a.errSchemaPath}/${r}`),a.opts.verbose&&(e.assign(t._`${c}.schema`,n),e.assign(t._`${c}.data`,o))}))};const i={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 a(e,r,n){const{createErrors:o}=e.it;return!1===o?t._`{}`:function(e,r,n={}){const{gen:o,it:a}=e,u=[c(a,n),l(e,n)];return function(e,{params:r,message:n},o){const{keyword:a,data:c,schemaValue:l,it:u}=e,{opts:d,propertyName:p,topSchemaRef:f,schemaPath:m}=u;o.push([i.keyword,a],[i.params,"function"==typeof r?r(e):r||t._`{}`]),d.messages&&o.push([i.message,"function"==typeof n?n(e):n]);d.verbose&&o.push([i.schema,l],[i.parentSchema,t._`${f}${m}`],[s.default.data,c]);p&&o.push([i.propertyName,p])}(e,r,u),o.object(...u)}(e,r,n)}function c({errorPath:e},{instancePath:n}){const o=n?t.str`${e}${(0,r.getErrorPath)(n,r.Type.Str)}`:e;return[s.default.instancePath,(0,t.strConcat)(s.default.instancePath,o)]}function l({keyword:e,it:{errSchemaPath:s}},{schemaPath:n,parentSchema:o}){let a=o?s:t.str`${s}/${e}`;return n&&(a=t.str`${a}${(0,r.getErrorPath)(n,r.Type.Str)}`),[i.schemaPath,a]}}(C)),C}var J,W={},Z={};function Q(){if(J)return Z;J=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.getRules=Z.isJSONType=void 0;const e=new Set(["string","number","integer","boolean","null","object","array"]);return Z.isJSONType=function(t){return"string"==typeof t&&e.has(t)},Z.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}},Z}var X,Y,ee={};function te(){if(X)return ee;function e(e,r){return r.rules.some((r=>t(e,r)))}function t(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}return X=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.shouldUseRule=ee.shouldUseGroup=ee.schemaHasRulesForType=void 0,ee.schemaHasRulesForType=function({schema:t,self:r},s){const n=r.RULES.types[s];return n&&!0!==n&&e(t,n)},ee.shouldUseGroup=e,ee.shouldUseRule=t,ee}function re(){if(Y)return W;Y=1,Object.defineProperty(W,"__esModule",{value:!0}),W.reportTypeError=W.checkDataTypes=W.checkDataType=W.coerceAndCheckDataType=W.getJSONTypes=W.getSchemaTypes=W.DataType=void 0;const e=Q(),t=te(),r=H(),s=q(),n=U();var o;function i(t){const r=Array.isArray(t)?t:t?[t]:[];if(r.every(e.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(o||(W.DataType=o={})),W.getSchemaTypes=function(e){const t=i(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},W.getJSONTypes=i,W.coerceAndCheckDataType=function(e,r){const{gen:n,data:i,opts:c}=e,u=function(e,t){return t?e.filter((e=>a.has(e)||"array"===t&&"array"===e)):[]}(r,c.coerceTypes),p=r.length>0&&!(0===u.length&&1===r.length&&(0,t.schemaHasRulesForType)(e,r[0]));if(p){const t=l(r,i,c.strictNumbers,o.Wrong);n.if(t,(()=>{u.length?function(e,t,r){const{gen:n,data:o,opts:i}=e,c=n.let("dataType",s._`typeof ${o}`),u=n.let("coerced",s._`undefined`);"array"===i.coerceTypes&&n.if(s._`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>n.assign(o,s._`${o}[0]`).assign(c,s._`typeof ${o}`).if(l(t,o,i.strictNumbers),(()=>n.assign(u,o)))));n.if(s._`${u} !== undefined`);for(const e of r)(a.has(e)||"array"===e&&"array"===i.coerceTypes)&&p(e);function p(e){switch(e){case"string":return void n.elseIf(s._`${c} == "number" || ${c} == "boolean"`).assign(u,s._`"" + ${o}`).elseIf(s._`${o} === null`).assign(u,s._`""`);case"number":return void n.elseIf(s._`${c} == "boolean" || ${o} === null || (${c} == "string" && ${o} && ${o} == +${o})`).assign(u,s._`+${o}`);case"integer":return void n.elseIf(s._`${c} === "boolean" || ${o} === null || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(u,s._`+${o}`);case"boolean":return void n.elseIf(s._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(u,!1).elseIf(s._`${o} === "true" || ${o} === 1`).assign(u,!0);case"null":return n.elseIf(s._`${o} === "" || ${o} === 0 || ${o} === false`),void n.assign(u,null);case"array":n.elseIf(s._`${c} === "string" || ${c} === "number" || ${c} === "boolean" || ${o} === null`).assign(u,s._`[${o}]`)}}n.else(),d(e),n.endIf(),n.if(s._`${u} !== undefined`,(()=>{n.assign(o,u),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(s._`${t} !== undefined`,(()=>e.assign(s._`${t}[${r}]`,n)))}(e,u)}))}(e,r,u):d(e)}))}return p};const a=new Set(["string","number","integer","boolean","null"]);function c(e,t,r,n=o.Correct){const i=n===o.Correct?s.operators.EQ:s.operators.NEQ;let a;switch(e){case"null":return s._`${t} ${i} null`;case"array":a=s._`Array.isArray(${t})`;break;case"object":a=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":a=c(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":a=c();break;default:return s._`typeof ${t} ${i} ${e}`}return n===o.Correct?a:(0,s.not)(a);function c(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,r?s._`isFinite(${t})`:s.nil)}}function l(e,t,r,o){if(1===e.length)return c(e[0],t,r,o);let i;const a=(0,n.toHash)(e);if(a.array&&a.object){const e=s._`typeof ${t} != "object"`;i=a.null?e:s._`!${t} || ${e}`,delete a.null,delete a.array,delete a.object}else i=s.nil;a.number&&delete a.integer;for(const e in a)i=(0,s.and)(i,c(e,t,r,o));return i}W.checkDataType=c,W.checkDataTypes=l;const u={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function d(e){const t=function(e){const{gen:t,data:r,schema:s}=e,o=(0,n.schemaRefOrVal)(e,s,"type");return{gen:t,keyword:"type",data:r,schema:s.type,schemaCode:o,schemaValue:o,parentSchema:s,params:{},it:e}}(e);(0,r.reportError)(t,u)}return W.reportTypeError=d,W}var se,ne={};var oe,ie,ae={},ce={};function le(){if(oe)return ce;oe=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.validateUnion=ce.validateArray=ce.usePattern=ce.callValidateCode=ce.schemaProperties=ce.allSchemaProperties=ce.noPropertyInData=ce.propertyInData=ce.isOwnProperty=ce.hasPropFunc=ce.reportMissingProp=ce.checkMissingProp=ce.checkReportMissingProp=void 0;const e=q(),t=U(),r=B(),s=U();function n(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:e._`Object.prototype.hasOwnProperty`})}function o(t,r,s){return e._`${n(t)}.call(${r}, ${s})`}function i(t,r,s,n){const i=e._`${r}${(0,e.getProperty)(s)} === undefined`;return n?(0,e.or)(i,(0,e.not)(o(t,r,s))):i}function a(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}ce.checkReportMissingProp=function(t,r){const{gen:s,data:n,it:o}=t;s.if(i(s,n,r,o.opts.ownProperties),(()=>{t.setParams({missingProperty:e._`${r}`},!0),t.error()}))},ce.checkMissingProp=function({gen:t,data:r,it:{opts:s}},n,o){return(0,e.or)(...n.map((n=>(0,e.and)(i(t,r,n,s.ownProperties),e._`${o} = ${n}`))))},ce.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},ce.hasPropFunc=n,ce.isOwnProperty=o,ce.propertyInData=function(t,r,s,n){const i=e._`${r}${(0,e.getProperty)(s)} !== undefined`;return n?e._`${i} && ${o(t,r,s)}`:i},ce.noPropertyInData=i,ce.allSchemaProperties=a,ce.schemaProperties=function(e,r){return a(r).filter((s=>!(0,t.alwaysValidSchema)(e,r[s])))},ce.callValidateCode=function({schemaCode:t,data:s,it:{gen:n,topSchemaRef:o,schemaPath:i,errorPath:a},it:c},l,u,d){const p=d?e._`${t}, ${s}, ${o}${i}`:s,f=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,a)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&f.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const m=e._`${p}, ${n.object(...f)}`;return u!==e.nil?e._`${l}.call(${u}, ${m})`:e._`${l}(${m})`};const c=e._`new RegExp`;return ce.usePattern=function({gen:t,it:{opts:r}},n){const o=r.unicodeRegExp?"u":"",{regExp:i}=r.code,a=i(n,o);return t.scopeValue("pattern",{key:a.toString(),ref:a,code:e._`${"new RegExp"===i.code?c:(0,s.useFunc)(t,i)}(${n}, ${o})`})},ce.validateArray=function(r){const{gen:s,data:n,keyword:o,it:i}=r,a=s.name("valid");if(i.allErrors){const e=s.let("valid",!0);return c((()=>s.assign(e,!1))),e}return s.var(a,!0),c((()=>s.break())),a;function c(i){const c=s.const("len",e._`${n}.length`);s.forRange("i",0,c,(n=>{r.subschema({keyword:o,dataProp:n,dataPropType:t.Type.Num},a),s.if((0,e.not)(a),i)}))}},ce.validateUnion=function(r){const{gen:s,schema:n,keyword:o,it:i}=r;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,t.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const a=s.let("valid",!1),c=s.name("_valid");s.block((()=>n.forEach(((t,n)=>{const i=r.subschema({keyword:o,schemaProp:n,compositeRule:!0},c);s.assign(a,e._`${a} || ${c}`);r.mergeValidEvaluated(i,c)||s.if((0,e.not)(a))})))),r.result(a,(()=>r.reset()),(()=>r.error(!0)))},ce}function ue(){if(ie)return ae;ie=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.validateKeywordUsage=ae.validSchemaType=ae.funcKeywordCode=ae.macroKeywordCode=void 0;const e=q(),t=B(),r=le(),s=H();function n(t){const{gen:r,data:s,it:n}=t;r.if(n.parentData,(()=>r.assign(s,e._`${n.parentData}[${n.parentDataProperty}]`)))}function o(t,r,s){if(void 0===s)throw new Error(`keyword "${r}" failed to compile`);return t.scopeValue("keyword","function"==typeof s?{ref:s}:{ref:s,code:(0,e.stringify)(s)})}return ae.macroKeywordCode=function(t,r){const{gen:s,keyword:n,schema:i,parentSchema:a,it:c}=t,l=r.macro.call(c.self,i,a,c),u=o(s,n,l);!1!==c.opts.validateSchema&&c.self.validateSchema(l,!0);const d=s.name("valid");t.subschema({schema:l,schemaPath:e.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:u,compositeRule:!0},d),t.pass(d,(()=>t.error(!0)))},ae.funcKeywordCode=function(i,a){var c;const{gen:l,keyword:u,schema:d,parentSchema:p,$data:f,it:m}=i;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(m,a);const h=!f&&a.compile?a.compile.call(m.self,d,p,m):a.validate,y=o(l,u,h),g=l.let("valid");function v(s=(a.async?e._`await `:e.nil)){const n=m.opts.passContext?t.default.this:t.default.self,o=!("compile"in a&&!f||!1===a.schema);l.assign(g,e._`${s}${(0,r.callValidateCode)(i,y,n,o)}`,a.modifying)}function $(t){var r;l.if((0,e.not)(null!==(r=a.valid)&&void 0!==r?r:g),t)}i.block$data(g,(function(){if(!1===a.errors)v(),a.modifying&&n(i),$((()=>i.error()));else{const r=a.async?function(){const t=l.let("ruleErrs",null);return l.try((()=>v(e._`await `)),(r=>l.assign(g,!1).if(e._`${r} instanceof ${m.ValidationError}`,(()=>l.assign(t,e._`${r}.errors`)),(()=>l.throw(r))))),t}():function(){const t=e._`${y}.errors`;return l.assign(t,null),v(e.nil),t}();a.modifying&&n(i),$((()=>function(r,n){const{gen:o}=r;o.if(e._`Array.isArray(${n})`,(()=>{o.assign(t.default.vErrors,e._`${t.default.vErrors} === null ? ${n} : ${t.default.vErrors}.concat(${n})`).assign(t.default.errors,e._`${t.default.vErrors}.length`),(0,s.extendErrors)(r)}),(()=>r.error()))}(i,r)))}})),i.ok(null!==(c=a.valid)&&void 0!==c?c:g)},ae.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},ae.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:s},n,o){if(Array.isArray(n.keyword)?!n.keyword.includes(o):n.keyword!==o)throw new Error("ajv implementation error");const i=n.dependencies;if(null==i?void 0:i.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${i.join(",")}`);if(n.validateSchema){if(!n.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${s}": `+r.errorsText(n.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},ae}var de,pe={};var fe,me,he={};function ye(){return me||(me=1,fe=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var s,n,o;if(Array.isArray(t)){if((s=t.length)!=r.length)return!1;for(n=s;0!=n--;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((s=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(n=s;0!=n--;)if(!Object.prototype.hasOwnProperty.call(r,o[n]))return!1;for(n=s;0!=n--;){var i=o[n];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r}),fe}var ge,ve,$e,be={exports:{}};function _e(){if(ge)return be.exports;ge=1;var e=be.exports=function(e,r,s){"function"==typeof r&&(s=r,r={}),t(r,"function"==typeof(s=r.cb||s)?s:s.pre||function(){},s.post||function(){},e,"",e)};function t(r,s,n,o,i,a,c,l,u,d){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var p in s(o,i,a,c,l,u,d),o){var f=o[p];if(Array.isArray(f)){if(p in e.arrayKeywords)for(var m=0;mr+=i(e))),r===1/0))return 1/0}return r}function a(e,t="",r){!1!==r&&(t=u(t));const s=e.parse(t);return c(e,s)}function c(e,t){return e.serialize(t).split("#")[0]+"#"}he.getFullPath=a,he._getFullPath=c;const l=/#\/?$/;function u(e){return e?e.replace(l,""):""}he.normalizeId=u,he.resolveUrl=function(e,t,r){return r=u(r),e.resolve(t,r)};const d=/^[a-z_][-a-z0-9._]*$/i;return he.getSchemaRefs=function(e,s){if("boolean"==typeof e)return{};const{schemaId:n,uriResolver:o}=this.opts,i=u(e[n]||s),c={"":i},l=a(o,i,!1),p={},f=new Set;return r(e,{allKeys:!0},((e,t,r,s)=>{if(void 0===s)return;const o=l+t;let i=c[s];function a(t){const r=this.opts.uriResolver.resolve;if(t=u(i?r(i,t):t),f.has(t))throw h(t);f.add(t);let s=this.refs[t];return"string"==typeof s&&(s=this.refs[s]),"object"==typeof s?m(e,s.schema,t):t!==u(o)&&("#"===t[0]?(m(e,p[t],t),p[t]=e):this.refs[t]=o),t}function y(e){if("string"==typeof e){if(!d.test(e))throw new Error(`invalid anchor "${e}"`);a.call(this,`#${e}`)}}"string"==typeof e[n]&&(i=a.call(this,e[n])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),c[t]=i})),p;function m(e,r,s){if(void 0!==r&&!t(e,r))throw h(s)}function h(e){return new Error(`reference "${e}" resolves to more than one schema`)}},he}function Pe(){if($e)return x;$e=1,Object.defineProperty(x,"__esModule",{value:!0}),x.getData=x.KeywordCxt=x.validateFunctionCode=void 0;const e=function(){if(K)return N;K=1,Object.defineProperty(N,"__esModule",{value:!0}),N.boolOrEmptySchema=N.topBoolOrEmptySchema=void 0;const e=H(),t=q(),r=B(),s={message:"boolean schema is false"};function n(t,r){const{gen:n,data:o}=t,i={gen:n,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,e.reportError)(i,s,void 0,r)}return N.topBoolOrEmptySchema=function(e){const{gen:s,schema:o,validateName:i}=e;!1===o?n(e,!1):"object"==typeof o&&!0===o.$async?s.return(r.default.data):(s.assign(t._`${i}.errors`,null),s.return(!0))},N.boolOrEmptySchema=function(e,t){const{gen:r,schema:s}=e;!1===s?(r.var(t,!1),n(e)):r.var(t,!0)},N}(),t=re(),r=te(),s=re(),n=function(){if(se)return ne;se=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.assignDefaults=void 0;const e=q(),t=U();function r(r,s,n){const{gen:o,compositeRule:i,data:a,opts:c}=r;if(void 0===n)return;const l=e._`${a}${(0,e.getProperty)(s)}`;if(i)return void(0,t.checkStrictMode)(r,`default is ignored for: ${l}`);let u=e._`${l} === undefined`;"empty"===c.useDefaults&&(u=e._`${u} || ${l} === null || ${l} === ""`),o.if(u,e._`${l} = ${(0,e.stringify)(n)}`)}return ne.assignDefaults=function(e,t){const{properties:s,items:n}=e.schema;if("object"===t&&s)for(const t in s)r(e,t,s[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,s)=>r(e,s,t.default)))},ne}(),o=ue(),i=function(){if(de)return pe;de=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.extendSubschemaMode=pe.extendSubschemaData=pe.getSubschema=void 0;const e=q(),t=U();return pe.getSubschema=function(r,{keyword:s,schemaProp:n,schema:o,schemaPath:i,errSchemaPath:a,topSchemaRef:c}){if(void 0!==s&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==s){const o=r.schema[s];return void 0===n?{schema:o,schemaPath:e._`${r.schemaPath}${(0,e.getProperty)(s)}`,errSchemaPath:`${r.errSchemaPath}/${s}`}:{schema:o[n],schemaPath:e._`${r.schemaPath}${(0,e.getProperty)(s)}${(0,e.getProperty)(n)}`,errSchemaPath:`${r.errSchemaPath}/${s}/${(0,t.escapeFragment)(n)}`}}if(void 0!==o){if(void 0===i||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:i,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},pe.extendSubschemaData=function(r,s,{dataProp:n,dataPropType:o,data:i,dataTypes:a,propertyName:c}){if(void 0!==i&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=s;if(void 0!==n){const{errorPath:i,dataPathArr:a,opts:c}=s;u(l.let("data",e._`${s.data}${(0,e.getProperty)(n)}`,!0)),r.errorPath=e.str`${i}${(0,t.getErrorPath)(n,o,c.jsPropertySyntax)}`,r.parentDataProperty=e._`${n}`,r.dataPathArr=[...a,r.parentDataProperty]}function u(e){r.data=e,r.dataLevel=s.dataLevel+1,r.dataTypes=[],s.definedProperties=new Set,r.parentData=s.data,r.dataNames=[...s.dataNames,e]}void 0!==i&&(u(i instanceof e.Name?i:l.let("data",i,!0)),void 0!==c&&(r.propertyName=c)),a&&(r.dataTypes=a)},pe.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:s,createErrors:n,allErrors:o}){void 0!==s&&(e.compositeRule=s),void 0!==n&&(e.createErrors=n),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r},pe}(),a=q(),c=B(),l=we(),u=U(),d=H();function p({gen:e,validateName:t,schema:r,schemaEnv:s,opts:n},o){n.code.es5?e.func(t,a._`${c.default.data}, ${c.default.valCxt}`,s.$async,(()=>{e.code(a._`"use strict"; ${f(r,n)}`),function(e,t){e.if(c.default.valCxt,(()=>{e.var(c.default.instancePath,a._`${c.default.valCxt}.${c.default.instancePath}`),e.var(c.default.parentData,a._`${c.default.valCxt}.${c.default.parentData}`),e.var(c.default.parentDataProperty,a._`${c.default.valCxt}.${c.default.parentDataProperty}`),e.var(c.default.rootData,a._`${c.default.valCxt}.${c.default.rootData}`),t.dynamicRef&&e.var(c.default.dynamicAnchors,a._`${c.default.valCxt}.${c.default.dynamicAnchors}`)}),(()=>{e.var(c.default.instancePath,a._`""`),e.var(c.default.parentData,a._`undefined`),e.var(c.default.parentDataProperty,a._`undefined`),e.var(c.default.rootData,c.default.data),t.dynamicRef&&e.var(c.default.dynamicAnchors,a._`{}`)}))}(e,n),e.code(o)})):e.func(t,a._`${c.default.data}, ${function(e){return a._`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${e.dynamicRef?a._`, ${c.default.dynamicAnchors}={}`:a.nil}}={}`}(n)}`,s.$async,(()=>e.code(f(r,n)).code(o)))}function f(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?a._`/*# sourceURL=${r} */`:a.nil}function m(t,r){y(t)&&(g(t),h(t))?function(e,t){const{schema:r,gen:s,opts:n}=e;n.$comment&&r.$comment&&$(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,l.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=s.const("_errs",c.default.errors);v(e,o),s.var(t,a._`${o} === ${c.default.errors}`)}(t,r):(0,e.boolOrEmptySchema)(t,r)}function h({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function g(e){(0,u.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:s,self:n}=e;t.$ref&&s.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(t,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,r){if(e.opts.jtd)return b(e,[],!1,r);const s=(0,t.getSchemaTypes)(e.schema);b(e,s,!(0,t.coerceAndCheckDataType)(e,s),r)}function $({gen:e,schemaEnv:t,schema:r,errSchemaPath:s,opts:n}){const o=r.$comment;if(!0===n.$comment)e.code(a._`${c.default.self}.logger.log(${o})`);else if("function"==typeof n.$comment){const r=a.str`${s}/$comment`,n=e.scopeValue("root",{ref:t.root});e.code(a._`${c.default.self}.opts.$comment(${o}, ${r}, ${n}.schema)`)}}function b(e,t,n,o){const{gen:i,schema:l,data:d,allErrors:p,opts:f,self:m}=e,{RULES:h}=m;function y(u){(0,r.shouldUseGroup)(l,u)&&(u.type?(i.if((0,s.checkDataType)(u.type,d,f.strictNumbers)),_(e,u),1===t.length&&t[0]===u.type&&n&&(i.else(),(0,s.reportTypeError)(e)),i.endIf()):_(e,u),p||i.if(a._`${c.default.errors} === ${o||0}`))}!l.$ref||!f.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(l,h)?(f.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{P(e.dataTypes,t)||S(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const s of e.dataTypes)P(t,s)?r.push(s):t.includes("integer")&&"number"===s&&r.push("integer");e.dataTypes=r}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&S(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const s=e.self.RULES.all;for(const n in s){const o=s[n];if("object"==typeof o&&(0,r.shouldUseRule)(e.schema,o)){const{type:r}=o.definition;r.length&&!r.some((e=>w(t,e)))&&S(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),i.block((()=>{for(const e of h.rules)y(e);y(h.post)}))):i.block((()=>E(e,"$ref",h.all.$ref.definition)))}function _(e,t){const{gen:s,schema:o,opts:{useDefaults:i}}=e;i&&(0,n.assignDefaults)(e,t.type),s.block((()=>{for(const s of t.rules)(0,r.shouldUseRule)(o,s)&&E(e,s.keyword,s.definition,t.type)}))}function w(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function P(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,u.checkStrictMode)(e,t,e.opts.strictTypes)}x.validateFunctionCode=function(t){y(t)&&(g(t),h(t))?function(e){const{schema:t,opts:r,gen:s}=e;p(e,(()=>{r.$comment&&t.$comment&&$(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,u.checkStrictMode)(e,"default is ignored in the schema root")}(e),s.let(c.default.vErrors,null),s.let(c.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",a._`${r}.evaluated`),t.if(a._`${e.evaluated}.dynamicProps`,(()=>t.assign(a._`${e.evaluated}.props`,a._`undefined`))),t.if(a._`${e.evaluated}.dynamicItems`,(()=>t.assign(a._`${e.evaluated}.items`,a._`undefined`)))}(e),v(e),function(e){const{gen:t,schemaEnv:r,validateName:s,ValidationError:n,opts:o}=e;r.$async?t.if(a._`${c.default.errors} === 0`,(()=>t.return(c.default.data)),(()=>t.throw(a._`new ${n}(${c.default.vErrors})`))):(t.assign(a._`${s}.errors`,c.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:s}){r instanceof a.Name&&e.assign(a._`${t}.props`,r);s instanceof a.Name&&e.assign(a._`${t}.items`,s)}(e),t.return(a._`${c.default.errors} === 0`))}(e)}))}(t):p(t,(()=>(0,e.topBoolOrEmptySchema)(t)))};class k{constructor(e,t,r){if((0,o.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",O(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",c.default.errors))}result(e,t,r){this.failResult((0,a.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,a.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(a._`${t} !== undefined && (${(0,a.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?d.reportExtraError:d.reportError)(this,this.def.error,t)}$dataError(){(0,d.reportError)(this,this.def.$dataError||d.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,d.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=a.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=a.nil,t=a.nil){if(!this.$data)return;const{gen:r,schemaCode:s,schemaType:n,def:o}=this;r.if((0,a.or)(a._`${s} === undefined`,t)),e!==a.nil&&r.assign(e,!0),(n.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==a.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:o}=this;return(0,a.or)(function(){if(r.length){if(!(t instanceof a.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return a._`${(0,s.checkDataTypes)(e,t,o.opts.strictNumbers,s.DataType.Wrong)}`}return a.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return a._`!${r}(${t})`}return a.nil}())}subschema(e,t){const r=(0,i.getSubschema)(this.it,e);(0,i.extendSubschemaData)(r,this.it,e),(0,i.extendSubschemaMode)(r,e);const s={...this.it,...r,items:void 0,props:void 0};return m(s,t),s}mergeEvaluated(e,t){const{it:r,gen:s}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=u.mergeEvaluated.props(s,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=u.mergeEvaluated.items(s,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:s}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return s.if(t,(()=>this.mergeEvaluated(e,a.Name))),!0}}function E(e,t,r,s){const n=new k(e,r,t);"code"in r?r.code(n,s):n.$data&&r.validate?(0,o.funcKeywordCode)(n,r):"macro"in r?(0,o.macroKeywordCode)(n,r):(r.compile||r.validate)&&(0,o.funcKeywordCode)(n,r)}x.KeywordCxt=k;const j=/^\/(?:[^~]|~0|~1)*$/,C=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function O(e,{dataLevel:t,dataNames:r,dataPathArr:s}){let n,o;if(""===e)return c.default.rootData;if("/"===e[0]){if(!j.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);n=e,o=c.default.rootData}else{const i=C.exec(e);if(!i)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+i[1];if(n=i[2],"#"===n){if(a>=t)throw new Error(d("property/index",a));return s[t-a]}if(a>t)throw new Error(d("data",a));if(o=r[t-a],!n)return o}let i=o;const l=n.split("/");for(const e of l)e&&(o=a._`${o}${(0,a.getProperty)((0,u.unescapeJsonPointer)(e))}`,i=a._`${i} && ${o}`);return i;function d(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}return x.getData=O,x}var Se,ke={};function Ee(){if(Se)return ke;Se=1,Object.defineProperty(ke,"__esModule",{value:!0});class e extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}return ke.default=e,ke}var je,xe={};function Ne(){if(je)return xe;je=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=we();class t extends Error{constructor(t,r,s,n){super(n||`can't resolve reference ${s} from id ${r}`),this.missingRef=(0,e.resolveUrl)(t,r,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(t,this.missingRef))}}return xe.default=t,xe}var Ce,Oe={};function Ie(){if(Ce)return Oe;Ce=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.resolveSchema=Oe.getCompilingSchema=Oe.resolveRef=Oe.compileSchema=Oe.SchemaEnv=void 0;const e=q(),t=Ee(),r=B(),s=we(),n=U(),o=Pe();class i{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function a(n){const i=l.call(this,n);if(i)return i;const a=(0,s.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:c,lines:u}=this.opts.code,{ownProperties:d}=this.opts,p=new e.CodeGen(this.scope,{es5:c,lines:u,ownProperties:d});let f;n.$async&&(f=p.scopeValue("Error",{ref:t.default,code:e._`require("ajv/dist/runtime/validation_error").default`}));const m=p.scopeName("validate");n.validateName=m;const h={gen:p,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:[],definedProperties:new Set,topSchemaRef:p.scopeValue("schema",!0===this.opts.code.source?{ref:n.schema,code:(0,e.stringify)(n.schema)}:{ref:n.schema}),validateName:m,ValidationError:f,schema:n.schema,schemaEnv:n,rootId:a,baseId:n.baseId||a,schemaPath:e.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:e._`""`,opts:this.opts,self:this};let y;try{this._compilations.add(n),(0,o.validateFunctionCode)(h),p.optimize(this.opts.code.optimize);const t=p.toString();y=`${p.scopeRefs(r.default.scope)}return ${t}`,this.opts.code.process&&(y=this.opts.code.process(y,n));const s=new Function(`${r.default.self}`,`${r.default.scope}`,y)(this,this.scope.get());if(this.scope.value(m,{ref:s}),s.errors=null,s.schema=n.schema,s.schemaEnv=n,n.$async&&(s.$async=!0),!0===this.opts.code.source&&(s.source={validateName:m,validateCode:t,scopeValues:p._values}),this.opts.unevaluated){const{props:t,items:r}=h;s.evaluated={props:t instanceof e.Name?void 0:t,items:r instanceof e.Name?void 0:r,dynamicProps:t instanceof e.Name,dynamicItems:r instanceof e.Name},s.source&&(s.source.evaluated=(0,e.stringify)(s.evaluated))}return n.validate=s,n}catch(e){throw delete n.validate,delete n.validateName,y&&this.logger.error("Error compiling schema, function code:",y),e}finally{this._compilations.delete(n)}}function c(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:a.call(this,e)}function l(e){for(const s of this._compilations)if(r=e,(t=s).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return s;var t,r}function u(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||d.call(this,e,t)}function d(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let o=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return f.call(this,r,e);const c=(0,s.normalizeId)(n),l=this.refs[c]||this.schemas[c];if("string"==typeof l){const t=d.call(this,e,l);if("object"!=typeof(null==t?void 0:t.schema))return;return f.call(this,r,t)}if("object"==typeof(null==l?void 0:l.schema)){if(l.validate||a.call(this,l),c===(0,s.normalizeId)(t)){const{schema:t}=l,{schemaId:r}=this.opts,n=t[r];return n&&(o=(0,s.resolveUrl)(this.opts.uriResolver,o,n)),new i({schema:t,schemaId:r,root:e,baseId:o})}return f.call(this,r,l)}}Oe.SchemaEnv=i,Oe.compileSchema=a,Oe.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const o=e.refs[r];if(o)return o;let a=u.call(this,e,r);if(void 0===a){const s=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:o}=this.opts;s&&(a=new i({schema:s,schemaId:o,root:e,baseId:t}))}return void 0!==a?e.refs[r]=c.call(this,a):void 0},Oe.getCompilingSchema=l,Oe.resolveSchema=d;const p=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function f(e,{baseId:t,schema:r,root:o}){var a;if("/"!==(null===(a=e.fragment)||void 0===a?void 0:a[0]))return;for(const o of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,n.unescapeFragment)(o)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!p.has(o)&&i&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,i))}let c;if("boolean"!=typeof r&&r.$ref&&!(0,n.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);c=d.call(this,o,e)}const{schemaId:l}=this.opts;return c=c||new i({schema:r,schemaId:l,root:o,baseId:t}),c.schema!==c.root.schema?c:void 0}return Oe}var Re,Me,Te,Ae,De,qe,Ve,ze,Ue,Le={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1},Fe={},Ke={exports:{}};function Ge(){if(Ae)return Te;Ae=1;const{HEX:e}=Me?Re:(Me=1,Re={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,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}});function t(e){if(o(e,".")<3)return{host:e,isIPV4:!1};const t=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[r]=t;return r?{host:n(r,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function r(t,r=!1){let s="",n=!0;for(const r of t){if(void 0===e[r])return;"0"!==r&&!0===n&&(n=!1),n||(s+=r)}return r&&0===s.length&&(s="0"),s}function s(e,t={}){if(o(e,":")<2)return{host:e,isIPV6:!1};const s=function(e){let t=0;const s={error:!1,address:"",zone:""},n=[],o=[];let i=!1,a=!1,c=!1;function l(){if(o.length){if(!1===i){const e=r(o);if(void 0===e)return s.error=!0,!1;n.push(e)}o.length=0}return!0}for(let r=0;r7){s.error=!0;break}r-1>=0&&":"===e[r-1]&&(a=!0)}}return o.length&&(i?s.zone=o.join(""):c?n.push(o.join("")):n.push(r(o))),s.address=n.join(""),s}(e);if(s.error)return{host:e,isIPV6:!1};{let e=s.address,t=s.address;return s.zone&&(e+="%"+s.zone,t+="%25"+s.zone),{host:e,escapedHost:t,isIPV6:!0}}}function n(e,t){let r="",s=!0;const n=e.length;for(let o=0;o/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t))));const l=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function u(r,s){const n=Object.assign({},s),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},a=-1!==r.indexOf("%");let u=!1;"suffix"===n.reference&&(r=(n.scheme?n.scheme+":":"")+"//"+r);const d=r.match(l);if(d){if(i.scheme=d[1],i.userinfo=d[3],i.host=d[4],i.port=parseInt(d[5],10),i.path=d[6]||"",i.query=d[7],i.fragment=d[8],isNaN(i.port)&&(i.port=d[5]),i.host){const r=t(i.host);if(!1===r.isIPV4){const t=e(r.host,{isIPV4:!1});i.host=t.host.toLowerCase(),u=t.isIPV6}else i.host=r.host,u=!0}void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||i.path||void 0!==i.query?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",n.reference&&"suffix"!==n.reference&&n.reference!==i.reference&&(i.error=i.error||"URI is not a "+n.reference+" reference.");const r=o[(n.scheme||i.scheme||"").toLowerCase()];if(!(n.unicodeSupport||r&&r.unicodeSupport)&&i.host&&(n.domainHost||r&&r.domainHost)&&!1===u&&function(e){let t=0;for(let r=0,s=e.length;r126||c[t])return!0;return!1}(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||"Host's domain name can not be converted to ASCII: "+e}(!r||r&&!r.skipNormalize)&&(a&&void 0!==i.scheme&&(i.scheme=unescape(i.scheme)),a&&void 0!==i.userinfo&&(i.userinfo=unescape(i.userinfo)),a&&void 0!==i.host&&(i.host=unescape(i.host)),void 0!==i.path&&i.path.length&&(i.path=escape(unescape(i.path))),void 0!==i.fragment&&i.fragment.length&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),r&&r.parse&&r.parse(i,n)}else i.error=i.error||"URI can not be parsed.";return i}const d={SCHEMES:o,normalize:function(e,t){return"string"==typeof e?e=a(u(e,t),t):"object"==typeof e&&(e=u(a(e,t),t)),e},resolve:function(e,t,r){const s=Object.assign({scheme:"null"},r);return a(i(u(e,s),u(t,s),s,!0),{...s,skipEscape:!0})},resolveComponents:i,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=a(n(u(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=a(n(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=a(n(u(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=a(n(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:a,parse:u};return Ke.exports=d,Ke.exports.default=d,Ke.exports.fastUri=d,Ke.exports}function He(){return Ue||(Ue=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=Pe();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=q();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const s=Ee(),n=Ne(),o=Q(),i=Ie(),a=q(),c=we(),l=re(),u=U(),d=Le,p=function(){if(ze)return Fe;ze=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=Be();return e.code='require("ajv/dist/runtime/uri").default',Fe.default=e,Fe}(),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";const m=["removeAdditional","useDefaults","coerceTypes"],h=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,r,s,n,o,i,a,c,l,u,d,m,h,y,g,v,$,b,_,w,P,S,k,E,j;const x=e.strict,N=null===(t=e.code)||void 0===t?void 0:t.optimize,C=!0===N||void 0===N?1:N||0,O=null!==(s=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==s?s:f,I=null!==(n=e.uriResolver)&&void 0!==n?n:p.default;return{strictSchema:null===(i=null!==(o=e.strictSchema)&&void 0!==o?o:x)||void 0===i||i,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:x)||void 0===c||c,strictTypes:null!==(u=null!==(l=e.strictTypes)&&void 0!==l?l:x)&&void 0!==u?u:"log",strictTuples:null!==(m=null!==(d=e.strictTuples)&&void 0!==d?d:x)&&void 0!==m?m:"log",strictRequired:null!==(y=null!==(h=e.strictRequired)&&void 0!==h?h:x)&&void 0!==y&&y,code:e.code?{...e.code,optimize:C,regExp:O}:{optimize:C,regExp:O},loopRequired:null!==(g=e.loopRequired)&&void 0!==g?g:200,loopEnum:null!==(v=e.loopEnum)&&void 0!==v?v:200,meta:null===($=e.meta)||void 0===$||$,messages:null===(b=e.messages)||void 0===b||b,inlineRefs:null===(_=e.inlineRefs)||void 0===_||_,schemaId:null!==(w=e.schemaId)&&void 0!==w?w:"$id",addUsedSchema:null===(P=e.addUsedSchema)||void 0===P||P,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(k=e.validateFormats)||void 0===k||k,unicodeRegExp:null===(E=e.unicodeRegExp)||void 0===E||E,int32range:null===(j=e.int32range)||void 0===j||j,uriResolver:I}}class ${constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:h,es5:t,lines:r}),this.logger=function(e){if(!1===e)return E;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),b.call(this,y,e,"NOT SUPPORTED"),b.call(this,g,e,"DEPRECATED","warn"),this._metaOpts=k.call(this),e.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),w.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let s=d;"id"===r&&(s={...d},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const s=r(t);return"$async"in r||(this.errors=r.errors),s}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return s.call(this,e,t);async function s(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||i.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await s.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof n.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await l.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,s);return this}let n;if("object"==typeof e){const{schemaId:t}=this.opts;if(n=e[t],void 0!==n&&"string"!=typeof n)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||n),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const s=this.validate(r,e);if(!s&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return s}getSchema(e){let t;for(;"string"==typeof(t=_.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,s=new i.SchemaEnv({schema:{},schemaId:r});if(t=i.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=_.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(x.call(this,r,t),!t)return(0,u.eachItem)(r,(e=>N.call(this,e))),this;O.call(this,t);const s={...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)};return(0,u.eachItem)(r,0===s.type.length?e=>N.call(this,e,s):e=>s.type.forEach((t=>N.call(this,e,s,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const s of t){const t=s.split("/").slice(1);let n=e;for(const e of t)n=n[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:s}=t.definition,o=n[e];s&&o&&(n[e]=R(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const s=e[r];t&&!t.test(r)||("string"==typeof s?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,t,r,s=this.opts.validateSchema,n=this.opts.addUsedSchema){let o;const{schemaId:a}=this.opts;if("object"==typeof e)o=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let l=this._cache.get(e);if(void 0!==l)return l;r=(0,c.normalizeId)(o||r);const u=c.getSchemaRefs.call(this,e,r);return l=new i.SchemaEnv({schema:e,schemaId:a,meta:t,baseId:r,localRefs:u}),this._cache.set(l.schema,l),n&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=l),s&&this.validateSchema(e,!0),l}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):i.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,e)}finally{this.opts=t}}}function b(e,t,r,s="error"){for(const n in e){const o=n;o in t&&this.logger[s](`${r}: option ${n}. ${e[o]}`)}}function _(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function w(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function P(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function k(){const e={...this.opts};for(const t of m)delete e[t];return e}$.ValidationError=s.default,$.MissingRefError=n.default,e.default=$;const E={log(){},warn(){},error(){}};const j=/^[a-z_$][a-z0-9_$:-]*$/i;function x(e,t){const{RULES:r}=this;if((0,u.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!j.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function N(e,t,r){var s;const n=null==t?void 0:t.post;if(r&&n)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let i=n?o.post:o.rules.find((({type:e})=>e===r));if(i||(i={type:r,rules:[]},o.rules.push(i)),o.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,l.getJSONTypes)(t.type),schemaType:(0,l.getJSONTypes)(t.schemaType)}};t.before?C.call(this,i,a,t.before):i.rules.push(a),o.all[e]=a,null===(s=t.implements)||void 0===s||s.forEach((e=>this.addKeyword(e)))}function C(e,t,r){const s=e.rules.findIndex((e=>e.keyword===r));s>=0?e.rules.splice(s,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function O(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=R(t)),e.validateSchema=this.compile(t,!0))}const I={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function R(e){return{anyOf:[e,I]}}}(j)),j}var Je,We={},Ze={},Qe={};var Xe,Ye,et={};function tt(){if(Xe)return et;Xe=1,Object.defineProperty(et,"__esModule",{value:!0}),et.callRef=et.getValidate=void 0;const e=Ne(),t=le(),r=q(),s=B(),n=Ie(),o=U(),i={keyword:"$ref",schemaType:"string",code(t){const{gen:s,schema:o,it:i}=t,{baseId:l,schemaEnv:u,validateName:d,opts:p,self:f}=i,{root:m}=u;if(("#"===o||"#/"===o)&&l===m.baseId)return function(){if(u===m)return c(t,d,u,u.$async);const e=s.scopeValue("root",{ref:m});return c(t,r._`${e}.validate`,m,m.$async)}();const h=n.resolveRef.call(f,m,l,o);if(void 0===h)throw new e.default(i.opts.uriResolver,l,o);return h instanceof n.SchemaEnv?function(e){const r=a(t,e);c(t,r,e,e.$async)}(h):function(e){const n=s.scopeValue("schema",!0===p.code.source?{ref:e,code:(0,r.stringify)(e)}:{ref:e}),i=s.name("valid"),a=t.subschema({schema:e,dataTypes:[],schemaPath:r.nil,topSchemaRef:n,errSchemaPath:o},i);t.mergeEvaluated(a),t.ok(i)}(h)}};function a(e,t){const{gen:s}=e;return t.validate?s.scopeValue("validate",{ref:t.validate}):r._`${s.scopeValue("wrapper",{ref:t})}.validate`}function c(e,n,i,a){const{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:p}=l,f=p.passContext?s.default.this:r.nil;function m(e){const t=r._`${e}.errors`;c.assign(s.default.vErrors,r._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),c.assign(s.default.errors,r._`${s.default.vErrors}.length`)}function h(e){var t;if(!l.opts.unevaluated)return;const s=null===(t=null==i?void 0:i.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(s&&!s.dynamicProps)void 0!==s.props&&(l.props=o.mergeEvaluated.props(c,s.props,l.props));else{const t=c.var("props",r._`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}if(!0!==l.items)if(s&&!s.dynamicItems)void 0!==s.items&&(l.items=o.mergeEvaluated.items(c,s.items,l.items));else{const t=c.var("items",r._`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}a?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const s=c.let("valid");c.try((()=>{c.code(r._`await ${(0,t.callValidateCode)(e,n,f)}`),h(n),u||c.assign(s,!0)}),(e=>{c.if(r._`!(${e} instanceof ${l.ValidationError})`,(()=>c.throw(e))),m(e),u||c.assign(s,!1)})),e.ok(s)}():e.result((0,t.callValidateCode)(e,n,f),(()=>h(n)),(()=>m(n)))}return et.getValidate=a,et.callRef=c,et.default=i,et}function rt(){if(Ye)return Ze;Ye=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=function(){if(Je)return Qe;Je=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Qe.default=e,Qe}(),t=tt(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Ze.default=r,Ze}var st,nt={},ot={};var it,at={};var ct,lt,ut={},dt={};function pt(){if(lt)return ut;lt=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=q(),t=U(),r=function(){if(ct)return dt;function e(e){const t=e.length;let r,s=0,n=0;for(;n=55296&&r<=56319&&ne._`{limit: ${t}}`},n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:s,code(s){const{keyword:n,data:o,schemaCode:i,it:a}=s,c="maxLength"===n?e.operators.GT:e.operators.LT,l=!1===a.opts.unicode?e._`${o}.length`:e._`${(0,t.useFunc)(s.gen,r.default)}(${o})`;s.fail$data(e._`${l} ${c} ${i}`)}};return ut.default=n,ut}var ft,mt={};var ht,yt={};var gt,vt={};function $t(){if(gt)return vt;gt=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=le(),t=q(),r=U(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>t.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>t._`{missingProperty: ${e}}`},code(s){const{gen:n,schema:o,schemaCode:i,data:a,$data:c,it:l}=s,{opts:u}=l;if(!c&&0===o.length)return;const d=o.length>=u.loopRequired;if(l.allErrors?function(){if(d||c)s.block$data(t.nil,p);else for(const t of o)(0,e.checkReportMissingProp)(s,t)}():function(){const r=n.let("missing");if(d||c){const o=n.let("valid",!0);s.block$data(o,(()=>function(r,o){s.setParams({missingProperty:r}),n.forOf(r,i,(()=>{n.assign(o,(0,e.propertyInData)(n,a,r,u.ownProperties)),n.if((0,t.not)(o),(()=>{s.error(),n.break()}))}),t.nil)}(r,o))),s.ok(o)}else n.if((0,e.checkMissingProp)(s,o,r)),(0,e.reportMissingProp)(s,r),n.else()}(),u.strictRequired){const e=s.parentSchema.properties,{definedProperties:t}=s.it;for(const s of o)if(void 0===(null==e?void 0:e[s])&&!t.has(s)){const e=`required property "${s}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,e,l.opts.strictRequired)}}function p(){n.forOf("prop",i,(t=>{s.setParams({missingProperty:t}),n.if((0,e.noPropertyInData)(n,a,t,u.ownProperties),(()=>s.error()))}))}}};return vt.default=s,vt}var bt,_t={};var wt,Pt,St={},kt={};function Et(){if(wt)return kt;wt=1,Object.defineProperty(kt,"__esModule",{value:!0});const e=ye();return e.code='require("ajv/dist/runtime/equal").default',kt.default=e,kt}function jt(){if(Pt)return St;Pt=1,Object.defineProperty(St,"__esModule",{value:!0});const e=re(),t=q(),r=U(),s=Et(),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:r}})=>t.str`must NOT have duplicate items (items ## ${r} and ${e} are identical)`,params:({params:{i:e,j:r}})=>t._`{i: ${e}, j: ${r}}`},code(n){const{gen:o,data:i,$data:a,schema:c,parentSchema:l,schemaCode:u,it:d}=n;if(!a&&!c)return;const p=o.let("valid"),f=l.items?(0,e.getSchemaTypes)(l.items):[];function m(r,s){const a=o.name("item"),c=(0,e.checkDataTypes)(f,a,d.opts.strictNumbers,e.DataType.Wrong),l=o.const("indices",t._`{}`);o.for(t._`;${r}--;`,(()=>{o.let(a,t._`${i}[${r}]`),o.if(c,t._`continue`),f.length>1&&o.if(t._`typeof ${a} == "string"`,t._`${a} += "_"`),o.if(t._`typeof ${l}[${a}] == "number"`,(()=>{o.assign(s,t._`${l}[${a}]`),n.error(),o.assign(p,!1).break()})).code(t._`${l}[${a}] = ${r}`)}))}function h(e,a){const c=(0,r.useFunc)(o,s.default),l=o.name("outer");o.label(l).for(t._`;${e}--;`,(()=>o.for(t._`${a} = ${e}; ${a}--;`,(()=>o.if(t._`${c}(${i}[${e}], ${i}[${a}])`,(()=>{n.error(),o.assign(p,!1).break(l)}))))))}n.block$data(p,(function(){const e=o.let("i",t._`${i}.length`),r=o.let("j");n.setParams({i:e,j:r}),o.assign(p,!0),o.if(t._`${e} > 1`,(()=>(f.length>0&&!f.some((e=>"object"===e||"array"===e))?m:h)(e,r)))}),t._`${u} === false`),n.ok(p)}};return St.default=n,St}var xt,Nt={};var Ct,Ot,It={};function Rt(){if(Ct)return It;Ct=1,Object.defineProperty(It,"__esModule",{value:!0});const e=q(),t=U(),r=Et(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>e._`{allowedValues: ${t}}`},code(s){const{gen:n,data:o,$data:i,schema:a,schemaCode:c,it:l}=s;if(!i&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=l.opts.loopEnum;let d;const p=()=>null!=d?d:d=(0,t.useFunc)(n,r.default);let f;if(u||i)f=n.let("valid"),s.block$data(f,(function(){n.assign(f,!1),n.forOf("v",c,(t=>n.if(e._`${p()}(${o}, ${t})`,(()=>n.assign(f,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const t=n.const("vSchema",c);f=(0,e.or)(...a.map(((r,s)=>function(t,r){const s=a[r];return"object"==typeof s&&null!==s?e._`${p()}(${o}, ${t}[${r}])`:e._`${o} === ${s}`}(t,s))))}s.pass(f)}};return It.default=s,It}function Mt(){if(Ot)return nt;Ot=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=function(){if(st)return ot;st=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=q(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},s={message:({keyword:t,schemaCode:s})=>e.str`must be ${r[t].okStr} ${s}`,params:({keyword:t,schemaCode:s})=>e._`{comparison: ${r[t].okStr}, limit: ${s}}`},n={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:s,code(t){const{keyword:s,data:n,schemaCode:o}=t;t.fail$data(e._`${n} ${r[s].fail} ${o} || isNaN(${n})`)}};return ot.default=n,ot}(),t=function(){if(it)return at;it=1,Object.defineProperty(at,"__esModule",{value:!0});const e=q(),t={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>e.str`must be multiple of ${t}`,params:({schemaCode:t})=>e._`{multipleOf: ${t}}`},code(t){const{gen:r,data:s,schemaCode:n,it:o}=t,i=o.opts.multipleOfPrecision,a=r.let("res"),c=i?e._`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:e._`${a} !== parseInt(${a})`;t.fail$data(e._`(${n} === 0 || (${a} = ${s}/${n}, ${c}))`)}};return at.default=t,at}(),r=pt(),s=function(){if(ft)return mt;ft=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=le(),t=q(),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>t.str`must match pattern "${e}"`,params:({schemaCode:e})=>t._`{pattern: ${e}}`},code(r){const{data:s,$data:n,schema:o,schemaCode:i,it:a}=r,c=a.opts.unicodeRegExp?"u":"",l=n?t._`(new RegExp(${i}, ${c}))`:(0,e.usePattern)(r,o);r.fail$data(t._`!${l}.test(${s})`)}};return mt.default=r,mt}(),n=function(){if(ht)return yt;ht=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=q(),t={message({keyword:t,schemaCode:r}){const s="maxProperties"===t?"more":"fewer";return e.str`must NOT have ${s} than ${r} properties`},params:({schemaCode:t})=>e._`{limit: ${t}}`},r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:t,code(t){const{keyword:r,data:s,schemaCode:n}=t,o="maxProperties"===r?e.operators.GT:e.operators.LT;t.fail$data(e._`Object.keys(${s}).length ${o} ${n}`)}};return yt.default=r,yt}(),o=$t(),i=function(){if(bt)return _t;bt=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=q(),t={message({keyword:t,schemaCode:r}){const s="maxItems"===t?"more":"fewer";return e.str`must NOT have ${s} than ${r} items`},params:({schemaCode:t})=>e._`{limit: ${t}}`},r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:t,code(t){const{keyword:r,data:s,schemaCode:n}=t,o="maxItems"===r?e.operators.GT:e.operators.LT;t.fail$data(e._`${s}.length ${o} ${n}`)}};return _t.default=r,_t}(),a=jt(),c=function(){if(xt)return Nt;xt=1,Object.defineProperty(Nt,"__esModule",{value:!0});const e=q(),t=U(),r=Et(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>e._`{allowedValue: ${t}}`},code(s){const{gen:n,data:o,$data:i,schemaCode:a,schema:c}=s;i||c&&"object"==typeof c?s.fail$data(e._`!${(0,t.useFunc)(n,r.default)}(${o}, ${a})`):s.fail(e._`${c} !== ${o}`)}};return Nt.default=s,Nt}(),l=Rt(),u=[e.default,t.default,r.default,s.default,n.default,o.default,i.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return nt.default=u,nt}var Tt,At={},Dt={};function qt(){if(Tt)return Dt;Tt=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.validateAdditionalItems=void 0;const e=q(),t=U(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:t}})=>e.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>e._`{limit: ${t}}`},code(e){const{parentSchema:r,it:n}=e,{items:o}=r;Array.isArray(o)?s(e,o):(0,t.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(r,s){const{gen:n,schema:o,data:i,keyword:a,it:c}=r;c.items=!0;const l=n.const("len",e._`${i}.length`);if(!1===o)r.setParams({len:s.length}),r.pass(e._`${l} <= ${s.length}`);else if("object"==typeof o&&!(0,t.alwaysValidSchema)(c,o)){const o=n.var("valid",e._`${l} <= ${s.length}`);n.if((0,e.not)(o),(()=>function(o){n.forRange("i",s.length,l,(s=>{r.subschema({keyword:a,dataProp:s,dataPropType:t.Type.Num},o),c.allErrors||n.if((0,e.not)(o),(()=>n.break()))}))}(o))),r.ok(o)}}return Dt.validateAdditionalItems=s,Dt.default=r,Dt}var Vt,zt,Ut={},Lt={};function Ft(){if(Vt)return Lt;Vt=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.validateTuple=void 0;const e=q(),t=U(),r=le(),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:s,it:o}=e;if(Array.isArray(s))return n(e,"additionalItems",s);o.items=!0,(0,t.alwaysValidSchema)(o,s)||e.ok((0,r.validateArray)(e))}};function n(r,s,n=r.schema){const{gen:o,parentSchema:i,data:a,keyword:c,it:l}=r;!function(e){const{opts:r,errSchemaPath:o}=l,i=n.length,a=i===e.minItems&&(i===e.maxItems||!1===e[s]);if(r.strictTuples&&!a){const e=`"${c}" is ${i}-tuple, but minItems or maxItems/${s} are not specified or different at path "${o}"`;(0,t.checkStrictMode)(l,e,r.strictTuples)}}(i),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=t.mergeEvaluated.items(o,n.length,l.items));const u=o.name("valid"),d=o.const("len",e._`${a}.length`);n.forEach(((s,n)=>{(0,t.alwaysValidSchema)(l,s)||(o.if(e._`${d} > ${n}`,(()=>r.subschema({keyword:c,schemaProp:n,dataProp:n},u))),r.ok(u))}))}return Lt.validateTuple=n,Lt.default=s,Lt}var Kt,Gt={};var Bt,Ht={};function Jt(){if(Bt)return Ht;Bt=1,Object.defineProperty(Ht,"__esModule",{value:!0});const e=q(),t=U(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:r}})=>void 0===r?e.str`must contain at least ${t} valid item(s)`:e.str`must contain at least ${t} and no more than ${r} valid item(s)`,params:({params:{min:t,max:r}})=>void 0===r?e._`{minContains: ${t}}`:e._`{minContains: ${t}, maxContains: ${r}}`},code(r){const{gen:s,schema:n,parentSchema:o,data:i,it:a}=r;let c,l;const{minContains:u,maxContains:d}=o;a.opts.next?(c=void 0===u?1:u,l=d):c=1;const p=s.const("len",e._`${i}.length`);if(r.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,t.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,t.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void r.fail();if((0,t.alwaysValidSchema)(a,n)){let t=e._`${p} >= ${c}`;return void 0!==l&&(t=e._`${t} && ${p} <= ${l}`),void r.pass(t)}a.items=!0;const f=s.name("valid");function m(){const t=s.name("_valid"),r=s.let("count",0);h(t,(()=>s.if(t,(()=>function(t){s.code(e._`${t}++`),void 0===l?s.if(e._`${t} >= ${c}`,(()=>s.assign(f,!0).break())):(s.if(e._`${t} > ${l}`,(()=>s.assign(f,!1).break())),1===c?s.assign(f,!0):s.if(e._`${t} >= ${c}`,(()=>s.assign(f,!0))))}(r)))))}function h(e,n){s.forRange("i",0,p,(s=>{r.subschema({keyword:"contains",dataProp:s,dataPropType:t.Type.Num,compositeRule:!0},e),n()}))}void 0===l&&1===c?h(f,(()=>s.if(f,(()=>s.break())))):0===c?(s.let(f,!0),void 0!==l&&s.if(e._`${i}.length > 0`,m)):(s.let(f,!1),m()),r.result(f,(()=>r.reset()))}};return Ht.default=r,Ht}var Wt,Zt={};function Qt(){return Wt||(Wt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=q(),r=U(),s=le();e.error={message:({params:{property:e,depsCount:r,deps:s}})=>{const n=1===r?"property":"properties";return t.str`must have ${n} ${s} when property ${e} is present`},params:({params:{property:e,depsCount:r,deps:s,missingProperty:n}})=>t._`{property: ${e}, missingProperty: ${n}, depsCount: ${r}, deps: ${s}}`};const n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const s in e){if("__proto__"===s)continue;(Array.isArray(e[s])?t:r)[s]=e[s]}return[t,r]}(e);o(e,t),i(e,r)}};function o(e,r=e.schema){const{gen:n,data:o,it:i}=e;if(0===Object.keys(r).length)return;const a=n.let("missing");for(const c in r){const l=r[c];if(0===l.length)continue;const u=(0,s.propertyInData)(n,o,c,i.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),i.allErrors?n.if(u,(()=>{for(const t of l)(0,s.checkReportMissingProp)(e,t)})):(n.if(t._`${u} && (${(0,s.checkMissingProp)(e,l,a)})`),(0,s.reportMissingProp)(e,a),n.else())}}function i(e,t=e.schema){const{gen:n,data:o,keyword:i,it:a}=e,c=n.name("valid");for(const l in t)(0,r.alwaysValidSchema)(a,t[l])||(n.if((0,s.propertyInData)(n,o,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:i,schemaProp:l},c);e.mergeValidEvaluated(t,c)}),(()=>n.var(c,!0))),e.ok(c))}e.validatePropertyDeps=o,e.validateSchemaDeps=i,e.default=n}(Zt)),Zt}var Xt,Yt={};var er,tr={};function rr(){if(er)return tr;er=1,Object.defineProperty(tr,"__esModule",{value:!0});const e=le(),t=q(),r=B(),s=U(),n={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>t._`{additionalProperty: ${e.additionalProperty}}`},code(n){const{gen:o,schema:i,parentSchema:a,data:c,errsCount:l,it:u}=n;if(!l)throw new Error("ajv implementation error");const{allErrors:d,opts:p}=u;if(u.props=!0,"all"!==p.removeAdditional&&(0,s.alwaysValidSchema)(u,i))return;const f=(0,e.allSchemaProperties)(a.properties),m=(0,e.allSchemaProperties)(a.patternProperties);function h(e){o.code(t._`delete ${c}[${e}]`)}function y(e){if("all"===p.removeAdditional||p.removeAdditional&&!1===i)h(e);else{if(!1===i)return n.setParams({additionalProperty:e}),n.error(),void(d||o.break());if("object"==typeof i&&!(0,s.alwaysValidSchema)(u,i)){const r=o.name("valid");"failing"===p.removeAdditional?(g(e,r,!1),o.if((0,t.not)(r),(()=>{n.reset(),h(e)}))):(g(e,r),d||o.if((0,t.not)(r),(()=>o.break())))}}}function g(e,t,r){const o={keyword:"additionalProperties",dataProp:e,dataPropType:s.Type.Str};!1===r&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(o,t)}o.forIn("key",c,(r=>{f.length||m.length?o.if(function(r){let i;if(f.length>8){const t=(0,s.schemaRefOrVal)(u,a.properties,"properties");i=(0,e.isOwnProperty)(o,t,r)}else i=f.length?(0,t.or)(...f.map((e=>t._`${r} === ${e}`))):t.nil;return m.length&&(i=(0,t.or)(i,...m.map((s=>t._`${(0,e.usePattern)(n,s)}.test(${r})`)))),(0,t.not)(i)}(r),(()=>y(r))):y(r)})),n.ok(t._`${l} === ${r.default.errors}`)}};return tr.default=n,tr}var sr,nr={};var or,ir={};var ar,cr={};var lr,ur={};var dr,pr={};var fr,mr={};var hr,yr={};var gr,vr,$r={};function br(){if(vr)return At;vr=1,Object.defineProperty(At,"__esModule",{value:!0});const e=qt(),t=function(){if(zt)return Ut;zt=1,Object.defineProperty(Ut,"__esModule",{value:!0});const e=Ft(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,e.validateTuple)(t,"items")};return Ut.default=t,Ut}(),r=Ft(),s=function(){if(Kt)return Gt;Kt=1,Object.defineProperty(Gt,"__esModule",{value:!0});const e=q(),t=U(),r=le(),s=qt(),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>e.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>e._`{limit: ${t}}`},code(e){const{schema:n,parentSchema:o,it:i}=e,{prefixItems:a}=o;i.items=!0,(0,t.alwaysValidSchema)(i,n)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,r.validateArray)(e)))}};return Gt.default=n,Gt}(),n=Jt(),o=Qt(),i=function(){if(Xt)return Yt;Xt=1,Object.defineProperty(Yt,"__esModule",{value:!0});const e=q(),t=U(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>e._`{propertyName: ${t.propertyName}}`},code(r){const{gen:s,schema:n,data:o,it:i}=r;if((0,t.alwaysValidSchema)(i,n))return;const a=s.name("valid");s.forIn("key",o,(t=>{r.setParams({propertyName:t}),r.subschema({keyword:"propertyNames",data:t,dataTypes:["string"],propertyName:t,compositeRule:!0},a),s.if((0,e.not)(a),(()=>{r.error(!0),i.allErrors||s.break()}))})),r.ok(a)}};return Yt.default=r,Yt}(),a=rr(),c=function(){if(sr)return nr;sr=1,Object.defineProperty(nr,"__esModule",{value:!0});const e=Pe(),t=le(),r=U(),s=rr(),n={keyword:"properties",type:"object",schemaType:"object",code(n){const{gen:o,schema:i,parentSchema:a,data:c,it:l}=n;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new e.KeywordCxt(l,s.default,"additionalProperties"));const u=(0,t.allSchemaProperties)(i);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=r.mergeEvaluated.props(o,(0,r.toHash)(u),l.props));const d=u.filter((e=>!(0,r.alwaysValidSchema)(l,i[e])));if(0===d.length)return;const p=o.name("valid");for(const e of d)f(e)?m(e):(o.if((0,t.propertyInData)(o,c,e,l.opts.ownProperties)),m(e),l.allErrors||o.else().var(p,!0),o.endIf()),n.it.definedProperties.add(e),n.ok(p);function f(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==i[e].default}function m(e){n.subschema({keyword:"properties",schemaProp:e,dataProp:e},p)}}};return nr.default=n,nr}(),l=function(){if(or)return ir;or=1,Object.defineProperty(ir,"__esModule",{value:!0});const e=le(),t=q(),r=U(),s=U(),n={keyword:"patternProperties",type:"object",schemaType:"object",code(n){const{gen:o,schema:i,data:a,parentSchema:c,it:l}=n,{opts:u}=l,d=(0,e.allSchemaProperties)(i),p=d.filter((e=>(0,r.alwaysValidSchema)(l,i[e])));if(0===d.length||p.length===d.length&&(!l.opts.unevaluated||!0===l.props))return;const f=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=o.name("valid");!0===l.props||l.props instanceof t.Name||(l.props=(0,s.evaluatedPropsToName)(o,l.props));const{props:h}=l;function y(e){for(const t in f)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function g(r){o.forIn("key",a,(i=>{o.if(t._`${(0,e.usePattern)(n,r)}.test(${i})`,(()=>{const e=p.includes(r);e||n.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:s.Type.Str},m),l.opts.unevaluated&&!0!==h?o.assign(t._`${h}[${i}]`,!0):e||l.allErrors||o.if((0,t.not)(m),(()=>o.break()))}))}))}!function(){for(const e of d)f&&y(e),l.allErrors?g(e):(o.var(m,!0),g(e),o.if(m))}()}};return ir.default=n,ir}(),u=function(){if(ar)return cr;ar=1,Object.defineProperty(cr,"__esModule",{value:!0});const e=U(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:r,schema:s,it:n}=t;if((0,e.alwaysValidSchema)(n,s))return void t.fail();const o=r.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,(()=>t.reset()),(()=>t.error()))},error:{message:"must NOT be valid"}};return cr.default=t,cr}(),d=function(){if(lr)return ur;lr=1,Object.defineProperty(ur,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:le().validateUnion,error:{message:"must match a schema in anyOf"}};return ur.default=e,ur}(),p=function(){if(dr)return pr;dr=1,Object.defineProperty(pr,"__esModule",{value:!0});const e=q(),t=U(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>e._`{passingSchemas: ${t.passing}}`},code(r){const{gen:s,schema:n,parentSchema:o,it:i}=r;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&o.discriminator)return;const a=n,c=s.let("valid",!1),l=s.let("passing",null),u=s.name("_valid");r.setParams({passing:l}),s.block((function(){a.forEach(((n,o)=>{let a;(0,t.alwaysValidSchema)(i,n)?s.var(u,!0):a=r.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},u),o>0&&s.if(e._`${u} && ${c}`).assign(c,!1).assign(l,e._`[${l}, ${o}]`).else(),s.if(u,(()=>{s.assign(c,!0),s.assign(l,o),a&&r.mergeEvaluated(a,e.Name)}))}))})),r.result(c,(()=>r.reset()),(()=>r.error(!0)))}};return pr.default=r,pr}(),f=function(){if(fr)return mr;fr=1,Object.defineProperty(mr,"__esModule",{value:!0});const e=U(),t={keyword:"allOf",schemaType:"array",code(t){const{gen:r,schema:s,it:n}=t;if(!Array.isArray(s))throw new Error("ajv implementation error");const o=r.name("valid");s.forEach(((r,s)=>{if((0,e.alwaysValidSchema)(n,r))return;const i=t.subschema({keyword:"allOf",schemaProp:s},o);t.ok(o),t.mergeEvaluated(i)}))}};return mr.default=t,mr}(),m=function(){if(hr)return yr;hr=1,Object.defineProperty(yr,"__esModule",{value:!0});const e=q(),t=U(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>e.str`must match "${t.ifClause}" schema`,params:({params:t})=>e._`{failingKeyword: ${t.ifClause}}`},code(r){const{gen:n,parentSchema:o,it:i}=r;void 0===o.then&&void 0===o.else&&(0,t.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),c=s(i,"else");if(!a&&!c)return;const l=n.let("valid",!0),u=n.name("_valid");if(function(){const e=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);r.mergeEvaluated(e)}(),r.reset(),a&&c){const e=n.let("ifClause");r.setParams({ifClause:e}),n.if(u,d("then",e),d("else",e))}else a?n.if(u,d("then")):n.if((0,e.not)(u),d("else"));function d(t,s){return()=>{const o=r.subschema({keyword:t},u);n.assign(l,u),r.mergeValidEvaluated(o,l),s?n.assign(s,e._`${t}`):r.setParams({ifClause:t})}}r.pass(l,(()=>r.error(!0)))}};function s(e,r){const s=e.schema[r];return void 0!==s&&!(0,t.alwaysValidSchema)(e,s)}return yr.default=r,yr}(),h=function(){if(gr)return $r;gr=1,Object.defineProperty($r,"__esModule",{value:!0});const e=U(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:r,it:s}){void 0===r.if&&(0,e.checkStrictMode)(s,`"${t}" without "if" is ignored`)}};return $r.default=t,$r}();return At.default=function(y=!1){const g=[u.default,d.default,p.default,f.default,m.default,h.default,i.default,a.default,o.default,c.default,l.default];return y?g.push(t.default,s.default):g.push(e.default,r.default),g.push(n.default),g},At}var _r,wr,Pr={},Sr={};function kr(){if(_r)return Sr;_r=1,Object.defineProperty(Sr,"__esModule",{value:!0});const e=q(),t={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>e.str`must match format "${t}"`,params:({schemaCode:t})=>e._`{format: ${t}}`},code(t,r){const{gen:s,data:n,$data:o,schema:i,schemaCode:a,it:c}=t,{opts:l,errSchemaPath:u,schemaEnv:d,self:p}=c;l.validateFormats&&(o?function(){const o=s.scopeValue("formats",{ref:p.formats,code:l.code.formats}),i=s.const("fDef",e._`${o}[${a}]`),c=s.let("fType"),u=s.let("format");s.if(e._`typeof ${i} == "object" && !(${i} instanceof RegExp)`,(()=>s.assign(c,e._`${i}.type || "string"`).assign(u,e._`${i}.validate`)),(()=>s.assign(c,e._`"string"`).assign(u,i))),t.fail$data((0,e.or)(!1===l.strictSchema?e.nil:e._`${a} && !${u}`,function(){const t=d.$async?e._`(${i}.async ? await ${u}(${n}) : ${u}(${n}))`:e._`${u}(${n})`,s=e._`(typeof ${u} == "function" ? ${t} : ${u}.test(${n}))`;return e._`${u} && ${u} !== true && ${c} === ${r} && !${s}`}()))}():function(){const o=p.formats[i];if(!o)return void function(){if(!1===l.strictSchema)return void p.logger.warn(e());throw new Error(e());function e(){return`unknown format "${i}" ignored in schema at path "${u}"`}}();if(!0===o)return;const[a,c,f]=function(t){const r=t instanceof RegExp?(0,e.regexpCode)(t):l.code.formats?e._`${l.code.formats}${(0,e.getProperty)(i)}`:void 0,n=s.scopeValue("formats",{key:i,ref:t,code:r});if("object"==typeof t&&!(t instanceof RegExp))return[t.type||"string",t.validate,e._`${n}.validate`];return["string",t,n]}(o);a===r&&t.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!d.$async)throw new Error("async format in sync schema");return e._`await ${f}(${n})`}return"function"==typeof c?e._`${f}(${n})`:e._`${f}.test(${n})`}())}())}};return Sr.default=t,Sr}var Er,jr,xr={};function Nr(){if(jr)return We;jr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=rt(),t=Mt(),r=br(),s=function(){if(wr)return Pr;wr=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=[kr().default];return Pr.default=e,Pr}(),n=(Er||(Er=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.contentVocabulary=xr.metadataVocabulary=void 0,xr.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],xr.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),xr),o=[e.default,t.default,(0,r.default)(),s.default,n.metadataVocabulary,n.contentVocabulary];return We.default=o,We}var Cr,Or={},Ir={};function Rr(){if(Cr)return Ir;Cr=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.dynamicAnchor=void 0;const e=q(),t=B(),r=Ie(),s=tt(),n={keyword:"$dynamicAnchor",schemaType:"string",code:e=>o(e,e.schema)};function o(n,o){const{gen:i,it:a}=n;a.schemaEnv.root.dynamicAnchors[o]=!0;const c=e._`${t.default.dynamicAnchors}${(0,e.getProperty)(o)}`,l="#"===a.errSchemaPath?a.validateName:function(e){const{schemaEnv:t,schema:n,self:o}=e.it,{root:i,baseId:a,localRefs:c,meta:l}=t.root,{schemaId:u}=o.opts,d=new r.SchemaEnv({schema:n,schemaId:u,root:i,baseId:a,localRefs:c,meta:l});return r.compileSchema.call(o,d),(0,s.getValidate)(e,d)}(n);i.if(e._`!${c}`,(()=>i.assign(c,l)))}return Ir.dynamicAnchor=o,Ir.default=n,Ir}var Mr,Tr={};function Ar(){if(Mr)return Tr;Mr=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.dynamicRef=void 0;const e=q(),t=B(),r=tt(),s={keyword:"$dynamicRef",schemaType:"string",code:e=>n(e,e.schema)};function n(s,n){const{gen:o,keyword:i,it:a}=s;if("#"!==n[0])throw new Error(`"${i}" only supports hash fragment reference`);const c=n.slice(1);if(a.allErrors)l();else{const e=o.let("valid",!1);l(e),s.ok(e)}function l(r){if(a.schemaEnv.root.dynamicAnchors[c]){const s=o.let("_v",e._`${t.default.dynamicAnchors}${(0,e.getProperty)(c)}`);o.if(s,u(s,r),u(a.validateName,r))}else u(a.validateName,r)()}function u(e,t){return t?()=>o.block((()=>{(0,r.callRef)(s,e),o.let(t,!0)})):()=>(0,r.callRef)(s,e)}}return Tr.dynamicRef=n,Tr.default=s,Tr}var Dr,qr={};var Vr,zr,Ur={};function Lr(){if(zr)return Or;zr=1,Object.defineProperty(Or,"__esModule",{value:!0});const e=Rr(),t=Ar(),r=function(){if(Dr)return qr;Dr=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=Rr(),t=U(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,e.dynamicAnchor)(r,""):(0,t.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};return qr.default=r,qr}(),s=function(){if(Vr)return Ur;Vr=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=Ar(),t={keyword:"$recursiveRef",schemaType:"string",code:t=>(0,e.dynamicRef)(t,t.schema)};return Ur.default=t,Ur}(),n=[e.default,t.default,r.default,s.default];return Or.default=n,Or}var Fr,Kr={},Gr={};var Br,Hr={};var Jr,Wr,Zr={};function Qr(){if(Wr)return Kr;Wr=1,Object.defineProperty(Kr,"__esModule",{value:!0});const e=function(){if(Fr)return Gr;Fr=1,Object.defineProperty(Gr,"__esModule",{value:!0});const e=Qt(),t={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:t=>(0,e.validatePropertyDeps)(t)};return Gr.default=t,Gr}(),t=function(){if(Br)return Hr;Br=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=Qt(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:t=>(0,e.validateSchemaDeps)(t)};return Hr.default=t,Hr}(),r=function(){if(Jr)return Zr;Jr=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=U(),t={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:r,it:s}){void 0===r.contains&&(0,e.checkStrictMode)(s,`"${t}" without "contains" is ignored`)}};return Zr.default=t,Zr}(),s=[e.default,t.default,r.default];return Kr.default=s,Kr}var Xr,Yr={},es={};function ts(){if(Xr)return es;Xr=1,Object.defineProperty(es,"__esModule",{value:!0});const e=q(),t=U(),r=B(),s={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:t})=>e._`{unevaluatedProperty: ${t.unevaluatedProperty}}`},code(s){const{gen:n,schema:o,data:i,errsCount:a,it:c}=s;if(!a)throw new Error("ajv implementation error");const{allErrors:l,props:u}=c;function d(r){if(!1===o)return s.setParams({unevaluatedProperty:r}),s.error(),void(l||n.break());if(!(0,t.alwaysValidSchema)(c,o)){const o=n.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:r,dataPropType:t.Type.Str},o),l||n.if((0,e.not)(o),(()=>n.break()))}}u instanceof e.Name?n.if(e._`${u} !== true`,(()=>n.forIn("key",i,(t=>n.if(function(t,r){return e._`!${t} || !${t}[${r}]`}(u,t),(()=>d(t))))))):!0!==u&&n.forIn("key",i,(t=>void 0===u?d(t):n.if(function(t,r){const s=[];for(const n in t)!0===t[n]&&s.push(e._`${r} !== ${n}`);return(0,e.and)(...s)}(u,t),(()=>d(t))))),c.props=!0,s.ok(e._`${a} === ${r.default.errors}`)}};return es.default=s,es}var rs,ss,ns={};function os(){if(rs)return ns;rs=1,Object.defineProperty(ns,"__esModule",{value:!0});const e=q(),t=U(),r={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:t}})=>e.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>e._`{limit: ${t}}`},code(r){const{gen:s,schema:n,data:o,it:i}=r,a=i.items||0;if(!0===a)return;const c=s.const("len",e._`${o}.length`);if(!1===n)r.setParams({len:a}),r.fail(e._`${c} > ${a}`);else if("object"==typeof n&&!(0,t.alwaysValidSchema)(i,n)){const n=s.var("valid",e._`${c} <= ${a}`);s.if((0,e.not)(n),(()=>function(n,o){s.forRange("i",o,c,(o=>{r.subschema({keyword:"unevaluatedItems",dataProp:o,dataPropType:t.Type.Num},n),i.allErrors||s.if((0,e.not)(n),(()=>s.break()))}))}(n,a))),r.ok(n)}i.items=!0}};return ns.default=r,ns}var is,as,cs={},ls={};function us(){if(as)return cs;as=1,Object.defineProperty(cs,"__esModule",{value:!0});const e=q(),t=(is||(is=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(ls.DiscrError=r={}))),ls);var r;const s=Ie(),n=Ne(),o=U(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:r}})=>e===t.DiscrError.Tag?`tag "${r}" must be string`:`value of tag "${r}" must be in oneOf`,params:({params:{discrError:t,tag:r,tagName:s}})=>e._`{error: ${t}, tag: ${s}, tagValue: ${r}}`},code(r){const{gen:i,data:a,schema:c,parentSchema:l,it:u}=r,{oneOf:d}=l;if(!u.opts.discriminator)throw new Error("discriminator: requires discriminator option");const p=c.propertyName;if("string"!=typeof p)throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!d)throw new Error("discriminator: requires oneOf keyword");const f=i.let("valid",!1),m=i.const("tag",e._`${a}${(0,e.getProperty)(p)}`);function h(t){const s=i.name("valid"),n=r.subschema({keyword:"oneOf",schemaProp:t},s);return r.mergeEvaluated(n,e.Name),s}i.if(e._`typeof ${m} == "string"`,(()=>function(){const a=function(){var e;const t={},r=a(l);let i=!0;for(let t=0;tr.error(!1,{discrError:t.DiscrError.Tag,tag:m,tagName:p}))),r.ok(f)}};return cs.default=i,cs}var ds,ps,fs={},ms={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}},hs={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}},ys={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}},gs={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}},vs={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}},$s={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},bs={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{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:{$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"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",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:[]}}};var _s=(ps||(ps=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.Ajv2019=void 0;const r=He(),s=Nr(),n=Lr(),o=Qr(),i=function(){if(ss)return Yr;ss=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=ts(),t=os(),r=[e.default,t.default];return Yr.default=r,Yr}(),a=us(),c=function(){if(ds)return fs;ds=1,Object.defineProperty(fs,"__esModule",{value:!0});const e=ms,t=hs,r=ys,s=gs,n=vs,o=$s,i=bs,a=["/properties"];return fs.default=function(c){return[e,t,r,s,l(this,n),o,l(this,i)].forEach((e=>this.addMetaSchema(e,void 0,!1))),this;function l(e,t){return c?e.$dataMetaSchema(t,a):t}},fs}(),l="https://json-schema.org/draft/2019-09/schema";class u extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),s.default.forEach((e=>this.addVocabulary(e))),this.addVocabulary(o.default),this.addVocabulary(i.default),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(c.default.call(this,e),this.refs["http://json-schema.org/schema"]=l)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv2019=u,e.exports=t=u,e.exports.Ajv2019=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var d=Pe();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var p=q();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var f=Ee();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var m=Ne();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}(E,E.exports)),E.exports);class ws extends Error{keyword;instancePath;schemaPath;details;constructor(e){super(`Validation error: ${e?.message}`),this.name="ComposeValidationError",this.keyword=e.keyword,this.instancePath=e.instancePath,this.schemaPath=e.schemaPath,this.details=e}toString(){return`ComposeValidationError: instancePath="${this.instancePath}", schemaPath="${this.schemaPath}", message="${this.message}".`}}var Ps={$schema:"https://json-schema.org/draft/2019-09/schema#",id:"compose_spec.json",type:"object",title:"Compose Specification",description:"The Compose file is a YAML file defining a multi-containers based application.",properties:{version:{type:"string",description:"declared for backward compatibility, ignored."},name:{type:"string",description:"define the Compose project name, until user defines one explicitly."},include:{type:"array",items:{$ref:"#/definitions/include"},description:"compose sub-projects to be included."},services:{id:"#/properties/services",type:"object",patternProperties:{"^[a-zA-Z0-9._-]+$":{$ref:"#/definitions/service"}},additionalProperties:!1},networks:{id:"#/properties/networks",type:"object",patternProperties:{"^[a-zA-Z0-9._-]+$":{$ref:"#/definitions/network"}}},volumes:{id:"#/properties/volumes",type:"object",patternProperties:{"^[a-zA-Z0-9._-]+$":{$ref:"#/definitions/volume"}},additionalProperties:!1},secrets:{id:"#/properties/secrets",type:"object",patternProperties:{"^[a-zA-Z0-9._-]+$":{$ref:"#/definitions/secret"}},additionalProperties:!1},configs:{id:"#/properties/configs",type:"object",patternProperties:{"^[a-zA-Z0-9._-]+$":{$ref:"#/definitions/config"}},additionalProperties:!1}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{service:{id:"#/definitions/service",type:"object",properties:{develop:{$ref:"#/definitions/development"},deploy:{$ref:"#/definitions/deployment"},annotations:{$ref:"#/definitions/list_or_dict"},attach:{type:["boolean","string"]},build:{oneOf:[{type:"string"},{type:"object",properties:{context:{type:"string"},dockerfile:{type:"string"},dockerfile_inline:{type:"string"},entitlements:{type:"array",items:{type:"string"}},args:{$ref:"#/definitions/list_or_dict"},ssh:{$ref:"#/definitions/list_or_dict"},labels:{$ref:"#/definitions/list_or_dict"},cache_from:{type:"array",items:{type:"string"}},cache_to:{type:"array",items:{type:"string"}},no_cache:{type:["boolean","string"]},additional_contexts:{$ref:"#/definitions/list_or_dict"},network:{type:"string"},pull:{type:["boolean","string"]},target:{type:"string"},shm_size:{type:["integer","string"]},extra_hosts:{$ref:"#/definitions/extra_hosts"},isolation:{type:"string"},privileged:{type:["boolean","string"]},secrets:{$ref:"#/definitions/service_config_or_secret"},tags:{type:"array",items:{type:"string"}},ulimits:{$ref:"#/definitions/ulimits"},platforms:{type:"array",items:{type:"string"}}},additionalProperties:!1,patternProperties:{"^x-":{}}}]},blkio_config:{type:"object",properties:{device_read_bps:{type:"array",items:{$ref:"#/definitions/blkio_limit"}},device_read_iops:{type:"array",items:{$ref:"#/definitions/blkio_limit"}},device_write_bps:{type:"array",items:{$ref:"#/definitions/blkio_limit"}},device_write_iops:{type:"array",items:{$ref:"#/definitions/blkio_limit"}},weight:{type:["integer","string"]},weight_device:{type:"array",items:{$ref:"#/definitions/blkio_weight"}}},additionalProperties:!1},cap_add:{type:"array",items:{type:"string"},uniqueItems:!0},cap_drop:{type:"array",items:{type:"string"},uniqueItems:!0},cgroup:{type:"string",enum:["host","private"]},cgroup_parent:{type:"string"},command:{$ref:"#/definitions/command"},configs:{$ref:"#/definitions/service_config_or_secret"},container_name:{type:"string"},cpu_count:{oneOf:[{type:"string"},{type:"integer",minimum:0}]},cpu_percent:{oneOf:[{type:"string"},{type:"integer",minimum:0,maximum:100}]},cpu_shares:{type:["number","string"]},cpu_quota:{type:["number","string"]},cpu_period:{type:["number","string"]},cpu_rt_period:{type:["number","string"]},cpu_rt_runtime:{type:["number","string"]},cpus:{type:["number","string"]},cpuset:{type:"string"},credential_spec:{type:"object",properties:{config:{type:"string"},file:{type:"string"},registry:{type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}},depends_on:{oneOf:[{$ref:"#/definitions/list_of_strings"},{type:"object",additionalProperties:!1,patternProperties:{"^[a-zA-Z0-9._-]+$":{type:"object",additionalProperties:!1,patternProperties:{"^x-":{}},properties:{restart:{type:["boolean","string"]},required:{type:"boolean",default:!0},condition:{type:"string",enum:["service_started","service_healthy","service_completed_successfully"]}},required:["condition"]}}}]},device_cgroup_rules:{$ref:"#/definitions/list_of_strings"},devices:{type:"array",items:{oneOf:[{type:"string"},{type:"object",required:["source"],properties:{source:{type:"string"},target:{type:"string"},permissions:{type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}}]}},dns:{$ref:"#/definitions/string_or_list"},dns_opt:{type:"array",items:{type:"string"},uniqueItems:!0},dns_search:{$ref:"#/definitions/string_or_list"},domainname:{type:"string"},entrypoint:{$ref:"#/definitions/command"},env_file:{$ref:"#/definitions/env_file"},environment:{$ref:"#/definitions/list_or_dict"},expose:{type:"array",items:{type:["string","number"],format:"expose"},uniqueItems:!0},extends:{oneOf:[{type:"string"},{type:"object",properties:{service:{type:"string"},file:{type:"string"}},required:["service"],additionalProperties:!1}]},external_links:{type:"array",items:{type:"string"},uniqueItems:!0},extra_hosts:{$ref:"#/definitions/extra_hosts"},group_add:{type:"array",items:{type:["string","number"]},uniqueItems:!0},healthcheck:{$ref:"#/definitions/healthcheck"},hostname:{type:"string"},image:{type:"string"},init:{type:["boolean","string"]},ipc:{type:"string"},isolation:{type:"string"},labels:{$ref:"#/definitions/list_or_dict"},links:{type:"array",items:{type:"string"},uniqueItems:!0},logging:{type:"object",properties:{driver:{type:"string"},options:{type:"object",patternProperties:{"^.+$":{type:["string","number","null"]}}}},additionalProperties:!1,patternProperties:{"^x-":{}}},mac_address:{type:"string"},mem_limit:{type:["number","string"]},mem_reservation:{type:["string","integer"]},mem_swappiness:{type:["integer","string"]},memswap_limit:{type:["number","string"]},network_mode:{type:"string"},networks:{oneOf:[{$ref:"#/definitions/list_of_strings"},{type:"object",patternProperties:{"^[a-zA-Z0-9._-]+$":{oneOf:[{type:"object",properties:{aliases:{$ref:"#/definitions/list_of_strings"},ipv4_address:{type:"string"},ipv6_address:{type:"string"},link_local_ips:{$ref:"#/definitions/list_of_strings"},mac_address:{type:"string"},driver_opts:{type:"object",patternProperties:{"^.+$":{type:["string","number"]}}},priority:{type:"number"}},additionalProperties:!1,patternProperties:{"^x-":{}}},{type:"null"}]}},additionalProperties:!1}]},oom_kill_disable:{type:["boolean","string"]},oom_score_adj:{oneOf:[{type:"string"},{type:"integer",minimum:-1e3,maximum:1e3}]},pid:{type:["string","null"]},pids_limit:{type:["number","string"]},platform:{type:"string"},ports:{type:"array",items:{oneOf:[{type:"number"},{type:"string"},{type:"object",properties:{name:{type:"string"},mode:{type:"string"},host_ip:{type:"string"},target:{type:["integer","string"]},published:{type:["string","integer"]},protocol:{type:"string"},app_protocol:{type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}}]},uniqueItems:!0},post_start:{type:"array",items:{$ref:"#/definitions/service_hook"}},pre_stop:{type:"array",items:{$ref:"#/definitions/service_hook"}},privileged:{type:["boolean","string"]},profiles:{$ref:"#/definitions/list_of_strings"},pull_policy:{type:"string",enum:["always","never","if_not_present","build","missing"]},read_only:{type:["boolean","string"]},restart:{type:"string"},runtime:{type:"string"},scale:{type:["integer","string"]},security_opt:{type:"array",items:{type:"string"},uniqueItems:!0},shm_size:{type:["number","string"]},secrets:{$ref:"#/definitions/service_config_or_secret"},sysctls:{$ref:"#/definitions/list_or_dict"},stdin_open:{type:["boolean","string"]},stop_grace_period:{type:"string"},stop_signal:{type:"string"},storage_opt:{type:"object"},tmpfs:{$ref:"#/definitions/string_or_list"},tty:{type:["boolean","string"]},ulimits:{$ref:"#/definitions/ulimits"},user:{type:"string"},uts:{type:"string"},userns_mode:{type:"string"},volumes:{type:"array",items:{oneOf:[{type:"string"},{type:"object",required:["type"],properties:{type:{type:"string"},source:{type:"string"},target:{type:"string"},read_only:{type:["boolean","string"]},consistency:{type:"string"},bind:{type:"object",properties:{propagation:{type:"string"},create_host_path:{type:["boolean","string"]},selinux:{type:"string",enum:["z","Z"]}},additionalProperties:!1,patternProperties:{"^x-":{}}},volume:{type:"object",properties:{nocopy:{type:["boolean","string"]},subpath:{type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}},tmpfs:{type:"object",properties:{size:{oneOf:[{type:"integer",minimum:0},{type:"string"}]},mode:{type:["number","string"]}},additionalProperties:!1,patternProperties:{"^x-":{}}}},additionalProperties:!1,patternProperties:{"^x-":{}}}]},uniqueItems:!0},volumes_from:{type:"array",items:{type:"string"},uniqueItems:!0},working_dir:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},healthcheck:{id:"#/definitions/healthcheck",type:"object",properties:{disable:{type:["boolean","string"]},interval:{type:"string"},retries:{type:["number","string"]},test:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},timeout:{type:"string"},start_period:{type:"string"},start_interval:{type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}},development:{id:"#/definitions/development",type:["object","null"],properties:{watch:{type:"array",items:{type:"object",required:["path","action"],properties:{ignore:{type:"array",items:{type:"string"}},path:{type:"string"},action:{type:"string",enum:["rebuild","sync","sync+restart"]},target:{type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}}}},additionalProperties:!1,patternProperties:{"^x-":{}}},deployment:{id:"#/definitions/deployment",type:["object","null"],properties:{mode:{type:"string"},endpoint_mode:{type:"string"},replicas:{type:["integer","string"]},labels:{$ref:"#/definitions/list_or_dict"},rollback_config:{type:"object",properties:{parallelism:{type:["integer","string"]},delay:{type:"string"},failure_action:{type:"string"},monitor:{type:"string"},max_failure_ratio:{type:["number","string"]},order:{type:"string",enum:["start-first","stop-first"]}},additionalProperties:!1,patternProperties:{"^x-":{}}},update_config:{type:"object",properties:{parallelism:{type:["integer","string"]},delay:{type:"string"},failure_action:{type:"string"},monitor:{type:"string"},max_failure_ratio:{type:["number","string"]},order:{type:"string",enum:["start-first","stop-first"]}},additionalProperties:!1,patternProperties:{"^x-":{}}},resources:{type:"object",properties:{limits:{type:"object",properties:{cpus:{type:["number","string"]},memory:{type:"string"},pids:{type:["integer","string"]}},additionalProperties:!1,patternProperties:{"^x-":{}}},reservations:{type:"object",properties:{cpus:{type:["number","string"]},memory:{type:"string"},generic_resources:{$ref:"#/definitions/generic_resources"},devices:{$ref:"#/definitions/devices"}},additionalProperties:!1,patternProperties:{"^x-":{}}}},additionalProperties:!1,patternProperties:{"^x-":{}}},restart_policy:{type:"object",properties:{condition:{type:"string"},delay:{type:"string"},max_attempts:{type:["integer","string"]},window:{type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}},placement:{type:"object",properties:{constraints:{type:"array",items:{type:"string"}},preferences:{type:"array",items:{type:"object",properties:{spread:{type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}}},max_replicas_per_node:{type:["integer","string"]}},additionalProperties:!1,patternProperties:{"^x-":{}}}},additionalProperties:!1,patternProperties:{"^x-":{}}},generic_resources:{id:"#/definitions/generic_resources",type:"array",items:{type:"object",properties:{discrete_resource_spec:{type:"object",properties:{kind:{type:"string"},value:{type:["number","string"]}},additionalProperties:!1,patternProperties:{"^x-":{}}}},additionalProperties:!1,patternProperties:{"^x-":{}}}},devices:{id:"#/definitions/devices",type:"array",items:{type:"object",properties:{capabilities:{$ref:"#/definitions/list_of_strings"},count:{type:["string","integer"]},device_ids:{$ref:"#/definitions/list_of_strings"},driver:{type:"string"},options:{$ref:"#/definitions/list_or_dict"}},additionalProperties:!1,patternProperties:{"^x-":{}},required:["capabilities"]}},include:{id:"#/definitions/include",oneOf:[{type:"string"},{type:"object",properties:{path:{$ref:"#/definitions/string_or_list"},env_file:{$ref:"#/definitions/string_or_list"},project_directory:{type:"string"}},additionalProperties:!1}]},network:{id:"#/definitions/network",type:["object","null"],properties:{name:{type:"string"},driver:{type:"string"},driver_opts:{type:"object",patternProperties:{"^.+$":{type:["string","number"]}}},ipam:{type:"object",properties:{driver:{type:"string"},config:{type:"array",items:{type:"object",properties:{subnet:{type:"string"},ip_range:{type:"string"},gateway:{type:"string"},aux_addresses:{type:"object",additionalProperties:!1,patternProperties:{"^.+$":{type:"string"}}}},additionalProperties:!1,patternProperties:{"^x-":{}}}},options:{type:"object",additionalProperties:!1,patternProperties:{"^.+$":{type:"string"}}}},additionalProperties:!1,patternProperties:{"^x-":{}}},external:{type:["boolean","string","object"],properties:{name:{deprecated:!0,type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}},internal:{type:["boolean","string"]},enable_ipv6:{type:["boolean","string"]},attachable:{type:["boolean","string"]},labels:{$ref:"#/definitions/list_or_dict"}},additionalProperties:!1,patternProperties:{"^x-":{}}},volume:{id:"#/definitions/volume",type:["object","null"],properties:{name:{type:"string"},driver:{type:"string"},driver_opts:{type:"object",patternProperties:{"^.+$":{type:["string","number"]}}},external:{type:["boolean","string","object"],properties:{name:{deprecated:!0,type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}},labels:{$ref:"#/definitions/list_or_dict"}},additionalProperties:!1,patternProperties:{"^x-":{}}},secret:{id:"#/definitions/secret",type:"object",properties:{name:{type:"string"},environment:{type:"string"},file:{type:"string"},external:{type:["boolean","string","object"],properties:{name:{type:"string"}}},labels:{$ref:"#/definitions/list_or_dict"},driver:{type:"string"},driver_opts:{type:"object",patternProperties:{"^.+$":{type:["string","number"]}}},template_driver:{type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}},config:{id:"#/definitions/config",type:"object",properties:{name:{type:"string"},content:{type:"string"},environment:{type:"string"},file:{type:"string"},external:{type:["boolean","string","object"],properties:{name:{deprecated:!0,type:"string"}}},labels:{$ref:"#/definitions/list_or_dict"},template_driver:{type:"string"}},additionalProperties:!1,patternProperties:{"^x-":{}}},command:{oneOf:[{type:"null"},{type:"string"},{type:"array",items:{type:"string"}}]},service_hook:{id:"#/definitions/service_hook",type:"object",properties:{command:{$ref:"#/definitions/command"},user:{type:"string"},privileged:{type:["boolean","string"]},working_dir:{type:"string"},environment:{$ref:"#/definitions/list_or_dict"}},additionalProperties:!1,patternProperties:{"^x-":{}}},env_file:{oneOf:[{type:"string"},{type:"array",items:{oneOf:[{type:"string"},{type:"object",additionalProperties:!1,properties:{path:{type:"string"},format:{type:"string"},required:{type:["boolean","string"],default:!0}},required:["path"]}]}}]},string_or_list:{oneOf:[{type:"string"},{$ref:"#/definitions/list_of_strings"}]},list_of_strings:{type:"array",items:{type:"string"},uniqueItems:!0},list_or_dict:{oneOf:[{type:"object",patternProperties:{".+":{type:["string","number","boolean","null"]}},additionalProperties:!1},{type:"array",items:{type:"string"},uniqueItems:!0}]},extra_hosts:{oneOf:[{type:"object",patternProperties:{".+":{type:["string","array"]},uniqueItems:!1},additionalProperties:!1},{type:"array",items:{type:"string"},uniqueItems:!0}]},blkio_limit:{type:"object",properties:{path:{type:"string"},rate:{type:["integer","string"]}},additionalProperties:!1},blkio_weight:{type:"object",properties:{path:{type:"string"},weight:{type:["integer","string"]}},additionalProperties:!1},service_config_or_secret:{type:"array",items:{oneOf:[{type:"string"},{type:"object",properties:{source:{type:"string"},target:{type:"string"},uid:{type:"string"},gid:{type:"string"},mode:{type:["number","string"]}},additionalProperties:!1,patternProperties:{"^x-":{}}}]}},ulimits:{type:"object",patternProperties:{"^[a-z]+$":{oneOf:[{type:["integer","string"]},{type:"object",properties:{hard:{type:["integer","string"]},soft:{type:["integer","string"]}},required:["soft","hard"],additionalProperties:!1,patternProperties:{"^x-":{}}}]}}},constraints:{service:{id:"#/definitions/constraints/service",anyOf:[{required:["build"]},{required:["image"]}],properties:{build:{required:["context"]}}}}}},Ss={$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{rules:{type:"object",propertyNames:{type:"string"},additionalProperties:{oneOf:[{type:"number",enum:[0,1,2]},{type:"array",items:[{type:"number",enum:[0,1,2]},{type:"object",additionalProperties:!0}],minItems:2,maxItems:2}]}},quiet:{type:"boolean"},debug:{type:"boolean"},exclude:{type:"array",items:{type:"string"}}},required:[],additionalProperties:!1};function ks(e){switch(e){case"compose":return Ps;case"linter-config":return Ss;default:return{}}}function Es(e){return"object"!=typeof e||("id"in e&&delete e.id,Object.entries(e).forEach((([t,r])=>{"object"==typeof r&&null!==r&&(e[t]=Es(r))}))),e}function js(e){const t=new _s.Ajv2019({allErrors:!0,strict:!1,strictSchema:!1,allowUnionTypes:!0,logger:!1}),r=ks("compose"),s=t.compile(Es(r));!s(e)&&Array.isArray(s.errors)&&s.errors.forEach((e=>{throw new ws(e)}))}const xs=(e,t)=>{const r=o.createHash("md5");for(const t of e.filter(Boolean))r.update(t.toString());const s=r.copy();let n=r.digest("hex");return t.has(n)&&(s.update(Math.random().toString()),n=s.digest("hex")),t.add(n),n};function Ns(e){return e.replaceAll(/[<>&'"]/g,(e=>{switch(e){case"<":return"<";case">":return">";case"&":return"&";case'"':return""";case"'":return"'";default:return e}}))}var Cs={codeclimateFormatter:function(e){const t=new Set,r=e.flatMap((e=>e.messages.map((r=>({type:"issue",check_name:r.rule,description:r.message,content:{body:`Error found in ${r.rule}`},categories:["Style"],location:{path:e.filePath,lines:{begin:r.line,end:r.endLine??r.line},positions:{begin:{line:r.line,column:r.column},end:{line:r.endLine??r.line,column:r.endColumn??r.column}}},severity:r.severity,fingerprint:xs([e.filePath,r.rule,r.message,`${r.line}`,`${r.column}`],t)})))));return JSON.stringify(r)},compactFormatter:function(e){return e.map((e=>e.messages.map((t=>`${e.filePath}:${t.line}:${t.column} ${t.message} [${t.rule}]`)).join("\n"))).join("\n\n")},jsonFormatter:function(e){return JSON.stringify(e,null,2)},junitFormatter:function(e){return`\n\n ${e.map((e=>{const t=e.messages.map((t=>`\n \n ${Ns(e.filePath)}:${t.line}:${t.column}\n \n `)).join("");return`\n \n ${t}\n \n `})).join("")}\n`},stylishFormatter:function(e){let t="",n=0,o=0,i=0,a=0;e.forEach((e=>{if(0===e.messages.length)return;const c=s.underline(r.resolve(e.filePath));t+=`\n${c}\n`,e.messages.forEach((e=>{const{type:r}=e,c="error"===r?s.red:s.yellow,l=e.line.toString().padStart(4," "),u=e.column.toString().padEnd(4," "),d=s.dim(`${l}:${u}`),p=c(r),f=s.dim(e.rule);t+=`${d} ${p} ${e.message} ${f}\n`,"error"===r?(n+=1,e.fixable&&(i+=1)):(o+=1,e.fixable&&(a+=1))}))}));const c=n+o;if(c>0){const e=s.red(s.bold(`✖ ${c} problems`)),r=s.red(s.bold(`${n} errors`)),i=s.yellow(s.bold(`${o} warnings`));t+=`\n${e} (${r}, ${i})\n`}if(i>0||a>0){const e=s.green(s.bold(`${i} errors and ${a} warnings potentially fixable with the \`--fix\` option.`));t+=`${e}\n`}return t}};async function Os(e){try{return(await import(e)).default}catch{throw new Error(`Module at ${e} does not export a default formatter.`)}}function Is(e){const t=new Set,r=e.trim().split("\n")[0].trim().match(/#\s*dclint\s+disable\s*(.*)/);if(r){const e=r[1].trim();""===e?t.add("*"):e.split(/\s+/).forEach((e=>t.add(e)))}return t}const Rs={debug:!1,exclude:[],rules:{},quiet:!1};class Ms{config;rules;constructor(e){this.config={...Rs,...e},this.rules=[],a.init(this.config?.debug)}async loadRules(){0===this.rules.length&&(this.rules=await async function(e){const t=a.getInstance(),r=[];for(const s of Object.values(S))try{const t=new s,n=e.rules[t.name];let o,i;if(Array.isArray(n)?[o,i]=n:o=n,0!==o){const e=i?new s(i):t,n={1:"warning",2:"error"};e.type=n[o]||e.type,r.push(e)}}catch(e){t.error(`Error loading rule: ${s?.name}`,e)}return r}(this.config))}lintContent(e){const t=[],r=Is(e.sourceCode),s=function(e){const t=new Map;return e.split("\n").forEach(((e,r)=>{const s=e.trim().startsWith("#")?r+2:r+1,n=e.match(/#\s*dclint\s+disable-line\s*(.*)/);if(!n)return;const o=n[1].trim();t.has(s)||t.set(s,new Set),""===o?t.get(s)?.add("*"):o.split(/\s+/).forEach((e=>t.get(s)?.add(e)))})),t}(e.sourceCode);return this.rules.forEach((n=>{if(r.has("*")||r.has(n.name))return;const o=n.check(e).filter((e=>{const t=s.get(e.line);return(!t||!t.has("*"))&&(!t||!t.has(n.name))}));t.push(...o)})),t}fixContent(e){let t=e;const r=Is(t);return this.rules.forEach((e=>{r.has("*")||r.has(e.name)||"function"==typeof e.fix&&(t=e.fix(t))})),t}static validateFile(r){const s=a.getInstance(),n=[],o={path:r,content:{},sourceCode:""};try{o.sourceCode=e.readFileSync(r,"utf8");const s=t.parseDocument(o.sourceCode,{merge:!0});s.errors&&s.errors.length>0&&s.errors.forEach((e=>{throw e})),o.content=s.toJS(),js(o.content)}catch(e){if(e instanceof t.YAMLError){const t=Array.isArray(e.linePos)?e.linePos[0]:e.linePos;n.push({rule:"invalid-yaml",category:"style",severity:"critical",message:"Invalid YAML format.",line:t?.line||1,column:t?.col||1,type:"error",fixable:!1})}else e instanceof ws?n.push({rule:"invalid-schema",type:"error",category:"style",severity:"critical",message:e.toString(),line:1,column:1,fixable:!1}):(n.push({rule:"unknown-error",category:"style",severity:"critical",message:"unknown-error",line:1,column:1,type:"error",fixable:!1}),s.debug(i,`Error while processing file ${r}`,e));return{context:null,messages:n}}return o.sourceCode.startsWith("# dclint disable-file")?(s.debug(i,`Linter disabled for file: ${r}`),{context:null,messages:n}):{context:o,messages:n}}async lintFiles(e,t){const r=a.getInstance(),s=[];await this.loadRules();const n=l(e,t,this.config.exclude);return r.debug(i,`Compose files for linting: ${n.toString()}`),n.forEach((e=>{r.debug(i,`Linting file: ${e}`);const{context:t,messages:n}=Ms.validateFile(e);if(t){const e=this.lintContent(t);n.push(...e)}const o=n.filter((e=>"error"===e.type)).length,a=n.filter((e=>"warning"===e.type)).length,c=n.filter((e=>e.fixable&&"error"===e.type)).length,l=n.filter((e=>e.fixable&&"warning"===e.type)).length;s.push({filePath:e,messages:n,errorCount:o,warningCount:a,fixableErrorCount:c,fixableWarningCount:l})})),r.debug(i,"Linting result:",JSON.stringify(s)),s}async fixFiles(t,r,s=!1){const n=a.getInstance();await this.loadRules();const o=l(t,r,this.config.exclude);n.debug(i,`Compose files for fixing: ${o.toString()}`),o.forEach((t=>{n.debug(i,`Fixing file: ${t}`);const{context:r,messages:o}=Ms.validateFile(t);if(!r)return n.debug(i,`Skipping file due to validation errors: ${t}`),void o.forEach((e=>n.debug(i,JSON.stringify(e))));const a=this.fixContent(r.sourceCode);s?(n.info(`Dry run - changes for file: ${t}`),n.info("\n\n",a)):(e.writeFileSync(t,a,"utf8"),n.debug(i,`File fixed: ${t}`))}))}async formatResults(e,t){const s=await async function(e){const t=a.getInstance();if(e.startsWith(".")){const s=r.resolve(e),n=await Os(s);return t.debug("UTIL",`Using formatter: ${s}`),n}if(e.includes("dclint-formatter-")){const r=await Os(e);return t.debug("UTIL",`Using formatter: ${e}`),r}const s=Cs[`${e}Formatter`];return s?(t.debug("UTIL",`Using built-in formatter: ${e}`),s):(t.warn(`Unknown formatter: ${e}. Using default - stylish.`),Cs.stylishFormatter)}(t);return s(e)}}exports.DCLinter=Ms;