monacozen 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{cssMode-DruRQLIe.js → cssMode-CJXOwqou.js} +1 -1
- package/assets/{htmlMode-Fhr9uBMz.js → htmlMode-DXEYjoJO.js} +1 -1
- package/assets/{jsonMode-sWKd2TOR.js → jsonMode-CJ6m-6ix.js} +1 -1
- package/assets/{monaco-CpRKBeoV.js → monaco-eCLjoH9K.js} +5 -5
- package/assets/{tsMode-Ci9elq6o.js → tsMode-x1GCvxZU.js} +1 -1
- package/assets/{yaml.worker-DfkUf8rM.js → yaml.worker-DzOKX3TP.js} +2 -2
- package/assets/{yaml.worker-DlEkvGzq.js → yaml.worker-Y0uWi-gi.js} +1 -1
- package/package.json +1 -1
- package/src/main.js +9 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as e } from "./editor.api-BzOtwRIu.js";
|
|
2
2
|
import { _ as t, a as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v } from "./lspLanguageFeatures-bOiKIJ8R.js";
|
|
3
|
-
import { r as y } from "./monaco-
|
|
3
|
+
import { r as y } from "./monaco-eCLjoH9K.js";
|
|
4
4
|
//#region node_modules/monaco-editor/esm/vs/languages/features/css/workerManager.js
|
|
5
5
|
var b = 12e4, x = class {
|
|
6
6
|
constructor(e) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as e } from "./editor.api-BzOtwRIu.js";
|
|
2
2
|
import { _ as t, a as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v } from "./lspLanguageFeatures-bOiKIJ8R.js";
|
|
3
|
-
import { r as y } from "./monaco-
|
|
3
|
+
import { r as y } from "./monaco-eCLjoH9K.js";
|
|
4
4
|
//#region node_modules/monaco-editor/esm/vs/languages/features/html/workerManager.js
|
|
5
5
|
var b = 12e4, x = class {
|
|
6
6
|
constructor(e) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as e, p as t } from "./editor.api-BzOtwRIu.js";
|
|
2
2
|
import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y } from "./lspLanguageFeatures-bOiKIJ8R.js";
|
|
3
|
-
import { r as b } from "./monaco-
|
|
3
|
+
import { r as b } from "./monaco-eCLjoH9K.js";
|
|
4
4
|
//#region node_modules/monaco-editor/esm/vs/languages/features/json/workerManager.js
|
|
5
5
|
var x = 12e4, S = class {
|
|
6
6
|
constructor(e) {
|
|
@@ -36664,7 +36664,7 @@ var uH = "5.9.3", dH = /* @__PURE__ */ Fd({
|
|
|
36664
36664
|
onlyVisible: !1
|
|
36665
36665
|
}, {}, {}, yH), SH = () => wH().then((e) => e.getTypeScriptWorker()), CH = () => wH().then((e) => e.getJavaScriptWorker());
|
|
36666
36666
|
function wH() {
|
|
36667
|
-
return import("./tsMode-
|
|
36667
|
+
return import("./tsMode-x1GCvxZU.js");
|
|
36668
36668
|
}
|
|
36669
36669
|
V.onLanguage("typescript", () => wH().then((e) => e.setupTypeScript(bH))), V.onLanguage("javascript", () => wH().then((e) => e.setupJavaScript(xH)));
|
|
36670
36670
|
//#endregion
|
|
@@ -39644,7 +39644,7 @@ var LG = /* @__PURE__ */ Fd({
|
|
|
39644
39644
|
documentRangeFormattingEdits: !0
|
|
39645
39645
|
}, VG = new RG("css", zG, BG), HG = new RG("scss", zG, BG), UG = new RG("less", zG, BG);
|
|
39646
39646
|
function WG() {
|
|
39647
|
-
return import("./cssMode-
|
|
39647
|
+
return import("./cssMode-CJXOwqou.js");
|
|
39648
39648
|
}
|
|
39649
39649
|
V.onLanguage("less", () => {
|
|
39650
39650
|
WG().then((e) => e.setupMode(UG));
|
|
@@ -39721,7 +39721,7 @@ function JG(e) {
|
|
|
39721
39721
|
}
|
|
39722
39722
|
var YG = "html", XG = "handlebars", ZG = "razor", QG = aK(YG, qG, JG(YG)), $G = QG.defaults, eK = aK(XG, qG, JG(XG)), tK = eK.defaults, nK = aK(ZG, qG, JG(ZG)), rK = nK.defaults;
|
|
39723
39723
|
function iK() {
|
|
39724
|
-
return import("./htmlMode-
|
|
39724
|
+
return import("./htmlMode-DXEYjoJO.js");
|
|
39725
39725
|
}
|
|
39726
39726
|
function aK(e, t = qG, n = JG(e)) {
|
|
39727
39727
|
let r = new KG(e, t, n), i, a = V.onLanguage(e, async () => {
|
|
@@ -39783,7 +39783,7 @@ var oK = /* @__PURE__ */ Fd({
|
|
|
39783
39783
|
selectionRanges: !0
|
|
39784
39784
|
}), cK = () => lK().then((e) => e.getWorker());
|
|
39785
39785
|
function lK() {
|
|
39786
|
-
return import("./jsonMode-
|
|
39786
|
+
return import("./jsonMode-CJ6m-6ix.js");
|
|
39787
39787
|
}
|
|
39788
39788
|
V.register({
|
|
39789
39789
|
id: "json",
|
|
@@ -40853,7 +40853,7 @@ var Eq = (e, t, n, r) => {
|
|
|
40853
40853
|
case "html":
|
|
40854
40854
|
case "handlebars":
|
|
40855
40855
|
case "razor": return import("./html.worker-CjDeE2MB.js");
|
|
40856
|
-
case "yaml": return import("./yaml.worker-
|
|
40856
|
+
case "yaml": return import("./yaml.worker-Y0uWi-gi.js");
|
|
40857
40857
|
case "typescript":
|
|
40858
40858
|
case "javascript": return import("./ts.worker-BydNuElr.js");
|
|
40859
40859
|
default: return import("./editorWebWorkerMain-5pwK50BL.js");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e, c as t, f as n, m as r, o as i, p as a } from "./editor.api-BzOtwRIu.js";
|
|
2
|
-
import { n as o, r as s } from "./monaco-
|
|
2
|
+
import { n as o, r as s } from "./monaco-eCLjoH9K.js";
|
|
3
3
|
//#region node_modules/monaco-editor/esm/vs/languages/features/typescript/workerManager.js
|
|
4
4
|
var c = class {
|
|
5
5
|
constructor(e, t) {
|
|
@@ -390,7 +390,7 @@ ${f}`),i.reset(f)}function cH(e,t,n={}){return sH(e,t,n)}async function lH(e,t){
|
|
|
390
390
|
`,e)}return{formatted:p,cursorOffset:f,comments:u.comments}}function RH(e,t,n){return typeof t!=`number`||Number.isNaN(t)||t<0||t>e.length?n:t}function zH(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i}=t;return n=RH(e,n,-1),r=RH(e,r,0),i=RH(e,i,e.length),{...t,cursorOffset:n,rangeStart:r,rangeEnd:i}}function BH(e,t){let{cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:a}=zH(e,t),o=e.charAt(0)===PH;if(o&&(e=e.slice(1),n--,r--,i--),a===`auto`&&(a=iL(e)),e.includes(`\r`)){let t=t=>sL(e.slice(0,Math.max(t,0)),`\r
|
|
391
391
|
`);n-=t(n),r-=t(r),i-=t(i),e=lL(e)}return{hasBOM:o,text:e,options:zH(e,{...t,cursorOffset:n,rangeStart:r,rangeEnd:i,endOfLine:a})}}async function VH(e,t){let n=await qV(t);return!n.hasPragma||n.hasPragma(e)}async function HH(e,t){return(await qV(t)).hasIgnorePragma?.(e)}async function UH(e,t){let{hasBOM:n,text:r,options:i}=BH(e,await iH(t));if(i.rangeStart>=i.rangeEnd&&r!==``||i.requirePragma&&!await VH(r,i)||i.checkIgnorePragma&&await HH(r,i))return{formatted:e,cursorOffset:t.cursorOffset,comments:[]};let a;return i.rangeStart>0||i.rangeEnd<r.length?a=await LH(r,i):(!i.requirePragma&&i.insertPragma&&i.printer.insertPragma&&!await VH(r,i)&&(r=i.printer.insertPragma(r)),a=await IH(r,i)),n&&(a.formatted=PH+a.formatted,a.cursorOffset>=0&&a.cursorOffset++),a}async function WH(e,t,n){let{text:r,options:i}=BH(e,await iH(t)),a=await dH(r,i);return n&&(n.preprocessForPrint&&(a.ast=await vH(a.ast,i)),n.massage&&(a.ast=SH(a.ast,i))),a}async function GH(e,t){return t=await iH(t),uz(await gH(e,t),t)}async function KH(e,t){let{formatted:n}=await UH(jR(e),{...t,parser:`__js_expression`});return n}async function qH(e,t){t=await iH(t);let{ast:n}=await dH(e,t);return t.cursorOffset>=0&&(t={...t,...bH(n,t)}),gH(n,t)}async function JH(e,t){return uz(e,await iH(t))}var YH={};UI(YH,{builders:()=>XH,printer:()=>ZH,utils:()=>QH});var XH={join:yR,line:xR,softline:SR,hardline:wR,literalline:ER,group:hR,conditionalGroup:gR,fill:mR,lineSuffix:DR,lineSuffixBoundary:OR,cursor:pR,breakParent:fR,ifBreak:_R,trim:kR,indent:oR,indentIfBreak:vR,align:sR,addAlignmentToDoc:dR,markAsRoot:lR,dedentToRoot:cR,dedent:uR,hardlineWithoutBreakParent:CR,literallineWithoutBreakParent:TR,label:bR,concat:e=>e},ZH={printDocToString:uz},QH={willBreak:HL,traverseDoc:RL,findInDoc:BL,mapDoc:zL,removeLines:KL,stripTrailingHardline:YL,replaceEndOfLine:QL,canBreak:eR},$H=`3.9.9`,eU={};UI(eU,{addDanglingComment:()=>Lz,addLeadingComment:()=>Iz,addTrailingComment:()=>Rz,getAlignmentSize:()=>fz,getIndentSize:()=>uU,getMaxContinuousCount:()=>pU,getNextNonSpaceNonCommentCharacter:()=>hU,getNextNonSpaceNonCommentCharacterIndex:()=>EU,getPreferredQuote:()=>bU,getStringWidth:()=>XR,hasNewline:()=>Dz,hasNewlineInRange:()=>SU,hasSpaces:()=>wU,isNextLineEmpty:()=>jU,isNextLineEmptyAfterIndex:()=>cU,isPreviousLineEmpty:()=>OU,makeString:()=>AU,skip:()=>vz,skipEverythingButNewLine:()=>Sz,skipInlineComment:()=>nU,skipNewline:()=>Tz,skipSpaces:()=>bz,skipToLineEnd:()=>xz,skipTrailingComment:()=>iU,skipWhitespace:()=>yz});function tU(e,t){if(t===!1)return!1;if(e.charAt(t)===`/`&&e.charAt(t+1)===`*`){for(let n=t+2;n<e.length;++n)if(e.charAt(n)===`*`&&e.charAt(n+1)===`/`)return n+2}return t}var nU=tU;function rU(e,t){return t===!1?!1:e.charAt(t)===`/`&&e.charAt(t+1)===`/`?Sz(e,t):t}var iU=rU;function aU(e,t){let n=null,r=t;for(;r!==n;)n=r,r=bz(e,r),r=nU(e,r),r=iU(e,r),r=Tz(e,r);return r}var oU=aU;function sU(e,t){let n=null,r=t;for(;r!==n;)n=r,r=xz(e,r),r=nU(e,r),r=bz(e,r);return r=iU(e,r),r=Tz(e,r),r!==!1&&Dz(e,r)}var cU=sU;function lU(e,t){let n=e.lastIndexOf(`
|
|
392
392
|
`);return n===-1?0:fz(e.slice(n+1).match(/^[\t ]*/)[0],t)}var uU=lU;function dU(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function fU(e,t){let n=e.matchAll(RegExp(`(?:${dU(t)})+`,`g`));return n.reduce||(n=[...n]),n.reduce((e,[t])=>Math.max(e,t.length),0)/t.length}var pU=fU;function mU(e,t){let n=oU(e,t);return n===!1?``:e.charAt(n)}var hU=mU,gU=Object.freeze({character:`'`,codePoint:39}),_U=Object.freeze({character:`"`,codePoint:34}),vU=Object.freeze({preferred:gU,alternate:_U}),yU=Object.freeze({preferred:_U,alternate:gU});function bU(e,t){let{preferred:n,alternate:r}=t===!0||t===`'`?vU:yU,{length:i}=e,a=0,o=0;for(let t=0;t<i;t++){let i=e.charCodeAt(t);i===n.codePoint?a++:i===r.codePoint&&o++}return(a>o?r:n).character}function xU(e,t,n){for(let r=t;r<n;++r)if(e.charAt(r)===`
|
|
393
|
-
`)return!0;return!1}var SU=xU;function CU(e,t,n={}){return bz(e,n.backwards?t-1:t,n)!==t}var wU=CU;function TU(e,t,n){return oU(e,n(t))}function EU(e,t){return arguments.length===2||typeof t==`number`?oU(e,t):TU(...arguments)}function DU(e,t,n){return Yz(e,n(t))}function OU(e,t){return arguments.length===2||typeof t==`number`?Yz(e,t):DU(...arguments)}function kU(e,t,n){return cU(e,n(t))}function AU(e,t,n){let r=t===`"`?`'`:`"`;return t+KI(0,e,/\\(.)|(["'])/gs,(e,i,a)=>i===r?i:a===t?`\\`+a:a||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(i)?i:`\\`+i))+t}function jU(e,t){return arguments.length===2||typeof t==`number`?cU(e,t):kU(...arguments)}function MU(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},await e(...n)}}var NU=MU(UH);async function PU(e,t){let{formatted:n}=await NU(e,{...t,cursorOffset:-1});return n}async function FU(e,t){return await PU(e,t)===e}var IU=MU(lB,0),LU={parse:MU(WH),formatAST:MU(GH),formatDoc:MU(KH),printToDoc:MU(qH),printDocToString:MU(JH)},RU=Object.getOwnPropertyNames,zU=((e,t)=>function(){return t||(0,e[RU(e)[0]])((t={exports:{}}).exports,t),t.exports})({"fillers/json-schema.json"(e,t){t.exports={}}});function BU(e){let t=[];try{for(let n of Or(e.getText()))T(n,(r,i,a)=>{if(!_(i))return;let o=i.resolve(n);if(!o||!a.includes(o)||!i.range)return;let[s,c]=i.range;t.push({code:`recursive-alias`,message:`Recursive YAML alias ${String(i)} is not supported.`,range:{start:e.positionAt(s),end:e.positionAt(c)},severity:1,source:`YAML`})})}catch{}return t}function VU(e,t){if(e.length<t.length)return!1;for(var n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function HU(e,t){var n=e.length-t.length;return n>0?e.lastIndexOf(t)===n:n===0&&e===t}function UU(e){return VU(e,`(?i)`)?new RegExp(e.substring(4),`i`):new RegExp(e)}function WU(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`||Array.isArray(e)!==Array.isArray(t))return!1;var n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!WU(e[n],t[n]))return!1}else{var i=[];for(r in e)i.push(r);i.sort();var a=[];for(r in t)a.push(r);if(a.sort(),!WU(i,a))return!1;for(n=0;n<i.length;n++)if(!WU(e[i[n]],t[i[n]]))return!1}return!0}function GU(e){return typeof e==`number`}function KU(e){return e!==void 0}function qU(e){return typeof e==`boolean`}function JU(e){return typeof e==`string`}var YU;(function(e){e[e.Undefined=0]=`Undefined`,e[e.EnumValueMismatch=1]=`EnumValueMismatch`,e[e.Deprecated=2]=`Deprecated`,e[e.UnexpectedEndOfComment=257]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=258]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=259]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=260]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=261]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=262]=`InvalidCharacter`,e[e.PropertyExpected=513]=`PropertyExpected`,e[e.CommaExpected=514]=`CommaExpected`,e[e.ColonExpected=515]=`ColonExpected`,e[e.ValueExpected=516]=`ValueExpected`,e[e.CommaOrCloseBacketExpected=517]=`CommaOrCloseBacketExpected`,e[e.CommaOrCloseBraceExpected=518]=`CommaOrCloseBraceExpected`,e[e.TrailingComma=519]=`TrailingComma`,e[e.DuplicateKey=520]=`DuplicateKey`,e[e.CommentNotPermitted=521]=`CommentNotPermitted`,e[e.SchemaResolveError=768]=`SchemaResolveError`})(YU||={});var XU;(function(e){e.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[Uf.Markdown,Uf.PlainText],commitCharactersSupport:!0}}}}})(XU||={});var ZU=(e,t,...n)=>n.length===0?t:t.replaceAll(/{(\d+)}/g,(e,[t])=>t in n?String(n[t]):e);function QU(){return ZU}var $U=/* @__PURE__ */ (function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),eW=QU(),tW={"color-hex":{errorMessage:eW(`colorHexFormatWarning`,`Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.`),pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:eW(`dateTimeFormatWarning`,`String is not a RFC3339 date-time.`),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:eW(`dateFormatWarning`,`String is not a RFC3339 date.`),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:eW(`timeFormatWarning`,`String is not a RFC3339 time.`),pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:eW(`emailFormatWarning`,`String is not an e-mail address.`),pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},nW=(function(){function e(e,t,n){n===void 0&&(n=0),this.offset=t,this.length=n,this.parent=e}return Object.defineProperty(e.prototype,"children",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return`type: `+this.type+` (`+this.offset+`/`+this.length+`)`+(this.parent?` parent: {`+this.parent.toString()+`}`:``)},e})();(function(e){$U(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.type=`null`,r.value=null,r}return t})(nW),(function(e){$U(t,e);function t(t,n,r){var i=e.call(this,t,r)||this;return i.type=`boolean`,i.value=n,i}return t})(nW),(function(e){$U(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.type=`array`,r.items=[],r}return Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!1,configurable:!0}),t})(nW),(function(e){$U(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.type=`number`,r.isInteger=!0,r.value=NaN,r}return t})(nW),(function(e){$U(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.type=`string`,i.value=``,i}return t})(nW),(function(e){$U(t,e);function t(t,n,r){var i=e.call(this,t,n)||this;return i.type=`property`,i.colonOffset=-1,i.keyNode=r,i}return Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!1,configurable:!0}),t})(nW),(function(e){$U(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.type=`object`,r.properties=[],r}return Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!1,configurable:!0}),t})(nW);function rW(e){return qU(e)?e?{}:{not:{}}:e}var iW;(function(e){e[e.Key=0]=`Key`,e[e.Enum=1]=`Enum`})(iW||={});var aW=(function(){function e(e,t){e===void 0&&(e=-1),this.focusOffset=e,this.exclude=t,this.schemas=[]}return e.prototype.add=function(e){this.schemas.push(e)},e.prototype.merge=function(e){Array.prototype.push.apply(this.schemas,e.schemas)},e.prototype.include=function(e){return(this.focusOffset===-1||lW(e,this.focusOffset))&&e!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e})(),oW=(function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.add=function(e){},e.prototype.merge=function(e){},e.prototype.include=function(e){return!0},e.prototype.newSub=function(){return this},e.instance=new e,e})(),sW=(function(){function e(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=void 0}return e.prototype.hasProblems=function(){return!!this.problems.length},e.prototype.mergeAll=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];this.merge(r)}},e.prototype.merge=function(e){this.problems=this.problems.concat(e.problems)},e.prototype.mergeEnumValues=function(e){if(!this.enumValueMatch&&!e.enumValueMatch&&this.enumValues&&e.enumValues){this.enumValues=this.enumValues.concat(e.enumValues);for(var t=0,n=this.problems;t<n.length;t++){var r=n[t];r.code===YU.EnumValueMismatch&&(r.message=eW(`enumWarning`,`Value is not accepted. Valid values: {0}.`,this.enumValues.map(function(e){return JSON.stringify(e)}).join(`, `)))}}},e.prototype.mergePropertyMatch=function(e){this.merge(e),this.propertiesMatches++,(e.enumValueMatch||!e.hasProblems()&&e.propertiesMatches)&&this.propertiesValueMatches++,e.enumValueMatch&&e.enumValues&&e.enumValues.length===1&&this.primaryValueMatches++},e.prototype.compare=function(e){var t=this.hasProblems();return t===e.hasProblems()?this.enumValueMatch===e.enumValueMatch?this.primaryValueMatches===e.primaryValueMatches?this.propertiesValueMatches===e.propertiesValueMatches?this.propertiesMatches-e.propertiesMatches:this.propertiesValueMatches-e.propertiesValueMatches:this.primaryValueMatches-e.primaryValueMatches:e.enumValueMatch?-1:1:t?-1:1},e})();function cW(e){return zd(e)}function lW(e,t,n){return n===void 0&&(n=!1),t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}(function(){function e(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=[]),this.root=e,this.syntaxErrors=t,this.comments=n}return e.prototype.getNodeFromOffset=function(e,t){if(t===void 0&&(t=!1),this.root)return Rd(this.root,e,t)},e.prototype.visit=function(e){if(this.root){var t=function(n){var r=e(n),i=n.children;if(Array.isArray(i))for(var a=0;a<i.length&&r;a++)r=t(i[a]);return r};t(this.root)}},e.prototype.validate=function(e,t,n){if(n===void 0&&(n=I.Warning),this.root&&t){var r=new sW;return uW(this.root,t,r,oW.instance),r.problems.map(function(t){var r=F.create(e.positionAt(t.location.offset),e.positionAt(t.location.offset+t.location.length));return Ef.create(r,t.message,t.severity??n,t.code)})}},e.prototype.getMatchingSchemas=function(e,t,n){t===void 0&&(t=-1);var r=new aW(t,n);return this.root&&e&&uW(this.root,e,new sW,r),r.schemas},e})();function uW(e,t,n,r){if(!e||!r.include(e))return;var i=e;switch(i.type){case`object`:l(i,t,n,r);break;case`array`:c(i,t,n,r);break;case`string`:s(i,t,n,r);break;case`number`:o(i,t,n,r);break;case`property`:return uW(i.valueNode,t,n,r)}a(),r.add({node:i,schema:t});function a(){function e(e){return i.type===e||e===`integer`&&i.type===`number`&&i.isInteger}if(Array.isArray(t.type)?t.type.some(e)||n.problems.push({location:{offset:i.offset,length:i.length},message:t.errorMessage||eW(`typeArrayMismatchWarning`,`Incorrect type. Expected one of {0}.`,t.type.join(`, `))}):t.type&&(e(t.type)||n.problems.push({location:{offset:i.offset,length:i.length},message:t.errorMessage||eW(`typeMismatchWarning`,`Incorrect type. Expected "{0}".`,t.type)})),Array.isArray(t.allOf))for(var a=0,o=t.allOf;a<o.length;a++){var s=o[a];uW(i,rW(s),n,r)}var c=rW(t.not);if(c){var l=new sW,u=r.newSub();uW(i,c,l,u),l.hasProblems()||n.problems.push({location:{offset:i.offset,length:i.length},message:eW(`notSchemaWarning`,`Matches a schema that is not allowed.`)});for(var d=0,f=u.schemas;d<f.length;d++){var p=f[d];p.inverted=!p.inverted,r.add(p)}}var m=function(e,t){for(var a=[],o=void 0,s=0,c=e;s<c.length;s++){var l=c[s],u=rW(l),d=new sW,f=r.newSub();if(uW(i,u,d,f),d.hasProblems()||a.push(u),!o)o={schema:u,validationResult:d,matchingSchemas:f};else if(!t&&!d.hasProblems()&&!o.validationResult.hasProblems())o.matchingSchemas.merge(f),o.validationResult.propertiesMatches+=d.propertiesMatches,o.validationResult.propertiesValueMatches+=d.propertiesValueMatches;else{var p=d.compare(o.validationResult);p>0?o={schema:u,validationResult:d,matchingSchemas:f}:p===0&&(o.matchingSchemas.merge(f),o.validationResult.mergeEnumValues(d))}}return a.length>1&&t&&n.problems.push({location:{offset:i.offset,length:1},message:eW(`oneOfWarning`,`Matches multiple schemas when only one must validate.`)}),o&&(n.merge(o.validationResult),n.propertiesMatches+=o.validationResult.propertiesMatches,n.propertiesValueMatches+=o.validationResult.propertiesValueMatches,r.merge(o.matchingSchemas)),a.length};Array.isArray(t.anyOf)&&m(t.anyOf,!1),Array.isArray(t.oneOf)&&m(t.oneOf,!0);var h=function(e){var t=new sW,a=r.newSub();uW(i,rW(e),t,a),n.merge(t),n.propertiesMatches+=t.propertiesMatches,n.propertiesValueMatches+=t.propertiesValueMatches,r.merge(a)},g=function(e,t,n){var a=rW(e),o=new sW,s=r.newSub();uW(i,a,o,s),r.merge(s),o.hasProblems()?n&&h(n):t&&h(t)},_=rW(t.if);if(_&&g(_,rW(t.then),rW(t.else)),Array.isArray(t.enum)){for(var v=cW(i),y=!1,b=0,x=t.enum;b<x.length;b++){var S=x[b];if(WU(v,S)){y=!0;break}}n.enumValues=t.enum,n.enumValueMatch=y,y||n.problems.push({location:{offset:i.offset,length:i.length},code:YU.EnumValueMismatch,message:t.errorMessage||eW(`enumWarning`,`Value is not accepted. Valid values: {0}.`,t.enum.map(function(e){return JSON.stringify(e)}).join(`, `))})}if(KU(t.const)){var v=cW(i);WU(v,t.const)?n.enumValueMatch=!0:(n.problems.push({location:{offset:i.offset,length:i.length},code:YU.EnumValueMismatch,message:t.errorMessage||eW(`constWarning`,`Value must be {0}.`,JSON.stringify(t.const))}),n.enumValueMatch=!1),n.enumValues=[t.const]}t.deprecationMessage&&i.parent&&n.problems.push({location:{offset:i.parent.offset,length:i.parent.length},severity:I.Warning,message:t.deprecationMessage,code:YU.Deprecated})}function o(e,t,n,r){var i=e.value;function a(e){var t=/^(-?\d+)(?:\.(\d+))?(?:e([-+]\d+))?$/.exec(e.toString());return t&&{value:Number(t[1]+(t[2]||``)),multiplier:(t[2]?.length||0)-(parseInt(t[3])||0)}}if(GU(t.multipleOf)){var o=-1;if(Number.isInteger(t.multipleOf))o=i%t.multipleOf;else{var s=a(t.multipleOf),c=a(i);if(s&&c){var l=10**Math.abs(c.multiplier-s.multiplier);c.multiplier<s.multiplier?c.value*=l:s.value*=l,o=c.value%s.value}}o!==0&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`multipleOfWarning`,`Value is not divisible by {0}.`,t.multipleOf)})}function u(e,t){if(GU(t))return t;if(qU(t)&&t)return e}function d(e,t){if(!qU(t)||!t)return e}var f=u(t.minimum,t.exclusiveMinimum);GU(f)&&i<=f&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`exclusiveMinimumWarning`,`Value is below the exclusive minimum of {0}.`,f)});var p=u(t.maximum,t.exclusiveMaximum);GU(p)&&i>=p&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`exclusiveMaximumWarning`,`Value is above the exclusive maximum of {0}.`,p)});var m=d(t.minimum,t.exclusiveMinimum);GU(m)&&i<m&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`minimumWarning`,`Value is below the minimum of {0}.`,m)});var h=d(t.maximum,t.exclusiveMaximum);GU(h)&&i>h&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`maximumWarning`,`Value is above the maximum of {0}.`,h)})}function s(e,t,n,r){if(GU(t.minLength)&&e.value.length<t.minLength&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`minLengthWarning`,`String is shorter than the minimum length of {0}.`,t.minLength)}),GU(t.maxLength)&&e.value.length>t.maxLength&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`maxLengthWarning`,`String is longer than the maximum length of {0}.`,t.maxLength)}),JU(t.pattern)&&(UU(t.pattern).test(e.value)||n.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||eW(`patternWarning`,`String does not match the pattern of "{0}".`,t.pattern)})),t.format)switch(t.format){case`uri`:case`uri-reference`:var i=void 0;if(!e.value)i=eW(`uriEmpty`,`URI expected.`);else{var a=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(e.value);a?!a[2]&&t.format===`uri`&&(i=eW(`uriSchemeMissing`,`URI with a scheme is expected.`)):i=eW(`uriMissing`,`URI is expected.`)}i&&n.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||eW(`uriFormatWarning`,`String is not a URI: {0}`,i)});break;case`color-hex`:case`date-time`:case`date`:case`time`:case`email`:var o=tW[t.format];(!e.value||!o.pattern.exec(e.value))&&n.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||o.errorMessage})}}function c(e,t,n,r){if(Array.isArray(t.items)){for(var i=t.items,a=0;a<i.length;a++){var o=i[a],s=rW(o),c=new sW,l=e.items[a];l?(uW(l,s,c,r),n.mergePropertyMatch(c)):e.items.length>=i.length&&n.propertiesValueMatches++}if(e.items.length>i.length){if(typeof t.additionalItems==`object`)for(var u=i.length;u<e.items.length;u++){var c=new sW;uW(e.items[u],t.additionalItems,c,r),n.mergePropertyMatch(c)}else t.additionalItems===!1&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`additionalItemsWarning`,`Array has too many items according to schema. Expected {0} or fewer.`,i.length)})}}else{var d=rW(t.items);if(d)for(var f=0,p=e.items;f<p.length;f++){var l=p[f],c=new sW;uW(l,d,c,r),n.mergePropertyMatch(c)}}var m=rW(t.contains);if(m&&(e.items.some(function(e){var t=new sW;return uW(e,m,t,oW.instance),!t.hasProblems()})||n.problems.push({location:{offset:e.offset,length:e.length},message:t.errorMessage||eW(`requiredItemMissingWarning`,`Array does not contain required item.`)})),GU(t.minItems)&&e.items.length<t.minItems&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`minItemsWarning`,`Array has too few items. Expected {0} or more.`,t.minItems)}),GU(t.maxItems)&&e.items.length>t.maxItems&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`maxItemsWarning`,`Array has too many items. Expected {0} or fewer.`,t.maxItems)}),t.uniqueItems===!0){var h=cW(e);h.some(function(e,t){return t!==h.lastIndexOf(e)})&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`uniqueItemsWarning`,`Array has duplicate items.`)})}}function l(e,t,n,r){for(var i=/* @__PURE__ */ Object.create(null),a=[],o=0,s=e.properties;o<s.length;o++){var c=s[o],l=c.keyNode.value;i[l]=c.valueNode,a.push(l)}if(Array.isArray(t.required))for(var u=0,d=t.required;u<d.length;u++){var f=d[u];if(!i[f]){var p=e.parent&&e.parent.type===`property`&&e.parent.keyNode,m=p?{offset:p.offset,length:p.length}:{offset:e.offset,length:1};n.problems.push({location:m,message:eW(`MissingRequiredPropWarning`,`Missing property "{0}".`,f)})}}var h=function(e){for(var t=a.indexOf(e);t>=0;)a.splice(t,1),t=a.indexOf(e)};if(t.properties)for(var g=0,_=Object.keys(t.properties);g<_.length;g++){var f=_[g];h(f);var v=t.properties[f],y=i[f];if(y){if(qU(v)){if(v)n.propertiesMatches++,n.propertiesValueMatches++;else{var c=y.parent;n.problems.push({location:{offset:c.keyNode.offset,length:c.keyNode.length},message:t.errorMessage||eW(`DisallowedExtraPropWarning`,`Property {0} is not allowed.`,f)})}}else{var b=new sW;uW(y,v,b,r),n.mergePropertyMatch(b)}}}if(t.patternProperties)for(var x=0,S=Object.keys(t.patternProperties);x<S.length;x++)for(var C=S[x],w=UU(C),ee=0,te=a.slice(0);ee<te.length;ee++){var f=te[ee];if(w.test(f)){h(f);var y=i[f];if(y){var v=t.patternProperties[C];if(qU(v)){if(v)n.propertiesMatches++,n.propertiesValueMatches++;else{var c=y.parent;n.problems.push({location:{offset:c.keyNode.offset,length:c.keyNode.length},message:t.errorMessage||eW(`DisallowedExtraPropWarning`,`Property {0} is not allowed.`,f)})}}else{var b=new sW;uW(y,v,b,r),n.mergePropertyMatch(b)}}}}if(typeof t.additionalProperties==`object`)for(var ne=0,re=a;ne<re.length;ne++){var f=re[ne],y=i[f];if(y){var b=new sW;uW(y,t.additionalProperties,b,r),n.mergePropertyMatch(b)}}else if(t.additionalProperties===!1&&a.length>0)for(var T=0,ie=a;T<ie.length;T++){var f=ie[T],y=i[f];if(y){var c=y.parent;n.problems.push({location:{offset:c.keyNode.offset,length:c.keyNode.length},message:t.errorMessage||eW(`DisallowedExtraPropWarning`,`Property {0} is not allowed.`,f)})}}if(GU(t.maxProperties)&&e.properties.length>t.maxProperties&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`MaxPropWarning`,`Object has more properties than limit of {0}.`,t.maxProperties)}),GU(t.minProperties)&&e.properties.length<t.minProperties&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`MinPropWarning`,`Object has fewer properties than the required number of {0}`,t.minProperties)}),t.dependencies)for(var ae=0,oe=Object.keys(t.dependencies);ae<oe.length;ae++){var l=oe[ae];if(i[l]){var se=t.dependencies[l];if(Array.isArray(se))for(var ce=0,le=se;ce<le.length;ce++){var ue=le[ce];i[ue]?n.propertiesValueMatches++:n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`RequiredDependentPropWarning`,`Object is missing property {0} required by property {1}.`,ue,l)})}else{var v=rW(se);if(v){var b=new sW;uW(e,v,b,r),n.mergePropertyMatch(b)}}}}var de=rW(t.propertyNames);if(de)for(var fe=0,pe=e.properties;fe<pe.length;fe++){var l=pe[fe].keyNode;l&&uW(l,de,n,oW.instance)}}}function dW(e,t){if(typeof e!=`string`)throw TypeError(`Expected a string`);for(var n=String(e),r=``,i=t?!!t.extended:!1,a=t?!!t.globstar:!1,o=!1,s=t&&typeof t.flags==`string`?t.flags:``,c,l=0,u=n.length;l<u;l++)switch(c=n[l],c){case`/`:case`$`:case`^`:case`+`:case`.`:case`(`:case`)`:case`=`:case`!`:case`|`:r+=`\\`+c;break;case`?`:if(i){r+=`.`;break}case`[`:case`]`:if(i){r+=c;break}case`{`:if(i){o=!0,r+=`(`;break}case`}`:if(i){o=!1,r+=`)`;break}case`,`:if(o){r+=`|`;break}r+=`\\`+c;break;case`*`:for(var d=n[l-1],f=1;n[l+1]===`*`;)f++,l++;var p=n[l+1];a?f>1&&(d===`/`||d===void 0||d===`{`||d===`,`)&&(p===`/`||p===void 0||p===`,`||p===`}`)?(p===`/`?l++:d===`/`&&r.endsWith(`\\/`)&&(r=r.substr(0,r.length-2)),r+=`((?:[^/]*(?:/|$))*)`):r+=`([^/]*)`:r+=`.*`;break;default:r+=c}return(!s||!~s.indexOf(`g`))&&(r=`^`+r+`$`),new RegExp(r,s)}var fW=QU(),pW=`!`,mW=`/`,hW=(function(){function e(e,t){this.globWrappers=[];try{for(var n=0,r=e;n<r.length;n++){var i=r[n],a=i[0]!==pW;a||(i=i.substring(1)),i.length>0&&(i[0]===mW&&(i=i.substring(1)),this.globWrappers.push({regexp:dW(`**/`+i,{extended:!0,globstar:!0}),include:a}))}this.uris=t}catch{this.globWrappers.length=0,this.uris=[]}}return e.prototype.matchesPattern=function(e){for(var t=!1,n=0,r=this.globWrappers;n<r.length;n++){var i=r[n],a=i.regexp,o=i.include;a.test(e)&&(t=o)}return t},e.prototype.getURIs=function(){return this.uris},e})(),gW=(function(){function e(e,t,n){this.service=e,this.url=t,this.dependencies={},n&&(this.unresolvedSchema=this.service.promise.resolve(new _W(n)))}return e.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||=this.service.loadSchema(this.url),this.unresolvedSchema},e.prototype.getResolvedSchema=function(){var e=this;return this.resolvedSchema||=this.getUnresolvedSchema().then(function(t){return e.service.resolveSchemaContent(t,e.url,e.dependencies)}),this.resolvedSchema},e.prototype.clearSchema=function(){this.resolvedSchema=void 0,this.unresolvedSchema=void 0,this.dependencies={}},e})(),_W=/* @__PURE__ */ (function(){function e(e,t){t===void 0&&(t=[]),this.schema=e,this.errors=t}return e})(),vW=(function(){function e(e,t){t===void 0&&(t=[]),this.schema=e,this.errors=t}return e.prototype.getSection=function(e){var t=this.getSectionRecursive(e,this.schema);if(t)return rW(t)},e.prototype.getSectionRecursive=function(e,t){if(!t||typeof t==`boolean`||e.length===0)return t;var n=e.shift();if(t.properties&&typeof t.properties[n])return this.getSectionRecursive(e,t.properties[n]);if(t.patternProperties)for(var r=0,i=Object.keys(t.patternProperties);r<i.length;r++){var a=i[r];if(UU(a).test(n))return this.getSectionRecursive(e,t.patternProperties[a])}else if(typeof t.additionalProperties==`object`)return this.getSectionRecursive(e,t.additionalProperties);else if(n.match(`[0-9]+`)){if(Array.isArray(t.items)){var o=parseInt(n,10);if(!isNaN(o)&&t.items[o])return this.getSectionRecursive(e,t.items[o])}else if(t.items)return this.getSectionRecursive(e,t.items)}},e})(),yW=(function(){function e(e,t,n){this.contextService=t,this.requestService=e,this.promiseConstructor=n||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations=[],this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={}}return e.prototype.getRegisteredSchemaIds=function(e){return Object.keys(this.registeredSchemasIds).filter(function(t){var n=Xd.parse(t).scheme;return n!==`schemaservice`&&(!e||e(n))})},Object.defineProperty(e.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(e){var t=this;this.cachedSchemaForResource=void 0;var n=!1;e=xW(e);for(var r=[e],i=Object.keys(this.schemasById).map(function(e){return t.schemasById[e]});r.length;)for(var a=r.pop(),o=0;o<i.length;o++){var s=i[o];s&&(s.url===a||s.dependencies[a])&&(s.url!==a&&r.push(s.url),s.clearSchema(),i[o]=void 0,n=!0)}return n},e.prototype.setSchemaContributions=function(e){if(e.schemas){var t=e.schemas;for(var n in t){var r=xW(n);this.contributionSchemas[r]=this.addSchemaHandle(r,t[n])}}if(Array.isArray(e.schemaAssociations))for(var i=e.schemaAssociations,a=0,o=i;a<o.length;a++){var s=o[a],c=s.uris.map(xW),l=this.addFilePatternAssociation(s.pattern,c);this.contributionAssociations.push(l)}},e.prototype.addSchemaHandle=function(e,t){var n=new gW(this,e,t);return this.schemasById[e]=n,n},e.prototype.getOrAddSchemaHandle=function(e,t){return this.schemasById[e]||this.addSchemaHandle(e,t)},e.prototype.addFilePatternAssociation=function(e,t){var n=new hW(e,t);return this.filePatternAssociations.push(n),n},e.prototype.registerExternalSchema=function(e,t,n){var r=xW(e);return this.registeredSchemasIds[r]=!0,this.cachedSchemaForResource=void 0,t&&this.addFilePatternAssociation(t,[e]),n?this.addSchemaHandle(r,n):this.getOrAddSchemaHandle(r)},e.prototype.clearExternalSchemas=function(){for(var e in this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={},this.cachedSchemaForResource=void 0,this.contributionSchemas)this.schemasById[e]=this.contributionSchemas[e],this.registeredSchemasIds[e]=!0;for(var t=0,n=this.contributionAssociations;t<n.length;t++){var r=n[t];this.filePatternAssociations.push(r)}},e.prototype.getResolvedSchema=function(e){var t=xW(e),n=this.schemasById[t];return n?n.getResolvedSchema():this.promise.resolve(void 0)},e.prototype.loadSchema=function(e){if(!this.requestService){var t=fW(`json.schema.norequestservice`,`Unable to load schema from '{0}'. No schema request service available`,CW(e));return this.promise.resolve(new _W({},[t]))}return this.requestService(e).then(function(t){if(!t)return new _W({},[fW(`json.schema.nocontent`,`Unable to load schema from '{0}': No content.`,CW(e))]);var n={},r=[];n=Ld(t,r);var i=r.length?[fW(`json.schema.invalidFormat`,`Unable to parse content from '{0}': Parse error at offset {1}.`,CW(e),r[0].offset)]:[];return new _W(n,i)},function(t){var n=t.toString(),r=t.toString().split(`Error: `);return r.length>1&&(n=r[1]),HU(n,`.`)&&(n=n.substr(0,n.length-1)),new _W({},[fW(`json.schema.nocontent`,`Unable to load schema from '{0}': {1}.`,CW(e),n)])})},e.prototype.resolveSchemaContent=function(e,t,n){var r=this,i=e.errors.slice(0),a=e.schema;if(a.$schema){var o=xW(a.$schema);if(o===`http://json-schema.org/draft-03/schema`)return this.promise.resolve(new vW({},[fW(`json.schema.draft03.notsupported`,`Draft-03 schemas are not supported.`)]));o===`https://json-schema.org/draft/2019-09/schema`&&i.push(fW(`json.schema.draft201909.notsupported`,`Draft 2019-09 schemas are not yet fully supported.`))}var s=this.contextService,c=function(e,t){if(!t)return e;var n=e;return t[0]===`/`&&(t=t.substr(1)),t.split(`/`).some(function(e){return e=e.replace(/~1/g,`/`).replace(/~0/g,`~`),n=n[e],!n}),n},l=function(e,t,n,r){var a=r?decodeURIComponent(r):void 0,o=c(t,a);if(o)for(var s in o)o.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(e[s]=o[s]);else i.push(fW(`json.schema.invalidref`,`$ref '{0}' in '{1}' can not be resolved.`,a,n))},u=function(e,t,n,a,o){s&&!/^[A-Za-z][A-Za-z0-9+\-.+]*:\/\/.*/.test(t)&&(t=s.resolveRelativePath(t,a)),t=xW(t);var c=r.getOrAddSchemaHandle(t);return c.getUnresolvedSchema().then(function(r){if(o[t]=!0,r.errors.length){var a=n?t+`#`+n:t;i.push(fW(`json.schema.problemloadingref`,`Problems loading reference '{0}': {1}`,a,r.errors[0]))}return l(e,r.schema,t,n),d(e,r.schema,t,c.dependencies)})},d=function(e,t,n,i){if(!e||typeof e!=`object`)return Promise.resolve(null);for(var a=[e],o=[],s=[],c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var i=r[n];typeof i==`object`&&a.push(i)}},d=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var i=r[n];if(typeof i==`object`)for(var o in i){var s=i[o];typeof s==`object`&&a.push(s)}}},f=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var i=r[n];if(Array.isArray(i))for(var o=0,s=i;o<s.length;o++){var c=s[o];typeof c==`object`&&a.push(c)}}},p=function(e){for(var r=[];e.$ref;){var a=e.$ref,o=a.split(`#`,2);if(delete e.$ref,o[0].length>0){s.push(u(e,o[0],o[1],n,i));return}r.indexOf(a)===-1&&(l(e,t,n,o[1]),r.push(a))}c(e.items,e.additionalItems,e.additionalProperties,e.not,e.contains,e.propertyNames,e.if,e.then,e.else),d(e.definitions,e.properties,e.patternProperties,e.dependencies),f(e.anyOf,e.allOf,e.oneOf,e.items)};a.length;){var m=a.pop();o.indexOf(m)>=0||(o.push(m),p(m))}return r.promise.all(s)};return d(a,a,t,n).then(function(e){return new vW(a,i)})},e.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&t.root.type===`object`){var n=t.root.properties.filter(function(e){return e.keyNode.value===`$schema`&&e.valueNode&&e.valueNode.type===`string`});if(n.length>0){var r=n[0].valueNode;if(r&&r.type===`string`){var i=cW(r);if(i&&VU(i,`.`)&&this.contextService&&(i=this.contextService.resolveRelativePath(i,e)),i){var a=xW(i);return this.getOrAddSchemaHandle(a).getResolvedSchema()}}}}if(this.cachedSchemaForResource&&this.cachedSchemaForResource.resource===e)return this.cachedSchemaForResource.resolvedSchema;for(var o=/* @__PURE__ */ Object.create(null),s=[],c=SW(e),l=0,u=this.filePatternAssociations;l<u.length;l++){var d=u[l];if(d.matchesPattern(c))for(var f=0,p=d.getURIs();f<p.length;f++){var m=p[f];o[m]||(s.push(m),o[m]=!0)}}var h=s.length>0?this.createCombinedSchema(e,s).getResolvedSchema():this.promise.resolve(void 0);return this.cachedSchemaForResource={resource:e,resolvedSchema:h},h},e.prototype.createCombinedSchema=function(e,t){if(t.length===1)return this.getOrAddSchemaHandle(t[0]);var n=`schemaservice://combinedSchema/`+encodeURIComponent(e),r={allOf:t.map(function(e){return{$ref:e}})};return this.addSchemaHandle(n,r)},e.prototype.getMatchingSchemas=function(e,t,n){if(n){var r=n.id||`schemaservice://untitled/matchingSchemas/`+bW++;return this.resolveSchemaContent(new _W(n),r,{}).then(function(e){return t.getMatchingSchemas(e.schema).filter(function(e){return!e.inverted})})}return this.getSchemaForResource(e.uri,t).then(function(e){return e?t.getMatchingSchemas(e.schema).filter(function(e){return!e.inverted}):[]})},e})(),bW=0;function xW(e){try{return Xd.parse(e).toString()}catch{return e}}function SW(e){try{return Xd.parse(e).with({fragment:null,query:null}).toString()}catch{return e}}function CW(e){try{var t=Xd.parse(e);if(t.scheme===`file`)return t.fsPath}catch{}return e}var wW;(function(e){e.draft04=`draft04`,e.draft07=`draft07`,e.draft2019=`draft2019-09`,e.draft2020=`draft2020-12`})(wW||={});function TW(e){switch(e.type){case`array`:return e.children.map(TW);case`object`:{let t=/* @__PURE__ */ Object.create(null);for(let n=0,r=e.children;n<r.length;n++){let e=r[n],i=e.children[1];i&&(t[e.children[0].value]=TW(i))}return t}case`null`:case`string`:case`number`:return e.value;case`boolean`:return e.source;default:return}}function EW(e,t,n=!1){return t>=e.offset&&t<=e.offset+e.length||n&&t===e.offset+e.length}function DW(e,t,n){if(n===void 0&&(n=!1),EW(e,t,n)){let r=e.children;if(Array.isArray(r))for(let e=0;e<r.length&&r[e].offset<=t;e++){let i=DW(r[e],t,n);if(i)return i}return e}}function OW(e){if([`true`,`True`,`TRUE`,`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`].lastIndexOf(e)>=0)return!0;if([`false`,`False`,`FALSE`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`].lastIndexOf(e)>=0)return!1;throw`Invalid boolean "${e}"`}function kW(e,t,n){if(n===`boolean`&&typeof e==`string`&&(e=OW(e)),e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`||Array.isArray(e)!==Array.isArray(t))return!1;let r,i;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(r=0;r<e.length;r++)if(!kW(e[r],t[r]))return!1}else{let n=[];for(i in e)n.push(i);n.sort();let a=[];for(i in t)a.push(i);if(a.sort(),!kW(n,a))return!1;for(r=0;r<n.length;r++)if(!kW(e[n[r]],t[n[r]]))return!1}return!0}function AW(e){return typeof e==`number`}function jW(e){return e!==void 0}function MW(e){return typeof e==`boolean`}function NW(e){return typeof e==`string`}function PW(e){return Symbol.iterator in Object(e)}function FW(e){let t=e.type&&e.closestTitle;return e.title?e.title:e.$id?IW(e.$id):e.$ref||e._$ref?IW(e.$ref||e._$ref):Array.isArray(e.type)?e.type.join(` | `):t?e.type.concat(`(`,e.closestTitle,`)`):e.type||e.closestTitle}function IW(e){let t=e.match(/^(?:.*\/)?(.*?)(?:\.schema\.json)?$/),n=!!t&&t[1];return n||(n=`typeNotFound`,console.error(`$ref (${e}) not parsed properly`)),n}function LW(e,t){let n=Xd.parse(t),r=Hp.basename(n.fsPath);return Hp.extname(n.fsPath)||(r+=`.json`),Object.getOwnPropertyDescriptor(e,`name`)?Object.getOwnPropertyDescriptor(e,`name`).value+` (${r})`:e.title?e.description?e.title+` - `+e.description+` (${r})`:e.title+` (${r})`:r}function RW(e){return e.type!==`object`&&!zW(e)}function zW(e){return!!(e.anyOf||e.allOf||e.oneOf)}function BW(e,t){for(let n of t.documents)if(n.internalDocument&&n.internalDocument.range[0]<=e&&n.internalDocument.range[2]>=e)return n;return t.documents.length===1?t.documents[0]:null}function VW(e){let t=[`mapping`,`scalar`,`sequence`];return e?e.filter(e=>{if(typeof e==`string`){let n=e.split(` `),r=n[1]&&n[1].toLowerCase()||`scalar`;return r!==`map`&&t.indexOf(r)!==-1}return!1}):[]}function HW(e,t){if(!t||!e||t.length!==e.length)return!1;for(let n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}function UW(e){return e.replace(/[-\\{}+?|^$.,[\]()#\s]/g,`\\$&`).replace(/[*]/g,`.*`)}function WW(e,t){if(e.length<t)return 0;for(let n=0;n<t;n++){let t=e.charCodeAt(n);if(t!==32&&t!==9)return n}return t}function GW(e){let t=``;e=e.replace(/\(\?([ims]+)\)/g,(e,n)=>{for(let e of n)t.includes(e)||(t+=e);return``});try{return new RegExp(e,t+`u`)}catch{try{return new RegExp(e,t)}catch{return}}}function KW(e,t){t++;for(let n=t;n<e.length;n++){let r=e.charAt(n);if(r===` `||r===` `)t++;else return t}return t}var qW=class{constructor(e){try{this.patternRegExp=RegExp(UW(e)+`$`)}catch{this.patternRegExp=null}this.schemas=[]}addSchema(e){this.schemas.push(e)}matchesPattern(e){return this.patternRegExp&&this.patternRegExp.test(e)}getSchemas(){return this.schemas}};function JW(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=Math.max(n,r);return parseInt(e.toFixed(i).replace(`.`,``))%parseInt(t.toFixed(i).replace(`.`,``))/10**i}var YW=QU(),XW=(function(){function e(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}return e.prototype.configure=function(e){e&&(this.validationEnabled=e.validate!==!1,this.commentSeverity=e.allowComments?void 0:I.Error)},e.prototype.doValidation=function(e,t,n,r){var i=this;if(!this.validationEnabled)return this.promise.resolve([]);var a=[],o={},s=function(e){var t=e.range.start.line+` `+e.range.start.character+` `+e.message;o[t]||(o[t]=!0,a.push(e))},c=function(r){var o=n?.trailingCommas?eG(n.trailingCommas):I.Error,c=n?.comments?eG(n.comments):i.commentSeverity,l=n?.schemaValidation?eG(n.schemaValidation):I.Warning,u=n?.schemaRequest?eG(n.schemaRequest):I.Warning;if(r){if(r.errors.length&&t.root&&u){var d=t.root,f=d.type===`object`?d.properties[0]:void 0;if(f&&f.keyNode.value===`$schema`){var p=f.valueNode||f,m=F.create(e.positionAt(p.offset),e.positionAt(p.offset+p.length));s(Ef.create(m,r.errors[0],u,YU.SchemaResolveError))}else{var m=F.create(e.positionAt(d.offset),e.positionAt(d.offset+1));s(Ef.create(m,r.errors[0],u,YU.SchemaResolveError))}}else if(l){var h=t.validate(e,r.schema,l);h&&h.forEach(s)}QW(r.schema)&&(c=void 0),$W(r.schema)&&(o=void 0)}for(var g=0,_=t.syntaxErrors;g<_.length;g++){var v=_[g];if(v.code===YU.TrailingComma){if(typeof o!=`number`)continue;v.severity=o}s(v)}if(typeof c==`number`){var y=YW(`InvalidCommentToken`,`Comments are not permitted in JSON.`);t.comments.forEach(function(e){s(Ef.create(e,y,c,YU.CommentNotPermitted))})}return a};if(r){var l=r.id||`schemaservice://untitled/`+ZW++;return this.jsonSchemaService.resolveSchemaContent(new _W(r),l,{}).then(function(e){return c(e)})}return this.jsonSchemaService.getSchemaForResource(e.uri,t).then(function(e){return c(e)})},e})(),ZW=0;function QW(e){if(e&&typeof e==`object`){if(qU(e.allowComments))return e.allowComments;if(e.allOf)for(var t=0,n=e.allOf;t<n.length;t++){var r=n[t],i=QW(r);if(qU(i))return i}}}function $W(e){if(e&&typeof e==`object`){if(qU(e.allowTrailingCommas))return e.allowTrailingCommas;var t=e;if(qU(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(e.allOf)for(var n=0,r=e.allOf;n<r.length;n++){var i=r[n],a=$W(i);if(qU(a))return a}}}function eG(e){switch(e){case`error`:return I.Error;case`warning`:return I.Warning;case`ignore`:return}}var tG=48,nG=57,rG=65,iG=97,aG=102;function oG(e){return e<tG?0:e<=nG?e-tG:(e<iG&&(e+=iG-rG),e>=iG&&e<=aG?e-iG+10:0)}function sG(e){if(e[0]===`#`)switch(e.length){case 4:return{red:oG(e.charCodeAt(1))*17/255,green:oG(e.charCodeAt(2))*17/255,blue:oG(e.charCodeAt(3))*17/255,alpha:1};case 5:return{red:oG(e.charCodeAt(1))*17/255,green:oG(e.charCodeAt(2))*17/255,blue:oG(e.charCodeAt(3))*17/255,alpha:oG(e.charCodeAt(4))*17/255};case 7:return{red:(oG(e.charCodeAt(1))*16+oG(e.charCodeAt(2)))/255,green:(oG(e.charCodeAt(3))*16+oG(e.charCodeAt(4)))/255,blue:(oG(e.charCodeAt(5))*16+oG(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(oG(e.charCodeAt(1))*16+oG(e.charCodeAt(2)))/255,green:(oG(e.charCodeAt(3))*16+oG(e.charCodeAt(4)))/255,blue:(oG(e.charCodeAt(5))*16+oG(e.charCodeAt(6)))/255,alpha:(oG(e.charCodeAt(7))*16+oG(e.charCodeAt(8)))/255}}}var cG=(function(){function e(e){this.schemaService=e}return e.prototype.findDocumentSymbols=function(e,t,n){var r=this;n===void 0&&(n={resultLimit:Number.MAX_VALUE});var i=t.root;if(!i)return[];var a=n.resultLimit||Number.MAX_VALUE,o=e.uri;if((o===`vscode://defaultsettings/keybindings.json`||HU(o.toLowerCase(),`/user/keybindings.json`))&&i.type===`array`){for(var s=[],c=0,l=i.items;c<l.length;c++){var u=l[c];if(u.type===`object`)for(var d=0,f=u.properties;d<f.length;d++){var p=f[d];if(p.keyNode.value===`key`&&p.valueNode){var m=gf.create(e.uri,lG(e,u));if(s.push({name:cW(p.valueNode),kind:op.Function,location:m}),a--,a<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(o),s}}}return s}for(var h=[{node:i,containerName:``}],g=0,_=!1,v=[],y=function(t,n){t.type===`array`?t.items.forEach(function(e){e&&h.push({node:e,containerName:n})}):t.type===`object`&&t.properties.forEach(function(t){var i=t.valueNode;if(i){if(a>0){a--;var o=gf.create(e.uri,lG(e,t)),s=n?n+`.`+t.keyNode.value:t.keyNode.value;v.push({name:r.getKeyLabel(t),kind:r.getSymbolKind(i.type),location:o,containerName:n}),h.push({node:i,containerName:s})}else _=!0}})};g<h.length;){var b=h[g++];y(b.node,b.containerName)}return _&&n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(o),v},e.prototype.findDocumentSymbols2=function(e,t,n){var r=this;n===void 0&&(n={resultLimit:Number.MAX_VALUE});var i=t.root;if(!i)return[];var a=n.resultLimit||Number.MAX_VALUE,o=e.uri;if((o===`vscode://defaultsettings/keybindings.json`||HU(o.toLowerCase(),`/user/keybindings.json`))&&i.type===`array`){for(var s=[],c=0,l=i.items;c<l.length;c++){var u=l[c];if(u.type===`object`)for(var d=0,f=u.properties;d<f.length;d++){var p=f[d];if(p.keyNode.value===`key`&&p.valueNode){var m=lG(e,u),h=lG(e,p.keyNode);if(s.push({name:cW(p.valueNode),kind:op.Function,range:m,selectionRange:h}),a--,a<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(o),s}}}return s}for(var g=[],_=[{node:i,result:g}],v=0,y=!1,b=function(t,n){t.type===`array`?t.items.forEach(function(t,i){if(t){if(a>0){a--;var o=lG(e,t),s=o,c={name:String(i),kind:r.getSymbolKind(t.type),range:o,selectionRange:s,children:[]};n.push(c),_.push({result:c.children,node:t})}else y=!0}}):t.type===`object`&&t.properties.forEach(function(t){var i=t.valueNode;if(i){if(a>0){a--;var o=lG(e,t),s=lG(e,t.keyNode),c=[],l={name:r.getKeyLabel(t),kind:r.getSymbolKind(i.type),range:o,selectionRange:s,children:c,detail:r.getDetail(i)};n.push(l),_.push({result:c,node:i})}else y=!0}})};v<_.length;){var x=_[v++];b(x.node,x.result)}return y&&n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(o),g},e.prototype.getSymbolKind=function(e){switch(e){case`object`:return op.Module;case`string`:return op.String;case`number`:return op.Number;case`array`:return op.Array;case`boolean`:return op.Boolean;default:return op.Variable}},e.prototype.getKeyLabel=function(e){var t=e.keyNode.value;return t&&=t.replace(/[\n]/g,`↵`),t&&t.trim()?t:`"`+t+`"`},e.prototype.getDetail=function(e){if(e){if(e.type===`boolean`||e.type===`number`||e.type===`null`||e.type===`string`)return String(e.value);if(e.type===`array`)return e.children.length?void 0:`[]`;if(e.type===`object`)return e.children.length?void 0:`{}`}},e.prototype.findDocumentColors=function(e,t,n){return this.schemaService.getSchemaForResource(e.uri,t).then(function(r){var i=[];if(r)for(var a=n&&typeof n.resultLimit==`number`?n.resultLimit:Number.MAX_VALUE,o=t.getMatchingSchemas(r.schema),s={},c=0,l=o;c<l.length;c++){var u=l[c];if(!u.inverted&&u.schema&&(u.schema.format===`color`||u.schema.format===`color-hex`)&&u.node&&u.node.type===`string`){var d=String(u.node.offset);if(!s[d]){var f=sG(cW(u.node));if(f){var p=lG(e,u.node);i.push({color:f,range:p})}if(s[d]=!0,a--,a<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(e.uri),i}}}return i})},e.prototype.getColorPresentations=function(e,t,n,r){var i=[],a=Math.round(n.red*255),o=Math.round(n.green*255),s=Math.round(n.blue*255);function c(e){var t=e.toString(16);return t.length===2?t:`0`+t}var l=n.alpha===1?`#`+c(a)+c(o)+c(s):`#`+c(a)+c(o)+c(s)+c(Math.round(n.alpha*255));return i.push({label:l,textEdit:Of.replace(r,JSON.stringify(l))}),i},e})();function lG(e,t){return F.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length))}function uG(e,t){var n=[];return t.visit(function(r){if(r.type===`property`&&r.keyNode.value===`$ref`&&r.valueNode?.type===`string`){var i=r.valueNode.value,a=fG(t,i);if(a){var o=e.positionAt(a.offset);n.push({target:e.uri+`#`+(o.line+1)+`,`+(o.character+1),range:dG(e,r.valueNode)})}}return!0}),Promise.resolve(n)}function dG(e,t){return F.create(e.positionAt(t.offset+1),e.positionAt(t.offset+t.length-1))}function fG(e,t){var n=mG(t);return n?pG(n,e.root):null}function pG(e,t){if(!t)return null;if(e.length===0)return t;var n=e.shift();if(t&&t.type===`object`){var r=t.properties.find(function(e){return e.keyNode.value===n});return r?pG(e,r.valueNode):null}if(t&&t.type===`array`&&n.match(/^(0|[1-9][0-9]*)$/)){var i=Number.parseInt(n),a=t.items[i];return a?pG(e,a):null}return null}function mG(e){return e===`#`?[]:e[0]!==`#`||e[1]!==`/`?null:e.substring(2).split(/\//).map(hG)}function hG(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}var gG=`YAML`,_G=`yaml-schema: `,vG;(function(e){e.missingRequiredPropWarning=`missingRequiredPropWarning`,e.typeMismatchWarning=`typeMismatchWarning`,e.constWarning=`constWarning`})(vG||={});var yG={[vG.missingRequiredPropWarning]:`Missing property "{0}".`,[vG.typeMismatchWarning]:`Incorrect type. Expected "{0}".`,[vG.constWarning]:`Value must be {0}.`},bG=class e{constructor(e=-1,t=null){this.focusOffset=e,this.exclude=t,this.schemas=[]}add(e){this.schemas.push(e)}merge(e){this.schemas.push(...e.schemas)}include(e){return(this.focusOffset===-1||EW(e,this.focusOffset))&&e!==this.exclude}newSub(){return new e(-1,this.exclude)}},xG=class{constructor(){}get schemas(){return[]}add(){}merge(){}include(){return!0}newSub(){return this}};xG.instance=new xG;var SG={"color-hex":{errorMessage:R(`Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.`),pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:R(`String is not a RFC3339 date-time.`),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:R(`String is not a RFC3339 date.`),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:R(`String is not a RFC3339 time.`),pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:R(`String is not an e-mail address.`),pattern:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/},ipv4:{errorMessage:R(`String does not match IPv4 format.`),pattern:/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/},ipv6:{errorMessage:R(`String does not match IPv6 format.`),pattern:/^([0-9a-f]|:){1,4}(:([0-9a-f]{0,4})*){1,7}$/i}},CG=class{constructor(e){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null,e&&(this.enumValues=[])}getEvaluatedItems(e){this.evaluatedItemsByNode??=/* @__PURE__ */ new Map;let t=this.evaluatedItemsByNode.get(e);return t||(t=/* @__PURE__ */ new Set,this.evaluatedItemsByNode.set(e,t)),t}hasProblems(){return this.problems.length>0}merge(e){if(this.problems=this.problems.concat(e.problems),e.evaluatedProperties){this.evaluatedProperties??=/* @__PURE__ */ new Set;for(let t of e.evaluatedProperties)this.evaluatedProperties.add(t)}if(e.evaluatedItemsByNode){this.evaluatedItemsByNode??=/* @__PURE__ */ new Map;for(let[t,n]of e.evaluatedItemsByNode){let e=this.evaluatedItemsByNode.get(t);if(e)for(let t of n)e.add(t);else this.evaluatedItemsByNode.set(t,new Set(n))}}}mergeEnumValues(e){if(!this.enumValueMatch&&!e.enumValueMatch&&this.enumValues&&e.enumValues){this.enumValues=this.enumValues.concat(e.enumValues);for(let e of this.problems)e.code===YU.EnumValueMismatch&&(e.message=R(`Value is not accepted. Valid values: {0}.`,[...new Set(this.enumValues)].map(e=>JSON.stringify(e)).join(`, `)))}}mergeWarningGeneric(e,t){if(this.problems?.length)for(let n of t){let t=this.problems.filter(e=>e.problemType===n);for(let r of t){let t=e.problems?.find(e=>e.problemType===n&&r.location.offset===e.location.offset&&(n!==vG.missingRequiredPropWarning||HW(e.problemArgs,r.problemArgs)));t&&(t.problemArgs?.length&&(t.problemArgs.filter(e=>!r.problemArgs.includes(e)).forEach(e=>r.problemArgs.push(e)),r.problemType&&(r.message=EG(r.problemType,r.problemArgs??[]))),this.mergeSources(t,r))}}}mergePropertyMatch(e,t=!0){t?this.merge(e):this.problems=this.problems.concat(e.problems),this.propertiesMatches++,(e.enumValueMatch||!e.hasProblems()&&e.propertiesMatches)&&this.propertiesValueMatches++,e.enumValueMatch&&e.enumValues&&this.primaryValueMatches++}mergeSources(e,t){let n=(e.source??``).replace(_G,``);n&&t.source&&!t.source.includes(n)&&(t.source=t.source+` | `+n),t.schemaUri&&e.schemaUri&&!t.schemaUri.includes(e.schemaUri[0])&&(t.schemaUri=t.schemaUri.concat(e.schemaUri))}compareGeneric(e){let t=this.hasProblems();return t===e.hasProblems()?this.enumValueMatch===e.enumValueMatch?this.propertiesValueMatches===e.propertiesValueMatches?this.primaryValueMatches===e.primaryValueMatches?this.propertiesMatches-e.propertiesMatches:this.primaryValueMatches-e.primaryValueMatches:this.propertiesValueMatches-e.propertiesValueMatches:e.enumValueMatch?-1:1:t?-1:1}compareKubernetes(e){let t=this.hasProblems();return this.propertiesMatches===e.propertiesMatches?this.enumValueMatch===e.enumValueMatch?this.primaryValueMatches===e.primaryValueMatches?this.propertiesValueMatches===e.propertiesValueMatches?t===e.hasProblems()?this.propertiesMatches-e.propertiesMatches:t?-1:1:this.propertiesValueMatches-e.propertiesValueMatches:this.primaryValueMatches-e.primaryValueMatches:e.enumValueMatch?-1:1:this.propertiesMatches-e.propertiesMatches}},wG=class{collectSeenKeys(e){let t=/* @__PURE__ */ Object.create(null),n=[...e.properties];for(;n.length>0;){let e=n.pop();if(!e)continue;let r=e.keyNode.value;if(r===`<<`&&e.valueNode){let t=e.valueNode;switch(t.type){case`object`:n.push(...t.properties);break;case`array`:t.items.forEach(e=>{e&&e.type===`object`&&PW(e.properties)&&n.push(...e.properties)})}}else t[r]=e.valueNode}return t}validateDocument(e,t,n,r){let i=new CG(r.isKubernetes);return this.validateNode(e,n,n,i,xG.instance,r),i.problems.map(e=>{let n=F.create(t.positionAt(e.location.offset),t.positionAt(e.location.offset+e.location.length)),r=Ef.create(n,e.message,e.severity,e.code?e.code:YU.Undefined,e.source);return r.data={schemaUri:e.schemaUri,...e.data},r})}getMatchingSchemas(e,t,n,r,i){let a=new bG(r,i);return this.validateNode(e,t,t,new CG(n.isKubernetes),a,n),a.schemas}getNoOpCollector(){return xG.instance}getSchemaSource(e,t){let n;if(e.title)n=e.title;else if(e.closestTitle)n=e.closestTitle;else if(t.closestTitle)n=t.closestTitle;else{let r=e.url??t.url;r&&(n=Xd.parse(r).toString())}return n?`${_G}${n}`:gG}getSchemaUri(e,t){let n=e.url??t.url;return n?[n]:[]}validateNode(e,t,n,r,i,a){if(e&&t&&typeof t==`object`){if(t._dialect){let o=t._dialect;if(o!==this.getCurrentDialect()){MG(o).validateNode(e,t,n,r,i,a);return}}switch(t.url||=n.url,t.closestTitle=t.title||n.closestTitle,e.type){case`object`:this.validateObjectNode(e,t,n,r,i,a);break;case`array`:this.validateArrayNode(e,t,n,r,i,a);break;case`string`:this.validateStringNode(e,t,n,r);break;case`number`:this.validateNumberNode(e,t,n,r);break;case`property`:this.validateNode(e.valueNode,t,t,r,i,a)}if(this.validateGenericNode(e,t,n,r,i,a),i.add({node:e,schema:t}),this.applyUnevaluatedItems(e,t,n,r,i,a),e.type===`object`){let o=this.collectSeenKeys(e);this.applyUnevaluatedProperties(e,t,n,r,i,a,o)}}}validateGenericNode(e,t,n,r,i,a){let{isKubernetes:o,callFromAutoComplete:s}=a,c=t=>e.type===t||t===`integer`&&e.type===`number`&&e.isInteger,l=(e,t)=>{if(t.evaluatedProperties){e.evaluatedProperties??=/* @__PURE__ */ new Set;for(let n of t.evaluatedProperties)e.evaluatedProperties.add(n)}if(t.evaluatedItemsByNode){e.evaluatedItemsByNode??=/* @__PURE__ */ new Map;for(let[n,r]of t.evaluatedItemsByNode){let t=e.evaluatedItemsByNode.get(n);if(t)for(let e of r)t.add(e);else e.evaluatedItemsByNode.set(n,new Set(r))}}};if(Array.isArray(t.type))t.type.some(c)||r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Incorrect type. Expected one of {0}.`,t.type.join(`, `)),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});else if(t.type&&!c(t.type)){let i=t.type===`object`?FW(t):t.type;r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||EG(vG.typeMismatchWarning,[i]),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n),problemType:vG.typeMismatchWarning,problemArgs:[i]})}if(Array.isArray(t.allOf))for(let n of t.allOf){let s=TG(n),c=new CG(o),l=i.newSub();this.validateNode(e,s,t,c,l,a),r.merge(c),r.propertiesMatches+=c.propertiesMatches,r.propertiesValueMatches+=c.propertiesValueMatches,i.merge(l)}let u=TG(t.not);if(u){let s=new CG(o),c=i.newSub();this.validateNode(e,u,t,s,c,a),s.hasProblems()||r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Matches a schema that is not allowed.`),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});for(let e of c.schemas)e.inverted=!e.inverted,i.add(e)}let d=(c,u)=>{let d=[],f=[],p=[],m=null;for(let n of c){let r={...TG(n)},c=new CG(o),l=i.newSub();this.validateNode(e,r,t,c,l,a),(!c.hasProblems()||s)&&(d.push(r),c.propertiesMatches===0&&f.push(r),r.format&&d.pop()),c.hasProblems()||p.push(c),m=m?o?this.alternativeComparison(c,m,r,l):this.genericComparison(e,u,c,m,r,l):{schema:r,validationResult:c,matchingSchemas:l}}if(d.length>1&&(d.length>1||f.length===0)&&u&&r.problems.push({location:{offset:e.offset,length:1},severity:I.Warning,message:R(`Matches multiple schemas when only one must validate.`),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),m&&(r.merge(m.validationResult),r.propertiesMatches+=m.validationResult.propertiesMatches,r.propertiesValueMatches+=m.validationResult.propertiesValueMatches,r.enumValueMatch=r.enumValueMatch||m.validationResult.enumValueMatch,m.validationResult.enumValues?.length&&(r.enumValues=(r.enumValues||[]).concat(m.validationResult.enumValues)),i.merge(m.matchingSchemas)),p.length>0)for(let e of p)l(r,e)};Array.isArray(t.anyOf)&&d(t.anyOf,!1),Array.isArray(t.oneOf)&&d(t.oneOf,!0);let f=(t,n)=>{let s=new CG(o),c=i.newSub();this.validateNode(e,TG(t),n,s,c,a),r.merge(s),r.propertiesMatches+=s.propertiesMatches,r.propertiesValueMatches+=s.propertiesValueMatches,i.merge(c)},p=(s,c,u,d)=>{let p=TG(s),m=new CG(o),h=i.newSub();this.validateNode(e,p,c,m,h,a),i.merge(h);let g=p?.filePatternAssociation;g&&(new qW(g).matchesPattern(a.uri)||m.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`filePatternAssociation '{0}' does not match with doc uri '{1}'`,g,a.uri),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})),m.hasProblems()?d&&f(d,c):(l(r,m),u&&f(u,c))},m=TG(t.if);if(m&&p(m,t,TG(t.then),TG(t.else)),Array.isArray(t.enum)){let i=TW(e),a=!1;for(let n of t.enum)if(kW(i,n,e.type)||DG(s,e,i,n)){a=!0;break}r.enumValues=t.enum,r.enumValueMatch=a,a||r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,code:YU.EnumValueMismatch,message:t.errorMessage||R(`Value is not accepted. Valid values: {0}.`,(t.enum??[]).map(e=>JSON.stringify(e)).join(`, `)),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n),data:{values:t.enum}})}if(jW(t.const)){let i=TW(e),a=t.const;!kW(i,a,e.type)&&!DG(s,e,i,a)?(r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,code:YU.EnumValueMismatch,problemType:vG.constWarning,message:t.errorMessage||EG(vG.constWarning,[JSON.stringify(a)]),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n),problemArgs:[JSON.stringify(a)],data:{values:[a]}}),r.enumValueMatch=!1):r.enumValueMatch=!0,r.enumValues=[a]}t.deprecationMessage&&e.parent&&r.problems.push({location:{offset:e.parent.offset,length:e.parent.length},severity:I.Warning,message:t.deprecationMessage,source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}validateStringNode(e,t,n,r){let i=e.value;if(AW(t.minLength)&&i.length<(t.minLength??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`String is shorter than the minimum length of {0}.`,t.minLength),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(t.maxLength)&&i.length>(t.maxLength??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`String is longer than the maximum length of {0}.`,t.maxLength),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),NW(t.pattern)){let a=GW(t.pattern);a?a.test(i)||r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.patternErrorMessage||t.errorMessage||R(`String does not match the pattern of "{0}".`,t.pattern),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}):r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Invalid pattern: "{0}"`,t.pattern),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}if(t.format)switch(t.format){case`uri`:case`uri-reference`:{let a;if(!i)a=R(`URI expected.`);else try{!Xd.parse(i).scheme&&t.format===`uri`&&(a=R(`URI with a scheme is expected.`))}catch(e){a=e instanceof Error?e.message:String(e)}a&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.patternErrorMessage||t.errorMessage||R(`String is not a URI: {0}`,a),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});break}case`color-hex`:case`date-time`:case`date`:case`time`:case`email`:case`ipv4`:case`ipv6`:{let a=SG[t.format];(!i||!a.pattern.test(i))&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.patternErrorMessage||t.errorMessage||R(a.errorMessage),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});break}}}validateNumberNode(e,t,n,r){let i=e.value;AW(t.multipleOf)&&JW(i,t.multipleOf??0)!==0&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Value is not divisible by {0}.`,t.multipleOf),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});let a=this.getNumberLimits(t);AW(a.exclusiveMinimum)&&i<=a.exclusiveMinimum&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Value is below the exclusive minimum of {0}.`,a.exclusiveMinimum),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(a.exclusiveMaximum)&&i>=a.exclusiveMaximum&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Value is above the exclusive maximum of {0}.`,a.exclusiveMaximum),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(a.minimum)&&i<a.minimum&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Value is below the minimum of {0}.`,a.minimum),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(a.maximum)&&i>a.maximum&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Value is above the maximum of {0}.`,a.maximum),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}validateArrayNode(e,t,n,r,i,a){let{isKubernetes:o}=a,s=e.items??[],c=t.items?r.getEvaluatedItems(e):void 0;if(Array.isArray(t.items)){let l=t.items;for(let e=0;e<l.length;e++){let n=TG(l[e]),u=new CG(o),d=s[e];d?(this.validateNode(d,n,t,u,i,a),r.mergePropertyMatch(u,!1),r.mergeEnumValues(u),c?.add(e)):s.length>=l.length&&r.propertiesValueMatches++}if(s.length>l.length){let u=t.additionalItems;if(u===!1){r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Array has too many items according to schema. Expected {0} or fewer.`,l.length),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});for(let e=l.length;e<s.length;e++)c?.add(e)}else if(typeof u==`object`)for(let e=l.length;e<s.length;e++){let n=new CG(o);this.validateNode(s[e],u,t,n,i,a),r.mergePropertyMatch(n,!1),r.mergeEnumValues(n),c?.add(e)}else if(u===!0)for(let e=l.length;e<s.length;e++)c?.add(e)}}else{let n=TG(t.items);if(n){let c=r.getEvaluatedItems(e);for(let e=0;e<s.length;e++){let l=s[e],u=new CG(o);this.validateNode(l,n,t,u,i,a),r.mergePropertyMatch(u,!1),r.mergeEnumValues(u),c.add(e)}}}this.applyContains(e,t,n,r,i,a),this.applyArrayLength(e,t,n,r,a),this.applyUniqueItems(e,t,n,r)}applyContains(e,t,n,r,i,a){let{isKubernetes:o}=a,s=TG(t.contains);s&&((e.items??[]).some(e=>{let n=new CG(o);return this.validateNode(e,s,t,n,xG.instance,a),!n.hasProblems()})||r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Array does not contain required item.`),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}))}applyArrayLength(e,t,n,r,i){AW(t.minItems)&&e.items.length<(t.minItems??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Array has too few items. Expected {0} or more.`,t.minItems),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(t.maxItems)&&e.items.length>(t.maxItems??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Array has too many items. Expected {0} or fewer.`,t.maxItems),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}applyUniqueItems(e,t,n,r){if(t.uniqueItems===!0){let i=TW(e);Array.isArray(i)&&i.some((e,t)=>t!==i.lastIndexOf(e))&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Array has duplicate items.`),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}}validateObjectNode(e,t,n,r,i,a){let o=/* @__PURE__ */ Object.create(null),s=[],c=[...e.properties];for(;c.length>0;){let e=c.pop();if(!e)continue;let t=e.keyNode.value;if(t===`<<`&&e.valueNode)switch(e.valueNode.type){case`object`:c.push(...e.valueNode.properties);break;case`array`:e.valueNode.items.forEach(e=>{e&&e.type===`object`&&PW(e.properties)&&c.push(...e.properties)})}else o[t]=e.valueNode,s.push(t)}let l=e=>{let t=s.indexOf(e);for(;t>=0;)s.splice(t,1),t=s.indexOf(e)};this.applyRequired(e,t,n,r,a,o),this.applyProperties(e,t,n,r,i,a,o,s,l),this.applyPatternProperties(e,t,n,r,i,a,o,s,l),this.applyAdditionalProperties(e,t,n,r,i,a,o,s),this.applyPropertyCount(e,t,n,r),this.applyDependencies(e,t,n,r,i,a,o),this.applyPropertyNames(e,t,r,a)}applyRequired(e,t,n,r,i,a){if(Array.isArray(t.required)){for(let i of t.required)if(a[i]===void 0){let a=e.parent&&e.parent.type===`property`&&e.parent.keyNode,o=a?{offset:a.offset,length:a.length}:{offset:e.offset,length:1};r.problems.push({location:o,severity:I.Warning,message:t.errorMessage||EG(vG.missingRequiredPropWarning,[i]),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n),problemArgs:[i],problemType:vG.missingRequiredPropWarning})}}}applyProperties(e,t,n,r,i,a,o,s,c){let{isKubernetes:l}=a,u=t.properties;if(u)for(let e of Object.keys(u)){c(e);let s=u[e],d=o[e];if(d){if(r.evaluatedProperties??=/* @__PURE__ */ new Set,r.evaluatedProperties.add(e),MW(s)){if(s)r.propertiesMatches++,r.propertiesValueMatches++;else{let i=d.parent;r.problems.push({location:{offset:i.keyNode.offset,length:i.keyNode.length},severity:I.Warning,message:t.errorMessage||R(`Property {0} is not allowed.`,e),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}}else{s.url=t.url??n.url;let e=new CG(l);this.validateNode(d,s,t,e,i,a),r.mergePropertyMatch(e,!1),r.mergeEnumValues(e)}}}}applyPatternProperties(e,t,n,r,i,a,o,s,c){let{isKubernetes:l}=a,u=t.patternProperties;if(u)for(let e of Object.keys(u)){let d=GW(e);if(d)for(let f of s.slice(0)){if(!d.test(f))continue;c(f);let s=o[f];if(!s)continue;r.evaluatedProperties??=/* @__PURE__ */ new Set,r.evaluatedProperties.add(f);let p=u[e];if(MW(p)){if(p)r.propertiesMatches++,r.propertiesValueMatches++;else{let e=s.parent;r.problems.push({location:{offset:e.keyNode.offset,length:e.keyNode.length},severity:I.Warning,message:t.errorMessage||R(`Property {0} is not allowed.`,f),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}}else{let e=new CG(l);this.validateNode(s,p,t,e,i,a),r.mergePropertyMatch(e,!1),r.mergeEnumValues(e)}}}}applyAdditionalProperties(e,t,n,r,i,a,o,s){let{isKubernetes:c}=a,l=t.additionalProperties;if(typeof l==`object`){for(let e of s){let n=o[e];if(!n)continue;r.evaluatedProperties??=/* @__PURE__ */ new Set,r.evaluatedProperties.add(e);let s=new CG(c);this.validateNode(n,l,t,s,i,a),r.mergePropertyMatch(s,!1),r.mergeEnumValues(s)}return}if(l===!0){if(s.length>0){r.evaluatedProperties??=/* @__PURE__ */ new Set;for(let e of s)o[e]&&r.evaluatedProperties.add(e)}return}if(!(l===!1||t.type===`object`&&l===void 0&&a.disableAdditionalProperties===!0)||s.length===0)return;let u=t.properties&&Object.entries(t.properties).filter(([e,t])=>!(o[e]||t&&typeof t==`object`&&(t.doNotSuggest||t.deprecationMessage))).map(([e])=>e);for(let e of s){let i=o[e];if(!i)continue;let a=i.type===`property`?i:i.parent??i;a.type===`object`&&(a=a.properties[0]??a);let s=a.type===`property`?a.keyNode:a,c={location:{offset:s.offset,length:s.length},severity:I.Warning,code:YU.PropertyExpected,message:t.errorMessage||R(`Property {0} is not allowed.`,e),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)};u?.length&&(c.data={properties:u}),r.problems.push(c)}}applyPropertyCount(e,t,n,r){AW(t.maxProperties)&&e.properties.length>(t.maxProperties??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Object has more properties than limit of {0}.`,t.maxProperties),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(t.minProperties)&&e.properties.length<(t.minProperties??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Object has fewer properties than the required number of {0}`,t.minProperties),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}applyDependencies(e,t,n,r,i,a,o){let{isKubernetes:s}=a,c=t.dependencies;if(c)for(let l of Object.keys(c)){if(!o[l])continue;let u=c[l];if(Array.isArray(u))for(let i of u)o[i]?r.propertiesValueMatches++:r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Object is missing property {0} required by property {1}.`,i,l),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});else{let n=TG(u);if(n){let o=new CG(s);this.validateNode(e,n,t,o,i,a),r.mergePropertyMatch(o),r.mergeEnumValues(o)}}}}applyPropertyNames(e,t,n,r){let i=TG(t.propertyNames);if(i)for(let a of e.properties){let e=a.keyNode;e&&this.validateNode(e,i,t,n,xG.instance,r)}}applyUnevaluatedProperties(e,t,n,r,i,a,o,s){}applyUnevaluatedItems(e,t,n,r,i,a){}alternativeComparison(e,t,n,r){let i=e.compareKubernetes(t.validationResult);return i>0?{schema:n,validationResult:e,matchingSchemas:r}:(i===0&&(t.matchingSchemas.merge(r),t.validationResult.mergeEnumValues(e)),t)}genericComparison(e,t,n,r,i,a){if(!t&&!n.hasProblems()&&!r.validationResult.hasProblems())r.matchingSchemas.merge(a),r.validationResult.propertiesMatches+=n.propertiesMatches,r.validationResult.propertiesValueMatches+=n.propertiesValueMatches;else{let o=n.compareGeneric(r.validationResult);o>0||o===0&&t&&r.schema.type===`object`&&e.type!==`null`&&e.type!==r.schema.type?r={schema:i,validationResult:n,matchingSchemas:a}:(o===0||(e.value===null||e.type===`null`)&&e.length===0)&&this.mergeValidationMatches(r,a,n)}return r}mergeValidationMatches(e,t,n){e.matchingSchemas.merge(t),e.validationResult.mergeEnumValues(n),e.validationResult.mergeWarningGeneric(n,[vG.missingRequiredPropWarning,vG.typeMismatchWarning,vG.constWarning])}};function TG(e){if(e!==void 0)return MW(e)?e?{}:{not:{}}:typeof e==`object`?e:(console.warn(`Wrong schema: ${JSON.stringify(e)}, it MUST be an Object or Boolean`),{type:e})}function EG(e,t){return R(yG[e],t.join(` | `))}function DG(e,t,n,r){return e?n===null&&t.length===0||NW(n)&&NW(r)&&r.startsWith(n):!1}var OG=class extends wG{getCurrentDialect(){return wW.draft04}getNumberLimits(e){let t=AW(e.minimum)?e.minimum:void 0,n=AW(e.maximum)?e.maximum:void 0,r=MW(e.exclusiveMinimum)&&e.exclusiveMinimum?t:void 0,i=MW(e.exclusiveMaximum)&&e.exclusiveMaximum?n:void 0;return{minimum:r===void 0?t:void 0,maximum:i===void 0?n:void 0,exclusiveMinimum:r,exclusiveMaximum:i}}},kG=class extends wG{getCurrentDialect(){return wW.draft07}getNumberLimits(e){let t=AW(e.minimum)?e.minimum:void 0,n=AW(e.maximum)?e.maximum:void 0,r=AW(e.exclusiveMinimum)?e.exclusiveMinimum:void 0,i=AW(e.exclusiveMaximum)?e.exclusiveMaximum:void 0;return{minimum:r===void 0?t:void 0,maximum:i===void 0?n:void 0,exclusiveMinimum:r,exclusiveMaximum:i}}},AG=class extends kG{getCurrentDialect(){return wW.draft2019}applyContains(e,t,n,r,i,a){let o=TG(t.contains);if(!o)return;let s=t.minContains,c=t.maxContains,l=AW(s)?s:1,u=AW(c)?c:void 0,d=0,f=e.items??[];for(let e of f){let n=new CG(a.isKubernetes);if(this.validateNode(e,o,t,n,this.getNoOpCollector(),a),!n.hasProblems()&&(d++,u!==void 0&&d>u))break}d<l&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Array has too few items matching "contains". Expected {0} or more.`,l),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),u!==void 0&&d>u&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Array has too many items matching "contains". Expected {0} or fewer.`,u),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}applyDependencies(e,t,n,r,i,a,o){super.applyDependencies(e,t,n,r,i,a,o);let s=t.dependentRequired;if(s&&typeof s==`object`)for(let i of Object.keys(s)){if(!o[i])continue;let a=s[i];if(Array.isArray(a))for(let s of a)o[s]?r.propertiesValueMatches++:r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Object is missing property {0} required by property {1}.`,s,i),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}let c=t.dependentSchemas;if(c&&typeof c==`object`)for(let n of Object.keys(c)){if(!o[n])continue;let s=TG(c[n]);if(!s)continue;let l=new CG(a.isKubernetes);this.validateNode(e,s,t,l,i,a),r.mergePropertyMatch(l),r.mergeEnumValues(l)}}applyUnevaluatedProperties(e,t,n,r,i,a,o){let s=t.unevaluatedProperties;if(s===void 0||!o)return;r.evaluatedProperties??=/* @__PURE__ */ new Set;let c=Object.keys(o).filter(e=>!r.evaluatedProperties?.has(e));if(c.length===0)return;if(s===!1){for(let e of c){let i=o[e];if(!i)continue;let a=(i.type===`property`?i:i.parent).keyNode;a&&(r.problems.push({location:{offset:a.offset,length:a.length},severity:I.Warning,code:YU.PropertyExpected,message:t.errorMessage||R(`Property {0} is not allowed.`,e),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),r.evaluatedProperties?.add(e))}return}if(s===!0){for(let e of c)r.evaluatedProperties?.add(e);return}let l=TG(s);if(l)for(let e of c){let n=o[e];if(!n)continue;let s=n.type===`property`?n.valueNode:n;if(!s)continue;let c=new CG(a.isKubernetes);this.validateNode(s,l,t,c,i,a),r.mergePropertyMatch(c),r.mergeEnumValues(c),r.evaluatedProperties?.add(e)}}applyUnevaluatedItems(e,t,n,r,i,a){let o=t.unevaluatedItems;if(o===void 0)return;let s=e.items??[];if(s.length===0)return;let c=r.getEvaluatedItems(e),l=[];for(let e=0;e<s.length;e++)c.has(e)||l.push(e);if(l.length===0)return;if(o===!1){for(let e of l){let i=s[e];r.problems.push({location:{offset:i.offset,length:i.length||1},severity:I.Warning,code:YU.PropertyExpected,message:t.errorMessage||R(`Array has too many items according to schema. Expected {0} or fewer.`,e),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),c.add(e)}return}if(o===!0){for(let e of l)c.add(e);return}let u=TG(o);if(u)for(let e of l){let n=s[e],o=new CG(a.isKubernetes);this.validateNode(n,u,t,o,i,a),r.merge(o),r.mergeEnumValues(o),c.add(e)}}},jG=class extends AG{getCurrentDialect(){return wW.draft2020}validateArrayNode(e,t,n,r,i,a){let o=e.items??[],s=r.getEvaluatedItems(e),c=t.prefixItems;if(Array.isArray(c)){let e=Math.min(c.length,o.length);for(let n=0;n<e;n++){let e=TG(c[n]);if(!e){s.add(n);continue}let l=new CG(a.isKubernetes);this.validateNode(o[n],e,t,l,i,a),r.mergePropertyMatch(l,!1),r.mergeEnumValues(l),s.add(n)}}let l=t.items,u=Array.isArray(c)?c.length:0;if(o.length>u){if(l===!1){r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Array has too many items according to schema. Expected {0} or fewer.`,u),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});for(let e=u;e<o.length;e++)s.add(e)}else{let e=TG(l);if(e)for(let n=u;n<o.length;n++){let c=new CG(a.isKubernetes);this.validateNode(o[n],e,t,c,i,a),r.mergePropertyMatch(c,!1),r.mergeEnumValues(c),s.add(n)}}}this.applyContains(e,t,n,r,i,a),this.applyArrayLength(e,t,n,r,a),this.applyUniqueItems(e,t,n,r)}applyContains(e,t,n,r,i,a){let o=TG(t.contains);if(!o)return;let s=e.items??[],c=t.minContains,l=t.maxContains,u=AW(c)?c:1,d=AW(l)?l:void 0,f=0,p=r.getEvaluatedItems(e);for(let e=0;e<s.length;e++){let n=new CG(a.isKubernetes);if(this.validateNode(s[e],o,t,n,this.getNoOpCollector(),a),!n.hasProblems()&&(p.add(e),f++,d!==void 0&&f>d))break}f<u&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Array has too few items matching "contains". Expected {0} or more.`,u),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),d!==void 0&&f>d&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Array has too many items matching "contains". Expected {0} or fewer.`,d),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}};function MG(e){switch(e){case wW.draft04:return new OG;case wW.draft07:return new kG;case wW.draft2019:return new AG;case wW.draft2020:return new jG;default:return new kG}}var NG=class{constructor(e,t,n,r){this.offset=n,this.length=r,this.parent=e,this.internalNode=t}getNodeFromOffsetEndInclusive(e){let t=[],n=r=>{if(e>=r.offset&&e<=r.offset+r.length){let i=r.children;for(let r=0;r<i.length&&i[r].offset<=e;r++){let e=n(i[r]);e&&t.push(e)}return r}return null},r=n(this),i=Number.MAX_VALUE,a=null;for(let n of t){let t=n.length+n.offset-e+(e-n.offset);t<i&&(a=n,i=t)}return a||r}get children(){return[]}toString(){return`type: `+this.type+` (`+this.offset+`/`+this.length+`)`+(this.parent?` parent: {`+this.parent.toString()+`}`:``)}},PG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`null`,this.value=null}},FG=class extends NG{constructor(e,t,n,r,i,a){super(e,t,i,a),this.type=`boolean`,this.value=n,this.source=r}},IG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`array`,this.items=[]}get children(){return this.items}},LG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`number`,this.isInteger=!0,this.value=NaN}},RG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`string`,this.value=``}},zG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`property`,this.colonOffset=-1}get children(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]}},BG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`object`,this.properties=[]}get children(){return this.properties}},VG;(function(e){e[e.Key=0]=`Key`,e[e.Enum=1]=`Enum`})(VG||={});var HG=class{constructor(e,t=[],n=[]){this.root=e,this.syntaxErrors=t,this.comments=n}getNodeFromOffset(e,t=!1){if(this.root)return DW(this.root,e,t)}getNodeFromOffsetEndInclusive(e){return this.root&&this.root.getNodeFromOffsetEndInclusive(e)}visit(e){if(this.root){let t=n=>{let r=e(n),i=n.children;if(Array.isArray(i))for(let e=0;e<i.length&&r;e++)r=t(i[e]);return r};t(this.root)}}validate(e,t){return!this.root||!t?null:MG(t._dialect).validateDocument(this.root,e,t,{isKubernetes:this.isKubernetes,disableAdditionalProperties:this.disableAdditionalProperties,uri:this.uri})}getMatchingSchemas(e,t=-1,n=null,r){return!this.root||!e?[]:MG(e._dialect).getMatchingSchemas(this.root,e,{isKubernetes:this.isKubernetes,disableAdditionalProperties:this.disableAdditionalProperties,uri:this.uri,callFromAutoComplete:r},t,n)}},UG={maxRefCount:1e3,currentRefDepth:0,aliasResolutionCache:/* @__PURE__ */ new Map};function WG(e,t,n,r){if(e||(UG.currentRefDepth=0,UG.aliasResolutionCache=/* @__PURE__ */ new Map),!t)return null;if(y(t))return GG(t,e,n,r);if(b(t))return KG(t,e,n,r);if(S(t))return qG(t,e,n,r);if(x(t))return JG(t,e);if(_(t)&&UG.currentRefDepth<UG.maxRefCount)return YG(t,e,n,r)}function GG(e,t,n,r){let i;i=e.flow&&!e.range?QG(e):e.range;let a=new BG(t,e,...ZG(i,r));for(let t of e.items)b(t)&&a.properties.push(WG(a,t,n,r));return a}function KG(e,t,n,r){let i=e.key,a=e.value,o=i.range[0],s=i.range[1],c=i.range[2];a&&(s=a.range[1],c=a.range[2]);let l=new zG(t,e,...ZG([o,s,c],r));if(_(i)){let e=new RG(t,i,...XG(i.range));e.value=i.source,l.keyNode=e}else l.keyNode=WG(l,i,n,r);return l.valueNode=WG(l,a,n,r),l}function qG(e,t,n,r){let i=new IG(t,e,...XG(e.range));for(let t of e.items)if(w(t)){let e=WG(i,t,n,r);e&&i.children.push(e)}return i}function JG(e,t){if(e.value===null)return new PG(t,e,...XG(e.range));switch(typeof e.value){case`string`:{let n=new RG(t,e,...XG(e.range));return n.value=e.value,n}case`boolean`:return new FG(t,e,e.value,e.source,...XG(e.range));case`number`:{let n=new LG(t,e,...XG(e.range));return n.value=e.value,n.isInteger=Number.isInteger(n.value),n}default:{let n=new RG(t,e,...XG(e.range));return n.value=e.source,n}}}function YG(e,t,n,r){if(UG.aliasResolutionCache.has(e))return UG.aliasResolutionCache.get(e);UG.currentRefDepth++;let i=e.resolve(n),a;if(i)a=WG(t,i,n,r);else{let n=new RG(t,e,...XG(e.range));n.value=e.source,a=n}return UG.currentRefDepth--,UG.aliasResolutionCache.set(e,a),a}function XG(e){return[e[0],e[1]-e[0]]}function ZG(e,t){let n=t.linePos(e[0]),r=t.linePos(e[1]),i=[e[0],e[1]-e[0]];return n.line!==r.line&&(t.lineStarts.length!==r.line||r.col===1)&&i[1]--,i}function QG(e){let t=2**53-1,n=0;for(let r of e.items)b(r)&&(w(r.key)&&r.key.range&&r.key.range[0]<=t&&(t=r.key.range[0]),w(r.value)&&r.value.range&&r.value.range[2]>=n&&(n=r.value.range[2]));return[t,n,n]}function $G(e,t){let n;if(T(e,(e,r,i)=>{if(r===t)return n=i[i.length-1],T.BREAK}),!v(n))return n}function eK(e){if(e.items.length>1)return!1;let t=e.items[0];return x(t.key)&&x(t.value)&&t.key.value===``&&!t.value.value}function tK(e,t){for(let[n,r]of e.items.entries())if(t===r)return n}function nK(e,t){let n=!1;for(let r of e){if(r.type===`document`)iK([],r,e=>{if(rK(e)&&e.value?.type===`comment`){if(r.offset<=t&&e.value.source.length+e.value.offset>=t)return n=!0,T.BREAK}else if(e.type===`comment`&&e.offset<=t&&e.offset+e.source.length>=t)return n=!0,T.BREAK});else if(r.type===`comment`&&r.offset<=t&&r.source.length+r.offset>=t)return!0;if(n)break}return n}function rK(e){return e.start!==void 0}function iK(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=iK(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===T.BREAK)return T.BREAK;else r===T.REMOVE&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}let i=t.sep;if(i)for(let t=0;t<i.length;++t){let r=iK(Object.freeze(e),i[t],n);if(typeof r==`number`)t=r-1;else if(r===T.BREAK)return T.BREAK;else r===T.REMOVE&&(i.items.splice(t,1),--t)}return typeof r==`function`?r(t,e):r}var aK=class e extends HG{constructor(e){super(null,[]),this.lineCounter=e}clone(){let t=new e(this.lineCounter);return t.isKubernetes=this.isKubernetes,t.disableAdditionalProperties=this.disableAdditionalProperties,t.uri=this.uri,t.currentDocIndex=this.currentDocIndex,t._lineComments=this.lineComments.slice(),t.internalDocument=this._internalDocument.clone(),t}collectLineComments(){this._lineComments=[],this._internalDocument.commentBefore&&this._internalDocument.commentBefore.split(`
|
|
393
|
+
`)return!0;return!1}var SU=xU;function CU(e,t,n={}){return bz(e,n.backwards?t-1:t,n)!==t}var wU=CU;function TU(e,t,n){return oU(e,n(t))}function EU(e,t){return arguments.length===2||typeof t==`number`?oU(e,t):TU(...arguments)}function DU(e,t,n){return Yz(e,n(t))}function OU(e,t){return arguments.length===2||typeof t==`number`?Yz(e,t):DU(...arguments)}function kU(e,t,n){return cU(e,n(t))}function AU(e,t,n){let r=t===`"`?`'`:`"`;return t+KI(0,e,/\\(.)|(["'])/gs,(e,i,a)=>i===r?i:a===t?`\\`+a:a||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(i)?i:`\\`+i))+t}function jU(e,t){return arguments.length===2||typeof t==`number`?cU(e,t):kU(...arguments)}function MU(e,t=1){return async(...n)=>{let r=n[t]??{},i=r.plugins??[];return n[t]={...r,plugins:Array.isArray(i)?i:Object.values(i)},await e(...n)}}var NU=MU(UH);async function PU(e,t){let{formatted:n}=await NU(e,{...t,cursorOffset:-1});return n}async function FU(e,t){return await PU(e,t)===e}var IU=MU(lB,0),LU={parse:MU(WH),formatAST:MU(GH),formatDoc:MU(KH),printToDoc:MU(qH),printDocToString:MU(JH)},RU=Object.getOwnPropertyNames,zU=((e,t)=>function(){return t||(0,e[RU(e)[0]])((t={exports:{}}).exports,t),t.exports})({"fillers/json-schema.json"(e,t){t.exports={}}});function BU(e){let t=e.getText();if(!(t.includes(`&`)&&t.includes(`*`)))return[];let n=[];try{for(let r of Or(t))T(r,(t,i,a)=>{if(!_(i))return;let o=i.resolve(r);if(!o||!a.includes(o)||!i.range)return;let[s,c]=i.range;n.push({code:`recursive-alias`,message:`Recursive YAML alias ${String(i)} is not supported.`,range:{start:e.positionAt(s),end:e.positionAt(c)},severity:1,source:`YAML`})})}catch{}return n}function VU(e,t){if(e.length<t.length)return!1;for(var n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function HU(e,t){var n=e.length-t.length;return n>0?e.lastIndexOf(t)===n:n===0&&e===t}function UU(e){return VU(e,`(?i)`)?new RegExp(e.substring(4),`i`):new RegExp(e)}function WU(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`||Array.isArray(e)!==Array.isArray(t))return!1;var n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!WU(e[n],t[n]))return!1}else{var i=[];for(r in e)i.push(r);i.sort();var a=[];for(r in t)a.push(r);if(a.sort(),!WU(i,a))return!1;for(n=0;n<i.length;n++)if(!WU(e[i[n]],t[i[n]]))return!1}return!0}function GU(e){return typeof e==`number`}function KU(e){return e!==void 0}function qU(e){return typeof e==`boolean`}function JU(e){return typeof e==`string`}var YU;(function(e){e[e.Undefined=0]=`Undefined`,e[e.EnumValueMismatch=1]=`EnumValueMismatch`,e[e.Deprecated=2]=`Deprecated`,e[e.UnexpectedEndOfComment=257]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=258]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=259]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=260]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=261]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=262]=`InvalidCharacter`,e[e.PropertyExpected=513]=`PropertyExpected`,e[e.CommaExpected=514]=`CommaExpected`,e[e.ColonExpected=515]=`ColonExpected`,e[e.ValueExpected=516]=`ValueExpected`,e[e.CommaOrCloseBacketExpected=517]=`CommaOrCloseBacketExpected`,e[e.CommaOrCloseBraceExpected=518]=`CommaOrCloseBraceExpected`,e[e.TrailingComma=519]=`TrailingComma`,e[e.DuplicateKey=520]=`DuplicateKey`,e[e.CommentNotPermitted=521]=`CommentNotPermitted`,e[e.SchemaResolveError=768]=`SchemaResolveError`})(YU||={});var XU;(function(e){e.LATEST={textDocument:{completion:{completionItem:{documentationFormat:[Uf.Markdown,Uf.PlainText],commitCharactersSupport:!0}}}}})(XU||={});var ZU=(e,t,...n)=>n.length===0?t:t.replaceAll(/{(\d+)}/g,(e,[t])=>t in n?String(n[t]):e);function QU(){return ZU}var $U=/* @__PURE__ */ (function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),eW=QU(),tW={"color-hex":{errorMessage:eW(`colorHexFormatWarning`,`Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.`),pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:eW(`dateTimeFormatWarning`,`String is not a RFC3339 date-time.`),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:eW(`dateFormatWarning`,`String is not a RFC3339 date.`),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:eW(`timeFormatWarning`,`String is not a RFC3339 time.`),pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:eW(`emailFormatWarning`,`String is not an e-mail address.`),pattern:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}},nW=(function(){function e(e,t,n){n===void 0&&(n=0),this.offset=t,this.length=n,this.parent=e}return Object.defineProperty(e.prototype,"children",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return`type: `+this.type+` (`+this.offset+`/`+this.length+`)`+(this.parent?` parent: {`+this.parent.toString()+`}`:``)},e})();(function(e){$U(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.type=`null`,r.value=null,r}return t})(nW),(function(e){$U(t,e);function t(t,n,r){var i=e.call(this,t,r)||this;return i.type=`boolean`,i.value=n,i}return t})(nW),(function(e){$U(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.type=`array`,r.items=[],r}return Object.defineProperty(t.prototype,"children",{get:function(){return this.items},enumerable:!1,configurable:!0}),t})(nW),(function(e){$U(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.type=`number`,r.isInteger=!0,r.value=NaN,r}return t})(nW),(function(e){$U(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.type=`string`,i.value=``,i}return t})(nW),(function(e){$U(t,e);function t(t,n,r){var i=e.call(this,t,n)||this;return i.type=`property`,i.colonOffset=-1,i.keyNode=r,i}return Object.defineProperty(t.prototype,"children",{get:function(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]},enumerable:!1,configurable:!0}),t})(nW),(function(e){$U(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.type=`object`,r.properties=[],r}return Object.defineProperty(t.prototype,"children",{get:function(){return this.properties},enumerable:!1,configurable:!0}),t})(nW);function rW(e){return qU(e)?e?{}:{not:{}}:e}var iW;(function(e){e[e.Key=0]=`Key`,e[e.Enum=1]=`Enum`})(iW||={});var aW=(function(){function e(e,t){e===void 0&&(e=-1),this.focusOffset=e,this.exclude=t,this.schemas=[]}return e.prototype.add=function(e){this.schemas.push(e)},e.prototype.merge=function(e){Array.prototype.push.apply(this.schemas,e.schemas)},e.prototype.include=function(e){return(this.focusOffset===-1||lW(e,this.focusOffset))&&e!==this.exclude},e.prototype.newSub=function(){return new e(-1,this.exclude)},e})(),oW=(function(){function e(){}return Object.defineProperty(e.prototype,"schemas",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.add=function(e){},e.prototype.merge=function(e){},e.prototype.include=function(e){return!0},e.prototype.newSub=function(){return this},e.instance=new e,e})(),sW=(function(){function e(){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=void 0}return e.prototype.hasProblems=function(){return!!this.problems.length},e.prototype.mergeAll=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];this.merge(r)}},e.prototype.merge=function(e){this.problems=this.problems.concat(e.problems)},e.prototype.mergeEnumValues=function(e){if(!this.enumValueMatch&&!e.enumValueMatch&&this.enumValues&&e.enumValues){this.enumValues=this.enumValues.concat(e.enumValues);for(var t=0,n=this.problems;t<n.length;t++){var r=n[t];r.code===YU.EnumValueMismatch&&(r.message=eW(`enumWarning`,`Value is not accepted. Valid values: {0}.`,this.enumValues.map(function(e){return JSON.stringify(e)}).join(`, `)))}}},e.prototype.mergePropertyMatch=function(e){this.merge(e),this.propertiesMatches++,(e.enumValueMatch||!e.hasProblems()&&e.propertiesMatches)&&this.propertiesValueMatches++,e.enumValueMatch&&e.enumValues&&e.enumValues.length===1&&this.primaryValueMatches++},e.prototype.compare=function(e){var t=this.hasProblems();return t===e.hasProblems()?this.enumValueMatch===e.enumValueMatch?this.primaryValueMatches===e.primaryValueMatches?this.propertiesValueMatches===e.propertiesValueMatches?this.propertiesMatches-e.propertiesMatches:this.propertiesValueMatches-e.propertiesValueMatches:this.primaryValueMatches-e.primaryValueMatches:e.enumValueMatch?-1:1:t?-1:1},e})();function cW(e){return zd(e)}function lW(e,t,n){return n===void 0&&(n=!1),t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}(function(){function e(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=[]),this.root=e,this.syntaxErrors=t,this.comments=n}return e.prototype.getNodeFromOffset=function(e,t){if(t===void 0&&(t=!1),this.root)return Rd(this.root,e,t)},e.prototype.visit=function(e){if(this.root){var t=function(n){var r=e(n),i=n.children;if(Array.isArray(i))for(var a=0;a<i.length&&r;a++)r=t(i[a]);return r};t(this.root)}},e.prototype.validate=function(e,t,n){if(n===void 0&&(n=I.Warning),this.root&&t){var r=new sW;return uW(this.root,t,r,oW.instance),r.problems.map(function(t){var r=F.create(e.positionAt(t.location.offset),e.positionAt(t.location.offset+t.location.length));return Ef.create(r,t.message,t.severity??n,t.code)})}},e.prototype.getMatchingSchemas=function(e,t,n){t===void 0&&(t=-1);var r=new aW(t,n);return this.root&&e&&uW(this.root,e,new sW,r),r.schemas},e})();function uW(e,t,n,r){if(!e||!r.include(e))return;var i=e;switch(i.type){case`object`:l(i,t,n,r);break;case`array`:c(i,t,n,r);break;case`string`:s(i,t,n,r);break;case`number`:o(i,t,n,r);break;case`property`:return uW(i.valueNode,t,n,r)}a(),r.add({node:i,schema:t});function a(){function e(e){return i.type===e||e===`integer`&&i.type===`number`&&i.isInteger}if(Array.isArray(t.type)?t.type.some(e)||n.problems.push({location:{offset:i.offset,length:i.length},message:t.errorMessage||eW(`typeArrayMismatchWarning`,`Incorrect type. Expected one of {0}.`,t.type.join(`, `))}):t.type&&(e(t.type)||n.problems.push({location:{offset:i.offset,length:i.length},message:t.errorMessage||eW(`typeMismatchWarning`,`Incorrect type. Expected "{0}".`,t.type)})),Array.isArray(t.allOf))for(var a=0,o=t.allOf;a<o.length;a++){var s=o[a];uW(i,rW(s),n,r)}var c=rW(t.not);if(c){var l=new sW,u=r.newSub();uW(i,c,l,u),l.hasProblems()||n.problems.push({location:{offset:i.offset,length:i.length},message:eW(`notSchemaWarning`,`Matches a schema that is not allowed.`)});for(var d=0,f=u.schemas;d<f.length;d++){var p=f[d];p.inverted=!p.inverted,r.add(p)}}var m=function(e,t){for(var a=[],o=void 0,s=0,c=e;s<c.length;s++){var l=c[s],u=rW(l),d=new sW,f=r.newSub();if(uW(i,u,d,f),d.hasProblems()||a.push(u),!o)o={schema:u,validationResult:d,matchingSchemas:f};else if(!t&&!d.hasProblems()&&!o.validationResult.hasProblems())o.matchingSchemas.merge(f),o.validationResult.propertiesMatches+=d.propertiesMatches,o.validationResult.propertiesValueMatches+=d.propertiesValueMatches;else{var p=d.compare(o.validationResult);p>0?o={schema:u,validationResult:d,matchingSchemas:f}:p===0&&(o.matchingSchemas.merge(f),o.validationResult.mergeEnumValues(d))}}return a.length>1&&t&&n.problems.push({location:{offset:i.offset,length:1},message:eW(`oneOfWarning`,`Matches multiple schemas when only one must validate.`)}),o&&(n.merge(o.validationResult),n.propertiesMatches+=o.validationResult.propertiesMatches,n.propertiesValueMatches+=o.validationResult.propertiesValueMatches,r.merge(o.matchingSchemas)),a.length};Array.isArray(t.anyOf)&&m(t.anyOf,!1),Array.isArray(t.oneOf)&&m(t.oneOf,!0);var h=function(e){var t=new sW,a=r.newSub();uW(i,rW(e),t,a),n.merge(t),n.propertiesMatches+=t.propertiesMatches,n.propertiesValueMatches+=t.propertiesValueMatches,r.merge(a)},g=function(e,t,n){var a=rW(e),o=new sW,s=r.newSub();uW(i,a,o,s),r.merge(s),o.hasProblems()?n&&h(n):t&&h(t)},_=rW(t.if);if(_&&g(_,rW(t.then),rW(t.else)),Array.isArray(t.enum)){for(var v=cW(i),y=!1,b=0,x=t.enum;b<x.length;b++){var S=x[b];if(WU(v,S)){y=!0;break}}n.enumValues=t.enum,n.enumValueMatch=y,y||n.problems.push({location:{offset:i.offset,length:i.length},code:YU.EnumValueMismatch,message:t.errorMessage||eW(`enumWarning`,`Value is not accepted. Valid values: {0}.`,t.enum.map(function(e){return JSON.stringify(e)}).join(`, `))})}if(KU(t.const)){var v=cW(i);WU(v,t.const)?n.enumValueMatch=!0:(n.problems.push({location:{offset:i.offset,length:i.length},code:YU.EnumValueMismatch,message:t.errorMessage||eW(`constWarning`,`Value must be {0}.`,JSON.stringify(t.const))}),n.enumValueMatch=!1),n.enumValues=[t.const]}t.deprecationMessage&&i.parent&&n.problems.push({location:{offset:i.parent.offset,length:i.parent.length},severity:I.Warning,message:t.deprecationMessage,code:YU.Deprecated})}function o(e,t,n,r){var i=e.value;function a(e){var t=/^(-?\d+)(?:\.(\d+))?(?:e([-+]\d+))?$/.exec(e.toString());return t&&{value:Number(t[1]+(t[2]||``)),multiplier:(t[2]?.length||0)-(parseInt(t[3])||0)}}if(GU(t.multipleOf)){var o=-1;if(Number.isInteger(t.multipleOf))o=i%t.multipleOf;else{var s=a(t.multipleOf),c=a(i);if(s&&c){var l=10**Math.abs(c.multiplier-s.multiplier);c.multiplier<s.multiplier?c.value*=l:s.value*=l,o=c.value%s.value}}o!==0&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`multipleOfWarning`,`Value is not divisible by {0}.`,t.multipleOf)})}function u(e,t){if(GU(t))return t;if(qU(t)&&t)return e}function d(e,t){if(!qU(t)||!t)return e}var f=u(t.minimum,t.exclusiveMinimum);GU(f)&&i<=f&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`exclusiveMinimumWarning`,`Value is below the exclusive minimum of {0}.`,f)});var p=u(t.maximum,t.exclusiveMaximum);GU(p)&&i>=p&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`exclusiveMaximumWarning`,`Value is above the exclusive maximum of {0}.`,p)});var m=d(t.minimum,t.exclusiveMinimum);GU(m)&&i<m&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`minimumWarning`,`Value is below the minimum of {0}.`,m)});var h=d(t.maximum,t.exclusiveMaximum);GU(h)&&i>h&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`maximumWarning`,`Value is above the maximum of {0}.`,h)})}function s(e,t,n,r){if(GU(t.minLength)&&e.value.length<t.minLength&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`minLengthWarning`,`String is shorter than the minimum length of {0}.`,t.minLength)}),GU(t.maxLength)&&e.value.length>t.maxLength&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`maxLengthWarning`,`String is longer than the maximum length of {0}.`,t.maxLength)}),JU(t.pattern)&&(UU(t.pattern).test(e.value)||n.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||eW(`patternWarning`,`String does not match the pattern of "{0}".`,t.pattern)})),t.format)switch(t.format){case`uri`:case`uri-reference`:var i=void 0;if(!e.value)i=eW(`uriEmpty`,`URI expected.`);else{var a=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/.exec(e.value);a?!a[2]&&t.format===`uri`&&(i=eW(`uriSchemeMissing`,`URI with a scheme is expected.`)):i=eW(`uriMissing`,`URI is expected.`)}i&&n.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||eW(`uriFormatWarning`,`String is not a URI: {0}`,i)});break;case`color-hex`:case`date-time`:case`date`:case`time`:case`email`:var o=tW[t.format];(!e.value||!o.pattern.exec(e.value))&&n.problems.push({location:{offset:e.offset,length:e.length},message:t.patternErrorMessage||t.errorMessage||o.errorMessage})}}function c(e,t,n,r){if(Array.isArray(t.items)){for(var i=t.items,a=0;a<i.length;a++){var o=i[a],s=rW(o),c=new sW,l=e.items[a];l?(uW(l,s,c,r),n.mergePropertyMatch(c)):e.items.length>=i.length&&n.propertiesValueMatches++}if(e.items.length>i.length){if(typeof t.additionalItems==`object`)for(var u=i.length;u<e.items.length;u++){var c=new sW;uW(e.items[u],t.additionalItems,c,r),n.mergePropertyMatch(c)}else t.additionalItems===!1&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`additionalItemsWarning`,`Array has too many items according to schema. Expected {0} or fewer.`,i.length)})}}else{var d=rW(t.items);if(d)for(var f=0,p=e.items;f<p.length;f++){var l=p[f],c=new sW;uW(l,d,c,r),n.mergePropertyMatch(c)}}var m=rW(t.contains);if(m&&(e.items.some(function(e){var t=new sW;return uW(e,m,t,oW.instance),!t.hasProblems()})||n.problems.push({location:{offset:e.offset,length:e.length},message:t.errorMessage||eW(`requiredItemMissingWarning`,`Array does not contain required item.`)})),GU(t.minItems)&&e.items.length<t.minItems&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`minItemsWarning`,`Array has too few items. Expected {0} or more.`,t.minItems)}),GU(t.maxItems)&&e.items.length>t.maxItems&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`maxItemsWarning`,`Array has too many items. Expected {0} or fewer.`,t.maxItems)}),t.uniqueItems===!0){var h=cW(e);h.some(function(e,t){return t!==h.lastIndexOf(e)})&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`uniqueItemsWarning`,`Array has duplicate items.`)})}}function l(e,t,n,r){for(var i=/* @__PURE__ */ Object.create(null),a=[],o=0,s=e.properties;o<s.length;o++){var c=s[o],l=c.keyNode.value;i[l]=c.valueNode,a.push(l)}if(Array.isArray(t.required))for(var u=0,d=t.required;u<d.length;u++){var f=d[u];if(!i[f]){var p=e.parent&&e.parent.type===`property`&&e.parent.keyNode,m=p?{offset:p.offset,length:p.length}:{offset:e.offset,length:1};n.problems.push({location:m,message:eW(`MissingRequiredPropWarning`,`Missing property "{0}".`,f)})}}var h=function(e){for(var t=a.indexOf(e);t>=0;)a.splice(t,1),t=a.indexOf(e)};if(t.properties)for(var g=0,_=Object.keys(t.properties);g<_.length;g++){var f=_[g];h(f);var v=t.properties[f],y=i[f];if(y){if(qU(v)){if(v)n.propertiesMatches++,n.propertiesValueMatches++;else{var c=y.parent;n.problems.push({location:{offset:c.keyNode.offset,length:c.keyNode.length},message:t.errorMessage||eW(`DisallowedExtraPropWarning`,`Property {0} is not allowed.`,f)})}}else{var b=new sW;uW(y,v,b,r),n.mergePropertyMatch(b)}}}if(t.patternProperties)for(var x=0,S=Object.keys(t.patternProperties);x<S.length;x++)for(var C=S[x],w=UU(C),ee=0,te=a.slice(0);ee<te.length;ee++){var f=te[ee];if(w.test(f)){h(f);var y=i[f];if(y){var v=t.patternProperties[C];if(qU(v)){if(v)n.propertiesMatches++,n.propertiesValueMatches++;else{var c=y.parent;n.problems.push({location:{offset:c.keyNode.offset,length:c.keyNode.length},message:t.errorMessage||eW(`DisallowedExtraPropWarning`,`Property {0} is not allowed.`,f)})}}else{var b=new sW;uW(y,v,b,r),n.mergePropertyMatch(b)}}}}if(typeof t.additionalProperties==`object`)for(var ne=0,re=a;ne<re.length;ne++){var f=re[ne],y=i[f];if(y){var b=new sW;uW(y,t.additionalProperties,b,r),n.mergePropertyMatch(b)}}else if(t.additionalProperties===!1&&a.length>0)for(var T=0,ie=a;T<ie.length;T++){var f=ie[T],y=i[f];if(y){var c=y.parent;n.problems.push({location:{offset:c.keyNode.offset,length:c.keyNode.length},message:t.errorMessage||eW(`DisallowedExtraPropWarning`,`Property {0} is not allowed.`,f)})}}if(GU(t.maxProperties)&&e.properties.length>t.maxProperties&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`MaxPropWarning`,`Object has more properties than limit of {0}.`,t.maxProperties)}),GU(t.minProperties)&&e.properties.length<t.minProperties&&n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`MinPropWarning`,`Object has fewer properties than the required number of {0}`,t.minProperties)}),t.dependencies)for(var ae=0,oe=Object.keys(t.dependencies);ae<oe.length;ae++){var l=oe[ae];if(i[l]){var se=t.dependencies[l];if(Array.isArray(se))for(var ce=0,le=se;ce<le.length;ce++){var ue=le[ce];i[ue]?n.propertiesValueMatches++:n.problems.push({location:{offset:e.offset,length:e.length},message:eW(`RequiredDependentPropWarning`,`Object is missing property {0} required by property {1}.`,ue,l)})}else{var v=rW(se);if(v){var b=new sW;uW(e,v,b,r),n.mergePropertyMatch(b)}}}}var de=rW(t.propertyNames);if(de)for(var fe=0,pe=e.properties;fe<pe.length;fe++){var l=pe[fe].keyNode;l&&uW(l,de,n,oW.instance)}}}function dW(e,t){if(typeof e!=`string`)throw TypeError(`Expected a string`);for(var n=String(e),r=``,i=t?!!t.extended:!1,a=t?!!t.globstar:!1,o=!1,s=t&&typeof t.flags==`string`?t.flags:``,c,l=0,u=n.length;l<u;l++)switch(c=n[l],c){case`/`:case`$`:case`^`:case`+`:case`.`:case`(`:case`)`:case`=`:case`!`:case`|`:r+=`\\`+c;break;case`?`:if(i){r+=`.`;break}case`[`:case`]`:if(i){r+=c;break}case`{`:if(i){o=!0,r+=`(`;break}case`}`:if(i){o=!1,r+=`)`;break}case`,`:if(o){r+=`|`;break}r+=`\\`+c;break;case`*`:for(var d=n[l-1],f=1;n[l+1]===`*`;)f++,l++;var p=n[l+1];a?f>1&&(d===`/`||d===void 0||d===`{`||d===`,`)&&(p===`/`||p===void 0||p===`,`||p===`}`)?(p===`/`?l++:d===`/`&&r.endsWith(`\\/`)&&(r=r.substr(0,r.length-2)),r+=`((?:[^/]*(?:/|$))*)`):r+=`([^/]*)`:r+=`.*`;break;default:r+=c}return(!s||!~s.indexOf(`g`))&&(r=`^`+r+`$`),new RegExp(r,s)}var fW=QU(),pW=`!`,mW=`/`,hW=(function(){function e(e,t){this.globWrappers=[];try{for(var n=0,r=e;n<r.length;n++){var i=r[n],a=i[0]!==pW;a||(i=i.substring(1)),i.length>0&&(i[0]===mW&&(i=i.substring(1)),this.globWrappers.push({regexp:dW(`**/`+i,{extended:!0,globstar:!0}),include:a}))}this.uris=t}catch{this.globWrappers.length=0,this.uris=[]}}return e.prototype.matchesPattern=function(e){for(var t=!1,n=0,r=this.globWrappers;n<r.length;n++){var i=r[n],a=i.regexp,o=i.include;a.test(e)&&(t=o)}return t},e.prototype.getURIs=function(){return this.uris},e})(),gW=(function(){function e(e,t,n){this.service=e,this.url=t,this.dependencies={},n&&(this.unresolvedSchema=this.service.promise.resolve(new _W(n)))}return e.prototype.getUnresolvedSchema=function(){return this.unresolvedSchema||=this.service.loadSchema(this.url),this.unresolvedSchema},e.prototype.getResolvedSchema=function(){var e=this;return this.resolvedSchema||=this.getUnresolvedSchema().then(function(t){return e.service.resolveSchemaContent(t,e.url,e.dependencies)}),this.resolvedSchema},e.prototype.clearSchema=function(){this.resolvedSchema=void 0,this.unresolvedSchema=void 0,this.dependencies={}},e})(),_W=/* @__PURE__ */ (function(){function e(e,t){t===void 0&&(t=[]),this.schema=e,this.errors=t}return e})(),vW=(function(){function e(e,t){t===void 0&&(t=[]),this.schema=e,this.errors=t}return e.prototype.getSection=function(e){var t=this.getSectionRecursive(e,this.schema);if(t)return rW(t)},e.prototype.getSectionRecursive=function(e,t){if(!t||typeof t==`boolean`||e.length===0)return t;var n=e.shift();if(t.properties&&typeof t.properties[n])return this.getSectionRecursive(e,t.properties[n]);if(t.patternProperties)for(var r=0,i=Object.keys(t.patternProperties);r<i.length;r++){var a=i[r];if(UU(a).test(n))return this.getSectionRecursive(e,t.patternProperties[a])}else if(typeof t.additionalProperties==`object`)return this.getSectionRecursive(e,t.additionalProperties);else if(n.match(`[0-9]+`)){if(Array.isArray(t.items)){var o=parseInt(n,10);if(!isNaN(o)&&t.items[o])return this.getSectionRecursive(e,t.items[o])}else if(t.items)return this.getSectionRecursive(e,t.items)}},e})(),yW=(function(){function e(e,t,n){this.contextService=t,this.requestService=e,this.promiseConstructor=n||Promise,this.callOnDispose=[],this.contributionSchemas={},this.contributionAssociations=[],this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={}}return e.prototype.getRegisteredSchemaIds=function(e){return Object.keys(this.registeredSchemasIds).filter(function(t){var n=Xd.parse(t).scheme;return n!==`schemaservice`&&(!e||e(n))})},Object.defineProperty(e.prototype,"promise",{get:function(){return this.promiseConstructor},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){for(;this.callOnDispose.length>0;)this.callOnDispose.pop()()},e.prototype.onResourceChange=function(e){var t=this;this.cachedSchemaForResource=void 0;var n=!1;e=xW(e);for(var r=[e],i=Object.keys(this.schemasById).map(function(e){return t.schemasById[e]});r.length;)for(var a=r.pop(),o=0;o<i.length;o++){var s=i[o];s&&(s.url===a||s.dependencies[a])&&(s.url!==a&&r.push(s.url),s.clearSchema(),i[o]=void 0,n=!0)}return n},e.prototype.setSchemaContributions=function(e){if(e.schemas){var t=e.schemas;for(var n in t){var r=xW(n);this.contributionSchemas[r]=this.addSchemaHandle(r,t[n])}}if(Array.isArray(e.schemaAssociations))for(var i=e.schemaAssociations,a=0,o=i;a<o.length;a++){var s=o[a],c=s.uris.map(xW),l=this.addFilePatternAssociation(s.pattern,c);this.contributionAssociations.push(l)}},e.prototype.addSchemaHandle=function(e,t){var n=new gW(this,e,t);return this.schemasById[e]=n,n},e.prototype.getOrAddSchemaHandle=function(e,t){return this.schemasById[e]||this.addSchemaHandle(e,t)},e.prototype.addFilePatternAssociation=function(e,t){var n=new hW(e,t);return this.filePatternAssociations.push(n),n},e.prototype.registerExternalSchema=function(e,t,n){var r=xW(e);return this.registeredSchemasIds[r]=!0,this.cachedSchemaForResource=void 0,t&&this.addFilePatternAssociation(t,[e]),n?this.addSchemaHandle(r,n):this.getOrAddSchemaHandle(r)},e.prototype.clearExternalSchemas=function(){for(var e in this.schemasById={},this.filePatternAssociations=[],this.registeredSchemasIds={},this.cachedSchemaForResource=void 0,this.contributionSchemas)this.schemasById[e]=this.contributionSchemas[e],this.registeredSchemasIds[e]=!0;for(var t=0,n=this.contributionAssociations;t<n.length;t++){var r=n[t];this.filePatternAssociations.push(r)}},e.prototype.getResolvedSchema=function(e){var t=xW(e),n=this.schemasById[t];return n?n.getResolvedSchema():this.promise.resolve(void 0)},e.prototype.loadSchema=function(e){if(!this.requestService){var t=fW(`json.schema.norequestservice`,`Unable to load schema from '{0}'. No schema request service available`,CW(e));return this.promise.resolve(new _W({},[t]))}return this.requestService(e).then(function(t){if(!t)return new _W({},[fW(`json.schema.nocontent`,`Unable to load schema from '{0}': No content.`,CW(e))]);var n={},r=[];n=Ld(t,r);var i=r.length?[fW(`json.schema.invalidFormat`,`Unable to parse content from '{0}': Parse error at offset {1}.`,CW(e),r[0].offset)]:[];return new _W(n,i)},function(t){var n=t.toString(),r=t.toString().split(`Error: `);return r.length>1&&(n=r[1]),HU(n,`.`)&&(n=n.substr(0,n.length-1)),new _W({},[fW(`json.schema.nocontent`,`Unable to load schema from '{0}': {1}.`,CW(e),n)])})},e.prototype.resolveSchemaContent=function(e,t,n){var r=this,i=e.errors.slice(0),a=e.schema;if(a.$schema){var o=xW(a.$schema);if(o===`http://json-schema.org/draft-03/schema`)return this.promise.resolve(new vW({},[fW(`json.schema.draft03.notsupported`,`Draft-03 schemas are not supported.`)]));o===`https://json-schema.org/draft/2019-09/schema`&&i.push(fW(`json.schema.draft201909.notsupported`,`Draft 2019-09 schemas are not yet fully supported.`))}var s=this.contextService,c=function(e,t){if(!t)return e;var n=e;return t[0]===`/`&&(t=t.substr(1)),t.split(`/`).some(function(e){return e=e.replace(/~1/g,`/`).replace(/~0/g,`~`),n=n[e],!n}),n},l=function(e,t,n,r){var a=r?decodeURIComponent(r):void 0,o=c(t,a);if(o)for(var s in o)o.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(e[s]=o[s]);else i.push(fW(`json.schema.invalidref`,`$ref '{0}' in '{1}' can not be resolved.`,a,n))},u=function(e,t,n,a,o){s&&!/^[A-Za-z][A-Za-z0-9+\-.+]*:\/\/.*/.test(t)&&(t=s.resolveRelativePath(t,a)),t=xW(t);var c=r.getOrAddSchemaHandle(t);return c.getUnresolvedSchema().then(function(r){if(o[t]=!0,r.errors.length){var a=n?t+`#`+n:t;i.push(fW(`json.schema.problemloadingref`,`Problems loading reference '{0}': {1}`,a,r.errors[0]))}return l(e,r.schema,t,n),d(e,r.schema,t,c.dependencies)})},d=function(e,t,n,i){if(!e||typeof e!=`object`)return Promise.resolve(null);for(var a=[e],o=[],s=[],c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var i=r[n];typeof i==`object`&&a.push(i)}},d=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var i=r[n];if(typeof i==`object`)for(var o in i){var s=i[o];typeof s==`object`&&a.push(s)}}},f=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var i=r[n];if(Array.isArray(i))for(var o=0,s=i;o<s.length;o++){var c=s[o];typeof c==`object`&&a.push(c)}}},p=function(e){for(var r=[];e.$ref;){var a=e.$ref,o=a.split(`#`,2);if(delete e.$ref,o[0].length>0){s.push(u(e,o[0],o[1],n,i));return}r.indexOf(a)===-1&&(l(e,t,n,o[1]),r.push(a))}c(e.items,e.additionalItems,e.additionalProperties,e.not,e.contains,e.propertyNames,e.if,e.then,e.else),d(e.definitions,e.properties,e.patternProperties,e.dependencies),f(e.anyOf,e.allOf,e.oneOf,e.items)};a.length;){var m=a.pop();o.indexOf(m)>=0||(o.push(m),p(m))}return r.promise.all(s)};return d(a,a,t,n).then(function(e){return new vW(a,i)})},e.prototype.getSchemaForResource=function(e,t){if(t&&t.root&&t.root.type===`object`){var n=t.root.properties.filter(function(e){return e.keyNode.value===`$schema`&&e.valueNode&&e.valueNode.type===`string`});if(n.length>0){var r=n[0].valueNode;if(r&&r.type===`string`){var i=cW(r);if(i&&VU(i,`.`)&&this.contextService&&(i=this.contextService.resolveRelativePath(i,e)),i){var a=xW(i);return this.getOrAddSchemaHandle(a).getResolvedSchema()}}}}if(this.cachedSchemaForResource&&this.cachedSchemaForResource.resource===e)return this.cachedSchemaForResource.resolvedSchema;for(var o=/* @__PURE__ */ Object.create(null),s=[],c=SW(e),l=0,u=this.filePatternAssociations;l<u.length;l++){var d=u[l];if(d.matchesPattern(c))for(var f=0,p=d.getURIs();f<p.length;f++){var m=p[f];o[m]||(s.push(m),o[m]=!0)}}var h=s.length>0?this.createCombinedSchema(e,s).getResolvedSchema():this.promise.resolve(void 0);return this.cachedSchemaForResource={resource:e,resolvedSchema:h},h},e.prototype.createCombinedSchema=function(e,t){if(t.length===1)return this.getOrAddSchemaHandle(t[0]);var n=`schemaservice://combinedSchema/`+encodeURIComponent(e),r={allOf:t.map(function(e){return{$ref:e}})};return this.addSchemaHandle(n,r)},e.prototype.getMatchingSchemas=function(e,t,n){if(n){var r=n.id||`schemaservice://untitled/matchingSchemas/`+bW++;return this.resolveSchemaContent(new _W(n),r,{}).then(function(e){return t.getMatchingSchemas(e.schema).filter(function(e){return!e.inverted})})}return this.getSchemaForResource(e.uri,t).then(function(e){return e?t.getMatchingSchemas(e.schema).filter(function(e){return!e.inverted}):[]})},e})(),bW=0;function xW(e){try{return Xd.parse(e).toString()}catch{return e}}function SW(e){try{return Xd.parse(e).with({fragment:null,query:null}).toString()}catch{return e}}function CW(e){try{var t=Xd.parse(e);if(t.scheme===`file`)return t.fsPath}catch{}return e}var wW;(function(e){e.draft04=`draft04`,e.draft07=`draft07`,e.draft2019=`draft2019-09`,e.draft2020=`draft2020-12`})(wW||={});function TW(e){switch(e.type){case`array`:return e.children.map(TW);case`object`:{let t=/* @__PURE__ */ Object.create(null);for(let n=0,r=e.children;n<r.length;n++){let e=r[n],i=e.children[1];i&&(t[e.children[0].value]=TW(i))}return t}case`null`:case`string`:case`number`:return e.value;case`boolean`:return e.source;default:return}}function EW(e,t,n=!1){return t>=e.offset&&t<=e.offset+e.length||n&&t===e.offset+e.length}function DW(e,t,n){if(n===void 0&&(n=!1),EW(e,t,n)){let r=e.children;if(Array.isArray(r))for(let e=0;e<r.length&&r[e].offset<=t;e++){let i=DW(r[e],t,n);if(i)return i}return e}}function OW(e){if([`true`,`True`,`TRUE`,`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`].lastIndexOf(e)>=0)return!0;if([`false`,`False`,`FALSE`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`].lastIndexOf(e)>=0)return!1;throw`Invalid boolean "${e}"`}function kW(e,t,n){if(n===`boolean`&&typeof e==`string`&&(e=OW(e)),e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`||Array.isArray(e)!==Array.isArray(t))return!1;let r,i;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(r=0;r<e.length;r++)if(!kW(e[r],t[r]))return!1}else{let n=[];for(i in e)n.push(i);n.sort();let a=[];for(i in t)a.push(i);if(a.sort(),!kW(n,a))return!1;for(r=0;r<n.length;r++)if(!kW(e[n[r]],t[n[r]]))return!1}return!0}function AW(e){return typeof e==`number`}function jW(e){return e!==void 0}function MW(e){return typeof e==`boolean`}function NW(e){return typeof e==`string`}function PW(e){return Symbol.iterator in Object(e)}function FW(e){let t=e.type&&e.closestTitle;return e.title?e.title:e.$id?IW(e.$id):e.$ref||e._$ref?IW(e.$ref||e._$ref):Array.isArray(e.type)?e.type.join(` | `):t?e.type.concat(`(`,e.closestTitle,`)`):e.type||e.closestTitle}function IW(e){let t=e.match(/^(?:.*\/)?(.*?)(?:\.schema\.json)?$/),n=!!t&&t[1];return n||(n=`typeNotFound`,console.error(`$ref (${e}) not parsed properly`)),n}function LW(e,t){let n=Xd.parse(t),r=Hp.basename(n.fsPath);return Hp.extname(n.fsPath)||(r+=`.json`),Object.getOwnPropertyDescriptor(e,`name`)?Object.getOwnPropertyDescriptor(e,`name`).value+` (${r})`:e.title?e.description?e.title+` - `+e.description+` (${r})`:e.title+` (${r})`:r}function RW(e){return e.type!==`object`&&!zW(e)}function zW(e){return!!(e.anyOf||e.allOf||e.oneOf)}function BW(e,t){for(let n of t.documents)if(n.internalDocument&&n.internalDocument.range[0]<=e&&n.internalDocument.range[2]>=e)return n;return t.documents.length===1?t.documents[0]:null}function VW(e){let t=[`mapping`,`scalar`,`sequence`];return e?e.filter(e=>{if(typeof e==`string`){let n=e.split(` `),r=n[1]&&n[1].toLowerCase()||`scalar`;return r!==`map`&&t.indexOf(r)!==-1}return!1}):[]}function HW(e,t){if(!t||!e||t.length!==e.length)return!1;for(let n=e.length-1;n>=0;n--)if(e[n]!==t[n])return!1;return!0}function UW(e){return e.replace(/[-\\{}+?|^$.,[\]()#\s]/g,`\\$&`).replace(/[*]/g,`.*`)}function WW(e,t){if(e.length<t)return 0;for(let n=0;n<t;n++){let t=e.charCodeAt(n);if(t!==32&&t!==9)return n}return t}function GW(e){let t=``;e=e.replace(/\(\?([ims]+)\)/g,(e,n)=>{for(let e of n)t.includes(e)||(t+=e);return``});try{return new RegExp(e,t+`u`)}catch{try{return new RegExp(e,t)}catch{return}}}function KW(e,t){t++;for(let n=t;n<e.length;n++){let r=e.charAt(n);if(r===` `||r===` `)t++;else return t}return t}var qW=class{constructor(e){try{this.patternRegExp=RegExp(UW(e)+`$`)}catch{this.patternRegExp=null}this.schemas=[]}addSchema(e){this.schemas.push(e)}matchesPattern(e){return this.patternRegExp&&this.patternRegExp.test(e)}getSchemas(){return this.schemas}};function JW(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=Math.max(n,r);return parseInt(e.toFixed(i).replace(`.`,``))%parseInt(t.toFixed(i).replace(`.`,``))/10**i}var YW=QU(),XW=(function(){function e(e,t){this.jsonSchemaService=e,this.promise=t,this.validationEnabled=!0}return e.prototype.configure=function(e){e&&(this.validationEnabled=e.validate!==!1,this.commentSeverity=e.allowComments?void 0:I.Error)},e.prototype.doValidation=function(e,t,n,r){var i=this;if(!this.validationEnabled)return this.promise.resolve([]);var a=[],o={},s=function(e){var t=e.range.start.line+` `+e.range.start.character+` `+e.message;o[t]||(o[t]=!0,a.push(e))},c=function(r){var o=n?.trailingCommas?eG(n.trailingCommas):I.Error,c=n?.comments?eG(n.comments):i.commentSeverity,l=n?.schemaValidation?eG(n.schemaValidation):I.Warning,u=n?.schemaRequest?eG(n.schemaRequest):I.Warning;if(r){if(r.errors.length&&t.root&&u){var d=t.root,f=d.type===`object`?d.properties[0]:void 0;if(f&&f.keyNode.value===`$schema`){var p=f.valueNode||f,m=F.create(e.positionAt(p.offset),e.positionAt(p.offset+p.length));s(Ef.create(m,r.errors[0],u,YU.SchemaResolveError))}else{var m=F.create(e.positionAt(d.offset),e.positionAt(d.offset+1));s(Ef.create(m,r.errors[0],u,YU.SchemaResolveError))}}else if(l){var h=t.validate(e,r.schema,l);h&&h.forEach(s)}QW(r.schema)&&(c=void 0),$W(r.schema)&&(o=void 0)}for(var g=0,_=t.syntaxErrors;g<_.length;g++){var v=_[g];if(v.code===YU.TrailingComma){if(typeof o!=`number`)continue;v.severity=o}s(v)}if(typeof c==`number`){var y=YW(`InvalidCommentToken`,`Comments are not permitted in JSON.`);t.comments.forEach(function(e){s(Ef.create(e,y,c,YU.CommentNotPermitted))})}return a};if(r){var l=r.id||`schemaservice://untitled/`+ZW++;return this.jsonSchemaService.resolveSchemaContent(new _W(r),l,{}).then(function(e){return c(e)})}return this.jsonSchemaService.getSchemaForResource(e.uri,t).then(function(e){return c(e)})},e})(),ZW=0;function QW(e){if(e&&typeof e==`object`){if(qU(e.allowComments))return e.allowComments;if(e.allOf)for(var t=0,n=e.allOf;t<n.length;t++){var r=n[t],i=QW(r);if(qU(i))return i}}}function $W(e){if(e&&typeof e==`object`){if(qU(e.allowTrailingCommas))return e.allowTrailingCommas;var t=e;if(qU(t.allowsTrailingCommas))return t.allowsTrailingCommas;if(e.allOf)for(var n=0,r=e.allOf;n<r.length;n++){var i=r[n],a=$W(i);if(qU(a))return a}}}function eG(e){switch(e){case`error`:return I.Error;case`warning`:return I.Warning;case`ignore`:return}}var tG=48,nG=57,rG=65,iG=97,aG=102;function oG(e){return e<tG?0:e<=nG?e-tG:(e<iG&&(e+=iG-rG),e>=iG&&e<=aG?e-iG+10:0)}function sG(e){if(e[0]===`#`)switch(e.length){case 4:return{red:oG(e.charCodeAt(1))*17/255,green:oG(e.charCodeAt(2))*17/255,blue:oG(e.charCodeAt(3))*17/255,alpha:1};case 5:return{red:oG(e.charCodeAt(1))*17/255,green:oG(e.charCodeAt(2))*17/255,blue:oG(e.charCodeAt(3))*17/255,alpha:oG(e.charCodeAt(4))*17/255};case 7:return{red:(oG(e.charCodeAt(1))*16+oG(e.charCodeAt(2)))/255,green:(oG(e.charCodeAt(3))*16+oG(e.charCodeAt(4)))/255,blue:(oG(e.charCodeAt(5))*16+oG(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(oG(e.charCodeAt(1))*16+oG(e.charCodeAt(2)))/255,green:(oG(e.charCodeAt(3))*16+oG(e.charCodeAt(4)))/255,blue:(oG(e.charCodeAt(5))*16+oG(e.charCodeAt(6)))/255,alpha:(oG(e.charCodeAt(7))*16+oG(e.charCodeAt(8)))/255}}}var cG=(function(){function e(e){this.schemaService=e}return e.prototype.findDocumentSymbols=function(e,t,n){var r=this;n===void 0&&(n={resultLimit:Number.MAX_VALUE});var i=t.root;if(!i)return[];var a=n.resultLimit||Number.MAX_VALUE,o=e.uri;if((o===`vscode://defaultsettings/keybindings.json`||HU(o.toLowerCase(),`/user/keybindings.json`))&&i.type===`array`){for(var s=[],c=0,l=i.items;c<l.length;c++){var u=l[c];if(u.type===`object`)for(var d=0,f=u.properties;d<f.length;d++){var p=f[d];if(p.keyNode.value===`key`&&p.valueNode){var m=gf.create(e.uri,lG(e,u));if(s.push({name:cW(p.valueNode),kind:op.Function,location:m}),a--,a<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(o),s}}}return s}for(var h=[{node:i,containerName:``}],g=0,_=!1,v=[],y=function(t,n){t.type===`array`?t.items.forEach(function(e){e&&h.push({node:e,containerName:n})}):t.type===`object`&&t.properties.forEach(function(t){var i=t.valueNode;if(i){if(a>0){a--;var o=gf.create(e.uri,lG(e,t)),s=n?n+`.`+t.keyNode.value:t.keyNode.value;v.push({name:r.getKeyLabel(t),kind:r.getSymbolKind(i.type),location:o,containerName:n}),h.push({node:i,containerName:s})}else _=!0}})};g<h.length;){var b=h[g++];y(b.node,b.containerName)}return _&&n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(o),v},e.prototype.findDocumentSymbols2=function(e,t,n){var r=this;n===void 0&&(n={resultLimit:Number.MAX_VALUE});var i=t.root;if(!i)return[];var a=n.resultLimit||Number.MAX_VALUE,o=e.uri;if((o===`vscode://defaultsettings/keybindings.json`||HU(o.toLowerCase(),`/user/keybindings.json`))&&i.type===`array`){for(var s=[],c=0,l=i.items;c<l.length;c++){var u=l[c];if(u.type===`object`)for(var d=0,f=u.properties;d<f.length;d++){var p=f[d];if(p.keyNode.value===`key`&&p.valueNode){var m=lG(e,u),h=lG(e,p.keyNode);if(s.push({name:cW(p.valueNode),kind:op.Function,range:m,selectionRange:h}),a--,a<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(o),s}}}return s}for(var g=[],_=[{node:i,result:g}],v=0,y=!1,b=function(t,n){t.type===`array`?t.items.forEach(function(t,i){if(t){if(a>0){a--;var o=lG(e,t),s=o,c={name:String(i),kind:r.getSymbolKind(t.type),range:o,selectionRange:s,children:[]};n.push(c),_.push({result:c.children,node:t})}else y=!0}}):t.type===`object`&&t.properties.forEach(function(t){var i=t.valueNode;if(i){if(a>0){a--;var o=lG(e,t),s=lG(e,t.keyNode),c=[],l={name:r.getKeyLabel(t),kind:r.getSymbolKind(i.type),range:o,selectionRange:s,children:c,detail:r.getDetail(i)};n.push(l),_.push({result:c,node:i})}else y=!0}})};v<_.length;){var x=_[v++];b(x.node,x.result)}return y&&n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(o),g},e.prototype.getSymbolKind=function(e){switch(e){case`object`:return op.Module;case`string`:return op.String;case`number`:return op.Number;case`array`:return op.Array;case`boolean`:return op.Boolean;default:return op.Variable}},e.prototype.getKeyLabel=function(e){var t=e.keyNode.value;return t&&=t.replace(/[\n]/g,`↵`),t&&t.trim()?t:`"`+t+`"`},e.prototype.getDetail=function(e){if(e){if(e.type===`boolean`||e.type===`number`||e.type===`null`||e.type===`string`)return String(e.value);if(e.type===`array`)return e.children.length?void 0:`[]`;if(e.type===`object`)return e.children.length?void 0:`{}`}},e.prototype.findDocumentColors=function(e,t,n){return this.schemaService.getSchemaForResource(e.uri,t).then(function(r){var i=[];if(r)for(var a=n&&typeof n.resultLimit==`number`?n.resultLimit:Number.MAX_VALUE,o=t.getMatchingSchemas(r.schema),s={},c=0,l=o;c<l.length;c++){var u=l[c];if(!u.inverted&&u.schema&&(u.schema.format===`color`||u.schema.format===`color-hex`)&&u.node&&u.node.type===`string`){var d=String(u.node.offset);if(!s[d]){var f=sG(cW(u.node));if(f){var p=lG(e,u.node);i.push({color:f,range:p})}if(s[d]=!0,a--,a<=0)return n&&n.onResultLimitExceeded&&n.onResultLimitExceeded(e.uri),i}}}return i})},e.prototype.getColorPresentations=function(e,t,n,r){var i=[],a=Math.round(n.red*255),o=Math.round(n.green*255),s=Math.round(n.blue*255);function c(e){var t=e.toString(16);return t.length===2?t:`0`+t}var l=n.alpha===1?`#`+c(a)+c(o)+c(s):`#`+c(a)+c(o)+c(s)+c(Math.round(n.alpha*255));return i.push({label:l,textEdit:Of.replace(r,JSON.stringify(l))}),i},e})();function lG(e,t){return F.create(e.positionAt(t.offset),e.positionAt(t.offset+t.length))}function uG(e,t){var n=[];return t.visit(function(r){if(r.type===`property`&&r.keyNode.value===`$ref`&&r.valueNode?.type===`string`){var i=r.valueNode.value,a=fG(t,i);if(a){var o=e.positionAt(a.offset);n.push({target:e.uri+`#`+(o.line+1)+`,`+(o.character+1),range:dG(e,r.valueNode)})}}return!0}),Promise.resolve(n)}function dG(e,t){return F.create(e.positionAt(t.offset+1),e.positionAt(t.offset+t.length-1))}function fG(e,t){var n=mG(t);return n?pG(n,e.root):null}function pG(e,t){if(!t)return null;if(e.length===0)return t;var n=e.shift();if(t&&t.type===`object`){var r=t.properties.find(function(e){return e.keyNode.value===n});return r?pG(e,r.valueNode):null}if(t&&t.type===`array`&&n.match(/^(0|[1-9][0-9]*)$/)){var i=Number.parseInt(n),a=t.items[i];return a?pG(e,a):null}return null}function mG(e){return e===`#`?[]:e[0]!==`#`||e[1]!==`/`?null:e.substring(2).split(/\//).map(hG)}function hG(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}var gG=`YAML`,_G=`yaml-schema: `,vG;(function(e){e.missingRequiredPropWarning=`missingRequiredPropWarning`,e.typeMismatchWarning=`typeMismatchWarning`,e.constWarning=`constWarning`})(vG||={});var yG={[vG.missingRequiredPropWarning]:`Missing property "{0}".`,[vG.typeMismatchWarning]:`Incorrect type. Expected "{0}".`,[vG.constWarning]:`Value must be {0}.`},bG=class e{constructor(e=-1,t=null){this.focusOffset=e,this.exclude=t,this.schemas=[]}add(e){this.schemas.push(e)}merge(e){this.schemas.push(...e.schemas)}include(e){return(this.focusOffset===-1||EW(e,this.focusOffset))&&e!==this.exclude}newSub(){return new e(-1,this.exclude)}},xG=class{constructor(){}get schemas(){return[]}add(){}merge(){}include(){return!0}newSub(){return this}};xG.instance=new xG;var SG={"color-hex":{errorMessage:R(`Invalid color format. Use #RGB, #RGBA, #RRGGBB or #RRGGBBAA.`),pattern:/^#([0-9A-Fa-f]{3,4}|([0-9A-Fa-f]{2}){3,4})$/},"date-time":{errorMessage:R(`String is not a RFC3339 date-time.`),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},date:{errorMessage:R(`String is not a RFC3339 date.`),pattern:/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/i},time:{errorMessage:R(`String is not a RFC3339 time.`),pattern:/^([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)([01][0-9]|2[0-3]):([0-5][0-9]))$/i},email:{errorMessage:R(`String is not an e-mail address.`),pattern:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/},ipv4:{errorMessage:R(`String does not match IPv4 format.`),pattern:/^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/},ipv6:{errorMessage:R(`String does not match IPv6 format.`),pattern:/^([0-9a-f]|:){1,4}(:([0-9a-f]{0,4})*){1,7}$/i}},CG=class{constructor(e){this.problems=[],this.propertiesMatches=0,this.propertiesValueMatches=0,this.primaryValueMatches=0,this.enumValueMatch=!1,this.enumValues=null,e&&(this.enumValues=[])}getEvaluatedItems(e){this.evaluatedItemsByNode??=/* @__PURE__ */ new Map;let t=this.evaluatedItemsByNode.get(e);return t||(t=/* @__PURE__ */ new Set,this.evaluatedItemsByNode.set(e,t)),t}hasProblems(){return this.problems.length>0}merge(e){if(this.problems=this.problems.concat(e.problems),e.evaluatedProperties){this.evaluatedProperties??=/* @__PURE__ */ new Set;for(let t of e.evaluatedProperties)this.evaluatedProperties.add(t)}if(e.evaluatedItemsByNode){this.evaluatedItemsByNode??=/* @__PURE__ */ new Map;for(let[t,n]of e.evaluatedItemsByNode){let e=this.evaluatedItemsByNode.get(t);if(e)for(let t of n)e.add(t);else this.evaluatedItemsByNode.set(t,new Set(n))}}}mergeEnumValues(e){if(!this.enumValueMatch&&!e.enumValueMatch&&this.enumValues&&e.enumValues){this.enumValues=this.enumValues.concat(e.enumValues);for(let e of this.problems)e.code===YU.EnumValueMismatch&&(e.message=R(`Value is not accepted. Valid values: {0}.`,[...new Set(this.enumValues)].map(e=>JSON.stringify(e)).join(`, `)))}}mergeWarningGeneric(e,t){if(this.problems?.length)for(let n of t){let t=this.problems.filter(e=>e.problemType===n);for(let r of t){let t=e.problems?.find(e=>e.problemType===n&&r.location.offset===e.location.offset&&(n!==vG.missingRequiredPropWarning||HW(e.problemArgs,r.problemArgs)));t&&(t.problemArgs?.length&&(t.problemArgs.filter(e=>!r.problemArgs.includes(e)).forEach(e=>r.problemArgs.push(e)),r.problemType&&(r.message=EG(r.problemType,r.problemArgs??[]))),this.mergeSources(t,r))}}}mergePropertyMatch(e,t=!0){t?this.merge(e):this.problems=this.problems.concat(e.problems),this.propertiesMatches++,(e.enumValueMatch||!e.hasProblems()&&e.propertiesMatches)&&this.propertiesValueMatches++,e.enumValueMatch&&e.enumValues&&this.primaryValueMatches++}mergeSources(e,t){let n=(e.source??``).replace(_G,``);n&&t.source&&!t.source.includes(n)&&(t.source=t.source+` | `+n),t.schemaUri&&e.schemaUri&&!t.schemaUri.includes(e.schemaUri[0])&&(t.schemaUri=t.schemaUri.concat(e.schemaUri))}compareGeneric(e){let t=this.hasProblems();return t===e.hasProblems()?this.enumValueMatch===e.enumValueMatch?this.propertiesValueMatches===e.propertiesValueMatches?this.primaryValueMatches===e.primaryValueMatches?this.propertiesMatches-e.propertiesMatches:this.primaryValueMatches-e.primaryValueMatches:this.propertiesValueMatches-e.propertiesValueMatches:e.enumValueMatch?-1:1:t?-1:1}compareKubernetes(e){let t=this.hasProblems();return this.propertiesMatches===e.propertiesMatches?this.enumValueMatch===e.enumValueMatch?this.primaryValueMatches===e.primaryValueMatches?this.propertiesValueMatches===e.propertiesValueMatches?t===e.hasProblems()?this.propertiesMatches-e.propertiesMatches:t?-1:1:this.propertiesValueMatches-e.propertiesValueMatches:this.primaryValueMatches-e.primaryValueMatches:e.enumValueMatch?-1:1:this.propertiesMatches-e.propertiesMatches}},wG=class{collectSeenKeys(e){let t=/* @__PURE__ */ Object.create(null),n=[...e.properties];for(;n.length>0;){let e=n.pop();if(!e)continue;let r=e.keyNode.value;if(r===`<<`&&e.valueNode){let t=e.valueNode;switch(t.type){case`object`:n.push(...t.properties);break;case`array`:t.items.forEach(e=>{e&&e.type===`object`&&PW(e.properties)&&n.push(...e.properties)})}}else t[r]=e.valueNode}return t}validateDocument(e,t,n,r){let i=new CG(r.isKubernetes);return this.validateNode(e,n,n,i,xG.instance,r),i.problems.map(e=>{let n=F.create(t.positionAt(e.location.offset),t.positionAt(e.location.offset+e.location.length)),r=Ef.create(n,e.message,e.severity,e.code?e.code:YU.Undefined,e.source);return r.data={schemaUri:e.schemaUri,...e.data},r})}getMatchingSchemas(e,t,n,r,i){let a=new bG(r,i);return this.validateNode(e,t,t,new CG(n.isKubernetes),a,n),a.schemas}getNoOpCollector(){return xG.instance}getSchemaSource(e,t){let n;if(e.title)n=e.title;else if(e.closestTitle)n=e.closestTitle;else if(t.closestTitle)n=t.closestTitle;else{let r=e.url??t.url;r&&(n=Xd.parse(r).toString())}return n?`${_G}${n}`:gG}getSchemaUri(e,t){let n=e.url??t.url;return n?[n]:[]}validateNode(e,t,n,r,i,a){if(e&&t&&typeof t==`object`){if(t._dialect){let o=t._dialect;if(o!==this.getCurrentDialect()){MG(o).validateNode(e,t,n,r,i,a);return}}switch(t.url||=n.url,t.closestTitle=t.title||n.closestTitle,e.type){case`object`:this.validateObjectNode(e,t,n,r,i,a);break;case`array`:this.validateArrayNode(e,t,n,r,i,a);break;case`string`:this.validateStringNode(e,t,n,r);break;case`number`:this.validateNumberNode(e,t,n,r);break;case`property`:this.validateNode(e.valueNode,t,t,r,i,a)}if(this.validateGenericNode(e,t,n,r,i,a),i.add({node:e,schema:t}),this.applyUnevaluatedItems(e,t,n,r,i,a),e.type===`object`){let o=this.collectSeenKeys(e);this.applyUnevaluatedProperties(e,t,n,r,i,a,o)}}}validateGenericNode(e,t,n,r,i,a){let{isKubernetes:o,callFromAutoComplete:s}=a,c=t=>e.type===t||t===`integer`&&e.type===`number`&&e.isInteger,l=(e,t)=>{if(t.evaluatedProperties){e.evaluatedProperties??=/* @__PURE__ */ new Set;for(let n of t.evaluatedProperties)e.evaluatedProperties.add(n)}if(t.evaluatedItemsByNode){e.evaluatedItemsByNode??=/* @__PURE__ */ new Map;for(let[n,r]of t.evaluatedItemsByNode){let t=e.evaluatedItemsByNode.get(n);if(t)for(let e of r)t.add(e);else e.evaluatedItemsByNode.set(n,new Set(r))}}};if(Array.isArray(t.type))t.type.some(c)||r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Incorrect type. Expected one of {0}.`,t.type.join(`, `)),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});else if(t.type&&!c(t.type)){let i=t.type===`object`?FW(t):t.type;r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||EG(vG.typeMismatchWarning,[i]),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n),problemType:vG.typeMismatchWarning,problemArgs:[i]})}if(Array.isArray(t.allOf))for(let n of t.allOf){let s=TG(n),c=new CG(o),l=i.newSub();this.validateNode(e,s,t,c,l,a),r.merge(c),r.propertiesMatches+=c.propertiesMatches,r.propertiesValueMatches+=c.propertiesValueMatches,i.merge(l)}let u=TG(t.not);if(u){let s=new CG(o),c=i.newSub();this.validateNode(e,u,t,s,c,a),s.hasProblems()||r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Matches a schema that is not allowed.`),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});for(let e of c.schemas)e.inverted=!e.inverted,i.add(e)}let d=(c,u)=>{let d=[],f=[],p=[],m=null;for(let n of c){let r={...TG(n)},c=new CG(o),l=i.newSub();this.validateNode(e,r,t,c,l,a),(!c.hasProblems()||s)&&(d.push(r),c.propertiesMatches===0&&f.push(r),r.format&&d.pop()),c.hasProblems()||p.push(c),m=m?o?this.alternativeComparison(c,m,r,l):this.genericComparison(e,u,c,m,r,l):{schema:r,validationResult:c,matchingSchemas:l}}if(d.length>1&&(d.length>1||f.length===0)&&u&&r.problems.push({location:{offset:e.offset,length:1},severity:I.Warning,message:R(`Matches multiple schemas when only one must validate.`),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),m&&(r.merge(m.validationResult),r.propertiesMatches+=m.validationResult.propertiesMatches,r.propertiesValueMatches+=m.validationResult.propertiesValueMatches,r.enumValueMatch=r.enumValueMatch||m.validationResult.enumValueMatch,m.validationResult.enumValues?.length&&(r.enumValues=(r.enumValues||[]).concat(m.validationResult.enumValues)),i.merge(m.matchingSchemas)),p.length>0)for(let e of p)l(r,e)};Array.isArray(t.anyOf)&&d(t.anyOf,!1),Array.isArray(t.oneOf)&&d(t.oneOf,!0);let f=(t,n)=>{let s=new CG(o),c=i.newSub();this.validateNode(e,TG(t),n,s,c,a),r.merge(s),r.propertiesMatches+=s.propertiesMatches,r.propertiesValueMatches+=s.propertiesValueMatches,i.merge(c)},p=(s,c,u,d)=>{let p=TG(s),m=new CG(o),h=i.newSub();this.validateNode(e,p,c,m,h,a),i.merge(h);let g=p?.filePatternAssociation;g&&(new qW(g).matchesPattern(a.uri)||m.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`filePatternAssociation '{0}' does not match with doc uri '{1}'`,g,a.uri),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})),m.hasProblems()?d&&f(d,c):(l(r,m),u&&f(u,c))},m=TG(t.if);if(m&&p(m,t,TG(t.then),TG(t.else)),Array.isArray(t.enum)){let i=TW(e),a=!1;for(let n of t.enum)if(kW(i,n,e.type)||DG(s,e,i,n)){a=!0;break}r.enumValues=t.enum,r.enumValueMatch=a,a||r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,code:YU.EnumValueMismatch,message:t.errorMessage||R(`Value is not accepted. Valid values: {0}.`,(t.enum??[]).map(e=>JSON.stringify(e)).join(`, `)),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n),data:{values:t.enum}})}if(jW(t.const)){let i=TW(e),a=t.const;!kW(i,a,e.type)&&!DG(s,e,i,a)?(r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,code:YU.EnumValueMismatch,problemType:vG.constWarning,message:t.errorMessage||EG(vG.constWarning,[JSON.stringify(a)]),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n),problemArgs:[JSON.stringify(a)],data:{values:[a]}}),r.enumValueMatch=!1):r.enumValueMatch=!0,r.enumValues=[a]}t.deprecationMessage&&e.parent&&r.problems.push({location:{offset:e.parent.offset,length:e.parent.length},severity:I.Warning,message:t.deprecationMessage,source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}validateStringNode(e,t,n,r){let i=e.value;if(AW(t.minLength)&&i.length<(t.minLength??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`String is shorter than the minimum length of {0}.`,t.minLength),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(t.maxLength)&&i.length>(t.maxLength??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`String is longer than the maximum length of {0}.`,t.maxLength),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),NW(t.pattern)){let a=GW(t.pattern);a?a.test(i)||r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.patternErrorMessage||t.errorMessage||R(`String does not match the pattern of "{0}".`,t.pattern),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}):r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Invalid pattern: "{0}"`,t.pattern),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}if(t.format)switch(t.format){case`uri`:case`uri-reference`:{let a;if(!i)a=R(`URI expected.`);else try{!Xd.parse(i).scheme&&t.format===`uri`&&(a=R(`URI with a scheme is expected.`))}catch(e){a=e instanceof Error?e.message:String(e)}a&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.patternErrorMessage||t.errorMessage||R(`String is not a URI: {0}`,a),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});break}case`color-hex`:case`date-time`:case`date`:case`time`:case`email`:case`ipv4`:case`ipv6`:{let a=SG[t.format];(!i||!a.pattern.test(i))&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.patternErrorMessage||t.errorMessage||R(a.errorMessage),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});break}}}validateNumberNode(e,t,n,r){let i=e.value;AW(t.multipleOf)&&JW(i,t.multipleOf??0)!==0&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Value is not divisible by {0}.`,t.multipleOf),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});let a=this.getNumberLimits(t);AW(a.exclusiveMinimum)&&i<=a.exclusiveMinimum&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Value is below the exclusive minimum of {0}.`,a.exclusiveMinimum),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(a.exclusiveMaximum)&&i>=a.exclusiveMaximum&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Value is above the exclusive maximum of {0}.`,a.exclusiveMaximum),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(a.minimum)&&i<a.minimum&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Value is below the minimum of {0}.`,a.minimum),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(a.maximum)&&i>a.maximum&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Value is above the maximum of {0}.`,a.maximum),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}validateArrayNode(e,t,n,r,i,a){let{isKubernetes:o}=a,s=e.items??[],c=t.items?r.getEvaluatedItems(e):void 0;if(Array.isArray(t.items)){let l=t.items;for(let e=0;e<l.length;e++){let n=TG(l[e]),u=new CG(o),d=s[e];d?(this.validateNode(d,n,t,u,i,a),r.mergePropertyMatch(u,!1),r.mergeEnumValues(u),c?.add(e)):s.length>=l.length&&r.propertiesValueMatches++}if(s.length>l.length){let u=t.additionalItems;if(u===!1){r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Array has too many items according to schema. Expected {0} or fewer.`,l.length),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});for(let e=l.length;e<s.length;e++)c?.add(e)}else if(typeof u==`object`)for(let e=l.length;e<s.length;e++){let n=new CG(o);this.validateNode(s[e],u,t,n,i,a),r.mergePropertyMatch(n,!1),r.mergeEnumValues(n),c?.add(e)}else if(u===!0)for(let e=l.length;e<s.length;e++)c?.add(e)}}else{let n=TG(t.items);if(n){let c=r.getEvaluatedItems(e);for(let e=0;e<s.length;e++){let l=s[e],u=new CG(o);this.validateNode(l,n,t,u,i,a),r.mergePropertyMatch(u,!1),r.mergeEnumValues(u),c.add(e)}}}this.applyContains(e,t,n,r,i,a),this.applyArrayLength(e,t,n,r,a),this.applyUniqueItems(e,t,n,r)}applyContains(e,t,n,r,i,a){let{isKubernetes:o}=a,s=TG(t.contains);s&&((e.items??[]).some(e=>{let n=new CG(o);return this.validateNode(e,s,t,n,xG.instance,a),!n.hasProblems()})||r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Array does not contain required item.`),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}))}applyArrayLength(e,t,n,r,i){AW(t.minItems)&&e.items.length<(t.minItems??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Array has too few items. Expected {0} or more.`,t.minItems),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(t.maxItems)&&e.items.length>(t.maxItems??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Array has too many items. Expected {0} or fewer.`,t.maxItems),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}applyUniqueItems(e,t,n,r){if(t.uniqueItems===!0){let i=TW(e);Array.isArray(i)&&i.some((e,t)=>t!==i.lastIndexOf(e))&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Array has duplicate items.`),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}}validateObjectNode(e,t,n,r,i,a){let o=/* @__PURE__ */ Object.create(null),s=[],c=[...e.properties];for(;c.length>0;){let e=c.pop();if(!e)continue;let t=e.keyNode.value;if(t===`<<`&&e.valueNode)switch(e.valueNode.type){case`object`:c.push(...e.valueNode.properties);break;case`array`:e.valueNode.items.forEach(e=>{e&&e.type===`object`&&PW(e.properties)&&c.push(...e.properties)})}else o[t]=e.valueNode,s.push(t)}let l=e=>{let t=s.indexOf(e);for(;t>=0;)s.splice(t,1),t=s.indexOf(e)};this.applyRequired(e,t,n,r,a,o),this.applyProperties(e,t,n,r,i,a,o,s,l),this.applyPatternProperties(e,t,n,r,i,a,o,s,l),this.applyAdditionalProperties(e,t,n,r,i,a,o,s),this.applyPropertyCount(e,t,n,r),this.applyDependencies(e,t,n,r,i,a,o),this.applyPropertyNames(e,t,r,a)}applyRequired(e,t,n,r,i,a){if(Array.isArray(t.required)){for(let i of t.required)if(a[i]===void 0){let a=e.parent&&e.parent.type===`property`&&e.parent.keyNode,o=a?{offset:a.offset,length:a.length}:{offset:e.offset,length:1};r.problems.push({location:o,severity:I.Warning,message:t.errorMessage||EG(vG.missingRequiredPropWarning,[i]),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n),problemArgs:[i],problemType:vG.missingRequiredPropWarning})}}}applyProperties(e,t,n,r,i,a,o,s,c){let{isKubernetes:l}=a,u=t.properties;if(u)for(let e of Object.keys(u)){c(e);let s=u[e],d=o[e];if(d){if(r.evaluatedProperties??=/* @__PURE__ */ new Set,r.evaluatedProperties.add(e),MW(s)){if(s)r.propertiesMatches++,r.propertiesValueMatches++;else{let i=d.parent;r.problems.push({location:{offset:i.keyNode.offset,length:i.keyNode.length},severity:I.Warning,message:t.errorMessage||R(`Property {0} is not allowed.`,e),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}}else{s.url=t.url??n.url;let e=new CG(l);this.validateNode(d,s,t,e,i,a),r.mergePropertyMatch(e,!1),r.mergeEnumValues(e)}}}}applyPatternProperties(e,t,n,r,i,a,o,s,c){let{isKubernetes:l}=a,u=t.patternProperties;if(u)for(let e of Object.keys(u)){let d=GW(e);if(d)for(let f of s.slice(0)){if(!d.test(f))continue;c(f);let s=o[f];if(!s)continue;r.evaluatedProperties??=/* @__PURE__ */ new Set,r.evaluatedProperties.add(f);let p=u[e];if(MW(p)){if(p)r.propertiesMatches++,r.propertiesValueMatches++;else{let e=s.parent;r.problems.push({location:{offset:e.keyNode.offset,length:e.keyNode.length},severity:I.Warning,message:t.errorMessage||R(`Property {0} is not allowed.`,f),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}}else{let e=new CG(l);this.validateNode(s,p,t,e,i,a),r.mergePropertyMatch(e,!1),r.mergeEnumValues(e)}}}}applyAdditionalProperties(e,t,n,r,i,a,o,s){let{isKubernetes:c}=a,l=t.additionalProperties;if(typeof l==`object`){for(let e of s){let n=o[e];if(!n)continue;r.evaluatedProperties??=/* @__PURE__ */ new Set,r.evaluatedProperties.add(e);let s=new CG(c);this.validateNode(n,l,t,s,i,a),r.mergePropertyMatch(s,!1),r.mergeEnumValues(s)}return}if(l===!0){if(s.length>0){r.evaluatedProperties??=/* @__PURE__ */ new Set;for(let e of s)o[e]&&r.evaluatedProperties.add(e)}return}if(!(l===!1||t.type===`object`&&l===void 0&&a.disableAdditionalProperties===!0)||s.length===0)return;let u=t.properties&&Object.entries(t.properties).filter(([e,t])=>!(o[e]||t&&typeof t==`object`&&(t.doNotSuggest||t.deprecationMessage))).map(([e])=>e);for(let e of s){let i=o[e];if(!i)continue;let a=i.type===`property`?i:i.parent??i;a.type===`object`&&(a=a.properties[0]??a);let s=a.type===`property`?a.keyNode:a,c={location:{offset:s.offset,length:s.length},severity:I.Warning,code:YU.PropertyExpected,message:t.errorMessage||R(`Property {0} is not allowed.`,e),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)};u?.length&&(c.data={properties:u}),r.problems.push(c)}}applyPropertyCount(e,t,n,r){AW(t.maxProperties)&&e.properties.length>(t.maxProperties??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Object has more properties than limit of {0}.`,t.maxProperties),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),AW(t.minProperties)&&e.properties.length<(t.minProperties??0)&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Object has fewer properties than the required number of {0}`,t.minProperties),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}applyDependencies(e,t,n,r,i,a,o){let{isKubernetes:s}=a,c=t.dependencies;if(c)for(let l of Object.keys(c)){if(!o[l])continue;let u=c[l];if(Array.isArray(u))for(let i of u)o[i]?r.propertiesValueMatches++:r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Object is missing property {0} required by property {1}.`,i,l),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});else{let n=TG(u);if(n){let o=new CG(s);this.validateNode(e,n,t,o,i,a),r.mergePropertyMatch(o),r.mergeEnumValues(o)}}}}applyPropertyNames(e,t,n,r){let i=TG(t.propertyNames);if(i)for(let a of e.properties){let e=a.keyNode;e&&this.validateNode(e,i,t,n,xG.instance,r)}}applyUnevaluatedProperties(e,t,n,r,i,a,o,s){}applyUnevaluatedItems(e,t,n,r,i,a){}alternativeComparison(e,t,n,r){let i=e.compareKubernetes(t.validationResult);return i>0?{schema:n,validationResult:e,matchingSchemas:r}:(i===0&&(t.matchingSchemas.merge(r),t.validationResult.mergeEnumValues(e)),t)}genericComparison(e,t,n,r,i,a){if(!t&&!n.hasProblems()&&!r.validationResult.hasProblems())r.matchingSchemas.merge(a),r.validationResult.propertiesMatches+=n.propertiesMatches,r.validationResult.propertiesValueMatches+=n.propertiesValueMatches;else{let o=n.compareGeneric(r.validationResult);o>0||o===0&&t&&r.schema.type===`object`&&e.type!==`null`&&e.type!==r.schema.type?r={schema:i,validationResult:n,matchingSchemas:a}:(o===0||(e.value===null||e.type===`null`)&&e.length===0)&&this.mergeValidationMatches(r,a,n)}return r}mergeValidationMatches(e,t,n){e.matchingSchemas.merge(t),e.validationResult.mergeEnumValues(n),e.validationResult.mergeWarningGeneric(n,[vG.missingRequiredPropWarning,vG.typeMismatchWarning,vG.constWarning])}};function TG(e){if(e!==void 0)return MW(e)?e?{}:{not:{}}:typeof e==`object`?e:(console.warn(`Wrong schema: ${JSON.stringify(e)}, it MUST be an Object or Boolean`),{type:e})}function EG(e,t){return R(yG[e],t.join(` | `))}function DG(e,t,n,r){return e?n===null&&t.length===0||NW(n)&&NW(r)&&r.startsWith(n):!1}var OG=class extends wG{getCurrentDialect(){return wW.draft04}getNumberLimits(e){let t=AW(e.minimum)?e.minimum:void 0,n=AW(e.maximum)?e.maximum:void 0,r=MW(e.exclusiveMinimum)&&e.exclusiveMinimum?t:void 0,i=MW(e.exclusiveMaximum)&&e.exclusiveMaximum?n:void 0;return{minimum:r===void 0?t:void 0,maximum:i===void 0?n:void 0,exclusiveMinimum:r,exclusiveMaximum:i}}},kG=class extends wG{getCurrentDialect(){return wW.draft07}getNumberLimits(e){let t=AW(e.minimum)?e.minimum:void 0,n=AW(e.maximum)?e.maximum:void 0,r=AW(e.exclusiveMinimum)?e.exclusiveMinimum:void 0,i=AW(e.exclusiveMaximum)?e.exclusiveMaximum:void 0;return{minimum:r===void 0?t:void 0,maximum:i===void 0?n:void 0,exclusiveMinimum:r,exclusiveMaximum:i}}},AG=class extends kG{getCurrentDialect(){return wW.draft2019}applyContains(e,t,n,r,i,a){let o=TG(t.contains);if(!o)return;let s=t.minContains,c=t.maxContains,l=AW(s)?s:1,u=AW(c)?c:void 0,d=0,f=e.items??[];for(let e of f){let n=new CG(a.isKubernetes);if(this.validateNode(e,o,t,n,this.getNoOpCollector(),a),!n.hasProblems()&&(d++,u!==void 0&&d>u))break}d<l&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Array has too few items matching "contains". Expected {0} or more.`,l),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),u!==void 0&&d>u&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Array has too many items matching "contains". Expected {0} or fewer.`,u),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}applyDependencies(e,t,n,r,i,a,o){super.applyDependencies(e,t,n,r,i,a,o);let s=t.dependentRequired;if(s&&typeof s==`object`)for(let i of Object.keys(s)){if(!o[i])continue;let a=s[i];if(Array.isArray(a))for(let s of a)o[s]?r.propertiesValueMatches++:r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Object is missing property {0} required by property {1}.`,s,i),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}let c=t.dependentSchemas;if(c&&typeof c==`object`)for(let n of Object.keys(c)){if(!o[n])continue;let s=TG(c[n]);if(!s)continue;let l=new CG(a.isKubernetes);this.validateNode(e,s,t,l,i,a),r.mergePropertyMatch(l),r.mergeEnumValues(l)}}applyUnevaluatedProperties(e,t,n,r,i,a,o){let s=t.unevaluatedProperties;if(s===void 0||!o)return;r.evaluatedProperties??=/* @__PURE__ */ new Set;let c=Object.keys(o).filter(e=>!r.evaluatedProperties?.has(e));if(c.length===0)return;if(s===!1){for(let e of c){let i=o[e];if(!i)continue;let a=(i.type===`property`?i:i.parent).keyNode;a&&(r.problems.push({location:{offset:a.offset,length:a.length},severity:I.Warning,code:YU.PropertyExpected,message:t.errorMessage||R(`Property {0} is not allowed.`,e),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),r.evaluatedProperties?.add(e))}return}if(s===!0){for(let e of c)r.evaluatedProperties?.add(e);return}let l=TG(s);if(l)for(let e of c){let n=o[e];if(!n)continue;let s=n.type===`property`?n.valueNode:n;if(!s)continue;let c=new CG(a.isKubernetes);this.validateNode(s,l,t,c,i,a),r.mergePropertyMatch(c),r.mergeEnumValues(c),r.evaluatedProperties?.add(e)}}applyUnevaluatedItems(e,t,n,r,i,a){let o=t.unevaluatedItems;if(o===void 0)return;let s=e.items??[];if(s.length===0)return;let c=r.getEvaluatedItems(e),l=[];for(let e=0;e<s.length;e++)c.has(e)||l.push(e);if(l.length===0)return;if(o===!1){for(let e of l){let i=s[e];r.problems.push({location:{offset:i.offset,length:i.length||1},severity:I.Warning,code:YU.PropertyExpected,message:t.errorMessage||R(`Array has too many items according to schema. Expected {0} or fewer.`,e),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),c.add(e)}return}if(o===!0){for(let e of l)c.add(e);return}let u=TG(o);if(u)for(let e of l){let n=s[e],o=new CG(a.isKubernetes);this.validateNode(n,u,t,o,i,a),r.merge(o),r.mergeEnumValues(o),c.add(e)}}},jG=class extends AG{getCurrentDialect(){return wW.draft2020}validateArrayNode(e,t,n,r,i,a){let o=e.items??[],s=r.getEvaluatedItems(e),c=t.prefixItems;if(Array.isArray(c)){let e=Math.min(c.length,o.length);for(let n=0;n<e;n++){let e=TG(c[n]);if(!e){s.add(n);continue}let l=new CG(a.isKubernetes);this.validateNode(o[n],e,t,l,i,a),r.mergePropertyMatch(l,!1),r.mergeEnumValues(l),s.add(n)}}let l=t.items,u=Array.isArray(c)?c.length:0;if(o.length>u){if(l===!1){r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:R(`Array has too many items according to schema. Expected {0} or fewer.`,u),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)});for(let e=u;e<o.length;e++)s.add(e)}else{let e=TG(l);if(e)for(let n=u;n<o.length;n++){let c=new CG(a.isKubernetes);this.validateNode(o[n],e,t,c,i,a),r.mergePropertyMatch(c,!1),r.mergeEnumValues(c),s.add(n)}}}this.applyContains(e,t,n,r,i,a),this.applyArrayLength(e,t,n,r,a),this.applyUniqueItems(e,t,n,r)}applyContains(e,t,n,r,i,a){let o=TG(t.contains);if(!o)return;let s=e.items??[],c=t.minContains,l=t.maxContains,u=AW(c)?c:1,d=AW(l)?l:void 0,f=0,p=r.getEvaluatedItems(e);for(let e=0;e<s.length;e++){let n=new CG(a.isKubernetes);if(this.validateNode(s[e],o,t,n,this.getNoOpCollector(),a),!n.hasProblems()&&(p.add(e),f++,d!==void 0&&f>d))break}f<u&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Array has too few items matching "contains". Expected {0} or more.`,u),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)}),d!==void 0&&f>d&&r.problems.push({location:{offset:e.offset,length:e.length},severity:I.Warning,message:t.errorMessage||R(`Array has too many items matching "contains". Expected {0} or fewer.`,d),source:this.getSchemaSource(t,n),schemaUri:this.getSchemaUri(t,n)})}};function MG(e){switch(e){case wW.draft04:return new OG;case wW.draft07:return new kG;case wW.draft2019:return new AG;case wW.draft2020:return new jG;default:return new kG}}var NG=class{constructor(e,t,n,r){this.offset=n,this.length=r,this.parent=e,this.internalNode=t}getNodeFromOffsetEndInclusive(e){let t=[],n=r=>{if(e>=r.offset&&e<=r.offset+r.length){let i=r.children;for(let r=0;r<i.length&&i[r].offset<=e;r++){let e=n(i[r]);e&&t.push(e)}return r}return null},r=n(this),i=Number.MAX_VALUE,a=null;for(let n of t){let t=n.length+n.offset-e+(e-n.offset);t<i&&(a=n,i=t)}return a||r}get children(){return[]}toString(){return`type: `+this.type+` (`+this.offset+`/`+this.length+`)`+(this.parent?` parent: {`+this.parent.toString()+`}`:``)}},PG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`null`,this.value=null}},FG=class extends NG{constructor(e,t,n,r,i,a){super(e,t,i,a),this.type=`boolean`,this.value=n,this.source=r}},IG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`array`,this.items=[]}get children(){return this.items}},LG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`number`,this.isInteger=!0,this.value=NaN}},RG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`string`,this.value=``}},zG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`property`,this.colonOffset=-1}get children(){return this.valueNode?[this.keyNode,this.valueNode]:[this.keyNode]}},BG=class extends NG{constructor(e,t,n,r){super(e,t,n,r),this.type=`object`,this.properties=[]}get children(){return this.properties}},VG;(function(e){e[e.Key=0]=`Key`,e[e.Enum=1]=`Enum`})(VG||={});var HG=class{constructor(e,t=[],n=[]){this.root=e,this.syntaxErrors=t,this.comments=n}getNodeFromOffset(e,t=!1){if(this.root)return DW(this.root,e,t)}getNodeFromOffsetEndInclusive(e){return this.root&&this.root.getNodeFromOffsetEndInclusive(e)}visit(e){if(this.root){let t=n=>{let r=e(n),i=n.children;if(Array.isArray(i))for(let e=0;e<i.length&&r;e++)r=t(i[e]);return r};t(this.root)}}validate(e,t){return!this.root||!t?null:MG(t._dialect).validateDocument(this.root,e,t,{isKubernetes:this.isKubernetes,disableAdditionalProperties:this.disableAdditionalProperties,uri:this.uri})}getMatchingSchemas(e,t=-1,n=null,r){return!this.root||!e?[]:MG(e._dialect).getMatchingSchemas(this.root,e,{isKubernetes:this.isKubernetes,disableAdditionalProperties:this.disableAdditionalProperties,uri:this.uri,callFromAutoComplete:r},t,n)}},UG={maxRefCount:1e3,currentRefDepth:0,aliasResolutionCache:/* @__PURE__ */ new Map};function WG(e,t,n,r){if(e||(UG.currentRefDepth=0,UG.aliasResolutionCache=/* @__PURE__ */ new Map),!t)return null;if(y(t))return GG(t,e,n,r);if(b(t))return KG(t,e,n,r);if(S(t))return qG(t,e,n,r);if(x(t))return JG(t,e);if(_(t)&&UG.currentRefDepth<UG.maxRefCount)return YG(t,e,n,r)}function GG(e,t,n,r){let i;i=e.flow&&!e.range?QG(e):e.range;let a=new BG(t,e,...ZG(i,r));for(let t of e.items)b(t)&&a.properties.push(WG(a,t,n,r));return a}function KG(e,t,n,r){let i=e.key,a=e.value,o=i.range[0],s=i.range[1],c=i.range[2];a&&(s=a.range[1],c=a.range[2]);let l=new zG(t,e,...ZG([o,s,c],r));if(_(i)){let e=new RG(t,i,...XG(i.range));e.value=i.source,l.keyNode=e}else l.keyNode=WG(l,i,n,r);return l.valueNode=WG(l,a,n,r),l}function qG(e,t,n,r){let i=new IG(t,e,...XG(e.range));for(let t of e.items)if(w(t)){let e=WG(i,t,n,r);e&&i.children.push(e)}return i}function JG(e,t){if(e.value===null)return new PG(t,e,...XG(e.range));switch(typeof e.value){case`string`:{let n=new RG(t,e,...XG(e.range));return n.value=e.value,n}case`boolean`:return new FG(t,e,e.value,e.source,...XG(e.range));case`number`:{let n=new LG(t,e,...XG(e.range));return n.value=e.value,n.isInteger=Number.isInteger(n.value),n}default:{let n=new RG(t,e,...XG(e.range));return n.value=e.source,n}}}function YG(e,t,n,r){if(UG.aliasResolutionCache.has(e))return UG.aliasResolutionCache.get(e);UG.currentRefDepth++;let i=e.resolve(n),a;if(i)a=WG(t,i,n,r);else{let n=new RG(t,e,...XG(e.range));n.value=e.source,a=n}return UG.currentRefDepth--,UG.aliasResolutionCache.set(e,a),a}function XG(e){return[e[0],e[1]-e[0]]}function ZG(e,t){let n=t.linePos(e[0]),r=t.linePos(e[1]),i=[e[0],e[1]-e[0]];return n.line!==r.line&&(t.lineStarts.length!==r.line||r.col===1)&&i[1]--,i}function QG(e){let t=2**53-1,n=0;for(let r of e.items)b(r)&&(w(r.key)&&r.key.range&&r.key.range[0]<=t&&(t=r.key.range[0]),w(r.value)&&r.value.range&&r.value.range[2]>=n&&(n=r.value.range[2]));return[t,n,n]}function $G(e,t){let n;if(T(e,(e,r,i)=>{if(r===t)return n=i[i.length-1],T.BREAK}),!v(n))return n}function eK(e){if(e.items.length>1)return!1;let t=e.items[0];return x(t.key)&&x(t.value)&&t.key.value===``&&!t.value.value}function tK(e,t){for(let[n,r]of e.items.entries())if(t===r)return n}function nK(e,t){let n=!1;for(let r of e){if(r.type===`document`)iK([],r,e=>{if(rK(e)&&e.value?.type===`comment`){if(r.offset<=t&&e.value.source.length+e.value.offset>=t)return n=!0,T.BREAK}else if(e.type===`comment`&&e.offset<=t&&e.offset+e.source.length>=t)return n=!0,T.BREAK});else if(r.type===`comment`&&r.offset<=t&&r.source.length+r.offset>=t)return!0;if(n)break}return n}function rK(e){return e.start!==void 0}function iK(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=iK(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===T.BREAK)return T.BREAK;else r===T.REMOVE&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}let i=t.sep;if(i)for(let t=0;t<i.length;++t){let r=iK(Object.freeze(e),i[t],n);if(typeof r==`number`)t=r-1;else if(r===T.BREAK)return T.BREAK;else r===T.REMOVE&&(i.items.splice(t,1),--t)}return typeof r==`function`?r(t,e):r}var aK=class e extends HG{constructor(e){super(null,[]),this.lineCounter=e}clone(){let t=new e(this.lineCounter);return t.isKubernetes=this.isKubernetes,t.disableAdditionalProperties=this.disableAdditionalProperties,t.uri=this.uri,t.currentDocIndex=this.currentDocIndex,t._lineComments=this.lineComments.slice(),t.internalDocument=this._internalDocument.clone(),t}collectLineComments(){this._lineComments=[],this._internalDocument.commentBefore&&this._internalDocument.commentBefore.split(`
|
|
394
394
|
`).forEach(e=>this._lineComments.push(`#${e}`)),T(this.internalDocument,(e,t)=>{t?.commentBefore&&(t?.commentBefore.split(`
|
|
395
395
|
`)).forEach(e=>this._lineComments.push(`#${e}`)),t?.comment&&this._lineComments.push(`#${t.comment}`)}),this._internalDocument.comment&&this._lineComments.push(`#${this._internalDocument.comment}`)}updateFromInternalDocument(){this.root=WG(null,this._internalDocument.contents,this._internalDocument,this.lineCounter)}set internalDocument(e){this._internalDocument=e,this.updateFromInternalDocument()}get internalDocument(){return this._internalDocument}get lineComments(){return this._lineComments||this.collectLineComments(),this._lineComments}set lineComments(e){this._lineComments=e}get errors(){return this.internalDocument.errors.map(cK)}get warnings(){return this.internalDocument.warnings.map(cK)}getNodeFromPosition(e,t,n){let r=t.getPosition(e),i=t.getLineContent(r.line);if(i.trim().length===0)return[this.findClosestNode(e,t,n),!0];let a=i.substring(r.character).match(/^([ ]+)\n?$/),o=!!a,s=a?.[1].length,c;return T(this.internalDocument,(t,n)=>{if(!n)return;let r=n.range;if(r){if(r[0]<=e&&r[1]>=e||o&&e+s===r[2]&&x(n)&&n.value===null)c=n;else return T.SKIP}}),[c,!1]}findClosestNode(e,t,n){let r=this.internalDocument.range[2],i=this.internalDocument.range[0],a;T(this.internalDocument,(t,n)=>{if(!n)return;let o=n.range;if(!o)return;let s=o[1]-e;i<=o[0]&&s<=0&&Math.abs(s)<=r&&(r=Math.abs(s),i=o[0],a=n)});let o=t.getPosition(e),s=WW(t.getLineContent(o.line),o.character);return x(a)&&a.value===null||s===o.character&&(a=this.getProperParentByIndentation(s,a,t,``,n)),a}getProperParentByIndentation(e,t,n,r,i,a){if(!t)return this.internalDocument.contents;if(i||=2,w(t)&&t.range){let o=n.getPosition(t.range[0]),s=n.getLineContent(o.line);if(r=r===``?s.trim():r,r.startsWith(`-`)&&e===i&&r===s.trim()&&(o.character+=e),o.character>e&&o.character>0){let o=this.getParent(t);if(o)return this.getProperParentByIndentation(e,o,n,r,i,a)}else if(o.character<e){let e=this.getParent(t);if(b(e)&&w(e.value))return e.value;if(b(a)&&w(a.value))return a.value}else return t}else if(b(t)){a=t;let o=this.getParent(t);return this.getProperParentByIndentation(e,o,n,r,i,a)}return t}getParent(e){return $G(this.internalDocument,e)}},oK=class{constructor(e,t){this.documents=e,this.tokens=t,this.errors=[],this.warnings=[]}},sK=new class{constructor(){this.cache=/* @__PURE__ */ new Map}getYamlDocument(e,t,n=!1){return this.ensureCache(e,t??pK,n),this.cache.get(e.uri).document}clear(){this.cache.clear()}ensureCache(e,t,n){let r=e.uri;this.cache.has(r)||this.cache.set(r,{version:-1,document:new oK([],[]),parserOptions:pK});let i=this.cache.get(r);if(i.version!==e.version||t.customTags&&!HW(i.parserOptions.customTags,t.customTags)){let r=e.getText();n&&!/\S/.test(r)&&(r=`{${r}}`),i.document=mK(r,t,e),i.version=e.version,i.parserOptions=t}}};function cK(e){return{message:e.message,location:{start:e.pos[0],end:e.pos[1],toLineEnd:!0},severity:1,code:YU.Undefined}}var lK=class{constructor(e,t){this.tag=e,this.type=t}get collection(){if(this.type===`mapping`)return`map`;if(this.type===`sequence`)return`seq`}resolve(e){if(y(e)&&this.type===`mapping`||S(e)&&this.type===`sequence`||typeof e==`string`&&this.type===`scalar`)return e}},uK=class{constructor(){this.tag=`!include`,this.type=`scalar`}resolve(e,t){if(e&&e.length>0&&e.trim())return e;t(`!include without value`)}};function dK(e){let t=[],n=VW(e);for(let e of n){let n=e.split(` `),r=n[0],i=n[1]&&n[1].toLowerCase()||`scalar`;t.push(new lK(r,i))}return t.push(new uK),t}var fK=class{constructor(e){this.doc=e}getLineCount(){return this.doc.lineCount}getLineLength(e){let t=this.doc.getLineOffsets();return e>=t.length?this.doc.getText().length:e<0?0:(e+1<t.length?t[e+1]:this.doc.getText().length)-t[e]}getLineContent(e){let t=this.doc.getLineOffsets();if(e>=t.length)return this.doc.getText();if(e<0)return``;let n=e+1<t.length?t[e+1]:this.doc.getText().length;return this.doc.getText().substring(t[e],n)}getLineCharCode(e,t){return this.doc.getText(F.create(e-1,t,e-1,t+1)).charCodeAt(0)}getText(e){return this.doc.getText(e)}getPosition(e){return this.doc.positionAt(e)}},pK={customTags:[],yamlVersion:`1.2`};function mK(e,t=pK,n){let r=new $n({strict:!1,customTags:dK(t.customTags),version:t.yamlVersion??pK.yamlVersion,keepSourceTokens:!0}),i=new vr,a=!1;if(n){let t=new fK(n),r=t.getPosition(e.length);a=t.getLineContent(r.line).trim().length===0}let o=(a?new Er:new Er(i.addNewLine)).parse(e),s=Array.from(o),c=r.compose(s,!0,e.length);return new oK(Array.from(c,e=>hK(e,i)),s)}function hK(e,t){let n=new aK(t);return n.internalDocument=e,n}function gK(e){if(e instanceof aK){let t=e.lineComments.find(e=>_K(e));if(t!=null){let e=t.match(/\$schema(?:=|:\s*)(\S+)/);if(e!==null&&e.length===2)return e[1]}}}function _K(e){let t=e.match(/^#\s+(?:yaml-language-server\s*:|\$schema:)/g);return t!==null&&t.length===1}function vK(){return!0}var yK=class{compile(){return vK}defaultMeta(){return`http://json-schema.org/draft-07/schema`}},bK=class extends yK{defaultMeta(){return`http://json-schema.org/draft-04/schema`}},xK=class extends yK{defaultMeta(){return`https://json-schema.org/draft/2019-09/schema`}},SK=class extends yK{defaultMeta(){return`https://json-schema.org/draft/2020-12/schema`}},CK=`https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.32.1-standalone-strict/`,wK=CK+`all.json`,TK=`https://raw.githubusercontent.com/datreeio/CRDs-catalog/main`;function EK(e){let t=/* @__PURE__ */ new Map;return e&&(e.url?e.url.startsWith(`schemaservice://combinedSchema/`)?DK(e,t):t.set(e.url,e):DK(e,t)),t}function DK(e,t){e.allOf&&OK(e.allOf,t),e.anyOf&&OK(e.anyOf,t),e.oneOf&&OK(e.oneOf,t)}function OK(e,t){for(let n of e)!MW(n)&&n.url&&!t.has(n.url)&&t.set(n.url,n)}function kK(e,t,n){let r=MK(e);if(!r||!r.group||!r.version||!r.kind)return;let i=AK(r,t);if(i)return i;let a=jK(r,n);if(a)return a}function AK(e,t){let{group:n,version:r,kind:i}=e,a=`io.k8s.api.${n.replace(`.k8s.io`,``).replace(`rbac.authorization`,`rbac`).toLowerCase()}.${r.toLowerCase()}.${i.toLowerCase()}`,o=(t.schema.oneOf||[]).map(e=>{if(typeof e!=`boolean`)return e._$ref||e.$ref}).find(e=>e?e.replace(`_definitions.json#/definitions/`,``).toLowerCase()===a:!1);if(o)return CK+o}function jK(e,t){let{group:n,version:r,kind:i}=e;return`io.k8s.api.${n.replace(`.k8s.io`,``).replace(`rbac.authorization`,`rbac`).toLowerCase()}.${r.toLowerCase()}.${i.toLowerCase()}`.includes(`openshift.io`)?`${t}/openshift/v4.15-strict/${i.toLowerCase()}_${n.toLowerCase()}_${r.toLowerCase()}.json`:`${t}/${n.toLowerCase()}/${i.toLowerCase()}_${r.toLowerCase()}.json`}function MK(e){if(e instanceof aK)try{let t=e.root.internalNode.toJSON();if(!t)return;let n=t.apiVersion;if(!n)return;let[r,i]=n.split(`/`);if(!r||!i)return;let a=t.kind;return a?{group:r,version:i,kind:a}:void 0}catch(e){console.error(`Error parsing YAML document:`,e);return}}var NK=new bK({allErrors:!0}),PK=new yK({allErrors:!0}),FK=new xK({allErrors:!0}),IK=new SK({allErrors:!0}),LK=zU(),RK=void 0,zK=zU(),BK=zU(),VK=zU(),HK=NK.compile(LK),UK=PK.compile(RK),WK=FK.compile(zK),GK=IK.compile(BK),KK=/* @__PURE__ */ new Map,qK=/* @__PURE__ */ new Map,JK=/* @__PURE__ */ new Map([[`zh-cn`,`zh`],[`zh-tw`,`zh-TW`]]),YK=/* @__PURE__ */ new Set(/* @__PURE__ */ `$ref._$ref.$schema.$id.id._baseUri._sourceUri._dialect.$anchor.$dynamicAnchor.$dynamicRef.$recursiveAnchor.$recursiveRef.definitions.$defs.$comment.title.description.markdownDescription.$vocabulary.examples.default.url.closestTitle.unevaluatedProperties.unevaluatedItems`.split(`.`)),XK;(function(e){e[e.delete=0]=`delete`,e[e.add=1]=`add`,e[e.deleteAll=2]=`deleteAll`})(XK||={});var ZK=class extends yW{constructor(e,t,n,r){super(e,t,n),this.schemaUriToNameAndDescription=/* @__PURE__ */ new Map,this.customSchemaProvider=void 0,this.requestService=e,this.schemaPriorityMapping=/* @__PURE__ */ new Map,this.yamlSettings=r}registerCustomSchemaProvider(e){this.customSchemaProvider=e}getAllSchemas(){let e=[],t=/* @__PURE__ */ new Set;for(let n of this.filePatternAssociations){let r=n.uris[0];if(t.has(r))continue;t.add(r);let i={uri:r,fromStore:!1,usedForCurrentFile:!1};if(this.schemaUriToNameAndDescription.has(r)){let{name:e,description:t,versions:n}=this.schemaUriToNameAndDescription.get(r);i.name=e,i.description=t,i.fromStore=!0,i.versions=n}e.push(i)}return e}collectSchemaNodes(e,...t){let n=t=>{if(t&&typeof t==`object`){if(Array.isArray(t)){for(let e of t)n(e);return}e(t)}};for(let e of t)n(e)}schemaMapValues(e){if(e&&typeof e==`object`)return Object.values(e)}async resolveSchemaContent(e,t,n){let r=e.errors.slice(0),i=QK(t),a=e.schema;if(a===null||Array.isArray(a)||typeof a!=`object`&&typeof a!=`boolean`){let e=a===null?`null`:Array.isArray(a)?`array`:typeof a;return r.push(R(`Schema '{0}' is not valid: {1}`,i,`expected a JSON Schema object or boolean, got "${e}".`)),new vW({},r)}let o=(e,t)=>{e&&typeof e==`object`&&t&&(e._sourceUri=t)},s=(e,t,n)=>{if(typeof e!=`object`||!e)return e;if(n){let r=n(e,t.size);if(r!==void 0)return r}if(t.has(e))return t.get(e);if(Array.isArray(e)){let r=[];t.set(e,r);for(let i of e)r.push(s(i,t,n));return r}let r={};t.set(e,r);for(let i in e)r[i]=s(e[i],t,n);return o(r,e._sourceUri),r},c=this.loadSchema.bind(this),l=this.yamlSettings?.locale;async function u(e,t){if(!e||typeof e!=`object`)return;let n=await iq(e.$schema,c);n&&(e._dialect=n);let a=aq(n);if(!a)return;let o=e;if(t&&(o=s(e,/* @__PURE__ */ new Map,(e,t)=>{if(t!==0&&e&&typeof e==`object`&&e.$schema)return{}})),!a(o)){rq(a.errors,l);let e=[];for(let t of a.errors)e.push(`${t.instancePath} : ${t.message}`);r.push(R(`Schema '{0}' is not valid: {1}`,i,`
|
|
396
396
|
${e.join(`
|
|
@@ -471,4 +471,4 @@ ${t}
|
|
|
471
471
|
\r\v":{[,]}`.indexOf(r.charAt(n))===-1;)n--;return r.substring(n+1,t)}fromMarkup(e){if(e&&this.doesSupportMarkdown())return{kind:Uf.Markdown,value:e}}doesSupportMarkdown(){if(this.supportsMarkdown===void 0){let e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.completion;this.supportsMarkdown=e&&e.completionItem&&Array.isArray(e.completionItem.documentationFormat)&&e.completionItem.documentationFormat.indexOf(Uf.Markdown)!==-1}return this.supportsMarkdown}findItemAtOffset(e,t,n){for(let t=e.items.length-1;t>=0;t--){let r=e.items[t];if(w(r)&&r.range&&(n>r.range[1]||n>=r.range[0]))return t}return 0}getPropertyNamesCandidates(e){let t=!1,n=e=>{if(!e||typeof e!=`object`)return null;if(Array.isArray(e.allOf)&&e.allOf.length){let r=null;for(let i of e.allOf){let e=n(i);if(e&&(r=r?new Set([...r].filter(t=>e.has(t))):new Set(e),r.size===0))return t=!0,/* @__PURE__ */ new Set}if(r)return r}let r=/* @__PURE__ */ new Set;return typeof e.const==`string`&&r.add(e.const),e.enum?.forEach(e=>typeof e==`string`&&r.add(e)),e.anyOf?.forEach(e=>n(e)?.forEach(e=>r.add(e))),e.oneOf?.forEach(e=>n(e)?.forEach(e=>r.add(e))),r.size?r:null},r=n(e);return{candidates:r?[...r]:[],impossible:t}}getQuote(){return this.isSingleQuote?`'`:`"`}evaluateTab1Symbol(e){return e.replace(/\$\{1:(.*)\}/,`$1`)}isParentCompletionItem(e){return`parent`in e}};function Kq(){}var qq=class{constructor(e){this.telemetry=e}getDefinition(e,t){try{let n=sK.getYamlDocument(e),r=e.offsetAt(t.position),i=BW(r,n);if(i){let[t]=i.getNodeFromPosition(r,new fK(e));if(t&&_(t)){let n=t.resolve(i.internalDocument);if(n&&n.range){let t=F.create(e.positionAt(n.range[0]),e.positionAt(n.range[2])),r=F.create(e.positionAt(n.range[0]),e.positionAt(n.range[1]));return[_f.create(e.uri,t,r)]}}}}catch(e){this.telemetry?.sendError(`yaml.definition.error`,e)}}};function Jq(e,t){let n=sK.getYamlDocument(e);return t.map(e=>{let t=r(e),n;for(let e of t)n=yp.create(e,n);return n??yp.create({start:e,end:e})});function r(t){let r=e.offsetAt(t),o=[];for(let s of n.documents){let n,c;for(s.visit(e=>{let o=e.offset+e.length;if(o<r||a(o-1,o)===`
|
|
472
472
|
`&&o-1<r)return!0;let s=e.offset;if(s>r){let n=i(e,t);if(!n||n>r)return!0;s=n}return(!n||s>=n.offset)&&(n=e,c=s),!0});n;){let t=c??n.offset,i=n.offset+n.length,a={start:e.positionAt(t),end:e.positionAt(i)},s=Yq(e.getText(a)),l=t+s.length;l>=r&&(a.end=e.positionAt(l));let u=(e,t)=>s.startsWith(e)&&s.endsWith(t||e);(n.type===`string`&&(u(`'`)||u(`"`))||n.type===`object`&&u(`{`,`}`)||n.type===`array`&&u(`[`,`]`))&&o.push({start:e.positionAt(t+1),end:e.positionAt(i-1)}),o.push(a),n=n.parent,c=void 0}if(o.length>0)break}return o.reverse()}function i(t,n){let r=e.positionAt(t.offset);if(r.line===n.line){if(t.parent?.type===`array`&&a(t.offset-2,t.offset)===`- `)return t.offset-2;if(t.type===`array`||t.type===`object`){let t={line:r.line,character:0};if(e.getText({start:t,end:r}).trim().length===0)return e.offsetAt(t)}}}function a(t,n){return e.getText({start:e.positionAt(t),end:e.positionAt(n)})}}function Yq(e){return e.endsWith(`\r
|
|
473
473
|
`)?e.substring(0,e.length-2):e.endsWith(`
|
|
474
|
-
`)?e.substring(0,e.length-1):e}var Xq={},Zq=class extends Error{name=`ResponseError`;constructor(e,t){super(t)}},Qq=class{constructor(e){this.telemetry=e}prepareRename(e,t){try{let n=this.findTarget(e,t.position);return!n||!this.findAnchorToken(n.yamlDoc,n.anchorNode)?null:this.getNameRange(e,n.token)}catch(e){return this.telemetry?.sendError(`yaml.prepareRename.error`,e),null}}doRename(e,t){try{let n=this.findTarget(e,t.position);if(!n)return null;let r=this.findAnchorToken(n.yamlDoc,n.anchorNode);if(!r)return null;let i=t.newName,a=this.findInvalidAnchorChar(i);if(a!==null)throw new Zq(Xq.InvalidParams,`Anchor name cannot contain '${a}'`);let o=[];return o.push(Of.replace(this.getNameRange(e,r),i)),T(n.yamlDoc.internalDocument,(t,r)=>{_(r)&&r.srcToken&&r.resolve(n.yamlDoc.internalDocument)===n.anchorNode&&o.push(Of.replace(this.getNameRange(e,r.srcToken),i))}),{changes:{[e.uri]:o}}}catch(e){if(e instanceof Zq)throw e;return this.telemetry?.sendError(`yaml.rename.error`,e),null}}findTarget(e,t){let n=sK.getYamlDocument(e),r=e.offsetAt(t),i=BW(r,n);if(!i)return null;let[a]=i.getNodeFromPosition(r,new fK(e));if(!a)return this.findByToken(i,r);if(_(a)&&a.srcToken&&this.isOffsetInsideToken(a.srcToken,r)){let e=a.resolve(i.internalDocument);return e?{anchorNode:e,token:a.srcToken,yamlDoc:i}:null}if((C(a)||x(a))&&a.anchor){let e=this.findAnchorToken(i,a);if(e&&this.isOffsetInsideToken(e,r))return{anchorNode:a,token:e,yamlDoc:i}}return this.findByToken(i,r)}findByToken(e,t){let n;return T(e.internalDocument,(r,i)=>{if(_(i)&&i.srcToken&&this.isOffsetInsideToken(i.srcToken,t)){let t=i.resolve(e.internalDocument);if(t)return n={anchorNode:t,token:i.srcToken,yamlDoc:e},T.BREAK}if((C(i)||x(i))&&i.anchor){let r=this.findAnchorToken(e,i);if(r&&this.isOffsetInsideToken(r,t))return n={anchorNode:i,token:r,yamlDoc:e},T.BREAK}}),n??null}findAnchorToken(e,t){let n=e.getParent(t),r=[];n&&n.srcToken&&r.push(n.srcToken),t.srcToken&&r.push(t.srcToken);for(let e of r){let n=this.getAnchorFromToken(e,t);if(n)return n}}getAnchorFromToken(e,t){if(rK(e))return this.getAnchorFromCollectionItem(e);if(cr(e)){let n=e;for(let e of n.items??[]){if(e.value!==t.srcToken)continue;let n=this.getAnchorFromCollectionItem(e);if(n)return n}}}getAnchorFromCollectionItem(e){for(let t of e.start)if(t.type===`anchor`)return t;if(e.sep&&Array.isArray(e.sep)){for(let t of e.sep)if(t.type===`anchor`)return t}}getNameRange(e,t){let n=t.offset+1,r=t.offset+t.source.length;return F.create(e.positionAt(n),e.positionAt(r))}isOffsetInsideToken(e,t){return t>=e.offset&&t<=e.offset+e.source.length}findInvalidAnchorChar(e){for(let t of[`[`,`]`,`{`,`}`,`,`,` `,` `])if(e.includes(t))return t===` `?`space`:t===` `?`tab`:t;return null}},$q;(function(e){e[e.SchemaStore=1]=`SchemaStore`,e[e.SchemaAssociation=2]=`SchemaAssociation`,e[e.Settings=3]=`Settings`})($q||={});function eJ(e){let t=new ZK(e.schemaRequestService,e.workspaceContext,null,e.yamlSettings),n=new Gq(t,e.clientCapabilities,sK,e.telemetry),r=new lq(t,e.telemetry),i=new oq(t,e.telemetry),a=new Tq(t,e.telemetry),o=new Eq,s=new Nq(e.clientCapabilities),c=new Lq(t,e.telemetry),l=new Dq(e.telemetry),u=new qq(e.telemetry),d=new Qq(e.telemetry);return new Kq(t,e.yamlSettings,e.connection),{configure:i=>{t.clearExternalSchemas(),i.schemas&&(t.schemaPriorityMapping=/* @__PURE__ */ new Map,i.schemas.forEach(e=>{let n=e.priority?e.priority:0;t.addSchemaPriority(e.uri,n),t.registerExternalSchema(e.uri,e.fileMatch,e.schema,e.name,e.description,e.versions)})),a.configure(i),r.configure(i),n.configure(i,e.yamlSettings),o.configure(i),s.configure(i,e?.yamlSettings?.yamlFormatterSettings?.printWidth||80)},registerCustomSchemaProvider:e=>{t.registerCustomSchemaProvider(e)},findLinks:l.findLinks.bind(l),doComplete:n.doComplete.bind(n),doValidation:a.doValidation.bind(a),doHover:r.doHover.bind(r),findDocumentSymbols:i.findDocumentSymbols.bind(i),findDocumentSymbols2:i.findHierarchicalDocumentSymbols.bind(i),doDefinition:u.getDefinition.bind(u),resetSchema:e=>t.onResourceChange(e),doFormat:o.format.bind(o),doDocumentOnTypeFormatting:Iq,addSchema:(e,n)=>t.saveSchema(e,n),deleteSchema:e=>t.deleteSchema(e),modifySchemaContent:e=>t.addContent(e),deleteSchemaContent:e=>t.deleteContent(e),deleteSchemasWhole:e=>t.deleteSchemas(e),getFoldingRanges:Oq,getSelectionRanges:Jq,getCodeAction:(e,t)=>s.getCodeAction(e,t),getCodeLens:e=>c.getCodeLens(e),resolveCodeLens:e=>c.resolveCodeLens(e),prepareRename:(e,t)=>d.prepareRename(e,t),doRename:(e,t)=>d.doRename(e,t)}}async function tJ(e){let t=await fetch(e);if(t.ok)return t.text();throw Error(`Schema request failed for ${e}`)}var nJ={send(){},sendError(e,t){console.error(`monaco-yaml`,e,t)},sendTrack(){}};gd((e,{enableSchemaRequest:t,format:n,...r})=>{let i=eJ({schemaRequestService:t?tJ:null,telemetry:nJ,workspaceContext:{resolveRelativePath(e,t){return String(new URL(e,t))}},clientCapabilities:{textDocument:{completion:{completionItem:{commitCharactersSupport:!0,documentationFormat:[`markdown`,`plaintext`],labelDetailsSupport:!0}}}}}),a=t=>(n,...r)=>{let i=e.getMirrorModels();for(let e of i)if(String(e.uri)===n)return t(vd.create(n,`yaml`,e.version,e.getValue()),...r)};return i.configure({...r,format:!!n?.enable}),{doValidation:a(e=>{let t=BU(e);return t.length>0?t:i.doValidation(e,!!r.isKubernetes)}),doComplete:
|
|
474
|
+
`)?e.substring(0,e.length-1):e}var Xq={},Zq=class extends Error{name=`ResponseError`;constructor(e,t){super(t)}},Qq=class{constructor(e){this.telemetry=e}prepareRename(e,t){try{let n=this.findTarget(e,t.position);return!n||!this.findAnchorToken(n.yamlDoc,n.anchorNode)?null:this.getNameRange(e,n.token)}catch(e){return this.telemetry?.sendError(`yaml.prepareRename.error`,e),null}}doRename(e,t){try{let n=this.findTarget(e,t.position);if(!n)return null;let r=this.findAnchorToken(n.yamlDoc,n.anchorNode);if(!r)return null;let i=t.newName,a=this.findInvalidAnchorChar(i);if(a!==null)throw new Zq(Xq.InvalidParams,`Anchor name cannot contain '${a}'`);let o=[];return o.push(Of.replace(this.getNameRange(e,r),i)),T(n.yamlDoc.internalDocument,(t,r)=>{_(r)&&r.srcToken&&r.resolve(n.yamlDoc.internalDocument)===n.anchorNode&&o.push(Of.replace(this.getNameRange(e,r.srcToken),i))}),{changes:{[e.uri]:o}}}catch(e){if(e instanceof Zq)throw e;return this.telemetry?.sendError(`yaml.rename.error`,e),null}}findTarget(e,t){let n=sK.getYamlDocument(e),r=e.offsetAt(t),i=BW(r,n);if(!i)return null;let[a]=i.getNodeFromPosition(r,new fK(e));if(!a)return this.findByToken(i,r);if(_(a)&&a.srcToken&&this.isOffsetInsideToken(a.srcToken,r)){let e=a.resolve(i.internalDocument);return e?{anchorNode:e,token:a.srcToken,yamlDoc:i}:null}if((C(a)||x(a))&&a.anchor){let e=this.findAnchorToken(i,a);if(e&&this.isOffsetInsideToken(e,r))return{anchorNode:a,token:e,yamlDoc:i}}return this.findByToken(i,r)}findByToken(e,t){let n;return T(e.internalDocument,(r,i)=>{if(_(i)&&i.srcToken&&this.isOffsetInsideToken(i.srcToken,t)){let t=i.resolve(e.internalDocument);if(t)return n={anchorNode:t,token:i.srcToken,yamlDoc:e},T.BREAK}if((C(i)||x(i))&&i.anchor){let r=this.findAnchorToken(e,i);if(r&&this.isOffsetInsideToken(r,t))return n={anchorNode:i,token:r,yamlDoc:e},T.BREAK}}),n??null}findAnchorToken(e,t){let n=e.getParent(t),r=[];n&&n.srcToken&&r.push(n.srcToken),t.srcToken&&r.push(t.srcToken);for(let e of r){let n=this.getAnchorFromToken(e,t);if(n)return n}}getAnchorFromToken(e,t){if(rK(e))return this.getAnchorFromCollectionItem(e);if(cr(e)){let n=e;for(let e of n.items??[]){if(e.value!==t.srcToken)continue;let n=this.getAnchorFromCollectionItem(e);if(n)return n}}}getAnchorFromCollectionItem(e){for(let t of e.start)if(t.type===`anchor`)return t;if(e.sep&&Array.isArray(e.sep)){for(let t of e.sep)if(t.type===`anchor`)return t}}getNameRange(e,t){let n=t.offset+1,r=t.offset+t.source.length;return F.create(e.positionAt(n),e.positionAt(r))}isOffsetInsideToken(e,t){return t>=e.offset&&t<=e.offset+e.source.length}findInvalidAnchorChar(e){for(let t of[`[`,`]`,`{`,`}`,`,`,` `,` `])if(e.includes(t))return t===` `?`space`:t===` `?`tab`:t;return null}},$q;(function(e){e[e.SchemaStore=1]=`SchemaStore`,e[e.SchemaAssociation=2]=`SchemaAssociation`,e[e.Settings=3]=`Settings`})($q||={});function eJ(e){let t=new ZK(e.schemaRequestService,e.workspaceContext,null,e.yamlSettings),n=new Gq(t,e.clientCapabilities,sK,e.telemetry),r=new lq(t,e.telemetry),i=new oq(t,e.telemetry),a=new Tq(t,e.telemetry),o=new Eq,s=new Nq(e.clientCapabilities),c=new Lq(t,e.telemetry),l=new Dq(e.telemetry),u=new qq(e.telemetry),d=new Qq(e.telemetry);return new Kq(t,e.yamlSettings,e.connection),{configure:i=>{t.clearExternalSchemas(),i.schemas&&(t.schemaPriorityMapping=/* @__PURE__ */ new Map,i.schemas.forEach(e=>{let n=e.priority?e.priority:0;t.addSchemaPriority(e.uri,n),t.registerExternalSchema(e.uri,e.fileMatch,e.schema,e.name,e.description,e.versions)})),a.configure(i),r.configure(i),n.configure(i,e.yamlSettings),o.configure(i),s.configure(i,e?.yamlSettings?.yamlFormatterSettings?.printWidth||80)},registerCustomSchemaProvider:e=>{t.registerCustomSchemaProvider(e)},findLinks:l.findLinks.bind(l),doComplete:n.doComplete.bind(n),doValidation:a.doValidation.bind(a),doHover:r.doHover.bind(r),findDocumentSymbols:i.findDocumentSymbols.bind(i),findDocumentSymbols2:i.findHierarchicalDocumentSymbols.bind(i),doDefinition:u.getDefinition.bind(u),resetSchema:e=>t.onResourceChange(e),doFormat:o.format.bind(o),doDocumentOnTypeFormatting:Iq,addSchema:(e,n)=>t.saveSchema(e,n),deleteSchema:e=>t.deleteSchema(e),modifySchemaContent:e=>t.addContent(e),deleteSchemaContent:e=>t.deleteContent(e),deleteSchemasWhole:e=>t.deleteSchemas(e),getFoldingRanges:Oq,getSelectionRanges:Jq,getCodeAction:(e,t)=>s.getCodeAction(e,t),getCodeLens:e=>c.getCodeLens(e),resolveCodeLens:e=>c.resolveCodeLens(e),prepareRename:(e,t)=>d.prepareRename(e,t),doRename:(e,t)=>d.doRename(e,t)}}async function tJ(e){let t=await fetch(e);if(t.ok)return t.text();throw Error(`Schema request failed for ${e}`)}var nJ={send(){},sendError(e,t){console.error(`monaco-yaml`,e,t)},sendTrack(){}};gd((e,{enableSchemaRequest:t,format:n,...r})=>{let i=eJ({schemaRequestService:t?tJ:null,telemetry:nJ,workspaceContext:{resolveRelativePath(e,t){return String(new URL(e,t))}},clientCapabilities:{textDocument:{completion:{completionItem:{commitCharactersSupport:!0,documentationFormat:[`markdown`,`plaintext`],labelDetailsSupport:!0}}}}}),a=t=>(n,...r)=>{let i=e.getMirrorModels();for(let e of i)if(String(e.uri)===n)return t(vd.create(n,`yaml`,e.version,e.getValue()),...r)},o=e=>a((t,...n)=>{if(!(BU(t).length>0))return e(t,...n)});return i.configure({...r,format:!!n?.enable}),{doValidation:a(e=>{let t=BU(e);return t.length>0?t:i.doValidation(e,!!r.isKubernetes)}),doComplete:o((e,t)=>i.doComplete(e,t,!!r.isKubernetes)),doDefinition:o((e,t)=>i.doDefinition(e,{position:t,textDocument:e})),doDocumentOnTypeFormatting:o((e,t,n,r)=>i.doDocumentOnTypeFormatting(e,{ch:n,options:r,position:t,textDocument:e})),doHover:o(i.doHover),doRename:o((e,t,n)=>i.doRename(e,{newName:n,position:t,textDocument:e})),format:o(e=>i.doFormat(e,n)),resetSchema:i.resetSchema,findDocumentSymbols:o(i.findDocumentSymbols2),findLinks:o(i.findLinks),getCodeAction:o((e,t,n)=>i.getCodeAction(e,{range:t,textDocument:e,context:n})),getCodeLens:o(i.getCodeLens),getFoldingRanges:o(e=>i.getFoldingRanges(e,{lineFoldingOnly:!0})),getSelectionRanges:o(i.getSelectionRanges),prepareRename:o((e,t)=>i.prepareRename(e,{position:t,textDocument:e}))}})})();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/runtime/yaml.worker.ts?worker
|
|
2
2
|
function e(e) {
|
|
3
|
-
return new Worker(new URL("yaml.worker-
|
|
3
|
+
return new Worker(new URL("yaml.worker-DzOKX3TP.js", import.meta.url).href, { name: e?.name });
|
|
4
4
|
}
|
|
5
5
|
//#endregion
|
|
6
6
|
export { e as default };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bugs":{"url":"https://github.com/Jaid/monacozen/issues"},"description":"text editor component with batteries included and UI clutter removed","homepage":"https://github.com/Jaid/monacozen#readme","keywords":["editor","monaco","react","text-editor"],"license":"MIT","name":"monacozen","peerDependencies":{"react":"^19.3.0","react-dom":"^19.3.0"},"repository":"github:Jaid/monacozen","version":"0.5.
|
|
1
|
+
{"bugs":{"url":"https://github.com/Jaid/monacozen/issues"},"description":"text editor component with batteries included and UI clutter removed","homepage":"https://github.com/Jaid/monacozen#readme","keywords":["editor","monaco","react","text-editor"],"license":"MIT","name":"monacozen","peerDependencies":{"react":"^19.3.0","react-dom":"^19.3.0"},"repository":"github:Jaid/monacozen","version":"0.5.1","type":"module","exports":{".":{"types":"./lib.d.ts","import":"./lib.js","default":"./lib.js"}},"types":"./lib.d.ts"}
|
package/src/main.js
CHANGED
|
@@ -10,17 +10,17 @@ return"antimono"!==a||i},g=({dark:e=!0,font:a="antimono",height:o="100%",width:t
|
|
|
10
10
|
let y=i(null),C=i(u)
|
|
11
11
|
n(m,()=>y.current,[]),r(()=>{y.current&&C.current?.(y.current)},[])
|
|
12
12
|
let S=d("textarea",{...b,...void 0===p?{defaultValue:v}:{value:p},spellCheck:b.spellCheck??!1,style:{boxSizing:"border-box",display:"block",resize:"none",border:0,borderRadius:0,margin:0,padding:0,fontSize:14,lineHeight:"16px",tabSize:2,height:o,width:t,...f,backgroundColor:e?"#000":"#fff",color:e?"#fff":"#000",fontFamily:c[a].fontFamily},ref:y,onChange:e=>s?.(e.currentTarget.value,e)})
|
|
13
|
-
return g?d("div",{...g,children:S}):S},p=o(async()=>{let[{Editor:e,loader:a},o]=await Promise.all([import("../assets/dist-Bx9hOuoB.js"),import("../assets/monaco-
|
|
14
|
-
return u=o.registerModelSchema,a.config({monaco:o.default}),{default:e}}),v=({dark:e=!0,font:o="antimono",height:n="100%",width:r="100%",schema:l,monaco:s,autoFocus:c,disabled:m,readOnly:g,placeholder:v,beforeMount:b,defaultLanguage:y,defaultPath:C,defaultValue:S,keepCurrentModel:M,language:w,line:
|
|
15
|
-
t(()=>{B
|
|
16
|
-
let I=f(o,{...!0===s?{}:s,...void 0===g?{}:{readOnly:g},...m?{readOnly:!0,domReadOnly:!0}:{},...void 0===v?{}:{placeholder:v},...void 0===
|
|
17
|
-
return d("div",{...
|
|
13
|
+
return g?d("div",{...g,children:S}):S},p=o(async()=>{let[{Editor:e,loader:a},o]=await Promise.all([import("../assets/dist-Bx9hOuoB.js"),import("../assets/monaco-eCLjoH9K.js").then(e=>e.t)])
|
|
14
|
+
return u=o.registerModelSchema,a.config({monaco:o.default}),{default:e}}),v=({dark:e=!0,font:o="antimono",height:n="100%",width:r="100%",schema:l,monaco:s,autoFocus:c,disabled:m,readOnly:g,placeholder:v,beforeMount:b,defaultLanguage:y,defaultPath:C,defaultValue:S,keepCurrentModel:M,language:w,line:z,loading:V="Loading…",onChange:k,onMount:x,onValidate:F,overrideServices:L,path:O,saveViewState:E,value:j,wrapperProps:D,style:P,...H})=>{let R=h(o),A=i(l),B=i(null)
|
|
15
|
+
t(()=>{R&&B.current?.monaco.editor.remeasureFonts()},[R,o]),t(()=>{A.current=l,B.current?.refreshSchema()},[l])
|
|
16
|
+
let I=f(o,{...!0===s?{}:s,...void 0===g?{}:{readOnly:g},...m?{readOnly:!0,domReadOnly:!0}:{},...void 0===v?{}:{placeholder:v},...void 0===H["aria-label"]?{}:{ariaLabel:H["aria-label"]}})
|
|
17
|
+
return d("div",{...D,...H,style:{...D?.style,width:r,height:n,...P},children:d(a,{fallback:V,children:d(p,{beforeMount:b,defaultLanguage:y,defaultPath:C,defaultValue:S,height:"100%",keepCurrentModel:M,language:w,line:z,loading:V,options:I,overrideServices:L,path:O,saveViewState:E,theme:e?"vs-dark":"vs",value:j,width:"100%",onChange:k,onMount(e,a){let o,t=()=>{e.trigger("monacozen","editor.action.inlineSuggest.hide",{}),o?.dispose()
|
|
18
18
|
let a=e.getModel()
|
|
19
|
-
o=a?u?.(a,
|
|
20
|
-
|
|
19
|
+
o=a?u?.(a,A.current):void 0}
|
|
20
|
+
B.current={editor:e,monaco:a,refreshSchema:t},t()
|
|
21
21
|
let n=e.onDidChangeModel(t),r=a.editor.onDidChangeModelLanguage(({model:a})=>{a===e.getModel()&&t()})
|
|
22
|
-
|
|
23
|
-
let i=e.onDidDispose(()=>{o?.dispose(),n.dispose(),r.dispose(),
|
|
22
|
+
R&&a.editor.remeasureFonts(),c&&e.focus()
|
|
23
|
+
let i=e.onDidDispose(()=>{o?.dispose(),n.dispose(),r.dispose(),B.current?.editor===e&&(B.current=null),i.dispose()})
|
|
24
24
|
x?.(e,a)},onValidate:F})})})}
|
|
25
25
|
function b(a){let o,t,n=e(14),[r,i]=l(a.defaultValue??"")
|
|
26
26
|
if(!1===a.monaco){let e,o,t,l=a
|