@mastra/deployer-cloud 1.79.0-alpha.5 → 1.79.0-alpha.7
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-BbgAsPiS.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-CfYwyayz.js → index-BPCxpgyV.js} +2 -2
- package/dist/studio/assets/{main-POoyO8V4.js → main-GmTtMbns.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-cjBSQsdZ.css +1 -0
- 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 +5 -5
- package/versions.json +1 -1
- package/dist/studio/assets/CodeDiff.es-Ca4a0Wkq.js +0 -298
- package/dist/studio/assets/bash-atvbtKCR.js +0 -1
- package/dist/studio/assets/core-BkqiHPjN.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-C09MwT6x.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/style-5KknwEv_.css +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
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuFy.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./angular-ts-BrjP3tb8.js","./scss-D5BDwBP9.js","./apl-CORt7UWP.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./json-Cp-IABpG.js","./astro-HNnZUWAn.js","./typescript-BPQ3VLAy.js","./postcss-CXtECtnM.js","./tsx-COt5Ahok.js","./blade-2xfisSek.js","./html-derivative-DlHx6ybY.js","./sql-CRqJ_cUM.js","./bsl-DlhNcFeZ.js","./sdbl-DVxCFoDh.js","./cairo-KRGpt6FW.js","./python-B6aJPvgy.js","./chapel-DTp_pixX.js","./c-BIGW1oBm.js","./cobol-nBiQ_Alo.js","./coffee-Ch7k5sss.js","./cpp-BMRokrvK.js","./regexp-CDVJQ6XC.js","./glsl-DplSGwfg.js","./crystal-DGywbUpC.js","./shellscript-Yzrsuije.js","./edge-FbVlp4U3.js","./elixir-CkH2-t6x.js","./elm-DbKCFpqz.js","./erb-DXfck5VN.js","./ruby-C0TQ7zu5.js","./haml-D5jkg6IW.js","./graphql-ChdNCCLP.js","./jsx-g9-lgVsj.js","./lua-BaeVxFsk.js","./yaml-Buea-lGh.js","./erlang-DsQrWhSR.js","./markdown-Cvjx9yec.js","./fortran-fixed-form-CkoXwp7k.js","./fortran-free-form-BxgE0vQu.js","./fsharp-CXgrBDvD.js","./gdresource-TyuKm33G.js","./gdshader-DkwncUOv.js","./gdscript-DqcFQ5yU.js","./git-commit-F4YmCXRG.js","./diff-D97Zzqfu.js","./git-rebase-r7XF79zn.js","./glimmer-js-ByusRIyA.js","./glimmer-ts-BfAWNZQY.js","./hack-BWmVpMyf.js","./handlebars-BpdQsYii.js","./http-jrhK8wxY.js","./hurl-irOxFIW8.js","./csv-fuZLfV_i.js","./hxml-2-FPmUDs.js","./haxe-CfZj7gIn.js","./jinja-f2NsQr07.js","./jison-wvAkD_A8.js","./julia-5Bft2YPA.js","./r-Cf5RLm7j.js","./just-Cwhn7H3k.js","./perl-B9cMNwum.js","./latex-D5pSuvFb.js","./tex-D96PA37w.js","./liquid-C0sCDyMI.js","./marko-DjSrsDqO.js","./less-B1dDrJ26.js","./mdc-D1_yUvq7.js","./nextflow-C-mBbutL.js","./nextflow-groovy-vE_lwT2v.js","./nginx-BpAMiNFr.js","./nim-BIad80T-.js","./org-DM6o9KBp.js","./ini-BEwlwnbL.js","./make-CHLpvVh8.js","./php-Csjmro_R.js","./vb-Cu-pLBUe.js","./clojure-P80f7IUj.js","./objective-c-DXmwc3jG.js","./docker-BcOcwvcX.js","./go-C27-OAKa.js","./groovy-gcz8RCvz.js","./raku-DXvB9xmW.js","./rust-B1yitclQ.js","./scala-CqE71os6.js","./csharp-DSvCPggb.js","./dart-bE4Kk8sk.js","./ocaml-C0hk2d4L.js","./zig-VOosw3JB.js","./xsl-CtQFsRM5.js","./pug-DKIMFp6K.js","./qml-3beO22l8.js","./razor-BjBPvh-w.js","./rst-bs7f0vWN.js","./cmake-D1j8_8rp.js","./sas-DEy46yEz.js","./shaderlab-Dg9Lc6iA.js","./hlsl-D3lLCCz7.js","./shellsession-BADoaaVG.js","./soy-8wufbnw4.js","./sparql-rVzFXLq3.js","./turtle-BsS91CYL.js","./stata-DI20mbqo.js","./surrealql-Cjom0U5J.js","./svelte-Cy7k_4gC.js","./templ-DhtptRzy.js","./ts-tags-D351s5mN.js","./twig-27uCiNez.js","./typst-BUadGCkm.js","./bat-CickPsom.js","./bibtex-CHM0blh-.js","./jsonc-Des-eS-w.js","./log-2UxHyX5q.js","./powershell-BmBUJMz7.js","./swift-C2oV4EkX.js","./verilog-nZwndyjY.js","./system-verilog-0hqHdDBg.js","./vue-BqiEGhQt.js","./vue-html-AaS7Mt5G.js","./vue-vine-BoDAl6tE.js","./stylus-BEDo0Tqx.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{w as ur,s as as,f as cl,a as hl,b as fl,c as xr,z as pl,h as ml,r as q,j as U,u as gl,d as _l}from"./main-GmTtMbns.js";import{_ as p}from"./preload-helper-PPVm8Dsz.js";function vl(e){return cr(e)}function cr(e){return Array.isArray(e)?bl(e):e instanceof RegExp?e:typeof e=="object"?yl(e):e}function bl(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=cr(e[n]);return t}function yl(e){let t={};for(let n in e)t[n]=cr(e[n]);return t}function ls(e,...t){return t.forEach(n=>{for(let i in n)e[i]=n[i]}),e}function ds(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?ds(e.substring(0,e.length-1)):e.substr(~t+1)}var Qn=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,jt=class{static hasCaptures(e){return e===null?!1:(Qn.lastIndex=0,Qn.test(e))}static replaceCaptures(e,t,n){return e.replace(Qn,(i,r,o,s)=>{let l=n[parseInt(r||o,10)];if(l){let a=t.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(s){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return i})}};function us(e,t){return e<t?-1:e>t?1:0}function cs(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let r=0;r<n;r++){let o=us(e[r],t[r]);if(o!==0)return o}return 0}return n-i}function Ar(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function hs(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var fs=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},bn=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Cl(e),t)}static createFromParsedTheme(e,t){return wl(e,t)}_cachedMatchRoot=new fs(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,i=this._cachedMatchRoot.get(t).find(r=>El(e.parent,r.parentScopes));return i?new ps(i.fontStyle,i.foreground,i.background):null}},Jn=class fn{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const i of n)t=new fn(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new fn(n,t[i]);return n}push(t){return new fn(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push(i.scopeName),i=i.parent;return i===t?n.reverse():void 0}};function El(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let i=t[n],r=!1;if(i===">"){if(n===t.length-1)return!1;i=t[++n],r=!0}for(;e&&!Sl(e.scopeName,i);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Sl(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var ps=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Cl(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];if(!s.settings)continue;let l;if(typeof s.scope=="string"){let c=s.scope;c=c.replace(/^[,]+/,""),c=c.replace(/[,]+$/,""),l=c.split(",")}else Array.isArray(s.scope)?l=s.scope:l=[""];let a=-1;if(typeof s.settings.fontStyle=="string"){a=0;let c=s.settings.fontStyle.split(" ");for(let f=0,h=c.length;f<h;f++)switch(c[f]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let d=null;typeof s.settings.foreground=="string"&&Ar(s.settings.foreground)&&(d=s.settings.foreground);let u=null;typeof s.settings.background=="string"&&Ar(s.settings.background)&&(u=s.settings.background);for(let c=0,f=l.length;c<f;c++){let m=l[c].trim().split(" "),g=m[m.length-1],b=null;m.length>1&&(b=m.slice(0,m.length-1),b.reverse()),n[i++]=new Ll(g,b,r,a,d,u)}}return n}var Ll=class{constructor(e,t,n,i,r,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=r,this.background=o}},ne=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(ne||{});function wl(e,t){e.sort((a,d)=>{let u=us(a.scope,d.scope);return u!==0||(u=cs(a.parentScopes,d.parentScopes),u!==0)?u:a.index-d.index});let n=0,i="#000000",r="#ffffff";for(;e.length>=1&&e[0].scope==="";){let a=e.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(i=a.foreground),a.background!==null&&(r=a.background)}let o=new kl(t),s=new ps(n,o.getId(i),o.getId(r)),l=new Al(new xi(0,null,-1,0,0),[]);for(let a=0,d=e.length;a<d;a++){let u=e[a];l.insert(0,u.scope,u.parentScopes,u.fontStyle,o.getId(u.foreground),o.getId(u.background))}return new bn(o,s,l)}var kl=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},xl=Object.freeze([]),xi=class ms{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,i,r,o){this.scopeDepth=t,this.parentScopes=n||xl,this.fontStyle=i,this.foreground=r,this.background=o}clone(){return new ms(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let i=0,r=t.length;i<r;i++)n[i]=t[i].clone();return n}acceptOverwrite(t,n,i,r){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),i!==0&&(this.foreground=i),r!==0&&(this.background=r)}},Al=class Ai{constructor(t,n=[],i={}){this._mainRule=t,this._children=i,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let i=0,r=0;for(;t.parentScopes[i]===">"&&i++,n.parentScopes[r]===">"&&r++,!(i>=t.parentScopes.length||r>=n.parentScopes.length);){const o=n.parentScopes[r].length-t.parentScopes[i].length;if(o!==0)return o;i++,r++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let i=t.indexOf("."),r,o;if(i===-1?(r=t,o=""):(r=t.substring(0,i),o=t.substring(i+1)),this._children.hasOwnProperty(r))return this._children[r].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ai._cmpBySpecificity),n}insert(t,n,i,r,o,s){if(n===""){this._doInsertHere(t,i,r,o,s);return}let l=n.indexOf("."),a,d;l===-1?(a=n,d=""):(a=n.substring(0,l),d=n.substring(l+1));let u;this._children.hasOwnProperty(a)?u=this._children[a]:(u=new Ai(this._mainRule.clone(),xi.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(t+1,d,i,r,o,s)}_doInsertHere(t,n,i,r,o){if(n===null){this._mainRule.acceptOverwrite(t,i,r,o);return}for(let s=0,l=this._rulesWithParentScopes.length;s<l;s++){let a=this._rulesWithParentScopes[s];if(cs(a.parentScopes,n)===0){a.acceptOverwrite(t,i,r,o);return}}i===-1&&(i=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new xi(t,n,i,r,o))}},rt=class le{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=le.getLanguageId(t),i=le.getTokenType(t),r=le.getFontStyle(t),o=le.getForeground(t),s=le.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:r,foreground:o,background:s})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,i,r,o,s,l){let a=le.getLanguageId(t),d=le.getTokenType(t),u=le.containsBalancedBrackets(t)?1:0,c=le.getFontStyle(t),f=le.getForeground(t),h=le.getBackground(t);return n!==0&&(a=n),i!==8&&(d=i),r!==null&&(u=r?1:0),o!==-1&&(c=o),s!==0&&(f=s),l!==0&&(h=l),(a<<0|d<<8|u<<10|c<<11|f<<15|h<<24)>>>0}};function yn(e,t){const n=[],i=Rl(e);let r=i.next();for(;r!==null;){let a=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=i.next()}let d=s();if(n.push({matcher:d,priority:a}),r!==",")break;r=i.next()}return n;function o(){if(r==="-"){r=i.next();const a=o();return d=>!!a&&!a(d)}if(r==="("){r=i.next();const a=l();return r===")"&&(r=i.next()),a}if(Rr(r)){const a=[];do a.push(r),r=i.next();while(Rr(r));return d=>t(a,d)}return null}function s(){const a=[];let d=o();for(;d;)a.push(d),d=o();return u=>a.every(c=>c(u))}function l(){const a=[];let d=s();for(;d&&(a.push(d),r==="|"||r===",");){do r=i.next();while(r==="|"||r===",");d=s()}return u=>a.some(c=>c(u))}}function Rr(e){return!!e&&!!e.match(/[\w\.:]+/)}function Rl(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}function gs(e){typeof e.dispose=="function"&&e.dispose()}var Ot=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Tl=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Il=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Pl=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ot(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Il;for(const n of e)Dl(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Ot){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 Dl(e,t,n,i){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Ot?pn({baseGrammar:o,selfGrammar:r},i):Ri(e.ruleName,{baseGrammar:o,selfGrammar:r,repository:r.repository},i);const s=n.injections(e.scopeName);if(s)for(const l of s)i.add(new Ot(l))}function Ri(e,t,n){if(t.repository&&t.repository[e]){const i=t.repository[e];En([i],t,n)}}function pn(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&En(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&En(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function En(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const r=i.repository?ls({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&En(i.patterns,{...t,repository:r},n);const o=i.include;if(!o)continue;const s=_s(o);switch(s.kind){case 0:pn({...t,selfGrammar:t.baseGrammar},n);break;case 1:pn(t,n);break;case 2:Ri(s.ruleName,{...t,repository:r},n);break;case 3:case 4:const l=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(l){const a={baseGrammar:t.baseGrammar,selfGrammar:l,repository:r};s.kind===4?Ri(s.ruleName,a,n):pn(a,n)}else s.kind===4?n.add(new Tl(s.scopeName,s.ruleName)):n.add(new Ot(s.scopeName));break}}}var Ol=class{kind=0},Nl=class{kind=1},Ml=class{constructor(e){this.ruleName=e}kind=2},Hl=class{constructor(e){this.scopeName=e}kind=3},Fl=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function _s(e){if(e==="$base")return new Ol;if(e==="$self")return new Nl;const t=e.indexOf("#");if(t===-1)return new Hl(e);if(t===0)return new Ml(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new Fl(n,i)}}var Vl=/\\(\d+)/,Tr=/\\(\d+)/g,$l=-1,vs=-2;var Bt=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=jt.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=jt.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${ds(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:jt.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:jt.replaceCaptures(this._contentName,e,t)}},Ul=class extends Bt{retokenizeCapturedWithRuleId;constructor(e,t,n,i,r){super(e,t,n,i),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},Bl=class extends Bt{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,null),this._match=new Nt(i,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Mt,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ir=class extends Bt{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,i),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Mt,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ti=class extends Bt{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r,o,s,l,a,d){super(e,t,n,i),this._begin=new Nt(r,this.id),this.beginCaptures=o,this._end=new Nt(s||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=a||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.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(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Mt;for(const n of this.patterns)e.getRule(n).collectPatterns(e,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,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Sn=class extends Bt{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,r,o,s,l,a){super(e,t,n,i),this._begin=new Nt(r,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new Nt(s,vs),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.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(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Mt;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Mt,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},bs=class te{static createCaptureRule(t,n,i,r,o){return t.registerRule(s=>new Ul(n,s,i,r,o))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new Bl(t.$vscodeTextmateLocation,t.id,t.name,t.match,te._compileCaptures(t.captures,n,i));if(typeof t.begin>"u"){t.repository&&(i=ls({},i,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new Ir(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,te._compilePatterns(o,n,i))}return t.while?new Sn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,te._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,te._compileCaptures(t.whileCaptures||t.captures,n,i),te._compilePatterns(t.patterns,n,i)):new Ti(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,te._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,te._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,te._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let r=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);l>o&&(o=l)}for(let s=0;s<=o;s++)r[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);let a=0;t[s].patterns&&(a=te.getCompiledRuleId(t[s],n,i)),r[l]=te.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,a)}}return r}static _compilePatterns(t,n,i){let r=[];if(t)for(let o=0,s=t.length;o<s;o++){const l=t[o];let a=-1;if(l.include){const d=_s(l.include);switch(d.kind){case 0:case 1:a=te.getCompiledRuleId(i[l.include],n,i);break;case 2:let u=i[d.ruleName];u&&(a=te.getCompiledRuleId(u,n,i));break;case 3:case 4:const c=d.scopeName,f=d.kind===4?d.ruleName:null,h=n.getExternalGrammar(c,i);if(h)if(f){let m=h.repository[f];m&&(a=te.getCompiledRuleId(m,n,h.repository))}else a=te.getCompiledRuleId(h.repository.$self,n,h.repository);break}}else a=te.getCompiledRuleId(l,n,i);if(a!==-1){const d=n.getRule(a);let u=!1;if((d instanceof Ir||d instanceof Ti||d instanceof Sn)&&d.hasMissingPatterns&&d.patterns.length===0&&(u=!0),u)continue;r.push(a)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},Nt=class ys{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const i=t.length;let r=0,o=[],s=!1;for(let l=0;l<i;l++)if(t.charAt(l)==="\\"&&l+1<i){const d=t.charAt(l+1);d==="z"?(o.push(t.substring(r,l)),o.push("$(?!\\n)(?<!\\n)"),r=l+2):(d==="A"||d==="G")&&(s=!0),l++}this.hasAnchor=s,r===0?this.source=t:(o.push(t.substring(r,i)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Vl.test(this.source):this.hasBackReferences=!1}clone(){return new ys(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let i=n.map(r=>t.substring(r.start,r.end));return Tr.lastIndex=0,this.source.replace(Tr,(r,o)=>hs(i[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],i=[],r=[],o,s,l,a;for(o=0,s=this.source.length;o<s;o++)l=this.source.charAt(o),t[o]=l,n[o]=l,i[o]=l,r[o]=l,l==="\\"&&o+1<s&&(a=this.source.charAt(o+1),a==="A"?(t[o+1]="",n[o+1]="",i[o+1]="A",r[o+1]="A"):a==="G"?(t[o+1]="",n[o+1]="G",i[o+1]="",r[o+1]="G"):(t[o+1]=a,n[o+1]=a,i[o+1]=a,r[o+1]=a),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:i.join(""),A1_G1:r.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Mt=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(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new Pr(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let i=this._items.map(r=>r.resolveAnchors(t,n));return new Pr(e,i,this._items.map(r=>r.ruleId))}},Pr=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
3
|
+
`)}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},Yn=class{constructor(e,t){this.languageId=e,this.tokenType=t}},zl=class Ii{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Yn(t,8),this._embeddedLanguagesMatcher=new Gl(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Ii._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Yn(0,0);_getBasicScopeAttributes=new fs(t=>{const n=this._scopeToLanguage(t),i=this._toStandardTokenType(t);return new Yn(n,i)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Ii.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/},Gl=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,i])=>hs(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Dr=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Es(e,t,n,i,r,o,s,l){const a=t.content.length;let d=!1,u=-1;if(s){const h=jl(e,t,n,i,r,o);r=h.stack,i=h.linePos,n=h.isFirstLine,u=h.anchorPosition}const c=Date.now();for(;!d;){if(l!==0&&Date.now()-c>l)return new Dr(r,!0);f()}return new Dr(r,!1);function f(){const h=Wl(e,t,n,i,r,u);if(!h){o.produce(r,a),d=!0;return}const m=h.captureIndices,g=h.matchedRuleId,b=m&&m.length>0?m[0].end>i:!1;if(g===$l){const _=r.getRule(e);o.produce(r,m[0].start),r=r.withContentNameScopesList(r.nameScopesList),At(e,t,n,r,o,_.endCaptures,m),o.produce(r,m[0].end);const v=r;if(r=r.parent,u=v.getAnchorPos(),!b&&v.getEnterPos()===i){r=v,o.produce(r,a),d=!0;return}}else{const _=e.getRule(g);o.produce(r,m[0].start);const v=r,y=_.getName(t.content,m),S=r.contentNameScopesList.pushAttributed(y,e);if(r=r.push(g,i,u,m[0].end===a,null,S,S),_ instanceof Ti){const E=_;At(e,t,n,r,o,E.beginCaptures,m),o.produce(r,m[0].end),u=m[0].end;const C=E.getContentName(t.content,m),L=S.pushAttributed(C,e);if(r=r.withContentNameScopesList(L),E.endHasBackReferences&&(r=r.withEndRule(E.getEndWithResolvedBackReferences(t.content,m))),!b&&v.hasSameRuleAs(r)){r=r.pop(),o.produce(r,a),d=!0;return}}else if(_ instanceof Sn){const E=_;At(e,t,n,r,o,E.beginCaptures,m),o.produce(r,m[0].end),u=m[0].end;const C=E.getContentName(t.content,m),L=S.pushAttributed(C,e);if(r=r.withContentNameScopesList(L),E.whileHasBackReferences&&(r=r.withEndRule(E.getWhileWithResolvedBackReferences(t.content,m))),!b&&v.hasSameRuleAs(r)){r=r.pop(),o.produce(r,a),d=!0;return}}else if(At(e,t,n,r,o,_.captures,m),o.produce(r,m[0].end),r=r.pop(),!b){r=r.safePop(),o.produce(r,a),d=!0;return}}m[0].end>i&&(i=m[0].end,n=!1)}}function jl(e,t,n,i,r,o){let s=r.beginRuleCapturedEOL?0:-1;const l=[];for(let a=r;a;a=a.pop()){const d=a.getRule(e);d instanceof Sn&&l.push({rule:d,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:d,findOptions:u}=Xl(a.rule,e,a.stack.endRule,n,i===s),c=d.findNextMatchSync(t,i,u);if(c){if(c.ruleId!==vs){r=a.stack.pop();break}c.captureIndices&&c.captureIndices.length&&(o.produce(a.stack,c.captureIndices[0].start),At(e,t,n,a.stack,o,a.rule.whileCaptures,c.captureIndices),o.produce(a.stack,c.captureIndices[0].end),s=c.captureIndices[0].end,c.captureIndices[0].end>i&&(i=c.captureIndices[0].end,n=!1))}else{r=a.stack.pop();break}}return{stack:r,linePos:i,anchorPosition:s,isFirstLine:n}}function Wl(e,t,n,i,r,o){const s=ql(e,t,n,i,r,o),l=e.getInjections();if(l.length===0)return s;const a=Kl(l,e,t,n,i,r,o);if(!a)return s;if(!s)return a;const d=s.captureIndices[0].start,u=a.captureIndices[0].start;return u<d||a.priorityMatch&&u===d?a:s}function ql(e,t,n,i,r,o){const s=r.getRule(e),{ruleScanner:l,findOptions:a}=Ss(s,e,r.endRule,n,i===o),d=l.findNextMatchSync(t,i,a);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function Kl(e,t,n,i,r,o,s){let l=Number.MAX_VALUE,a=null,d,u=0;const c=o.contentNameScopesList.getScopeNames();for(let f=0,h=e.length;f<h;f++){const m=e[f];if(!m.matcher(c))continue;const g=t.getRule(m.ruleId),{ruleScanner:b,findOptions:_}=Ss(g,t,null,i,r===s),v=b.findNextMatchSync(n,r,_);if(!v)continue;const y=v.captureIndices[0].start;if(!(y>=l)&&(l=y,a=v.captureIndices,d=v.ruleId,u=m.priority,l===r))break}return a?{priorityMatch:u===-1,captureIndices:a,matchedRuleId:d}:null}function Ss(e,t,n,i,r){return{ruleScanner:e.compileAG(t,n,i,r),findOptions:0}}function Xl(e,t,n,i,r){return{ruleScanner:e.compileWhileAG(t,n,i,r),findOptions:0}}function At(e,t,n,i,r,o,s){if(o.length===0)return;const l=t.content,a=Math.min(o.length,s.length),d=[],u=s[0].end;for(let c=0;c<a;c++){const f=o[c];if(f===null)continue;const h=s[c];if(h.length===0)continue;if(h.start>u)break;for(;d.length>0&&d[d.length-1].endPos<=h.start;)r.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?r.produceFromScopes(d[d.length-1].scopes,h.start):r.produce(i,h.start),f.retokenizeCapturedWithRuleId){const g=f.getName(l,s),b=i.contentNameScopesList.pushAttributed(g,e),_=f.getContentName(l,s),v=b.pushAttributed(_,e),y=i.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,b,v),S=e.createOnigString(l.substring(0,h.end));Es(e,S,n&&h.start===0,h.start,y,r,!1,0),gs(S);continue}const m=f.getName(l,s);if(m!==null){const b=(d.length>0?d[d.length-1].scopes:i.contentNameScopesList).pushAttributed(m,e);d.push(new Ql(b,h.end))}}for(;d.length>0;)r.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var Ql=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Jl(e,t,n,i,r,o,s,l){return new Zl(e,t,n,i,r,o,s,l)}function Or(e,t,n,i,r){const o=yn(t,Cn),s=bs.getCompiledRuleId(n,i,r.repository);for(const l of o)e.push({debugSelector:t,matcher:l.matcher,ruleId:s,grammar:r,priority:l.priority})}function Cn(e,t){if(t.length<e.length)return!1;let n=0;return e.every(i=>{for(let r=n;r<t.length;r++)if(Yl(t[r],i))return n=r+1,!0;return!1})}function Yl(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Zl=class{constructor(e,t,n,i,r,o,s,l){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=l,this._basicScopeAttributesProvider=new zl(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=Nr(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const a of Object.keys(r)){const d=yn(a,Cn);for(const u of d)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[a]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},t=[],n=this._rootScopeName,i=e.lookup(n);if(i){const r=i.injections;if(r)for(let s in r)Or(t,s,r[s],this,i);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const l=this.getExternalGrammar(s);if(l){const a=l.injectionSelector;a&&Or(t,a,l,this,l)}})}return t.sort((r,o)=>r.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Nr(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){const i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){this._rootId===-1&&(this._rootId=bs.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!t||t===Pi.NULL){r=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),c=rt.set(0,d.languageId,d.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null);let h;f?h=Pt.createRootAndLookUpScopeName(f,c,this):h=Pt.createRoot("unknown",c),t=new Pi(null,this._rootId,-1,-1,!1,null,h,h)}else r=!1,t.reset();e=e+`
|
|
4
|
+
`;const o=this.createOnigString(e),s=o.content.length,l=new td(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Es(this,o,r,0,t,l,!0,i);return gs(o),{lineLength:s,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function Nr(e,t){return e=vl(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Pt=class ye{constructor(t,n,i){this.parent=t,this.scopePath=n,this.tokenAttributes=i}static fromExtension(t,n){let i=t,r=t?.scopePath??null;for(const o of n)r=Jn.push(r,o.scopeNames),i=new ye(i,r,o.encodedTokenAttributes);return i}static createRoot(t,n){return new ye(null,new Jn(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const r=i.getMetadataForScope(t),o=new Jn(null,t),s=i.themeProvider.themeMatch(o),l=ye.mergeAttributes(n,r,s);return new ye(null,o,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return ye.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,i){let r=-1,o=0,s=0;return i!==null&&(r=i.fontStyle,o=i.foregroundId,s=i.backgroundId),rt.set(t,n.languageId,n.tokenType,null,r,o,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return ye._pushAttributed(this,t,n);const i=t.split(/ /g);let r=this;for(const o of i)r=ye._pushAttributed(r,o,n);return r}static _pushAttributed(t,n,i){const r=i.getMetadataForScope(n),o=t.scopePath.push(n),s=i.themeProvider.themeMatch(o),l=ye.mergeAttributes(t.tokenAttributes,r,s);return new ye(t,o,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push({encodedTokenAttributes:i.tokenAttributes,scopeNames:i.scopePath.getExtensionIfDefined(i.parent?.scopePath??null)}),i=i.parent;return i===t?n.reverse():void 0}},Pi=class Ye{constructor(t,n,i,r,o,s,l,a){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=i,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new Ye(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Ye._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Pt.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Ye._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,r,o,s,l){return new Ye(this,t,n,i,r,o,s,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Ye(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.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(t,n){const i=Pt.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Ye(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,Pt.fromExtension(i,n.contentNameScopesList))}},ed=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):yn(n,Cn).map(i=>i.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>yn(n,Cn).map(i=>i.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},td=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(i=rt.set(i,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(o))}if(r&&(i=rt.set(i,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let i=0,r=this._binaryTokens.length;i<r;i++)n[i]=this._binaryTokens[i];return n}},nd=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,r){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,Jl(e,o,t,n,i,r,this,this._onigLib))}return this._grammars.get(e)}},id=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new nd(bn.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(bn.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,i){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:i})}loadGrammarWithConfiguration(t,n,i){return this._loadGrammar(t,n,i.embeddedLanguages,i.tokenTypes,new ed(i.balancedBracketSelectors||[],i.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,i,r,o){const s=new Pl(this._syncRegistry,t);for(;s.Q.length>0;)s.Q.map(l=>this._loadSingleGrammar(l.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,i,r,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const i=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,i)}}addGrammar(t,n=[],i=0,r=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,i,r)}_grammarForScopeName(t,n=0,i=null,r=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,i,r,o)}},Di=Pi.NULL;const rd=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],od=/["&'<>`]/g,sd=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ad=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ld=/[|\\{}()[\]^$+*?.]/g,Mr=new WeakMap;function dd(e,t){if(e=e.replace(t.subset?ud(t.subset):od,i),t.subset||t.escapeOnly)return e;return e.replace(sd,n).replace(ad,i);function n(r,o,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function i(r,o,s){return t.format(r.charCodeAt(0),s.charCodeAt(o+1),t)}}function ud(e){let t=Mr.get(e);return t||(t=cd(e),Mr.set(e,t)),t}function cd(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(ld,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const hd=/[\dA-Fa-f]/;function fd(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!hd.test(String.fromCharCode(t))?i:i+";"}const pd=/\d/;function md(e,t,n){const i="&#"+String(e);return n&&t&&!pd.test(String.fromCharCode(t))?i:i+";"}const gd=["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"],Zn={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:"€"},_d=["cent","copy","divide","gt","lt","not","para","times"],Cs={}.hasOwnProperty,Oi={};let Wt;for(Wt in Zn)Cs.call(Zn,Wt)&&(Oi[Zn[Wt]]=Wt);const vd=/[^\dA-Za-z]/;function bd(e,t,n,i){const r=String.fromCharCode(e);if(Cs.call(Oi,r)){const o=Oi[r],s="&"+o;return n&&gd.includes(o)&&!_d.includes(o)&&(!i||t&&t!==61&&vd.test(String.fromCharCode(t)))?s:s+";"}return""}function yd(e,t,n){let i=fd(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=bd(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const o=md(e,t,n.omitOptionalSemicolons);o.length<i.length&&(i=o)}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function _t(e,t){return dd(e,Object.assign({format:yd},t))}const Ed=/^>|^->|<!--|-->|--!>|<!-$/g,Sd=[">"],Cd=["<",">"];function Ld(e,t,n,i){return i.settings.bogusComments?"<?"+_t(e.value,Object.assign({},i.settings.characterReferences,{subset:Sd}))+">":"<!--"+e.value.replace(Ed,r)+"-->";function r(o){return _t(o,Object.assign({},i.settings.characterReferences,{subset:Cd}))}}function wd(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}const J=ws(1),Ls=ws(-1),kd=[];function ws(e){return t;function t(n,i,r){const o=n?n.children:kd;let s=(i||0)+e,l=o[s];if(!r)for(;l&&ur(l);)s+=e,l=o[s];return l}}const xd={}.hasOwnProperty;function ks(e){return t;function t(n,i,r){return xd.call(e,n.tagName)&&e[n.tagName](n,i,r)}}const hr=ks({body:Rd,caption:ei,colgroup:ei,dd:Dd,dt:Pd,head:ei,html:Ad,li:Id,optgroup:Od,option:Nd,p:Td,rp:Hr,rt:Hr,tbody:Hd,td:Fr,tfoot:Fd,th:Fr,thead:Md,tr:Vd});function ei(e,t,n){const i=J(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&ur(i.value.charAt(0)))}function Ad(e,t,n){const i=J(n,t);return!i||i.type!=="comment"}function Rd(e,t,n){const i=J(n,t);return!i||i.type!=="comment"}function Td(e,t,n){const i=J(n,t);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.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 Id(e,t,n){const i=J(n,t);return!i||i.type==="element"&&i.tagName==="li"}function Pd(e,t,n){const i=J(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function Dd(e,t,n){const i=J(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function Hr(e,t,n){const i=J(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function Od(e,t,n){const i=J(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function Nd(e,t,n){const i=J(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function Md(e,t,n){const i=J(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function Hd(e,t,n){const i=J(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function Fd(e,t,n){return!J(n,t)}function Vd(e,t,n){const i=J(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function Fr(e,t,n){const i=J(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const $d=ks({body:zd,colgroup:Gd,head:Bd,html:Ud,tbody:jd});function Ud(e){const t=J(e,-1);return!t||t.type!=="comment"}function Bd(e){const t=new Set;for(const i of e.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(t.has(i.tagName))return!1;t.add(i.tagName)}const n=e.children[0];return!n||n.type==="element"}function zd(e){const t=J(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&ur(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Gd(e,t,n){const i=Ls(n,t),r=J(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&hr(i,n.children.indexOf(i),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function jd(e,t,n){const i=Ls(n,t),r=J(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&hr(i,n.children.indexOf(i),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const qt={name:[[`
|
|
5
|
+
\f\r &/=>`.split(""),`
|
|
6
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
7
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
8
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
9
|
+
\f\r &>`.split(""),`\0
|
|
10
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
11
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
12
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Wd(e,t,n,i){const r=i.schema,o=r.space==="svg"?!1:i.settings.omitOptionalTags;let s=r.space==="svg"?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase());const l=[];let a;r.space==="html"&&e.tagName==="svg"&&(i.schema=as);const d=qd(i,e.properties),u=i.all(r.space==="html"&&e.tagName==="template"?e.content:e);return i.schema=r,u&&(s=!1),(d||!o||!$d(e,t,n))&&(l.push("<",e.tagName,d?" "+d:""),s&&(r.space==="svg"||i.settings.closeSelfClosing)&&(a=d.charAt(d.length-1),(!i.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(u),!s&&(!o||!hr(e,t,n))&&l.push("</"+e.tagName+">"),l.join("")}function qd(e,t){const n=[];let i=-1,r;if(t){for(r in t)if(t[r]!==null&&t[r]!==void 0){const o=Kd(e,r,t[r]);o&&n.push(o)}}for(;++i<n.length;){const o=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&o!=='"'&&o!=="'"&&(n[i]+=" ")}return n.join("")}function Kd(e,t,n){const i=cl(e.schema,t),r=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,o=e.settings.allowDangerousCharacters?0:1;let s=e.quote,l;if(i.overloadedBoolean&&(n===i.attribute||n==="")?n=!0:(i.boolean||i.overloadedBoolean)&&(typeof n!="string"||n===i.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const a=_t(i.attribute,Object.assign({},e.settings.characterReferences,{subset:qt.name[r][o]}));return n===!0||(n=Array.isArray(n)?(i.commaSeparated?hl:fl)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?a:(e.settings.preferUnquoted&&(l=_t(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:qt.unquoted[r][o]}))),l!==n&&(e.settings.quoteSmart&&xr(n,s)>xr(n,e.alternative)&&(s=e.alternative),l=s+_t(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?qt.single:qt.double)[r][o],attribute:!0}))+s),a+(l&&"="+l))}const Xd=["<","&"];function xs(e,t,n,i){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:_t(e.value,Object.assign({},i.settings.characterReferences,{subset:Xd}))}function Qd(e,t,n,i){return i.settings.allowDangerousHtml?e.value:xs(e,t,n,i)}function Jd(e,t,n,i){return i.all(e)}const Yd=pl("type",{invalid:Zd,unknown:eu,handlers:{comment:Ld,doctype:wd,element:Wd,raw:Qd,root:Jd,text:xs}});function Zd(e){throw new Error("Expected node, not `"+e+"`")}function eu(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const tu={},nu={},iu=[];function Oe(e,t){const n=t||tu,i=n.quote||'"',r=i==='"'?"'":'"';if(i!=='"'&&i!=="'")throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:ru,all:ou,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||rd,characterReferences:n.characterReferences||nu,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?as:ml,quote:i,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ru(e,t,n){return Yd(e,t,n,this)}function ou(e){const t=[],n=e&&e.children||iu;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}const ue=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function fr(e,t,n,i){const r=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let s=0,l="";for(const a of e.matchAll(r)){const{0:d,groups:{$skip:u}}=a;if(!u&&(!i||i===ue.DEFAULT==!s)){n instanceof Function?l+=n(a,{context:s?ue.CHAR_CLASS:ue.DEFAULT,negated:o[o.length-1]}):l+=n;continue}d[0]==="["?(s++,o.push(d[1]==="^")):d==="]"&&s&&(s--,o.pop()),l+=d}return l}function As(e,t,n,i){fr(e,t,n,i)}function su(e,t,n=0,i){if(!new RegExp(t,"su").test(e))return null;const r=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let o=0,s;for(;s=r.exec(e);){const{0:l,groups:{$skip:a}}=s;if(!a&&(!i||i===ue.DEFAULT==!o))return s;l==="["?o++:l==="]"&&o&&o--,r.lastIndex==s.index&&r.lastIndex++}return null}function Kt(e,t,n){return!!su(e,t,0,n)}function au(e,t){const n=/\\?./gsu;n.lastIndex=t;let i=e.length,r=0,o=1,s;for(;s=n.exec(e);){const[l]=s;if(l==="[")r++;else if(r)l==="]"&&r--;else if(l==="(")o++;else if(l===")"&&(o--,!o)){i=s.index;break}}return e.slice(t,i)}function Xt(e){const t=q.useRef(e);return q.useInsertionEffect(()=>{t.current=e}),q.useCallback((...n)=>t.current(...n),[])}const lu=q.createContext(void 0);function du(){return q.useContext(lu)}const uu={position:"absolute",top:0,bottom:0,textAlign:"center",whiteSpace:"normal",touchAction:"none"},cu={display:"contents"};function Vr(){return null}const pr="diffs-container";(()=>{try{return!1}catch{return!1}})();const hu=/(?=^From [a-f0-9]+ .+$)/m,Rs=/(?=^diff --git)/gm,fu=new RegExp("(?<=\\n)"),pu=/^(---|\+\+\+)\s+([^\t\r\n]+)/,mu=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Ts="header-prefix",Is="header-filename-suffix",Ps="header-metadata",mr="header-custom",Ce={dark:"pierre-dark",light:"pierre-light"},gu="data-theme-css",_u="data-unsafe-css",vu="data-diffs-scrollbar-measure",Ds="--diffs-scrollbar-gutter-measured",bu=1e5,yu={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},Eu=Object.freeze({fromStart:0,fromEnd:0}),$r={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Su={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function tt(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function Cu({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function ce(e,t){return e-(t===0?0:1)}function oe(e,t){return ce(e,t)+t}function Lu(e,t){const n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:wu(n,e.startContentIndex)}}function wu(e,t){let n=e.unifiedLineStart;for(let i=0;i<t;i++){const r=e.hunkContent[i];n+=r.type==="context"?r.lines:r.deletions+r.additions}return n}function Os({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:i,renderHeaderFilenameSuffix:r,renderHeaderMetadata:o,renderAnnotation:s,renderGutterUtility:l,renderMergeConflictUtility:a,lineAnnotations:d,getHoveredLine:u,getInstance:c,getAnnotationSlotName:f=tt}){const h=n?.(e),m=i?.(e),g=r?.(e),b=o?.(e);return U.jsxs(U.Fragment,{children:[h!=null?U.jsx("div",{slot:mr,children:h}):U.jsxs(U.Fragment,{children:[m!=null&&U.jsx("div",{slot:"header-prefix",children:m}),g!=null&&U.jsx("div",{slot:"header-filename-suffix",children:g}),b!=null&&U.jsx("div",{slot:"header-metadata",children:b})]}),s!=null&&d?.map((_,v)=>U.jsx("div",{slot:f(_),children:s(_)},v)),t!=null&&a!=null&&c!=null&&t.map(_=>{if(_==null)return;const v=ku(_,e);return U.jsx("div",{slot:v,style:cu,children:a(_,c)},v)}),l!=null&&U.jsx("div",{slot:"gutter-utility-slot",style:uu,children:l(u)})]})}function ku(e,t){const n=Lu(e,t);return n!=null?Cu({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex}):void 0}const Ht=new Map,ti=new Map,xu=new Map,Ni=new Set;function Mi(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!Ni.has(t))return!1;return!0}function gr(e=Ce){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}const Hi=new Set;function Ft(e){const t=[],n=new Set;for(const c of Au(e.themes)){const f=Ns(c)?c.getThemes():[c];for(const h of f){if(n.has(h.name))throw new Error(`Theme collection already contains theme "${h.name}"`);n.add(h.name),t.push(h)}}const i=Object.freeze([...t]),r=Object.freeze(i.filter(c=>c.colorScheme==="light")),o=Object.freeze(i.filter(c=>c.colorScheme==="dark")),s=new Map(i.map(c=>[c.name,c])),l=Object.freeze(i.map(c=>c.name)),a=Object.freeze(r.map(c=>c.name)),d=Object.freeze(o.map(c=>c.name));function u(c){if(c==null)return i;const{colorScheme:f,collection:h}=c;return h==null?f==="light"?r:f==="dark"?o:i:i.filter(m=>m.collection!==h?!1:f==null||m.colorScheme===f)}return{getTheme(c){return s.get(c)},getThemes(c){return u(c)},getThemeNames(c){return c?.collection==null?c?.colorScheme==="light"?a:c?.colorScheme==="dark"?d:l:u(c).map(f=>f.name)},hasTheme(c){return s.has(c)},orderBy(c){return Ft({themes:i.map((f,h)=>({descriptor:f,index:h})).sort((f,h)=>{const m=c(f.descriptor,h.descriptor);return m!==0?m:f.index-h.index}).map(f=>f.descriptor)})},pick(c){const f=[],h=new Set;for(const m of c){if(h.has(m))throw new Error(`Theme collection pick already includes theme "${m}"`);h.add(m);const g=s.get(m);if(g==null)throw new Error(`Theme collection does not contain theme "${m}"`);f.push(g)}return Ft({themes:f})},registerInto(c){for(const f of i)c.registerThemeIfAbsent(f.name,f.load)}}}function Au(e){return Ru(e)?[e]:e}function Ru(e){return Ns(e)||Tu(e)}function Tu(e){return typeof e.name=="string"&&typeof e.load=="function"}function Ns(e){return typeof e.getThemes=="function"}function Ms(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Iu=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},Pu=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},Du=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Ou(){const e=new Map,t=new Map,n=new Map;let i=0;function r(_,v){if(e.has(_))throw new Iu(_);e.set(_,v)}function o(_,v){return e.has(_)?!1:(e.set(_,v),!0)}function s(_){return e.has(_)}function l(_){const v=t.get(_);if(v!==void 0)return Promise.resolve(v);const y=n.get(_);if(y!==void 0)return y;const S=e.get(_);if(S===void 0)return Promise.reject(new Pu(_));const E=i,C=S().then(L=>{const x=Ms(L);return E===i&&t.set(_,x),n.get(_)===C&&n.delete(_),x}).catch(L=>{throw n.get(_)===C&&n.delete(_),L});return n.set(_,C),C}function a(_){return Promise.all(_.map(v=>l(v)))}function d(_,v){t.set(_,v)}function u(_){for(const[v,y]of _)d(v,y)}function c(_){return t.get(_)}function f(_){const v=[];for(const y of _){const S=t.get(y);if(S===void 0)throw new Du(y);v.push(S)}return v}function h(_){return t.has(_)}function m(_){for(const v of _)if(!t.has(v))return!1;return!0}function g(_){const v=t.get(_);return v!==void 0?v:l(_)}function b(){i++,t.clear(),n.clear()}return{clearResolvedThemes:b,getResolvedOrResolveTheme:g,getResolvedTheme:c,getResolvedThemes:f,hasRegisteredTheme:s,hasResolvedTheme:h,hasResolvedThemes:m,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:u}}const We=Ou();function Ur(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=We.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,We.getResolvedTheme(n)==null&&We.seedResolvedTheme(n,i);Hi.has(n)||(Hi.add(n),t.loadThemeSync(i))}}function Br(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(Ni.has(n.name))continue;let i=Ht.get(n.name);i==null&&(i=n,Ht.set(n.name,i));const r=i.data.find(o=>o.name===i.name||o.aliases?.includes(i.name)===!0);if(r==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${i.name}" as its name or an alias.`);t.loadLanguageSync(i.data);try{t.getLanguage(i.name)}catch{throw new Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${i.name}". Load the alias first or give the grammar a unique name.`)}Ni.add(i.name)}}function Hs(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var Fi=Object.defineProperty,Nu=Object.getOwnPropertyDescriptor,Mu=Object.getOwnPropertyNames,Hu=Object.prototype.hasOwnProperty,Fu=(e,t)=>{let n={};for(var i in e)Fi(n,i,{get:e[i],enumerable:!0});return Fi(n,Symbol.toStringTag,{value:"Module"}),n},Vu=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var r=Mu(t),o=0,s=r.length,l;o<s;o++)l=r[o],!Hu.call(e,l)&&l!==n&&Fi(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(i=Nu(t,l))||i.enumerable});return e},$u=(e,t,n)=>(Vu(e,t,"default"),n);const Fs=[{id:"abap",name:"ABAP",import:(()=>p(()=>import("./abap-BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>p(()=>import("./actionscript-3-B3316cI-.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>p(()=>import("./ada-bCR0ucgS.js"),[],import.meta.url))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>p(()=>import("./ahk-CsyLZFj1.js"),[],import.meta.url))},{id:"ahk2",name:"AutoHotkey2",import:(()=>p(()=>import("./ahk2-8Zs4aa1G.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>p(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>p(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>p(()=>import("./apache-Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>p(()=>import("./apex-DhZFqWV2.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>p(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>p(()=>import("./applescript-Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>p(()=>import("./ara-BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>p(()=>import("./asciidoc-CSVQ5wI8.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>p(()=>import("./asm-D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>p(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>p(()=>import("./awk-DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>p(()=>import("./ballerina-BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>p(()=>import("./bat-CickPsom.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>p(()=>import("./beancount-k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>p(()=>import("./berry-uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>p(()=>import("./bibtex-CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>p(()=>import("./bicep-Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>p(()=>import("./bird2-Bx8U0n9b.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>p(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]),import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>p(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>p(()=>import("./c-BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>p(()=>import("./c3-Dp5svz6Z.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>p(()=>import("./cadence-Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>p(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>p(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>p(()=>import("./clarity-Dn5IMItf.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>p(()=>import("./clojure-P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>p(()=>import("./cmake-D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>p(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>p(()=>import("./codeowners-Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>p(()=>import("./codeql-DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>p(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>p(()=>import("./common-lisp-Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Rocq",import:(()=>p(()=>import("./coq-C7JzOVbR.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>p(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>p(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>p(()=>import("./csharp-DSvCPggb.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>p(()=>import("./css-CLj8gQPS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>p(()=>import("./csv-fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>p(()=>import("./cue-D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>p(()=>import("./cypher-COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>p(()=>import("./d-85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>p(()=>import("./dart-bE4Kk8sk.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>p(()=>import("./dax-CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>p(()=>import("./desktop-BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>p(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>p(()=>import("./docker-BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>p(()=>import("./dotenv-Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>p(()=>import("./dream-maker-BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>p(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>p(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>p(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>p(()=>import("./emacs-lisp-C_m_b--Z.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>p(()=>import("./erb-DXfck5VN.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>p(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>p(()=>import("./fennel-BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>p(()=>import("./fish-BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>p(()=>import("./fluent-C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>p(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([42,43]),import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>p(()=>import("./fortran-free-form-BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>p(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>p(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>p(()=>import("./gdscript-DqcFQ5yU.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>p(()=>import("./gdshader-DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>p(()=>import("./genie-D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>p(()=>import("./gherkin-DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>p(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>p(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>p(()=>import("./gleam-BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>p(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>p(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>p(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22]),import.meta.url))},{id:"gn",name:"GN",import:(()=>p(()=>import("./gn-n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>p(()=>import("./gnuplot-DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>p(()=>import("./go-C27-OAKa.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>p(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>p(()=>import("./groovy-gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>p(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>p(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>p(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>p(()=>import("./haskell-Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>p(()=>import("./haxe-CfZj7gIn.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>p(()=>import("./hcl-BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>p(()=>import("./hjson-D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>p(()=>import("./hlsl-D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>p(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>p(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>p(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>p(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>p(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>p(()=>import("./hy-DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>p(()=>import("./imba-DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>p(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>p(()=>import("./java-CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>p(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>p(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>p(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>p(()=>import("./json-Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>p(()=>import("./json5-C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>p(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>p(()=>import("./jsonl-DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>p(()=>import("./jsonnet-DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>p(()=>import("./jssm-C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>p(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>p(()=>import("./julia-5Bft2YPA.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16]),import.meta.url))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>p(()=>import("./just-Cwhn7H3k.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39]),import.meta.url))},{id:"kdl",name:"KDL",import:(()=>p(()=>import("./kdl-DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>p(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>p(()=>import("./kusto-wEQ09or8.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>p(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>p(()=>import("./lean-BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>p(()=>import("./less-B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>p(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>p(()=>import("./llvm-BZoOZj88.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>p(()=>import("./log-2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>p(()=>import("./logo-BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>p(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>p(()=>import("./luau-BnpPk5vE.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>p(()=>import("./make-CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>p(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>p(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>p(()=>import("./matlab-D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>p(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>p(()=>import("./mdx-Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>p(()=>import("./mermaid-CQcHuHx7.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>p(()=>import("./mipsasm-CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>p(()=>import("./mojo-DJz3ZmWd.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>p(()=>import("./moonbit-CHtswR0a.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>p(()=>import("./move-el3G9tDJ.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>p(()=>import("./narrat-DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>p(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73]),import.meta.url))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>p(()=>import("./nextflow-groovy-vE_lwT2v.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>p(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>p(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>p(()=>import("./nix-CwoSXNpI.js"),[],import.meta.url))},{id:"nsis",name:"NSIS",import:(()=>p(()=>import("./nsis-BlV79W_Q.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>p(()=>import("./nushell-D3jzshHO.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>p(()=>import("./objective-c-DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>p(()=>import("./objective-cpp-CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>p(()=>import("./ocaml-C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>p(()=>import("./odin-BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>p(()=>import("./openscad-C4EeE6gA.js"),[],import.meta.url))},{id:"org",name:"Org Markup",import:(()=>p(()=>import("./org-DM6o9KBp.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67]),import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>p(()=>import("./pascal-D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>p(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>p(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>p(()=>import("./pkl-u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>p(()=>import("./plsql-ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>p(()=>import("./po-BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>p(()=>import("./polar-C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>p(()=>import("./postcss-CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>p(()=>import("./powerquery-CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>p(()=>import("./powershell-BmBUJMz7.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>p(()=>import("./prisma-Vru482bI.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>p(()=>import("./prolog-CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>p(()=>import("./proto-C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>p(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>p(()=>import("./puppet-BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>p(()=>import("./purescript-CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>p(()=>import("./python-B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>p(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>p(()=>import("./qmldir-C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>p(()=>import("./qss-IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>p(()=>import("./r-Cf5RLm7j.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>p(()=>import("./racket-BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>p(()=>import("./raku-DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>p(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89]),import.meta.url))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>p(()=>import("./rbs-CpoqiR4B.js"),[],import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>p(()=>import("./reg-C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>p(()=>import("./regexp-CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>p(()=>import("./rel-C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>p(()=>import("./riscv-BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>p(()=>import("./ron-D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>p(()=>import("./rosmsg-BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>p(()=>import("./rst-bs7f0vWN.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38]),import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>p(()=>import("./ruby-C0TQ7zu5.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>p(()=>import("./rust-B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>p(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>p(()=>import("./sass-Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>p(()=>import("./scala-CqE71os6.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>p(()=>import("./scheme-C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>p(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>p(()=>import("./sdbl-DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>p(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>p(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>p(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29]),import.meta.url))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>p(()=>import("./smalltalk-BOQMe2GC.js"),[],import.meta.url))},{id:"smithy",name:"Smithy",import:(()=>p(()=>import("./smithy-cds9vsN8.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>p(()=>import("./solidity-DijEV5ha.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>p(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>p(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>p(()=>import("./splunk-BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>p(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>p(()=>import("./ssh-config-_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>p(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>p(()=>import("./stylus-BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>p(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>p(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>p(()=>import("./swift-C2oV4EkX.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>p(()=>import("./system-verilog-0hqHdDBg.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>p(()=>import("./systemd-4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>p(()=>import("./talonscript-CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>p(()=>import("./tasl-QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>p(()=>import("./tcl-dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>p(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>p(()=>import("./terraform-BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>p(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>p(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>p(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8]),import.meta.url))},{id:"tsv",name:"TSV",import:(()=>p(()=>import("./tsv-B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>p(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>p(()=>import("./turtle-BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>p(()=>import("./twig-27uCiNez.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>p(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>p(()=>import("./typespec-CAFt9gP4.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>p(()=>import("./typst-BUadGCkm.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80]),import.meta.url))},{id:"v",name:"V",import:(()=>p(()=>import("./v-BGw2Nkan.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>p(()=>import("./vala-CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",import:(()=>p(()=>import("./vb-Cu-pLBUe.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>p(()=>import("./verilog-nZwndyjY.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>p(()=>import("./vhdl-CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>p(()=>import("./viml-CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>p(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>p(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>p(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>p(()=>import("./vyper-CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>p(()=>import("./wasm-MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>p(()=>import("./wenyan-BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>p(()=>import("./wgsl-Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>p(()=>import("./wikitext-BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>p(()=>import("./wit-5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>p(()=>import("./wolfram-lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>p(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>p(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>p(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>p(()=>import("./zenscript-DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>p(()=>import("./zig-VOosw3JB.js"),[],import.meta.url))}],Uu=Object.fromEntries(Fs.map(e=>[e.id,e.import])),Bu=Object.fromEntries(Fs.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Vi={...Uu,...Bu},zu=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>p(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>p(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>p(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>p(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>p(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>p(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>p(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>p(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>p(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>p(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>p(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>p(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>p(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>p(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>p(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>p(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>p(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>p(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>p(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>p(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>p(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>p(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>p(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>p(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>p(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>p(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>p(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>p(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>p(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>p(()=>import("./houston-DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>p(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>p(()=>import("./kanagawa-lotus-C3DzagqV.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>p(()=>import("./kanagawa-wave-DFGoQZhC.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>p(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>p(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>p(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>p(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>p(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>p(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>p(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>p(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>p(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>p(()=>import("./monokai-BRVnQi9A.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>p(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>p(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>p(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>p(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>p(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>p(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>p(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>p(()=>import("./red-hvxz__6c.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>p(()=>import("./rose-pine-5qJOZa0Y.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>p(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>p(()=>import("./rose-pine-moon-C9pEdX9L.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>p(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>p(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>p(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>p(()=>import("./solarized-dark-CpvCGNkr.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>p(()=>import("./solarized-light-Dlz6yCKv.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>p(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>p(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>p(()=>import("./vesper-DRje8inN.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>p(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>p(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>p(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url))}],Gu=Object.fromEntries(zu.map(e=>[e.id,e.import]));var _r=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function ju(){return 2147483648}function Wu(){return typeof performance<"u"?performance.now():Date.now()}const qu=(e,t)=>e+(t-e%t)%t;async function Ku(e){let t,n;const i={};function r(h){n=h,i.HEAPU8=new Uint8Array(h),i.HEAPU32=new Uint32Array(h)}function o(h,m,g){i.HEAPU8.copyWithin(h,m,m+g)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}function l(h){const m=i.HEAPU8.length;h=h>>>0;const g=ju();if(h>g)return!1;for(let b=1;b<=4;b*=2){let _=m*(1+.2/b);_=Math.min(_,h+100663296);const v=Math.min(g,qu(Math.max(h,_),65536));if(s(v))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(h,m,g=1024){const b=m+g;let _=m;for(;h[_]&&!(_>=b);)++_;if(_-m>16&&h.buffer&&a)return a.decode(h.subarray(m,_));let v="";for(;m<_;){let y=h[m++];if(!(y&128)){v+=String.fromCharCode(y);continue}const S=h[m++]&63;if((y&224)===192){v+=String.fromCharCode((y&31)<<6|S);continue}const E=h[m++]&63;if((y&240)===224?y=(y&15)<<12|S<<6|E:y=(y&7)<<18|S<<12|E<<6|h[m++]&63,y<65536)v+=String.fromCharCode(y);else{const C=y-65536;v+=String.fromCharCode(55296|C>>10,56320|C&1023)}}return v}function u(h,m){return h?d(i.HEAPU8,h,m):""}const c={emscripten_get_now:Wu,emscripten_memcpy_big:o,emscripten_resize_heap:l,fd_write:()=>0};async function f(){const m=await e({env:c,wasi_snapshot_preview1:c});t=m.memory,r(t.buffer),Object.assign(i,m),i.UTF8ToString=u}return await f(),i}var Xu=Object.defineProperty,Qu=(e,t,n)=>t in e?Xu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,X=(e,t,n)=>Qu(e,typeof t!="symbol"?t+"":t,n);let Y=null;function Ju(e){throw new _r(e.UTF8ToString(e.getLastOnigError()))}class Nn{constructor(t){X(this,"utf16Length"),X(this,"utf8Length"),X(this,"utf16Value"),X(this,"utf8Value"),X(this,"utf16OffsetToUtf8"),X(this,"utf8OffsetToUtf16");const n=t.length,i=Nn._utf8ByteLength(t),r=i!==n,o=r?new Uint32Array(n+1):null;r&&(o[n]=i);const s=r?new Uint32Array(i+1):null;r&&(s[i]=n);const l=new Uint8Array(i);let a=0;for(let d=0;d<n;d++){const u=t.charCodeAt(d);let c=u,f=!1;if(u>=55296&&u<=56319&&d+1<n){const h=t.charCodeAt(d+1);h>=56320&&h<=57343&&(c=(u-55296<<10)+65536|h-56320,f=!0)}r&&(o[d]=a,f&&(o[d+1]=a),c<=127?s[a+0]=d:c<=2047?(s[a+0]=d,s[a+1]=d):c<=65535?(s[a+0]=d,s[a+1]=d,s[a+2]=d):(s[a+0]=d,s[a+1]=d,s[a+2]=d,s[a+3]=d)),c<=127?l[a++]=c:c<=2047?(l[a++]=192|(c&1984)>>>6,l[a++]=128|(c&63)>>>0):c<=65535?(l[a++]=224|(c&61440)>>>12,l[a++]=128|(c&4032)>>>6,l[a++]=128|(c&63)>>>0):(l[a++]=240|(c&1835008)>>>18,l[a++]=128|(c&258048)>>>12,l[a++]=128|(c&4032)>>>6,l[a++]=128|(c&63)>>>0),f&&d++}this.utf16Length=n,this.utf8Length=i,this.utf16Value=t,this.utf8Value=l,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let i=0,r=t.length;i<r;i++){const o=t.charCodeAt(i);let s=o,l=!1;if(o>=55296&&o<=56319&&i+1<r){const a=t.charCodeAt(i+1);a>=56320&&a<=57343&&(s=(o-55296<<10)+65536|a-56320,l=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,l&&i++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Mn=class Ee{constructor(t){if(X(this,"id",++Ee.LAST_ID),X(this,"_onigBinding"),X(this,"content"),X(this,"utf16Length"),X(this,"utf8Length"),X(this,"utf16OffsetToUtf8"),X(this,"utf8OffsetToUtf16"),X(this,"ptr"),!Y)throw new _r("Must invoke loadWasm first.");this._onigBinding=Y,this.content=t;const n=new Nn(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ee._sharedPtrInUse?(Ee._sharedPtr||(Ee._sharedPtr=Y.omalloc(1e4)),Ee._sharedPtrInUse=!0,Y.HEAPU8.set(n.utf8Value,Ee._sharedPtr),this.ptr=Ee._sharedPtr):this.ptr=n.createString(Y)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Ee._sharedPtr?Ee._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};X(Mn,"LAST_ID",0);X(Mn,"_sharedPtr",0);X(Mn,"_sharedPtrInUse",!1);let Vs=Mn;class Yu{constructor(t){if(X(this,"_onigBinding"),X(this,"_ptr"),!Y)throw new _r("Must invoke loadWasm first.");const n=[],i=[];for(let l=0,a=t.length;l<a;l++){const d=new Nn(t[l]);n[l]=d.createString(Y),i[l]=d.utf8Length}const r=Y.omalloc(4*t.length);Y.HEAPU32.set(n,r/4);const o=Y.omalloc(4*t.length);Y.HEAPU32.set(i,o/4);const s=Y.createOnigScanner(r,o,t.length);for(let l=0,a=t.length;l<a;l++)Y.ofree(n[l]);Y.ofree(o),Y.ofree(r),s===0&&Ju(Y),this._onigBinding=Y,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,i){let r=0;if(typeof i=="number"&&(r=i),typeof t=="string"){t=new Vs(t);const o=this._findNextMatchSync(t,n,!1,r);return t.dispose(),o}return this._findNextMatchSync(t,n,!1,r)}_findNextMatchSync(t,n,i,r){const o=this._onigBinding,s=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),r);if(s===0)return null;const l=o.HEAPU32;let a=s/4;const d=l[a++],u=l[a++],c=[];for(let f=0;f<u;f++){const h=t.convertUtf8OffsetToUtf16(l[a++]),m=t.convertUtf8OffsetToUtf16(l[a++]);c[f]={start:h,end:m,length:m-h}}return{index:d,captureIndices:c}}}function Zu(e){return typeof e.instantiator=="function"}function ec(e){return typeof e.default=="function"}function tc(e){return typeof e.data<"u"}function nc(e){return typeof Response<"u"&&e instanceof Response}function ic(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Qt;function $s(e){if(Qt)return Qt;async function t(){Y=await Ku(async n=>{let i=e;return i=await i,typeof i=="function"&&(i=await i(n)),typeof i=="function"&&(i=await i(n)),Zu(i)?i=await i.instantiator(n):ec(i)?i=await i.default(n):(tc(i)&&(i=i.data),nc(i)?typeof WebAssembly.instantiateStreaming=="function"?i=await rc(i)(n):i=await oc(i)(n):ic(i)?i=await ni(i)(n):i instanceof WebAssembly.Module?i=await ni(i)(n):"default"in i&&i.default instanceof WebAssembly.Module&&(i=await ni(i.default)(n))),"instance"in i&&(i=i.instance),"exports"in i&&(i=i.exports),i})}return Qt=t(),Qt}function ni(e){return t=>WebAssembly.instantiate(e,t)}function rc(e){return t=>WebAssembly.instantiateStreaming(e,t)}function oc(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let Us;function sc(e){Us=e}function ac(){return Us}async function Bs(e){return e&&await $s(e),{createScanner(t){return new Yu(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Vs(t)}}}const lc=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:Bs,getDefaultWasmLoader:ac,loadWasm:$s,setDefaultWasmLoader:sc},Symbol.toStringTag,{value:"Module"}));var zs=Fu({});$u(zs,lc);var B=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Ln(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},i=typeof e=="string"?e:e.name;for(const[r,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[r]=o:r===i&&Object.assign(n,o);return n}function qe(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function dc(e){return Array.isArray(e)?e:[e]}async function Gs(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Hn(e){return!e||["plaintext","txt","text","plain"].includes(e)}function js(e){return e==="ansi"||Hn(e)}function Fn(e){return e==="none"}function Ws(e){return Fn(e)}const uc=/(\r?\n)/g;function Vn(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(uc);let i=0;const r=[];for(let o=0;o<n.length;o+=2){const s=t?n[o]+(n[o+1]||""):n[o];r.push([s,i]),i+=n[o].length,i+=n[o+1]?.length||0}return r}const zr={light:"#333333",dark:"#bbbbbb"},Gr={light:"#fffffe",dark:"#1e1e1e"},jr="__shiki_resolved";function $n(e){if(e?.[jr])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const l=t.settings?t.settings.find(a=>!a.name&&!a.scope):void 0;l?.settings?.foreground&&(i=l.settings.foreground),l?.settings?.background&&(n=l.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i=t.type==="light"?zr.light:zr.dark),n||(n=t.type==="light"?Gr.light:Gr.dark),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const o=new Map;function s(l){if(o.has(l))return o.get(l);r+=1;const a=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${a}`]?s(l):(o.set(l,a),a)}t.settings=t.settings.map(l=>{const a=l.settings?.foreground&&!l.settings.foreground.startsWith("#"),d=l.settings?.background&&!l.settings.background.startsWith("#");if(!a&&!d)return l;const u={...l,settings:{...l.settings}};if(a){const c=s(l.settings.foreground);t.colorReplacements[c]=l.settings.foreground,u.settings.foreground=c}if(d){const c=s(l.settings.background);t.colorReplacements[c]=l.settings.background,u.settings.background=c}return u});for(const l of Object.keys(t.colors||{}))if((l==="editor.foreground"||l==="editor.background"||l.startsWith("terminal.ansi"))&&!t.colors[l]?.startsWith("#")){const a=s(t.colors[l]);t.colorReplacements[a]=t.colors[l],t.colors[l]=a}return Object.defineProperty(t,jr,{enumerable:!1,writable:!1,value:!0}),t}async function qs(e){return[...new Set((await Promise.all(e.filter(t=>!js(t)).map(async t=>await Gs(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Ks(e){return(await Promise.all(e.map(async t=>Ws(t)?null:$n(await Gs(t))))).filter(t=>!!t)}function Xs(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new B(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var cc=class extends id{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(r=>this.loadTheme(r)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=$n(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=bn.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Xs(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(r=>r.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(r=>{this._alias[r]=e.name}),this._loadedLanguagesCache=null,t.size)for(const r of t)this._resolvedGrammars.delete(r.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(r.scopeName),this._syncRegistry?._grammars?.delete(r.scopeName),this.loadLanguage(this._langMap.get(r.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const i of e)this.resolveEmbeddedLanguages(i);const t=[...this._langGraph.entries()],n=t.filter(([i,r])=>!r);if(n.length){const i=t.filter(([r,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(s=>n.map(([l])=>l).includes(s)):!1).filter(r=>!n.includes(r));throw new B(`Missing languages ${n.map(([r])=>`\`${r}\``).join(", ")}, required by ${i.map(([r])=>`\`${r}\``).join(", ")}`)}for(const[i,r]of t)this._resolver.addLanguage(r);for(const[i,r]of t)this.loadLanguage(r)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},hc=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let i=1;i<=t.length;i++){const r=t.slice(0,i).join(".");n=[...n,...this._injections.get(r)||[]]}return n}};let Ct=0;function fc(e){Ct+=1,e.warnings!==!1&&Ct>=10&&Ct%10===0&&console.warn(`[Shiki] ${Ct} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new B("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map($n),r=new cc(new hc(e.engine,n),i,n,e.langAlias);let o;function s(v){return Xs(v,e.langAlias)}function l(v){b();const y=r.getGrammar(typeof v=="string"?v:v.name);if(!y)throw new B(`Language \`${v}\` not found, you may need to load it first`);return y}function a(v){if(v==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const y=r.getTheme(v);if(!y)throw new B(`Theme \`${v}\` not found, you may need to load it first`);return y}function d(v){b();const y=a(v);return o!==v&&(r.setTheme(y),o=v),{theme:y,colorMap:r.getColorMap()}}function u(){return b(),r.getLoadedThemes()}function c(){return b(),r.getLoadedLanguages()}function f(...v){b(),r.loadLanguages(v.flat(1))}async function h(...v){return f(await qs(v))}function m(...v){b();for(const y of v.flat(1))r.loadTheme(y)}async function g(...v){return b(),m(await Ks(v))}function b(){if(t)throw new B("Shiki instance has been disposed")}function _(){t||(t=!0,r.dispose(),Ct-=1)}return{setTheme:d,getTheme:a,getLanguage:l,getLoadedThemes:u,getLoadedLanguages:c,resolveLangAlias:s,loadLanguage:h,loadLanguageSync:f,loadTheme:g,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function pc(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([Ks(e.themes||[]),qs(e.langs||[]),e.engine]);return fc({...e,themes:t,langs:n,engine:i})}const Qs=new WeakMap;function Un(e,t){Qs.set(e,t)}function Vt(e){return Qs.get(e)}var Bn=class Js{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new Js(Object.fromEntries(dc(n).map(i=>[i,Di])),t)}constructor(...t){if(t.length===2){const[n,i]=t;this.lang=i,this._stacks=n}else{const[n,i,r]=t;this.lang=i,this._stacks={[r]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return mc(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function mc(e){const t=[],n=new Set;function i(r){if(n.has(r))return;n.add(r);const o=r?.nameScopesList?.scopeName;o&&t.push(o),r.parent&&i(r.parent)}return i(e),t}function gc(e,t){if(!(e instanceof Bn))throw new B("Invalid grammar state");return e.getInternalStack(t)}const _c=/,/,vc=/ /;function Ys(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n;if(Hn(e.resolveLangAlias(n.lang||"text"))||Fn(i))return Vn(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:r,colorMap:o}=e.setTheme(i),s=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new B(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(r.name))throw new B(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return yc(t,s,r,o,n)}function bc(...e){if(e.length===2)return Vt(e[1]);const[t,n,i={}]=e,{lang:r="text",theme:o=t.getLoadedThemes()[0]}=i;if(Hn(r)||Fn(o))throw new B("Plain language does not have grammar state");if(r==="ansi")throw new B("ANSI language does not have grammar state");const{theme:s,colorMap:l}=t.setTheme(o),a=t.getLanguage(r);return new Bn(vr(n,a,s,l,i).stateStack,a.name,s.name)}function yc(e,t,n,i,r){const o=vr(e,t,n,i,r),s=new Bn(o.stateStack,t.name,n.name);return Un(o.tokens,s),o.tokens}function vr(e,t,n,i,r){const o=Ln(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:l=500,includeExplanation:a=!1}=r,d=Vn(e);let u=r.grammarState?gc(r.grammarState,n.name)??Di:r.grammarContextCode!=null?vr(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Di,c=[];const f=[];for(let h=0,m=d.length;h<m;h++){const[g,b]=d[h];if(g===""){c=[],f.push([]);continue}if(s>0&&g.length>=s){c=[],f.push([{content:g,offset:b,color:"",fontStyle:0}]);continue}let _,v,y;a&&a!=="tokenType"&&(_=t.tokenizeLine(g,u,l),v=_.tokens,y=0);const S=t.tokenizeLine2(g,u,l),E=S.tokens.length/2;for(let C=0;C<E;C++){const L=S.tokens[2*C],x=C+1<E?S.tokens[2*C+2]:g.length;if(L===x)continue;const w=S.tokens[2*C+1],A=qe(i[rt.getForeground(w)],o),I=rt.getFontStyle(w),k={content:g.substring(L,x),offset:b+L,color:A,fontStyle:I};if(a==="tokenType")k.type=rt.getTokenType(w);else if(a){const R=[];if(a!=="scopeName")for(const F of n.settings){let T;switch(typeof F.scope){case"string":T=F.scope.split(_c).map(N=>N.trim());break;case"object":T=F.scope;break;default:continue}R.push({settings:F,selectors:T.map(N=>N.split(vc))})}k.explanation=[];let P=0;for(;L+P<x;){const F=v[y],T=g.substring(F.startIndex,F.endIndex);P+=T.length,k.explanation.push({content:T,scopes:a==="scopeName"?Ec(F.scopes):Sc(R,F.scopes)}),y+=1}}c.push(k)}f.push(c),c=[],u=S.ruleStack}return{tokens:f,stateStack:u}}function Ec(e){return e.map(t=>({scopeName:t}))}function Sc(e,t){const n=[];for(let i=0,r=t.length;i<r;i++){const o=t[i];n[i]={scopeName:o,themeMatches:Lc(e,o,t.slice(0,i))}}return n}function Wr(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Cc(e,t,n){if(!Wr(e.at(-1),t))return!1;let i=e.length-2,r=n.length-1;for(;i>=0&&r>=0;)Wr(e[i],n[r])&&(i-=1),r-=1;return i===-1}function Lc(e,t,n){const i=[];for(const{selectors:r,settings:o}of e)for(const s of r)if(Cc(s,t,n)){i.push(o);break}return i}function Zs(e,t,n,i=Ys){const r=Object.entries(n.themes).filter(d=>d[1]).map(d=>({color:d[0],theme:d[1]})),o=r.map(d=>{const u=i(e,t,{...n,theme:d.theme});return{tokens:u,state:Vt(u),theme:typeof d.theme=="string"?d.theme:d.theme.name}}),s=wc(...o.map(d=>d.tokens)),l=s[0].map((d,u)=>d.map((c,f)=>{const h={content:c.content,variants:{},offset:c.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=c.explanation),s.forEach((m,g)=>{const{content:b,explanation:_,offset:v,...y}=m[u][f];h.variants[r[g].color]=y}),h})),a=o[0].state?new Bn(Object.fromEntries(o.map(d=>[d.theme,d.state?.getInternalStack(d.theme)])),o[0].state.lang):void 0;return a&&Un(l,a),l}function wc(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const r=e.map(a=>a[i]),o=t.map(()=>[]);t.forEach((a,d)=>a.push(o[d]));const s=r.map(()=>0),l=r.map(a=>a[0]);for(;l.every(a=>a);){const a=Math.min(...l.map(d=>d.content.length));for(let d=0;d<n;d++){const u=l[d];u.content.length===a?(o[d].push(u),s[d]+=1,l[d]=r[d][s[d]]):(o[d].push({...u,content:u.content.slice(0,a)}),l[d]={...u,content:u.content.slice(a),offset:u.offset+a})}}}return t}const qr=/\s+/g;function ea(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(qr)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(qr);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function kc(e){const t=Vn(e,!0).map(([r])=>r);function n(r){if(r===e.length)return{line:t.length-1,character:t.at(-1).length};let o=r,s=0;for(const l of t){if(o<l.length)break;o-=l.length,s++}return{line:s,character:o}}function i(r,o){let s=0;for(let l=0;l<r;l++)s+=t[l].length;return s+=o,s}return{lines:t,indexToPos:n,posToIndex:i}}const xc=["color","background-color"];function Ac(e,t){let n=0;const i=[];for(const r of t)r>n&&i.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}function Rc(e,t){let n=0,i=e.length;for(;n<i;){const r=n+(i-n>>1);e[r]<=t?n=r+1:i=r}return n}function Tc(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((i,r)=>i-r);return n.length?e.map(i=>i.flatMap(r=>{const o=r.offset+r.content.length,s=Rc(n,r.offset);let l=s;for(;l<n.length&&n[l]<o;)l++;if(s===l)return r;const a=n.slice(s,l);for(let d=0;d<a.length;d++)a[d]-=r.offset;return Ac(r,a)})):e}function Ic(e,t,n,i,r="css-vars"){const o={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(u=>wn(e.variants[u])),l=new Set(s.flatMap(u=>Object.keys(u))),a={},d=(u,c)=>{const f=c==="color"?"":c==="background-color"?"-bg":`-${c}`;return n+t[u]+(c==="color"?"":f)};return s.forEach((u,c)=>{for(const f of l){const h=u[f]||"inherit";if(c===0&&i&&xc.includes(f))if(i==="light-dark()"&&s.length>1){const m=t.findIndex(v=>v==="light"),g=t.findIndex(v=>v==="dark");if(m===-1||g===-1)throw new B('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=s[m][f]||"inherit",_=s[g][f]||"inherit";a[f]=`light-dark(${b}, ${_})`,r==="css-vars"&&(a[d(c,f)]=h)}else a[f]=h;else r==="css-vars"&&(a[d(c,f)]=h)}}),o.htmlStyle=a,o}function wn(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&ne.Italic&&(t["font-style"]="italic"),e.fontStyle&ne.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&ne.Underline&&n.push("underline"),e.fontStyle&ne.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function $i(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function Pc(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let i=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new B(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const l=r.lines[s.line];if(l===void 0)throw new B(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let a=s.character;if(a<0&&(a=l.length+a),a<0||a>l.length)throw new B(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${l.length}`);return{...s,character:a,offset:r.posToIndex(s.line,a)}}};const r=kc(n.source),o=(n.options.decorations||[]).map(s=>({...s,start:i(s.start),end:i(s.end)}));Dc(o),e.set(n.meta,{decorations:o,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Tc(n,t(this).decorations.flatMap(i=>[i.start.offset,i.end.offset]))},code(n){if(!this.options.decorations?.length)return;const i=t(this),r=[...n.children].filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==i.converter.lines.length)throw new B(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${i.converter.lines.length}). Failed to apply decorations.`);function o(u,c,f,h){const m=r[u];let g="",b=-1,_=-1;if(c===0&&(b=0),f===0&&(_=0),f===Number.POSITIVE_INFINITY&&(_=m.children.length),b===-1||_===-1)for(let y=0;y<m.children.length;y++)g+=ta(m.children[y]),b===-1&&g.length===c&&(b=y+1),_===-1&&g.length===f&&(_=y+1);if(b===-1)throw new B(`Failed to find start index for decoration ${JSON.stringify(h.start)}`);if(_===-1)throw new B(`Failed to find end index for decoration ${JSON.stringify(h.end)}`);const v=m.children.slice(b,_);if(!h.alwaysWrap&&v.length===m.children.length)l(m,h,"line");else if(!h.alwaysWrap&&v.length===1&&v[0].type==="element")l(v[0],h,"token");else{const y={type:"element",tagName:"span",properties:{},children:v};l(y,h,"wrapper"),m.children.splice(b,v.length,y)}}function s(u,c){r[u]=l(r[u],c,"line")}function l(u,c,f){const h=c.properties||{},m=c.transform||(g=>g);return u.tagName=c.tagName||"span",u.properties={...u.properties,...h,class:u.properties.class},c.properties?.class&&ea(u,c.properties.class),u=m(u,f)||u,u}const a=[],d=i.decorations.sort((u,c)=>c.start.offset-u.start.offset||u.end.offset-c.end.offset);for(const u of d){const{start:c,end:f}=u;if(c.line===f.line)o(c.line,c.character,f.character,u);else if(c.line<f.line){o(c.line,c.character,Number.POSITIVE_INFINITY,u);for(let h=c.line+1;h<f.line;h++)a.unshift(()=>s(h,u));o(f.line,0,f.character,u)}}a.forEach(u=>u())}}}function Dc(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new B(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const r=e[i],o=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,s=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,l=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,a=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(o||s||l||a){if(o&&s||l&&a||l&&n.start.offset===n.end.offset||s&&r.start.offset===r.end.offset)continue;throw new B(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function ta(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(ta).join(""):""}const Oc=[Pc()];function kn(e){const t=Nc(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Oc]}function Nc(e){const t=[],n=[],i=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}var nt=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],ii={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Mc(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const i=e.indexOf("m",n);if(i!==-1)return{sequence:e.substring(n+2,i).split(";"),startPosition:n,position:i+1}}return{position:e.length}}function Kr(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(i=>Number.parseInt(i));return n.length!==3||n.some(i=>Number.isNaN(i))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Hc(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(i===0)t.push({type:"resetAll"});else if(i<=9)ii[i]&&t.push({type:"setDecoration",value:ii[i]});else if(i<=29){const r=ii[i-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:nt[i-30]}});else if(i===38){const r=Kr(e);r&&t.push({type:"setForegroundColor",value:r})}else if(i===39)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:nt[i-40]}});else if(i===48){const r=Kr(e);r&&t.push({type:"setBackgroundColor",value:r})}else i===49?t.push({type:"resetBackgroundColor"}):i===53?t.push({type:"setDecoration",value:"overline"}):i===55?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:nt[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:nt[i-100+8]}})}return t}function Fc(){let e=null,t=null,n=new Set;return{parse(i){const r=[];let o=0;do{const s=Mc(i,o),l=s.sequence?i.substring(o,s.startPosition):i.substring(o);if(l.length>0&&r.push({value:l,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const a=Hc(s.sequence);for(const d of a)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of a)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}o=s.position}while(o<i.length);return r}}}var Vc={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function $c(e=Vc){function t(l){return e[l]}function n(l){return`#${l.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let i;function r(){if(i)return i;i=[];for(let d=0;d<nt.length;d++)i.push(t(nt[d]));let l=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let u=0;u<6;u++)for(let c=0;c<6;c++)i.push(n([l[d],l[u],l[c]]));let a=8;for(let d=0;d<24;d++,a+=10)i.push(n([a,a,a]));return i}function o(l){return r()[l]}function s(l){switch(l.type){case"named":return t(l.name);case"rgb":return n(l.rgb);case"table":return o(l.index)}}return{value:s}}const Uc=/#([0-9a-f]{3,8})/i,Bc=/var\((--[\w-]+-ansi-[\w-]+)\)/,zc={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function Gc(e,t,n){const i=Ln(e,n),r=Vn(t),o=$c(Object.fromEntries(nt.map(l=>{const a=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`;return[l,e.colors?.[a]||zc[l]]}))),s=Fc();return r.map(l=>s.parse(l[0]).map(a=>{let d,u;a.decorations.has("reverse")?(d=a.background?o.value(a.background):e.bg,u=a.foreground?o.value(a.foreground):e.fg):(d=a.foreground?o.value(a.foreground):e.fg,u=a.background?o.value(a.background):void 0),d=qe(d,i),u=qe(u,i),a.decorations.has("dim")&&(d=jc(d));let c=ne.None;return a.decorations.has("bold")&&(c|=ne.Bold),a.decorations.has("italic")&&(c|=ne.Italic),a.decorations.has("underline")&&(c|=ne.Underline),a.decorations.has("strikethrough")&&(c|=ne.Strikethrough),{content:a.value,offset:l[1],color:d,bgColor:u,fontStyle:c}}))}function jc(e){const t=e.match(Uc);if(t){const i=t[1];if(i.length===8){const r=Math.round(Number.parseInt(i.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${i.slice(0,6)}${r}`}else{if(i.length===6)return`#${i}80`;if(i.length===4){const r=i[0],o=i[1],s=i[2],l=i[3];return`#${r}${r}${o}${o}${s}${s}${Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0")}`}else if(i.length===3){const r=i[0],o=i[1],s=i[2];return`#${r}${r}${o}${o}${s}${s}80`}}}const n=e.match(Bc);return n?`var(${n[1]}-dim)`:e}function Ui(e,t,n={}){const i=e.resolveLangAlias(n.lang||"text"),{theme:r=e.getLoadedThemes()[0]}=n;if(!Hn(i)&&!Fn(r)&&i==="ansi"){const{theme:o}=e.setTheme(r);return Gc(o,t,n)}return Ys(e,t,n)}function xn(e,t,n){let i,r,o,s,l,a;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:u="--shiki-",colorsRendering:c="css-vars"}=n,f=Object.entries(n.themes).filter(_=>_[1]).map(_=>({color:_[0],theme:_[1]})).sort((_,v)=>_.color===d?-1:v.color===d?1:0);if(f.length===0)throw new B("`themes` option must not be empty");const h=Zs(e,t,n,Ui);if(a=Vt(h),d&&d!=="light-dark()"&&!f.some(_=>_.color===d))throw new B(`\`themes\` option must contain the defaultColor key \`${d}\``);const m=f.map(_=>e.getTheme(_.theme)),g=f.map(_=>_.color);o=h.map(_=>_.map(v=>Ic(v,g,u,d,c))),a&&Un(o,a);const b=f.map(_=>Ln(_.theme,n));r=Xr(f,m,b,u,d,"fg",c),i=Xr(f,m,b,u,d,"bg",c),s=`shiki-themes ${m.map(_=>_.name).join(" ")}`,l=d?void 0:[r,i].join(";")}else if("theme"in n){const d=Ln(n.theme,n);o=Ui(e,t,n);const u=e.getTheme(n.theme);i=qe(u.bg,d),r=qe(u.fg,d),s=u.name,a=Vt(o)}else throw new B("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:r,bg:i,themeName:s,rootStyle:l,grammarState:a}}function Xr(e,t,n,i,r,o,s){return e.map((l,a)=>{const d=qe(t[a][o],n[a])||"inherit",u=`${i+l.color}${o==="bg"?"-bg":""}:${d}`;if(a===0&&r){if(r==="light-dark()"&&e.length>1){const c=e.findIndex(h=>h.color==="light"),f=e.findIndex(h=>h.color==="dark");if(c===-1||f===-1)throw new B('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${qe(t[c][o],n[c])||"inherit"}, ${qe(t[f][o],n[f])||"inherit"});${u}`}return d}return s==="css-vars"?u:null}).filter(l=>!!l).join(";")}const na=/^\s+$/,Wc=/^(\s*)(.*?)(\s*)$/;function An(e,t,n,i={meta:{},options:n,codeToHast:(r,o)=>An(e,r,o),codeToTokens:(r,o)=>xn(e,r,o)}){let r=t;for(const m of kn(n))r=m.preprocess?.call(i,r,n)||r;let{tokens:o,fg:s,bg:l,themeName:a,rootStyle:d,grammarState:u}=xn(e,r,n);const{mergeWhitespaces:c=!0,mergeSameStyleTokens:f=!1}=n;c===!0?o=Kc(o):c==="never"&&(o=Xc(o)),f&&(o=Qc(o));const h={...i,get source(){return r}};for(const m of kn(n))o=m.tokens?.call(h,o)||o;return qc(o,{...n,fg:s,bg:l,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},h,u)}function qc(e,t,n,i=Vt(e)){const r=kn(t),o=[],s={type:"root",children:[]},{structure:l="classic",tabindex:a="0"}=t,d={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),a!==!1&&a!=null&&(d.tabindex=a.toString());for(const[g,b]of Object.entries(t.meta||{}))g.startsWith("_")||(d[g]=b);let u={type:"element",tagName:"pre",properties:d,children:[],data:t.data},c={type:"element",tagName:"code",properties:{},children:o};const f=[],h={...n,structure:l,addClassToHast:ea,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return u},get code(){return c},get lines(){return f}};if(e.forEach((g,b)=>{b&&(l==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&o.push({type:"text",value:`
|
|
13
|
+
`}));let _={type:"element",tagName:"span",properties:{class:"line"},children:[]},v=0;for(const y of g){let S={type:"element",tagName:"span",properties:{...y.htmlAttrs},children:[{type:"text",value:y.content}]};const E=$i(y.htmlStyle||wn(y));E&&(S.properties.style=E);for(const C of r)S=C?.span?.call(h,S,b+1,v,_,y)||S;l==="inline"?s.children.push(S):l==="classic"&&_.children.push(S),v+=y.content.length}if(l==="classic"){for(const y of r)_=y?.line?.call(h,_,b+1)||_;f.push(_),o.push(_)}else l==="inline"&&f.push(_)}),l==="classic"){for(const g of r)c=g?.code?.call(h,c)||c;u.children.push(c);for(const g of r)u=g?.pre?.call(h,u)||u;s.children.push(u)}else if(l==="inline"){const g=[];let b={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const v of s.children)v.type==="element"&&v.tagName==="br"?(g.push(b),b={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(v.type==="element"||v.type==="text")&&b.children.push(v);g.push(b);let _={type:"element",tagName:"code",properties:{},children:g};for(const v of r)_=v?.code?.call(h,_)||_;s.children=[];for(let v=0;v<_.children.length;v++){v>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const y=_.children[v];y.type==="element"&&s.children.push(...y.children)}}let m=s;for(const g of r)m=g?.root?.call(h,m)||m;return i&&Un(m,i),m}function Kc(e){return e.map(t=>{const n=[];let i="",r;return t.forEach((o,s)=>{const l=!(o.fontStyle&&(o.fontStyle&ne.Underline||o.fontStyle&ne.Strikethrough));l&&na.test(o.content)&&t[s+1]?(r===void 0&&(r=o.offset),i+=o.content):i?(l?n.push({...o,offset:r,content:i+o.content}):n.push({content:i,offset:r},o),r=void 0,i=""):n.push(o)}),n})}function Xc(e){return e.map(t=>t.flatMap(n=>{if(na.test(n.content))return n;const i=n.content.match(Wc);if(!i)return n;const[,r,o,s]=i;if(!r&&!s)return n;const l=[{...n,offset:n.offset+r.length,content:o}];return r&&l.unshift({content:r,offset:n.offset}),s&&l.push({content:s,offset:n.offset+r.length+o.length}),l}))}function Qc(e){return e.map(t=>{const n=[];for(const i of t){if(n.length===0){n.push({...i});continue}const r=n.at(-1),o=$i(r.htmlStyle||wn(r)),s=$i(i.htmlStyle||wn(i)),l=r.fontStyle&&(r.fontStyle&ne.Underline||r.fontStyle&ne.Strikethrough),a=i.fontStyle&&(i.fontStyle&ne.Underline||i.fontStyle&ne.Strikethrough);!l&&!a&&o===s?r.content+=i.content:n.push({...i})}return n})}const Jc=Oe;function Yc(e,t,n){const i={meta:{},options:n,codeToHast:(o,s)=>An(e,o,s),codeToTokens:(o,s)=>xn(e,o,s)};let r=Jc(An(e,t,n,i));for(const o of kn(n))r=o.postprocess?.call(i,r,n)||r;return r}async function Zc(e){const t=await pc(e);return{getLastGrammarState:(...n)=>bc(t,...n),codeToTokensBase:(n,i)=>Ui(t,n,i),codeToTokensWithThemes:(n,i)=>Zs(t,n,i),codeToTokens:(n,i)=>xn(t,n,i),codeToHast:(n,i)=>An(t,n,i),codeToHtml:(n,i)=>Yc(t,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function eh(e){const t=e.langs,n=e.themes,i=e.engine;async function r(o){function s(c){if(typeof c=="string"){if(c=o.langAlias?.[c]||c,js(c))return[];const f=t[c];if(!f)throw new B(`Language \`${c}\` is not included in this bundle. You may want to load it from external source.`);return f}return c}function l(c){if(Ws(c))return"none";if(typeof c=="string"){const f=n[c];if(!f)throw new B(`Theme \`${c}\` is not included in this bundle. You may want to load it from external source.`);return f}return c}const a=(o.themes??[]).map(c=>l(c)),d=(o.langs??[]).map(c=>s(c)),u=await Zc({engine:o.engine??i(),...o,themes:a,langs:d});return{...u,loadLanguage(...c){return u.loadLanguage(...c.map(s))},loadTheme(...c){return u.loadTheme(...c.map(l))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return r}const th=eh({langs:Vi,themes:Gu,engine:()=>(0,zs.createOnigurumaEngine)(p(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))}),Qr=4294967295;var nh=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:i,regexConstructor:r}=t;if(!r)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const s=i?.get(o);if(s){if(s instanceof RegExp)return s;if(n)return null;throw s}try{const l=r(o);return i?.set(o,l),l}catch(l){if(i?.set(o,l),n)return null;throw l}})}findNextMatchSync(e,t,n){const i=typeof e=="string"?e:e.content,r=[];function o(s,l,a=0){return{index:s,captureIndices:l.indices.map(d=>d==null?{start:Qr,end:Qr,length:0}:{start:d[0]+a,end:d[1]+a,length:d[1]-d[0]})}}for(let s=0;s<this.regexps.length;s++){const l=this.regexps[s];if(l)try{l.lastIndex=t;const a=l.exec(i);if(!a)continue;if(a.index===t)return o(s,a,0);r.push([s,a,0])}catch(a){if(this.options.forgiving)continue;throw a}}if(r.length){const s=Math.min(...r.map(l=>l[1].index));for(const[l,a,d]of r)if(a.index===s)return o(l,a,d)}return null}};function yt(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function ih(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const br=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Z=String.raw;function Et(e,t){if(e==null)throw new Error(t??"Value expected");return e}const ia=Z`\[\^?`,ra=`c.? | C(?:-.?)?|${Z`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Z`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Z`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Z`o\{[^\}]*\}?`}|${Z`\d{1,3}`}`,yr=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Jt=new RegExp(Z`
|
|
14
|
+
\\ (?:
|
|
15
|
+
${ra}
|
|
16
|
+
| [gk]<[^>]*>?
|
|
17
|
+
| [gk]'[^']*'?
|
|
18
|
+
| .
|
|
19
|
+
)
|
|
20
|
+
| \( (?:
|
|
21
|
+
\? (?:
|
|
22
|
+
[:=!>({]
|
|
23
|
+
| <[=!]
|
|
24
|
+
| <[^>]*>
|
|
25
|
+
| '[^']*'
|
|
26
|
+
| ~\|?
|
|
27
|
+
| #(?:[^)\\]|\\.?)*
|
|
28
|
+
| [^:)]*[:)]
|
|
29
|
+
)?
|
|
30
|
+
| \*[^\)]*\)?
|
|
31
|
+
)?
|
|
32
|
+
| (?:${yr.source})+
|
|
33
|
+
| ${ia}
|
|
34
|
+
| .
|
|
35
|
+
`.replace(/\s+/g,""),"gsu"),ri=new RegExp(Z`
|
|
36
|
+
\\ (?:
|
|
37
|
+
${ra}
|
|
38
|
+
| .
|
|
39
|
+
)
|
|
40
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
41
|
+
| ${ia}
|
|
42
|
+
| &&
|
|
43
|
+
| .
|
|
44
|
+
`.replace(/\s+/g,""),"gsu");function rh(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const i=Ch(n.flags),r=[i.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(c){r.push(c)},replaceCurrentModX(c){r[r.length-1]=c},singleline:n.rules.singleline};let s=[],l;for(Jt.lastIndex=0;l=Jt.exec(e);){const c=oh(o,e,l[0],Jt.lastIndex);c.tokens?s.push(...c.tokens):c.token&&s.push(c.token),c.lastIndex!==void 0&&(Jt.lastIndex=c.lastIndex)}const a=[];let d=0;s.filter(c=>c.type==="GroupOpen").forEach(c=>{c.kind==="capturing"?c.number=++d:c.raw==="("&&a.push(c)}),d||a.forEach((c,f)=>{c.kind="capturing",c.number=f+1});const u=d||a.length;return{tokens:s.map(c=>c.type==="EscapedNumber"?wh(c,u):c).flat(),flags:i}}function oh(e,t,n,i){const[r,o]=n;if(n==="["||n==="[^"){const s=sh(t,n,i);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(o))return{token:Jr(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:gh(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:sa(n)}}if(o==="K")return{token:aa("keep",n)};if(o==="N"||o==="R")return{token:it("newline",n,{negate:o==="N"})};if(o==="O")return{token:it("any",n)};if(o==="X")return{token:it("text_segment",n)};const s=oa(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(r==="("){if(o==="*")return{token:yh(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[i]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:i+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:bh(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:ht("group",n)};if(n==="(?>")return{token:ht("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:ht(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:ht("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:ht("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:fh(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(`
|
|
45
|
+
`,i);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=i,{lastIndex:s.exec(t)?s.lastIndex:i}}}if(n===".")return{token:it("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":Z`\A`,$:Z`\Z`}[n]:n;return{token:Jr(s,n)}}return n==="|"?{token:lh(n)}:yr.test(n)?{tokens:kh(n)}:{token:Ne(yt(n),n)}}function sh(e,t,n){const i=[Yr(t[1]==="^",t)];let r=1,o;for(ri.lastIndex=n;o=ri.exec(e);){const s=o[0];if(s[0]==="["&&s[1]!==":")r++,i.push(Yr(s[1]==="^",s));else if(s==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(Ne(93,s));else if(r--,i.push(dh(s)),!r)break}else{const l=ah(s);Array.isArray(l)?i.push(...l):i.push(l)}}return{tokens:i,lastIndex:ri.lastIndex||e.length}}function ah(e){if(e[0]==="\\")return oa(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!br.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return it("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?uh(e):e==="&&"?ch(e):Ne(yt(e),e)}function oa(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return vh(e);if("dDhHsSwW".includes(n))return Eh(e);if(e.startsWith(Z`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return Sh(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const i=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(i)),o=new TextEncoder;return[...r].map(s=>{const l=[...o.encode(s)].map(a=>`\\x${a.toString(16)}`).join("");return Ne(yt(s),l)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ne(Lh(e),e);if(Zr.has(n))return Ne(Zr.get(n),e);if(/\d/.test(n))return hh(t,e);if(e==="\\")throw new Error(Z`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ne(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function lh(e){return{type:"Alternator",raw:e}}function Jr(e,t){return{type:"Assertion",kind:e,raw:t}}function sa(e){return{type:"Backreference",raw:e}}function Ne(e,t){return{type:"Character",value:e,raw:t}}function dh(e){return{type:"CharacterClassClose",raw:e}}function uh(e){return{type:"CharacterClassHyphen",raw:e}}function ch(e){return{type:"CharacterClassIntersector",raw:e}}function Yr(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function it(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function aa(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Et(n.flags),raw:t}}function hh(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function fh(e){return{type:"GroupClose",raw:e}}function ht(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function ph(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function mh(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function gh(e){return{type:"Subroutine",raw:e}}const _h=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Zr=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function vh(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Ne(yt(t.toUpperCase())-64,e)}function bh(e,t){let{on:n,off:i}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;i??="";const r=(t.getCurrentModX()||n.includes("x"))&&!i.includes("x"),o=to(n),s=to(i),l={};if(o&&(l.enable=o),s&&(l.disable=s),e.endsWith(")"))return t.replaceCurrentModX(r),aa("flags",e,{flags:l});if(e.endsWith(":"))return t.pushModX(r),t.numOpenGroups++,ht("group",e,{...(o||s)&&{flags:l}});throw new Error(`Unexpected flag modifier "${e}"`)}function yh(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:i,args:r}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(i==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const o=r?r.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[s,l,a]=o,d=_h.has(n)?n.toLowerCase():"custom";switch(d){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(o.length===2&&(typeof l=="number"||!/^[<>X]$/.test(l)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${l}"`);break;case"count":case"total_count":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(typeof l=="number"||!/^(?:[<>!=]=|[<>])$/.test(l))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${l}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument three must be a tag or number "${a}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${d}"`)}return ph(d,i??null,r?.split(",")??null,e)}function eo(e){let t=null,n,i;if(e[0]==="{"){const{minStr:r,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,s=1e5;if(+r>s||o&&+o>s)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+r,i=o===void 0?+r:o===""?1/0:+o,n>i&&(t="possessive",[n,i]=[i,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,i=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return mh(t,n,i,e)}function Eh(e){const t=e[1].toLowerCase();return it({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function Sh(e){const{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return it("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function to(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function Ch(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const i=e[n];if(!"imxDPSWy".includes(i))throw new Error(`Invalid flag "${i}"`);if(i==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[i]]=!0}return t}function Lh(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function wh(e,t){const{raw:n,inCharClass:i}=e,r=n.slice(1);if(!i&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=t))return[sa(n)];const o=[],s=r.match(/^[0-7]+|\d/g);for(let l=0;l<s.length;l++){const a=s[l];let d;if(l===0&&a!=="8"&&a!=="9"){if(d=parseInt(a,8),d>127)throw new Error(Z`Octal encoded byte above 177 unsupported "${n}"`)}else d=yt(a);o.push(Ne(d,(l===0?"\\":"")+a))}return o}function kh(e){const t=[],n=new RegExp(yr,"gy");let i;for(;i=n.exec(e);){const r=i[0];if(r[0]==="{"){const o=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);if(o){const{min:s,max:l}=o.groups;if(+s>+l&&r.endsWith("?")){n.lastIndex--,t.push(eo(r.slice(0,-1)));continue}}}t.push(eo(r))}return t}function la(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(i=>t[i]===n[i])}function xh(e){return Ah.has(e.type)}const Ah=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function da(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=rh(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),r=(f,h)=>{const m=i.tokens[o.nextIndex];switch(o.parent=f,o.nextIndex++,m.type){case"Alternator":return st();case"Assertion":return Rh(m);case"Backreference":return Th(m,o);case"Character":return zn(m.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return Ih(m,o,h);case"CharacterClassOpen":return Ph(m,o,h);case"CharacterSet":return Dh(m,o);case"Directive":return Vh(m.kind,{flags:m.flags});case"GroupOpen":return Oh(m,o,h);case"NamedCallout":return Uh(m.kind,m.tag,m.arguments);case"Quantifier":return Nh(m,o);case"Subroutine":return Mh(m,o);default:throw new Error(`Unexpected token type "${m.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:i.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:r},s=zh($h(i.flags));let l=s.body[0];for(;o.nextIndex<i.tokens.length;){const f=r(l,{});f.type==="Alternative"?(s.body.push(f),l=f):l.body.push(f)}const{capturingGroups:a,hasNumberedRef:d,namedGroupsByName:u,subroutines:c}=o;if(d&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:f}of c)if(typeof f=="number"){if(f>a.length)throw new Error("Subroutine uses a group number that's not defined");f&&(a[f-1].isSubroutined=!0)}else if(u.has(f)){if(u.get(f).length>1)throw new Error(Z`Subroutine uses a duplicate group name "\g<${f}>"`);u.get(f)[0].isSubroutined=!0}else throw new Error(Z`Subroutine uses a group name that's not defined "\g<${f}>"`);return s}function Rh({kind:e}){return Bi(Et({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===Z`\B`||e===Z`\Y`})}function Th({raw:e},t){const n=/^\\k[<']/.test(e),i=n?e.slice(3,-1):e.slice(1),r=(o,s=!1)=>{const l=t.capturingGroups.length;let a=!1;if(o>l)if(t.skipBackrefValidation)a=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,zi(s?l+1-o:o,{orphan:a})};if(n){const o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(o)return r(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(i))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(i))throw new Error(`Group name not defined to the left "${e}"`);return zi(i)}return r(+i)}function Ih(e,t,n){const{tokens:i,walk:r}=t,o=t.parent,s=o.body.at(-1),l=i[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&l&&l.type!=="CharacterClassOpen"&&l.type!=="CharacterClassClose"&&l.type!=="CharacterClassIntersector"){const a=r(o,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&a.type==="Character")return o.body.pop(),Fh(s,a);throw new Error("Invalid character class range")}return zn(yt("-"))}function Ph({negate:e},t,n){const{tokens:i,walk:r}=t,o=[mn()],s=i[t.nextIndex];let l=ro(s);for(;l.type!=="CharacterClassClose";){if(l.type==="CharacterClassIntersector")o.push(mn()),t.nextIndex++;else{const d=o.at(-1);d.body.push(r(d,n))}l=ro(i[t.nextIndex],s)}const a=mn({negate:e});return o.length===1?a.body=o[0].body:(a.kind="intersection",a.body=o.map(d=>d.body.length===1?d.body[0]:d)),t.nextIndex++,a}function Dh({kind:e,negate:t,value:n},i){const{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:s}=i;if(e==="property"){const l=Gn(n);if(br.has(l)&&!s?.has(l))e="posix",n=l;else return ft(n,{negate:t,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:s})}return e==="posix"?Bh(n,{negate:t}):Gi(e,{negate:t})}function Oh(e,t,n){const{tokens:i,capturingGroups:r,namedGroupsByName:o,skipLookbehindValidation:s,walk:l}=t,a=Gh(e),d=a.type==="AbsenceFunction",u=io(a),c=u&&a.negate;if(a.type==="CapturingGroup"&&(r.push(a),a.name&&ih(o,a.name,[]).push(a)),d&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=oo(i[t.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")a.body.push(st()),t.nextIndex++;else{const h=a.body.at(-1),m=l(h,{...n,isInAbsenceFunction:n.isInAbsenceFunction||d,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||c});if(h.body.push(m),(u||n.isInLookbehind)&&!s){const g="Lookbehind includes a pattern not allowed by Oniguruma";if(c||n.isInNegLookbehind){if(no(m)||m.type==="CapturingGroup")throw new Error(g)}else if(no(m)||io(m)&&m.negate)throw new Error(g)}}f=oo(i[t.nextIndex])}return t.nextIndex++,a}function Nh({kind:e,min:t,max:n},i){const r=i.parent,o=r.body.at(-1);if(!o||!xh(o))throw new Error("Quantifier requires a repeatable token");const s=ca(e,t,n,o);return r.body.pop(),s}function Mh({raw:e},t){const{capturingGroups:n,subroutines:i}=t;let r=e.slice(3,-1);const o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(o){const l=+o.groups.num,a=n.length;if(t.hasNumberedRef=!0,r={"":l,"+":a+l,"-":a+1-l}[o.groups.sign],r<1)throw new Error("Invalid subroutine number")}else r==="0"&&(r=0);const s=ha(r);return i.push(s),s}function Hh(e,t){return{type:"AbsenceFunction",kind:e,body:zt(t?.body)}}function st(e){return{type:"Alternative",body:fa(e?.body)}}function Bi(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function zi(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function ua(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!jh(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:zt(t?.body)}}function zn(e,t){const n={useLastValid:!1,...t};if(e>1114111){const i=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${i}}"`):new Error(`Invalid code point out of range in JS "\\x{${i}}"`)}return{type:"Character",value:e}}function mn(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:fa(e?.body)}}function Fh(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Gi(e,t){const n=!!t?.negate,i={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(i.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(i.variableLength=!0),i}function Vh(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Et(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function $h(e){return{type:"Flags",...e}}function ge(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:zt(e?.body)}}function Ze(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:zt(e?.body)}}function Uh(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function Bh(e,t){const n=!!t?.negate;if(!br.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function ca(e,t,n,i){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:i}}function zh(e,t){return{type:"Regex",body:zt(t?.body),flags:e}}function ha(e){return{type:"Subroutine",ref:e}}function ft(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let i=n.unicodePropertyMap?.get(Gn(e));if(!i){if(n.normalizeUnknownPropertyNames)i=Wh(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Z`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function Gh({flags:e,kind:t,name:n,negate:i,number:r}){switch(t){case"absence_repeater":return Hh("repeater");case"atomic":return ge({atomic:!0});case"capturing":return ua(r,{name:n});case"group":return ge({flags:e});case"lookahead":case"lookbehind":return Ze({behind:t==="lookbehind",negate:i});default:throw new Error(`Unexpected group kind "${t}"`)}}function zt(e){if(e===void 0)e=[st()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function fa(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function no(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function io(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function jh(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Wh(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Gn(e){return e.replace(/[- _]+/g,"").toLowerCase()}function ro(e,t){const n=t;return Et(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function oo(e){return Et(e,"Unclosed group")}function Dt(e,t,n=null){function i(o,s){for(let l=0;l<o.length;l++){const a=r(o[l],s,l,o);l=Math.max(-1,l+a)}}function r(o,s=null,l=null,a=null){let d=0,u=!1;const c={node:o,parent:s,key:l,container:a,root:e,remove(){Yt(a).splice(Math.max(0,lt(l)+d),1),d--,u=!0},removeAllNextSiblings(){return Yt(a).splice(lt(l)+1)},removeAllPrevSiblings(){const _=lt(l)+d;return d-=_,Yt(a).splice(0,Math.max(0,_))},replaceWith(_,v={}){const y=!!v.traverse;a?a[Math.max(0,lt(l)+d)]=_:Et(s,"Can't replace root node")[l]=_,y&&r(_,s,l,a),u=!0},replaceWithMultiple(_,v={}){const y=!!v.traverse;if(Yt(a).splice(Math.max(0,lt(l)+d),1,..._),d+=_.length-1,y){let S=0;for(let E=0;E<_.length;E++)S+=r(_[E],s,lt(l)+E+S,a)}u=!0},skip(){u=!0}},{type:f}=o,h=t["*"],m=t[f],g=typeof h=="function"?h:h?.enter,b=typeof m=="function"?m:m?.enter;if(g?.(c,n),b?.(c,n),!u)switch(f){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":i(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(o.min,o,"min"),r(o.max,o,"max");break;case"Quantifier":r(o.body,o,"body");break;case"Regex":i(o.body,o),r(o.flags,o,"flags");break;default:throw new Error(`Unexpected node type "${f}"`)}return m?.exit?.(c,n),h?.exit?.(c,n),d}return r(e),e}function Yt(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function lt(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const qh=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Kh(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Xh(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}const so=new RegExp(String.raw`(?<noncapturingStart>${qh})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Qh(e,t){const n=t?.hiddenCaptures??[];let i=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};const r="(?>",o="(?:(?=(",s=[0],l=[];let a=0,d=0,u=NaN,c;do{c=!1;let f=0,h=0,m=!1,g;for(so.lastIndex=Number.isNaN(u)?0:u+o.length;g=so.exec(e);){const{0:b,index:_,groups:{capturingStart:v,noncapturingStart:y}}=g;if(b==="[")f++;else if(f)b==="]"&&f--;else if(b===r&&!m)u=_,m=!0;else if(m&&y)h++;else if(v)m?h++:(a++,s.push(a+d));else if(b===")"&&m){if(!h){d++;const S=a+d;if(e=`${e.slice(0,u)}${o}${e.slice(u+r.length,_)}))<$$${S}>)${e.slice(_+1)}`,c=!0,l.push(S),Kh(n,S),i.size){const E=new Map;i.forEach((C,L)=>{E.set(L>=S?L+1:L,C.map(x=>x>=S?x+1:x))}),i=E}break}h--}}}while(c);return n.push(...l),e=fr(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:f,groups:{backrefNum:h,wrappedBackrefNum:m}})=>{if(h){const g=+h;if(g>s.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${s[g]}`}return`\\${m}`},ue.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}const pa=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,oi=new RegExp(String.raw`
|
|
46
|
+
\\(?: \d+
|
|
47
|
+
| c[A-Za-z]
|
|
48
|
+
| [gk]<[^>]+>
|
|
49
|
+
| [pPu]\{[^\}]+\}
|
|
50
|
+
| u[A-Fa-f\d]{4}
|
|
51
|
+
| x[A-Fa-f\d]{2}
|
|
52
|
+
)
|
|
53
|
+
| \((?: \? (?: [:=!>]
|
|
54
|
+
| <(?:[=!]|[^>]+>)
|
|
55
|
+
| [A-Za-z\-]+:
|
|
56
|
+
| \(DEFINE\)
|
|
57
|
+
))?
|
|
58
|
+
| (?<qBase>${pa})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
59
|
+
| \\?.
|
|
60
|
+
`.replace(/\s+/g,""),"gsu");function Jh(e){if(!new RegExp(`${pa}\\+`).test(e))return{pattern:e};const t=[];let n=null,i=null,r="",o=0,s;for(oi.lastIndex=0;s=oi.exec(e);){const{0:l,index:a,groups:{qBase:d,qMod:u,invalidQ:c}}=s;if(l==="[")o||(i=a),o++;else if(l==="]")o?o--:i=null;else if(!o)if(u==="+"&&r&&!r.startsWith("(")){if(c)throw new Error(`Invalid quantifier "${l}"`);let f=-1;if(/^\{\d+\}$/.test(d))e=Xh(e,a+d.length,u,"");else{if(r===")"||r==="]"){const h=r===")"?n:i;if(h===null)throw new Error(`Invalid unmatched "${r}"`);e=`${e.slice(0,h)}(?>${e.slice(h,a)}${d})${e.slice(a+l.length)}`}else e=`${e.slice(0,a-r.length)}(?>${r}${d})${e.slice(a+l.length)}`;f+=4}oi.lastIndex+=f}else l[0]==="("?t.push(a):l===")"&&(n=t.length?t.pop():null);r=l}return{pattern:e}}const de=String.raw,Yh=de`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,ji=de`\(\?R=(?<rDepth>[^\)]+)\)|${Yh}`,jn=de`\(\?<(?![=!])(?<captureName>[^>]+)>`,ma=de`${jn}|(?<unnamed>\()(?!\?)`,Je=new RegExp(de`${jn}|${ji}|\(\?|\\?.`,"gsu"),si="Cannot use multiple overlapping recursions";function Zh(e,t){const{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t};let r=t?.captureTransfers??new Map;if(!new RegExp(ji,"su").test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};if(i==="plugin"&&Kt(e,de`\(\?\(DEFINE\)`,ue.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],s=Kt(e,de`\\[1-9]`,ue.DEFAULT),l=new Map,a=[];let d=!1,u=0,c=0,f;for(Je.lastIndex=0;f=Je.exec(e);){const{0:h,groups:{captureName:m,rDepth:g,gRNameOrNum:b,gRDepth:_}}=f;if(h==="[")u++;else if(u)h==="]"&&u--;else if(g){if(ao(g),d)throw new Error(si);if(s)throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const v=e.slice(0,f.index),y=e.slice(Je.lastIndex);if(Kt(y,ji,ue.DEFAULT))throw new Error(si);const S=+g-1;e=lo(v,y,S,!1,n,o,c),r=co(r,v,S,o.length,0,c);break}else if(b){ao(_);let v=!1;for(const k of a)if(k.name===b||k.num===+b){if(v=!0,k.hasRecursedWithin)throw new Error(si);break}if(!v)throw new Error(de`Recursive \g cannot be used outside the referenced group "${i==="external"?b:de`\g<${b}&R=${_}>`}"`);const y=l.get(b),S=au(e,y);if(s&&Kt(S,de`${jn}|\((?!\?)`,ue.DEFAULT))throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const E=e.slice(y,f.index),C=S.slice(E.length+h.length),L=o.length,x=+_-1,w=lo(E,C,x,!0,n,o,c);r=co(r,E,x,o.length-L,L,c);const A=e.slice(0,y),I=e.slice(y+S.length);e=`${A}${w}${I}`,Je.lastIndex+=w.length-h.length-E.length-C.length,a.forEach(k=>k.hasRecursedWithin=!0),d=!0}else if(m)c++,l.set(String(c),Je.lastIndex),l.set(m,Je.lastIndex),a.push({num:c,name:m});else if(h[0]==="("){const v=h==="(";v&&(c++,l.set(String(c),Je.lastIndex)),a.push(v?{num:c}:{})}else h===")"&&a.pop()}return n.push(...o),{pattern:e,captureTransfers:r,hiddenCaptures:n}}function ao(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function lo(e,t,n,i,r,o,s){const l=new Set;i&&As(e+t,jn,({groups:{captureName:d}})=>{l.add(d)},ue.DEFAULT);const a=[n,i?l:null,r,o,s];return`${e}${uo(`(?:${e}`,"forward",...a)}(?:)${uo(`${t})`,"backward",...a)}${t}`}function uo(e,t,n,i,r,o,s){const a=u=>t==="forward"?u+2:n-u+2-1;let d="";for(let u=0;u<n;u++){const c=a(u);d+=fr(e,de`${ma}|\\k<(?<backref>[^>]+)>`,({0:f,groups:{captureName:h,unnamed:m,backref:g}})=>{if(g&&i&&!i.has(g))return f;const b=`_$${c}`;if(m||h){const _=s+o.length+1;return o.push(_),ef(r,_),m?f:`(?<${h}${b}>`}return de`\k<${g}${b}>`},ue.DEFAULT)}return d}function ef(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function co(e,t,n,i,r,o){if(e.size&&i){let s=0;As(t,ma,()=>s++,ue.DEFAULT);const l=o-s+r,a=new Map;return e.forEach((d,u)=>{const c=(i-s*n)/n,f=s*n,h=u>l+s?u+i:u,m=[];for(const g of d)if(g<=l)m.push(g);else if(g>l+s+c)m.push(g+i);else if(g<=l+s)for(let b=0;b<=n;b++)m.push(g+s*b);else for(let b=0;b<=n;b++)m.push(g+f+c*b);a.set(h,m)}),a}return e}var Q=String.fromCodePoint,O=String.raw,_e={},Wn=globalThis.RegExp;_e.flagGroups=(()=>{try{new Wn("(?i:)")}catch{return!1}return!0})();_e.unicodeSets=(()=>{try{new Wn("[[]]","v")}catch{return!1}return!0})();_e.bugFlagVLiteralHyphenIsRange=_e.unicodeSets?(()=>{try{new Wn(O`[\d\-a]`,"v")}catch{return!0}return!1})():!1;_e.bugNestedClassIgnoresNegation=_e.unicodeSets&&new Wn("[[^a]]","v").test("a");function Rn(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function $t(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Wi(e,t){return ho[e]>=ho[t]}function tf(e,t){if(e==null)throw new Error(t??"Value expected");return e}var ho={ES2025:2025,ES2024:2024,ES2018:2018},nf={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function ga(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!nf[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=_e.flagGroups?"ES2025":_e.unicodeSets?"ES2024":"ES2018"),t}var rf="[ -\r ]",of=new Set([Q(304),Q(305)]),xe=O`[\p{L}\p{M}\p{N}\p{Pc}]`;function _a(e){if(of.has(e))return[e];const t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),r=lf.get(n),o=sf.get(n),s=af.get(n);return[...i].length===1&&t.add(i),s&&t.add(s),r&&t.add(r),t.add(n),o&&t.add(o),[...t]}var Er=new Map(`C Other
|
|
61
|
+
Cc Control cntrl
|
|
62
|
+
Cf Format
|
|
63
|
+
Cn Unassigned
|
|
64
|
+
Co Private_Use
|
|
65
|
+
Cs Surrogate
|
|
66
|
+
L Letter
|
|
67
|
+
LC Cased_Letter
|
|
68
|
+
Ll Lowercase_Letter
|
|
69
|
+
Lm Modifier_Letter
|
|
70
|
+
Lo Other_Letter
|
|
71
|
+
Lt Titlecase_Letter
|
|
72
|
+
Lu Uppercase_Letter
|
|
73
|
+
M Mark Combining_Mark
|
|
74
|
+
Mc Spacing_Mark
|
|
75
|
+
Me Enclosing_Mark
|
|
76
|
+
Mn Nonspacing_Mark
|
|
77
|
+
N Number
|
|
78
|
+
Nd Decimal_Number digit
|
|
79
|
+
Nl Letter_Number
|
|
80
|
+
No Other_Number
|
|
81
|
+
P Punctuation punct
|
|
82
|
+
Pc Connector_Punctuation
|
|
83
|
+
Pd Dash_Punctuation
|
|
84
|
+
Pe Close_Punctuation
|
|
85
|
+
Pf Final_Punctuation
|
|
86
|
+
Pi Initial_Punctuation
|
|
87
|
+
Po Other_Punctuation
|
|
88
|
+
Ps Open_Punctuation
|
|
89
|
+
S Symbol
|
|
90
|
+
Sc Currency_Symbol
|
|
91
|
+
Sk Modifier_Symbol
|
|
92
|
+
Sm Math_Symbol
|
|
93
|
+
So Other_Symbol
|
|
94
|
+
Z Separator
|
|
95
|
+
Zl Line_Separator
|
|
96
|
+
Zp Paragraph_Separator
|
|
97
|
+
Zs Space_Separator
|
|
98
|
+
ASCII
|
|
99
|
+
ASCII_Hex_Digit AHex
|
|
100
|
+
Alphabetic Alpha
|
|
101
|
+
Any
|
|
102
|
+
Assigned
|
|
103
|
+
Bidi_Control Bidi_C
|
|
104
|
+
Bidi_Mirrored Bidi_M
|
|
105
|
+
Case_Ignorable CI
|
|
106
|
+
Cased
|
|
107
|
+
Changes_When_Casefolded CWCF
|
|
108
|
+
Changes_When_Casemapped CWCM
|
|
109
|
+
Changes_When_Lowercased CWL
|
|
110
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
111
|
+
Changes_When_Titlecased CWT
|
|
112
|
+
Changes_When_Uppercased CWU
|
|
113
|
+
Dash
|
|
114
|
+
Default_Ignorable_Code_Point DI
|
|
115
|
+
Deprecated Dep
|
|
116
|
+
Diacritic Dia
|
|
117
|
+
Emoji
|
|
118
|
+
Emoji_Component EComp
|
|
119
|
+
Emoji_Modifier EMod
|
|
120
|
+
Emoji_Modifier_Base EBase
|
|
121
|
+
Emoji_Presentation EPres
|
|
122
|
+
Extended_Pictographic ExtPict
|
|
123
|
+
Extender Ext
|
|
124
|
+
Grapheme_Base Gr_Base
|
|
125
|
+
Grapheme_Extend Gr_Ext
|
|
126
|
+
Hex_Digit Hex
|
|
127
|
+
IDS_Binary_Operator IDSB
|
|
128
|
+
IDS_Trinary_Operator IDST
|
|
129
|
+
ID_Continue IDC
|
|
130
|
+
ID_Start IDS
|
|
131
|
+
Ideographic Ideo
|
|
132
|
+
Join_Control Join_C
|
|
133
|
+
Logical_Order_Exception LOE
|
|
134
|
+
Lowercase Lower
|
|
135
|
+
Math
|
|
136
|
+
Noncharacter_Code_Point NChar
|
|
137
|
+
Pattern_Syntax Pat_Syn
|
|
138
|
+
Pattern_White_Space Pat_WS
|
|
139
|
+
Quotation_Mark QMark
|
|
140
|
+
Radical
|
|
141
|
+
Regional_Indicator RI
|
|
142
|
+
Sentence_Terminal STerm
|
|
143
|
+
Soft_Dotted SD
|
|
144
|
+
Terminal_Punctuation Term
|
|
145
|
+
Unified_Ideograph UIdeo
|
|
146
|
+
Uppercase Upper
|
|
147
|
+
Variation_Selector VS
|
|
148
|
+
White_Space space
|
|
149
|
+
XID_Continue XIDC
|
|
150
|
+
XID_Start XIDS`.split(/\s/).map(e=>[Gn(e),e])),sf=new Map([["s",Q(383)],[Q(383),"s"]]),af=new Map([[Q(223),Q(7838)],[Q(107),Q(8490)],[Q(229),Q(8491)],[Q(969),Q(8486)]]),lf=new Map([Ge(453),Ge(456),Ge(459),Ge(498),...ai(8072,8079),...ai(8088,8095),...ai(8104,8111),Ge(8124),Ge(8140),Ge(8188)]),df=new Map([["alnum",O`[\p{Alpha}\p{Nd}]`],["alpha",O`\p{Alpha}`],["ascii",O`\p{ASCII}`],["blank",O`[\p{Zs}\t]`],["cntrl",O`\p{Cc}`],["digit",O`\p{Nd}`],["graph",O`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",O`\p{Lower}`],["print",O`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",O`[\p{P}\p{S}]`],["space",O`\p{space}`],["upper",O`\p{Upper}`],["word",O`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",O`\p{AHex}`]]);function uf(e,t){const n=[];for(let i=e;i<=t;i++)n.push(i);return n}function Ge(e){const t=Q(e);return[t.toLowerCase(),t]}function ai(e,t){return uf(e,t).map(n=>Ge(n))}var va=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function cf(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};ba(e);const i={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Wi(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Dt(e,hf,i);const r={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},o={currentFlags:r,prevFlags:null,globalFlags:r,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:i.subroutineRefMap};Dt(e,ff,o);const s={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return Dt(e,pf,s),e._originMap=o.groupOriginByCopy,e._strategy=i.strategy,e}var hf={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:i,kind:r}=e;if(r==="repeater"){const o=ge();o.body[0].body.push(Ze({negate:!0,body:i}),ft("Any"));const s=ge();s.body[0].body.push(ca("greedy",0,1/0,o)),n(W(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:i}){const r=e.body.filter(o=>o.kind==="flags");for(let o=n+1;o<t.body.length;o++){const s=t.body[o];$t(i,s,[]).push(...r)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Ea(t.get(e));if(n){const i=ge({flags:n});i.body[0].body=e.body,e.body=[W(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:i,root:r,remove:o,replaceWith:s},l){const{kind:a,negate:d}=e,{asciiWordBoundaries:u,avoidSubclass:c,supportedGNodes:f,wordIsAscii:h}=l;if(a==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if(a==="line_end")s(W(Ze({body:[st({body:[Bi("string_end")]}),st({body:[zn(10)]})]}),t));else if(a==="line_start")s(W(Ae(O`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(a==="search_start")if(f.has(e))r.flags.sticky=!0,o();else{const m=i[n-1];if(m&&yf(m))s(W(Ze({negate:!0}),t));else{if(c)throw new Error(O`Uses "\G" in a way that requires a subclass`);s(je(Bi("string_start"),t)),l.strategy="clip_search"}}else if(!(a==="string_end"||a==="string_start"))if(a==="string_end_newline")s(W(Ae(O`(?=\n?\z)`),t));else if(a==="word_boundary"){if(!h&&!u){const m=`(?:(?<=${xe})(?!${xe})|(?<!${xe})(?=${xe}))`,g=`(?:(?<=${xe})(?=${xe})|(?<!${xe})(?!${xe}))`;s(W(Ae(d?g:m),t))}}else throw new Error(`Unexpected assertion kind "${a}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!di(n)&&(n=li(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;i&&!di(i)&&(i=li(i,t),e.name=i),n.set(e.number,e),i&&n.set(i,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const i=mn({body:[e]});n(W(i,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:i,minTargetEs2024:r,digitIsAscii:o,spaceIsAscii:s,wordIsAscii:l}){const{kind:a,negate:d,value:u}=e;if(o&&(a==="digit"||u==="digit")){n(je(Gi("digit",{negate:d}),t));return}if(s&&(a==="space"||u==="space")){n(W(ui(Ae(rf),d),t));return}if(l&&(a==="word"||u==="word")){n(je(Gi("word",{negate:d}),t));return}if(a==="any")n(je(ft("Any"),t));else if(a==="digit")n(je(ft("Nd",{negate:d}),t));else if(a!=="dot")if(a==="text_segment"){if(i==="strict")throw new Error(O`Use of "\X" requires non-strict accuracy`);const c="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",f=O`\p{RI}{2}|${c}(?:\u200D${c})*`;n(W(Ae(O`(?>\r\n|${r?O`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(a==="hex")n(je(ft("AHex",{negate:d}),t));else if(a==="newline")n(W(Ae(d?`[^
|
|
151
|
+
]`:`(?>\r
|
|
152
|
+
?|[
|
|
153
|
+
\v\f
\u2028\u2029])`),t));else if(a==="posix")if(!r&&(u==="graph"||u==="print")){if(i==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let c={graph:"!-~",print:" -~"}[u];d&&(c=`\0-${Q(c.codePointAt(0)-1)}${Q(c.codePointAt(2)+1)}-`),n(W(Ae(`[${c}]`),t))}else n(W(ui(Ae(df.get(u)),d),t));else if(a==="property")Er.has(Gn(u))||(e.key="sc");else if(a==="space")n(je(ft("space",{negate:d}),t));else if(a==="word")n(W(ui(Ae(xe),d),t));else throw new Error(`Unexpected character set kind "${a}"`)},Directive({node:e,parent:t,root:n,remove:i,replaceWith:r,removeAllPrevSiblings:o,removeAllNextSiblings:s}){const{kind:l,flags:a}=e;if(l==="flags")if(!a.enable&&!a.disable)i();else{const d=ge({flags:a});d.body[0].body=s(),r(W(d,t),{traverse:!0})}else if(l==="keep"){const d=n.body[0],c=n.body.length===1&&la(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:n;if(t.parent!==c||c.body.length>1)throw new Error(O`Uses "\K" in a way that's unsupported`);const f=Ze({behind:!0});f.body[0].body=o(),r(W(f,t))}else throw new Error(`Unexpected directive kind "${l}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:i}=e;if(i==="fail")n(W(Ze({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=ge();t.body[0].body.push(e.body),e.body=W(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let i=!1,r=!1;for(const o of e.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const s=Ca(o.body);s?(i=!0,Array.isArray(s)?n.push(...s):n.push(s)):r=!0}i&&!r&&n.forEach(o=>t.add(o))},exit(e,{accuracy:t,passedLookbehind:n,strategy:i}){if(t==="strict"&&n&&i)throw new Error(O`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!di(n)&&(n=li(n,t),e.ref=n)}},ff={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:i,ref:r}=e;i||n.set(e,[...t.get(r).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:i},{groupOriginByCopy:r,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:l,reffedNodesByReferencer:a}){const d=r.get(e);if(d&&l.has(e.number)){const c=je(fo(e.number),t);a.set(c,l.get(e.number)),n(c);return}l.set(e.number,e),s.set(e.number,[]),e.name&&$t(s,e.name,[]);const u=s.get(e.name??e.number);for(let c=0;c<u.length;c++){const f=u[c];if(d===f.node||d&&d===f.origin||e===f.origin){u.splice(c,1);break}}if(s.get(e.number).push({node:e,origin:d}),e.name&&s.get(e.name).push({node:e,origin:d}),e.name){const c=$t(o,e.name,new Map);let f=!1;if(d)f=!0;else for(const h of c.values())if(!h.hasDuplicateNameToRemove){f=!0;break}o.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:f})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Rn(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},i){const{isRecursive:r,ref:o}=e;if(r){let u=t;for(;(u=u.parent)&&!(u.type==="CapturingGroup"&&(u.name===o||u.number===o)););i.reffedNodesByReferencer.set(e,u);return}const s=i.subroutineRefMap.get(o),l=o===0,a=l?fo(0):ya(s,i.groupOriginByCopy,null);let d=a;if(!l){const u=Ea(_f(s,f=>f.type==="Group"&&!!f.flags)),c=u?Rn(i.globalFlags,u):i.globalFlags;mf(c,i.currentFlags)||(d=ge({flags:vf(c)}),d.body[0].body.push(a))}n(W(d,t),{traverse:!l})}},pf={Backreference({node:e,parent:t,replaceWith:n},i){if(e.orphan){i.highestOrphanBackref=Math.max(i.highestOrphanBackref,e.ref);return}const o=i.reffedNodesByReferencer.get(e).filter(s=>gf(s,e));if(!o.length)n(W(Ze({negate:!0}),t));else if(o.length>1){const s=ge({atomic:!0,body:o.reverse().map(l=>st({body:[zi(l.number)]}))});n(W(s,t))}else e.ref=o[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let i=0;i<n;i++){const r=ua();e.body.at(-1).body.push(r)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function ba(e){Dt(e,{"*"({node:t,parent:n}){t.parent=n}})}function mf(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function gf(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const i=Sa(n.parent);for(const r of i){if(r===n)break;if(r===e||La(r,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function ya(e,t,n,i){const r=Array.isArray(e)?[]:{};for(const[o,s]of Object.entries(e))o==="parent"?r.parent=Array.isArray(n)?i:n:s&&typeof s=="object"?r[o]=ya(s,t,r,n):(o==="type"&&s==="CapturingGroup"&&t.set(r,t.get(e)??e),r[o]=s);return r}function fo(e){const t=ha(e);return t.isRecursive=!0,t}function _f(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function li(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function Ea(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:i})=>{t.forEach(r=>{i.enable?.[r]&&(delete n.disable[r],n.enable[r]=!0),i.disable?.[r]&&(n.disable[r]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function vf({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Sa(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Ca(e){const t=e.find(n=>n.kind==="search_start"||Ef(n,{negate:!1})||!bf(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const i of t.body){const r=Ca(i.body);if(!r)return null;Array.isArray(r)?n.push(...r):n.push(r)}return n}return null}function La(e,t){const n=Sa(e)??[];for(const i of n)if(i===t||La(i,t))return!0;return!1}function bf({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function yf(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Ef(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&la(e.body[0],{type:"Assertion",kind:"search_start"})}function di(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Ae(e,t){const i=da(e,{...t,unicodePropertyMap:Er}).body;return i.length>1||i[0].body.length>1?ge({body:i}):i[0].body[0]}function ui(e,t){return e.negate=t,e}function je(e,t){return e.parent=t,e}function W(e,t){return ba(e),e.parent=t,e}function Sf(e,t){const n=ga(t),i=Wi(n.target,"ES2024"),r=Wi(n.target,"ES2025"),o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,l=null;if(!r){const h=[e.flags.ignoreCase];Dt(e,Cf,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(m){h.push(m)},setHasCasedChar(){h.at(-1)?s=!0:l=!0}})}const a={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!l)};let d=e;const u={accuracy:n.accuracy,appliedGlobalFlags:a,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!r&&s&&l),useFlagMods:r,useFlagV:i,verbose:n.verbose};function c(h){return u.lastNode=d,d=h,tf(Lf[h.type],`Unexpected node type "${h.type}"`)(h,u,c)}const f={pattern:e.body.map(c).join("|"),flags:c(e.flags),options:{...e.options}};return i||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((h,m)=>{h.hidden&&f._hiddenCaptures.push(m),h.transferTo&&$t(f._captureTransfers,h.transferTo,[]).push(m)}),f}var Cf={"*":{enter({node:e},t){if(mo(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Rn({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){mo(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Sr(Q(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),wa(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&va.has(e.value)&&t.setHasCasedChar()}},Lf={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?O`\B`:O`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:i,name:r,number:o}=e,s={ignoreCase:t.currentFlags.ignoreCase},l=t.originMap.get(e);return l&&(s.hidden=!0,o>l.number&&(s.transferTo=l.number)),t.captureMap.set(o,s),`(${r?`?<${r}>`:""}${i.map(n).join("|")})`},Character({value:e},t){const n=Q(e),i=dt(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Sr(n)){const r=_a(n);return t.inCharClass?r.join(""):r.length>1?`[${r.join("")}]`:r[0]}return n},CharacterClass(e,t,n){const{kind:i,negate:r,parent:o}=e;let{body:s}=e;if(i==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");_e.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(go)&&(s=[zn(45),...s.filter(d=>!go(d))]);const l=()=>`[${r?"^":""}${s.map(n).join(i==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||_e.bugNestedClassIgnoresNegation)&&!r){const u=s.filter(c=>c.type==="CharacterClass"&&c.kind==="union"&&c.negate);if(u.length){const c=ge(),f=c.body[0];return c.parent=o,f.parent=c,s=s.filter(h=>!u.includes(h)),e.body=s,s.length?(e.parent=f,f.body.push(e)):c.body.pop(),u.forEach(h=>{const m=st({body:[h]});h.parent=m,m.parent=c,c.body.push(m)}),n(c)}}t.inCharClass=!0;const d=l();return t.inCharClass=!1,d}const a=s[0];if(i==="union"&&!r&&a&&((!t.useFlagV||!t.verbose)&&o.kind==="union"&&!(_e.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&o.kind==="intersection"&&s.length===1&&a.type!=="CharacterClassRange"))return s.map(n).join("");if(!t.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return l()},CharacterClassRange(e,t){const n=e.min.value,i=e.max.value,r={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=dt(n,r),s=dt(i,r),l=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const a=wa(e);Rf(a).forEach(u=>{l.add(Array.isArray(u)?`${dt(u[0],r)}-${dt(u[1],r)}`:dt(u,r))})}return`${o}-${s}${[...l].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:i},r){if(e==="dot")return r.currentFlags.dotAll?r.appliedGlobalFlags.dotAll||r.useFlagMods?".":"[^]":O`[^\n]`;if(e==="digit")return t?O`\D`:O`\d`;if(e==="property"){if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase&&va.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?O`\P`:O`\p`}{${i?`${i}=`:""}${n}}`}if(e==="word")return t?O`\W`:O`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:i},r,o){const s=r.currentFlags;n&&(r.currentFlags=Rn(s,n));const l=t.map(o).join("|"),a=!r.verbose&&t.length===1&&i.type!=="Quantifier"&&!e&&(!r.useFlagMods||!n)?l:`(?${Tf(e,n,r.useFlagMods)}${l})`;return r.currentFlags=s,a},LookaroundAssertion({body:e,kind:t,negate:n},i,r){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(r).join("|")})`},Quantifier(e,t,n){return n(e.body)+If(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const i=n.recursionLimit;return t===0?`(?R=${i})`:O`\g<${t}&R=${i}>`}},wf=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),kf=new Set(["-","\\","]","^","["]),xf=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),po=new Map([[9,O`\t`],[10,O`\n`],[11,O`\v`],[12,O`\f`],[13,O`\r`],[8232,O`\u2028`],[8233,O`\u2029`],[65279,O`\uFEFF`]]),Af=new RegExp("^\\p{Cased}$","u");function Sr(e){return Af.test(e)}function wa(e,t){const n=!!t?.firstOnly,i=e.min.value,r=e.max.value,o=[];if(i<65&&(r===65535||r>=131071)||i===65536&&r>=131071)return o;for(let s=i;s<=r;s++){const l=Q(s);if(!Sr(l))continue;const a=_a(l).filter(d=>{const u=d.codePointAt(0);return u<i||u>r});if(a.length&&(o.push(...a),n))break}return o}function dt(e,{escDigit:t,inCharClass:n,useFlagV:i}){if(po.has(e))return po.get(e);if(e<32||e>126&&e<160||e>262143||t&&Pf(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const r=n?i?xf:kf:wf,o=Q(e);return(r.has(o)?"\\":"")+o}function Rf(e){const t=e.map(r=>r.codePointAt(0)).sort((r,o)=>r-o),n=[];let i=null;for(let r=0;r<t.length;r++)t[r+1]===t[r]+1?i??=t[r]:i===null?n.push(t[r]):(n.push([i,t[r]]),i=null);return n}function Tf(e,t,n){if(e)return">";let i="";if(t&&n){const{enable:r,disable:o}=t;i=(r?.ignoreCase?"i":"")+(r?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${i}:`}function If({kind:e,max:t,min:n}){let i;return!n&&t===1?i="?":!n&&t===1/0?i="*":n===1&&t===1/0?i="+":n===t?i=`{${n}}`:i=`{${n},${t===1/0?"":t}}`,i+{greedy:"",lazy:"?",possessive:"+"}[e]}function mo({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Pf(e){return e>47&&e<58}function go({type:e,value:t}){return e==="Character"&&t===45}var Df=class qi extends RegExp{#t=new Map;#e=null;#i;#n=null;#r=null;rawOptions={};get source(){return this.#i||"(?:)"}constructor(t,n,i){const r=!!i?.lazyCompile;if(t instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const o=t;super(o,n),this.#i=o.source,o instanceof qi&&(this.#t=o.#t,this.#n=o.#n,this.#r=o.#r,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...i};super(r?"":t,n),this.#i=t,this.#t=Nf(o.hiddenCaptures,o.transfers),this.#r=o.strategy,this.rawOptions=i??{}}r||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:r,...o}=this.rawOptions;this.#e=new qi(this.#i,this.flags,o)}const n=this.global||this.sticky,i=this.lastIndex;if(this.#r==="clip_search"&&n&&i){this.lastIndex=0;const r=this.#o(t.slice(i));return r&&(Of(r,i,t,this.hasIndices),this.lastIndex+=i),r}return this.#o(t)}#o(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const i=[...n];n.length=1;let r;this.hasIndices&&(r=[...n.indices],n.indices.length=1);const o=[0];for(let s=1;s<i.length;s++){const{hidden:l,transferTo:a}=this.#t.get(s)??{};if(l?o.push(null):(o.push(n.length),n.push(i[s]),this.hasIndices&&n.indices.push(r[s])),a&&i[s]!==void 0){const d=o[a];if(!d)throw new Error(`Invalid capture transfer to "${d}"`);if(n[d]=i[s],this.hasIndices&&(n.indices[d]=r[s]),n.groups){this.#n||(this.#n=Mf(this.source));const u=this.#n.get(a);u&&(n.groups[u]=i[s],this.hasIndices&&(n.indices.groups[u]=r[s]))}}}return n}};function Of(e,t,n,i){if(e.index+=t,e.input=n,i){const r=e.indices;for(let s=0;s<r.length;s++){const l=r[s];l&&(r[s]=[l[0]+t,l[1]+t])}const o=r.groups;o&&Object.keys(o).forEach(s=>{const l=o[s];l&&(o[s]=[l[0]+t,l[1]+t])})}}function Nf(e,t){const n=new Map;for(const i of e)n.set(i,{hidden:!0});for(const[i,r]of t)for(const o of r)$t(n,o,{}).transferTo=i;return n}function Mf(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let i=0,r=0,o;for(;o=t.exec(e);){const{0:s,groups:{capture:l,name:a}}=o;s==="["?i++:i?s==="]"&&i--:l&&(r++,a&&n.set(r,a))}return n}function Hf(e,t){const n=Ff(e,t);return n.options?new Df(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Ff(e,t){const n=ga(t),i=da(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Er}),r=cf(i,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=Sf(r,n),s=Zh(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),l=Jh(s.pattern),a=Qh(l.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),d={pattern:a.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const u=a.hiddenCaptures.sort((m,g)=>m-g),c=Array.from(a.captureTransfers),f=r._strategy,h=d.pattern.length>=n.lazyCompileLength;(u.length||c.length||f||h)&&(d.options={...u.length&&{hiddenCaptures:u},...c.length&&{transfers:c},...f&&{strategy:f},...h&&{lazyCompile:h}})}return d}function Vf(e,t){return Hf(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function $f(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>Vf(n,{target:t.target}),{createScanner(n){return new nh(n,t)},createString(n){return{content:n}}}}async function Uf(e){if(Hs())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=ti.get(e);if(t!=null)return t;try{let n=xu.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Vi,e)&&(n=Vi[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:r})=>{const o={name:e,data:r};return Ht.has(e)||Ht.set(e,o),o});return ti.set(e,i),await i}finally{ti.delete(e)}}function Bf(e){return Ht.get(e)??Uf(e)}function pt(e){for(const t of gr(e))if(!Hi.has(t))return!1;return!0}function ka({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:zf(t)}}function zf(e){return async()=>$n(Ms(await e()))}const Gf="pierre",jf=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],xa=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],Wf=[...xa,...jf],qf=new Set(xa);function Kf(e){return qf.has(e)?"light":"dark"}const Xf={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},Qf={"pierre-dark":()=>p(()=>import("./pierre-dark-CyvmCCZW.js"),[],import.meta.url),"pierre-dark-soft":()=>p(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[],import.meta.url),"pierre-dark-vibrant":()=>p(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>p(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[],import.meta.url),"pierre-dark-tritanopia":()=>p(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[],import.meta.url),"pierre-light":()=>p(()=>import("./pierre-light-480U9XYS.js"),[],import.meta.url),"pierre-light-soft":()=>p(()=>import("./pierre-light-soft-CVdyfjmI.js"),[],import.meta.url),"pierre-light-vibrant":()=>p(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>p(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[],import.meta.url),"pierre-light-tritanopia":()=>p(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[],import.meta.url)};function Jf(e){return ka({name:e,collection:Gf,colorScheme:Kf(e),displayName:Xf[e],load:Qf[e]})}const Aa=Ft({themes:Wf.map(e=>Jf(e))}),Yf="shiki",Ra=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],Zf=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],ep=new Set(Ra);function tp(e){return ep.has(e)?"light":"dark"}const np={andromeeda:()=>p(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url),"aurora-x":()=>p(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url),"ayu-dark":()=>p(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url),"ayu-light":()=>p(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url),"ayu-mirage":()=>p(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url),"catppuccin-frappe":()=>p(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[],import.meta.url),"catppuccin-latte":()=>p(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[],import.meta.url),"catppuccin-macchiato":()=>p(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[],import.meta.url),"catppuccin-mocha":()=>p(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[],import.meta.url),"dark-plus":()=>p(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url),dracula:()=>p(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url),"dracula-soft":()=>p(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url),"everforest-dark":()=>p(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url),"everforest-light":()=>p(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url),"github-dark":()=>p(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),"github-dark-default":()=>p(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url),"github-dark-dimmed":()=>p(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url),"github-dark-high-contrast":()=>p(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url),"github-light":()=>p(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),"github-light-default":()=>p(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url),"github-light-high-contrast":()=>p(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url),"gruvbox-dark-hard":()=>p(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url),"gruvbox-dark-medium":()=>p(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url),"gruvbox-dark-soft":()=>p(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url),"gruvbox-light-hard":()=>p(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url),"gruvbox-light-medium":()=>p(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url),"gruvbox-light-soft":()=>p(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url),horizon:()=>p(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url),"horizon-bright":()=>p(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url),houston:()=>p(()=>import("./houston-DnULxvSX.js"),[],import.meta.url),"kanagawa-dragon":()=>p(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[],import.meta.url),"kanagawa-lotus":()=>p(()=>import("./kanagawa-lotus-C3DzagqV.js"),[],import.meta.url),"kanagawa-wave":()=>p(()=>import("./kanagawa-wave-DFGoQZhC.js"),[],import.meta.url),laserwave:()=>p(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url),"light-plus":()=>p(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url),"material-theme":()=>p(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url),"material-theme-darker":()=>p(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url),"material-theme-lighter":()=>p(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url),"material-theme-ocean":()=>p(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url),"material-theme-palenight":()=>p(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url),"min-dark":()=>p(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url),"min-light":()=>p(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url),monokai:()=>p(()=>import("./monokai-BRVnQi9A.js"),[],import.meta.url),"night-owl":()=>p(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url),"night-owl-light":()=>p(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url),nord:()=>p(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url),"one-dark-pro":()=>p(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url),"one-light":()=>p(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url),plastic:()=>p(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url),poimandres:()=>p(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url),red:()=>p(()=>import("./red-hvxz__6c.js"),[],import.meta.url),"rose-pine":()=>p(()=>import("./rose-pine-5qJOZa0Y.js"),[],import.meta.url),"rose-pine-dawn":()=>p(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[],import.meta.url),"rose-pine-moon":()=>p(()=>import("./rose-pine-moon-C9pEdX9L.js"),[],import.meta.url),"slack-dark":()=>p(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url),"slack-ochin":()=>p(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url),"snazzy-light":()=>p(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url),"solarized-dark":()=>p(()=>import("./solarized-dark-CpvCGNkr.js"),[],import.meta.url),"solarized-light":()=>p(()=>import("./solarized-light-Dlz6yCKv.js"),[],import.meta.url),"synthwave-84":()=>p(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url),"tokyo-night":()=>p(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url),vesper:()=>p(()=>import("./vesper-DRje8inN.js"),[],import.meta.url),"vitesse-black":()=>p(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url),"vitesse-dark":()=>p(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url),"vitesse-light":()=>p(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url)};function _o(e){return ka({name:e,collection:Yf,colorScheme:tp(e),load:np[e]})}const Ta=Ft({themes:Object.freeze([...Ra.map(e=>_o(e)),...Zf.map(e=>_o(e))])});Ft({themes:[Aa,Ta]});function ip(e){if(Hs())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(We.hasRegisteredTheme(e))return;const t=Ta.getTheme(e);if(t!=null){We.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function rp(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function op(e){ip(e);const t=await We.resolveTheme(e);return rp(e,t),t}function sp(e){return We.getResolvedTheme(e)??op(e)}let Se;async function Ia({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){Se??=th({themes:[],langs:["text"],engine:n==="shiki-wasm"?Bs(p(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url)):$f()});const i=ap(Se)?await Se:Se;Se=i;const r=[];for(const s of Array.from(new Set(t))){if(s==="text"||s==="ansi")continue;const l=Bf(s);"then"in l?r.push(l):Br(l,i)}const o=[];for(const s of e){const l=sp(s);"then"in l?o.push(l):Ur(l,Se)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Br(s,i)}),Promise.all(o).then(s=>{Ur(s,i)})]),i}function Ki(e){if(!(Se==null||"then"in Se)&&!(e!=null&&(!pt(e.theme)||!Mi(e.lang))))return Se}function ap(e=Se){return e!=null&&"then"in e}for(const e of Aa.getThemes())We.registerThemeIfAbsent(e.name,e.load);function Cr(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}const ut=new Map,Lt={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",mts:"typescript",cts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Me(e){if(ut.has(e))return ut.get(e)??"text";if(Lt[e]!=null)return Lt[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(ut.has(t[1]))return ut.get(t[1])??"text";if(Lt[t[1]]!=null)return Lt[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return ut.has(n)?ut.get(n)??"text":Lt[n]??"text"}function vo(e,t){for(const n of t)e.push(n)}function Le(e){return{type:"text",value:e}}function M({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function Tn({name:e,width:t=16,height:n=16,properties:i}){return M({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[M({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function lp(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Zt(e){return M({tagName:"div",properties:{"data-gutter":""},children:e})}function dp(e,t,n,i={}){return M({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[M({tagName:"span",properties:{"data-line-number-content":""},children:[Le(`${t}`)]})]:void 0})}function pe(e,t,n){return M({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function up(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(Le(`
|
|
154
|
+
`)),e}const en=Symbol("no-token"),ci=Symbol("multiple-tokens");function Pa(e){const t=cp(e);if(t!=null)return t;let n=en;const i=[];let r=[],o;const s=()=>{if(r.length===0||o==null){r=[],o=void 0;return}if(r.length===1){const a=r[0];if(a?.type==="element"){hp(a,o);for(const d of a.children)gn(d)}else gn(a);i.push(a),r=[],o=void 0;return}for(const a of r)gn(a);i.push(M({tagName:"span",properties:{"data-char":o},children:r})),r=[],o=void 0},l=a=>{if(a!==en){if(a===ci){n=ci;return}if(n===en){n=a;return}n!==a&&(n=ci)}};for(const a of e.children){const d=a.type==="element"?Pa(a):en;if(l(d),typeof d!="number"){s(),i.push(a);continue}o!=null&&o!==d&&s(),o??=d,r.push(a)}return s(),e.children=i,n}function cp(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function gn(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)gn(t)}}function hp(e,t){e.properties["data-char"]=t}function fp(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=l=>l}=e,r=new Map;function o(l){return Object.entries(l).map(([a,d])=>`${a}:${d}`).join(";")}function s(l){const a=typeof l=="string"?l:o(l);let d=t+pp(a)+n;return d=i(d),r.has(d)||r.set(d,typeof l=="string"?l:{...l}),d}return{name:"@shikijs/transformers:style-to-class",pre(l){if(!l.properties.style)return;const a=s(l.properties.style);delete l.properties.style,this.addClassToHast(l,a)},tokens(l){for(const a of l)for(const d of a){if(!d.htmlStyle)continue;const u=s(d.htmlStyle);d.htmlStyle={},d.htmlAttrs||={},d.htmlAttrs.class?d.htmlAttrs.class+=` ${u}`:d.htmlAttrs.class=u}},getClassRegistry(){return r},getCSS(){let l="";for(const[a,d]of r.entries())l+=`.${a}{${typeof d=="string"?d:o(d)}}`;return l},clearRegistry(){r.clear()}}}function pp(e,t=0){let n=3735928559^t,i=1103547991^t;for(let r=0,o;r<e.length;r++)o=e.charCodeAt(r),n=Math.imul(n^o,2654435761),i=Math.imul(i^o,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(36).slice(0,6)}function mp(e=!1,t=!1){const n={lineInfo:[]},i=[{line(r){return delete r.properties.class,r},pre(r){const o=lp(r),s=[];if(o!=null){let l=1;for(const a of o.children)a.type==="element"&&(e&&Pa(a),s.push(up(a,l,n)),l++);o.children=s}return r},...e?{tokens(r){for(const o of r){let s=0;for(const l of o){const a=l;a.__lineChar??=s,s+=l.content.length}}},preprocess(r,o){o.mergeWhitespaces="never"},span(r,o,s,l,a){if(a?.offset!=null&&a.content!=null){const d=a.__lineChar;return d!=null&&(r.properties["data-char"]=d),r}return r}}:null}];return t&&i.push(gp,bo),e&&i.push({line:r=>(r.type==="element"&&r.children.length===0&&r.children.push({type:"element",tagName:"br",properties:{},children:[]}),r)}),{state:n,transformers:i,toClass:bo}}const bo=fp({classPrefix:"hl-"}),gp={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const i={};n.color!=null&&(i.color=n.color),n.bgColor!=null&&(i["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(i["font-style"]="italic"),(n.fontStyle&2)!==0&&(i["font-weight"]="bold"),(n.fontStyle&4)!==0&&(i["text-decoration"]="underline")),Object.keys(i).length>0&&(n.htmlStyle=i)}}};function me(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const _p=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,vp=/^0(?:\.0+)?%?$/;function bp(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const r=i.lastIndexOf("/");if(r!==-1)return i.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const o=i.split(",");if(o.length===4)return o[3]?.trim()}}function yp(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let i,r=1;return n.length===3?i=n.split("").map(o=>o+o).join(""):n.length===6?i=n:(i=n.slice(0,6),r=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),r]}function hi(e){if(e==null)return null;const t=yp(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,r=t[2]/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(i)+.0722*o(r)}function yo(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||_p.test(t))return!0;const n=bp(t);return n!=null&&vp.test(n)}function Ep(e,t,n){if(t==null||n==null)return!1;const i=hi(e),r=hi(t),o=hi(n);return i==null||r==null||o==null?!1:Math.abs(i-o)<Math.abs(i-r)}const Eo=new WeakMap;function fi(e){const t=Eo.get(e);if(t!=null)return t;const n=e.colors??{},i={...n},r=n["editor.background"]??e.bg,o=n["editor.foreground"]??e.fg,s=n["sideBar.background"]??r,l=n["sideBar.foreground"]??o;be(i,"editor.background",r),be(i,"editor.foreground",o),be(i,"sideBar.background",s),be(i,"sideBar.foreground",l),be(i,"input.background",n["input.background"]??s),be(i,"sideBarSectionHeader.foreground",n["sideBarSectionHeader.foreground"]??l),be(i,"list.activeSelectionForeground",n["list.activeSelectionForeground"]??l),be(i,"gitDecoration.addedResourceForeground",pi(n["gitDecoration.addedResourceForeground"],n["terminal.ansiGreen"],n["editorGutter.addedBackground"])),be(i,"gitDecoration.modifiedResourceForeground",pi(n["gitDecoration.modifiedResourceForeground"],n["terminal.ansiBlue"],n["editorGutter.modifiedBackground"])),be(i,"gitDecoration.deletedResourceForeground",pi(n["gitDecoration.deletedResourceForeground"],n["terminal.ansiRed"],n["editorGutter.deletedBackground"]));const a=(yo(n["list.focusOutline"])?void 0:n["list.focusOutline"])??(yo(n.focusBorder)?void 0:n.focusBorder);a!=null?i["list.focusOutline"]=a:delete i["list.focusOutline"];const d=n["list.hoverBackground"];d!=null&&(Sp(d,s)||Ep(d,s,l))&&delete i["list.hoverBackground"];const u=Object.freeze({...e,colors:Object.freeze(i)});return Eo.set(e,u),u}function be(e,t,n){n!=null&&n!==""&&(e[t]=n)}function pi(...e){for(const t of e)if(t!=null&&t!=="")return t}function Sp(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function Cp({theme:e=Ce,highlighter:t,prefix:n}){let i="";if(typeof e=="string"){const r=t.getTheme(e),o=fi(r);i+=`color:${o.fg};`,i+=`background-color:${o.bg};`,i+=`${me("global")}fg:${o.fg};`,i+=`${me("global")}bg:${o.bg};`,i+=mi(r,n)}else{let r=t.getTheme(e.dark),o=fi(r);i+=`${me("global")}dark:${o.fg};`,i+=`${me("global")}dark-bg:${o.bg};`,i+=mi(r,"dark"),r=t.getTheme(e.light),o=fi(r),i+=`${me("global")}light:${o.fg};`,i+=`${me("global")}light-bg:${o.bg};`,i+=mi(r,"light")}return i}function mi(e,t){t=t!=null?`${t}-`:"";let n="";const i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];i!=null&&(n+=`${me("global")}${t}addition-color:${i};`);const r=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];r!=null&&(n+=`${me("global")}${t}deletion-color:${r};`);const o=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return o!=null&&(n+=`${me("global")}${t}modified-color:${o};`),n}function So(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}function G(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e===t}function Da(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Re(e,t){return Cr(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Rt(e){const t=e.lang??Me(e.name),n=e.lang??(e.prevName!=null?Me(e.prevName):"text");return t==="text"&&n==="text"}function gi(e){return{...yu,...e}}function mt(e,t){const n=Lp(e,t);return t?n:e.diffHeaderHeight+n}function Lp(e,t){return e.paddingTop??(t?e.spacing:0)}function Oa(e){return e.paddingBottom??e.spacing}function wp(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}function Ut(e){return[ce(e.additionStart,e.additionCount)+1,oe(e.additionStart,e.additionCount)+1]}function He({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}){const o=Math.max(t,0);if(o===0||e)return{fromStart:0,fromEnd:0,rangeSize:o,collapsedLines:o,renderAll:!1};if(n===!0||o<=r)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};const s=n?.get(i),l=Math.min(Math.max(s?.fromStart??0,0),o),a=Math.min(Math.max(s?.fromEnd??0,0),o),d=l+a,u=d>=o;return{fromStart:u?o:l,fromEnd:u?0:a,rangeSize:o,collapsedLines:Math.max(o-d,0),renderAll:u}}function kp(e){const t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;const n=e.additionLines.length-oe(t.additionStart,t.additionCount),i=e.deletionLines.length-oe(t.deletionStart,t.deletionCount);return n<=0&&i<=0?!1:n!==i}function Na({fileDiff:e,errorPrefix:t}){const n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const i=e.additionLines.length-oe(n.additionStart,n.additionCount),r=e.deletionLines.length-oe(n.deletionStart,n.deletionCount);if(i<=0&&r<=0)return 0;if(i!==r)throw new Error(`${t}: trailing context mismatch (additions=${i}, deletions=${r}) for ${e.name}`);return Math.min(i,r)}function Fe({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:r}){if(t!==e.hunks.length-1)return;const o=Na({fileDiff:e,errorPrefix:r});if(o<=0)return;if(n===!0||o<=i)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};const s=n?.get(e.hunks.length),l=Math.min(Math.max(s?.fromStart??0,0),o);return{fromStart:l,fromEnd:0,rangeSize:o,collapsedLines:o-l,renderAll:l>=o}}function Ma({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:i}){if(n===!0||e.isPartial)return!0;for(const[l,a]of e.hunks.entries()){const[d,u]=Ut(a);if(t<d){const c=He({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:l,collapsedContextThreshold:i}),f=d-c.rangeSize;return c.renderAll||t<f+c.fromStart||t>=d-c.fromEnd}if(t<u)return!0}const r=Fe({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:"isAdditionLineRenderable"});if(r==null||r.renderAll)return!0;const o=e.hunks[e.hunks.length-1],[,s]=Ut(o);return t<s+r.fromStart||t>=s+r.rangeSize}function xp({fileDiff:e,lineNumber:t,direction:n,expandedHunks:i,collapsedContextThreshold:r}){if(i===!0||e.isPartial)return t;const o=[];let s=1;for(const[a,d]of e.hunks.entries()){const[u,c]=Ut(d),f=He({isPartial:e.isPartial,rangeSize:d.collapsedBefore,expandedHunks:i,hunkIndex:a,collapsedContextThreshold:r}),h=u-f.rangeSize;f.renderAll?o.push([h,u]):(f.fromStart>0&&o.push([h,h+f.fromStart]),f.fromEnd>0&&o.push([u-f.fromEnd,u])),o.push([u,c]),s=c}const l=Fe({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:i,collapsedContextThreshold:r,errorPrefix:"getNearestRenderableAdditionLine"});if(l!=null){const a=s;s=a+l.rangeSize,l.renderAll?o.push([a,s]):l.fromStart>0&&o.push([a,a+l.fromStart])}if(t>=s)return t;if(n==="down"){for(const[a,d]of o)if(d>t)return Math.max(a,t);return}for(let a=o.length-1;a>=0;a--){const[d,u]=o[a];if(d<=t)return Math.min(u-1,t)}}function Ha({type:e,metrics:t}){return t.hunkSeparatorHeight??wp(e)}function Fa({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function Ap({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case"simple":return t>0;case"metadata":return n!=null;case"line-info":case"line-info-basic":case"custom":return!0}}function Rp(e){return e!=="simple"&&e!=="metadata"}function Tt({type:e,metrics:t,hunkIndex:n,hunkSpecs:i}){if(!Ap({type:e,hunkIndex:n,hunkSpecs:i}))return;const r=Ha({type:e,metrics:t}),o=Fa({type:e,metrics:t}),s=n>0?o:0,l=o;return{height:r,gapBefore:s,gapAfter:l,totalHeight:s+r+l}}function et({type:e,metrics:t}){if(!Rp(e))return;const n=Ha({type:e,metrics:t}),i=Fa({type:e,metrics:t});return{height:n,gapBefore:i,gapAfter:0,totalHeight:i+n}}function ot({diff:e,diffStyle:t,startingLine:n=0,totalLines:i=1/0,expandedHunks:r,collapsedContextThreshold:o=1,callback:s}){const l=Tp({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:o}),a={viewportStart:n,viewportEnd:n+i,isWindowedHighlight:n>0||i<1/0,splitCount:l.splitCount,unifiedCount:l.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!a.isWindowedHighlight)return!1;const d=a.unifiedCount>=n+i,u=a.splitCount>=n+i;return t==="unified"?d:(t==="split"||d)&&u},shouldSkip(d,u){if(!a.isWindowedHighlight)return!1;const c=d>0&&a.unifiedCount+d<=n,f=u>0&&a.splitCount+u<=n;return t==="unified"?c:(t==="split"||c)&&f},incrementCounts(d,u){(t==="unified"||t==="both")&&(a.unifiedCount+=d),(t==="split"||t==="both")&&(a.splitCount+=u)},isInWindow(d,u){if(!a.isWindowedHighlight)return!0;const c=a.isInUnifiedWindow(d),f=a.isInSplitWindow(u);return t==="unified"?c:t==="split"?f:c||f},isInUnifiedWindow(d){return!a.isWindowedHighlight||a.unifiedCount>=n-d&&a.unifiedCount<n+i},isInSplitWindow(d){return!a.isWindowedHighlight||a.splitCount>=n-d&&a.splitCount<n+i},emit(d,u=!1){return u||(t==="unified"?a.incrementCounts(1,0):t==="split"?a.incrementCounts(0,1):a.incrementCounts(1,1)),s(d)??!1}};e:for(let d=l.hunkIndex;d<e.hunks.length;d++){let v=function(k,R){return b==null||b.collapsedLines<=0||b.fromStart+b.fromEnd>0?0:t==="unified"?k===u.unifiedLineStart+u.unifiedLineCount-1?b.collapsedLines:0:R===u.splitLineStart+u.splitLineCount-1?b.collapsedLines:0},S=function(){return y?0:(y=!0,g.collapsedLines)};const u=e.hunks[d];if(u==null)throw new Error("iterateOverDiff: invalid hunk index");if(a.shouldBreak())break;const c=ce(u.deletionStart,u.deletionCount),f=ce(u.additionStart,u.additionCount),h=!e.isPartial&&u.deletionCount===0?c:u.deletionLineIndex,m=!e.isPartial&&u.additionCount===0?f:u.additionLineIndex,g=He({isPartial:e.isPartial,rangeSize:u.collapsedBefore,expandedHunks:r,hunkIndex:d,collapsedContextThreshold:o}),b=d===a.finalHunkIndex?Fe({fileDiff:e,hunkIndex:d,expandedHunks:r,collapsedContextThreshold:o,errorPrefix:"iterateOverDiff"}):void 0,_=g.fromStart+g.fromEnd;let y=g.collapsedLines===0;if(a.shouldSkip(_,_))a.incrementCounts(_,_),S();else{let k=u.unifiedLineStart-g.rangeSize,R=u.splitLineStart-g.rangeSize,P=h-g.rangeSize,F=m-g.rangeSize,T=c+1-g.rangeSize,N=f+1-g.rangeSize;if(tn(a,g.fromStart,t,V=>a.emit({hunkIndex:d,hunk:u,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:T+V,lineIndex:P+V,noEOFCR:!1,unifiedLineIndex:k+V,splitLineIndex:R+V},additionLine:{unifiedLineIndex:k+V,splitLineIndex:R+V,lineIndex:F+V,lineNumber:N+V,noEOFCR:!1}}))||(k=u.unifiedLineStart-g.fromEnd,R=u.splitLineStart-g.fromEnd,P=h-g.fromEnd,F=m-g.fromEnd,T=c+1-g.fromEnd,N=f+1-g.fromEnd,tn(a,g.fromEnd,t,V=>a.emit({hunkIndex:d,hunk:u,collapsedBefore:S(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:T+V,lineIndex:P+V,noEOFCR:!1,unifiedLineIndex:k+V,splitLineIndex:R+V},additionLine:{unifiedLineIndex:k+V,splitLineIndex:R+V,lineIndex:F+V,lineNumber:N+V,noEOFCR:!1}}),()=>{S()})))break e}let E=u.unifiedLineStart,C=u.splitLineStart,L=h,x=m,w=c+1,A=f+1;const I=u.hunkContent.at(-1);for(const k of u.hunkContent){if(a.shouldBreak())break e;const R=k===I;if(k.type==="context"){if(a.shouldSkip(k.lines,k.lines))a.incrementCounts(k.lines,k.lines),S();else if(tn(a,k.lines,t,P=>{const F=R&&P===k.lines-1,T=E+P,N=C+P;return a.emit({hunkIndex:d,hunk:u,collapsedBefore:S(),collapsedAfter:v(T,N),type:"context",deletionLine:{lineNumber:w+P,lineIndex:L+P,noEOFCR:F&&u.noEOFCRDeletions,unifiedLineIndex:T,splitLineIndex:N},additionLine:{unifiedLineIndex:T,splitLineIndex:N,lineIndex:x+P,lineNumber:A+P,noEOFCR:F&&u.noEOFCRAdditions}})},()=>{S()}))break e;E+=k.lines,C+=k.lines,L+=k.lines,x+=k.lines,w+=k.lines,A+=k.lines}else{const P=Math.max(k.deletions,k.additions),F=k.deletions+k.additions;if(!a.shouldSkip(F,P)){const T=Dp(a,k,t);(T[0]?.[0]??0)>0&&S();for(const[N,V]of T)for(let D=N;D<V;D++){const H=v(E+D,t==="unified"?C+(D<k.deletions?D:D-k.deletions):C+D);if(a.emit(Op({hunkIndex:d,hunk:u,collapsedBefore:S(),collapsedAfter:H,diffStyle:t,index:D,unifiedLineIndex:E,splitLineIndex:C,additionLineIndex:x,deletionLineIndex:L,additionLineNumber:A,deletionLineNumber:w,content:k,isLastContent:R,unifiedCount:F,splitCount:P}),!0))break e}}S(),a.incrementCounts(F,P),E+=F,C+=P,L+=k.deletions,x+=k.additions,w+=k.deletions,A+=k.additions}}if(b!=null){const{collapsedLines:k,fromStart:R,fromEnd:P}=b,F=R+P;if(tn(a,F,t,T=>{const N=T===F-1;return a.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:N?k:0,type:"context-expanded",deletionLine:{lineNumber:w+T,lineIndex:L+T,noEOFCR:!1,unifiedLineIndex:E+T,splitLineIndex:C+T},additionLine:{unifiedLineIndex:E+T,splitLineIndex:C+T,lineIndex:x+T,lineNumber:A+T,noEOFCR:!1}})},void 0,()=>a.shouldBreak()))break e}}}function Tp({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:r}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const o=Ip({diff:e,expandedHunks:i,collapsedContextThreshold:r});let s=0,l=e.hunks.length-1,a=e.hunks.length;for(;s<=l;){const u=s+l>>1,c=o[u+1];if(c==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?c.unifiedCount:c.splitCount)>n?(a=u,l=u-1):s=u+1}if(a>=e.hunks.length){const u=o[e.hunks.length];if(u==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:u.splitCount,unifiedCount:u.unifiedCount}}const d=o[a];if(d==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:a,splitCount:d.splitCount,unifiedCount:d.unifiedCount}}function Ip({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let i=0,r=0;const o=e.hunks.length-1,s=[{splitCount:0,unifiedCount:0}];for(let l=0;l<e.hunks.length;l++){const a=e.hunks[l];if(a==null)throw new Error("iterateOverDiff: invalid hunk summary index");const d=He({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:l,collapsedContextThreshold:n}),u=d.fromStart+d.fromEnd;i+=u+a.splitLineCount,r+=u+a.unifiedLineCount;const c=l===o?Fe({fileDiff:e,hunkIndex:l,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"iterateOverDiff"}):void 0;if(c!=null){const f=c.fromStart+c.fromEnd;i+=f,r+=f}s.push({splitCount:i,unifiedCount:r})}return s}function Pp(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];const i=[];function r(l){const a=Math.max(0,e.viewportStart-l),d=Math.min(t,e.viewportEnd-l);d>a&&i.push([a,d])}if(n!=="split"&&r(e.unifiedCount),n!=="unified"&&r(e.splitCount),i.length===0)return[0,0];let o=i[0][0],s=i[0][1];for(let l=1;l<i.length;l++){const a=i[l];o=Math.min(o,a[0]),s=Math.max(s,a[1])}return[o,s]}function tn(e,t,n,i,r,o){const[s,l]=Pp(e,t,n);s>0&&(e.incrementCounts(s,s),r?.());let a=s;for(;a<t;){if(o?.()===!0)return!0;if(a>=l){e.incrementCounts(t-a,t-a);break}if(e.isInWindow(0,0)){if(i(a)===!0)return!0}else e.incrementCounts(1,1);a++}return!1}function Dp(e,t,n){if(!e.isWindowedHighlight)return[[0,n==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const i=n!=="split",r=n!=="unified",o=n==="unified"?"unified":"split",s=[];function l(c,f){if(c+f<=e.viewportStart||c>=e.viewportEnd)return;const h=Math.max(0,e.viewportStart-c),m=Math.min(f,e.viewportEnd-c);return m>h?[h,m]:void 0}function a(c,f){return o==="split"?c:f==="additions"?[c[0]+t.deletions,c[1]+t.deletions]:c}function d(c,f){if(c==null)return;const[h,m]=a(c,f);m>h&&s.push([h,m])}if(i&&(d(l(e.unifiedCount,t.deletions),"deletions"),d(l(e.unifiedCount+t.deletions,t.additions),"additions")),r&&(d(l(e.splitCount,t.deletions),"deletions"),d(l(e.splitCount,t.additions),"additions")),s.length===0)return s;s.sort((c,f)=>c[0]-f[0]);const u=[s[0]];for(const[c,f]of s.slice(1)){const h=u[u.length-1];c<=h[1]?h[1]=Math.max(h[1],f):u.push([c,f])}return u}function Op({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,diffStyle:r,index:o,unifiedLineIndex:s,splitLineIndex:l,additionLineIndex:a,deletionLineIndex:d,additionLineNumber:u,deletionLineNumber:c,content:f,isLastContent:h,unifiedCount:m,splitCount:g}){const b=o<f.deletions?s+o:void 0,_=r==="unified"?o>=f.deletions?s+o:void 0:o<f.additions?s+f.deletions+o:void 0,v=r==="unified"?l+(o<f.deletions?o:o-f.deletions):l+o,y=o<f.deletions?d+o:void 0,S=o<f.deletions?c+o:void 0,E=r==="unified"?o>=f.deletions?a+(o-f.deletions):void 0:o<f.additions?a+o:void 0,C=r==="unified"?o>=f.deletions?u+(o-f.deletions):void 0:o<f.additions?u+o:void 0,L=r==="unified"?h&&o===f.deletions-1&&t.noEOFCRDeletions:h&&o===g-1&&t.noEOFCRDeletions,x=r==="unified"?h&&o===m-1&&t.noEOFCRAdditions:h&&o===g-1&&t.noEOFCRAdditions,w=y!=null&&S!=null&&b!=null?{lineNumber:S,lineIndex:y,noEOFCR:L,unifiedLineIndex:b,splitLineIndex:v}:void 0,A=E!=null&&C!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:E,lineNumber:C,noEOFCR:x}:void 0;if(w==null&&A!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:void 0,additionLine:A};if(w!=null&&A==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:w,additionLine:void 0};if(w==null||A==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:w,additionLine:A}}function Ve(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}class Lr{diff(t,n,i={}){let r;typeof i=="function"?(r=i,i={}):"callback"in i&&(r=i.callback);const o=this.castInput(t,i),s=this.castInput(n,i),l=this.removeEmpty(this.tokenize(o,i)),a=this.removeEmpty(this.tokenize(s,i));return this.diffWithOptionsObj(l,a,i,r)}diffWithOptionsObj(t,n,i,r){var o;const s=v=>{if(v=this.postProcess(v,i),r){setTimeout(function(){r(v)},0);return}else return v},l=n.length,a=t.length;let d=1,u=l+a;i.maxEditLength!=null&&(u=Math.min(u,i.maxEditLength));const c=(o=i.timeout)!==null&&o!==void 0?o:1/0,f=Date.now()+c,h=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(h[0],n,t,0,i);if(h[0].oldPos+1>=a&&m+1>=l)return s(this.buildValues(h[0].lastComponent,n,t));let g=-1/0,b=1/0;const _=()=>{for(let v=Math.max(g,-d);v<=Math.min(b,d);v+=2){let y;const S=h[v-1],E=h[v+1];S&&(h[v-1]=void 0);let C=!1;if(E){const x=E.oldPos-v;C=E&&0<=x&&x<l}const L=S&&S.oldPos+1<a;if(!C&&!L){h[v]=void 0;continue}if(!L||C&&S.oldPos<E.oldPos?y=this.addToPath(E,!0,!1,0,i):y=this.addToPath(S,!1,!0,1,i),m=this.extractCommon(y,n,t,v,i),y.oldPos+1>=a&&m+1>=l)return s(this.buildValues(y.lastComponent,n,t))||!0;h[v]=y,y.oldPos+1>=a&&(b=Math.min(b,v-1)),m+1>=l&&(g=Math.max(g,v+1))}d++};if(r)(function v(){setTimeout(function(){if(d>u||Date.now()>f)return r(void 0);_()||v()},0)})();else for(;d<=u&&Date.now()<=f;){const v=_();if(v)return v}}addToPath(t,n,i,r,o){const s=t.lastComponent;return s&&!o.oneChangePerToken&&s.added===n&&s.removed===i?{oldPos:t.oldPos+r,lastComponent:{count:s.count+1,added:n,removed:i,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:i,previousComponent:s}}}extractCommon(t,n,i,r,o){const s=n.length,l=i.length;let a=t.oldPos,d=a-r,u=0;for(;d+1<s&&a+1<l&&this.equals(i[a+1],n[d+1],o);)d++,a++,u++,o.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!o.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=a,d}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){const r=[];let o;for(;t;)r.push(t),o=t.previousComponent,delete t.previousComponent,t=o;r.reverse();const s=r.length;let l=0,a=0,d=0;for(;l<s;l++){const u=r[l];if(u.removed)u.value=this.join(i.slice(d,d+u.count)),d+=u.count;else{if(!u.added&&this.useLongestToken){let c=n.slice(a,a+u.count);c=c.map(function(f,h){const m=i[d+h];return m.length>f.length?m:f}),u.value=this.join(c)}else u.value=this.join(n.slice(a,a+u.count));a+=u.count,u.added||(d+=u.count)}}return r}}class Np extends Lr{}const Mp=new Np;function Hp(e,t,n){return Mp.diff(e,t,n)}const Co="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Fp extends Lr{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${Co}]+|[^\\S\\n\\r]+|[^${Co}]`,"ug");return t.match(n)||[]}}const Vp=new Fp;function $p(e,t,n){return Vp.diff(e,t,n)}class Up extends Lr{constructor(){super(...arguments),this.tokenize=zp}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
|
|
155
|
+
`))&&(t=t.trim()),(!i.newlineIsToken||!n.includes(`
|
|
156
|
+
`))&&(n=n.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(t.endsWith(`
|
|
157
|
+
`)&&(t=t.slice(0,-1)),n.endsWith(`
|
|
158
|
+
`)&&(n=n.slice(0,-1))),super.equals(t,n,i)}}const Bp=new Up;function Lo(e,t,n){return Bp.diff(e,t,n)}function zp(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
159
|
+
`));const n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let r=0;r<i.length;r++){const o=i[r];r%2&&!t.newlineIsToken?n[n.length-1]+=o:n.push(o)}return n}function Gp(e){for(let t=0;t<e.length;t++)if(e[t]<" "||e[t]>"~"||e[t]==='"'||e[t]==="\\")return!0;return!1}function Be(e){if(!Gp(e))return e;let t='"';const n=new TextEncoder().encode(e);let i=0;for(;i<n.length;){const r=n[i];r===7?t+="\\a":r===8?t+="\\b":r===9?t+="\\t":r===10?t+="\\n":r===11?t+="\\v":r===12?t+="\\f":r===13?t+="\\r":r===34?t+='\\"':r===92?t+="\\\\":r>=32&&r<=126?t+=String.fromCharCode(r):t+="\\"+r.toString(8).padStart(3,"0"),i++}return t+='"',t}const wo={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function ko(e,t,n,i,r,o,s){let l;s?typeof s=="function"?l={callback:s}:l=s:l={},typeof l.context>"u"&&(l.context=4);const a=l.context;if(l.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(l.callback){const{callback:u}=l;Lo(n,i,Object.assign(Object.assign({},l),{callback:c=>{const f=d(c);u(f)}}))}else return d(Lo(n,i,l));function d(u){if(!u)return;u.push({value:"",lines:[]});function c(v){return v.map(function(y){return" "+y})}const f=[];let h=0,m=0,g=[],b=1,_=1;for(let v=0;v<u.length;v++){const y=u[v],S=y.lines||Wp(y.value);if(y.lines=S,y.added||y.removed){if(!h){const E=u[v-1];h=b,m=_,E&&(g=a>0?c(E.lines.slice(-a)):[],h-=g.length,m-=g.length)}for(const E of S)g.push((y.added?"+":"-")+E);y.added?_+=S.length:b+=S.length}else{if(h)if(S.length<=a*2&&v<u.length-2)for(const E of c(S))g.push(E);else{const E=Math.min(S.length,a);for(const L of c(S.slice(0,E)))g.push(L);const C={oldStart:h,oldLines:b-h+E,newStart:m,newLines:_-m+E,lines:g};f.push(C),h=0,m=0,g=[]}b+=S.length,_+=S.length}}for(const v of f)for(let y=0;y<v.lines.length;y++)v.lines[y].endsWith(`
|
|
160
|
+
`)?v.lines[y]=v.lines[y].slice(0,-1):(v.lines.splice(y+1,0,"\"),y++);return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:o,hunks:f}}}function Xi(e,t){var n,i,r,o,s,l;if(t||(t=wo),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(u=>u.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(u=>Xi(u,t)).join(`
|
|
161
|
+
`)}const a=[];if(e.isGit){if(t=wo,!e.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!e.newFileName)throw new Error("newFileName must be specified for Git patches");let u=e.oldFileName,c=e.newFileName;e.isCreate&&u==="/dev/null"?u=c.replace(/^b\//,"a/"):e.isDelete&&c==="/dev/null"&&(c=u.replace(/^a\//,"b/")),a.push("diff --git "+Be(u)+" "+Be(c)),e.isDelete&&a.push("deleted file mode "+((n=e.oldMode)!==null&&n!==void 0?n:"100644")),e.isCreate&&a.push("new file mode "+((i=e.newMode)!==null&&i!==void 0?i:"100644")),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(a.push("old mode "+e.oldMode),a.push("new mode "+e.newMode)),e.isRename&&(a.push("rename from "+Be(((r=e.oldFileName)!==null&&r!==void 0?r:"").replace(/^a\//,""))),a.push("rename to "+Be(((o=e.newFileName)!==null&&o!==void 0?o:"").replace(/^b\//,"")))),e.isCopy&&(a.push("copy from "+Be(((s=e.oldFileName)!==null&&s!==void 0?s:"").replace(/^a\//,""))),a.push("copy to "+Be(((l=e.newFileName)!==null&&l!==void 0?l:"").replace(/^b\//,""))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&a.push("Index: "+e.oldFileName),t.includeUnderline&&a.push("===================================================================");const d=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||d)&&(a.push("--- "+Be(e.oldFileName)+(e.oldHeader?" "+e.oldHeader:"")),a.push("+++ "+Be(e.newFileName)+(e.newHeader?" "+e.newHeader:"")));for(let u=0;u<e.hunks.length;u++){const c=e.hunks[u],f=c.oldLines===0?c.oldStart-1:c.oldStart,h=c.newLines===0?c.newStart-1:c.newStart;a.push("@@ -"+f+","+c.oldLines+" +"+h+","+c.newLines+" @@");for(const m of c.lines)a.push(m)}return a.join(`
|
|
162
|
+
`)+`
|
|
163
|
+
`}function jp(e,t,n,i,r,o,s){if(typeof s=="function"&&(s={callback:s}),s?.callback){const{callback:l}=s;ko(e,t,n,i,r,o,Object.assign(Object.assign({},s),{callback:a=>{l(a?Xi(a,s.headerOptions):void 0)}}))}else{const l=ko(e,t,n,i,r,o,s);return l?Xi(l,s?.headerOptions):void 0}}function Wp(e){const t=e.endsWith(`
|
|
164
|
+
`),n=e.split(`
|
|
165
|
+
`).map(i=>i+`
|
|
166
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function In({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function nn({item:e,arr:t,enableJoin:n,isNeutral:i=!1,isLastItem:r=!1}){const o=t[t.length-1];if(o==null||r||!n){t.push([i?0:1,e.value]);return}const s=o[0]===0;if(i===s||i&&e.value.length===1&&!s){o[1]+=e.value;return}t.push([i?0:1,e.value])}const qp={forcePlainText:!1};function Kp(e,t,n,{forcePlainText:i,startingLine:r,totalLines:o,expandedHunks:s,collapsedContextThreshold:l=1}=qp){i?(r??=0,o??=1/0):(r=0,o=1/0);const a=r>0||o<1/0,d=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,u=Cp({theme:n.theme,highlighter:t}),c=i&&!a&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:h}=n,m=!i&&!e.isPartial,g=i?s:void 0,b=new Map;function _(y){const S=m?0:y,E=b.get(S)??Jp();return b.set(S,E),E}function v(y,S,E,C){if(a){let L=E.at(-1);(L==null||L.targetIndex+L.count!==S)&&(L={targetIndex:S,originalOffset:C.length,count:0},E.push(L)),L.count++}C.push(y)}ot({diff:e,diffStyle:"both",startingLine:r,totalLines:o,expandedHunks:a?g:!0,collapsedContextThreshold:l,callback:({hunkIndex:y,additionLine:S,deletionLine:E,type:C})=>{const L=_(y),x=S!=null?S.splitLineIndex:E.splitLineIndex;C==="change"&&S!=null&&E!=null&&Qp({additionLine:e.additionLines[S.lineIndex],deletionLine:e.deletionLines[E.lineIndex],deletionLineIndex:L.deletionContent.length,additionLineIndex:L.additionContent.length,deletionDecorations:L.deletionDecorations,additionDecorations:L.additionDecorations,lineDiffType:c,maxLineDiffLength:h}),E!=null&&(v(e.deletionLines[E.lineIndex],E.lineIndex,L.deletionSegments,L.deletionContent),L.deletionInfo.push({type:C==="change"?"change-deletion":C,lineNumber:E.lineNumber,altLineNumber:C==="change"?void 0:S.lineNumber??void 0,lineIndex:`${E.unifiedLineIndex},${x}`})),S!=null&&(v(e.additionLines[S.lineIndex],S.lineIndex,L.additionSegments,L.additionContent),L.additionInfo.push({type:C==="change"?"change-addition":C,lineNumber:S.lineNumber,altLineNumber:C==="change"?void 0:E.lineNumber??void 0,lineIndex:`${S.unifiedLineIndex},${x}`}))}});for(const y of b.values()){if(y.deletionContent.length===0&&y.additionContent.length===0)continue;const S={name:e.prevName??e.name,contents:y.deletionContent.value},E={name:e.name,contents:y.additionContent.value},{deletionLines:C,additionLines:L}=Yp({deletionFile:S,deletionInfo:y.deletionInfo,deletionDecorations:y.deletionDecorations,additionFile:E,additionInfo:y.additionInfo,additionDecorations:y.additionDecorations,highlighter:t,options:n,languageOverride:i?"text":e.lang});if(m){f.deletionLines=C,f.additionLines=L;continue}if(y.deletionSegments.length>0)for(const x of y.deletionSegments)for(let w=0;w<x.count;w++)f.deletionLines[x.targetIndex+w]=C[x.originalOffset+w];else vo(f.deletionLines,C);if(y.additionSegments.length>0)for(const x of y.additionSegments)for(let w=0;w<x.count;w++)f.additionLines[x.targetIndex+w]=L[x.originalOffset+w];else vo(f.additionLines,L)}return{code:f,themeStyles:u,baseThemeType:d}}function Xp(e,{deletionLineIndex:t,additionLineIndex:n,deletionDecorations:i,additionDecorations:r}){let o=0,s=0,l=-1,a=0,d=-1,u=0;for(const{value:c,added:f,removed:h}of e)h?(l===-1&&(l=o),o+=c.length,a=o):f?(d===-1&&(d=s),s+=c.length,u=s):(o+=c.length,s+=c.length);l!==-1&&i.push(In({line:t,spanStart:l,spanLength:a-l})),d!==-1&&r.push(In({line:n,spanStart:d,spanLength:u-d}))}function Qp({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:i,deletionDecorations:r,additionDecorations:o,lineDiffType:s,maxLineDiffLength:l}){if(e==null||t==null||s==="none"||(e=Ve(e),t=Ve(t),e.length>l||t.length>l))return;const a=s==="char"?Hp(e,t):$p(e,t);if(s==="word-line"){Xp(a,{deletionLineIndex:n,additionLineIndex:i,deletionDecorations:r,additionDecorations:o});return}const d=[],u=[],c=s==="word-alt",f=a.at(-1);for(const m of a){const g=m===f;!m.added&&!m.removed?(nn({item:m,arr:d,enableJoin:c,isNeutral:!0,isLastItem:g}),nn({item:m,arr:u,enableJoin:c,isNeutral:!0,isLastItem:g})):m.removed?nn({item:m,arr:d,enableJoin:c,isLastItem:g}):nn({item:m,arr:u,enableJoin:c,isLastItem:g})}let h=0;for(const m of d)m[0]===1&&r.push(In({line:n,spanStart:h,spanLength:m[1].length})),h+=m[1].length;h=0;for(const m of u)m[0]===1&&o.push(In({line:i,spanStart:h,spanLength:m[1].length})),h+=m[1].length}function Jp(){return{deletionContent:{push(e){this.value+=e,this.length++},value:"",length:0},additionContent:{push(e){this.value+=e,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function Yp({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:i,highlighter:r,deletionDecorations:o,additionDecorations:s,languageOverride:l,options:{theme:a,...d}}){const u=l??Me(e.name),c=l??Me(t.name),{state:f,transformers:h}=mp(d.useTokenTransformer),m=typeof a=="string"?{...d,lang:"text",theme:a,transformers:h,decorations:void 0,defaultColor:!1,cssVariablePrefix:me("token"),tokenizeTimeLimit:0}:{...d,lang:"text",themes:a,transformers:h,decorations:void 0,defaultColor:!1,cssVariablePrefix:me("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(m.lang=u,f.lineInfo=n,m.decorations=o,So(r.codeToHast(Ve(e.contents),m))),additionLines:t.contents===""?[]:(m.lang=c,m.decorations=s,f.lineInfo=i,So(r.codeToHast(Ve(t.contents),m)))}}const Zp=q.createContext(void 0);function Qi(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function Va(e,t){const n=e?.theme??Ce,i=t?.theme??Ce,r=xo(e),o=xo(t);return Cr(n,i)&&Qi(e,t,["theme","parseDiffOptions"])&&Qi(r,o)}function xo(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}const vt=new Set;let bt=null;function $a(e){vt.add(e),bt??=requestAnimationFrame(Ua)}function Ji(e){vt.delete(e)&&vt.size===0&&bt!=null&&(cancelAnimationFrame(bt),bt=null)}function Ua(e){const t=new Set(vt);vt.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}vt.size>0?bt=requestAnimationFrame(Ua):bt=null}function Yi(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Ao(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function Ro(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}const em="-1,-1";function tm(e){return e?.some(t=>t.lineNumber===0)??!1}function To(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function Ba(e){return e.startingLine===0&&e.totalLines>0}function nm(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function im(){return M({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[Tn({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function rn(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}var rm=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),Ji(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){const n=!(e===this.selectedRange||Yi(e??void 0,this.selectedRange??void 0)),i=t?.lineNumberOnly??!1,r=t?.activeLineSide!==this.selectedRangeHighlightSide||i!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!r||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=i,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){const i=e!==this.editorActiveLine,r=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!i&&!r||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&rn(e.composedPath())||(Te(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null||(Te(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(Te(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){Te(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();Te(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);Te(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:u,onTokenLeave:c,onHunkExpand:f,onMergeConflictActionClick:h}=this.options;switch(e){case"move":{const m=_i(r)&&this.hoveredLine?.lineElement===r.lineElement;_n(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),_n(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),u?.(this.hoveredToken,t))),m||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),_i(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(am(r)&&h!=null){h(r);break}if(sm(r)&&f!=null){f(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!_i(r))break;_n(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const m=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...m,event:t}):o?.({...m,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:u,onMergeConflictActionClick:c,enableGutterUtility:f=!1,enableLineSelection:h=!1,onGutterUtilityClick:m}=this.options,g=m!=null,b=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||u!=null||c!=null||f||h||g;b&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,Te(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const y=[];return(t==="both"||t==="click")&&(i!=null&&y.push("onLineClick"),r!=null&&y.push("onLineNumberClick"),u!=null&&y.push("expandable hunk separators"),c!=null&&y.push("merge conflict actions")),y})()),Te(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),Te(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!b&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const _=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",v=this.pointerSession.mode==="gutterSelecting";(!h&&_||!g&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();rn(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?s>=l.start:s<=l.end;this.selectionAnchor={lineNumber:a?this.selectedRange.start:this.selectedRange.end,side:a?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{onGutterUtilityClick:t}=this.options;if(t==null)return;const n=this.currentSelectionEnds(),i=n?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),r=n?.top??i;i==null||r==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:r,current:i},this.selectionAnchor={lineNumber:r.lineNumber,side:r.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;const n={lineNumber:t.lineNumber,side:t.eventSide};if(nm(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{const{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(n.current=i,this.updateSelection(i.lineNumber,i.side));const r=this.buildSelectedLineRange(n.anchor,n.current);t?.({...r}),this.selectionAnchor=void 0,this.notifySelectionEnd(r),this.notifySelectionCommitted(r),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=Oe(im());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);It(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(wt(r));if(It(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(It(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(It(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&rn(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=wt(e);if(t&&rn(n))return;const i=dm(e);return i!=null?wt(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=um(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute("data-line")||t.hasAttribute("data-column-number")))return wt(t);const n=hm(cm(e));if(n==null)return;const i=this.targetForSelectionPoint(n);return i!=null?wt(i.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=Do(t)?t:Do(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}Yi(i??void 0,r??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,$a(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;const i=this.getIndexesFromSelection(e.range,t);if(i==null)throw console.error({rowRange:i,range:e.range}),new Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return i}getLineRenderColumns(e,t,n,i){if(this.pre==null||t==null&&i==null)return[];const{children:r}=this.pre;if(r.length>2)throw console.error(r),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const o=[];for(const s of r){const l=s.hasAttribute("data-deletions")?"deletions":s.hasAttribute("data-additions")?"additions":void 0,a=e!=null&&t!=null&&(e.highlightSide==null||l==null||e.highlightSide===l),d=n!=null&&i!=null&&(n.highlightSide==null||l==null||n.highlightSide===l);if(!a&&!d)continue;const[u,c]=s.children;if(!(u instanceof HTMLElement)||!(c instanceof HTMLElement))throw new Error("InteractionManager.renderSelection: missing gutter or content element");if(c.children.length!==u.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");o.push({content:c,gutter:u,renderEditorActiveLine:d,renderSelectedLines:a})}return o}renderSelection=()=>{Ji(this.renderSelection);const e=this.getSelectionRenderState();if(this.pre==null)return;const{editorActiveLine:t,selectedLines:n}=e,i=!Oo(this.renderedSelectedLinesState,n),r=!Oo(this.renderedEditorActiveLineState,t);if(!i&&!r)return;i&&(this.renderedSelectedLinesState=void 0),r&&(this.renderedEditorActiveLineState=void 0);const o=this.pre.getAttribute("data-diff-type")==="split",s=i?this.resolveLineRenderRange(n,o,"selected-lines"):void 0,l=r?this.resolveLineRenderRange(t,o,"editor-active-line"):void 0,a=this.getLineRenderColumns(i?n:void 0,s,r?t:void 0,l),d=n.range==null||a.some(g=>g.renderSelectedLines),u=t.range==null||a.some(g=>g.renderEditorActiveLine);if(i)for(const g of this.pre.querySelectorAll("[data-selected-line]"))g.removeAttribute("data-selected-line");if(r)for(const g of this.pre.querySelectorAll("[data-editor-active-line]"))g.removeAttribute("data-editor-active-line");const c=s==null?void 0:Math.min(s.start,s.end),f=s==null?void 0:Math.max(s.start,s.end),h=c===f,m=l?.start;for(const g of a){const{content:b,gutter:_,renderEditorActiveLine:v,renderSelectedLines:y}=g,S=Math.max(y?f??-1/0:-1/0,v?m??-1/0:-1/0),E=b.children.length;for(let C=0;C<E;C++){const L=b.children[C],x=_.children[C];if(!(L instanceof HTMLElement)||!(x instanceof HTMLElement))continue;const w=this.parseLineIndex(L,o);if((w??0)>S)break;if(w!=null){if(y&&c!=null&&f!=null&&w>=c&&w<=f){let A=h?"single":w===c?"first":w===f?"last":"";x.setAttribute("data-selected-line",A),n.lineNumberOnly||(L.setAttribute("data-selected-line",A),x.nextSibling instanceof HTMLElement&&L.nextSibling instanceof HTMLElement&&(L.nextSibling.hasAttribute("data-line-annotation")||L.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(h?(A="last",L.setAttribute("data-selected-line","first")):w===c?A="":w===f&&L.setAttribute("data-selected-line",""),L.nextSibling.setAttribute("data-selected-line",A),x.nextSibling.setAttribute("data-selected-line",A)))}v&&w===m&&(x.setAttribute("data-editor-active-line",""),t.lineNumberOnly||L.setAttribute("data-editor-active-line",""))}}}i&&d&&(this.renderedSelectedLinesState=n),r&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode==="file"?{type:"line",lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:"diff-line",annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:r,tokenText:o}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...n!=null?{side:n}:{},...n!==i&&i!=null?{endSide:i}:{}}}resolvePointerTarget(e){let t=!1,n,i,r,o,s,l,a,d,u,c;for(const h of e){if(!(h instanceof HTMLElement))continue;if(c==null&&h.hasAttribute("data-merge-conflict-action")){const _=h.getAttribute("data-merge-conflict-action")??void 0,v=h.getAttribute("data-merge-conflict-conflict-index")??void 0,y=v!=null?Number.parseInt(v,10):NaN;lm(_)&&Number.isFinite(y)&&(c={kind:"merge-conflict-action",resolution:_,conflictIndex:y})}if(l==null&&h.hasAttribute("data-char")){l=h;const _=h.getAttribute("data-char");if(_!=null){const v=Number.parseInt(_,10);if(!Number.isNaN(v)){const y=h.textContent??"",S=v+y.length;(y.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(a={tokenElement:l,lineCharStart:v,lineCharEnd:S,tokenText:y});continue}}}const m=s==null?h.getAttribute("data-column-number")??void 0:void 0;if(m!=null){s=h,u=Number.parseInt(m,10),t=!0,n=Mo(h),o=h.getAttribute("data-line-index")??void 0;continue}const g=r==null?h.getAttribute("data-line")??void 0:void 0;if(g!=null){r=h,u=Number.parseInt(g,10),n=Mo(h),o=h.getAttribute("data-line-index")??void 0;continue}if(d==null&&(h.hasAttribute("data-expand-button")||h.hasAttribute("data-unmodified-lines"))){d={hunkIndex:void 0,direction:h.hasAttribute("data-expand-up")?"up":h.hasAttribute("data-expand-down")?"down":"both",all:h.hasAttribute("data-expand-all-button")};continue}const b=d!=null?h.getAttribute("data-expand-index")??void 0:void 0;if(d!=null&&b!=null){const _=Number.parseInt(b,10);Number.isNaN(_)||(d.hunkIndex=_);continue}if(i==null&&h.hasAttribute("data-code")){i=h;break}}if(c!=null)return c;if(d?.hunkIndex!=null)return{type:"line-info",hunkIndex:d.hunkIndex,direction:d.direction,all:d.all};if(r??=o!=null?Po(i,`[data-line][data-line-index="${o}"]`):void 0,s??=o!=null?Po(i,`[data-column-number][data-line-index="${o}"]`):void 0,i==null||r==null||s==null||n==null||u==null||Number.isNaN(u))return;const f=this.parseLineIndex(r,this.isSplitDiff());return a!=null?this.mode==="file"?{kind:"token",lineType:n,lineElement:r,lineNumber:u,numberColumn:t,numberElement:s,side:void 0,splitLineIndex:f,...a}:{kind:"token",lineType:n,lineElement:r,lineNumber:u,numberColumn:t,numberElement:s,side:No(n,i),splitLineIndex:f,...a}:this.mode==="file"?{kind:"line",lineType:n,lineElement:r,lineNumber:u,numberColumn:t,numberElement:s,side:void 0,splitLineIndex:f}:{kind:"line",lineType:n,lineElement:r,lineNumber:u,numberColumn:t,numberElement:s,side:No(n,i),splitLineIndex:f}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const n=(e.getAttribute("data-line-index")??"").split(",").map(i=>Number.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Io({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:u,renderGutterUtility:c,__debugPointerEvents:f,enableLineSelection:h,controlledSelection:m,onLineSelected:g,onLineSelectionStart:b,onLineSelectionChange:_,onLineSelectionEnd:v},y,S,E){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:om({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:y,onMergeConflictActionClick:E,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:h,controlledSelection:m,onLineSelected:g,onLineSelectionStart:b,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:S}}function om({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function It(e){return e!=null&&"kind"in e&&e.kind==="line"}function _n(e){return e!=null&&"kind"in e&&e.kind==="token"}function _i(e){return It(e)||_n(e)}function sm(e){return"type"in e&&e.type==="line-info"}function am(e){return"kind"in e&&e.kind==="merge-conflict-action"}function lm(e){return e==="current"||e==="incoming"||e==="both"}function Po(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function wt(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function dm(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function um(e){const t=e.closest('[slot^="annotation-"]'),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName==="SLOT"?e:void 0)?.closest("[data-line-annotation]");return n instanceof HTMLElement?n:void 0}function cm(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function hm(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function Do(e){return e!=null&&typeof e.elementFromPoint=="function"}function fm(e,t){return e===t||Yi(e??void 0,t??void 0)}function Oo(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&fm(e?.range??null,t.range)}function No(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function Mo(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function Te(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return}console.log(...n)}var pm=class Pe{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=Pe.resizeObserver??new ResizeObserver(Pe.handleSharedResizeEntries);return Pe.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=Pe.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,{disableAnnotations:n,columnVariables:i="apply"}){const r=new Set,o=i==="apply";let s=0;const l=new Map(this.observedNodes);this.observedNodes.clear();for(const a of t.children){if(s===2)break;const d=(()=>{if(a instanceof HTMLElement&&a.tagName==="CODE")return a})();if(d==null)continue;s++;let u=l.get(d);if(u!=null&&u.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let c=d.firstElementChild;c instanceof HTMLElement||(c=null),u!=null?(this.observedNodes.set(d,u),l.delete(d),u.numberElement!==c?(u.numberElement!=null&&(this.unobserve(u.numberElement),l.delete(u.numberElement)),c!=null&&(this.observe(c),l.delete(c),this.observedNodes.set(c,u)),u.numberElement=c,u.numberWidth=0):u.numberElement!=null?(l.delete(u.numberElement),this.observedNodes.set(u.numberElement,u)):u.numberWidth=0,_m(u,o)):(u={type:"code",codeElement:d,numberElement:c,codeWidth:"auto",numberWidth:0,applyColumnVariables:o},this.observedNodes.set(d,u),this.observe(d),c!=null&&(this.observedNodes.set(c,u),this.observe(c)))}if(s>1&&!n){const a=t.querySelectorAll('[data-line-annotation*=","]'),d=new Map;for(const u of a){if(!(u instanceof HTMLElement))continue;const c=u.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(c)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:c,element:u});continue}let f=d.get(c);f==null&&(f=[],d.set(c,f)),f.push(u)}for(const[u,c]of d){if(c.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",u,c);continue}const[f,h]=c,m=f.firstElementChild,g=h.firstElementChild;if(!(f instanceof HTMLElement)||!(h instanceof HTMLElement)||!(m instanceof HTMLElement)||!(g instanceof HTMLElement))continue;let b=l.get(m);if(b!=null){this.observedNodes.set(m,b),this.observedNodes.set(g,b),l.delete(m),l.delete(g);continue}const _=m.getBoundingClientRect().height,v=g.getBoundingClientRect().height;b={type:"annotations",column1:{container:f,child:m,childHeight:_},column2:{container:h,child:g,childHeight:v},currentHeight:"auto"},r.add({child1:m,child2:g,item:b,newHeight:Math.max(_,v)})}for(const u of r)this.applyNewHeight(u.item,u.newHeight),this.observedNodes.set(u.child1,u.item),this.observedNodes.set(u.child2,u.item),this.observe(u.child1),this.observe(u.child2);r.clear()}for(const[a,d]of l)this.unobserve(a),d.type==="code"?vm(d):bm(d);l.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=Pe,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),Pe.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=Pe,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),Pe.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:s,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const a=this.observedNodes.get(o);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(a.type==="annotations"){const d=(()=>{if(o===a.column1.child)return a.column1;if(o===a.column2.child)return a.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:o});continue}d.childHeight=s[0].blockSize,i.add(a)}else if(a.type==="code"){const d=n.get(a)??{},u=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=u:o===a.numberElement&&(d.numberInlineSize=u),n.set(a,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?mm(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?gm(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,l=o!==n.numberWidth;!s&&!l||(n.codeWidth=r,n.numberWidth=o,n.applyColumnVariables&&za(n,{codeWidthChanged:s,numberWidthChanged:l}))}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function mm(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function gm(e){return Math.max(Math.ceil(e),0)}function _m(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?za(e,{codeWidthChanged:!0,numberWidthChanged:!0}):Ga(e))}function za(e,{codeWidthChanged:t,numberWidthChanged:n}){const{codeElement:i,codeWidth:r,numberWidth:o}=e;if(t&&i.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),n&&i.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),t||n&&r!=="auto"){const s=typeof r=="number"?Math.max(r-o,0):0;i.style.setProperty("--diffs-column-content-width",`${s>0?`${s}px`:"auto"}`)}}function Ga(e){e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width")}function vm(e){e.codeElement.isConnected&&Ga(e)}function bm(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}function ja(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function ym(e,t){return e.endsWith(`\r
|
|
167
|
+
`)?t+`\r
|
|
168
|
+
`:e.endsWith("\r")?t+"\r":e.endsWith(`
|
|
169
|
+
`)?t+`
|
|
170
|
+
`:t}function Em(e){return M({tagName:"div",children:[M({tagName:"div",children:e.annotations?.map(t=>M({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Sm(e,t){return M({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function Cm(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function Lm({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return M({tagName:"div",children:[t==="custom"?M({tagName:"slot",properties:{name:mr}}):wm({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[km(i)]],properties:r})}function wm({name:e,prevName:t,iconType:n}){const i=[M({tagName:"slot",properties:{name:Ts}}),Tn({name:Cm(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(M({tagName:"div",children:[M({tagName:"bdi",children:[Le(t)]})],properties:{"data-prev-name":""}})),i.push(Tn({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(M({tagName:"div",children:[M({tagName:"bdi",children:[Le(e)]})],properties:{"data-title":""}})),i.push(M({tagName:"slot",properties:{name:Is}})),M({tagName:"div",children:i,properties:{"data-header-content":""}})}function km(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(M({tagName:"span",children:[Le(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(M({tagName:"span",children:[Le(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(M({tagName:"slot",properties:{name:Ps}})),M({tagName:"div",children:t,properties:{"data-metadata":""}})}function xm(e){return M({tagName:"pre",properties:Am(e)})}function Am({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:s,customProperties:l}){return{...l,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}function Rm(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:Array.isArray(e)?e:[e??"text"],themes:gr(t),preferredHighlighter:n}}function Zi(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}const Tm=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
171
|
+
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
172
|
+
<path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
|
|
173
|
+
</symbol>
|
|
174
|
+
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
175
|
+
<path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
|
|
176
|
+
</symbol>
|
|
177
|
+
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
178
|
+
<path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
|
|
179
|
+
</symbol>
|
|
180
|
+
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
181
|
+
<path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
|
|
182
|
+
</symbol>
|
|
183
|
+
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
184
|
+
<path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
|
|
185
|
+
</symbol>
|
|
186
|
+
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
187
|
+
<path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
|
|
188
|
+
</symbol>
|
|
189
|
+
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
190
|
+
<path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
|
|
191
|
+
</symbol>
|
|
192
|
+
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
193
|
+
<path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
|
|
194
|
+
</symbol>
|
|
195
|
+
<symbol id="diffs-icon-eye-slash" viewBox="0 0 16 16">
|
|
196
|
+
<path d="m13.47 1.47-12 12 1.06 1.06 12-12zM8 14c-.92 0-1.802-.208-2.624-.547l1.173-1.174c.476.142.963.221 1.451.221 1.66 0 3.307-.949 4.626-2.196a10.4 10.4 0 0 0 1.494-1.751A5 5 0 0 0 14.443 8a5 5 0 0 0-.323-.553 10 10 0 0 0-1.238-1.5l1.061-1.062C15.222 6.173 16 7.511 16 8c0 1.05-3.582 6-8 6"/><path d="M8 11q-.084 0-.167-.005l3.162-3.162q.006.083.005.167a3 3 0 0 1-3 3M5.005 8.167l3.162-3.162a3 3 0 0 0-3.162 3.162"/><path d="M8 3.5c.485 0 .97.081 1.445.227l1.168-1.169C9.794 2.212 8.915 2 8 2 3.582 2 0 6.8 0 8c0 .555.766 1.88 2.027 3.144l1.06-1.06a9.5 9.5 0 0 1-1.203-1.461 4.3 4.3 0 0 1-.345-.617L1.536 8l.003-.006c.064-.149.176-.359.345-.617a9.8 9.8 0 0 1 1.482-1.73C4.675 4.427 6.326 3.5 8 3.5"/>
|
|
197
|
+
</symbol>
|
|
198
|
+
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
199
|
+
<path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
|
|
200
|
+
</symbol>
|
|
201
|
+
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
202
|
+
<path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
|
|
203
|
+
</symbol>
|
|
204
|
+
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
205
|
+
<path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
206
|
+
</symbol>
|
|
207
|
+
<symbol id="diffs-icon-symbol-added-duo" viewBox="0 0 16 16">
|
|
208
|
+
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/>
|
|
209
|
+
</symbol>
|
|
210
|
+
<symbol id="diffs-icon-symbol-added-fill" viewBox="0 0 16 16">
|
|
211
|
+
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 4a.75.75 0 0 0-.75.75v2.5h-2.5a.75.75 0 0 0 0 1.5h2.5v2.5a.75.75 0 0 0 1.5 0v-2.5h2.5a.75.75 0 0 0 0-1.5h-2.5v-2.5A.75.75 0 0 0 8 4" clip-rule="evenodd"/>
|
|
212
|
+
</symbol>
|
|
213
|
+
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
214
|
+
<path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
215
|
+
</symbol>
|
|
216
|
+
<symbol id="diffs-icon-symbol-deleted-duo" viewBox="0 0 16 16">
|
|
217
|
+
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/>
|
|
218
|
+
</symbol>
|
|
219
|
+
<symbol id="diffs-icon-symbol-deleted-fill" viewBox="0 0 16 16">
|
|
220
|
+
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M4.75 7.25a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/>
|
|
221
|
+
</symbol>
|
|
222
|
+
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
223
|
+
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
|
|
224
|
+
</symbol>
|
|
225
|
+
<symbol id="diffs-icon-symbol-diffstat-duo" viewBox="0 0 16 16">
|
|
226
|
+
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
|
|
227
|
+
</symbol>
|
|
228
|
+
<symbol id="diffs-icon-symbol-diffstat-fill" viewBox="0 0 16 16">
|
|
229
|
+
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5zM8 3.546a.75.75 0 0 0-.75.75V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2V4.296a.75.75 0 0 0-.75-.75" clip-rule="evenodd"/>
|
|
230
|
+
</symbol>
|
|
231
|
+
<symbol id="diffs-icon-symbol-extracted" viewBox="0 0 16 16">
|
|
232
|
+
<path d="M8.25 4.25a.75.75 0 0 1 0 1.5H6.81l3.302 3.302a1.5 1.5 0 1 1-1.06 1.06L5.75 6.811V8.25a.75.75 0 0 1-1.5 0V5A.75.75 0 0 1 5 4.25z"/><path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 1.5c-1.613 0-2.807.089-3.704.288-.88.196-1.382.477-1.706.802-.325.324-.606.826-.802 1.706C1.588 5.193 1.5 6.387 1.5 8s.089 2.807.288 3.704c.196.88.477 1.382.802 1.706.324.325.826.606 1.706.802.897.2 2.091.288 3.704.288s2.807-.089 3.704-.288c.88-.196 1.382-.477 1.706-.802.325-.324.606-.826.802-1.706.2-.897.288-2.091.288-3.704s-.089-2.807-.288-3.704c-.196-.88-.477-1.382-.802-1.706-.324-.325-.826-.606-1.706-.802C10.807 1.588 9.613 1.5 8 1.5" clip-rule="evenodd"/>
|
|
233
|
+
</symbol>
|
|
234
|
+
<symbol id="diffs-icon-symbol-extracted-duo" viewBox="0 0 16 16">
|
|
235
|
+
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8" clip-rule="evenodd" opacity=".2"/><path d="M8.25 4.25a.75.75 0 0 1 0 1.5H6.81l3.302 3.302a1.5 1.5 0 1 1-1.06 1.06L5.75 6.811V8.25a.75.75 0 0 1-1.5 0V5A.75.75 0 0 1 5 4.25z"/>
|
|
236
|
+
</symbol>
|
|
237
|
+
<symbol id="diffs-icon-symbol-extracted-fill" viewBox="0 0 16 16">
|
|
238
|
+
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5 4.25a.75.75 0 0 0-.75.75v3.25a.75.75 0 0 0 1.5 0V6.81l3.302 3.302a1.5 1.5 0 1 0 1.06-1.06L6.811 5.75H8.25a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/>
|
|
239
|
+
</symbol>
|
|
240
|
+
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
241
|
+
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
|
|
242
|
+
</symbol>
|
|
243
|
+
<symbol id="diffs-icon-symbol-ignored-duo" viewBox="0 0 16 16">
|
|
244
|
+
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M11.53 4.47a.75.75 0 0 1 0 1.06l-6 6a.75.75 0 0 1-1.06-1.06l6-6a.75.75 0 0 1 1.06 0"/>
|
|
245
|
+
</symbol>
|
|
246
|
+
<symbol id="diffs-icon-symbol-ignored-fill" viewBox="0 0 16 16">
|
|
247
|
+
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m3.53 4.47a.75.75 0 0 0-1.06 0l-6 6a.75.75 0 1 0 1.06 1.06l6-6a.75.75 0 0 0 0-1.06" clip-rule="evenodd"/>
|
|
248
|
+
</symbol>
|
|
249
|
+
<symbol id="diffs-icon-symbol-inlined" viewBox="0 0 16 16">
|
|
250
|
+
<path d="M7.75 11.75a.75.75 0 0 1 0-1.5h1.44L5.887 6.948a1.5 1.5 0 1 1 1.06-1.06l3.302 3.301V7.75a.75.75 0 0 1 1.5 0V11a.75.75 0 0 1-.75.75z"/><path fill-rule="evenodd" d="M8 16c-6.588 0-8-1.412-8-8s1.412-8 8-8 8 1.412 8 8-1.412 8-8 8m0-1.5c1.613 0 2.807-.089 3.704-.288.88-.196 1.382-.477 1.706-.802.325-.324.606-.826.802-1.706.2-.897.288-2.091.288-3.704s-.089-2.807-.288-3.704c-.196-.88-.477-1.382-.802-1.706-.324-.325-.826-.606-1.706-.802C10.807 1.588 9.613 1.5 8 1.5s-2.807.089-3.704.288c-.88.196-1.382.477-1.706.802-.325.324-.606.826-.802 1.706C1.588 5.193 1.5 6.387 1.5 8s.089 2.807.288 3.704c.196.88.477 1.382.802 1.706.324.325.826.606 1.706.802.897.2 2.091.288 3.704.288" clip-rule="evenodd"/>
|
|
251
|
+
</symbol>
|
|
252
|
+
<symbol id="diffs-icon-symbol-inlined-duo" viewBox="0 0 16 16">
|
|
253
|
+
<path fill-rule="evenodd" d="M8 16c-6.588 0-8-1.412-8-8s1.412-8 8-8 8 1.412 8 8-1.412 8-8 8" clip-rule="evenodd" opacity=".2"/><path d="M7.75 11.75a.75.75 0 0 1 0-1.5h1.44L5.887 6.948a1.5 1.5 0 1 1 1.06-1.06l3.302 3.301V7.75a.75.75 0 0 1 1.5 0V11a.75.75 0 0 1-.75.75z"/>
|
|
254
|
+
</symbol>
|
|
255
|
+
<symbol id="diffs-icon-symbol-inlined-fill" viewBox="0 0 16 16">
|
|
256
|
+
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5.5 4a1.5 1.5 0 1 0 .388 2.948l3.301 3.302H7.75a.75.75 0 0 0 0 1.5H11a.75.75 0 0 0 .75-.75V7.75a.75.75 0 0 0-1.5 0v1.44L6.948 5.887A1.5 1.5 0 0 0 5.5 4" clip-rule="evenodd"/>
|
|
257
|
+
</symbol>
|
|
258
|
+
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
259
|
+
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
|
|
260
|
+
</symbol>
|
|
261
|
+
<symbol id="diffs-icon-symbol-modified-duo" viewBox="0 0 16 16">
|
|
262
|
+
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0"/>
|
|
263
|
+
</symbol>
|
|
264
|
+
<symbol id="diffs-icon-symbol-modified-fill" viewBox="0 0 16 16">
|
|
265
|
+
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 5a3 3 0 1 0 0 6 3 3 0 0 0 0-6" clip-rule="evenodd"/>
|
|
266
|
+
</symbol>
|
|
267
|
+
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
268
|
+
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
|
|
269
|
+
</symbol>
|
|
270
|
+
<symbol id="diffs-icon-symbol-moved-duo" viewBox="0 0 16 16">
|
|
271
|
+
<path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M8.496 4.695a.75.75 0 0 0-.051 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.051 1.06L6.49 8.003 4.693 9.998a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
|
|
272
|
+
</symbol>
|
|
273
|
+
<symbol id="diffs-icon-symbol-moved-fill" viewBox="0 0 16 16">
|
|
274
|
+
<path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m1.555 4.745a.75.75 0 0 0-1.11 1.01L10.486 8l-2.04 2.245a.75.75 0 0 0 1.109 1.01l2.5-2.75a.75.75 0 0 0 0-1.01zm-4 0a.75.75 0 0 0-1.11 1.01l2.043 2.248-1.796 1.995a.75.75 0 0 0 1.116 1.004l2.25-2.5a.75.75 0 0 0-.003-1.007z" clip-rule="evenodd"/>
|
|
275
|
+
</symbol>
|
|
276
|
+
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
277
|
+
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
|
|
278
|
+
</symbol>
|
|
279
|
+
</svg>`;function Im(e,t){return e==null||t==null?e===t:Pm(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}const Ho={};function Pm(e=Ho,t=Ho){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function Dm(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function Om(){const e=document.createElement("div");return e.slot="gutter-utility-slot",e.style.position="absolute",e.style.top="0",e.style.bottom="0",e.style.textAlign="center",e.style.whiteSpace="normal",e.style.touchAction="none",e}function Nm(){const e=document.createElement("style");return e.setAttribute(_u,""),e}let on;function er(e){if(on!=null)return on;const t=e.host;if(typeof HTMLElement<"u"&&t instanceof HTMLElement&&!t.isConnected)return;const n=document.createElement("div");n.setAttribute("data-code",""),n.setAttribute(vu,"true");const i=document.createElement("div");return i.style.position="relative",i.style.width="200%",i.style.height="200%",n.appendChild(i),e.appendChild(n),on=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),on}function Wa(e){const t=e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`;return`${Ds}: ${t};`}var Mm=`@layer base,theme,rendered,unsafe;@layer base{:host{--diffs-font-fallback:"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace;--diffs-header-font-fallback:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;--diffs-mixer:light-dark(#000,#fff);--diffs-gap-fallback:8px;--diffs-scrollbar-gutter-fallback:6px;--diffs-scrollbar-gutter:var(--diffs-scrollbar-gutter-override,var(--diffs-scrollbar-gutter-measured,var(--diffs-scrollbar-gutter-fallback)));--diffs-added-light:#0dbe4e;--diffs-added-dark:#5ecc71;--diffs-modified-light:#009fff;--diffs-modified-dark:#69b1ff;--diffs-deleted-light:#ff2e3f;--diffs-deleted-dark:#ff6762;--diffs-warning-light:#d5a910;--diffs-warning-dark:#ffd452;color-scheme:light dark;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));font-size:var(--diffs-font-size,13px);line-height:var(--diffs-line-height,20px);font-feature-settings:var(--diffs-font-features);--diffs-bg:light-dark(var(--diffs-light-bg,#fff),var(--diffs-dark-bg,#000));--diffs-bg-buffer:var(--diffs-bg-buffer-override,light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));--diffs-bg-context:var(--diffs-bg-context-override,light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));--diffs-bg-context-gutter:var(--diffs-bg-context-gutter-override,light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)),color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));--diffs-bg-separator:var(--diffs-bg-separator-override,light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));--diffs-fg:light-dark(var(--diffs-light,#000),var(--diffs-dark,#fff));--diffs-fg-number:var(--diffs-fg-number-override,light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)),color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));--diffs-fg-conflict-marker:var(--diffs-fg-conflict-marker-override,var(--diffs-fg-number));--diffs-deletion-base:var(--diffs-deletion-color-override,light-dark(var(--diffs-light-deletion-color,var(--diffs-deletion-color,var(--diffs-deleted-light))),var(--diffs-dark-deletion-color,var(--diffs-deletion-color,var(--diffs-deleted-dark)))));--diffs-addition-base:var(--diffs-addition-color-override,light-dark(var(--diffs-light-addition-color,var(--diffs-addition-color,var(--diffs-added-light))),var(--diffs-dark-addition-color,var(--diffs-addition-color,var(--diffs-added-dark)))));--diffs-modified-base:var(--diffs-modified-color-override,light-dark(var(--diffs-light-modified-color,var(--diffs-modified-color,var(--diffs-modified-light))),var(--diffs-dark-modified-color,var(--diffs-modified-color,var(--diffs-modified-dark)))));--diffs-bg-deletion:var(--diffs-bg-deletion-override,light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)),color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));--diffs-bg-deletion-emphasis:var(--diffs-bg-deletion-emphasis-override,light-dark(rgb(from var(--diffs-deletion-base) r g b / .15),rgb(from var(--diffs-deletion-base) r g b / .2)));--diffs-bg-addition:var(--diffs-bg-addition-override,light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)),color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));--diffs-bg-addition-emphasis:var(--diffs-bg-addition-emphasis-override,light-dark(rgb(from var(--diffs-addition-base) r g b / .15),rgb(from var(--diffs-addition-base) r g b / .2)));--diffs-selection-base:var(--diffs-modified-base);--diffs-selection-number-fg:light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));background-color:var(--diffs-bg);color:var(--diffs-fg);display:block}pre,code,[data-error-wrapper]{isolation:isolate;font-family:var(--diffs-font-family,var(--diffs-font-fallback));outline:none;margin:0;padding:0;display:block}pre,code{background-color:var(--diffs-bg)}code{contain:content}input,button{font-family:inherit;font-size:inherit;line-height:inherit}*,:before,:after{box-sizing:border-box}[data-icon-sprite]{display:none}[data-diffs-header],[data-separator]{font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback))}[data-diffs-header][data-sticky]{z-index:1;background-color:var(--diffs-bg);position:sticky;top:0}[data-file-info]{color:var(--fg);background-color:color-mix(in lab, var(--bg) 98%, var(--fg));border-block:1px solid color-mix(in lab, var(--bg) 95%, var(--fg));padding:10px;font-weight:700}[data-diff],[data-file]{--diffs-grid-number-column-width:minmax(min-content, max-content);--diffs-code-grid:var(--diffs-grid-number-column-width) 1fr;&[data-dehydrated]{--diffs-code-grid:var(--diffs-grid-number-column-width) minmax(0, 1fr)}&:hover [data-code]::-webkit-scrollbar-thumb{background-color:var(--diffs-bg-context)}}@supports (-webkit-touch-callout:none){:host{--diffs-scrollbar-gutter-fallback:0px}}[data-line] span,[data-edit-prediction-suffix] span{color:light-dark(var(--diffs-token-light,var(--diffs-light)),var(--diffs-token-dark,var(--diffs-dark)));background-color:light-dark(var(--diffs-token-light-bg,inherit),var(--diffs-token-dark-bg,inherit));font-weight:light-dark(var(--diffs-token-light-font-weight,inherit),var(--diffs-token-dark-font-weight,inherit));font-style:light-dark(var(--diffs-token-light-font-style,inherit),var(--diffs-token-dark-font-style,inherit));text-decoration:light-dark(var(--diffs-token-light-text-decoration,inherit),var(--diffs-token-dark-text-decoration,inherit))}[data-line],[data-gutter-buffer],[data-column-number],[data-line-annotation],[data-no-newline],[data-merge-conflict],[data-merge-conflict-actions],[data-editor-overlay]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-computed-editor-active-line-bg:var(--diffs-computed-selected-line-bg);--diffs-computed-hovered-line-bg:var(--diffs-computed-editor-active-line-bg);--diffs-hover-mix-target:var(--diffs-bg-hover-override,var(--diffs-mixer));--diffs-line-bg:var(--diffs-computed-hovered-line-bg);color:var(--diffs-fg);background-color:var(--diffs-line-bg,var(--diffs-bg))}[data-line],[data-no-newline]{&[data-decoration-bg]{--mix-deco-light:92%;--mix-deco-dark:85%;&[data-decoration-bg-depth="2"]{--mix-deco-light:88%;--mix-deco-dark:80%}&[data-decoration-bg-depth="3"]{--mix-deco-light:85%;--mix-deco-dark:78%}--diffs-hover-mix-target:var(--diffs-decoration-bg);--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) var(--mix-deco-light), var(--diffs-decoration-bg)),color-mix(in lab, var(--diffs-bg) var(--mix-deco-dark), var(--diffs-decoration-bg)))}}[data-line-annotation],[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context);--diffs-computed-decoration-bg:var(--diffs-annotation-bg);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-merge-conflict-actions],[data-gutter-buffer=merge-conflict-action],[data-gutter-buffer=merge-conflict-marker-base],[data-gutter-buffer=merge-conflict-marker-separator],[data-merge-conflict=marker-base],[data-merge-conflict=marker-separator]{--diffs-computed-decoration-bg:var(--diffs-bg-context);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-gutter-buffer=merge-conflict-marker-start],[data-merge-conflict=marker-start]{--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) 78%, var(--conflict-bg-current-header-override,var(--diffs-addition-base))),color-mix(in lab, var(--diffs-bg) 68%, var(--conflict-bg-current-header-override,var(--diffs-addition-base))));--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-gutter-buffer=merge-conflict-marker-end],[data-merge-conflict=marker-end]{--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) 78%, var(--conflict-bg-incoming-header-override,var(--diffs-modified-base))),color-mix(in lab, var(--diffs-bg) 68%, var(--conflict-bg-incoming-header-override,var(--diffs-modified-base))));--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-has-merge-conflict] [data-line-annotation],[data-has-merge-conflict] [data-gutter-buffer=annotation]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}:where([data-background]){& [data-gutter-buffer],& [data-column-number]{--mix-light:91%;--mix-dark:85%}& [data-line],& [data-no-newline]{--mix-light:88%;--mix-dark:80%}& [data-gutter-buffer],& [data-column-number],& [data-line],& [data-no-newline]{--diffs-diff-line-mix-target:var(--diffs-bg);&[data-line-type=change-deletion]{--diffs-diff-line-mix-target:var(--diffs-bg-deletion-override,var(--diffs-deletion-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-deletion-override,var(--diffs-deletion-base));--diffs-diff-line-mix-target:var(--diffs-bg-deletion-number-override,var(--diffs-deletion-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}&[data-line-type=change-addition]{--diffs-diff-line-mix-target:var(--diffs-bg-addition-override,var(--diffs-addition-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-addition-override,var(--diffs-addition-base));--diffs-diff-line-mix-target:var(--diffs-bg-addition-number-override,var(--diffs-addition-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}&[data-merge-conflict=current]{--diffs-diff-line-mix-target:var(--conflict-bg-current-override,var(--diffs-addition-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-addition-override,var(--diffs-addition-base));--diffs-diff-line-mix-target:var(--conflict-bg-current-number-override,var(--diffs-addition-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}&[data-merge-conflict=incoming]{--diffs-diff-line-mix-target:var(--conflict-bg-incoming-override,var(--diffs-modified-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-modified-base);--diffs-diff-line-mix-target:var(--conflict-bg-incoming-number-override,var(--diffs-modified-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}}}[data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline],[data-editor-overlay]{--diffs-selection-mix-target:var(--diffs-bg-selection-override,var(--diffs-selection-base));--diffs-selection-emphasis-mix-target:var(--diffs-selection-mix-target);&:where([data-editor-overlay]),&:where([data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline])[data-selected-line]{--mix-selection-light:82%;--mix-selection-dark:75%;--diffs-hover-mix-target:var(--diffs-selection-mix-target)}&:where([data-gutter-buffer][data-selected-line],[data-column-number]:is([data-selected-line],[data-editor-active-line])){--mix-selection-light:75%;--mix-selection-dark:60%;--diffs-selection-mix-target:var(--diffs-bg-selection-number-override,var(--diffs-selection-base));--diffs-hover-mix-target:var(--diffs-selection-mix-target)}&:where([data-line][data-selected-line]):is([data-line-type=change-addition],[data-line-type=change-deletion]){--diffs-selection-emphasis-mix-target:light-dark(color-mix(in lab, var(--diffs-diff-line-mix-target,var(--diffs-selection-mix-target)) var(--mix-selection-light), var(--diffs-selection-mix-target)),var(--diffs-selection-mix-target))}&:where([data-editor-overlay]),&[data-selected-line]{--diffs-computed-selected-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-diff-line-bg) var(--mix-selection-light), var(--diffs-selection-mix-target)),color-mix(in lab, var(--diffs-computed-diff-line-bg) var(--mix-selection-dark), var(--diffs-selection-mix-target)))}}[data-line][data-editor-active-line],[data-column-number][data-editor-active-line]{--diffs-computed-editor-active-line-bg:color-mix(in lab, var(--diffs-computed-selected-line-bg) var(--diffs-editor-active-line-source-mix,100%), var(--diffs-selection-emphasis-mix-target))}@media (pointer:fine){[data-line][data-hovered],[data-gutter-buffer][data-hovered],[data-column-number][data-hovered],[data-line-annotation][data-hovered],[data-no-newline][data-hovered],[data-merge-conflict][data-hovered],[data-merge-conflict-actions][data-hovered],[data-editor-overlay][data-hovered]{--diffs-computed-hovered-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-editor-active-line-bg) 97%, var(--diffs-hover-mix-target)),color-mix(in lab, var(--diffs-computed-editor-active-line-bg) 91%, var(--diffs-hover-mix-target)))}}[data-gutter-buffer][data-selected-line],[data-column-number]:is([data-selected-line],[data-editor-active-line]){color:var(--diffs-selection-number-fg)}[data-no-newline]{user-select:none;& span{opacity:.6}}[data-diff-type=split][data-overflow=scroll]{grid-template-columns:1fr 1fr;display:grid;& [data-additions]{border-left:1px solid var(--diffs-bg)}& [data-deletions]{border-right:1px solid var(--diffs-bg)}}[data-code]{grid-auto-flow:dense;grid-template-columns:var(--diffs-code-grid);overflow:var(--diffs-overflow-override,scroll) clip;overscroll-behavior-x:none;tab-size:var(--diffs-tab-size,2);padding-top:var(--diffs-gap-block,var(--diffs-gap-fallback));padding-bottom:max(0px, calc(var(--diffs-gap-block,var(--diffs-gap-fallback)) - var(--diffs-scrollbar-gutter)));scrollbar-gutter:stable;align-self:flex-start;display:grid}[data-diffs-scrollbar-measure]{opacity:0;pointer-events:none;scrollbar-gutter:auto;grid-template-columns:none;width:100px;height:100px;padding:0;position:absolute;top:-200px;left:-200px}[data-container-size]{container-type:inline-size}[data-code]::-webkit-scrollbar{width:0;height:var(--diffs-scrollbar-gutter)}[data-code]::-webkit-scrollbar-track{background:0 0}[data-code]::-webkit-scrollbar-thumb{background-color:#0000;background-clip:content-box;border:1px solid #0000;border-radius:3px}[data-code]::-webkit-scrollbar-corner{background-color:#0000}@supports ((-moz-appearance:none)){[data-code]{scrollbar-width:thin;scrollbar-color:var(--diffs-bg-context) transparent;padding-bottom:var(--diffs-gap-block,var(--diffs-gap-fallback))}}[data-diffs-header]~[data-diff],[data-diffs-header]~[data-file]{& [data-code],&[data-overflow=wrap],&[data-dehydrated][data-diff-type=split][data-overflow=scroll]{padding-top:0}}[data-gutter]{grid-template-rows:subgrid;grid-template-columns:subgrid;z-index:3;background-color:var(--diffs-bg);grid-column:1;display:grid;position:relative;& [data-gutter-buffer],& [data-column-number]{border-right:var(--diffs-gap-style,2px solid var(--diffs-bg))}}[data-content]{grid-template-rows:subgrid;grid-template-columns:subgrid;background-color:var(--diffs-bg);grid-column:2;min-width:0;display:grid}[data-diff-type=split][data-overflow=wrap],[data-dehydrated][data-diff-type=split][data-overflow=scroll]{grid-auto-flow:dense;grid-template-columns:repeat(2, var(--diffs-code-grid));padding-block:var(--diffs-gap-block,var(--diffs-gap-fallback));display:grid;& [data-code]{display:contents}& [data-deletions]{& [data-gutter]{grid-column:1}& [data-content]{border-right:1px solid var(--diffs-bg);grid-column:2}}& [data-additions]{& [data-gutter]{border-left:1px solid var(--diffs-bg);grid-column:3}& [data-content]{grid-column:4}}}[data-dehydrated][data-diff-type=split][data-overflow=scroll] [data-content]{overflow:clip}[data-overflow=scroll] [data-gutter]{position:sticky;left:0}[data-interactive-lines] [data-line]{cursor:pointer}[data-interactive-line-numbers] [data-column-number]{cursor:pointer;touch-action:none}[data-content-buffer],[data-gutter-buffer]{user-select:none;min-height:1lh;position:relative}[data-gutter-buffer]{padding-left:2ch;padding-right:1ch;&:before{content:"";min-width:var(--diffs-min-number-column-width,var(--diffs-min-number-column-width-default,3ch));display:block}}[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context-gutter);min-height:0}[data-gutter-buffer=buffer]{--diffs-line-bg:var(--diffs-bg-context-gutter)}[data-content-buffer]{background-position:5px 0;background-size:8px 8px;background-origin:border-box;background-image:repeating-linear-gradient(-45deg, transparent, transparent calc(3px * 1.414), var(--diffs-bg-buffer) calc(3px * 1.414), var(--diffs-bg-buffer) calc(4px * 1.414));grid-column:1}[data-separator]{box-sizing:content-box;background-color:var(--diffs-bg)}[data-separator=simple]{min-height:4px}[data-separator=line-info],[data-separator=line-info-basic],[data-separator=metadata],[data-separator=simple]{background-color:var(--diffs-bg-separator)}[data-separator=line-info],[data-separator=line-info-basic],[data-separator=metadata]{height:32px;position:relative}[data-separator-wrapper]{user-select:none;fill:currentColor;background-color:var(--diffs-bg);align-items:center;height:100%;display:flex;position:absolute;inset-inline:0}[data-content] [data-separator-wrapper]{display:none}[data-separator=metadata] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);height:100%;color:var(--diffs-fg-number);white-space:nowrap;text-overflow:ellipsis;min-width:min-content;padding-inline:1ch;inset-inline:100% auto;overflow:hidden}[data-separator=line-info]{margin-block:var(--diffs-gap-block,var(--diffs-gap-fallback));& [data-separator-wrapper]{min-width:16px}}[data-separator=line-info-basic],[data-separator=metadata]{margin-block:0}[data-separator=line-info][data-separator-first]{margin-top:0}[data-separator=line-info][data-separator-last]{margin-bottom:0}[data-expand-index] [data-separator-wrapper]{grid-template-columns:32px auto;display:grid}[data-expand-index] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:32px 32px auto}[data-expand-button],[data-separator-content]{background-color:var(--diffs-bg-separator);flex:none;align-items:center;display:flex}[data-expand-index] [data-separator-content]:hover{cursor:pointer;text-decoration:underline}[data-expand-button]{cursor:pointer;min-width:32px;color:var(--diffs-fg-number);border-right:2px solid var(--diffs-bg);flex-shrink:0;justify-content:center;align-self:stretch;&:hover{color:var(--diffs-fg)}&[data-expand-all-button]{display:none}}[data-expand-down] [data-icon]{transform:scaleY(-1)}[data-separator-content]{height:100%;color:var(--diffs-fg-number);flex:auto;justify-content:flex-start;padding:0 1ch;overflow:hidden}[data-separator=line-info],[data-separator=line-info-basic]{& [data-separator-content]{user-select:none;height:100%;overflow:clip}}[data-unmodified-lines]{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;display:block;overflow:hidden}@supports (width:1cqi){[data-unified]{& [data-separator=line-info] [data-separator-wrapper]{padding-inline:var(--diffs-gap-inline,var(--diffs-gap-fallback));width:100cqi;& [data-separator-content]{border-radius:6px}}& [data-separator=line-info][data-expand-index] [data-separator-wrapper] [data-separator-content]{border-top-left-radius:unset;border-bottom-left-radius:unset}}[data-gutter]{& [data-separator=line-info] [data-separator-wrapper]{padding-left:var(--diffs-gap-inline,var(--diffs-gap-fallback))}& [data-separator=line-info] [data-separator-content]{border-top-left-radius:6px;border-bottom-left-radius:6px}& [data-separator=line-info][data-expand-index] [data-separator-content]{border-top-left-radius:unset;border-bottom-left-radius:unset}}[data-additions]{& [data-content] [data-separator=line-info]{background-color:var(--diffs-bg);& [data-separator-wrapper]{display:none}}& [data-gutter] [data-separator=line-info] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);border-top-right-radius:6px;border-bottom-right-radius:6px;height:100%;display:block;& [data-separator-content],& [data-expand-button]{display:none}}}[data-overflow=scroll] [data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]{width:calc(100cqi - var(--diffs-gap-inline,var(--diffs-gap-fallback)))}[data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);height:100%;margin-right:var(--diffs-gap-inline,var(--diffs-gap-fallback));border-top-right-radius:6px;border-bottom-right-radius:6px;display:block;& [data-separator-content],& [data-expand-button]{display:none}}[data-separator=line-info] [data-separator-wrapper]{& [data-expand-both],& [data-expand-down],& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}}@media (pointer:fine){[data-separator=line-info] [data-separator-wrapper]{&[data-separator-multi-button]{& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:unset}& [data-expand-down]{border-bottom-left-radius:6px;border-top-left-radius:unset}}}}}@media (pointer:coarse){[data-separator=line-info-basic] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:34px 34px auto;& [data-separator-content]{grid-column:unset;grid-row:unset}}@supports (width:1cqi){[data-separator=line-info] [data-separator-wrapper]{& [data-expand-both],& [data-expand-down],& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}&[data-separator-multi-button]{& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}& [data-expand-down]{border-bottom-left-radius:unset;border-top-left-radius:unset}}}}}@media (pointer:fine){[data-separator-wrapper][data-separator-multi-button]{grid-template-rows:50% 50%;display:grid;& [data-separator-content]{grid-area:1/2/-1;min-width:min-content}& [data-expand-button]{grid-column:1}}[data-separator=line-info] [data-separator-wrapper],[data-separator=line-info] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:34px auto}[data-separator=line-info-basic][data-expand-index] [data-separator-wrapper]{grid-template-columns:100% auto}[data-separator=line-info],[data-separator=line-info-basic]{& [data-separator-multi-button]{& [data-expand-up]{border-bottom:1px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg)}& [data-expand-down]{border-top:1px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg)}}}}[data-additions] [data-gutter] [data-separator-wrapper],[data-additions] [data-separator=line-info-basic] [data-separator-wrapper],[data-content] [data-separator-wrapper]{display:none}[data-line-annotation]{min-height:var(--diffs-annotation-min-height,0);z-index:2}[data-merge-conflict-actions]{z-index:2}[data-separator=custom]{grid-template-columns:subgrid;display:grid}[data-line],[data-column-number],[data-no-newline]{padding-inline:1ch;position:relative}[data-indicators=classic] [data-line]{padding-inline-start:2ch}[data-indicators=classic]{& [data-line-type=change-addition],& [data-line-type=change-deletion]{&[data-no-newline],&[data-line]{&:before{user-select:none;width:1ch;height:1lh;display:inline-block;position:absolute;top:0;left:0}}}& [data-line-type=change-addition]{&[data-line],&[data-no-newline]{&:before{content:"+";color:var(--diffs-addition-base)}}}& [data-line-type=change-deletion]{&[data-line],&[data-no-newline]{&:before{content:"-";color:var(--diffs-deletion-base)}}}}[data-indicators=bars]{& [data-line-type=change-deletion],& [data-line-type=change-addition]{&[data-column-number]{&:before{content:"";user-select:none;contain:strict;width:4px;height:100%;display:block;position:absolute;top:0;left:0}}}& [data-line-type=change-deletion]{&[data-column-number]{&:before{background-image:linear-gradient(0deg, var(--diffs-bg-deletion) 50%, var(--diffs-deletion-base) 50%);background-repeat:repeat;background-size:2px 2px;background-size:calc(1lh / round(1lh / 2px)) calc(1lh / round(1lh / 2px))}}}& [data-line-type=change-addition]{&[data-column-number]{&:before{background-color:var(--diffs-addition-base)}}}}[data-overflow=wrap]{& [data-line]{white-space:pre-wrap;word-break:break-word}& [data-annotation-content]{word-break:break-word}}[data-overflow=scroll] [data-line]{white-space:pre;min-height:1lh}[data-column-number]{box-sizing:content-box;text-align:right;user-select:none;color:var(--diffs-fg-number);padding-left:2ch}[data-line-number-content]{min-width:var(--diffs-min-number-column-width,var(--diffs-min-number-column-width-default,3ch));z-index:1;display:inline-block;position:relative}[data-disable-line-numbers]{& [data-gutter-buffer],& [data-column-number]{min-width:4px;padding:0;&:before{min-width:0}}& [data-line-number-content]{display:none}& [data-gutter-utility-slot]{right:unset;justify-content:flex-start;left:0}&[data-indicators=bars] [data-gutter-utility-slot]{left:6px}}[data-file][data-disable-line-numbers]{& [data-gutter-buffer],& [data-column-number]{border-right:0;min-width:0}}[data-diff-span]{box-decoration-break:clone;border-radius:3px}[data-line-type=change-addition] [data-diff-span]{background-color:var(--diffs-bg-addition-emphasis)}[data-line-type=change-deletion] [data-diff-span]{background-color:var(--diffs-bg-deletion-emphasis)}[data-merge-conflict=marker-start],[data-merge-conflict=marker-base],[data-merge-conflict=marker-separator],[data-merge-conflict=marker-end]{color:var(--diffs-fg);padding-left:1ch}[data-merge-conflict=marker-start],[data-merge-conflict=marker-end]{align-items:center;display:flex;&:after{color:var(--diffs-fg-conflict-marker);font-size:.75rem;font-style:normal;line-height:1.25rem;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));padding-left:1ch}}[data-merge-conflict=marker-start]:after{content:"(Current Change)"}[data-merge-conflict=marker-end]:after{content:"(Incoming Change)"}[data-merge-conflict-actions-content]{min-height:1.75rem;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));color:var(--diffs-fg);align-items:center;gap:.25rem;padding-inline:.5rem;font-size:.75rem;line-height:1.2;display:flex}[data-merge-conflict-action]{appearance:none;color:var(--diffs-fg-number);font:inherit;cursor:pointer;background:0 0;border:0;padding:0;font-style:normal}[data-merge-conflict-action]:hover{color:var(--diffs-fg)}[data-merge-conflict-action=current]:hover{color:var(--diffs-addition-base)}[data-merge-conflict-action=incoming]:hover{color:var(--diffs-modified-base)}[data-merge-conflict-action-separator]{color:var(--diffs-fg-number);opacity:.6;user-select:none}[data-diffs-header=default]{background-color:var(--diffs-bg);justify-content:space-between;align-items:center;gap:var(--diffs-gap-inline,var(--diffs-gap-fallback));min-height:calc(1lh + (var(--diffs-gap-block,var(--diffs-gap-fallback)) * 3));z-index:2;flex-direction:row;padding-inline:16px;display:flex;position:relative;top:0}[data-header-content]{align-items:center;gap:var(--diffs-gap-inline,var(--diffs-gap-fallback));white-space:nowrap;flex-direction:row;min-width:0;display:flex}[data-header-content] [data-prev-name],[data-header-content] [data-title]{text-overflow:ellipsis;white-space:nowrap;direction:rtl;min-width:0;overflow:hidden}[data-prev-name]{opacity:.7}[data-rename-icon]{fill:currentColor;flex-grow:0;flex-shrink:0}[data-diffs-header=default] [data-metadata]{white-space:nowrap;align-items:center;gap:1ch;display:flex}[data-diffs-header=default] [data-additions-count]{font-family:var(--diffs-font-family,var(--diffs-font-fallback));color:var(--diffs-addition-base)}[data-diffs-header=default] [data-deletions-count]{font-family:var(--diffs-font-family,var(--diffs-font-fallback));color:var(--diffs-deletion-base)}[data-change-icon]{fill:currentColor;flex-shrink:0}[data-change-icon=change],[data-change-icon=rename-pure],[data-change-icon=rename-changed]{color:var(--diffs-modified-base)}[data-change-icon=new]{color:var(--diffs-addition-base)}[data-change-icon=deleted]{color:var(--diffs-deletion-base)}[data-change-icon=file]{opacity:.6}[data-annotation-content]{z-index:2;isolation:isolate;white-space:normal;align-self:flex-start;min-width:0;display:flow-root;position:relative}[data-overflow=scroll] [data-annotation-content],[data-overflow=scroll] [data-merge-conflict-actions-content]{width:var(--diffs-column-content-width,auto);left:var(--diffs-column-number-width,0);position:sticky}[data-annotation-slot]{text-wrap-mode:wrap;word-break:normal;white-space-collapse:collapse}[data-gutter-utility-slot]{touch-action:none;justify-content:flex-end;display:flex;position:absolute;top:0;bottom:0;right:0}[data-utility-button]{appearance:none;cursor:pointer;width:1lh;height:1lh;font-size:var(--diffs-font-size,13px);line-height:var(--diffs-line-height,20px);background-color:var(--diffs-modified-base);color:var(--diffs-bg);fill:currentColor;z-index:4;touch-action:none;border:none;border-radius:4px;justify-content:center;align-items:center;margin-right:calc(-1lh + 1ch);padding:0;display:flex;position:relative;&:before{content:"";display:block;position:absolute;inset:0 0 0 -4px}}[data-decoration-bar-stack]{pointer-events:none;isolation:isolate;z-index:1;background-color:var(--diffs-decoration-bar-color,transparent);box-sizing:content-box;border-left:2px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg);width:6px;position:absolute;top:0;bottom:0;right:-2px;[data-decoration-bar-depth="1"] &{background-color:color-mix(in lab, var(--diffs-bg) 20%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="2"] &{background-color:color-mix(in lab, var(--diffs-bg) 45%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="3"] &{background-color:color-mix(in lab, var(--diffs-bg) 65%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-start] &{border-top-left-radius:5px;border-top-right-radius:5px}[data-decoration-bar-end] &{z-index:3;border-bottom-right-radius:5px;border-bottom-left-radius:5px}}[data-placeholder]{contain:strict}[data-error-wrapper]{padding:var(--diffs-gap-block,var(--diffs-gap-fallback)) var(--diffs-gap-inline,var(--diffs-gap-fallback));scrollbar-width:none;max-height:400px;overflow:auto;& [data-error-message]{color:var(--diffs-deletion-base);font-size:18px;font-weight:700}& [data-error-stack]{color:var(--diffs-fg-number)}}}@layer theme,rendered,unsafe;
|
|
280
|
+
`;const qa="@layer base, theme, rendered, unsafe;",Hm=new RegExp(`${Um(Ds)}\\s*:\\s*[^;]+;`);function Fm(e){return`${qa}
|
|
281
|
+
@layer unsafe {
|
|
282
|
+
${e}
|
|
283
|
+
}`}function Vm(e,t="system",n){const i=t==="system"?"":`
|
|
284
|
+
color-scheme: ${t};`,r=Wa(n);return`${qa}
|
|
285
|
+
@layer rendered {
|
|
286
|
+
:host {${i}
|
|
287
|
+
${r}
|
|
288
|
+
${e}
|
|
289
|
+
}
|
|
290
|
+
}`}function $m(e,t){const n=Wa(t);return e.replace(Hm,n)}function Um(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Bm=new WeakMap;function wr(e){const t=Bm.get(e);return t??e}function Fo(e,t,n){const i=new Map;for(const r of e){const o=wr(r);i.set(o,n?.slotNames.get(o)??t(r))}return{provided:e,current:e,slotNames:i}}function zm(e,t,n){for(const i of t){const r=wr(i);e.slotNames.has(r)||e.slotNames.set(r,n(i))}e.provided=t,e.current=t}function Gm(e,t,n){if(e==null)return n(t);const i=wr(t);let r=e.slotNames.get(i);return r==null&&(r=n(t),e.slotNames.set(i,r)),r}function jm(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function vi({code:e,pre:t,columnType:n,rowSpan:i,containerSize:r=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),n!=null&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),i!=null?e.style.setProperty("grid-row",`span ${i}`):e.style.removeProperty("grid-row"),r?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function Vo(e,t){const n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=""}}function Wm({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}return t??=qm(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function qm(){const e=document.createElement("style");return e.setAttribute(gu,""),e}let Km;function Xm(){return Km??="safari"in window&&"pushNotification"in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Qm(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function Jm(e,{type:t,diffIndicators:n,disableBackground:i,disableLineNumbers:r,overflow:o,split:s,totalLines:l,customProperties:a}){if(a!=null)for(const d in a){const u=a[d];u!=null&&e.setAttribute(d,`${u}`)}switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators")}return r?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),i?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",s?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",o),e.style.setProperty("--diffs-min-number-column-width-default",`${`${l}`.length}ch`),e}if(typeof HTMLElement<"u"&&customElements.get("diffs-container")==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const i=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(Mm)),i.adoptedStyleSheets=[e]}connectedCallback(){const i=this.shadowRoot??this.attachShadow({mode:"open"});er(i)}}customElements.define(pr,t)}async function tr(e,t=300){let n;try{await Promise.race([e(),new Promise(i=>{n=setTimeout(i,t)})])}finally{n!=null&&clearTimeout(n)}}function Ym({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:i,expandUnchanged:r,expandedHunks:o,collapsedContextThreshold:s,canHydratePartialDiff:l}){let a=mt(t,n),d=a;const u=r?!0:o,c=e.hunks.length-1;for(let f=0;f<e.hunks.length;f++){const h=e.hunks[f];if(h==null)throw new Error("computeEstimatedDiffHeights: invalid hunk index");const m=He({isPartial:e.isPartial,rangeSize:h.collapsedBefore,expandedHunks:u,hunkIndex:f,collapsedContextThreshold:s}),g=(m.fromStart+m.fromEnd)*t.lineHeight;if(a+=g,d+=g,m.collapsedLines>0){const v=Tt({type:i,metrics:t,hunkIndex:f,hunkSpecs:h.hunkSpecs})?.totalHeight??0;a+=v,d+=v}a+=h.splitLineCount*t.lineHeight,d+=h.unifiedLineCount*t.lineHeight;const b=Zm(h);a+=b.split*t.lineHeight,d+=b.unified*t.lineHeight;const _=f===c?Fe({fileDiff:e,hunkIndex:f,expandedHunks:u,collapsedContextThreshold:s,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(_!=null){const v=(_.fromStart+_.fromEnd)*t.lineHeight;if(a+=v,d+=v,_.collapsedLines>0){const y=et({type:i,metrics:t})?.totalHeight??0;a+=y,d+=y}}else if(f===c&&e.isPartial&&l){const v=et({type:i,metrics:t})?.totalHeight??0;a+=v,d+=v}}if(e.hunks.length>0){const f=Oa(t);a+=f,d+=f}return{splitHeight:a,unifiedHeight:d}}function Zm(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};const t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type==="context"){const n=t.lines>0?1:0;return{split:n,unified:n}}return eg(e,t)}function eg(e,t){const n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),i=t.deletions>0&&e.noEOFCRDeletions,r=t.additions>0&&e.noEOFCRAdditions;return{split:i||r?1:0,unified:n}}function nr({oldFile:e,newFile:t},n){if(!(e===void 0&&t===void 0)){if(e===void 0||t===void 0)throw new Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw new Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return t===null?{oldFile:e,newFile:t}:{oldFile:e,newFile:t}}}function Ka(e){return e.map(t=>({...t,hunkContent:t.hunkContent.map(n=>({...n}))}))}function Xa(e){return{...e,hunks:Ka(e.hunks),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}const tg=1;function Qa(e,...t){return`ck${tg}:${JSON.stringify([e,...t])}`}function Pn(e){return e!==""?e.split(fu):[]}function ir(e,t,n){const i=e==="clone"?Xa(t):t;if(!i.isPartial)throw new Error("hydratePartialDiff: fileDiff must be partial");switch(i.type){case"change":case"rename-changed":return ng(i,rg(i,n),$o(i,n));case"rename-pure":{const r=$o(i,n);og(i,n);const o=Pn(r.contents);return i.isPartial=!1,i.deletionLines=o,i.additionLines=o,Ja(i,null,r),i}}throw new Error(`hydratePartialDiff: ${i.type} diffs cannot be hydrated from loaded files`)}function ng(e,t,n){const i=Pn(t.contents),r=Pn(n.contents),{hunks:o,splitLineCount:s,unifiedLineCount:l}=ig(e.hunks,r.length);return e.hunks=o,e.splitLineCount=s,e.unifiedLineCount=l,e.isPartial=!1,e.deletionLines=i,e.additionLines=r,Ja(e,t,n),e}function ig(e,t){let n=0,i=0,r=0;const o=[];for(const s of e){const l=Math.max(s.additionStart-1,0),a=Math.max(s.deletionStart-1,0);let d=l,u=a,c=0,f=0,h=0,m=0;const g=[];for(const _ of s.hunkContent){if(_.type==="context"){g.push({..._,additionLineIndex:d,deletionLineIndex:u}),d+=_.lines,u+=_.lines,h+=_.lines,m+=_.lines;continue}g.push({..._,additionLineIndex:d,deletionLineIndex:u}),d+=_.additions,u+=_.deletions,c+=_.additions,f+=_.deletions,h+=Math.max(_.additions,_.deletions),m+=_.additions+_.deletions}const b=Math.max(ce(s.additionStart,s.additionCount)-r,0);o.push({...s,collapsedBefore:b,additionLineIndex:l,deletionLineIndex:a,additionLines:c,deletionLines:f,hunkContent:g,splitLineStart:n+b,unifiedLineStart:i+b,splitLineCount:h,unifiedLineCount:m}),n+=b+h,i+=b+m,r=oe(s.additionStart,s.additionCount)}if(o.length>0){const s=o[o.length-1],l=oe(s.additionStart,s.additionCount),a=Math.max(t-l,0);n+=a,i+=a}return{hunks:o,splitLineCount:n,unifiedLineCount:i}}function rg(e,t){if(t.oldFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function $o(e,t){if(t.newFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function og(e,t){if(t.oldFile!==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function sg(e,t,n){return e.cacheKey!=null?`${e.cacheKey}:hydrated`:ag(t,n)}function Ja(e,t,n){const i=sg(e,t,n);if(i==null){delete e.cacheKey;return}e.cacheKey=i}function ag(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?Qa("hydrated-files",e.cacheKey,t.cacheKey):void 0:e?.cacheKey??t?.cacheKey}const lg=new TextEncoder,dg=new TextDecoder("utf-8",{ignoreBOM:!0}),ug=/[\uD800-\uDFFF]/,rr=1024;let gt=new Uint8Array(rr);function Ya(){gt.length!==rr&&(gt=new Uint8Array(rr))}function K(e){if(e.length===0)return e;if(ug.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;gt.length<t&&(gt=new Uint8Array(t));const{written:n}=lg.encodeInto(e,gt);return dg.decode(gt.subarray(0,n))}const cg=new TextDecoder("utf-8",{ignoreBOM:!0}),hg={'"':'"',"\\":"\\",a:"\x07",b:"\b",t:" ",n:`
|
|
291
|
+
`,v:"\v",f:"\f",r:"\r"};function fg(e){if(e[0]!=='"')return;let t="",n=1;for(;n<e.length;){const i=e[n];if(i==='"')return{fileName:t,rawLength:n+1};if(i!=="\\"){t+=i,n++;continue}const r=hg[e[n+1]];if(r!=null){t+=r,n+=2;continue}const o=[];do{const s=pg(e,n+1);if(s==null)return;o.push(s),n+=4}while(e[n]==="\\"&&e[n+1]>="0"&&e[n+1]<="7");t+=cg.decode(new Uint8Array(o))}}function pg(e,t){const n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48,r=e.charCodeAt(t+2)-48;if(n>=0&&n<=3&&i>=0&&i<=7&&r>=0&&r<=7)return n*64+i*8+r}const mg=4096,gg=.5;function _g(e){for(const t of e.hunks)for(let n=0;n<t.hunkContent.length;n++){const i=t.hunkContent[n];if(i.type!=="change")continue;const r=bg(e,i);r!=null&&(t.hunkContent.splice(n,1,...r),n+=r.length-1)}}function vg(e,t,n){const{hunkContent:i}=e;for(let r=1;r<i.length;r++){const o=i[r],s=i[r-1];if(o.type!=="change"||o.additions>0&&o.deletions>0||s.type!=="context")continue;const l=o.additions>0,a=l?t.additionLines:t.deletionLines,d=l?o.additionLineIndex:o.deletionLineIndex,u=l?o.additions:o.deletions,c=a[d]??"";if(c.trim()!=="")continue;let f=!0;for(let _=1;_<u;_++)if(a[d+_]!==c){f=!1;break}if(!f)continue;let h=0;for(;h<s.lines&&t.additionLines[s.additionLineIndex+s.lines-1-h]===c;)h++;if(h===0||r===1&&h===s.lines||n!=null&&(h=n(o,h),h===0))continue;o.additionLineIndex-=h,o.deletionLineIndex-=h;const m=o.additionLineIndex+o.additions,g=o.deletionLineIndex+o.deletions,b=i[r+1];b?.type==="context"?(b.lines+=h,b.additionLineIndex=m,b.deletionLineIndex=g):i.splice(r+1,0,{type:"context",lines:h,additionLineIndex:m,deletionLineIndex:g}),s.lines-=h,s.lines===0&&(i.splice(r-1,1),r--)}}function bg(e,t){const{deletions:n,additions:i,deletionLineIndex:r,additionLineIndex:o}=t,s=Math.min(n,i),l=Math.abs(i-n);if(s===0||l===0||s*(l+1)>mg)return null;const a=[];for(let g=0;g<n;g++)a.push(Uo(e.deletionLines[r+g]??""));const d=[];for(let g=0;g<i;g++)d.push(Uo(e.additionLines[o+g]??""));const u=i>n;let c=0,f=-1;for(let g=0;g<=l;g++){let b=0;for(let _=0;_<s;_++)b+=Eg(a[_+(u?0:g)],d[_+(u?g:0)]);g===0?f=b+s*gg:b>f&&(f=b,c=g)}if(c===0)return null;const h=[],m=(g,b,_,v)=>{(g>0||b>0)&&h.push({type:"change",deletions:g,additions:b,deletionLineIndex:_,additionLineIndex:v})};return u?(m(0,c,r,o),m(s,s,r,o+c),m(0,i-s-c,r+s,o+c+s)):(m(c,0,r,o),m(s,s,r+c,o),m(n-s-c,0,r+c+s,o+s)),h}const yg=/\s+/g;function Uo(e){return e.replace(yg,"")}function Eg(e,t){if(e===t)return 1;const n=Math.max(e.length,t.length),i=Math.min(e.length,t.length);if(i===0)return 0;let r=0;for(;r<i&&e[r]===t[r];)r++;let o=0;for(;o<i-r&&e[e.length-1-o]===t[t.length-1-o];)o++;return(r+o)/n}const Sg=/^diff --git ("a\/(?:[^"\\]|\\.)*"|a\/.+?) ("b\/(?:[^"\\]|\\.)*"|b\/.+?)$/;function Cg(e,t,n=!1,i){const r=Dg(e),o=r?xg(e):Ag(e);let s;const l=[];for(const a of o){if(r&&!Rs.test(a)){if(s==null)s=K(a);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",a)}continue}else if(!r&&!Rg(a)){if(s==null)s=K(a);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",a)}continue}const d=Za(a,{cacheKey:void 0,isGitDiff:r,throwOnError:n});d!=null&&l.push(d)}return{patchMetadata:s,files:l}}function Lg(e,t){try{return Za(e,t)}finally{Ya()}}function Za(e,{cacheKey:t,isGitDiff:n=Rs.test(e),oldFile:i,newFile:r,throwOnError:o=!1}={}){let s=0;const l=il(e,"@@ ");let a;const d=i==null||r==null;let u=0,c=0;for(const f of l){const h=el(f),m=h[0];if(m==null){if(o)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",f);continue}const g=nl(m);let b=0,_=0;if(g==null||a==null){if(a!=null){if(o)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",f);continue}a={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:!d&&i!=null&&r!=null?Bo(r.contents):[],deletionLines:!d&&i!=null&&r!=null?Bo(i.contents):[],cacheKey:jo(t)},a.additionLines.length===1&&r?.contents===""&&(a.additionLines.length=0),a.deletionLines.length===1&&i?.contents===""&&(a.deletionLines.length=0);for(const w of h){if(w.startsWith("diff --git")){const I=w.trim().match(Sg);if(I==null){if(o)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",w);continue}const k=kt(I[1],!0),R=kt(I[2],!0);a.name=K(R),k!==R&&(a.prevName=K(k));continue}const A=w.startsWith("---")||w.startsWith("+++")?w.match(pu):null;if(A!=null){const[,I,k]=A,R=kt(k,n);if(I==="---"&&R!=="/dev/null"){const P=K(R);a.prevName=P,a.name=P}else I==="+++"&&R!=="/dev/null"&&(a.name=K(R))}else if(n){if(w.startsWith("new mode ")&&(a.mode=K(w.slice(8).trim())),w.startsWith("old mode ")&&(a.prevMode=K(w.slice(8).trim())),w.startsWith("new file mode")&&(a.type="new",a.mode=K(w.slice(13).trim())),w.startsWith("deleted file mode")&&(a.type="deleted",a.mode=K(w.slice(17).trim())),w.startsWith("similarity index")&&(w.startsWith("similarity index 100%")?a.type="rename-pure":a.type="rename-changed"),w.startsWith("index ")){const[,I,k,R]=w.trim().match(mu)??[];I!=null&&(a.prevObjectId=K(I)),k!=null&&(a.newObjectId=K(k)),R!=null&&(a.mode=K(R))}(w.startsWith("rename from ")||w.startsWith("copy from "))&&(a.prevName=K(kt(w.slice(w.startsWith("rename")?12:10)))),(w.startsWith("rename to ")||w.startsWith("copy to "))&&(a.name=K(kt(w.slice(w.startsWith("rename")?10:8))))}}continue}let v,y;for(;h.length>0&&(h[h.length-1]===`
|
|
292
|
+
`||h[h.length-1]==="\r"||h[h.length-1]===`\r
|
|
293
|
+
`||h[h.length-1]==="");)h.pop();const{additionStart:S,deletionStart:E}=g;u=d?u:E-1,c=d?c:S-1;const C={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:g.additionCount,additionStart:S,additionLines:b,deletionCount:g.deletionCount,deletionStart:E,deletionLines:_,deletionLineIndex:u,additionLineIndex:c,hunkContent:[],hunkContext:jo(g.hunkContext),hunkSpecs:K(m),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let L=0,x=0;for(let w=1;w<h.length;w++){const A=h[w];if(L>=C.additionCount&&x>=C.deletionCount&&!A.startsWith("\\")){if(!(Tg(A)&&!Ig(A)))break;if(o)throw Error("parsePatchContent: hunk has more lines than expected")}const I=A[0];if(I!=="+"&&I!=="-"&&I!==" "&&I!=="\\"){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${I}", full line: "${A}"`),console.error("processFile: invalid rawLine:",A);continue}const k=Og(I);if(k==="addition"){if(o&&L>=C.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const R=bi(A);(v==null||v.type!=="change")&&(v=yi("change",u,c),C.hunkContent.push(v)),c++,L++,d&&a.additionLines.push(R),v.additions++,b++,y="addition"}else if(k==="deletion"){if(o&&x>=C.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const R=bi(A);(v==null||v.type!=="change")&&(v=yi("change",u,c),C.hunkContent.push(v)),u++,x++,d&&a.deletionLines.push(R),v.deletions++,_++,y="deletion"}else if(k==="context"){if(o&&(x>=C.deletionCount||L>=C.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const R=bi(A);(v==null||v.type!=="context")&&(v=yi("context",u,c),C.hunkContent.push(v)),c++,u++,L++,x++,d&&(a.deletionLines.push(R),a.additionLines.push(R)),v.lines++,y="context"}else if(k==="metadata"&&v!=null){if(v.type==="context"?(C.noEOFCRAdditions=!0,C.noEOFCRDeletions=!0):y==="deletion"?C.noEOFCRDeletions=!0:y==="addition"&&(C.noEOFCRAdditions=!0),d&&(y==="addition"||y==="context")){const R=a.additionLines.length-1;R>=0&&(a.additionLines[R]=Ve(a.additionLines[R]))}if(d&&(y==="deletion"||y==="context")){const R=a.deletionLines.length-1;R>=0&&(a.deletionLines[R]=Ve(a.deletionLines[R]))}}}if(L!==C.additionCount||x!==C.deletionCount){if(o)throw Error("parsePatchContent: hunk line count mismatch");console.error(`parsePatchContent: hunk line count mismatch: "${m.trimEnd()}", declared old/new ${C.deletionCount}/${C.additionCount}, parsed old/new ${x}/${L}`);const w=ce(C.additionStart,C.additionCount)+(L===0?0:1),A=ce(C.deletionStart,C.deletionCount)+(x===0?0:1);if(!d){const I=w-C.additionStart,k=A-C.deletionStart;C.additionLineIndex+=I,C.deletionLineIndex+=k;for(const R of C.hunkContent)R.additionLineIndex+=I,R.deletionLineIndex+=k}C.additionStart=w,C.deletionStart=A,C.additionCount=L,C.deletionCount=x}C.additionLines=b,C.deletionLines=_,C.collapsedBefore=Math.max(ce(C.additionStart,C.additionCount)-s,0),a.hunks.push(C),s=oe(C.additionStart,C.additionCount);for(const w of C.hunkContent)w.type==="context"?(C.splitLineCount+=w.lines,C.unifiedLineCount+=w.lines):(C.splitLineCount+=Math.max(w.additions,w.deletions),C.unifiedLineCount+=w.deletions+w.additions);C.splitLineStart=a.splitLineCount+C.collapsedBefore,C.unifiedLineStart=a.unifiedLineCount+C.collapsedBefore,a.splitLineCount+=C.collapsedBefore+C.splitLineCount,a.unifiedLineCount+=C.collapsedBefore+C.unifiedLineCount}if(a!=null){if(o&&d&&!n&&a.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(a.hunks.length>0&&!d&&a.additionLines.length>0&&a.deletionLines.length>0){const f=a.hunks[a.hunks.length-1],h=oe(f.additionStart,f.additionCount),m=a.additionLines.length,g=Math.max(m-h,0);a.splitLineCount+=g,a.unifiedLineCount+=g}return n||(a.prevName!=null&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(i==null||i.contents==="")&&r!=null&&r.contents!==""?a.type="new":i!=null&&i.contents!==""&&(r==null||r.contents==="")&&(a.type="deleted")),a.type!=="rename-pure"&&a.type!=="rename-changed"&&(a.prevName=void 0),_g(a),a}}function wg(e,t,n=!1){const i=[],r=kg(e)?e.split(hu):[e];for(const o of r)try{i.push(Cg(o,t,n,t!=null?i.length:void 0))}catch(s){if(n)throw s;console.error(s)}finally{Ya()}return i}function kt(e,t=!1){const n=e.trim(),i=n.startsWith('"')?fg(n)?.fileName??n:n;return t&&(i.startsWith("a/")||i.startsWith("b/"))?i.slice(2):i}function kg(e){return e.startsWith("From ")||e.includes(`
|
|
294
|
+
From `)}function Bo(e){const t=el(e);for(let n=0;n<t.length;n++)t[n]=K(t[n]);return t}function el(e){if(e.length===0)return[""];const t=[];let n=0;for(;;){const i=e.indexOf(`
|
|
295
|
+
`,n);if(i===-1)break;t.push(e.slice(n,i+1)),n=i+1}return n<e.length&&t.push(e.slice(n)),t}function xg(e){return il(e,"diff --git")}function Ag(e){if(e.length===0)return[""];const t=[];let n=0,i=0,r=0,o=0,s=!1;for(;i<e.length;){const l=or(e,i);if(r<=0&&o<=0){if(tl(e,i)){i>n&&t.push(e.slice(n,i)),n=i,s=!0,i=or(e,l);continue}if(s&&e.startsWith("@@ -",i)){const d=nl(e.slice(i,l));d!=null&&(r=d.deletionCount,o=d.additionCount)}i=l;continue}const a=e[i];if(a==="\\"){i=l;continue}a===" "?(r=Math.max(r-1,0),o=Math.max(o-1,0)):a==="-"?r=Math.max(r-1,0):a==="+"&&(o=Math.max(o-1,0)),i=l}return t.push(e.slice(n)),t}function Rg(e){return tl(e,0)}function tl(e,t){const n=or(e,t);return zo(e,t,"---")&&zo(e,n,"+++")}function zo(e,t,n){if(!e.startsWith(n,t))return!1;const i=e[t+n.length];if(i!==" "&&i!==" ")return!1;for(let r=t+n.length+1;r<e.length;r++){const o=e[r];if(o===`
|
|
296
|
+
`||o==="\r")break;if(o!==" "&&o!==" ")return!0}return!1}function or(e,t){const n=e.indexOf(`
|
|
297
|
+
`,t);return n===-1?e.length:n+1}function Tg(e){const t=e[0];return t==="+"||t==="-"||t===" "}function Ig(e){if(!e.startsWith("--"))return!1;for(let t=2;t<e.length;t++){const n=e[t];if(n!==" "&&n!==" "&&n!==`
|
|
298
|
+
`&&n!=="\r")return!1}return!0}function nl(e){if(!e.startsWith("@@ -"))return;let t=4;const n=sn(e,t);if(n==null)return;const i=n.value;t=n.endIndex;let r=1;if(e[t]===","){const u=sn(e,t+1);if(u==null)return;r=u.value,t=u.endIndex}if(e[t]!==" "||e[t+1]!=="+")return;t+=2;const o=sn(e,t);if(o==null)return;const s=o.value;t=o.endIndex;let l=1;if(e[t]===","){const u=sn(e,t+1);if(u==null)return;l=u.value,t=u.endIndex}if(e[t]!==" "||e[t+1]!=="@"||e[t+2]!=="@")return;let a;const d=t+3;return e[d]===" "&&(a=Pg(e.slice(d+1))),{additionCount:l,additionStart:s,deletionCount:r,deletionStart:i,hunkContext:a}}function sn(e,t){let n=t,i=0;for(;n<e.length;n++){const r=e.charCodeAt(n)-48;if(r<0||r>9)break;i=i*10+r}if(n!==t)return{value:i,endIndex:n}}function Pg(e){return e.endsWith(`\r
|
|
299
|
+
`)?e.slice(0,-2):e.endsWith(`
|
|
300
|
+
`)?e.slice(0,-1):e}function Dg(e){return e.startsWith("diff --git")||e.includes(`
|
|
301
|
+
diff --git`)}function il(e,t){if(e.length===0)return[""];const n=`
|
|
302
|
+
${t}`,i=e.startsWith(t)?0:Go(e,n,0);if(i===-1)return[e];const r=[];i>0&&r.push(e.slice(0,i));let o=i;for(;;){const s=Go(e,n,o+1);if(s===-1)break;r.push(e.slice(o,s)),o=s}return r.push(e.slice(o)),r}function Go(e,t,n){const i=e.indexOf(t,n);return i===-1?-1:i+1}function jo(e){return e==null?e:K(e)}function Og(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function bi(e){const t=e.slice(1);return K(t===""?`
|
|
303
|
+
`:t)}function yi(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}const Ng="/dev/null";function Ke(e,t,n,i=!1){if(e===null&&t===null)throw new Error("parseDiffFromFile: You must pass oldFile, newFile, or both");const r=e??Wo(),o=t??Wo(),s=jp(r.name,o.name,r.contents,o.contents,r.header,o.header,n),l=Lg(s,{cacheKey:(()=>{const d=e?.cacheKey,u=t?.cacheKey;return d!=null&&u!=null?Qa("diff",d,u):void 0})(),oldFile:r,newFile:o,throwOnError:i});if(l==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");e===null?(l.type="new",l.prevName=void 0):t===null&&(l.type="deleted",l.prevName=void 0);const a=t?.lang??(t===null?e?.lang:void 0);return a!=null&&(l.lang=a),l}function Wo(){return{name:Ng,contents:""}}var Mg=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(t==null||n==null)for(const i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?t=i:"additions"in i.dataset&&(n=i));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function De(e,t){const n=Ke({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function Hg(e,t){const n=Math.max(e,1);let i=Array.from({length:n},(r,o)=>`${" ".repeat(o+1)}
|
|
304
|
+
`).join("");return i===t&&(i=Array.from({length:n},(r,o)=>`\0${" ".repeat(o)}
|
|
305
|
+
`).join("")),i}function Fg(e){for(const t of e)if(t.trim().length>0)return!1;return!0}function sr(e,t){return t.length>0&&t.length<e.deletionLines.length&&Fg(t)}function Dn(e,t,n){const i=e.deletionLines.join(""),r=Hg(t.length,i),o=Ke({name:e.prevName??e.name,contents:i},{name:e.name,contents:r,lang:e.lang},n);return{hunks:o.hunks,splitLineCount:o.splitLineCount,unifiedLineCount:o.unifiedLineCount,additionLines:t,deletionLines:o.deletionLines,type:o.type}}function vn(e,t){return Dn(e,[""],t)}function rl(e,t){if(e.additionLines.length===0)return vn(e,t);if(sr(e,e.additionLines))return Dn(e,e.additionLines,t);const n=e.additionLines,i=De(e,t);return ol(i,n),i}function Vg(e){return e.length>1&&e.at(-1)===""}function ol(e,t){if(!Vg(t))return;const n=t.length-e.additionLines.length;if(n<=0)return;const i=e.additionLines.length,r=e.hunks.at(-1);if(r!=null&&oe(r.additionStart,r.additionCount)===i){for(const o of r.hunkContent)if(o.type==="change"&&o.additions<o.deletions&&o.additionLineIndex+o.additions===i){e.additionLines=t,o.additions+=n,r.additionCount+=n,r.additionLines+=n,qn(e);return}}}function $g(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return Ie(e,De(e,n));const i=Array.from(t);if(i.length===0)return Ie(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(const o of i){const s=e.additionLines[o],l=e.deletionLines[o];if(s==null||l==null||Ve(s)===Ve(l))return Ie(e,De(e,n))}const r=Ug(e,i);if(r.size===0)return Ie(e,De(e,n));for(const o of r)if(!zg(e,o,n))return Ie(e,De(e,n));return qn(e),kp(e)?Ie(e,De(e,n)):Ie(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function Ie(e,t){return Object.assign(e,t),t}function Ug(e,t){const n=new Set;for(const i of t){const r=Bg(e,i);if(r==null)return new Set;n.add(r)}return n}function Bg(e,t){for(const[n,i]of e.hunks.entries()){const r=i.additionLineIndex+i.additionCount;if(t>=i.additionLineIndex&&t<r)return n}}function zg(e,t,n){const i=e.hunks[t];if(i==null)return!1;const r=e.deletionLines.slice(i.deletionLineIndex,i.deletionLineIndex+i.deletionCount),o=e.additionLines.slice(i.additionLineIndex,i.additionLineIndex+i.additionCount),s=Ke({name:e.prevName??e.name,contents:r.join("")},{name:e.name,contents:o.join(""),lang:e.lang},{...n,context:0}),l=s.hunks[0];return l==null||s.hunks.length!==1?!1:(Gg(i,l),sl(e,t),!0)}function sl(e,t){const n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}const i=e.additionLines.at(-1),r=e.deletionLines.at(-1);n.noEOFCRAdditions=i!=null&&i!==""&&!i.endsWith(`
|
|
306
|
+
`),n.noEOFCRDeletions=r!=null&&r!==""&&!r.endsWith(`
|
|
307
|
+
`)}function Gg(e,t){const n=e.additionLineIndex,i=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(r=>al(r,n,i)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart=e.additionStart+t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=i+t.deletionLineIndex,e.deletionStart=e.deletionStart+t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,kr(e)}function al(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function kr(e){let t=0,n=0;for(const i of e.hunkContent)i.type==="context"?(t+=i.lines,n+=i.lines):(t+=Math.max(i.additions,i.deletions),n+=i.additions+i.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function qn(e){let t=0,n=0,i=0;for(const r of e.hunks)r.collapsedBefore=Math.max(ce(r.additionStart,r.additionCount)-i,0),r.splitLineStart=t+r.collapsedBefore,r.unifiedLineStart=n+r.collapsedBefore,kr(r),t+=r.collapsedBefore+r.splitLineCount,n+=r.collapsedBefore+r.unifiedLineCount,i=oe(r.additionStart,r.additionCount);if(e.hunks.length>0){const r=e.hunks[e.hunks.length-1],o=Math.max(e.additionLines.length-oe(r.additionStart,r.additionCount),0);t+=o,n+=o}e.splitLineCount=t,e.unifiedLineCount=n}const qo=new WeakMap;function jg(e){return e.length>1&&e[e.length-1]===""?e.slice(0,-1):e}function Wg(e,t){const n=Math.min(e.length,t.length);let i=0;for(;i<n&&e[i]===t[i];)i++;let r=e.length,o=t.length;for(;r>i&&o>i&&e[r-1]===t[o-1];)r--,o--;if(!(i===r&&i===o))return{start:i,deletionEnd:r,additionEnd:o}}function ar(e,t,n){const i=e.hunks,r=e.additionLines,o=jg(r),s=o===r?e:{...e,additionLines:o},l=n0(i,e0(s,t,n),e.deletionLines.length),a=o0(s,l);if(e.additionLines=o,e.hunks=a,e.editSessionDirty=!0,d0(e),ol(e,r),!!a0(i,e.hunks))return{regions:l.map(d=>d.previousSpan)}}function qg(e,t,n,i){const r=new Set(t),o=Array.from(r).filter(u=>u>=0&&u<e.additionLines.length).sort((u,c)=>u-c);if(o.length===0)return;const s=u=>r.has(u)?i?.get(u):e.additionLines[u],{hunks:l}=e;let a,d=0;for(const u of o){for(;d<l.length;){const h=l[d];if(u<On(h)+h.additionCount)break;d++}const c=l[d],f=c==null?void 0:On(c);if(f==null||u<f||a!=null&&a!==d)return ar(e,n,s);a=d}if(a!=null){if(Kg(e,o,a,i,n)){e.editSessionDirty=!0;return}return ar(e,n,s)}}function Kg(e,t,n,i,r){if(i==null||r?.ignoreWhitespace===!0||r?.stripTrailingCr===!0)return!1;const o=Xg(e),s=e.hunks[n];if(s.hunkContent.some(Qg))return!1;for(const l of t){const a=i.get(l),d=e.additionLines[l];if(a==null||d==null||o.has(a)||o.has(d))return!1;let u=!1;for(const c of s.hunkContent)if(c.type==="change"&&c.additions===c.deletions&&l>=c.additionLineIndex&&l<c.additionLineIndex+c.additions){u=!0;break}if(!u)return!1}return!0}function Xg(e){const t=qo.get(e);if(t?.lines===e.deletionLines)return t.set;const n=new Set(e.deletionLines);return qo.set(e,{lines:e.deletionLines,set:n}),n}function Qg(e){return e?.type==="change"&&(e.additions===0||e.deletions===0)}function Jg(e,t){const n=new Map,{regions:i}=t;for(let r=0;r<=i.length;r++){const o=i[r-1],s=i[r],l=r===0?e.get(0):o==null?void 0:e.get(o.lastIndex+1),a=s==null?void 0:e.get(s.firstIndex),d=l?.fromStart??0,u=a?.fromEnd??0;(d>0||u>0)&&n.set(r,{fromStart:d,fromEnd:u})}return n}function Yg(e,t,n){const i=[];if(e.isPartial)return i;for(const[o,s]of e.hunks.entries()){const l=He({isPartial:e.isPartial,rangeSize:s.collapsedBefore,expandedHunks:t,hunkIndex:o,collapsedContextThreshold:n});if(l.rangeSize<=n)continue;const a=at(s),d=a-l.rangeSize;l.fromStart>0&&i.push([d,d+l.fromStart]),l.fromEnd>0&&i.push([a-l.fromEnd,a])}const r=Fe({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"captureExpansionAnchors"});if(r!=null&&r.fromStart>0&&r.rangeSize>n){const o=e.hunks[e.hunks.length-1],s=at(o)+o.deletionCount;i.push([s,s+r.fromStart])}return i}function Zg(e,t){const n=new Map;if(t.length===0)return n;const i=(o,s,l)=>{if(l<=s)return;let a=0,d=0;for(const[u,c]of t)c<=s||u>=l||(u<=s&&(a=Math.max(a,Math.min(c,l)-s)),c>=l&&(d=Math.max(d,l-Math.max(u,s))));(a>0||d>0)&&n.set(o,{fromStart:a,fromEnd:d})};for(const[o,s]of e.hunks.entries()){const l=at(s);i(o,l-Math.max(s.collapsedBefore,0),l)}const r=e.hunks[e.hunks.length-1];return r!=null&&!e.isPartial&&e.deletionLines.length>0&&i(e.hunks.length,at(r)+r.deletionCount,e.deletionLines.length),n}function Ko(e,t){return e.editSessionDirty!==!0?!1:(delete e.editSessionDirty,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join("")===""?De(e,t):rl(e,t)),!0)}function e0(e,t,n){if(Wg(e.deletionLines,e.additionLines)==null)return[];const i=Ke({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);let r;const o=(d,u)=>{r??=t0(e.hunks);for(let c=0;c<=u;c++){const f=r.get(d.deletionLineIndex-c);if(!(f==null||f.additions!==d.additions||f.deletions!==d.deletions)){if(d.additions>0&&n!=null){for(let h=0;h<d.additions;h++)if(n(f.additionLineIndex+h)!==i.additionLines[d.additionLineIndex+h])return u}return c}}return u},s=[];let l=0,a=0;for(const d of i.hunks){vg(d,i,o);const u=d.additionCount>0?d.additionLineIndex-l:d.deletionLineIndex-a;l+=u,a+=u;for(const c of d.hunkContent){if(c.type==="context"){l+=c.lines,a+=c.lines;continue}const f=al(c,0,0);f.additions===0&&(f.additionLineIndex=l),f.deletions===0&&(f.deletionLineIndex=a),s.push(f),l+=f.additions,a+=f.deletions}}return s}function t0(e){const t=new Map;for(const n of e)for(const i of n.hunkContent)i.type==="change"&&(i.additions===0||i.deletions===0)&&t.set(i.deletionLineIndex,i);return t}function n0(e,t,n){const i=e.map((s,l)=>{const a=at(s);return{deletionStart:a,deletionEnd:a+s.deletionCount,blocks:[],previousSpan:{firstIndex:l,lastIndex:l}}}),r=[];let o=0;for(const s of t){const l=s.deletionLineIndex,a=l+s.deletions;for(;o<i.length&&i[o].deletionEnd<l;)r.push(i[o]),o++;let d=r.length>0&&i0(l,a,r[r.length-1])?r.pop():void 0;for(;o<i.length&&i[o].deletionStart<=a;)d=r0(d,i[o]),o++;if(d==null){let u=l,c=a;if((s.deletions===0||s.additions===0)&&n>s.deletions){const f=r[r.length-1]?.deletionEnd??0,h=i[o]?.deletionStart??n;l>f?u--:a<h&&c++}d={deletionStart:u,deletionEnd:c,blocks:[],previousSpan:void 0}}d.deletionStart=Math.min(d.deletionStart,l),d.deletionEnd=Math.max(d.deletionEnd,a),d.blocks.push(s),r.push(d)}for(;o<i.length;)r.push(i[o]),o++;return r}function i0(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function r0(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function o0(e,t){const n=[];let i=0,r=0;for(const o of t){const s=o.deletionStart-i;if(s<0)throw new Error("buildRegionHunks: overlapping old-side regions");i+=s,r+=s;const l=r,a=[];for(const u of o.blocks){const c=u.deletionLineIndex-i,f=u.additionLineIndex-r;if(c<0||c!==f)throw new Error("buildRegionHunks: canonical block context mismatch");Xo(a,c,r,i),i+=c,r+=f,a.push({...u}),i+=u.deletions,r+=u.additions}const d=o.deletionEnd-i;if(d<0)throw new Error("buildRegionHunks: block exceeds its old-side region");Xo(a,d,r,i),i+=d,r+=d,n.push(s0(e,{additionStart:l,additionEnd:r,deletionStart:o.deletionStart,deletionEnd:o.deletionEnd},a))}if(e.deletionLines.length-i!==e.additionLines.length-r)throw new Error("buildRegionHunks: trailing context mismatch");return n}function s0(e,t,n){const i=t.additionEnd-t.additionStart,r=t.deletionEnd-t.deletionStart;let o=0,s=0;for(const a of n)a.type==="change"&&(o+=a.additions,s+=a.deletions);const l={collapsedBefore:0,additionStart:an(t.additionStart,i),additionCount:i,additionLines:o,additionLineIndex:Jo(t.additionStart,i),deletionStart:an(t.deletionStart,r),deletionCount:r,deletionLines:s,deletionLineIndex:Jo(t.deletionStart,r),hunkContent:n,hunkSpecs:`@@ -${an(t.deletionStart,r)},${r} +${an(t.additionStart,i)},${i} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return kr(l),l}function Xo(e,t,n,i){t>0&&e.push({type:"context",lines:t,additionLineIndex:n,deletionLineIndex:i})}function a0(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){const i=e[n],r=t[n];if(at(i)!==at(r)||i.deletionCount!==r.deletionCount||On(i)!==On(r)||i.additionCount!==r.additionCount||i.splitLineCount!==r.splitLineCount||!l0(i,r))return!0}return!1}function l0(e,t){const n=Qo(e),i=Qo(t);for(;;){const r=n.next(),o=i.next();if(r.done===!0||o.done===!0)return r.done===o.done;if(r.value[0]!==o.value[0]||r.value[1]!==o.value[1])return!1}}function*Qo(e){for(const t of e.hunkContent){if(t.type==="context"){for(let i=0;i<t.lines;i++)yield[t.deletionLineIndex+i,t.additionLineIndex+i];continue}const n=Math.max(t.deletions,t.additions);for(let i=0;i<n;i++)yield[i<t.deletions?t.deletionLineIndex+i:void 0,i<t.additions?t.additionLineIndex+i:void 0]}}function On(e){return ce(e.additionStart,e.additionCount)}function at(e){return ce(e.deletionStart,e.deletionCount)}function an(e,t){return t===0?e:e+1}function Jo(e,t){return t===0?e-1:e}function d0(e){qn(e);for(let t=0;t<e.hunks.length;t++)sl(e,t)}function ln(e){return M({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function dn(e){return M({tagName:"div",children:[M({tagName:"span",children:[Le("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function Ei(e){return M({tagName:"div",children:[Tn({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function ct({type:e,content:t,expandIndex:n,chunked:i=!1,slotName:r,isFirstHunk:o,isLastHunk:s}){let l=0;const a=[];if(e==="metadata"&&t!=null&&a.push(M({tagName:"div",children:[Le(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const d=[];n!=null&&(i?(o||(d.push(Ei("up")),l++),s||(d.push(Ei("down")),l++)):(d.push(Ei(!o&&!s?"both":o?"down":"up")),l++)),d.push(M({tagName:"div",children:[M({tagName:"span",children:[Le(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),i&&n!=null&&d.push(M({tagName:"div",children:[Le("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),a.push(M({tagName:"div",children:d,properties:{"data-separator-wrapper":"","data-separator-multi-button":l>1?"":void 0}}))}return e==="custom"&&r!=null&&a.push(M({tagName:"slot",properties:{name:r}})),M({tagName:"div",children:a,properties:{"data-separator":a.length===0?"simple":e,"data-expand-index":n,"data-separator-first":o?"":void 0,"data-separator-last":s?"":void 0}})}function u0(e,t){return`hunk-separator-${e}-${t}`}function c0(e){const t=e.at(-1);return t==null?0:Math.max(oe(t.additionStart,t.additionCount),oe(t.deletionStart,t.deletionCount))}let h0=-1;var f0=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++h0}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLangs=["text"];renderCache;pendingHighlightResult;pendingStructuralRows;editSessionActive=!1;constructor(e={theme:Ce},t=tt,n,i){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=i,i?.isWorkingPool()!==!0&&(this.highlighter=pt(e.theme??Ce)?Ki():void 0)}cleanUp(){this.endEditSession(),this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.editSessionActive?(this.renderCache!=null&&(this.renderCache.renderRange=void 0),this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0):this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this)}beginEditSession(e,t){const{editSessionActive:n}=this;this.editSessionActive=!0,n||(this.pendingHighlightResult=void 0),this.diff=e,n&&this.renderCache!=null&&this.renderCache.diff!==e&&this.clearRenderCache();const{renderCache:i}=this;if(!e.isPartial&&e.additionLines.length===0){Object.assign(e,vn(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache();return}if(i==null||n&&i.diff===e)return;const{options:r}=this.getRenderOptions(e),o=i.diff===e,s=t!=null&&G(i.diff,t),{result:l}=i;if(!i.highlighted||l==null||!Re(i.options,r)||!o&&!s){this.clearRenderCache();return}o||(this.renderCache={diff:e,options:r,highlighted:!0,result:{...l,code:{...l.code,additionLines:[...l.code.additionLines]}},renderRange:i.renderRange})}endEditSession(){this.editSessionActive=!1,this.pendingHighlightResult=void 0,this.diff==null&&this.clearRenderCache()}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){const{diff:e,renderCache:t,workerManager:n}=this;return e==null||t==null||!G(t.diff,e)||Rt(e)||xt(e,this.getTokenizeMaxLength())?Promise.resolve():!this.editSessionActive&&n?.isWorkingPool()===!0&&e.cacheKey!=null?(n.evictDiffFromCache(e.cacheKey),n.primeDiffHighlightCache(e).then(()=>{this.applyRefreshedResult(e,n.getDiffResultCache(e))}).catch(i=>this.onHighlightError(i))):this.asyncHighlight(e).then(i=>this.applyRefreshedResult(e,i)).catch(i=>this.onHighlightError(i))}applyRefreshedResult(e,t){const{diff:n,renderCache:i}=this;if(t==null||n==null||i==null||!G(n,e)||!G(i.diff,e)||this.editSessionActive)return;const{options:r}=this.getRenderOptions(n);Re(r,t.options)&&(this.pendingHighlightResult={diff:n,options:t.options,highlighted:!0,result:t.result},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){this.renderCache=void 0,this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){const i={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(i.fromStart+=n),(t==="down"||t==="both")&&(i.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,i)}getExpandedHunk(e){return this.expandedHunks.get(e)??Eu}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),i=n[t.lineNumber]??[];n[t.lineNumber]=i,i.push(t)}}updateRenderCache(e,t,n=!1){this.pendingStructuralRows=void 0;const{renderCache:i}=this;if(i==null)return!1;const{result:r,diff:o}=i;if(r==null)return!1;if(o.isPartial)throw new Error("Could not update render cache for partial diff");const s=r.code.additionLines,l=this.pendingStructuralRows=n?new Map:void 0,a=[],d=new Map;for(const[c,f]of e){const h=s[c]?.properties??{},m=f.map(y=>y[2]).join(""),g=c<o.additionLines.length,b=g?o.additionLines[c]??"":"",_=Ve(b);l==null&&g&&(o.additionLines[c]=ym(b,m),_!==m&&(a.push(c),d.set(c,b)));const v={type:"element",tagName:"div",properties:{"data-line":h["data-line"]??c+1,"data-line-index":h["data-line-index"]??c,"data-line-type":h["data-line-type"]??"context"},children:f.map(([y,S,E])=>y===0&&S===""?E===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:E}:{type:"element",tagName:"span",properties:{"data-char":y,style:`color:${S};`},children:[{type:"text",value:E}]})};l!=null?l.set(c,v):s[c]=v}let u=!1;if(a.length>0)if(this.editSessionActive)if(o.additionLines.length<=1&&o.additionLines.join("")==="")this.applyRecomputePreservingSessionType(o,vn(o,this.options.parseDiffOptions)),u=!0;else if(sr(o,o.additionLines))this.applyRecomputePreservingSessionType(o,Dn(o,o.additionLines,this.options.parseDiffOptions)),u=!0;else{const c=qg(o,a,this.options.parseDiffOptions,d);this.applyExpansionRemap(c),u=c!=null}else Object.assign(o,$g(o,a,this.options.parseDiffOptions));return r.baseThemeType=t,i.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=Jg(this.expandedHunks,e))}applyDocumentChange(e){const{pendingStructuralRows:t,renderCache:n}=this;this.pendingStructuralRows=void 0;const i=this.diff??n?.diff;if(i==null)return;const r=n?.result;if(i.isPartial)throw new Error("Could not apply document change for partial diff");const{additionLines:o}=i;if(i.additionLines=_0(e),r!=null&&(r.code.additionLines=g0(o,i.additionLines,r.code.additionLines,e)),i.additionLines.length<=1&&i.additionLines.join("")===""?(this.applyRecomputePreservingSessionType(i,vn(i,this.options.parseDiffOptions)),r!=null&&(r.code.additionLines[0]=lr(0,e.getLineText(0)))):this.editSessionActive?this.applySessionDocumentChange(i,o):Object.assign(i,rl(i,this.options.parseDiffOptions)),t!=null&&r!=null)for(const[s,l]of t)s<r.code.additionLines.length&&(r.code.additionLines[s]=l);n!=null&&(n.isDirty=!0)}applySessionDocumentChange(e,t){const{parseDiffOptions:n}=this.options,i=e.additionLines;if(sr(e,i)){this.applyRecomputePreservingSessionType(e,Dn(e,i,n));return}this.applyExpansionRemap(ar(e,n,r=>t[r]))}applyRecomputePreservingSessionType(e,t){const n=this.editSessionActive?e.type:void 0;Object.assign(e,t),n!=null&&(e.type=n),this.markEditSessionPass(e)}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){const n=t==="change"?e==="deletions"?"change-deletion":"change-addition":t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>Em(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:i=!1,disableLineNumbers:r=!1,disableVirtualizationBuffers:o=!1,collapsed:s=!1,expandUnchanged:l=!1,collapsedContextThreshold:a=1,expansionLineCount:d=100,hunkSeparators:u="line-info",lineDiffType:c="word-alt",maxLineDiffLength:f=1e3,overflow:h="scroll",stickyHeader:m=!1,theme:g=Ce,headerRenderMode:b="default",tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=bu,useTokenTransformer:y=!1,useCSSClasses:S=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:i,disableLineNumbers:r,disableVirtualizationBuffers:o,collapsed:s,expandUnchanged:l,collapsedContextThreshold:a,expansionLineCount:d,hunkSeparators:u,lineDiffType:c,maxLineDiffLength:f,overflow:h,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??g,headerRenderMode:b,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:S}}async initializeHighlighter(){return this.highlighter=await Ia(Rm(this.computedLangs,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e),n=xt(e,this.getTokenizeMaxLength());let i=this.workerManager?.getDiffResultCache(e);i!=null&&!Re(t,i.options)&&(i=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!n&&!Rt(e),options:t,result:n?void 0:i?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter==null&&(this.computedLangs=Ci(e),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??Ce}getEffectiveCodeOptions(){const e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0){const l=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&l.useTokenTransformer!==!0?{...l,useTokenTransformer:!0}:l}const{theme:i,tokenizeMaxLineLength:r,lineDiffType:o,maxLineDiffLength:s}=this.getOptionsWithDefaults();return{theme:i,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:r,lineDiffType:o,maxLineDiffLength:s}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!G(e,n.diff)||!Re(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getDiffForNextRender(e){const{options:t}=this.getRenderOptions(e);if(this.getReadyRenderResult(e,t)!=null||this.renderCache==null)return e;if(G(this.renderCache.diff,e))return this.renderCache.diff;const n=!(e.additionLines.length>0||e.deletionLines.length>0)||Rt(e)||xt(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,n)?e:this.renderCache.diff}canRenderDiff(e,t,n){const{renderCache:i}=this;return i==null||G(i.diff,e)?!0:n?i.result==null&&i.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&pt(t.theme):i.result==null&&i.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!i.highlighted:this.highlighter!=null&&pt(t.theme)}renderDiff(e=this.diff,t=$r){if(this.diff=e,e==null){this.pendingHighlightResult=void 0;return}const{expandUnchanged:n,collapsedContextThreshold:i}=this.getOptionsWithDefaults();let{options:r,forceHighlight:o}=this.getRenderOptions(e);const s=this.getReadyRenderResult(e,r);this.pendingHighlightResult=void 0,s!=null&&(this.renderCache={...s,diff:e,renderRange:void 0},o=!1),this.renderCache??={diff:e,highlighted:!1,options:r,result:void 0,renderRange:void 0};const l=e.additionLines.length>0||e.deletionLines.length>0,a=!l||Rt(e)||xt(e,this.getTokenizeMaxLength()),d=this.canRenderDiff(e,r,a),u=!G(e,this.renderCache.diff),c=!ja(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){const f=this.renderCache.result==null&&this.renderCache.highlighted&&!a&&!u&&Zi(t);d&&!f&&(a||this.renderCache.result==null||!this.renderCache.highlighted&&(u||c))&&(this.renderCache.diff=e,this.renderCache.options=r,this.renderCache.highlighted=!1,(this.renderCache.result==null||u||c||o)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,Zi(t)||n?!0:this.expandedHunks,i)),this.renderCache.renderRange=t),!a&&l&&(!this.renderCache.highlighted||o)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLangs=Ci(e),this.highlighter??=Ki();const f=this.highlighter!=null&&pt(r.theme),h=this.highlighter!=null&&Mi(this.computedLangs),m=!a&&h;if(d&&this.highlighter!=null&&f&&(o||a||!this.renderCache.highlighted&&m||this.renderCache.result==null)){const{result:g,options:b}=this.renderDiffWithHighlighter(e,this.highlighter,a||!h);this.renderCache={diff:e,options:b,highlighted:m,result:g,renderRange:void 0}}(!f||!a&&!h)&&this.asyncHighlight(e).then(({result:g,options:b})=>{this.applyHighlightResult(e,g,b,!a)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=$r){this.diff=e;const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){const{diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:s}=this.getOptionsWithDefaults();return xm({type:"diff",diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:s,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){const t=xt(e,this.getTokenizeMaxLength());this.computedLangs=t?["text"]:Ci(e);const n=this.highlighter!=null&&pt(this.getLocalHighlightTheme()),i=t||this.highlighter!=null&&Mi(this.computedLangs);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e),{collapsedContextThreshold:r}=this.getOptionsWithDefaults(),o=Kp(e,t,i,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:r});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===""&&o.code.additionLines[0]==null){let s;if(ot({diff:e,diffStyle:"both",expandedHunks:n?!0:void 0,collapsedContextThreshold:r,callback:({additionLine:l})=>{if(l?.lineIndex===0)return s=l,!0}}),s==null)throw new Error("DiffHunksRenderer: missing empty addition line");o.code.additionLines[0]=lr(0,"",s.unifiedLineIndex,s.splitLineIndex)}return{result:o,options:i}}onHighlightSuccess(e,t,n,i=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,i)}applyHighlightResult(e,t,n,i=!0){const{diff:r,renderCache:o}=this;r==null||o==null||!G(r,e)||!Re(n,this.getRenderOptions(r).options)||(o.result==null||!o.highlighted||!Re(o.options,n)||!G(o.diff,r))&&(this.pendingHighlightResult={diff:r,options:n,highlighted:i,result:t},this.onRenderUpdate?.())}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!Re(t,n.options)))return n}getReadyRenderResult(e,t){const{pendingHighlightResult:n}=this;if(n!=null&&G(n.diff,e)&&Re(n.options,t))return n;const i=this.getMatchingWorkerResultCache(e,t);if(!(i==null||this.hasHighlightedRenderCache(e,t)))return{diff:e,highlighted:!0,...i}}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&G(e,n.diff)&&Re(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){const{diffStyle:o,disableFileHeader:s,expandUnchanged:l,expansionLineCount:a,collapsedContextThreshold:d,hunkSeparators:u}=this.getOptionsWithDefaults(),c=this.renderCache?.isDirty??!1,f=o==="unified",h=v0(e,this.options.loadDiffFiles!=null),m=!e.isPartial||h;let g=[],b=[],_=[];const v=[],{additionLines:y,deletionLines:S}=n,E={rowCount:0,hunkSeparators:u,additionsContentAST:g,deletionsContentAST:b,unifiedContentAST:_,unifiedGutterAST:Zt(),deletionsGutterAST:Zt(),additionsGutterAST:Zt(),expansionLineCount:a,hunkData:v,incrementRowCount(T=1){E.rowCount+=T},pushToGutter(T,N){switch(T){case"unified":E.unifiedGutterAST.children.push(N);break;case"deletions":E.deletionsGutterAST.children.push(N);break;case"additions":E.additionsGutterAST.children.push(N)}}},C=Na({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),L={size:0,side:void 0,increment(){this.size+=1},flush(){if(o!=="unified"){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side==="additions"?(E.pushToGutter("additions",pe(void 0,"buffer",this.size)),g?.push(ln(this.size))):(E.pushToGutter("deletions",pe(void 0,"buffer",this.size)),b?.push(ln(this.size))),this.size=0,this.side=void 0}}},x=(T,N,V,D,H)=>{E.pushToGutter(T,dp(N,V,D,H))};function w(T){L.flush(),o==="unified"?Si("unified",T,E):(Si("deletions",T,E),Si("additions",T,E))}this.pushFileLevelAnnotations(e,o,t,E),ot({diff:e,diffStyle:o,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:l?!0:this.expandedHunks,collapsedContextThreshold:d,callback:({hunkIndex:T,hunk:N,collapsedBefore:V,collapsedAfter:D,additionLine:H,deletionLine:$,type:z})=>{const ee=$!=null?$.splitLineIndex:H.splitLineIndex,se=H!=null?H.unifiedLineIndex:$.unifiedLineIndex;o==="split"&&z!=="change"&&L.flush(),V>0&&w({hunkIndex:T,collapsedLines:V,rangeSize:Math.max(N?.collapsedBefore??0,0),hunkSpecs:N?.hunkSpecs,isFirstHunk:T===0,isLastHunk:!1,isExpandable:m});const ve=o==="unified"?se:ee,$e={type:z,hunkIndex:T,lineIndex:ve,unifiedLineIndex:se,splitLineIndex:ee,deletionLine:$,additionLine:H};if(o==="unified"){const j=this.getUnifiedInjectedRowsForLine?.($e);j?.before!=null&&Yo(j.before,E);let ie=$!=null?S[$.lineIndex]:void 0,ae=H!=null?y[H.lineIndex]:void 0;if(ie==null&&ae==null){const fe="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(fe,{file:e.name}),new Error(fe)}const Qe=z==="change"?H!=null?"change-addition":"change-deletion":z,he=this.getUnifiedLineDecoration({type:z,lineType:Qe,additionLineIndex:H?.lineIndex,deletionLineIndex:$?.lineIndex});x("unified",he.gutterLineType,H!=null?H.lineNumber:$.lineNumber,`${se},${ee}`,he.gutterProperties),ae!=null?ae=cn(ae,he.contentProperties,c&&H!=null?{"data-line":H.lineNumber,"data-line-index":`${se},${ee}`}:void 0):ie!=null&&(ie=cn(ie,he.contentProperties,c&&$!=null?{"data-line":$.lineNumber,"data-line-index":`${se},${ee}`}:void 0)),un({diffStyle:"unified",type:z,deletionLine:ie,additionLine:ae,unifiedSpan:this.getAnnotations("unified",$?.lineNumber,H?.lineNumber,T,ve),createAnnotationElement:fe=>this.createAnnotationElement(fe),context:E}),j?.after!=null&&Yo(j.after,E)}else{const j=this.getSplitInjectedRowsForLine?.($e);j?.before!=null&&Zo(j.before,E,L);let ie=$!=null?S[$.lineIndex]:void 0,ae=H!=null?y[H.lineIndex]:void 0;const Qe=this.getSplitLineDecoration({side:"deletions",type:z,lineIndex:$?.lineIndex}),he=this.getSplitLineDecoration({side:"additions",type:z,lineIndex:H?.lineIndex});if(ie==null&&ae==null){const re="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(re,{file:e.name}),new Error(re)}const fe=(()=>{if(z==="change"){if(ae==null)return"additions";if(ie==null)return"deletions"}})();fe!=null?(L.side!=null&&L.side!==fe&&L.flush(),L.side=fe,L.increment()):z==="change"&&L.flush();const Ue=this.getAnnotations("split",$?.lineNumber,H?.lineNumber,T,ve);if(Ue!=null&&L.size>0&&L.flush(),$!=null){const re=cn(ie,Qe.contentProperties,c?{"data-line":$.lineNumber,"data-line-index":`${$.unifiedLineIndex},${ee}`}:void 0);x("deletions",Qe.gutterLineType,$.lineNumber,`${$.unifiedLineIndex},${ee}`,Qe.gutterProperties),re!=null&&(ie=re)}if(H!=null){const re=cn(ae,he.contentProperties,c?{"data-line":H.lineNumber,"data-line-index":`${H.unifiedLineIndex},${ee}`}:void 0);x("additions",he.gutterLineType,H.lineNumber,`${H.unifiedLineIndex},${ee}`,he.gutterProperties),re!=null&&(ae=re)}un({diffStyle:"split",type:z,additionLine:ae,deletionLine:ie,...Ue,createAnnotationElement:re=>this.createAnnotationElement(re),context:E}),j?.after!=null&&Zo(j.after,E,L)}const St=o==="split"&&N!=null&&ee===N.splitLineStart+N.splitLineCount-1,we=T===e.hunks.length-1&&N!=null&&(o==="split"?ee===N.splitLineStart+N.splitLineCount-1:se===N.unifiedLineStart+N.unifiedLineCount-1),Kn=St?N.noEOFCRDeletions:!1,Xn=St?N.noEOFCRAdditions:!1,Xe=($?.noEOFCR??!1)||Kn,ke=(H?.noEOFCR??!1)||Xn;if(ke||Xe){if(o==="split"&&L.flush(),Xe){const j=z==="context"||z==="context-expanded"?z:"change-deletion";o==="unified"?(E.unifiedContentAST.push(dn(j)),E.pushToGutter("unified",pe(j,"metadata",1))):(E.deletionsContentAST.push(dn(j)),E.pushToGutter("deletions",pe(j,"metadata",1)),ke||(E.pushToGutter("additions",pe(void 0,"buffer",1)),E.additionsContentAST.push(ln(1))))}if(ke){const j=z==="context"||z==="context-expanded"?z:"change-addition";o==="unified"?(E.unifiedContentAST.push(dn(j)),E.pushToGutter("unified",pe(j,"metadata",1))):(E.additionsContentAST.push(dn(j)),E.pushToGutter("additions",pe(j,"metadata",1)),Xe||(E.pushToGutter("deletions",pe(void 0,"buffer",1)),E.deletionsContentAST.push(ln(1))))}E.incrementRowCount(1)}u!=="simple"&&u!=="metadata"&&(D>0||we&&h)&&w({hunkIndex:z==="context-expanded"?T:T+1,collapsedLines:we&&h?"unknown":D,rangeSize:C,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),E.incrementRowCount(1)}}),o==="split"&&L.flush();const A=Math.max(c0(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),I=t.bufferBefore>0||t.bufferAfter>0,k=!f&&e.type!=="deleted",R=!f&&e.type!=="new",P=E.rowCount>0||I;g=k&&P?g:void 0,b=R&&P?b:void 0,_=f&&P?_:void 0;const F=this.createPreElement(b!=null&&g!=null,A);return{fileDiff:e,unifiedGutterAST:f&&P?E.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:R&&P?E.deletionsGutterAST.children:void 0,deletionsContentAST:b,additionsGutterAST:k&&P?E.additionsGutterAST.children:void 0,additionsContentAST:g,hunkData:v,preNode:F,themeStyles:i,baseThemeType:r,headerElement:s?void 0:this.renderHeader(e),totalLines:A,rowCount:E.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const n=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,i=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(n==null||i==null)return;const r=Zt(n);return r.properties.style=`grid-row: span ${t.rowCount}`,[r,Sm(i,t.rowCount)]}renderFullAST(e,t=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",i=this.renderCodeAST("unified",e);if(i!=null)return t.push(M({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const r=this.renderCodeAST("deletions",e);r!=null&&t.push(M({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const o=this.renderCodeAST("additions",e);return o!=null&&t.push(M({tagName:"code",children:o,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Oe(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?Oe(e):Oe(M({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,n,i){if(!Ba(n))return;const r=e.type!=="new"?this.getAnnotationNames(To(this.deletionAnnotations)):[],o=e.type!=="deleted"?this.getAnnotationNames(To(this.additionAnnotations)):[];if(r.length===0&&o.length===0)return;const s=-1,l=-1,{createAnnotationElement:a}=this;if(t==="unified"){un({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:s,lineIndex:l,annotations:r.concat(o)},createAnnotationElement:a,context:i});return}un({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:s,lineIndex:l,annotations:r},additionSpan:{type:"annotation",hunkIndex:s,lineIndex:l,annotations:o},createAnnotationElement:a,context:i})}getAnnotations(e,t,n,i,r){const o={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(t!=null)for(const l of this.deletionAnnotations[t]??[])o.annotations.push(this.annotationSlotName(l));const s={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(n!=null)for(const l of this.additionAnnotations[n]??[])(e==="unified"?o:s).annotations.push(this.annotationSlotName(l));if(e==="unified")return o.annotations.length>0?o:void 0;if(!(s.annotations.length===0&&o.annotations.length===0))return{deletionSpan:o,additionSpan:s}}getAnnotationNames(e){return e?.map(t=>this.annotationSlotName(t))??[]}renderHeader(e){const{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return Lm({fileOrDiff:e,mode:t,stickyHeader:n})}};const p0=new Intl.PluralRules("en-US");function m0(e){return`${e} unmodified line${p0.select(e)==="one"?"":"s"}`}function Yo(e,t){for(const n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function Zo(e,t,n){for(const{deletion:i,addition:r}of e){if(i==null&&r==null)continue;const o=i!=null&&r!=null?void 0:i==null?"deletions":"additions";(o==null||n.side!==o)&&n.flush(),i!=null&&(t.deletionsContentAST.push(i.content),t.pushToGutter("deletions",i.gutter)),r!=null&&(t.additionsContentAST.push(r.content),t.pushToGutter("additions",r.gutter)),o!=null&&(n.side=o,n.increment()),t.incrementRowCount(1)}}function un({diffStyle:e,type:t,deletionLine:n,additionLine:i,unifiedSpan:r,deletionSpan:o,additionSpan:s,createAnnotationElement:l,context:a}){let d=!1;if(e==="unified"){if(i!=null?a.unifiedContentAST.push(i):n!=null&&a.unifiedContentAST.push(n),r!=null){const u=t==="change"?n!=null?"change-deletion":"change-addition":t;a.unifiedContentAST.push(l(r)),a.pushToGutter("unified",pe(u,"annotation",1)),d=!0}}else if(e==="split"){if(n!=null&&a.deletionsContentAST.push(n),i!=null&&a.additionsContentAST.push(i),o!=null){const u=t==="change"?n!=null?"change-deletion":"context":t;a.deletionsContentAST.push(l(o)),a.pushToGutter("deletions",pe(u,"annotation",1)),d=!0}if(s!=null){const u=t==="change"?i!=null?"change-addition":"context":t;a.additionsContentAST.push(l(s)),a.pushToGutter("additions",pe(u,"annotation",1)),d=!0}}d&&a.incrementRowCount(1)}function Si(e,{hunkIndex:t,collapsedLines:n,rangeSize:i,hunkSpecs:r,isFirstHunk:o,isLastHunk:s,isExpandable:l},a){if(typeof n=="number"&&n<=0)return;const d=e==="unified"?a.unifiedContentAST:e==="deletions"?a.deletionsContentAST:a.additionsContentAST;if(a.hunkSeparators==="metadata"){r!=null&&(a.pushToGutter(e,ct({type:"metadata",content:r,isFirstHunk:o,isLastHunk:s})),d.push(ct({type:"metadata",content:r,isFirstHunk:o,isLastHunk:s})),e!=="additions"&&a.incrementRowCount(1));return}if(a.hunkSeparators==="simple"){t>0&&(a.pushToGutter(e,ct({type:"simple",isFirstHunk:o,isLastHunk:!1})),d.push(ct({type:"simple",isFirstHunk:o,isLastHunk:!1})),e!=="additions"&&a.incrementRowCount(1));return}const u=u0(e,t),c=i>a.expansionLineCount,f=l?t:void 0,h=typeof n=="number"?m0(n):"More unchanged context may be available";a.pushToGutter(e,ct({type:a.hunkSeparators,content:h,expandIndex:f,chunked:c,slotName:u,isFirstHunk:o,isLastHunk:s})),d.push(ct({type:a.hunkSeparators,content:h,expandIndex:f,chunked:c,slotName:u,isFirstHunk:o,isLastHunk:s})),e!=="additions"&&a.incrementRowCount(1),a.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n=="number"?n:0,lineCountKnown:typeof n=="number",type:e,expandable:l?{up:!o,down:!s,chunked:c}:void 0})}function cn(e,t,n){return e==null||e.type!=="element"||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function es(e){return e.length>0&&e[e.length-1]===""?e.length-1:e.length}function g0(e,t,n,i){const r=es(e),o=es(t),s=Math.min(r,o);let l=0;for(;l<s&&e[l]===t[l];)l++;let a=0;for(;a<s-l&&e[r-1-a]===t[o-1-a];)a++;const d=new Array(t.length);for(let u=0;u<l;u++)d[u]=n[u];for(let u=0;u<a;u++)d[o-1-u]=n[r-1-u];r<e.length&&o<t.length&&(d[t.length-1]=n[e.length-1]);for(let u=l;u<t.length;u++)d[u]??=lr(u,i.getLineText(u));return d}function lr(e,t,n=e,i=e){return{type:"element",tagName:"div",properties:{"data-line":e+1,"data-line-index":`${n},${i}`,"data-line-type":"context"},children:[{type:"element",tagName:"span",properties:{"data-char":0},children:[{type:"text",value:t}]}]}}function _0(e){const t=[];for(let n=0;n<e.lineCount;n++)t.push(e.getLineText(n,!0));return t}function Ci(e){if(e.lang!=null)return[e.lang];const t=Me(e.prevName??e.name),n=Me(e.name);return t===n?[n]:[t,n]}function xt(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function v0(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function b0(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function y0(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function E0(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:jm(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators=="function"?"custom":e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Li(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}function S0(e){const t={...e};return delete t.cacheKey,t}function ts(e,t){if(e.isPartial||t.isPartial)throw new Error("FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated");const n=e.lang??Me(e.name),i=t.lang??Me(t.name),r=e.type!=="new",o=t.type!=="new";return e.name!==t.name||n!==i||r!==o||e.deletionLines.length!==t.deletionLines.length?!0:e.deletionLines.some((s,l)=>s!==t.deletionLines[l])}function C0(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}function L0(e,t){const{oldFile:n}=e;return n==null?t.type==="new":t.type!=="new"&&n.name===(t.prevName??t.name)&&C0(n.lines,t.deletionLines)}let w0=-1;var ll=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++w0}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;editSession;renderedDiff;renderRange;pendingFiles;appliedPreAttributes;headerCache={lastRenderedHTML:void 0,html:void 0,fileDiff:void 0};lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:Ce},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new pm,this.scrollSyncManager=new Mg,this.interactionManager=new rm("diff",Io(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"||e.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??Ce}getHunksRendererOptions(e){return E0(e)}createHunksRenderer(e){return new f0(this.getHunksRendererOptions(e),this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>this.getLineIndexForDiff(this.getDiffForLineIndex(),e,t);getDiffForLineIndex(){return this.getRenderedDiff()}getLineIndexForDiff(e,t,n){if(e==null)return;const i=e.hunks.at(-1);let r,o;e:for(const s of e.hunks){const l=n==="deletions"?s.deletionStart:s.additionStart,a=n==="deletions"?s.deletionCount:s.additionCount;let d=ce(l,a)+1,u=s.splitLineStart,c=s.unifiedLineStart;if(t<d){const f=d-t;r=Math.max(c-f,0),o=Math.max(u-f,0);break e}if(t>=d+a){if(s===i){const f=t-(d+a);r=c+s.unifiedLineCount+f,o=u+s.splitLineCount+f;break e}continue}for(const f of s.hunkContent)if(f.type==="context")if(t<d+f.lines){const h=t-d;o=u+h,r=c+h;break e}else d+=f.lines,u+=f.lines,c+=f.lines;else{const h=n==="deletions"?f.deletions:f.additions;if(t<d+h){const m=t-d;r=c+(n==="additions"?f.deletions:0)+m,o=u+m;break e}else d+=h,u+=Math.max(f.deletions,f.additions),c+=f.deletions+f.additions}break e}if(!(r==null||o==null))return[r,o]}setOptions(e){e!=null&&(this.options=e,this.clearReusableHeader(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Io(this.options,typeof this.options.hunkSeparators=="function"||(this.options.hunkSeparators??"line-info")==="line-info"||this.options.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;const t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Cr(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();getAnnotationSlotName=e=>Gm(this.editSession?.annotations,e,tt);getLatestAnnotations(){return this.editSession?.annotations?.current??this.lineAnnotations}isNewAnnotations(e){const t=this.editSession?.annotations;return e===this.lineAnnotations?!1:t==null||e!==t.provided&&e!==t.current}setLineAnnotations(e){const t=this.editSession?.annotations;if(t==null){this.lineAnnotations=e;return}this.isNewAnnotations(e)&&(this.lineAnnotations=e,zm(t,e,tt))}syncEditSessionAnnotationsFromEditor(e){const t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.hunksRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators=="function")}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??"additions"})}flushDeferredLineState(){const{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{diffStyle:e="split",overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t==="wrap",columnVariables:this.shouldApplyColumnVariables(t)?"apply":"measure"}),t==="scroll"&&e==="split"?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators=="function"?!0:e==="scroll"&&(this.getLatestAnnotations().length>0||this.pre?.hasAttribute("data-has-merge-conflict")===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){const{editor:t}=this;Ji(this.handleEditSessionRender),this.emitPostRender(!0),t?.cleanUp(e?"recycle":"discard"),e||(this.editor=void 0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,e||(this.pendingFiles=void 0),this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.headerCache.lastRenderedHTML=void 0,e||this.clearReusableHeader(),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.editSession=void 0,this.renderedDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:i,fileDiff:r,...o}){if(!this.enabled)throw new Error("FileDiff.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw new Error("FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated");const s=nr(o,"FileDiff.hydrate"),l=s?.oldFile,a=s?.newFile;this.hydrateElements(e,t);const d=this.editor!=null;d||R0(this.pre,x0({fileDiff:r,oldFile:l,newFile:a}),this.options.collapsed)||T0(this.headerElement,A0({fileDiff:r,oldFile:l,newFile:a}),this.options.disableFileHeader)?this.render({...o,fileContainer:e,lineAnnotations:i,fileDiff:r,forceRender:d||o.forceRender,preventEmit:!0}):this.hydrationSetup({fileDiff:r,lineAnnotations:i,...s}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Qm(e,t);for(const n of e.shadowRoot?.children??[]){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){this.pre=n;for(const i of n.children)!(i instanceof HTMLElement)||i.tagName.toLowerCase()!=="code"||("deletions"in i.dataset&&(this.codeDeletions=i),"additions"in i.dataset&&(this.codeAdditions=i),"unified"in i.dataset&&(this.codeUnified=i));continue}if("diffsHeader"in n.dataset){this.headerElement=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:i}){this.lineAnnotations=i??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Ke(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderedDiff=this.fileDiff,this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.loadFilesIfNecessary(),this.hunksRenderer.expandHunk(e,t,n),this.rerender()};loadFilesIfNecessary(){const{fileDiff:e,options:{loadDiffFiles:t}}=this;if(e==null||!Li(e)||this.pendingFiles?.fileDiff===e)return;if(t==null)throw new Error("FileDiff: loadDiffFiles is required to load full files for a partial diff");const n=this.loadFilesForDiff(e,t),i=this.pendingFiles={fileDiff:e,promise:n},r=()=>{this.pendingFiles===i&&(this.pendingFiles=void 0)};i.promise=n.finally(r)}__canAttachEditor(){return this.fileDiff!=null&&!this.fileDiff.isPartial}async prepareForEditing(){if(this.__canAttachEditor())return;const e=this.__prepareForEditing();if(e==null)throw this.fileDiff?.isPartial===!0&&!Li(this.fileDiff)?new Error("FileDiff.prepareForEditing: this partial diff cannot be hydrated; provide a complete diff"):new Error("FileDiff.prepareForEditing: a partial diff requires loadDiffFiles");if(await e,!this.__canAttachEditor())throw new Error("FileDiff.prepareForEditing: the diff did not finish loading")}__prepareForEditing(){if(!this.__canAttachEditor()){if(this.fileDiff?.isPartial===!0&&!Li(this.fileDiff))throw new Error("FileDiff: this partial diff cannot be hydrated; provide a complete diff to edit");return this.loadFilesIfNecessary(),this.pendingFiles?.promise}}async loadFilesForDiff(e,t){try{const n=await t(e);if(this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(n){if(this.options.disableErrorHandling===!0)throw n;console.error(n)}}async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(ir("merge",e,t),this.setHydratedState(t),this.installHydratedSessionDiff(e)){this.rerender();return}await tr(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender()}}installHydratedSessionDiff(e){if(e.isPartial)throw new Error("FileDiff.installHydratedSessionDiff: diffs cannot be partial for editing");return this.fileDiff!==e?!1:this.editSession?.outgoingDiff!=null?(this.installEditSession(e),!0):!1}updateExternalDiff(e,t){if(G(this.fileDiff,e))return!1;const n=this.editSession?.outgoingDiff??this.editSession?.diff;return this.fileDiff=e,n!=null&&(e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e),this.editSession!=null&&(this.editSession.outgoingDiff=n)),this.editSession?.annotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSession.annotations=Fo(t,tt,this.editSession.annotations)),!0}installEditSession(e,t,n){const i=e.additionLines.join(""),r=t!=null?Pn(t.contents):void 0,o=n!=null&&L0(n,e);if(n!=null&&!o)throw new Error("FileDiff: retained session cannot resume against a different old file");if(t!=null&&t.contents!==i&&!o)throw new Error("FileDiff: retained edits are missing their diff session state");const s=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===i,l=S0(e);t!=null&&r!=null&&!s&&(l.name=t.name,l.lang=t.lang),o&&n!=null&&r!=null&&(l.additionLines=r,l.type=n.type,l.hunks=n.hunks,l.editSessionDirty=!0,qn(l)),this.editSession={diff:l,annotations:this.editSession?.annotations??Fo(this.lineAnnotations,tt),outgoingDiff:this.editSession?.outgoingDiff},this.hunksRenderer.beginEditSession(l,s&&!o?e:void 0)}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:i=!1,lineAnnotations:r,fileContainer:o,containerWrapper:s,renderRange:l,...a}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");const d=nr(a,"FileDiff.render"),u=d?.oldFile,c=d?.newFile;this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:f=!1,themeType:h="system",expandUnchanged:m=!1}=this.options,g=f?void 0:l,b=this.hasThemeChanged(),_=d!=null,v=_&&(!ns(u,this.deletionFile)||!ns(c,this.additionFile));let y=e!=null&&!G(e,this.fileDiff);const S=r!=null&&(r.length>0||this.getLatestAnnotations().length>0)?this.isNewAnnotations(r):!1;if(!f&&ja(g,this.renderRange)&&!n&&!S&&!b&&(e!=null&&!y||e==null&&!v)){const A=this.applyCachedThemeState(h);return A&&this.finalizeRender(),A}let E;e==null&&_&&(v||this.fileDiff==null)&&(E=Ke(d.oldFile,d.newFile,this.options.parseDiffOptions));const{renderRange:C}=this;this.renderRange=g,_?(this.deletionFile=u,this.additionFile=c):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e!=null&&y?this.updateExternalDiff(e,r):E!=null&&(y=!0,this.updateExternalDiff(E,r)),y&&this.clearReusableHeader(),r!=null&&this.setLineAnnotations(r);const L=this.getLatestDiff();if(L==null)return!1;L.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(Ko(L,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.getLatestAnnotations());const{disableErrorHandling:x=!1,disableFileHeader:w=!1}=this.options;if(w&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.headerCache.lastRenderedHTML=void 0),this.clearHeaderSlots()),o=this.getOrCreateFileContainer(o,s),this.applyCachedThemeState(h),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const A=this.hunksRenderer.renderDiff(L,Su);A!=null&&this.applyThemeState(o,A.themeStyles,h,A.baseThemeType),A?.headerElement!=null&&this.applyHeaderToDOM(A.headerElement,o,A.fileDiff),this.renderSeparators([]),this.renderedDiff=A?.fileDiff??L,this.injectUnsafeCSS()}catch(A){if(x)throw A;console.error(A),A instanceof Error&&this.applyErrorToDOM(A,o)}return this.finalizeRender(),i||this.emitPostRender(),!0}try{const A=this.getOrCreatePreNode(o);if(!(this.canPartiallyRender(n,S,v||y||b||!G(this.renderedDiff,L))&&this.applyPartialRender({fileDiff:L,previousRenderRange:C,renderRange:g}))){const I=this.hunksRenderer.renderDiff(L,g);if(I==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(o,I.themeStyles,h,I.baseThemeType),I.headerElement!=null&&this.applyHeaderToDOM(I.headerElement,o,I.fileDiff),I.additionsContentAST!=null||I.deletionsContentAST!=null||I.unifiedContentAST!=null?this.applyHunksToDOM(A,I):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(I.hunkData),this.renderedDiff=I.fileDiff}this.applyBuffers(A,g),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(A){if(x)throw A;console.error(A),A instanceof Error&&this.applyErrorToDOM(A,o)}return i||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,"unmount");return}if(t==null)return;const i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}getLatestDiff(e=this.fileDiff){return this.editSession?.diff??e}getRenderedDiff(){return this.renderedDiff}syncRenderViewToEditor(){const{editor:e,fileContainer:t}=this,n=this.getLatestAnnotations(),i=this.computeEditorRenderRange(this.renderRange),r=this.getLatestDiff();if(e==null||t==null||r==null||r.isPartial)return;const o=d=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.getLatestDiff()!==r)return;const u=this.editSession?.outgoingDiff,{fileDiff:c}=this,f=u!=null&&c!=null&&u!==r,h=f&&u!=null&&c!=null?ts(u,c):!1;e.__syncRenderView({highlighter:d,fileContainer:t,fileDiff:r,lineAnnotations:n,renderRange:i,externalDocument:f,resetHistory:h})},s=this.getTheme(),l=r.lang??Me(r.name),a=Ki({theme:s,lang:l});a!=null?o(a):Ia({themes:gr(s),langs:["text",l],preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter}).then(o)}computeEditorRenderRange(e){const t=this.getLatestDiff();if(e==null||t==null||Zi(e))return e;const{diffStyle:n="split",expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options;let o,s;return ot({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,callback:({additionLine:l})=>{l!=null&&(o??=l.lineNumber,s=l.lineNumber)}}),o==null||s==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:o-1,totalLines:s-o+1}}__acknowledgeDocumentUpdate(){this.editSession!=null&&(this.editSession.outgoingDiff=void 0)}__acceptEditorChange(e){const{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}emitEditChange(e){const{onEditChange:t}=this.options;t?.(e)}__captureDocumentSessionState(e=!0){let{fileDiff:t,editSession:{diff:n,outgoingDiff:i}={}}=this;if(i!=null&&t!=null){if(!t.isPartial&&ts(i,t))return;n=i}if(!(n==null||n.isPartial))return{diffSession:{oldFile:n.type!=="new"?{name:n.prevName??n.name,lines:e?[...n.deletionLines]:n.deletionLines}:null,type:n.type,hunks:e?Ka(n.hunks):n.hunks},hasChanges:n.editSessionDirty===!0}}__attachEditor(e){if(this.type!=="file-diff")throw new Error(`FileDiff.__attachEditor: cannot attach an editor to a "${this.type}" diff`);if(this.editor!=null)throw new Error("FileDiff.__attachEditor: an editor is already attached");if(!this.__canAttachEditor())throw new Error("FileDiff.__attachEditor: a complete diff is required before editing");const t=()=>{this.editor=void 0,this.finishEditSession()};try{return this.resumeEditorRendering(e),t}catch(n){throw t(),n}}__resumeEditor(e){if(this.editor!==e)throw new Error("FileDiff.__resumeEditor: editor association changed");this.resumeEditorRendering(e)}resumeEditorRendering(e){const{fileDiff:t}=this,n=this.editSession?.outgoingDiff;n!=null&&t!=null&&!t.isPartial&&this.editSession?.diff===n&&this.installEditSession(t);const i=this.editSession==null&&t!=null&&!t.isPartial?t:void 0;i!=null?this.installEditSession(i,e.__getDocumentContents(k0(i)),e.__getDocumentSessionState()):this.editSession!=null&&this.hunksRenderer.beginEditSession(this.editSession.diff),this.editor=e,this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary();const r=this.editSession?.diff;this.hunksRenderer.editorRenderReady()?(r!=null&&this.hunksRenderer.diffCache===r&&(this.renderedDiff=r),this.syncRenderViewToEditor()):this.rerender()}finishEditSession(){this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks()}__completeEditSession(e,t){this.settleEditSession(t==="install",e)}settleEditSession(e,t){const{editSession:n,fileDiff:i,lineAnnotations:r}=this;if(n==null||i==null)return;const{diff:o,annotations:s}=n;if(this.editor!=null)throw new Error("FileDiff.__completeEditSession: detach the editor before completing the session");this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks();const l=s?.current;let a,d=null,u=null,c=!1,f;if(t==null)throw new Error("FileDiff.__completeEditSession: editor is required for completion");const h=Xa(o),m={name:h.name,contents:h.additionLines.join("")};h.lang!=null&&(m.lang=h.lang);const g={fileDiff:h,editor:t,originalFileDiff:i,oldFile:h.type==="new"?null:{name:h.prevName??h.name,contents:h.deletionLines.join("")},newFile:m,lineAnnotations:l,originalLineAnnotations:r};Object.freeze(g);try{if(t.__emitEditComplete(g),this.options.onEditComplete?.(g)==="accept"){if(h.cacheKey!=null&&h.cacheKey===i.cacheKey)throw new Error("FileDiff.__completeEditSession: an accepted diff must not reuse the replaced diff cacheKey");a=h,d=g.oldFile,u=g.newFile}}catch(b){c=!0,f=b}if(e&&a!=null&&(this.fileDiff=a,this.additionFile!=null&&(this.deletionFile=d,this.additionFile=u),l!=null&&(this.lineAnnotations=l)),this.editSession=void 0,e&&this.fileContainer!=null&&this.rerender(),c)throw f}finalizeEditSessionHunks(){const e=this.getLatestDiff();if(e==null||e.editSessionDirty!==!0)return!1;const{collapsedContextThreshold:t=1}=this.options,n=Yg(e,this.hunksRenderer.getExpandedHunksMap(),t);return Ko(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(Zg(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){const n=this.editSession?.diff;if(n==null)throw new Error("FileDiff.applyDocumentChange: requires an active edit session");this.detachAdditionLines(),this.hunksRenderer.beginEditSession(n),this.hunksRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t),this.rerender(),this.interactionManager.setSelectionDirty()}applySuspendedDocumentChange(e,t){this.applyDocumentChange(e,t),this.hunksRenderer.clearRenderCache()}updateRenderCache(e,t,n={}){const i=this.editSession?.diff;if(i==null)throw new Error("FileDiff.updateRenderCache: requires an active edit session");this.detachAdditionLines(),this.hunksRenderer.beginEditSession(i);const{shouldRefreshDiffsView:r,lineCountChangeInFlight:o}=n;if(this.hunksRenderer.updateRenderCache(e,t,o)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle==="split"?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}detachAdditionLines(){const e=this.editSession?.diff,{fileDiff:t}=this;e!=null&&(e.additionLines===t?.additionLines||e.additionLines===e.deletionLines)&&(e.additionLines=[...e.additionLines])}isLineRenderable(e){const t=this.getRenderedDiff();if(t==null)return!0;const{expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options;return Ma({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}getNearestRenderableLine(e,t){const n=this.getRenderedDiff();if(n==null)return e;const{expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options;return xp({fileDiff:n,lineNumber:e,direction:t,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}revealLine(e){const t=this.getRenderedDiff(),{expandUnchanged:n=!1,collapsedContextThreshold:i=1,expansionLineCount:r=100}=this.options;if(t==null||t.isPartial||n)return!1;const o=this.hunksRenderer.getExpandedHunksMap();for(const[d,u]of t.hunks.entries()){const[c,f]=Ut(u);if(e<c){const h=He({isPartial:t.isPartial,rangeSize:u.collapsedBefore,expandedHunks:o,hunkIndex:d,collapsedContextThreshold:i}),m=c-h.rangeSize;if(h.renderAll||e<m+h.fromStart||e>=c-h.fromEnd)return!1;const g=e-(m+h.fromStart)+1,b=c-h.fromEnd-e;return g<=b?this.expandHunk(d,"up",g+r):this.expandHunk(d,"down",b+r),!0}if(e<f)return!1}const s=Fe({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:o,collapsedContextThreshold:i,errorPrefix:"FileDiff.revealLine"});if(s==null||s.renderAll)return!1;const l=t.hunks[t.hunks.length-1],[,a]=Ut(l);return e<a+s.fromStart||e>=a+s.rangeSize?!1:(this.expandHunk(t.hunks.length,"up",e-(a+s.fromStart)+1+r),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){$a(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(const{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.setPlaceholderHeight(e)}setPlaceholderHeight(e){return this.placeHolder==null?!1:(this.placeHolder.style.setProperty("height",`${e}px`),!0)}async primeHighlightCache(e=this.fileDiff){const{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Rt(e))return;const n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(i=>{console.error(i)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.headerCache.lastRenderedHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){const{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!="function"){for(const{element:i}of this.separatorCache.values())i.remove();this.separatorCache.clear();return}const n=new Map(this.separatorCache);for(const i of e){const r=i.slotName;let o=this.separatorCache.get(r);if(o==null||!y0(i,o.hunkData)){o?.element.remove();const s=document.createElement("div");s.style.display="contents",s.slot=i.slotName;const l=t(i,this);l!=null&&s.appendChild(l),this.fileContainer.appendChild(s),o={element:s,hunkData:i},this.separatorCache.set(r,o)}n.delete(r)}for(const[i,{element:r}]of n.entries())this.separatorCache.delete(i),r.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:i}of this.annotationCache.values())i.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options,n=this.getLatestAnnotations();if(t!=null&&n.length>0)for(const[i,r]of n.entries()){const o=this.getAnnotationSlotName(r),s=`${i}-${o}`;let l=this.annotationCache.get(s);if(l==null||!b0(r,l.annotation)){l?.element.remove();const a=t(r);if(a==null)continue;l={element:Dm(o),annotation:r},l.element.appendChild(a),this.fileContainer.appendChild(l.element),this.annotationCache.set(s,l)}e.delete(s)}for(const[i,{element:r}]of e.entries())this.annotationCache.delete(i),r.remove()}renderGutterUtility(){const{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=Om();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){const{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),r=n!==i;return n!=null&&r&&this.editor?.__captureFocusForDOMReplacement(),r&&this.emitPostRender(!0),this.fileContainer=i,n!=null&&r&&(this.headerCache.lastRenderedHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),r&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const n of t.children)n instanceof SVGElement?this.spriteSVG??=n:Ao(n)&&n.hasAttribute("data-theme-css")?(this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0):Ao(n)&&n.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=Tm;const i=n.firstChild;i instanceof SVGElement&&(this.spriteSVG=i)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(const t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute("data-unified")?this.codeUnified=t:t.hasAttribute("data-deletions")?this.codeDeletions=t:t.hasAttribute("data-additions")&&(this.codeAdditions=t))}applyHeaderToDOM(e,t,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const{headerCache:{fileDiff:i,html:r,lastRenderedHTML:o}}=this,s=(n!==this.editSession?.diff&&G(i,n)?r:void 0)??Oe(e);if(this.headerCache.html=s,this.headerCache.fileDiff=n,s!==o){const m=document.createElement("div");m.innerHTML=s;const g=m.firstElementChild;if(!(g instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(g,this.headerElement):t.shadowRoot?.prepend(g),this.headerElement=g,this.headerCache.lastRenderedHTML=s}if(this.isContainerManaged)return;const{renderCustomHeader:l,renderHeaderPrefix:a,renderHeaderFilenameSuffix:d,renderHeaderMetadata:u}=this.options;if(l!=null){const m=l(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,mr,m),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}const c=a?.(n)??void 0,f=d?.(n)??void 0,h=u?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Ts,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Is,f),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Ps,h),this.headerCustom?.remove(),this.headerCustom=void 0}clearReusableHeader(){this.headerCache.html=void 0,this.headerCache.fileDiff=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}const r=t??this.createHeaderSlotElement(n);return t==null&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){const t=document.createElement("div");return t.slot=e,t}injectUnsafeCSS(){const{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=Nm(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Fm(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){const r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n,s=this.getTheme(),l=typeof s=="string"?s:{...s},a=er(r);if(this.themeCSSStyle?.parentNode===r&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===o&&this.appliedThemeCSS.scrollbarGutter===a){this.appliedThemeCSS.theme=l;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===r){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:a};return}this.themeCSSStyle=Wm({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:Vm(t,o,a)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:a}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=$m(this.themeCSSStyle.textContent??"",er(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Xm()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?Vo(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){const i=this.getColumnPair(e);if(i==null)return!1;const r=ze(t[0]),o=ze(t[1]);return r==null||o==null?!1:(i.gutter.innerHTML=Oe(r),i.content.innerHTML=Oe(o),n!==this.lastRowCount&&(i.gutter.style.setProperty("grid-row",`span ${n}`),i.content.style.setProperty("grid-row",`span ${n}`)),!0)}replaceCodeColumns(e,t){const{overflow:n="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",r=n==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1;const s=[],l=this.hunksRenderer.renderCodeAST("unified",t),a=this.hunksRenderer.renderCodeAST("deletions",t),d=this.hunksRenderer.renderCodeAST("additions",t);this.editor?.__captureFocusForDOMReplacement(),l!=null?(o=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=vi({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:i}),this.applyCodeColumnsInPlace(this.codeUnified,l,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(l)),s.push(this.codeUnified)):a!=null||d!=null?(a!=null?(o=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=vi({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:i}),this.applyCodeColumnsInPlace(this.codeDeletions,a,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(a)),s.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),d!=null?(o=o||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=vi({code:this.codeAdditions,columnType:"additions",rowSpan:r,containerSize:i}),this.applyCodeColumnsInPlace(this.codeAdditions,d,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(d)),s.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),s.length===0?e.textContent="":o&&e.replaceChildren(...s),this.lastRowCount=t.rowCount}applyPartialRender({fileDiff:e,previousRenderRange:t,renderRange:n}){const{pre:i,codeUnified:r,codeAdditions:o,codeDeletions:s,options:{diffStyle:l="split"}}=this;if(i==null||t==null||n==null||!Number.isFinite(t.totalLines)||!Number.isFinite(n.totalLines)||this.lastRowCount==null)return!1;const a=this.getCodeColumns(l,r,s,o);if(a==null)return!1;const d=t.startingLine,u=n.startingLine,c=d+t.totalLines,f=u+n.totalLines,h=Math.max(d,u),m=Math.min(c,f);if(m<=h)return!1;const g=Math.max(0,h-d),b=Math.max(0,c-m),_=this.trimColumns({columns:a,trimStart:g,trimEnd:b,previousStart:d,overlapStart:h,overlapEnd:m,diffStyle:l});if(_<0)throw new Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount<_)throw new Error("FileDiff.applyPartialRender: trimmed beyond DOM row count");let v=this.lastRowCount-_;const y=(L,x)=>{if(!(x<=0))return this.hunksRenderer.renderDiff(e,{startingLine:L,totalLines:x,bufferBefore:0,bufferAfter:0})},S=y(u,Math.max(h-u,0));if(S==null&&u<h)return!1;const E=y(m,Math.max(f-m,0));if(E==null&&f>m)return!1;const C=(L,x)=>{if(L!=null){if(l==="unified"&&!Array.isArray(a))this.insertPartialHTML(l,a,L,x);else if(l==="split"&&Array.isArray(a))this.insertPartialHTML(l,a,L,x);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");v+=L.rowCount,this.renderedDiff=L.fileDiff}};return this.cleanupErrorWrapper(),C(S,"afterbegin"),C(E,"beforeend"),this.lastRowCount!==v&&(this.applyRowSpan(l,a,v),this.lastRowCount=v),!0}insertPartialHTML(e,t,n,i){if(e==="unified"&&!Array.isArray(t)){const r=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,r,i)}else if(e==="split"&&Array.isArray(t)){const r=this.hunksRenderer.renderCodeAST("deletions",n),o=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],r,i),this.renderPartialColumn(t[1],o,i)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}refreshSplitDiffView(){const e=this.getLatestDiff();if(this.options.diffStyle!=="split"||e==null)return;const t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;const n=this.getCodeColumns("split",this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(n))return;const i=(r,o)=>{if(o==null)return;const s=this.hunksRenderer.renderCodeAST(r,t),l=ze(s?.[0]),a=ze(s?.[1]);for(const[d,u]of[[o.gutter,l],[o.content,a]])if(u!=null&&d.childElementCount===u.length)for(let c=0;c<u.length;c++){const f=d.children[c],h=u[c].properties["data-line-type"];h!=null&&f.dataset.lineType!==h&&(f.dataset.lineType=h)}};i("deletions",n[0]),i("additions",n[1]),this.renderedDiff=t.fileDiff}refreshUnifiedDiffView(){const e=this.getLatestDiff();if(this.options.diffStyle!=="unified"||e==null)return;const t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;const n=this.getCodeColumns("unified",this.codeUnified,this.codeDeletions,this.codeAdditions);if(n==null||Array.isArray(n))return;const i=this.hunksRenderer.renderCodeAST("unified",t),r=ze(i?.[0]),o=ze(i?.[1]),s=()=>{for(const[l,a]of[[n.gutter,r],[n.content,o]])a!=null&&(l.innerHTML=Oe(a));t.rowCount!==this.lastRowCount&&(this.applyRowSpan("unified",n,t.rowCount),this.lastRowCount=t.rowCount),this.renderedDiff=t.fileDiff};this.shouldGuardRebuildScroll()?Vo(this.pre,s):s(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;const i=ze(t[0]),r=ze(t[1]);if(i==null||r==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const o=r.at(0);n==="beforeend"&&o?.type==="element"&&typeof o.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],i,r,!0);const s=r.at(-1);n==="afterbegin"&&s?.type==="element"&&typeof s.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(s.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],i,r,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,t,n,i,r,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;const s=this.getBufferSize(t.dataset);s!=null&&(o?(i.shift(),r.shift()):(i.pop(),r.pop()),this.updateBufferSize(t,s+e),this.updateBufferSize(n,s+e))}applyRowSpan(e,t,n){const i=r=>{r!=null&&(r.gutter.style.setProperty("grid-row",`span ${n}`),r.content.style.setProperty("grid-row",`span ${n}`))};if(e==="unified"&&!Array.isArray(t))i(t);else if(e==="split"&&Array.isArray(t))i(t[0]),i(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,n){let i=0,r=0,o=0,s=!1;const l=n>=0;if(e==null)return 0;const a=Array.from(e.content.children),d=Array.from(e.gutter.children);if(a.length!==d.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;o<a.length&&!(t<=0&&!l&&!s);){const u=d[o],c=a[o];if(o++,!(u instanceof HTMLElement)||!(c instanceof HTMLElement))throw console.error({gutterElement:u,contentElement:c}),new Error("FileDiff.trimColumnRows: invalid row elements");if(s&&(s=!1,u.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in c.dataset||u.dataset.gutterBuffer==="metadata"&&"noNewline"in c.dataset)){u.remove(),c.remove(),r++;continue}if("lineIndex"in u.dataset&&"lineIndex"in c.dataset){(t>0||l&&i>=n)&&(u.remove(),c.remove(),t>0&&(t--,t===0&&(s=!0)),r++),i++;continue}if("separator"in u.dataset&&"separator"in c.dataset){(t>0||l&&i>=n)&&(u.remove(),c.remove(),r++);continue}if(u.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in c.dataset){(t>0||l&&i>=n)&&(u.remove(),c.remove(),r++);continue}if(u.dataset.gutterBuffer==="metadata"&&"noNewline"in c.dataset){(t>0||l&&i>=n)&&(u.remove(),c.remove(),r++);continue}if(u.dataset.gutterBuffer==="buffer"&&"contentBuffer"in c.dataset){const f=this.getBufferSize(c.dataset);if(f==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){const h=Math.min(t,f),m=f-h;m>0?(this.updateBufferSize(u,m),this.updateBufferSize(c,m),r+=h):(u.remove(),c.remove(),r+=f),t-=h,t===0&&m===0&&(s=!0)}else if(l){const h=i,m=i+f-1;if(n<=h)u.remove(),c.remove(),r+=f;else if(n<=m){const g=m-n+1,b=f-g;this.updateBufferSize(u,b),this.updateBufferSize(c,b),r+=g}}i+=f;continue}throw console.error({gutterElement:u,contentElement:c}),new Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:i,previousStart:r,trimEnd:o,trimStart:s}){const l=Math.max(0,i-r),a=n-r;if(a<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const d=s>0,u=o>0;if(!d&&!u)return 0;const c=d?l:0,f=u?a:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,c,f);if(t==="split"&&Array.isArray(e)){const h=this.trimColumnRows(e[0],c,f),m=this.trimColumnRows(e[1],c,f);if(e[0]!=null&&e[1]!=null&&h!==m)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?h:m}else throw console.error({diffStyle:t,columns:e}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){const t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;const t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,i){if(e==="unified")return this.getColumnPair(t);{const r=this.getColumnPair(n),o=this.getColumnPair(i);return r!=null||o!=null?[r,o]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:i},r){const{diffIndicators:o="bars",disableBackground:s=!1,disableLineNumbers:l=!1,overflow:a="scroll",diffStyle:d="split"}=this.options,u={type:"diff",diffIndicators:o,disableBackground:s,disableLineNumbers:l,overflow:a,split:d==="unified"?!1:t!=null&&n!=null,totalLines:i,customProperties:r};Im(u,this.appliedPreAttributes)||(Jm(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);const i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);const r=document.createElement("pre");r.dataset.errorStack="",r.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(r)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function k0(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join("")}}function ns(e,t){return e==null||t==null?e==null&&t==null:Da(e,t)}function x0({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function A0({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function R0(e,t,n=!1){return!n&&e==null&&t}function T0(e,t,n=!1){return e==null&&t&&!n}function ze(e){if(!(e==null||e.type!=="element"))return e.children??[]}const dr=3e3,hn=new Map;let I0=-1;var P0=class extends ll{__id=`little-virtualized-file-diff:${++I0}`;renderType="virtualized";top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:hn,ghostTextRowsByIndex:new Map};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;pendingHydratedDiff;pendingExpansions;pendingRender;constructor(e,t,n,i,r=!1){super(e,i,r),this.virtualizer=t,this.metrics=gi(n)}setMetrics(e,t=!1){const n=gi(e);!t&&Qi(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&(this.forceRenderOverride=!0)}syncLineAnnotations(e){return e==null||!this.isNewAnnotations(e)||e.length===0&&this.getLatestAnnotations().length===0?!1:(super.setLineAnnotations(e),!0)}syncEditSessionAnnotationsFromEditor(e){return super.syncEditSessionAnnotationsFromEditor(e)?(this.forceRenderOverride=!0,!0):!1}setFileAnnotationHeight(e){const t=this.cache.fileAnnotationHeight;return e===t?!1:(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e){const t=this.getLatestAnnotations();return tm(t)?t.some(n=>n.lineNumber!==0?!1:e.type==="new"?n.side==="additions":e.type==="deleted"?n.side==="deletions":!0):!1}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){const t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!Va(t,e),i=n&&F0(t,e);super.setOptions(e),i&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:V0(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal=0,this.cache.ghostTextRows=hn,this.cache.ghostTextRowsByIndex.size>0&&this.cache.ghostTextRowsByIndex.clear(),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}applyGhostTextRows(e,t){const{cache:{heightDeltas:n,ghostTextRows:i,ghostTextRowsByIndex:r},metrics:{lineHeight:o}}=this;if(i===t)return!1;const s=this.getDiffStyle(),l=new Map;for(const[d,u]of t){const c=this.getLineIndexForDiff(e,d+1,"additions");c!=null&&l.set(s==="split"?c[1]:c[0],u)}let a=!1;for(const d of new Set([...r.keys(),...l.keys()])){const u=((l.get(d)??0)-(r.get(d)??0))*o;if(u===0)continue;const c=(n.get(d)??0)+u;c===0?n.delete(d):n.set(d,c),this.cache.measuredHeightDeltaTotal+=u,a=!0}return this.cache.ghostTextRows=t,this.cache.ghostTextRowsByIndex=l,a}reconcileHeights(){let e=!1;const{options:{overflow:t="scroll"},metrics:{lineHeight:n}}=this,i=this.placeHolder!=null?this.getLayoutDiff():this.getRenderedDiff();if(this.fileContainer==null||i==null)return this.height!==0&&(e=!0),this.height=0,e;this.top=this.getVirtualizedTop(),e=this.applyGhostTextRows(i,this.editor?.__getGhostTextRows()??hn);const{ghostTextRowsByIndex:r}=this.cache,o=t!=="scroll"||this.getLatestAnnotations().length>0||this.isResizeDebuggingEnabled();if(this.placeHolder!=null||!o&&this.cache.heightDeltas.size===0&&this.cache.fileAnnotationHeight===0)return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;const s=this.getDiffStyle(),l=s==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];if(this.renderRange!=null&&Ba(this.renderRange)){const a=D0(l)??0;this.setFileAnnotationHeight(a)&&(e=!0)}for(const a of l){if(a==null)continue;const d=a.children[1];if(!(d instanceof HTMLElement))continue;const u=s==="split"&&a===this.codeDeletions;for(const c of d.children){if(!(c instanceof HTMLElement))continue;const f=c.dataset.lineIndex;if(f==null)continue;const h=U0(f,s),m=r.get(h)??0;if(u&&m>0)continue;const g=this.cache.heightDeltas.get(h)??0;if(!o&&g===m*n)continue;let b=c.getBoundingClientRect().height+m*n,_=!1;c.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in c.nextElementSibling.dataset||"noNewline"in c.nextElementSibling.dataset)&&("noNewline"in c.nextElementSibling.dataset&&(_=!0),b+=c.nextElementSibling.getBoundingClientRect().height);const v=this.getEstimatedLineHeight(_),y=b-v;y!==g&&(e=!0,this.cache.measuredHeightDeltaTotal+=y-g,y===0?this.cache.heightDeltas.delete(h):this.cache.heightDeltas.set(h,y))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}updateCodeViewLayout(e,t,n,i){let r=!1,o=!1;const{pendingExpansions:s,pendingHydratedDiff:l,options:{collapsed:a=!1}}=this;if(l!=null&&(this.pendingHydratedDiff=void 0,l.expectedDiff===e&&(Object.assign(e,l.nextDiff),this.setHydratedState(l.files),this.installHydratedSessionDiff(e),this.forceRenderOverride=!0,r=!0,o=!0)),s!=null){this.pendingExpansions=void 0;for(const{hunkIndex:m,direction:g,expansionLineCountOverride:b}of s)this.hunksRenderer.expandHunk(m,g,b),this.forceRenderOverride=!0,o=!0}const d=this.updateExternalDiff(e,i),{pendingRenderDiff:u,layoutDiffChanged:c,renderedDiffChanged:f,annotationsChanged:h}=this.updatePendingRender(e,i);return!this.forceRenderOverride&&(d||f||h)&&(this.forceRenderOverride=!0),(n?.resetDiffLayoutCache===!0||c)&&(r=!0),(c||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights)&&(o=!0),n?.metrics!=null&&(this.metrics=gi(n.metrics),r=!0,o=!0),this.currentCollapsed!==a&&(this.currentCollapsed=a,r=!0),r?this.resetLayoutCache({includeEstimatedHeights:o}):o&&this.invalidateDerivedLayoutCache(!0),this.top=t,this.computeApproximateSize(!1,u),this.height}getLinePosition(e,t="additions"){const n=this.getLayoutDiff();if(n==null||e<1)return;const i=this.getLineIndexForDiff(n,e,t);if(i==null)return;const{disableFileHeader:r=!1,expandUnchanged:o=!1,collapsed:s=!1,collapsedContextThreshold:l=1}=this.options,a=this.getDiffStyle(),d=this.getHunkSeparatorType(),u=a==="split"?i[1]:i[0];this.approximateLayoutCheckpoints(n);const c=mt(this.metrics,r),f=this.getLayoutCheckpointBeforeLineIndex(u);let h=f?.top??c+this.cache.fileAnnotationHeight;if(s)return{top:c,height:0};let m;return ot({diff:n,diffStyle:a,startingLine:f?.renderedLineIndex??0,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:l,callback:({hunkIndex:g,hunk:b,collapsedBefore:_,collapsedAfter:v,deletionLine:y,additionLine:S})=>{const E=a==="split"?S?.splitLineIndex??y?.splitLineIndex:S?.unifiedLineIndex??y?.unifiedLineIndex;if(E==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(_>0){const L=Tt({type:d,metrics:this.metrics,hunkIndex:g,hunkSpecs:b?.hunkSpecs});if(L!=null){if(h+=L.gapBefore,u>=E-_&&u<E)return m={top:h,height:L.height},!0;h+=L.height+L.gapAfter}}const C=this.getLineHeight(E,(S?.noEOFCR??!1)||(y?.noEOFCR??!1));if(E===u)return m={top:h,height:C},!0;if(h+=C,v>0){const L=et({type:d,metrics:this.metrics});if(L!=null){if(u>E&&u<=E+v)return m={top:h+L.gapBefore,height:L.height},!0;h+=L.totalHeight}}return!1}}),m}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){const t=this.getLayoutDiff();if(t==null)return;const{disableFileHeader:n=!1,expandUnchanged:i=!1,collapsed:r=!1,collapsedContextThreshold:o=1}=this.options;if(r)return;const s=this.getDiffStyle(),l=this.getHunkSeparatorType();this.approximateLayoutCheckpoints(t);const a=this.getLayoutCheckpointBeforeTop(e);let d=a?.top??mt(this.metrics,n)+this.cache.fileAnnotationHeight,u;return ot({diff:t,diffStyle:s,startingLine:a?.renderedLineIndex??0,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:c,hunk:f,collapsedBefore:h,collapsedAfter:m,deletionLine:g,additionLine:b})=>{const _=s==="split"?b?.splitLineIndex??g?.splitLineIndex:b?.unifiedLineIndex??g?.unifiedLineIndex;if(_==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(h>0){const y=Tt({type:l,metrics:this.metrics,hunkIndex:c,hunkSpecs:f?.hunkSpecs});y!=null&&(d+=y.totalHeight)}if(d>=e&&(g!=null?u={lineNumber:g.lineNumber,side:"deletions",top:d}:b!=null&&(u={lineNumber:b.lineNumber,side:"additions",top:d}),u!=null))return!0;const v=this.getLineHeight(_,(b?.noEOFCR??!1)||(g?.noEOFCR??!1));if(d+=v,m>0){const y=et({type:l,metrics:this.metrics});y!=null&&(d+=y.totalHeight)}return!1}}),u}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){const t=this.getLayoutDiff();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const n=e!=null?this.computeRenderRangeFromWindow(t,this.top,e):this.renderRange;if(n==null)return;const{bufferBefore:i,bufferAfter:r,totalLines:o}=n;let s=0;if(o===0){const l=e??this.virtualizer.getWindowSpecs();this.top<l.top&&(s=r)}return{topOffset:this.top+i+s,height:this.height-(i+r)}}cleanUp(e=!1){const t=this.cache.ghostTextRows.size>0;t&&(this.layoutDirty=!0);const n=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!G(this.getRenderedDiff(),this.getLatestDiff()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),n&&this.virtualizer.instanceChanged(this,!0)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.loadFilesIfNecessary(),this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(this.isAdvancedMode()){const n=ir("clone",e,t);if(await tr(()=>this.primeHighlightCache(n)),this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(ir("merge",e,t),this.setHydratedState(t),!this.installHydratedSessionDiff(e)&&(await tr(()=>this.primeHighlightCache(e)),this.fileDiff!==e))return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;const{pendingExpansions:t}=this,n=this.getRenderedDiff();if(t==null||t.length===0||n==null)return!1;const{expansionLineCount:i=100,collapsedContextThreshold:r=1}=this.options,o=new Map(this.hunksRenderer.getExpandedHunksMap());for(const s of t){const l={...o.get(s.hunkIndex)??{fromStart:0,fromEnd:0}},a=s.expansionLineCountOverride??i;(s.direction==="up"||s.direction==="both")&&(l.fromStart+=a),(s.direction==="down"||s.direction==="both")&&(l.fromEnd+=a),o.set(s.hunkIndex,l)}return Ma({fileDiff:n,lineNumber:e,expandedHunks:o,collapsedContextThreshold:r})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),!(!this.enabled||this.fileDiff==null)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){if(!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null)return;const e=this.getLatestDiff(),t=e==null?void 0:this.hunksRenderer.getDiffForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!G(this.getRenderedDiff(),t))}syncGhostTextRows(){const e=this.getAdvancedVirtualizer();e!=null?(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0)):this.getSimpleVirtualizer()?.requestHeightReconcile(this)}applyDocumentChange(e,t,n=!1){const{renderRange:i}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1});const r=this.getRenderedDiff();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&i!=null&&r!=null){const o=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(r,this.top??0,o);s.bufferAfter!==i.bufferAfter&&this.updateBuffers(s)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutDiff()){const n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;const i=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(t,this.editor?.__getGhostTextRows()??hn);const{disableFileHeader:r=!1,collapsed:o=!1}=this.options,s=mt(this.metrics,r);if(this.height+=s,o){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!i&&this.validateComputedHeight(t),this.layoutDirty=!1}getLayoutDiff(){return this.pendingRender?.diff??this.getRenderedDiff()}getActiveEstimatedHeight(e=this.getLayoutDiff()){this.ensureEstimatedDiffHeights(e);const t=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw new Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return t}ensureEstimatedDiffHeights(e=this.getLayoutDiff()){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options,{splitHeight:r,unifiedHeight:o}=Ym({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,canHydratePartialDiff:wi(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=r,this.cache.estimatedUnifiedHeight=o}validateComputedHeight(e=this.getLayoutDiff()){if(this.fileContainer==null||e==null)return;const t=this.fileContainer.getBoundingClientRect();t.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:e.name,elementHeight:t.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:i,...r}={}){const o=nr(r,"VirtualizedFileDiff.render"),s=o!=null,l=o?.oldFile,a=o?.newFile,d=s&&(!os(l,this.deletionFile)||!os(a,this.additionFile));let u=t??this.fileDiff;t==null&&s&&(d||this.fileDiff==null)&&(u=Ke(o.oldFile,o.newFile,this.options.parseDiffOptions));const{forceRenderOverride:c,isSetup:f}=this;this.forceRenderOverride=void 0;const h=u!=null&&!G(this.fileDiff,u),m=h||d;if(e=this.getOrCreateFileContainer(e),u==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;h&&this.updateExternalDiff(u,i);const{pendingRenderDiff:g,layoutDiffChanged:b,renderedDiffChanged:_,annotationsChanged:v}=this.pendingRender!=null&&this.pendingRender.latestDiff===(this.getLatestDiff(u)??u)?{pendingRenderDiff:this.pendingRender.diff,layoutDiffChanged:!1,renderedDiffChanged:!1,annotationsChanged:this.syncLineAnnotations(i)}:this.updatePendingRender(u,i);if(b&&this.resetLayoutCache({includeEstimatedHeights:!0}),f)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,g));else{this.computeApproximateSize(!1,g);const C=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(C==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");C.connect(e,this),this.isVisible=C.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!m||!f))return o!=null&&(this.deletionFile=l,this.additionFile=a),h&&this.clearReusableHeader(),this.renderPlaceholder(this.height);const y=this.virtualizer.getWindowSpecs(),S=this.top??0,E=this.computeRenderRangeFromWindow(g,S,y);return super.render({fileDiff:u,fileContainer:e,renderRange:E,lineAnnotations:i,forceRender:(c??n)||v||_||h,...o,...r})}finalizeRender(){if(!G(this.getRenderedDiff(),this.pendingRender?.diff))throw new Error("VirtualizedFileDiff.render: rendered a different diff than its prepared layout");this.pendingRender=void 0,this.isSimpleMode()&&this.getSimpleVirtualizer()?.requestHeightReconcile(this)}updatePendingRender(e,t){const n=this.getLatestDiff(e)??e,i=this.getRenderedDiff(),{pendingRender:r}=this,o=r?.diff??i,s=this.hunksRenderer.getDiffForNextRender(n);return this.pendingRender={latestDiff:n,diff:s},{pendingRenderDiff:s,annotationsChanged:this.syncLineAnnotations(t),layoutDiffChanged:!G(o,s),renderedDiffChanged:!G(i,s)}}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type==="advanced"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return $0(this.options.hunkSeparators)}approximateLayoutCheckpoints(e){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e.hunks.length===0||this.options.collapsed===!0)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options,r=e.hunks.length-1,o=wi(e,this.options.loadDiffFiles!=null),s=this.getDiffStyle(),l=this.getHunkSeparatorType(),a=n?!0:this.hunksRenderer.getExpandedHunksMap(),d=O0(this.cache.heightDeltas);let u=mt(this.metrics,t)+this.cache.fileAnnotationHeight,c=0;const f=({rowCount:h,startLineIndex:m,preSeparatorHeight:g=0,postSeparatorHeight:b=0,metadataOffsets:_=[]})=>{if(h<=0)return;const v=c,y=c+h;let S=N0(v);for(;S<y;){const E=S-v,C=u+(E>0?g:0)+E*this.metrics.lineHeight+M0(_,E)*this.metrics.lineHeight+is(d,m,m+E);this.cache.checkpoints.push({renderedLineIndex:S,lineIndex:m+E,top:C}),S+=dr}u+=g+h*this.metrics.lineHeight+_.length*this.metrics.lineHeight+is(d,m,m+h)+b,c=y};for(let h=0;h<e.hunks.length;h++){const m=e.hunks[h];if(m==null)throw new Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");const g=He({isPartial:e.isPartial,rangeSize:m.collapsedBefore,expandedHunks:a,hunkIndex:h,collapsedContextThreshold:i}),b=g.collapsedLines>0?Tt({type:l,metrics:this.metrics,hunkIndex:h,hunkSpecs:m.hunkSpecs})?.totalHeight??0:0;f({rowCount:g.fromStart,startLineIndex:(s==="split"?m.splitLineStart:m.unifiedLineStart)-g.rangeSize});let _=b;f({rowCount:g.fromEnd,startLineIndex:(s==="split"?m.splitLineStart:m.unifiedLineStart)-g.fromEnd,preSeparatorHeight:_}),g.fromEnd>0&&(_=0);const v=h===r?Fe({fileDiff:e,hunkIndex:h,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:"VirtualizedFileDiff"}):void 0,y=v!=null&&v.collapsedLines>0?et({type:l,metrics:this.metrics})?.totalHeight??0:h===r&&o?et({type:l,metrics:this.metrics})?.totalHeight??0:0,S=v!=null?v.fromStart+v.fromEnd:0,E=s==="split"?m.splitLineCount:m.unifiedLineCount,C=s==="split"?m.splitLineStart:m.unifiedLineStart;f({rowCount:E,startLineIndex:C,preSeparatorHeight:_,postSeparatorHeight:S===0?y:0,metadataOffsets:H0({diffStyle:s,hunk:m,rowCount:E})}),v!=null&&S>0&&f({rowCount:S,startLineIndex:C+E,postSeparatorHeight:y})}this.cache.totalLines=c}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const r=t+n>>1,o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");o.lineIndex<=e?(i=o,t=r+1):n=r-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,r=-1;for(;n<=i;){const o=n+i>>1,s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");s.top<=e?(r=o,n=o+1):i=o-1}if(t==null)return r>=0?this.cache.checkpoints[r]:void 0;for(let o=r;o>=0;o--){const s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(s.renderedLineIndex%t===0)return s}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(const l of e.hunks)n+=t==="split"?l.splitLineCount:l.unifiedLineCount;return n}const{expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options,o=i?!0:this.hunksRenderer.getExpandedHunksMap();for(const[l,a]of e.hunks.entries()){const d=t==="split"?a.splitLineCount:a.unifiedLineCount;n+=d;const u=Math.max(a.collapsedBefore,0),{fromStart:c,fromEnd:f,renderAll:h}=He({isPartial:e.isPartial,rangeSize:u,expandedHunks:o,hunkIndex:l,collapsedContextThreshold:r});u>0&&(n+=h?u:c+f)}const s=Fe({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:o,collapsedContextThreshold:r,errorPrefix:"VirtualizedFileDiff"});return s!=null&&(n+=s.fromStart+s.fromEnd),n}getLayoutLineCount(e,t){const n=this.getExpandedLineCount(e,t),i=t==="split"?e.splitLineCount:e.unifiedLineCount;return Math.max(n,i,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:r=!1,expandUnchanged:o=!1,collapsedContextThreshold:s=1}=this.options,{hunkLineCount:l,lineHeight:a}=this.metrics,d=this.getDiffStyle(),u=this.getHunkSeparatorType(),c=wi(e,this.options.loadDiffFiles!=null),f=this.height;let h=this.getLayoutLineCount(e,d);const m=mt(this.metrics,r),g=e.hunks.length>0?Oa(this.metrics):0,{fileAnnotationHeight:b}=this.cache,_=m+b,v=Math.max(0,f-m-b-g),y=this.hasFileAnnotations(e),S=t+m,E=b>0&&y&&S<i&&S+b>n;if(t<n-f||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-g};if(h<=l||e.hunks.length===0)return{startingLine:0,totalLines:l,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),h=this.getLayoutLineCount(e,d);const C=Math.ceil(Math.max(i-n,0)/a),L=Math.ceil(C/l)*l+l,x=L/l,w=x,A=[],I=(n+i)/2,k=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-L*a*2),l);let R=t+(k?.top??_),P=k?.renderedLineIndex??0,F,T,N;if(ot({diff:e,diffStyle:d,startingLine:k?.renderedLineIndex??0,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:St,hunk:we,collapsedBefore:Kn,collapsedAfter:Xn,deletionLine:Xe,additionLine:ke})=>{const j=ke!=null?ke.splitLineIndex:Xe.splitLineIndex,ie=ke!=null?ke.unifiedLineIndex:Xe.unifiedLineIndex,ae=(ke?.noEOFCR??!1)||(Xe?.noEOFCR??!1),Qe=St===e.hunks.length-1&&we!=null&&(d==="split"?j===we.splitLineStart+we.splitLineCount-1:ie===we.unifiedLineStart+we.unifiedLineCount-1),he=(Kn>0?Tt({type:u,metrics:this.metrics,hunkIndex:St,hunkSpecs:we?.hunkSpecs}):void 0)?.totalHeight??0;R+=he;const fe=P%l===0,Ue=Math.floor(P/l);if(fe&&(A[Ue]=R-(t+_+he),N!=null)){if(N<=0)return!0;N--}const re=this.getLineHeight(d==="split"?j:ie,ae);if(R>n-re&&R<i&&(F??=Ue),T==null&&R+re>I&&(T=Ue),N==null&&R>=i&&fe&&(N=w),P++,R+=re,Xn>0||Qe&&c){const Gt=et({type:u,metrics:this.metrics});Gt!=null&&(R<i&&R+Gt.totalHeight>n&&(F??=Ue),T==null&&R+Gt.totalHeight>I&&(T=Ue),R+=Gt.totalHeight)}return!1}}),F==null)if(E)F=0,T=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-g};T??=F;const V=Math.round(T-x/2),D=Math.max(0,Math.ceil(h/l)-x),H=Math.max(0,Math.min(V,D)),$=H*l,z=V<0?L+V*l:L,ee=A[H]??0,se=$===0?0:b+ee,ve=H+z/l,$e=ve<A.length?v-A[ve]:v-(R-t-_);return{startingLine:$,totalLines:z,bufferBefore:se,bufferAfter:Math.max(0,$e)}}};function D0(e){let t;for(const n of e){if(n==null)continue;const i=n.children[1];if(i instanceof HTMLElement)for(const r of i.children)r instanceof HTMLElement&&r.dataset.lineAnnotation===em&&(t=Math.max(t??0,r.getBoundingClientRect().height))}return t}function O0(e){const t=Array.from(e).sort((o,s)=>o[0]-s[0]),n=[],i=[0];let r=0;for(const[o,s]of t)n.push(o),r+=s,i.push(r);return{lineIndexes:n,prefixTotals:i}}function is({lineIndexes:e,prefixTotals:t},n,i){if(n>=i||e.length===0)return 0;const r=rs(e,n);return(t[rs(e,i)]??0)-(t[r]??0)}function rs(e,t){let n=0,i=e.length;for(;n<i;){const r=n+i>>1,o=e[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid prefix index");o<t?n=r+1:i=r}return n}function N0(e){return Math.ceil(e/dr)*dr}function M0(e,t){let n=0;for(const i of e)i<t&&n++;return n}function H0({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];const i=t.hunkContent.at(-1);if(i==null)return[];if(i.type==="context")return[n-1];const r=Math.max(i.deletions,i.additions),o=i.deletions+i.additions;if(e==="split")return r>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];const s=[],l=n-o;return i.deletions>0&&t.noEOFCRDeletions&&s.push(l+i.deletions-1),i.additions>0&&t.noEOFCRAdditions&&s.push(n-1),s}function F0(e,t){return(e.diffStyle??"split")!==(t.diffStyle??"split")||(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??"bars")!==(t.diffIndicators??"bars")||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function V0(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function wi(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function $0(e){return typeof e=="function"?"custom":e??"line-info"}function os(e,t){return e==null||t==null?e==null&&t==null:Da(e,t)}function U0(e,t){const[n,i]=e.split(",").map(Number);return t==="split"?i:n}function dl(e,t){return typeof window>"u"&&t!=null?U.jsxs(U.Fragment,{children:[U.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t}}),e]}):U.jsx(U.Fragment,{children:e})}const B0=q.createContext(void 0);function z0(){return q.useContext(B0)}const G0=typeof window>"u"?q.useEffect:q.useLayoutEffect;function ul({fileDiff:e,oldFile:t,newFile:n,options:i,editorOptions:r,editStateKey:o,lineAnnotations:s,selectedLines:l,prerenderedHTML:a,metrics:d,hasGutterRenderUtility:u,hasCustomHeader:c,disableWorkerPool:f,edit:h,onEditChange:m,onEditComplete:g}){const b=z0(),_=l!==void 0,v=q.useContext(Zp),y=du(),[S,E]=q.useState(),C=Xt(D=>m?.(D)),L=m!=null?C:void 0,x=q.useRef(null),w=Xt(D=>{const H=g?.(D)??"reject";return H==="accept"&&(x.current={fileDiff:{installed:D.fileDiff,stale:D.originalFileDiff},filePair:e==null?{fileDiff:D.fileDiff,installed:{oldFile:D.oldFile,newFile:D.newFile},stale:{oldFile:t??null,newFile:n??null}}:null,annotations:{installed:D.lineAnnotations,stale:D.originalLineAnnotations}}),H}),A=g!=null?w:void 0,I=j0({acceptedCache:x,fileDiff:e,newFile:n,oldFile:t,parseDiffOptions:i?.parseDiffOptions}),k=q.useRef(null),R=q.useRef(null),P=q.useRef(null),F=Xt(()=>{if(y==null)throw new Error("FileDiff: EditContext is not attached");return y("file-diff",r??{},o)}),T=Xt(D=>{if(D!=null){if(k.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");b!=null?k.current=new P0(ki({controlledSelection:_,hasCustomHeader:c,hasGutterRenderUtility:u,onEditChange:L,onEditComplete:A,options:i}),b,d,f?void 0:v,!0):k.current=new ll(ki({controlledSelection:_,hasCustomHeader:c,hasGutterRenderUtility:u,onEditChange:L,onEditComplete:A,options:i}),f?void 0:v,!0),k.current.hydrate({fileDiff:I,fileContainer:D,lineAnnotations:s,prerenderedHTML:a})}else{if(k.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");P.current=null,k.current.cleanUp(),k.current=null,R.current=null}});G0(()=>{const{current:D}=k;if(D==null)return;const H=ki({controlledSelection:_,hasCustomHeader:c,hasGutterRenderUtility:u,onEditChange:L,onEditComplete:A,options:i}),$=H!==void 0&&!Va(D.options,H);if(D.setOptions(H),!h&&(P.current=null,R.current!=null)){const{current:$e}=R;R.current=null,$e()}const z=W0(I,s,x);if(D.render({forceRender:$,fileDiff:z.fileDiff,lineAnnotations:z.lineAnnotations}),l!==void 0&&D.setSelectedLines(l),!h||R.current!=null)return;if(y==null)throw new Error("FileDiff: EditContext is not attached");const ee=()=>{k.current!==D||R.current!=null||!D.__canAttachEditor()||(R.current=q0(D,F))};if(D.__canAttachEditor()){P.current=null,ee();return}const se=D.__prepareForEditing();if(se==null){P.current=null;return}if(P.current?.promise===se)return;const ve={promise:se};P.current=ve,se.then(()=>{P.current===ve&&(ee(),P.current=null)}).catch($e=>{P.current===ve&&(P.current=null,E($e))})});const N=q.useCallback(()=>k.current?.getHoveredLine(),[]),V=q.useCallback(D=>k.current?.getAnnotationSlotName(D)??tt(D),[]);if(S!=null)throw S;return{fileDiff:I,ref:T,getHoveredLine:N,getAnnotationSlotName:V}}function j0({acceptedCache:e,fileDiff:t,newFile:n,oldFile:i,parseDiffOptions:r}){return q.useMemo(()=>{if(t!=null)return t;const{current:o}=e,s=o?.filePair;if(o!=null&&s!=null){if(ss(i,n,s.stale)||ss(i,n,s.installed))return s.fileDiff;o.filePair=null}return Ke(i??null,n??null,r)},[e,t,i,n,r])}function ss(e,t,n){return Ro(e??void 0,n.oldFile??void 0)&&Ro(t??void 0,n.newFile??void 0)}function W0(e,t,n){const{current:i}=n;if(i==null)return{fileDiff:e,lineAnnotations:t};const{fileDiff:r,annotations:o}=i;let s=e;r!=null&&(G(e,r.stale)?s=r.installed:i.fileDiff=null);let l=t;return o!=null&&(t===o.stale?l=o.installed:i.annotations=null),i.fileDiff==null&&i.annotations==null&&i.filePair==null&&(n.current=null),{fileDiff:s,lineAnnotations:l}}function ki({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:i,onEditChange:r,onEditComplete:o}){return t||i||n||r!=null||o!=null?{...e,controlledSelection:t,renderCustomHeader:n?Vr:e?.renderCustomHeader,renderGutterUtility:i?Vr:e?.renderGutterUtility,onEditChange:r,onEditComplete:o}:e}function q0(e,t){const n=t();try{return n.edit(e)}catch(i){throw n.cleanUp(),i}}function K0({oldFile:e,newFile:t,options:n,editorOptions:i,editStateKey:r,metrics:o,lineAnnotations:s,selectedLines:l,className:a,style:d,prerenderedHTML:u,renderAnnotation:c,renderCustomHeader:f,renderHeaderPrefix:h,renderHeaderFilenameSuffix:m,renderHeaderMetadata:g,renderGutterUtility:b,disableWorkerPool:_=!1,edit:v=!1,onEditChange:y,onEditComplete:S}){const{fileDiff:E,ref:C,getHoveredLine:L,getAnnotationSlotName:x}=ul({oldFile:e,newFile:t,options:n,editorOptions:i,editStateKey:r,metrics:o,lineAnnotations:s,selectedLines:l,prerenderedHTML:u,hasGutterRenderUtility:b!=null,hasCustomHeader:f!=null,disableWorkerPool:_,edit:v,onEditChange:y,onEditComplete:S}),w=Os({fileDiff:E,renderCustomHeader:f,renderHeaderPrefix:h,renderHeaderFilenameSuffix:m,renderHeaderMetadata:g,renderAnnotation:c,lineAnnotations:s,renderGutterUtility:b,getHoveredLine:L,getAnnotationSlotName:x});return U.jsx(pr,{ref:C,className:a,style:d,children:dl(w,u)})}function X0(e){const t=wg(e);if(t.length!==1)throw console.error(t),new Error("PatchDiff: Provided patch must include only 1 patch, with 1 diff");const{files:n}=t[0];if(n.length!==1)throw console.error(n),new Error("FileDiff: Provided patch must contain exactly 1 file diff");return n[0]}function Q0({patch:e,options:t,editorOptions:n,editStateKey:i,metrics:r,lineAnnotations:o,selectedLines:s,className:l,style:a,prerenderedHTML:d,renderAnnotation:u,renderCustomHeader:c,renderHeaderPrefix:f,renderHeaderFilenameSuffix:h,renderHeaderMetadata:m,renderGutterUtility:g,disableWorkerPool:b=!1,edit:_=!1,onEditChange:v,onEditComplete:y}){const S=J0(e),{ref:E,getHoveredLine:C,getAnnotationSlotName:L}=ul({fileDiff:S,options:t,editorOptions:n,editStateKey:i,metrics:r,lineAnnotations:o,selectedLines:s,prerenderedHTML:d,hasGutterRenderUtility:g!=null,hasCustomHeader:c!=null,disableWorkerPool:b,edit:_,onEditChange:v,onEditComplete:y}),x=Os({fileDiff:S,renderCustomHeader:c,renderHeaderPrefix:f,renderHeaderFilenameSuffix:h,renderHeaderMetadata:m,renderAnnotation:u,lineAnnotations:o,renderGutterUtility:g,getHoveredLine:C,getAnnotationSlotName:L});return U.jsx(pr,{ref:E,className:l,style:a,children:dl(x,d)})}function J0(e){return q.useMemo(()=>X0(e),[e])}const Y0=["Binary files ","GIT binary patch","similarity index ","rename from ","rename to ","copy from ","copy to ","new file mode ","deleted file mode ","old mode ","new mode "];function Z0({patch:e}){const t=e.split(`
|
|
308
|
+
`).filter(n=>Y0.some(i=>n.startsWith(i)));return t.length===0?U.jsx("p",{className:"p-3 text-caption text-muted-foreground",children:"No textual changes."}):U.jsx("div",{className:"p-3 font-mono text-caption",children:t.map(n=>U.jsx("div",{children:n},n))})}function e_({patch:e,options:t}){return/^@@ -\d/m.test(e)?U.jsx(Q0,{patch:e,options:t}):U.jsx(Z0,{patch:e})}function o_({className:e,layout:t,...n}){const{resolvedTheme:i}=gl(),r=n.patch!==void 0,o={theme:{dark:"pierre-dark",light:"pierre-light"},themeType:i,diffStyle:t??(r?"unified":"split"),diffIndicators:"classic",disableFileHeader:!0,overflow:"wrap"};return U.jsx("div",{className:_l("code-diff min-w-0 overflow-auto rounded-md border border-border bg-card",e),children:n.patch!==void 0?U.jsx(e_,{patch:n.patch,options:o}):U.jsx(K0,{oldFile:{name:n.filename??"content.txt",contents:n.codeA},newFile:{name:n.filename??"content.txt",contents:n.codeB},options:o})})}export{o_ as CodeDiff};
|