@mastra/deployer-cloud 1.79.0-alpha.6 → 1.79.0-alpha.8
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/dist/studio/assets/CodeDiff.es-e2MbYboz.js +308 -0
- package/dist/studio/assets/css-BnMrqG3P.js +1 -0
- package/dist/studio/assets/diff-DbItnlRl.js +1 -0
- package/dist/studio/assets/{index-BR4Pb6K4.js → index-DLVMqNuw.js} +2 -2
- package/dist/studio/assets/{main-BW6Uo34i.js → main-D6HxdGiJ.js} +279 -278
- package/dist/studio/assets/python-BuPzkPfP.js +1 -0
- package/dist/studio/assets/sql-D0XecflT.js +1 -0
- package/dist/studio/assets/{style-CM1J8ZrS.css → style-cjBSQsdZ.css} +1 -1
- package/dist/studio/assets/xml-BQQZnNBQ.js +1 -0
- package/dist/studio/assets/yaml-DsCXHVTH.js +1 -0
- package/dist/studio/index.html +2 -2
- package/package.json +4 -4
- package/dist/studio/assets/CodeDiff.es-CNsroDEW.js +0 -298
- package/dist/studio/assets/bash-atvbtKCR.js +0 -1
- package/dist/studio/assets/core-BdAVaBaR.js +0 -2
- package/dist/studio/assets/css-BPhBrDlE.js +0 -1
- package/dist/studio/assets/diff-BgYniUM_.js +0 -1
- package/dist/studio/assets/engine-compile-CUTZfOIo.js +0 -137
- package/dist/studio/assets/engine-javascript-DSQaR0Yq.js +0 -1
- package/dist/studio/assets/github-dark-vbPMK5nw.js +0 -1
- package/dist/studio/assets/github-light-CBO01_j6.js +0 -1
- package/dist/studio/assets/html-C2L_23MC.js +0 -1
- package/dist/studio/assets/index-2BQyy0xI.js +0 -1
- package/dist/studio/assets/index-Bytkm7tb.js +0 -11
- package/dist/studio/assets/javascript-ySlJ1b_l.js +0 -1
- package/dist/studio/assets/json-BQoSv7ci.js +0 -1
- package/dist/studio/assets/jsx-BAng5TT0.js +0 -1
- package/dist/studio/assets/markdown-UIAJJxZW.js +0 -1
- package/dist/studio/assets/python-DhUJRlN_.js +0 -1
- package/dist/studio/assets/sql-COK4E0Yg.js +0 -1
- package/dist/studio/assets/tsx-B6W0miNI.js +0 -1
- package/dist/studio/assets/typescript-Dj6nwHGl.js +0 -1
- package/dist/studio/assets/xml-DGRTSKzu.js +0 -1
- package/dist/studio/assets/yaml-CVw76BM1.js +0 -1
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{w as ie,s as Re,f as qe,a as We,b as Fe,c as ce,z as ze,h as Ue}from"./main-BW6Uo34i.js";function He(t){return ae(t)}function ae(t){return Array.isArray(t)?Ke(t):t instanceof RegExp?t:typeof t=="object"?Qe(t):t}function Ke(t){let e=[];for(let n=0,s=t.length;n<s;n++)e[n]=ae(t[n]);return e}function Qe(t){let e={};for(let n in t)e[n]=ae(t[n]);return e}function Se(t,...e){return e.forEach(n=>{for(let s in n)t[s]=n[s]}),t}function be(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?be(t.substring(0,t.length-1)):t.substr(~e+1)}var H=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,T=class{static hasCaptures(t){return t===null?!1:(H.lastIndex=0,H.test(t))}static replaceCaptures(t,e,n){return t.replace(H,(s,r,i,a)=>{let c=n[parseInt(r||i,10)];if(c){let o=e.substring(c.start,c.end);for(;o[0]===".";)o=o.substring(1);switch(a){case"downcase":return o.toLowerCase();case"upcase":return o.toUpperCase();default:return o}}else return s})}};function we(t,e){return t<e?-1:t>e?1:0}function Ne(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,s=e.length;if(n===s){for(let r=0;r<n;r++){let i=we(t[r],e[r]);if(i!==0)return i}return 0}return n-s}function le(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Ae(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Ie=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},V=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Ve(t),e)}static createFromParsedTheme(t,e){return et(t,e)}_cachedMatchRoot=new Ie(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,s=this._cachedMatchRoot.get(e).find(r=>Ye(t.parent,r.parentScopes));return s?new Pe(s.fontStyle,s.foreground,s.background):null}},K=class M{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const s of n)e=new M(e,s);return e}static from(...e){let n=null;for(let s=0;s<e.length;s++)n=new M(n,e[s]);return n}push(e){return new M(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let s=this;for(;s&&s!==e;)n.push(s.scopeName),s=s.parent;return s===e?n.reverse():void 0}};function Ye(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let s=e[n],r=!1;if(s===">"){if(n===e.length-1)return!1;s=e[++n],r=!0}for(;t&&!Xe(t.scopeName,s);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Xe(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Pe=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Ve(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],s=0;for(let r=0,i=e.length;r<i;r++){let a=e[r];if(!a.settings)continue;let c;if(typeof a.scope=="string"){let h=a.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),c=h.split(",")}else Array.isArray(a.scope)?c=a.scope:c=[""];let o=-1;if(typeof a.settings.fontStyle=="string"){o=0;let h=a.settings.fontStyle.split(" ");for(let m=0,d=h.length;m<d;m++)switch(h[m]){case"italic":o=o|1;break;case"bold":o=o|2;break;case"underline":o=o|4;break;case"strikethrough":o=o|8;break}}let l=null;typeof a.settings.foreground=="string"&&le(a.settings.foreground)&&(l=a.settings.foreground);let u=null;typeof a.settings.background=="string"&&le(a.settings.background)&&(u=a.settings.background);for(let h=0,m=c.length;h<m;h++){let p=c[h].trim().split(" "),S=p[p.length-1],_=null;p.length>1&&(_=p.slice(0,p.length-1),_.reverse()),n[s++]=new Je(S,_,r,o,l,u)}}return n}var Je=class{constructor(t,e,n,s,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=s,this.foreground=r,this.background=i}},Ze=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(Ze||{});function et(t,e){t.sort((o,l)=>{let u=we(o.scope,l.scope);return u!==0||(u=Ne(o.parentScopes,l.parentScopes),u!==0)?u:o.index-l.index});let n=0,s="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let o=t.shift();o.fontStyle!==-1&&(n=o.fontStyle),o.foreground!==null&&(s=o.foreground),o.background!==null&&(r=o.background)}let i=new tt(e),a=new Pe(n,i.getId(s),i.getId(r)),c=new st(new J(0,null,-1,0,0),[]);for(let o=0,l=t.length;o<l;o++){let u=t[o];c.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new V(i,a,c)}var tt=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},nt=Object.freeze([]),J=class Ee{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,s,r,i){this.scopeDepth=e,this.parentScopes=n||nt,this.fontStyle=s,this.foreground=r,this.background=i}clone(){return new Ee(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let s=0,r=e.length;s<r;s++)n[s]=e[s].clone();return n}acceptOverwrite(e,n,s,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),r!==0&&(this.background=r)}},st=class Z{constructor(e,n=[],s={}){this._mainRule=e,this._children=s,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let s=0,r=0;for(;e.parentScopes[s]===">"&&s++,n.parentScopes[r]===">"&&r++,!(s>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[s].length;if(i!==0)return i;s++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let s=e.indexOf("."),r,i;if(s===-1?(r=e,i=""):(r=e.substring(0,s),i=e.substring(s+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Z._cmpBySpecificity),n}insert(e,n,s,r,i,a){if(n===""){this._doInsertHere(e,s,r,i,a);return}let c=n.indexOf("."),o,l;c===-1?(o=n,l=""):(o=n.substring(0,c),l=n.substring(c+1));let u;this._children.hasOwnProperty(o)?u=this._children[o]:(u=new Z(this._mainRule.clone(),J.cloneArr(this._rulesWithParentScopes)),this._children[o]=u),u.insert(e+1,l,s,r,i,a)}_doInsertHere(e,n,s,r,i){if(n===null){this._mainRule.acceptOverwrite(e,s,r,i);return}for(let a=0,c=this._rulesWithParentScopes.length;a<c;a++){let o=this._rulesWithParentScopes[a];if(Ne(o.parentScopes,n)===0){o.acceptOverwrite(e,s,r,i);return}}s===-1&&(s=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new J(e,n,s,r,i))}},$=class R{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=R.getLanguageId(e),s=R.getTokenType(e),r=R.getFontStyle(e),i=R.getForeground(e),a=R.getBackground(e);console.log({languageId:n,tokenType:s,fontStyle:r,foreground:i,background:a})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,s,r,i,a,c){let o=R.getLanguageId(e),l=R.getTokenType(e),u=R.containsBalancedBrackets(e)?1:0,h=R.getFontStyle(e),m=R.getForeground(e),d=R.getBackground(e);return n!==0&&(o=n),s!==8&&(l=s),r!==null&&(u=r?1:0),i!==-1&&(h=i),a!==0&&(m=a),c!==0&&(d=c),(o<<0|l<<8|u<<10|h<<11|m<<15|d<<24)>>>0}};function D(t,e){const n=[],s=rt(t);let r=s.next();for(;r!==null;){let o=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":o=1;break;case"L":o=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=s.next()}let l=a();if(n.push({matcher:l,priority:o}),r!==",")break;r=s.next()}return n;function i(){if(r==="-"){r=s.next();const o=i();return l=>!!o&&!o(l)}if(r==="("){r=s.next();const o=c();return r===")"&&(r=s.next()),o}if(ue(r)){const o=[];do o.push(r),r=s.next();while(ue(r));return l=>e(o,l)}return null}function a(){const o=[];let l=i();for(;l;)o.push(l),l=i();return u=>o.every(h=>h(u))}function c(){const o=[];let l=a();for(;l&&(o.push(l),r==="|"||r===",");){do r=s.next();while(r==="|"||r===",");l=a()}return u=>o.some(h=>h(u))}}function ue(t){return!!t&&!!t.match(/[\w\.:]+/)}function rt(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const s=n[0];return n=e.exec(t),s}}}function ve(t){typeof t.dispose=="function"&&t.dispose()}var k=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},it=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},at=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},ot=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new k(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new at;for(const n of t)ct(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof k){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function ct(t,e,n,s){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof k?j({baseGrammar:i,selfGrammar:r},s):ee(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},s);const a=n.injections(t.scopeName);if(a)for(const c of a)s.add(new k(c))}function ee(t,e,n){if(e.repository&&e.repository[t]){const s=e.repository[t];q([s],e,n)}}function j(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&q(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&q(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function q(t,e,n){for(const s of t){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const r=s.repository?Se({},e.repository,s.repository):e.repository;Array.isArray(s.patterns)&&q(s.patterns,{...e,repository:r},n);const i=s.include;if(!i)continue;const a=ke(i);switch(a.kind){case 0:j({...e,selfGrammar:e.baseGrammar},n);break;case 1:j(e,n);break;case 2:ee(a.ruleName,{...e,repository:r},n);break;case 3:case 4:const c=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const o={baseGrammar:e.baseGrammar,selfGrammar:c,repository:r};a.kind===4?ee(a.ruleName,o,n):j(o,n)}else a.kind===4?n.add(new it(a.scopeName,a.ruleName)):n.add(new k(a.scopeName));break}}}var lt=class{kind=0},ut=class{kind=1},ht=class{constructor(t){this.ruleName=t}kind=2},pt=class{constructor(t){this.scopeName=t}kind=3},dt=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function ke(t){if(t==="$base")return new lt;if(t==="$self")return new ut;const e=t.indexOf("#");if(e===-1)return new pt(t);if(e===0)return new ht(t.substring(1));{const n=t.substring(0,e),s=t.substring(e+1);return new dt(n,s)}}var mt=/\\(\d+)/,he=/\\(\d+)/g,ft=-1,xe=-2;var L=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,s){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=T.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=T.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${be(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:T.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:T.replaceCaptures(this._contentName,t,e)}},gt=class extends L{retokenizeCapturedWithRuleId;constructor(t,e,n,s,r){super(t,e,n,s),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,s){throw new Error("Not supported!")}},_t=class extends L{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,null),this._match=new x(s,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new G,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},pe=class extends L{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,s),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new G,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},te=class extends L{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r,i,a,c,o,l){super(t,e,n,s),this._begin=new x(r,this.id),this.beginCaptures=i,this._end=new x(a||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=o||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,s)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new G;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},W=class extends L{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,s,r,i,a,c,o){super(t,e,n,s),this._begin=new x(r,this.id),this.beginCaptures=i,this.whileCaptures=c,this._while=new x(a,xe),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new G;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,s){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,s)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new G,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||""),this._cachedCompiledWhilePatterns}},Ge=class g{static createCaptureRule(e,n,s,r,i){return e.registerRule(a=>new gt(n,a,s,r,i))}static getCompiledRuleId(e,n,s){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new _t(e.$vscodeTextmateLocation,e.id,e.name,e.match,g._compileCaptures(e.captures,n,s));if(typeof e.begin>"u"){e.repository&&(s=Se({},s,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new pe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,g._compilePatterns(i,n,s))}return e.while?new W(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,g._compileCaptures(e.beginCaptures||e.captures,n,s),e.while,g._compileCaptures(e.whileCaptures||e.captures,n,s),g._compilePatterns(e.patterns,n,s)):new te(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,g._compileCaptures(e.beginCaptures||e.captures,n,s),e.end,g._compileCaptures(e.endCaptures||e.captures,n,s),e.applyEndPatternLast,g._compilePatterns(e.patterns,n,s))}),e.id}static _compileCaptures(e,n,s){let r=[];if(e){let i=0;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const c=parseInt(a,10);c>i&&(i=c)}for(let a=0;a<=i;a++)r[a]=null;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const c=parseInt(a,10);let o=0;e[a].patterns&&(o=g.getCompiledRuleId(e[a],n,s)),r[c]=g.createCaptureRule(n,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,o)}}return r}static _compilePatterns(e,n,s){let r=[];if(e)for(let i=0,a=e.length;i<a;i++){const c=e[i];let o=-1;if(c.include){const l=ke(c.include);switch(l.kind){case 0:case 1:o=g.getCompiledRuleId(s[c.include],n,s);break;case 2:let u=s[l.ruleName];u&&(o=g.getCompiledRuleId(u,n,s));break;case 3:case 4:const h=l.scopeName,m=l.kind===4?l.ruleName:null,d=n.getExternalGrammar(h,s);if(d)if(m){let p=d.repository[m];p&&(o=g.getCompiledRuleId(p,n,d.repository))}else o=g.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else o=g.getCompiledRuleId(c,n,s);if(o!==-1){const l=n.getRule(o);let u=!1;if((l instanceof pe||l instanceof te||l instanceof W)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(o)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},x=class Le{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const s=e.length;let r=0,i=[],a=!1;for(let c=0;c<s;c++)if(e.charAt(c)==="\\"&&c+1<s){const l=e.charAt(c+1);l==="z"?(i.push(e.substring(r,c)),i.push("$(?!\\n)(?<!\\n)"),r=c+2):(l==="A"||l==="G")&&(a=!0),c++}this.hasAnchor=a,r===0?this.source=e:(i.push(e.substring(r,s)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=mt.test(this.source):this.hasBackReferences=!1}clone(){return new Le(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let s=n.map(r=>e.substring(r.start,r.end));return he.lastIndex=0,this.source.replace(he,(r,i)=>Ae(s[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],s=[],r=[],i,a,c,o;for(i=0,a=this.source.length;i<a;i++)c=this.source.charAt(i),e[i]=c,n[i]=c,s[i]=c,r[i]=c,c==="\\"&&i+1<a&&(o=this.source.charAt(i+1),o==="A"?(e[i+1]="",n[i+1]="",s[i+1]="A",r[i+1]="A"):o==="G"?(e[i+1]="",n[i+1]="G",s[i+1]="",r[i+1]="G"):(e[i+1]=o,n[i+1]=o,s[i+1]=o,r[i+1]=o),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:r.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},G=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new de(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let s=this._items.map(r=>r.resolveAnchors(e,n));return new de(t,s,this._items.map(r=>r.ruleId))}},de=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
|
-
`)}findNextMatchSync(t,e,n){const s=this.scanner.findNextMatchSync(t,e,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},Q=class{constructor(t,e){this.languageId=t,this.tokenType=e}},yt=class ne{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new Q(e,8),this._embeddedLanguagesMatcher=new Ct(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?ne._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new Q(0,0);_getBasicScopeAttributes=new Ie(e=>{const n=this._scopeToLanguage(e),s=this._toStandardTokenType(e);return new Q(n,s)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(ne.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Ct=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,s])=>Ae(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},me=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Te(t,e,n,s,r,i,a,c){const o=e.content.length;let l=!1,u=-1;if(a){const d=Rt(t,e,n,s,r,i);r=d.stack,s=d.linePos,n=d.isFirstLine,u=d.anchorPosition}const h=Date.now();for(;!l;){if(c!==0&&Date.now()-h>c)return new me(r,!0);m()}return new me(r,!1);function m(){const d=St(t,e,n,s,r,u);if(!d){i.produce(r,o),l=!0;return}const p=d.captureIndices,S=d.matchedRuleId,_=p&&p.length>0?p[0].end>s:!1;if(S===ft){const C=r.getRule(t);i.produce(r,p[0].start),r=r.withContentNameScopesList(r.nameScopesList),E(t,e,n,r,i,C.endCaptures,p),i.produce(r,p[0].end);const y=r;if(r=r.parent,u=y.getAnchorPos(),!_&&y.getEnterPos()===s){r=y,i.produce(r,o),l=!0;return}}else{const C=t.getRule(S);i.produce(r,p[0].start);const y=r,I=C.getName(e.content,p),N=r.contentNameScopesList.pushAttributed(I,t);if(r=r.push(S,s,u,p[0].end===o,null,N,N),C instanceof te){const b=C;E(t,e,n,r,i,b.beginCaptures,p),i.produce(r,p[0].end),u=p[0].end;const z=b.getContentName(e.content,p),U=N.pushAttributed(z,t);if(r=r.withContentNameScopesList(U),b.endHasBackReferences&&(r=r.withEndRule(b.getEndWithResolvedBackReferences(e.content,p))),!_&&y.hasSameRuleAs(r)){r=r.pop(),i.produce(r,o),l=!0;return}}else if(C instanceof W){const b=C;E(t,e,n,r,i,b.beginCaptures,p),i.produce(r,p[0].end),u=p[0].end;const z=b.getContentName(e.content,p),U=N.pushAttributed(z,t);if(r=r.withContentNameScopesList(U),b.whileHasBackReferences&&(r=r.withEndRule(b.getWhileWithResolvedBackReferences(e.content,p))),!_&&y.hasSameRuleAs(r)){r=r.pop(),i.produce(r,o),l=!0;return}}else if(E(t,e,n,r,i,C.captures,p),i.produce(r,p[0].end),r=r.pop(),!_){r=r.safePop(),i.produce(r,o),l=!0;return}}p[0].end>s&&(s=p[0].end,n=!1)}}function Rt(t,e,n,s,r,i){let a=r.beginRuleCapturedEOL?0:-1;const c=[];for(let o=r;o;o=o.pop()){const l=o.getRule(t);l instanceof W&&c.push({rule:l,stack:o})}for(let o=c.pop();o;o=c.pop()){const{ruleScanner:l,findOptions:u}=Nt(o.rule,t,o.stack.endRule,n,s===a),h=l.findNextMatchSync(e,s,u);if(h){if(h.ruleId!==xe){r=o.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(i.produce(o.stack,h.captureIndices[0].start),E(t,e,n,o.stack,i,o.rule.whileCaptures,h.captureIndices),i.produce(o.stack,h.captureIndices[0].end),a=h.captureIndices[0].end,h.captureIndices[0].end>s&&(s=h.captureIndices[0].end,n=!1))}else{r=o.stack.pop();break}}return{stack:r,linePos:s,anchorPosition:a,isFirstLine:n}}function St(t,e,n,s,r,i){const a=bt(t,e,n,s,r,i),c=t.getInjections();if(c.length===0)return a;const o=wt(c,t,e,n,s,r,i);if(!o)return a;if(!a)return o;const l=a.captureIndices[0].start,u=o.captureIndices[0].start;return u<l||o.priorityMatch&&u===l?o:a}function bt(t,e,n,s,r,i){const a=r.getRule(t),{ruleScanner:c,findOptions:o}=Oe(a,t,r.endRule,n,s===i),l=c.findNextMatchSync(e,s,o);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function wt(t,e,n,s,r,i,a){let c=Number.MAX_VALUE,o=null,l,u=0;const h=i.contentNameScopesList.getScopeNames();for(let m=0,d=t.length;m<d;m++){const p=t[m];if(!p.matcher(h))continue;const S=e.getRule(p.ruleId),{ruleScanner:_,findOptions:C}=Oe(S,e,null,s,r===a),y=_.findNextMatchSync(n,r,C);if(!y)continue;const I=y.captureIndices[0].start;if(!(I>=c)&&(c=I,o=y.captureIndices,l=y.ruleId,u=p.priority,c===r))break}return o?{priorityMatch:u===-1,captureIndices:o,matchedRuleId:l}:null}function Oe(t,e,n,s,r){return{ruleScanner:t.compileAG(e,n,s,r),findOptions:0}}function Nt(t,e,n,s,r){return{ruleScanner:t.compileWhileAG(e,n,s,r),findOptions:0}}function E(t,e,n,s,r,i,a){if(i.length===0)return;const c=e.content,o=Math.min(i.length,a.length),l=[],u=a[0].end;for(let h=0;h<o;h++){const m=i[h];if(m===null)continue;const d=a[h];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,d.start):r.produce(s,d.start),m.retokenizeCapturedWithRuleId){const S=m.getName(c,a),_=s.contentNameScopesList.pushAttributed(S,t),C=m.getContentName(c,a),y=_.pushAttributed(C,t),I=s.push(m.retokenizeCapturedWithRuleId,d.start,-1,!1,null,_,y),N=t.createOnigString(c.substring(0,d.end));Te(t,N,n&&d.start===0,d.start,I,r,!1,0),ve(N);continue}const p=m.getName(c,a);if(p!==null){const _=(l.length>0?l[l.length-1].scopes:s.contentNameScopesList).pushAttributed(p,t);l.push(new At(_,d.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var At=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function It(t,e,n,s,r,i,a,c){return new Et(t,e,n,s,r,i,a,c)}function fe(t,e,n,s,r){const i=D(e,F),a=Ge.getCompiledRuleId(n,s,r.repository);for(const c of i)t.push({debugSelector:e,matcher:c.matcher,ruleId:a,grammar:r,priority:c.priority})}function F(t,e){if(e.length<t.length)return!1;let n=0;return t.every(s=>{for(let r=n;r<e.length;r++)if(Pt(e[r],s))return n=r+1,!0;return!1})}function Pt(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var Et=class{constructor(t,e,n,s,r,i,a,c){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=c,this._basicScopeAttributesProvider=new yt(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=ge(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const o of Object.keys(r)){const l=D(o,F);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[o]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},e=[],n=this._rootScopeName,s=t.lookup(n);if(s){const r=s.injections;if(r)for(let a in r)fe(e,a,r[a],this,s);const i=this._grammarRepository.injections(n);i&&i.forEach(a=>{const c=this.getExternalGrammar(a);if(c){const o=c.injectionSelector;o&&fe(e,o,c,this,c)}})}return e.sort((r,i)=>r.priority-i.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=ge(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const s=this._tokenize(t,e,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(t,e,n=0){const s=this._tokenize(t,e,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(t,e,n,s){this._rootId===-1&&(this._rootId=Ge.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!e||e===se.NULL){r=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=$.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),m=this.getRule(this._rootId).getName(null,null);let d;m?d=v.createRootAndLookUpScopeName(m,h,this):d=v.createRoot("unknown",h),e=new se(null,this._rootId,-1,-1,!1,null,d,d)}else r=!1,e.reset();t=t+`
|
|
3
|
-
`;const i=this.createOnigString(t),a=i.content.length,c=new kt(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),o=Te(this,i,r,0,e,c,!0,s);return ve(i),{lineLength:a,lineTokens:c,ruleStack:o.stack,stoppedEarly:o.stoppedEarly}}};function ge(t,e){return t=He(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var v=class w{constructor(e,n,s){this.parent=e,this.scopePath=n,this.tokenAttributes=s}static fromExtension(e,n){let s=e,r=e?.scopePath??null;for(const i of n)r=K.push(r,i.scopeNames),s=new w(s,r,i.encodedTokenAttributes);return s}static createRoot(e,n){return new w(null,new K(null,e),n)}static createRootAndLookUpScopeName(e,n,s){const r=s.getMetadataForScope(e),i=new K(null,e),a=s.themeProvider.themeMatch(i),c=w.mergeAttributes(n,r,a);return new w(null,i,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return w.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,s){let r=-1,i=0,a=0;return s!==null&&(r=s.fontStyle,i=s.foregroundId,a=s.backgroundId),$.set(e,n.languageId,n.tokenType,null,r,i,a)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return w._pushAttributed(this,e,n);const s=e.split(/ /g);let r=this;for(const i of s)r=w._pushAttributed(r,i,n);return r}static _pushAttributed(e,n,s){const r=s.getMetadataForScope(n),i=e.scopePath.push(n),a=s.themeProvider.themeMatch(i),c=w.mergeAttributes(e.tokenAttributes,r,a);return new w(e,i,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let s=this;for(;s&&s!==e;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(s.parent?.scopePath??null)}),s=s.parent;return s===e?n.reverse():void 0}},se=class A{constructor(e,n,s,r,i,a,c,o){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=c,this.contentNameScopesList=o,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new A(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:A._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?v.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){A._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,s,r,i,a,c){return new A(this,e,n,s,r,i,a,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new A(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const s=v.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new A(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,v.fromExtension(s,n.contentNameScopesList))}},vt=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):D(n,F).map(s=>s.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>D(n,F).map(s=>s.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},kt=class{constructor(t,e,n,s){this.balancedBracketSelectors=s,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let s=t?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=t?.getScopeNames()??[];for(const a of this._tokenTypeOverrides)a.matcher(i)&&(s=$.set(s,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(s=$.set(s,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let s=0,r=this._binaryTokens.length;s<r;s++)n[s]=this._binaryTokens[s];return n}},xt=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,s,r){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,It(t,i,e,n,s,r,this,this._onigLib))}return this._grammars.get(t)}},Bn=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new xt(V.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(V.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,s){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(e,n,s){return this._loadGrammar(e,n,s.embeddedLanguages,s.tokenTypes,new vt(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,s,r,i){const a=new ot(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(c=>this._loadSingleGrammar(c.scopeName)),a.processQueue();return this._grammarForScopeName(e,n,s,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(e,n=[],s=0,r=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,s,r)}_grammarForScopeName(e,n=0,s=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,s,r,i)}},jn=se.NULL;const Gt=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Lt=/["&'<>`]/g,Tt=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ot=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Bt=/[|\\{}()[\]^$+*?.]/g,_e=new WeakMap;function Mt(t,e){if(t=t.replace(e.subset?jt(e.subset):Lt,s),e.subset||e.escapeOnly)return t;return t.replace(Tt,n).replace(Ot,s);function n(r,i,a){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,a.charCodeAt(i+2),e)}function s(r,i,a){return e.format(r.charCodeAt(0),a.charCodeAt(i+1),e)}}function jt(t){let e=_e.get(t);return e||(e=$t(t),_e.set(t,e)),e}function $t(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Bt,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const Dt=/[\dA-Fa-f]/;function qt(t,e,n){const s="&#x"+t.toString(16).toUpperCase();return n&&e&&!Dt.test(String.fromCharCode(e))?s:s+";"}const Wt=/\d/;function Ft(t,e,n){const s="&#"+String(t);return n&&e&&!Wt.test(String.fromCharCode(e))?s:s+";"}const zt=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Y={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Ut=["cent","copy","divide","gt","lt","not","para","times"],Be={}.hasOwnProperty,re={};let O;for(O in Y)Be.call(Y,O)&&(re[Y[O]]=O);const Ht=/[^\dA-Za-z]/;function Kt(t,e,n,s){const r=String.fromCharCode(t);if(Be.call(re,r)){const i=re[r],a="&"+i;return n&&zt.includes(i)&&!Ut.includes(i)&&(!s||e&&e!==61&&Ht.test(String.fromCharCode(e)))?a:a+";"}return""}function Qt(t,e,n){let s=qt(t,e,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=Kt(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=Ft(t,e,n.omitOptionalSemicolons);i.length<s.length&&(s=i)}return r&&(!n.useShortestReferences||r.length<s.length)?r:s}function P(t,e){return Mt(t,Object.assign({format:Qt},e))}const Yt=/^>|^->|<!--|-->|--!>|<!-$/g,Xt=[">"],Vt=["<",">"];function Jt(t,e,n,s){return s.settings.bogusComments?"<?"+P(t.value,Object.assign({},s.settings.characterReferences,{subset:Xt}))+">":"<!--"+t.value.replace(Yt,r)+"-->";function r(i){return P(i,Object.assign({},s.settings.characterReferences,{subset:Vt}))}}function Zt(t,e,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}const f=je(1),Me=je(-1),en=[];function je(t){return e;function e(n,s,r){const i=n?n.children:en;let a=(s||0)+t,c=i[a];if(!r)for(;c&&ie(c);)a+=t,c=i[a];return c}}const tn={}.hasOwnProperty;function $e(t){return e;function e(n,s,r){return tn.call(t,n.tagName)&&t[n.tagName](n,s,r)}}const oe=$e({body:sn,caption:X,colgroup:X,dd:cn,dt:on,head:X,html:nn,li:an,optgroup:ln,option:un,p:rn,rp:ye,rt:ye,tbody:pn,td:Ce,tfoot:dn,th:Ce,thead:hn,tr:mn});function X(t,e,n){const s=f(n,e,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&ie(s.value.charAt(0)))}function nn(t,e,n){const s=f(n,e);return!s||s.type!=="comment"}function sn(t,e,n){const s=f(n,e);return!s||s.type!=="comment"}function rn(t,e,n){const s=f(n,e);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function an(t,e,n){const s=f(n,e);return!s||s.type==="element"&&s.tagName==="li"}function on(t,e,n){const s=f(n,e);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function cn(t,e,n){const s=f(n,e);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function ye(t,e,n){const s=f(n,e);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function ln(t,e,n){const s=f(n,e);return!s||s.type==="element"&&s.tagName==="optgroup"}function un(t,e,n){const s=f(n,e);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function hn(t,e,n){const s=f(n,e);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function pn(t,e,n){const s=f(n,e);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function dn(t,e,n){return!f(n,e)}function mn(t,e,n){const s=f(n,e);return!s||s.type==="element"&&s.tagName==="tr"}function Ce(t,e,n){const s=f(n,e);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const fn=$e({body:yn,colgroup:Cn,head:_n,html:gn,tbody:Rn});function gn(t){const e=f(t,-1);return!e||e.type!=="comment"}function _n(t){const e=new Set;for(const s of t.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(e.has(s.tagName))return!1;e.add(s.tagName)}const n=t.children[0];return!n||n.type==="element"}function yn(t){const e=f(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&ie(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Cn(t,e,n){const s=Me(n,e),r=f(t,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&oe(s,n.children.indexOf(s),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function Rn(t,e,n){const s=Me(n,e),r=f(t,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&oe(s,n.children.indexOf(s),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const B={name:[[`
|
|
4
|
-
\f\r &/=>`.split(""),`
|
|
5
|
-
\f\r "&'/=>\``.split("")],[`\0
|
|
6
|
-
\f\r "&'/<=>`.split(""),`\0
|
|
7
|
-
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
8
|
-
\f\r &>`.split(""),`\0
|
|
9
|
-
\f\r "&'<=>\``.split("")],[`\0
|
|
10
|
-
\f\r "&'<=>\``.split(""),`\0
|
|
11
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Sn(t,e,n,s){const r=s.schema,i=r.space==="svg"?!1:s.settings.omitOptionalTags;let a=r.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(t.tagName.toLowerCase());const c=[];let o;r.space==="html"&&t.tagName==="svg"&&(s.schema=Re);const l=bn(s,t.properties),u=s.all(r.space==="html"&&t.tagName==="template"?t.content:t);return s.schema=r,u&&(a=!1),(l||!i||!fn(t,e,n))&&(c.push("<",t.tagName,l?" "+l:""),a&&(r.space==="svg"||s.settings.closeSelfClosing)&&(o=l.charAt(l.length-1),(!s.settings.tightSelfClosing||o==="/"||o&&o!=='"'&&o!=="'")&&c.push(" "),c.push("/")),c.push(">")),c.push(u),!a&&(!i||!oe(t,e,n))&&c.push("</"+t.tagName+">"),c.join("")}function bn(t,e){const n=[];let s=-1,r;if(e){for(r in e)if(e[r]!==null&&e[r]!==void 0){const i=wn(t,r,e[r]);i&&n.push(i)}}for(;++s<n.length;){const i=t.settings.tightAttributes?n[s].charAt(n[s].length-1):void 0;s!==n.length-1&&i!=='"'&&i!=="'"&&(n[s]+=" ")}return n.join("")}function wn(t,e,n){const s=qe(t.schema,e),r=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let a=t.quote,c;if(s.overloadedBoolean&&(n===s.attribute||n==="")?n=!0:(s.boolean||s.overloadedBoolean)&&(typeof n!="string"||n===s.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const o=P(s.attribute,Object.assign({},t.settings.characterReferences,{subset:B.name[r][i]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?We:Fe)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?o:(t.settings.preferUnquoted&&(c=P(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:B.unquoted[r][i]}))),c!==n&&(t.settings.quoteSmart&&ce(n,a)>ce(n,t.alternative)&&(a=t.alternative),c=a+P(n,Object.assign({},t.settings.characterReferences,{subset:(a==="'"?B.single:B.double)[r][i],attribute:!0}))+a),o+(c&&"="+c))}const Nn=["<","&"];function De(t,e,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:P(t.value,Object.assign({},s.settings.characterReferences,{subset:Nn}))}function An(t,e,n,s){return s.settings.allowDangerousHtml?t.value:De(t,e,n,s)}function In(t,e,n,s){return s.all(t)}const Pn=ze("type",{invalid:En,unknown:vn,handlers:{comment:Jt,doctype:Zt,element:Sn,raw:An,root:In,text:De}});function En(t){throw new Error("Expected node, not `"+t+"`")}function vn(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const kn={},xn={},Gn=[];function $n(t,e){const n=e||kn,s=n.quote||'"',r=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:Ln,all:Tn,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Gt,characterReferences:n.characterReferences||xn,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Re:Ue,quote:s,alternative:r}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Ln(t,e,n){return Pn(t,e,n,this)}function Tn(t){const e=[],n=t&&t.children||Gn;let s=-1;for(;++s<n.length;)e[s]=this.one(n[s],s,t);return e.join("")}export{$ as E,Ze as F,jn as I,Bn as R,V as T,$n as t};
|