From e7697f56e59a9a3eeb6832c507c66398cacae345 Mon Sep 17 00:00:00 2001 From: arzafran Date: Wed, 4 Nov 2026 18:29:23 -0300 Subject: [PATCH 1/2] chore: bump Sparkle 2.10.1, swift-toml 2.1.0, nix 0.31, @pierre/diffs 1.6.4, typescript 7 (INC-493) --- .github/workflows/release.yml | 2 +- GhosttyTabs.xcodeproj/project.pbxproj | 4 +- .../xcshareddata/swiftpm/Package.resolved | 10 +-- .../review-diff-viewer/chunks/diff-vendor.mjs | 63 +++++++++++-------- .../review-diff-viewer/chunks/diff-worker.mjs | 12 ++-- .../chunks/highlights-CpZm9DAR.mjs | 1 + .../review-diff-viewer/chunks/highlights.mjs | 1 + .../chunks/pierre-highlights.mjs | 8 +++ .../chunks/pierre-theming.mjs | 2 +- .../chunks/shiki-Ci4cdHsM.mjs | 1 + .../review-diff-viewer/chunks/shiki-core.mjs | 58 ++++++++--------- .../chunks/stream-tokenizer-DK9xp5M5.mjs | 4 ++ Resources/review-diff-viewer/main.mjs | 4 +- THIRD_PARTY_LICENSES.md | 11 +++- core/Cargo.lock | 4 +- core/Cargo.toml | 2 +- core/crates/programad/src/fdpass.rs | 7 ++- core/crates/programad/src/pty.rs | 11 ++-- core/crates/programad/src/session.rs | 4 +- core/crates/programad/tests/integration.rs | 14 ++--- scripts/sparkle_generate_appcast.sh | 4 +- scripts/sparkle_generate_keys.sh | 2 +- webviews/review-diff/bun.lock | 54 +++++++++++++--- webviews/review-diff/package.json | 4 +- webviews/review-diff/src/main.ts | 2 +- webviews/review-diff/vite.config.mjs | 33 ++++++---- 26 files changed, 203 insertions(+), 119 deletions(-) create mode 100644 Resources/review-diff-viewer/chunks/highlights-CpZm9DAR.mjs create mode 100644 Resources/review-diff-viewer/chunks/highlights.mjs create mode 100644 Resources/review-diff-viewer/chunks/pierre-highlights.mjs create mode 100644 Resources/review-diff-viewer/chunks/shiki-Ci4cdHsM.mjs create mode 100644 Resources/review-diff-viewer/chunks/stream-tokenizer-DK9xp5M5.mjs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5371b99b8..182e6c5b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -373,7 +373,7 @@ jobs: run: | ./scripts/verify_sparkle_artifact.sh \ "build-universal/Build/Products/Release/Programa.app" \ - "2.9.6" + "2.10.1" - name: Notarize app env: diff --git a/GhosttyTabs.xcodeproj/project.pbxproj b/GhosttyTabs.xcodeproj/project.pbxproj index 5da6fb8a6..bba36143b 100644 --- a/GhosttyTabs.xcodeproj/project.pbxproj +++ b/GhosttyTabs.xcodeproj/project.pbxproj @@ -2322,7 +2322,7 @@ repositoryURL = "https://github.com/sparkle-project/Sparkle"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 2.9.6; + minimumVersion = 2.10.1; }; }; A5001292 /* XCRemoteSwiftPackageReference "swift-markdown-ui" */ = { @@ -2350,7 +2350,7 @@ repositoryURL = "https://github.com/mattt/swift-toml"; requirement = { kind = exactVersion; - version = 2.0.0; + version = 2.1.0; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 58fd056a4..1918a33d2 100644 --- a/GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "21ac4fd1223a12d33e21f002cbd77a37f4bf0c1a44dca4be675f88d2d2db4acf", + "originHash" : "81ea4c3875bd59caa425edf150992a831637cceb43a0421adb923584a854bd77", "pins" : [ { "identity" : "eventsource", @@ -24,8 +24,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/sparkle-project/Sparkle", "state" : { - "revision" : "ac2def288cbff5cfc7df3ffef6abdf45b72bcb0a", - "version" : "2.9.6" + "revision" : "ab7d71291238df6e0492143b120c9b696a35f603", + "version" : "2.10.1" } }, { @@ -105,8 +105,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mattt/swift-toml", "state" : { - "revision" : "827506c90475e82d5a7f191f950fb3025cbdc0d6", - "version" : "2.0.0" + "revision" : "8227201d741c82183c9b0531a7d9ec7fa9240a2f", + "version" : "2.1.0" } } ], diff --git a/Resources/review-diff-viewer/chunks/diff-vendor.mjs b/Resources/review-diff-viewer/chunks/diff-vendor.mjs index 1b83335ad..405e1ef07 100644 --- a/Resources/review-diff-viewer/chunks/diff-vendor.mjs +++ b/Resources/review-diff-viewer/chunks/diff-vendor.mjs @@ -1,13 +1,13 @@ -import{b as Vi,c as Zs,a as er,d as tr,t as X,e as ir,f as nr,g as sr,h as rr}from"./shiki-core.mjs";import{c as or,s as ar,p as lr,n as ti}from"./pierre-theming.mjs";import{_ as dr}from"./preload-helper.mjs";const Vn="diffs-container",hr=(()=>{try{return!1}catch{return!1}})(),cr=/(?=^From [a-f0-9]+ .+$)/m,Wn=/(?=^diff --git)/gm,ur=new RegExp("(?<=\\n)"),fr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,pr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Ii="header-prefix",Mi="header-filename-suffix",Di="header-metadata",Pi="header-custom",U={dark:"pierre-dark",light:"pierre-light"},gr="data-theme-css",mr="data-unsafe-css",vr="data-diffs-scrollbar-measure",Sr="data-diffs-code-view-header",yr="data-diffs-code-view-footer",qn="--diffs-scrollbar-gutter-measured",br=1e5,Fi={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},tt={...Fi,hunkLineCount:1},Cr={paddingTop:8,paddingBottom:8,gap:8},kr={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},Lr=Object.freeze({fromStart:0,fromEnd:0}),_t={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},$n={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},_e=new Map,ii=new Map,wr=new Map,pi=new Set;function Qe(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!pi.has(t))return!1;return!0}function Wi(e,t){e=Array.isArray(e)?e:[e];for(const i of e){if(pi.has(i.name))continue;let n=_e.get(i.name);n==null&&(n=i,_e.set(i.name,n));const s=n.data.find(r=>r.name===n.name||r.aliases?.includes(n.name)===!0);if(s==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${n.name}" as its name or an alias.`);t.loadLanguageSync(n.data);try{t.getLanguage(n.name)}catch{throw new Error(`attachResolvedLanguages: "${s.name}" is already loaded without alias "${n.name}". Load the alias first or give the grammar a unique name.`)}pi.add(n.name)}}function Gn(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function jn(e){if(Gn())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=ii.get(e);if(t!=null)return t;try{let i=wr.get(e);if(i==null&&Object.prototype.hasOwnProperty.call(Vi,e)&&(i=Vi[e]),i==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const n=i().then(({default:s})=>{const r={name:e,data:s};return _e.has(e)||_e.set(e,r),r});return ii.set(e,n),await n}finally{ii.delete(e)}}function Kn(e){return _e.get(e)??jn(e)}function Ee(e=U){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}const gi=new Set;function ce(e){for(const t of Ee(e))if(!gi.has(t))return!1;return!0}const ue=or();function mi(e,t){e=Array.isArray(e)?e:[e];for(let i of e){let n;if(typeof i=="string"){if(n=ue.getResolvedTheme(i),n==null)throw new Error(`loadResolvedThemes: ${i} is not resolved, you must resolve it before calling loadResolvedThemes`)}else n=i,i=i.name,ue.getResolvedTheme(i)==null&&ue.seedResolvedTheme(i,n);gi.has(i)||(gi.add(i),t.loadThemeSync(n))}}function Yn(e){if(Gn())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(ue.hasRegisteredTheme(e))return;const t=ar.getTheme(e);if(t!=null){ue.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function Xn(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function xr(e){Yn(e);const t=await ue.resolveTheme(e);return Xn(e,t),t}function Er(e){return ue.getResolvedTheme(e)??xr(e)}let he;async function Me({themes:e,langs:t,preferredHighlighter:i="shiki-js"}){he??=Zs({themes:[],langs:["text"],engine:i==="shiki-wasm"?er(dr(()=>import("./shiki-wasm.mjs"),[])):tr()});const n=Tr(he)?await he:he;he=n;const s=[];for(const o of Array.from(new Set(t))){if(o==="text"||o==="ansi")continue;const l=Kn(o);"then"in l?s.push(l):Wi(l,n)}const r=[];for(const o of e){const l=Er(o);"then"in l?r.push(l):mi(l,he)}return(s.length>0||r.length>0)&&await Promise.all([Promise.all(s).then(o=>{Wi(o,n)}),Promise.all(r).then(o=>{mi(o,n)})]),n}function Rr(e=he){return e!=null&&!("then"in e)}function Je(e){if(!(he==null||"then"in he)&&!(e!=null&&(!ce(e.theme)||!Qe(e.lang))))return he}function Tr(e=he){return e!=null&&"then"in e}async function Ar(e){await Me(e)}for(const e of lr.getThemes())ue.registerThemeIfAbsent(e.name,e.load);const Ke=new Set;let Ye=null;function Oi(e){Ke.add(e),Ye??=requestAnimationFrame(Qn)}function ct(e){Ke.delete(e)&&Ke.size===0&&Ye!=null&&(cancelAnimationFrame(Ye),Ye=null)}function Qn(e){const t=new Set(Ke);Ke.clear();for(const i of t)try{i(e)}catch(n){console.error(n)}Ke.size>0?Ye=requestAnimationFrame(Qn):Ye=null}function Ze(e,t,i){if(e===t||e==null||t==null)return e===t;const n=new Set(i),s=Object.keys(e),r=new Set(Object.keys(t));for(const o of s)if(r.delete(o),!n.has(o)&&(!(o in t)||e[o]!==t[o]))return!1;for(const o of Array.from(r))if(!n.has(o))return!1;return!0}function De(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function zi(e,t){const i=e?.theme??U,n=t?.theme??U,s=qi(e),r=qi(t);return De(i,n)&&Ze(e,t,["theme","parseDiffOptions"])&&Ze(s,r)}function qi(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Ut(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Hr({scrollTop:e,scrollHeight:t,height:i,fitPerfectly:n=!1,fitPerfectlyOverscroll:s=0,overscrollSize:r}){const o=i+r*2,l=n?i+s*2:o;if(t=Math.max(t,l),o>=t||n){const d=Math.max(e-s,0),c=Math.min(e+l,t);return{top:d,bottom:Math.max(c,d)}}let a=e+i/2-o/2,h=a+o;return a<0&&(a=0),h>t&&(h=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(h,t),a))}}function Ir(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ge(e){return{type:"text",value:e}}function I({tagName:e,children:t=[],properties:i={}}){return{type:"element",tagName:e,properties:i,children:t}}function Vt({name:e,width:t=16,height:i=16,properties:n}){return I({tagName:"svg",properties:{width:t,height:i,viewBox:"0 0 16 16",...n},children:[I({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function Mr(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 Ge(e){return I({tagName:"div",properties:{"data-gutter":""},children:e})}function Jn(e,t,i,n={}){return I({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":i,...n},children:t!=null?[I({tagName:"span",properties:{"data-line-number-content":""},children:[ge(`${t}`)]})]:void 0})}function te(e,t,i){return I({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":i,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${i};`:`grid-row: span ${i};min-height:calc(${i} * 1lh);`}})}function Dr(){return I({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[Vt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function Pr(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function vt(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 Zn=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(),ct(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:i=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),i?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 i=!(e===this.selectedRange||Ut(e??void 0,this.selectedRange??void 0)),n=t?.lineNumberOnly??!1,s=t?.activeLineSide!==this.selectedRangeHighlightSide||n!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!i&&!s||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=n,this.renderSelection(),this.placeUtility(),i&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:i}={}){const n=e!==this.editorActiveLine,s=i!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!n&&!s||(this.editorActiveLine=e,this.editorActiveLineSide=i,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:i,onLineNumberClick:n,onTokenClick:s,onMergeConflictActionClick:r}=this.options;t==null&&i==null&&n==null&&r==null&&s==null||this.options.onGutterUtilityClick!=null&&vt(e.composedPath())||(ye(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:i,onLineLeave:n,onTokenEnter:s,onTokenLeave:r,enableGutterUtility:o=!1}=this.options;t==="disabled"&&!o&&i==null&&n==null&&s==null&&r==null||(ye(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(ye(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){ye(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:i}=this.options,n=t.composedPath();ye(i,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:n});const s=this.resolvePointerTarget(n);ye(i,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",s);const{onLineClick:r,onLineNumberClick:o,onLineEnter:l,onLineLeave:a,onTokenClick:h,onTokenEnter:d,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=ni(s)&&this.hoveredLine?.lineElement===s.lineElement;Dt(s)&&this.hoveredToken?.tokenElement===s.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),Dt(s)&&(this.setHoveredToken(this.toTokenEventBaseProps(s)),d?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),ni(s)?(this.setHoveredLine(this.toEventBaseProps(s)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(s==null)break;if(zr(s)&&f!=null){f(s);break}if(Or(s)&&u!=null){u(s.hunkIndex,s.all||t.shiftKey?"both":s.direction,s.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!ni(s))break;Dt(s)&&h!=null&&h(this.toTokenEventBaseProps(s),t);const g=this.toEventBaseProps(s);o!=null&&s.numberColumn?o({...g,event:t}):r?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:i="disabled",onLineClick:n,onLineNumberClick:s,onLineEnter:r,onLineLeave:o,onTokenClick:l,onTokenEnter:a,onTokenLeave:h,onHunkExpand:d,onMergeConflictActionClick:c,enableGutterUtility:u=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,p=g!=null,m=i!=="disabled"||n!=null||s!=null||r!=null||o!=null||l!=null||a!=null||h!=null||d!=null||c!=null||u||f||p;m&&!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,ye(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const k=[];return(t==="both"||t==="click")&&(n!=null&&k.push("onLineClick"),s!=null&&k.push("onLineNumberClick"),d!=null&&k.push("expandable hunk separators"),c!=null&&k.push("merge conflict actions")),k})()),ye(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),ye(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!m&&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 y=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",v=this.pointerSession.mode==="gutterSelecting";(!f&&y||!p&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:i=!1}=this.options,n=e!=null,s=t!=null||i;n&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!n&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),s&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!s&&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();vt(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 i=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(i==null)return;const{pre:n}=this;if(n==null)return;const{lineNumber:s,eventSide:r,lineIndex:o}=i;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,n.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?o>=l.start:o<=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(s,r,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===s&&this.selectedRange?.end===s){const l={lineNumber:s,side:r};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:s,side:r},this.updateSelection(s,r,!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 i=this.currentSelectionEnds(),n=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),s=i?.top??n;n==null||s==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:s,current:n},this.selectionAnchor={lineNumber:s.lineNumber,side:s.side},this.updateSelection(n.lineNumber,n.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 i={lineNumber:t.lineNumber,side:t.eventSide};if(Pr(this.pointerSession.pending,i))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:i}=this;if(e.pointerId!==i.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});n!=null&&(i.current=n,this.updateSelection(n.lineNumber,n.side));const s=this.buildSelectedLineRange(i.anchor,i.current);t?.({...s}),this.selectionAnchor=void 0,this.notifySelectionEnd(s),this.notifySelectionCommitted(s),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=X(Dr());const i=t.firstElementChild;if(!(i instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");i.remove(),this.gutterUtilityButton=i}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);ot(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},i={lineNumber:e.end,side:e.endSide??e.side},n=this.selectionPointRowIndex(t),s=this.selectionPointRowIndex(i);if(!(n==null||s==null))return n>s?{top:i,bottom:t}:{top:t,bottom:i}}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 i=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,n=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${i}"]`);for(const s of n){if(!(s instanceof HTMLElement))continue;const r=this.resolvePointerTarget(it(s));if(ot(r)&&!(this.mode==="diff"&&e.side!=null&&r.side!==e.side))return r}}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 i=this.resolvePointerTarget(e);if(ot(i)&&!(t&&!i.numberColumn)&&i.splitLineIndex!=null)return{lineIndex:i.splitLineIndex,lineNumber:i.lineNumber,eventSide:this.mode==="diff"?i.side:void 0}}resolveSelectionInfo(e,t){const i=this.resolveSelectionPath(e,t);return i!=null?this.selectionInfoFromPath(i,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(ot(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const i=this.resolveSelectionPath(e,t);return i!=null?this.selectionPointFromPath(i):void 0}resolveSelectionPath(e,t){const i=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),i);case"coordinates-first":{const n=this.pathFromCoordinates(e,i);return n!==void 0?n??void 0:this.pathFromEventPath(e.composedPath(),i)}}}pathFromCoordinates(e,t){const i=this.hitTest(e);if(i!==void 0)return i===null?null:this.pathFromElement(i,t)??null}pathFromEventPath(e,t){if(!(t&&vt(e))){for(const i of e)if(i instanceof Element)return this.pathFromElement(i,t)}}pathFromElement(e,t){const i=it(e);if(t&&vt(i))return;const n=Br(e);return n!=null?it(n):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=_r(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute("data-line")||t.hasAttribute("data-column-number")))return it(t);const i=Vr(Ur(e));if(i==null)return;const n=this.targetForSelectionPoint(i);return n!=null?it(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),i=Gi(t)?t:Gi(document)?document:void 0;if(i!=null)return i.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:i}=this.options;return i!=null?i(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,i=!0){const n=this.getCurrentSelectionRange();let s;if(e==null)s=null;else{const r=this.selectionAnchor?.side??t,o=this.selectionAnchor?.lineNumber??e;s=this.buildSelectionRange(o,e,r,t)}Ut(n??void 0,s??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=s:(this.selectedRange=s,Oi(this.renderSelection)),this.placeUtility(),i&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const i=this.getLineIndex(e.start,e.side),n=this.getLineIndex(e.end,e.endSide??e.side);return i!=null&&n!=null?{start:t?i[1]:i[0],end:t?n[1]:n[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,i){if(e.range==null)return;const n=this.getIndexesFromSelection(e.range,t);if(n==null)throw console.error({rowRange:n,range:e.range}),new Error(`InteractionManager.renderSelection: No valid ${i} rowRange`);return n}getLineRenderColumns(e,t,i,n){if(this.pre==null||t==null&&n==null)return[];const{children:s}=this.pre;if(s.length>2)throw console.error(s),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const r=[];for(const o of s){const l=o.hasAttribute("data-deletions")?"deletions":o.hasAttribute("data-additions")?"additions":void 0,a=e!=null&&t!=null&&(e.highlightSide==null||l==null||e.highlightSide===l),h=i!=null&&n!=null&&(i.highlightSide==null||l==null||i.highlightSide===l);if(!a&&!h)continue;const[d,c]=o.children;if(!(d instanceof HTMLElement)||!(c instanceof HTMLElement))throw new Error("InteractionManager.renderSelection: missing gutter or content element");if(c.children.length!==d.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");r.push({content:c,gutter:d,renderEditorActiveLine:h,renderSelectedLines:a})}return r}renderSelection=()=>{ct(this.renderSelection);const e=this.getSelectionRenderState();if(this.pre==null)return;const{editorActiveLine:t,selectedLines:i}=e,n=!ji(this.renderedSelectedLinesState,i),s=!ji(this.renderedEditorActiveLineState,t);if(!n&&!s)return;n&&(this.renderedSelectedLinesState=void 0),s&&(this.renderedEditorActiveLineState=void 0);const r=this.pre.getAttribute("data-diff-type")==="split",o=n?this.resolveLineRenderRange(i,r,"selected-lines"):void 0,l=s?this.resolveLineRenderRange(t,r,"editor-active-line"):void 0,a=this.getLineRenderColumns(n?i:void 0,o,s?t:void 0,l),h=i.range==null||a.some(p=>p.renderSelectedLines),d=t.range==null||a.some(p=>p.renderEditorActiveLine);if(n)for(const p of this.pre.querySelectorAll("[data-selected-line]"))p.removeAttribute("data-selected-line");if(s)for(const p of this.pre.querySelectorAll("[data-editor-active-line]"))p.removeAttribute("data-editor-active-line");const c=o==null?void 0:Math.min(o.start,o.end),u=o==null?void 0:Math.max(o.start,o.end),f=c===u,g=l?.start;for(const p of a){const{content:m,gutter:y,renderEditorActiveLine:v,renderSelectedLines:k}=p,x=Math.max(k?u??-1/0:-1/0,v?g??-1/0:-1/0),b=m.children.length;for(let C=0;Cx)break;if(w!=null){if(k&&c!=null&&u!=null&&w>=c&&w<=u){let E=f?"single":w===c?"first":w===u?"last":"";L.setAttribute("data-selected-line",E),i.lineNumberOnly||(S.setAttribute("data-selected-line",E),L.nextSibling instanceof HTMLElement&&S.nextSibling instanceof HTMLElement&&(S.nextSibling.hasAttribute("data-line-annotation")||S.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(f?(E="last",S.setAttribute("data-selected-line","first")):w===c?E="":w===u&&S.setAttribute("data-selected-line",""),S.nextSibling.setAttribute("data-selected-line",E),L.nextSibling.setAttribute("data-selected-line",E)))}v&&w===g&&(L.setAttribute("data-editor-active-line",""),t.lineNumberOnly||S.setAttribute("data-editor-active-line",""))}}}n&&h&&(this.renderedSelectedLinesState=i),s&&d&&(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:i,side:n,tokenElement:s,tokenText:r}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:i,tokenElement:s,tokenText:r}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:i,side:n,tokenElement:s,tokenText:r}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,i,n){return{start:e,end:t,...i!=null?{side:i}:{},...i!==n&&n!=null?{endSide:n}:{}}}resolvePointerTarget(e){let t=!1,i,n,s,r,o,l,a,h,d,c;for(const f of e){if(!(f instanceof HTMLElement))continue;if(c==null&&f.hasAttribute("data-merge-conflict-action")){const y=f.getAttribute("data-merge-conflict-action")??void 0,v=f.getAttribute("data-merge-conflict-conflict-index")??void 0,k=v!=null?Number.parseInt(v,10):NaN;Nr(y)&&Number.isFinite(k)&&(c={kind:"merge-conflict-action",resolution:y,conflictIndex:k})}if(l==null&&f.hasAttribute("data-char")){l=f;const y=f.getAttribute("data-char");if(y!=null){const v=Number.parseInt(y,10);if(!Number.isNaN(v)){const k=f.textContent??"",x=v+k.length;(k.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(a={tokenElement:l,lineCharStart:v,lineCharEnd:x,tokenText:k});continue}}}const g=o==null?f.getAttribute("data-column-number")??void 0:void 0;if(g!=null){o=f,d=Number.parseInt(g,10),t=!0,i=Yi(f),r=f.getAttribute("data-line-index")??void 0;continue}const p=s==null?f.getAttribute("data-line")??void 0:void 0;if(p!=null){s=f,d=Number.parseInt(p,10),i=Yi(f),r=f.getAttribute("data-line-index")??void 0;continue}if(h==null&&(f.hasAttribute("data-expand-button")||f.hasAttribute("data-unmodified-lines"))){h={hunkIndex:void 0,direction:f.hasAttribute("data-expand-up")?"up":f.hasAttribute("data-expand-down")?"down":"both",all:f.hasAttribute("data-expand-all-button")};continue}const m=h!=null?f.getAttribute("data-expand-index")??void 0:void 0;if(h!=null&&m!=null){const y=Number.parseInt(m,10);Number.isNaN(y)||(h.hunkIndex=y);continue}if(n==null&&f.hasAttribute("data-code")){n=f;break}}if(c!=null)return c;if(h?.hunkIndex!=null)return{type:"line-info",hunkIndex:h.hunkIndex,direction:h.direction,all:h.all};if(s??=r!=null?$i(n,`[data-line][data-line-index="${r}"]`):void 0,o??=r!=null?$i(n,`[data-column-number][data-line-index="${r}"]`):void 0,n==null||s==null||o==null||i==null||d==null||Number.isNaN(d))return;const u=this.parseLineIndex(s,this.isSplitDiff());return a!=null?this.mode==="file"?{kind:"token",lineType:i,lineElement:s,lineNumber:d,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:u,...a}:{kind:"token",lineType:i,lineElement:s,lineNumber:d,numberColumn:t,numberElement:o,side:Ki(i,n),splitLineIndex:u,...a}:this.mode==="file"?{kind:"line",lineType:i,lineElement:s,lineNumber:d,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:u}:{kind:"line",lineType:i,lineElement:s,lineNumber:d,numberColumn:t,numberElement:o,side:Ki(i,n),splitLineIndex:u}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const i=(e.getAttribute("data-line-index")??"").split(",").map(n=>Number.parseInt(n,10)).filter(n=>!Number.isNaN(n));if(t&&i.length===2)return i[1];if(!t)return i[0]}};function Wt({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:i,onGutterUtilityClick:n,onLineClick:s,onLineEnter:r,onLineLeave:o,onLineNumberClick:l,onTokenClick:a,onTokenEnter:h,onTokenLeave:d,renderGutterUtility:c,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:p,onLineSelectionStart:m,onLineSelectionChange:y,onLineSelectionEnd:v},k,x,b){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Fr({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:n}),usesCustomGutterUtility:c!=null,lineHoverHighlight:i,onGutterUtilityClick:n,onHunkExpand:k,onMergeConflictActionClick:b,onLineClick:s,onLineEnter:r,onLineLeave:o,onLineNumberClick:l,onTokenClick:a,onTokenEnter:h,onTokenLeave:d,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:p,onLineSelectionStart:m,onLineSelectionChange:y,onLineSelectionEnd:v,getLineIndex:x}}function Fr({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:i}){if(i!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function ot(e){return e!=null&&"kind"in e&&e.kind==="line"}function Dt(e){return e!=null&&"kind"in e&&e.kind==="token"}function ni(e){return ot(e)||Dt(e)}function Or(e){return"type"in e&&e.type==="line-info"}function zr(e){return"kind"in e&&e.kind==="merge-conflict-action"}function Nr(e){return e==="current"||e==="incoming"||e==="both"}function $i(e,t){const i=e?.querySelector(t);return i instanceof HTMLElement?i:void 0}function it(e){const t=[];let i=e;for(;i!=null;)t.push(i),i=i.parentNode;return t}function Br(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const i=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(i instanceof HTMLElement))return;const n=i.previousElementSibling;return n instanceof HTMLElement&&(n.hasAttribute("data-line")||n.hasAttribute("data-column-number"))?n:void 0}function _r(e){const t=e.closest('[slot^="annotation-"]'),i=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName==="SLOT"?e:void 0)?.closest("[data-line-annotation]");return i instanceof HTMLElement?i:void 0}function Ur(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const i=e.getAttribute("name")??void 0;return i!=null&&i.startsWith("annotation-")?i:void 0}}function Vr(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const i=Number.parseInt(t[2],10);if(!(!Number.isFinite(i)||i<=0))return{lineNumber:i,side:t[1]}}function Gi(e){return e!=null&&typeof e.elementFromPoint=="function"}function Wr(e,t){return e===t||Ut(e??void 0,t??void 0)}function ji(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&Wr(e?.range??null,t.range)}function Ki(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function Yi(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 ye(e="none",t,...i){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return}console.log(...i)}var es=class ke{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=ke.resizeObserver??new ResizeObserver(ke.handleSharedResizeEntries);return ke.resizeObserver=t,t}static handleSharedResizeEntries(t){const i=new Map;for(const n of t){const s=ke.managersByElement.get(n.target);if(s==null)continue;const r=i.get(s);r==null?i.set(s,[n]):r.push(n)}for(const[n,s]of i)n.handleResizeEntries(s)}observedNodes=new Map;setup(t,{disableAnnotations:i,columnVariables:n="apply"}){const s=new Set,r=n==="apply";let o=0;const l=new Map(this.observedNodes);this.observedNodes.clear();for(const a of t.children){if(o===2)break;const h=(()=>{if(a instanceof HTMLElement&&a.tagName==="CODE")return a})();if(h==null)continue;o++;let d=l.get(h);if(d!=null&&d.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let c=h.firstElementChild;c instanceof HTMLElement||(c=null),d!=null?(this.observedNodes.set(h,d),l.delete(h),d.numberElement!==c?(d.numberElement!=null&&(this.unobserve(d.numberElement),l.delete(d.numberElement)),c!=null&&(this.observe(c),l.delete(c),this.observedNodes.set(c,d)),d.numberElement=c,d.numberWidth=0):d.numberElement!=null?(l.delete(d.numberElement),this.observedNodes.set(d.numberElement,d)):d.numberWidth=0,Gr(d,r)):(d={type:"code",codeElement:h,numberElement:c,codeWidth:"auto",numberWidth:0,applyColumnVariables:r},this.observedNodes.set(h,d),this.observe(h),c!=null&&(this.observedNodes.set(c,d),this.observe(c)))}if(o>1&&!i){const a=t.querySelectorAll('[data-line-annotation*=","]'),h=new Map;for(const d of a){if(!(d instanceof HTMLElement))continue;const c=d.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(c)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:c,element:d});continue}let u=h.get(c);u==null&&(u=[],h.set(c,u)),u.push(d)}for(const[d,c]of h){if(c.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",d,c);continue}const[u,f]=c,g=u.firstElementChild,p=f.firstElementChild;if(!(u instanceof HTMLElement)||!(f instanceof HTMLElement)||!(g instanceof HTMLElement)||!(p instanceof HTMLElement))continue;let m=l.get(g);if(m!=null){this.observedNodes.set(g,m),this.observedNodes.set(p,m),l.delete(g),l.delete(p);continue}const y=g.getBoundingClientRect().height,v=p.getBoundingClientRect().height;m={type:"annotations",column1:{container:u,child:g,childHeight:y},column2:{container:f,child:p,childHeight:v},currentHeight:"auto"},s.add({child1:g,child2:p,item:m,newHeight:Math.max(y,v)})}for(const d of s)this.applyNewHeight(d.item,d.newHeight),this.observedNodes.set(d.child1,d.item),this.observedNodes.set(d.child2,d.item),this.observe(d.child1),this.observe(d.child2);s.clear()}for(const[a,h]of l)this.unobserve(a),h.type==="code"?jr(h):Kr(h);l.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:i}=ke,n=i.get(t);if(n!==this){if(n!=null&&n!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");i.set(t,this),ke.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:i,resizeObserver:n}=ke,s=i.get(t);if(s!=null){if(s!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");i.delete(t),n?.unobserve(t),n!=null&&i.size===0&&(n.disconnect(),ke.resizeObserver=void 0)}}handleResizeEntries(t){const i=new Map,n=new Set;for(const s of t){const{target:r,borderBoxSize:o,contentBoxSize:l}=s;if(!(r instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",s);continue}const a=this.observedNodes.get(r);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",s);continue}if(a.type==="annotations"){const h=(()=>{if(r===a.column1.child)return a.column1;if(r===a.column2.child)return a.column2})();if(h==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:r});continue}h.childHeight=o[0].blockSize,n.add(a)}else if(a.type==="code"){const h=i.get(a)??{},d=l[0].inlineSize;r===a.codeElement?h.codeInlineSize=d:r===a.numberElement&&(h.numberInlineSize=d),i.set(a,h)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(i),i.clear()}applyAnnotationUpdates(t){for(const i of t)this.applyNewHeight(i,Math.max(i.column1.childHeight,i.column2.childHeight))}applyColumnUpdates=t=>{for(const[i,n]of t){const s=n.codeInlineSize!=null?qr(n.codeInlineSize):i.codeWidth,r=n.numberInlineSize!=null?$r(n.numberInlineSize):i.numberWidth,o=s!==i.codeWidth,l=r!==i.numberWidth;!o&&!l||(i.codeWidth=s,i.numberWidth=r,i.applyColumnVariables&&ts(i,{codeWidthChanged:o,numberWidthChanged:l}))}};applyNewHeight(t,i){i!==t.currentHeight&&(t.currentHeight=Math.max(i,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 qr(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function $r(e){return Math.max(Math.ceil(e),0)}function Gr(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?ts(e,{codeWidthChanged:!0,numberWidthChanged:!0}):is(e))}function ts(e,{codeWidthChanged:t,numberWidthChanged:i}){const{codeElement:n,codeWidth:s,numberWidth:r}=e;if(t&&n.style.setProperty("--diffs-column-width",`${typeof s=="number"?`${s}px`:"auto"}`),i&&n.style.setProperty("--diffs-column-number-width",`${r===0?"auto":`${r}px`}`),t||i&&s!=="auto"){const o=typeof s=="number"?Math.max(s-r,0):0;n.style.setProperty("--diffs-column-content-width",`${o>0?`${o}px`:"auto"}`)}}function is(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 jr(e){e.codeElement.isConnected&&is(e)}function Kr(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 vi(e){return ue.hasResolvedThemes(e)}function de(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function Jt(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 Si(e){return I({tagName:"div",children:[I({tagName:"div",children:e.annotations?.map(t=>I({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Yr(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 ns({fileOrDiff:e,mode:t,stickyHeader:i}){const n="type"in e?e:void 0,s={"data-diffs-header":t,"data-change-type":n?.type,"data-sticky":i?"":void 0};return I({tagName:"div",children:[t==="custom"?I({tagName:"slot",properties:{name:Pi}}):Xr({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:n?.type??"file"}),...t==="custom"?[]:[Qr(n)]],properties:s})}function Xr({name:e,prevName:t,iconType:i}){const n=[I({tagName:"slot",properties:{name:Ii}}),Vt({name:Yr(i),properties:{"data-change-icon":i}})];return t!=null&&(n.push(I({tagName:"div",children:[I({tagName:"bdi",children:[ge(t)]})],properties:{"data-prev-name":""}})),n.push(Vt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),n.push(I({tagName:"div",children:[I({tagName:"bdi",children:[ge(e)]})],properties:{"data-title":""}})),n.push(I({tagName:"slot",properties:{name:Mi}})),I({tagName:"div",children:n,properties:{"data-header-content":""}})}function Qr(e){const t=[];if(e!=null){let i=0,n=0;for(const s of e.hunks)i+=s.additionLines,n+=s.deletionLines;(n>0||i===0)&&t.push(I({tagName:"span",children:[ge(`-${n}`)],properties:{"data-deletions-count":""}})),(i>0||n===0)&&t.push(I({tagName:"span",children:[ge(`+${i}`)],properties:{"data-additions-count":""}}))}return t.push(I({tagName:"slot",properties:{name:Di}})),I({tagName:"div",children:t,properties:{"data-metadata":""}})}function ss(e){return I({tagName:"pre",properties:Jr(e)})}function Jr({diffIndicators:e,disableBackground:t,disableLineNumbers:i,overflow:n,split:s,totalLines:r,type:o,customProperties:l}){return{...l,"data-diff":o==="diff"?"":void 0,"data-file":o==="file"?"":void 0,"data-diff-type":o==="diff"?s?"split":"single":void 0,"data-overflow":n,"data-disable-line-numbers":i?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${r}`.length}ch;`}}const Oe=new Map;let Zr=0;const qe={"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",odin:"odin",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",BUCK:"python",BUILD:"python",PACKAGE:"python",WORKSPACE:"python",Tiltfile:"python",bazel:"python",bxl:"python",bzl:"python",bzlmod:"python",star:"python",sky:"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 $(e){const t=Xi(e);if(t!=null)return t;const i=e.split(/[/\\]/).pop()??e;return i===e?"text":Xi(i)??"text"}function Xi(e){if(Oe.has(e))return Oe.get(e)??"text";if(Object.hasOwn(qe,e))return qe[e]??null;const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Oe.has(t[1]))return Oe.get(t[1])??"text";if(Object.hasOwn(qe,t[1]))return qe[t[1]]??"text"}const i=e.match(/\.([^.]+)$/)?.[1]??"";return Oe.has(i)?Oe.get(i)??"text":Object.hasOwn(qe,i)?qe[i]??"text":null}function Qi(){return Zr}function Ji(){return Object.fromEntries(Oe)}function rs(e,{theme:t,preferredHighlighter:i="shiki-js"}){return{langs:Array.isArray(e)?e:[e??"text"],themes:Ee(t),preferredHighlighter:i}}function pe(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function qt(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function eo(e,t,i){const n=typeof i.lineInfo=="function"?i.lineInfo(t):i.lineInfo[t-1];if(n==null){const s=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(s,{node:e,line:t,state:i}),new Error(s)}return e.tagName="div",e.properties["data-line"]=n.lineNumber,e.properties["data-alt-line"]=n.altLineNumber,e.properties["data-line-type"]=n.type,e.properties["data-line-index"]=n.lineIndex,e.children.length===0&&e.children.push(ge(` -`)),e}const St=Symbol("no-token"),si=Symbol("multiple-tokens");function os(e){const t=to(e);if(t!=null)return t;let i=St;const n=[];let s=[],r;const o=()=>{if(s.length===0||r==null){s=[],r=void 0;return}if(s.length===1){const a=s[0];if(a?.type==="element"){io(a,r);for(const h of a.children)Pt(h)}else Pt(a);n.push(a),s=[],r=void 0;return}for(const a of s)Pt(a);n.push(I({tagName:"span",properties:{"data-char":r},children:s})),s=[],r=void 0},l=a=>{if(a!==St){if(a===si){i=si;return}if(i===St){i=a;return}i!==a&&(i=si)}};for(const a of e.children){const h=a.type==="element"?os(a):St;if(l(h),typeof h!="number"){o(),n.push(a);continue}r!=null&&r!==h&&o(),r??=h,s.push(a)}return o(),e.children=n,i}function to(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function Pt(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)Pt(t)}}function io(e,t){e.properties["data-char"]=t}function as(e=!1,t=!1){const i={lineInfo:[]},n=[{line(s){return delete s.properties.class,s},pre(s){const r=Mr(s),o=[];if(r!=null){let l=1;for(const a of r.children)a.type==="element"&&(e&&os(a),o.push(eo(a,l,i)),l++);r.children=o}return s},...e?{tokens(s){for(const r of s){let o=0;for(const l of r){const a=l;a.__lineChar??=o,o+=l.content.length}}},preprocess(s,r){r.mergeWhitespaces="never"},span(s,r,o,l,a){if(a?.offset!=null&&a.content!=null){const h=a.__lineChar;return h!=null&&(s.properties["data-char"]=h),s}return s}}:null}];return t&&n.push(no,Zi),e&&n.push({line:s=>(s.type==="element"&&s.children.length===0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]}),s)}),{state:i,transformers:n,toClass:Zi}}const Zi=ir({classPrefix:"hl-"}),no={name:"token-style-normalizer",tokens(e){for(const t of e)for(const i of t){if(i.htmlStyle!=null)continue;const n={};i.color!=null&&(n.color=i.color),i.bgColor!=null&&(n["background-color"]=i.bgColor),i.fontStyle!=null&&i.fontStyle!==0&&((i.fontStyle&1)!==0&&(n["font-style"]="italic"),(i.fontStyle&2)!==0&&(n["font-weight"]="bold"),(i.fontStyle&4)!==0&&(n["text-decoration"]="underline")),Object.keys(n).length>0&&(i.htmlStyle=n)}}};function ie(e){return`--${e==="token"?"diffs-token":"diffs"}-`}function ls({theme:e=U,highlighter:t,prefix:i}){let n="";if(typeof e=="string"){const s=t.getTheme(e),r=ti(s);n+=`color:${r.fg};`,n+=`background-color:${r.bg};`,n+=`${ie("global")}fg:${r.fg};`,n+=`${ie("global")}bg:${r.bg};`,n+=ri(s,i)}else{let s=t.getTheme(e.dark),r=ti(s);n+=`${ie("global")}dark:${r.fg};`,n+=`${ie("global")}dark-bg:${r.bg};`,n+=ri(s,"dark"),s=t.getTheme(e.light),r=ti(s),n+=`${ie("global")}light:${r.fg};`,n+=`${ie("global")}light-bg:${r.bg};`,n+=ri(s,"light")}return n}function ri(e,t){t=t!=null?`${t}-`:"";let i="";const n=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];n!=null&&(i+=`${ie("global")}${t}addition-color:${n};`);const s=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];s!=null&&(i+=`${ie("global")}${t}deletion-color:${s};`);const r=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return r!=null&&(i+=`${ie("global")}${t}modified-color:${r};`),i}function yi(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")}const en=10,tn=13,so=4,ro=40;function oo(e){const t=[0];let i=e.indexOf("\r"),n=e.indexOf(` +import{t as Li,c as xr,d as Er,a as Rr,L as en,I as ze,E as tn,b as Tr,e as Ar}from"./shiki-core.mjs";import{_ as Ee}from"./preload-helper.mjs";import{c as Ir,n as Hr}from"./pierre-theming.mjs";const ss="diffs-container",Mr=(()=>{try{return!1}catch{return!1}})(),Dr=/(?=^From [a-f0-9]+ .+$)/m,rs=/(?=^diff --git)/gm,Fr=new RegExp("(?<=\\n)"),Pr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Or=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,_i="header-prefix",Bi="header-filename-suffix",Vi="header-metadata",Ui="header-custom",q={dark:"pierre-dark",light:"pierre-light"},zr="data-theme-css",Nr="data-unsafe-css",_r="data-diffs-scrollbar-measure",Br="data-diffs-code-view-header",Vr="data-diffs-code-view-footer",os="--diffs-scrollbar-gutter-measured",Ur=1e5,Wi={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},st={...Wi,hunkLineCount:1},Wr={paddingTop:8,paddingBottom:8,gap:8},$r={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},qr=Object.freeze({fromStart:0,fromEnd:0}),jt={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},as=Object.freeze([]),ls={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};let De,wi=0;var ve=class extends Error{constructor(){super("Highlighter is disposed"),this.name="HighlighterDisposedError"}};function Gr(){return De}function qe(e){return e??De??"shiki-js"}function jr(e){if(De!=null&&De!==e)throw new Error(`Cannot load the "${e}" highlighter while "${De}" is in use. Only one highlighter type can be active at a time; dispose every "${De}" instance (disposeHighlighter() disposes the shared one) before switching.`)}function ds(e){jr(e),De=e,wi++}function hs(){wi--,wi===0&&(De=void 0)}const Ue=new Map,Lt=new Map,cs=new Map,us=new Set;function fe(e=q){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function fs(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function $i(e){let t;return()=>t??=e().then(i=>(t=i,i),i=>{throw t=void 0,i})}const Kr=new Map,nn=new Map,Yr=$i(()=>Ee(()=>import("./pierre-highlights.mjs").then(e=>e.l),[])),Xr=$i(()=>Ee(()=>import("./pierre-theming.mjs").then(e=>e.t),[])),Qr=$i(()=>Ee(()=>import("./shiki-core.mjs").then(e=>e.f),[])),Zr=[["editor.lineHighlightBackground","editor.active_line.background"],["editor.selectionBackground","element.selected"],["editor.findMatchBackground","search.match_background"],["editor.findMatchHighlightBackground","search.match_background"],["editorBracketMatch.background","editor.document_highlight.bracket_background"],["editorError.foreground","error"],["editorWarning.foreground","warning"],["editorInfo.foreground","info"],["editorHint.foreground","hint"],["gitDecoration.addedResourceForeground","created","terminal.ansi.green"],["gitDecoration.deletedResourceForeground","deleted","terminal.ansi.red"],["gitDecoration.modifiedResourceForeground","modified","terminal.ansi.blue"]];function sn(e,t){const i="themes"in t?t.themes[0]:t;if(i==null)throw new Error(`Theme "${e}" is an empty Zed theme family.`);const n={...i,name:e},s={};for(const[a,l]of Object.entries(n.style))typeof l=="string"&&(s[a]=l);const r=n.style.players?.[0];r?.cursor!=null&&(s["editorCursor.foreground"]??=r.cursor),r?.selection!=null&&(s["editor.selectionBackground"]??=r.selection);for(const[a,...l]of Zr){if(s[a]!=null)continue;const d=l.find(h=>s[h]!=null);d!=null&&(s[a]=s[d])}if(n.cssVariables===!0)s["editor.foreground"]="var(--hls-foreground)",s["editor.background"]="var(--hls-background)";else if(typeof n.cssVariables=="object"){s["editor.foreground"]??=s.text??s.foreground??"foreground",s["editor.background"]??=s.background??"background";const{prefix:a="--hls-",defaults:l}=n.cssVariables;for(const[d,h]of Object.entries(s)){const c=l?.[h];s[d]=`var(${a}${h}${c?`, ${c}`:""})`}}const o=n.appearance==="light"?"light":"dark";return{name:e,type:o,colors:s,zed:n,fg:s["editor.foreground"]??s.text??s.foreground??(o==="light"?"#333333":"#bbbbbb"),bg:s["editor.background"]??s.background??(o==="light"?"#ffffff":"#1e1e1e")}}function bt(e){let t=nn.get(e);return t!=null||(t=Ir({fallbackLoader:async i=>{if(typeof __DIFFS_WORKER__<"u"?__DIFFS_WORKER__:fs())throw new Error(`Theme "${i}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedThemes parameter.`);const n=Kr.get(i);if(e==="highlights"){const s=n?.zed??n?.diffs;if(s!=null){const l=await s(),d="default"in l?l.default:l;if("zed"in d&&d.zed!=null)return d;if("style"in d||"themes"in d)return sn(i,d);throw new Error(`Theme "${i}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`)}const r=Yr(),{themes:o}=r instanceof Promise?await r:r,a=o[i];if(a!=null)return sn(i,(await a()).default);if(n?.textmate!=null)throw new Error(`Theme "${i}" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`)}else{const s=n?.textmate??n?.diffs;let r;if(s!=null){const h=await s();r="default"in h?h.default:h}else{const h=Xr(),{themes:c}=h instanceof Promise?await h:h,u=c.getTheme(i);if(u==null&&n?.zed!=null)throw new Error(`Theme "${i}" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`);if(u==null)throw new Error(`No valid theme loader registered for "${i}"`);const f=await u.load();r="default"in f?f.default:f}if("style"in r||"themes"in r)throw new Error(`Theme "${i}" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`);const o=Qr(),{normalizeTheme:a,createCssVariablesTheme:l}=o instanceof Promise?await o:o;if("cssVariables"in r&&r.cssVariables!=null)return{...r,textmate:a(l(r.cssVariables))};if("textmate"in r&&r.textmate!=null)return{...r,textmate:a(r.textmate)};const d=a(r);return{name:d.name,type:d.type,fg:d.fg,bg:d.bg,colors:d.colors,textmate:d}}throw new Error(`No valid theme loader registered for "${i}"`)},normalizeTheme:(i,n)=>{if(i.name!==n)throw new Error(`resolvedTheme: themeName: ${n} does not match theme.name: ${i.name}`);return i}}),nn.set(e,t)),t}function ft(e,t=qe()){return typeof t!="string"&&t.isDisposed?!1:(typeof t=="string"?bt(t):t.themeResolver).hasResolvedThemes(fe(e))}let pe;async function Jr(e){const t=qe(e);ds(t);try{if(t==="highlights"){const{HighlightsHighlighter:n}=await Ee(async()=>{const{HighlightsHighlighter:s}=await import("./highlights.mjs");return{HighlightsHighlighter:s}},[]);return new n}const{ShikiHighlighter:i}=await Ee(async()=>{const{ShikiHighlighter:n}=await Promise.resolve().then(()=>lh);return{ShikiHighlighter:n}},void 0);return await i.create(t)}finally{hs()}}async function it({themes:e,langs:t,preferredHighlighter:i}){ps();const n=pe??=Jr(Gr()??i);let s;try{s=await n}catch(r){throw pe===n&&(pe=void 0),r}if(pe===n&&(pe=s),await Promise.all([s.themeResolver.resolveThemes(e),s.loadLanguages(t)]),s.isDisposed)throw new ve;return s}function ps(){pe!=null&&!("then"in pe)&&pe.isDisposed&&(pe=void 0)}function $({theme:e,lang:t,langs:i}={}){ps();const n=pe;if(!(n==null||"then"in n||e!=null&&!ft(e,n)||(t!=null||i!=null)&&!n.hasLoadedLanguages([...t!=null?[t]:[],...i??[]])))return n}async function eo(e){await it(e)}const Ze=new Set;let Je=null;function qi(e){Ze.add(e),Je??=requestAnimationFrame(gs)}function pt(e){Ze.delete(e)&&Ze.size===0&&Je!=null&&(cancelAnimationFrame(Je),Je=null)}function gs(e){const t=new Set(Ze);Ze.clear();for(const i of t)try{i(e)}catch(n){console.error(n)}Ze.size>0?Je=requestAnimationFrame(gs):Je=null}function tt(e,t,i){if(e===t||e==null||t==null)return e===t;const n=new Set(i),s=Object.keys(e),r=new Set(Object.keys(t));for(const o of s)if(r.delete(o),!n.has(o)&&(!(o in t)||e[o]!==t[o]))return!1;for(const o of Array.from(r))if(!n.has(o))return!1;return!0}function Fe(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function Gi(e,t){const i=e?.theme??q,n=t?.theme??q,s=rn(e),r=rn(t);return Fe(i,n)&&tt(e,t,["theme","parseDiffOptions"])&&tt(s,r)}function rn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function Kt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function to({scrollTop:e,scrollHeight:t,height:i,fitPerfectly:n=!1,fitPerfectlyOverscroll:s=0,overscrollSize:r}){const o=i+r*2,a=n?i+s*2:o;if(t=Math.max(t,a),o>=t||n){const h=Math.max(e-s,0),c=Math.min(e+a,t);return{top:h,bottom:Math.max(c,h)}}let l=e+i/2-o/2,d=l+o;return l<0&&(l=0),d>t&&(d=t),l=Math.floor(Math.max(l,0)),{top:l,bottom:Math.ceil(Math.max(Math.min(d,t),l))}}function io(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function me(e){return{type:"text",value:e}}function M({tagName:e,children:t=[],properties:i={}}){return{type:"element",tagName:e,properties:i,children:t}}function Yt({name:e,width:t=16,height:i=16,properties:n}){return M({tagName:"svg",properties:{width:t,height:i,viewBox:"0 0 16 16",...n},children:[M({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function Xe(e){return M({tagName:"div",properties:{"data-gutter":""},children:e})}function ms(e,t,i,n={}){return M({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":i,...n},children:t!=null?[M({tagName:"span",properties:{"data-line-number-content":""},children:[me(`${t}`)]})]:void 0})}function ie(e,t,i){return M({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":i,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${i};`:`grid-row: span ${i};min-height:calc(${i} * 1lh);`}})}function no(){return M({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[Yt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}const so=new Set(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"]),ro=new Set(["svg","template","script","style"]),oo={class:"class",className:"class",id:"id",role:"role",style:"style",tabIndex:"tabindex",tabindex:"tabindex",title:"title"},ao=/^data-[\w.:-]+$/,lo=/[<&]/g,ho=/[\0"&'`]/g,co={"<":"<","&":"&",'"':""","'":"'","`":"`","\0":"�"},uo=256;function Y(e){const t=new Map;return Array.isArray(e)?ji(e,t):vs(e,t)}function ji(e,t){let i="";for(const n of e)i+=vs(n,t);return i}function vs(e,t){switch(e.type){case"text":return ys(e.value);case"element":return fo(e,t);case"root":return ji(e.children,t);default:return Li(e)}}function fo(e,t){const{tagName:i}=e;if(i==="span"&&e.children.length===1&&e.children[0].type==="text"&&typeof e.properties?.style=="string"){let o=!0;for(const a in e.properties)if(a!=="style"&&e.properties[a]!=null){o=!1;break}if(o)return`${ys(e.children[0].value)}`}if(ro.has(i))return Li(e);const n=po(e.properties,t);if(n==null)return Li(e);const s=n===""?`<${i}>`:`<${i} ${n}>`,r=ji(e.children,t);return r===""&&so.has(i.toLowerCase())?s:`${s}${r}`}function Ss(e,t){let i=t.get(e);return i==null&&(i=`style="${bs(e)}"`,t.size{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:i,onLineNumberClick:n,onTokenClick:s,onMergeConflictActionClick:r}=this.options;t==null&&i==null&&n==null&&r==null&&s==null||this.options.onGutterUtilityClick!=null&&wt(e.composedPath())||(ye(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:i,onLineLeave:n,onTokenEnter:s,onTokenLeave:r,enableGutterUtility:o=!1}=this.options;t==="disabled"&&!o&&i==null&&n==null&&s==null&&r==null||(ye(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(ye(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){ye(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:i}=this.options,n=t.composedPath();ye(i,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:n});const s=this.resolvePointerTarget(n);ye(i,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",s);const{onLineClick:r,onLineNumberClick:o,onLineEnter:a,onLineLeave:l,onTokenClick:d,onTokenEnter:h,onTokenLeave:c,onHunkExpand:u,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=di(s)&&this.hoveredLine?.lineElement===s.lineElement;Vt(s)&&this.hoveredToken?.tokenElement===s.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),Vt(s)&&(this.setHoveredToken(this.toTokenEventBaseProps(s)),h?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(l?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),di(s)?(this.setHoveredLine(this.toEventBaseProps(s)),this.placeUtility(),a?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(s==null)break;if(So(s)&&f!=null){f(s);break}if(vo(s)&&u!=null){u(s.hunkIndex,s.all||t.shiftKey?"both":s.direction,s.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!di(s))break;Vt(s)&&d!=null&&d(this.toTokenEventBaseProps(s),t);const g=this.toEventBaseProps(s);o!=null&&s.numberColumn?o({...g,event:t}):r?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:i="disabled",onLineClick:n,onLineNumberClick:s,onLineEnter:r,onLineLeave:o,onTokenClick:a,onTokenEnter:l,onTokenLeave:d,onHunkExpand:h,onMergeConflictActionClick:c,enableGutterUtility:u=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,p=g!=null,m=i!=="disabled"||n!=null||s!=null||r!=null||o!=null||a!=null||l!=null||d!=null||h!=null||c!=null||u||f||p;m&&!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,ye(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const y=[];return(t==="both"||t==="click")&&(n!=null&&y.push("onLineClick"),s!=null&&y.push("onLineNumberClick"),h!=null&&y.push("expandable hunk separators"),c!=null&&y.push("merge conflict actions")),y})()),ye(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),ye(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!m&&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 v=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",k=this.pointerSession.mode==="gutterSelecting";(!f&&v||!p&&k)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:i=!1}=this.options,n=e!=null,s=t!=null||i;n&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!n&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),s&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!s&&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();wt(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 i=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(i==null)return;const{pre:n}=this;if(n==null)return;const{lineNumber:s,eventSide:r,lineIndex:o}=i;if(e.shiftKey&&this.selectedRange!=null){const a=this.getIndexesFromSelection(this.selectedRange,n.getAttribute("data-diff-type")==="split");if(a==null)return;const l=a.start<=a.end?o>=a.start:o<=a.end;this.selectionAnchor={lineNumber:l?this.selectedRange.start:this.selectedRange.end,side:l?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(s,r,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===s&&this.selectedRange?.end===s){const a={lineNumber:s,side:r};this.selectionAnchor=a,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:a,pending:a},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:s,side:r},this.updateSelection(s,r,!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 i=this.currentSelectionEnds(),n=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),s=i?.top??n;n==null||s==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:s,current:n},this.selectionAnchor={lineNumber:s.lineNumber,side:s.side},this.updateSelection(n.lineNumber,n.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 i={lineNumber:t.lineNumber,side:t.eventSide};if(go(this.pointerSession.pending,i))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:i}=this;if(e.pointerId!==i.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});n!=null&&(i.current=n,this.updateSelection(n.lineNumber,n.side));const s=this.buildSelectedLineRange(i.anchor,i.current);t?.({...s}),this.selectionAnchor=void 0,this.notifySelectionEnd(s),this.notifySelectionCommitted(s),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=Y(no());const i=t.firstElementChild;if(!(i instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");i.remove(),this.gutterUtilityButton=i}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);dt(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},i={lineNumber:e.end,side:e.endSide??e.side},n=this.selectionPointRowIndex(t),s=this.selectionPointRowIndex(i);if(!(n==null||s==null))return n>s?{top:i,bottom:t}:{top:t,bottom:i}}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 i=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,n=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${i}"]`);for(const s of n){if(!(s instanceof HTMLElement))continue;const r=this.resolvePointerTarget(rt(s));if(dt(r)&&!(this.mode==="diff"&&e.side!=null&&r.side!==e.side))return r}}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 i=this.resolvePointerTarget(e);if(dt(i)&&!(t&&!i.numberColumn)&&i.splitLineIndex!=null)return{lineIndex:i.splitLineIndex,lineNumber:i.lineNumber,eventSide:this.mode==="diff"?i.side:void 0}}resolveSelectionInfo(e,t){const i=this.resolveSelectionPath(e,t);return i!=null?this.selectionInfoFromPath(i,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(dt(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const i=this.resolveSelectionPath(e,t);return i!=null?this.selectionPointFromPath(i):void 0}resolveSelectionPath(e,t){const i=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),i);case"coordinates-first":{const n=this.pathFromCoordinates(e,i);return n!==void 0?n??void 0:this.pathFromEventPath(e.composedPath(),i)}}}pathFromCoordinates(e,t){const i=this.hitTest(e);if(i!==void 0)return i===null?null:this.pathFromElement(i,t)??null}pathFromEventPath(e,t){if(!(t&&wt(e))){for(const i of e)if(i instanceof Element)return this.pathFromElement(i,t)}}pathFromElement(e,t){const i=rt(e);if(t&&wt(i))return;const n=bo(e);return n!=null?rt(n):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=Co(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute("data-line")||t.hasAttribute("data-column-number")))return rt(t);const i=Lo(ko(e));if(i==null)return;const n=this.targetForSelectionPoint(i);return n!=null?rt(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),i=an(t)?t:an(document)?document:void 0;if(i!=null)return i.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:i}=this.options;return i!=null?i(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,i=!0){const n=this.getCurrentSelectionRange();let s;if(e==null)s=null;else{const r=this.selectionAnchor?.side??t,o=this.selectionAnchor?.lineNumber??e;s=this.buildSelectionRange(o,e,r,t)}Kt(n??void 0,s??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=s:(this.selectedRange=s,qi(this.renderSelection)),this.placeUtility(),i&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const i=this.getLineIndex(e.start,e.side),n=this.getLineIndex(e.end,e.endSide??e.side);return i!=null&&n!=null?{start:t?i[1]:i[0],end:t?n[1]:n[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,i){if(e.range==null)return;const n=this.getIndexesFromSelection(e.range,t);if(n==null)throw console.error({rowRange:n,range:e.range}),new Error(`InteractionManager.renderSelection: No valid ${i} rowRange`);return n}getLineRenderColumns(e,t,i,n){if(this.pre==null||t==null&&n==null)return[];const{children:s}=this.pre;if(s.length>2)throw console.error(s),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const r=[];for(const o of s){const a=o.hasAttribute("data-deletions")?"deletions":o.hasAttribute("data-additions")?"additions":void 0,l=e!=null&&t!=null&&(e.highlightSide==null||a==null||e.highlightSide===a),d=i!=null&&n!=null&&(i.highlightSide==null||a==null||i.highlightSide===a);if(!l&&!d)continue;const[h,c]=o.children;if(!(h instanceof HTMLElement)||!(c instanceof HTMLElement))throw new Error("InteractionManager.renderSelection: missing gutter or content element");if(c.children.length!==h.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");r.push({content:c,gutter:h,renderEditorActiveLine:d,renderSelectedLines:l})}return r}renderSelection=()=>{pt(this.renderSelection);const e=this.getSelectionRenderState();if(this.pre==null)return;const{editorActiveLine:t,selectedLines:i}=e,n=!ln(this.renderedSelectedLinesState,i),s=!ln(this.renderedEditorActiveLineState,t);if(!n&&!s)return;n&&(this.renderedSelectedLinesState=void 0),s&&(this.renderedEditorActiveLineState=void 0);const r=this.pre.getAttribute("data-diff-type")==="split",o=n?this.resolveLineRenderRange(i,r,"selected-lines"):void 0,a=s?this.resolveLineRenderRange(t,r,"editor-active-line"):void 0,l=this.getLineRenderColumns(n?i:void 0,o,s?t:void 0,a),d=i.range==null||l.some(p=>p.renderSelectedLines),h=t.range==null||l.some(p=>p.renderEditorActiveLine);if(n)for(const p of this.pre.querySelectorAll("[data-selected-line]"))p.removeAttribute("data-selected-line");if(s)for(const p of this.pre.querySelectorAll("[data-editor-active-line]"))p.removeAttribute("data-editor-active-line");const c=o==null?void 0:Math.min(o.start,o.end),u=o==null?void 0:Math.max(o.start,o.end),f=c===u,g=a?.start;for(const p of l){const{content:m,gutter:v,renderEditorActiveLine:k,renderSelectedLines:y}=p,b=Math.max(y?u??-1/0:-1/0,k?g??-1/0:-1/0),C=m.children.length;for(let E=0;Eb)break;if(R!=null){if(y&&c!=null&&u!=null&&R>=c&&R<=u){let L=f?"single":R===c?"first":R===u?"last":"";w.setAttribute("data-selected-line",L),i.lineNumberOnly||(S.setAttribute("data-selected-line",L),w.nextSibling instanceof HTMLElement&&S.nextSibling instanceof HTMLElement&&(S.nextSibling.hasAttribute("data-line-annotation")||S.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(f?(L="last",S.setAttribute("data-selected-line","first")):R===c?L="":R===u&&S.setAttribute("data-selected-line",""),S.nextSibling.setAttribute("data-selected-line",L),w.nextSibling.setAttribute("data-selected-line",L)))}k&&R===g&&(w.setAttribute("data-editor-active-line",""),t.lineNumberOnly||S.setAttribute("data-editor-active-line",""))}}}n&&d&&(this.renderedSelectedLinesState=i),s&&h&&(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:i,side:n,tokenElement:s,tokenText:r}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:i,tokenElement:s,tokenText:r}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:i,side:n,tokenElement:s,tokenText:r}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,i,n){return{start:e,end:t,...i!=null?{side:i}:{},...i!==n&&n!=null?{endSide:n}:{}}}resolvePointerTarget(e){let t=!1,i,n,s,r,o,a,l,d,h,c;for(const f of e){if(!(f instanceof HTMLElement))continue;if(c==null&&f.hasAttribute("data-merge-conflict-action")){const v=f.getAttribute("data-merge-conflict-action")??void 0,k=f.getAttribute("data-merge-conflict-conflict-index")??void 0,y=k!=null?Number.parseInt(k,10):NaN;yo(v)&&Number.isFinite(y)&&(c={kind:"merge-conflict-action",resolution:v,conflictIndex:y})}if(a==null&&f.hasAttribute("data-char")){a=f;const v=f.getAttribute("data-char");if(v!=null){const k=Number.parseInt(v,10);if(!Number.isNaN(k)){const y=f.textContent??"",b=k+y.length;(y.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(l={tokenElement:a,lineCharStart:k,lineCharEnd:b,tokenText:y});continue}}}const g=o==null?f.getAttribute("data-column-number")??void 0:void 0;if(g!=null){o=f,h=Number.parseInt(g,10),t=!0,i=hn(f),r=f.getAttribute("data-line-index")??void 0;continue}const p=s==null?f.getAttribute("data-line")??void 0:void 0;if(p!=null){s=f,h=Number.parseInt(p,10),i=hn(f),r=f.getAttribute("data-line-index")??void 0;continue}if(d==null&&(f.hasAttribute("data-expand-button")||f.hasAttribute("data-unmodified-lines"))){d={hunkIndex:void 0,direction:f.hasAttribute("data-expand-up")?"up":f.hasAttribute("data-expand-down")?"down":"both",all:f.hasAttribute("data-expand-all-button")};continue}const m=d!=null?f.getAttribute("data-expand-index")??void 0:void 0;if(d!=null&&m!=null){const v=Number.parseInt(m,10);Number.isNaN(v)||(d.hunkIndex=v);continue}if(n==null&&f.hasAttribute("data-code")){n=f;break}}if(c!=null)return c;if(d?.hunkIndex!=null)return{type:"line-info",hunkIndex:d.hunkIndex,direction:d.direction,all:d.all};if(s??=r!=null?on(n,`[data-line][data-line-index="${r}"]`):void 0,o??=r!=null?on(n,`[data-column-number][data-line-index="${r}"]`):void 0,n==null||s==null||o==null||i==null||h==null||Number.isNaN(h))return;const u=this.parseLineIndex(s,this.isSplitDiff());return l!=null?this.mode==="file"?{kind:"token",lineType:i,lineElement:s,lineNumber:h,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:u,...l}:{kind:"token",lineType:i,lineElement:s,lineNumber:h,numberColumn:t,numberElement:o,side:dn(i,n),splitLineIndex:u,...l}:this.mode==="file"?{kind:"line",lineType:i,lineElement:s,lineNumber:h,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:u}:{kind:"line",lineType:i,lineElement:s,lineNumber:h,numberColumn:t,numberElement:o,side:dn(i,n),splitLineIndex:u}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const i=(e.getAttribute("data-line-index")??"").split(",").map(n=>Number.parseInt(n,10)).filter(n=>!Number.isNaN(n));if(t&&i.length===2)return i[1];if(!t)return i[0]}};function Xt({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:i,onGutterUtilityClick:n,onLineClick:s,onLineEnter:r,onLineLeave:o,onLineNumberClick:a,onTokenClick:l,onTokenEnter:d,onTokenLeave:h,renderGutterUtility:c,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:p,onLineSelectionStart:m,onLineSelectionChange:v,onLineSelectionEnd:k},y,b,C){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:mo({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:n}),usesCustomGutterUtility:c!=null,lineHoverHighlight:i,onGutterUtilityClick:n,onHunkExpand:y,onMergeConflictActionClick:C,onLineClick:s,onLineEnter:r,onLineLeave:o,onLineNumberClick:a,onTokenClick:l,onTokenEnter:d,onTokenLeave:h,__debugPointerEvents:u,enableLineSelection:f,controlledSelection:g,onLineSelected:p,onLineSelectionStart:m,onLineSelectionChange:v,onLineSelectionEnd:k,getLineIndex:b}}function mo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:i}){if(i!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function dt(e){return e!=null&&"kind"in e&&e.kind==="line"}function Vt(e){return e!=null&&"kind"in e&&e.kind==="token"}function di(e){return dt(e)||Vt(e)}function vo(e){return"type"in e&&e.type==="line-info"}function So(e){return"kind"in e&&e.kind==="merge-conflict-action"}function yo(e){return e==="current"||e==="incoming"||e==="both"}function on(e,t){const i=e?.querySelector(t);return i instanceof HTMLElement?i:void 0}function rt(e){const t=[];let i=e;for(;i!=null;)t.push(i),i=i.parentNode;return t}function bo(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const i=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(i instanceof HTMLElement))return;const n=i.previousElementSibling;return n instanceof HTMLElement&&(n.hasAttribute("data-line")||n.hasAttribute("data-column-number"))?n:void 0}function Co(e){const t=e.closest('[slot^="annotation-"]'),i=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName==="SLOT"?e:void 0)?.closest("[data-line-annotation]");return i instanceof HTMLElement?i:void 0}function ko(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const i=e.getAttribute("name")??void 0;return i!=null&&i.startsWith("annotation-")?i:void 0}}function Lo(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const i=Number.parseInt(t[2],10);if(!(!Number.isFinite(i)||i<=0))return{lineNumber:i,side:t[1]}}function an(e){return e!=null&&typeof e.elementFromPoint=="function"}function wo(e,t){return e===t||Kt(e??void 0,t??void 0)}function ln(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&wo(e?.range??null,t.range)}function dn(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function hn(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 ye(e="none",t,...i){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return}console.log(...i)}var Ls=class ke{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=ke.resizeObserver??new ResizeObserver(ke.handleSharedResizeEntries);return ke.resizeObserver=t,t}static handleSharedResizeEntries(t){const i=new Map;for(const n of t){const s=ke.managersByElement.get(n.target);if(s==null)continue;const r=i.get(s);r==null?i.set(s,[n]):r.push(n)}for(const[n,s]of i)n.handleResizeEntries(s)}observedNodes=new Map;setup(t,{disableAnnotations:i,columnVariables:n="apply"}){const s=new Set,r=n==="apply";let o=0;const a=new Map(this.observedNodes);this.observedNodes.clear();for(const l of t.children){if(o===2)break;const d=(()=>{if(l instanceof HTMLElement&&l.tagName==="CODE")return l})();if(d==null)continue;o++;let h=a.get(d);if(h!=null&&h.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),h!=null?(this.observedNodes.set(d,h),a.delete(d),h.numberElement!==c?(h.numberElement!=null&&(this.unobserve(h.numberElement),a.delete(h.numberElement)),c!=null&&(this.observe(c),a.delete(c),this.observedNodes.set(c,h)),h.numberElement=c,h.numberWidth=0):h.numberElement!=null?(a.delete(h.numberElement),this.observedNodes.set(h.numberElement,h)):h.numberWidth=0,Ro(h,r)):(h={type:"code",codeElement:d,numberElement:c,codeWidth:"auto",numberWidth:0,applyColumnVariables:r},this.observedNodes.set(d,h),this.observe(d),c!=null&&(this.observedNodes.set(c,h),this.observe(c)))}if(o>1&&!i){const l=t.querySelectorAll('[data-line-annotation*=","]'),d=new Map;for(const h of l){if(!(h instanceof HTMLElement))continue;const c=h.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(c)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:c,element:h});continue}let u=d.get(c);u==null&&(u=[],d.set(c,u)),u.push(h)}for(const[h,c]of d){if(c.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",h,c);continue}const[u,f]=c,g=u.firstElementChild,p=f.firstElementChild;if(!(u instanceof HTMLElement)||!(f instanceof HTMLElement)||!(g instanceof HTMLElement)||!(p instanceof HTMLElement))continue;let m=a.get(g);if(m!=null){this.observedNodes.set(g,m),this.observedNodes.set(p,m),a.delete(g),a.delete(p);continue}const v=g.getBoundingClientRect().height,k=p.getBoundingClientRect().height;m={type:"annotations",column1:{container:u,child:g,childHeight:v},column2:{container:f,child:p,childHeight:k},currentHeight:"auto"},s.add({child1:g,child2:p,item:m,newHeight:Math.max(v,k)})}for(const h of s)this.applyNewHeight(h.item,h.newHeight),this.observedNodes.set(h.child1,h.item),this.observedNodes.set(h.child2,h.item),this.observe(h.child1),this.observe(h.child2);s.clear()}for(const[l,d]of a)this.unobserve(l),d.type==="code"?To(d):Ao(d);a.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:i}=ke,n=i.get(t);if(n!==this){if(n!=null&&n!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");i.set(t,this),ke.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:i,resizeObserver:n}=ke,s=i.get(t);if(s!=null){if(s!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");i.delete(t),n?.unobserve(t),n!=null&&i.size===0&&(n.disconnect(),ke.resizeObserver=void 0)}}handleResizeEntries(t){const i=new Map,n=new Set;for(const s of t){const{target:r,borderBoxSize:o,contentBoxSize:a}=s;if(!(r instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",s);continue}const l=this.observedNodes.get(r);if(l==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",s);continue}if(l.type==="annotations"){const d=(()=>{if(r===l.column1.child)return l.column1;if(r===l.column2.child)return l.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:l,target:r});continue}d.childHeight=o[0].blockSize,n.add(l)}else if(l.type==="code"){const d=i.get(l)??{},h=a[0].inlineSize;r===l.codeElement?d.codeInlineSize=h:r===l.numberElement&&(d.numberInlineSize=h),i.set(l,d)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(i),i.clear()}applyAnnotationUpdates(t){for(const i of t)this.applyNewHeight(i,Math.max(i.column1.childHeight,i.column2.childHeight))}applyColumnUpdates=t=>{for(const[i,n]of t){const s=n.codeInlineSize!=null?xo(n.codeInlineSize):i.codeWidth,r=n.numberInlineSize!=null?Eo(n.numberInlineSize):i.numberWidth,o=s!==i.codeWidth,a=r!==i.numberWidth;!o&&!a||(i.codeWidth=s,i.numberWidth=r,i.applyColumnVariables&&ws(i,{codeWidthChanged:o,numberWidthChanged:a}))}};applyNewHeight(t,i){i!==t.currentHeight&&(t.currentHeight=Math.max(i,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 xo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function Eo(e){return Math.max(Math.ceil(e),0)}function Ro(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?ws(e,{codeWidthChanged:!0,numberWidthChanged:!0}):xs(e))}function ws(e,{codeWidthChanged:t,numberWidthChanged:i}){const{codeElement:n,codeWidth:s,numberWidth:r}=e;if(t&&n.style.setProperty("--diffs-column-width",`${typeof s=="number"?`${s}px`:"auto"}`),i&&n.style.setProperty("--diffs-column-number-width",`${r===0?"auto":`${r}px`}`),t||i&&s!=="auto"){const o=typeof s=="number"?Math.max(s-r,0):0;n.style.setProperty("--diffs-column-content-width",`${o>0?`${o}px`:"auto"}`)}}function xs(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 To(e){e.codeElement.isConnected&&xs(e)}function Ao(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 gt(e,t){const i=Array.isArray(e)?e:[e];return t!=null?t.hasLoadedLanguages(i):i.every(n=>n==="text"||n==="ansi"||us.has(n))}function re(e,t){return Fe(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function ri(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 xi(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 Io(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 Es({fileOrDiff:e,mode:t,stickyHeader:i}){const n="type"in e?e:void 0,s={"data-diffs-header":t,"data-change-type":n?.type,"data-sticky":i?"":void 0};return M({tagName:"div",children:[t==="custom"?M({tagName:"slot",properties:{name:Ui}}):Ho({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:n?.type??"file"}),...t==="custom"?[]:[Mo(n)]],properties:s})}function Ho({name:e,prevName:t,iconType:i}){const n=[M({tagName:"slot",properties:{name:_i}}),Yt({name:Io(i),properties:{"data-change-icon":i}})];return t!=null&&(n.push(M({tagName:"div",children:[M({tagName:"bdi",children:[me(t)]})],properties:{"data-prev-name":""}})),n.push(Yt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),n.push(M({tagName:"div",children:[M({tagName:"bdi",children:[me(e)]})],properties:{"data-title":""}})),n.push(M({tagName:"slot",properties:{name:Bi}})),M({tagName:"div",children:n,properties:{"data-header-content":""}})}function Mo(e){const t=[];if(e!=null){let i=0,n=0;for(const s of e.hunks)i+=s.additionLines,n+=s.deletionLines;(n>0||i===0)&&t.push(M({tagName:"span",children:[me(`-${n}`)],properties:{"data-deletions-count":""}})),(i>0||n===0)&&t.push(M({tagName:"span",children:[me(`+${i}`)],properties:{"data-additions-count":""}}))}return t.push(M({tagName:"slot",properties:{name:Vi}})),M({tagName:"div",children:t,properties:{"data-metadata":""}})}function Rs(e){return M({tagName:"pre",properties:Do(e)})}function Do({diffIndicators:e,disableBackground:t,disableLineNumbers:i,overflow:n,split:s,totalLines:r,type:o,customProperties:a}){return{...a,"data-diff":o==="diff"?"":void 0,"data-file":o==="file"?"":void 0,"data-diff-type":o==="diff"?s?"split":"single":void 0,"data-overflow":n,"data-disable-line-numbers":i?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${r}`.length}ch;`}}const Ne=new Map;let Fo=0;const je={"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",odin:"odin",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",BUCK:"python",BUILD:"python",PACKAGE:"python",WORKSPACE:"python",Tiltfile:"python",bazel:"python",bxl:"python",bzl:"python",bzlmod:"python",star:"python",sky:"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 j(e){const t=cn(e);if(t!=null)return t;const i=e.split(/[/\\]/).pop()??e;return i===e?"text":cn(i)??"text"}function cn(e){if(Ne.has(e))return Ne.get(e)??"text";if(Object.hasOwn(je,e))return je[e]??null;const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Ne.has(t[1]))return Ne.get(t[1])??"text";if(Object.hasOwn(je,t[1]))return je[t[1]]??"text"}const i=e.match(/\.([^.]+)$/)?.[1]??"";return Ne.has(i)?Ne.get(i)??"text":Object.hasOwn(je,i)?je[i]??"text":null}function un(){return Fo}function fn(){return Object.fromEntries(Ne)}function Ts(e,{theme:t,preferredHighlighter:i}){return{langs:Array.isArray(e)?e:[e??"text"],themes:fe(t),preferredHighlighter:qe(i)}}function ge(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function Qt(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function he(e){return`--${e==="token"?"diffs-token":"diffs"}-`}function As({theme:e=q,highlighter:t,prefix:i}){let n="";if(typeof e=="string"){const s=t.getTheme(e),r=hi(s,t);n+=`color:${r.fg};`,n+=`background-color:${r.bg};`,n+=`${he("global")}fg:${r.fg};`,n+=`${he("global")}bg:${r.bg};`,n+=ci(s,i)}else{let s=t.getTheme(e.dark),r=hi(s,t);n+=`${he("global")}dark:${r.fg};`,n+=`${he("global")}dark-bg:${r.bg};`,n+=ci(s,"dark"),s=t.getTheme(e.light),r=hi(s,t),n+=`${he("global")}light:${r.fg};`,n+=`${he("global")}light-bg:${r.bg};`,n+=ci(s,"light")}return n}function hi(e,t){if(t.name==="highlights"&&e.zed?.cssVariables===!0){const i=he("token");return{fg:`var(${i}foreground)`,bg:`var(${i}background)`}}return Hr(e)}function ci(e,t){t=t!=null?`${t}-`:"";let i="";const n=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];n!=null&&(i+=`${he("global")}${t}addition-color:${n};`);const s=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];s!=null&&(i+=`${he("global")}${t}deletion-color:${s};`);const r=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return r!=null&&(i+=`${he("global")}${t}modified-color:${r};`),i}function Po(e,t,i){const n=typeof i.lineInfo=="function"?i.lineInfo(t):i.lineInfo[t-1];if(n==null){const s=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(s,{node:e,line:t,state:i}),new Error(s)}return e.tagName="div",e.properties["data-line"]=n.lineNumber,e.properties["data-alt-line"]=n.altLineNumber,e.properties["data-line-type"]=n.type,e.properties["data-line-index"]=n.lineIndex,e.children.length===0&&e.children.push(me(` +`)),e}const pn=new WeakMap;function Is(e,t=!1){const{htmlStyle:i}=e;if(i!=null){let s=t?pn.get(i):void 0;if(s==null){s="";for(const r in i)s+=`${s===""?"":";"}${r}:${i[r]}`;t&&pn.set(i,s)}return s}let n=e.color!=null?`color:${e.color}`:"";if(e.bgColor!=null&&(n+=`;background-color:${e.bgColor}`),e.fontStyle!=null){(e.fontStyle&1)!==0&&(n+=";font-style:italic"),(e.fontStyle&2)!==0&&(n+=";font-weight:bold");const s=(e.fontStyle&4)!==0,r=(e.fontStyle&8)!==0;(s||r)&&(n+=`;text-decoration:${s?"underline":""}${s&&r?" ":""}${r?"line-through":""}`)}return n.replace(/^;/,"")}function Ki(e,t,i,{retain:n=!0}={}){let s=!1,r;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){if(s)return r;const o=i();return n?(r=o,s=!0,Object.getOwnPropertyDescriptor(e,t)?.configurable===!0&&Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}),r):o},set(o){if(Object.getOwnPropertyDescriptor(e,t)?.configurable===!0)Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:o});else{if(Object.isFrozen(e))throw new TypeError(`Cannot assign to read only array index '${t}'`);r=o,s=!0}}})}const xt=Symbol("no-token"),ui=Symbol("multiple-tokens");function Hs(e){const t=Oo(e);if(t!=null)return t;let i=xt;const n=[];let s=[],r;const o=()=>{if(s.length===0||r==null){s=[],r=void 0;return}if(s.length===1){const l=s[0];if(l?.type==="element"){zo(l,r);for(const d of l.children)Ut(d)}else Ut(l);n.push(l),s=[],r=void 0;return}for(const l of s)Ut(l);n.push(M({tagName:"span",properties:{"data-char":r},children:s})),s=[],r=void 0},a=l=>{if(l!==xt){if(l===ui){i=ui;return}if(i===xt){i=l;return}i!==l&&(i=ui)}};for(const l of e.children){const d=l.type==="element"?Hs(l):xt;if(a(d),typeof d!="number"){o(),n.push(l);continue}r!=null&&r!==d&&o(),r??=d,s.push(l)}return o(),e.children=n,i}function Oo(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function Ut(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)Ut(t)}}function zo(e,t){e.properties["data-char"]=t}function Yi(e,{state:t,lazyLineAST:i=!1,cacheHtmlStyles:n=!1,useTokenTransformer:s=!1,mergeWhitespaces:r="always",decorations:o=[],lineOffsets:a=[]}){let l;for(const c of o){const u=l??=new Map,f={...c,start:gn(c.start,a),end:gn(c.end,a)},g=Math.min(f.end.line,e.length-1);for(let p=f.start.line;p<=g;p++){let m=u.get(p);m==null&&u.set(p,m=[]),m.push(f)}}const d=(c,u)=>{let f;if(s||r!=="never"){let v="",k=0;for(let y=0;y0&&f.push({content:b.content.slice(0,E),offset:b.offset}),f.push({...b,content:C,offset:b.offset+E});const S=E+C.length;Sd(u,c))}return h}function No(e,t,i,n){let s=0;for(const r of t)r.content!==""&&(e.children.push(Ms(r,Is(r,n),r.content,s,i)),s+=r.content.length);return s}function _o(e,t,i,n,s,r){i.length>1&&i.sort((m,v)=>m.start.line!==v.start.line?m.start.line-v.start.line:m.start.character!==v.start.character?m.start.character-v.start.character:m.end.line!==v.end.line?v.end.line-m.end.line:v.end.character-m.end.character);const o=t.reduce((m,v)=>m+v.content.length,0),a=[];for(let m=0;mm.position-v.position);const l=[],d=[];let h=0;const c=(m,v)=>{let k=0,y=l.length;for(;k>>1;l[b].order{let m=e,v=0;for(const k of l){if(d[v]?.range!==k){d.length=v;const y={type:"element",tagName:"span",properties:{...k.decoration.properties},children:[]};m.children.push(y),d.push({range:k,node:y})}m=d[v++].node}return d.length=v,m};let f=e;const g=m=>{const v=h;for(;a[h]?.position===m;)h++;let k=!1;for(let y=v;y=m&&(b.to>m||b.from===m||m===o)&&(c(b,!0),b.from===b.to&&(k=!0))}if(k){u();for(let y=v;y>>1;t[s]<=e?i=s:n=s}return{line:i,character:e-(t[i]??0)}}const mn=10,vn=13,Bo=4,Vo=40;function Uo(e){const t=[0];let i=e.indexOf("\r"),n=e.indexOf(` `),s=0,r=0;for(;i!==-1||n!==-1;){let o;if(i!==-1&&(n===-1||i{const s=t[n],r=t[n+1]??e.length;return e.slice(s,r)})}function bi(e,t){for(const i of t)e.push(i)}const ao={forcePlainText:!1};function ds(e,t,{theme:i,tokenizeMaxLineLength:n,useTokenTransformer:s},{forcePlainText:r,startingLine:o,totalLines:l,lines:a}=ao){r?(o??=0,l??=1/0):(o=0,l=1/0);const h=o>0||l<1/0,{state:d,transformers:c}=as(s),u=r?"text":e.lang??$(e.name),f=typeof i=="string"?t.getTheme(i).type:void 0,g=ls({theme:i,highlighter:t});d.lineInfo=v=>({type:"context",lineIndex:v-1+o,lineNumber:v+o});const p=typeof i=="string"?{lang:u,theme:i,transformers:c,defaultColor:!1,cssVariablePrefix:ie("token"),tokenizeMaxLineLength:n,tokenizeTimeLimit:0}:{lang:u,themes:i,transformers:c,defaultColor:!1,cssVariablePrefix:ie("token"),tokenizeMaxLineLength:n,tokenizeTimeLimit:0},m=yi(t.codeToHast(lo(h?ho(a??at(e.contents),o,l):e.contents),p)),y=h?new Array(o):m;return h&&bi(y,m),{code:y,themeStyles:g,baseThemeType:f}}function lo(e){return e.replace(/\r(?!\n)/g,` -`)}function ho(e,t,i){if(e.length===0)return"";const n=Math.min(t+i,e.length);return e.slice(t,n).join("")}function W(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 hs="-1,-1";function cs(e){return e?.some(t=>t.lineNumber===0)??!1}function Ci(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function Zt(e){return e.startingLine===0&&e.totalLines>0}function us(e,t){return e.endsWith(`\r +`,o)),t.push(o),++r===Bo){if(o-s<=Vo){for(let a=o;a{const s=t[n],r=t[n+1]??e.length;return e.slice(s,r)})}function Xi(e,t){for(const i of t)e.push(i)}function Ds(e,t,i){return{lang:e,...typeof t=="string"?{theme:t}:{themes:t},defaultColor:!1,cssVariablePrefix:he("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0}}const Wo={forcePlainText:!1};function Ei(e,t,{theme:i,tokenizeMaxLineLength:n,useTokenTransformer:s},{forcePlainText:r,lazyLineAST:o=!1,startingLine:a,totalLines:l,lines:d}=Wo){r?(a??=0,l??=1/0):(a=0,l=1/0);const h=a>0||l<1/0,c={lineInfo:[]},u=r?"text":e.lang??j(e.name),f=typeof i=="string"?t.getTheme(i).type:void 0,g=As({theme:i,highlighter:t});c.lineInfo=v=>({type:"context",lineIndex:v-1+a,lineNumber:v+a});const p=Yi(t.codeToTokens($o(h?qo(d??ht(e.contents),a,l):e.contents),Ds(u,i,n)).tokens,{state:c,useTokenTransformer:s,lazyLineAST:o&&!r&&!s,cacheHtmlStyles:t.name==="highlights"}),m=h?new Array(a):p;return h&&Xi(m,p),{code:m,themeStyles:g,baseThemeType:f}}function $o(e){return e.replace(/\r(?!\n)/g,` +`)}function qo(e,t,i){if(e.length===0)return"";const n=Math.min(t+i,e.length);return e.slice(t,n).join("")}function Ct(e,t){return e?.getPreferredHighlighter()??t.preferredHighlighter}function B(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 Fs="-1,-1";function Ps(e){return e?.some(t=>t.lineNumber===0)??!1}function Ri(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function oi(e){return e.startingLine===0&&e.totalLines>0}function Os(e,t){return e.endsWith(`\r `)?t+`\r `:e.endsWith("\r")?t+"\r":e.endsWith(` `)?t+` -`:t}function fs(e,t){return I({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function Xe(e){return(e.lang??$(e.name))==="text"}function yt(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}let co=-1;var uo=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`file-renderer:${++co}`;highlighter;file;renderCache;pendingHighlightResult;computedLang="text";lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;get fileCache(){return this.renderCache?.file}constructor(e={theme:U},t=pe,i,n){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=i,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=ce(e.theme??U)?Je():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const i=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=i,i.push(t)}}cleanUp(){this.endEditSession(),this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}beginEditSession(e,t){const{editSessionActive:i,renderCache:n}=this;if(this.editSessionActive=!0,i||(this.pendingHighlightResult=void 0),this.file=e,n==null||i&&n.file===e)return;if(i){this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap;return}const{options:s}=this.getRenderOptions(e),r=n.file===e,o=t!=null&&W(n.file,t),{result:l}=n;if(!n.highlighted||l==null||!de(n.options,s)||!r&&!o){this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap;return}if(r)return;this.renderCache={...n,file:e,result:{...l,code:[...l.code]}};const{lineCache:a}=this;a!=null&&t!=null&&yt(a,t)?this.lineCache={cacheKey:void 0,file:e,sourceContents:e.contents,lines:a.lines}:this.lineCache=void 0}endEditSession(e){if(this.editSessionActive=!1,this.pendingHighlightResult=void 0,this.file==null){this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap;return}const{renderCache:t}=this;e==null||t==null||t.file===e||!W(t.file,e)||(t.file=e)}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}recycle(){this.editSessionActive?(this.renderCache!=null&&(this.renderCache.renderRange=void 0),this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0):(this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.file=void 0}clearRenderCache(){this.pendingStructuralRows=void 0,this.renderCache=void 0,this.pendingHighlightResult=void 0}hydrate(e){this.file=e;const{options:t}=this.getRenderOptions(e),i=bt(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let n=this.workerManager?.getFileResultCache(e);n!=null&&!de(t,n.options)&&(n=void 0),this.renderCache??={file:e,hydrated:!0,options:t,highlighted:!i&&!Xe(e),result:i?void 0:n?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!i&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??$(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??U}getEffectiveCodeOptions(){const e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getFileRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0){const s=this.workerManager.getFileRenderOptions();return this.editSessionActive&&s.useTokenTransformer!==!0?{...s,useTokenTransformer:!0}:s}const{tokenizeMaxLineLength:n=1e3}=this.options;return{theme:this.getLocalHighlightTheme(),useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:n}})(),{renderCache:i}=this;return i?.result==null?{options:t,forceHighlight:!0}:!W(e,i.file)||!de(t,i.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getFileForNextRender(e){const{options:t}=this.getRenderOptions(e);if(this.getReadyRenderResult(e,t)!=null)return e;const{renderCache:i}=this;if(i==null)return e;if(W(i.file,e))return i.file;const n=at(e.contents),s=e.contents.length===0||Xe(e)||bt(n.length,this.getTokenizeMaxLength());return this.canRenderFile(e,t,s)?e:i.file}canRenderFile(e,t,i){const{renderCache:n}=this;return n==null||W(n.file,e)?!0:i?n.result==null&&n.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&ce(t.theme):n.result==null&&n.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!n.highlighted:this.highlighter!=null&&ce(t.theme)}getOrCreateLineCache(e){let{lineCache:t}=this;return(t==null||!yt(t,e))&&(t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:at(e.contents)}),this.lineCache=t,t.lines}getLineCount(e){const t=this.getOrCreateLineCache(e);return this.textDocumentCache.get(e)?.lineCount??t.length}updateRenderCache(e,t,i=!1){this.pendingStructuralRows=void 0;const{renderCache:n}=this;if(n==null)return;const{file:s,result:r}=n;if(r==null)return;const o=i?new Map:void 0;this.pendingStructuralRows=o;const l=this.lineCache!=null&&yt(this.lineCache,s)?this.lineCache:void 0;for(const[a,h]of e){if(o==null&&l!=null&&au[2]).join("");l.lines[a]=us(l.lines[a]??"",c)}const d={type:"element",tagName:"div",properties:{"data-line":a+1,"data-line-type":"context","data-line-index":a},children:h.map(([c,u,f])=>c===0&&u===""?f===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:f}:{type:"element",tagName:"span",properties:{"data-char":c,style:`color:${u};`},children:[{type:"text",value:f}]})};o!=null?o.set(a,d):r.code[a]=d}r.baseThemeType=t,n.isDirty=!0,o==null&&l!=null&&(s.contents=l.lines.join(""),l.sourceContents=s.contents)}applyDocumentChange(e){const{pendingStructuralRows:t,renderCache:i}=this;this.pendingStructuralRows=void 0;const n=this.file??i?.file;if(n==null)return;const s=i?.result,r=this.lineCache!=null&&yt(this.lineCache,n)?this.lineCache.lines:at(n.contents),o=at(e.getText());if(s!=null&&r.length!==o.length){const a=Math.min(r.length,o.length);let h=0;for(;h0,l=!o||Xe(e)||bt(r.length,this.getTokenizeMaxLength()),a=this.canRenderFile(e,i,l),h=!W(e,this.renderCache.file),d=!Jt(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){const c=this.renderCache.result==null&&this.renderCache.highlighted&&!l&&!h&&qt(t);a&&!c&&(l||this.renderCache.result==null||!this.renderCache.highlighted&&(h||d))&&(this.renderCache.file=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||h||d||n)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,r)),this.renderCache.renderRange=t),!l&&o&&(!this.renderCache.highlighted||n)&&this.workerManager.highlightFileAST(this,e)}else{this.computedLang=e.lang??$(e.name),this.highlighter??=Je();const c=this.highlighter!=null&&ce(i.theme),u=this.highlighter!=null&&Qe(this.computedLang),f=!l&&u;if(a&&this.highlighter!=null&&c&&(n||l||!this.renderCache.highlighted&&f||this.renderCache.result==null)){const{result:g,options:p}=this.renderFileWithHighlighter(e,this.highlighter,l||!u);this.renderCache={file:e,options:p,highlighted:f,result:g,renderRange:void 0}}(!c||!l&&!u)&&this.asyncHighlight(e).then(({result:g,options:p})=>{this.applyHighlightResult(e,g,p,!l)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=_t){this.file=e;const{result:i}=await this.asyncHighlight(e);return this.processFileResult(e,t,i)}async asyncHighlight(e){const t=bt(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??$(e.name);const i=this.highlighter!=null&&vi(Ee(this.getLocalHighlightTheme())),n=t||this.highlighter!=null&&Qe(this.computedLang);return(this.highlighter==null||!i||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,i=!1){const{options:n}=this.getRenderOptions(e);return{result:ds(e,t,n,{forcePlainText:i}),options:n}}processFileResult(e,t,{code:i,themeStyles:n,baseThemeType:s}){const r=this.getLineCount(e),{disableFileHeader:o=!1}=this.options,l=[],a=Ge(),h=Math.min(t.startingLine+t.totalLines,r);let d=0;const c=Zt(t)?Ci(this.lineAnnotations):void 0;c!=null&&(a.children.push(te("context","annotation",1)),l.push(Si({hunkIndex:-1,lineIndex:-1,annotations:c.map(u=>this.annotationSlotName(u))})),d++);for(let u=t.startingLine;uthis.annotationSlotName(m))})),d++)}return a.properties.style=`grid-row: span ${d}`,{file:e,gutterAST:a.children??[],contentAST:l,preAST:this.createPreElement(r),headerAST:o?void 0:this.renderHeader(e),totalLines:r,rowCount:d,themeStyles:n,baseThemeType:s,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:i=!1}=this.options;return ns({fileOrDiff:e,mode:t,stickyHeader:i})}renderFullHTML(e){return X(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(I({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=Ge();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,fs(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return t?X(I({tagName:"code",children:e,properties:{"data-code":""}})):X(e)}async initializeHighlighter(){return this.highlighter=await Me(rs(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}onHighlightSuccess(e,t,i,n=!0){this.editSessionActive||this.applyHighlightResult(e,t,i,n)}applyHighlightResult(e,t,i,n=!0){const{file:s,renderCache:r}=this;s==null||r==null||!W(e,s)||!de(i,this.getRenderOptions(s).options)||(r.result==null||!r.highlighted||!de(r.options,i)||!W(r.file,s))&&(this.pendingHighlightResult={file:s,options:i,highlighted:n,result:t},this.onRenderUpdate?.())}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const i=this.workerManager?.getFileResultCache(e);if(!(i==null||!de(t,i.options)))return i}getReadyRenderResult(e,t){const{pendingHighlightResult:i}=this;if(i!=null&&W(i.file,e)&&de(i.options,t))return i;const n=this.getMatchingWorkerResultCache(e,t);if(!(n==null||this.hasHighlightedRenderCache(e,t)))return{file:e,highlighted:!0,...n}}hasHighlightedRenderCache(e,t){const{renderCache:i}=this;return i?.result!=null&&i.highlighted&&W(e,i.file)&&de(t,i.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){const{disableLineNumbers:t=!1,overflow:i="scroll"}=this.options;return ss({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:i,split:!1,totalLines:e})}};function bt(e,t){return e>t}const ps=``;function Ko(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function _s(e,t){return e==null||t==null?e===t:Yo(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 Sn={};function Yo(e=Sn,t=Sn){if(e===t)return!0;const i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(const s of i)if(e[s]!==t[s])return!1;return!0}function Bs(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function Vs(){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 Us(){const e=document.createElement("style");return e.setAttribute(Nr,""),e}var Xo=`@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))}[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-overflow=scroll]:not([data-dehydrated],[data-custom-styles],:has(>[data-code]>[contenteditable],>[data-code]>*>:is([data-line-annotation],[data-separator],[data-merge-conflict],[data-merge-conflict-actions])))>[data-code]{display:flex;&>[data-gutter]{flex-shrink:0;display:block}&>[data-content]{flex:1 0 max-content;display:block}}[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-overflow=scroll] [data-column-number]{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; +`;let Tt;function mt(e){if(Tt!=null)return Tt;const t=e.host;if(typeof HTMLElement<"u"&&t instanceof HTMLElement&&!t.isConnected)return;const i=document.createElement("div");i.setAttribute("data-code",""),i.setAttribute(_r,"true");const n=document.createElement("div");return n.style.position="relative",n.style.width="200%",n.style.height="200%",i.appendChild(n),e.appendChild(i),Tt=Math.max(i.offsetHeight-i.clientHeight,0),i.remove(),Tt}function Ws(e){const t=e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`;return`${os}: ${t};`}const $s="@layer base, theme, rendered, unsafe;",Qo=new RegExp(`${Zo(os)}\\s*:\\s*[^;]+;`);function qs(e){return`${$s} @layer unsafe { ${e} -}`}function ks(e,t="system",i){const n=t==="system"?"":` - color-scheme: ${t};`,s=ys(i);return`${bs} +}`}function Gs(e,t="system",i){const n=t==="system"?"":` + color-scheme: ${t};`,s=Ws(i),r=(t==="system"?["light","dark"]:[t]).map(o=>{const a=` + [data-line] span, [data-edit-prediction-suffix] span { + font-weight: var(--diffs-token-${o}-font-weight, inherit); + font-style: var(--diffs-token-${o}-font-style, inherit); + text-decoration: var(--diffs-token-${o}-text-decoration, inherit); + }`;return t==="system"&&o==="dark"?`@media (prefers-color-scheme: dark) {${a} +}`:a}).join(` +`);return`${$s} +@layer base { + ${r} +} @layer rendered { :host {${n} ${s} ${e} } -}`}function Ls(e,t){const i=ys(t);return e.replace(mo,i)}function vo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const So=new WeakMap;function Ni(e){const t=So.get(e);return t??e}function Ft({code:e,pre:t,columnType:i,rowSpan:n,containerSize:s=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),i!=null&&e.setAttribute(`data-${i}`,""),t?.appendChild(e)),n!=null?e.style.setProperty("grid-row",`span ${n}`):e.style.removeProperty("grid-row"),s?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function ws(e,t){if(t==null)return;const i=e.shadowRoot??e.attachShadow({mode:"open"});i.innerHTML===""&&(i.innerHTML=t)}function xs(e,{type:t,diffIndicators:i,disableBackground:n,disableLineNumbers:s,overflow:r,split:o,totalLines:l,customProperties:a}){if(a!=null)for(const h in a){const d=a[h];d!=null&&e.setAttribute(h,`${d}`)}switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),i){case"bars":case"classic":e.setAttribute("data-indicators",i);break;case"none":e.removeAttribute("data-indicators")}return s?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),n?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",o?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",r),e.style.setProperty("--diffs-min-number-column-width-default",`${`${l}`.length}ch`),e}function ft(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}let yo,bo;function Es(){return yo??="safari"in window&&"pushNotification"in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Co(){return bo??=/\bFirefox\//.test(navigator.userAgent)}function $t(e,t,i){const n=new Map;for(const s of e){const r=Ni(s);n.set(r,i?.slotNames.get(r)??t(s))}return{provided:e,current:e,slotNames:n}}function Rs(e,t,i){for(const n of t){const s=Ni(n);e.slotNames.has(s)||e.slotNames.set(s,i(n))}e.provided=t,e.current=t}function Ts(e,t,i){if(e==null)return i(t);const n=Ni(t);let s=e.slotNames.get(n);return s==null&&(s=i(t),e.slotNames.set(n,s)),s}function As(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function sn(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:As(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function ki(e,t){const i=e?.offsetHeight??0;if(e==null||i===0){t();return}e.style.minHeight=`${i}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=""}}function Hs({shadowRoot:e,currentNode:t,themeCSS:i}){if(i.trim()===""){t?.remove();return}return t??=ko(),t.textContent=i,t.parentNode!==e&&e.appendChild(t),t}function ko(){const e=document.createElement("style");return e.setAttribute(gr,""),e}var lt=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated"),this.name="WorkerPoolTerminatedError"}},Ot=class extends Error{constructor(){super("WorkerPoolManager: operation canceled before the task completed"),this.name="WorkerPoolTaskCanceledError"}},Is=class extends Error{constructor(e,t){super(e,t),this.name="WorkerPoolWorkerError"}};const Ms=new WeakSet;function Lo(e){Ms.add(e)}function wo(e){return e instanceof lt||e instanceof Ot}function Bi(e){return wo(e)||e instanceof Is&&Ms.has(e)}if(typeof HTMLElement<"u"&&customElements.get("diffs-container")==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const n=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(go)),n.adoptedStyleSheets=[e]}connectedCallback(){const n=this.shadowRoot??this.attachShadow({mode:"open"});ut(n)}}customElements.define(Vn,t)}const xo=[""];function Eo(e){const t={...e};return delete t.cacheKey,t}let Ro=-1;var To=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++Ro}`;type="file";fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerFilenameSuffix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;editSession;renderedFile;renderRange;enabled=!0;editor;constructor(e={theme:U},t,i=!1){this.options=e,this.workerManager=t,this.isContainerManaged=i,this.fileRenderer=new uo(e,this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager),this.resizeManager=new es,this.interactionManager=new Zn("file",Wt(e)),this.workerManager?.subscribeToThemeChanges(this)}getAnnotationSlotName=e=>Ts(this.editSession?.annotations,e,pe);handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}getTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??U}getLatestFile(e=this.file){return this.editSession?.file??e}getRenderedFile(){return this.renderedFile}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}updateExternalFile(e,t){if(W(this.file,e))return!1;const i=this.editSession!=null;return this.file=e,i||this.editor!=null?this.installEditSession(e,i?void 0:this.editor?.__getDocumentContents(e),!0):this.editSession=void 0,this.editSession?.annotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSession.annotations=$t(t,pe,this.editSession.annotations)),!0}installEditSession(e,t,i=!1){const n=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===e.contents,s=Eo(t??e);this.editSession={file:s,externalReplacement:i&&n,annotations:this.editSession?.annotations??$t(this.lineAnnotations,pe)},this.fileRenderer.beginEditSession(s,n?e:void 0)}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Wt(this.options))}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&&!De(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){const t=this.editSession?.annotations;if(t==null){this.lineAnnotations=e;return}this.isNewAnnotations(e)&&(this.lineAnnotations=e,Rs(t,e,pe))}syncEditSessionAnnotationsFromEditor(e){const t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.fileRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??"additions"})}getCodeScrollLeft(){return this.code?.scrollLeft??0}setCodeScrollLeft(e){this.code!=null&&(this.code.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.fileRenderer.getEffectiveCodeOptions()}}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{overflow:e="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:e==="wrap",columnVariables:this.shouldApplyColumnVariables(e)?"apply":"measure"}),this.managersDirty=!1}shouldApplyColumnVariables(e){return e==="scroll"&&this.getLatestAnnotations().length>0}cleanUp(e=!1){const t=this.editor;this.emitPostRender(!0),t?.cleanUp(e?"recycle":"discard"),e||(this.editor=void 0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.pre=void 0,this.code=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=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.placeHolder?.remove(),this.placeHolder=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0,this.editSession=void 0,this.renderedFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{fileContainer:t,prerenderedHTML:i,preventEmit:n=!1,file:s,lineAnnotations:r}=e;if(!this.enabled)throw new Error("File.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw new Error("File.hydrate: hydrate can only be called before the instance has rendered or hydrated");this.hydrateElements(t,i);const o=this.editor!=null;o||Ao(this.pre,s,this.options.collapsed)||Ho(this.headerElement,s,this.options.disableFileHeader)?this.render({...e,forceRender:o||e.forceRender,preventEmit:!0}):this.hydrationSetup({file:s,lineAnnotations:r}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),ws(e,t);for(const i of Array.from(e.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i,this.appliedPreAttributes=void 0;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-theme-css")){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.textContent;continue}if("diffsHeader"in i.dataset){this.headerElement=i,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions(sn(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderedFile=e,this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.getLatestFile()){return e!=null?this.fileRenderer.getOrCreateLineCache(e):xo}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}syncRenderViewToEditor(){const{editor:e,fileContainer:t,renderRange:i}=this,n=this.getLatestAnnotations(),s=this.getLatestFile();if(e==null||t==null||s==null)return;const r=h=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.getLatestFile()!==s||e.__syncRenderView({highlighter:h,fileContainer:t,file:s,lineAnnotations:n,renderRange:i,externalDocument:this.editSession?.externalReplacement===!0})},o=this.getTheme(),l=s.lang??$(s.name),a=Je({theme:o,lang:l});a!=null?r(a):Me({themes:Ee(o),langs:Array.from(new Set(["text",l])),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter}).then(r)}__acknowledgeDocumentUpdate(){this.editSession!=null&&(this.editSession.externalReplacement=!1)}__acceptEditorChange(e){const{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}emitEditChange(e){const{onEditChange:t}=this.options;t?.(e)}__captureDocumentSessionState(){}__attachEditor(e){if(this.editor!=null)throw new Error("File.__attachEditor: an editor is already attached");this.editor=e;const t=()=>{this.editor=void 0,this.fileRenderer.endEditSession()};try{return this.resumeEditorRendering(e),t}catch(i){throw t(),i}}__resumeEditor(e){if(this.editor!==e)throw new Error("File.__resumeEditor: editor association changed");this.resumeEditorRendering(e)}resumeEditorRendering(e){this.editSession!=null?this.fileRenderer.beginEditSession(this.editSession.file):this.file!=null&&this.installEditSession(this.file,e.__getDocumentContents(this.file));const t=this.editSession?.file;this.fileRenderer.editorRenderReady()?(this.fileRenderer.fileCache===t&&(this.renderedFile=t),this.syncRenderViewToEditor()):this.rerender()}__completeEditSession(e,t){this.settleEditSession(t==="install",e)}settleEditSession(e,t){const{editSession:i,file:n,lineAnnotations:s}=this;if(i==null||n==null)return;const{file:r,annotations:o}=i;if(this.editor!=null)throw new Error("File.__completeEditSession: detach the editor before completing the session");const l=o?.current;let a,h=!1,d;if(t==null)throw new Error("File.__completeEditSession: editor is required for completion");const c={...r},u={file:c,editor:t,originalFile:n,lineAnnotations:l,originalLineAnnotations:s};Object.freeze(u);try{if(t.__emitEditComplete(u),this.options.onEditComplete?.(u)==="accept"){if(c.cacheKey!=null&&c.cacheKey===n.cacheKey)throw new Error("File.__completeEditSession: an accepted file must not reuse the replaced file cacheKey");a=c}}catch(p){h=!0,d=p}e&&a!=null&&(this.file=a,l!=null&&(this.lineAnnotations=l)),this.editSession=void 0;const{renderedFile:f,file:g}=this;if(this.fileRenderer.endEditSession(g),f!=null&&g!=null&&f!==g&&W(f,g)&&(this.renderedFile=g),e&&this.fileContainer!=null&&this.rerender(),h)throw d}applyDocumentChange(e,t){const i=this.editSession?.file;if(i==null)throw new Error("File.applyDocumentChange: requires an active edit session");this.fileRenderer.beginEditSession(i),this.fileRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}applySuspendedDocumentChange(e,t){this.editSession!=null&&(this.applyDocumentChange(e,t),this.fileRenderer.clearRenderCache())}updateRenderCache(e,t,i){const n=this.editSession?.file;if(n==null)throw new Error("File.updateRenderCache: requires an active edit session");this.fileRenderer.beginEditSession(n),this.fileRenderer.updateRenderCache(e,t,i?.lineCountChangeInFlight)}render({file:e,fileContainer:t,forceRender:i=!1,preventEmit:n=!1,containerWrapper:s,deferManagers:r=!1,lineAnnotations:o,renderRange:l}){if(!this.enabled)throw new Error("File.render: attempting to call render after cleaned up");this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:a=!1,themeType:h="system"}=this.options,d=a?void 0:l,c=this.renderRange,u=this.hasThemeChanged(),f=o!=null&&(o.length>0||this.getLatestAnnotations().length>0)?this.isNewAnnotations(o):!1,g=!W(this.file,e);g&&this.updateExternalFile(e,o);const p=this.getLatestFile(e)??e;if(!a&&!i&&Jt(d,this.renderRange)&&!g&&!f&&!u){const v=this.applyCachedThemeState(h);return v&&this.finalizeRender(),v}this.renderRange=d,g&&(this.cachedHeaderHTML=void 0),this.fileRenderer.setOptions(sn(this.options)),this.syncInteractionOptions(),o!=null&&this.setLineAnnotations(o),this.fileRenderer.setLineAnnotations(this.getLatestAnnotations());const{disableErrorHandling:m=!1,disableFileHeader:y=!1}=this.options;if(y&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,s),this.applyCachedThemeState(h),a){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const v=this.fileRenderer.renderFile(p,$n);v!=null&&this.applyThemeState(t,v.themeStyles,h,v.baseThemeType),v?.headerAST!=null&&this.applyHeaderToDOM(v.headerAST,t,v.file),this.renderedFile=v?.file??p,this.injectUnsafeCSS()}catch(v){if(m)throw v;console.error(v),v instanceof Error&&this.applyErrorToDOM(v,t)}return this.finalizeRender(),n||this.emitPostRender(),!0}try{const v=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(i,f,g||u||!W(this.renderedFile,p))||!this.applyPartialRender(p,c,d)){const k=this.fileRenderer.renderFile(p,d);if(k==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(t,k.themeStyles,h,k.baseThemeType),k.headerAST!=null&&this.applyHeaderToDOM(k.headerAST,t,k.file),this.applyFullRender(k,v),this.renderedFile=k.file}this.applyBuffers(v,d),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,r||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(v){if(m)throw v;console.error(v),v instanceof Error&&this.applyErrorToDOM(v,t)}return n||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:i}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;i?.(t,this,"unmount");return}if(t==null)return;const n=this.mounted?"update":"mount";this.mounted=!0,i?.(t,this,n)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,i){return!(e||t||i)}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.file){const{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Xe(e))return;const i=this.options.tokenizeMaxLength??1e5;this.fileRenderer.getOrCreateLineCache(e).length>i||await t.primeFileHighlightCache(e).catch(n=>{Bi(n)||console.error(n)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.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.code=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.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options,i=this.getLatestAnnotations();if(t!=null&&i.length>0)for(const[n,s]of i.entries()){const r=this.getAnnotationSlotName(s),o=`${n}-${r}`;let l=this.annotationCache.get(o);if(l==null||!fo(s,l.annotation)){l?.element.remove();const a=t(s);if(a==null)continue;l={element:ms(r),annotation:s},l.element.appendChild(a),this.fileContainer.appendChild(l.element),this.annotationCache.set(o,l)}e.delete(o)}for(const[n,{element:s}]of e.entries())this.annotationCache.delete(n),s.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 i=vs();i.appendChild(t),this.fileContainer.appendChild(i),this.gutterUtilityContent=i}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??=Ss(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Cs(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,i,n){const s=e.shadowRoot??e.attachShadow({mode:"open"}),r=n??i,o=this.getTheme(),l=typeof o=="string"?o:{...o},a=ut(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===r&&this.appliedThemeCSS.scrollbarGutter===a){this.appliedThemeCSS.theme=l;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:l,themeStyles:t,themeType:r,baseThemeType:n,scrollbarGutter:a};return}this.themeCSSStyle=Hs({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:ks(t,r,a)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:l,themeStyles:t,themeType:r,baseThemeType:n,scrollbarGutter:a}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=Ls(this.themeCSSStyle.textContent??"",ut(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Es()}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e);const i=this.code=Ft({code:this.code}),n=this.fileRenderer.renderCodeAST(e);this.editor?.__captureFocusForDOMReplacement();const s=()=>{if(i.childElementCount>=2)for(let r=0;r<2;r++){const o=i.children[r],l=n[r];o.innerHTML=X(l.children),o.style.cssText=l.properties.style}else i.innerHTML=X(n);t.contains(i)||t.replaceChildren(i)};this.shouldGuardRebuildScroll()?ki(t,s):s(),this.lastRowCount=e.rowCount}applyPartialRender(e,t,i){if(t==null||i==null)return!1;const{code:n}=this,s=n!=null?this.getColumns(n):void 0;if(n==null||s==null)return!1;const r=t.startingLine,o=i.startingLine,l=t.totalLines===1/0?Number.POSITIVE_INFINITY:r+t.totalLines,a=i.totalLines===1/0?Number.POSITIVE_INFINITY:o+i.totalLines,h=Math.max(r,o),d=Math.min(l,a);if(d<=h)return!1;if(!this.trimDOMToOverlap(s.gutter,h,d)||!this.trimDOMToOverlap(s.content,h,d))throw new Error("File.applyPartialRender: failed to trim to overlap");let{length:c}=s.content.children;const u=(m,y)=>{if(!(y<=0))return this.fileRenderer.renderFile(e,{startingLine:m,totalLines:y,bufferBefore:0,bufferAfter:0})},f=od?u(d,g):void 0;return p===void 0&&a>d?!1:(this.cleanupErrorWrapper(),f!=null&&(s.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(f.gutterAST)),s.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(f.contentAST)),c+=f.rowCount),p!=null&&(s.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(p.gutterAST)),s.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(p.contentAST)),c+=p.rowCount),this.lastRowCount!==c&&(s.gutter.style.setProperty("grid-row",`span ${c}`),s.content.style.setProperty("grid-row",`span ${c}`),this.lastRowCount=c),!0)}getColumns(e){const t=e.children[0],i=e.children[1];if(!(!(t instanceof HTMLElement)||!(i instanceof HTMLElement)||t.dataset.gutter==null||i.dataset.content==null))return{gutter:t,content:i}}trimDOMToOverlap(e,t,i){const n=this.getDOMBoundaryIndices(e,[t,i]),s=n.get(t)??e.children.length,r=n.get(i)??e.children.length;if(s>r)return!1;for(let o=e.children.length-1;o>=r;o-=1)e.children[o]?.remove();for(let o=s-1;o>=0;o-=1)e.children[o]?.remove();return!0}getDOMBoundaryIndices(e,t){const i=[...new Set(t)].sort((l,a)=>l-a),n=new Map;if(i.length===0)return n;let s=0,r=i[s];const{children:o}=e;r===0&&(n.set(0,0),s+=1,r=i[s]);for(let l=0;l=r;)n.set(r,l),s+=1,r=i[s];if(s>=i.length)break}}for(const l of i)n.has(l)||n.set(l,o.length);return n}getLineIndexFromDOMNode(e){const t=e.dataset.lineIndex;if(t==null)return;const i=Number(t);return Number.isNaN(i)?void 0:i}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}applyHeaderToDOM(e,t,i){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const n=this.cachedHeaderHTML??X(e);if(this.cachedHeaderHTML=n,n!==this.lastRenderedHeaderHTML){const a=document.createElement("div");a.innerHTML=n;const h=a.firstElementChild;if(!(h instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(h,this.headerElement):t.shadowRoot?.prepend(h),this.headerElement=h,this.lastRenderedHeaderHTML=n}if(this.isContainerManaged)return;const{renderHeaderPrefix:s,renderHeaderFilenameSuffix:r,renderCustomHeader:o,renderHeaderMetadata:l}=this.options;if(o!=null){const a=o(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Pi,a),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{const a=s?.(i)??void 0,h=r?.(i)??void 0,d=l?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Ii,a),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Mi,h),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Di,d),this.headerCustom?.remove(),this.headerCustom=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,i,n){if(n==null){t?.remove();return}const s=t??this.createHeaderSlotElement(i);return t==null&&e.appendChild(s),this.replaceHeaderSlotContent(s,n),s}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}getOrCreateFileContainerNode(e,t){const{fileContainer:i}=this,n=e??i??document.createElement("diffs-container"),s=i!==n;return i!=null&&s&&this.editor?.__captureFocusForDOMReplacement(),s&&this.emitPostRender(!0),this.fileContainer=n,i!=null&&s&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),s&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const i of t.children)i instanceof SVGElement?this.spriteSVG??=i:ft(i)&&i.hasAttribute("data-theme-css")?(this.themeCSSStyle??=i,this.hasAdoptedThemeCSS=!0):ft(i)&&i.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=i,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const i=document.createElement("div");i.innerHTML=ps;const n=i.firstChild;n instanceof SVGElement&&(this.spriteSVG=n)}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.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(const t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute("data-code")){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){const{overflow:i="scroll",disableLineNumbers:n=!1}=this.options,s={type:"file",split:!1,overflow:i,disableLineNumbers:n,diffIndicators:"none",disableBackground:!0,totalLines:t};gs(s,this.appliedPreAttributes)||(xs(e,s),this.appliedPreAttributes=s)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const i=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",i.appendChild(this.errorWrapper);const n=document.createElement("div");n.dataset.errorMessage="",n.innerText=e.message,this.errorWrapper.appendChild(n);const s=document.createElement("pre");s.dataset.errorStack="",s.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(s)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Ao(e,t,i=!1){return!i&&e==null&&t!=null}function Ho(e,t,i=!1){return e==null&&t!=null&&!i}function zt(e){return{...Fi,...e}}function xe(e,t){return pt(e,t)+Io(e,t)}function pt(e,t){return t?0:e.diffHeaderHeight}function Io(e,t){return e.paddingTop??(t?e.spacing:0)}function Gt(e){return e.paddingBottom??e.spacing}function Mo(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}const Do=5e3,kt=new Map;let Po=-1;function Fo(e,t){return(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.unsafeCSS!==t.unsafeCSS}var Oo=class extends To{virtualizer;metrics;__id=`virtualized-file:${++Po}`;renderType="virtualized";top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0,ghostTextRows:kt};pendingRender;isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,i=Fi,n,s=!1){super(e,n,s),this.virtualizer=t,this.metrics=i}setMetrics(e,t=!1){const i=zt(e);!t&&Ze(this.metrics,i)||(this.metrics=i,this.resetLayoutCache())}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}hasLineAnnotations(){return this.getLatestAnnotations().some(e=>e.lineNumber>0)}hasUniformLineHeights(){const{overflow:e="scroll"}=this.options;return e==="scroll"&&!this.hasLineAnnotations()&&this.cache.heights.size===0}getLineHeight(e,t=!1){const i=this.cache.heights.get(e);if(i!=null)return i;const n=t?2:1;return this.metrics.lineHeight*n}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,i=!zi(t,e),n=Fo(t,e);super.setOptions(e),n&&this.resetLayoutCache(!0),i&&(this.forceRenderOverride=!0),i&&this.virtualizer.instanceChanged(this,n)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache(e=!1,t=!0){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.ghostTextRows=kt,this.renderRange!=null&&t&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}applyGhostTextRows(e){const{heights:t,ghostTextRows:i}=this.cache;if(i===e)return!1;const{lineHeight:n}=this.metrics;let s=!1;for(const r of new Set([...i.keys(),...e.keys()])){const o=i.get(r)??0,l=e.get(r)??0;if(l===o)continue;const a=(t.get(r)??n)-o*n+l*n;a===n?t.delete(r):t.set(r,a),s=!0}return this.cache.ghostTextRows=e,s}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.getLayoutFile()==null)return this.height!==0&&(e=!0),this.height=0,e;const{overflow:t="scroll"}=this.options;this.top=this.getVirtualizedTop();const i=this.editor?.__getGhostTextRows()??kt;e=this.applyGhostTextRows(i);const n=t!=="scroll"||this.getLatestAnnotations().length>0||this.isResizeDebuggingEnabled();if(this.placeHolder!=null||!n&&this.cache.heights.size===0&&this.cache.fileAnnotationHeight===0)return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;const{lineHeight:s}=this.metrics;if(this.code==null)return e;const r=this.code.children[1];if(!(r instanceof HTMLElement))return e;if(this.renderRange!=null&&Zt(this.renderRange)){const o=zo(r)??0;o!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=o,e=!0)}for(const o of r.children){if(!(o instanceof HTMLElement))continue;const l=o.dataset.lineIndex;if(l==null)continue;const a=Number(l),h=(i.get(a)??0)*s,d=this.cache.heights.get(a);if(!n&&(d==null||d===s+h))continue;let c=o.getBoundingClientRect().height+h,u=!1;o.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in o.nextElementSibling.dataset||"noNewline"in o.nextElementSibling.dataset)&&("noNewline"in o.nextElementSibling.dataset&&(u=!0),c+=o.nextElementSibling.getBoundingClientRect().height);const f=this.getLineHeight(a,u);c!==f&&(e=!0,c===this.metrics.lineHeight*(u?2:1)?this.cache.heights.delete(a):this.cache.heights.set(a,c))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));updateCodeViewLayout(e,t,i,n){const s=!W(this.file,e);s&&this.updateExternalFile(e,n);const{pendingRenderFile:r,layoutFileChanged:o,renderedFileChanged:l,annotationsChanged:a}=this.updatePendingRender(e,n);let h=i?.resetFileLayoutCache===!0||o;i?.metrics!=null&&(this.metrics=i.metrics,h=!0);const{collapsed:d=!1}=this.options;return this.currentCollapsed!==d&&(this.currentCollapsed=d,h=!0),h&&this.resetLayoutCache(),s&&(this.layoutDirty=!0),!this.forceRenderOverride&&(s||l||a)&&(this.forceRenderOverride=!0),this.top=t,this.computeApproximateSize(!1,r),this.height}getLayoutFile(){return this.pendingRender?.file??this.getRenderedFile()}getLinePosition(e){const t=this.getLayoutFile();if(t==null||e<1)return;const{disableFileHeader:i=!1,collapsed:n=!1}=this.options,s=this.fileRenderer.getLineCount(t)-1;if(n)return{top:pt(this.metrics,i),height:0};let r=xe(this.metrics,i);if(s<0)return{top:r,height:0};const o=Math.min(Math.max(e-1,0),s),{lineHeight:l}=this.metrics;if(r+=this.cache.fileAnnotationHeight,this.hasUniformLineHeights())return{top:r+o*l,height:l};const a=this.getLayoutCheckpointBeforeLineIndex(o);r=a?.top??r;for(let h=a?.lineIndex??0;hl?void 0:{lineNumber:u+1,top:r+a+u*d}}let h=r+(o===0?a:this.renderRange.bufferBefore);for(let d=o;d<=l;d++){if(h>=e)return{lineNumber:d+1,top:h};h+=this.getLineHeight(d)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){const t=this.getLayoutFile();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const i=e!=null?this.computeRenderRangeFromWindow(t,this.top,e):this.renderRange;if(i==null)return;const{bufferBefore:n,bufferAfter:s,totalLines:r}=i;let o=0;if(r===0){const l=e??this.virtualizer.getWindowSpecs();this.top0;t&&(this.layoutDirty=!0);const i=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!W(this.getRenderedFile(),this.getLatestFile()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache(),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),i&&this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutFile()){const i=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!i)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(this.editor?.__getGhostTextRows()??kt);const{disableFileHeader:s=!1,collapsed:r=!1}=this.options,{lineHeight:o}=this.metrics,l=this.fileRenderer.getLineCount(t);if(r){this.height+=pt(this.metrics,s),this.layoutDirty=!1;return}const a=xe(this.metrics,s),h=Gt(this.metrics);if(this.height+=a,this.height+=this.cache.fileAnnotationHeight,this.hasUniformLineHeights())this.height+=l*o;else for(let d=0;d0&&(this.height+=h),this.fileContainer!=null&&i&&!n){const d=this.fileContainer.getBoundingClientRect();d.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:t.name,elementHeight:d.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}this.layoutDirty=!1}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.file==null)return;const e=this.getLatestFile(),t=e==null?void 0:this.fileRenderer.getFileForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!W(this.getRenderedFile(),t))}syncGhostTextRows(){const e=this.getAdvancedVirtualizer();e!=null?(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0)):this.getSimpleVirtualizer()?.requestHeightReconcile(this)}applyDocumentChange(e,t,i=!1){const{renderRange:n}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(this.isSimpleMode(),!1);const s=this.getRenderedFile();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(i&&n!=null&&s!=null){const r=this.virtualizer.getWindowSpecs(),o=this.computeRenderRangeFromWindow(s,this.top??0,r);o.bufferAfter!==n.bufferAfter&&this.updateBuffers(o)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}render({fileContainer:e,file:t,forceRender:i=!1,lineAnnotations:n,...s}){const r=!W(this.file,t);r&&(this.updateExternalFile(t,n),this.cachedHeaderHTML=void 0);const{pendingRenderFile:o,layoutFileChanged:l,renderedFileChanged:a,annotationsChanged:h}=this.pendingRender!=null&&this.pendingRender.latestFile===(this.getLatestFile(t)??t)?{pendingRenderFile:this.pendingRender.file,layoutFileChanged:!1,renderedFileChanged:!1,annotationsChanged:this.syncLineAnnotations(n)}:this.updatePendingRender(t,n),{forceRenderOverride:d,isSetup:c}=this;if(this.forceRenderOverride=void 0,l&&this.resetLayoutCache(),e=this.getOrCreateFileContainerNode(e),c)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,o));else{this.computeApproximateSize(!1,o);const p=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(p==null)throw new Error("VirtualizedFile.render: simple virtualizer is not available");p.connect(e,this),this.isVisible=p.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!r||!c))return this.renderPlaceholder(this.height);const u=this.virtualizer.getWindowSpecs(),f=this.top??0,g=this.computeRenderRangeFromWindow(o,f,u);return super.render({file:t,fileContainer:e,renderRange:g,lineAnnotations:n,forceRender:(d??i)||h||a||r,...s})}finalizeRender(){if(this.getRenderedFile()!==this.pendingRender?.file)throw new Error("VirtualizedFile.render: rendered a different file than its prepared layout");this.pendingRender=void 0,this.isSimpleMode()&&this.getSimpleVirtualizer()?.requestHeightReconcile(this)}updatePendingRender(e,t){const i=this.getLatestFile(e)??e,n=this.getRenderedFile(),s=this.pendingRender?.file??n,r=this.fileRenderer.getFileForNextRender(i);return this.pendingRender={latestFile:i,file:r},{pendingRenderFile:r,annotationsChanged:this.syncLineAnnotations(t),layoutFileChanged:!W(s,r),renderedFileChanged:!W(n,r)}}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"}addLayoutCheckpoint(e,t){e%Do===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,i=this.cache.checkpoints.length-1,n;for(;t<=i;){const s=t+i>>1,r=this.cache.checkpoints[s];if(r==null)throw new Error("VirtualizedFile: invalid checkpoint index");r.lineIndex<=e?(n=r,t=s+1):i=s-1}return n}getLayoutCheckpointBeforeTop(e,t){let i=0,n=this.cache.checkpoints.length-1,s=-1;for(;i<=n;){const r=i+n>>1,o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFile: invalid checkpoint index");o.top<=e?(s=r,i=r+1):n=r-1}if(t==null)return s>=0?this.cache.checkpoints[s]:void 0;for(let r=s;r>=0;r--){const o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFile: invalid checkpoint index");if(o.lineIndex%t===0)return o}}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}computeRenderRangeFromWindow(e,t,{top:i,bottom:n}){const{disableFileHeader:s=!1}=this.options,{hunkLineCount:r,lineHeight:o}=this.metrics,l=this.fileRenderer.getLineCount(e),a=this.height,h=xe(this.metrics,s),d=l>0?Gt(this.metrics):0,{fileAnnotationHeight:c}=this.cache,u=h+c,f=Math.max(0,a-h-c-d),g=cs(this.getLatestAnnotations()),p=t+h,m=c>0&&g&&pi;if(tn)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:a-h-d};if(l<=r)return{startingLine:0,totalLines:r,bufferBefore:0,bufferAfter:0};const y=Math.ceil(Math.max(n-i,0)/o),v=Math.ceil(y/r)*r+r,k=v/r,x=(i+n)/2;if(this.hasUniformLineHeights()){const V=t+u,J=V+f;if(!m&&!(Vi))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:a-h-d};const ne=Math.floor(m&&xi-se&&Lx&&(H??=ne),R==null&&L>=n&&J&&(R=b),w++,L+=se}if(E==null)if(m)E=0,H=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:a-h-d};H??=E;const D=Math.round(H-k/2),z=Math.max(0,Math.ceil(l/r)-k),A=Math.max(0,Math.min(D,z)),M=A*r,F=D<0?v+D*r:v,G=C[A]??0,P=M===0?0:c+G,O=A+F/r,N=O({...t,hunkContent:t.hunkContent.map(i=>({...i}))}))}function Ps(e){return{...e,hunks:Ds(e.hunks),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function re(e,t){return e-(t===0?0:1)}function Q(e,t){return re(e,t)+t}const No=1;function jt(e,...t){return`ck${No}:${JSON.stringify([e,...t])}`}function Kt(e){return e!==""?e.split(ur):[]}function Li(e,t,i){const n=e==="clone"?Ps(t):t;if(!n.isPartial)throw new Error("hydratePartialDiff: fileDiff must be partial");switch(n.type){case"change":case"rename-changed":return Bo(n,Uo(n,i),rn(n,i));case"rename-pure":{const s=rn(n,i);Vo(n,i);const r=Kt(s.contents);return n.isPartial=!1,n.deletionLines=r,n.additionLines=r,Fs(n,null,s),n}}throw new Error(`hydratePartialDiff: ${n.type} diffs cannot be hydrated from loaded files`)}function Bo(e,t,i){const n=Kt(t.contents),s=Kt(i.contents),{hunks:r,splitLineCount:o,unifiedLineCount:l}=_o(e.hunks,s.length);return e.hunks=r,e.splitLineCount=o,e.unifiedLineCount=l,e.isPartial=!1,e.deletionLines=n,e.additionLines=s,Fs(e,t,i),e}function _o(e,t){let i=0,n=0,s=0;const r=[];for(const o of e){const l=Math.max(o.additionStart-1,0),a=Math.max(o.deletionStart-1,0);let h=l,d=a,c=0,u=0,f=0,g=0;const p=[];for(const y of o.hunkContent){if(y.type==="context"){p.push({...y,additionLineIndex:h,deletionLineIndex:d}),h+=y.lines,d+=y.lines,f+=y.lines,g+=y.lines;continue}p.push({...y,additionLineIndex:h,deletionLineIndex:d}),h+=y.additions,d+=y.deletions,c+=y.additions,u+=y.deletions,f+=Math.max(y.additions,y.deletions),g+=y.additions+y.deletions}const m=Math.max(re(o.additionStart,o.additionCount)-s,0);r.push({...o,collapsedBefore:m,additionLineIndex:l,deletionLineIndex:a,additionLines:c,deletionLines:u,hunkContent:p,splitLineStart:i+m,unifiedLineStart:n+m,splitLineCount:f,unifiedLineCount:g}),i+=m+f,n+=m+g,s=Q(o.additionStart,o.additionCount)}if(r.length>0){const o=r[r.length-1],l=Q(o.additionStart,o.additionCount),a=Math.max(t-l,0);i+=a,n+=a}return{hunks:r,splitLineCount:i,unifiedLineCount:n}}function Uo(e,t){if(t.oldFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function rn(e,t){if(t.newFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function Vo(e,t){if(t.oldFile!==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function Wo(e,t,i){return e.cacheKey!=null?`${e.cacheKey}:hydrated`:qo(t,i)}function Fs(e,t,i){const n=Wo(e,t,i);if(n==null){delete e.cacheKey;return}e.cacheKey=n}function qo(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?jt("hydrated-files",e.cacheKey,t.cacheKey):void 0:e?.cacheKey??t?.cacheKey}function me(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const $o=new TextEncoder,Go=new TextDecoder("utf-8",{ignoreBOM:!0}),jo=/[\uD800-\uDFFF]/,wi=1024;let je=new Uint8Array(wi);function Os(){je.length!==wi&&(je=new Uint8Array(wi))}function q(e){if(e.length===0)return e;if(jo.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;je.length="0"&&e[i+1]<="7");t+=Ko.decode(new Uint8Array(r))}}function Qo(e,t){const i=e.charCodeAt(t)-48,n=e.charCodeAt(t+1)-48,s=e.charCodeAt(t+2)-48;if(i>=0&&i<=3&&n>=0&&n<=7&&s>=0&&s<=7)return i*64+n*8+s}const Jo=4096,Zo=.5;function ea(e){for(const t of e.hunks)for(let i=0;i0&&r.deletions>0||o.type!=="context")continue;const l=r.additions>0,a=l?t.additionLines:t.deletionLines,h=l?r.additionLineIndex:r.deletionLineIndex,d=l?r.additions:r.deletions,c=a[h]??"";if(c.trim()!=="")continue;let u=!0;for(let y=1;yJo)return null;const a=[];for(let p=0;pi;let c=0,u=-1;for(let p=0;p<=l;p++){let m=0;for(let y=0;yu&&(u=m,c=p)}if(c===0)return null;const f=[],g=(p,m,y,v)=>{(p>0||m>0)&&f.push({type:"change",deletions:p,additions:m,deletionLineIndex:y,additionLineIndex:v})};return d?(g(0,c,s,r),g(o,o,s,r+c),g(0,n-o-c,s+o,r+c+o)):(g(c,0,s,r),g(o,o,s+c,r),g(i-o-c,0,s+c+o,r+o)),f}const na=/\s+/g;function on(e){return e.replace(na,"")}function sa(e,t){if(e===t)return 1;const i=Math.max(e.length,t.length),n=Math.min(e.length,t.length);if(n===0)return 0;let s=0;for(;s0&&(f[f.length-1]===` -`||f[f.length-1]==="\r"||f[f.length-1]===`\r -`||f[f.length-1]==="");)f.pop();const{additionStart:x,deletionStart:b}=p;d=h?d:b-1,c=h?c:x-1;const C={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:x,additionLines:m,deletionCount:p.deletionCount,deletionStart:b,deletionLines:y,deletionLineIndex:d,additionLineIndex:c,hunkContent:[],hunkContext:hn(p.hunkContext),hunkSpecs:q(g),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let S=0,L=0;for(let w=1;w=C.additionCount&&L>=C.deletionCount&&!E.startsWith("\\")){if(!(ua(E)&&!fa(E)))break;if(r)throw Error("parsePatchContent: hunk has more lines than expected")}const H=E[0];if(H!=="+"&&H!=="-"&&H!==" "&&H!=="\\"){if(r)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${H}", full line: "${E}"`),console.error("processFile: invalid rawLine:",E);continue}const R=ma(H);if(R==="addition"){if(r&&S>=C.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const T=oi(E);(v==null||v.type!=="change")&&(v=ai("change",d,c),C.hunkContent.push(v)),c++,S++,h&&a.additionLines.push(T),v.additions++,m++,k="addition"}else if(R==="deletion"){if(r&&L>=C.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const T=oi(E);(v==null||v.type!=="change")&&(v=ai("change",d,c),C.hunkContent.push(v)),d++,L++,h&&a.deletionLines.push(T),v.deletions++,y++,k="deletion"}else if(R==="context"){if(r&&(L>=C.deletionCount||S>=C.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const T=oi(E);(v==null||v.type!=="context")&&(v=ai("context",d,c),C.hunkContent.push(v)),c++,d++,S++,L++,h&&(a.deletionLines.push(T),a.additionLines.push(T)),v.lines++,k="context"}else if(R==="metadata"&&v!=null){if(v.type==="context"?(C.noEOFCRAdditions=!0,C.noEOFCRDeletions=!0):k==="deletion"?C.noEOFCRDeletions=!0:k==="addition"&&(C.noEOFCRAdditions=!0),h&&(k==="addition"||k==="context")){const T=a.additionLines.length-1;T>=0&&(a.additionLines[T]=me(a.additionLines[T]))}if(h&&(k==="deletion"||k==="context")){const T=a.deletionLines.length-1;T>=0&&(a.deletionLines[T]=me(a.deletionLines[T]))}}}if(S!==C.additionCount||L!==C.deletionCount){if(r)throw Error("parsePatchContent: hunk line count mismatch");console.error(`parsePatchContent: hunk line count mismatch: "${g.trimEnd()}", declared old/new ${C.deletionCount}/${C.additionCount}, parsed old/new ${L}/${S}`);const w=re(C.additionStart,C.additionCount)+(S===0?0:1),E=re(C.deletionStart,C.deletionCount)+(L===0?0:1);if(!h){const H=w-C.additionStart,R=E-C.deletionStart;C.additionLineIndex+=H,C.deletionLineIndex+=R;for(const T of C.hunkContent)T.additionLineIndex+=H,T.deletionLineIndex+=R}C.additionStart=w,C.deletionStart=E,C.additionCount=S,C.deletionCount=L}C.additionLines=m,C.deletionLines=y,C.collapsedBefore=Math.max(re(C.additionStart,C.additionCount)-o,0),a.hunks.push(C),o=Q(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(r&&h&&!i&&a.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(a.hunks.length>0&&!h&&a.additionLines.length>0&&a.deletionLines.length>0){const u=a.hunks[a.hunks.length-1],f=Q(u.additionStart,u.additionCount),g=a.additionLines.length,p=Math.max(g-f,0);a.splitLineCount+=p,a.unifiedLineCount+=p}return i||(a.prevName!=null&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(n==null||n.contents==="")&&s!=null&&s.contents!==""?a.type="new":n!=null&&n.contents!==""&&(s==null||s.contents==="")&&(a.type="deleted")),a.type!=="rename-pure"&&a.type!=="rename-changed"&&(a.prevName=void 0),ea(a),a}}function Sd(e,t,i=!1){const n=[],s=la(e)?e.split(cr):[e];for(const r of s)try{n.push(oa(r,t,i,t!=null?n.length:void 0))}catch(o){if(i)throw o;console.error(o)}finally{Os()}return n}function nt(e,t=!1){const i=e.trim(),n=i.startsWith('"')?Xo(i)?.fileName??i:i;return t&&(n.startsWith("a/")||n.startsWith("b/"))?n.slice(2):n}function la(e){return e.startsWith("From ")||e.includes(` -From `)}function an(e){const t=Ns(e);for(let i=0;ii&&t.push(e.slice(i,n)),i=n,o=!0,n=xi(e,l);continue}if(o&&e.startsWith("@@ -",n)){const h=_s(e.slice(n,l));h!=null&&(s=h.deletionCount,r=h.additionCount)}n=l;continue}const a=e[n];if(a==="\\"){n=l;continue}a===" "?(s=Math.max(s-1,0),r=Math.max(r-1,0)):a==="-"?s=Math.max(s-1,0):a==="+"&&(r=Math.max(r-1,0)),n=l}return t.push(e.slice(i)),t}function ca(e){return Bs(e,0)}function Bs(e,t){const i=xi(e,t);return ln(e,t,"---")&&ln(e,i,"+++")}function ln(e,t,i){if(!e.startsWith(i,t))return!1;const n=e[t+i.length];if(n!==" "&&n!==" ")return!1;for(let s=t+i.length+1;s9)break;n=n*10+s}if(i!==t)return{value:n,endIndex:i}}function pa(e){return e.endsWith(`\r +}`}function js(e,t){const i=Ws(t);return e.replace(Qo,i)}function Zo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Jo=new WeakMap;function Qi(e){const t=Jo.get(e);return t??e}function Wt({code:e,pre:t,columnType:i,rowSpan:n,containerSize:s=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),i!=null&&e.setAttribute(`data-${i}`,""),t?.appendChild(e)),n!=null?e.style.setProperty("grid-row",`span ${n}`):e.style.removeProperty("grid-row"),s?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function Ks(e,t){if(t==null)return;const i=e.shadowRoot??e.attachShadow({mode:"open"});i.innerHTML===""&&(i.innerHTML=t)}function Ys(e,{type:t,diffIndicators:i,disableBackground:n,disableLineNumbers:s,overflow:r,split:o,totalLines:a,customProperties:l}){if(l!=null)for(const d in l){const h=l[d];h!=null&&e.setAttribute(d,`${h}`)}switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),i){case"bars":case"classic":e.setAttribute("data-indicators",i);break;case"none":e.removeAttribute("data-indicators")}return s?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),n?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",o?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",r),e.style.setProperty("--diffs-min-number-column-width-default",`${`${a}`.length}ch`),e}function vt(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}let ea,ta;function Xs(){return ea??="safari"in window&&"pushNotification"in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ia(){return ta??=/\bFirefox\//.test(navigator.userAgent)}function Zt(e,t,i){const n=new Map;for(const s of e){const r=Qi(s);n.set(r,i?.slotNames.get(r)??t(s))}return{provided:e,current:e,slotNames:n}}function Qs(e,t,i){for(const n of t){const s=Qi(n);e.slotNames.has(s)||e.slotNames.set(s,i(n))}e.provided=t,e.current=t}function Zs(e,t,i){if(e==null)return i(t);const n=Qi(t);let s=e.slotNames.get(n);return s==null&&(s=i(t),e.slotNames.set(n,s)),s}function Js(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function yn(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:Js(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Ti(e,t){const i=e?.offsetHeight??0;if(e==null||i===0){t();return}e.style.minHeight=`${i}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=""}}function er({shadowRoot:e,currentNode:t,themeCSS:i}){if(i.trim()===""){t?.remove();return}return t??=na(),t.textContent=i,t.parentNode!==e&&e.appendChild(t),t}function na(){const e=document.createElement("style");return e.setAttribute(zr,""),e}var Ye=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated"),this.name="WorkerPoolTerminatedError"}},ct=class extends Error{constructor(){super("WorkerPoolManager: operation canceled before the task completed"),this.name="WorkerPoolTaskCanceledError"}},tr=class extends Error{constructor(e,t){super(e,t),this.name="WorkerPoolWorkerError"}};const ir=new WeakSet;function sa(e){ir.add(e)}function ra(e){return e instanceof Ye||e instanceof ct}function ai(e){return ra(e)||e instanceof tr&&ir.has(e)}if(typeof HTMLElement<"u"&&customElements.get("diffs-container")==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const n=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(Xo)),n.adoptedStyleSheets=[e]}connectedCallback(){const n=this.shadowRoot??this.attachShadow({mode:"open"});mt(n)}}customElements.define(ss,t)}const oa=[""];function aa(e){const t={...e};return delete t.cacheKey,t}let la=-1;var da=class{options;workerManager;requestOwnerRender;static LoadedCustomComponent=!0;__id=`file:${++la}`;type="file";fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerFilenameSuffix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;get lineAnnotations(){return this.renderedData?.lineAnnotations??as}managersDirty=!1;file;editSession;renderedData;pendingData;forceRenderOverride;renderRange;enabled=!0;editor;constructor(e={theme:q},t,i){this.options=e,this.workerManager=t,this.requestOwnerRender=i,this.fileRenderer=new jo(e,this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager),this.resizeManager=new Ls,this.interactionManager=new ks("file",Xt(e)),this.workerManager?.subscribeToThemeChanges(this)}getAnnotationSlotName=e=>Zs(this.editSession?.annotations,e,ge);handleHighlightRender=()=>{this.rerender()};rerender(){const e=this.getInputFile();!this.enabled||e==null||this.requestRender()||this.render({file:e,forceRender:!0,renderRange:this.renderRange})}requestRender(){const{requestOwnerRender:e}=this;return this.editSession!=null||e==null?!1:(this.forceRenderOverride=!0,e(),!0)}get isComponentManaged(){return this.requestOwnerRender!=null}getTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??q}getInputFile(){return this.file}getWorkingFile(e=this.file){return this.editSession?.file??e}getRenderedFile(){return this.renderedData?.file}__getNextRenderData({file:e,lineAnnotations:t}){const i=this.editSession?.annotations;if(i!=null)return{file:e,lineAnnotations:t!=null&&this.isNewAnnotations(t)?t:i.provided};const n=this.getWorkingFile(e)??e,s=this.fileRenderer.getFileForNextRender(n);return{file:s,lineAnnotations:t!=null&&B(s,n)?t:this.getAnnotationsForFile(s)}}getLatestAnnotations(){return this.pendingData?.lineAnnotations??this.editSession?.annotations?.current??this.lineAnnotations}getAnnotationsForFile(e){const{pendingData:t}=this;return t!=null&&B(e,t.file)?t.lineAnnotations:this.lineAnnotations}adoptRenderData(e){const{pendingData:t}=this,i=t!=null&&B(e,t.file);this.renderedData={file:e,lineAnnotations:i?t.lineAnnotations:this.lineAnnotations},i&&(this.pendingData=void 0)}isNewAnnotations(e){const t=this.editSession?.annotations;return e===this.getLatestAnnotations()?!1:t==null||e!==t.provided&&e!==t.current}updateInputFile(e,t){if(B(this.getInputFile(),e))return!1;const i=this.editSession!=null,n=this.getLatestAnnotations();return this.file=e,i||this.editor!=null?this.installEditSession(e,i?void 0:this.editor?.__getDocumentContents(e),!0):this.editSession=void 0,this.editSession?.annotations!=null&&t!=null&&(this.editSession.annotations=Zt(t,ge,this.editSession.annotations)),this.pendingData={file:this.editSession?.file??e,lineAnnotations:this.editSession?.annotations?.current??t??n},!0}installEditSession(e,t,i=!1){const n=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===e.contents,s=aa(t??e),r=this.editSession?.annotations??Zt(this.getLatestAnnotations(),ge);this.editSession={file:s,inputFile:e,externalReplacement:i&&n,annotations:r},this.pendingData={file:s,lineAnnotations:r.current},this.fileRenderer.beginEditSession(s,n?e:void 0)}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Xt(this.options))}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&&!Fe(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){const t=this.editSession?.annotations;if(t!=null){if(!this.isNewAnnotations(e))return;Qs(t,e,ge)}const i=this.getWorkingFile();i!=null&&(this.pendingData={file:i,lineAnnotations:e})}syncEditSessionAnnotationsFromEditor(e){const t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.renderedData!=null&&(this.renderedData.lineAnnotations=e),this.pendingData=void 0,this.fileRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??"additions"})}getCodeScrollLeft(){return this.code?.scrollLeft??0}setCodeScrollLeft(e){this.code!=null&&(this.code.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.fileRenderer.getEffectiveCodeOptions()}}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{overflow:e="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:e==="wrap",columnVariables:this.shouldApplyColumnVariables(e)?"apply":"measure"}),this.managersDirty=!1}shouldApplyColumnVariables(e){return e==="scroll"&&this.lineAnnotations.length>0}cleanUp(e=!1){const t=this.editor;this.emitPostRender(!0),t?.cleanUp(e?"recycle":"discard"),e||(this.editor=void 0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isComponentManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.renderedData=void 0,this.pendingData=void 0),this.clearAuxiliaryNodes(),this.pre?.remove(),this.pre=void 0,this.code=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement?.remove(),this.headerElement=void 0,this.clearHeaderSlots(),this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=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.placeHolder?.remove(),this.placeHolder=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0,this.editSession=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{fileContainer:t,prerenderedHTML:i,preventEmit:n=!1,file:s,lineAnnotations:r}=e;if(!this.enabled)throw new Error("File.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw new Error("File.hydrate: hydrate can only be called before the instance has rendered or hydrated");this.hydrateElements(t,i);const o=this.editor!=null;o||ha(this.pre,s,this.options.collapsed)||ca(this.headerElement,s,this.options.disableFileHeader)?this.render({...e,forceRender:o||e.forceRender,preventEmit:!0}):this.hydrationSetup({file:s,lineAnnotations:r}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Ks(e,t);for(const i of Array.from(e.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i,this.appliedPreAttributes=void 0;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-theme-css")){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.textContent;continue}if("diffsHeader"in i.dataset){this.headerElement=i,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.renderedData={file:e,lineAnnotations:t??this.getLatestAnnotations()},this.pendingData=void 0,this.file=e,this.fileRenderer.setOptions(yn(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.getWorkingFile()){return e!=null?this.fileRenderer.getOrCreateLineCache(e):oa}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}syncRenderViewToEditor(){const{editor:e,fileContainer:t,renderRange:i}=this,n=this.getLatestAnnotations(),s=this.getWorkingFile();if(e==null||t==null||s==null)return;const r=d=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.getWorkingFile()!==s||e.__syncRenderView({highlighter:d,fileContainer:t,file:s,lineAnnotations:n,renderRange:i,externalDocument:this.editSession?.externalReplacement===!0})},o=this.getTheme(),a=s.lang??j(s.name),l=$({theme:o,lang:a});l!=null?r(l):it({themes:fe(o),langs:Array.from(new Set(["text",a])),preferredHighlighter:Ct(this.workerManager,this.options)}).then(r).catch(d=>{d instanceof ve||console.error(d)})}__acknowledgeDocumentUpdate(){this.editSession!=null&&(this.editSession.externalReplacement=!1)}__acceptEditorChange(e){const{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}emitEditChange(e){const{onEditChange:t}=this.options;t?.(e)}__captureDocumentSessionState(){}__attachEditor(e){if(this.editor!=null)throw new Error("File.__attachEditor: an editor is already attached");this.editor=e;const t=()=>{this.editor=void 0,this.fileRenderer.endEditSession()};try{return this.resumeEditorRendering(e),t}catch(i){throw t(),i}}__resumeEditor(e){if(this.editor!==e)throw new Error("File.__resumeEditor: editor association changed");this.resumeEditorRendering(e)}resumeEditorRendering(e){if(this.editSession!=null)this.fileRenderer.beginEditSession(this.editSession.file);else{const i=this.getInputFile();i!=null&&this.installEditSession(i,e.__getDocumentContents(i))}const t=this.editSession?.file;this.fileRenderer.editorRenderReady()?(t!=null&&this.fileRenderer.fileCache===t&&this.adoptRenderData(t),this.syncRenderViewToEditor()):this.rerender()}__completeEditSession(e,t){this.settleEditSession(t==="install",e)}settleEditSession(e,t){const{editSession:i}=this;if(i==null)return;const{file:n,inputFile:s,annotations:r}=i,o=r?.provided??this.lineAnnotations;if(this.editor!=null)throw new Error("File.__completeEditSession: detach the editor before completing the session");const a=r?.current;let l,d=!1,h;if(t==null)throw new Error("File.__completeEditSession: editor is required for completion");const c={...n},u={file:c,editor:t,originalFile:s,lineAnnotations:a,originalLineAnnotations:o};Object.freeze(u);try{if(t.__emitEditComplete(u),this.options.onEditComplete?.(u)==="accept"){if(c.cacheKey!=null&&c.cacheKey===s.cacheKey)throw new Error("File.__completeEditSession: an accepted file must not reuse the replaced file cacheKey");l=c}}catch(p){d=!0,h=p}const f=e&&l!=null?l:s,g=e&&l!=null?a??o:o;if(this.editSession=void 0,this.file=f,this.pendingData={file:f,lineAnnotations:g},this.fileRenderer.endEditSession(f),B(this.getRenderedFile(),f)&&this.adoptRenderData(f),e&&this.fileContainer!=null&&this.rerender(),d)throw h}applyDocumentChange(e,t){const i=this.editSession?.file;if(i==null)throw new Error("File.applyDocumentChange: requires an active edit session");this.fileRenderer.beginEditSession(i),this.fileRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}applySuspendedDocumentChange(e,t){this.editSession!=null&&(this.applyDocumentChange(e,t),this.fileRenderer.clearRenderCache())}updateRenderCache(e,t,i){const n=this.editSession?.file;if(n==null)throw new Error("File.updateRenderCache: requires an active edit session");this.fileRenderer.beginEditSession(n),this.fileRenderer.updateRenderCache(e,t,i?.lineCountChangeInFlight)}render({file:e,fileContainer:t,forceRender:i=!1,preventEmit:n=!1,containerWrapper:s,deferManagers:r=!1,lineAnnotations:o,renderRange:a}){if(!this.enabled)throw new Error("File.render: attempting to call render after cleaned up");i=this.forceRenderOverride??i,this.forceRenderOverride=void 0,this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:l=!1,themeType:d="system"}=this.options,h=l?void 0:a,c=this.renderRange,u=this.hasThemeChanged(),f=o!=null&&(o.length>0||this.getLatestAnnotations().length>0)?this.isNewAnnotations(o):!1,g=!B(this.getInputFile(),e);g&&this.updateInputFile(e,o);const p=this.getWorkingFile(e)??e;if(!l&&!i&&ri(h,this.renderRange)&&!g&&!f&&!u){const y=this.applyCachedThemeState(d);return y&&this.finalizeRender(),y}this.renderRange=h,g&&(this.cachedHeaderHTML=void 0),this.fileRenderer.setOptions(yn(this.options)),this.syncInteractionOptions(),o!=null&&this.setLineAnnotations(o);const m=this.fileRenderer.getFileForNextRender(p);this.fileRenderer.setLineAnnotations(this.getAnnotationsForFile(m));const{disableErrorHandling:v=!1,disableFileHeader:k=!1}=this.options;if(k&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,s),this.applyCachedThemeState(d),l){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const y=this.fileRenderer.renderFile(p,ls);y!=null&&this.applyThemeState(t,y.themeStyles,d,y.baseThemeType),y?.headerAST!=null&&this.applyHeaderToDOM(y.headerAST,t,y.file),this.adoptRenderData(y?.file??p),this.injectUnsafeCSS()}catch(y){if(v)throw y;console.error(y),y instanceof Error&&this.applyErrorToDOM(y,t)}return this.finalizeRender(),n||this.emitPostRender(),!0}try{const y=this.getOrCreatePreNode(t);let b=this.getRenderedFile();if(!this.canPartiallyRender(i,f,g||u||!B(this.getRenderedFile(),p))||!this.applyPartialRender(p,c,h)){const C=this.fileRenderer.renderFile(p,h);if(C==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(t,C.themeStyles,d,C.baseThemeType),C.headerAST!=null&&this.applyHeaderToDOM(C.headerAST,t,C.file),this.applyFullRender(C,y),b=C.file}this.applyBuffers(y,h),this.injectUnsafeCSS(),b!=null&&this.adoptRenderData(b),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,r||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(y){if(v)throw y;console.error(y),y instanceof Error&&this.applyErrorToDOM(y,t)}return n||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:i}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;i?.(t,this,"unmount");return}if(t==null)return;const n=this.mounted?"update":"mount";this.mounted=!0,i?.(t,this,n)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,i){return!(e||t||i)}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.getInputFile()){const{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||et(e))return;const i=this.options.tokenizeMaxLength??1e5;this.fileRenderer.getOrCreateLineCache(e).length>i||await t.primeFileHighlightCache(e).catch(n=>{ai(n)||console.error(n)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.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.code=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.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isComponentManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options,{renderedData:i}=this;if(t!=null&&i!=null){const{file:n,lineAnnotations:s}=i;for(const[r,o]of s.entries()){const a=this.getAnnotationSlotName(o),l=`${r}-${a}`;let d=this.annotationCache.get(l);if(d==null||d.file!==n||!Ko(o,d.annotation)){d?.element.remove();const h=t(o,n);if(h==null)continue;d={element:Bs(a),annotation:o,file:n},d.element.appendChild(h),this.fileContainer.appendChild(d.element),this.annotationCache.set(l,d)}e.delete(l)}}for(const[n,{element:s}]of e.entries())this.annotationCache.delete(n),s.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 i=Vs();i.appendChild(t),this.fileContainer.appendChild(i),this.gutterUtilityContent=i}injectUnsafeCSS(){const{unsafeCSS:e}=this.options;this.pre?.toggleAttribute("data-custom-styles",!!e);const 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??=Us(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=qs(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,i,n){const s=e.shadowRoot??e.attachShadow({mode:"open"}),r=n??i,o=this.getTheme(),a=typeof o=="string"?o:{...o},l=mt(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===r&&this.appliedThemeCSS.scrollbarGutter===l){this.appliedThemeCSS.theme=a;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:a,themeStyles:t,themeType:r,baseThemeType:n,scrollbarGutter:l};return}this.themeCSSStyle=er({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:Gs(t,r,l)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:a,themeStyles:t,themeType:r,baseThemeType:n,scrollbarGutter:l}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=js(this.themeCSSStyle.textContent??"",mt(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Xs()}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e);const i=this.code=Wt({code:this.code}),n=this.fileRenderer.renderCodeAST(e);this.editor?.__captureFocusForDOMReplacement();const s=()=>{if(i.childElementCount>=2)for(let r=0;r<2;r++){const o=i.children[r],a=n[r];o.innerHTML=Y(a.children),o.style.cssText=a.properties.style}else i.innerHTML=Y(n);t.contains(i)||t.replaceChildren(i)};this.shouldGuardRebuildScroll()?Ti(t,s):s(),this.lastRowCount=e.rowCount}applyPartialRender(e,t,i){if(t==null||i==null)return!1;const{code:n}=this,s=n!=null?this.getColumns(n):void 0;if(n==null||s==null)return!1;const r=t.startingLine,o=i.startingLine,a=t.totalLines===1/0?Number.POSITIVE_INFINITY:r+t.totalLines,l=i.totalLines===1/0?Number.POSITIVE_INFINITY:o+i.totalLines,d=Math.max(r,o),h=Math.min(a,l);if(h<=d)return!1;if(!this.trimDOMToOverlap(s.gutter,d,h)||!this.trimDOMToOverlap(s.content,d,h))throw new Error("File.applyPartialRender: failed to trim to overlap");let{length:c}=s.content.children;const u=(m,v)=>{if(!(v<=0))return this.fileRenderer.renderFile(e,{startingLine:m,totalLines:v,bufferBefore:0,bufferAfter:0})},f=oh?u(h,g):void 0;return p===void 0&&l>h?!1:(this.cleanupErrorWrapper(),f!=null&&(s.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(f.gutterAST)),s.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(f.contentAST)),c+=f.rowCount),p!=null&&(s.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(p.gutterAST)),s.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(p.contentAST)),c+=p.rowCount),this.lastRowCount!==c&&(s.gutter.style.setProperty("grid-row",`span ${c}`),s.content.style.setProperty("grid-row",`span ${c}`),this.lastRowCount=c),!0)}getColumns(e){const t=e.children[0],i=e.children[1];if(!(!(t instanceof HTMLElement)||!(i instanceof HTMLElement)||t.dataset.gutter==null||i.dataset.content==null))return{gutter:t,content:i}}trimDOMToOverlap(e,t,i){const n=this.getDOMBoundaryIndices(e,[t,i]),s=n.get(t)??e.children.length,r=n.get(i)??e.children.length;if(s>r)return!1;for(let o=e.children.length-1;o>=r;o-=1)e.children[o]?.remove();for(let o=s-1;o>=0;o-=1)e.children[o]?.remove();return!0}getDOMBoundaryIndices(e,t){const i=[...new Set(t)].sort((a,l)=>a-l),n=new Map;if(i.length===0)return n;let s=0,r=i[s];const{children:o}=e;r===0&&(n.set(0,0),s+=1,r=i[s]);for(let a=0;a=r;)n.set(r,a),s+=1,r=i[s];if(s>=i.length)break}}for(const a of i)n.has(a)||n.set(a,o.length);return n}getLineIndexFromDOMNode(e){const t=e.dataset.lineIndex;if(t==null)return;const i=Number(t);return Number.isNaN(i)?void 0:i}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}applyHeaderToDOM(e,t,i){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const n=this.cachedHeaderHTML??Y(e);if(this.cachedHeaderHTML=n,n!==this.lastRenderedHeaderHTML){const l=document.createElement("div");l.innerHTML=n;const d=l.firstElementChild;if(!(d instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(d,this.headerElement):t.shadowRoot?.prepend(d),this.headerElement=d,this.lastRenderedHeaderHTML=n}if(this.isComponentManaged)return;const{renderHeaderPrefix:s,renderHeaderFilenameSuffix:r,renderCustomHeader:o,renderHeaderMetadata:a}=this.options;if(o!=null){const l=o(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Ui,l),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{const l=s?.(i)??void 0,d=r?.(i)??void 0,h=a?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,_i,l),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Bi,d),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Vi,h),this.headerCustom?.remove(),this.headerCustom=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,i,n){if(n==null){t?.remove();return}const s=t??this.createHeaderSlotElement(i);return t==null&&e.appendChild(s),this.replaceHeaderSlotContent(s,n),s}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}getOrCreateFileContainerNode(e,t){const{fileContainer:i}=this,n=e??i??document.createElement("diffs-container"),s=i!==n;return i!=null&&s&&this.editor?.__captureFocusForDOMReplacement(),s&&this.emitPostRender(!0),this.fileContainer=n,i!=null&&s&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),s&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const i of t.children)i instanceof SVGElement?this.spriteSVG??=i:vt(i)&&i.hasAttribute("data-theme-css")?(this.themeCSSStyle??=i,this.hasAdoptedThemeCSS=!0):vt(i)&&i.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=i,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const i=document.createElement("div");i.innerHTML=Ns;const n=i.firstChild;n instanceof SVGElement&&(this.spriteSVG=n)}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.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(const t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute("data-code")){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){const{overflow:i="scroll",disableLineNumbers:n=!1}=this.options,s={type:"file",split:!1,overflow:i,disableLineNumbers:n,diffIndicators:"none",disableBackground:!0,totalLines:t};_s(s,this.appliedPreAttributes)||(Ys(e,s),this.appliedPreAttributes=s)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const i=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",i.appendChild(this.errorWrapper);const n=document.createElement("div");n.dataset.errorMessage="",n.innerText=e.message,this.errorWrapper.appendChild(n);const s=document.createElement("pre");s.dataset.errorStack="",s.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(s)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function ha(e,t,i=!1){return!i&&e==null&&t!=null}function ca(e,t,i=!1){return e==null&&t!=null&&!i}function $t(e){return{...Wi,...e}}function xe(e,t){return St(e,t)+ua(e,t)}function St(e,t){return t?0:e.diffHeaderHeight}function ua(e,t){return e.paddingTop??(t?e.spacing:0)}function Jt(e){return e.paddingBottom??e.spacing}function fa(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}const pa=5e3,At=new Map;let ga=-1;function ma(e,t){return(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.unsafeCSS!==t.unsafeCSS}var va=class extends da{virtualizer;metrics;__id=`virtualized-file:${++ga}`;renderType="virtualized";top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0,ghostTextRows:At};pendingRender;isVisible=!1;isSetup=!1;layoutDirty=!0;currentCollapsed;constructor(e,t,i=Wi,n,s){super(e,n,s),this.virtualizer=t,this.metrics=i}setMetrics(e,t=!1){const i=$t(e);!t&&tt(this.metrics,i)||(this.metrics=i,this.resetLayoutCache())}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}hasLineAnnotations(){return this.getLayoutAnnotations().some(e=>e.lineNumber>0)}hasUniformLineHeights(){const{overflow:e="scroll"}=this.options;return e==="scroll"&&!this.hasLineAnnotations()&&this.cache.heights.size===0}getLineHeight(e,t=!1){const i=this.cache.heights.get(e);if(i!=null)return i;const n=t?2:1;return this.metrics.lineHeight*n}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,i=!Gi(t,e),n=ma(t,e);super.setOptions(e),n&&this.resetLayoutCache(!0),i&&(this.forceRenderOverride=!0),i&&this.virtualizer.instanceChanged(this,n)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache(e=!1,t=!0){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.ghostTextRows=At,this.renderRange!=null&&t&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}applyGhostTextRows(e){const{heights:t,ghostTextRows:i}=this.cache;if(i===e)return!1;const{lineHeight:n}=this.metrics;let s=!1;for(const r of new Set([...i.keys(),...e.keys()])){const o=i.get(r)??0,a=e.get(r)??0;if(a===o)continue;const l=(t.get(r)??n)-o*n+a*n;l===n?t.delete(r):t.set(r,l),s=!0}return this.cache.ghostTextRows=e,s}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.getLayoutFile()==null)return this.height!==0&&(e=!0),this.height=0,e;const{overflow:t="scroll"}=this.options;this.top=this.getVirtualizedTop();const i=this.editor?.__getGhostTextRows()??At;e=this.applyGhostTextRows(i);const n=t!=="scroll"||this.lineAnnotations.length>0||this.isResizeDebuggingEnabled();if(this.placeHolder!=null||!n&&this.cache.heights.size===0&&this.cache.fileAnnotationHeight===0)return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;const{lineHeight:s}=this.metrics;if(this.code==null)return e;const r=this.code.children[1];if(!(r instanceof HTMLElement))return e;if(this.renderRange!=null&&oi(this.renderRange)){const o=Sa(r)??0;o!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=o,e=!0)}for(const o of r.children){if(!(o instanceof HTMLElement))continue;const a=o.dataset.lineIndex;if(a==null)continue;const l=Number(a),d=(i.get(l)??0)*s,h=this.cache.heights.get(l);if(!n&&(h==null||h===s+d))continue;let c=o.getBoundingClientRect().height+d,u=!1;o.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in o.nextElementSibling.dataset||"noNewline"in o.nextElementSibling.dataset)&&("noNewline"in o.nextElementSibling.dataset&&(u=!0),c+=o.nextElementSibling.getBoundingClientRect().height);const f=this.getLineHeight(l,u);c!==f&&(e=!0,c===this.metrics.lineHeight*(u?2:1)?this.cache.heights.delete(l):this.cache.heights.set(l,c))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>{const t=this.getInputFile();return this.fileContainer==null||t==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:t}))};updateCodeViewLayout(e,t,i,n){const s=!B(this.getInputFile(),e);s&&this.updateInputFile(e,n);const{pendingRenderFile:r,layoutFileChanged:o,renderedFileChanged:a,annotationsChanged:l}=this.updatePendingRender(e,n);let d=i?.resetFileLayoutCache===!0||o;i?.metrics!=null&&(this.metrics=i.metrics,d=!0);const{collapsed:h=!1}=this.options;return this.currentCollapsed!==h&&(this.currentCollapsed=h,d=!0),d&&this.resetLayoutCache(),s&&(this.layoutDirty=!0),!this.forceRenderOverride&&(s||a||l)&&(this.forceRenderOverride=!0),this.top=t,this.computeApproximateSize(!1,r),this.height}getLayoutFile(){return this.pendingRender?.file??this.getRenderedFile()}getLayoutAnnotations(){const{pendingRender:e}=this;return e!=null?this.getAnnotationsForFile(e.file):this.lineAnnotations}getLinePosition(e){const t=this.getLayoutFile();if(t==null||e<1)return;const{disableFileHeader:i=!1,collapsed:n=!1}=this.options,s=this.fileRenderer.getLineCount(t)-1;if(n)return{top:St(this.metrics,i),height:0};let r=xe(this.metrics,i);if(s<0)return{top:r,height:0};const o=Math.min(Math.max(e-1,0),s),{lineHeight:a}=this.metrics;if(r+=this.cache.fileAnnotationHeight,this.hasUniformLineHeights())return{top:r+o*a,height:a};const l=this.getLayoutCheckpointBeforeLineIndex(o);r=l?.top??r;for(let d=l?.lineIndex??0;da?void 0:{lineNumber:u+1,top:r+l+u*h}}let d=r+(o===0?l:this.renderRange.bufferBefore);for(let h=o;h<=a;h++){if(d>=e)return{lineNumber:h+1,top:d};d+=this.getLineHeight(h)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){const t=this.getLayoutFile();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const i=e!=null?this.computeRenderRangeFromWindow(t,this.top,e):this.renderRange;if(i==null)return;const{bufferBefore:n,bufferAfter:s,totalLines:r}=i;let o=0;if(r===0){const a=e??this.virtualizer.getWindowSpecs();this.top0;t&&(this.layoutDirty=!0);const i=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!B(this.getRenderedFile(),this.getWorkingFile()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache(),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),i&&this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutFile()){const i=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!i)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(this.editor?.__getGhostTextRows()??At);const{disableFileHeader:s=!1,collapsed:r=!1}=this.options,{lineHeight:o}=this.metrics,a=this.fileRenderer.getLineCount(t);if(r){this.height+=St(this.metrics,s),this.layoutDirty=!1;return}const l=xe(this.metrics,s),d=Jt(this.metrics);if(this.height+=l,this.height+=this.cache.fileAnnotationHeight,this.hasUniformLineHeights())this.height+=a*o;else for(let h=0;h0&&(this.height+=d),this.fileContainer!=null&&i&&!n){const h=this.fileContainer.getBoundingClientRect();h.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:t.name,elementHeight:h.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}this.layoutDirty=!1}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.getInputFile()==null)return;const e=this.getWorkingFile(),t=e==null?void 0:this.fileRenderer.getFileForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,!(this.isSimpleMode()&&this.requestRender())&&this.virtualizer.instanceChanged(this,!B(this.getRenderedFile(),t))}get isComponentManaged(){return this.getAdvancedVirtualizer()?.isComponentManaged??super.isComponentManaged}syncGhostTextRows(){const e=this.getAdvancedVirtualizer();e!=null?(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0)):this.getSimpleVirtualizer()?.requestHeightReconcile(this)}applyDocumentChange(e,t,i=!1){const{renderRange:n}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(this.isSimpleMode(),!1);const s=this.getRenderedFile();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(i&&n!=null&&s!=null){const r=this.virtualizer.getWindowSpecs(),o=this.computeRenderRangeFromWindow(s,this.top??0,r);o.bufferAfter!==n.bufferAfter&&this.updateBuffers(o)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}render({fileContainer:e,file:t,forceRender:i=!1,lineAnnotations:n,...s}){const r=!B(this.getInputFile(),t);r&&(this.updateInputFile(t,n),this.cachedHeaderHTML=void 0);const{pendingRenderFile:o,layoutFileChanged:a,renderedFileChanged:l,annotationsChanged:d}=this.pendingRender!=null&&this.pendingRender.workingFile===(this.getWorkingFile(t)??t)?{pendingRenderFile:this.pendingRender.file,layoutFileChanged:!1,renderedFileChanged:!1,annotationsChanged:this.syncLineAnnotations(n)}:this.updatePendingRender(t,n),{forceRenderOverride:h,isSetup:c}=this;if(this.forceRenderOverride=void 0,a&&this.resetLayoutCache(),e=this.getOrCreateFileContainerNode(e),c)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,o));else{this.computeApproximateSize(!1,o);const p=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(p==null)throw new Error("VirtualizedFile.render: simple virtualizer is not available");p.connect(e,this),this.isVisible=p.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!r||!c))return this.renderPlaceholder(this.height);const u=this.virtualizer.getWindowSpecs(),f=this.top??0,g=this.computeRenderRangeFromWindow(o,f,u);return super.render({file:t,fileContainer:e,renderRange:g,lineAnnotations:n,forceRender:(h??i)||d||l||r,...s})}finalizeRender(){if(this.getRenderedFile()!==this.pendingRender?.file)throw new Error("VirtualizedFile.render: rendered a different file than its prepared layout");this.pendingRender=void 0,this.isSimpleMode()&&this.getSimpleVirtualizer()?.requestHeightReconcile(this)}updatePendingRender(e,t){const i=this.getWorkingFile(e)??e,n=this.getRenderedFile(),s=this.pendingRender?.file??n,r=this.fileRenderer.getFileForNextRender(i);return this.pendingRender={workingFile:i,file:r},{pendingRenderFile:r,annotationsChanged:this.syncLineAnnotations(t),layoutFileChanged:!B(s,r),renderedFileChanged:!B(n,r)}}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"}addLayoutCheckpoint(e,t){e%pa===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,i=this.cache.checkpoints.length-1,n;for(;t<=i;){const s=t+i>>1,r=this.cache.checkpoints[s];if(r==null)throw new Error("VirtualizedFile: invalid checkpoint index");r.lineIndex<=e?(n=r,t=s+1):i=s-1}return n}getLayoutCheckpointBeforeTop(e,t){let i=0,n=this.cache.checkpoints.length-1,s=-1;for(;i<=n;){const r=i+n>>1,o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFile: invalid checkpoint index");o.top<=e?(s=r,i=r+1):n=r-1}if(t==null)return s>=0?this.cache.checkpoints[s]:void 0;for(let r=s;r>=0;r--){const o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFile: invalid checkpoint index");if(o.lineIndex%t===0)return o}}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}computeRenderRangeFromWindow(e,t,{top:i,bottom:n}){const{disableFileHeader:s=!1}=this.options,{hunkLineCount:r,lineHeight:o}=this.metrics,a=this.fileRenderer.getLineCount(e),l=this.height,d=xe(this.metrics,s),h=a>0?Jt(this.metrics):0,{fileAnnotationHeight:c}=this.cache,u=d+c,f=Math.max(0,l-d-c-h),g=Ps(this.getLayoutAnnotations()),p=t+d,m=c>0&&g&&pi;if(tn)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:l-d-h};if(a<=r)return{startingLine:0,totalLines:r,bufferBefore:0,bufferAfter:0};const v=Math.ceil(Math.max(n-i,0)/o),k=Math.ceil(v/r)*r+r,y=k/r,b=(i+n)/2;if(this.hasUniformLineHeights()){const U=t+u,ee=U+f;if(!m&&!(Ui))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:l-d-h};const ne=Math.floor(m&&bi-se&&wb&&(H??=ne),x==null&&w>=n&&ee&&(x=C),R++,w+=se}if(L==null)if(m)L=0,H=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:l-d-h};H??=L;const T=Math.round(H-y/2),F=Math.max(0,Math.ceil(a/r)-y),I=Math.max(0,Math.min(T,F)),D=I*r,O=T<0?k+T*r:k,G=E[I]??0,P=D===0?0:c+G,z=I+O/r,_=z({...t,hunkContent:t.hunkContent.map(i=>({...i}))}))}function sr(e){return{...e,hunks:nr(e.hunks),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function oe(e,t){return e-(t===0?0:1)}function J(e,t){return oe(e,t)+t}const ya=1;function ei(e,...t){return`ck${ya}:${JSON.stringify([e,...t])}`}function ti(e){return e!==""?e.split(Fr):[]}function Ai(e,t,i,n={}){const s=e==="clone"?sr(t):t;if(!s.isPartial)throw new Error("hydratePartialDiff: fileDiff must be partial");switch(s.type){case"change":case"rename-changed":return ba(s,ka(s,i),bn(s,i),n);case"rename-pure":{const r=bn(s,i);La(s,i);const o=ti(r.contents);return s.isPartial=!1,s.deletionLines=o,s.additionLines=o,s.deletionCharacterCount=r.contents.length,s.additionCharacterCount=r.contents.length,rr(s,null,r,n),s}}throw new Error(`hydratePartialDiff: ${s.type} diffs cannot be hydrated from loaded files`)}function ba(e,t,i,n){const s=ti(t.contents),r=ti(i.contents),{hunks:o,splitLineCount:a,unifiedLineCount:l}=Ca(e.hunks,r.length);return e.hunks=o,e.splitLineCount=a,e.unifiedLineCount=l,e.isPartial=!1,e.deletionLines=s,e.additionLines=r,e.deletionCharacterCount=t.contents.length,e.additionCharacterCount=i.contents.length,rr(e,t,i,n),e}function Ca(e,t){let i=0,n=0,s=0;const r=[];for(const o of e){const a=Math.max(o.additionStart-1,0),l=Math.max(o.deletionStart-1,0);let d=a,h=l,c=0,u=0,f=0,g=0;const p=[];for(const v of o.hunkContent){if(v.type==="context"){p.push({...v,additionLineIndex:d,deletionLineIndex:h}),d+=v.lines,h+=v.lines,f+=v.lines,g+=v.lines;continue}p.push({...v,additionLineIndex:d,deletionLineIndex:h}),d+=v.additions,h+=v.deletions,c+=v.additions,u+=v.deletions,f+=Math.max(v.additions,v.deletions),g+=v.additions+v.deletions}const m=Math.max(oe(o.additionStart,o.additionCount)-s,0);r.push({...o,collapsedBefore:m,additionLineIndex:a,deletionLineIndex:l,additionLines:c,deletionLines:u,hunkContent:p,splitLineStart:i+m,unifiedLineStart:n+m,splitLineCount:f,unifiedLineCount:g}),i+=m+f,n+=m+g,s=J(o.additionStart,o.additionCount)}if(r.length>0){const o=r[r.length-1],a=J(o.additionStart,o.additionCount),l=Math.max(t-a,0);i+=l,n+=l}return{hunks:r,splitLineCount:i,unifiedLineCount:n}}function ka(e,t){if(t.oldFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function bn(e,t){if(t.newFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function La(e,t){if(t.oldFile!==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function wa(e,t,i,n){return e.cacheKey!=null?`${e.cacheKey}:hydrated`:xa(t,i,n)}function rr(e,t,i,n){const s=wa(e,t,i,n);if(s==null){delete e.cacheKey;return}e.cacheKey=s}function xa(e,t,i){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?ei(i.disableLineMatching===!0?"hydrated-files-raw":"hydrated-files",e.cacheKey,t.cacheKey):void 0:e?.cacheKey??t?.cacheKey}function Re(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}const Ea=new TextEncoder,Ra=new TextDecoder("utf-8",{ignoreBOM:!0}),Ta=/[\uD800-\uDFFF]/,Ii=1024;let Qe=new Uint8Array(Ii);function or(){Qe.length!==Ii&&(Qe=new Uint8Array(Ii))}function W(e){if(e.length===0)return e;if(Ta.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;Qe.length="0"&&e[i+1]<="7");t+=Aa.decode(new Uint8Array(r))}}function Ma(e,t){const i=e.charCodeAt(t)-48,n=e.charCodeAt(t+1)-48,s=e.charCodeAt(t+2)-48;if(i>=0&&i<=3&&n>=0&&n<=7&&s>=0&&s<=7)return i*64+n*8+s}const Da=4096,Fa=.5;function Pa(e){for(const t of e.hunks)for(let i=0;i0&&r.deletions>0||o.type!=="context")continue;const a=r.additions>0,l=a?t.additionLines:t.deletionLines,d=a?r.additionLineIndex:r.deletionLineIndex,h=a?r.additions:r.deletions,c=l[d]??"";if(c.trim()!=="")continue;let u=!0;for(let v=1;vDa)return null;const l=[];for(let p=0;pi;let c=0,u=-1;for(let p=0;p<=a;p++){let m=0;for(let v=0;vu&&(u=m,c=p)}if(c===0)return null;const f=[],g=(p,m,v,k)=>{(p>0||m>0)&&f.push({type:"change",deletions:p,additions:m,deletionLineIndex:v,additionLineIndex:k})};return h?(g(0,c,s,r),g(o,o,s,r+c),g(0,n-o-c,s+o,r+c+o)):(g(c,0,s,r),g(o,o,s+c,r),g(i-o-c,0,s+c+o,r+o)),f}const Na=/\s+/g;function Cn(e){return e.replace(Na,"")}function _a(e,t){if(e===t)return 1;const i=Math.max(e.length,t.length),n=Math.min(e.length,t.length);if(n===0)return 0;let s=0;for(;s0&&(g[g.length-1]===` +`||g[g.length-1]==="\r"||g[g.length-1]===`\r +`||g[g.length-1]==="");)g.pop();const{additionStart:C,deletionStart:E}=m;c=h?c:E-1,u=h?u:C-1;const S={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:m.additionCount,additionStart:C,additionLines:v,deletionCount:m.deletionCount,deletionStart:E,deletionLines:k,deletionLineIndex:c,additionLineIndex:u,hunkContent:[],hunkContext:xn(m.hunkContext),hunkSpecs:W(p),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let w=0,R=0;for(let L=1;L=S.additionCount&&R>=S.deletionCount&&!H.startsWith("\\")){if(!(ja(H)&&!Ka(H)))break;if(o)throw Error("parsePatchContent: hunk has more lines than expected")}const x=H[0];if(x!=="+"&&x!=="-"&&x!==" "&&x!=="\\"){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${x}", full line: "${H}"`),console.error("processFile: invalid rawLine:",H);continue}const A=Qa(x);if(A==="addition"){if(o&&w>=S.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const T=fi(H);(y==null||y.type!=="change")&&(y=pi("change",c,u),S.hunkContent.push(y)),u++,w++,h&&(d.additionLines.push(T),d.additionCharacterCount+=T.length),y.additions++,v++,b="addition"}else if(A==="deletion"){if(o&&R>=S.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const T=fi(H);(y==null||y.type!=="change")&&(y=pi("change",c,u),S.hunkContent.push(y)),c++,R++,h&&(d.deletionLines.push(T),d.deletionCharacterCount+=T.length),y.deletions++,k++,b="deletion"}else if(A==="context"){if(o&&(R>=S.deletionCount||w>=S.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const T=fi(H);(y==null||y.type!=="context")&&(y=pi("context",c,u),S.hunkContent.push(y)),u++,c++,w++,R++,h&&(d.deletionLines.push(T),d.additionLines.push(T),d.deletionCharacterCount+=T.length,d.additionCharacterCount+=T.length),y.lines++,b="context"}else if(A==="metadata"&&y!=null){if(y.type==="context"?(S.noEOFCRAdditions=!0,S.noEOFCRDeletions=!0):b==="deletion"?S.noEOFCRDeletions=!0:b==="addition"&&(S.noEOFCRAdditions=!0),h&&(b==="addition"||b==="context")){const T=d.additionLines.length-1;if(T>=0){const F=d.additionLines[T],I=Re(F);d.additionLines[T]=I,d.additionCharacterCount+=I.length-F.length}}if(h&&(b==="deletion"||b==="context")){const T=d.deletionLines.length-1;if(T>=0){const F=d.deletionLines[T],I=Re(F);d.deletionLines[T]=I,d.deletionCharacterCount+=I.length-F.length}}}}if(w!==S.additionCount||R!==S.deletionCount){if(o)throw Error("parsePatchContent: hunk line count mismatch");console.error(`parsePatchContent: hunk line count mismatch: "${p.trimEnd()}", declared old/new ${S.deletionCount}/${S.additionCount}, parsed old/new ${R}/${w}`);const L=oe(S.additionStart,S.additionCount)+(w===0?0:1),H=oe(S.deletionStart,S.deletionCount)+(R===0?0:1);if(!h){const x=L-S.additionStart,A=H-S.deletionStart;S.additionLineIndex+=x,S.deletionLineIndex+=A;for(const T of S.hunkContent)T.additionLineIndex+=x,T.deletionLineIndex+=A}S.additionStart=L,S.deletionStart=H,S.additionCount=w,S.deletionCount=R}S.additionLines=v,S.deletionLines=k,S.collapsedBefore=Math.max(oe(S.additionStart,S.additionCount)-a,0),d.hunks.push(S),a=J(S.additionStart,S.additionCount);for(const L of S.hunkContent)L.type==="context"?(S.splitLineCount+=L.lines,S.unifiedLineCount+=L.lines):(S.splitLineCount+=Math.max(L.additions,L.deletions),S.unifiedLineCount+=L.deletions+L.additions);S.splitLineStart=d.splitLineCount+S.collapsedBefore,S.unifiedLineStart=d.unifiedLineCount+S.collapsedBefore,d.splitLineCount+=S.collapsedBefore+S.splitLineCount,d.unifiedLineCount+=S.collapsedBefore+S.unifiedLineCount}if(d!=null){if(o&&h&&!n&&d.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(d.hunks.length>0&&!h&&d.additionLines.length>0&&d.deletionLines.length>0){const f=d.hunks[d.hunks.length-1],g=J(f.additionStart,f.additionCount),p=d.additionLines.length,m=Math.max(p-g,0);d.splitLineCount+=m,d.unifiedLineCount+=m}return n||(d.prevName!=null&&d.name!==d.prevName?d.hunks.length>0?d.type="rename-changed":d.type="rename-pure":(s==null||s.contents==="")&&r!=null&&r.contents!==""?d.type="new":s!=null&&s.contents!==""&&(r==null||r.contents==="")&&(d.type="deleted")),d.type!=="rename-pure"&&d.type!=="rename-changed"&&(d.prevName=void 0),i||Pa(d),d}}function uh(e,t={}){const{cacheKeyPrefix:i,throwOnError:n=!1}=t,s=[],r=Wa(e)?e.split(Dr):[e];for(const o of r)try{s.push(Va(o,t,i!=null?s.length:void 0))}catch(a){if(n)throw a;console.error(a)}finally{or()}return s}function ot(e,t=!1){const i=e.trim(),n=i.startsWith('"')?Ha(i)?.fileName??i:i;return t&&(n.startsWith("a/")||n.startsWith("b/"))?n.slice(2):n}function Wa(e){return e.startsWith("From ")||e.includes(` +From `)}function kn(e){const t=lr(e);for(let i=0;ii&&t.push(e.slice(i,n)),i=n,o=!0,n=Hi(e,a);continue}if(o&&e.startsWith("@@ -",n)){const d=hr(e.slice(n,a));d!=null&&(s=d.deletionCount,r=d.additionCount)}n=a;continue}const l=e[n];if(l==="\\"){n=a;continue}l===" "?(s=Math.max(s-1,0),r=Math.max(r-1,0)):l==="-"?s=Math.max(s-1,0):l==="+"&&(r=Math.max(r-1,0)),n=a}return t.push(e.slice(i)),t}function Ga(e){return dr(e,0)}function dr(e,t){const i=Hi(e,t);return Ln(e,t,"---")&&Ln(e,i,"+++")}function Ln(e,t,i){if(!e.startsWith(i,t))return!1;const n=e[t+i.length];if(n!==" "&&n!==" ")return!1;for(let s=t+i.length+1;s9)break;n=n*10+s}if(i!==t)return{value:n,endIndex:i}}function Ya(e){return e.endsWith(`\r `)?e.slice(0,-2):e.endsWith(` -`)?e.slice(0,-1):e}function ga(e){return e.startsWith("diff --git")||e.includes(` -diff --git`)}function Us(e,t){if(e.length===0)return[""];const i=` -${t}`,n=e.startsWith(t)?0:dn(e,i,0);if(n===-1)return[e];const s=[];n>0&&s.push(e.slice(0,n));let r=n;for(;;){const o=dn(e,i,r+1);if(o===-1)break;s.push(e.slice(r,o)),r=o}return s.push(e.slice(r)),s}function dn(e,t,i){const n=e.indexOf(t,i);return n===-1?-1:n+1}function hn(e){return e==null?e:q(e)}function ma(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function oi(e){const t=e.slice(1);return q(t===""?` -`:t)}function ai(e,t,i){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:i,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:i,deletionLineIndex:t}}const va="/dev/null";function Ue(e,t,i,n=!1){if(e===null&&t===null)throw new Error("parseDiffFromFile: You must pass oldFile, newFile, or both");const s=e??cn(),r=t??cn(),o=nr(s.name,r.name,s.contents,r.contents,s.header,r.header,i),l=aa(o,{cacheKey:(()=>{const h=e?.cacheKey,d=t?.cacheKey;return h!=null&&d!=null?jt("diff",h,d):void 0})(),oldFile:s,newFile:r,throwOnError:n});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 cn(){return{name:va,contents:""}}var Sa=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,i){if(t==null||i==null)for(const n of e.children??[])n instanceof HTMLElement&&("deletions"in n.dataset?t=n:"additions"in n.dataset&&(i=n));if(i==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!==i&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=i,i.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 ee(e,t){return De(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function wt(e){return I({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function xt(e){return I({tagName:"div",children:[I({tagName:"span",children:[ge("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function li(e){return I({tagName:"div",children:[Vt({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 $e({type:e,content:t,expandIndex:i,chunked:n=!1,slotName:s,isFirstHunk:r,isLastHunk:o}){let l=0;const a=[];if(e==="metadata"&&t!=null&&a.push(I({tagName:"div",children:[ge(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const h=[];i!=null&&(n?(r||(h.push(li("up")),l++),o||(h.push(li("down")),l++)):(h.push(li(!r&&!o?"both":r?"down":"up")),l++)),h.push(I({tagName:"div",children:[I({tagName:"span",children:[ge(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),n&&i!=null&&h.push(I({tagName:"div",children:[ge("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),a.push(I({tagName:"div",children:h,properties:{"data-separator-wrapper":"","data-separator-multi-button":l>1?"":void 0}}))}return e==="custom"&&s!=null&&a.push(I({tagName:"slot",properties:{name:s}})),I({tagName:"div",children:a,properties:{"data-separator":a.length===0?"simple":e,"data-expand-index":i,"data-separator-first":r?"":void 0,"data-separator-last":o?"":void 0}})}function ya(e,t){return`hunk-separator-${e}-${t}`}function ba(e){const t=e.at(-1);return t==null?0:Math.max(Q(t.additionStart,t.additionCount),Q(t.deletionStart,t.deletionCount))}function Yt({line:e,spanStart:t,spanLength:i}){return{start:{line:e,character:t},end:{line:e,character:t+i},properties:{"data-diff-span":""},alwaysWrap:!0}}function Et({item:e,arr:t,enableJoin:i,isNeutral:n=!1,isLastItem:s=!1}){const r=t[t.length-1];if(r==null||s||!i){t.push([n?0:1,e.value]);return}const o=r[0]===0;if(n===o||n&&e.value.length===1&&!o){r[1]+=e.value;return}t.push([n?0:1,e.value])}function gt(e){return[re(e.additionStart,e.additionCount)+1,Q(e.additionStart,e.additionCount)+1]}function Re({isPartial:e,rangeSize:t,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:s}){const r=Math.max(t,0);if(r===0||e)return{fromStart:0,fromEnd:0,rangeSize:r,collapsedLines:r,renderAll:!1};if(i===!0||r<=s)return{fromStart:r,fromEnd:0,rangeSize:r,collapsedLines:0,renderAll:!0};const o=i?.get(n),l=Math.min(Math.max(o?.fromStart??0,0),r),a=Math.min(Math.max(o?.fromEnd??0,0),r),h=l+a,d=h>=r;return{fromStart:d?r:l,fromEnd:d?0:a,rangeSize:r,collapsedLines:Math.max(r-h,0),renderAll:d}}function Ca(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 i=e.additionLines.length-Q(t.additionStart,t.additionCount),n=e.deletionLines.length-Q(t.deletionStart,t.deletionCount);return i<=0&&n<=0?!1:i!==n}function Vs({fileDiff:e,errorPrefix:t}){const i=e.hunks[e.hunks.length-1];if(i==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const n=e.additionLines.length-Q(i.additionStart,i.additionCount),s=e.deletionLines.length-Q(i.deletionStart,i.deletionCount);if(n<=0&&s<=0)return 0;if(n!==s)throw new Error(`${t}: trailing context mismatch (additions=${n}, deletions=${s}) for ${e.name}`);return Math.min(n,s)}function Te({fileDiff:e,hunkIndex:t,expandedHunks:i,collapsedContextThreshold:n,errorPrefix:s}){if(t!==e.hunks.length-1)return;const r=Vs({fileDiff:e,errorPrefix:s});if(r<=0)return;if(i===!0||r<=n)return{fromStart:r,fromEnd:0,rangeSize:r,collapsedLines:0,renderAll:!0};const o=i?.get(e.hunks.length),l=Math.min(Math.max(o?.fromStart??0,0),r);return{fromStart:l,fromEnd:0,rangeSize:r,collapsedLines:r-l,renderAll:l>=r}}function Ws({fileDiff:e,lineNumber:t,expandedHunks:i,collapsedContextThreshold:n}){if(i===!0||e.isPartial)return!0;for(const[l,a]of e.hunks.entries()){const[h,d]=gt(a);if(t=h-c.fromEnd}if(t=o+s.rangeSize}function ka({fileDiff:e,lineNumber:t,direction:i,expandedHunks:n,collapsedContextThreshold:s}){if(n===!0||e.isPartial)return t;const r=[];let o=1;for(const[a,h]of e.hunks.entries()){const[d,c]=gt(h),u=Re({isPartial:e.isPartial,rangeSize:h.collapsedBefore,expandedHunks:n,hunkIndex:a,collapsedContextThreshold:s}),f=d-u.rangeSize;u.renderAll?r.push([f,d]):(u.fromStart>0&&r.push([f,f+u.fromStart]),u.fromEnd>0&&r.push([d-u.fromEnd,d])),r.push([d,c]),o=c}const l=Te({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:s,errorPrefix:"getNearestRenderableAdditionLine"});if(l!=null){const a=o;o=a+l.rangeSize,l.renderAll?r.push([a,o]):l.fromStart>0&&r.push([a,a+l.fromStart])}if(t>=o)return t;if(i==="down"){for(const[a,h]of r)if(h>t)return Math.max(a,t);return}for(let a=r.length-1;a>=0;a--){const[h,d]=r[a];if(h<=t)return Math.min(d-1,t)}}function qs({type:e,metrics:t}){return t.hunkSeparatorHeight??Mo(e)}function $s({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function La({type:e,hunkIndex:t,hunkSpecs:i}){switch(e){case"simple":return t>0;case"metadata":return i!=null;case"line-info":case"line-info-basic":case"custom":return!0}}function wa(e){return e!=="simple"&&e!=="metadata"}function dt({type:e,metrics:t,hunkIndex:i,hunkSpecs:n}){if(!La({type:e,hunkIndex:i,hunkSpecs:n}))return;const s=qs({type:e,metrics:t}),r=$s({type:e,metrics:t}),o=i>0?r:0,l=r;return{height:s,gapBefore:o,gapAfter:l,totalHeight:o+s+l}}function ze({type:e,metrics:t}){if(!wa(e))return;const i=qs({type:e,metrics:t}),n=$s({type:e,metrics:t});return{height:i,gapBefore:n,gapAfter:0,totalHeight:n+i}}function Be({diff:e,diffStyle:t,startingLine:i=0,totalLines:n=1/0,expandedHunks:s,collapsedContextThreshold:r=1,callback:o}){const l=xa({diff:e,diffStyle:t,startingLine:i,expandedHunks:s,collapsedContextThreshold:r}),a={viewportStart:i,viewportEnd:i+n,isWindowedHighlight:i>0||n<1/0,splitCount:l.splitCount,unifiedCount:l.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!a.isWindowedHighlight)return!1;const h=a.unifiedCount>=i+n,d=a.splitCount>=i+n;return t==="unified"?h:(t==="split"||h)&&d},shouldSkip(h,d){if(!a.isWindowedHighlight)return!1;const c=h>0&&a.unifiedCount+h<=i,u=d>0&&a.splitCount+d<=i;return t==="unified"?c:(t==="split"||c)&&u},incrementCounts(h,d){(t==="unified"||t==="both")&&(a.unifiedCount+=h),(t==="split"||t==="both")&&(a.splitCount+=d)},isInWindow(h,d){if(!a.isWindowedHighlight)return!0;const c=a.isInUnifiedWindow(h),u=a.isInSplitWindow(d);return t==="unified"?c:t==="split"?u:c||u},isInUnifiedWindow(h){return!a.isWindowedHighlight||a.unifiedCount>=i-h&&a.unifiedCount=i-h&&a.splitCount0?0:t==="unified"?R===d.unifiedLineStart+d.unifiedLineCount-1?m.collapsedLines:0:T===d.splitLineStart+d.splitLineCount-1?m.collapsedLines:0},x=function(){return k?0:(k=!0,p.collapsedLines)};const d=e.hunks[h];if(d==null)throw new Error("iterateOverDiff: invalid hunk index");if(a.shouldBreak())break;const c=re(d.deletionStart,d.deletionCount),u=re(d.additionStart,d.additionCount),f=!e.isPartial&&d.deletionCount===0?c:d.deletionLineIndex,g=!e.isPartial&&d.additionCount===0?u:d.additionLineIndex,p=Re({isPartial:e.isPartial,rangeSize:d.collapsedBefore,expandedHunks:s,hunkIndex:h,collapsedContextThreshold:r}),m=h===a.finalHunkIndex?Te({fileDiff:e,hunkIndex:h,expandedHunks:s,collapsedContextThreshold:r,errorPrefix:"iterateOverDiff"}):void 0,y=p.fromStart+p.fromEnd;let k=p.collapsedLines===0;if(a.shouldSkip(y,y))a.incrementCounts(y,y),x();else{let R=d.unifiedLineStart-p.rangeSize,T=d.splitLineStart-p.rangeSize,D=f-p.rangeSize,z=g-p.rangeSize,A=c+1-p.rangeSize,M=u+1-p.rangeSize;if(Rt(a,p.fromStart,t,F=>a.emit({hunkIndex:h,hunk:d,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:A+F,lineIndex:D+F,noEOFCR:!1,unifiedLineIndex:R+F,splitLineIndex:T+F},additionLine:{unifiedLineIndex:R+F,splitLineIndex:T+F,lineIndex:z+F,lineNumber:M+F,noEOFCR:!1}}))||(R=d.unifiedLineStart-p.fromEnd,T=d.splitLineStart-p.fromEnd,D=f-p.fromEnd,z=g-p.fromEnd,A=c+1-p.fromEnd,M=u+1-p.fromEnd,Rt(a,p.fromEnd,t,F=>a.emit({hunkIndex:h,hunk:d,collapsedBefore:x(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:A+F,lineIndex:D+F,noEOFCR:!1,unifiedLineIndex:R+F,splitLineIndex:T+F},additionLine:{unifiedLineIndex:R+F,splitLineIndex:T+F,lineIndex:z+F,lineNumber:M+F,noEOFCR:!1}}),()=>{x()})))break e}let b=d.unifiedLineStart,C=d.splitLineStart,S=f,L=g,w=c+1,E=u+1;const H=d.hunkContent.at(-1);for(const R of d.hunkContent){if(a.shouldBreak())break e;const T=R===H;if(R.type==="context"){if(a.shouldSkip(R.lines,R.lines))a.incrementCounts(R.lines,R.lines),x();else if(Rt(a,R.lines,t,D=>{const z=T&&D===R.lines-1,A=b+D,M=C+D;return a.emit({hunkIndex:h,hunk:d,collapsedBefore:x(),collapsedAfter:v(A,M),type:"context",deletionLine:{lineNumber:w+D,lineIndex:S+D,noEOFCR:z&&d.noEOFCRDeletions,unifiedLineIndex:A,splitLineIndex:M},additionLine:{unifiedLineIndex:A,splitLineIndex:M,lineIndex:L+D,lineNumber:E+D,noEOFCR:z&&d.noEOFCRAdditions}})},()=>{x()}))break e;b+=R.lines,C+=R.lines,S+=R.lines,L+=R.lines,w+=R.lines,E+=R.lines}else{const D=Math.max(R.deletions,R.additions),z=R.deletions+R.additions;if(!a.shouldSkip(z,D)){const A=Ta(a,R,t);(A[0]?.[0]??0)>0&&x();for(const[M,F]of A)for(let G=M;G{const M=A===z-1;return a.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:M?R:0,type:"context-expanded",deletionLine:{lineNumber:w+A,lineIndex:S+A,noEOFCR:!1,unifiedLineIndex:b+A,splitLineIndex:C+A},additionLine:{unifiedLineIndex:b+A,splitLineIndex:C+A,lineIndex:L+A,lineNumber:E+A,noEOFCR:!1}})},void 0,()=>a.shouldBreak()))break e}}}function xa({diff:e,diffStyle:t,startingLine:i,expandedHunks:n,collapsedContextThreshold:s}){if(i<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const r=Ea({diff:e,expandedHunks:n,collapsedContextThreshold:s});let o=0,l=e.hunks.length-1,a=e.hunks.length;for(;o<=l;){const d=o+l>>1,c=r[d+1];if(c==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?c.unifiedCount:c.splitCount)>i?(a=d,l=d-1):o=d+1}if(a>=e.hunks.length){const d=r[e.hunks.length];if(d==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:d.splitCount,unifiedCount:d.unifiedCount}}const h=r[a];if(h==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:a,splitCount:h.splitCount,unifiedCount:h.unifiedCount}}function Ea({diff:e,expandedHunks:t,collapsedContextThreshold:i}){let n=0,s=0;const r=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let l=0;la&&n.push([a,h])}if(i!=="split"&&s(e.unifiedCount),i!=="unified"&&s(e.splitCount),n.length===0)return[0,0];let r=n[0][0],o=n[0][1];for(let l=1;l0&&(e.incrementCounts(o,o),s?.());let a=o;for(;a=l){e.incrementCounts(t-a,t-a);break}if(e.isInWindow(0,0)){if(n(a)===!0)return!0}else e.incrementCounts(1,1);a++}return!1}function Ta(e,t,i){if(!e.isWindowedHighlight)return[[0,i==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const n=i!=="split",s=i!=="unified",r=i==="unified"?"unified":"split",o=[];function l(c,u){if(c+u<=e.viewportStart||c>=e.viewportEnd)return;const f=Math.max(0,e.viewportStart-c),g=Math.min(u,e.viewportEnd-c);return g>f?[f,g]:void 0}function a(c,u){return r==="split"?c:u==="additions"?[c[0]+t.deletions,c[1]+t.deletions]:c}function h(c,u){if(c==null)return;const[f,g]=a(c,u);g>f&&o.push([f,g])}if(n&&(h(l(e.unifiedCount,t.deletions),"deletions"),h(l(e.unifiedCount+t.deletions,t.additions),"additions")),s&&(h(l(e.splitCount,t.deletions),"deletions"),h(l(e.splitCount,t.additions),"additions")),o.length===0)return o;o.sort((c,u)=>c[0]-u[0]);const d=[o[0]];for(const[c,u]of o.slice(1)){const f=d[d.length-1];c<=f[1]?f[1]=Math.max(f[1],u):d.push([c,u])}return d}function Aa({hunkIndex:e,hunk:t,collapsedAfter:i,collapsedBefore:n,diffStyle:s,index:r,unifiedLineIndex:o,splitLineIndex:l,additionLineIndex:a,deletionLineIndex:h,additionLineNumber:d,deletionLineNumber:c,content:u,isLastContent:f,unifiedCount:g,splitCount:p}){const m=r=u.deletions?o+r:void 0:r=u.deletions?a+(r-u.deletions):void 0:r=u.deletions?d+(r-u.deletions):void 0:r0||r<1/0,h=typeof i.theme=="string"?t.getTheme(i.theme).type:void 0,d=ls({theme:i.theme,highlighter:t}),c=n&&!a&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":i.lineDiffType,u={deletionLines:[],additionLines:[]},{maxLineDiffLength:f}=i,g=!n&&!e.isPartial,p=n?o:void 0,m=new Map;function y(k){const x=g?0:k,b=m.get(x)??Da();return m.set(x,b),b}function v(k,x,b,C){if(a){let S=b.at(-1);(S==null||S.targetIndex+S.count!==x)&&(S={targetIndex:x,originalOffset:C.length,count:0},b.push(S)),S.count++}C.push(k)}Be({diff:e,diffStyle:"both",startingLine:s,totalLines:r,expandedHunks:a?p:!0,collapsedContextThreshold:l,callback:({hunkIndex:k,additionLine:x,deletionLine:b,type:C})=>{const S=y(k),L=x!=null?x.splitLineIndex:b.splitLineIndex;C==="change"&&x!=null&&b!=null&&Ma({additionLine:e.additionLines[x.lineIndex],deletionLine:e.deletionLines[b.lineIndex],deletionLineIndex:S.deletionContent.length,additionLineIndex:S.additionContent.length,deletionDecorations:S.deletionDecorations,additionDecorations:S.additionDecorations,lineDiffType:c,maxLineDiffLength:f}),b!=null&&(v(e.deletionLines[b.lineIndex],b.lineIndex,S.deletionSegments,S.deletionContent),S.deletionInfo.push({type:C==="change"?"change-deletion":C,lineNumber:b.lineNumber,altLineNumber:C==="change"?void 0:x.lineNumber??void 0,lineIndex:`${b.unifiedLineIndex},${L}`})),x!=null&&(v(e.additionLines[x.lineIndex],x.lineIndex,S.additionSegments,S.additionContent),S.additionInfo.push({type:C==="change"?"change-addition":C,lineNumber:x.lineNumber,altLineNumber:C==="change"?void 0:b.lineNumber??void 0,lineIndex:`${x.unifiedLineIndex},${L}`}))}});for(const k of m.values()){if(k.deletionContent.length===0&&k.additionContent.length===0)continue;const x={name:e.prevName??e.name,contents:k.deletionContent.value},b={name:e.name,contents:k.additionContent.value},{deletionLines:C,additionLines:S}=Pa({deletionFile:x,deletionInfo:k.deletionInfo,deletionDecorations:k.deletionDecorations,additionFile:b,additionInfo:k.additionInfo,additionDecorations:k.additionDecorations,highlighter:t,options:i,languageOverride:n?"text":e.lang});if(g){u.deletionLines=C,u.additionLines=S;continue}if(k.deletionSegments.length>0)for(const L of k.deletionSegments)for(let w=0;w0)for(const L of k.additionSegments)for(let w=0;wl||t.length>l))return;const a=o==="char"?sr(e,t):rr(e,t);if(o==="word-line"){Ia(a,{deletionLineIndex:i,additionLineIndex:n,deletionDecorations:s,additionDecorations:r});return}const h=[],d=[],c=o==="word-alt",u=a.at(-1);for(const g of a){const p=g===u;!g.added&&!g.removed?(Et({item:g,arr:h,enableJoin:c,isNeutral:!0,isLastItem:p}),Et({item:g,arr:d,enableJoin:c,isNeutral:!0,isLastItem:p})):g.removed?Et({item:g,arr:h,enableJoin:c,isLastItem:p}):Et({item:g,arr:d,enableJoin:c,isLastItem:p})}let f=0;for(const g of h)g[0]===1&&s.push(Yt({line:i,spanStart:f,spanLength:g[1].length})),f+=g[1].length;f=0;for(const g of d)g[0]===1&&r.push(Yt({line:n,spanStart:f,spanLength:g[1].length})),f+=g[1].length}function Da(){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 Pa({deletionFile:e,additionFile:t,deletionInfo:i,additionInfo:n,highlighter:s,deletionDecorations:r,additionDecorations:o,languageOverride:l,options:{theme:a,...h}}){const d=l??$(e.name),c=l??$(t.name),{state:u,transformers:f}=as(h.useTokenTransformer),g=typeof a=="string"?{...h,lang:"text",theme:a,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:ie("token"),tokenizeTimeLimit:0}:{...h,lang:"text",themes:a,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:ie("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(g.lang=d,u.lineInfo=i,g.decorations=r,yi(s.codeToHast(me(e.contents),g))),additionLines:t.contents===""?[]:(g.lang=c,g.decorations=o,u.lineInfo=n,yi(s.codeToHast(me(t.contents),g)))}}function we(e,t){const i=Ue({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:i.hunks,splitLineCount:i.splitLineCount,unifiedLineCount:i.unifiedLineCount,additionLines:i.additionLines,deletionLines:i.deletionLines,type:i.type}}function Fa(e,t){const i=Math.max(e,1);let n=Array.from({length:i},(s,r)=>`${" ".repeat(r+1)} +`)?e.slice(0,-1):e}function Xa(e){return e.startsWith("diff --git")||e.includes(` +diff --git`)}function cr(e,t){if(e.length===0)return[""];const i=` +${t}`,n=e.startsWith(t)?0:wn(e,i,0);if(n===-1)return[e];const s=[];n>0&&s.push(e.slice(0,n));let r=n;for(;;){const o=wn(e,i,r+1);if(o===-1)break;s.push(e.slice(r,o)),r=o}return s.push(e.slice(r)),s}function wn(e,t,i){const n=e.indexOf(t,i);return n===-1?-1:n+1}function xn(e){return e==null?e:W(e)}function Qa(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function fi(e){const t=e.slice(1);return W(t===""?` +`:t)}function pi(e,t,i){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:i,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:i,deletionLineIndex:t}}const Za="/dev/null";function We(e,t,{disableLineMatching:i,...n}={},s=!1){if(e===null&&t===null)throw new Error("parseDiffFromFile: You must pass oldFile, newFile, or both");const r=e??En(),o=t??En(),a=xr(r.name,o.name,r.contents,o.contents,r.header,o.header,n),l=Ua(a,{cacheKey:(()=>{const h=e?.cacheKey,c=t?.cacheKey;return h!=null&&c!=null?ei(i===!0?"diff-raw":"diff",h,c):void 0})(),oldFile:r,newFile:o,disableLineMatching:i,throwOnError:s});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 d=t?.lang??(t===null?e?.lang:void 0);return d!=null&&(l.lang=d),l}function En(){return{name:Za,contents:""}}var Ja=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,i){if(t==null||i==null)for(const n of e.children??[])n instanceof HTMLElement&&("deletions"in n.dataset?t=n:"additions"in n.dataset&&(i=n));if(i==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!==i&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=i,i.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 Z(e,t){return Fe(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Ht(e){return M({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Mt(e){return M({tagName:"div",children:[M({tagName:"span",children:[me("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function gi(e){return M({tagName:"div",children:[Yt({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 Ke({type:e,content:t,expandIndex:i,chunked:n=!1,slotName:s,isFirstHunk:r,isLastHunk:o}){let a=0;const l=[];if(e==="metadata"&&t!=null&&l.push(M({tagName:"div",children:[me(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const d=[];i!=null&&(n?(r||(d.push(gi("up")),a++),o||(d.push(gi("down")),a++)):(d.push(gi(!r&&!o?"both":r?"down":"up")),a++)),d.push(M({tagName:"div",children:[M({tagName:"span",children:[me(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),n&&i!=null&&d.push(M({tagName:"div",children:[me("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),l.push(M({tagName:"div",children:d,properties:{"data-separator-wrapper":"","data-separator-multi-button":a>1?"":void 0}}))}return e==="custom"&&s!=null&&l.push(M({tagName:"slot",properties:{name:s}})),M({tagName:"div",children:l,properties:{"data-separator":l.length===0?"simple":e,"data-expand-index":i,"data-separator-first":r?"":void 0,"data-separator-last":o?"":void 0}})}function el(e,t){return`hunk-separator-${e}-${t}`}function tl(e){const t=e.at(-1);return t==null?0:Math.max(J(t.additionStart,t.additionCount),J(t.deletionStart,t.deletionCount))}function ii({line:e,spanStart:t,spanLength:i}){return{start:{line:e,character:t},end:{line:e,character:t+i},properties:{"data-diff-span":""},alwaysWrap:!0}}function Dt({item:e,arr:t,enableJoin:i,isNeutral:n=!1,isLastItem:s=!1}){const r=t[t.length-1];if(r==null||s||!i){t.push([n?0:1,e.value]);return}const o=r[0]===0;if(n===o||n&&e.value.length===1&&!o){r[1]+=e.value;return}t.push([n?0:1,e.value])}function yt(e){return[oe(e.additionStart,e.additionCount)+1,J(e.additionStart,e.additionCount)+1]}function Te({isPartial:e,rangeSize:t,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:s}){const r=Math.max(t,0);if(r===0||e)return{fromStart:0,fromEnd:0,rangeSize:r,collapsedLines:r,renderAll:!1};if(i===!0||r<=s)return{fromStart:r,fromEnd:0,rangeSize:r,collapsedLines:0,renderAll:!0};const o=i?.get(n),a=Math.min(Math.max(o?.fromStart??0,0),r),l=Math.min(Math.max(o?.fromEnd??0,0),r),d=a+l,h=d>=r;return{fromStart:h?r:a,fromEnd:h?0:l,rangeSize:r,collapsedLines:Math.max(r-d,0),renderAll:h}}function il(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 i=e.additionLines.length-J(t.additionStart,t.additionCount),n=e.deletionLines.length-J(t.deletionStart,t.deletionCount);return i<=0&&n<=0?!1:i!==n}function ur({fileDiff:e,errorPrefix:t}){const i=e.hunks[e.hunks.length-1];if(i==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const n=e.additionLines.length-J(i.additionStart,i.additionCount),s=e.deletionLines.length-J(i.deletionStart,i.deletionCount);if(n<=0&&s<=0)return 0;if(n!==s)throw new Error(`${t}: trailing context mismatch (additions=${n}, deletions=${s}) for ${e.name}`);return Math.min(n,s)}function Ae({fileDiff:e,hunkIndex:t,expandedHunks:i,collapsedContextThreshold:n,errorPrefix:s}){if(t!==e.hunks.length-1)return;const r=ur({fileDiff:e,errorPrefix:s});if(r<=0)return;if(i===!0||r<=n)return{fromStart:r,fromEnd:0,rangeSize:r,collapsedLines:0,renderAll:!0};const o=i?.get(e.hunks.length),a=Math.min(Math.max(o?.fromStart??0,0),r);return{fromStart:a,fromEnd:0,rangeSize:r,collapsedLines:r-a,renderAll:a>=r}}function fr({fileDiff:e,lineNumber:t,expandedHunks:i,collapsedContextThreshold:n}){if(i===!0||e.isPartial)return!0;for(const[a,l]of e.hunks.entries()){const[d,h]=yt(l);if(t=d-c.fromEnd}if(t=o+s.rangeSize}function nl({fileDiff:e,lineNumber:t,direction:i,expandedHunks:n,collapsedContextThreshold:s}){if(n===!0||e.isPartial)return t;const r=[];let o=1;for(const[l,d]of e.hunks.entries()){const[h,c]=yt(d),u=Te({isPartial:e.isPartial,rangeSize:d.collapsedBefore,expandedHunks:n,hunkIndex:l,collapsedContextThreshold:s}),f=h-u.rangeSize;u.renderAll?r.push([f,h]):(u.fromStart>0&&r.push([f,f+u.fromStart]),u.fromEnd>0&&r.push([h-u.fromEnd,h])),r.push([h,c]),o=c}const a=Ae({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:s,errorPrefix:"getNearestRenderableAdditionLine"});if(a!=null){const l=o;o=l+a.rangeSize,a.renderAll?r.push([l,o]):a.fromStart>0&&r.push([l,l+a.fromStart])}if(t>=o)return t;if(i==="down"){for(const[l,d]of r)if(d>t)return Math.max(l,t);return}for(let l=r.length-1;l>=0;l--){const[d,h]=r[l];if(d<=t)return Math.min(h-1,t)}}function pr({type:e,metrics:t}){return t.hunkSeparatorHeight??fa(e)}function gr({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function sl({type:e,hunkIndex:t,hunkSpecs:i}){switch(e){case"simple":return t>0;case"metadata":return i!=null;case"line-info":case"line-info-basic":case"custom":return!0}}function rl(e){return e!=="simple"&&e!=="metadata"}function ut({type:e,metrics:t,hunkIndex:i,hunkSpecs:n}){if(!sl({type:e,hunkIndex:i,hunkSpecs:n}))return;const s=pr({type:e,metrics:t}),r=gr({type:e,metrics:t}),o=i>0?r:0,a=r;return{height:s,gapBefore:o,gapAfter:a,totalHeight:o+s+a}}function _e({type:e,metrics:t}){if(!rl(e))return;const i=pr({type:e,metrics:t}),n=gr({type:e,metrics:t});return{height:i,gapBefore:n,gapAfter:0,totalHeight:n+i}}function Ve({diff:e,diffStyle:t,startingLine:i=0,totalLines:n=1/0,expandedHunks:s,collapsedContextThreshold:r=1,callback:o}){const a=ol({diff:e,diffStyle:t,startingLine:i,expandedHunks:s,collapsedContextThreshold:r}),l={viewportStart:i,viewportEnd:i+n,isWindowedHighlight:i>0||n<1/0,splitCount:a.splitCount,unifiedCount:a.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!l.isWindowedHighlight)return!1;const d=l.unifiedCount>=i+n,h=l.splitCount>=i+n;return t==="unified"?d:(t==="split"||d)&&h},shouldSkip(d,h){if(!l.isWindowedHighlight)return!1;const c=d>0&&l.unifiedCount+d<=i,u=h>0&&l.splitCount+h<=i;return t==="unified"?c:(t==="split"||c)&&u},incrementCounts(d,h){(t==="unified"||t==="both")&&(l.unifiedCount+=d),(t==="split"||t==="both")&&(l.splitCount+=h)},isInWindow(d,h){if(!l.isWindowedHighlight)return!0;const c=l.isInUnifiedWindow(d),u=l.isInSplitWindow(h);return t==="unified"?c:t==="split"?u:c||u},isInUnifiedWindow(d){return!l.isWindowedHighlight||l.unifiedCount>=i-d&&l.unifiedCount=i-d&&l.splitCount0?0:t==="unified"?x===h.unifiedLineStart+h.unifiedLineCount-1?m.collapsedLines:0:A===h.splitLineStart+h.splitLineCount-1?m.collapsedLines:0},b=function(){return y?0:(y=!0,p.collapsedLines)};const h=e.hunks[d];if(h==null)throw new Error("iterateOverDiff: invalid hunk index");if(l.shouldBreak())break;const c=oe(h.deletionStart,h.deletionCount),u=oe(h.additionStart,h.additionCount),f=!e.isPartial&&h.deletionCount===0?c:h.deletionLineIndex,g=!e.isPartial&&h.additionCount===0?u:h.additionLineIndex,p=Te({isPartial:e.isPartial,rangeSize:h.collapsedBefore,expandedHunks:s,hunkIndex:d,collapsedContextThreshold:r}),m=d===l.finalHunkIndex?Ae({fileDiff:e,hunkIndex:d,expandedHunks:s,collapsedContextThreshold:r,errorPrefix:"iterateOverDiff"}):void 0,v=p.fromStart+p.fromEnd;let y=p.collapsedLines===0;if(l.shouldSkip(v,v))l.incrementCounts(v,v),b();else{let x=h.unifiedLineStart-p.rangeSize,A=h.splitLineStart-p.rangeSize,T=f-p.rangeSize,F=g-p.rangeSize,I=c+1-p.rangeSize,D=u+1-p.rangeSize;if(Ft(l,p.fromStart,t,O=>l.emit({hunkIndex:d,hunk:h,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:I+O,lineIndex:T+O,noEOFCR:!1,unifiedLineIndex:x+O,splitLineIndex:A+O},additionLine:{unifiedLineIndex:x+O,splitLineIndex:A+O,lineIndex:F+O,lineNumber:D+O,noEOFCR:!1}}))||(x=h.unifiedLineStart-p.fromEnd,A=h.splitLineStart-p.fromEnd,T=f-p.fromEnd,F=g-p.fromEnd,I=c+1-p.fromEnd,D=u+1-p.fromEnd,Ft(l,p.fromEnd,t,O=>l.emit({hunkIndex:d,hunk:h,collapsedBefore:b(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:I+O,lineIndex:T+O,noEOFCR:!1,unifiedLineIndex:x+O,splitLineIndex:A+O},additionLine:{unifiedLineIndex:x+O,splitLineIndex:A+O,lineIndex:F+O,lineNumber:D+O,noEOFCR:!1}}),()=>{b()})))break e}let C=h.unifiedLineStart,E=h.splitLineStart,S=f,w=g,R=c+1,L=u+1;const H=h.hunkContent.at(-1);for(const x of h.hunkContent){if(l.shouldBreak())break e;const A=x===H;if(x.type==="context"){if(l.shouldSkip(x.lines,x.lines))l.incrementCounts(x.lines,x.lines),b();else if(Ft(l,x.lines,t,T=>{const F=A&&T===x.lines-1,I=C+T,D=E+T;return l.emit({hunkIndex:d,hunk:h,collapsedBefore:b(),collapsedAfter:k(I,D),type:"context",deletionLine:{lineNumber:R+T,lineIndex:S+T,noEOFCR:F&&h.noEOFCRDeletions,unifiedLineIndex:I,splitLineIndex:D},additionLine:{unifiedLineIndex:I,splitLineIndex:D,lineIndex:w+T,lineNumber:L+T,noEOFCR:F&&h.noEOFCRAdditions}})},()=>{b()}))break e;C+=x.lines,E+=x.lines,S+=x.lines,w+=x.lines,R+=x.lines,L+=x.lines}else{const T=Math.max(x.deletions,x.additions),F=x.deletions+x.additions;if(!l.shouldSkip(F,T)){const I=dl(l,x,t);(I[0]?.[0]??0)>0&&b();for(const[D,O]of I)for(let G=D;G{const D=I===F-1;return l.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:D?x:0,type:"context-expanded",deletionLine:{lineNumber:R+I,lineIndex:S+I,noEOFCR:!1,unifiedLineIndex:C+I,splitLineIndex:E+I},additionLine:{unifiedLineIndex:C+I,splitLineIndex:E+I,lineIndex:w+I,lineNumber:L+I,noEOFCR:!1}})},void 0,()=>l.shouldBreak()))break e}}}function ol({diff:e,diffStyle:t,startingLine:i,expandedHunks:n,collapsedContextThreshold:s}){if(i<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const r=al({diff:e,expandedHunks:n,collapsedContextThreshold:s});let o=0,a=e.hunks.length-1,l=e.hunks.length;for(;o<=a;){const h=o+a>>1,c=r[h+1];if(c==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?c.unifiedCount:c.splitCount)>i?(l=h,a=h-1):o=h+1}if(l>=e.hunks.length){const h=r[e.hunks.length];if(h==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:h.splitCount,unifiedCount:h.unifiedCount}}const d=r[l];if(d==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:l,splitCount:d.splitCount,unifiedCount:d.unifiedCount}}function al({diff:e,expandedHunks:t,collapsedContextThreshold:i}){let n=0,s=0;const r=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let a=0;al&&n.push([l,d])}if(i!=="split"&&s(e.unifiedCount),i!=="unified"&&s(e.splitCount),n.length===0)return[0,0];let r=n[0][0],o=n[0][1];for(let a=1;a0&&(e.incrementCounts(o,o),s?.());let l=o;for(;l=a){e.incrementCounts(t-l,t-l);break}if(e.isInWindow(0,0)){if(n(l)===!0)return!0}else e.incrementCounts(1,1);l++}return!1}function dl(e,t,i){if(!e.isWindowedHighlight)return[[0,i==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const n=i!=="split",s=i!=="unified",r=i==="unified"?"unified":"split",o=[];function a(c,u){if(c+u<=e.viewportStart||c>=e.viewportEnd)return;const f=Math.max(0,e.viewportStart-c),g=Math.min(u,e.viewportEnd-c);return g>f?[f,g]:void 0}function l(c,u){return r==="split"?c:u==="additions"?[c[0]+t.deletions,c[1]+t.deletions]:c}function d(c,u){if(c==null)return;const[f,g]=l(c,u);g>f&&o.push([f,g])}if(n&&(d(a(e.unifiedCount,t.deletions),"deletions"),d(a(e.unifiedCount+t.deletions,t.additions),"additions")),s&&(d(a(e.splitCount,t.deletions),"deletions"),d(a(e.splitCount,t.additions),"additions")),o.length===0)return o;o.sort((c,u)=>c[0]-u[0]);const h=[o[0]];for(const[c,u]of o.slice(1)){const f=h[h.length-1];c<=f[1]?f[1]=Math.max(f[1],u):h.push([c,u])}return h}function hl({hunkIndex:e,hunk:t,collapsedAfter:i,collapsedBefore:n,diffStyle:s,index:r,unifiedLineIndex:o,splitLineIndex:a,additionLineIndex:l,deletionLineIndex:d,additionLineNumber:h,deletionLineNumber:c,content:u,isLastContent:f,unifiedCount:g,splitCount:p}){const m=r=u.deletions?o+r:void 0:r=u.deletions?l+(r-u.deletions):void 0:r=u.deletions?h+(r-u.deletions):void 0:r0||o<1/0;s&&=!n&&!i.useTokenTransformer;const h=typeof i.theme=="string"?t.getTheme(i.theme).type:void 0,c=As({theme:i.theme,highlighter:t}),u=n&&!d&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":i.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:g}=i,p=!n&&!e.isPartial,m=n?a:void 0,v=new Map;function k(b){const C=p?0:b,E=v.get(C)??pl();return v.set(C,E),E}function y(b,C,E,S){if(d){let w=E.at(-1);(w==null||w.targetIndex+w.count!==C)&&(w={targetIndex:C,originalOffset:S.length,count:0},E.push(w)),w.count++}S.push(b)}Ve({diff:e,diffStyle:"both",startingLine:r,totalLines:o,expandedHunks:d?m:!0,collapsedContextThreshold:l,callback:({hunkIndex:b,additionLine:C,deletionLine:E,type:S})=>{const w=k(b),R=C!=null?C.splitLineIndex:E.splitLineIndex;S==="change"&&C!=null&&E!=null&&fl({additionLine:e.additionLines[C.lineIndex],deletionLine:e.deletionLines[E.lineIndex],deletionLineIndex:w.deletionContent.length,additionLineIndex:w.additionContent.length,deletionDecorations:w.deletionDecorations,additionDecorations:w.additionDecorations,lineDiffType:u,maxLineDiffLength:g}),E!=null&&(y(e.deletionLines[E.lineIndex],E.lineIndex,w.deletionSegments,w.deletionContent),w.deletionInfo.push({type:S==="change"?"change-deletion":S,lineNumber:E.lineNumber,altLineNumber:S==="change"?void 0:C.lineNumber??void 0,lineIndex:`${E.unifiedLineIndex},${R}`})),C!=null&&(y(e.additionLines[C.lineIndex],C.lineIndex,w.additionSegments,w.additionContent),w.additionInfo.push({type:S==="change"?"change-addition":S,lineNumber:C.lineNumber,altLineNumber:S==="change"?void 0:E.lineNumber??void 0,lineIndex:`${C.unifiedLineIndex},${R}`}))}});for(const b of v.values()){if(b.deletionContent.length===0&&b.additionContent.length===0)continue;const C={name:e.prevName??e.name,contents:b.deletionContent.value},E={name:e.name,contents:b.additionContent.value},{deletionLines:S,additionLines:w}=gl({deletionFile:C,deletionInfo:b.deletionInfo,deletionDecorations:b.deletionDecorations,additionFile:E,additionInfo:b.additionInfo,additionDecorations:b.additionDecorations,highlighter:t,options:i,languageOverride:n?"text":e.lang,lazyLineAST:s});if(p){f.deletionLines=S,f.additionLines=w;continue}for(const[R,L,H]of[[f.deletionLines,S,b.deletionSegments],[f.additionLines,w,b.additionSegments]])if(H.length>0)for(const x of H)for(let A=0;AL[A])}else Xi(R,L)}return{code:f,themeStyles:c,baseThemeType:h}}function ul(e,{deletionLineIndex:t,additionLineIndex:i,deletionDecorations:n,additionDecorations:s}){let r=0,o=0,a=-1,l=0,d=-1,h=0;for(const{value:c,added:u,removed:f}of e)f?(a===-1&&(a=r),r+=c.length,l=r):u?(d===-1&&(d=o),o+=c.length,h=o):(r+=c.length,o+=c.length);a!==-1&&n.push(ii({line:t,spanStart:a,spanLength:l-a})),d!==-1&&s.push(ii({line:i,spanStart:d,spanLength:h-d}))}function fl({deletionLine:e,additionLine:t,deletionLineIndex:i,additionLineIndex:n,deletionDecorations:s,additionDecorations:r,lineDiffType:o,maxLineDiffLength:a}){if(e==null||t==null||o==="none"||(e=Re(e),t=Re(t),e.length>a||t.length>a))return;const l=o==="char"?Er(e,t):Rr(e,t);if(o==="word-line"){ul(l,{deletionLineIndex:i,additionLineIndex:n,deletionDecorations:s,additionDecorations:r});return}const d=[],h=[],c=o==="word-alt",u=l.at(-1);for(const g of l){const p=g===u;!g.added&&!g.removed?(Dt({item:g,arr:d,enableJoin:c,isNeutral:!0,isLastItem:p}),Dt({item:g,arr:h,enableJoin:c,isNeutral:!0,isLastItem:p})):g.removed?Dt({item:g,arr:d,enableJoin:c,isLastItem:p}):Dt({item:g,arr:h,enableJoin:c,isLastItem:p})}let f=0;for(const g of d)g[0]===1&&s.push(ii({line:i,spanStart:f,spanLength:g[1].length})),f+=g[1].length;f=0;for(const g of h)g[0]===1&&r.push(ii({line:n,spanStart:f,spanLength:g[1].length})),f+=g[1].length}function pl(){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 gl({lazyLineAST:e,deletionFile:t,additionFile:i,deletionInfo:n,additionInfo:s,highlighter:r,deletionDecorations:o,additionDecorations:a,languageOverride:l,options:{theme:d,useTokenTransformer:h,tokenizeMaxLineLength:c}}){const u=(f,g,p)=>f.contents===""?[]:Yi(r.codeToTokens(Re(f.contents),Ds(l??j(f.name),d,c)).tokens,{state:{lineInfo:g},useTokenTransformer:h,decorations:p,lazyLineAST:e,cacheHtmlStyles:r.name==="highlights"});return{deletionLines:u(t,n,o),additionLines:u(i,s,a)}}function we(e,t){const i=We({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:i.hunks,splitLineCount:i.splitLineCount,unifiedLineCount:i.unifiedLineCount,additionLines:i.additionLines,deletionLines:i.deletionLines,additionCharacterCount:i.additionCharacterCount,deletionCharacterCount:i.deletionCharacterCount,type:i.type}}function ml(e,t){const i=Math.max(e,1);let n=Array.from({length:i},(s,r)=>`${" ".repeat(r+1)} `).join("");return n===t&&(n=Array.from({length:i},(s,r)=>`\0${" ".repeat(r)} -`).join("")),n}function Oa(e){for(const t of e)if(t.trim().length>0)return!1;return!0}function Ei(e,t){return t.length>0&&t.length1&&e.at(-1)===""}function Ks(e,t){if(!za(t))return;const i=t.length-e.additionLines.length;if(i<=0)return;const n=e.additionLines.length,s=e.hunks.at(-1);if(s!=null&&Q(s.additionStart,s.additionCount)===n){for(const r of s.hunkContent)if(r.type==="change"&&r.additions=n.additionLineIndex&&t0)return!1;return!0}function Di(e,t){return t.length>0&&t.length1&&e.at(-1)===""}function vr(e,t){if(!Sl(t))return;const i=t.length-e.additionLines.length;if(i<=0)return;const n=e.additionLines.length,s=e.hunks.at(-1);if(s!=null&&J(s.additionStart,s.additionCount)===n){for(const r of s.hunkContent)if(r.type==="change"&&r.additions=n.additionLineIndex&&tXs(s,i,n)),e.additionLineIndex=i+t.additionLineIndex,e.additionStart=e.additionStart+t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=n+t.deletionLineIndex,e.deletionStart=e.deletionStart+t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,Ui(e)}function Xs(e,t,i){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+i}}function Ui(e){let t=0,i=0;for(const n of e.hunkContent)n.type==="context"?(t+=n.lines,i+=n.lines):(t+=Math.max(n.additions,n.deletions),i+=n.additions+n.deletions);e.splitLineCount=t,e.unifiedLineCount=i}function ei(e){let t=0,i=0,n=0;for(const s of e.hunks)s.collapsedBefore=Math.max(re(s.additionStart,s.additionCount)-n,0),s.splitLineStart=t+s.collapsedBefore,s.unifiedLineStart=i+s.collapsedBefore,Ui(s),t+=s.collapsedBefore+s.splitLineCount,i+=s.collapsedBefore+s.unifiedLineCount,n=Q(s.additionStart,s.additionCount);if(e.hunks.length>0){const s=e.hunks[e.hunks.length-1],r=Math.max(e.additionLines.length-Q(s.additionStart,s.additionCount),0);t+=r,i+=r}e.splitLineCount=t,e.unifiedLineCount=i}const un=new WeakMap;function Wa(e){return e.length>1&&e[e.length-1]===""?e.slice(0,-1):e}function qa(e,t){const i=Math.min(e.length,t.length);let n=0;for(;nn&&r>n&&e[s-1]===t[r-1];)s--,r--;if(!(n===s&&n===r))return{start:n,deletionEnd:s,additionEnd:r}}function Ri(e,t,i){const n=e.hunks,s=e.additionLines,r=Wa(s),o=r===s?e:{...e,additionLines:r},l=el(n,Ja(o,t,i),e.deletionLines.length),a=nl(o,l);if(e.additionLines=r,e.hunks=a,e.editSessionDirty=!0,al(e),Ks(e,s),!!rl(n,e.hunks))return{regions:l.map(h=>h.previousSpan)}}function $a(e,t,i,n){const s=new Set(t),r=Array.from(s).filter(d=>d>=0&&dd-c);if(r.length===0)return;const o=d=>s.has(d)?n?.get(d):e.additionLines[d],{hunks:l}=e;let a,h=0;for(const d of r){for(;h=c.additionLineIndex&&l0||d>0)&&i.set(s,{fromStart:h,fromEnd:d})}return i}function Xa(e,t,i){const n=[];if(e.isPartial)return n;for(const[r,o]of e.hunks.entries()){const l=Re({isPartial:e.isPartial,rangeSize:o.collapsedBefore,expandedHunks:t,hunkIndex:r,collapsedContextThreshold:i});if(l.rangeSize<=i)continue;const a=Ve(o),h=a-l.rangeSize;l.fromStart>0&&n.push([h,h+l.fromStart]),l.fromEnd>0&&n.push([a-l.fromEnd,a])}const s=Te({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:i,errorPrefix:"captureExpansionAnchors"});if(s!=null&&s.fromStart>0&&s.rangeSize>i){const r=e.hunks[e.hunks.length-1],o=Ve(r)+r.deletionCount;n.push([o,o+s.fromStart])}return n}function Qa(e,t){const i=new Map;if(t.length===0)return i;const n=(r,o,l)=>{if(l<=o)return;let a=0,h=0;for(const[d,c]of t)c<=o||d>=l||(d<=o&&(a=Math.max(a,Math.min(c,l)-o)),c>=l&&(h=Math.max(h,l-Math.max(d,o))));(a>0||h>0)&&i.set(r,{fromStart:a,fromEnd:h})};for(const[r,o]of e.hunks.entries()){const l=Ve(o);n(r,l-Math.max(o.collapsedBefore,0),l)}const s=e.hunks[e.hunks.length-1];return s!=null&&!e.isPartial&&e.deletionLines.length>0&&n(e.hunks.length,Ve(s)+s.deletionCount,e.deletionLines.length),i}function fn(e,t){return e.editSessionDirty!==!0?!1:(delete e.editSessionDirty,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join("")===""?we(e,t):js(e,t)),!0)}function Ja(e,t,i){if(qa(e.deletionLines,e.additionLines)==null)return[];const n=Ue({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);let s;const r=(h,d)=>{s??=Za(e.hunks);for(let c=0;c<=d;c++){const u=s.get(h.deletionLineIndex-c);if(!(u==null||u.additions!==h.additions||u.deletions!==h.deletions)){if(h.additions>0&&i!=null){for(let f=0;f0?h.additionLineIndex-l:h.deletionLineIndex-a;l+=d,a+=d;for(const c of h.hunkContent){if(c.type==="context"){l+=c.lines,a+=c.lines;continue}const u=Xs(c,0,0);u.additions===0&&(u.additionLineIndex=l),u.deletions===0&&(u.deletionLineIndex=a),o.push(u),l+=u.additions,a+=u.deletions}}return o}function Za(e){const t=new Map;for(const i of e)for(const n of i.hunkContent)n.type==="change"&&(n.additions===0||n.deletions===0)&&t.set(n.deletionLineIndex,n);return t}function el(e,t,i){const n=e.map((o,l)=>{const a=Ve(o);return{deletionStart:a,deletionEnd:a+o.deletionCount,blocks:[],previousSpan:{firstIndex:l,lastIndex:l}}}),s=[];let r=0;for(const o of t){const l=o.deletionLineIndex,a=l+o.deletions;for(;r0&&tl(l,a,s[s.length-1])?s.pop():void 0;for(;ro.deletions){const u=s[s.length-1]?.deletionEnd??0,f=n[r]?.deletionStart??i;l>u?d--:a=i.deletionStart}function il(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 nl(e,t){const i=[];let n=0,s=0;for(const r of t){const o=r.deletionStart-n;if(o<0)throw new Error("buildRegionHunks: overlapping old-side regions");n+=o,s+=o;const l=s,a=[];for(const d of r.blocks){const c=d.deletionLineIndex-n,u=d.additionLineIndex-s;if(c<0||c!==u)throw new Error("buildRegionHunks: canonical block context mismatch");pn(a,c,s,n),n+=c,s+=u,a.push({...d}),n+=d.deletions,s+=d.additions}const h=r.deletionEnd-n;if(h<0)throw new Error("buildRegionHunks: block exceeds its old-side region");pn(a,h,s,n),n+=h,s+=h,i.push(sl(e,{additionStart:l,additionEnd:s,deletionStart:r.deletionStart,deletionEnd:r.deletionEnd},a))}if(e.deletionLines.length-n!==e.additionLines.length-s)throw new Error("buildRegionHunks: trailing context mismatch");return i}function sl(e,t,i){const n=t.additionEnd-t.additionStart,s=t.deletionEnd-t.deletionStart;let r=0,o=0;for(const a of i)a.type==="change"&&(r+=a.additions,o+=a.deletions);const l={collapsedBefore:0,additionStart:Tt(t.additionStart,n),additionCount:n,additionLines:r,additionLineIndex:mn(t.additionStart,n),deletionStart:Tt(t.deletionStart,s),deletionCount:s,deletionLines:o,deletionLineIndex:mn(t.deletionStart,s),hunkContent:i,hunkSpecs:`@@ -${Tt(t.deletionStart,s)},${s} +${Tt(t.additionStart,n)},${n} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return Ui(l),l}function pn(e,t,i,n){t>0&&e.push({type:"context",lines:t,additionLineIndex:i,deletionLineIndex:n})}function rl(e,t){if(e.length!==t.length)return!0;for(let i=0;i{this.applyRefreshedResult(e,i.getDiffResultCache(e))}).catch(n=>this.onHighlightError(n))):this.asyncHighlight(e).then(n=>this.applyRefreshedResult(e,n)).catch(n=>this.onHighlightError(n))}applyRefreshedResult(e,t){const{diff:i,renderCache:n}=this;if(t==null||i==null||n==null||!B(i,e)||!B(n.diff,e)||this.editSessionActive)return;const{options:s}=this.getRenderOptions(i);ee(s,t.options)&&(this.pendingHighlightResult={diff:i,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,i=this.getOptionsWithDefaults().expansionLineCount){const n={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(n.fromStart+=i),(t==="down"||t==="both")&&(n.fromEnd+=i),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,n)}getExpandedHunk(e){return this.expandedHunks.get(e)??Lr}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const i=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),n=i[t.lineNumber]??[];i[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,i=!1,n,s){this.pendingStructuralRows=void 0;const{renderCache:r}=this;if(r==null)return!1;const{result:o,diff:l}=r;if(o==null)return!1;if(l.isPartial)throw new Error("Could not update render cache for partial diff");const a=o.code.additionLines,h=this.pendingStructuralRows=i?new Map:void 0,d=[],c=new Map;if(h==null&&n!=null){const f=l.additionLines.length,g=fl(l.additionLines,s);for(const[p,m]of n){if(p<0||p>f||p===f&&(m===""||!g))continue;const y=l.additionLines[p]??"";y!==m&&(l.additionLines[p]=m,d.push(p),c.set(p,y),e.has(p)||(a[p]=Bt(p,me(m))))}}for(const[f,g]of e){const p=a[f]?.properties??{},m=g.map(b=>b[2]).join(""),y=fb===0&&C===""?S===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:S}:{type:"element",tagName:"span",properties:{"data-char":b,style:`color:${C};`},children:[{type:"text",value:S}]})};h!=null?h.set(f,x):a[f]=x}let u=!1;if(d.length>0)if(this.editSessionActive)if(l.additionLines.length<=1&&l.additionLines.join("")==="")this.applyRecomputePreservingSessionType(l,Nt(l,this.options.parseDiffOptions)),u=!0;else if(Ei(l,l.additionLines))this.applyRecomputePreservingSessionType(l,Xt(l,l.additionLines,this.options.parseDiffOptions)),u=!0;else{const f=$a(l,d,this.options.parseDiffOptions,c);this.applyExpansionRemap(f),u=f!=null}else Object.assign(l,Na(l,d,this.options.parseDiffOptions));return o.baseThemeType=t,r.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=Ya(this.expandedHunks,e))}applyDocumentChange(e){const{pendingStructuralRows:t,renderCache:i}=this;this.pendingStructuralRows=void 0;const n=this.diff??i?.diff;if(n==null)return;const s=i?.result;if(n.isPartial)throw new Error("Could not apply document change for partial diff");const{additionLines:r}=n;if(n.additionLines=pl(e),s!=null&&(s.code.additionLines=ul(r,n.additionLines,s.code.additionLines,e)),n.additionLines.length<=1&&n.additionLines.join("")===""?(this.applyRecomputePreservingSessionType(n,Nt(n,this.options.parseDiffOptions)),s!=null&&(s.code.additionLines[0]=Bt(0,e.getLineText(0)))):this.editSessionActive?this.applySessionDocumentChange(n,r):Object.assign(n,js(n,this.options.parseDiffOptions)),t!=null&&s!=null)for(const[o,l]of t)ot[s]))}applyRecomputePreservingSessionType(e,t){const i=this.editSessionActive?e.type:void 0;Object.assign(e,t),i!=null&&(e.type=i),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 i=t==="change"?e==="deletions"?"change-deletion":"change-addition":t;return{gutterLineType:i,contentProperties:{"data-line-type":i}}}createAnnotationElement=e=>Si(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:i=!1,disableFileHeader:n=!1,disableLineNumbers:s=!1,disableVirtualizationBuffers:r=!1,collapsed:o=!1,expandUnchanged:l=!1,collapsedContextThreshold:a=1,expansionLineCount:h=100,hunkSeparators:d="line-info",lineDiffType:c="word-alt",maxLineDiffLength:u=1e3,overflow:f="scroll",stickyHeader:g=!1,theme:p=U,headerRenderMode:m="default",tokenizeMaxLineLength:y=1e3,tokenizeMaxLength:v=br,useTokenTransformer:k=!1,useCSSClasses:x=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:i,disableFileHeader:n,disableLineNumbers:s,disableVirtualizationBuffers:r,collapsed:o,expandUnchanged:l,collapsedContextThreshold:a,expansionLineCount:h,hunkSeparators:d,lineDiffType:c,maxLineDiffLength:u,overflow:f,stickyHeader:g,theme:this.workerManager?.getDiffRenderOptions().theme??p,headerRenderMode:m,tokenizeMaxLineLength:y,tokenizeMaxLength:v,useTokenTransformer:k,useCSSClasses:x}}async initializeHighlighter(){return this.highlighter=await Me(rs(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),i=st(e,this.getTokenizeMaxLength());let n=this.workerManager?.getDiffResultCache(e);n!=null&&!ee(t,n.options)&&(n=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!i&&!Ne(e),options:t,result:i?void 0:n?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!i&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter==null&&(this.computedLangs=hi(e),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??U}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:n,tokenizeMaxLineLength:s,lineDiffType:r,maxLineDiffLength:o}=this.getOptionsWithDefaults();return{theme:n,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:s,lineDiffType:r,maxLineDiffLength:o}})();this.getOptionsWithDefaults();const{renderCache:i}=this;return i?.result==null?{options:t,forceHighlight:!0}:!B(e,i.diff)||!ee(t,i.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(B(this.renderCache.diff,e))return this.renderCache.diff;const i=!(e.additionLines.length>0||e.deletionLines.length>0)||Ne(e)||st(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,i)?e:this.renderCache.diff}canRenderDiff(e,t,i){const{renderCache:n}=this;return n==null||B(n.diff,e)?!0:i?n.result==null&&n.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&ce(t.theme):n.result==null&&n.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!n.highlighted:this.highlighter!=null&&ce(t.theme)}renderDiff(e=this.diff,t=_t){if(this.diff=e,e==null){this.pendingHighlightResult=void 0;return}const{expandUnchanged:i,collapsedContextThreshold:n}=this.getOptionsWithDefaults();let{options:s,forceHighlight:r}=this.getRenderOptions(e);const o=this.getReadyRenderResult(e,s);this.pendingHighlightResult=void 0,o!=null&&(this.renderCache={...o,diff:e,renderRange:void 0},r=!1),this.renderCache??={diff:e,highlighted:!1,options:s,result:void 0,renderRange:void 0};const l=e.additionLines.length>0||e.deletionLines.length>0,a=!l||Ne(e)||st(e,this.getTokenizeMaxLength()),h=this.canRenderDiff(e,s,a),d=!B(e,this.renderCache.diff),c=!Jt(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){const u=this.renderCache.result==null&&this.renderCache.highlighted&&!a&&!d&&qt(t);h&&!u&&(a||this.renderCache.result==null||!this.renderCache.highlighted&&(d||c))&&(this.renderCache.diff=e,this.renderCache.options=s,this.renderCache.highlighted=!1,(this.renderCache.result==null||d||c||r)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,qt(t)||i?!0:this.expandedHunks,n)),this.renderCache.renderRange=t),!a&&l&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLangs=hi(e),this.highlighter??=Je();const u=this.highlighter!=null&&ce(s.theme),f=this.highlighter!=null&&Qe(this.computedLangs),g=!a&&f;if(h&&this.highlighter!=null&&u&&(r||a||!this.renderCache.highlighted&&g||this.renderCache.result==null)){const{result:p,options:m}=this.renderDiffWithHighlighter(e,this.highlighter,a||!f);this.renderCache={diff:e,options:m,highlighted:g,result:p,renderRange:void 0}}(!u||!a&&!f)&&this.asyncHighlight(e).then(({result:p,options:m})=>{this.applyHighlightResult(e,p,m,!a)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=_t){this.diff=e;const{result:i}=await this.asyncHighlight(e);return this.processDiffResult(e,t,i)}createPreElement(e,t,i){const{diffIndicators:n,disableBackground:s,disableLineNumbers:r,overflow:o}=this.getOptionsWithDefaults();return ss({type:"diff",diffIndicators:n,disableBackground:s,disableLineNumbers:r,overflow:o,split:e,totalLines:t,customProperties:i})}async asyncHighlight(e){const t=st(e,this.getTokenizeMaxLength());this.computedLangs=t?["text"]:hi(e);const i=this.highlighter!=null&&ce(this.getLocalHighlightTheme()),n=t||this.highlighter!=null&&Qe(this.computedLangs);return(this.highlighter==null||!i||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,i=!1){const{options:n}=this.getRenderOptions(e),{collapsedContextThreshold:s}=this.getOptionsWithDefaults(),r=Gs(e,t,n,{forcePlainText:i,expandedHunks:i?!0:void 0,collapsedContextThreshold:s});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===""&&r.code.additionLines[0]==null){let o;if(Be({diff:e,diffStyle:"both",expandedHunks:i?!0:void 0,collapsedContextThreshold:s,callback:({additionLine:l})=>{if(l?.lineIndex===0)return o=l,!0}}),o==null)throw new Error("DiffHunksRenderer: missing empty addition line");r.code.additionLines[0]=Bt(0,"",o.unifiedLineIndex,o.splitLineIndex)}return{result:r,options:n}}onHighlightSuccess(e,t,i,n=!0){this.editSessionActive||this.applyHighlightResult(e,t,i,n)}applyHighlightResult(e,t,i,n=!0){const{diff:s,renderCache:r}=this;s==null||r==null||!B(s,e)||!ee(i,this.getRenderOptions(s).options)||(r.result==null||!r.highlighted||!ee(r.options,i)||!B(r.diff,s))&&(this.pendingHighlightResult={diff:s,options:i,highlighted:n,result:t},this.onRenderUpdate?.())}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const i=this.workerManager?.getDiffResultCache(e);if(!(i==null||!ee(t,i.options)))return i}getReadyRenderResult(e,t){const{pendingHighlightResult:i}=this;if(i!=null&&B(i.diff,e)&&ee(i.options,t))return i;const n=this.getMatchingWorkerResultCache(e,t);if(!(n==null||this.hasHighlightedRenderCache(e,t)))return{diff:e,highlighted:!0,...n}}hasHighlightedRenderCache(e,t){const{renderCache:i}=this;return i?.result!=null&&i.highlighted&&B(e,i.diff)&&ee(t,i.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:i,themeStyles:n,baseThemeType:s}){const{diffStyle:r,disableFileHeader:o,expandUnchanged:l,expansionLineCount:a,collapsedContextThreshold:h,hunkSeparators:d}=this.getOptionsWithDefaults(),c=this.renderCache?.isDirty??!1,u=r==="unified",f=gl(e,this.options.loadDiffFiles!=null),g=!e.isPartial||f;let p=[],m=[],y=[];const v=[],{additionLines:k,deletionLines:x}=i,b={rowCount:0,hunkSeparators:d,additionsContentAST:p,deletionsContentAST:m,unifiedContentAST:y,unifiedGutterAST:Ge(),deletionsGutterAST:Ge(),additionsGutterAST:Ge(),expansionLineCount:a,hunkData:v,incrementRowCount(A=1){b.rowCount+=A},pushToGutter(A,M){switch(A){case"unified":b.unifiedGutterAST.children.push(M);break;case"deletions":b.deletionsGutterAST.children.push(M);break;case"additions":b.additionsGutterAST.children.push(M)}}},C=Vs({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),S={size:0,side:void 0,increment(){this.size+=1},flush(){if(r!=="unified"){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side==="additions"?(b.pushToGutter("additions",te(void 0,"buffer",this.size)),p?.push(wt(this.size))):(b.pushToGutter("deletions",te(void 0,"buffer",this.size)),m?.push(wt(this.size))),this.size=0,this.side=void 0}}},L=(A,M,F,G,P)=>{b.pushToGutter(A,Jn(M,F,G,P))};function w(A){S.flush(),r==="unified"?di("unified",A,b):(di("deletions",A,b),di("additions",A,b))}this.pushFileLevelAnnotations(e,r,t,b),Be({diff:e,diffStyle:r,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:l?!0:this.expandedHunks,collapsedContextThreshold:h,callback:({hunkIndex:A,hunk:M,collapsedBefore:F,collapsedAfter:G,additionLine:P,deletionLine:O,type:N})=>{const V=O!=null?O.splitLineIndex:P.splitLineIndex,J=P!=null?P.unifiedLineIndex:O.unifiedLineIndex;r==="split"&&N!=="change"&&S.flush(),F>0&&w({hunkIndex:A,collapsedLines:F,rangeSize:Math.max(M?.collapsedBefore??0,0),hunkSpecs:M?.hunkSpecs,isFirstHunk:A===0,isLastHunk:!1,isExpandable:g});const ne=r==="unified"?J:V,se={type:N,hunkIndex:A,lineIndex:ne,unifiedLineIndex:J,splitLineIndex:V,deletionLine:O,additionLine:P};if(r==="unified"){const _=this.getUnifiedInjectedRowsForLine?.(se);_?.before!=null&&vn(_.before,b);let K=O!=null?x[O.lineIndex]:void 0,Z=P!=null?k[P.lineIndex]:void 0;if(K==null&&Z==null){const ae="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(ae,{file:e.name}),new Error(ae)}const Fe=N==="change"?P!=null?"change-addition":"change-deletion":N,oe=this.getUnifiedLineDecoration({type:N,lineType:Fe,additionLineIndex:P?.lineIndex,deletionLineIndex:O?.lineIndex});L("unified",oe.gutterLineType,P!=null?P.lineNumber:O.lineNumber,`${J},${V}`,oe.gutterProperties),Z!=null?Z=Ht(Z,oe.contentProperties,c&&P!=null?{"data-line":P.lineNumber,"data-line-index":`${J},${V}`}:void 0):K!=null&&(K=Ht(K,oe.contentProperties,c&&O!=null?{"data-line":O.lineNumber,"data-line-index":`${J},${V}`}:void 0)),At({diffStyle:"unified",type:N,deletionLine:K,additionLine:Z,unifiedSpan:this.getAnnotations("unified",O?.lineNumber,P?.lineNumber,A,ne),createAnnotationElement:ae=>this.createAnnotationElement(ae),context:b}),_?.after!=null&&vn(_.after,b)}else{const _=this.getSplitInjectedRowsForLine?.(se);_?.before!=null&&Sn(_.before,b,S);let K=O!=null?x[O.lineIndex]:void 0,Z=P!=null?k[P.lineIndex]:void 0;const Fe=this.getSplitLineDecoration({side:"deletions",type:N,lineIndex:O?.lineIndex}),oe=this.getSplitLineDecoration({side:"additions",type:N,lineIndex:P?.lineIndex});if(K==null&&Z==null){const Y="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Y,{file:e.name}),new Error(Y)}const ae=(()=>{if(N==="change"){if(Z==null)return"additions";if(K==null)return"deletions"}})();ae!=null?(S.side!=null&&S.side!==ae&&S.flush(),S.side=ae,S.increment()):N==="change"&&S.flush();const Ae=this.getAnnotations("split",O?.lineNumber,P?.lineNumber,A,ne);if(Ae!=null&&S.size>0&&S.flush(),O!=null){const Y=Ht(K,Fe.contentProperties,c?{"data-line":O.lineNumber,"data-line-index":`${O.unifiedLineIndex},${V}`}:void 0);L("deletions",Fe.gutterLineType,O.lineNumber,`${O.unifiedLineIndex},${V}`,Fe.gutterProperties),Y!=null&&(K=Y)}if(P!=null){const Y=Ht(Z,oe.contentProperties,c?{"data-line":P.lineNumber,"data-line-index":`${P.unifiedLineIndex},${V}`}:void 0);L("additions",oe.gutterLineType,P.lineNumber,`${P.unifiedLineIndex},${V}`,oe.gutterProperties),Y!=null&&(Z=Y)}At({diffStyle:"split",type:N,additionLine:Z,deletionLine:K,...Ae,createAnnotationElement:Y=>this.createAnnotationElement(Y),context:b}),_?.after!=null&&Sn(_.after,b,S)}const Pe=r==="split"&&M!=null&&V===M.splitLineStart+M.splitLineCount-1,j=A===e.hunks.length-1&&M!=null&&(r==="split"?V===M.splitLineStart+M.splitLineCount-1:J===M.unifiedLineStart+M.unifiedLineCount-1),We=Pe?M.noEOFCRDeletions:!1,et=Pe?M.noEOFCRAdditions:!1,ve=(O?.noEOFCR??!1)||We,Se=(P?.noEOFCR??!1)||et;if(Se||ve){if(r==="split"&&S.flush(),ve){const _=N==="context"||N==="context-expanded"?N:"change-deletion";r==="unified"?(b.unifiedContentAST.push(xt(_)),b.pushToGutter("unified",te(_,"metadata",1))):(b.deletionsContentAST.push(xt(_)),b.pushToGutter("deletions",te(_,"metadata",1)),Se||(b.pushToGutter("additions",te(void 0,"buffer",1)),b.additionsContentAST.push(wt(1))))}if(Se){const _=N==="context"||N==="context-expanded"?N:"change-addition";r==="unified"?(b.unifiedContentAST.push(xt(_)),b.pushToGutter("unified",te(_,"metadata",1))):(b.additionsContentAST.push(xt(_)),b.pushToGutter("additions",te(_,"metadata",1)),ve||(b.pushToGutter("deletions",te(void 0,"buffer",1)),b.deletionsContentAST.push(wt(1))))}b.incrementRowCount(1)}d!=="simple"&&d!=="metadata"&&(G>0||j&&f)&&w({hunkIndex:N==="context-expanded"?A:A+1,collapsedLines:j&&f?"unknown":G,rangeSize:C,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:g}),b.incrementRowCount(1)}}),r==="split"&&S.flush();const E=Math.max(ba(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),H=t.bufferBefore>0||t.bufferAfter>0,R=!u&&e.type!=="deleted",T=!u&&e.type!=="new",D=b.rowCount>0||H;p=R&&D?p:void 0,m=T&&D?m:void 0,y=u&&D?y:void 0;const z=this.createPreElement(m!=null&&p!=null,E);return{fileDiff:e,unifiedGutterAST:u&&D?b.unifiedGutterAST.children:void 0,unifiedContentAST:y,deletionsGutterAST:T&&D?b.deletionsGutterAST.children:void 0,deletionsContentAST:m,additionsGutterAST:R&&D?b.additionsGutterAST.children:void 0,additionsContentAST:p,hunkData:v,preNode:z,themeStyles:n,baseThemeType:s,headerElement:o?void 0:this.renderHeader(e),totalLines:E,rowCount:b.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const i=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,n=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(i==null||n==null)return;const s=Ge(i);return s.properties.style=`grid-row: span ${t.rowCount}`,[s,fs(n,t.rowCount)]}renderFullAST(e,t=[]){const i=this.getOptionsWithDefaults().hunkSeparators==="line-info",n=this.renderCodeAST("unified",e);if(n!=null)return t.push(I({tagName:"code",children:n,properties:{"data-code":"","data-container-size":i?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const s=this.renderCodeAST("deletions",e);s!=null&&t.push(I({tagName:"code",children:s,properties:{"data-code":"","data-container-size":i?"":void 0,"data-deletions":""}}));const r=this.renderCodeAST("additions",e);return r!=null&&t.push(I({tagName:"code",children:r,properties:{"data-code":"","data-container-size":i?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return X(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?X(e):X(I({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,i,n){if(!Zt(i))return;const s=e.type!=="new"?this.getAnnotationNames(Ci(this.deletionAnnotations)):[],r=e.type!=="deleted"?this.getAnnotationNames(Ci(this.additionAnnotations)):[];if(s.length===0&&r.length===0)return;const o=-1,l=-1,{createAnnotationElement:a}=this;if(t==="unified"){At({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:o,lineIndex:l,annotations:s.concat(r)},createAnnotationElement:a,context:n});return}At({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:o,lineIndex:l,annotations:s},additionSpan:{type:"annotation",hunkIndex:o,lineIndex:l,annotations:r},createAnnotationElement:a,context:n})}getAnnotations(e,t,i,n,s){const r={type:"annotation",hunkIndex:n,lineIndex:s,annotations:[]};if(t!=null)for(const l of this.deletionAnnotations[t]??[])r.annotations.push(this.annotationSlotName(l));const o={type:"annotation",hunkIndex:n,lineIndex:s,annotations:[]};if(i!=null)for(const l of this.additionAnnotations[i]??[])(e==="unified"?r:o).annotations.push(this.annotationSlotName(l));if(e==="unified")return r.annotations.length>0?r:void 0;if(!(o.annotations.length===0&&r.annotations.length===0))return{deletionSpan:r,additionSpan:o}}getAnnotationNames(e){return e?.map(t=>this.annotationSlotName(t))??[]}renderHeader(e){const{headerRenderMode:t,stickyHeader:i}=this.getOptionsWithDefaults();return ns({fileOrDiff:e,mode:t,stickyHeader:i})}};const hl=new Intl.PluralRules("en-US");function cl(e){return`${e} unmodified line${hl.select(e)==="one"?"":"s"}`}function vn(e,t){for(const i of e)t.unifiedContentAST.push(i.content),t.pushToGutter("unified",i.gutter),t.incrementRowCount(1)}function Sn(e,t,i){for(const{deletion:n,addition:s}of e){if(n==null&&s==null)continue;const r=n!=null&&s!=null?void 0:n==null?"deletions":"additions";(r==null||i.side!==r)&&i.flush(),n!=null&&(t.deletionsContentAST.push(n.content),t.pushToGutter("deletions",n.gutter)),s!=null&&(t.additionsContentAST.push(s.content),t.pushToGutter("additions",s.gutter)),r!=null&&(i.side=r,i.increment()),t.incrementRowCount(1)}}function At({diffStyle:e,type:t,deletionLine:i,additionLine:n,unifiedSpan:s,deletionSpan:r,additionSpan:o,createAnnotationElement:l,context:a}){let h=!1;if(e==="unified"){if(n!=null?a.unifiedContentAST.push(n):i!=null&&a.unifiedContentAST.push(i),s!=null){const d=t==="change"?i!=null?"change-deletion":"change-addition":t;a.unifiedContentAST.push(l(s)),a.pushToGutter("unified",te(d,"annotation",1)),h=!0}}else if(e==="split"){if(i!=null&&a.deletionsContentAST.push(i),n!=null&&a.additionsContentAST.push(n),r!=null){const d=t==="change"?i!=null?"change-deletion":"context":t;a.deletionsContentAST.push(l(r)),a.pushToGutter("deletions",te(d,"annotation",1)),h=!0}if(o!=null){const d=t==="change"?n!=null?"change-addition":"context":t;a.additionsContentAST.push(l(o)),a.pushToGutter("additions",te(d,"annotation",1)),h=!0}}h&&a.incrementRowCount(1)}function di(e,{hunkIndex:t,collapsedLines:i,rangeSize:n,hunkSpecs:s,isFirstHunk:r,isLastHunk:o,isExpandable:l},a){if(typeof i=="number"&&i<=0)return;const h=e==="unified"?a.unifiedContentAST:e==="deletions"?a.deletionsContentAST:a.additionsContentAST;if(a.hunkSeparators==="metadata"){s!=null&&(a.pushToGutter(e,$e({type:"metadata",content:s,isFirstHunk:r,isLastHunk:o})),h.push($e({type:"metadata",content:s,isFirstHunk:r,isLastHunk:o})),e!=="additions"&&a.incrementRowCount(1));return}if(a.hunkSeparators==="simple"){t>0&&(a.pushToGutter(e,$e({type:"simple",isFirstHunk:r,isLastHunk:!1})),h.push($e({type:"simple",isFirstHunk:r,isLastHunk:!1})),e!=="additions"&&a.incrementRowCount(1));return}const d=ya(e,t),c=n>a.expansionLineCount,u=l?t:void 0,f=typeof i=="number"?cl(i):"More unchanged context may be available";a.pushToGutter(e,$e({type:a.hunkSeparators,content:f,expandIndex:u,chunked:c,slotName:d,isFirstHunk:r,isLastHunk:o})),h.push($e({type:a.hunkSeparators,content:f,expandIndex:u,chunked:c,slotName:d,isFirstHunk:r,isLastHunk:o})),e!=="additions"&&a.incrementRowCount(1),a.hunkData.push({slotName:d,hunkIndex:t,lines:typeof i=="number"?i:0,lineCountKnown:typeof i=="number",type:e,expandable:l?{up:!r,down:!o,chunked:c}:void 0})}function Ht(e,t,i){return e==null||e.type!=="element"||t==null&&i==null?e:{...e,properties:{...e.properties,...t,...i}}}function yn(e){return e.length>0&&e[e.length-1]===""?e.length-1:e.length}function ul(e,t,i,n){const s=yn(e),r=yn(t),o=Math.min(s,r);let l=0;for(;lt}function gl(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function ml(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function vl(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}async function Ti(e,t=300){let i;try{await Promise.race([e(),new Promise(n=>{i=setTimeout(n,t)})])}finally{i!=null&&clearTimeout(i)}}function Ai({oldFile:e,newFile:t},i){if(!(e===void 0&&t===void 0)){if(e===void 0||t===void 0)throw new Error(`${i}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw new Error(`${i}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return t===null?{oldFile:e,newFile:t}:{oldFile:e,newFile:t}}}function Sl(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:As(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,parseDiffOptions:e?.parseDiffOptions,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function ci(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}function yl(e){const t={...e};return delete t.cacheKey,t}function bn(e,t){if(e.isPartial||t.isPartial)throw new Error("FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated");const i=e.lang??$(e.name),n=t.lang??$(t.name),s=e.type!=="new",r=t.type!=="new";return e.name!==t.name||i!==n||s!==r||e.deletionLines.length!==t.deletionLines.length?!0:e.deletionLines.some((o,l)=>o!==t.deletionLines[l])}function bl(e,t){return e.length===t.length&&e.every((i,n)=>i===t[n])}function Cl(e,t){const{oldFile:i}=e;return i==null?t.type==="new":t.type!=="new"&&i.name===(t.prevName??t.name)&&bl(i.lines,t.deletionLines)}let kl=-1;var Ll=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++kl}`;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:U},t,i=!1){this.options=e,this.workerManager=t,this.isContainerManaged=i,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new es,this.scrollSyncManager=new Sa,this.interactionManager=new Zn("diff",Wt(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??U}getHunksRendererOptions(e){return Sl(e)}createHunksRenderer(e){return new dl(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,i){if(e==null)return;const n=e.hunks.at(-1);let s,r;e:for(const o of e.hunks){const l=i==="deletions"?o.deletionStart:o.additionStart,a=i==="deletions"?o.deletionCount:o.additionCount;let h=re(l,a)+1,d=o.splitLineStart,c=o.unifiedLineStart;if(t=h+a){if(o===n){const u=t-(h+a);s=c+o.unifiedLineCount+u,r=d+o.splitLineCount+u;break e}continue}for(const u of o.hunkContent)if(u.type==="context")if(tthis.interactionManager.getHoveredLine();getAnnotationSlotName=e=>Ts(this.editSession?.annotations,e,pe);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,Rs(t,e,pe))}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,i){return!(e||t||i||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;ct(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:i=!1,lineAnnotations:n,fileDiff:s,...r}){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 o=Ai(r,"FileDiff.hydrate"),l=o?.oldFile,a=o?.newFile;this.hydrateElements(e,t);const h=this.editor!=null;h||Rl(this.pre,xl({fileDiff:s,oldFile:l,newFile:a}),this.options.collapsed)||Tl(this.headerElement,El({fileDiff:s,oldFile:l,newFile:a}),this.options.disableFileHeader)?this.render({...r,fileContainer:e,lineAnnotations:n,fileDiff:s,forceRender:h||r.forceRender,preventEmit:!0}):this.hydrationSetup({fileDiff:s,lineAnnotations:n,...o}),i||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),ws(e,t);for(const i of e.shadowRoot?.children??[]){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i;for(const n of i.children)!(n instanceof HTMLElement)||n.tagName.toLowerCase()!=="code"||("deletions"in n.dataset&&(this.codeDeletions=n),"additions"in n.dataset&&(this.codeAdditions=n),"unified"in n.dataset&&(this.codeUnified=n));continue}if("diffsHeader"in i.dataset){this.headerElement=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-theme-css")){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.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:i,lineAnnotations:n}){this.lineAnnotations=n??this.lineAnnotations,this.additionFile=i,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&i!==void 0?Ue(t,i,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,i)=>{this.expandHunk(e,t,i)};expandHunk=(e,t,i)=>{this.loadFilesIfNecessary(),this.hunksRenderer.expandHunk(e,t,i),this.rerender()};loadFilesIfNecessary(){const{fileDiff:e,options:{loadDiffFiles:t}}=this;if(e==null||!ci(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 i=this.loadFilesForDiff(e,t),n=this.pendingFiles={fileDiff:e,promise:i},s=()=>{this.pendingFiles===n&&(this.pendingFiles=void 0)};n.promise=i.finally(s)}__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&&!ci(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&&!ci(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 i=await t(e);if(this.fileDiff!==e)return;await this.handleFilesLoaded(e,i)}catch(i){if(this.options.disableErrorHandling===!0)throw i;console.error(i)}}async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(Li("merge",e,t),this.setHydratedState(t),this.installHydratedSessionDiff(e)){this.rerender();return}await Ti(()=>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(B(this.fileDiff,e))return!1;const i=this.editSession?.outgoingDiff??this.editSession?.diff;return this.fileDiff=e,i!=null&&(e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e),this.editSession!=null&&(this.editSession.outgoingDiff=i)),this.editSession?.annotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSession.annotations=$t(t,pe,this.editSession.annotations)),!0}installEditSession(e,t,i){const n=e.additionLines.join(""),s=t!=null?Kt(t.contents):void 0,r=i!=null&&Cl(i,e);if(i!=null&&!r)throw new Error("FileDiff: retained session cannot resume against a different old file");if(t!=null&&t.contents!==n&&!r)throw new Error("FileDiff: retained edits are missing their diff session state");const o=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===n,l=yl(e);t!=null&&s!=null&&!o&&(l.name=t.name,l.lang=t.lang),r&&i!=null&&s!=null&&(l.additionLines=s,l.type=i.type,l.hunks=i.hunks,l.editSessionDirty=!0,ei(l)),this.editSession={diff:l,annotations:this.editSession?.annotations??$t(this.lineAnnotations,pe),outgoingDiff:this.editSession?.outgoingDiff},this.hunksRenderer.beginEditSession(l,o&&!r?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:i=!1,preventEmit:n=!1,lineAnnotations:s,fileContainer:r,containerWrapper:o,renderRange:l,...a}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");const h=Ai(a,"FileDiff.render"),d=h?.oldFile,c=h?.newFile;this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:u=!1,themeType:f="system",expandUnchanged:g=!1}=this.options,p=u?void 0:l,m=this.hasThemeChanged(),y=h!=null,v=y&&(!Cn(d,this.deletionFile)||!Cn(c,this.additionFile));let k=e!=null&&!B(e,this.fileDiff);const x=s!=null&&(s.length>0||this.getLatestAnnotations().length>0)?this.isNewAnnotations(s):!1;if(!u&&Jt(p,this.renderRange)&&!i&&!x&&!m&&(e!=null&&!k||e==null&&!v)){const E=this.applyCachedThemeState(f);return E&&this.finalizeRender(),E}let b;e==null&&y&&(v||this.fileDiff==null)&&(b=Ue(h.oldFile,h.newFile,this.options.parseDiffOptions));const{renderRange:C}=this;this.renderRange=p,y?(this.deletionFile=d,this.additionFile=c):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e!=null&&k?this.updateExternalDiff(e,s):b!=null&&(k=!0,this.updateExternalDiff(b,s)),k&&this.clearReusableHeader(),s!=null&&this.setLineAnnotations(s);const S=this.getLatestDiff();if(S==null)return!1;S.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(fn(S,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),g&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.getLatestAnnotations());const{disableErrorHandling:L=!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()),r=this.getOrCreateFileContainer(r,o),this.applyCachedThemeState(f),u){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const E=this.hunksRenderer.renderDiff(S,$n);E!=null&&this.applyThemeState(r,E.themeStyles,f,E.baseThemeType),E?.headerElement!=null&&this.applyHeaderToDOM(E.headerElement,r,E.fileDiff),this.renderSeparators([]),this.renderedDiff=E?.fileDiff??S,this.injectUnsafeCSS()}catch(E){if(L)throw E;console.error(E),E instanceof Error&&this.applyErrorToDOM(E,r)}return this.finalizeRender(),n||this.emitPostRender(),!0}try{const E=this.getOrCreatePreNode(r);if(!(this.canPartiallyRender(i,x,v||k||m||!B(this.renderedDiff,S))&&this.applyPartialRender({fileDiff:S,previousRenderRange:C,renderRange:p}))){const H=this.hunksRenderer.renderDiff(S,p);if(H==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(r,H.themeStyles,f,H.baseThemeType),H.headerElement!=null&&this.applyHeaderToDOM(H.headerElement,r,H.fileDiff),H.additionsContentAST!=null||H.deletionsContentAST!=null||H.unifiedContentAST!=null?this.applyHunksToDOM(E,H):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(H.hunkData),this.renderedDiff=H.fileDiff}this.applyBuffers(E,p),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(E){if(L)throw E;console.error(E),E instanceof Error&&this.applyErrorToDOM(E,r)}return n||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:i}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,"unmount");return}if(t==null)return;const n=this.mounted?"update":"mount";this.mounted=!0,i?.(t,this,n)}getLatestDiff(e=this.fileDiff){return this.editSession?.diff??e}getRenderedDiff(){return this.renderedDiff}syncRenderViewToEditor(){const{editor:e,fileContainer:t}=this,i=this.getLatestAnnotations(),n=this.computeEditorRenderRange(this.renderRange),s=this.getLatestDiff();if(e==null||t==null||s==null||s.isPartial)return;const r=h=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.getLatestDiff()!==s)return;const d=this.editSession?.outgoingDiff,{fileDiff:c}=this,u=d!=null&&c!=null&&d!==s,f=u&&d!=null&&c!=null?bn(d,c):!1;e.__syncRenderView({highlighter:h,fileContainer:t,fileDiff:s,lineAnnotations:i,renderRange:n,externalDocument:u,resetHistory:f})},o=this.getTheme(),l=s.lang??$(s.name),a=Je({theme:o,lang:l});a!=null?r(a):Me({themes:Ee(o),langs:["text",l],preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter}).then(r)}computeEditorRenderRange(e){const t=this.getLatestDiff();if(e==null||t==null||qt(e))return e;const{diffStyle:i="split",expandUnchanged:n=!1,collapsedContextThreshold:s=1}=this.options;let r,o;return Be({diff:t,diffStyle:i,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({additionLine:l})=>{l!=null&&(r??=l.lineNumber,o=l.lineNumber)}}),r==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:r-1,totalLines:o-r+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:i,outgoingDiff:n}={}}=this;if(n!=null&&t!=null){if(!t.isPartial&&bn(n,t))return;i=n}if(!(i==null||i.isPartial))return{diffSession:{oldFile:i.type!=="new"?{name:i.prevName??i.name,lines:e?[...i.deletionLines]:i.deletionLines}:null,type:i.type,hunks:e?Ds(i.hunks):i.hunks},hasChanges:i.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(i){throw t(),i}}__resumeEditor(e){if(this.editor!==e)throw new Error("FileDiff.__resumeEditor: editor association changed");this.resumeEditorRendering(e)}resumeEditorRendering(e){const{fileDiff:t}=this,i=this.editSession?.outgoingDiff;i!=null&&t!=null&&!t.isPartial&&this.editSession?.diff===i&&this.installEditSession(t);const n=this.editSession==null&&t!=null&&!t.isPartial?t:void 0;n!=null?this.installEditSession(n,e.__getDocumentContents(wl(n)),e.__getDocumentSessionState()):this.editSession!=null&&this.hunksRenderer.beginEditSession(this.editSession.diff),this.editor=e,this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary();const s=this.editSession?.diff;this.hunksRenderer.editorRenderReady()?(s!=null&&this.hunksRenderer.diffCache===s&&(this.renderedDiff=s),this.syncRenderViewToEditor()):this.rerender()}finishEditSession(){this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks()}__completeEditSession(e,t){this.settleEditSession(t==="install",e)}settleEditSession(e,t){const{editSession:i,fileDiff:n,lineAnnotations:s}=this;if(i==null||n==null)return;const{diff:r,annotations:o}=i;if(this.editor!=null)throw new Error("FileDiff.__completeEditSession: detach the editor before completing the session");this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks();const l=o?.current;let a,h=null,d=null,c=!1,u;if(t==null)throw new Error("FileDiff.__completeEditSession: editor is required for completion");const f=Ps(r),g={name:f.name,contents:f.additionLines.join("")};f.lang!=null&&(g.lang=f.lang);const p={fileDiff:f,editor:t,originalFileDiff:n,oldFile:f.type==="new"?null:{name:f.prevName??f.name,contents:f.deletionLines.join("")},newFile:g,lineAnnotations:l,originalLineAnnotations:s};Object.freeze(p);try{if(t.__emitEditComplete(p),this.options.onEditComplete?.(p)==="accept"){if(f.cacheKey!=null&&f.cacheKey===n.cacheKey)throw new Error("FileDiff.__completeEditSession: an accepted diff must not reuse the replaced diff cacheKey");a=f,h=p.oldFile,d=p.newFile}}catch(m){c=!0,u=m}if(e&&a!=null&&(this.fileDiff=a,this.additionFile!=null&&(this.deletionFile=h,this.additionFile=d),l!=null&&(this.lineAnnotations=l)),this.editSession=void 0,e&&this.fileContainer!=null&&this.rerender(),c)throw u}finalizeEditSessionHunks(){const e=this.getLatestDiff();if(e==null||e.editSessionDirty!==!0)return!1;const{collapsedContextThreshold:t=1}=this.options,i=Xa(e,this.hunksRenderer.getExpandedHunksMap(),t);return fn(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(Qa(e,i)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){const i=this.editSession?.diff;if(i==null)throw new Error("FileDiff.applyDocumentChange: requires an active edit session");this.detachAdditionLines(),this.hunksRenderer.beginEditSession(i),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,i={}){const n=this.editSession?.diff;if(n==null)throw new Error("FileDiff.updateRenderCache: requires an active edit session");this.detachAdditionLines(),this.hunksRenderer.beginEditSession(n);const{shouldRefreshDiffsView:s,lineCountChangeInFlight:r}=i;if(this.hunksRenderer.updateRenderCache(e,t,r,i.changedDocumentLines,i.documentLineCount)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}s===!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:i=!1,collapsedContextThreshold:n=1}=this.options;return Ws({fileDiff:t,lineNumber:e,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n})}getNearestRenderableLine(e,t){const i=this.getRenderedDiff();if(i==null)return e;const{expandUnchanged:n=!1,collapsedContextThreshold:s=1}=this.options;return ka({fileDiff:i,lineNumber:e,direction:t,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s})}revealLine(e){const t=this.getRenderedDiff(),{expandUnchanged:i=!1,collapsedContextThreshold:n=1,expansionLineCount:s=100}=this.options;if(t==null||t.isPartial||i)return!1;const r=this.hunksRenderer.getExpandedHunksMap();for(const[h,d]of t.hunks.entries()){const[c,u]=gt(d);if(e=c-f.fromEnd)return!1;const p=e-(g+f.fromStart)+1,m=c-f.fromEnd-e;return p<=m?this.expandHunk(h,"up",p+s):this.expandHunk(h,"down",m+s),!0}if(e=a+o.rangeSize?!1:(this.expandHunk(t.hunks.length,"up",e-(a+o.fromStart)+1+s),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){Oi(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||Ne(e))return;const i=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>i||await t.primeDiffHighlightCache(e).catch(n=>{Bi(n)||console.error(n)})}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:n}of this.separatorCache.values())n.remove();this.separatorCache.clear();return}const i=new Map(this.separatorCache);for(const n of e){const s=n.slotName;let r=this.separatorCache.get(s);if(r==null||!vl(n,r.hunkData)){r?.element.remove();const o=document.createElement("div");o.style.display="contents",o.slot=n.slotName;const l=t(n,this);l!=null&&o.appendChild(l),this.fileContainer.appendChild(o),r={element:o,hunkData:n},this.separatorCache.set(s,r)}i.delete(s)}for(const[n,{element:s}]of i.entries())this.separatorCache.delete(n),s.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options,i=this.getLatestAnnotations();if(t!=null&&i.length>0)for(const[n,s]of i.entries()){const r=this.getAnnotationSlotName(s),o=`${n}-${r}`;let l=this.annotationCache.get(o);if(l==null||!ml(s,l.annotation)){l?.element.remove();const a=t(s);if(a==null)continue;l={element:ms(r),annotation:s},l.element.appendChild(a),this.fileContainer.appendChild(l.element),this.annotationCache.set(o,l)}e.delete(o)}for(const[n,{element:s}]of e.entries())this.annotationCache.delete(n),s.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 i=vs();i.appendChild(t),this.fileContainer.appendChild(i),this.gutterUtilityContent=i}getOrCreateFileContainer(e,t){const{fileContainer:i}=this,n=e??i??document.createElement("diffs-container"),s=i!==n;return i!=null&&s&&this.editor?.__captureFocusForDOMReplacement(),s&&this.emitPostRender(!0),this.fileContainer=n,i!=null&&s&&(this.headerCache.lastRenderedHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),s&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const i of t.children)i instanceof SVGElement?this.spriteSVG??=i:ft(i)&&i.hasAttribute("data-theme-css")?(this.themeCSSStyle??=i,this.hasAdoptedThemeCSS=!0):ft(i)&&i.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=i,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const i=document.createElement("div");i.innerHTML=ps;const n=i.firstChild;n instanceof SVGElement&&(this.spriteSVG=n)}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,i){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const{headerCache:{fileDiff:n,html:s,lastRenderedHTML:r}}=this,o=(i!==this.editSession?.diff&&B(n,i)?s:void 0)??X(e);if(this.headerCache.html=o,this.headerCache.fileDiff=i,o!==r){const g=document.createElement("div");g.innerHTML=o;const p=g.firstElementChild;if(!(p instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(p,this.headerElement):t.shadowRoot?.prepend(p),this.headerElement=p,this.headerCache.lastRenderedHTML=o}if(this.isContainerManaged)return;const{renderCustomHeader:l,renderHeaderPrefix:a,renderHeaderFilenameSuffix:h,renderHeaderMetadata:d}=this.options;if(l!=null){const g=l(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Pi,g),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?.(i)??void 0,u=h?.(i)??void 0,f=d?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Ii,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Mi,u),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Di,f),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,i,n){if(n==null){t?.remove();return}const s=t??this.createHeaderSlotElement(i);return t==null&&e.appendChild(s),this.replaceHeaderSlotContent(s,n),s}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??=Ss(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Cs(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,i,n){const s=e.shadowRoot??e.attachShadow({mode:"open"}),r=n??i,o=this.getTheme(),l=typeof o=="string"?o:{...o},a=ut(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===r&&this.appliedThemeCSS.scrollbarGutter===a){this.appliedThemeCSS.theme=l;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:l,themeStyles:t,themeType:r,baseThemeType:n,scrollbarGutter:a};return}this.themeCSSStyle=Hs({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:ks(t,r,a)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:l,themeStyles:t,themeType:r,baseThemeType:n,scrollbarGutter:a}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=Ls(this.themeCSSStyle.textContent??"",ut(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Es()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?ki(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,i){const n=this.getColumnPair(e);if(n==null)return!1;const s=He(t[0]),r=He(t[1]);return s==null||r==null?!1:(n.gutter.innerHTML=X(s),n.content.innerHTML=X(r),i!==this.lastRowCount&&(n.gutter.style.setProperty("grid-row",`span ${i}`),n.content.style.setProperty("grid-row",`span ${i}`)),!0)}replaceCodeColumns(e,t){const{overflow:i="scroll"}=this.options,n=(this.options.hunkSeparators??"line-info")==="line-info",s=i==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let r=!1;const o=[],l=this.hunksRenderer.renderCodeAST("unified",t),a=this.hunksRenderer.renderCodeAST("deletions",t),h=this.hunksRenderer.renderCodeAST("additions",t);this.editor?.__captureFocusForDOMReplacement(),l!=null?(r=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=Ft({code:this.codeUnified,columnType:"unified",rowSpan:s,containerSize:n}),this.applyCodeColumnsInPlace(this.codeUnified,l,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeUnified)):a!=null||h!=null?(a!=null?(r=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Ft({code:this.codeDeletions,columnType:"deletions",rowSpan:s,containerSize:n}),this.applyCodeColumnsInPlace(this.codeDeletions,a,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(a)),o.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),h!=null?(r=r||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Ft({code:this.codeAdditions,columnType:"additions",rowSpan:s,containerSize:n}),this.applyCodeColumnsInPlace(this.codeAdditions,h,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(h)),o.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),o.length===0?e.textContent="":r&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({fileDiff:e,previousRenderRange:t,renderRange:i}){const{pre:n,codeUnified:s,codeAdditions:r,codeDeletions:o,options:{diffStyle:l="split"}}=this;if(n==null||t==null||i==null||!Number.isFinite(t.totalLines)||!Number.isFinite(i.totalLines)||this.lastRowCount==null)return!1;const a=this.getCodeColumns(l,s,o,r);if(a==null)return!1;const h=t.startingLine,d=i.startingLine,c=h+t.totalLines,u=d+i.totalLines,f=Math.max(h,d),g=Math.min(c,u);if(g<=f)return!1;const p=Math.max(0,f-h),m=Math.max(0,c-g),y=this.trimColumns({columns:a,trimStart:p,trimEnd:m,previousStart:h,overlapStart:f,overlapEnd:g,diffStyle:l});if(y<0)throw new Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount{if(!(L<=0))return this.hunksRenderer.renderDiff(e,{startingLine:S,totalLines:L,bufferBefore:0,bufferAfter:0})},x=k(d,Math.max(f-d,0));if(x==null&&dg)return!1;const C=(S,L)=>{if(S!=null){if(l==="unified"&&!Array.isArray(a))this.insertPartialHTML(l,a,S,L);else if(l==="split"&&Array.isArray(a))this.insertPartialHTML(l,a,S,L);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");v+=S.rowCount,this.renderedDiff=S.fileDiff}};return this.cleanupErrorWrapper(),C(x,"afterbegin"),C(b,"beforeend"),this.lastRowCount!==v&&(this.applyRowSpan(l,a,v),this.lastRowCount=v),!0}insertPartialHTML(e,t,i,n){if(e==="unified"&&!Array.isArray(t)){const s=this.hunksRenderer.renderCodeAST("unified",i);this.renderPartialColumn(t,s,n)}else if(e==="split"&&Array.isArray(t)){const s=this.hunksRenderer.renderCodeAST("deletions",i),r=this.hunksRenderer.renderCodeAST("additions",i);this.renderPartialColumn(t[0],s,n),this.renderPartialColumn(t[1],r,n)}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 i=this.getCodeColumns("split",this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(i))return;const n=(s,r)=>{if(r==null)return;const o=this.hunksRenderer.renderCodeAST(s,t),l=He(o?.[0]),a=He(o?.[1]);for(const[h,d]of[[r.gutter,l],[r.content,a]])if(d!=null&&h.childElementCount===d.length)for(let c=0;c{for(const[l,a]of[[i.gutter,s],[i.content,r]])a!=null&&(l.innerHTML=X(a));t.rowCount!==this.lastRowCount&&(this.applyRowSpan("unified",i,t.rowCount),this.lastRowCount=t.rowCount),this.renderedDiff=t.fileDiff};this.shouldGuardRebuildScroll()?ki(this.pre,o):o(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,i){if(e==null||t==null)return;const n=He(t[0]),s=He(t[1]);if(n==null||s==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const r=s.at(0);i==="beforeend"&&r?.type==="element"&&typeof r.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(r.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],n,s,!0);const o=s.at(-1);i==="afterbegin"&&o?.type==="element"&&typeof o.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],n,s,!1),e.gutter.insertAdjacentHTML(i,this.hunksRenderer.renderPartialHTML(n)),e.content.insertAdjacentHTML(i,this.hunksRenderer.renderPartialHTML(s))}mergeBuffersIfNecessary(e,t,i,n,s,r){if(!(t instanceof HTMLElement)||!(i instanceof HTMLElement))return;const o=this.getBufferSize(t.dataset);o!=null&&(r?(n.shift(),s.shift()):(n.pop(),s.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(i,o+e))}applyRowSpan(e,t,i){const n=s=>{s!=null&&(s.gutter.style.setProperty("grid-row",`span ${i}`),s.content.style.setProperty("grid-row",`span ${i}`))};if(e==="unified"&&!Array.isArray(t))n(t);else if(e==="split"&&Array.isArray(t))n(t[0]),n(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,i){let n=0,s=0,r=0,o=!1;const l=i>=0;if(e==null)return 0;const a=Array.from(e.content.children),h=Array.from(e.gutter.children);if(a.length!==h.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;r0||l&&n>=i)&&(d.remove(),c.remove(),t>0&&(t--,t===0&&(o=!0)),s++),n++;continue}if("separator"in d.dataset&&"separator"in c.dataset){(t>0||l&&n>=i)&&(d.remove(),c.remove(),s++);continue}if(d.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in c.dataset){(t>0||l&&n>=i)&&(d.remove(),c.remove(),s++);continue}if(d.dataset.gutterBuffer==="metadata"&&"noNewline"in c.dataset){(t>0||l&&n>=i)&&(d.remove(),c.remove(),s++);continue}if(d.dataset.gutterBuffer==="buffer"&&"contentBuffer"in c.dataset){const u=this.getBufferSize(c.dataset);if(u==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){const f=Math.min(t,u),g=u-f;g>0?(this.updateBufferSize(d,g),this.updateBufferSize(c,g),s+=f):(d.remove(),c.remove(),s+=u),t-=f,t===0&&g===0&&(o=!0)}else if(l){const f=n,g=n+u-1;if(i<=f)d.remove(),c.remove(),s+=u;else if(i<=g){const p=g-i+1,m=u-p;this.updateBufferSize(d,m),this.updateBufferSize(c,m),s+=p}}n+=u;continue}throw console.error({gutterElement:d,contentElement:c}),new Error("FileDiff.trimColumnRows: unknown row elements")}return s}trimColumns({columns:e,diffStyle:t,overlapEnd:i,overlapStart:n,previousStart:s,trimEnd:r,trimStart:o}){const l=Math.max(0,n-s),a=i-s;if(a<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const h=o>0,d=r>0;if(!h&&!d)return 0;const c=h?l:0,u=d?a:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,c,u);if(t==="split"&&Array.isArray(e)){const f=this.trimColumnRows(e[0],c,u),g=this.trimColumnRows(e[1],c,u);if(e[0]!=null&&e[1]!=null&&f!==g)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?f:g}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],i=e.children[1];if(!(!(t instanceof HTMLElement)||!(i instanceof HTMLElement)||t.dataset.gutter==null||i.dataset.content==null))return{gutter:t,content:i}}getCodeColumns(e,t,i,n){if(e==="unified")return this.getColumnPair(t);{const s=this.getColumnPair(i),r=this.getColumnPair(n);return s!=null||r!=null?[s,r]: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:i,totalLines:n},s){const{diffIndicators:r="bars",disableBackground:o=!1,disableLineNumbers:l=!1,overflow:a="scroll",diffStyle:h="split"}=this.options,d={type:"diff",diffIndicators:r,disableBackground:o,disableLineNumbers:l,overflow:a,split:h==="unified"?!1:t!=null&&i!=null,totalLines:n,customProperties:s};gs(d,this.appliedPreAttributes)||(xs(e,d),this.appliedPreAttributes=d)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const i=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",i.appendChild(this.errorWrapper);const n=document.createElement("div");n.dataset.errorMessage="",n.innerText=e.message,this.errorWrapper.appendChild(n);const s=document.createElement("pre");s.dataset.errorStack="",s.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(s)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function wl(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join("")}}function Cn(e,t){return e==null||t==null?e==null&&t==null:_i(e,t)}function xl({fileDiff:e,oldFile:t,newFile:i}){return e!=null&&e.hunks.length>0||t!=null||i!=null}function El({fileDiff:e,oldFile:t,newFile:i}){return e!=null||t!=null||i!=null}function Rl(e,t,i=!1){return!i&&e==null&&t}function Tl(e,t,i=!1){return e==null&&t&&!i}function He(e){if(!(e==null||e.type!=="element"))return e.children??[]}function Al({fileDiff:e,metrics:t,disableFileHeader:i,hunkSeparators:n,expandUnchanged:s,expandedHunks:r,collapsedContextThreshold:o,canHydratePartialDiff:l}){let a=xe(t,i),h=a;const d=s?!0:r,c=e.hunks.length-1;for(let u=0;u0){const v=dt({type:n,metrics:t,hunkIndex:u,hunkSpecs:f.hunkSpecs})?.totalHeight??0;a+=v,h+=v}a+=f.splitLineCount*t.lineHeight,h+=f.unifiedLineCount*t.lineHeight;const m=Hl(f);a+=m.split*t.lineHeight,h+=m.unified*t.lineHeight;const y=u===c?Te({fileDiff:e,hunkIndex:u,expandedHunks:d,collapsedContextThreshold:o,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(y!=null){const v=(y.fromStart+y.fromEnd)*t.lineHeight;if(a+=v,h+=v,y.collapsedLines>0){const k=ze({type:n,metrics:t})?.totalHeight??0;a+=k,h+=k}}else if(u===c&&e.isPartial&&l){const v=ze({type:n,metrics:t})?.totalHeight??0;a+=v,h+=v}}if(e.hunks.length>0){const u=Gt(t);a+=u,h+=u}return{splitHeight:a,unifiedHeight:h}}function Hl(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 i=t.lines>0?1:0;return{split:i,unified:i}}return Il(e,t)}function Il(e,t){const i=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),n=t.deletions>0&&e.noEOFCRDeletions,s=t.additions>0&&e.noEOFCRAdditions;return{split:n||s?1:0,unified:i}}const Hi=3e3,It=new Map;let Ml=-1;var Dl=class extends Ll{__id=`little-virtualized-file-diff:${++Ml}`;renderType="virtualized";top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:It,ghostTextRowsByIndex:new Map};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;pendingHydratedDiff;pendingExpansions;pendingRender;constructor(e,t,i,n,s=!1){super(e,n,s),this.virtualizer=t,this.metrics=zt(i)}setMetrics(e,t=!1){const i=zt(e);!t&&Ze(this.metrics,i)||(this.metrics=i,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 cs(t)?t.some(i=>i.lineNumber!==0?!1:e.type==="new"?i.side==="additions":e.type==="deleted"?i.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,i=!zi(t,e),n=i&&Bl(t,e);super.setOptions(e),n&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:_l(t,e)}),i&&(this.forceRenderOverride=!0),i&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,n)}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:i=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal=0,this.cache.ghostTextRows=It,this.cache.ghostTextRowsByIndex.size>0&&this.cache.ghostTextRowsByIndex.clear(),this.invalidateDerivedLayoutCache(t,i),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:i,ghostTextRows:n,ghostTextRowsByIndex:s},metrics:{lineHeight:r}}=this;if(n===t)return!1;const o=this.getDiffStyle(),l=new Map;for(const[h,d]of t){const c=this.getLineIndexForDiff(e,h+1,"additions");c!=null&&l.set(o==="split"?c[1]:c[0],d)}let a=!1;for(const h of new Set([...s.keys(),...l.keys()])){const d=((l.get(h)??0)-(s.get(h)??0))*r;if(d===0)continue;const c=(i.get(h)??0)+d;c===0?i.delete(h):i.set(h,c),this.cache.measuredHeightDeltaTotal+=d,a=!0}return this.cache.ghostTextRows=t,this.cache.ghostTextRowsByIndex=l,a}reconcileHeights(){let e=!1;const{options:{overflow:t="scroll"},metrics:{lineHeight:i}}=this,n=this.placeHolder!=null?this.getLayoutDiff():this.getRenderedDiff();if(this.fileContainer==null||n==null)return this.height!==0&&(e=!0),this.height=0,e;this.top=this.getVirtualizedTop(),e=this.applyGhostTextRows(n,this.editor?.__getGhostTextRows()??It);const{ghostTextRowsByIndex:s}=this.cache,r=t!=="scroll"||this.getLatestAnnotations().length>0||this.isResizeDebuggingEnabled();if(this.placeHolder!=null||!r&&this.cache.heightDeltas.size===0&&this.cache.fileAnnotationHeight===0)return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;const o=this.getDiffStyle(),l=o==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];if(this.renderRange!=null&&Zt(this.renderRange)){const a=Pl(l)??0;this.setFileAnnotationHeight(a)&&(e=!0)}for(const a of l){if(a==null)continue;const h=a.children[1];if(!(h instanceof HTMLElement))continue;const d=o==="split"&&a===this.codeDeletions;for(const c of h.children){if(!(c instanceof HTMLElement))continue;const u=c.dataset.lineIndex;if(u==null)continue;const f=Vl(u,o),g=s.get(f)??0;if(d&&g>0)continue;const p=this.cache.heightDeltas.get(f)??0;if(!r&&p===g*i)continue;let m=c.getBoundingClientRect().height+g*i,y=!1;c.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in c.nextElementSibling.dataset||"noNewline"in c.nextElementSibling.dataset)&&("noNewline"in c.nextElementSibling.dataset&&(y=!0),m+=c.nextElementSibling.getBoundingClientRect().height);const v=this.getEstimatedLineHeight(y),k=m-v;k!==p&&(e=!0,this.cache.measuredHeightDeltaTotal+=k-p,k===0?this.cache.heightDeltas.delete(f):this.cache.heightDeltas.set(f,k))}}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,i,n){let s=!1,r=!1;const{pendingExpansions:o,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,s=!0,r=!0)),o!=null){this.pendingExpansions=void 0;for(const{hunkIndex:g,direction:p,expansionLineCountOverride:m}of o)this.hunksRenderer.expandHunk(g,p,m),this.forceRenderOverride=!0,r=!0}const h=this.updateExternalDiff(e,n),{pendingRenderDiff:d,layoutDiffChanged:c,renderedDiffChanged:u,annotationsChanged:f}=this.updatePendingRender(e,n);return!this.forceRenderOverride&&(h||u||f)&&(this.forceRenderOverride=!0),(i?.resetDiffLayoutCache===!0||c)&&(s=!0),(c||i?.resetDiffLayoutCache===!0&&i.includeEstimatedDiffHeights)&&(r=!0),i?.metrics!=null&&(this.metrics=zt(i.metrics),s=!0,r=!0),this.currentCollapsed!==a&&(this.currentCollapsed=a,s=!0),s?this.resetLayoutCache({includeEstimatedHeights:r}):r&&this.invalidateDerivedLayoutCache(!0),this.top=t,this.computeApproximateSize(!1,d),this.height}getLinePosition(e,t="additions"){const i=this.getLayoutDiff();if(i==null||e<1)return;const n=this.getLineIndexForDiff(i,e,t);if(n==null)return;const{disableFileHeader:s=!1,expandUnchanged:r=!1,collapsed:o=!1,collapsedContextThreshold:l=1}=this.options,a=this.getDiffStyle(),h=this.getHunkSeparatorType(),d=a==="split"?n[1]:n[0];this.approximateLayoutCheckpoints(i);const c=xe(this.metrics,s),u=this.getLayoutCheckpointBeforeLineIndex(d);let f=u?.top??c+this.cache.fileAnnotationHeight;if(o)return{top:pt(this.metrics,s),height:0};let g;return Be({diff:i,diffStyle:a,startingLine:u?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:l,callback:({hunkIndex:p,hunk:m,collapsedBefore:y,collapsedAfter:v,deletionLine:k,additionLine:x})=>{const b=a==="split"?x?.splitLineIndex??k?.splitLineIndex:x?.unifiedLineIndex??k?.unifiedLineIndex;if(b==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(y>0){const S=dt({type:h,metrics:this.metrics,hunkIndex:p,hunkSpecs:m?.hunkSpecs});if(S!=null){if(f+=S.gapBefore,d>=b-y&&d0){const S=ze({type:h,metrics:this.metrics});if(S!=null){if(d>b&&d<=b+v)return g={top:f+S.gapBefore,height:S.height},!0;f+=S.totalHeight}}return!1}}),g}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){const t=this.getLayoutDiff();if(t==null)return;const{disableFileHeader:i=!1,expandUnchanged:n=!1,collapsed:s=!1,collapsedContextThreshold:r=1}=this.options;if(s)return;const o=this.getDiffStyle(),l=this.getHunkSeparatorType();this.approximateLayoutCheckpoints(t);const a=this.getLayoutCheckpointBeforeTop(e);let h=a?.top??xe(this.metrics,i)+this.cache.fileAnnotationHeight,d;return Be({diff:t,diffStyle:o,startingLine:a?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,callback:({hunkIndex:c,hunk:u,collapsedBefore:f,collapsedAfter:g,deletionLine:p,additionLine:m})=>{const y=o==="split"?m?.splitLineIndex??p?.splitLineIndex:m?.unifiedLineIndex??p?.unifiedLineIndex;if(y==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(f>0){const k=dt({type:l,metrics:this.metrics,hunkIndex:c,hunkSpecs:u?.hunkSpecs});k!=null&&(h+=k.totalHeight)}if(h>=e&&(p!=null?d={lineNumber:p.lineNumber,side:"deletions",top:h}:m!=null&&(d={lineNumber:m.lineNumber,side:"additions",top:h}),d!=null))return!0;const v=this.getLineHeight(y,(m?.noEOFCR??!1)||(p?.noEOFCR??!1));if(h+=v,g>0){const k=ze({type:l,metrics:this.metrics});k!=null&&(h+=k.totalHeight)}return!1}}),d}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 i=e!=null?this.computeRenderRangeFromWindow(t,this.top,e):this.renderRange;if(i==null)return;const{bufferBefore:n,bufferAfter:s,totalLines:r}=i;let o=0;if(r===0){const l=e??this.virtualizer.getWindowSpecs();this.top0;t&&(this.layoutDirty=!0);const i=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!B(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),i&&this.virtualizer.instanceChanged(this,!0)}expandHunk=(e,t,i)=>{this.fileDiff!=null&&(this.loadFilesIfNecessary(),this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:i})):(this.hunksRenderer.expandHunk(e,t,i),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 i=Li("clone",e,t);if(await Ti(()=>this.primeHighlightCache(i)),this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:i,files:t}}else{if(Li("merge",e,t),this.setHydratedState(t),!this.installHydratedSessionDiff(e)&&(await Ti(()=>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,i=this.getRenderedDiff();if(t==null||t.length===0||i==null)return!1;const{expansionLineCount:n=100,collapsedContextThreshold:s=1}=this.options,r=new Map(this.hunksRenderer.getExpandedHunksMap());for(const o of t){const l={...r.get(o.hunkIndex)??{fromStart:0,fromEnd:0}},a=o.expansionLineCountOverride??n;(o.direction==="up"||o.direction==="both")&&(l.fromStart+=a),(o.direction==="down"||o.direction==="both")&&(l.fromEnd+=a),r.set(o.hunkIndex,l)}return Ws({fileDiff:i,lineNumber:e,expandedHunks:r,collapsedContextThreshold:s})}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,!B(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,i=!1){const{renderRange:n}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1});const s=this.getRenderedDiff();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(i&&n!=null&&s!=null){const r=this.virtualizer.getWindowSpecs(),o=this.computeRenderRangeFromWindow(s,this.top??0,r);o.bufferAfter!==n.bufferAfter&&this.updateBuffers(o)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutDiff()){const i=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!i)return;const n=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()??It);const{disableFileHeader:s=!1,collapsed:r=!1}=this.options;if(r){this.height+=pt(this.metrics,s),this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,i&&!n&&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:i=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:s,unifiedHeight:r}=Al({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:i,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n,canHydratePartialDiff:ui(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=s,this.cache.estimatedUnifiedHeight=r}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:i=!1,lineAnnotations:n,...s}={}){const r=Ai(s,"VirtualizedFileDiff.render"),o=r!=null,l=r?.oldFile,a=r?.newFile,h=o&&(!wn(l,this.deletionFile)||!wn(a,this.additionFile));let d=t??this.fileDiff;t==null&&o&&(h||this.fileDiff==null)&&(d=Ue(r.oldFile,r.newFile,this.options.parseDiffOptions));const{forceRenderOverride:c,isSetup:u}=this;this.forceRenderOverride=void 0;const f=d!=null&&!B(this.fileDiff,d),g=f||h;if(e=this.getOrCreateFileContainer(e),d==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;f&&this.updateExternalDiff(d,n);const{pendingRenderDiff:p,layoutDiffChanged:m,renderedDiffChanged:y,annotationsChanged:v}=this.pendingRender!=null&&this.pendingRender.latestDiff===(this.getLatestDiff(d)??d)?{pendingRenderDiff:this.pendingRender.diff,layoutDiffChanged:!1,renderedDiffChanged:!1,annotationsChanged:this.syncLineAnnotations(n)}:this.updatePendingRender(d,n);if(m&&this.resetLayoutCache({includeEstimatedHeights:!0}),u)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,p));else{this.computeApproximateSize(!1,p);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()&&(!g||!u))return r!=null&&(this.deletionFile=l,this.additionFile=a),f&&this.clearReusableHeader(),this.renderPlaceholder(this.height);const k=this.virtualizer.getWindowSpecs(),x=this.top??0,b=this.computeRenderRangeFromWindow(p,x,k);return super.render({fileDiff:d,fileContainer:e,renderRange:b,lineAnnotations:n,forceRender:(c??i)||v||y||f,...r,...s})}finalizeRender(){if(!B(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 i=this.getLatestDiff(e)??e,n=this.getRenderedDiff(),{pendingRender:s}=this,r=s?.diff??n,o=this.hunksRenderer.getDiffForNextRender(i);return this.pendingRender={latestDiff:i,diff:o},{pendingRenderDiff:o,annotationsChanged:this.syncLineAnnotations(t),layoutDiffChanged:!B(r,o),renderedDiffChanged:!B(n,o)}}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 Ul(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:i=!1,collapsedContextThreshold:n=1}=this.options,s=e.hunks.length-1,r=ui(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),l=this.getHunkSeparatorType(),a=i?!0:this.hunksRenderer.getExpandedHunksMap(),h=Fl(this.cache.heightDeltas);let d=xe(this.metrics,t)+this.cache.fileAnnotationHeight,c=0;const u=({rowCount:f,startLineIndex:g,preSeparatorHeight:p=0,postSeparatorHeight:m=0,metadataOffsets:y=[]})=>{if(f<=0)return;const v=c,k=c+f;let x=Ol(v);for(;x0?p:0)+b*this.metrics.lineHeight+zl(y,b)*this.metrics.lineHeight+kn(h,g,g+b);this.cache.checkpoints.push({renderedLineIndex:x,lineIndex:g+b,top:C}),x+=Hi}d+=p+f*this.metrics.lineHeight+y.length*this.metrics.lineHeight+kn(h,g,g+f)+m,c=k};for(let f=0;f0?dt({type:l,metrics:this.metrics,hunkIndex:f,hunkSpecs:g.hunkSpecs})?.totalHeight??0:0;u({rowCount:p.fromStart,startLineIndex:(o==="split"?g.splitLineStart:g.unifiedLineStart)-p.rangeSize});let y=m;u({rowCount:p.fromEnd,startLineIndex:(o==="split"?g.splitLineStart:g.unifiedLineStart)-p.fromEnd,preSeparatorHeight:y}),p.fromEnd>0&&(y=0);const v=f===s?Te({fileDiff:e,hunkIndex:f,expandedHunks:a,collapsedContextThreshold:n,errorPrefix:"VirtualizedFileDiff"}):void 0,k=v!=null&&v.collapsedLines>0?ze({type:l,metrics:this.metrics})?.totalHeight??0:f===s&&r?ze({type:l,metrics:this.metrics})?.totalHeight??0:0,x=v!=null?v.fromStart+v.fromEnd:0,b=o==="split"?g.splitLineCount:g.unifiedLineCount,C=o==="split"?g.splitLineStart:g.unifiedLineStart;u({rowCount:b,startLineIndex:C,preSeparatorHeight:y,postSeparatorHeight:x===0?k:0,metadataOffsets:Nl({diffStyle:o,hunk:g,rowCount:b})}),v!=null&&x>0&&u({rowCount:x,startLineIndex:C+b,postSeparatorHeight:k})}this.cache.totalLines=c}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,i=this.cache.checkpoints.length-1,n;for(;t<=i;){const s=t+i>>1,r=this.cache.checkpoints[s];if(r==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");r.lineIndex<=e?(n=r,t=s+1):i=s-1}return n}getLayoutCheckpointBeforeTop(e,t){let i=0,n=this.cache.checkpoints.length-1,s=-1;for(;i<=n;){const r=i+n>>1,o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");o.top<=e?(s=r,i=r+1):n=r-1}if(t==null)return s>=0?this.cache.checkpoints[s]:void 0;for(let r=s;r>=0;r--){const o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(o.renderedLineIndex%t===0)return o}}getExpandedLineCount(e,t){let i=0;if(e.isPartial){for(const l of e.hunks)i+=t==="split"?l.splitLineCount:l.unifiedLineCount;return i}const{expandUnchanged:n=!1,collapsedContextThreshold:s=1}=this.options,r=n?!0:this.hunksRenderer.getExpandedHunksMap();for(const[l,a]of e.hunks.entries()){const h=t==="split"?a.splitLineCount:a.unifiedLineCount;i+=h;const d=Math.max(a.collapsedBefore,0),{fromStart:c,fromEnd:u,renderAll:f}=Re({isPartial:e.isPartial,rangeSize:d,expandedHunks:r,hunkIndex:l,collapsedContextThreshold:s});d>0&&(i+=f?d:c+u)}const o=Te({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:s,errorPrefix:"VirtualizedFileDiff"});return o!=null&&(i+=o.fromStart+o.fromEnd),i}getLayoutLineCount(e,t){const i=this.getExpandedLineCount(e,t),n=t==="split"?e.splitLineCount:e.unifiedLineCount;return Math.max(i,n,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:i,bottom:n}){const{disableFileHeader:s=!1,expandUnchanged:r=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:l,lineHeight:a}=this.metrics,h=this.getDiffStyle(),d=this.getHunkSeparatorType(),c=ui(e,this.options.loadDiffFiles!=null),u=this.height;let f=this.getLayoutLineCount(e,h);const g=xe(this.metrics,s),p=e.hunks.length>0?Gt(this.metrics):0,{fileAnnotationHeight:m}=this.cache,y=g+m,v=Math.max(0,u-g-m-p),k=this.hasFileAnnotations(e),x=t+g,b=m>0&&k&&xi;if(tn)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:u-g-p};if(f<=l||e.hunks.length===0)return{startingLine:0,totalLines:l,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),f=this.getLayoutLineCount(e,h);const C=Math.ceil(Math.max(n-i,0)/a),S=Math.ceil(C/l)*l+l,L=S/l,w=L,E=[],H=(i+n)/2,R=this.getLayoutCheckpointBeforeTop(Math.max(0,i-t-S*a*2),l);let T=t+(R?.top??y),D=R?.renderedLineIndex??0,z,A,M;if(Be({diff:e,diffStyle:h,startingLine:R?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:Pe,hunk:j,collapsedBefore:We,collapsedAfter:et,deletionLine:ve,additionLine:Se})=>{const _=Se!=null?Se.splitLineIndex:ve.splitLineIndex,K=Se!=null?Se.unifiedLineIndex:ve.unifiedLineIndex,Z=(Se?.noEOFCR??!1)||(ve?.noEOFCR??!1),Fe=Pe===e.hunks.length-1&&j!=null&&(h==="split"?_===j.splitLineStart+j.splitLineCount-1:K===j.unifiedLineStart+j.unifiedLineCount-1),oe=(We>0?dt({type:d,metrics:this.metrics,hunkIndex:Pe,hunkSpecs:j?.hunkSpecs}):void 0)?.totalHeight??0;T+=oe;const ae=D%l===0,Ae=Math.floor(D/l);if(ae&&(E[Ae]=T-(t+y+oe),M!=null)){if(M<=0)return!0;M--}const Y=this.getLineHeight(h==="split"?_:K,Z);if(T>i-Y&&TH&&(A=Ae),M==null&&T>=n&&ae&&(M=w),D++,T+=Y,et>0||Fe&&c){const mt=ze({type:d,metrics:this.metrics});mt!=null&&(Ti&&(z??=Ae),A==null&&T+mt.totalHeight>H&&(A=Ae),T+=mt.totalHeight)}return!1}}),z==null)if(b)z=0,A=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:u-g-p};A??=z;const F=Math.round(A-L/2),G=Math.max(0,Math.ceil(f/l)-L),P=Math.max(0,Math.min(F,G)),O=P*l,N=F<0?S+F*l:S,V=E[P]??0,J=O===0?0:m+V,ne=P+N/l,se=ner[0]-o[0]),i=[],n=[0];let s=0;for(const[r,o]of t)i.push(r),s+=o,n.push(s);return{lineIndexes:i,prefixTotals:n}}function kn({lineIndexes:e,prefixTotals:t},i,n){if(i>=n||e.length===0)return 0;const s=Ln(e,i);return(t[Ln(e,n)]??0)-(t[s]??0)}function Ln(e,t){let i=0,n=e.length;for(;i>1,r=e[s];if(r==null)throw new Error("VirtualizedFileDiff: invalid prefix index");r0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[i-1]:[];const o=[],l=i-r;return n.deletions>0&&t.noEOFCRDeletions&&o.push(l+n.deletions-1),n.additions>0&&t.noEOFCRAdditions&&o.push(i-1),o}function Bl(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 _l(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 ui(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function Ul(e){return typeof e=="function"?"custom":e??"line-info"}function wn(e,t){return e==null||t==null?e==null&&t==null:_i(e,t)}function Vl(e,t){const[i,n]=e.split(",").map(Number);return t==="split"?n:i}function Wl(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:ql(e.items,t.items)}function ql(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let i=0;i{const{navigator:e}=globalThis,t=e.userAgent,i=/iP(?:hone|ad|od)/.test(t),n=e.platform==="MacIntel"&&e.maxTouchPoints>1;return(i||n)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})();var yd=class Le{static __STOP=!1;static __lastScrollPosition=0;type="advanced";config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollRebaseConfig=Co()?Xl:Yl;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=tt;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement("div");stickyContainer=document.createElement("div");stickyOffset=document.createElement("div");header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;pendingHighlighterTheme;isContainerManaged;constructor(t={theme:U},i,n=!1){this.options=t,this.computeMetricsCache(t.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=i,this.isContainerManaged=n,this.stickyOffset.style.contain="layout size",this.stickyContainer.style.position="sticky",this.stickyContainer.style.width="100%",this.stickyContainer.style.contain="layout style inline-size",this.stickyContainer.style.isolation="isolate",this.stickyContainer.style.display="flex",this.stickyContainer.style.flexDirection="column"}getLayout(){return this.options.layout??Cr}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(t){return this.itemMetricsCache={hunkLineCount:t?.hunkLineCount??tt.hunkLineCount,lineHeight:t?.lineHeight??tt.lineHeight,diffHeaderHeight:t?.diffHeaderHeight??tt.diffHeaderHeight,hunkSeparatorHeight:t?.hunkSeparatorHeight,spacing:t?.spacing??tt.spacing,paddingTop:t?.paddingTop,paddingBottom:t?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??kr}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return hr&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(t){if(!this.shouldValidateItemHeights()||t.element==null)return;const i=t.instance.getAdvancedStickySpecs();if(i==null)return;const n=i.height,s=t.element.getBoundingClientRect().height;n!==s&&console.error("CodeView: reconciled item height does not match DOM height",{id:t.item.id,type:t.type,index:t.index,version:t.version,expectedHeight:n,actualHeight:s,delta:s-n,stickyTopOffset:i.topOffset,virtualizedHeight:t.instance.getVirtualizedHeight(),top:t.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:t.element,instance:t.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;const{firstIndex:t,lastIndex:i,stickyHeight:n,stickyTop:s,stickyBottom:r}=this.renderState;if(t===-1||i===-1)return;const o=this.stickyContainer.getBoundingClientRect().height;Math.abs(o-n){this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&(this.stickyContainer.style.removeProperty("pointer-events"),this.pointerEventsDisabled=!1),this.codeOverflowFix&&(this.stickyContainer.style.setProperty(An,"auto"),this.codeOverflowFix=!1)};syncLayout(){const{gap:t,paddingBottom:i,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${t}px`,this.container?.style.setProperty("margin-top",`${n}px`),this.container?.style.setProperty("margin-bottom",`${i}px`)}reconcileHeaderFooterHosts(){const t=this.reconcileHost("header"),i=this.reconcileHost("footer");return t||i}reconcileHost(t){const{root:i,container:n}=this;if(i==null||n==null)return!1;const s=t==="header"?this.header:this.footer,r=t==="header"?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(r==null)return s.element==null||(this.resizeObserver?.unobserve(s.element),s.element.remove(),s.element=void 0,s.render=void 0,this.setHostHeight(s,0)),!1;if(s.element!=null&&r===s.render)return!1;const o=s.element??$l(t,n,this.resizeObserver);s.element=o;const l=r();return l!=null?o.replaceChildren(l):!this.isContainerManaged&&o.children.length>0&&(o.textContent=""),s.render=r,!0}setHostHeight(t,i){t.height!==i&&(t.height=i,this.scrollDirty=!0)}measureMountedHosts(){this.header.element!=null&&this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height),this.footer.element!=null&&this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw new Error("CodeView.setup: already setup");this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor="none",this.root.hasAttribute("tabindex")||(this.root.tabIndex=-1),this.container??=document.createElement("div"),this.container.style.contain="layout style",this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener("scroll",this.handleScroll,{passive:!0}),this.root.addEventListener("wheel",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("touchstart",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("pointerdown",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("keydown",this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{Le.__STOP?(Le.__STOP=!1,this.scrollTo({type:"position",position:Le.__lastScrollPosition,behavior:"instant"})):(Le.__lastScrollPosition=this.getScrollTop(),Le.__STOP=!0)}}reset(){ct(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();const{items:t}=this,i=[...this.itemEditors.values()].map(r=>{const o=this.idToItem.get(r.state.id);return o!=null&&(r.state.removedItem=o.item),r});this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items=[],this.idToItem.clear(),this.instanceToItem.clear();let n=!1,s;for(const r of i)try{r.editor.cleanUp("discard")}catch(o){n||(n=!0,s=o)}for(const r of t)try{r.instance.cleanUp()}catch(o){n||(n=!0,s=o)}if(this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent="",this.stickyOffset.style.height="",this.container?.style.removeProperty("height"),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator(),n)throw s}cleanUp(){let t=!1,i;try{this.reset()}catch(n){t=!0,i=n}if(this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener("scroll",this.handleScroll),this.root?.removeEventListener("wheel",this.clearPendingScroll),this.root?.removeEventListener("touchstart",this.clearPendingScroll),this.root?.removeEventListener("pointerdown",this.clearPendingScroll),this.root?.removeEventListener("keydown",this.clearPendingScroll),this.root?.style.removeProperty("overflow-anchor"),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent="",this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0,t)throw i}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let t=this.renderState.firstIndex;t<=this.renderState.lastIndex;t++){const i=this.items[t];if(i==null)throw new Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${t}`);this.releaseRenderedItem(i)}}primeScrollTarget(t){if(t.type==="position")return;const i=this.idToItem.get(t.id);i?.instance.primeHighlightCache()}getElementPoolLimit(){const t=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:i}=this.itemMetricsCache;return Math.max(8,Math.ceil(t/Math.max(i,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let t=this.elementPool.pop();for(;t!=null&&!this.isElementPoolGenerationCurrent(t);)t=this.elementPool.pop();return t??=document.createElement(Vn),this.markElementPoolGenerationCurrent(t),t}releaseRenderedItem(t){const{element:i}=t;i!=null&&this.renderedItemOwnsFocus(i)&&(this.shouldFixContainerFocus=!0),t.instance.cleanUp(!0),this.attachedEditors.delete(t.item.id),t.element=void 0,i!=null&&(i.remove(),this.cleanElement(i),this.queueElementForPool(i))}renderedItemOwnsFocus(t){const{activeElement:i}=document;return i===t||t.contains(i)||t.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(t){const{shadowRoot:i}=t;if(i!=null)for(const n of Array.from(i.children))nd(n)||n.remove();this.isContainerManaged||t.replaceChildren()}queueElementForPool(t){const i=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(t)||this.getElementPoolSize()>=i||(this.isElementClean(t)?this.elementPool.push(t):this.pendingElementPool.push(t))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;const{pendingElementPool:t}=this;this.pendingElementPool=[];const i=this.getElementPoolLimit();for(const n of t)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.lengththis.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(t){if(t==null)return;this.capturePendingLayoutAnchor();const{options:i}=this,n=this.getLayout(),{itemMetricsCache:s}=this;ed(i,t)&&this.invalidateElementPool(),this.options=t;const r=this.computeMetricsCache(t.itemMetrics),o=!Ze(s,r),l=!Ze(n,this.getLayout());l&&this.syncLayout();const a=o||td(i,t);if(a){const d=this.pendingLayoutReset;this.pendingLayoutReset={metrics:o?r:d?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:d?.includeEstimatedDiffHeights===!0||o||id(i,t)}}(l||a)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),zi(i,t)||this.renderOptionsRevision++,this.syncItemEditors();const h=i.renderCodeViewHeader!==t.renderCodeViewHeader||i.renderCodeViewFooter!==t.renderCodeViewFooter;!this.isContainerManaged&&(this.items.length>0||h)&&this.render()}capturePendingLayoutAnchor(t=this.idToItem){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop(),t))}render(t=!1){Le.__STOP||(t?(ct(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):Oi(this.computeRenderRangeAndEmit))}isReady(){const{workerManager:t}=this;return t==null||t.getStats().workersFailed?this.isSharedHighlighterReady():t.isInitialized()?(this.clearReadySubscription(),!0):(this.isReadySubscription??=t.subscribeToStatChanges(i=>{i.managerState!=="initialized"&&!i.workersFailed||(this.clearReadySubscription(),this.render(!0))}),t.getStats().managerState==="waiting"&&t.initialize().catch(()=>{}),!1)}clearReadySubscription(){this.isReadySubscription!=null&&(this.isReadySubscription(),this.isReadySubscription=void 0,this.pendingHighlighterTheme=void 0)}isSharedHighlighterReady(){const t=this.workerManager?.getFileRenderOptions().theme??this.options.theme??U;return Rr()&&ce(t)?(this.clearReadySubscription(),!0):(De(this.pendingHighlighterTheme,t)||this.clearReadySubscription(),this.isReadySubscription??=(()=>{this.pendingHighlighterTheme=t;let i=!1;return Ar({themes:Ee(t),langs:[],preferredHighlighter:this.options.preferredHighlighter}).then(()=>{i||(this.clearReadySubscription(),this.render(!0))},n=>{i||(this.clearReadySubscription(),console.error(n))}),()=>{i=!0}})(),!1)}instanceChanged(t,i){const n=this.instanceToItem.get(t);if(n==null)throw new Error("CodeView.instanceChanged: An instance has changed that is not registered");i&&this.markItemLayoutDirty(n),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){const{firstIndex:t,lastIndex:i}=this.renderState;if(t===-1||i===-1||i{this.scrollListeners.delete(t)}}getLocalTopForInstance(t){const i=this.instanceToItem.get(t);if(i==null)throw new Error("CodeView.getLocalTopForInstance: unknown virtualized instance");return i.top}getTopForItem(t){const i=this.idToItem.get(t);if(i!=null)return i.top+this.getItemTopOffset()}createItem(t,i,n){const{itemMetricsCache:s}=this;if(t.type==="diff"){const o=new Dl(this.createDiffOptions(t.id),this,s,this.workerManager,this.isContainerManaged);return{type:"diff",item:t,version:t.version,index:i,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:o}}const r=new Oo(this.createFileOptions(t.id),this,s,this.workerManager,this.isContainerManaged);return{type:"file",item:t,version:t.version,index:i,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:r}}applySelectedLines(t,i){const{selectedLines:n}=this;t==null&&n==null||t!=null&&n?.id===t.id&&Ut(n.range,t.range)||(n!=null&&n.id!==t?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=t,this.idToItem.get(t?.id??"")?.instance.setSelectedLines(t?.range??null,i))}syncSelection(){if(this.selectedLines==null)return;const t=this.idToItem.get(this.selectedLines.id);if(t==null){this.selectedLines=null,this.options.onSelectedLinesChange?.(null);return}t.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(t){return t.item.edit===!0&&t.item.collapsed!==!0}attachItemEditor(t){const{id:i}=t.item,{createEditor:n}=this.options;if(t.element==null||this.attachedEditors.has(i)||!this.isItemInEditMode(t))return;const s=this.itemEditors.get(i);let r;try{if(s==null&&t.type==="diff"&&!t.instance.__canAttachEditor()){t.instance.__prepareForEditing();return}if(s==null){Ql(n);const o=Ie(t.instance.options);if(o==null)throw new Error("CodeView.attachItemEditor: instance options are missing their state");const l=h=>{const d=this.idToItem.get(o.id);d!=null&&this.options.onItemEditChange?.(h,d.item)},a=this.options.getEditStateKey?.(t.item);if(t.type==="diff"){const h=n("file-diff",{onChange:l},a);r=h,this.itemEditors.set(i,{editor:h,state:o,dispose:h.edit(t.instance)})}else{const h=n("file",{onChange:l},a);r=h,this.itemEditors.set(i,{editor:h,state:o,dispose:h.edit(t.instance)})}}else t.type,s.dispose=s.editor.edit(t.instance);this.attachedEditors.add(i)}catch(o){throw r?.cleanUp(),this.releaseRenderedItem(t),o}}syncItemEditors(t){if(this.itemEditors.size===0)return;const i=[];for(const[r,o]of this.itemEditors){const l=this.idToItem.get(r),a=t?.get(r);if(a==null&&l!=null){const{edit:h=!1,collapsed:d=!1}=l.item;if(h){d&&this.attachedEditors.delete(r)&&o.editor.cleanUp("recycle");continue}}else a!=null&&(o.state.removedItem=a.item);this.itemEditors.delete(r),this.attachedEditors.delete(r),i.push(o)}if(i.length===0)return;let n=!1,s;for(const r of i){try{r.dispose()}catch(l){n||(n=!0,s=l)}const o=this.idToItem.get(r.state.id);o!=null&&this.markItemLayoutDirty(o)}if(this.render(),n)throw s}requireItemFromState(t){const i=this.idToItem.get(t.id)?.item??t.removedItem;if(i==null)throw new Error(`CodeView.onItemEditComplete: unknown item "${t.id}"`);return i}completeFileItemEdit(t,i){const n=this.requireItemFromState(t);if(n.type!=="file")throw new Error(`CodeView.onItemEditComplete: item "${t.id}" is not a file item`);const s={...n,file:i.file,annotations:i.lineAnnotations,edit:!1,version:(n.version??0)+1};return(this.options.onItemEditComplete?.(i,n,s)??"reject")==="reject"?"reject":(this.idToItem.has(n.id)&&this.updateItem(s),"accept")}completeDiffItemEdit(t,i){const n=this.requireItemFromState(t);if(n.type!=="diff")throw new Error(`CodeView.onItemEditComplete: item "${t.id}" is not a diff item`);const s={...n,fileDiff:i.fileDiff,annotations:i.lineAnnotations,edit:!1,version:(n.version??0)+1};return(this.options.onItemEditComplete?.(i,n,s)??"reject")==="reject"?"reject":(this.idToItem.has(n.id)&&this.updateItem(s),"accept")}renamePendingScrollTarget(t,i){const{pendingScrollTarget:n}=this;n==null||n.type==="position"||n.id!==t||(this.pendingScrollTarget={...n,id:i})}renamePendingLayoutAnchor(t,i){this.pendingLayoutAnchor?.id===t&&(this.pendingLayoutAnchor.id=i)}createFileOptionsPrototype(){const t={};for(const i of jl)le(t,i,()=>this.options[i]);le(t,"stickyHeader",()=>this.options.stickyHeaders),le(t,"collapsed",i=>{const n=Ie(i);if(n!=null)return this.getItemOptions(n,"file")?.item.collapsed}),le(t,"onEditComplete",i=>{if(this.options.onItemEditComplete==null)return;const n=Ie(i);if(n!=null)return s=>this.completeFileItemEdit(n,s)});for(const i of xn)this.defineItemSharedCallback(t,"file",i);for(const i of En)this.defineItemSelectionCallback(t,"file",i);return t}createDiffOptionsPrototype(){const t={};for(const i of Gl)le(t,i,()=>this.options[i]);le(t,"stickyHeader",()=>this.options.stickyHeaders),le(t,"hunkSeparators",()=>this.options.hunkSeparators),le(t,"collapsed",i=>{const n=Ie(i);if(n!=null)return this.getItemOptions(n,"diff")?.item.collapsed}),le(t,"onEditComplete",i=>{if(this.options.onItemEditComplete==null)return;const n=Ie(i);if(n!=null)return s=>this.completeDiffItemEdit(n,s)});for(const i of xn)this.defineItemSharedCallback(t,"diff",i);for(const i of En)this.defineItemSelectionCallback(t,"diff",i);return t}createFileOptions(t){const i=Object.create(this.fileOptionsPrototype);return Rn(i,{id:t}),i}createDiffOptions(t){const i=Object.create(this.diffOptionsPrototype);return Rn(i,{id:t}),i}updateItemOptionsId(t,i){const n=Ie(t);if(n==null)throw new Error("CodeView.updateItemOptionsId: No valid state");n.id=i}getItemOptions(t,i){const n=this.idToItem.get(t.id);if(!(n==null||n.type!==i))return n}defineItemSharedCallback(t,i,n){le(t,n,s=>{if(this.options[n]==null)return;const r=Ie(s);if(r==null)return;const o=r.callbackCache??={};let l=o[n];return l==null&&(l=((...a)=>{const h=this.getItemOptions(r,i);if(h==null)return;const d=this.options[n];return d?.(...a,h)}),o[n]=l),l})}defineItemSelectionCallback(t,i,n){le(t,n,s=>{const r=Ie(s);if(r==null)return;const o=r.callbackCache??={};let l=o[n];return l==null&&(l=a=>{const h=this.getItemOptions(r,i);if(h==null)return;const d=a==null?null:{id:h.item.id,range:a};this.options.controlledSelection!==!0&&(a!=null||this.selectedLines?.id===h.item.id)&&this.applySelectedLines(d,{notify:!1}),this.options.onSelectedLinesChange?.(d);const c=this.options[n];return c?.(a,h)},o[n]=l),l})}markLayoutDirtyFromIndex(t){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??t,t)}markItemLayoutDirty(t){if(this.items[t.index]!==t)throw new Error(`CodeView.markItemLayoutDirty: unknown item id "${t.item.id}"`);this.markLayoutDirtyFromIndex(t.index)}tryAppendItems(t){if(t.length<=this.items.length)return!1;for(let i=0;i=r.length?this.resetRenderState():this.renderState.lastIndex>=r.length&&(this.renderState.lastIndex=r.length-1),this.markLayoutDirtyFromIndex(h),this.scrollDirty=!0,this.render(),a.size>0?a:void 0}syncItemRecord(t,i){if(t.type!==i.type)throw new Error(`CodeView.syncItemRecord: type mismatch for id "${i.id}"`);return t.version===i.version?!1:(t.item=i,t.version=i.version,t.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(t){const{paddingBottom:i,paddingTop:n}=this.getLayout();return Math.max(n+this.header.height+t+this.footer.height+i-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>this.scrollRebaseConfig.threshold}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),this.scrollRebaseConfig.containerHeight):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(t){const i=this.getMaxPagedScrollTop();return Math.max(0,Math.min(t,i))}clampScrollTop(t){const i=this.getMaxScrollTop();return Math.max(0,Math.min(t,i))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(t){const i=this.getMaxScrollPageOffset();return Math.max(0,Math.min(t,i))}resolveScrollPageWindow(t,i){let n=fe(this.clampPagedScrollTop(i)),s=this.clampScrollPageOffset(t-n);return n=fe(this.clampPagedScrollTop(t-s)),s=this.clampScrollPageOffset(t-n),{pagedScrollTop:n,scrollPageOffset:s}}resolvePagedScrollPosition(t){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(t),scrollPageOffset:0};const{scrollPageOffset:i,scrollRebaseConfig:n}=this,s=this.clampScrollPageOffset(i),r=t-s,o=this.getMaxPagedScrollTop(),l=this.getMaxScrollPageOffset(),a=r>n.threshold&&s0;return r<0||r>o||a||h?this.resolveScrollPageWindow(t,h?Math.min(n.targetBottom,o):n.targetTop):{pagedScrollTop:fe(this.clampPagedScrollTop(r)),scrollPageOffset:s}}needsScrollPageUpdate(t){const i=fe(this.clampScrollTop(t)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(i);return n!==this.scrollPageOffset}getPagedLayoutTop(t){return this.shouldRebaseScroll()?Math.max(t-this.scrollPageOffset,0):t}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(t){const i=this.idToItem.get(t.id);if(i==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return{top:i.top,height:i.height};if(t.type==="range"){const s=this.getRangeScrollPosition(i,t);if(s==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Hn(t.range)} for item "${t.id}"`);return}return{top:i.top+s.top,height:s.height}}const n=this.getLineScrollPosition(i,t);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return{top:i.top+n.top,height:n.height}}normalizeScrollTarget(t){if(t.type==="position"||t.align!=="nearest")return t;const i=this.getScrollTargetRect(t);if(i==null)return;const n=t.offset??0,s=this.getItemTopOffset()+i.top,r=s+i.height,o=this.getScrollTop(),l=o+(t.type==="line"||t.type==="range"?this.getStickyHeaderOffset():0),a=o+this.getHeight();if(!(s-n<=l&&r+n>=a)){if(s-na)return{...t,align:"end"}}}resolveScrollTargetTop(t){if(t.type==="position"){const s=this.clampScrollTop(t.position);return s!==t.position?s:this.clampScrollTop(t.position-this.getStickyHeaderOffset())}const i=this.idToItem.get(t.id);if(i==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return this.clampScrollTop(this.resolveAlignedScrollPosition(i.top,i.height,t.align,t.offset));if(t.type==="range"){const s=this.getRangeScrollPosition(i,t);if(s==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Hn(t.range)} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(i.top+s.top,s.height,t.align,t.offset,this.getStickyHeaderOffset()))}const n=this.getLineScrollPosition(i,t);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(i.top+n.top,n.height,t.align,t.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(t,i,n,s=0,r=0){t+=this.getItemTopOffset();const o=this.getHeight();return n==="center"&&i+s{if(Le.__STOP||this.container==null||!this.isReady())return;const i=this.getHeight(),n=this.getScrollTop();let s=n,r=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(s);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,r=!0),r&&o!=null){const S=this.resolveAnchoredScrollTop(o);if(S!=null){const L=S-s;s=S,this.scrollAnimation!=null&&(this.scrollAnimation.position+=L)}}r&&(s=this.clampScrollTop(s),this.syncContainerHeight());const l=this.computeTargetScrollTopForFrame(s,t),a=!r&&(this.renderState.scrollTop===-1||Math.abs(l-this.renderState.scrollTop)>i+this.config.overscrollSize*2);a&&(o=void 0),this.windowSpecs=Hr({scrollTop:l-this.header.height,height:i,scrollHeight:this.getScrollHeight(),fitPerfectly:a,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let h=n;(this.pendingScrollTarget!=null&&l!==h||this.needsScrollPageUpdate(l))&&(this.applyScrollFix(l,h,this.windowSpecs),h=l);const{top:d,bottom:c}=this.windowSpecs,{firstIndex:u,lastIndex:f}=this.renderState;if(u>=0)for(let S=u;S<=f;S++){const L=this.items[S];if(L==null)throw new Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${S}`);L.top>d-L.height&&L.top<=c||this.releaseRenderedItem(L)}const g=this.reconcileHeaderFooterHosts();let p;const m=new Set,y=this.findFirstVisibleIndex(d),v=this.findLastVisibleIndex(c);for(let S=y;S<=v;S++){const L=this.items[S];if(L==null)throw new Error("CodeView.computeRenderRangeAndEmit: missing item");const{instance:w}=L;L.element==null?(L.element=this.acquireElement(),Dn(this.stickyContainer,L.element,p),w.virtualizedSetup(),Mn(L,L.element)&&(L.renderedOptionsRevision=this.renderOptionsRevision,m.add(L)),p=L.element):(Dn(this.stickyContainer,L.element,p),Mn(L,void 0,L.renderedOptionsRevision!==this.renderOptionsRevision)&&(L.renderedOptionsRevision=this.renderOptionsRevision,m.add(L)),p=L.element),L.item.edit===!0&&this.attachItemEditor(L)}this.renderState.firstIndex=y<=v?y:-1,this.renderState.lastIndex=v,this.flushSlotCoordinator(),this.flushManagers(m),g&&this.measureMountedHosts(),this.reconcileRenderedItems(m),this.syncContainerHeight(),this.updateStickyPositioning();const k=o!=null?this.resolveAnchoredScrollTop(o):void 0;o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);const x=k!=null?k-s:0;let b=l,C=!1;if(this.pendingScrollTarget!=null){const S=this.advanceScrollAnimation(t,x);S!=null?(b=S,C=!0):b=s}else b=k??l;b!==h&&(this.applyScrollFix(b,h,this.windowSpecs),h=b),C&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=fe(h),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),(a||this.scrollAnimation!=null)&&this.render()};flushManagers(t){for(const i of t)i.instance.flushManagers()}syncContainerHeight(){const t=this.getPagedScrollHeight();this.container==null||this.containerHeight===t||(this.container.style.height=`${t}px`,this.containerHeight=t)}getStickyBounds(t){const{firstIndex:i,lastIndex:n}=t!=null?{firstIndex:this.findFirstVisibleIndex(t.top),lastIndex:this.findLastVisibleIndex(t.bottom)}:this.renderState;if(i===-1||n===-1||i>n)return;const s=this.items[i]?.instance.getAdvancedStickySpecs(t),r=this.items[n]?.instance.getAdvancedStickySpecs(t);if(!(s==null||r==null))return{stickyTop:this.getPagedLayoutTop(Math.max(s.topOffset,0)),stickyBottom:this.getPagedLayoutTop(r.topOffset+r.height)}}applyStickyPositioning({stickyTop:t,stickyBottom:i}){const n=this.getHeight(),{itemMetricsCache:s}=this,r=i-t;this.renderState.stickyHeight=r,this.renderState.stickyTop=t,this.renderState.stickyBottom=i,this.stickyOffset.style.height=`${t}px`;const o=(Math.random()*s.lineHeight>>0)*-1,l=-Math.max(r+o,0)+n;this.stickyContainer.style.top=`${l}px`,this.stickyContainer.style.bottom=`${l+s.diffHeaderHeight}px`}syncPagedScrollScaffolding(t){this.syncContainerHeight();const i=this.getStickyBounds(t);if(i==null){this.stickyOffset.style.height=`${this.getPagedLayoutTop(t.top)}px`;return}this.applyStickyPositioning(i)}reconcileRenderedItems(t){const{firstIndex:i,lastIndex:n}=this.renderState;if(i===-1)return;let s=-1,r=!1;for(let o=i;on);o++){const l=this.items[o];if(l==null)throw new Error("CodeView.reconcileRenderedItems: Invalid item");s===-1?s=l.top:l.top!==s&&(l.top=s,l.instance.syncVirtualizedTop(),r=!0),(t==null?o<=n:t.has(l))&&(l.instance.reconcileHeights()&&(r=!0,l.height=l.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(l)),s+=l.instance.getVirtualizedHeight(),o{Le.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=t=>{let i=!1;for(const n of t)if(n.target===this.stickyContainer){const s=n.borderBoxSize[0].blockSize;if(Math.abs(s-this.renderState.stickyHeight)>=Tn){const r=this.getScrollTop(),o=this.getScrollAnchor(r);this.reconcileRenderedItems(),this.updateStickyPositioning();const l=o!=null?this.resolveAnchoredScrollTop(o):void 0;if(l!=null){const a=l-r;this.applyScrollFix(l,r,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=a)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),i=!0}}else if(n.target===this.header.element||n.target===this.footer.element){const s=n.target===this.header.element?this.header:this.footer,r=n.borderBoxSize[0].blockSize;if(r!==s.height){const o=this.getScrollTop(),l=this.getScrollAnchor(o);this.setHostHeight(s,r);const a=l!=null?this.resolveAnchoredScrollTop(l):void 0;if(a!=null){const h=a-o;this.applyScrollFix(a,o,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=h)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),i=!0}}else this.scrollDirty=!0,this.heightDirty=!0,i=!0;i&&this.render(!0)};getScrollAnchorViewportTop(t,i){return t=t+h)break;if(i.get(c.item.id)!==c){n??=c;continue}if(u>=t)return{type:"item",id:c.item.id,viewportOffset:u-t};const f=this.getScrollAnchorViewportTop(u,t)-u,g=c.instance.getNumericScrollAnchor(f);if(g!=null){const p=u+g.top;return{type:"line",id:c.item.id,lineNumber:g.lineNumber,side:g.side,viewportOffset:p-t}}}if(n!=null)for(let d=n.index+1;d>1,o=this.items[r];if(o==null)throw new Error("CodeView.findFirstVisibleIndex: invalid item index");o.top+o.height>t?(s=r,n=r-1):i=r+1}return s}findLastVisibleIndex(t){let i=0,n=this.items.length-1,s=-1;for(;i<=n;){const r=i+n>>1,o=this.items[r];if(o==null)throw new Error("CodeView.findLastVisibleIndex: invalid item index");o.top<=t?(s=r,i=r+1):n=r-1}return s}recomputeLayout(t=0,i){if(this.items.length===0){this.scrollHeight=0;return}const n=this.getLayout();let s=0;if(t>0){const r=this.items[t-1];if(r==null)throw new Error("CodeView.recomputeLayout: invalid dirty index");s=r.top+r.height+n.gap}for(let r=t;r0}function rd(e,{hasHeaderRenderers:t,hasAnnotationRenderer:i,hasGutterRenderer:n}){if(e.length===0)return;if(t||n)return e;if(!i)return;const s=[];for(const r of e)sd(r.item)&&s.push(r);return s.length>0?s:void 0}function Pn(e){const t=[];for(const i of e){const n=_e.get(i);if(n==null)throw new Error(`getResolvedLanguages: ${i} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(n)}return t}function Fn(e){for(const t of Array.isArray(e)?e:[e])if(!_e.has(t))return!1;return!0}async function On(e){const t=[],i=[];for(const n of e){if(n==="text"||n==="ansi")continue;const s=Kn(n)??jn(n);"then"in s?i.push(s):t.push(s)}return i.length>0&&await Promise.all(i).then(n=>{for(const s of n){if(s==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(s)}}),t}function zn(e){return ue.getResolvedThemes(e)}async function Nn(e){for(const i of e)Yn(i);const t=await ue.resolveThemes(e);for(let i=0;ithis.limit&&this.shift(),this)}shift(){var c=this.oldest;if(c)return this.oldest[n]?(this.oldest=this.oldest[n],this.oldest[s]=void 0):(this.oldest=void 0,this.newest=void 0),c[n]=c[s]=void 0,this._keymap.delete(c.key),--this.size,[c.key,c.value]}find(c){let u=this._keymap.get(c);return u?u.value:void 0}has(c){return this._keymap.has(c)}delete(c){var u=this._keymap.get(c);return u?(this._keymap.delete(u.key),u[n]&&u[s]?(u[s][n]=u[n],u[n][s]=u[s]):u[n]?(u[n][s]=void 0,this.oldest=u[n]):u[s]?(u[s][n]=void 0,this.newest=u[s]):this.oldest=this.newest=void 0,this.size--,u.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new a(this.oldest)}values(){return new h(this.oldest)}entries(){return this}[Symbol.iterator](){return new l(this.oldest)}forEach(c,u){typeof u!="object"&&(u=this);let f=this.oldest;for(;f;)c.call(u,f.value,f.key,this),f=f[n]}toJSON(){for(var c=new Array(this.size),u=0,f=this.oldest;f;)c[u++]={key:f.key,value:f.value},f=f[n];return c}toString(){for(var c="",u=this.oldest;u;)c+=String(u.key)+":"+u.value,u=u[n],u&&(c+=" < ");return c}}i.LRUMap=r;function o(d,c){this.key=d,this.value=c,this[n]=void 0,this[s]=void 0}function l(d){this.entry=d}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let d=this.entry;return d?(this.entry=d[n],{done:!1,value:[d.key,d.value]}):{done:!0,value:void 0}};function a(d){this.entry=d}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let d=this.entry;return d?(this.entry=d[n],{done:!1,value:d.key}):{done:!0,value:void 0}};function h(d){this.entry=d}h.prototype[Symbol.iterator]=function(){return this},h.prototype.next=function(){let d=this.entry;return d?(this.entry=d[n],{done:!1,value:d.value}):{done:!0,value:void 0}}})})(ht,ht.exports)),ht.exports}var dd=ld();const _n=od(dd),Mt=Symbol("IGNORE_RESPONSE"),hd=1e4;var cd=class{options;highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:i=U,useTokenTransformer:n=!1,lineDiffType:s="word-alt",maxLineDiffLength:r=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:l="shiki-js"}){this.options=e,this.preferredHighlighter=l,this.renderOptions={theme:i,useTokenTransformer:n,lineDiffType:s,maxLineDiffLength:r,tokenizeMaxLineLength:o},this.fileCache=new _n.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new _n.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??U,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:i=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:n=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:s=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:r}=this,o=++this.renderOptionsRequestVersion,l=()=>this.isCurrentLifecycle(r)&&this.renderOptionsRequestVersion===o;try{const a={theme:e,useTokenTransformer:t,lineDiffType:i,maxLineDiffLength:n,tokenizeMaxLineLength:s};if(this.isInitialized()||await this.initialize(),!l()||ee(a,this.renderOptions))return;const h=Ee(e);let d=[];if(De(a.theme,this.renderOptions.theme)||(vi(h)?d=zn(h):d=await Nn(h)),!l())return;if(this.highlighter!=null)mi(d,this.highlighter);else{const u=await Me({themes:h,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!l())return;this.highlighter=u}const c=this.setRenderOptionsOnWorkers(a,d);this.renderOptions=a,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const u of this.themeSubscribers)u.onThemeChange();await c}catch(a){if(a instanceof lt||!l())return;throw a}}getPreferredHighlighter(){return this.preferredHighlighter}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:i}=this.renderOptions;return{theme:t,useTokenTransformer:i,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const i=[];for(const n of this.workers){if(!n.initialized)throw console.log({managedWorker:n}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");i.push(new Promise((s,r)=>{const o=this.generateRequestId(),l={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:e,resolvedThemes:t},resolve:s,reject:r,requestStart:Date.now()};this.activeTaskById.set(o,l),n.pendingSetupRequestId=o,n.worker.postMessage(l.request)}))}await Promise.all(i)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);const t=this.activeRequestByInstance.get(e);if(t!=null){const i=this.activeTaskById.get(t);Ce(i)?(this.detachInstanceFromRenderTask(i,e),!i.primeCache&&i.instances.size===0&&this.removeActiveTask(i)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1){const{lifecycleGeneration:t}=this,i=new Promise((n,s)=>{(async()=>{try{const r=Ee(this.renderOptions.theme);let o=[];if(vi(r)?o=zn(r):o=await Nn(r),!this.isCurrentLifecycle(t)){n();return}let l=[];if(Fn(e)?l=Pn(e):l=await On(e),!this.isCurrentLifecycle(t)){n();return}const[a]=await Promise.all([Me({themes:r,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(o,l)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=a,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(r){if(r instanceof lt||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.activeTaskById.clear();for(const o of this.queuedTasks)this.rejectRenderTaskCallbacks(o,fi(r));this.queueBroadcastStateChanges(),s(r)}})()});return this.initialized=i,this.queueBroadcastStateChanges(),i}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const i=[],n=Qi(),s=n>0?Ji():void 0;this.workers.length>0&&this.terminateWorkers();for(let l=0;l<(this.options.poolSize??8);l++){const a=this.options.workerFactory(),h={worker:a,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:d})=>d)]),customExtensionsVersion:0};a.addEventListener("message",d=>{this.handleWorkerMessage(h,d.data)}),a.addEventListener("error",d=>this.handleWorkerError(h,d)),this.workers.push(h),i.push(new Promise((d,c)=>{const u=this.generateRequestId(),f={type:"initialize",id:u,request:{type:"initialize",id:u,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:s!=null?n:void 0,customExtensionMap:s},resolve(){h.initialized=!0,d()},reject:c,requestStart:Date.now()};h.pendingSetupRequestId=u,this.activeTaskById.set(u,f),this.executeTask(h,f)}))}const r=this.options.workerInitializationTimeout??hd;let o;try{await Promise.race([Promise.all(i),new Promise((l,a)=>{o=setTimeout(()=>{a(new Error(`WorkerPoolManager: worker initialization timed out after ${r}ms`))},r)})])}finally{o!=null&&clearTimeout(o)}}handleWorkerError(e,t){const{onWorkerError:i}=this.options;if(i!=null)try{i(t,e.worker)}catch(o){console.error("WorkerPoolManager: onWorkerError threw:",o)}else console.error("Worker error:",t,e);const{pendingSetupRequestId:n}=e;if(n==null)return;const s=this.activeTaskById.get(n);if(s?.type!=="initialize")return;const r=pd(t);i!=null&&Lo(r),s.reject(r),this.cleanWorkerAndTask(e,s)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;e "${e.name}".`);return}const t=this.getDiffResultCache(e),i=this.getDiffHighlightKey(e);if(i==null||Ne(e)||t!=null&&ee(t.options,this.getDiffRenderOptions()))return;const n=this.getTaskByHighlightKey(i);if(n!=null)return n.primeCache=!0,n.type==="diff"?n:void 0;{const s=this.submitCacheTask({type:"diff",diff:e},i);return s.type==="diff"?s:void 0}}getPlainDiffAST(e,t,i,n,s){return this.highlighter!=null?Gs(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:i,expandedHunks:n,collapsedContextThreshold:s}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers();const e=new lt;for(const t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,e);this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(t=>{Bi(t)||console.error(t)})}cancelActiveWorkerTasks(){const e=new lt;for(const t of this.activeTaskById.values())"reject"in t?t.reject(e):Ce(t)&&this.rejectRenderTaskCallbacks(t,e)}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();const i=this.getHighlightKeyForRequest(t),n=i!=null?this.getTaskByHighlightKey(i):void 0;if(n!=null){this.detachInstanceFromQueuedTasks(e,n),this.addInstanceToTask(n,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);const s=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:o}=this,l=(()=>{switch(t.type){case"file":return{type:"file",id:s,request:{...t,id:s},instances:new Set([e]),primeCache:!1,highlightKey:i,callbacks:new Set,renderOptionsVersion:o,requestStart:r};case"diff":return{type:"diff",id:s,request:{...t,id:s},instances:new Set([e]),primeCache:!1,highlightKey:i,callbacks:new Set,renderOptionsVersion:o,requestStart:r}}})();this.enqueueRenderTask(l,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const i=this.generateRequestId(),n=Date.now(),{renderOptionsVersion:s}=this,r=(()=>{switch(e.type){case"file":return{type:"file",id:i,request:{...e,id:i},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:s,requestStart:n};case"diff":return{type:"diff",id:i,request:{...e,id:i},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:s,requestStart:n}}})();return this.enqueueRenderTask(r),r}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,i){try{const n=i.filter(r=>!Qe(r));n.length>0&&Me({themes:Ee(this.renderOptions.theme),langs:["text",...n],preferredHighlighter:this.preferredHighlighter}).catch(r=>{console.error(r)});const s=i.filter(r=>!e.langs.has(r));if(s.length>0&&(Fn(s)?t.request.resolvedLanguages=Pn(s):t.request.resolvedLanguages=await On(s)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch(n){this.rejectRenderTaskCallbacks(t,fi(n)),this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){const i=this.activeTaskById.get(t.id);try{if(i==null)throw Mt;if(t.type==="error"){const n=new Error(t.error);if(t.stack&&(n.stack=t.stack),"reject"in i)i.reject(n);else if(Ce(i))this.notifyHighlightError(i,n),this.rejectRenderTaskCallbacks(i,n);else throw new Error("handleWorkerMessage: unknown task type");throw n}else{if(Ce(i))for(const{name:n}of i.request.resolvedLanguages??[])e.langs.add(n);switch(t.requestType){case"initialize":if(i.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(e,i.request),i.resolve();break;case"set-render-options":if(i.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");i.resolve();break;case"file":{if(i.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:n,options:s}=t;if(!this.isCurrentRenderTask(i)||!de(s,this.getFileRenderOptions()))throw Mt;const{request:r}=i;this.syncCustomExtensionVersion(e,r),i.cacheKeyAtDispatch!=null&&this.fileCache.set(i.cacheKeyAtDispatch,{result:n,options:s}),this.resolveRenderTaskCallbacks(i),this.notifyFileInstances(i,n,s);break}case"diff":{if(i.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:n,options:s}=t;if(!this.isCurrentRenderTask(i)||!ee(s,this.getDiffRenderOptions()))throw Mt;const{request:r}=i;this.syncCustomExtensionVersion(e,r),i.cacheKeyAtDispatch!=null&&this.diffCache.set(i.cacheKeyAtDispatch,{result:n,options:s}),this.resolveRenderTaskCallbacks(i),this.notifyDiffInstances(i,n,s);break}}}}catch(n){n!==Mt&&console.error(n,i,t)}this.cleanWorkerAndTask(e,i,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,Ce(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,i=t?.id){e.requestId===i&&(e.requestId=void 0),e.pendingSetupRequestId===i&&(e.pendingSetupRequestId=void 0),t!=null&&(Ce(t)&&(this.rejectRenderTaskCallbacks(t,new Ot),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){ud(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);try{t.type==="file"?t.cacheKeyAtDispatch=t.request.file.cacheKey:t.type==="diff"&&(t.cacheKeyAtDispatch=t.request.diff.cacheKey),e.worker.postMessage(t.request)}catch(i){console.error("Failed to post message to worker:",i),Ce(t)?(this.notifyHighlightError(t,i),this.rejectRenderTaskCallbacks(t,fi(i))):"reject"in t&&t.reject(i),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;const i=Qi();e.customExtensionsVersion>=i||(t.customExtensionsVersion=i,t.customExtensionMap=Ji())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(const i of this.workers){if(i.requestId!=null||i.pendingSetupRequestId!=null||!i.initialized)continue;if(t=i,e.length===0)break;let n=!0;for(const s of e)if(!i.langs.has(s)){n=!1;break}if(n)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case"file":return this.getFileHighlightKey(e.file);case"diff":return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(const t of rt(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){const i=this.queuedTaskByInstance.get(e);i==null||i===t||(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(i,e),!i.primeCache&&i.instances.size===0&&this.removeQueuedTask(i))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){const t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.rejectRenderTaskCallbacks(e,new Ot),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new Ot),this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}createRenderTaskCallbacks(e){return new Promise((t,i)=>{e.callbacks.add({resolve:t,reject:i})})}resolveRenderTaskCallbacks(e){for(const t of e.callbacks)t.resolve();e.callbacks.clear()}rejectRenderTaskCallbacks(e,t){for(const i of e.callbacks)i.reject(t);e.callbacks.clear()}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){const t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(const e of Array.from(this.activeTaskById.values()))Ce(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of rt(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(const t of rt(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of rt(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,i){for(const n of e.instances)this.activeRequestByInstance.get(n)===e.id&&n.onHighlightSuccess(e.request.file,t,i)}notifyDiffInstances(e,t,i){for(const n of e.instances)this.activeRequestByInstance.get(n)===e.id&&n.onHighlightSuccess(e.request.diff,t,i)}notifyHighlightError(e,t){for(const i of rt(e))this.activeRequestByInstance.get(i)===e.id&&i.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(const i of this.iterateRenderTasks())if(i.type==="file"&&this.isCurrentRenderTask(i)&&i.instances.has(e)&&_i(t,i.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(const i of this.iterateRenderTasks())if(i.type==="diff"&&this.isCurrentRenderTask(i)&&i.instances.has(e)&&B(i.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){const t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const e of this.queuedTasks)yield e;for(const e of this.activeTaskById.values())Ce(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function ud(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function fd(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??$(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??$(e.request.diff.name)),t.add(e.request.diff.lang??$(e.request.diff.prevName??"-"))}return t.delete("text"),Array.from(t)}function Ce(e){return e?.type==="file"||e?.type==="diff"}function rt(e){return e.instances}function fi(e){if(e instanceof Error)return e;if(e!=null&&typeof e=="object"){if("error"in e&&e.error instanceof Error)return e.error;if("message"in e&&typeof e.message=="string")return new Error(e.message)}return new Error(String(e))}function pd(e){const t="error"in e?e.error:void 0,i="message"in e&&typeof e.message=="string"&&e.message!==""?e.message:t instanceof Error?t.message:"the worker script failed to load (the error event carries no message)";return new Is(`WorkerPoolManager: worker failed: ${i}`,t instanceof Error?{cause:t}:void 0)}let Un;function bd({poolOptions:e,highlighterOptions:t}){return Un??=new cd(e,t),Un}export{yd as C,$ as a,bd as g,Sd as p}; +`)}function Ll(e,t){const i=e.additionLineIndex,n=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(s=>yr(s,i,n)),e.additionLineIndex=i+t.additionLineIndex,e.additionStart=e.additionStart+t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=n+t.deletionLineIndex,e.deletionStart=e.deletionStart+t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,Ji(e)}function yr(e,t,i){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+i}}function Ji(e){let t=0,i=0;for(const n of e.hunkContent)n.type==="context"?(t+=n.lines,i+=n.lines):(t+=Math.max(n.additions,n.deletions),i+=n.additions+n.deletions);e.splitLineCount=t,e.unifiedLineCount=i}function li(e){let t=0,i=0,n=0;for(const s of e.hunks)s.collapsedBefore=Math.max(oe(s.additionStart,s.additionCount)-n,0),s.splitLineStart=t+s.collapsedBefore,s.unifiedLineStart=i+s.collapsedBefore,Ji(s),t+=s.collapsedBefore+s.splitLineCount,i+=s.collapsedBefore+s.unifiedLineCount,n=J(s.additionStart,s.additionCount);if(e.hunks.length>0){const s=e.hunks[e.hunks.length-1],r=Math.max(e.additionLines.length-J(s.additionStart,s.additionCount),0);t+=r,i+=r}e.splitLineCount=t,e.unifiedLineCount=i}const Rn=new WeakMap;function wl(e){return e.length>1&&e[e.length-1]===""?e.slice(0,-1):e}function xl(e,t){const i=Math.min(e.length,t.length);let n=0;for(;nn&&r>n&&e[s-1]===t[r-1];)s--,r--;if(!(n===s&&n===r))return{start:n,deletionEnd:s,additionEnd:r}}function Fi(e,t,i){const n=e.hunks,s=e.additionLines,r=wl(s),o=r===s?e:{...e,additionLines:r},a=Pl(n,Dl(o,t,i),e.deletionLines.length),l=Nl(o,a);if(e.additionLines=r,e.hunks=l,e.editSessionDirty=!0,Ul(e),vr(e,s),!!Bl(n,e.hunks))return{regions:a.map(d=>d.previousSpan)}}function El(e,t,i,n){const s=new Set(t),r=Array.from(s).filter(h=>h>=0&&hh-c);if(r.length===0)return;const o=h=>s.has(h)?n?.get(h):e.additionLines[h],{hunks:a}=e;let l,d=0;for(const h of r){for(;d=c.additionLineIndex&&a0||h>0)&&i.set(s,{fromStart:d,fromEnd:h})}return i}function Hl(e,t,i){const n=[];if(e.isPartial)return n;for(const[r,o]of e.hunks.entries()){const a=Te({isPartial:e.isPartial,rangeSize:o.collapsedBefore,expandedHunks:t,hunkIndex:r,collapsedContextThreshold:i});if(a.rangeSize<=i)continue;const l=$e(o),d=l-a.rangeSize;a.fromStart>0&&n.push([d,d+a.fromStart]),a.fromEnd>0&&n.push([l-a.fromEnd,l])}const s=Ae({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:i,errorPrefix:"captureExpansionAnchors"});if(s!=null&&s.fromStart>0&&s.rangeSize>i){const r=e.hunks[e.hunks.length-1],o=$e(r)+r.deletionCount;n.push([o,o+s.fromStart])}return n}function Ml(e,t){const i=new Map;if(t.length===0)return i;const n=(r,o,a)=>{if(a<=o)return;let l=0,d=0;for(const[h,c]of t)c<=o||h>=a||(h<=o&&(l=Math.max(l,Math.min(c,a)-o)),c>=a&&(d=Math.max(d,a-Math.max(h,o))));(l>0||d>0)&&i.set(r,{fromStart:l,fromEnd:d})};for(const[r,o]of e.hunks.entries()){const a=$e(o);n(r,a-Math.max(o.collapsedBefore,0),a)}const s=e.hunks[e.hunks.length-1];return s!=null&&!e.isPartial&&e.deletionLines.length>0&&n(e.hunks.length,$e(s)+s.deletionCount,e.deletionLines.length),i}function Tn(e,t){return e.editSessionDirty!==!0?!1:(delete e.editSessionDirty,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join("")===""?we(e,t):mr(e,t)),!0)}function Dl(e,t,i){if(xl(e.deletionLines,e.additionLines)==null)return[];const n=We({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);let s;const r=(d,h)=>{s??=Fl(e.hunks);for(let c=0;c<=h;c++){const u=s.get(d.deletionLineIndex-c);if(!(u==null||u.additions!==d.additions||u.deletions!==d.deletions)){if(d.additions>0&&i!=null){for(let f=0;f0?d.additionLineIndex-a:d.deletionLineIndex-l;a+=h,l+=h;for(const c of d.hunkContent){if(c.type==="context"){a+=c.lines,l+=c.lines;continue}const u=yr(c,0,0);u.additions===0&&(u.additionLineIndex=a),u.deletions===0&&(u.deletionLineIndex=l),o.push(u),a+=u.additions,l+=u.deletions}}return o}function Fl(e){const t=new Map;for(const i of e)for(const n of i.hunkContent)n.type==="change"&&(n.additions===0||n.deletions===0)&&t.set(n.deletionLineIndex,n);return t}function Pl(e,t,i){const n=e.map((o,a)=>{const l=$e(o);return{deletionStart:l,deletionEnd:l+o.deletionCount,blocks:[],previousSpan:{firstIndex:a,lastIndex:a}}}),s=[];let r=0;for(const o of t){const a=o.deletionLineIndex,l=a+o.deletions;for(;r0&&Ol(a,l,s[s.length-1])?s.pop():void 0;for(;ro.deletions){const u=s[s.length-1]?.deletionEnd??0,f=n[r]?.deletionStart??i;a>u?h--:l=i.deletionStart}function zl(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 Nl(e,t){const i=[];let n=0,s=0;for(const r of t){const o=r.deletionStart-n;if(o<0)throw new Error("buildRegionHunks: overlapping old-side regions");n+=o,s+=o;const a=s,l=[];for(const h of r.blocks){const c=h.deletionLineIndex-n,u=h.additionLineIndex-s;if(c<0||c!==u)throw new Error("buildRegionHunks: canonical block context mismatch");An(l,c,s,n),n+=c,s+=u,l.push({...h}),n+=h.deletions,s+=h.additions}const d=r.deletionEnd-n;if(d<0)throw new Error("buildRegionHunks: block exceeds its old-side region");An(l,d,s,n),n+=d,s+=d,i.push(_l(e,{additionStart:a,additionEnd:s,deletionStart:r.deletionStart,deletionEnd:r.deletionEnd},l))}if(e.deletionLines.length-n!==e.additionLines.length-s)throw new Error("buildRegionHunks: trailing context mismatch");return i}function _l(e,t,i){const n=t.additionEnd-t.additionStart,s=t.deletionEnd-t.deletionStart;let r=0,o=0;for(const l of i)l.type==="change"&&(r+=l.additions,o+=l.deletions);const a={collapsedBefore:0,additionStart:Pt(t.additionStart,n),additionCount:n,additionLines:r,additionLineIndex:Hn(t.additionStart,n),deletionStart:Pt(t.deletionStart,s),deletionCount:s,deletionLines:o,deletionLineIndex:Hn(t.deletionStart,s),hunkContent:i,hunkSpecs:`@@ -${Pt(t.deletionStart,s)},${s} +${Pt(t.additionStart,n)},${n} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return Ji(a),a}function An(e,t,i,n){t>0&&e.push({type:"context",lines:t,additionLineIndex:i,deletionLineIndex:n})}function Bl(e,t){if(e.length!==t.length)return!0;for(let i=0;i{this.applyRefreshedResult(e,i.getDiffResultCache(e))}).catch(n=>{ai(n)||this.onHighlightError(n)})):this.asyncHighlight(e).then(n=>this.applyRefreshedResult(e,n)).catch(n=>this.onHighlightError(n))}applyRefreshedResult(e,t){const{diff:i,renderCache:n}=this;if(t==null||i==null||n==null||!N(i,e)||!N(n.diff,e)||this.editSessionActive)return;const{options:s}=this.getRenderOptions(i);Z(s,t.options)&&(this.pendingHighlightResult={diff:i,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,i=this.getOptionsWithDefaults().expansionLineCount){const n={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(n.fromStart+=i),(t==="down"||t==="both")&&(n.fromEnd+=i),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,n)}getExpandedHunk(e){return this.expandedHunks.get(e)??qr}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const i=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),n=i[t.lineNumber]??[];i[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,i=!1,n,s){this.pendingStructuralRows=void 0;const{renderCache:r}=this;if(r==null)return!1;const{result:o,diff:a}=r;if(o==null)return!1;if(a.isPartial)throw new Error("Could not update render cache for partial diff");const l=o.code.additionLines,d=this.pendingStructuralRows=i?new Map:void 0,h=[],c=new Map;if(d==null&&n!=null){const f=a.additionLines.length,g=Kl(a.additionLines,s);for(const[p,m]of n){if(p<0||p>f||p===f&&(m===""||!g))continue;const v=a.additionLines[p]??"";v!==m&&(a.additionLines[p]=m,a.additionCharacterCount+=m.length-v.length,h.push(p),c.set(p,v),e.has(p)||(l[p]=Gt(p,Re(m))))}}for(const[f,g]of e){const p=l[f]?.properties??{},m=g.map(C=>C[2]).join(""),v=fC===0&&E===""?S===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:S}:{type:"element",tagName:"span",properties:{"data-char":C,style:`color:${E};`},children:[{type:"text",value:S}]})};d!=null?d.set(f,b):l[f]=b}let u=!1;if(h.length>0)if(this.editSessionActive)if(a.additionLines.length<=1&&a.additionLines.join("")==="")this.applyRecomputePreservingSessionType(a,qt(a,this.options.parseDiffOptions)),u=!0;else if(Di(a,a.additionLines))this.applyRecomputePreservingSessionType(a,ni(a,a.additionLines,a.additionCharacterCount,this.options.parseDiffOptions)),u=!0;else{const f=El(a,h,this.options.parseDiffOptions,c);this.applyExpansionRemap(f),u=f!=null}else Object.assign(a,yl(a,h,this.options.parseDiffOptions));return o.baseThemeType=t,r.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=Il(this.expandedHunks,e))}applyDocumentChange(e){const{pendingStructuralRows:t,renderCache:i}=this;this.pendingStructuralRows=void 0;const n=this.diff??i?.diff;if(n==null)return;const s=i?.result;if(n.isPartial)throw new Error("Could not apply document change for partial diff");const{additionLines:r}=n,{lines:o,characterCount:a}=Yl(e);if(n.additionLines=o,n.additionCharacterCount=a,s!=null&&(s.code.additionLines=jl(r,n.additionLines,s.code.additionLines,e)),n.additionLines.length<=1&&n.additionLines.join("")===""?(this.applyRecomputePreservingSessionType(n,qt(n,this.options.parseDiffOptions)),s!=null&&(s.code.additionLines[0]=Gt(0,e.getLineText(0)))):this.editSessionActive?this.applySessionDocumentChange(n,r):Object.assign(n,mr(n,this.options.parseDiffOptions)),t!=null&&s!=null)for(const[l,d]of t)lt[s]))}applyRecomputePreservingSessionType(e,t){const i=this.editSessionActive?e.type:void 0;Object.assign(e,t),i!=null&&(e.type=i),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 i=t==="change"?e==="deletions"?"change-deletion":"change-addition":t;return{gutterLineType:i,contentProperties:{"data-line-type":i}}}createAnnotationElement=e=>xi(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:i=!1,disableFileHeader:n=!1,disableLineNumbers:s=!1,disableVirtualizationBuffers:r=!1,collapsed:o=!1,expandUnchanged:a=!1,collapsedContextThreshold:l=1,expansionLineCount:d=100,hunkSeparators:h="line-info",lineDiffType:c="word-alt",maxLineDiffLength:u=1e3,overflow:f="scroll",stickyHeader:g=!1,theme:p=q,headerRenderMode:m="default",tokenizeMaxLineLength:v=1e3,tokenizeMaxLength:k=Ur,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:i,disableFileHeader:n,disableLineNumbers:s,disableVirtualizationBuffers:r,collapsed:o,expandUnchanged:a,collapsedContextThreshold:l,expansionLineCount:d,hunkSeparators:h,lineDiffType:c,maxLineDiffLength:u,overflow:f,stickyHeader:g,theme:this.workerManager?.getDiffRenderOptions().theme??p,headerRenderMode:m,tokenizeMaxLineLength:v,tokenizeMaxLength:k,useTokenTransformer:y,useCSSClasses:b}}initializeHighlighter(){return it(Ts(this.computedLangs,{theme:this.getLocalHighlightTheme(),preferredHighlighter:Ct(this.workerManager,this.options)}))}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e),i=at(e,this.getTokenizeMaxLength());let n=this.workerManager?.getDiffResultCache(e);n!=null&&!Z(t,n.options)&&(n=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!i&&!Be(e),options:t,result:i?void 0:n?.result,renderRange:void 0};const s=this.getHighlightWorkerManager(e);s!=null?this.renderCache.result==null&&!i&&s.highlightDiffAST(this,this.diff):$({theme:this.getLocalHighlightTheme()})==null&&(this.computedLangs=vi(e),this.initializeHighlighter().catch(r=>{r instanceof ve||this.onHighlightError(r)}))}getHighlightWorkerManager(e){const{editSessionActive:t,workerManager:i}=this;return!t&&i?.isWorkingPool()===!0&&!i.shouldHighlightOnMainThread(e)?i:void 0}cacheHighlightResult(e,t){const{editSessionActive:i,workerManager:n}=this;!i&&n?.isWorkingPool()===!0&&n.setDiffResultCache(e.cacheKey,t)}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??q}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 a=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&a.useTokenTransformer!==!0?{...a,useTokenTransformer:!0}:a}const{theme:n,tokenizeMaxLineLength:s,lineDiffType:r,maxLineDiffLength:o}=this.getOptionsWithDefaults();return{theme:n,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:s,lineDiffType:r,maxLineDiffLength:o}})();this.getOptionsWithDefaults();const{renderCache:i}=this;return i?.result==null?{options:t,forceHighlight:!0}:!N(e,i.diff)||!Z(t,i.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(N(this.renderCache.diff,e))return this.renderCache.diff;const i=!(e.additionLines.length>0||e.deletionLines.length>0)||Be(e)||at(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,i)?e:this.renderCache.diff}canRenderDiff(e,t,i){const{renderCache:n}=this;return n==null||N(n.diff,e)?!0:i?n.result==null&&n.hydrated!==!0||this.workerManager?.isWorkingPool()===!0&&!this.workerManager.shouldHighlightOnMainThread(e)||$({theme:t.theme})!=null:n.result==null&&n.hydrated!==!0?!0:this.getHighlightWorkerManager(e)!=null?!n.highlighted:$({theme:t.theme})!=null}renderDiff(e=this.diff,t=jt){if(this.diff=e,e==null){this.pendingHighlightResult=void 0;return}const{expandUnchanged:i,collapsedContextThreshold:n}=this.getOptionsWithDefaults();let{options:s,forceHighlight:r}=this.getRenderOptions(e);const o=this.getReadyRenderResult(e,s);this.pendingHighlightResult=void 0,o!=null&&(this.renderCache={...o,diff:e,renderRange:void 0},r=!1),this.renderCache??={diff:e,highlighted:!1,options:s,result:void 0,renderRange:void 0};const a=e.additionLines.length>0||e.deletionLines.length>0,l=!a||Be(e)||at(e,this.getTokenizeMaxLength()),d=this.canRenderDiff(e,s,l),h=!N(e,this.renderCache.diff),c=!ri(this.renderCache.renderRange,t),u=this.getHighlightWorkerManager(e);if(u!=null){const f=this.renderCache.result==null&&this.renderCache.highlighted&&!l&&!h&&Qt(t);d&&!f&&(l||this.renderCache.result==null||!this.renderCache.highlighted&&(h||c))&&(this.renderCache.diff=e,this.renderCache.options=s,this.renderCache.highlighted=!1,(this.renderCache.result==null||h||c||r)&&(this.renderCache.result=u.getPlainDiffAST(e,t.startingLine,t.totalLines,Qt(t)||i?!0:this.expandedHunks,n)),this.renderCache.renderRange=t),!l&&a&&(!this.renderCache.highlighted||r)&&u.highlightDiffAST(this,e)}else{this.computedLangs=vi(e);const f=$(),g=f!=null&&ft(s.theme,f),p=f!=null&>(this.computedLangs,f),m=!l&&p,v=Number.isFinite(t.totalLines);if(d&&f!=null&&g&&(r||l||!this.renderCache.highlighted&&m||this.renderCache.result==null)){const{result:k,options:y}=this.renderDiffWithHighlighter(e,f,l||!p,v);this.renderCache={diff:e,options:y,highlighted:m,result:k,renderRange:void 0},m&&this.cacheHighlightResult(e,{result:k,options:y})}(!g||!l&&!p)&&this.asyncHighlight(e,v).then(({result:k,options:y})=>{l||this.cacheHighlightResult(e,{result:k,options:y}),this.applyHighlightResult(e,k,y,!l)}).catch(k=>{k instanceof ve||this.onHighlightError(k)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=jt){this.diff=e;const{result:i}=await this.asyncHighlight(e,Number.isFinite(t.totalLines));return this.processDiffResult(e,t,i)}createPreElement(e,t,i){const{diffIndicators:n,disableBackground:s,disableLineNumbers:r,overflow:o}=this.getOptionsWithDefaults();return Rs({type:"diff",diffIndicators:n,disableBackground:s,disableLineNumbers:r,overflow:o,split:e,totalLines:t,customProperties:i})}async asyncHighlight(e,t=!1){const i=at(e,this.getTokenizeMaxLength());this.computedLangs=i?["text"]:vi(e);let n=$();const s=n!=null&&ft(this.getLocalHighlightTheme(),n),r=i||n!=null&>(this.computedLangs,n);return(n==null||!s||!r)&&(n=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,n,i,t)}renderDiffWithHighlighter(e,t,i=!1,n=!1){const{options:s}=this.getRenderOptions(e),{collapsedContextThreshold:r}=this.getOptionsWithDefaults(),o=Mi(e,t,s,{forcePlainText:i,lazyLineAST:n,expandedHunks:i?!0:void 0,collapsedContextThreshold:r});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===""&&o.code.additionLines[0]==null){let a;if(Ve({diff:e,diffStyle:"both",expandedHunks:i?!0:void 0,collapsedContextThreshold:r,callback:({additionLine:l})=>{if(l?.lineIndex===0)return a=l,!0}}),a==null)throw new Error("DiffHunksRenderer: missing empty addition line");o.code.additionLines[0]=Gt(0,"",a.unifiedLineIndex,a.splitLineIndex)}return{result:o,options:s}}onHighlightSuccess(e,t,i,n=!0){this.editSessionActive||this.applyHighlightResult(e,t,i,n)}applyHighlightResult(e,t,i,n=!0){const{diff:s,renderCache:r}=this;s==null||r==null||!N(s,e)||!Z(i,this.getRenderOptions(s).options)||(r.result==null||!r.highlighted||!Z(r.options,i)||!N(r.diff,s))&&(this.pendingHighlightResult={diff:s,options:i,highlighted:n,result:t},this.onRenderUpdate?.())}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const i=this.workerManager?.getDiffResultCache(e);if(!(i==null||!Z(t,i.options)))return i}getReadyRenderResult(e,t){const{pendingHighlightResult:i}=this;if(i!=null&&N(i.diff,e)&&Z(i.options,t))return i;const n=this.getMatchingWorkerResultCache(e,t);if(!(n==null||this.hasHighlightedRenderCache(e,t)))return{diff:e,highlighted:!0,...n}}hasHighlightedRenderCache(e,t){const{renderCache:i}=this;return i?.result!=null&&i.highlighted&&N(e,i.diff)&&Z(t,i.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:i,themeStyles:n,baseThemeType:s}){const{diffStyle:r,disableFileHeader:o,expandUnchanged:a,expansionLineCount:l,collapsedContextThreshold:d,hunkSeparators:h}=this.getOptionsWithDefaults(),c=this.renderCache?.isDirty??!1,u=r==="unified",f=Xl(e,this.options.loadDiffFiles!=null),g=!e.isPartial||f;let p=[],m=[],v=[];const k=[],{additionLines:y,deletionLines:b}=i,C={rowCount:0,hunkSeparators:h,additionsContentAST:p,deletionsContentAST:m,unifiedContentAST:v,unifiedGutterAST:Xe(),deletionsGutterAST:Xe(),additionsGutterAST:Xe(),expansionLineCount:l,hunkData:k,incrementRowCount(I=1){C.rowCount+=I},pushToGutter(I,D){switch(I){case"unified":C.unifiedGutterAST.children.push(D);break;case"deletions":C.deletionsGutterAST.children.push(D);break;case"additions":C.additionsGutterAST.children.push(D)}}},E=ur({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),S={size:0,side:void 0,increment(){this.size+=1},flush(){if(r!=="unified"){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side==="additions"?(C.pushToGutter("additions",ie(void 0,"buffer",this.size)),p?.push(Ht(this.size))):(C.pushToGutter("deletions",ie(void 0,"buffer",this.size)),m?.push(Ht(this.size))),this.size=0,this.side=void 0}}},w=(I,D,O,G,P)=>{C.pushToGutter(I,ms(D,O,G,P))};function R(I){S.flush(),r==="unified"?mi("unified",I,C):(mi("deletions",I,C),mi("additions",I,C))}this.pushFileLevelAnnotations(e,r,t,C),Ve({diff:e,diffStyle:r,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:a?!0:this.expandedHunks,collapsedContextThreshold:d,callback:({hunkIndex:I,hunk:D,collapsedBefore:O,collapsedAfter:G,additionLine:P,deletionLine:z,type:_})=>{const U=z!=null?z.splitLineIndex:P.splitLineIndex,ee=P!=null?P.unifiedLineIndex:z.unifiedLineIndex;r==="split"&&_!=="change"&&S.flush(),O>0&&R({hunkIndex:I,collapsedLines:O,rangeSize:Math.max(D?.collapsedBefore??0,0),hunkSpecs:D?.hunkSpecs,isFirstHunk:I===0,isLastHunk:!1,isExpandable:g});const ne=r==="unified"?ee:U,se={type:_,hunkIndex:I,lineIndex:ne,unifiedLineIndex:ee,splitLineIndex:U,deletionLine:z,additionLine:P};if(r==="unified"){const V=this.getUnifiedInjectedRowsForLine?.(se);V?.before!=null&&Mn(V.before,C);let X=z!=null?b[z.lineIndex]:void 0,te=P!=null?y[P.lineIndex]:void 0;if(X==null&&te==null){const le="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(le,{file:e.name}),new Error(le)}const Oe=_==="change"?P!=null?"change-addition":"change-deletion":_,ae=this.getUnifiedLineDecoration({type:_,lineType:Oe,additionLineIndex:P?.lineIndex,deletionLineIndex:z?.lineIndex});w("unified",ae.gutterLineType,P!=null?P.lineNumber:z.lineNumber,`${ee},${U}`,ae.gutterProperties),te!=null?te=zt(te,ae.contentProperties,c&&P!=null?{"data-line":P.lineNumber,"data-line-index":`${ee},${U}`}:void 0):X!=null&&(X=zt(X,ae.contentProperties,c&&z!=null?{"data-line":z.lineNumber,"data-line-index":`${ee},${U}`}:void 0)),Ot({diffStyle:"unified",type:_,deletionLine:X,additionLine:te,unifiedSpan:this.getAnnotations("unified",z?.lineNumber,P?.lineNumber,I,ne),createAnnotationElement:le=>this.createAnnotationElement(le),context:C}),V?.after!=null&&Mn(V.after,C)}else{const V=this.getSplitInjectedRowsForLine?.(se);V?.before!=null&&Dn(V.before,C,S);let X=z!=null?b[z.lineIndex]:void 0,te=P!=null?y[P.lineIndex]:void 0;const Oe=this.getSplitLineDecoration({side:"deletions",type:_,lineIndex:z?.lineIndex}),ae=this.getSplitLineDecoration({side:"additions",type:_,lineIndex:P?.lineIndex});if(X==null&&te==null){const Q="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Q,{file:e.name}),new Error(Q)}const le=(()=>{if(_==="change"){if(te==null)return"additions";if(X==null)return"deletions"}})();le!=null?(S.side!=null&&S.side!==le&&S.flush(),S.side=le,S.increment()):_==="change"&&S.flush();const Ie=this.getAnnotations("split",z?.lineNumber,P?.lineNumber,I,ne);if(Ie!=null&&S.size>0&&S.flush(),z!=null){const Q=zt(X,Oe.contentProperties,c?{"data-line":z.lineNumber,"data-line-index":`${z.unifiedLineIndex},${U}`}:void 0);w("deletions",Oe.gutterLineType,z.lineNumber,`${z.unifiedLineIndex},${U}`,Oe.gutterProperties),Q!=null&&(X=Q)}if(P!=null){const Q=zt(te,ae.contentProperties,c?{"data-line":P.lineNumber,"data-line-index":`${P.unifiedLineIndex},${U}`}:void 0);w("additions",ae.gutterLineType,P.lineNumber,`${P.unifiedLineIndex},${U}`,ae.gutterProperties),Q!=null&&(te=Q)}Ot({diffStyle:"split",type:_,additionLine:te,deletionLine:X,...Ie,createAnnotationElement:Q=>this.createAnnotationElement(Q),context:C}),V?.after!=null&&Dn(V.after,C,S)}const Pe=r==="split"&&D!=null&&U===D.splitLineStart+D.splitLineCount-1,K=I===e.hunks.length-1&&D!=null&&(r==="split"?U===D.splitLineStart+D.splitLineCount-1:ee===D.unifiedLineStart+D.unifiedLineCount-1),Ge=Pe?D.noEOFCRDeletions:!1,nt=Pe?D.noEOFCRAdditions:!1,ce=(z?.noEOFCR??!1)||Ge,Se=(P?.noEOFCR??!1)||nt;if(Se||ce){if(r==="split"&&S.flush(),ce){const V=_==="context"||_==="context-expanded"?_:"change-deletion";r==="unified"?(C.unifiedContentAST.push(Mt(V)),C.pushToGutter("unified",ie(V,"metadata",1))):(C.deletionsContentAST.push(Mt(V)),C.pushToGutter("deletions",ie(V,"metadata",1)),Se||(C.pushToGutter("additions",ie(void 0,"buffer",1)),C.additionsContentAST.push(Ht(1))))}if(Se&&!(u&&ce&&_!=="change")){const V=_==="context"||_==="context-expanded"?_:"change-addition";r==="unified"?(C.unifiedContentAST.push(Mt(V)),C.pushToGutter("unified",ie(V,"metadata",1))):(C.additionsContentAST.push(Mt(V)),C.pushToGutter("additions",ie(V,"metadata",1)),ce||(C.pushToGutter("deletions",ie(void 0,"buffer",1)),C.deletionsContentAST.push(Ht(1))))}C.incrementRowCount(1)}h!=="simple"&&h!=="metadata"&&(G>0||K&&f)&&R({hunkIndex:_==="context-expanded"?I:I+1,collapsedLines:K&&f?"unknown":G,rangeSize:E,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:g}),C.incrementRowCount(1)}}),r==="split"&&S.flush();const L=Math.max(tl(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),H=t.bufferBefore>0||t.bufferAfter>0,x=!u&&e.type!=="deleted",A=!u&&e.type!=="new",T=C.rowCount>0||H;p=x&&T?p:void 0,m=A&&T?m:void 0,v=u&&T?v:void 0;const F=this.createPreElement(m!=null&&p!=null,L);return{fileDiff:e,unifiedGutterAST:u&&T?C.unifiedGutterAST.children:void 0,unifiedContentAST:v,deletionsGutterAST:A&&T?C.deletionsGutterAST.children:void 0,deletionsContentAST:m,additionsGutterAST:x&&T?C.additionsGutterAST.children:void 0,additionsContentAST:p,hunkData:k,preNode:F,themeStyles:n,baseThemeType:s,headerElement:o?void 0:this.renderHeader(e),totalLines:L,rowCount:C.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const i=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,n=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(i==null||n==null)return;const s=Xe(i);return s.properties.style=`grid-row: span ${t.rowCount}`,[s,zs(n,t.rowCount)]}renderFullAST(e,t=[]){const i=this.getOptionsWithDefaults().hunkSeparators==="line-info",n=this.renderCodeAST("unified",e);if(n!=null)return t.push(M({tagName:"code",children:n,properties:{"data-code":"","data-container-size":i?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const s=this.renderCodeAST("deletions",e);s!=null&&t.push(M({tagName:"code",children:s,properties:{"data-code":"","data-container-size":i?"":void 0,"data-deletions":""}}));const r=this.renderCodeAST("additions",e);return r!=null&&t.push(M({tagName:"code",children:r,properties:{"data-code":"","data-container-size":i?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Y(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?Y(e):Y(M({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,i,n){if(!oi(i))return;const s=e.type!=="new"?this.getAnnotationNames(Ri(this.deletionAnnotations)):[],r=e.type!=="deleted"?this.getAnnotationNames(Ri(this.additionAnnotations)):[];if(s.length===0&&r.length===0)return;const o=-1,a=-1,{createAnnotationElement:l}=this;if(t==="unified"){Ot({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:o,lineIndex:a,annotations:s.concat(r)},createAnnotationElement:l,context:n});return}Ot({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:o,lineIndex:a,annotations:s},additionSpan:{type:"annotation",hunkIndex:o,lineIndex:a,annotations:r},createAnnotationElement:l,context:n})}getAnnotations(e,t,i,n,s){const r={type:"annotation",hunkIndex:n,lineIndex:s,annotations:[]};if(t!=null)for(const a of this.deletionAnnotations[t]??[])r.annotations.push(this.annotationSlotName(a));const o={type:"annotation",hunkIndex:n,lineIndex:s,annotations:[]};if(i!=null)for(const a of this.additionAnnotations[i]??[])(e==="unified"?r:o).annotations.push(this.annotationSlotName(a));if(e==="unified")return r.annotations.length>0?r:void 0;if(!(o.annotations.length===0&&r.annotations.length===0))return{deletionSpan:r,additionSpan:o}}getAnnotationNames(e){return e?.map(t=>this.annotationSlotName(t))??[]}renderHeader(e){const{headerRenderMode:t,stickyHeader:i}=this.getOptionsWithDefaults();return Es({fileOrDiff:e,mode:t,stickyHeader:i})}};const ql=new Intl.PluralRules("en-US");function Gl(e){return`${e} unmodified line${ql.select(e)==="one"?"":"s"}`}function Mn(e,t){for(const i of e)t.unifiedContentAST.push(i.content),t.pushToGutter("unified",i.gutter),t.incrementRowCount(1)}function Dn(e,t,i){for(const{deletion:n,addition:s}of e){if(n==null&&s==null)continue;const r=n!=null&&s!=null?void 0:n==null?"deletions":"additions";(r==null||i.side!==r)&&i.flush(),n!=null&&(t.deletionsContentAST.push(n.content),t.pushToGutter("deletions",n.gutter)),s!=null&&(t.additionsContentAST.push(s.content),t.pushToGutter("additions",s.gutter)),r!=null&&(i.side=r,i.increment()),t.incrementRowCount(1)}}function Ot({diffStyle:e,type:t,deletionLine:i,additionLine:n,unifiedSpan:s,deletionSpan:r,additionSpan:o,createAnnotationElement:a,context:l}){let d=!1;if(e==="unified"){if(n!=null?l.unifiedContentAST.push(n):i!=null&&l.unifiedContentAST.push(i),s!=null){const h=t==="change"?i!=null?"change-deletion":"change-addition":t;l.unifiedContentAST.push(a(s)),l.pushToGutter("unified",ie(h,"annotation",1)),d=!0}}else if(e==="split"){if(i!=null&&l.deletionsContentAST.push(i),n!=null&&l.additionsContentAST.push(n),r!=null){const h=t==="change"?i!=null?"change-deletion":"context":t;l.deletionsContentAST.push(a(r)),l.pushToGutter("deletions",ie(h,"annotation",1)),d=!0}if(o!=null){const h=t==="change"?n!=null?"change-addition":"context":t;l.additionsContentAST.push(a(o)),l.pushToGutter("additions",ie(h,"annotation",1)),d=!0}}d&&l.incrementRowCount(1)}function mi(e,{hunkIndex:t,collapsedLines:i,rangeSize:n,hunkSpecs:s,isFirstHunk:r,isLastHunk:o,isExpandable:a},l){if(typeof i=="number"&&i<=0)return;const d=e==="unified"?l.unifiedContentAST:e==="deletions"?l.deletionsContentAST:l.additionsContentAST;if(l.hunkSeparators==="metadata"){s!=null&&(l.pushToGutter(e,Ke({type:"metadata",content:s,isFirstHunk:r,isLastHunk:o})),d.push(Ke({type:"metadata",content:s,isFirstHunk:r,isLastHunk:o})),e!=="additions"&&l.incrementRowCount(1));return}if(l.hunkSeparators==="simple"){t>0&&(l.pushToGutter(e,Ke({type:"simple",isFirstHunk:r,isLastHunk:!1})),d.push(Ke({type:"simple",isFirstHunk:r,isLastHunk:!1})),e!=="additions"&&l.incrementRowCount(1));return}const h=el(e,t),c=n>l.expansionLineCount,u=a?t:void 0,f=typeof i=="number"?Gl(i):"More unchanged context may be available";l.pushToGutter(e,Ke({type:l.hunkSeparators,content:f,expandIndex:u,chunked:c,slotName:h,isFirstHunk:r,isLastHunk:o})),d.push(Ke({type:l.hunkSeparators,content:f,expandIndex:u,chunked:c,slotName:h,isFirstHunk:r,isLastHunk:o})),e!=="additions"&&l.incrementRowCount(1),l.hunkData.push({slotName:h,hunkIndex:t,lines:typeof i=="number"?i:0,lineCountKnown:typeof i=="number",type:e,expandable:a?{up:!r,down:!o,chunked:c}:void 0})}function zt(e,t,i){return e==null||e.type!=="element"||t==null&&i==null?e:{...e,properties:{...e.properties,...t,...i}}}function Fn(e){return e.length>0&&e[e.length-1]===""?e.length-1:e.length}function jl(e,t,i,n){const s=Fn(e),r=Fn(t),o=Math.min(s,r);let a=0;for(;at}function Xl(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function Ql(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Zl(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}async function Pi(e,t=300){let i;try{await Promise.race([e(),new Promise(n=>{i=setTimeout(n,t)})])}finally{i!=null&&clearTimeout(i)}}function Oi({oldFile:e,newFile:t},i){if(!(e===void 0&&t===void 0)){if(e===void 0||t===void 0)throw new Error(`${i}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw new Error(`${i}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return t===null?{oldFile:e,newFile:t}:{oldFile:e,newFile:t}}}function Jl(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:Js(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,parseDiffOptions:e?.parseDiffOptions,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Si(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}function ed(e){const t={...e};return delete t.cacheKey,t}function Pn(e,t){if(e.isPartial||t.isPartial)throw new Error("FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated");const i=e.lang??j(e.name),n=t.lang??j(t.name),s=e.type!=="new",r=t.type!=="new";return e.name!==t.name||i!==n||s!==r||e.deletionLines.length!==t.deletionLines.length?!0:e.deletionLines.some((o,a)=>o!==t.deletionLines[a])}function td(e,t){return e.length===t.length&&e.every((i,n)=>i===t[n])}function id(e,t){const{oldFile:i}=e;return i==null?t.type==="new":t.type!=="new"&&i.name===(t.prevName??t.name)&&td(i.lines,t.deletionLines)}let nd=-1;var sd=class{options;workerManager;requestOwnerRender;static LoadedCustomComponent=!0;__id=`file-diff:${++nd}`;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;get lineAnnotations(){return this.renderedData?.lineAnnotations??as}managersDirty=!1;deletionFile;additionFile;fileDiff;editSession;renderedData;pendingData;forceRenderOverride;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:q},t,i){this.options=e,this.workerManager=t,this.requestOwnerRender=i,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new Ls,this.scrollSyncManager=new Ja,this.interactionManager=new ks("diff",Xt(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??q}getHunksRendererOptions(e){return Jl(e)}createHunksRenderer(e){return new $l(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,i){if(e==null)return;const n=e.hunks.at(-1);let s,r;e:for(const o of e.hunks){const a=i==="deletions"?o.deletionStart:o.additionStart,l=i==="deletions"?o.deletionCount:o.additionCount;let d=oe(a,l)+1,h=o.splitLineStart,c=o.unifiedLineStart;if(t=d+l){if(o===n){const u=t-(d+l);s=c+o.unifiedLineCount+u,r=h+o.splitLineCount+u;break e}continue}for(const u of o.hunkContent)if(u.type==="context")if(tthis.interactionManager.getHoveredLine();getAnnotationSlotName=e=>Zs(this.editSession?.annotations,e,ge);getLatestAnnotations(){return this.pendingData?.lineAnnotations??this.editSession?.annotations?.current??this.lineAnnotations}getAnnotationsForDiff(e){const{pendingData:t}=this;return t!=null&&N(e,t.fileDiff)?t.lineAnnotations:this.lineAnnotations}isNewAnnotations(e){const t=this.editSession?.annotations;return e===this.getLatestAnnotations()?!1:t==null||e!==t.provided&&e!==t.current}setLineAnnotations(e){const t=this.editSession?.annotations;if(t!=null){if(!this.isNewAnnotations(e))return;Qs(t,e,ge)}const i=this.getWorkingDiff();i!=null&&(this.pendingData={fileDiff:i,lineAnnotations:e})}syncEditSessionAnnotationsFromEditor(e){const t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.renderedData!=null&&(this.renderedData.lineAnnotations=e),this.pendingData=void 0,this.hunksRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}canPartiallyRender(e,t,i){return!(e||t||i||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.lineAnnotations.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;pt(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.isComponentManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.renderedData=void 0,this.pendingData=void 0),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre?.remove(),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?.remove(),this.headerElement=void 0,this.clearHeaderSlots(),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.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:i=!1,lineAnnotations:n,fileDiff:s,...r}){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 o=Oi(r,"FileDiff.hydrate"),a=o?.oldFile,l=o?.newFile;this.hydrateElements(e,t);const d=this.editor!=null;d||ld(this.pre,od({fileDiff:s,oldFile:a,newFile:l}),this.options.collapsed)||dd(this.headerElement,ad({fileDiff:s,oldFile:a,newFile:l}),this.options.disableFileHeader)?this.render({...r,fileContainer:e,lineAnnotations:n,fileDiff:s,forceRender:d||r.forceRender,preventEmit:!0}):this.hydrationSetup({fileDiff:s,lineAnnotations:n,...o}),i||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Ks(e,t);for(const i of e.shadowRoot?.children??[]){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i;for(const n of i.children)!(n instanceof HTMLElement)||n.tagName.toLowerCase()!=="code"||("deletions"in n.dataset&&(this.codeDeletions=n),"additions"in n.dataset&&(this.codeAdditions=n),"unified"in n.dataset&&(this.codeUnified=n));continue}if("diffsHeader"in i.dataset){this.headerElement=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-theme-css")){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.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:i,lineAnnotations:n}){const s=n??this.getLatestAnnotations();this.pendingData=void 0,this.additionFile=i,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&i!==void 0?We(t,i,this.options.parseDiffOptions):void 0),this.renderedData=this.fileDiff!=null?{fileDiff:this.fileDiff,lineAnnotations:s}:void 0,this.fileDiff!=null&&this.adoptRenderData(this.fileDiff),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.getInputDiff()==null&&this.additionFile==null&&this.deletionFile==null||this.requestRender()||this.render({forceRender:!0,renderRange:this.renderRange})}requestRender(){const{requestOwnerRender:e}=this;return this.editSession!=null||e==null?!1:(this.forceRenderOverride=!0,e(),!0)}get isComponentManaged(){return this.requestOwnerRender!=null}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,i)=>{this.expandHunk(e,t,i)};expandHunk=(e,t,i)=>{this.loadFilesIfNecessary(),this.hunksRenderer.expandHunk(e,t,i),this.rerender()};loadFilesIfNecessary(){const e=this.getInputDiff(),{loadDiffFiles:t}=this.options;if(e==null||!Si(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 i=this.loadFilesForDiff(e,t),n=this.pendingFiles={fileDiff:e,promise:i},s=()=>{this.pendingFiles===n&&(this.pendingFiles=void 0)};n.promise=i.finally(s)}__canAttachEditor(){const e=this.getInputDiff();return e!=null&&!e.isPartial}async prepareForEditing(){if(this.__canAttachEditor())return;const e=this.__prepareForEditing();if(e==null){const t=this.getInputDiff();throw t?.isPartial===!0&&!Si(t)?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())return;const e=this.getInputDiff();if(e?.isPartial===!0&&!Si(e))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 i=await t(e);if(this.getInputDiff()!==e)return;await this.handleFilesLoaded(e,i)}catch(i){if(this.options.disableErrorHandling===!0)throw i;console.error(i)}}async handleFilesLoaded(e,t){if(!(this.getInputDiff()!==e||!e.isPartial)){if(Ai("merge",e,t,this.options.parseDiffOptions),this.setHydratedState(t),this.installHydratedSessionDiff(e)){this.rerender();return}await Pi(()=>this.primeHighlightCache(e)),!(!this.enabled||this.getInputDiff()!==e)&&this.rerender()}}installHydratedSessionDiff(e){if(e.isPartial)throw new Error("FileDiff.installHydratedSessionDiff: diffs cannot be partial for editing");return this.getInputDiff()!==e?!1:this.editSession?.outgoingDiff!=null?(this.installEditSession(e),!0):!1}updateInputDiff(e,t){if(N(this.getInputDiff(),e))return!1;const i=this.getLatestAnnotations();this.fileDiff=e;const{editSession:n}=this,s=n?.outgoingDiff??n?.diff;return n!=null&&(e.isPartial?n.inputDiff=e:this.installEditSession(e),this.editSession!=null&&(this.editSession.outgoingDiff=s)),this.editSession?.annotations!=null&&t!=null&&(this.editSession.annotations=Zt(t,ge,this.editSession.annotations)),this.pendingData={fileDiff:this.editSession?.diff??e,lineAnnotations:this.editSession?.annotations?.current??t??i},s!=null&&e.isPartial&&this.loadFilesIfNecessary(),!0}installEditSession(e,t,i){const n=e.additionLines.join(""),s=t!=null?ti(t.contents):void 0,r=i!=null&&id(i,e);if(i!=null&&!r)throw new Error("FileDiff: retained session cannot resume against a different old file");if(t!=null&&t.contents!==n&&!r)throw new Error("FileDiff: retained edits are missing their diff session state");const o=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===n,a=ed(e);t!=null&&s!=null&&!o&&(a.name=t.name,a.lang=t.lang),r&&i!=null&&t!=null&&s!=null&&(a.additionLines=s,a.additionCharacterCount=t.contents.length,a.type=i.type,a.hunks=i.hunks,a.editSessionDirty=!0,li(a));const l=this.editSession?.annotations??Zt(this.getLatestAnnotations(),ge);this.editSession={diff:a,inputDiff:e,annotations:l,outgoingDiff:this.editSession?.outgoingDiff},this.pendingData={fileDiff:a,lineAnnotations:l.current},this.hunksRenderer.beginEditSession(a,o&&!r?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:i=!1,preventEmit:n=!1,lineAnnotations:s,fileContainer:r,containerWrapper:o,renderRange:a,...l}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");i=this.forceRenderOverride??i,this.forceRenderOverride=void 0;const d=Oi(l,"FileDiff.render"),h=d?.oldFile,c=d?.newFile;this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:u=!1,themeType:f="system",expandUnchanged:g=!1}=this.options,p=u?void 0:a,m=this.hasThemeChanged(),v=d!=null,k=v&&(!On(h,this.deletionFile)||!On(c,this.additionFile));let y=e!=null&&!N(e,this.getInputDiff());const b=s!=null&&(s.length>0||this.getLatestAnnotations().length>0)?this.isNewAnnotations(s):!1;if(!u&&ri(p,this.renderRange)&&!i&&!b&&!m&&(e!=null&&!y||e==null&&!k)){const L=this.applyCachedThemeState(f);return L&&this.finalizeRender(),L}let C;e==null&&v&&(k||this.getInputDiff()==null)&&(C=We(d.oldFile,d.newFile,this.options.parseDiffOptions));const{renderRange:E}=this;this.renderRange=p,v?(this.deletionFile=h,this.additionFile=c):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e!=null&&y?this.updateInputDiff(e,s):C!=null&&(y=!0,this.updateInputDiff(C,s)),y&&this.clearReusableHeader(),s!=null&&this.setLineAnnotations(s);const S=this.getWorkingDiff();if(S==null)return!1;S.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(Tn(S,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),g&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.prepareRenderData(this.hunksRenderer.getDiffForNextRender(S));const{disableErrorHandling:w=!1,disableFileHeader:R=!1}=this.options;if(R&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.headerCache.lastRenderedHTML=void 0),this.clearHeaderSlots()),r=this.getOrCreateFileContainer(r,o),this.applyCachedThemeState(f),u){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const L=this.hunksRenderer.renderDiff(S,ls);L!=null&&this.applyThemeState(r,L.themeStyles,f,L.baseThemeType),L?.headerElement!=null&&this.applyHeaderToDOM(L.headerElement,r,L.fileDiff),this.renderSeparators([]),this.adoptRenderData(L?.fileDiff??S),this.injectUnsafeCSS()}catch(L){if(w)throw L;console.error(L),L instanceof Error&&this.applyErrorToDOM(L,r)}return this.finalizeRender(),n||this.emitPostRender(),!0}try{const L=this.getOrCreatePreNode(r);if(this.canPartiallyRender(i,b,k||y||m||!N(this.getRenderedDiff(),S))&&this.applyPartialRender({fileDiff:S,previousRenderRange:E,renderRange:p})){const H=this.getRenderedDiff();H!=null&&this.adoptRenderData(H)}else{const H=this.hunksRenderer.renderDiff(S,p);if(H==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(r,H.themeStyles,f,H.baseThemeType),H.headerElement!=null&&this.applyHeaderToDOM(H.headerElement,r,H.fileDiff),H.additionsContentAST!=null||H.deletionsContentAST!=null||H.unifiedContentAST!=null?this.applyHunksToDOM(L,H):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(H.hunkData),this.adoptRenderData(H.fileDiff)}this.applyBuffers(L,p),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(L){if(w)throw L;console.error(L),L instanceof Error&&this.applyErrorToDOM(L,r)}return n||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:i}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,"unmount");return}if(t==null)return;const n=this.mounted?"update":"mount";this.mounted=!0,i?.(t,this,n)}getInputDiff(){return this.fileDiff}getWorkingDiff(e=this.fileDiff){return this.editSession?.diff??e}getRenderedDiff(){return this.renderedData?.fileDiff}__getNextRenderData({fileDiff:e,lineAnnotations:t}){const i=this.editSession?.annotations;if(i!=null)return{fileDiff:e,lineAnnotations:t!=null&&this.isNewAnnotations(t)?t:i.provided};const n=this.getWorkingDiff(e)??e,s=this.hunksRenderer.getDiffForNextRender(n);return{fileDiff:s,lineAnnotations:t!=null&&N(s,n)?t:this.getAnnotationsForDiff(s)}}prepareRenderData(e){this.hunksRenderer.setLineAnnotations(this.getAnnotationsForDiff(e))}adoptRenderData(e){const{pendingData:t}=this,i=t!=null&&N(e,t.fileDiff);this.renderedData={fileDiff:e,lineAnnotations:i?t.lineAnnotations:this.lineAnnotations},i&&(this.pendingData=void 0)}syncRenderViewToEditor(){const{editor:e,fileContainer:t}=this,i=this.getLatestAnnotations(),n=this.computeEditorRenderRange(this.renderRange),s=this.getWorkingDiff();if(e==null||t==null||s==null||s.isPartial)return;const r=d=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.getWorkingDiff()!==s)return;const h=this.editSession?.outgoingDiff,c=this.getInputDiff(),u=h!=null&&c!=null&&h!==s,f=u&&h!=null&&c!=null?Pn(h,c):!1;e.__syncRenderView({highlighter:d,fileContainer:t,fileDiff:s,lineAnnotations:i,renderRange:n,externalDocument:u,resetHistory:f})},o=this.getTheme(),a=s.lang??j(s.name),l=$({theme:o,lang:a});l!=null?r(l):it({themes:fe(o),langs:["text",a],preferredHighlighter:Ct(this.workerManager,this.options)}).then(r).catch(d=>{d instanceof ve||console.error(d)})}computeEditorRenderRange(e){const t=this.getWorkingDiff();if(e==null||t==null||Qt(e))return e;const{diffStyle:i="split",expandUnchanged:n=!1,collapsedContextThreshold:s=1}=this.options;let r,o;return Ve({diff:t,diffStyle:i,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({additionLine:a})=>{a!=null&&(r??=a.lineNumber,o=a.lineNumber)}}),r==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:r-1,totalLines:o-r+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){const t=this.getInputDiff();let{diff:i,outgoingDiff:n}=this.editSession??{};if(n!=null&&t!=null){if(!t.isPartial&&Pn(n,t))return;i=n}if(!(i==null||i.isPartial))return{diffSession:{oldFile:i.type!=="new"?{name:i.prevName??i.name,lines:e?[...i.deletionLines]:i.deletionLines}:null,type:i.type,hunks:e?nr(i.hunks):i.hunks},hasChanges:i.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(i){throw t(),i}}__resumeEditor(e){if(this.editor!==e)throw new Error("FileDiff.__resumeEditor: editor association changed");this.resumeEditorRendering(e)}resumeEditorRendering(e){const t=this.getInputDiff(),i=this.editSession?.outgoingDiff;i!=null&&t!=null&&!t.isPartial&&this.editSession?.diff===i&&this.installEditSession(t);const n=this.editSession==null&&t!=null&&!t.isPartial?t:void 0;n!=null?this.installEditSession(n,e.__getDocumentContents(rd(n)),e.__getDocumentSessionState()):this.editSession!=null&&this.hunksRenderer.beginEditSession(this.editSession.diff),this.editor=e,this.getInputDiff()?.isPartial===!0&&this.loadFilesIfNecessary();const s=this.editSession?.diff;this.hunksRenderer.editorRenderReady()?(s!=null&&this.hunksRenderer.diffCache===s&&this.adoptRenderData(s),this.syncRenderViewToEditor()):this.rerender()}finishEditSession(){this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks()}__completeEditSession(e,t){this.settleEditSession(t==="install",e)}settleEditSession(e,t){const{editSession:i}=this;if(i==null)return;const{diff:n,inputDiff:s,annotations:r}=i,o=r?.provided??this.lineAnnotations;if(this.editor!=null)throw new Error("FileDiff.__completeEditSession: detach the editor before completing the session");this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks();const a=r?.current;let l,d=null,h=null,c=!1,u;if(t==null)throw new Error("FileDiff.__completeEditSession: editor is required for completion");const f=sr(n),g={name:f.name,contents:f.additionLines.join("")};f.lang!=null&&(g.lang=f.lang);const p={fileDiff:f,editor:t,originalFileDiff:s,oldFile:f.type==="new"?null:{name:f.prevName??f.name,contents:f.deletionLines.join("")},newFile:g,lineAnnotations:a,originalLineAnnotations:o};Object.freeze(p);try{if(t.__emitEditComplete(p),this.options.onEditComplete?.(p)==="accept"){if(f.cacheKey!=null&&f.cacheKey===s.cacheKey)throw new Error("FileDiff.__completeEditSession: an accepted diff must not reuse the replaced diff cacheKey");l=f,d=p.oldFile,h=p.newFile}}catch(m){c=!0,u=m}if(e&&l!=null&&this.additionFile!=null&&(this.deletionFile=d,this.additionFile=h),this.editSession=void 0,this.fileDiff=e&&l!=null?l:s,this.pendingData={fileDiff:this.fileDiff,lineAnnotations:e&&l!=null?a??o:o},e&&this.fileContainer!=null&&this.rerender(),c)throw u}finalizeEditSessionHunks(){const e=this.getWorkingDiff();if(e==null||e.editSessionDirty!==!0)return!1;const{collapsedContextThreshold:t=1}=this.options,i=Hl(e,this.hunksRenderer.getExpandedHunksMap(),t);return Tn(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(Ml(e,i)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){const i=this.editSession?.diff;if(i==null)throw new Error("FileDiff.applyDocumentChange: requires an active edit session");this.detachAdditionLines(),this.hunksRenderer.beginEditSession(i),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,i={}){const n=this.editSession?.diff;if(n==null)throw new Error("FileDiff.updateRenderCache: requires an active edit session");this.detachAdditionLines(),this.hunksRenderer.beginEditSession(n);const{shouldRefreshDiffsView:s,lineCountChangeInFlight:r}=i;if(this.hunksRenderer.updateRenderCache(e,t,r,i.changedDocumentLines,i.documentLineCount)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}s===!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{diff:e,inputDiff:t}=this.editSession??{};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:i=!1,collapsedContextThreshold:n=1}=this.options;return fr({fileDiff:t,lineNumber:e,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n})}getNearestRenderableLine(e,t){const i=this.getRenderedDiff();if(i==null)return e;const{expandUnchanged:n=!1,collapsedContextThreshold:s=1}=this.options;return nl({fileDiff:i,lineNumber:e,direction:t,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s})}revealLine(e){const t=this.getRenderedDiff(),{expandUnchanged:i=!1,collapsedContextThreshold:n=1,expansionLineCount:s=100}=this.options;if(t==null||t.isPartial||i)return!1;const r=this.hunksRenderer.getExpandedHunksMap();for(const[d,h]of t.hunks.entries()){const[c,u]=yt(h);if(e=c-f.fromEnd)return!1;const p=e-(g+f.fromStart)+1,m=c-f.fromEnd-e;return p<=m?this.expandHunk(d,"up",p+s):this.expandHunk(d,"down",m+s),!0}if(e=l+o.rangeSize?!1:(this.expandHunk(t.hunks.length,"up",e-(l+o.fromStart)+1+s),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){qi(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.getInputDiff()){const{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Be(e))return;const i=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>i||await t.primeDiffHighlightCache(e).catch(n=>{ai(n)||console.error(n)})}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.isComponentManaged||this.fileContainer==null||typeof t!="function"){for(const{element:n}of this.separatorCache.values())n.remove();this.separatorCache.clear();return}const i=new Map(this.separatorCache);for(const n of e){const s=n.slotName;let r=this.separatorCache.get(s);if(r==null||!Zl(n,r.hunkData)){r?.element.remove();const o=document.createElement("div");o.style.display="contents",o.slot=n.slotName;const a=t(n,this);a!=null&&o.appendChild(a),this.fileContainer.appendChild(o),r={element:o,hunkData:n},this.separatorCache.set(s,r)}i.delete(s)}for(const[n,{element:s}]of i.entries())this.separatorCache.delete(n),s.remove()}renderAnnotations(){if(this.isComponentManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderedData:t,options:{renderAnnotation:i}}=this;if(i!=null&&t!=null){const{fileDiff:n,lineAnnotations:s}=t;for(const[r,o]of s.entries()){const a=this.getAnnotationSlotName(o),l=`${r}-${a}`;let d=this.annotationCache.get(l);if(d==null||d.fileDiff!==n||!Ql(o,d.annotation)){d?.element.remove();const h=i(o,n);if(h==null)continue;d={element:Bs(a),annotation:o,fileDiff:n},d.element.appendChild(h),this.fileContainer.appendChild(d.element),this.annotationCache.set(l,d)}e.delete(l)}}for(const[n,{element:s}]of e.entries())this.annotationCache.delete(n),s.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 i=Vs();i.appendChild(t),this.fileContainer.appendChild(i),this.gutterUtilityContent=i}getOrCreateFileContainer(e,t){const{fileContainer:i}=this,n=e??i??document.createElement("diffs-container"),s=i!==n;return i!=null&&s&&this.editor?.__captureFocusForDOMReplacement(),s&&this.emitPostRender(!0),this.fileContainer=n,i!=null&&s&&(this.headerCache.lastRenderedHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),s&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const i of t.children)i instanceof SVGElement?this.spriteSVG??=i:vt(i)&&i.hasAttribute("data-theme-css")?(this.themeCSSStyle??=i,this.hasAdoptedThemeCSS=!0):vt(i)&&i.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=i,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const i=document.createElement("div");i.innerHTML=Ns;const n=i.firstChild;n instanceof SVGElement&&(this.spriteSVG=n)}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,i){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const{headerCache:{fileDiff:n,html:s,lastRenderedHTML:r}}=this,o=(i!==this.editSession?.diff&&N(n,i)?s:void 0)??Y(e);if(this.headerCache.html=o,this.headerCache.fileDiff=i,o!==r){const g=document.createElement("div");g.innerHTML=o;const p=g.firstElementChild;if(!(p instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(p,this.headerElement):t.shadowRoot?.prepend(p),this.headerElement=p,this.headerCache.lastRenderedHTML=o}if(this.isComponentManaged)return;const{renderCustomHeader:a,renderHeaderPrefix:l,renderHeaderFilenameSuffix:d,renderHeaderMetadata:h}=this.options;if(a!=null){const g=a(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Ui,g),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}const c=l?.(i)??void 0,u=d?.(i)??void 0,f=h?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,_i,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Bi,u),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Vi,f),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,i,n){if(n==null){t?.remove();return}const s=t??this.createHeaderSlotElement(i);return t==null&&e.appendChild(s),this.replaceHeaderSlotContent(s,n),s}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;this.pre?.toggleAttribute("data-custom-styles",!!e);const 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??=Us(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=qs(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,i,n){const s=e.shadowRoot??e.attachShadow({mode:"open"}),r=n??i,o=this.getTheme(),a=typeof o=="string"?o:{...o},l=mt(s);if(this.themeCSSStyle?.parentNode===s&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===r&&this.appliedThemeCSS.scrollbarGutter===l){this.appliedThemeCSS.theme=a;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===s){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:a,themeStyles:t,themeType:r,baseThemeType:n,scrollbarGutter:l};return}this.themeCSSStyle=er({shadowRoot:s,currentNode:this.themeCSSStyle,themeCSS:Gs(t,r,l)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:a,themeStyles:t,themeType:r,baseThemeType:n,scrollbarGutter:l}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=js(this.themeCSSStyle.textContent??"",mt(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Xs()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?Ti(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,i){const n=this.getColumnPair(e);if(n==null)return!1;const s=He(t[0]),r=He(t[1]);return s==null||r==null?!1:(n.gutter.innerHTML=Y(s),n.content.innerHTML=Y(r),i!==this.lastRowCount&&(n.gutter.style.setProperty("grid-row",`span ${i}`),n.content.style.setProperty("grid-row",`span ${i}`)),!0)}replaceCodeColumns(e,t){const{overflow:i="scroll"}=this.options,n=(this.options.hunkSeparators??"line-info")==="line-info",s=i==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let r=!1;const o=[],a=this.hunksRenderer.renderCodeAST("unified",t),l=this.hunksRenderer.renderCodeAST("deletions",t),d=this.hunksRenderer.renderCodeAST("additions",t);this.editor?.__captureFocusForDOMReplacement(),a!=null?(r=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=Wt({code:this.codeUnified,columnType:"unified",rowSpan:s,containerSize:n}),this.applyCodeColumnsInPlace(this.codeUnified,a,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(a)),o.push(this.codeUnified)):l!=null||d!=null?(l!=null?(r=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Wt({code:this.codeDeletions,columnType:"deletions",rowSpan:s,containerSize:n}),this.applyCodeColumnsInPlace(this.codeDeletions,l,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),d!=null?(r=r||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Wt({code:this.codeAdditions,columnType:"additions",rowSpan:s,containerSize:n}),this.applyCodeColumnsInPlace(this.codeAdditions,d,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(d)),o.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),o.length===0?e.textContent="":r&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({fileDiff:e,previousRenderRange:t,renderRange:i}){const{pre:n,codeUnified:s,codeAdditions:r,codeDeletions:o,options:{diffStyle:a="split"}}=this;if(n==null||t==null||i==null||!Number.isFinite(t.totalLines)||!Number.isFinite(i.totalLines)||this.lastRowCount==null)return!1;const l=this.getCodeColumns(a,s,o,r);if(l==null)return!1;const d=t.startingLine,h=i.startingLine,c=d+t.totalLines,u=h+i.totalLines,f=Math.max(d,h),g=Math.min(c,u);if(g<=f)return!1;const p=Math.max(0,f-d),m=Math.max(0,c-g),v=this.trimColumns({columns:l,trimStart:p,trimEnd:m,previousStart:d,overlapStart:f,overlapEnd:g,diffStyle:a});if(v<0)throw new Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount{if(!(w<=0))return this.hunksRenderer.renderDiff(e,{startingLine:S,totalLines:w,bufferBefore:0,bufferAfter:0})},b=y(h,Math.max(f-h,0));if(b==null&&hg)return!1;const E=(S,w)=>{if(S!=null){if(a==="unified"&&!Array.isArray(l))this.insertPartialHTML(a,l,S,w);else if(a==="split"&&Array.isArray(l))this.insertPartialHTML(a,l,S,w);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");k+=S.rowCount,this.adoptRenderData(S.fileDiff)}};return this.cleanupErrorWrapper(),E(b,"afterbegin"),E(C,"beforeend"),this.lastRowCount!==k&&(this.applyRowSpan(a,l,k),this.lastRowCount=k),!0}insertPartialHTML(e,t,i,n){if(e==="unified"&&!Array.isArray(t)){const s=this.hunksRenderer.renderCodeAST("unified",i);this.renderPartialColumn(t,s,n)}else if(e==="split"&&Array.isArray(t)){const s=this.hunksRenderer.renderCodeAST("deletions",i),r=this.hunksRenderer.renderCodeAST("additions",i);this.renderPartialColumn(t[0],s,n),this.renderPartialColumn(t[1],r,n)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}refreshSplitDiffView(){const e=this.getWorkingDiff();if(this.options.diffStyle!=="split"||e==null)return;const t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;const i=this.getCodeColumns("split",this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(i))return;const n=(s,r)=>{if(r==null)return;const o=this.hunksRenderer.renderCodeAST(s,t),a=He(o?.[0]),l=He(o?.[1]);for(const[d,h]of[[r.gutter,a],[r.content,l]])if(h!=null&&d.childElementCount===h.length)for(let c=0;c{for(const[a,l]of[[i.gutter,s],[i.content,r]])l!=null&&(a.innerHTML=Y(l));t.rowCount!==this.lastRowCount&&(this.applyRowSpan("unified",i,t.rowCount),this.lastRowCount=t.rowCount),this.adoptRenderData(t.fileDiff)};this.shouldGuardRebuildScroll()?Ti(this.pre,o):o(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,i){if(e==null||t==null)return;const n=He(t[0]),s=He(t[1]);if(n==null||s==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const r=s.at(0);i==="beforeend"&&r?.type==="element"&&typeof r.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(r.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],n,s,!0);const o=s.at(-1);i==="afterbegin"&&o?.type==="element"&&typeof o.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],n,s,!1),e.gutter.insertAdjacentHTML(i,this.hunksRenderer.renderPartialHTML(n)),e.content.insertAdjacentHTML(i,this.hunksRenderer.renderPartialHTML(s))}mergeBuffersIfNecessary(e,t,i,n,s,r){if(!(t instanceof HTMLElement)||!(i instanceof HTMLElement))return;const o=this.getBufferSize(t.dataset);o!=null&&(r?(n.shift(),s.shift()):(n.pop(),s.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(i,o+e))}applyRowSpan(e,t,i){const n=s=>{s!=null&&(s.gutter.style.setProperty("grid-row",`span ${i}`),s.content.style.setProperty("grid-row",`span ${i}`))};if(e==="unified"&&!Array.isArray(t))n(t);else if(e==="split"&&Array.isArray(t))n(t[0]),n(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,i){let n=0,s=0,r=0,o=!1;const a=i>=0;if(e==null)return 0;const l=Array.from(e.content.children),d=Array.from(e.gutter.children);if(l.length!==d.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;r0||a&&n>=i)&&(h.remove(),c.remove(),t>0&&(t--,t===0&&(o=!0)),s++),n++;continue}if("separator"in h.dataset&&"separator"in c.dataset){(t>0||a&&n>=i)&&(h.remove(),c.remove(),s++);continue}if(h.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in c.dataset){(t>0||a&&n>=i)&&(h.remove(),c.remove(),s++);continue}if(h.dataset.gutterBuffer==="metadata"&&"noNewline"in c.dataset){(t>0||a&&n>=i)&&(h.remove(),c.remove(),s++);continue}if(h.dataset.gutterBuffer==="buffer"&&"contentBuffer"in c.dataset){const u=this.getBufferSize(c.dataset);if(u==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){const f=Math.min(t,u),g=u-f;g>0?(this.updateBufferSize(h,g),this.updateBufferSize(c,g),s+=f):(h.remove(),c.remove(),s+=u),t-=f,t===0&&g===0&&(o=!0)}else if(a){const f=n,g=n+u-1;if(i<=f)h.remove(),c.remove(),s+=u;else if(i<=g){const p=g-i+1,m=u-p;this.updateBufferSize(h,m),this.updateBufferSize(c,m),s+=p}}n+=u;continue}throw console.error({gutterElement:h,contentElement:c}),new Error("FileDiff.trimColumnRows: unknown row elements")}return s}trimColumns({columns:e,diffStyle:t,overlapEnd:i,overlapStart:n,previousStart:s,trimEnd:r,trimStart:o}){const a=Math.max(0,n-s),l=i-s;if(l<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const d=o>0,h=r>0;if(!d&&!h)return 0;const c=d?a:0,u=h?l:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,c,u);if(t==="split"&&Array.isArray(e)){const f=this.trimColumnRows(e[0],c,u),g=this.trimColumnRows(e[1],c,u);if(e[0]!=null&&e[1]!=null&&f!==g)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?f:g}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],i=e.children[1];if(!(!(t instanceof HTMLElement)||!(i instanceof HTMLElement)||t.dataset.gutter==null||i.dataset.content==null))return{gutter:t,content:i}}getCodeColumns(e,t,i,n){if(e==="unified")return this.getColumnPair(t);{const s=this.getColumnPair(i),r=this.getColumnPair(n);return s!=null||r!=null?[s,r]: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:i,totalLines:n},s){const{diffIndicators:r="bars",disableBackground:o=!1,disableLineNumbers:a=!1,overflow:l="scroll",diffStyle:d="split"}=this.options,h={type:"diff",diffIndicators:r,disableBackground:o,disableLineNumbers:a,overflow:l,split:d==="unified"?!1:t!=null&&i!=null,totalLines:n,customProperties:s};_s(h,this.appliedPreAttributes)||(Ys(e,h),this.appliedPreAttributes=h)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const i=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",i.appendChild(this.errorWrapper);const n=document.createElement("div");n.dataset.errorMessage="",n.innerText=e.message,this.errorWrapper.appendChild(n);const s=document.createElement("pre");s.dataset.errorStack="",s.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(s)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function rd(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join("")}}function On(e,t){return e==null||t==null?e==null&&t==null:Zi(e,t)}function od({fileDiff:e,oldFile:t,newFile:i}){return e!=null&&e.hunks.length>0||t!=null||i!=null}function ad({fileDiff:e,oldFile:t,newFile:i}){return e!=null||t!=null||i!=null}function ld(e,t,i=!1){return!i&&e==null&&t}function dd(e,t,i=!1){return e==null&&t&&!i}function He(e){if(!(e==null||e.type!=="element"))return e.children??[]}function hd({fileDiff:e,metrics:t,disableFileHeader:i,hunkSeparators:n,expandUnchanged:s,expandedHunks:r,collapsedContextThreshold:o,canHydratePartialDiff:a}){let l=xe(t,i),d=l;const h=s?!0:r,c=e.hunks.length-1;for(let u=0;u0){const k=ut({type:n,metrics:t,hunkIndex:u,hunkSpecs:f.hunkSpecs})?.totalHeight??0;l+=k,d+=k}l+=f.splitLineCount*t.lineHeight,d+=f.unifiedLineCount*t.lineHeight;const m=cd(f);l+=m.split*t.lineHeight,d+=m.unified*t.lineHeight;const v=u===c?Ae({fileDiff:e,hunkIndex:u,expandedHunks:h,collapsedContextThreshold:o,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(v!=null){const k=(v.fromStart+v.fromEnd)*t.lineHeight;if(l+=k,d+=k,v.collapsedLines>0){const y=_e({type:n,metrics:t})?.totalHeight??0;l+=y,d+=y}}else if(u===c&&e.isPartial&&a){const k=_e({type:n,metrics:t})?.totalHeight??0;l+=k,d+=k}}if(e.hunks.length>0){const u=Jt(t);l+=u,d+=u}return{splitHeight:l,unifiedHeight:d}}function cd(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 i=t.lines>0?1:0;return{split:i,unified:i}}return ud(e,t)}function ud(e,t){const i=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),n=t.deletions>0&&e.noEOFCRDeletions,s=t.additions>0&&e.noEOFCRAdditions;return{split:n||s?1:0,unified:i}}const zi=3e3,Nt=new Map;let fd=-1;var pd=class extends sd{__id=`little-virtualized-file-diff:${++fd}`;renderType="virtualized";top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:Nt,ghostTextRowsByIndex:new Map};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;currentCollapsed;pendingHydratedDiff;pendingExpansions;pendingRender;constructor(e,t,i,n,s){super(e,n,s),this.virtualizer=t,this.metrics=$t(i)}setMetrics(e,t=!1){const i=$t(e);!t&&tt(this.metrics,i)||(this.metrics=i,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.getLayoutAnnotations();return Ps(t)?t.some(i=>i.lineNumber!==0?!1:e.type==="new"?i.side==="additions":e.type==="deleted"?i.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,i=!Gi(t,e),n=i&&bd(t,e);super.setOptions(e),n&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:Cd(t,e)}),i&&(this.forceRenderOverride=!0),i&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,n)}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:i=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal=0,this.cache.ghostTextRows=Nt,this.cache.ghostTextRowsByIndex.size>0&&this.cache.ghostTextRowsByIndex.clear(),this.invalidateDerivedLayoutCache(t,i),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:i,ghostTextRows:n,ghostTextRowsByIndex:s},metrics:{lineHeight:r}}=this;if(n===t)return!1;const o=this.getDiffStyle(),a=new Map;for(const[d,h]of t){const c=this.getLineIndexForDiff(e,d+1,"additions");c!=null&&a.set(o==="split"?c[1]:c[0],h)}let l=!1;for(const d of new Set([...s.keys(),...a.keys()])){const h=((a.get(d)??0)-(s.get(d)??0))*r;if(h===0)continue;const c=(i.get(d)??0)+h;c===0?i.delete(d):i.set(d,c),this.cache.measuredHeightDeltaTotal+=h,l=!0}return this.cache.ghostTextRows=t,this.cache.ghostTextRowsByIndex=a,l}reconcileHeights(){let e=!1;const{options:{overflow:t="scroll"},metrics:{lineHeight:i}}=this,n=this.placeHolder!=null?this.getLayoutDiff():this.getRenderedDiff();if(this.fileContainer==null||n==null)return this.height!==0&&(e=!0),this.height=0,e;this.top=this.getVirtualizedTop(),e=this.applyGhostTextRows(n,this.editor?.__getGhostTextRows()??Nt);const{ghostTextRowsByIndex:s}=this.cache,r=t!=="scroll"||this.lineAnnotations.length>0||this.isResizeDebuggingEnabled();if(this.placeHolder!=null||!r&&this.cache.heightDeltas.size===0&&this.cache.fileAnnotationHeight===0)return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;const o=this.getDiffStyle(),a=o==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];if(this.renderRange!=null&&oi(this.renderRange)){const l=gd(a)??0;this.setFileAnnotationHeight(l)&&(e=!0)}for(const l of a){if(l==null)continue;const d=l.children[1];if(!(d instanceof HTMLElement))continue;const h=o==="split"&&l===this.codeDeletions;for(const c of d.children){if(!(c instanceof HTMLElement))continue;const u=c.dataset.lineIndex;if(u==null)continue;const f=Ld(u,o),g=s.get(f)??0;if(h&&g>0)continue;const p=this.cache.heightDeltas.get(f)??0;if(!r&&p===g*i)continue;let m=c.getBoundingClientRect().height+g*i,v=!1;c.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in c.nextElementSibling.dataset||"noNewline"in c.nextElementSibling.dataset)&&("noNewline"in c.nextElementSibling.dataset&&(v=!0),m+=c.nextElementSibling.getBoundingClientRect().height);const k=this.getEstimatedLineHeight(v),y=m-k;y!==p&&(e=!0,this.cache.measuredHeightDeltaTotal+=y-p,y===0?this.cache.heightDeltas.delete(f):this.cache.heightDeltas.set(f,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,i,n){let s=!1,r=!1;const{pendingExpansions:o,pendingHydratedDiff:a,options:{collapsed:l=!1}}=this;if(a!=null&&(this.pendingHydratedDiff=void 0,a.expectedDiff===e&&(Object.assign(e,a.nextDiff),this.setHydratedState(a.files),this.installHydratedSessionDiff(e),this.forceRenderOverride=!0,s=!0,r=!0)),o!=null){this.pendingExpansions=void 0;for(const{hunkIndex:g,direction:p,expansionLineCountOverride:m}of o)this.hunksRenderer.expandHunk(g,p,m),this.forceRenderOverride=!0,r=!0}const d=this.updateInputDiff(e,n),{pendingRenderDiff:h,layoutDiffChanged:c,renderedDiffChanged:u,annotationsChanged:f}=this.updatePendingRender(e,n);return!this.forceRenderOverride&&(d||u||f)&&(this.forceRenderOverride=!0),(i?.resetDiffLayoutCache===!0||c)&&(s=!0),(c||i?.resetDiffLayoutCache===!0&&i.includeEstimatedDiffHeights)&&(r=!0),i?.metrics!=null&&(this.metrics=$t(i.metrics),s=!0,r=!0),this.currentCollapsed!==l&&(this.currentCollapsed=l,s=!0),s?this.resetLayoutCache({includeEstimatedHeights:r}):r&&this.invalidateDerivedLayoutCache(!0),this.top=t,this.computeApproximateSize(!1,h),this.height}getLinePosition(e,t="additions"){const i=this.getLayoutDiff();if(i==null||e<1)return;const n=this.getLineIndexForDiff(i,e,t);if(n==null)return;const{disableFileHeader:s=!1,expandUnchanged:r=!1,collapsed:o=!1,collapsedContextThreshold:a=1}=this.options,l=this.getDiffStyle(),d=this.getHunkSeparatorType(),h=l==="split"?n[1]:n[0];this.approximateLayoutCheckpoints(i);const c=xe(this.metrics,s),u=this.getLayoutCheckpointBeforeLineIndex(h);let f=u?.top??c+this.cache.fileAnnotationHeight;if(o)return{top:St(this.metrics,s),height:0};let g;return Ve({diff:i,diffStyle:l,startingLine:u?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:p,hunk:m,collapsedBefore:v,collapsedAfter:k,deletionLine:y,additionLine:b})=>{const C=l==="split"?b?.splitLineIndex??y?.splitLineIndex:b?.unifiedLineIndex??y?.unifiedLineIndex;if(C==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(v>0){const S=ut({type:d,metrics:this.metrics,hunkIndex:p,hunkSpecs:m?.hunkSpecs});if(S!=null){if(f+=S.gapBefore,h>=C-v&&h0){const S=_e({type:d,metrics:this.metrics});if(S!=null){if(h>C&&h<=C+k)return g={top:f+S.gapBefore,height:S.height},!0;f+=S.totalHeight}}return!1}}),g}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){const t=this.getLayoutDiff();if(t==null)return;const{disableFileHeader:i=!1,expandUnchanged:n=!1,collapsed:s=!1,collapsedContextThreshold:r=1}=this.options;if(s)return;const o=this.getDiffStyle(),a=this.getHunkSeparatorType();this.approximateLayoutCheckpoints(t);const l=this.getLayoutCheckpointBeforeTop(e);let d=l?.top??xe(this.metrics,i)+this.cache.fileAnnotationHeight,h;return Ve({diff:t,diffStyle:o,startingLine:l?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,callback:({hunkIndex:c,hunk:u,collapsedBefore:f,collapsedAfter:g,deletionLine:p,additionLine:m})=>{const v=o==="split"?m?.splitLineIndex??p?.splitLineIndex:m?.unifiedLineIndex??p?.unifiedLineIndex;if(v==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(f>0){const y=ut({type:a,metrics:this.metrics,hunkIndex:c,hunkSpecs:u?.hunkSpecs});y!=null&&(d+=y.totalHeight)}if(d>=e&&(p!=null?h={lineNumber:p.lineNumber,side:"deletions",top:d}:m!=null&&(h={lineNumber:m.lineNumber,side:"additions",top:d}),h!=null))return!0;const k=this.getLineHeight(v,(m?.noEOFCR??!1)||(p?.noEOFCR??!1));if(d+=k,g>0){const y=_e({type:a,metrics:this.metrics});y!=null&&(d+=y.totalHeight)}return!1}}),h}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 i=e!=null?this.computeRenderRangeFromWindow(t,this.top,e):this.renderRange;if(i==null)return;const{bufferBefore:n,bufferAfter:s,totalLines:r}=i;let o=0;if(r===0){const a=e??this.virtualizer.getWindowSpecs();this.top0;t&&(this.layoutDirty=!0);const i=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!N(this.getRenderedDiff(),this.getWorkingDiff()));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),i&&this.virtualizer.instanceChanged(this,!0)}expandHunk=(e,t,i)=>{this.getInputDiff()!=null&&(this.loadFilesIfNecessary(),this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:i})):(this.hunksRenderer.expandHunk(e,t,i),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(!(this.getInputDiff()!==e||!e.isPartial)){if(this.isAdvancedMode()){const i=Ai("clone",e,t,this.options.parseDiffOptions);if(await Pi(()=>this.primeHighlightCache(i)),this.getInputDiff()!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:i,files:t}}else{if(Ai("merge",e,t,this.options.parseDiffOptions),this.setHydratedState(t),!this.installHydratedSessionDiff(e)&&(await Pi(()=>this.primeHighlightCache(e)),this.getInputDiff()!==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.getInputDiff())return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;const{pendingExpansions:t}=this,i=this.getRenderedDiff();if(t==null||t.length===0||i==null)return!1;const{expansionLineCount:n=100,collapsedContextThreshold:s=1}=this.options,r=new Map(this.hunksRenderer.getExpandedHunksMap());for(const o of t){const a={...r.get(o.hunkIndex)??{fromStart:0,fromEnd:0}},l=o.expansionLineCountOverride??n;(o.direction==="up"||o.direction==="both")&&(a.fromStart+=l),(o.direction==="down"||o.direction==="both")&&(a.fromEnd+=l),r.set(o.hunkIndex,a)}return fr({fileDiff:i,lineNumber:e,expandedHunks:r,collapsedContextThreshold:s})}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.getInputDiff()==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.getInputDiff()==null&&this.additionFile==null&&this.deletionFile==null)return;const e=this.getWorkingDiff(),t=e==null?void 0:this.hunksRenderer.getDiffForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,!(this.isSimpleMode()&&this.requestRender())&&this.virtualizer.instanceChanged(this,!N(this.getRenderedDiff(),t))}get isComponentManaged(){return this.getAdvancedVirtualizer()?.isComponentManaged??super.isComponentManaged}syncGhostTextRows(){const e=this.getAdvancedVirtualizer();e!=null?(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0)):this.getSimpleVirtualizer()?.requestHeightReconcile(this)}applyDocumentChange(e,t,i=!1){const{renderRange:n}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1});const s=this.getRenderedDiff();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(i&&n!=null&&s!=null){const r=this.virtualizer.getWindowSpecs(),o=this.computeRenderRangeFromWindow(s,this.top??0,r);o.bufferAfter!==n.bufferAfter&&this.updateBuffers(o)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutDiff()){const i=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!i)return;const n=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()??Nt);const{disableFileHeader:s=!1,collapsed:r=!1}=this.options;if(r){this.height+=St(this.metrics,s),this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,i&&!n&&this.validateComputedHeight(t),this.layoutDirty=!1}getLayoutDiff(){return this.pendingRender?.diff??this.getRenderedDiff()}getLayoutAnnotations(){const{pendingRender:e}=this;return e!=null?this.getAnnotationsForDiff(e.diff):this.lineAnnotations}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:i=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:s,unifiedHeight:r}=hd({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:i,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n,canHydratePartialDiff:yi(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=s,this.cache.estimatedUnifiedHeight=r}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:i=!1,lineAnnotations:n,...s}={}){const r=Oi(s,"VirtualizedFileDiff.render"),o=r!=null,a=r?.oldFile,l=r?.newFile,d=o&&(!_n(a,this.deletionFile)||!_n(l,this.additionFile));let h=t??this.getInputDiff();t==null&&o&&(d||this.getInputDiff()==null)&&(h=We(r.oldFile,r.newFile,this.options.parseDiffOptions));const{forceRenderOverride:c,isSetup:u}=this;this.forceRenderOverride=void 0;const f=h!=null&&!N(this.getInputDiff(),h),g=f||d;if(e=this.getOrCreateFileContainer(e),h==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;f&&this.updateInputDiff(h,n);const{pendingRenderDiff:p,layoutDiffChanged:m,renderedDiffChanged:v,annotationsChanged:k}=this.pendingRender!=null&&this.pendingRender.workingDiff===(this.getWorkingDiff(h)??h)?{pendingRenderDiff:this.pendingRender.diff,layoutDiffChanged:!1,renderedDiffChanged:!1,annotationsChanged:this.syncLineAnnotations(n)}:this.updatePendingRender(h,n);if(m&&this.resetLayoutCache({includeEstimatedHeights:!0}),u)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,p));else{this.computeApproximateSize(!1,p);const E=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(E==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");E.connect(e,this),this.isVisible=E.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!g||!u))return r!=null&&(this.deletionFile=a,this.additionFile=l),f&&this.clearReusableHeader(),this.renderPlaceholder(this.height);const y=this.virtualizer.getWindowSpecs(),b=this.top??0,C=this.computeRenderRangeFromWindow(p,b,y);return super.render({fileDiff:h,fileContainer:e,renderRange:C,lineAnnotations:n,forceRender:(c??i)||k||v||f,...r,...s})}finalizeRender(){if(!N(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 i=this.getWorkingDiff(e)??e,n=this.getRenderedDiff(),{pendingRender:s}=this,r=s?.diff??n,o=this.hunksRenderer.getDiffForNextRender(i);return this.pendingRender={workingDiff:i,diff:o},{pendingRenderDiff:o,annotationsChanged:this.syncLineAnnotations(t),layoutDiffChanged:!N(r,o),renderedDiffChanged:!N(n,o)}}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 kd(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:i=!1,collapsedContextThreshold:n=1}=this.options,s=e.hunks.length-1,r=yi(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),a=this.getHunkSeparatorType(),l=i?!0:this.hunksRenderer.getExpandedHunksMap(),d=md(this.cache.heightDeltas);let h=xe(this.metrics,t)+this.cache.fileAnnotationHeight,c=0;const u=({rowCount:f,startLineIndex:g,preSeparatorHeight:p=0,postSeparatorHeight:m=0,metadataOffsets:v=[]})=>{if(f<=0)return;const k=c,y=c+f;let b=vd(k);for(;b0?p:0)+C*this.metrics.lineHeight+Sd(v,C)*this.metrics.lineHeight+zn(d,g,g+C);this.cache.checkpoints.push({renderedLineIndex:b,lineIndex:g+C,top:E}),b+=zi}h+=p+f*this.metrics.lineHeight+v.length*this.metrics.lineHeight+zn(d,g,g+f)+m,c=y};for(let f=0;f0?ut({type:a,metrics:this.metrics,hunkIndex:f,hunkSpecs:g.hunkSpecs})?.totalHeight??0:0;u({rowCount:p.fromStart,startLineIndex:(o==="split"?g.splitLineStart:g.unifiedLineStart)-p.rangeSize});let v=m;u({rowCount:p.fromEnd,startLineIndex:(o==="split"?g.splitLineStart:g.unifiedLineStart)-p.fromEnd,preSeparatorHeight:v}),p.fromEnd>0&&(v=0);const k=f===s?Ae({fileDiff:e,hunkIndex:f,expandedHunks:l,collapsedContextThreshold:n,errorPrefix:"VirtualizedFileDiff"}):void 0,y=k!=null&&k.collapsedLines>0?_e({type:a,metrics:this.metrics})?.totalHeight??0:f===s&&r?_e({type:a,metrics:this.metrics})?.totalHeight??0:0,b=k!=null?k.fromStart+k.fromEnd:0,C=o==="split"?g.splitLineCount:g.unifiedLineCount,E=o==="split"?g.splitLineStart:g.unifiedLineStart;u({rowCount:C,startLineIndex:E,preSeparatorHeight:v,postSeparatorHeight:b===0?y:0,metadataOffsets:yd({diffStyle:o,hunk:g,rowCount:C})}),k!=null&&b>0&&u({rowCount:b,startLineIndex:E+C,postSeparatorHeight:y})}this.cache.totalLines=c}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,i=this.cache.checkpoints.length-1,n;for(;t<=i;){const s=t+i>>1,r=this.cache.checkpoints[s];if(r==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");r.lineIndex<=e?(n=r,t=s+1):i=s-1}return n}getLayoutCheckpointBeforeTop(e,t){let i=0,n=this.cache.checkpoints.length-1,s=-1;for(;i<=n;){const r=i+n>>1,o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");o.top<=e?(s=r,i=r+1):n=r-1}if(t==null)return s>=0?this.cache.checkpoints[s]:void 0;for(let r=s;r>=0;r--){const o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(o.renderedLineIndex%t===0)return o}}getExpandedLineCount(e,t){let i=0;if(e.isPartial){for(const a of e.hunks)i+=t==="split"?a.splitLineCount:a.unifiedLineCount;return i}const{expandUnchanged:n=!1,collapsedContextThreshold:s=1}=this.options,r=n?!0:this.hunksRenderer.getExpandedHunksMap();for(const[a,l]of e.hunks.entries()){const d=t==="split"?l.splitLineCount:l.unifiedLineCount;i+=d;const h=Math.max(l.collapsedBefore,0),{fromStart:c,fromEnd:u,renderAll:f}=Te({isPartial:e.isPartial,rangeSize:h,expandedHunks:r,hunkIndex:a,collapsedContextThreshold:s});h>0&&(i+=f?h:c+u)}const o=Ae({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:s,errorPrefix:"VirtualizedFileDiff"});return o!=null&&(i+=o.fromStart+o.fromEnd),i}getLayoutLineCount(e,t){const i=this.getExpandedLineCount(e,t),n=t==="split"?e.splitLineCount:e.unifiedLineCount;return Math.max(i,n,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:i,bottom:n}){const{disableFileHeader:s=!1,expandUnchanged:r=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:a,lineHeight:l}=this.metrics,d=this.getDiffStyle(),h=this.getHunkSeparatorType(),c=yi(e,this.options.loadDiffFiles!=null),u=this.height;let f=this.getLayoutLineCount(e,d);const g=xe(this.metrics,s),p=e.hunks.length>0?Jt(this.metrics):0,{fileAnnotationHeight:m}=this.cache,v=g+m,k=Math.max(0,u-g-m-p),y=this.hasFileAnnotations(e),b=t+g,C=m>0&&y&&bi;if(tn)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:u-g-p};if(f<=a||e.hunks.length===0)return{startingLine:0,totalLines:a,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),f=this.getLayoutLineCount(e,d);const E=Math.ceil(Math.max(n-i,0)/l),S=Math.ceil(E/a)*a+a,w=S/a,R=w,L=[],H=(i+n)/2,x=this.getLayoutCheckpointBeforeTop(Math.max(0,i-t-S*l*2),a);let A=t+(x?.top??v),T=x?.renderedLineIndex??0,F,I,D;if(Ve({diff:e,diffStyle:d,startingLine:x?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:Pe,hunk:K,collapsedBefore:Ge,collapsedAfter:nt,deletionLine:ce,additionLine:Se})=>{const V=Se!=null?Se.splitLineIndex:ce.splitLineIndex,X=Se!=null?Se.unifiedLineIndex:ce.unifiedLineIndex,te=(Se?.noEOFCR??!1)||(ce?.noEOFCR??!1),Oe=Pe===e.hunks.length-1&&K!=null&&(d==="split"?V===K.splitLineStart+K.splitLineCount-1:X===K.unifiedLineStart+K.unifiedLineCount-1),ae=(Ge>0?ut({type:h,metrics:this.metrics,hunkIndex:Pe,hunkSpecs:K?.hunkSpecs}):void 0)?.totalHeight??0;A+=ae;const le=T%a===0,Ie=Math.floor(T/a);if(le&&(L[Ie]=A-(t+v+ae),D!=null)){if(D<=0)return!0;D--}const Q=this.getLineHeight(d==="split"?V:X,te);if(A>i-Q&&AH&&(I=Ie),D==null&&A>=n&&le&&(D=R),T++,A+=Q,nt>0||Oe&&c){const kt=_e({type:h,metrics:this.metrics});kt!=null&&(Ai&&(F??=Ie),I==null&&A+kt.totalHeight>H&&(I=Ie),A+=kt.totalHeight)}return!1}}),F==null)if(C)F=0,I=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:u-g-p};I??=F;const O=Math.round(I-w/2),G=Math.max(0,Math.ceil(f/a)-w),P=Math.max(0,Math.min(O,G)),z=P*a,_=O<0?S+O*a:S,U=L[P]??0,ee=z===0?0:m+U,ne=P+_/a,se=ner[0]-o[0]),i=[],n=[0];let s=0;for(const[r,o]of t)i.push(r),s+=o,n.push(s);return{lineIndexes:i,prefixTotals:n}}function zn({lineIndexes:e,prefixTotals:t},i,n){if(i>=n||e.length===0)return 0;const s=Nn(e,i);return(t[Nn(e,n)]??0)-(t[s]??0)}function Nn(e,t){let i=0,n=e.length;for(;i>1,r=e[s];if(r==null)throw new Error("VirtualizedFileDiff: invalid prefix index");r0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[i-1]:[];const o=[],a=i-r;return n.deletions>0&&t.noEOFCRDeletions&&o.push(a+n.deletions-1),n.additions>0&&t.noEOFCRAdditions&&o.push(i-1),o}function bd(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 Cd(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 yi(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function kd(e){return typeof e=="function"?"custom":e??"line-info"}function _n(e,t){return e==null||t==null?e==null&&t==null:Zi(e,t)}function Ld(e,t){const[i,n]=e.split(",").map(Number);return t==="split"?n:i}function wd(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:xd(e.items,t.items)}function xd(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let i=0;i{const{navigator:e}=globalThis,t=e.userAgent,i=/iP(?:hone|ad|od)/.test(t),n=e.platform==="MacIntel"&&e.maxTouchPoints>1;return(i||n)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})();var fh=class Le{static __STOP=!1;static __lastScrollPosition=0;type="advanced";config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollRebaseConfig=ia()?Md:Hd;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=st;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement("div");stickyContainer=document.createElement("div");stickyOffset=document.createElement("div");header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;pendingHighlighterTheme;isComponentManaged;slotSnapshotStale=!1;constructor(t={theme:q},i,n=!1){this.options=t,this.computeMetricsCache(t.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=i,this.isComponentManaged=n,this.stickyOffset.style.contain="layout size",this.stickyContainer.style.position="sticky",this.stickyContainer.style.width="100%",this.stickyContainer.style.contain="layout style inline-size",this.stickyContainer.style.isolation="isolate",this.stickyContainer.style.display="flex",this.stickyContainer.style.flexDirection="column"}getLayout(){return this.options.layout??Wr}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(t){return this.itemMetricsCache={hunkLineCount:t?.hunkLineCount??st.hunkLineCount,lineHeight:t?.lineHeight??st.lineHeight,diffHeaderHeight:t?.diffHeaderHeight??st.diffHeaderHeight,hunkSeparatorHeight:t?.hunkSeparatorHeight,spacing:t?.spacing??st.spacing,paddingTop:t?.paddingTop,paddingBottom:t?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??$r}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return Mr&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(t){if(!this.shouldValidateItemHeights()||t.element==null)return;const i=t.instance.getAdvancedStickySpecs();if(i==null)return;const n=i.height,s=t.element.getBoundingClientRect().height;n!==s&&console.error("CodeView: reconciled item height does not match DOM height",{id:t.item.id,type:t.type,index:t.index,version:t.version,expectedHeight:n,actualHeight:s,delta:s-n,stickyTopOffset:i.topOffset,virtualizedHeight:t.instance.getVirtualizedHeight(),top:t.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:t.element,instance:t.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;const{firstIndex:t,lastIndex:i,stickyHeight:n,stickyTop:s,stickyBottom:r}=this.renderState;if(t===-1||i===-1)return;const o=this.stickyContainer.getBoundingClientRect().height;Math.abs(o-n){this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&(this.stickyContainer.style.removeProperty("pointer-events"),this.pointerEventsDisabled=!1),this.codeOverflowFix&&(this.stickyContainer.style.setProperty($n,"auto"),this.codeOverflowFix=!1)};syncLayout(){const{gap:t,paddingBottom:i,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${t}px`,this.container?.style.setProperty("margin-top",`${n}px`),this.container?.style.setProperty("margin-bottom",`${i}px`)}reconcileHeaderFooterHosts(){const t=this.reconcileHost("header"),i=this.reconcileHost("footer");return t||i}reconcileHost(t){const{root:i,container:n}=this;if(i==null||n==null)return!1;const s=t==="header"?this.header:this.footer,r=t==="header"?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(r==null)return s.element==null||(this.resizeObserver?.unobserve(s.element),s.element.remove(),s.element=void 0,s.render=void 0,this.setHostHeight(s,0)),!1;if(s.element!=null&&r===s.render)return!1;const o=s.element??Ed(t,n,this.resizeObserver);s.element=o;const a=r();return a!=null?o.replaceChildren(a):!this.isComponentManaged&&o.children.length>0&&(o.textContent=""),s.render=r,!0}setHostHeight(t,i){t.height!==i&&(t.height=i,this.scrollDirty=!0)}measureMountedHosts(){this.header.element!=null&&this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height),this.footer.element!=null&&this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw new Error("CodeView.setup: already setup");this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor="none",this.root.hasAttribute("tabindex")||(this.root.tabIndex=-1),this.container??=document.createElement("div"),this.container.style.contain="layout style",this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener("scroll",this.handleScroll,{passive:!0}),this.root.addEventListener("wheel",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("touchstart",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("pointerdown",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("keydown",this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{Le.__STOP?(Le.__STOP=!1,this.scrollTo({type:"position",position:Le.__lastScrollPosition,behavior:"instant"})):(Le.__lastScrollPosition=this.getScrollTop(),Le.__STOP=!0)}}reset(){pt(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();const{items:t}=this,i=[...this.itemEditors.values()].map(r=>{const o=this.idToItem.get(r.state.id);return o!=null&&(r.state.removedItem=o.item),r});this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items=[],this.idToItem.clear(),this.instanceToItem.clear();let n=!1,s;for(const r of i)try{r.editor.cleanUp("discard")}catch(o){n||(n=!0,s=o)}for(const r of t)try{r.instance.cleanUp()}catch(o){n||(n=!0,s=o)}if(this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent="",this.stickyOffset.style.height="",this.container?.style.removeProperty("height"),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isComponentManaged||this.flushSlotCoordinator(),n)throw s}cleanUp(){let t=!1,i;try{this.reset()}catch(n){t=!0,i=n}if(this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener("scroll",this.handleScroll),this.root?.removeEventListener("wheel",this.clearPendingScroll),this.root?.removeEventListener("touchstart",this.clearPendingScroll),this.root?.removeEventListener("pointerdown",this.clearPendingScroll),this.root?.removeEventListener("keydown",this.clearPendingScroll),this.root?.style.removeProperty("overflow-anchor"),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent="",this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0,t)throw i}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let t=this.renderState.firstIndex;t<=this.renderState.lastIndex;t++){const i=this.items[t];if(i==null)throw new Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${t}`);this.releaseRenderedItem(i)}}primeScrollTarget(t){if(t.type==="position")return;const i=this.idToItem.get(t.id);i?.instance.primeHighlightCache()}getElementPoolLimit(){const t=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:i}=this.itemMetricsCache;return Math.max(8,Math.ceil(t/Math.max(i,10))+1)*(this.isComponentManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let t=this.elementPool.pop();for(;t!=null&&!this.isElementPoolGenerationCurrent(t);)t=this.elementPool.pop();return t??=document.createElement(ss),this.markElementPoolGenerationCurrent(t),t}releaseRenderedItem(t){const{element:i}=t;i!=null&&this.renderedItemOwnsFocus(i)&&(this.shouldFixContainerFocus=!0),t.instance.cleanUp(!0),this.attachedEditors.delete(t.item.id),t.element=void 0,i!=null&&(i.remove(),this.cleanElement(i),this.queueElementForPool(i))}renderedItemOwnsFocus(t){const{activeElement:i}=document;return i===t||t.contains(i)||t.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(t){const{shadowRoot:i}=t;if(i!=null)for(const n of Array.from(i.children))_d(n)||n.remove();this.isComponentManaged||t.replaceChildren()}queueElementForPool(t){const i=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(t)||this.getElementPoolSize()>=i||(this.isElementClean(t)?this.elementPool.push(t):this.pendingElementPool.push(t))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;const{pendingElementPool:t}=this;this.pendingElementPool=[];const i=this.getElementPoolLimit();for(const n of t)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.lengththis.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(t){if(t==null)return;this.capturePendingLayoutAnchor();const{options:i}=this,n=this.getLayout(),{itemMetricsCache:s}=this;Od(i,t)&&this.invalidateElementPool(),this.options=t;const r=this.computeMetricsCache(t.itemMetrics),o=!tt(s,r),a=!tt(n,this.getLayout());a&&this.syncLayout();const l=o||zd(i,t);if(l){const h=this.pendingLayoutReset;this.pendingLayoutReset={metrics:o?r:h?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:h?.includeEstimatedDiffHeights===!0||o||Nd(i,t)}}(a||l)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),Gi(i,t)||this.renderOptionsRevision++,this.syncItemEditors();const d=i.renderCodeViewHeader!==t.renderCodeViewHeader||i.renderCodeViewFooter!==t.renderCodeViewFooter;!this.isComponentManaged&&(this.items.length>0||d)&&this.render()}capturePendingLayoutAnchor(t=this.idToItem){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop(),t))}render(t=!1){Le.__STOP||(t?(pt(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):qi(this.computeRenderRangeAndEmit))}isReady(){const{workerManager:t}=this;return t==null||t.getStats().workersFailed?this.isSharedHighlighterReady():t.isInitialized()?(this.clearReadySubscription(),!0):(this.isReadySubscription??=t.subscribeToStatChanges(i=>{i.managerState!=="initialized"&&!i.workersFailed||(this.clearReadySubscription(),this.render(!0))}),t.getStats().managerState==="waiting"&&t.initialize().catch(()=>{}),!1)}clearReadySubscription(){this.isReadySubscription!=null&&(this.isReadySubscription(),this.isReadySubscription=void 0,this.pendingHighlighterTheme=void 0)}isSharedHighlighterReady(){const t=this.workerManager?.getFileRenderOptions().theme??this.options.theme??q;return $({theme:t})!=null?(this.clearReadySubscription(),!0):(Fe(this.pendingHighlighterTheme,t)||this.clearReadySubscription(),this.isReadySubscription??=(()=>{this.pendingHighlighterTheme=t;let i=!1;return eo({themes:fe(t),langs:[],preferredHighlighter:Ct(this.workerManager,this.options)}).then(()=>{i||(this.clearReadySubscription(),this.render(!0))},n=>{i||(this.clearReadySubscription(),n instanceof ve||console.error(n))}),()=>{i=!0}})(),!1)}instanceChanged(t,i){const n=this.instanceToItem.get(t);if(n==null)throw new Error("CodeView.instanceChanged: An instance has changed that is not registered");i&&this.markItemLayoutDirty(n),this.itemEditors.has(n.item.id)||(this.slotSnapshotStale=!0),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){const{firstIndex:t,lastIndex:i}=this.renderState;if(t===-1||i===-1||i{this.scrollListeners.delete(t)}}getLocalTopForInstance(t){const i=this.instanceToItem.get(t);if(i==null)throw new Error("CodeView.getLocalTopForInstance: unknown virtualized instance");return i.top}getTopForItem(t){const i=this.idToItem.get(t);if(i!=null)return i.top+this.getItemTopOffset()}createItem(t,i,n){const{itemMetricsCache:s}=this;if(t.type==="diff"){const o=new pd(this.createDiffOptions(t.id),this,s,this.workerManager);return{type:"diff",item:t,version:t.version,index:i,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:o}}const r=new va(this.createFileOptions(t.id),this,s,this.workerManager);return{type:"file",item:t,version:t.version,index:i,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:r}}applySelectedLines(t,i){const{selectedLines:n}=this;t==null&&n==null||t!=null&&n?.id===t.id&&Kt(n.range,t.range)||(n!=null&&n.id!==t?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=t,this.idToItem.get(t?.id??"")?.instance.setSelectedLines(t?.range??null,i))}syncSelection(){if(this.selectedLines==null)return;const t=this.idToItem.get(this.selectedLines.id);if(t==null){this.selectedLines=null,this.options.onSelectedLinesChange?.(null);return}t.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(t){return t.item.edit===!0&&t.item.collapsed!==!0}attachItemEditor(t){const{id:i}=t.item,{createEditor:n}=this.options;if(t.element==null||this.attachedEditors.has(i)||!this.isItemInEditMode(t))return;const s=this.itemEditors.get(i);let r;try{if(s==null&&t.type==="diff"&&!t.instance.__canAttachEditor()){t.instance.__prepareForEditing();return}if(s==null){Dd(n);const o=Me(t.instance.options);if(o==null)throw new Error("CodeView.attachItemEditor: instance options are missing their state");const a=d=>{const h=this.idToItem.get(o.id);h!=null&&this.options.onItemEditChange?.(d,h.item)},l=this.options.getEditStateKey?.(t.item);if(t.type==="diff"){const d=n("file-diff",{onChange:a},l);r=d,this.itemEditors.set(i,{editor:d,state:o,dispose:d.edit(t.instance)})}else{const d=n("file",{onChange:a},l);r=d,this.itemEditors.set(i,{editor:d,state:o,dispose:d.edit(t.instance)})}}else t.type,s.dispose=s.editor.edit(t.instance);this.attachedEditors.add(i)}catch(o){throw r?.cleanUp(),this.releaseRenderedItem(t),o}}syncItemEditors(t){if(this.itemEditors.size===0)return;const i=[];for(const[r,o]of this.itemEditors){const a=this.idToItem.get(r),l=t?.get(r);if(l==null&&a!=null){const{edit:d=!1,collapsed:h=!1}=a.item;if(d){h&&this.attachedEditors.delete(r)&&o.editor.cleanUp("recycle");continue}}else l!=null&&(o.state.removedItem=l.item);this.itemEditors.delete(r),this.attachedEditors.delete(r),i.push(o)}if(i.length===0)return;let n=!1,s;for(const r of i){try{r.dispose()}catch(a){n||(n=!0,s=a)}const o=this.idToItem.get(r.state.id);o!=null&&this.markItemLayoutDirty(o)}if(this.render(),n)throw s}requireItemFromState(t){const i=this.idToItem.get(t.id)?.item??t.removedItem;if(i==null)throw new Error(`CodeView.onItemEditComplete: unknown item "${t.id}"`);return i}completeFileItemEdit(t,i){const n=this.requireItemFromState(t);if(n.type!=="file")throw new Error(`CodeView.onItemEditComplete: item "${t.id}" is not a file item`);const s={...n,file:i.file,annotations:i.lineAnnotations,edit:!1,version:(n.version??0)+1};return(this.options.onItemEditComplete?.(i,n,s)??"reject")==="reject"?"reject":(this.idToItem.has(n.id)&&this.updateItem(s),"accept")}completeDiffItemEdit(t,i){const n=this.requireItemFromState(t);if(n.type!=="diff")throw new Error(`CodeView.onItemEditComplete: item "${t.id}" is not a diff item`);const s={...n,fileDiff:i.fileDiff,annotations:i.lineAnnotations,edit:!1,version:(n.version??0)+1};return(this.options.onItemEditComplete?.(i,n,s)??"reject")==="reject"?"reject":(this.idToItem.has(n.id)&&this.updateItem(s),"accept")}renamePendingScrollTarget(t,i){const{pendingScrollTarget:n}=this;n==null||n.type==="position"||n.id!==t||(this.pendingScrollTarget={...n,id:i})}renamePendingLayoutAnchor(t,i){this.pendingLayoutAnchor?.id===t&&(this.pendingLayoutAnchor.id=i)}createFileOptionsPrototype(){const t={};for(const i of Ad)de(t,i,()=>this.options[i]);de(t,"stickyHeader",()=>this.options.stickyHeaders),de(t,"collapsed",i=>{const n=Me(i);if(n!=null)return this.getItemOptions(n,"file")?.item.collapsed}),de(t,"onEditComplete",i=>{if(this.options.onItemEditComplete==null)return;const n=Me(i);if(n!=null)return s=>this.completeFileItemEdit(n,s)});for(const i of Bn)this.defineItemSharedCallback(t,"file",i);for(const i of Vn)this.defineItemSelectionCallback(t,"file",i);return t}createDiffOptionsPrototype(){const t={};for(const i of Td)de(t,i,()=>this.options[i]);de(t,"stickyHeader",()=>this.options.stickyHeaders),de(t,"hunkSeparators",()=>this.options.hunkSeparators),de(t,"collapsed",i=>{const n=Me(i);if(n!=null)return this.getItemOptions(n,"diff")?.item.collapsed}),de(t,"onEditComplete",i=>{if(this.options.onItemEditComplete==null)return;const n=Me(i);if(n!=null)return s=>this.completeDiffItemEdit(n,s)});for(const i of Bn)this.defineItemSharedCallback(t,"diff",i);for(const i of Vn)this.defineItemSelectionCallback(t,"diff",i);return t}createFileOptions(t){const i=Object.create(this.fileOptionsPrototype);return Un(i,{id:t}),i}createDiffOptions(t){const i=Object.create(this.diffOptionsPrototype);return Un(i,{id:t}),i}updateItemOptionsId(t,i){const n=Me(t);if(n==null)throw new Error("CodeView.updateItemOptionsId: No valid state");n.id=i}getItemOptions(t,i){const n=this.idToItem.get(t.id);if(!(n==null||n.type!==i))return n}defineItemSharedCallback(t,i,n){de(t,n,s=>{if(this.options[n]==null)return;const r=Me(s);if(r==null)return;const o=r.callbackCache??={};let a=o[n];return a==null&&(a=((...l)=>{const d=this.getItemOptions(r,i);if(d==null)return;const h=this.options[n];return h?.(...l,d)}),o[n]=a),a})}defineItemSelectionCallback(t,i,n){de(t,n,s=>{const r=Me(s);if(r==null)return;const o=r.callbackCache??={};let a=o[n];return a==null&&(a=l=>{const d=this.getItemOptions(r,i);if(d==null)return;const h=l==null?null:{id:d.item.id,range:l};this.options.controlledSelection!==!0&&(l!=null||this.selectedLines?.id===d.item.id)&&this.applySelectedLines(h,{notify:!1}),this.options.onSelectedLinesChange?.(h);const c=this.options[n];return c?.(l,d)},o[n]=a),a})}markLayoutDirtyFromIndex(t){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??t,t)}markItemLayoutDirty(t){if(this.items[t.index]!==t)throw new Error(`CodeView.markItemLayoutDirty: unknown item id "${t.item.id}"`);this.markLayoutDirtyFromIndex(t.index)}tryAppendItems(t){if(t.length<=this.items.length)return!1;for(let i=0;i=r.length?this.resetRenderState():this.renderState.lastIndex>=r.length&&(this.renderState.lastIndex=r.length-1),this.markLayoutDirtyFromIndex(d),this.scrollDirty=!0,this.render(),l.size>0?l:void 0}syncItemRecord(t,i){if(t.type!==i.type)throw new Error(`CodeView.syncItemRecord: type mismatch for id "${i.id}"`);return t.version===i.version?!1:(t.item=i,t.version=i.version,t.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(t){const{paddingBottom:i,paddingTop:n}=this.getLayout();return Math.max(n+this.header.height+t+this.footer.height+i-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>this.scrollRebaseConfig.threshold}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),this.scrollRebaseConfig.containerHeight):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(t){const i=this.getMaxPagedScrollTop();return Math.max(0,Math.min(t,i))}clampScrollTop(t){const i=this.getMaxScrollTop();return Math.max(0,Math.min(t,i))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(t){const i=this.getMaxScrollPageOffset();return Math.max(0,Math.min(t,i))}resolveScrollPageWindow(t,i){let n=ue(this.clampPagedScrollTop(i)),s=this.clampScrollPageOffset(t-n);return n=ue(this.clampPagedScrollTop(t-s)),s=this.clampScrollPageOffset(t-n),{pagedScrollTop:n,scrollPageOffset:s}}resolvePagedScrollPosition(t){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(t),scrollPageOffset:0};const{scrollPageOffset:i,scrollRebaseConfig:n}=this,s=this.clampScrollPageOffset(i),r=t-s,o=this.getMaxPagedScrollTop(),a=this.getMaxScrollPageOffset(),l=r>n.threshold&&s0;return r<0||r>o||l||d?this.resolveScrollPageWindow(t,d?Math.min(n.targetBottom,o):n.targetTop):{pagedScrollTop:ue(this.clampPagedScrollTop(r)),scrollPageOffset:s}}needsScrollPageUpdate(t){const i=ue(this.clampScrollTop(t)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(i);return n!==this.scrollPageOffset}getPagedLayoutTop(t){return this.shouldRebaseScroll()?Math.max(t-this.scrollPageOffset,0):t}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(t){const i=this.idToItem.get(t.id);if(i==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return{top:i.top,height:i.height};if(t.type==="range"){const s=this.getRangeScrollPosition(i,t);if(s==null){console.warn(`CodeView.scrollTo: unable to resolve range ${qn(t.range)} for item "${t.id}"`);return}return{top:i.top+s.top,height:s.height}}const n=this.getLineScrollPosition(i,t);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return{top:i.top+n.top,height:n.height}}normalizeScrollTarget(t){if(t.type==="position"||t.align!=="nearest")return t;const i=this.getScrollTargetRect(t);if(i==null)return;const n=t.offset??0,s=this.getItemTopOffset()+i.top,r=s+i.height,o=this.getScrollTop(),a=o+(t.type==="line"||t.type==="range"?this.getStickyHeaderOffset():0),l=o+this.getHeight();if(!(s-n<=a&&r+n>=l)){if(s-nl)return{...t,align:"end"}}}resolveScrollTargetTop(t){if(t.type==="position"){const s=this.clampScrollTop(t.position);return s!==t.position?s:this.clampScrollTop(t.position-this.getStickyHeaderOffset())}const i=this.idToItem.get(t.id);if(i==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return this.clampScrollTop(this.resolveAlignedScrollPosition(i.top,i.height,t.align,t.offset));if(t.type==="range"){const s=this.getRangeScrollPosition(i,t);if(s==null){console.warn(`CodeView.scrollTo: unable to resolve range ${qn(t.range)} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(i.top+s.top,s.height,t.align,t.offset,this.getStickyHeaderOffset()))}const n=this.getLineScrollPosition(i,t);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(i.top+n.top,n.height,t.align,t.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(t,i,n,s=0,r=0){t+=this.getItemTopOffset();const o=this.getHeight();return n==="center"&&i+s{if(Le.__STOP||this.container==null||!this.isReady())return;const i=this.getHeight(),n=this.getScrollTop();let s=n,r=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(s);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,r=!0),r&&o!=null){const S=this.resolveAnchoredScrollTop(o);if(S!=null){const w=S-s;s=S,this.scrollAnimation!=null&&(this.scrollAnimation.position+=w)}}r&&(s=this.clampScrollTop(s),this.syncContainerHeight());const a=this.computeTargetScrollTopForFrame(s,t),l=!r&&(this.renderState.scrollTop===-1||Math.abs(a-this.renderState.scrollTop)>i+this.config.overscrollSize*2);l&&(o=void 0),this.windowSpecs=to({scrollTop:a-this.header.height,height:i,scrollHeight:this.getScrollHeight(),fitPerfectly:l,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let d=n;(this.pendingScrollTarget!=null&&a!==d||this.needsScrollPageUpdate(a))&&(this.applyScrollFix(a,d,this.windowSpecs),d=a);const{top:h,bottom:c}=this.windowSpecs,{firstIndex:u,lastIndex:f}=this.renderState;if(u>=0)for(let S=u;S<=f;S++){const w=this.items[S];if(w==null)throw new Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${S}`);w.top>h-w.height&&w.top<=c||this.releaseRenderedItem(w)}const g=this.reconcileHeaderFooterHosts();let p;const m=new Set,v=this.findFirstVisibleIndex(h),k=this.findLastVisibleIndex(c);for(let S=v;S<=k;S++){const w=this.items[S];if(w==null)throw new Error("CodeView.computeRenderRangeAndEmit: missing item");const{instance:R}=w;w.element==null?(w.element=this.acquireElement(),Kn(this.stickyContainer,w.element,p),R.virtualizedSetup(),jn(w,w.element)&&(w.renderedOptionsRevision=this.renderOptionsRevision,m.add(w)),p=w.element):(Kn(this.stickyContainer,w.element,p),jn(w,void 0,w.renderedOptionsRevision!==this.renderOptionsRevision)&&(w.renderedOptionsRevision=this.renderOptionsRevision,m.add(w)),p=w.element),w.item.edit===!0&&this.attachItemEditor(w)}this.renderState.firstIndex=v<=k?v:-1,this.renderState.lastIndex=k,this.flushSlotCoordinator(),this.flushManagers(m),g&&this.measureMountedHosts(),this.reconcileRenderedItems(m),this.syncContainerHeight(),this.updateStickyPositioning();const y=o!=null?this.resolveAnchoredScrollTop(o):void 0;o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);const b=y!=null?y-s:0;let C=a,E=!1;if(this.pendingScrollTarget!=null){const S=this.advanceScrollAnimation(t,b);S!=null?(C=S,E=!0):C=s}else C=y??a;C!==d&&(this.applyScrollFix(C,d,this.windowSpecs),d=C),E&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=ue(d),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),(l||this.scrollAnimation!=null)&&this.render()};flushManagers(t){for(const i of t)i.instance.flushManagers()}syncContainerHeight(){const t=this.getPagedScrollHeight();this.container==null||this.containerHeight===t||(this.container.style.height=`${t}px`,this.containerHeight=t)}getStickyBounds(t){const{firstIndex:i,lastIndex:n}=t!=null?{firstIndex:this.findFirstVisibleIndex(t.top),lastIndex:this.findLastVisibleIndex(t.bottom)}:this.renderState;if(i===-1||n===-1||i>n)return;const s=this.items[i]?.instance.getAdvancedStickySpecs(t),r=this.items[n]?.instance.getAdvancedStickySpecs(t);if(!(s==null||r==null))return{stickyTop:this.getPagedLayoutTop(Math.max(s.topOffset,0)),stickyBottom:this.getPagedLayoutTop(r.topOffset+r.height)}}applyStickyPositioning({stickyTop:t,stickyBottom:i}){const n=this.getHeight(),{itemMetricsCache:s}=this,r=i-t;this.renderState.stickyHeight=r,this.renderState.stickyTop=t,this.renderState.stickyBottom=i,this.stickyOffset.style.height=`${t}px`;const o=(Math.random()*s.lineHeight>>0)*-1,a=-Math.max(r+o,0)+n;this.stickyContainer.style.top=`${a}px`,this.stickyContainer.style.bottom=`${a+s.diffHeaderHeight}px`}syncPagedScrollScaffolding(t){this.syncContainerHeight();const i=this.getStickyBounds(t);if(i==null){this.stickyOffset.style.height=`${this.getPagedLayoutTop(t.top)}px`;return}this.applyStickyPositioning(i)}reconcileRenderedItems(t){const{firstIndex:i,lastIndex:n}=this.renderState;if(i===-1)return;let s=-1,r=!1;for(let o=i;on);o++){const a=this.items[o];if(a==null)throw new Error("CodeView.reconcileRenderedItems: Invalid item");s===-1?s=a.top:a.top!==s&&(a.top=s,a.instance.syncVirtualizedTop(),r=!0),(t==null?o<=n:t.has(a))&&(a.instance.reconcileHeights()&&(r=!0,a.height=a.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(a)),s+=a.instance.getVirtualizedHeight(),o{Le.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=t=>{let i=!1;for(const n of t)if(n.target===this.stickyContainer){const s=n.borderBoxSize[0].blockSize;if(Math.abs(s-this.renderState.stickyHeight)>=Wn){const r=this.getScrollTop(),o=this.getScrollAnchor(r);this.reconcileRenderedItems(),this.updateStickyPositioning();const a=o!=null?this.resolveAnchoredScrollTop(o):void 0;if(a!=null){const l=a-r;this.applyScrollFix(a,r,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=l)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),i=!0}}else if(n.target===this.header.element||n.target===this.footer.element){const s=n.target===this.header.element?this.header:this.footer,r=n.borderBoxSize[0].blockSize;if(r!==s.height){const o=this.getScrollTop(),a=this.getScrollAnchor(o);this.setHostHeight(s,r);const l=a!=null?this.resolveAnchoredScrollTop(a):void 0;if(l!=null){const d=l-o;this.applyScrollFix(l,o,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=d)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),i=!0}}else this.scrollDirty=!0,this.heightDirty=!0,i=!0;i&&this.render(!0)};getScrollAnchorViewportTop(t,i){return t=t+d)break;if(i.get(c.item.id)!==c){n??=c;continue}if(u>=t)return{type:"item",id:c.item.id,viewportOffset:u-t};const f=this.getScrollAnchorViewportTop(u,t)-u,g=c.instance.getNumericScrollAnchor(f);if(g!=null){const p=u+g.top;return{type:"line",id:c.item.id,lineNumber:g.lineNumber,side:g.side,viewportOffset:p-t}}}if(n!=null)for(let h=n.index+1;h>1,o=this.items[r];if(o==null)throw new Error("CodeView.findFirstVisibleIndex: invalid item index");o.top+o.height>t?(s=r,n=r-1):i=r+1}return s}findLastVisibleIndex(t){let i=0,n=this.items.length-1,s=-1;for(;i<=n;){const r=i+n>>1,o=this.items[r];if(o==null)throw new Error("CodeView.findLastVisibleIndex: invalid item index");o.top<=t?(s=r,i=r+1):n=r-1}return s}recomputeLayout(t=0,i){if(this.items.length===0){this.scrollHeight=0;return}const n=this.getLayout();let s=0;if(t>0){const r=this.items[t-1];if(r==null)throw new Error("CodeView.recomputeLayout: invalid dirty index");s=r.top+r.height+n.gap}for(let r=t;r0||Rd(e).lineAnnotations.length>0}function Vd(e,{hasHeaderRenderers:t,hasAnnotationRenderer:i,hasGutterRenderer:n}){if(e.length===0)return;if(t||n)return e;if(!i)return;const s=[];for(const r of e)Bd(r)&&s.push(r);return s.length>0?s:void 0}function Ud(e,t){for(const i of Array.isArray(e)?e:[e]){let n=Ue.get(i.name);n==null&&(n=i,Ue.set(i.name,n)),t.attachLanguages([n]),us.add(n.name)}}function Yn(e){const t=[];for(const i of e){const n=Ue.get(i);if(n==null)throw new Error(`getResolvedLanguages: ${i} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(n)}return t}async function kr(e){if(typeof __DIFFS_WORKER__<"u"?__DIFFS_WORKER__:fs())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=Lt.get(e);if(t!=null)return t;const i=(async()=>{let n=cs.get(e);if(n==null){const{bundledLanguages:o}=await Ee(async()=>{const{bundledLanguages:a}=await import("./shiki-core.mjs").then(l=>l.l);return{bundledLanguages:a}},[]);Object.prototype.hasOwnProperty.call(o,e)&&(n=o[e])}if(n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const{default:s}=await n(),r={name:e,data:s};return Ue.has(e)||Ue.set(e,r),r})();Lt.set(e,i);try{return await i}finally{Lt.get(e)===i&&Lt.delete(e)}}function Wd(e){return Ue.get(e)??kr(e)}function Xn(e){for(const t of Array.isArray(e)?e:[e])if(!Ue.has(t))return!1;return!0}async function Ni(e){const t=[],i=[];for(const n of e){if(n==="text"||n==="ansi")continue;const s=Wd(n)??kr(n);"then"in s?i.push(s):t.push(s)}return i.length>0&&await Promise.all(i).then(n=>{for(const s of n){if(s==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(s)}}),t}function Qn(e,t=qe()){return bt(t).getResolvedThemes(e)}function Zn(e,t=qe()){return bt(t).hasResolvedThemes(e)}function Jn(e,t=qe()){return bt(t).resolveThemes(e)}function $d(e,t,i,n=!1){const s=[0];if(i.decorations?.some(l=>typeof l.start=="number"||typeof l.end=="number")===!0)for(let l=e.indexOf(` +`);l!==-1;l=e.indexOf(` +`,l+1))s.push(l+1);const r={type:"element",tagName:"code",properties:{},children:[]},o=Yi(t.tokens,{decorations:i.decorations,mergeWhitespaces:i.mergeWhitespaces,lineOffsets:s,cacheHtmlStyles:n});for(let l=0;l0&&r.children.push({type:"text",value:` +`}),r.children.push(o[l]);const a={type:"root",children:[{type:"element",tagName:"pre",properties:{class:"diffs",style:t.rootStyle===!1?void 0:t.rootStyle??[t.fg!=null?`color:${t.fg}`:"",t.bg!=null?`background-color:${t.bg}`:""].filter(Boolean).join(";"),tabIndex:0},children:[r]}]};return Y(a)}const es=0,qd=1,Gd=2,jd=4,Kd=5,Yd=6,Xd=[void 0,null,!0,!1];function bi(e){if(Array.isArray(e))return e;const{ops:t,offsets:i,strings:n,text:s,extras:r}=e,o=new Array(i.length/2);let a=0,l=0;function d(h){const c=new Array(h);for(let u=0;u0;m--){const v=n[t[a++]],k=t[a++],y=k===jd?n[t[a++]]:k===Kd?t[a++]:k===Yd?r[t[a++]]:Xd[k];v==="__proto__"?Object.defineProperty(p,v,{value:y,enumerable:!0,configurable:!0,writable:!0}):p[v]=y}c[u]={type:"element",tagName:g,properties:p,children:d(t[a++])}}else c[u]=r[t[a++]]}return c}for(let h=0;h(a=i[h*2],l=i[h*2+1],d(1)[0]),{retain:!1});return o}const _t=Symbol("IGNORE_RESPONSE"),Qd=1e4;var Zd=class{options;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;terminated=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:i=q,useTokenTransformer:n=!1,lineDiffType:s="word-alt",maxLineDiffLength:r=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:a}){this.options=e,this.preferredHighlighter=qe(a),this.renderOptions={theme:i,useTokenTransformer:n,lineDiffType:s,maxLineDiffLength:r,tokenizeMaxLineLength:o},this.fileCache=new en.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new en.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed&&!this.terminated}shouldHighlightOnMainThread(e){const{mainThreadMaxCharacters:t=-1}=this.options;return("contents"in e?e.contents.length:e.deletionCharacterCount+e.additionCharacterCount)<=t}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}setFileResultCache(e,{result:t,options:i}){return e==null||!re(i,this.getFileRenderOptions())?!1:(this.fileCache.set(e,{result:t,options:i}),this.queueBroadcastStateChanges(),!0)}setDiffResultCache(e,{result:t,options:i}){return e==null||!Z(i,this.getDiffRenderOptions())?!1:(this.diffCache.set(e,{result:t,options:i}),this.queueBroadcastStateChanges(),!0)}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??q,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:i=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:n=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:s=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:r}=this,o=++this.renderOptionsRequestVersion,a=()=>this.isCurrentLifecycle(r)&&this.renderOptionsRequestVersion===o;try{const l={theme:e,useTokenTransformer:t,lineDiffType:i,maxLineDiffLength:n,tokenizeMaxLineLength:s};if(!this.isInitialized())try{await this.initialize()}catch(u){if(!this.workersFailed)throw u}if(!a()||Z(l,this.renderOptions))return;const d=fe(e);let h=[];if(Fe(l.theme,this.renderOptions.theme)||(h=Zn(d,this.preferredHighlighter)?Qn(d,this.preferredHighlighter):await Jn(d,this.preferredHighlighter)),!a()||$({theme:e})==null&&(await this.loadSharedHighlighter(d,["text"]),!a()))return;const c=this.setRenderOptionsOnWorkers(l,h);this.renderOptions=l,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const u of this.themeSubscribers)u.onThemeChange();await c}catch(l){if(l instanceof Ye||!a())return;throw l}}getPreferredHighlighter(){return this.preferredHighlighter}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:i}=this.renderOptions;return{theme:t,useTokenTransformer:i,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const i=[];for(const n of this.workers){if(!n.initialized)throw console.log({managedWorker:n}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");i.push(new Promise((s,r)=>{const o=this.generateRequestId(),a={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:e,resolvedThemes:t},resolve:s,reject:r,requestStart:Date.now()};this.activeTaskById.set(o,a),n.pendingSetupRequestId=o,n.worker.postMessage(a.request)}))}await Promise.all(i)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);const t=this.activeRequestByInstance.get(e);if(t!=null){const i=this.activeTaskById.get(t);Ce(i)?(this.detachInstanceFromRenderTask(i,e),!i.primeCache&&i.instances.size===0&&this.removeActiveTask(i)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized===!0){$({theme:this.renderOptions.theme})==null&&await this.loadSharedHighlighter(fe(this.renderOptions.theme),["text",...e]);return}else if(this.initialized===!1){this.terminated=!1;const{lifecycleGeneration:t}=this,i=new Promise((n,s)=>{(async()=>{try{const r=fe(this.renderOptions.theme),o=Zn(r,this.preferredHighlighter)?Qn(r,this.preferredHighlighter):await Jn(r,this.preferredHighlighter);if(!this.isCurrentLifecycle(t)){n();return}let a=[];if(this.preferredHighlighter!=="highlights"&&(a=Xn(e)?Yn(e):await Ni(e)),!this.isCurrentLifecycle(t)){n();return}if(await Promise.all([this.loadSharedHighlighter(r,["text",...e]),this.initializeWorkers(o,a)]),!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.initialized=!0,this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(r){if(r instanceof Ye||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.activeTaskById.clear();for(const o of this.queuedTasks)this.rejectRenderTaskCallbacks(o,ki(r));this.queueBroadcastStateChanges(),s(r)}})()});return this.initialized=i,this.queueBroadcastStateChanges(),i}else return this.initialized}async loadSharedHighlighter(e,t){try{await it({themes:e,langs:t,preferredHighlighter:this.preferredHighlighter})}catch(i){if(!(i instanceof ve))throw i}}async initializeWorkers(e,t){this.workersFailed=!1;const i=[],n=un(),s=n>0?fn():void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){const l=this.options.workerFactory(),d={worker:l,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:h})=>h)]),customExtensionsVersion:0};l.addEventListener("message",h=>{this.handleWorkerMessage(d,h.data)}),l.addEventListener("error",h=>this.handleWorkerError(d,h)),this.workers.push(d),i.push(new Promise((h,c)=>{const u=this.generateRequestId(),f={type:"initialize",id:u,request:{type:"initialize",resultFormat:"hast-ops-v1",id:u,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:s!=null?n:void 0,customExtensionMap:s},resolve(){d.initialized=!0,h()},reject:c,requestStart:Date.now()};d.pendingSetupRequestId=u,this.activeTaskById.set(u,f),this.executeTask(d,f)}))}const r=this.options.workerInitializationTimeout??Qd;let o;try{await Promise.race([Promise.all(i),new Promise((a,l)=>{o=setTimeout(()=>{l(new Error(`WorkerPoolManager: worker initialization timed out after ${r}ms`))},r)})])}finally{o!=null&&clearTimeout(o)}}handleWorkerError(e,t){const{onWorkerError:i}=this.options;if(i!=null)try{i(t,e.worker)}catch(o){console.error("WorkerPoolManager: onWorkerError threw:",o)}else console.error("Worker error:",t,e);const{pendingSetupRequestId:n}=e;if(n==null)return;const s=this.activeTaskById.get(n);if(s?.type!=="initialize")return;const r=eh(t);i!=null&&sa(r),s.reject(r),this.cleanWorkerAndTask(e,s)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;ethis.setFileResultCache(e.cacheKey,{result:Ei(e,n,i),options:i}))}const t=this.getOrCreateFileHighlightCacheTask(e);return t!=null?this.createRenderTaskCallbacks(t):Promise.resolve()}shouldPrimeFileHighlightCache(e){if(e.cacheKey==null)return console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`),!1;const t=this.getFileResultCache(e);return!et(e)&&(t==null||!re(t.options,this.getFileRenderOptions()))}getOrCreateFileHighlightCacheTask(e){const t=this.getFileHighlightKey(e);if(t==null)return;const i=this.getTaskByHighlightKey(t);if(i!=null){if(i.type!=="file")throw new Error("WorkerPoolManager.getOrCreateFileHighlightCacheTask: Invalid task type");return i.primeCache=!0,i}else{const n=this.submitCacheTask({type:"file",file:e},t);if(n.type!=="file")throw new Error("WorkerPoolManager.getOrCreateFileHighlightCacheTask: Invalid task created");return n}}getPlainFileAST(e,t,i,n){const s=$({theme:this.renderOptions.theme});if(s==null){this.queueInitialization();return}return Ei(e,s,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:i,lines:n})}highlightDiffAST(e,t){const i=this.getDiffResultCache(t);Be(t)||i!=null&&Z(i.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:"diff",diff:t})}primeDiffHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(new Error("WorkerPoolManager.primeDiffHighlightCache: worker pool is not working"));if(!this.shouldPrimeDiffHighlightCache(e))return Promise.resolve();if(this.shouldHighlightOnMainThread(e)){const i=this.getDiffRenderOptions();return this.primeHighlightCacheOnMainThread(Ci({type:"diff",diff:e}),i.theme,n=>this.setDiffResultCache(e.cacheKey,{result:Mi(e,n,i),options:i}))}const t=this.getOrCreateDiffHighlightCacheTask(e);return t!=null?this.createRenderTaskCallbacks(t):Promise.resolve()}shouldPrimeDiffHighlightCache(e){if(e.cacheKey==null)return console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`),!1;const t=this.getDiffResultCache(e);return!Be(e)&&(t==null||!Z(t.options,this.getDiffRenderOptions()))}primeHighlightCacheOnMainThread(e,t,i){function n(){const r=$({theme:t,langs:e});return r!=null&&i(r)}if(n())return Promise.resolve();const{lifecycleGeneration:s}=this;return this.loadSharedHighlighter(fe(t),["text",...e]).then(()=>{if(!this.isCurrentLifecycle(s))throw new Ye;if(!n())throw new ct})}getOrCreateDiffHighlightCacheTask(e){const t=this.getDiffHighlightKey(e);if(t==null)return;const i=this.getTaskByHighlightKey(t);if(i!=null){if(i.type!=="diff")throw new Error("WorkerPoolManager.getOrCreateDiffHighlightCacheTask: Invalid task type");return i.primeCache=!0,i}else{const n=this.submitCacheTask({type:"diff",diff:e},t);if(n.type!=="diff")throw new Error("WorkerPoolManager.getOrCreateDiffHighlightCacheTask: Invalid task created");return n}}getPlainDiffAST(e,t,i,n,s){const r=$({theme:this.renderOptions.theme});if(r==null){this.queueInitialization();return}return Mi(e,r,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:i,expandedHunks:n,collapsedContextThreshold:s})}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers();const e=new Ye;for(const t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,e);this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.initialized=!1,this.workersFailed=!1,this.terminated=!0,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(t=>{ai(t)||console.error(t)})}cancelActiveWorkerTasks(){const e=new Ye;for(const t of this.activeTaskById.values())"reject"in t?t.reject(e):Ce(t)&&this.rejectRenderTaskCallbacks(t,e)}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();const i=this.getHighlightKeyForRequest(t),n=i!=null?this.getTaskByHighlightKey(i):void 0;if(n!=null){this.detachInstanceFromQueuedTasks(e,n),this.addInstanceToTask(n,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);const s=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:o}=this,a=(()=>{switch(t.type){case"file":return{type:"file",id:s,request:{...t,id:s},instances:new Set([e]),primeCache:!1,highlightKey:i,callbacks:new Set,renderOptionsVersion:o,requestStart:r};case"diff":return{type:"diff",id:s,request:{...t,id:s},instances:new Set([e]),primeCache:!1,highlightKey:i,callbacks:new Set,renderOptionsVersion:o,requestStart:r}}})();this.enqueueRenderTask(a,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const i=this.generateRequestId(),n=Date.now(),{renderOptionsVersion:s}=this,r=(()=>{switch(e.type){case"file":return{type:"file",id:i,request:{...e,id:i},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:s,requestStart:n};case"diff":return{type:"diff",id:i,request:{...e,id:i},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:s,requestStart:n}}})();return this.enqueueRenderTask(r),r}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,i){try{const n=$(),s=i.filter(o=>n==null||!gt(o,n));s.length>0&&this.loadSharedHighlighter(fe(this.renderOptions.theme),["text",...s]).catch(o=>{console.error(o)});const r=this.preferredHighlighter==="highlights"?[]:i.filter(o=>!e.langs.has(o));if(r.length>0&&(Xn(r)?t.request.resolvedLanguages=Yn(r):t.request.resolvedLanguages=await Ni(r)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch(n){this.rejectRenderTaskCallbacks(t,ki(n)),this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){const i=this.activeTaskById.get(t.id);try{if(i==null)throw _t;if(t.type==="error"){const n=new Error(t.error);if(t.stack&&(n.stack=t.stack),"reject"in i)i.reject(n);else if(Ce(i))this.notifyHighlightError(i,n),this.rejectRenderTaskCallbacks(i,n);else throw new Error("handleWorkerMessage: unknown task type");throw n}else{if(Ce(i))for(const{name:n}of i.request.resolvedLanguages??[])e.langs.add(n);switch(t.requestType){case"initialize":if(i.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(e,i.request),i.resolve();break;case"set-render-options":if(i.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");i.resolve();break;case"file":{if(i.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{options:n}=t;if(!this.isCurrentRenderTask(i)||!re(n,this.getFileRenderOptions()))throw _t;const{request:s}=i,r={...t.result,code:bi(t.result.code)};this.syncCustomExtensionVersion(e,s),i.cacheKeyAtDispatch!=null&&this.fileCache.set(i.cacheKeyAtDispatch,{result:r,options:n}),this.resolveRenderTaskCallbacks(i),this.notifyFileInstances(i,r,n);break}case"diff":{if(i.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{options:n}=t;if(!this.isCurrentRenderTask(i)||!Z(n,this.getDiffRenderOptions()))throw _t;const{request:s}=i,r={...t.result,code:{deletionLines:bi(t.result.code.deletionLines),additionLines:bi(t.result.code.additionLines)}};this.syncCustomExtensionVersion(e,s),i.cacheKeyAtDispatch!=null&&this.diffCache.set(i.cacheKeyAtDispatch,{result:r,options:n}),this.resolveRenderTaskCallbacks(i),this.notifyDiffInstances(i,r,n);break}}}}catch(n){n!==_t&&console.error(n,i,t)}this.cleanWorkerAndTask(e,i,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,Ce(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,i=t?.id){e.requestId===i&&(e.requestId=void 0),e.pendingSetupRequestId===i&&(e.pendingSetupRequestId=void 0),t!=null&&(Ce(t)&&(this.rejectRenderTaskCallbacks(t,new ct),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){Jd(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);try{t.type==="file"?t.cacheKeyAtDispatch=t.request.file.cacheKey:t.type==="diff"&&(t.cacheKeyAtDispatch=t.request.diff.cacheKey),e.worker.postMessage(t.request)}catch(i){console.error("Failed to post message to worker:",i),Ce(t)?(this.notifyHighlightError(t,i),this.rejectRenderTaskCallbacks(t,ki(i))):"reject"in t&&t.reject(i),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;const i=un();e.customExtensionsVersion>=i||(t.customExtensionsVersion=i,t.customExtensionMap=fn())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(const i of this.workers){if(i.requestId!=null||i.pendingSetupRequestId!=null||!i.initialized)continue;if(t=i,e.length===0)break;let n=!0;for(const s of e)if(!i.langs.has(s)){n=!1;break}if(n)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case"file":return this.getFileHighlightKey(e.file);case"diff":return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(const t of lt(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){const i=this.queuedTaskByInstance.get(e);i==null||i===t||(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(i,e),!i.primeCache&&i.instances.size===0&&this.removeQueuedTask(i))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){const t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.rejectRenderTaskCallbacks(e,new ct),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new ct),this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}createRenderTaskCallbacks(e){return new Promise((t,i)=>{e.callbacks.add({resolve:t,reject:i})})}resolveRenderTaskCallbacks(e){for(const t of e.callbacks)t.resolve();e.callbacks.clear()}rejectRenderTaskCallbacks(e,t){for(const i of e.callbacks)i.reject(t);e.callbacks.clear()}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){const t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(const e of Array.from(this.activeTaskById.values()))Ce(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of lt(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(const t of lt(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of lt(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,i){for(const n of e.instances)this.activeRequestByInstance.get(n)===e.id&&n.onHighlightSuccess(e.request.file,t,i)}notifyDiffInstances(e,t,i){for(const n of e.instances)this.activeRequestByInstance.get(n)===e.id&&n.onHighlightSuccess(e.request.diff,t,i)}notifyHighlightError(e,t){for(const i of lt(e))this.activeRequestByInstance.get(i)===e.id&&i.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(const i of this.iterateRenderTasks())if(i.type==="file"&&this.isCurrentRenderTask(i)&&i.instances.has(e)&&Zi(t,i.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(const i of this.iterateRenderTasks())if(i.type==="diff"&&this.isCurrentRenderTask(i)&&i.instances.has(e)&&N(i.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){const t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const e of this.queuedTasks)yield e;for(const e of this.activeTaskById.values())Ce(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function Jd(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function Ci(e){const t=new Set;switch(e.type){case"file":t.add(e.file.lang??j(e.file.name));break;case"diff":t.add(e.diff.lang??j(e.diff.name)),t.add(e.diff.lang??j(e.diff.prevName??"-"))}return t.delete("text"),Array.from(t)}function Ce(e){return e?.type==="file"||e?.type==="diff"}function lt(e){return e.instances}function ki(e){if(e instanceof Error)return e;if(e!=null&&typeof e=="object"){if("error"in e&&e.error instanceof Error)return e.error;if("message"in e&&typeof e.message=="string")return new Error(e.message)}return new Error(String(e))}function eh(e){const t="error"in e?e.error:void 0,i="message"in e&&typeof e.message=="string"&&e.message!==""?e.message:t instanceof Error?t.message:"the worker script failed to load (the error event carries no message)";return new tr(`WorkerPoolManager: worker failed: ${i}`,t instanceof Error?{cause:t}:void 0)}let ts;function ph({poolOptions:e,highlighterOptions:t}){return ts??=new Zd(e,t),ts}var th=class{name;themeResolver;disposed=!1;constructor(e,t){this.name=e,this.themeResolver=t,ds(e)}codeToHtml(e,t){return $d(e,this.codeToTokens(e,t),t,this.name==="highlights")}get isDisposed(){return this.disposed}dispose(){this.disposed||(this.disposed=!0,this.releaseResources(),hs())}assertNotDisposed(){if(this.disposed)throw new ve}},ih=class{disposed=!1;stableOffset=0;unstable=[];pendingCarriageReturn="";enqueue(e){this.assertActive(),e=this.pendingCarriageReturn+e,this.pendingCarriageReturn=e.endsWith("\r")?"\r":"",this.pendingCarriageReturn!==""&&(e=e.slice(0,-1));const t=this.unstable.length,i=[],{unstable:n,tailLength:s}=this.tokenizeChunk(e,i);return this.pendingCarriageReturn!==""&&n.push({content:"\r",offset:this.stableOffset+s}),this.unstable=n,{recall:t,stable:i,unstable:n}}pushLineBreak(e,t,i){for(let n=0;ne.apply(this,n),t)}}const is=0;let sh=0;var rh=class{backend;#n;#t;#g;#C;#i;#T;#A;#d;#k;#I=!1;#e=[ze];#h=[];#c=0;#u=[];#f=-1;#s=!0;#r=!1;#o=0;#M=++sh;#a=-1;#p=-1;#L;#v=0;#l=[];#w=!1;#z=nh(async e=>{if(this.#I)return;const{startingLine:t=0,totalLines:i=1/0}=e??{},n=Math.min(i===1/0?1/0:t+i,this.#i.lineCount);if(this.#t==null&&!Bt(this.#i.languageId)){if(await this.backend?.loadLanguages([this.#i.languageId]),this.#I)return;this.#t=this.#n.getLanguage(this.#i.languageId)}this.#m(),this.#O(n)},500);#D=({data:e})=>{if(typeof e!="object"||e===null)return;const{type:t,tokenizerId:i,jobId:n}=e;t==="tokenize"&&i===this.#M&&typeof n=="number"&&n===this.#o&&(this.#a>=0?this.#_(n):this.#B(n))};getStringCommentRegexpRangesInLine(e){if(!this.#d||e<0||e>=this.#i.lineCount||(this.#x(),this.#t==null))return null;if(this.#l[e]===void 0){this.#b(e);const t=this.#e[e]??ze,i=this.#E(e,t);this.#e[e+1]=i.state}return this.#l[e]??null}constructor(e,t,i){this.backend=i,this.#n=e,this.#i=t.textDocument,this.#g=t.theme,this.#C=[],this.#T=t.tokenizeMaxLineLength??1e3,this.#A=t.onDeferTokenize,this.#d=t.matchBrackets!==!1,this.#k=t.__debug??!1,this.#x(),this.#m()}setTheme(e){this.#g!==e&&(this.#g=e,this.#m(),this.stopBackgroundTokenize(),this.#e=[ze],this.#h=[],this.#c=0,this.#u=[],this.#t!=null&&this.#i.lineCount>0&&this.#H(0))}#m(){if(this.#g==="")return;this.backend?.getTheme(this.#g);const{colorMap:e}=this.#n.setTheme(this.#g);this.#C=e}dispose(){this.#I=!0,this.stopBackgroundTokenize(),this.#P()}tokenize(e,t,i=!1){if(this.#x(),this.#m(),this.#t==null&&!Bt(this.#i.languageId))throw new Error(`Grammar for language "${this.#i.languageId}" not loaded`);const{lineCount:n}=this.#i,{startingLine:s=0,totalLines:r=1/0}=t??{},o=r===1/0?n:Math.min(s+r,n),a=e.startLine,l=Math.max(s,a),d=t!=null&&r!==1/0&&e.lineDelta>0&&a=o,h=e.lineDelta===0&&(e.changedLineChanges?.every(([,,R])=>R===0)??!0);this.#d&&!h&&(this.#l.length=Math.min(this.#l.length,e.startLine));const c=i&&e.lineDelta!==0&&a>=s,u=h||t==null||a>=l,f=e.changedLineRanges??[[a,e.endLine]];this.#h=[],this.#c=0,this.#u=[];let g=-1;if(a=a&&(h||e.lineDelta<0);h?this.#b(a):(this.#N(e),(t==null||a>=l)&&this.#b(l));let m=0,v=f[m][1],k,y=0,b=h?f[m][0]:l,C=!1;const E=new Map,S=p?new Map:void 0;if(S!=null&&!h){const R=Math.min(g+1,l,o);if(R>a){this.#b(R);let L=a,H=this.#e[L]??ze;for(;L=l?E.set(b,L):S?.set(b,L),u&&(this.#e[b+1]=w),C=b>=v&&(h||c)&&R!=null&&w.equals(R),C){m++;const x=f[m];if(x==null)break;if(x[0]>=o){k=x[0],y=m;break}let A=this.#e[x[0]];if(c)for(let T=b+2;T<=x[0]&&(A=this.#R(T),A!=null);T++)this.#e[T]=A;A==null?(v=x[1],b++):(b=x[0],w=A,v=x[1]),C=!1;continue}b++}if(u&&(b0&&this.#A(S),k!=null)this.#d&&h&&(this.#l.length=Math.min(this.#l.length,k)),this.#H(k,f,y);else if(!C&&b=l?o:a=0&&(this.#p=Math.max(this.#p,this.#a)),this.#a=-1,this.#L=t,this.#v=i,this.#F(),this.#S(n)}#O(e){if(this.#t==null||this.#e.length>e)return;if(!this.#s){this.#a>=0?this.#a=Math.max(this.#a,e):this.#p=Math.max(this.#p,e);return}const t=++this.#o;this.#s=!1,this.#r=!1,this.#f=this.#e.length-1,this.#a=e,this.#p=-1,this.#L=void 0,this.#v=0,this.#F(),this.#S(t)}#E(e,t){const i=this.#i.getLineText(e);if(i.length>=this.#T)return console.warn(`[diffs] Line(${e}) too long to tokenize: ${i.length}`),this.#y(e,null),{resolvedTokens:[[0,"",i]],state:t};if(this.#t==null||i===""||i.trim()==="")return this.#y(e,null),{resolvedTokens:[[0,"",i]],state:t};const n=ns(this.#t,this.#C,i,t,is,this.#d);return this.#y(e,n.bracketIgnoredRanges),{resolvedTokens:n.resolvedTokens,state:n.ruleStack}}#y(e,t){this.#d&&(this.#l[e]=t)}#N(e){const t=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],i=e.startLine+1;i<=this.#e.length-i?(this.#h=this.#e,this.#c=0,this.#e=this.#e.slice(0,i)):(this.#c=i,this.#h=this.#e.slice(i),this.#e.length=Math.min(this.#e.length,i)),this.#u=t}#R(e){let t=e;for(let i=this.#u.length-1;i>=0;i--){const[n,s,r]=this.#u[i];if(r!==0){if(t>s)t-=r;else if(t>n)return this.#e[e]}}return this.#h[t-this.#c]??this.#e[e]}#b(e,t){const i=Math.min(Math.max(0,e),this.#i.lineCount);if(this.#e.length>i||this.#t==null)return!0;const n=t==null?0:performance.now();let s=this.#e.length-1,r=this.#e[s]??ze;for(;st)break}return s>=i}#_(e){if(this.#s||this.#r||this.#t==null||e!==this.#o)return;this.#m();const t=this.#b(this.#a,1);if(!(this.#s||this.#r||e!==this.#o)){if(t){this.stopBackgroundTokenize();return}this.#f=this.#e.length-1,this.#S(e)}}#B(e){if(this.#s||this.#r||this.#t==null||e!==this.#o)return;this.#m();const t=performance.now(),i=new Map,n=this.#i.lineCount,s=this.#L;let r=this.#f,o=this.#e[r]??ze,a=!1,l=this.#v,d=s?.[l]?.[1];for(;r=d&&h!=null&&o.equals(h),r++,a){l++;const u=s?.[l];if(u==null)break;if(d=u[1],this.#e[u[0]]==null)a=!1;else{r=u[0],o=this.#e[r]??o,a=!1;continue}}if(performance.now()-t>1)break}if(this.#A(i),!(this.#s||this.#r||e!==this.#o)){if(a||r>=n){const h=this.#p;this.stopBackgroundTokenize(),h>=0&&this.#O(h);return}this.#f=r,this.#v=l,this.#S(e)}}};function ns(e,t,i,n,s,r=!0,o=!0){const a=e.tokenizeLine2(i,n,s);a.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${i.substring(0,100)}`);const l=a.tokens,d=l.length/2,h=[],c=[];if(!o&&!r)return{ruleStack:a.ruleStack,resolvedTokens:h,bracketIgnoredRanges:c};for(let u=0;u0&&c.push([f,g])}return{ruleStack:a.ruleStack,resolvedTokens:h,bracketIgnoredRanges:c}}function Bt(e){return e==="text"||e==="ansi"}var oh=class Lr extends ih{highlighter;options;#n="";#t;constructor(t,i){super(),this.highlighter=t,this.options=i}tokenizeChunk(t,i){const n=(this.#n+t).split(/(\r\n|\r|\n)/);let s=[];for(let r=0;r({...d,offset:d.offset+this.stableOffset}));r+1{const{createOnigurumaEngine:s}=await import("./shiki-core.mjs").then(r=>r.g);return{createOnigurumaEngine:s}},[])).createOnigurumaEngine(Ee(()=>import("./shiki-wasm.mjs"),[])):(await Ee(async()=>{const{createJavaScriptRegexEngine:s}=await import("./shiki-core.mjs").then(r=>r.h);return{createJavaScriptRegexEngine:s}},[])).createJavaScriptRegexEngine(),n=await Tr({themes:[],langs:[],engine:i});return new wr(t,n)}constructor(t,i){super(t,bt(t)),this.raw=i}getTheme(t){this.assertNotDisposed();const i=this.loadedThemes.get(t),n=this.themeResolver.getResolvedTheme(t)??i;if(n==null)throw new Error(`Theme "${t}" has not been resolved`);if(i!==n){const s=n.textmate??(n.cssVariables!=null?Ar(n.cssVariables):void 0);if(s==null)throw new Error(`Theme "${t}" does not support Shiki`);this.raw.setTheme({...s,name:t}),this.loadedThemes.set(t,n)}return n}codeToTokens(t,i){return this.raw.codeToTokens(t,this.resolveOptions(i))}createEditorTokenizer(t){return new rh(this.raw,t,this)}createStreamTokenizer(t){return new oh(this.raw,this.resolveOptions(t))}async loadLanguages(t){this.assertNotDisposed();const i=t.filter(n=>!this.attachedLanguages.has(n));Ud(await Ni(i),this)}hasLoadedLanguages(t){if(this.disposed)return!1;let i;return t.every(n=>this.attachedLanguages.has(n)?!0:cs.has(n)?!1:(i??=this.raw.getLoadedLanguages(),i.includes(n)))}attachLanguages(t){this.assertNotDisposed();for(const i of t){if(this.attachedLanguages.has(i.name))continue;const n=i.data.find(s=>s.name===i.name||s.aliases?.includes(i.name)===!0);if(n==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${i.name}" as its name or an alias.`);this.raw.loadLanguageSync(i.data);try{this.raw.getLanguage(i.name)}catch{throw new Error(`attachResolvedLanguages: "${n.name}" is already loaded without alias "${i.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(i.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:t,themes:i,...n}){if(this.assertNotDisposed(),t!=null)return this.getTheme(t),{...n,theme:t};if(i==null)throw new Error("A theme or themes option is required");for(const s of Object.values(i))this.getTheme(s);return{...n,themes:i}}};const lh=Object.freeze(Object.defineProperty({__proto__:null,ShikiHighlighter:ah},Symbol.toStringTag,{value:"Module"}));export{ih as B,fh as C,th as D,j as a,Xi as b,bt as c,he as f,ph as g,uh as p}; diff --git a/Resources/review-diff-viewer/chunks/diff-worker.mjs b/Resources/review-diff-viewer/chunks/diff-worker.mjs index de2e04ddc..57dfa9ea9 100644 --- a/Resources/review-diff-viewer/chunks/diff-worker.mjs +++ b/Resources/review-diff-viewer/chunks/diff-worker.mjs @@ -1,6 +1,6 @@ -import{_ as ke}from"./preload-helper.mjs";import{c as ve,n as U}from"./pierre-theming.mjs";import{e as Ie,i as xe,a as we,d as Ce,g as Se,h as Ee}from"./shiki-core.mjs";(()=>{try{return!1}catch{return!1}})();const fe={dark:"pierre-dark",light:"pierre-light"},te=new Map,ie=new Set;function ee(e,n){e=Array.isArray(e)?e:[e];for(const t of e){if(ie.has(t.name))continue;let i=te.get(t.name);i==null&&(i=t,te.set(t.name,i));const l=i.data.find(o=>o.name===i.name||o.aliases?.includes(i.name)===!0);if(l==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${i.name}" as its name or an alias.`);n.loadLanguageSync(i.data);try{n.getLanguage(i.name)}catch{throw new Error(`attachResolvedLanguages: "${l.name}" is already loaded without alias "${i.name}". Load the alias first or give the grammar a unique name.`)}ie.add(i.name)}}const oe=new Set,G=ve();function he(e,n){e=Array.isArray(e)?e:[e];for(let t of e){let i;if(typeof t=="string"){if(i=G.getResolvedTheme(t),i==null)throw new Error(`loadResolvedThemes: ${t} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=t,t=t.name,G.getResolvedTheme(t)==null&&G.seedResolvedTheme(t,i);oe.has(t)||(oe.add(t),n.loadThemeSync(i))}}const F=new Map;let re=0;const M={"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",odin:"odin",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",BUCK:"python",BUILD:"python",PACKAGE:"python",WORKSPACE:"python",Tiltfile:"python",bazel:"python",bxl:"python",bzl:"python",bzlmod:"python",star:"python",sky:"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 J(e){const n=le(e);if(n!=null)return n;const t=e.split(/[/\\]/).pop()??e;return t===e?"text":le(t)??"text"}function le(e){if(F.has(e))return F.get(e)??"text";if(Object.hasOwn(M,e))return M[e]??null;const n=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(n!=null){if(F.has(n[1]))return F.get(n[1])??"text";if(Object.hasOwn(M,n[1]))return M[n[1]]??"text"}const t=e.match(/\.([^.]+)$/)?.[1]??"";return F.has(t)?F.get(t)??"text":Object.hasOwn(M,t)?M[t]??"text":null}function Le(e,n){if(e<=re)return!1;F.clear();for(const t in n){const i=n[t];i!=null&&F.set(t,i)}return re=e,!0}function Z(e,n){for(const t of n)e.push(t)}function H(e){let n=e.length;return e.charCodeAt(n-1)===10&&(n--,e.charCodeAt(n-1)===13&&n--),e.slice(0,n)}function Re(e){return{type:"text",value:e}}function Te({tagName:e,children:n=[],properties:t={}}){return{type:"element",tagName:e,properties:t,children:n}}function Oe(e){let n=e.children[0];for(;n!=null;){if(n.type==="element"&&n.tagName==="code")return n;"children"in n?n=n.children[0]:n=null}}function je(e,n,t){const i=typeof t.lineInfo=="function"?t.lineInfo(n):t.lineInfo[n-1];if(i==null){const l=`processLine: line ${n}, contains no state.lineInfo`;throw console.error(l,{node:e,line:n,state:t}),new Error(l)}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(Re(` -`)),e}const D=Symbol("no-token"),K=Symbol("multiple-tokens");function pe(e){const n=Ne(e);if(n!=null)return n;let t=D;const i=[];let l=[],o;const s=()=>{if(l.length===0||o==null){l=[],o=void 0;return}if(l.length===1){const r=l[0];if(r?.type==="element"){Ae(r,o);for(const a of r.children)B(a)}else B(r);i.push(r),l=[],o=void 0;return}for(const r of l)B(r);i.push(Te({tagName:"span",properties:{"data-char":o},children:l})),l=[],o=void 0},d=r=>{if(r!==D){if(r===K){t=K;return}if(t===D){t=r;return}t!==r&&(t=K)}};for(const r of e.children){const a=r.type==="element"?pe(r):D;if(d(a),typeof a!="number"){s(),i.push(r);continue}o!=null&&o!==a&&s(),o??=a,l.push(r)}return s(),e.children=i,t}function Ne(e){const n=e.properties["data-char"];if(typeof n=="number")return n}function B(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const n of e.children)B(n)}}function Ae(e,n){e.properties["data-char"]=n}function me(e=!1,n=!1){const t={lineInfo:[]},i=[{line(l){return delete l.properties.class,l},pre(l){const o=Oe(l),s=[];if(o!=null){let d=1;for(const r of o.children)r.type==="element"&&(e&&pe(r),s.push(je(r,d,t)),d++);o.children=s}return l},...e?{tokens(l){for(const o of l){let s=0;for(const d of o){const r=d;r.__lineChar??=s,s+=d.content.length}}},preprocess(l,o){o.mergeWhitespaces="never"},span(l,o,s,d,r){if(r?.offset!=null&&r.content!=null){const a=r.__lineChar;return a!=null&&(l.properties["data-char"]=a),l}return l}}:null}];return n&&i.push(ze,se),e&&i.push({line:l=>(l.type==="element"&&l.children.length===0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]}),l)}),{state:t,transformers:i,toClass:se}}const se=Ie({classPrefix:"hl-"}),ze={name:"token-style-normalizer",tokens(e){for(const n of e)for(const t of n){if(t.htmlStyle!=null)continue;const i={};t.color!=null&&(i.color=t.color),t.bgColor!=null&&(i["background-color"]=t.bgColor),t.fontStyle!=null&&t.fontStyle!==0&&((t.fontStyle&1)!==0&&(i["font-style"]="italic"),(t.fontStyle&2)!==0&&(i["font-weight"]="bold"),(t.fontStyle&4)!==0&&(i["text-decoration"]="underline")),Object.keys(i).length>0&&(t.htmlStyle=i)}}};function j(e){return`--${e==="token"?"diffs-token":"diffs"}-`}function ge({theme:e=fe,highlighter:n,prefix:t}){let i="";if(typeof e=="string"){const l=n.getTheme(e),o=U(l);i+=`color:${o.fg};`,i+=`background-color:${o.bg};`,i+=`${j("global")}fg:${o.fg};`,i+=`${j("global")}bg:${o.bg};`,i+=X(l,t)}else{let l=n.getTheme(e.dark),o=U(l);i+=`${j("global")}dark:${o.fg};`,i+=`${j("global")}dark-bg:${o.bg};`,i+=X(l,"dark"),l=n.getTheme(e.light),o=U(l),i+=`${j("global")}light:${o.fg};`,i+=`${j("global")}light-bg:${o.bg};`,i+=X(l,"light")}return i}function X(e,n){n=n!=null?`${n}-`:"";let t="";const i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];i!=null&&(t+=`${j("global")}${n}addition-color:${i};`);const l=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];l!=null&&(t+=`${j("global")}${n}deletion-color:${l};`);const o=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return o!=null&&(t+=`${j("global")}${n}modified-color:${o};`),t}function Q(e){let n=e.children[0];for(;n!=null;){if(n.type==="element"&&n.tagName==="code")return n.children;"children"in n?n=n.children[0]:n=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}function Y(e,n){return e-(n===0?0:1)}function ae(e,n){return Y(e,n)+n}function Fe({isPartial:e,rangeSize:n,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:l}){const o=Math.max(n,0);if(o===0||e)return{fromStart:0,fromEnd:0,rangeSize:o,collapsedLines:o,renderAll:!1};if(t===!0||o<=l)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};const s=t?.get(i),d=Math.min(Math.max(s?.fromStart??0,0),o),r=Math.min(Math.max(s?.fromEnd??0,0),o),a=d+r,u=a>=o;return{fromStart:u?o:d,fromEnd:u?0:r,rangeSize:o,collapsedLines:Math.max(o-a,0),renderAll:u}}function _e({fileDiff:e,errorPrefix:n}){const t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const i=e.additionLines.length-ae(t.additionStart,t.additionCount),l=e.deletionLines.length-ae(t.deletionStart,t.deletionCount);if(i<=0&&l<=0)return 0;if(i!==l)throw new Error(`${n}: trailing context mismatch (additions=${i}, deletions=${l}) for ${e.name}`);return Math.min(i,l)}function Me({fileDiff:e,hunkIndex:n,expandedHunks:t,collapsedContextThreshold:i,errorPrefix:l}){if(n!==e.hunks.length-1)return;const o=_e({fileDiff:e,errorPrefix:l});if(o<=0)return;if(t===!0||o<=i)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};const s=t?.get(e.hunks.length),d=Math.min(Math.max(s?.fromStart??0,0),o);return{fromStart:d,fromEnd:0,rangeSize:o,collapsedLines:o-d,renderAll:d>=o}}function $e({diff:e,diffStyle:n,startingLine:t=0,totalLines:i=1/0,expandedHunks:l,collapsedContextThreshold:o=1,callback:s}){const d=De({diff:e,diffStyle:n,startingLine:t,expandedHunks:l,collapsedContextThreshold:o}),r={viewportStart:t,viewportEnd:t+i,isWindowedHighlight:t>0||i<1/0,splitCount:d.splitCount,unifiedCount:d.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!r.isWindowedHighlight)return!1;const a=r.unifiedCount>=t+i,u=r.splitCount>=t+i;return a&&u},shouldSkip(a,u){if(!r.isWindowedHighlight)return!1;const f=a>0&&r.unifiedCount+a<=t,c=u>0&&r.splitCount+u<=t;return f&&c},incrementCounts(a,u){r.unifiedCount+=a,r.splitCount+=u},isInWindow(a,u){if(!r.isWindowedHighlight)return!0;const f=r.isInUnifiedWindow(a),c=r.isInSplitWindow(u);return f||c},isInUnifiedWindow(a){return!r.isWindowedHighlight||r.unifiedCount>=t-a&&r.unifiedCount=t-a&&r.splitCount0?0:N===c.splitLineStart+c.splitLineCount-1?L.collapsedLines:0},f=function(){return I?0:(I=!0,b.collapsedLines)};const c=e.hunks[a];if(c==null)throw new Error("iterateOverDiff: invalid hunk index");if(r.shouldBreak())break;const v=Y(c.deletionStart,c.deletionCount),h=Y(c.additionStart,c.additionCount),R=!e.isPartial&&c.deletionCount===0?v:c.deletionLineIndex,O=!e.isPartial&&c.additionCount===0?h:c.additionLineIndex,b=Fe({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:l,hunkIndex:a,collapsedContextThreshold:o}),L=a===r.finalHunkIndex?Me({fileDiff:e,hunkIndex:a,expandedHunks:l,collapsedContextThreshold:o,errorPrefix:"iterateOverDiff"}):void 0,y=b.fromStart+b.fromEnd;let I=b.collapsedLines===0;if(r.shouldSkip(y,y))r.incrementCounts(y,y),f();else{let p=c.unifiedLineStart-b.rangeSize,N=c.splitLineStart-b.rangeSize,E=R-b.rangeSize,T=O-b.rangeSize,w=v+1-b.rangeSize,z=h+1-b.rangeSize;if(W(r,b.fromStart,n,C=>r.emit({hunkIndex:a,hunk:c,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:w+C,lineIndex:E+C,noEOFCR:!1,unifiedLineIndex:p+C,splitLineIndex:N+C},additionLine:{unifiedLineIndex:p+C,splitLineIndex:N+C,lineIndex:T+C,lineNumber:z+C,noEOFCR:!1}}))||(p=c.unifiedLineStart-b.fromEnd,N=c.splitLineStart-b.fromEnd,E=R-b.fromEnd,T=O-b.fromEnd,w=v+1-b.fromEnd,z=h+1-b.fromEnd,W(r,b.fromEnd,n,C=>r.emit({hunkIndex:a,hunk:c,collapsedBefore:f(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:w+C,lineIndex:E+C,noEOFCR:!1,unifiedLineIndex:p+C,splitLineIndex:N+C},additionLine:{unifiedLineIndex:p+C,splitLineIndex:N+C,lineIndex:T+C,lineNumber:z+C,noEOFCR:!1}}),()=>{f()})))break e}let g=c.unifiedLineStart,k=c.splitLineStart,m=R,S=O,x=v+1,A=h+1;const be=c.hunkContent.at(-1);for(const p of c.hunkContent){if(r.shouldBreak())break e;const N=p===be;if(p.type==="context"){if(r.shouldSkip(p.lines,p.lines))r.incrementCounts(p.lines,p.lines),f();else if(W(r,p.lines,n,E=>{const T=N&&E===p.lines-1,w=g+E,z=k+E;return r.emit({hunkIndex:a,hunk:c,collapsedBefore:f(),collapsedAfter:u(w,z),type:"context",deletionLine:{lineNumber:x+E,lineIndex:m+E,noEOFCR:T&&c.noEOFCRDeletions,unifiedLineIndex:w,splitLineIndex:z},additionLine:{unifiedLineIndex:w,splitLineIndex:z,lineIndex:S+E,lineNumber:A+E,noEOFCR:T&&c.noEOFCRAdditions}})},()=>{f()}))break e;g+=p.lines,k+=p.lines,m+=p.lines,S+=p.lines,x+=p.lines,A+=p.lines}else{const E=Math.max(p.deletions,p.additions),T=p.deletions+p.additions;if(!r.shouldSkip(T,E)){const w=qe(r,p);(w[0]?.[0]??0)>0&&f();for(const[z,C]of w)for(let $=z;${const z=w===T-1;return r.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:z?p:0,type:"context-expanded",deletionLine:{lineNumber:x+w,lineIndex:m+w,noEOFCR:!1,unifiedLineIndex:g+w,splitLineIndex:k+w},additionLine:{unifiedLineIndex:g+w,splitLineIndex:k+w,lineIndex:S+w,lineNumber:A+w,noEOFCR:!1}})},void 0,()=>r.shouldBreak()))break e}}}function De({diff:e,diffStyle:n,startingLine:t,expandedHunks:i,collapsedContextThreshold:l}){return{hunkIndex:0,splitCount:0,unifiedCount:0}}function We(e,n,t){if(!e.isWindowedHighlight||n<=0)return[0,n];const i=[];function l(d){const r=Math.max(0,e.viewportStart-d),a=Math.min(n,e.viewportEnd-d);a>r&&i.push([r,a])}if(l(e.unifiedCount),l(e.splitCount),i.length===0)return[0,0];let o=i[0][0],s=i[0][1];for(let d=1;d0&&(e.incrementCounts(s,s),l?.());let r=s;for(;r=d){e.incrementCounts(n-r,n-r);break}if(e.isInWindow(0,0)){if(i(r)===!0)return!0}else e.incrementCounts(1,1);r++}return!1}function qe(e,n,t){if(!e.isWindowedHighlight)return[[0,Math.max(n.deletions,n.additions)]];const i=[];function l(r,a){if(r+a<=e.viewportStart||r>=e.viewportEnd)return;const u=Math.max(0,e.viewportStart-r),f=Math.min(a,e.viewportEnd-r);return f>u?[u,f]:void 0}function o(r,a){return r}function s(r,a){if(r==null)return;const[u,f]=o(r);f>u&&i.push([u,f])}if(s(l(e.unifiedCount,n.deletions)),s(l(e.unifiedCount+n.deletions,n.additions)),s(l(e.splitCount,n.deletions)),s(l(e.splitCount,n.additions)),i.length===0)return i;i.sort((r,a)=>r[0]-a[0]);const d=[i[0]];for(const[r,a]of i.slice(1)){const u=d[d.length-1];r<=u[1]?u[1]=Math.max(u[1],a):d.push([r,a])}return d}function Be({hunkIndex:e,hunk:n,collapsedAfter:t,collapsedBefore:i,diffStyle:l,index:o,unifiedLineIndex:s,splitLineIndex:d,additionLineIndex:r,deletionLineIndex:a,additionLineNumber:u,deletionLineNumber:f,content:c,isLastContent:v,unifiedCount:h,splitCount:R}){const O=o=c.deletions?s+o:void 0:o=c.deletions?r+(o-c.deletions):void 0:o=c.deletions?u+(o-c.deletions):void 0:o0||o<1/0,a=typeof t.theme=="string"?n.getTheme(t.theme).type:void 0,u=ge({theme:t.theme,highlighter:n}),f=i&&!r&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":t.lineDiffType,c={deletionLines:[],additionLines:[]},{maxLineDiffLength:v}=t,h=!i&&!e.isPartial,R=i?s:void 0,O=new Map;function b(y){const I=h?0:y,g=O.get(I)??Ge();return O.set(I,g),g}function L(y,I,g,k){if(r){let m=g.at(-1);(m==null||m.targetIndex+m.count!==I)&&(m={targetIndex:I,originalOffset:k.length,count:0},g.push(m)),m.count++}k.push(y)}$e({diff:e,diffStyle:"both",startingLine:l,totalLines:o,expandedHunks:r?R:!0,collapsedContextThreshold:d,callback:({hunkIndex:y,additionLine:I,deletionLine:g,type:k})=>{const m=b(y),S=I!=null?I.splitLineIndex:g.splitLineIndex;k==="change"&&I!=null&&g!=null&&Ue({additionLine:e.additionLines[I.lineIndex],deletionLine:e.deletionLines[g.lineIndex],deletionLineIndex:m.deletionContent.length,additionLineIndex:m.additionContent.length,deletionDecorations:m.deletionDecorations,additionDecorations:m.additionDecorations,lineDiffType:f,maxLineDiffLength:v}),g!=null&&(L(e.deletionLines[g.lineIndex],g.lineIndex,m.deletionSegments,m.deletionContent),m.deletionInfo.push({type:k==="change"?"change-deletion":k,lineNumber:g.lineNumber,altLineNumber:k==="change"?void 0:I.lineNumber??void 0,lineIndex:`${g.unifiedLineIndex},${S}`})),I!=null&&(L(e.additionLines[I.lineIndex],I.lineIndex,m.additionSegments,m.additionContent),m.additionInfo.push({type:k==="change"?"change-addition":k,lineNumber:I.lineNumber,altLineNumber:k==="change"?void 0:g.lineNumber??void 0,lineIndex:`${I.unifiedLineIndex},${S}`}))}});for(const y of O.values()){if(y.deletionContent.length===0&&y.additionContent.length===0)continue;const I={name:e.prevName??e.name,contents:y.deletionContent.value},g={name:e.name,contents:y.additionContent.value},{deletionLines:k,additionLines:m}=Ke({deletionFile:I,deletionInfo:y.deletionInfo,deletionDecorations:y.deletionDecorations,additionFile:g,additionInfo:y.additionInfo,additionDecorations:y.additionDecorations,highlighter:n,options:t,languageOverride:i?"text":e.lang});if(h){c.deletionLines=k,c.additionLines=m;continue}if(y.deletionSegments.length>0)for(const S of y.deletionSegments)for(let x=0;x0)for(const S of y.additionSegments)for(let x=0;xd||n.length>d))return;const r=s==="char"?Se(e,n):Ee(e,n);if(s==="word-line"){Pe(r,{deletionLineIndex:t,additionLineIndex:i,deletionDecorations:l,additionDecorations:o});return}const a=[],u=[],f=s==="word-alt",c=r.at(-1);for(const h of r){const R=h===c;!h.added&&!h.removed?(q({item:h,arr:a,enableJoin:f,isNeutral:!0,isLastItem:R}),q({item:h,arr:u,enableJoin:f,isNeutral:!0,isLastItem:R})):h.removed?q({item:h,arr:a,enableJoin:f,isLastItem:R}):q({item:h,arr:u,enableJoin:f,isLastItem:R})}let v=0;for(const h of a)h[0]===1&&l.push(V({line:t,spanStart:v,spanLength:h[1].length})),v+=h[1].length;v=0;for(const h of u)h[0]===1&&o.push(V({line:i,spanStart:v,spanLength:h[1].length})),v+=h[1].length}function Ge(){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 Ke({deletionFile:e,additionFile:n,deletionInfo:t,additionInfo:i,highlighter:l,deletionDecorations:o,additionDecorations:s,languageOverride:d,options:{theme:r,...a}}){const u=d??J(e.name),f=d??J(n.name),{state:c,transformers:v}=me(a.useTokenTransformer),h=typeof r=="string"?{...a,lang:"text",theme:r,transformers:v,decorations:void 0,defaultColor:!1,cssVariablePrefix:j("token"),tokenizeTimeLimit:0}:{...a,lang:"text",themes:r,transformers:v,decorations:void 0,defaultColor:!1,cssVariablePrefix:j("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(h.lang=u,c.lineInfo=t,h.decorations=o,Q(l.codeToHast(H(e.contents),h))),additionLines:n.contents===""?[]:(h.lang=f,h.decorations=s,c.lineInfo=i,Q(l.codeToHast(H(n.contents),h)))}}const de=10,ce=13,Xe=4,Je=40;function Ze(e){const n=[0];let t=e.indexOf("\r"),i=e.indexOf(` -`),l=0,o=0;for(;t!==-1||i!==-1;){let s;if(t!==-1&&(i===-1||t{const l=n[i],o=n[i+1]??e.length;return e.slice(l,o)})}const Ye={forcePlainText:!1};function en(e,n,{theme:t,tokenizeMaxLineLength:i,useTokenTransformer:l},{forcePlainText:o,startingLine:s,totalLines:d,lines:r}=Ye){o?(s??=0,d??=1/0):(s=0,d=1/0);const a=s>0||d<1/0,{state:u,transformers:f}=me(l),c=o?"text":e.lang??J(e.name),v=typeof t=="string"?n.getTheme(t).type:void 0,h=ge({theme:t,highlighter:n});u.lineInfo=L=>({type:"context",lineIndex:L-1+s,lineNumber:L+s});const R=typeof t=="string"?{lang:c,theme:t,transformers:f,defaultColor:!1,cssVariablePrefix:j("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0}:{lang:c,themes:t,transformers:f,defaultColor:!1,cssVariablePrefix:j("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0},O=Q(n.codeToHast(nn(a?tn(r??Qe(e.contents),s,d):e.contents),R)),b=a?new Array(s):O;return a&&Z(b,O),{code:b,themeStyles:h,baseThemeType:v}}function nn(e){return e.replace(/\r(?!\n)/g,` -`)}function tn(e,n,t){if(e.length===0)return"";const i=Math.min(n+t,e.length);return e.slice(n,i).join("")}let ue,_={theme:fe,useTokenTransformer:!1,tokenizeMaxLineLength:1e3,lineDiffType:"word-alt",maxLineDiffLength:1e3};self.addEventListener("error",e=>{console.error("[Shiki Worker] Unhandled error:",e.error)});self.addEventListener("message",e=>{on(e.data)});async function on(e){try{switch(e.type){case"initialize":await rn(e);break;case"set-render-options":await ln(e);break;case"file":await sn(e);break;case"diff":await an(e);break;default:throw new Error(`Unknown request type: ${e.type}`)}}catch(n){console.error("Worker error:",n),un(e.id,n)}}async function rn({id:e,renderOptions:n,preferredHighlighter:t,resolvedThemes:i,resolvedLanguages:l,customExtensionsVersion:o,customExtensionMap:s}){let d=P(t);"then"in d&&(d=await d),ne({customExtensionsVersion:o,customExtensionMap:s}),he(i,d),l!=null&&ee(l,d),_=n,postMessage({type:"success",id:e,requestType:"initialize",sentAt:Date.now()})}async function ln({id:e,renderOptions:n,resolvedThemes:t}){let i=P();"then"in i&&(i=await i),he(t,i),_=n,postMessage({type:"success",id:e,requestType:"set-render-options",sentAt:Date.now()})}async function sn({id:e,file:n,resolvedLanguages:t,customExtensionsVersion:i,customExtensionMap:l}){let o=P();"then"in o&&(o=await o),ne({customExtensionsVersion:i,customExtensionMap:l}),t!=null&&ee(t,o);const s={theme:_.theme,useTokenTransformer:_.useTokenTransformer,tokenizeMaxLineLength:_.tokenizeMaxLineLength};dn(e,en(n,o,s),s)}async function an({id:e,diff:n,resolvedLanguages:t,customExtensionsVersion:i,customExtensionMap:l}){let o=P();"then"in o&&(o=await o),ne({customExtensionsVersion:i,customExtensionMap:l}),t!=null&&ee(t,o),cn(e,Ve(n,o,_),_)}function P(e="shiki-js"){return ue??=xe({themes:[],langs:[],engine:e==="shiki-wasm"?we(ke(()=>import("./shiki-wasm.mjs"),[])):Ce()}),ue}function ne({customExtensionsVersion:e,customExtensionMap:n}){if(!(e==null&&n==null)){if(e==null||n==null)throw new Error("Worker request must include both customExtensionsVersion and customExtensionMap");Le(e,n)}}function dn(e,n,t){postMessage({type:"success",requestType:"file",id:e,result:n,options:t,sentAt:Date.now()})}function cn(e,n,t){postMessage({type:"success",requestType:"diff",id:e,result:n,options:t,sentAt:Date.now()})}function un(e,n){const t={type:"error",id:e,error:n instanceof Error?n.message:String(n),stack:n instanceof Error?n.stack:void 0};postMessage(t)} +import{_ as ie}from"./preload-helper.mjs";import{d as Se,a as Le}from"./shiki-core.mjs";import{n as Oe}from"./pierre-theming.mjs";(()=>{try{return!1}catch{return!1}})();const pe={dark:"pierre-dark",light:"pierre-light"},oe=new Map,Tt=new Map,jt=new Map,Re=new Set;function ee(e,t){for(const n of Array.isArray(e)?e:[e]){let r=oe.get(n.name);r==null&&(r=n,oe.set(n.name,r)),t.attachLanguages([r]),Re.add(r.name)}}let F,J=0;var Mt=class extends Error{constructor(){super("Highlighter is disposed"),this.name="HighlighterDisposedError"}};function Te(e){return e??F??"shiki-js"}function je(e){if(F!=null&&F!==e)throw new Error(`Cannot load the "${e}" highlighter while "${F}" is in use. Only one highlighter type can be active at a time; dispose every "${F}" instance (disposeHighlighter() disposes the shared one) before switching.`)}function Me(e){je(e),F=e,J++}function Ae(){J--,J===0&&(F=void 0)}async function Ne(e){const t=Te(e);Me(t);try{if(t==="highlights"){const{HighlightsHighlighter:r}=await ie(async()=>{const{HighlightsHighlighter:s}=await import("./highlights-CpZm9DAR.mjs");return{HighlightsHighlighter:s}},[]);return new r}const{ShikiHighlighter:n}=await ie(async()=>{const{ShikiHighlighter:r}=await import("./shiki-Ci4cdHsM.mjs");return{ShikiHighlighter:r}},[]);return await n.create(t)}finally{Ae()}}function ge(e,t){for(const n of Array.isArray(e)?e:[e]){const r=typeof n=="string"?t.themeResolver.getResolvedThemes([n])[0]:n;t.themeResolver.seedResolvedTheme(r.name,r)}}const $=new Map;let re=0;const z={"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",odin:"odin",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",BUCK:"python",BUILD:"python",PACKAGE:"python",WORKSPACE:"python",Tiltfile:"python",bazel:"python",bxl:"python",bzl:"python",bzlmod:"python",star:"python",sky:"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){const t=se(e);if(t!=null)return t;const n=e.split(/[/\\]/).pop()??e;return n===e?"text":se(n)??"text"}function se(e){if($.has(e))return $.get(e)??"text";if(Object.hasOwn(z,e))return z[e]??null;const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if($.has(t[1]))return $.get(t[1])??"text";if(Object.hasOwn(z,t[1]))return z[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return $.has(n)?$.get(n)??"text":Object.hasOwn(z,n)?z[n]??"text":null}function $e(e,t){if(e<=re)return!1;$.clear();for(const n in t){const r=t[n];r!=null&&$.set(n,r)}return re=e,!0}function ye(e,t){for(const n of t)e.push(n)}function Z(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}function N(e){return`--${e==="token"?"diffs-token":"diffs"}-`}function be({theme:e=pe,highlighter:t,prefix:n}){let r="";if(typeof e=="string"){const s=t.getTheme(e),i=G(s,t);r+=`color:${i.fg};`,r+=`background-color:${i.bg};`,r+=`${N("global")}fg:${i.fg};`,r+=`${N("global")}bg:${i.bg};`,r+=K(s,n)}else{let s=t.getTheme(e.dark),i=G(s,t);r+=`${N("global")}dark:${i.fg};`,r+=`${N("global")}dark-bg:${i.bg};`,r+=K(s,"dark"),s=t.getTheme(e.light),i=G(s,t),r+=`${N("global")}light:${i.fg};`,r+=`${N("global")}light-bg:${i.bg};`,r+=K(s,"light")}return r}function G(e,t){if(t.name==="highlights"&&e.zed?.cssVariables===!0){const n=N("token");return{fg:`var(${n}foreground)`,bg:`var(${n}background)`}}return Oe(e)}function K(e,t){t=t!=null?`${t}-`:"";let n="";const r=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];r!=null&&(n+=`${N("global")}${t}addition-color:${r};`);const s=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];s!=null&&(n+=`${N("global")}${t}deletion-color:${s};`);const i=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return i!=null&&(n+=`${N("global")}${t}modified-color:${i};`),n}function ve(e,t,n){return{lang:e,...typeof t=="string"?{theme:t}:{themes:t},defaultColor:!1,cssVariablePrefix:N("token"),tokenizeMaxLineLength:n,tokenizeTimeLimit:0}}function Q(e,t){return e-(t===0?0:1)}function le(e,t){return Q(e,t)+t}function Fe({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:s}){const i=Math.max(t,0);if(i===0||e)return{fromStart:0,fromEnd:0,rangeSize:i,collapsedLines:i,renderAll:!1};if(n===!0||i<=s)return{fromStart:i,fromEnd:0,rangeSize:i,collapsedLines:0,renderAll:!0};const l=n?.get(r),a=Math.min(Math.max(l?.fromStart??0,0),i),o=Math.min(Math.max(l?.fromEnd??0,0),i),d=a+o,p=d>=i;return{fromStart:p?i:a,fromEnd:p?0:o,rangeSize:i,collapsedLines:Math.max(i-d,0),renderAll:p}}function De({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 r=e.additionLines.length-le(n.additionStart,n.additionCount),s=e.deletionLines.length-le(n.deletionStart,n.deletionCount);if(r<=0&&s<=0)return 0;if(r!==s)throw new Error(`${t}: trailing context mismatch (additions=${r}, deletions=${s}) for ${e.name}`);return Math.min(r,s)}function ze({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:s}){if(t!==e.hunks.length-1)return;const i=De({fileDiff:e,errorPrefix:s});if(i<=0)return;if(n===!0||i<=r)return{fromStart:i,fromEnd:0,rangeSize:i,collapsedLines:0,renderAll:!0};const l=n?.get(e.hunks.length),a=Math.min(Math.max(l?.fromStart??0,0),i);return{fromStart:a,fromEnd:0,rangeSize:i,collapsedLines:i-a,renderAll:a>=i}}function _e({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:s,collapsedContextThreshold:i=1,callback:l}){const a=He({diff:e,diffStyle:t,startingLine:n,expandedHunks:s,collapsedContextThreshold:i}),o={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:a.splitCount,unifiedCount:a.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!o.isWindowedHighlight)return!1;const d=o.unifiedCount>=n+r,p=o.splitCount>=n+r;return d&&p},shouldSkip(d,p){if(!o.isWindowedHighlight)return!1;const c=d>0&&o.unifiedCount+d<=n,u=p>0&&o.splitCount+p<=n;return c&&u},incrementCounts(d,p){o.unifiedCount+=d,o.splitCount+=p},isInWindow(d,p){if(!o.isWindowedHighlight)return!0;const c=o.isInUnifiedWindow(d),u=o.isInSplitWindow(p);return c||u},isInUnifiedWindow(d){return!o.isWindowedHighlight||o.unifiedCount>=n-d&&o.unifiedCount=n-d&&o.splitCount0?0:S===u.splitLineStart+u.splitLineCount-1?w.collapsedLines:0},c=function(){return h?0:(h=!0,f.collapsedLines)};const u=e.hunks[d];if(u==null)throw new Error("iterateOverDiff: invalid hunk index");if(o.shouldBreak())break;const m=Q(u.deletionStart,u.deletionCount),b=Q(u.additionStart,u.additionCount),y=!e.isPartial&&u.deletionCount===0?m:u.deletionLineIndex,g=!e.isPartial&&u.additionCount===0?b:u.additionLineIndex,f=Fe({isPartial:e.isPartial,rangeSize:u.collapsedBefore,expandedHunks:s,hunkIndex:d,collapsedContextThreshold:i}),w=d===o.finalHunkIndex?ze({fileDiff:e,hunkIndex:d,expandedHunks:s,collapsedContextThreshold:i,errorPrefix:"iterateOverDiff"}):void 0,I=f.fromStart+f.fromEnd;let h=f.collapsedLines===0;if(o.shouldSkip(I,I))o.incrementCounts(I,I),c();else{let k=u.unifiedLineStart-f.rangeSize,S=u.splitLineStart-f.rangeSize,T=y-f.rangeSize,M=g-f.rangeSize,L=m+1-f.rangeSize,A=b+1-f.rangeSize;if(W(o,f.fromStart,t,R=>o.emit({hunkIndex:d,hunk:u,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:L+R,lineIndex:T+R,noEOFCR:!1,unifiedLineIndex:k+R,splitLineIndex:S+R},additionLine:{unifiedLineIndex:k+R,splitLineIndex:S+R,lineIndex:M+R,lineNumber:A+R,noEOFCR:!1}}))||(k=u.unifiedLineStart-f.fromEnd,S=u.splitLineStart-f.fromEnd,T=y-f.fromEnd,M=g-f.fromEnd,L=m+1-f.fromEnd,A=b+1-f.fromEnd,W(o,f.fromEnd,t,R=>o.emit({hunkIndex:d,hunk:u,collapsedBefore:c(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:L+R,lineIndex:T+R,noEOFCR:!1,unifiedLineIndex:k+R,splitLineIndex:S+R},additionLine:{unifiedLineIndex:k+R,splitLineIndex:S+R,lineIndex:M+R,lineNumber:A+R,noEOFCR:!1}}),()=>{c()})))break e}let v=u.unifiedLineStart,x=u.splitLineStart,C=y,E=g,O=m+1,j=b+1;const H=u.hunkContent.at(-1);for(const k of u.hunkContent){if(o.shouldBreak())break e;const S=k===H;if(k.type==="context"){if(o.shouldSkip(k.lines,k.lines))o.incrementCounts(k.lines,k.lines),c();else if(W(o,k.lines,t,T=>{const M=S&&T===k.lines-1,L=v+T,A=x+T;return o.emit({hunkIndex:d,hunk:u,collapsedBefore:c(),collapsedAfter:p(L,A),type:"context",deletionLine:{lineNumber:O+T,lineIndex:C+T,noEOFCR:M&&u.noEOFCRDeletions,unifiedLineIndex:L,splitLineIndex:A},additionLine:{unifiedLineIndex:L,splitLineIndex:A,lineIndex:E+T,lineNumber:j+T,noEOFCR:M&&u.noEOFCRAdditions}})},()=>{c()}))break e;v+=k.lines,x+=k.lines,C+=k.lines,E+=k.lines,O+=k.lines,j+=k.lines}else{const T=Math.max(k.deletions,k.additions),M=k.deletions+k.additions;if(!o.shouldSkip(M,T)){const L=qe(o,k);(L[0]?.[0]??0)>0&&c();for(const[A,R]of L)for(let _=A;_{const A=L===M-1;return o.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:A?k:0,type:"context-expanded",deletionLine:{lineNumber:O+L,lineIndex:C+L,noEOFCR:!1,unifiedLineIndex:v+L,splitLineIndex:x+L},additionLine:{unifiedLineIndex:v+L,splitLineIndex:x+L,lineIndex:E+L,lineNumber:j+L,noEOFCR:!1}})},void 0,()=>o.shouldBreak()))break e}}}function He({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:s}){return{hunkIndex:0,splitCount:0,unifiedCount:0}}function We(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];const r=[];function s(a){const o=Math.max(0,e.viewportStart-a),d=Math.min(t,e.viewportEnd-a);d>o&&r.push([o,d])}if(s(e.unifiedCount),s(e.splitCount),r.length===0)return[0,0];let i=r[0][0],l=r[0][1];for(let a=1;a0&&(e.incrementCounts(l,l),s?.());let o=l;for(;o=a){e.incrementCounts(t-o,t-o);break}if(e.isInWindow(0,0)){if(r(o)===!0)return!0}else e.incrementCounts(1,1);o++}return!1}function qe(e,t,n){if(!e.isWindowedHighlight)return[[0,Math.max(t.deletions,t.additions)]];const r=[];function s(o,d){if(o+d<=e.viewportStart||o>=e.viewportEnd)return;const p=Math.max(0,e.viewportStart-o),c=Math.min(d,e.viewportEnd-o);return c>p?[p,c]:void 0}function i(o,d){return o}function l(o,d){if(o==null)return;const[p,c]=i(o);c>p&&r.push([p,c])}if(l(s(e.unifiedCount,t.deletions)),l(s(e.unifiedCount+t.deletions,t.additions)),l(s(e.splitCount,t.deletions)),l(s(e.splitCount,t.additions)),r.length===0)return r;r.sort((o,d)=>o[0]-d[0]);const a=[r[0]];for(const[o,d]of r.slice(1)){const p=a[a.length-1];o<=p[1]?p[1]=Math.max(p[1],d):a.push([o,d])}return a}function Be({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:s,index:i,unifiedLineIndex:l,splitLineIndex:a,additionLineIndex:o,deletionLineIndex:d,additionLineNumber:p,deletionLineNumber:c,content:u,isLastContent:m,unifiedCount:b,splitCount:y}){const g=i=u.deletions?l+i:void 0:i=u.deletions?o+(i-u.deletions):void 0:i=u.deletions?p+(i-u.deletions):void 0:i{if(s.length===0||i==null){s=[],i=void 0;return}if(s.length===1){const o=s[0];if(o?.type==="element"){Ke(o,i);for(const d of o.children)P(d)}else P(o);r.push(o),s=[],i=void 0;return}for(const o of s)P(o);r.push(Ve({tagName:"span",properties:{"data-char":i},children:s})),s=[],i=void 0},a=o=>{if(o!==B){if(o===X){n=X;return}if(n===B){n=o;return}n!==o&&(n=X)}};for(const o of e.children){const d=o.type==="element"?Ie(o):B;if(a(d),typeof d!="number"){l(),r.push(o);continue}i!=null&&i!==d&&l(),i??=d,s.push(o)}return l(),e.children=r,n}function Ge(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function P(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)P(t)}}function Ke(e,t){e.properties["data-char"]=t}function xe(e,{state:t,lazyLineAST:n=!1,cacheHtmlStyles:r=!1,useTokenTransformer:s=!1,mergeWhitespaces:i="always",decorations:l=[],lineOffsets:a=[]}){let o;for(const c of l){const u=o??=new Map,m={...c,start:ce(c.start,a),end:ce(c.end,a)},b=Math.min(m.end.line,e.length-1);for(let y=m.start.line;y<=b;y++){let g=u.get(y);g==null&&u.set(y,g=[]),g.push(m)}}const d=(c,u)=>{let m;if(s||i!=="never"){let f="",w=0;for(let I=0;I0&&m.push({content:h.content.slice(0,x),offset:h.offset}),m.push({...h,content:v,offset:h.offset+x});const C=x+v.length;Cd(u,c))}return p}function Xe(e,t,n,r){let s=0;for(const i of t)i.content!==""&&(e.children.push(Ee(i,ke(i,r),i.content,s,n)),s+=i.content.length);return s}function Je(e,t,n,r,s,i){n.length>1&&n.sort((g,f)=>g.start.line!==f.start.line?g.start.line-f.start.line:g.start.character!==f.start.character?g.start.character-f.start.character:g.end.line!==f.end.line?f.end.line-g.end.line:f.end.character-g.end.character);const l=t.reduce((g,f)=>g+f.content.length,0),a=[];for(let g=0;gg.position-f.position);const o=[],d=[];let p=0;const c=(g,f)=>{let w=0,I=o.length;for(;w>>1;o[h].order{let g=e,f=0;for(const w of o){if(d[f]?.range!==w){d.length=f;const I={type:"element",tagName:"span",properties:{...w.decoration.properties},children:[]};g.children.push(I),d.push({range:w,node:I})}g=d[f++].node}return d.length=f,g};let m=e;const b=g=>{const f=p;for(;a[p]?.position===g;)p++;let w=!1;for(let I=f;I=g&&(h.to>g||h.from===g||g===l)&&(c(h,!0),h.from===h.to&&(w=!0))}if(w){u();for(let I=f;I>>1;t[s]<=e?n=s:r=s}return{line:n,character:e-(t[n]??0)}}const Ze={forcePlainText:!1};function Qe(e,t,n,{forcePlainText:r,lazyLineAST:s=!1,startingLine:i,totalLines:l,expandedHunks:a,collapsedContextThreshold:o=1}=Ze){r?(i??=0,l??=1/0):(i=0,l=1/0);const d=i>0||l<1/0;s&&=!r&&!n.useTokenTransformer;const p=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,c=be({theme:n.theme,highlighter:t}),u=r&&!d&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,m={deletionLines:[],additionLines:[]},{maxLineDiffLength:b}=n,y=!r&&!e.isPartial,g=r?a:void 0,f=new Map;function w(h){const v=y?0:h,x=f.get(v)??tt();return f.set(v,x),x}function I(h,v,x,C){if(d){let E=x.at(-1);(E==null||E.targetIndex+E.count!==v)&&(E={targetIndex:v,originalOffset:C.length,count:0},x.push(E)),E.count++}C.push(h)}_e({diff:e,diffStyle:"both",startingLine:i,totalLines:l,expandedHunks:d?g:!0,collapsedContextThreshold:o,callback:({hunkIndex:h,additionLine:v,deletionLine:x,type:C})=>{const E=w(h),O=v!=null?v.splitLineIndex:x.splitLineIndex;C==="change"&&v!=null&&x!=null&&et({additionLine:e.additionLines[v.lineIndex],deletionLine:e.deletionLines[x.lineIndex],deletionLineIndex:E.deletionContent.length,additionLineIndex:E.additionContent.length,deletionDecorations:E.deletionDecorations,additionDecorations:E.additionDecorations,lineDiffType:u,maxLineDiffLength:b}),x!=null&&(I(e.deletionLines[x.lineIndex],x.lineIndex,E.deletionSegments,E.deletionContent),E.deletionInfo.push({type:C==="change"?"change-deletion":C,lineNumber:x.lineNumber,altLineNumber:C==="change"?void 0:v.lineNumber??void 0,lineIndex:`${x.unifiedLineIndex},${O}`})),v!=null&&(I(e.additionLines[v.lineIndex],v.lineIndex,E.additionSegments,E.additionContent),E.additionInfo.push({type:C==="change"?"change-addition":C,lineNumber:v.lineNumber,altLineNumber:C==="change"?void 0:x.lineNumber??void 0,lineIndex:`${v.unifiedLineIndex},${O}`}))}});for(const h of f.values()){if(h.deletionContent.length===0&&h.additionContent.length===0)continue;const v={name:e.prevName??e.name,contents:h.deletionContent.value},x={name:e.name,contents:h.additionContent.value},{deletionLines:C,additionLines:E}=nt({deletionFile:v,deletionInfo:h.deletionInfo,deletionDecorations:h.deletionDecorations,additionFile:x,additionInfo:h.additionInfo,additionDecorations:h.additionDecorations,highlighter:t,options:n,languageOverride:r?"text":e.lang,lazyLineAST:s});if(y){m.deletionLines=C,m.additionLines=E;continue}for(const[O,j,H]of[[m.deletionLines,C,h.deletionSegments],[m.additionLines,E,h.additionSegments]])if(H.length>0)for(const k of H)for(let S=0;Sj[S])}else ye(O,j)}return{code:m,themeStyles:c,baseThemeType:p}}function Ye(e,{deletionLineIndex:t,additionLineIndex:n,deletionDecorations:r,additionDecorations:s}){let i=0,l=0,a=-1,o=0,d=-1,p=0;for(const{value:c,added:u,removed:m}of e)m?(a===-1&&(a=i),i+=c.length,o=i):u?(d===-1&&(d=l),l+=c.length,p=l):(i+=c.length,l+=c.length);a!==-1&&r.push(V({line:t,spanStart:a,spanLength:o-a})),d!==-1&&s.push(V({line:n,spanStart:d,spanLength:p-d}))}function et({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:s,additionDecorations:i,lineDiffType:l,maxLineDiffLength:a}){if(e==null||t==null||l==="none"||(e=Z(e),t=Z(t),e.length>a||t.length>a))return;const o=l==="char"?Se(e,t):Le(e,t);if(l==="word-line"){Ye(o,{deletionLineIndex:n,additionLineIndex:r,deletionDecorations:s,additionDecorations:i});return}const d=[],p=[],c=l==="word-alt",u=o.at(-1);for(const b of o){const y=b===u;!b.added&&!b.removed?(q({item:b,arr:d,enableJoin:c,isNeutral:!0,isLastItem:y}),q({item:b,arr:p,enableJoin:c,isNeutral:!0,isLastItem:y})):b.removed?q({item:b,arr:d,enableJoin:c,isLastItem:y}):q({item:b,arr:p,enableJoin:c,isLastItem:y})}let m=0;for(const b of d)b[0]===1&&s.push(V({line:n,spanStart:m,spanLength:b[1].length})),m+=b[1].length;m=0;for(const b of p)b[0]===1&&i.push(V({line:r,spanStart:m,spanLength:b[1].length})),m+=b[1].length}function tt(){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 nt({lazyLineAST:e,deletionFile:t,additionFile:n,deletionInfo:r,additionInfo:s,highlighter:i,deletionDecorations:l,additionDecorations:a,languageOverride:o,options:{theme:d,useTokenTransformer:p,tokenizeMaxLineLength:c}}){const u=(m,b,y)=>m.contents===""?[]:xe(i.codeToTokens(Z(m.contents),ve(o??me(m.name),d,c)).tokens,{state:{lineInfo:b},useTokenTransformer:p,decorations:y,lazyLineAST:e,cacheHtmlStyles:i.name==="highlights"});return{deletionLines:u(t,r,l),additionLines:u(n,s,a)}}const de=10,ue=13,it=4,ot=40;function rt(e){const t=[0];let n=e.indexOf("\r"),r=e.indexOf(` +`),s=0,i=0;for(;n!==-1||r!==-1;){let l;if(n!==-1&&(r===-1||n{const s=t[r],i=t[r+1]??e.length;return e.slice(s,i)})}const lt={forcePlainText:!1};function at(e,t,{theme:n,tokenizeMaxLineLength:r,useTokenTransformer:s},{forcePlainText:i,lazyLineAST:l=!1,startingLine:a,totalLines:o,lines:d}=lt){i?(a??=0,o??=1/0):(a=0,o=1/0);const p=a>0||o<1/0,c={lineInfo:[]},u=i?"text":e.lang??me(e.name),m=typeof n=="string"?t.getTheme(n).type:void 0,b=be({theme:n,highlighter:t});c.lineInfo=f=>({type:"context",lineIndex:f-1+a,lineNumber:f+a});const y=xe(t.codeToTokens(ct(p?dt(d??st(e.contents),a,o):e.contents),ve(u,n,r)).tokens,{state:c,useTokenTransformer:s,lazyLineAST:l&&!i&&!s,cacheHtmlStyles:t.name==="highlights"}),g=p?new Array(a):y;return p&&ye(g,y),{code:g,themeStyles:b,baseThemeType:m}}function ct(e){return e.replace(/\r(?!\n)/g,` +`)}function dt(e,t,n){if(e.length===0)return"";const r=Math.min(t+n,e.length);return e.slice(t,r).join("")}const fe=0,ut=1,ft=2,ht=3,pt=0,gt=1,mt=2,yt=3,bt=4,vt=5,wt=6;function Y(e){let t=new Int32Array(Math.max(32,Math.min(65536,e.length*32))),n=0;const r=new Uint32Array(e.length*2),s=[],i=new Map,l=[];let a="";function o(c){if(n===t.length){const u=new Int32Array(t.length*2);u.set(t),t=u}t[n++]=c}function d(c){let u=i.get(c);return u==null&&(u=s.length,s.push(c),i.set(c,u)),u}function p(c){let u=0;for(const m in c)u++;if(c?.type==="text"&&u===2)o(ut),o(c.value.length),a+=c.value;else if(c?.type==="element"&&u===4&&c.properties!=null&&Object.getPrototypeOf(c.properties)===Object.prototype){o(ft),o(d(c.tagName));let m=0;for(const b in c.properties)m++;o(m);for(const b in c.properties){const y=c.properties[b];o(d(b)),y===void 0?o(pt):y===null?o(gt):y===!0?o(mt):y===!1?o(yt):typeof y=="string"?(o(bt),o(d(y))):typeof y=="number"&&(y|0)===y&&!Object.is(y,-0)?(o(vt),o(y)):(o(wt),o(l.length),l.push(y))}o(c.children.length);for(let b=0;b{console.error("[Diffs Worker] Unhandled error:",e.error)});self.addEventListener("message",e=>{kt(e.data)});async function kt(e){try{switch(e.type){case"initialize":await It(e);break;case"set-render-options":await xt(e);break;case"file":await Et(e);break;case"diff":await Ct(e);break;default:throw new Error(`Unknown request type: ${e.type}`)}}catch(t){console.error("Worker error:",t),St(e.id,t)}}async function It({id:e,renderOptions:t,preferredHighlighter:n,resolvedThemes:r,resolvedLanguages:s,customExtensionsVersion:i,customExtensionMap:l,resultFormat:a}){let o=U(n);"then"in o&&(o=await o),ne({customExtensionsVersion:i,customExtensionMap:l}),ge(r,o),s!=null&&ee(s,o),D=t,te=a==="hast-ops-v1",postMessage({type:"success",id:e,requestType:"initialize",sentAt:Date.now()})}async function xt({id:e,renderOptions:t,resolvedThemes:n}){let r=U();"then"in r&&(r=await r),ge(n,r),D=t,postMessage({type:"success",id:e,requestType:"set-render-options",sentAt:Date.now()})}async function Et({id:e,file:t,resolvedLanguages:n,customExtensionsVersion:r,customExtensionMap:s}){let i=U();"then"in i&&(i=await i),ne({customExtensionsVersion:r,customExtensionMap:s}),n!=null&&ee(n,i);const l={theme:D.theme,useTokenTransformer:D.useTokenTransformer,tokenizeMaxLineLength:D.tokenizeMaxLineLength},a=at(t,i,l),o=te?Y(a.code):void 0,d={type:"success",requestType:"file",id:e,result:a,options:l,sentAt:Date.now()};postMessage(o==null?d:{...d,result:{...a,code:o}},o==null?[]:[o.ops.buffer,o.offsets.buffer])}async function Ct({id:e,diff:t,resolvedLanguages:n,customExtensionsVersion:r,customExtensionMap:s}){let i=U();"then"in i&&(i=await i),ne({customExtensionsVersion:r,customExtensionMap:s}),n!=null&&ee(n,i);const l=Qe(t,i,D),a=te?{deletionLines:Y(l.code.deletionLines),additionLines:Y(l.code.additionLines)}:void 0,o={type:"success",requestType:"diff",id:e,result:l,options:D,sentAt:Date.now()};postMessage(a==null?o:{...o,result:{...l,code:a}},a==null?[]:[a.deletionLines.ops.buffer,a.deletionLines.offsets.buffer,a.additionLines.ops.buffer,a.additionLines.offsets.buffer])}function U(e){return he??=Ne(e),he}function ne({customExtensionsVersion:e,customExtensionMap:t}){if(!(e==null&&t==null)){if(e==null||t==null)throw new Error("Worker request must include both customExtensionsVersion and customExtensionMap");$e(e,t)}}function St(e,t){const n={type:"error",id:e,error:t instanceof Error?t.message:String(t),stack:t instanceof Error?t.stack:void 0};postMessage(n)}export{Mt as H,jt as R,ye as a,Me as b,xe as c,ee as d,oe as e,N as f,Tt as g,Ae as r}; diff --git a/Resources/review-diff-viewer/chunks/highlights-CpZm9DAR.mjs b/Resources/review-diff-viewer/chunks/highlights-CpZm9DAR.mjs new file mode 100644 index 000000000..a019b94d4 --- /dev/null +++ b/Resources/review-diff-viewer/chunks/highlights-CpZm9DAR.mjs @@ -0,0 +1 @@ +import{D as m,c as T,B as k}from"./stream-tokenizer-DK9xp5M5.mjs";import{f as v,a as L}from"./diff-worker.mjs";import{c as z,i as x,L as d}from"./pierre-highlights.mjs";import"./preload-helper.mjs";import"./pierre-theming.mjs";import"./shiki-core.mjs";var D=class{options;resolveOptions;#e;#t;#r=!1;#n;#i=!1;#o;#s;constructor(e,t){this.options=e,this.resolveOptions=t,this.#t=e.textDocument.version,this.#e=this.#h()}#h(){return new d({...this.resolveOptions({lang:this.options.textDocument.languageId,theme:this.options.theme,cssVariablePrefix:v("token"),tokenizeMaxLineLength:this.options.tokenizeMaxLineLength??1e3}),code:this.options.textDocument.getText(),renderRange:[0,0],onDeferTokenize:e=>this.#l(e)})}#l(e){const t=this.#o;if(t!=null){for(const[i,n]of e)t.set(i,n);return}const s=this.#n;if(s!=null){for(const i of e.keys())i>=s[0]&&i{const s=this.#s;this.#s=void 0,s!=null&&s.size>0&&!this.#r&&this.options.onDeferTokenize(s)})}tokenize(e,t,s=!1){const i=this.options.textDocument,n=Math.min(t?.startingLine??0,i.lineCount),o=Math.min(n+(t?.totalLines??1/0),i.lineCount),r=Math.max(n,e.startLine);this.#i=!1;let h;if(this.#t!==i.version)this.#s=void 0,h=this.#c(e,[n,o]).lines,this.#t=i.version;else if(this.#e.lineCount!==i.lineCount)this.#s=void 0,h=this.#e.reset(i.getText(),{renderRange:[n,o]}).lines;else{if(h=new Map,this.#a(h,r,o),this.#s!=null)for(const l of h.keys())this.#s.delete(l);return h}return(e.lineDelta===0?e.changedLineChanges?.some(([,,l])=>l!==0)??!1:!s)&&this.#a(h,r,o),h}#c(e,t){const s=this.options.textDocument,i={renderRange:t};if(Math.abs(s.version-this.#t)===1&&e.changes.length>0&&this.#e.lineCount===e.previousLineCount)try{const n=this.#e.applyEdits(e.changes.map(({range:o,text:r})=>({range:o,newText:r})),i);if(this.#e.lineCount===s.lineCount)return n}catch(n){if(!(n instanceof RangeError))throw n}return this.#e.reset(s.getText(),i)}#a(e,t,s){this.#n=[t,s];try{this.#e.flush(s)}finally{this.#n=void 0}for(let i=t;i[o.offset,o.color??"",o.content]))}}setTheme(e){e!==this.options.theme&&(this.options.theme=e,this.#e.dispose(),this.#s=void 0,this.#i=!1,this.#t=this.options.textDocument.version,this.#e=this.#h())}getStringCommentRegexpRangesInLine(e){const t=this.options.textDocument;if(this.options.matchBrackets===!1||e<0||e>=t.lineCount)return null;const s=new Map;this.#o=s;try{(this.#t!==t.version||this.#e.lineCount!==t.lineCount)&&(this.#s=void 0,this.#e.reset(t.getText(),{renderRange:[e,e+1]}),this.#t=t.version),this.#e.flush(e+1)}finally{this.#o=void 0,this.#i&&this.#e.pause()}return s.size>0&&this.#u(s),this.#e.getLineTokens(e).bracketIgnoredRanges}prebuildStateStack(){}stopBackgroundTokenize(){this.pauseBackgroundTokenize()}pauseBackgroundTokenize(){this.#i=!0,this.#e.pause()}resumeBackgroundTokenize(){this.#i=!1,this.#e.resume()}dispose(){this.#r=!0,this.#s=void 0,this.#e.dispose()}};const g=1024,p={line:0,character:0};var C=class f extends k{options;#e;#t=g;constructor(t){super(),this.options=t,this.#e=new d(t)}tokenizeChunk(t,s){const i=[...t.matchAll(/\r\n|\r|\n/g)],n=this.#e.lineCount-1,o={line:n,character:this.#e.getLineLength(n)};this.#e.applyEdits([{range:{start:o,end:o},newText:t}]);const r=this.#e.lineCount-1;let h=[];for(let a=n;a<=r;a++){const{tokens:u}=this.#e.getLineTokens(a);for(const c of u)c.offset+=this.stableOffset;athis.#t){const a=this.#e.getText(),{lineChanges:u}=this.#e.applyEdits([{range:{start:p,end:{line:r-1,character:0}},newText:""}]);if(u.every(c=>c.newEndLine<=1))this.#t=g;else{const c=this.#e.getText().length;this.#e.applyEdits([{range:{start:p,end:p},newText:a.slice(0,a.length-c)}]),this.#t=r*2}}return{unstable:h,tailLength:l}}clone(){this.assertActive();const t=new f(this.options);return t.#e.reset(this.#e.getText()),this.copyStateTo(t),t}resetSource(){this.#e.reset(""),this.#t=g}releaseSource(){this.#e.dispose()}},O=class extends m{usedThemes=new Map;constructor(){super("highlights",T("highlights"))}getTheme(e){this.assertNotDisposed();const t=this.themeResolver.getResolvedTheme(e)??this.usedThemes.get(e);if(t==null)throw new Error(`Theme "${e}" has not been resolved`);return this.usedThemes.set(e,t),t}codeToTokens(e,t){return this.assertNotDisposed(),z(e,this.resolveOptions(t))}createEditorTokenizer(e){return this.assertNotDisposed(),new D(e,t=>this.resolveOptions(t))}createStreamTokenizer(e){return new C(this.resolveOptions(e))}loadLanguages(){return this.assertNotDisposed(),Promise.resolve()}hasLoadedLanguages(){return!this.disposed}attachLanguages(){this.assertNotDisposed()}releaseResources(){this.usedThemes.clear()}resolveOptions({theme:e,themes:t,...s}){const i=x(s.lang)?s.lang:"text";if(e!=null)return{...s,lang:i,theme:this.getZedTheme(e)};if(t==null)throw new Error("A theme or themes option is required");const n={};for(const[o,r]of Object.entries(t))n[o]=this.getZedTheme(r);return{...s,lang:i,themes:n}}getZedTheme(e){const t=this.getTheme(e);if(t.zed==null)throw new Error(`Theme "${e}" does not support Highlights`);return t.zed}};export{O as HighlightsHighlighter}; diff --git a/Resources/review-diff-viewer/chunks/highlights.mjs b/Resources/review-diff-viewer/chunks/highlights.mjs new file mode 100644 index 000000000..e93c1246f --- /dev/null +++ b/Resources/review-diff-viewer/chunks/highlights.mjs @@ -0,0 +1 @@ +import{f as m,B as T,b as k,D as v,c as L}from"./diff-vendor.mjs";import{L as d,c as z,i as x}from"./pierre-highlights.mjs";import"./shiki-core.mjs";import"./preload-helper.mjs";import"./pierre-theming.mjs";var D=class{options;resolveOptions;#e;#t;#r=!1;#n;#i=!1;#o;#s;constructor(e,t){this.options=e,this.resolveOptions=t,this.#t=e.textDocument.version,this.#e=this.#h()}#h(){return new d({...this.resolveOptions({lang:this.options.textDocument.languageId,theme:this.options.theme,cssVariablePrefix:m("token"),tokenizeMaxLineLength:this.options.tokenizeMaxLineLength??1e3}),code:this.options.textDocument.getText(),renderRange:[0,0],onDeferTokenize:e=>this.#l(e)})}#l(e){const t=this.#o;if(t!=null){for(const[i,n]of e)t.set(i,n);return}const s=this.#n;if(s!=null){for(const i of e.keys())i>=s[0]&&i{const s=this.#s;this.#s=void 0,s!=null&&s.size>0&&!this.#r&&this.options.onDeferTokenize(s)})}tokenize(e,t,s=!1){const i=this.options.textDocument,n=Math.min(t?.startingLine??0,i.lineCount),o=Math.min(n+(t?.totalLines??1/0),i.lineCount),r=Math.max(n,e.startLine);this.#i=!1;let h;if(this.#t!==i.version)this.#s=void 0,h=this.#c(e,[n,o]).lines,this.#t=i.version;else if(this.#e.lineCount!==i.lineCount)this.#s=void 0,h=this.#e.reset(i.getText(),{renderRange:[n,o]}).lines;else{if(h=new Map,this.#a(h,r,o),this.#s!=null)for(const l of h.keys())this.#s.delete(l);return h}return(e.lineDelta===0?e.changedLineChanges?.some(([,,l])=>l!==0)??!1:!s)&&this.#a(h,r,o),h}#c(e,t){const s=this.options.textDocument,i={renderRange:t};if(Math.abs(s.version-this.#t)===1&&e.changes.length>0&&this.#e.lineCount===e.previousLineCount)try{const n=this.#e.applyEdits(e.changes.map(({range:o,text:r})=>({range:o,newText:r})),i);if(this.#e.lineCount===s.lineCount)return n}catch(n){if(!(n instanceof RangeError))throw n}return this.#e.reset(s.getText(),i)}#a(e,t,s){this.#n=[t,s];try{this.#e.flush(s)}finally{this.#n=void 0}for(let i=t;i[o.offset,o.color??"",o.content]))}}setTheme(e){e!==this.options.theme&&(this.options.theme=e,this.#e.dispose(),this.#s=void 0,this.#i=!1,this.#t=this.options.textDocument.version,this.#e=this.#h())}getStringCommentRegexpRangesInLine(e){const t=this.options.textDocument;if(this.options.matchBrackets===!1||e<0||e>=t.lineCount)return null;const s=new Map;this.#o=s;try{(this.#t!==t.version||this.#e.lineCount!==t.lineCount)&&(this.#s=void 0,this.#e.reset(t.getText(),{renderRange:[e,e+1]}),this.#t=t.version),this.#e.flush(e+1)}finally{this.#o=void 0,this.#i&&this.#e.pause()}return s.size>0&&this.#u(s),this.#e.getLineTokens(e).bracketIgnoredRanges}prebuildStateStack(){}stopBackgroundTokenize(){this.pauseBackgroundTokenize()}pauseBackgroundTokenize(){this.#i=!0,this.#e.pause()}resumeBackgroundTokenize(){this.#i=!1,this.#e.resume()}dispose(){this.#r=!0,this.#s=void 0,this.#e.dispose()}};const g=1024,p={line:0,character:0};var C=class f extends T{options;#e;#t=g;constructor(t){super(),this.options=t,this.#e=new d(t)}tokenizeChunk(t,s){const i=[...t.matchAll(/\r\n|\r|\n/g)],n=this.#e.lineCount-1,o={line:n,character:this.#e.getLineLength(n)};this.#e.applyEdits([{range:{start:o,end:o},newText:t}]);const r=this.#e.lineCount-1;let h=[];for(let a=n;a<=r;a++){const{tokens:u}=this.#e.getLineTokens(a);for(const c of u)c.offset+=this.stableOffset;athis.#t){const a=this.#e.getText(),{lineChanges:u}=this.#e.applyEdits([{range:{start:p,end:{line:r-1,character:0}},newText:""}]);if(u.every(c=>c.newEndLine<=1))this.#t=g;else{const c=this.#e.getText().length;this.#e.applyEdits([{range:{start:p,end:p},newText:a.slice(0,a.length-c)}]),this.#t=r*2}}return{unstable:h,tailLength:l}}clone(){this.assertActive();const t=new f(this.options);return t.#e.reset(this.#e.getText()),this.copyStateTo(t),t}resetSource(){this.#e.reset(""),this.#t=g}releaseSource(){this.#e.dispose()}},M=class extends v{usedThemes=new Map;constructor(){super("highlights",L("highlights"))}getTheme(e){this.assertNotDisposed();const t=this.themeResolver.getResolvedTheme(e)??this.usedThemes.get(e);if(t==null)throw new Error(`Theme "${e}" has not been resolved`);return this.usedThemes.set(e,t),t}codeToTokens(e,t){return this.assertNotDisposed(),z(e,this.resolveOptions(t))}createEditorTokenizer(e){return this.assertNotDisposed(),new D(e,t=>this.resolveOptions(t))}createStreamTokenizer(e){return new C(this.resolveOptions(e))}loadLanguages(){return this.assertNotDisposed(),Promise.resolve()}hasLoadedLanguages(){return!this.disposed}attachLanguages(){this.assertNotDisposed()}releaseResources(){this.usedThemes.clear()}resolveOptions({theme:e,themes:t,...s}){const i=x(s.lang)?s.lang:"text";if(e!=null)return{...s,lang:i,theme:this.getZedTheme(e)};if(t==null)throw new Error("A theme or themes option is required");const n={};for(const[o,r]of Object.entries(t))n[o]=this.getZedTheme(r);return{...s,lang:i,themes:n}}getZedTheme(e){const t=this.getTheme(e);if(t.zed==null)throw new Error(`Theme "${e}" does not support Highlights`);return t.zed}};export{M as HighlightsHighlighter}; diff --git a/Resources/review-diff-viewer/chunks/pierre-highlights.mjs b/Resources/review-diff-viewer/chunks/pierre-highlights.mjs new file mode 100644 index 000000000..da9367db9 --- /dev/null +++ b/Resources/review-diff-viewer/chunks/pierre-highlights.mjs @@ -0,0 +1,8 @@ +import{_ as t}from"./preload-helper.mjs";const M=["none","attribute","attribute.jsx","boolean","comment","comment.doc","constant","constant.builtin","constructor","diff.minus","diff.plus","embedded","emphasis","emphasis.strong","function","function.definition","function.method","keyword","keyword.control","keyword.declaration","keyword.import","keyword.operator","label","namespace","number","operator","predictive","preproc","primary","property","property.json_key","punctuation","punctuation.bracket","punctuation.bracket.html","punctuation.bracket.jsx","punctuation.delimiter","punctuation.delimiter.html","punctuation.delimiter.jsx","punctuation.list_marker","punctuation.markup","punctuation.special","selector","selector.class","selector.id","string","string.escape","string.regex","string.special","string.special.symbol","tag","tag.doctype","tag.jsx","text.jsx","text.literal","title","type","type.builtin","type.class","variable","variable.parameter","variable.special","enum","hint","keyword.jsdoc","link_text","link_uri","selector.pseudo","tag.component.jsx","type.jsdoc","variable.jsdoc","variant","background","foreground"],XA="--hls-",KA=new TextEncoder,VA=/^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i,qA=/^color\(display-p3\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:\s*\/\s*[+-]?(?:\d+(?:\.\d*)?|\.\d+))?\s*\)$/i;function vA(A){return typeof A=="string"&&(VA.test(A.trim())||qA.test(A.trim()))}function EA(A){return A["editor.foreground"]??A.text??A.foreground}function SA(A){return A["editor.background"]??A.background}const rA=["black","red","green","yellow","blue","magenta","cyan","white","bright_black","bright_red","bright_green","bright_yellow","bright_blue","bright_magenta","bright_cyan","bright_white"],OA=["#000000","#cd3131","#0dbc79","#e5e510","#2472c8","#bc3fbc","#11a8cd","#e5e5e5","#666666","#f14c4c","#23d18b","#f5f543","#3b8eea","#d670d6","#29b8db","#ffffff"];function zA(A){return rA.map((B,Q)=>JA({foreground:A[`terminal.ansi.${B}`]},"foreground").color??OA[Q])}function DA(A){return A===null?"null":A===void 0?"undefined":typeof A=="string"?`the string ${JSON.stringify(A)} (theme ids are not supported; import the theme object from "@pierre/highlights/themes")`:Array.isArray(A)?"an array":typeof A=="object"?"themes"in A&&Array.isArray(A.themes)?`a ThemeFamily whose first member is ${DA(A.themes[0])}`:"an object without a `name`":`a ${typeof A}`}function $A(A){return A!=null&&typeof A=="object"&&"name"in A&&typeof A.name=="string"&&A.name!==""}function AB(A){const B=A!=null&&typeof A=="object"&&"themes"in A&&A.themes!=null?A.themes[0]:A;if(!$A(B))throw new TypeError(`invalid theme: expected a Theme or ThemeFamily object, received ${DA(A)}`);return B}function UA(A,B){let Q;for(let I=B;I!=="";){const E=A[I];if(typeof E=="string")return{...Q,color:E};if(E!=null&&typeof E=="object"&&(Q??=E,E.color!=null))return{...Q,color:E.color};const o=I.lastIndexOf(".");I=o<0?"":I.slice(0,o)}return Q}function JA(A,B){let Q,I,E;return B==="background"?Q=SA(A):B==="foreground"?Q=EA(A):({color:Q,font_style:I,font_weight:E}=UA(A.syntax??{},B)??{},(I!=null||E!=null)&&(Q??=EA(A))),vA(Q)?(Q=Q.trim().toLowerCase(),Q.startsWith("#")&&(Q.length<=5&&(Q=Q.replace(/[^#]/g,"$&$&")),Q.length===9&&Q.endsWith("ff")&&(Q=Q.slice(0,7)),Q==="#00000000"&&(Q=void 0))):Q=void 0,{color:Q,italic:I==="italic",weight:E!=null&&E>=100&&E<=900?Math.round(E/100)*100:0}}function V(A,B){return`var(${B}${A.replace(/[._]/g,"-")})`}function J(A){return A.replaceAll("&","&").replaceAll('"',""").replaceAll("<","<").replaceAll(">",">")}function LA(A){const B=A.map(g=>KA.encode(g));let Q=4+8*B.length;const I=new Uint8Array(Q+B.reduce((g,e)=>g+e.length,0)),E=new DataView(I.buffer);let o=32;for(let g=0;g{const i=B.defaults?.[C];return`var(${Q}${C}${i?`, ${i}`:""})`},E=new Array(M.length).fill(null),o=A.style.syntax??{};for(let C=1;C{const i=A.style[`terminal.ansi.${C}`];return I(typeof i=="string"?i:`terminal-ansi-${C.replace("_","-")}`)})}}}function QB(A,B){let Q;const I=()=>Q??=EB(B);let E;return{name:A,get styles(){return I().styles},get fg(){return I().fg},get bg(){return I().bg},table:void 0,htmlOpeners:void 0,get ansi(){return E??=rA.map(o=>V(`terminal.ansi.${o}`,B))}}}function EB(A){const B=new Array(M.length).fill(null);for(let Q=1;Q>16,I[w+1]=k>>8&255,I[w+2]=k&255,I[w+3]=c.length===9?parseInt(c.slice(7),16):255}else g=!0;I[w+4]=(n?16:0)|l/100,!(c===void 0&&!n&&l===0)&&(C==="foreground"?E=c:C==="background"?o=c:Q[r]=i)}let e,a;return{name:A.name,styles:Q,fg:E,bg:o,table:g?void 0:I,get htmlOpeners(){if(g)return e??=mA(Q,E,o)},get ansi(){return a??=zA(B)}}}function mA(A,B,Q){const I=[`
`];for(let E=1;E`)}return LA(I)}const oB=new TextEncoder,N=new Uint8Array(M.length);for(let A=0;AC!=null).sort(([C],[i])=>Cc==="light"),i=Q.find(([c])=>c==="dark");if(C===void 0||i===void 0)throw new TypeError("`themes` must contain `light` and `dark` when defaultColor is 'light-dark()'");Q.splice(0,Q.length,C,i),E=["light-dark","light-dark"]}else{if(I!==!1){const C=Q.findIndex(([i])=>i===I);if(C<0)throw new TypeError(`\`themes\` must contain the defaultColor key \`${I}\``);Q.unshift(...Q.splice(C,1))}E=Q.map((C,i)=>I!==!1&&i===0?"default":"variable")}const o=Q.map(([,C])=>IA(C,B)),g=JSON.stringify(Q.map(([C],i)=>[iB(o[i]),E[i],C]));let e=fA.get(o[0]);const a=e?.get(g);if(a!==void 0)return a;const r=Q.map(([C],i)=>dA(o[i],C,E[i]));if(e===void 0&&(e=new Map,fA.set(o[0],e)),e.set(g,r),e.size>128){const C=e.keys().next().value;C!==void 0&&e.delete(C)}return r}function x(A,B,Q,I,E,o,g=0){const e={content:A.slice(B,Q),offset:B+g};if(E[0].role==="single"){const{styles:r,fg:C}=E[0],i=r[I];e.color=i?.color??C;let c=0;i?.italic===!0&&(c|=1),(i?.weight??0)>=600&&(c|=2),e.fontStyle=c}else e.htmlStyle=tA(E,I,o);const a=N[I];return a!==0&&(e.type=a),e}function pA(A,B){let Q=lA.get(A);Q===void 0&&(Q=new Map,lA.set(A,Q));let I=Q.get(B);return I===void 0&&(I=[],Q.set(B,I)),I}function tA(A,B,Q){const I=pA(A,Q);let E=I[B];if(E===void 0){if(A[0].role==="light-dark")E=rB(A,B,Q);else{E={};for(const{color:o,role:g,styles:e,fg:a}of A){const r=e[B],C=g==="default";E[C?"color":Q+o]=r?.color??a??"inherit",r?.italic===!0&&(E[C?"font-style":`${Q}${o}-font-style`]="italic"),r!=null&&r.weight!==0&&(E[C?"font-weight":`${Q}${o}-font-weight`]=String(r.weight))}}I[B]=E}return E}function cB(A,B){let Q=nA.get(A);Q===void 0&&(Q=new Map,nA.set(A,Q));const I=Q.get(B);if(I!==void 0)return I??void 0;const E=A.length;if(!(E<=255&&A.every(l=>l.table!==void 0))){Q.set(B,null);return}const o=A.map(l=>l.role==="default"?new Uint8Array(0):oB.encode(J(`${B}${l.color}`))),g=32+16*E,e=g+384*E;let a=64,r=128,C=0;for(const{length:l}of o)a+=64+3*l,r+=48+2*l,C+=l;const i=new Uint8Array(e+C),c=new DataView(i.buffer);i[0]=E,i[1]=A[0].role==="light-dark"?1:0,c.setUint32(4,g,!0),c.setUint32(8,a,!0),c.setUint32(12,r,!0),c.setUint32(16,gB++,!0);let n=e;for(let l=0;l`];for(let r=1;r`)}const a=LA(e);return Q.set(B,a),a}function rB(A,B,Q){const[I,E]=A,o=I.styles[B],g=E.styles[B],e=o?.color??I.fg??"currentcolor",a=g?.color??E.fg??"currentcolor",r={color:e===a?e:`light-dark(${e}, ${a})`},C=o?.italic===!0,i=g?.italic===!0;C&&i?r["font-style"]="italic":(C&&(r[`${Q}light-font-style`]="italic"),i&&(r[`${Q}dark-font-style`]="italic"));const c=o?.weight??0,n=g?.weight??0;return c!==0&&c===n?r["font-weight"]=String(c):(c!==0&&(r[`${Q}light-font-weight`]=String(c)),n!==0&&(r[`${Q}dark-font-weight`]=String(n))),r}function uA(A,B,Q,I,E,o=0){const g=[],e=E??0,{styles:a,fg:r,role:C}=Q[0],i=C==="single"?void 0:pA(Q,I);let c=0;for(let n=0;;n+=2){const l=n;for(;n0&&w-c>=e)k=[x(A,c,w,0,Q,I,o)];else{k=new Array((n-l)/2);let y=0;for(let G=l;Gc){const f=B[G+1];let d;if(i===void 0){const U=a[f];d={content:A.slice(c,R),offset:c+o,color:U?.color??r,fontStyle:(U?.italic===!0?1:0)|((U?.weight??0)>=600?2:0)}}else d={content:A.slice(c,R),offset:c+o,htmlStyle:i[f]??tA(Q,f,I)};const s=N[f];s!==0&&(d.type=s),k[y++]=d,c=R}}k.length=y}if(g.push(k),n===B.length)break;c=B[n]}return g}function oA(A,B){if(A[0].role==="single")return{fg:A[0].fg,bg:A[0].bg,themeName:A[0].name};const Q=`highlights-themes ${A.map(o=>o.name).join(" ")}`;if(A[0].role==="light-dark"){const o=(g,e,a)=>{const r=g??a,C=e??a;return r===C?r:`light-dark(${r}, ${C})`};return{fg:o(A[0].fg,A[1].fg,"currentcolor"),bg:o(A[0].bg,A[1].bg,"transparent"),themeName:Q}}const I=A.map(o=>o.role==="default"?o.fg??"inherit":`${B}${o.color}:${o.fg??"inherit"}`).join(";"),E=A.map(o=>o.role==="default"?o.bg??"inherit":`${B}${o.color}-bg:${o.bg??"inherit"}`).join(";");return{fg:I,bg:E,themeName:Q,rootStyle:A[0].role==="default"?void 0:`${I};${E}`}}const gA=1,jA=2,YA=4,NA=8,HA=16,ZA=32,RA=[0,gA,jA,YA,NA,0,0,HA,0,ZA],$=[0,95,135,175,215,255],AA=/\x1b(?:\[([0-?]*)[ -/]*([@-~])|\][^\x07\x1b\n]*(?:\x07|\x1b\\)|[ -/]*[0-~])/y;var xA=class{fg=-1;bg=-1;flags=0;styles=new Map};function T(A){return String(A).toLowerCase()==="ansi"}function BA(A,B){if(B<16)return A.ansi[B];let Q=B&16777215;if(B<232){const I=B-16;Q=$[I/36|0]<<16|$[(I/6|0)%6]<<8|$[I%6]}else B<256&&(Q=(8+(B-232)*10)*65793);return`#${Q.toString(16).padStart(6,"0")}`}function CA(A,B,Q,I,E=new xA,o=0){const g=[],e=I??0;let a=[],r,C,i,c=A.indexOf("\x1B"),n=0;for(;;){const l=A.indexOf(`
+`,n);let w=l<0?A.length:l;l>n&&A.charCodeAt(l-1)===13&&w--;const k=e>0&&w-n>=e;for(;n=0&&c=0&&c=60)&&(R=f[1]))}if(y>n&&k)C===void 0?(C=x(A,n,y,0,B,Q,o),a.push(C)):C.content+=A.slice(n,y);else if(y>n){if(r===void 0){const{fg:f,bg:d,flags:s}=E,U=`${f},${d},${s}`;if(r=E.styles.get(U),r===void 0){const h=((s&YA)!==0?1:0)|((s&gA)!==0?2:0)|((s&NA)!==0?4:0)|((s&ZA)!==0?8:0),S=B.map(b=>{let F=f<0?b.fg:BA(b,f),D=d<0?void 0:BA(b,d);return(s&HA)!==0&&(D=F,F=d<0?b.bg:BA(b,d)),(s&jA)!==0&&F!==void 0&&(F=F.startsWith("#")?F.length===9?F.slice(0,7)+Math.round(parseInt(F.slice(7),16)/2).toString(16).padStart(2,"0"):`${F}80`:`color-mix(in srgb, ${F} 50%, transparent)`),[F,D]});if(B[0].role==="single"){const[b,F]=S[0];r=F===void 0?{color:b,fontStyle:h}:{color:b,bgColor:F,fontStyle:h}}else{const b=[];(h&1)!==0&&b.push(["font-style","italic"]),(h&2)!==0&&b.push(["font-weight","bold"]),(h&12)!==0&&b.push(["text-decoration",(h&12)===12?"underline line-through":(h&4)!==0?"underline":"line-through"]);const F={};if(B[0].role==="light-dark"){const[[D,W],[_,u]]=S,L=D??"currentcolor",H=_??"currentcolor";if(F.color=L===H?L:`light-dark(${L}, ${H})`,W!==void 0||u!==void 0){const m=W??"transparent",P=u??"transparent";F["background-color"]=m===P?m:`light-dark(${m}, ${P})`}for(const[m,P]of b)F[m]=P}else for(let D=0;D20&&s<30)E.flags&=~((RA[s-20]??0)|(s===22?gA:0));else if(s>=30&&s<38)E.fg=s-30;else if(s===39)E.fg=-1;else if(s>=40&&s<48)E.bg=s-40;else if(s===49)E.bg=-1;else if(s>=90&&s<98)E.fg=s-82;else if(s>=100&&s<108)E.bg=s-92;else if(s===38||s===48){const U=f[++d];let h=-1;if(U==="5"){const S=Number(f[++d]);Number.isInteger(S)&&S<256&&(h=S)}else if(U==="2"){const S=Number(f[d+1]),b=Number(f[d+2]),F=Number(f[d+3]);d+=3,S>=0&&b>=0&&F>=0&&(h=16777216|Math.min(S,255)<<16|Math.min(b,255)<<8|Math.min(F,255))}h>=0&&(s===38?E.fg=h:E.bg=h)}}r=void 0}n=G}if(g.push(a),l<0)return g;n=l+1,a=[],C=void 0}}const tB={plain:0,plaintext:0,text:0,txt:0,abap:1,ada:2,adb:2,ads:2,"angular-html":3,apache:4,apacheconf:4,htaccess:4,apex:5,applescript:6,adoc:7,asciidoc:7,asm:8,assembly:8,mips:8,mipsasm:8,riscv:8,s:8,astro:9,awk:10,bash:11,sh:11,shell:11,shellscript:11,shellsession:11,zsh:11,bat:12,batch:12,batchfile:12,cmd:12,dos:12,bib:13,bibtex:13,bicep:14,blade:15,c:16,h:16,c3:17,clj:18,cljc:18,cljs:18,clojure:18,edn:18,cmake:19,cbl:20,cob:20,cobol:20,codeowners:21,codeql:22,ql:22,coffee:23,coffeescript:23,coq:24,rocq:24,"c++":25,cc:25,cpp:25,cxx:25,hh:25,hpp:25,hxx:25,"c#":26,cs:26,csharp:26,css:27,postcss:27,qss:27,csv:28,cu:29,cuda:29,cuh:29,cql:30,cypher:30,d:31,dart:32,dax:33,diff:34,"git-commit":34,"git-rebase":34,patch:34,containerfile:35,docker:35,dockerfile:35,dotenv:36,env:36,elixir:37,ex:37,exs:37,elm:38,erb:39,erl:40,erlang:40,hrl:40,fish:41,f03:42,f08:42,f90:42,f95:42,fortran:42,"fortran-free-form":42,f:43,f77:43,for:43,"fortran-fixed-form":43,"f#":44,fs:44,fsharp:44,fsi:44,fsx:44,gdresource:45,"godot-resource":45,tres:45,tscn:45,gd:46,gdscript:46,gdshader:47,gdshaderinc:47,"godot-shader":47,cucumber:48,feature:48,gherkin:48,gleam:49,comp:50,frag:50,geom:50,glsl:50,vert:50,gnuplot:51,gp:51,go:52,golang:52,gql:53,graphql:53,groq:54,gradle:55,groovy:55,gsh:55,gvy:55,gy:55,nextflow:55,"nextflow-groovy":55,nf:55,hack:56,haml:57,handlebars:58,hbs:58,mustache:58,haskell:59,hs:59,haxe:60,hx:60,hlsl:61,htm:62,html:62,"html-derivative":62,http:63,desktop:64,ini:64,properties:64,systemd:64,java:65,j2:66,jinja:66,jinja2:66,cjs:67,javascript:67,js:67,mjs:67,json:68,jsonc:68,json5:69,jsonl:70,jsonnet:71,libsonnet:71,jsx:72,jl:73,julia:73,just:74,justfile:74,kdl:75,kotlin:76,kt:76,kts:76,latex:77,tex:77,lean:78,lean4:78,less:79,liquid:80,cl:81,el:81,elisp:81,"emacs-lisp":81,lisp:81,lsp:81,racket:81,rkt:81,scheme:81,scm:81,llvm:82,log:83,lua:84,luau:85,make:86,makefile:86,mk:86,markdown:87,md:87,mdc:87,matlab:88,octave:88,mdx:89,mermaid:90,mmd:90,mbt:91,moonbit:91,nginx:92,nim:93,nix:94,m:95,mm:95,objc:95,objcpp:95,"objective-c":95,"objective-cpp":95,objectivec:95,ml:96,mli:96,ocaml:96,odin:97,openscad:98,scad:98,delphi:99,dpk:99,dpr:99,lpr:99,"object-pascal":99,objectpascal:99,pas:99,pascal:99,pp:99,perl:100,pl:100,pm:100,php:101,plsql:102,po:103,pot:103,potx:103,powerquery:104,pq:104,powershell:105,ps:105,ps1:105,psd1:105,psm1:105,pwsh:105,prisma:106,prolog:107,promql:108,proto:109,protobuf:109,jade:110,pug:110,puppet:111,py:112,python:112,qml:113,r:114,rscript:114,cshtml:115,razor:115,reg:116,rosmsg:117,restructuredtext:118,rst:118,rb:119,ruby:119,rs:120,rust:120,sas:121,sass:122,sbt:123,sc:123,scala:123,scss:124,shader:125,shaderlab:125,sol:126,solidity:126,sparql:127,sql:128,stata:129,styl:130,stylus:130,svelte:131,swift:132,tcl:133,hcl:134,terraform:134,tf:134,tfvars:134,toml:135,"angular-ts":136,cts:136,lit:136,mts:136,ts:136,"ts-tags":136,typescript:136,tsrx:137,tsv:138,tsx:139,ttl:140,turtle:140,twig:141,typ:142,typst:142,sv:143,svh:143,"system-verilog":143,systemverilog:143,verilog:143,vhd:144,vhdl:144,vim:145,viml:145,vimscript:145,vue:146,"vue-html":146,wasm:147,wat:147,wgsl:148,mathematica:149,wl:149,wolfram:149,svg:150,xml:150,xsd:150,xsl:150,xslt:150,yaml:151,yml:151,zig:152,zon:152},X=new TextEncoder,TA=new TextDecoder("utf-8",{ignoreBOM:!0}),q=65536,FA=64,p=81920,kA=[new RegExp("^\\p{ID_Start}$","u"),/^[\u200C\u200D\p{ID_Continue}]$/u];let QA;const WA=tB;function v(A){const B=WA[String(A).toLowerCase()];if(typeof B!="number")throw new RangeError(`unknown lang: ${A}`);return B}function CI(A){return typeof WA[String(A).toLowerCase()]=="number"||T(A)}var z=class{#Q;#a;#i;#e;#t=new Uint8Array(0);wasmModule;instance;memory;buffer;dv;pageN;constructor(A){this.wasmModule=A;const B=new WebAssembly.Instance(A,{env:{is_id_start:(Q,I)=>this.#A(Q,I,0),is_id_continue:(Q,I)=>this.#A(Q,I,2)}});this.instance=B,this.memory=B.exports.memory,this.#Q=B.exports.highlight,this.#a=B.exports.highlightStream,this.pageN=this.memory.buffer.byteLength/q,this.buffer=new Uint8Array(this.memory.buffer),this.dv=new DataView(this.memory.buffer)}writeInput(A,B=0){if(typeof A=="string"){this.#B(B+A.length+96);let{read:Q,written:I}=X.encodeInto(A,this.buffer.subarray(p+B,this.buffer.length-96));if(Q`;for(let y=0,G=-1;y0&&(G=l.indexOf(`
+`,G+1),k+=l.charCodeAt(G-1)===13?`\r
+`:`
+`);for(const{content:R,htmlStyle:f}of w[y]){let d="";for(const s in f)d+=`${d===""?"":";"}${s}:${f[s]}`;k+=`${R.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}`}}return X.encode(`${k}
`)}const I=v(B.lang);let E,o,g=0;if(B.themes!=null){const C=Z(B);o=cB(C,Q),g=2,o===void 0&&(o=eB(C,Q),g=4)}else{const C=IA(B.theme,Q);E=C.table,o=C.htmlOpeners,o!==void 0&&(g=4)}const e=this.writeInput(A);if(o!==void 0){this.#B(e+o.length+96);const C=p+e+47&-16;this.buffer.set(o,C),this.dv.setUint32(14,C,!0),this.dv.setUint32(18,o.length,!0)}else if(E===void 0){this.#e!==Q&&(this.#t=X.encode(J(Q)),this.#e=Q);const C=this.#t;this.#B(e+C.length+96);const i=p+e+47&-16;this.buffer.set(C,i),this.dv.setUint32(14,i,!0),this.dv.setUint32(18,C.length,!0),g=1}else this.#i!==E&&(this.buffer.set(E,FA),this.buffer.fill(0,FA+E.length,448),this.#i=E),g=0;this.#r(I,g,e);const a=this.dv.getUint32(6,!0),r=this.dv.getUint32(10,!0);return this.buffer.subarray(a,a+r)}tokenizeLineRecords(A,B,Q){this.#r(A,3,B,Q);const I=this.dv.getUint32(6,!0),E=this.dv.getUint32(10,!0);return new Uint32Array(this.buffer.buffer,I,E>>2)}codeToTokens(A,B){const Q=iA(A);typeof A!="string"&&(Q.includes("�")||A===this.memory.buffer||A instanceof Uint8Array&&A.buffer===this.memory.buffer)&&(A=Q);const I=Z(B),E=B.cssVariablePrefix??"--hls-";return{tokens:T(B.lang)?CA(Q,I,E,B.tokenizeMaxLineLength):uA(Q,this.tokenizeLineRecords(v(B.lang),this.writeInput(A)),I,E,B.tokenizeMaxLineLength),...oA(I,E)}}#B(A){const B=Math.ceil((p+A)/q);B>this.pageN&&(this.memory.grow(B-this.pageN),this.bindMemory())}#A(A,B,Q){this.bindMemory();const I=this.buffer;let E;if(B===2?E=(I[A]&31)<<6|I[A+1]&63:B===3?E=(I[A]&15)<<12|(I[A+1]&63)<<6|I[A+2]&63:E=(I[A]&7)<<18|(I[A+1]&63)<<12|(I[A+2]&63)<<6|I[A+3]&63,E>1114111)return 0;if(E>65535||E>=55296&&E<=57343)return kA[Q>>1].test(String.fromCodePoint(E))?1:0;QA??=new Uint8Array(65536);const o=QA[E]>>Q&3;if(o!==0)return o-1;const g=kA[Q>>1].test(String.fromCharCode(E));return QA[E]|=(g?2:1)<128&&(typeof A=="string"?A.length:A.byteLength)<=q&&(j=new z(j.wasmModule)),j}function _A(){if(O==null)throw new Error("highlights is not initialized");return O}function lB(A){return O=A,Y=void 0,j=new z(A)}function iI(A,B){return aB(A).codeToTokens(A,B)}(class extends TransformStream{#Q;#a;#i;#e;#t;#r;#B=new Uint8Array(0);#A=0;#E="";#I="";#c=0;#o=!1;constructor(A){super({transform:(Q,I)=>{try{for(const E of this.pushCode(Q))I.enqueue(E)}catch(E){throw this.dispose(),E}},flush:Q=>{for(const I of this.end())Q.enqueue(I)},cancel:()=>this.dispose()}),this.#i=T(A.lang)?new xA:void 0,this.#a=this.#i===void 0?v(A.lang):0,this.#e=Z(A);const B=_A();this.#Q=Y?.wasmModule===B?Y:new z(B),Y=void 0,this.#t=A.cssVariablePrefix??"--hls-",this.#r=A.tokenizeMaxLineLength}pushCode(A){if(this.#Q==null)throw new Error("stream has ended");if(A.length===0)return[];if(typeof A!="string"){let o=A.lastIndexOf(10)+1;if(o===0)return this.#l(A),[];this.#A>0&&(o+=this.#A,A=this.#l(A));const g=this.#n(A.subarray(0,o),this.#I+this.#E);return this.#I="",this.#E="",this.#A=0,o0&&(A=TA.decode(this.#B.subarray(0,this.#A))+A,this.#A=0),A=this.#E+A,this.#E="";const B=A.charCodeAt(A.length-1);B>=55296&&B<=56319&&(this.#E=A.slice(-1),A=A.slice(0,-1));const Q=A.lastIndexOf(` +`)+1;if(Q===0)return this.#I+=A,[];const I=this.#I+A.slice(0,Q);this.#I=A.slice(Q);const E=this.#n(I);return E.pop(),E}end(){if(this.#Q==null)throw new Error("stream has ended");try{if(this.#A>0)return this.#n(this.#B.subarray(0,this.#A),this.#I+this.#E);if(this.#I+=this.#E,this.#E="",this.#I==="")return[[]];const A=this.#I;return this.#I="",this.#n(A)}finally{this.dispose()}}dispose(){const A=this.#Q;A!=null&&(Y==null&&A.wasmModule===O&&A.pageN<=16&&(Y=A),this.#Q=void 0,this.#B=new Uint8Array(0),this.#A=0,this.#E="",this.#I="")}#l(A){const B=this.#A+A.length;if(B>this.#B.length){const Q=new Uint8Array(Math.max(B,this.#B.length*2,1024));Q.set(this.#B.subarray(0,this.#A)),this.#B=Q}return this.#B.set(A,this.#A),this.#A=B,this.#B.subarray(0,B)}#n(A,B=""){const Q=this.#Q;if(Q==null)throw new Error("stream has ended");let I=iA(A);typeof A!="string"&&I.includes("�")&&(A=I),I=B+I;let E;if(this.#i===void 0){let o=B===""?0:Q.writeInput(B);o+=Q.writeInput(A,o);const g=Q.tokenizeLineRecords(this.#a,o,!this.#o);this.#o=!0,E=uA(I,g,this.#e,this.#t,this.#r,this.#c)}else E=CA(I,this.#e,this.#t,this.#r,this.#i,this.#c);return this.#c+=I.length,E}});const nB=new TextEncoder,yA=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}),sB=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]/;function bA(A){if(!sB.test(A))return nB.encode(A);const B=new Uint8Array(A.length*3);let Q=0;for(let I=0;I>6,B[Q++]=128|E&63;else{if(E>=55296&&E<56320){const o=A.charCodeAt(I+1);if(o>=56320&&o<57344){const g=65536+(E-55296<<10)+(o-56320);B[Q++]=240|g>>18,B[Q++]=128|g>>12&63,B[Q++]=128|g>>6&63,B[Q++]=128|g&63,I++;continue}}B[Q++]=224|E>>12,B[Q++]=128|E>>6&63,B[Q++]=128|E&63}}return B.subarray(0,Q)}function MA(A,B){const Q=new Array(B);let I=0,E=0;for(;E>10),Q[I++]=56320+(e-65536&1023),E+=4}}let o="";for(let g=0;g0&&E.length>=o)return{tokens:[x(E,0,E.length,0,this.#i,this.#e)],bracketIgnoredRanges:[]};const g=I.liveLineTokCount(B),e=(I.liveLineFlags(B)&4)!==0,a=I.liveLineTokPtr(B),r=new Uint32Array(Q.memory.buffer,g===0?0:a,e?g*2:g),C=[],i=[];let c=0;for(let n=0;n>>24;if(l>c){if(C.push(x(E,c,l,w,this.#i,this.#e)),N[w]!==0){const k=i[i.length-1];k!==void 0&&k[1]>=c?k[1]=l:i.push([c,l])}c=l}}return C.length===0&&E.length>0&&C.push(x(E,0,E.length,0,this.#i,this.#e)),{tokens:C,bracketIgnoredRanges:i}}applyEdits(B,Q){const I=this.#g(),E=this.#C;this.#F();const o=K(Q?.renderRange),g=this.#b(B,I,E),e=E.liveLineCount();if(g.length===0)return this.resume(),{revision:this.#B,previousLineCount:e,lineCount:e,lineChanges:[],lines:new Map};this.#A+=1,this.#o=!1,this.#l=!0;try{this.#G(I,E,g),this.#B+=1;const a=this.#d(I,E,o);return this.#y(I,E,e,a)}finally{this.#l=!1}}reset(B,Q){this.#g(),this.#F();const I=K(Q?.renderRange);if(typeof B!="string")throw new TypeError("code must be a string");this.#A+=1,this.#o=!1;const E=this.#C.liveLineCount();this.#c=void 0;const o=cA.#n(B,this.#a);this.#Q=o;const g=this.#C;this.#B+=1,this.#l=!0;let e;try{e=this.#d(o,g,I)}finally{this.#l=!1}const a=g.liveLineCount();return{revision:this.#B,previousLineCount:E,lineCount:a,lineChanges:[{oldStartLine:0,oldEndLine:E,newStartLine:0,newEndLine:a}],lines:e}}#F(){if(this.#l)throw new Error("applyEdits and reset cannot be called from onDeferTokenize during an update; use pause, flush, or the reads instead")}#d(B,Q,I){if(I===void 0)return Q.liveRun(2147483647),B.bindMemory(),new Map;const E=this.#A,o=I[0]>=Q.liveLineCount()?0:Math.min(I[1],Q.liveLineCount());try{return this.#R(B,Q,o,performance.now()+1,I)}finally{E===this.#A&&this.#Q===B&&!this.#o&&this.pendingTokenization&&this.#f(E)}}#f(B){if(typeof MessageChannel>"u"){setTimeout(()=>this.#k(B),0);return}if(this.#E===void 0){const Q=new MessageChannel;Q.port1.addEventListener("message",I=>{const E=I.data;this.#I-=1;try{typeof E=="number"&&this.#k(E)}finally{this.#I===0&&GA(Q.port1,!1)}}),Q.port1.start(),this.#E=Q}this.#I===0&&GA(this.#E.port1,!0),this.#I+=1,this.#E.port2.postMessage(B)}#k(B){if(B!==this.#A||this.#Q==null||this.#o)return;const Q=this.#Q;try{this.#R(Q,this.#C,this.#C.liveLineCount(),performance.now()+1)}finally{B===this.#A&&this.#Q===Q&&!this.#o&&this.pendingTokenization&&this.#f(B)}}#R(B,Q,I,E,o){const g=this.#A,e=new Map;let a=new Map;const{styles:r,fg:C}=this.#i[0];for(;g===this.#A&&performance.now()=I)break;if(Q.liveRun(1,I,E===1/0?0:4096),B.bindMemory(),Q.liveStats(10)===R||this.#r===void 0&&(o===void 0||R=o[1]))continue;if(i={line:R,byte:0,text:"",record:0,start:0,tokens:[]},this.#c=i,performance.now()>=E)break}const{line:c}=i;if(c>=I)break;const n=Q.liveLineByteLen(c);if(i.byte=E)continue}const l=this.#t,w=l>0&&Q.liveLineLen(c)>=l?0:Q.liveLineTokCount(c),k=(Q.liveLineFlags(c)&4)!==0,y=new Uint32Array(B.memory.buffer,w===0?0:Q.liveLineTokPtr(c),k?w*2:w),G=Math.min(w,i.record+256);for(;i.record>>24;f>i.start&&(i.tokens.push([i.start,r[d]?.color??C??"",i.text.slice(i.start,f)]),i.start=f)}if(!(i.record0?C??"":"",i.text]),o!==void 0&&c>=o[0]&&c=16)){const R=a;a=new Map,this.#r?.(R)}}return a.size>0&&this.#r?.(a),e}#y(B,Q,I,E){const o=Q.liveChangesPtr(),g=B.dv.getUint32(o,!0),e=[];for(let a=0;a=Q.liveLineCount())throw new RangeError(`line ${B} out of range`)}#b(B,Q,I){if(!Array.isArray(B))throw new TypeError("edits must be an array");const E=I.liveLineCount(),o=[];for(const C of B){if(C==null||typeof C!="object"||C.range==null)throw new TypeError("each edit needs a range and newText");const{start:i,end:c}=C.range,n=C.newText;if(typeof n!="string")throw new TypeError("newText must be a string");for(const l of[i,c]){if(l==null||!Number.isInteger(l.line)||!Number.isInteger(l.character)||l.line<0||l.character<0)throw new TypeError("positions must be non-negative integers");if(l.line>=E)throw new RangeError(`line ${l.line} out of range`);if(l.character>I.liveLineLen(l.line))throw new RangeError(`character ${l.character} past the end of line ${l.line}`)}if(i.line>c.line||i.line===c.line&&i.character>c.character)throw new RangeError("range start is after its end");o.push({sl:i.line,sc:i.character,el:c.line,ec:c.character,newText:n})}o.sort((C,i)=>C.sl!==i.sl?C.sl-i.sl:C.sc!==i.sc?C.sc-i.sc:C.el!==i.el?C.el-i.el:C.ec-i.ec);for(let C=1;Cc.sl||i.el===c.sl&&i.ec>c.sc)throw new RangeError("edit ranges overlap");if(i.sl===c.sl&&i.sc===c.sc&&i.el===c.el&&i.ec===c.ec&&i.sl===i.el&&i.sc===i.ec)throw new RangeError("edit ranges overlap")}let g=-1,e="";const a=C=>(C!==g&&(e=this.#s(Q,I,C),g=C),e),r=[];for(const C of o){if(this.#M(C,I,a))continue;const i=r[r.length-1];i!==void 0&&i.el===C.sl?(i.newText+=a(C.sl).slice(i.ec,C.sc)+C.newText,i.el=C.el,i.ec=C.ec):r.push(C)}return r}#M(B,Q,I){let E=B.ec-B.sc;for(let g=B.sl;gB.newText.length)return!1;if(E!==B.newText.length)return!1;if(E===0)return!0;let o=0;for(let g=B.sl;g<=B.el;g++){const e=I(g),a=e.slice(g===B.sl?B.sc:0,g===B.el?B.ec:e.length);if(!B.newText.startsWith(a,o))return!1;if(o+=a.length,gbA(a.newText));let o=4+I.length*24;for(const a of E)o+=a.length;const g=Q.liveStage(o);B.bindMemory();let e=4+I.length*24;for(let a=0;at(()=>Promise.resolve().then(()=>dB),void 0),"aurora-x":()=>t(()=>Promise.resolve().then(()=>FB),void 0),"ayu-dark":()=>t(()=>Promise.resolve().then(()=>yB),void 0),"ayu-light":()=>t(()=>Promise.resolve().then(()=>MB),void 0),"ayu-mirage":()=>t(()=>Promise.resolve().then(()=>hB),void 0),"catppuccin-frappe":()=>t(()=>Promise.resolve().then(()=>DB),void 0),"catppuccin-latte":()=>t(()=>Promise.resolve().then(()=>JB),void 0),"catppuccin-macchiato":()=>t(()=>Promise.resolve().then(()=>mB),void 0),"catppuccin-mocha":()=>t(()=>Promise.resolve().then(()=>uB),void 0),"dark-plus":()=>t(()=>Promise.resolve().then(()=>YB),void 0),dracula:()=>t(()=>Promise.resolve().then(()=>HB),void 0),"dracula-soft":()=>t(()=>Promise.resolve().then(()=>xB),void 0),"everforest-dark":()=>t(()=>Promise.resolve().then(()=>WB),void 0),"everforest-light":()=>t(()=>Promise.resolve().then(()=>PB),void 0),"github-dark":()=>t(()=>Promise.resolve().then(()=>KB),void 0),"github-dark-default":()=>t(()=>Promise.resolve().then(()=>qB),void 0),"github-dark-dimmed":()=>t(()=>Promise.resolve().then(()=>OB),void 0),"github-dark-high-contrast":()=>t(()=>Promise.resolve().then(()=>$B),void 0),"github-light":()=>t(()=>Promise.resolve().then(()=>BQ),void 0),"github-light-default":()=>t(()=>Promise.resolve().then(()=>EQ),void 0),"github-light-high-contrast":()=>t(()=>Promise.resolve().then(()=>oQ),void 0),"gruvbox-dark-hard":()=>t(()=>Promise.resolve().then(()=>CQ),void 0),"gruvbox-dark-medium":()=>t(()=>Promise.resolve().then(()=>cQ),void 0),"gruvbox-dark-soft":()=>t(()=>Promise.resolve().then(()=>rQ),void 0),"gruvbox-light-hard":()=>t(()=>Promise.resolve().then(()=>aQ),void 0),"gruvbox-light-medium":()=>t(()=>Promise.resolve().then(()=>nQ),void 0),"gruvbox-light-soft":()=>t(()=>Promise.resolve().then(()=>fQ),void 0),horizon:()=>t(()=>Promise.resolve().then(()=>dQ),void 0),"horizon-bright":()=>t(()=>Promise.resolve().then(()=>FQ),void 0),houston:()=>t(()=>Promise.resolve().then(()=>yQ),void 0),"kanagawa-dragon":()=>t(()=>Promise.resolve().then(()=>MQ),void 0),"kanagawa-lotus":()=>t(()=>Promise.resolve().then(()=>hQ),void 0),"kanagawa-wave":()=>t(()=>Promise.resolve().then(()=>DQ),void 0),laserwave:()=>t(()=>Promise.resolve().then(()=>JQ),void 0),"light-plus":()=>t(()=>Promise.resolve().then(()=>mQ),void 0),"material-theme":()=>t(()=>Promise.resolve().then(()=>uQ),void 0),"material-theme-darker":()=>t(()=>Promise.resolve().then(()=>YQ),void 0),"material-theme-lighter":()=>t(()=>Promise.resolve().then(()=>HQ),void 0),"material-theme-ocean":()=>t(()=>Promise.resolve().then(()=>xQ),void 0),"material-theme-palenight":()=>t(()=>Promise.resolve().then(()=>WQ),void 0),"min-dark":()=>t(()=>Promise.resolve().then(()=>PQ),void 0),"min-light":()=>t(()=>Promise.resolve().then(()=>KQ),void 0),monokai:()=>t(()=>Promise.resolve().then(()=>qQ),void 0),"night-owl":()=>t(()=>Promise.resolve().then(()=>OQ),void 0),"night-owl-light":()=>t(()=>Promise.resolve().then(()=>$Q),void 0),nord:()=>t(()=>Promise.resolve().then(()=>BE),void 0),"one-dark-pro":()=>t(()=>Promise.resolve().then(()=>EE),void 0),"one-light":()=>t(()=>Promise.resolve().then(()=>oE),void 0),"pierre-dark":()=>t(()=>Promise.resolve().then(()=>CE),void 0),"pierre-dark-protanopia-deuteranopia":()=>t(()=>Promise.resolve().then(()=>cE),void 0),"pierre-dark-soft":()=>t(()=>Promise.resolve().then(()=>rE),void 0),"pierre-dark-tritanopia":()=>t(()=>Promise.resolve().then(()=>aE),void 0),"pierre-dark-vibrant":()=>t(()=>Promise.resolve().then(()=>nE),void 0),"pierre-light":()=>t(()=>Promise.resolve().then(()=>fE),void 0),"pierre-light-protanopia-deuteranopia":()=>t(()=>Promise.resolve().then(()=>dE),void 0),"pierre-light-soft":()=>t(()=>Promise.resolve().then(()=>FE),void 0),"pierre-light-tritanopia":()=>t(()=>Promise.resolve().then(()=>yE),void 0),"pierre-light-vibrant":()=>t(()=>Promise.resolve().then(()=>ME),void 0),plastic:()=>t(()=>Promise.resolve().then(()=>hE),void 0),poimandres:()=>t(()=>Promise.resolve().then(()=>DE),void 0),red:()=>t(()=>Promise.resolve().then(()=>JE),void 0),"rose-pine":()=>t(()=>Promise.resolve().then(()=>mE),void 0),"rose-pine-dawn":()=>t(()=>Promise.resolve().then(()=>uE),void 0),"rose-pine-moon":()=>t(()=>Promise.resolve().then(()=>YE),void 0),"slack-dark":()=>t(()=>Promise.resolve().then(()=>HE),void 0),"slack-ochin":()=>t(()=>Promise.resolve().then(()=>xE),void 0),"snazzy-light":()=>t(()=>Promise.resolve().then(()=>WE),void 0),"solarized-dark":()=>t(()=>Promise.resolve().then(()=>PE),void 0),"solarized-light":()=>t(()=>Promise.resolve().then(()=>KE),void 0),"synthwave-84":()=>t(()=>Promise.resolve().then(()=>qE),void 0),"tokyo-night":()=>t(()=>Promise.resolve().then(()=>OE),void 0),vesper:()=>t(()=>Promise.resolve().then(()=>$E),void 0),"vitesse-black":()=>t(()=>Promise.resolve().then(()=>BI),void 0),"vitesse-dark":()=>t(()=>Promise.resolve().then(()=>EI),void 0),"vitesse-light":()=>t(()=>Promise.resolve().then(()=>oI),void 0)},eI=Object.freeze(Object.defineProperty({__proto__:null,themes:fB},Symbol.toStringTag,{value:"Module"})),wB={name:"Andromeeda",appearance:"dark",style:{background:"#23262E",text:"#e1dde4","editor.background":"#23262E","editor.foreground":"#D5CED9","editor.active_line.background":"#2e323d","editor.document_highlight.bracket_background":"#4F5666","search.match_background":"#f39d1256",players:[{cursor:"#D5CED9",background:"#3D4352",selection:"#3D4352"},{cursor:"#FFB8B8",background:"#2F3646",selection:"#4A3A4A"},{cursor:"#A5FFD6",background:"#3A424F",selection:"#2D4A4A"},{cursor:"#FFD6A5",background:"#353D4A",selection:"#4A3D2D"},{cursor:"#C6B8FF",background:"#2D3542",selection:"#3D2D4A"}],error:"#FC644D",warning:"#FF9F2E",info:"#969696ff",hint:"#969696ff","terminal.ansi.black":"#000000f2","terminal.ansi.red":"#ee5d43","terminal.ansi.green":"#96E072","terminal.ansi.yellow":"#FFE66D","terminal.ansi.blue":"#7cb7ff","terminal.ansi.magenta":"#FF66C4","terminal.ansi.cyan":"#5DFFDF","terminal.ansi.white":"#D5CED9","terminal.ansi.bright_black":"#000000e6","terminal.ansi.bright_red":"#D04A32","terminal.ansi.bright_green":"#5dcd26","terminal.ansi.bright_yellow":"#fbd831","terminal.ansi.bright_blue":"#5A8FD6","terminal.ansi.bright_magenta":"#ff00aa","terminal.ansi.bright_cyan":"#00e8c6","terminal.ansi.bright_white":"#D5CED9",syntax:{attribute:{color:"#FFE66D"},comment:{color:"#81898f"},"comment.doc":{color:"#A0A1A7cc"},"comment.documentation":{color:"#A0A1A7cc"},"diff.plus":{color:"#9BC53D40"},"diff.minus":{color:"#FC644D40"},constant:{color:"#74c7ec"},"constant.macro":{color:"#c74ded"},"constant.builtin":{color:"#ee7843"},constructor:{color:"#f92672"},emphasis:{color:"#c74ded"},"emphasis.strong":{color:"#f39c12"},function:{color:"#FFE66D"},include:{color:"#c74ded"},keyword:{color:"#c74ded"},"keyword.modifier":{color:"#c74ded"},"keyword.type":{color:"#c74ded"},"keyword.coroutine":{color:"#c74ded"},"keyword.function":{color:"#c74ded"},"keyword.operator":{color:"#c74ded"},"keyword.import":{color:"#c74ded"},"keyword.repeat":{color:"#c74ded"},"keyword.return":{color:"#c74ded"},"keyword.debug":{color:"#c74ded"},"keyword.exception":{color:"#c74ded"},"keyword.conditional":{color:"#c74ded"},"keyword.conditional.ternary":{color:"#ee5d43"},repeat:{color:"#c74ded"},conditional:{color:"#c74ded"},exception:{color:"#ee5d43"},module:{color:"#FFE66D"},field:{color:"#00e8c6"},"variable.member":{color:"#00e8c6"},property:{color:"#00e8c6"},punctuation:{color:"#D5CED9"},"punctuation.bracket":{color:"#D5CED9"},"punctuation.delimiter":{color:"#D5CED9"},"punctuation.special":{color:"#D5CED9"},"punctuation.list_marker":{color:"#FFE66D"},number:{color:"#f39c12"},operator:{color:"#ee5d43"},boolean:{color:"#f92672"},string:{color:"#96E072"},"string.escape":{color:"#96E072"},"string.regex":{color:"#7cb7ff"},regex:{color:"#7cb7ff"},"string.special":{color:"#7cb7ff"},"string.special.symbol":{color:"#96E072"},"string.special.url":{color:"#96E072"},tag:{color:"#f92672"},"tag.delimiter":{color:"#D5CED9"},"tag.attribute":{color:"#FFE66D"},"tag.punctuation.bracket":{color:"#D5CED9"},"tag.punctuation.special":{color:"#D5CED9"},"tag.punctuation.delimiter":{color:"#D5CED9"},"text.literal":{color:"#96E072"},"text.title":{color:"#fe00aa"},title:{color:"#fe00aa",font_weight:400},link_text:{color:"#ee5d43"},link_uri:{color:"#c74ded"},namespace:{color:"#FFE66D"},type:{color:"#FFE66D"},"type.builtin":{color:"#c74ded"},"type.definition":{color:"#FFE66D"},"type.interface":{color:"#FFE66D"},"type.super":{color:"#FFE66D"},variable:{color:"#00e8c6"},"variable.special":{color:"#00e8c6"},embedded:{color:"#D5CED9"},label:{color:"#00e8c6"},predictive:{color:"#81898f"},preproc:{color:"#c74ded"},primary:{color:"#D5CED9"},selector:{color:"#F92672"},enum:{color:"#FFE66D"},hint:{color:"#969696ff"},variant:{color:"#00E8C6"},"selector.class":{color:"#FFE66D"},"selector.id":{color:"#EE5D43"},"selector.pseudo":{color:"#FFE66D"}}}},dB=Object.freeze(Object.defineProperty({__proto__:null,default:wB},Symbol.toStringTag,{value:"Module"})),RB={name:"Aurora X",appearance:"dark",style:{background:"#131318",text:"#ebece6","editor.background":"#131318","editor.foreground":"#ebece6","editor.active_line.background":"#1e1e2640","search.match_background":"#f0fb8c40",players:[{cursor:"#49baff",background:"#49baff",selection:"#49baff30"},{cursor:"#50fb7b",background:"#50fb7b",selection:"#50fb7b30"},{cursor:"#fc4cb4",background:"#fc4cb4",selection:"#fc4cb430"},{cursor:"#f0fb8c",background:"#f0fb8c",selection:"#f0fb8c30"},{cursor:"#8be9fd",background:"#8be9fd",selection:"#8be9fd30"},{cursor:"#fc4346",background:"#fc4346",selection:"#fc434630"}],error:"#fc4346",warning:"#f0fb8c",info:"#49baff",hint:"#8be9fd",created:"#64d389fd",deleted:"#dd5074",modified:"#c778db","terminal.ansi.black":"#000000","terminal.ansi.red":"#fc4346","terminal.ansi.green":"#50fb7b","terminal.ansi.yellow":"#f0fb8c","terminal.ansi.blue":"#49baff","terminal.ansi.magenta":"#fc4cb4","terminal.ansi.cyan":"#8be9fd","terminal.ansi.white":"#ededec","terminal.ansi.bright_black":"#555555","terminal.ansi.bright_red":"#fc4346","terminal.ansi.bright_green":"#50fb7b","terminal.ansi.bright_yellow":"#f0fb8c","terminal.ansi.bright_blue":"#49baff","terminal.ansi.bright_magenta":"#fc4cb4","terminal.ansi.bright_cyan":"#8be9fd","terminal.ansi.bright_white":"#ffffff",syntax:{attribute:{color:"#50fb7b"},boolean:{color:"#fc4cb4"},comment:{color:"#6a6a72",font_style:"italic"},"comment.doc":{color:"#7a7a82",font_style:"italic"},constant:{color:"#fc4cb4"},constructor:{color:"#8be9fd"},emphasis:{color:"#f0fb8c",font_style:"italic"},"emphasis.strong":{color:"#f0fb8c",font_weight:700},enum:{color:"#8be9fd"},function:{color:"#50fb7b"},"function.builtin":{color:"#50fb7b"},"function.call":{color:"#50fb7b"},"function.definition":{color:"#50fb7b"},"function.method":{color:"#50fb7b"},"function.special.definition":{color:"#50fb7b"},hint:{color:"#6a6a72",font_style:"italic"},keyword:{color:"#49baff"},label:{color:"#49baff"},link_text:{color:"#49baff"},link_uri:{color:"#8be9fd"},namespace:{color:"#ffb86c"},module:{color:"#ffb86c"},identifier:{color:"#ffb86c"},include:{color:"#ffb86c"},number:{color:"#fc4cb4"},operator:{color:"#ebece6"},parameter:{color:"#8be9fd",font_style:"italic"},predictive:{color:"#5a5a64",font_style:"italic"},preproc:{color:"#49baff"},primary:{color:"#ebece6"},property:{color:"#8be9fd"},punctuation:{color:"#9a9a9e"},"punctuation.bracket":{color:"#9a9a9e"},"punctuation.delimiter":{color:"#9a9a9e"},"punctuation.list_marker":{color:"#fc4346"},"punctuation.special":{color:"#fc4cb4"},string:{color:"#f0fb8c"},"string.escape":{color:"#fc4cb4"},"string.regex":{color:"#fc4346"},"string.special":{color:"#fc4cb4"},"string.special.symbol":{color:"#8be9fd"},tag:{color:"#fc4346"},"text.literal":{color:"#f0fb8c"},title:{color:"#50fb7b",font_weight:700},type:{color:"#8be9fd"},"type.builtin":{color:"#8be9fd"},"type.class":{color:"#8be9fd"},"type.interface":{color:"#8be9fd",font_style:"italic"},variable:{color:"#ffb86c"},"variable.builtin":{color:"#fc4cb4",font_style:"italic"},"variable.member":{color:"#8be9fd"},"variable.parameter":{color:"#8be9fd",font_style:"italic"},"variable.special":{color:"#fc4cb4"},variant:{color:"#8be9fd"},embedded:{color:"#ebece6"},selector:{color:"#fc4346"},"diff.minus":{color:"#dd5074"},"diff.plus":{color:"#64d389fd"}}}},FB=Object.freeze(Object.defineProperty({__proto__:null,default:RB},Symbol.toStringTag,{value:"Module"})),kB={name:"Ayu Dark",appearance:"dark",style:{background:"#313337ff",text:"#bfbdb6ff","editor.background":"#0d1016ff","editor.foreground":"#bfbdb6ff","editor.active_line.background":"#1f2127bf","search.match_background":"#5ac2fe66",players:[{cursor:"#5ac1feff",background:"#5ac1feff",selection:"#5ac1fe3d"},{cursor:"#39bae5ff",background:"#39bae5ff",selection:"#39bae53d"},{cursor:"#fe8f40ff",background:"#fe8f40ff",selection:"#fe8f403d"},{cursor:"#d2a6feff",background:"#d2a6feff",selection:"#d2a6fe3d"},{cursor:"#95e5cbff",background:"#95e5cbff",selection:"#95e5cb3d"},{cursor:"#ef7177ff",background:"#ef7177ff",selection:"#ef71773d"},{cursor:"#feb454ff",background:"#feb454ff",selection:"#feb4543d"},{cursor:"#aad84cff",background:"#aad84cff",selection:"#aad84c3d"}],error:"#ef7177ff",warning:"#feb454ff",info:"#5ac1feff",hint:"#628b80ff",deleted:"#f26d78",modified:"#73b8ff","terminal.ansi.black":"#0d1016ff","terminal.ansi.red":"#ef7177ff","terminal.ansi.green":"#aad84cff","terminal.ansi.yellow":"#feb454ff","terminal.ansi.blue":"#5ac1feff","terminal.ansi.magenta":"#39bae5ff","terminal.ansi.cyan":"#95e5cbff","terminal.ansi.white":"#bfbdb6ff","terminal.ansi.bright_black":"#545557ff","terminal.ansi.bright_red":"#83353bff","terminal.ansi.bright_green":"#567627ff","terminal.ansi.bright_yellow":"#92582bff","terminal.ansi.bright_blue":"#27618cff","terminal.ansi.bright_magenta":"#205a78ff","terminal.ansi.bright_cyan":"#4c806fff","terminal.ansi.bright_white":"#fafafaff",syntax:{attribute:{color:"#5ac1feff"},boolean:{color:"#d2a6ffff"},comment:{color:"#5c6773ff"},"comment.doc":{color:"#8c8b88ff"},constant:{color:"#d2a6ffff"},constructor:{color:"#5ac1feff"},embedded:{color:"#bfbdb6ff"},emphasis:{color:"#5ac1feff"},"emphasis.strong":{color:"#5ac1feff",font_weight:700},enum:{color:"#fe8f40ff"},function:{color:"#ffb353ff"},hint:{color:"#628b80ff"},keyword:{color:"#ff8f3fff"},label:{color:"#5ac1feff"},link_text:{color:"#fe8f40ff",font_style:"italic"},link_uri:{color:"#aad84cff"},namespace:{color:"#bfbdb6ff"},number:{color:"#d2a6ffff"},operator:{color:"#f29668ff"},predictive:{color:"#5a728bff",font_style:"italic"},preproc:{color:"#ff8f3fff"},primary:{color:"#bfbdb6ff"},property:{color:"#5ac1feff"},punctuation:{color:"#a6a5a0ff"},"punctuation.bracket":{color:"#a6a5a0ff"},"punctuation.delimiter":{color:"#a6a5a0ff"},"punctuation.list_marker":{color:"#a6a5a0ff"},"punctuation.markup":{color:"#a6a5a0ff"},"punctuation.special":{color:"#d2a6ffff"},selector:{color:"#d2a6ffff"},"selector.pseudo":{color:"#5ac1feff"},string:{color:"#a9d94bff"},"string.escape":{color:"#8c8b88ff"},"string.regex":{color:"#95e6cbff"},"string.special":{color:"#e5b572ff"},"string.special.symbol":{color:"#fe8f40ff"},tag:{color:"#5ac1feff"},"text.literal":{color:"#fe8f40ff"},title:{color:"#bfbdb6ff",font_weight:700},type:{color:"#59c2ffff"},variable:{color:"#bfbdb6ff"},"variable.parameter":{color:"#d2a6ffff"},variant:{color:"#5ac1feff"},"diff.plus":{color:"#aad94cff"},"diff.minus":{color:"#f07178ff"}}}},yB=Object.freeze(Object.defineProperty({__proto__:null,default:kB},Symbol.toStringTag,{value:"Module"})),bB={name:"Ayu Light",appearance:"light",style:{background:"#dcdddeff",text:"#5c6166ff","editor.background":"#fcfcfcff","editor.foreground":"#5c6166ff","editor.active_line.background":"#ececedbf","search.match_background":"#3b9ee566",players:[{cursor:"#3b9ee5ff",background:"#3b9ee5ff",selection:"#3b9ee53d"},{cursor:"#55b4d3ff",background:"#55b4d3ff",selection:"#55b4d33d"},{cursor:"#f98d3fff",background:"#f98d3fff",selection:"#f98d3f3d"},{cursor:"#a37accff",background:"#a37accff",selection:"#a37acc3d"},{cursor:"#4dbf99ff",background:"#4dbf99ff",selection:"#4dbf993d"},{cursor:"#ef7271ff",background:"#ef7271ff",selection:"#ef72713d"},{cursor:"#f1ad49ff",background:"#f1ad49ff",selection:"#f1ad493d"},{cursor:"#85b304ff",background:"#85b304ff",selection:"#85b3043d"}],error:"#ef7271ff",warning:"#f1ad49ff",info:"#3b9ee5ff",hint:"#8ca7c2ff",deleted:"#ff7383",modified:"#478acc","terminal.ansi.black":"#5c6166ff","terminal.ansi.red":"#ef7271ff","terminal.ansi.green":"#85b304ff","terminal.ansi.yellow":"#f1ad49ff","terminal.ansi.blue":"#3b9ee5ff","terminal.ansi.magenta":"#55b4d3ff","terminal.ansi.cyan":"#4dbf99ff","terminal.ansi.white":"#fcfcfcff","terminal.ansi.bright_black":"#3b9ee5ff","terminal.ansi.bright_red":"#febab6ff","terminal.ansi.bright_green":"#c7d98fff","terminal.ansi.bright_yellow":"#fed5a3ff","terminal.ansi.bright_blue":"#abcdf2ff","terminal.ansi.bright_magenta":"#b1d8e8ff","terminal.ansi.bright_cyan":"#ace0cbff","terminal.ansi.bright_white":"#ffffffff",syntax:{attribute:{color:"#3b9ee5ff"},boolean:{color:"#a37accff"},comment:{color:"#abb0b6ff"},"comment.doc":{color:"#898d90ff"},constant:{color:"#a37accff"},constructor:{color:"#3b9ee5ff"},embedded:{color:"#5c6166ff"},emphasis:{color:"#3b9ee5ff"},"emphasis.strong":{color:"#3b9ee5ff",font_weight:700},enum:{color:"#f98d3fff"},function:{color:"#f2ad48ff"},hint:{color:"#8ca7c2ff"},keyword:{color:"#fa8d3eff"},label:{color:"#3b9ee5ff"},link_text:{color:"#f98d3fff",font_style:"italic"},link_uri:{color:"#85b304ff"},namespace:{color:"#5c6166ff"},number:{color:"#a37accff"},operator:{color:"#ed9365ff"},predictive:{color:"#9eb9d3ff",font_style:"italic"},preproc:{color:"#fa8d3eff"},primary:{color:"#5c6166ff"},property:{color:"#3b9ee5ff"},punctuation:{color:"#73777bff"},"punctuation.bracket":{color:"#73777bff"},"punctuation.delimiter":{color:"#73777bff"},"punctuation.list_marker":{color:"#73777bff"},"punctuation.markup":{color:"#73777bff"},"punctuation.special":{color:"#a37accff"},selector:{color:"#a37accff"},"selector.pseudo":{color:"#3b9ee5ff"},string:{color:"#86b300ff"},"string.escape":{color:"#898d90ff"},"string.regex":{color:"#4bbf98ff"},"string.special":{color:"#e6ba7eff"},"string.special.symbol":{color:"#f98d3fff"},tag:{color:"#3b9ee5ff"},"text.literal":{color:"#f98d3fff"},title:{color:"#5c6166ff",font_weight:700},type:{color:"#389ee6ff"},variable:{color:"#5c6166ff"},"variable.parameter":{color:"#a37accff"},variant:{color:"#3b9ee5ff"},"diff.plus":{color:"#6cbf43ff"},"diff.minus":{color:"#ff6666ff"}}}},MB=Object.freeze(Object.defineProperty({__proto__:null,default:bB},Symbol.toStringTag,{value:"Module"})),GB={name:"Ayu Mirage",appearance:"dark",style:{background:"#464a52ff",text:"#cccac2ff","editor.background":"#242835ff","editor.foreground":"#cccac2ff","editor.active_line.background":"#353944bf","search.match_background":"#73cffe66",players:[{cursor:"#72cffeff",background:"#72cffeff",selection:"#72cffe3d"},{cursor:"#5bcde5ff",background:"#5bcde5ff",selection:"#5bcde53d"},{cursor:"#fead66ff",background:"#fead66ff",selection:"#fead663d"},{cursor:"#debffeff",background:"#debffeff",selection:"#debffe3d"},{cursor:"#95e5cbff",background:"#95e5cbff",selection:"#95e5cb3d"},{cursor:"#f18779ff",background:"#f18779ff",selection:"#f187793d"},{cursor:"#fecf72ff",background:"#fecf72ff",selection:"#fecf723d"},{cursor:"#d5fe80ff",background:"#d5fe80ff",selection:"#d5fe803d"}],error:"#f18779ff",warning:"#fecf72ff",info:"#72cffeff",hint:"#7399a3ff",deleted:"#f27983",modified:"#80bfff","terminal.ansi.black":"#242835ff","terminal.ansi.red":"#f18779ff","terminal.ansi.green":"#d5fe80ff","terminal.ansi.yellow":"#fecf72ff","terminal.ansi.blue":"#72cffeff","terminal.ansi.magenta":"#5bcde5ff","terminal.ansi.cyan":"#95e5cbff","terminal.ansi.white":"#cccac2ff","terminal.ansi.bright_black":"#67696eff","terminal.ansi.bright_red":"#833f3cff","terminal.ansi.bright_green":"#75993cff","terminal.ansi.bright_yellow":"#937237ff","terminal.ansi.bright_blue":"#336d8dff","terminal.ansi.bright_magenta":"#2b6c7bff","terminal.ansi.bright_cyan":"#4c806fff","terminal.ansi.bright_white":"#fafafaff",syntax:{attribute:{color:"#72cffeff"},boolean:{color:"#dfbfffff"},comment:{color:"#5c6773ff"},"comment.doc":{color:"#9b9b99ff"},constant:{color:"#dfbfffff"},constructor:{color:"#72cffeff"},embedded:{color:"#cccac2ff"},emphasis:{color:"#72cffeff"},"emphasis.strong":{color:"#72cffeff",font_weight:700},enum:{color:"#fead66ff"},function:{color:"#ffd173ff"},hint:{color:"#7399a3ff"},keyword:{color:"#ffad65ff"},label:{color:"#72cffeff"},link_text:{color:"#fead66ff",font_style:"italic"},link_uri:{color:"#d5fe80ff"},namespace:{color:"#cccac2ff"},number:{color:"#dfbfffff"},operator:{color:"#f29e74ff"},predictive:{color:"#6d839bff",font_style:"italic"},preproc:{color:"#ffad65ff"},primary:{color:"#cccac2ff"},property:{color:"#72cffeff"},punctuation:{color:"#b4b3aeff"},"punctuation.bracket":{color:"#b4b3aeff"},"punctuation.delimiter":{color:"#b4b3aeff"},"punctuation.list_marker":{color:"#b4b3aeff"},"punctuation.markup":{color:"#b4b3aeff"},"punctuation.special":{color:"#dfbfffff"},selector:{color:"#dfbfffff"},"selector.pseudo":{color:"#72cffeff"},string:{color:"#d4fe7fff"},"string.escape":{color:"#9b9b99ff"},"string.regex":{color:"#95e6cbff"},"string.special":{color:"#ffdfb3ff"},"string.special.symbol":{color:"#fead66ff"},tag:{color:"#72cffeff"},"text.literal":{color:"#fead66ff"},title:{color:"#cccac2ff",font_weight:700},type:{color:"#73cfffff"},variable:{color:"#cccac2ff"},"variable.parameter":{color:"#dfbfffff"},variant:{color:"#72cffeff"},"diff.plus":{color:"#aad94cff"},"diff.minus":{color:"#f07178ff"}}}},hB=Object.freeze(Object.defineProperty({__proto__:null,default:GB},Symbol.toStringTag,{value:"Module"})),SB={name:"Catppuccin Frappé",appearance:"dark",style:{background:"#383c52",text:"#c6d0f5","editor.background":"#303446","editor.foreground":"#c6d0f5","editor.active_line.background":"#c6d0f512","editor.document_highlight.bracket_background":"#ca9ee617","search.match_background":"#81c8be4d",players:[{cursor:"#f2d5cf",selection:"#949cbb40",background:"#f2d5cf"},{cursor:"#ca9ee6",selection:"#ca9ee640",background:"#ca9ee6"},{cursor:"#babbf1",selection:"#babbf140",background:"#babbf1"},{cursor:"#85c1dc",selection:"#85c1dc40",background:"#85c1dc"},{cursor:"#a6d189",selection:"#a6d18940",background:"#a6d189"},{cursor:"#e5c890",selection:"#e5c89040",background:"#e5c890"},{cursor:"#ef9f76",selection:"#ef9f7640",background:"#ef9f76"},{cursor:"#e78284",selection:"#e7828440",background:"#e78284"}],error:"#e78284",warning:"#e5c890",info:"#81c8be",hint:"#626880",created:"#a6d189",deleted:"#e78284",modified:"#e5c890","terminal.ansi.black":"#51576d","terminal.ansi.red":"#e78284","terminal.ansi.green":"#a6d189","terminal.ansi.yellow":"#e5c890","terminal.ansi.blue":"#8caaee","terminal.ansi.magenta":"#f4b8e4","terminal.ansi.cyan":"#81c8be","terminal.ansi.white":"#a5adce","terminal.ansi.bright_black":"#626880","terminal.ansi.bright_red":"#e67172","terminal.ansi.bright_green":"#8ec772","terminal.ansi.bright_yellow":"#d9ba73","terminal.ansi.bright_blue":"#7b9ef0","terminal.ansi.bright_magenta":"#f4b8e4","terminal.ansi.bright_cyan":"#5abfb5","terminal.ansi.bright_white":"#b5bfe2",syntax:{variable:{color:"#c6d0f5"},"variable.builtin":{color:"#e78284"},"variable.parameter":{color:"#ea999c"},"variable.member":{color:"#8caaee"},"variable.special":{color:"#e78284",font_style:"italic"},constant:{color:"#ef9f76"},"constant.builtin":{color:"#ef9f76"},"constant.macro":{color:"#ca9ee6"},module:{color:"#e5c890",font_style:"italic"},label:{color:"#85c1dc"},string:{color:"#a6d189"},"string.documentation":{color:"#81c8be"},"string.regexp":{color:"#ef9f76"},"string.escape":{color:"#f4b8e4"},"string.special":{color:"#f4b8e4"},"string.special.path":{color:"#f4b8e4"},"string.special.symbol":{color:"#eebebe"},"string.special.url":{color:"#f2d5cf",font_style:"italic"},character:{color:"#81c8be"},"character.special":{color:"#f4b8e4"},boolean:{color:"#ef9f76"},number:{color:"#ef9f76"},"number.float":{color:"#ef9f76"},tag:{color:"#8caaee"},"tag.attribute":{color:"#e5c890",font_style:"italic"},"tag.delimiter":{color:"#81c8be"},type:{color:"#e5c890"},"type.builtin":{color:"#ca9ee6",font_style:"italic"},"type.definition":{color:"#e5c890"},"type.interface":{color:"#e5c890",font_style:"italic"},"type.super":{color:"#e5c890",font_style:"italic"},attribute:{color:"#ef9f76"},property:{color:"#8caaee"},function:{color:"#8caaee"},"function.builtin":{color:"#ef9f76"},"function.call":{color:"#8caaee"},"function.macro":{color:"#81c8be"},"function.method":{color:"#8caaee"},"function.method.call":{color:"#8caaee"},constructor:{color:"#eebebe"},operator:{color:"#99d1db"},keyword:{color:"#ca9ee6"},"keyword.modifier":{color:"#ca9ee6"},"keyword.type":{color:"#ca9ee6"},"keyword.coroutine":{color:"#ca9ee6"},"keyword.function":{color:"#ca9ee6"},"keyword.operator":{color:"#ca9ee6"},"keyword.import":{color:"#ca9ee6"},"keyword.repeat":{color:"#ca9ee6"},"keyword.return":{color:"#ca9ee6"},"keyword.debug":{color:"#ca9ee6"},"keyword.exception":{color:"#ca9ee6"},"keyword.conditional":{color:"#ca9ee6"},"keyword.conditional.ternary":{color:"#ca9ee6"},"keyword.directive":{color:"#f4b8e4"},"keyword.directive.define":{color:"#f4b8e4"},"keyword.export":{color:"#99d1db"},punctuation:{color:"#949cbb"},"punctuation.delimiter":{color:"#949cbb"},"punctuation.bracket":{color:"#949cbb"},"punctuation.special":{color:"#f4b8e4"},"punctuation.special.symbol":{color:"#eebebe"},"punctuation.list_marker":{color:"#81c8be"},comment:{color:"#949cbb",font_style:"italic"},"comment.doc":{color:"#949cbb",font_style:"italic"},"comment.documentation":{color:"#949cbb",font_style:"italic"},"comment.info":{color:"#81c8be",font_style:"italic"},"comment.error":{color:"#e78284",font_style:"italic"},"comment.warning":{color:"#e5c890",font_style:"italic"},"comment.warn":{color:"#e5c890",font_style:"italic"},"comment.hint":{color:"#8caaee",font_style:"italic"},"comment.todo":{color:"#eebebe",font_style:"italic"},"comment.note":{color:"#f2d5cf",font_style:"italic"},"diff.plus":{color:"#a6d189"},"diff.minus":{color:"#e78284"},parameter:{color:"#ea999c"},field:{color:"#babbf1"},namespace:{color:"#e5c890",font_style:"italic"},float:{color:"#ef9f76"},symbol:{color:"#f4b8e4"},"string.regex":{color:"#ef9f76"},text:{color:"#c6d0f5"},"emphasis.strong":{color:"#ea999c",font_weight:700},emphasis:{color:"#ea999c",font_style:"italic"},embedded:{color:"#ea999c"},"text.literal":{color:"#a6d189"},concept:{color:"#85c1dc"},enum:{color:"#81c8be",font_weight:700},"function.decorator":{color:"#ef9f76"},"type.class.definition":{color:"#e5c890",font_weight:700},hint:{color:"#838ba7",font_style:"italic"},link_text:{color:"#babbf1"},link_uri:{color:"#8caaee",font_style:"italic"},parent:{color:"#ef9f76"},predictive:{color:"#737994"},predoc:{color:"#e78284"},primary:{color:"#ea999c"},"tag.doctype":{color:"#ca9ee6"},"string.doc":{color:"#81c8be",font_style:"italic"},title:{color:"#c6d0f5",font_weight:800},variant:{color:"#e78284"},preproc:{color:"#f4b8e4"},selector:{color:"#8CAAEE"},"selector.class":{color:"#E5C890"},"selector.id":{color:"#E5C890"},"selector.pseudo":{color:"#81C8BE"}}}},DB=Object.freeze(Object.defineProperty({__proto__:null,default:SB},Symbol.toStringTag,{value:"Module"})),UB={name:"Catppuccin Latte",appearance:"light",style:{background:"#d7dce5",text:"#4c4f69","editor.background":"#eff1f5","editor.foreground":"#4c4f69","editor.active_line.background":"#4c4f6912","editor.document_highlight.bracket_background":"#8839ef17","search.match_background":"#1792994d",players:[{cursor:"#dc8a78",selection:"#7c7f934d",background:"#dc8a78"},{cursor:"#8839ef",selection:"#8839ef4d",background:"#8839ef"},{cursor:"#7287fd",selection:"#7287fd4d",background:"#7287fd"},{cursor:"#209fb5",selection:"#209fb54d",background:"#209fb5"},{cursor:"#40a02b",selection:"#40a02b4d",background:"#40a02b"},{cursor:"#df8e1d",selection:"#df8e1d4d",background:"#df8e1d"},{cursor:"#fe640b",selection:"#fe640b4d",background:"#fe640b"},{cursor:"#d20f39",selection:"#d20f394d",background:"#d20f39"}],error:"#d20f39",warning:"#df8e1d",info:"#179299",hint:"#acb0be",created:"#40a02b",deleted:"#d20f39",modified:"#df8e1d","terminal.ansi.black":"#5c5f77","terminal.ansi.red":"#d20f39","terminal.ansi.green":"#40a02b","terminal.ansi.yellow":"#df8e1d","terminal.ansi.blue":"#1e66f5","terminal.ansi.magenta":"#ea76cb","terminal.ansi.cyan":"#179299","terminal.ansi.white":"#acb0be","terminal.ansi.bright_black":"#6c6f85","terminal.ansi.bright_red":"#de293e","terminal.ansi.bright_green":"#49af3d","terminal.ansi.bright_yellow":"#eea02d","terminal.ansi.bright_blue":"#456eff","terminal.ansi.bright_magenta":"#fe85d8","terminal.ansi.bright_cyan":"#2d9fa8","terminal.ansi.bright_white":"#bcc0cc",syntax:{variable:{color:"#4c4f69"},"variable.builtin":{color:"#d20f39"},"variable.parameter":{color:"#e64553"},"variable.member":{color:"#1e66f5"},"variable.special":{color:"#d20f39",font_style:"italic"},constant:{color:"#fe640b"},"constant.builtin":{color:"#fe640b"},"constant.macro":{color:"#8839ef"},module:{color:"#df8e1d",font_style:"italic"},label:{color:"#209fb5"},string:{color:"#40a02b"},"string.documentation":{color:"#179299"},"string.regexp":{color:"#fe640b"},"string.escape":{color:"#ea76cb"},"string.special":{color:"#ea76cb"},"string.special.path":{color:"#ea76cb"},"string.special.symbol":{color:"#dd7878"},"string.special.url":{color:"#dc8a78",font_style:"italic"},character:{color:"#179299"},"character.special":{color:"#ea76cb"},boolean:{color:"#fe640b"},number:{color:"#fe640b"},"number.float":{color:"#fe640b"},tag:{color:"#1e66f5"},"tag.attribute":{color:"#df8e1d",font_style:"italic"},"tag.delimiter":{color:"#179299"},type:{color:"#df8e1d"},"type.builtin":{color:"#8839ef",font_style:"italic"},"type.definition":{color:"#df8e1d"},"type.interface":{color:"#df8e1d",font_style:"italic"},"type.super":{color:"#df8e1d",font_style:"italic"},attribute:{color:"#fe640b"},property:{color:"#1e66f5"},function:{color:"#1e66f5"},"function.builtin":{color:"#fe640b"},"function.call":{color:"#1e66f5"},"function.macro":{color:"#179299"},"function.method":{color:"#1e66f5"},"function.method.call":{color:"#1e66f5"},constructor:{color:"#dd7878"},operator:{color:"#04a5e5"},keyword:{color:"#8839ef"},"keyword.modifier":{color:"#8839ef"},"keyword.type":{color:"#8839ef"},"keyword.coroutine":{color:"#8839ef"},"keyword.function":{color:"#8839ef"},"keyword.operator":{color:"#8839ef"},"keyword.import":{color:"#8839ef"},"keyword.repeat":{color:"#8839ef"},"keyword.return":{color:"#8839ef"},"keyword.debug":{color:"#8839ef"},"keyword.exception":{color:"#8839ef"},"keyword.conditional":{color:"#8839ef"},"keyword.conditional.ternary":{color:"#8839ef"},"keyword.directive":{color:"#ea76cb"},"keyword.directive.define":{color:"#ea76cb"},"keyword.export":{color:"#04a5e5"},punctuation:{color:"#7c7f93"},"punctuation.delimiter":{color:"#7c7f93"},"punctuation.bracket":{color:"#7c7f93"},"punctuation.special":{color:"#ea76cb"},"punctuation.special.symbol":{color:"#dd7878"},"punctuation.list_marker":{color:"#179299"},comment:{color:"#7c7f93",font_style:"italic"},"comment.doc":{color:"#7c7f93",font_style:"italic"},"comment.documentation":{color:"#7c7f93",font_style:"italic"},"comment.info":{color:"#179299",font_style:"italic"},"comment.error":{color:"#d20f39",font_style:"italic"},"comment.warning":{color:"#df8e1d",font_style:"italic"},"comment.warn":{color:"#df8e1d",font_style:"italic"},"comment.hint":{color:"#1e66f5",font_style:"italic"},"comment.todo":{color:"#dd7878",font_style:"italic"},"comment.note":{color:"#dc8a78",font_style:"italic"},"diff.plus":{color:"#40a02b"},"diff.minus":{color:"#d20f39"},parameter:{color:"#e64553"},field:{color:"#7287fd"},namespace:{color:"#df8e1d",font_style:"italic"},float:{color:"#fe640b"},symbol:{color:"#ea76cb"},"string.regex":{color:"#fe640b"},text:{color:"#4c4f69"},"emphasis.strong":{color:"#e64553",font_weight:700},emphasis:{color:"#e64553",font_style:"italic"},embedded:{color:"#e64553"},"text.literal":{color:"#40a02b"},concept:{color:"#209fb5"},enum:{color:"#179299",font_weight:700},"function.decorator":{color:"#fe640b"},"type.class.definition":{color:"#df8e1d",font_weight:700},hint:{color:"#8c8fa1",font_style:"italic"},link_text:{color:"#7287fd"},link_uri:{color:"#1e66f5",font_style:"italic"},parent:{color:"#fe640b"},predictive:{color:"#9ca0b0"},predoc:{color:"#d20f39"},primary:{color:"#e64553"},"tag.doctype":{color:"#8839ef"},"string.doc":{color:"#179299",font_style:"italic"},title:{color:"#4c4f69",font_weight:800},variant:{color:"#d20f39"},preproc:{color:"#ea76cb"},selector:{color:"#1E66F5"},"selector.class":{color:"#DF8E1D"},"selector.id":{color:"#DF8E1D"},"selector.pseudo":{color:"#179299"}}}},JB=Object.freeze(Object.defineProperty({__proto__:null,default:UB},Symbol.toStringTag,{value:"Module"})),LB={name:"Catppuccin Macchiato",appearance:"dark",style:{background:"#2c2f46",text:"#cad3f5","editor.background":"#24273a","editor.foreground":"#cad3f5","editor.active_line.background":"#cad3f512","editor.document_highlight.bracket_background":"#c6a0f617","search.match_background":"#8bd5ca4d",players:[{cursor:"#f4dbd6",selection:"#939ab740",background:"#f4dbd6"},{cursor:"#c6a0f6",selection:"#c6a0f640",background:"#c6a0f6"},{cursor:"#b7bdf8",selection:"#b7bdf840",background:"#b7bdf8"},{cursor:"#7dc4e4",selection:"#7dc4e440",background:"#7dc4e4"},{cursor:"#a6da95",selection:"#a6da9540",background:"#a6da95"},{cursor:"#eed49f",selection:"#eed49f40",background:"#eed49f"},{cursor:"#f5a97f",selection:"#f5a97f40",background:"#f5a97f"},{cursor:"#ed8796",selection:"#ed879640",background:"#ed8796"}],error:"#ed8796",warning:"#eed49f",info:"#8bd5ca",hint:"#5b6078",created:"#a6da95",deleted:"#ed8796",modified:"#eed49f","terminal.ansi.black":"#494d64","terminal.ansi.red":"#ed8796","terminal.ansi.green":"#a6da95","terminal.ansi.yellow":"#eed49f","terminal.ansi.blue":"#8aadf4","terminal.ansi.magenta":"#f5bde6","terminal.ansi.cyan":"#8bd5ca","terminal.ansi.white":"#a5adcb","terminal.ansi.bright_black":"#5b6078","terminal.ansi.bright_red":"#ec7486","terminal.ansi.bright_green":"#8ccf7f","terminal.ansi.bright_yellow":"#e1c682","terminal.ansi.bright_blue":"#78a1f6","terminal.ansi.bright_magenta":"#f2a9dd","terminal.ansi.bright_cyan":"#63cbc0","terminal.ansi.bright_white":"#b8c0e0",syntax:{variable:{color:"#cad3f5"},"variable.builtin":{color:"#ed8796"},"variable.parameter":{color:"#ee99a0"},"variable.member":{color:"#8aadf4"},"variable.special":{color:"#ed8796",font_style:"italic"},constant:{color:"#f5a97f"},"constant.builtin":{color:"#f5a97f"},"constant.macro":{color:"#c6a0f6"},module:{color:"#eed49f",font_style:"italic"},label:{color:"#7dc4e4"},string:{color:"#a6da95"},"string.documentation":{color:"#8bd5ca"},"string.regexp":{color:"#f5a97f"},"string.escape":{color:"#f5bde6"},"string.special":{color:"#f5bde6"},"string.special.path":{color:"#f5bde6"},"string.special.symbol":{color:"#f0c6c6"},"string.special.url":{color:"#f4dbd6",font_style:"italic"},character:{color:"#8bd5ca"},"character.special":{color:"#f5bde6"},boolean:{color:"#f5a97f"},number:{color:"#f5a97f"},"number.float":{color:"#f5a97f"},tag:{color:"#8aadf4"},"tag.attribute":{color:"#eed49f",font_style:"italic"},"tag.delimiter":{color:"#8bd5ca"},type:{color:"#eed49f"},"type.builtin":{color:"#c6a0f6",font_style:"italic"},"type.definition":{color:"#eed49f"},"type.interface":{color:"#eed49f",font_style:"italic"},"type.super":{color:"#eed49f",font_style:"italic"},attribute:{color:"#f5a97f"},property:{color:"#8aadf4"},function:{color:"#8aadf4"},"function.builtin":{color:"#f5a97f"},"function.call":{color:"#8aadf4"},"function.macro":{color:"#8bd5ca"},"function.method":{color:"#8aadf4"},"function.method.call":{color:"#8aadf4"},constructor:{color:"#f0c6c6"},operator:{color:"#91d7e3"},keyword:{color:"#c6a0f6"},"keyword.modifier":{color:"#c6a0f6"},"keyword.type":{color:"#c6a0f6"},"keyword.coroutine":{color:"#c6a0f6"},"keyword.function":{color:"#c6a0f6"},"keyword.operator":{color:"#c6a0f6"},"keyword.import":{color:"#c6a0f6"},"keyword.repeat":{color:"#c6a0f6"},"keyword.return":{color:"#c6a0f6"},"keyword.debug":{color:"#c6a0f6"},"keyword.exception":{color:"#c6a0f6"},"keyword.conditional":{color:"#c6a0f6"},"keyword.conditional.ternary":{color:"#c6a0f6"},"keyword.directive":{color:"#f5bde6"},"keyword.directive.define":{color:"#f5bde6"},"keyword.export":{color:"#91d7e3"},punctuation:{color:"#939ab7"},"punctuation.delimiter":{color:"#939ab7"},"punctuation.bracket":{color:"#939ab7"},"punctuation.special":{color:"#f5bde6"},"punctuation.special.symbol":{color:"#f0c6c6"},"punctuation.list_marker":{color:"#8bd5ca"},comment:{color:"#939ab7",font_style:"italic"},"comment.doc":{color:"#939ab7",font_style:"italic"},"comment.documentation":{color:"#939ab7",font_style:"italic"},"comment.info":{color:"#8bd5ca",font_style:"italic"},"comment.error":{color:"#ed8796",font_style:"italic"},"comment.warning":{color:"#eed49f",font_style:"italic"},"comment.warn":{color:"#eed49f",font_style:"italic"},"comment.hint":{color:"#8aadf4",font_style:"italic"},"comment.todo":{color:"#f0c6c6",font_style:"italic"},"comment.note":{color:"#f4dbd6",font_style:"italic"},"diff.plus":{color:"#a6da95"},"diff.minus":{color:"#ed8796"},parameter:{color:"#ee99a0"},field:{color:"#b7bdf8"},namespace:{color:"#eed49f",font_style:"italic"},float:{color:"#f5a97f"},symbol:{color:"#f5bde6"},"string.regex":{color:"#f5a97f"},text:{color:"#cad3f5"},"emphasis.strong":{color:"#ee99a0",font_weight:700},emphasis:{color:"#ee99a0",font_style:"italic"},embedded:{color:"#ee99a0"},"text.literal":{color:"#a6da95"},concept:{color:"#7dc4e4"},enum:{color:"#8bd5ca",font_weight:700},"function.decorator":{color:"#f5a97f"},"type.class.definition":{color:"#eed49f",font_weight:700},hint:{color:"#8087a2",font_style:"italic"},link_text:{color:"#b7bdf8"},link_uri:{color:"#8aadf4",font_style:"italic"},parent:{color:"#f5a97f"},predictive:{color:"#6e738d"},predoc:{color:"#ed8796"},primary:{color:"#ee99a0"},"tag.doctype":{color:"#c6a0f6"},"string.doc":{color:"#8bd5ca",font_style:"italic"},title:{color:"#cad3f5",font_weight:800},variant:{color:"#ed8796"},preproc:{color:"#f5bde6"},selector:{color:"#8AADF4"},"selector.class":{color:"#EED49F"},"selector.id":{color:"#EED49F"},"selector.pseudo":{color:"#8BD5CA"}}}},mB=Object.freeze(Object.defineProperty({__proto__:null,default:LB},Symbol.toStringTag,{value:"Module"})),pB={name:"Catppuccin Mocha",appearance:"dark",style:{background:"#27273b",text:"#cdd6f4","editor.background":"#1e1e2e","editor.foreground":"#cdd6f4","editor.active_line.background":"#cdd6f412","editor.document_highlight.bracket_background":"#cba6f717","search.match_background":"#94e2d54d",players:[{cursor:"#f5e0dc",selection:"#9399b240",background:"#f5e0dc"},{cursor:"#cba6f7",selection:"#cba6f740",background:"#cba6f7"},{cursor:"#b4befe",selection:"#b4befe40",background:"#b4befe"},{cursor:"#74c7ec",selection:"#74c7ec40",background:"#74c7ec"},{cursor:"#a6e3a1",selection:"#a6e3a140",background:"#a6e3a1"},{cursor:"#f9e2af",selection:"#f9e2af40",background:"#f9e2af"},{cursor:"#fab387",selection:"#fab38740",background:"#fab387"},{cursor:"#f38ba8",selection:"#f38ba840",background:"#f38ba8"}],error:"#f38ba8",warning:"#f9e2af",info:"#94e2d5",hint:"#585b70",created:"#a6e3a1",deleted:"#f38ba8",modified:"#f9e2af","terminal.ansi.black":"#45475a","terminal.ansi.red":"#f38ba8","terminal.ansi.green":"#a6e3a1","terminal.ansi.yellow":"#f9e2af","terminal.ansi.blue":"#89b4fa","terminal.ansi.magenta":"#f5c2e7","terminal.ansi.cyan":"#94e2d5","terminal.ansi.white":"#a6adc8","terminal.ansi.bright_black":"#585b70","terminal.ansi.bright_red":"#f37799","terminal.ansi.bright_green":"#89d88b","terminal.ansi.bright_yellow":"#ebd391","terminal.ansi.bright_blue":"#74a8fc","terminal.ansi.bright_magenta":"#f2aede","terminal.ansi.bright_cyan":"#6bd7ca","terminal.ansi.bright_white":"#bac2de",syntax:{variable:{color:"#cdd6f4"},"variable.builtin":{color:"#f38ba8"},"variable.parameter":{color:"#eba0ac"},"variable.member":{color:"#89b4fa"},"variable.special":{color:"#f38ba8",font_style:"italic"},constant:{color:"#fab387"},"constant.builtin":{color:"#fab387"},"constant.macro":{color:"#cba6f7"},module:{color:"#f9e2af",font_style:"italic"},label:{color:"#74c7ec"},string:{color:"#a6e3a1"},"string.documentation":{color:"#94e2d5"},"string.regexp":{color:"#fab387"},"string.escape":{color:"#f5c2e7"},"string.special":{color:"#f5c2e7"},"string.special.path":{color:"#f5c2e7"},"string.special.symbol":{color:"#f2cdcd"},"string.special.url":{color:"#f5e0dc",font_style:"italic"},character:{color:"#94e2d5"},"character.special":{color:"#f5c2e7"},boolean:{color:"#fab387"},number:{color:"#fab387"},"number.float":{color:"#fab387"},tag:{color:"#89b4fa"},"tag.attribute":{color:"#f9e2af",font_style:"italic"},"tag.delimiter":{color:"#94e2d5"},type:{color:"#f9e2af"},"type.builtin":{color:"#cba6f7",font_style:"italic"},"type.definition":{color:"#f9e2af"},"type.interface":{color:"#f9e2af",font_style:"italic"},"type.super":{color:"#f9e2af",font_style:"italic"},attribute:{color:"#fab387"},property:{color:"#89b4fa"},function:{color:"#89b4fa"},"function.builtin":{color:"#fab387"},"function.call":{color:"#89b4fa"},"function.macro":{color:"#94e2d5"},"function.method":{color:"#89b4fa"},"function.method.call":{color:"#89b4fa"},constructor:{color:"#f2cdcd"},operator:{color:"#89dceb"},keyword:{color:"#cba6f7"},"keyword.modifier":{color:"#cba6f7"},"keyword.type":{color:"#cba6f7"},"keyword.coroutine":{color:"#cba6f7"},"keyword.function":{color:"#cba6f7"},"keyword.operator":{color:"#cba6f7"},"keyword.import":{color:"#cba6f7"},"keyword.repeat":{color:"#cba6f7"},"keyword.return":{color:"#cba6f7"},"keyword.debug":{color:"#cba6f7"},"keyword.exception":{color:"#cba6f7"},"keyword.conditional":{color:"#cba6f7"},"keyword.conditional.ternary":{color:"#cba6f7"},"keyword.directive":{color:"#f5c2e7"},"keyword.directive.define":{color:"#f5c2e7"},"keyword.export":{color:"#89dceb"},punctuation:{color:"#9399b2"},"punctuation.delimiter":{color:"#9399b2"},"punctuation.bracket":{color:"#9399b2"},"punctuation.special":{color:"#f5c2e7"},"punctuation.special.symbol":{color:"#f2cdcd"},"punctuation.list_marker":{color:"#94e2d5"},comment:{color:"#9399b2",font_style:"italic"},"comment.doc":{color:"#9399b2",font_style:"italic"},"comment.documentation":{color:"#9399b2",font_style:"italic"},"comment.info":{color:"#94e2d5",font_style:"italic"},"comment.error":{color:"#f38ba8",font_style:"italic"},"comment.warning":{color:"#f9e2af",font_style:"italic"},"comment.warn":{color:"#f9e2af",font_style:"italic"},"comment.hint":{color:"#89b4fa",font_style:"italic"},"comment.todo":{color:"#f2cdcd",font_style:"italic"},"comment.note":{color:"#f5e0dc",font_style:"italic"},"diff.plus":{color:"#a6e3a1"},"diff.minus":{color:"#f38ba8"},parameter:{color:"#eba0ac"},field:{color:"#b4befe"},namespace:{color:"#f9e2af",font_style:"italic"},float:{color:"#fab387"},symbol:{color:"#f5c2e7"},"string.regex":{color:"#fab387"},text:{color:"#cdd6f4"},"emphasis.strong":{color:"#eba0ac",font_weight:700},emphasis:{color:"#eba0ac",font_style:"italic"},embedded:{color:"#eba0ac"},"text.literal":{color:"#a6e3a1"},concept:{color:"#74c7ec"},enum:{color:"#94e2d5",font_weight:700},"function.decorator":{color:"#fab387"},"type.class.definition":{color:"#f9e2af",font_weight:700},hint:{color:"#7f849c",font_style:"italic"},link_text:{color:"#b4befe"},link_uri:{color:"#89b4fa",font_style:"italic"},parent:{color:"#fab387"},predictive:{color:"#6c7086"},predoc:{color:"#f38ba8"},primary:{color:"#eba0ac"},"tag.doctype":{color:"#cba6f7"},"string.doc":{color:"#94e2d5",font_style:"italic"},title:{color:"#cdd6f4",font_weight:800},variant:{color:"#f38ba8"},preproc:{color:"#f5c2e7"},selector:{color:"#89B4FA"},"selector.class":{color:"#F9E2AF"},"selector.id":{color:"#F9E2AF"},"selector.pseudo":{color:"#94E2D5"}}}},uB=Object.freeze(Object.defineProperty({__proto__:null,default:pB},Symbol.toStringTag,{value:"Module"})),jB={name:"Dark Plus",appearance:"dark",style:{background:"#1e1e1eff",text:"#d4d4d4ff","editor.background":"#1e1e1eff","editor.foreground":"#d4d4d4ff","editor.active_line.background":"#d4d4d40a","editor.document_highlight.bracket_background":"#d4d4d41a","search.match_background":"#d4d4d433",players:[{cursor:"#d4d4d4ff",background:"#d4d4d426",selection:"#d4d4d433"},{cursor:"#d4b455ff",background:"#d4b45526",selection:"#d4b4554d"},{cursor:"#94d455ff",background:"#94d45526",selection:"#94d4554d"},{cursor:"#55d475ff",background:"#55d47526",selection:"#55d4754d"},{cursor:"#55d4d4ff",background:"#55d4d426",selection:"#55d4d44d"},{cursor:"#5575d4ff",background:"#5575d426",selection:"#5575d44d"},{cursor:"#9455d4ff",background:"#9455d426",selection:"#9455d44d"},{cursor:"#d455b4ff",background:"#d455b426",selection:"#d455b44d"}],error:"#f44747ff",warning:"#cca700ff",info:"#3794ffff",hint:"#969696ff","terminal.ansi.black":"#000000ff","terminal.ansi.red":"#cd3131ff","terminal.ansi.green":"#0dbc79ff","terminal.ansi.yellow":"#e5e510ff","terminal.ansi.blue":"#2472c8ff","terminal.ansi.magenta":"#bc3fbcff","terminal.ansi.cyan":"#11a8cdff","terminal.ansi.white":"#e5e5e5ff","terminal.ansi.bright_black":"#666666ff","terminal.ansi.bright_red":"#f14c4cff","terminal.ansi.bright_green":"#23d18bff","terminal.ansi.bright_yellow":"#f5f543ff","terminal.ansi.bright_blue":"#3b8eeaff","terminal.ansi.bright_magenta":"#d670d6ff","terminal.ansi.bright_cyan":"#29b8dbff","terminal.ansi.bright_white":"#e5e5e5ff",syntax:{comment:{color:"#6a9955ff"},"comment.doc":{color:"#6a9955ff"},string:{color:"#ce9178ff"},"string.regex":{color:"#d16969ff"},"string.escape":{color:"#d7ba7dff"},link_text:{color:"#ce9178ff"},number:{color:"#b5cea8ff"},boolean:{color:"#569cd6ff"},"constant.builtin":{color:"#569cd6ff"},constant:{color:"#4FC1FF"},variable:{color:"#9cdcfeff"},"variable.special":{color:"#569cd6ff"},"variable.parameter":{color:"#9cdcfeff"},keyword:{color:"#569cd6ff"},operator:{color:"#d4d4d4ff"},type:{color:"#4ec9b0ff"},"type.builtin":{color:"#4ec9b0ff"},function:{color:"#dcdcaaff"},"function.builtin":{color:"#dcdcaaff"},tag:{color:"#569cd6ff"},attribute:{color:"#9cdcfeff"},"punctuation.special":{color:"#569cd6ff"},"punctuation.bracket":{color:"#d4d4d4ff"},"punctuation.delimiter":{color:"#d4d4d4ff"},"punctuation.list_marker":{color:"#6796e6ff"},punctuation:{color:"#d4d4d4ff"},preproc:{color:"#569cd6ff"},title:{color:"#569cd6ff",font_weight:700},"emphasis.strong":{color:"#569cd6ff",font_weight:700},emphasis:{color:"#c586c0ff",font_style:"italic"},"text.literal":{color:"#ce9178ff"},enum:{color:"#4ec9b0ff"},property:{color:"#9cdcfeff"},label:{color:"#C8C8C8"},constructor:{color:"#dcdcaaff"},namespace:{color:"#4ec9b0ff"},"diff.minus":{color:"#ce9178ff"},"diff.plus":{color:"#b5cea8ff"},embedded:{color:"#d4d4d4ff"},selector:{color:"#d7ba7dff"},"selector.pseudo":{color:"#D7BA7D"},variant:{color:"#4fc1ffff"},"string.special":{color:"#ce9178ff"},"punctuation.markup":{color:"#d4d4d4ff"},primary:{color:"#d4d4d4ff"},link_uri:{color:"#d4d4d4ff"},hint:{color:"#d4d4d466"},predictive:{color:"#d4d4d466"},"string.special.symbol":{color:"#d4d4d4ff"},"keyword.control":{color:"#C586C0"},"keyword.import":{color:"#C586C0"},"tag.doctype":{color:"#d4d4d4ff"},"punctuation.bracket.html":{color:"#808080"},"punctuation.bracket.jsx":{color:"#808080"},"punctuation.delimiter.html":{color:"#808080"},"punctuation.delimiter.jsx":{color:"#808080"},"tag.component.jsx":{color:"#4EC9B0"}},created:"#81b88b",deleted:"#c74e39",modified:"#E2C08D"}},YB=Object.freeze(Object.defineProperty({__proto__:null,default:jB},Symbol.toStringTag,{value:"Module"})),NB={name:"Dracula Theme",appearance:"dark",style:{background:"#b597e033",text:"#f8f8f2ff","editor.background":"#282a36ff","editor.foreground":"#f8f8f2ff","editor.active_line.background":"#C9A8F933","editor.document_highlight.bracket_background":"#bd93f935","search.match_background":"#50fa7b50",players:[{cursor:"#bd93f9ff",background:"#bd93f9ff",selection:"#bd93f933"},{cursor:"#50fa7bff",background:"#50fa7bff",selection:"#50fa7b33"},{cursor:"#ff79c6ff",background:"#ff79c6ff",selection:"#ff79c633"},{cursor:"#f1fa8cff",background:"#f1fa8cff",selection:"#f1fa8c33"},{cursor:"#8be9fdff",background:"#8be9fdff",selection:"#8be9fd33"},{cursor:"#ffb86cff",background:"#ffb86cff",selection:"#ffb86c33"},{cursor:"#ff5555ff",background:"#ff5555ff",selection:"#ff555533"}],error:"#e67373ff",warning:"#e6e373ff",info:"#73ece5ff",hint:"#6272a4ff",deleted:"#FF5555",modified:"#8BE9FD","terminal.ansi.black":"#21222cff","terminal.ansi.red":"#ff5555ff","terminal.ansi.green":"#50fa7bff","terminal.ansi.yellow":"#f1fa8cff","terminal.ansi.blue":"#9580ffff","terminal.ansi.magenta":"#ff79c6ff","terminal.ansi.cyan":"#8be9fdff","terminal.ansi.white":"#f8f8f2ff","terminal.ansi.bright_black":"#919cbfff","terminal.ansi.bright_red":"#FF6E6Eff","terminal.ansi.bright_green":"#69FF94ff","terminal.ansi.bright_yellow":"#FFFFA5ff","terminal.ansi.bright_blue":"#D6ACFFff","terminal.ansi.bright_magenta":"#FF92DFff","terminal.ansi.bright_cyan":"#A4FFFFff","terminal.ansi.bright_white":"#ffffffff",syntax:{attribute:{color:"#8be9fdff"},boolean:{color:"#ff79c6ff"},comment:{color:"#6272a4ff"},"comment.doc":{color:"#ff79c6ff"},constant:{color:"#bd93f9ff"},constructor:{color:"#ff79c6ff"},embedded:{color:"#f8f8f2ff"},emphasis:{color:"#f1fa8cff",font_style:"italic"},"emphasis.strong":{color:"#ffb86cff",font_weight:700},enum:{color:"#bd93f9ff"},function:{color:"#50fa7bff"},hint:{color:"#6272a4ff",font_style:"italic"},keyword:{color:"#ff79c6ff"},label:{color:"#f8f8f2ff"},link_text:{color:"#ff79c6ff",font_style:"normal"},link_uri:{color:"#8be9fdff"},number:{color:"#bd93f9ff"},operator:{color:"#ff79c6ff"},predictive:{color:"#c6c6c2ff",font_style:"italic"},preproc:{color:"#6272a4ff"},primary:{color:"#f8f8f2ff"},property:{color:"#8be9fdff"},punctuation:{color:"#ff79c6ff"},"punctuation.bracket":{color:"#f8f8f2ff"},"punctuation.delimiter":{color:"#ff79c6ff"},"punctuation.list_marker":{color:"#8be9fdff"},"punctuation.special":{color:"#ff79c6ff"},string:{color:"#f1fa8cff"},"string.escape":{color:"#ff79c6ff"},"string.regex":{color:"#ff5555ff"},"string.special":{color:"#ff79c6ff"},"string.special.symbol":{color:"#bd93f9ff"},tag:{color:"#ff79c6ff"},"text.literal":{color:"#50fa7bff"},title:{color:"#bd93f9ff",font_weight:600},type:{color:"#8be9fdff"},"type.interface":{color:"#8be9fdff",font_style:"italic"},"type.super":{color:"#8be9fdff",font_style:"italic"},variable:{color:"#f8f8f2ff"},"variable.member":{color:"#f8f8f2ff"},"variable.parameter":{color:"#ffb86cff",font_style:"italic"},"variable.special":{color:"#bd93f9ff",font_style:"italic"},variant:{color:"#bd93f9ff"},namespace:{color:"#8be9fdff"},selector:{color:"#FF79C6"},"diff.minus":{color:"#FF5555"},"diff.plus":{color:"#50FA7B"},"selector.class":{color:"#50FA7B",font_style:"italic"},"selector.id":{color:"#50FA7B",font_style:"italic"},"selector.pseudo":{color:"#50FA7B",font_style:"italic"}}}},HB=Object.freeze(Object.defineProperty({__proto__:null,default:NB},Symbol.toStringTag,{value:"Module"})),ZB={name:"Dracula Theme Soft",appearance:"dark",style:{background:"#282A36","editor.background":"#282A36",text:"#f6f6f4","editor.foreground":"#f6f6f4","search.match_background":"#FFB86C80",error:"#ee6666",warning:"#97e1f1",players:[{cursor:"#f6f6f4",selection:"#44475A"}],deleted:"#ee6666",modified:"#97e1f1","terminal.ansi.black":"#262626","terminal.ansi.red":"#ee6666","terminal.ansi.green":"#62e884","terminal.ansi.yellow":"#e7ee98","terminal.ansi.blue":"#bf9eee","terminal.ansi.magenta":"#f286c4","terminal.ansi.cyan":"#97e1f1","terminal.ansi.white":"#f6f6f4","terminal.ansi.bright_black":"#7b7f8b","terminal.ansi.bright_red":"#f07c7c","terminal.ansi.bright_green":"#78f09a","terminal.ansi.bright_yellow":"#f6f6ae","terminal.ansi.bright_blue":"#d6b4f7","terminal.ansi.bright_magenta":"#f49dda","terminal.ansi.bright_cyan":"#adf6f6","terminal.ansi.bright_white":"#ffffff",syntax:{attribute:{color:"#62e884",font_style:"italic"},comment:{color:"#7b7f8b"},"comment.doc":{color:"#7b7f8b"},constant:{color:"#bf9eee"},constructor:{color:"#f286c4"},emphasis:{color:"#e7ee98",font_style:"italic"},"emphasis.strong":{color:"#FFB86C",font_weight:700},function:{color:"#62e884"},keyword:{color:"#f286c4"},link_text:{color:"#97e1f1"},link_uri:{color:"#97e1f1"},number:{color:"#bf9eee"},string:{color:"#e7ee98"},"string.escape":{color:"#e7ee98"},"string.regex":{color:"#e7ee98"},"string.special":{color:"#e7ee98"},"string.special.symbol":{color:"#e7ee98"},tag:{color:"#f286c4"},"text.literal":{color:"#e7ee98"},type:{color:"#97e1f1",font_style:"italic"},variable:{color:"#f6f6f4"},"variable.special":{color:"#bf9eee",font_style:"italic"},boolean:{color:"#BF9EEE"},embedded:{color:"#f6f6f4"},label:{color:"#f6f6f4"},namespace:{color:"#97e1f1",font_style:"italic"},operator:{color:"#F286C4"},predictive:{color:"#7b7f8b"},preproc:{color:"#f286c4"},primary:{color:"#f6f6f4"},property:{color:"#F6F6F4"},punctuation:{color:"#f6f6f4"},selector:{color:"#F286C4"},title:{color:"#BF9EEE",font_weight:700},enum:{color:"#97E1F1",font_style:"italic"},hint:{color:"#7b7f8b"},variant:{color:"#F6F6F4"},"diff.minus":{color:"#EE6666"},"diff.plus":{color:"#62E884"},"property.json_key":{color:"#97E1F1"},"selector.class":{color:"#62E884",font_style:"italic"},"selector.id":{color:"#62E884",font_style:"italic"},"selector.pseudo":{color:"#62E884",font_style:"italic"}}}},xB=Object.freeze(Object.defineProperty({__proto__:null,default:ZB},Symbol.toStringTag,{value:"Module"})),TB={name:"Everforest Dark",appearance:"dark",style:{background:"#3d484d",text:"#d3c6aa","editor.background":"#2d353b","editor.foreground":"#d3c6aa","editor.active_line.background":"#343f44","editor.document_highlight.bracket_background":"#475258","search.match_background":"#475258",players:[{background:"#e67e80",cursor:"#e67e80",selection:"#543a48"}],error:"#e67e80",warning:"#dbbc7f",info:"#a7c080",hint:"#d699b6",created:"#a7c080a0",deleted:"#e67e80a0",modified:"#7fbbb3a0","terminal.ansi.black":"#232a2e","terminal.ansi.red":"#e67e80","terminal.ansi.green":"#a7c080","terminal.ansi.yellow":"#dbbc7f","terminal.ansi.blue":"#7fbbb3","terminal.ansi.magenta":"#d699b6","terminal.ansi.cyan":"#83c092","terminal.ansi.white":"#d3c6aa","terminal.ansi.bright_black":"#859289","terminal.ansi.bright_red":"#e67e80","terminal.ansi.bright_green":"#a7c080","terminal.ansi.bright_yellow":"#dbbc7f","terminal.ansi.bright_blue":"#7fbbb3","terminal.ansi.bright_magenta":"#d699b6","terminal.ansi.bright_cyan":"#83c092","terminal.ansi.bright_white":"#d3c6aa",syntax:{attribute:{color:"#d699b6"},boolean:{color:"#d699b6"},comment:{color:"#859289"},"comment.doc":{color:"#9da9a0"},constant:{color:"#d3c6aa"},"constant.builtin":{color:"#83c092"},constructor:{color:"#a7c080"},embedded:{color:"#a7c080"},emphasis:{color:"#83c092",font_style:"italic"},"emphasis.strong":{color:"#83c092",font_weight:600},enum:{color:"#dbbc7f"},function:{color:"#a7c080"},"function.builtin":{color:"#a7c080"},hint:{color:"#d699b6"},keyword:{color:"#e67e80"},label:{color:"#e69875"},link_text:{color:"#dbbc7f"},link_uri:{color:"#7fbbb3"},namespace:{color:"#dbbc7f"},number:{color:"#d699b6"},operator:{color:"#e69875"},predictive:{color:"#859289"},preproc:{color:"#d699b6"},primary:{color:"#d3c6aa"},property:{color:"#7fbbb3"},punctuation:{color:"#859289"},"punctuation.bracket":{color:"#d3c6aa"},"punctuation.delimiter":{color:"#859289"},"punctuation.list_marker":{color:"#7fbbb3"},"punctuation.markup":{color:"#859289"},"punctuation.special":{color:"#7fbbb3"},selector:{color:"#e67e80"},"selector.pseudo":{color:"#d699b6"},string:{color:"#83c092"},"string.escape":{color:"#a7c080"},"string.regex":{color:"#a7c080"},"string.special":{color:"#dbbc7f"},"string.special.symbol":{color:"#d3c6aa"},tag:{color:"#e69875"},"tag.doctype":{color:"#d699b6"},"text.literal":{color:"#a7c080"},title:{color:"#e69875"},type:{color:"#dbbc7f"},variable:{color:"#d3c6aa"},"variable.special":{color:"#d699b6"},variant:{color:"#d3c6aa"},"diff.minus":{color:"#e67e80a0"},"diff.plus":{color:"#a7c080a0"}}}},WB=Object.freeze(Object.defineProperty({__proto__:null,default:TB},Symbol.toStringTag,{value:"Module"})),_B={name:"Everforest Light",appearance:"light",style:{background:"#efebd4",text:"#5c6a72","editor.background":"#fdf6e3","editor.foreground":"#5c6a72","editor.active_line.background":"#f4f0d9","editor.document_highlight.bracket_background":"#e6e2cc","search.match_background":"#e6e2cc",players:[{background:"#e66868",cursor:"#e66868",selection:"#eaedc8"}],error:"#f85552",warning:"#dfa000",info:"#8da101",hint:"#df69ba",created:"#8da101a0",deleted:"#f85552a0",modified:"#3a94c5a0","terminal.ansi.black":"#efebd4","terminal.ansi.red":"#f85552","terminal.ansi.green":"#8da101","terminal.ansi.yellow":"#dfa000","terminal.ansi.blue":"#3a94c5","terminal.ansi.magenta":"#df69ba","terminal.ansi.cyan":"#35a77c","terminal.ansi.white":"#5c6a72","terminal.ansi.bright_black":"#939f91","terminal.ansi.bright_red":"#f85552","terminal.ansi.bright_green":"#8da101","terminal.ansi.bright_yellow":"#dfa000","terminal.ansi.bright_blue":"#3a94c5","terminal.ansi.bright_magenta":"#df69ba","terminal.ansi.bright_cyan":"#35a77c","terminal.ansi.bright_white":"#5c6a72",syntax:{attribute:{color:"#df69ba"},boolean:{color:"#df69ba"},comment:{color:"#939f91"},"comment.doc":{color:"#829181"},constant:{color:"#5c6a72"},"constant.builtin":{color:"#35a77c"},constructor:{color:"#8da101"},embedded:{color:"#8da101"},emphasis:{color:"#35a77c",font_style:"italic"},"emphasis.strong":{color:"#35a77c",font_weight:600},enum:{color:"#dfa000"},function:{color:"#8da101"},"function.builtin":{color:"#8da101"},hint:{color:"#df69ba"},keyword:{color:"#f85552"},label:{color:"#f57d26"},link_text:{color:"#dfa000"},link_uri:{color:"#3a94c5"},namespace:{color:"#dfa000"},number:{color:"#df69ba"},operator:{color:"#f57d26"},predictive:{color:"#939f91"},preproc:{color:"#df69ba"},primary:{color:"#5c6a72"},property:{color:"#3a94c5"},punctuation:{color:"#939f91"},"punctuation.bracket":{color:"#5c6a72"},"punctuation.delimiter":{color:"#939f91"},"punctuation.list_marker":{color:"#3a94c5"},"punctuation.markup":{color:"#939f91"},"punctuation.special":{color:"#3a94c5"},selector:{color:"#f85552"},"selector.pseudo":{color:"#df69ba"},string:{color:"#35a77c"},"string.escape":{color:"#8da101"},"string.regex":{color:"#8da101"},"string.special":{color:"#dfa000"},"string.special.symbol":{color:"#5c6a72"},tag:{color:"#f57d26"},"tag.doctype":{color:"#df69ba"},"text.literal":{color:"#8da101"},title:{color:"#f57d26"},type:{color:"#dfa000"},variable:{color:"#5c6a72"},"variable.special":{color:"#df69ba"},variant:{color:"#5c6a72"},"diff.minus":{color:"#f85552a0"},"diff.plus":{color:"#8da101a0"}}}},PB=Object.freeze(Object.defineProperty({__proto__:null,default:_B},Symbol.toStringTag,{value:"Module"})),XB={name:"GitHub Dark",appearance:"dark",style:{background:"#24292e",text:"#d1d5da","editor.background":"#24292e","editor.foreground":"#e1e4e8","editor.active_line.background":"#2b3036","editor.document_highlight.bracket_background":"#17E5E611","search.match_background":"#ffd33d1a",players:[{cursor:"#79b8ff",selection:"#04428933",background:"#79b8ff"},{cursor:"#d1d5da",selection:"#444d5633",background:"#d1d5da"},{cursor:"#85e89d",selection:"#176f2c33",background:"#85e89d"},{cursor:"#ffab70",selection:"#d1570433",background:"#ffab70"},{cursor:"#f692ce",selection:"#b93a8633",background:"#f692ce"},{cursor:"#b392f0",selection:"#4c288933",background:"#b392f0"},{cursor:"#f97583",selection:"#b31d2833",background:"#f97583"},{cursor:"#ffea7f",selection:"#dbab0933",background:"#ffea7f"}],error:"#f97583",warning:"#ffea7f",info:"#79b8ff",hint:"#848d97",created:"#34d058",deleted:"#ea4a5a",modified:"#79b8ff","terminal.ansi.black":"#586069","terminal.ansi.red":"#ea4a5a","terminal.ansi.green":"#34d058","terminal.ansi.yellow":"#ffea7f","terminal.ansi.blue":"#2188ff","terminal.ansi.magenta":"#b392f0","terminal.ansi.cyan":"#39c5cf","terminal.ansi.white":"#d1d5da","terminal.ansi.bright_black":"#959da5","terminal.ansi.bright_red":"#f97583","terminal.ansi.bright_green":"#85e89d","terminal.ansi.bright_yellow":"#ffea7f","terminal.ansi.bright_blue":"#79b8ff","terminal.ansi.bright_magenta":"#b392f0","terminal.ansi.bright_cyan":"#56d4dd","terminal.ansi.bright_white":"#fafbfc",syntax:{boolean:{color:"#79b8ff"},comment:{color:"#6a737d"},"comment.doc":{color:"#6a737d"},"comment.documentation":{color:"#6a737d"},constant:{color:"#79b8ff"},"constant.builtin":{color:"#79b8ff"},constructor:{color:"#85e89d"},emphasis:{color:"#e1e4e8",font_style:"italic"},"emphasis.strong":{color:"#e1e4e8",font_weight:700},enum:{color:"#79b8ff"},function:{color:"#b392f0"},"function.builtin":{color:"#b392f0"},"function.method":{color:"#b392f0"},"function.method.call":{color:"#b392f0"},keyword:{color:"#f97583"},"keyword.operator":{color:"#f97583"},label:{color:"#b392f0"},link_text:{color:"#dbedff"},link_uri:{color:"#dbedff"},number:{color:"#79b8ff"},operator:{color:"#f97583"},property:{color:"#79b8ff"},"punctuation.bracket":{color:"#79b8ff"},"punctuation.delimiter":{color:"#f97583"},string:{color:"#9ecbff"},"string.escape":{color:"#9ecbff"},"string.regex":{color:"#9ecbff"},"string.regexp":{color:"#9ecbff"},"string.special":{color:"#9ecbff"},"string.special.symbol":{color:"#9ecbff"},tag:{color:"#85e89d"},"text.literal":{color:"#9ecbff"},title:{color:"#b392f0"},type:{color:"#b392f0"},"type.builtin":{color:"#b392f0"},"type.class.definition":{color:"#b392f0"},variable:{color:"#e1e4e8"},"variable.member":{color:"#ffab70"},attribute:{color:"#B392F0"},embedded:{color:"#e1e4e8"},namespace:{color:"#B392F0"},predictive:{color:"#6a737d"},preproc:{color:"#f97583"},primary:{color:"#e1e4e8"},punctuation:{color:"#e1e4e8"},selector:{color:"#85E89D"},hint:{color:"#848d97"},variant:{color:"#79B8FF"},"diff.minus":{color:"#FDAEB7"},"diff.plus":{color:"#85E89D"},"punctuation.list_marker":{color:"#FFAB70"},"selector.class":{color:"#B392F0"},"selector.id":{color:"#B392F0"},"selector.pseudo":{color:"#B392F0"}}}},KB=Object.freeze(Object.defineProperty({__proto__:null,default:XB},Symbol.toStringTag,{value:"Module"})),VB={name:"GitHub Dark Default",appearance:"dark",style:{background:"#0d1117",text:"#e6edf3","editor.background":"#0d1117","editor.foreground":"#e6edf3","editor.active_line.background":"#6e76811a",players:[],warning:"#fbe557",hint:"#7d8590",created:"#3fb950",deleted:"#f85149",modified:"#d29922","terminal.ansi.black":"#484f58","terminal.ansi.red":"#ff7b72","terminal.ansi.green":"#3fb950","terminal.ansi.yellow":"#d29922","terminal.ansi.blue":"#58a6ff","terminal.ansi.magenta":"#bc8cff","terminal.ansi.cyan":"#39c5cf","terminal.ansi.white":"#b1bac4","terminal.ansi.bright_black":"#6e7681","terminal.ansi.bright_red":"#ffa198","terminal.ansi.bright_green":"#56d364","terminal.ansi.bright_yellow":"#e3b341","terminal.ansi.bright_blue":"#79c0ff","terminal.ansi.bright_magenta":"#d2a8ff","terminal.ansi.bright_cyan":"#56d4dd","terminal.ansi.bright_white":"#ffffff",syntax:{boolean:{color:"#79c0ff"},comment:{color:"#8b949e"},"comment.doc":{color:"#8b949e"},constant:{color:"#79c0ff"},constructor:{color:"#7ee787"},emphasis:{color:"#e6edf3",font_style:"italic"},"emphasis.strong":{color:"#e6edf3",font_weight:700},function:{color:"#d2a8ff"},keyword:{color:"#ff7b72"},label:{color:"#ffa657"},link_text:{color:"#a5d6ff"},link_uri:{color:"#a5d6ff"},number:{color:"#79c0ff"},string:{color:"#a5d6ff"},"string.escape":{color:"#ff7b72"},"string.regex":{color:"#a5d6ff"},"string.special":{color:"#a5d6ff"},"string.special.symbol":{color:"#a5d6ff"},tag:{color:"#7ee787"},"text.literal":{color:"#a5d6ff"},title:{color:"#ffa657"},variable:{color:"#e6edf3"},type:{color:"#79c0ff"},"variable.special":{color:"#79c0ff"},attribute:{color:"#79C0FF"},embedded:{color:"#e6edf3"},namespace:{color:"#FFA657"},operator:{color:"#FF7B72"},predictive:{color:"#8b949e"},preproc:{color:"#ff7b72"},primary:{color:"#e6edf3"},property:{color:"#e6edf3"},punctuation:{color:"#e6edf3"},selector:{color:"#7EE787"},enum:{color:"#FFA657"},hint:{color:"#7d8590"},variant:{color:"#79C0FF"},"diff.minus":{color:"#FFA198"},"diff.plus":{color:"#7EE787"},"property.json_key":{color:"#7EE787"},"punctuation.list_marker":{color:"#FFA657"},"punctuation.special":{color:"#FF7B72"},"selector.class":{color:"#79C0FF"},"selector.id":{color:"#79C0FF"},"selector.pseudo":{color:"#79C0FF"},"punctuation.delimiter.jsx":{color:"#FF7B72"},"variable.parameter":{color:"#FFA657"}}}},qB=Object.freeze(Object.defineProperty({__proto__:null,default:VB},Symbol.toStringTag,{value:"Module"})),vB={name:"GitHub Dark Dimmed",appearance:"dark",style:{background:"#212830ff",text:"#d1d7e0ff","editor.background":"#212830ff","editor.foreground":"#d1d7e0ff","editor.active_line.background":"#262c36ff","search.match_background":"#eac55f4d",players:[{cursor:"#0576ffff",background:"#0576ffff",selection:"#0576ff66"},{cursor:"#2f6f37ff",background:"#2f6f37ff",selection:"#2f6f3766"},{cursor:"#895906ff",background:"#895906ff",selection:"#89590666"},{cursor:"#eb3342ff",background:"#eb3342ff",selection:"#eb334266"},{cursor:"#d34591ff",background:"#d34591ff",selection:"#d3459166"},{cursor:"#975bf1ff",background:"#975bf1ff",selection:"#975bf166"}],error:"#e5534bff",warning:"#c69026ff",info:"#c69026ff",hint:"#9198a1ff",created:"#57ab5a",deleted:"#e5534b",modified:"#c69026","terminal.ansi.black":"#2f3742ff","terminal.ansi.red":"#f47067ff","terminal.ansi.green":"#57ab5aff","terminal.ansi.yellow":"#c69026ff","terminal.ansi.blue":"#539bf5ff","terminal.ansi.magenta":"#b083f0ff","terminal.ansi.cyan":"#39c5cfff","terminal.ansi.white":"#f0f6fcff","terminal.ansi.bright_black":"#656c76ff","terminal.ansi.bright_red":"#ff938aff","terminal.ansi.bright_green":"#6bc46dff","terminal.ansi.bright_yellow":"#daaa3fff","terminal.ansi.bright_blue":"#6cb6ffff","terminal.ansi.bright_magenta":"#dcbdfbff","terminal.ansi.bright_cyan":"#56d4ddff","terminal.ansi.bright_white":"#cdd9e5ff",syntax:{attribute:{color:"#6cb6ffff"},boolean:{color:"#6cb6ffff"},comment:{color:"#9198a1ff"},"comment.doc":{color:"#9198a1ff"},constant:{color:"#6cb6ffff"},constructor:{color:"#f47067ff"},embedded:{color:"#f47067ff"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},enum:{color:"#f69d50ff"},function:{color:"#dcbdfbff"},"function.method":{color:"#dcbdfbff"},"function.special.definition":{color:"#dcbdfbff"},hint:{color:"#9198a1ff",font_weight:700},keyword:{color:"#f47067ff"},"keyword.operator":{color:"#f47067ff"},label:{color:"#6cb6ffff"},link_text:{color:"#96d0ffff",font_style:"italic"},link_uri:{color:"#6cb6ffff"},number:{color:"#6cb6ffff"},operator:{color:"#f47067ff"},predictive:{color:"#9198a1ff",font_style:"italic"},preproc:{color:"#f47067ff"},primary:{color:"#d1d7e0ff"},property:{color:"#d1d7e0ff"},"property.json_key":{color:"#8ddb8cff"},punctuation:{color:"#f47067ff"},"punctuation.bracket":{color:"#d1d7e0ff"},"punctuation.delimiter":{color:"#d1d7e0ff"},"punctuation.delimiter.jsx":{color:"#f47067ff"},"punctuation.list_marker":{color:"#f69d50ff"},"punctuation.special":{color:"#f47067ff"},string:{color:"#96d0ffff"},"string.escape":{color:"#f47067ff"},"string.regex":{color:"#96d0ffff"},"string.special":{color:"#6cb6ffff"},"string.special.symbol":{color:"#6cb6ffff"},tag:{color:"#8ddb8cff"},"text.literal":{color:"#6cb6ffff"},title:{color:"#6cb6ffff",font_weight:700},type:{color:"#f69d50ff"},"type.builtin":{color:"#6cb6ffff"},variable:{color:"#d1d7e0ff"},"variable.builtin":{color:"#6cb6ffff"},"variable.parameter":{color:"#f69d50ff"},"variable.special":{color:"#6cb6ffff"},variant:{color:"#f69d50ff"},namespace:{color:"#F69D50"},selector:{color:"#8DDB8C"},"diff.minus":{color:"#FF938A"},"diff.plus":{color:"#8DDB8C"},"selector.class":{color:"#6CB6FF"},"selector.id":{color:"#6CB6FF"},"selector.pseudo":{color:"#6CB6FF"}}}},OB=Object.freeze(Object.defineProperty({__proto__:null,default:vB},Symbol.toStringTag,{value:"Module"})),zB={name:"GitHub Dark High Contrast",appearance:"dark",style:{background:"#010409ff",text:"#ffffffff","editor.background":"#010409ff","editor.foreground":"#ffffffff","editor.active_line.background":"#151b23ff","search.match_background":"#fbd6694d",players:[{cursor:"#0576ffff",background:"#0576ffff",selection:"#0576ff66"},{cursor:"#2f6f37ff",background:"#2f6f37ff",selection:"#2f6f3766"},{cursor:"#895906ff",background:"#895906ff",selection:"#89590666"},{cursor:"#eb3342ff",background:"#eb3342ff",selection:"#eb334266"},{cursor:"#d34591ff",background:"#d34591ff",selection:"#d3459166"},{cursor:"#975bf1ff",background:"#975bf1ff",selection:"#975bf166"}],error:"#ff9492ff",warning:"#f0b72fff",info:"#f0b72fff",hint:"#b7bdc8ff",created:"#26cd4d",deleted:"#ff6a69",modified:"#f0b72f","terminal.ansi.black":"#2f3742ff","terminal.ansi.red":"#ff9492ff","terminal.ansi.green":"#28d751ff","terminal.ansi.yellow":"#f0b72fff","terminal.ansi.blue":"#71b7ffff","terminal.ansi.magenta":"#cb9effff","terminal.ansi.cyan":"#39c5cfff","terminal.ansi.white":"#f0f6fcff","terminal.ansi.bright_black":"#656c76ff","terminal.ansi.bright_red":"#ffb1afff","terminal.ansi.bright_green":"#4ae168ff","terminal.ansi.bright_yellow":"#f7c843ff","terminal.ansi.bright_blue":"#91cbffff","terminal.ansi.bright_magenta":"#dbb7ffff","terminal.ansi.bright_cyan":"#56d4ddff","terminal.ansi.bright_white":"#ffffffff",syntax:{attribute:{color:"#91cbffff"},boolean:{color:"#91cbffff"},comment:{color:"#9198a1ff"},"comment.doc":{color:"#9198a1ff"},constant:{color:"#91cbffff"},constructor:{color:"#ff9492ff"},embedded:{color:"#ff9492ff"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},enum:{color:"#ffb757ff"},function:{color:"#dbb7ffff"},"function.method":{color:"#dbb7ffff"},"function.special.definition":{color:"#dbb7ffff"},hint:{color:"#b7bdc8ff",font_weight:700},keyword:{color:"#ff9492ff"},"keyword.operator":{color:"#ff9492ff"},label:{color:"#91cbffff"},link_text:{color:"#addcffff",font_style:"italic"},link_uri:{color:"#91cbffff"},number:{color:"#91cbffff"},operator:{color:"#ff9492ff"},predictive:{color:"#b7bdc8ff",font_style:"italic"},preproc:{color:"#ff9492ff"},primary:{color:"#ffffffff"},property:{color:"#ffffffff"},"property.json_key":{color:"#72f088ff"},punctuation:{color:"#ff9492ff"},"punctuation.bracket":{color:"#ffffffff"},"punctuation.delimiter":{color:"#ffffffff"},"punctuation.delimiter.jsx":{color:"#ff9492ff"},"punctuation.list_marker":{color:"#ffb757ff"},"punctuation.special":{color:"#ff9492ff"},string:{color:"#addcffff"},"string.escape":{color:"#ff9492ff"},"string.regex":{color:"#addcffff"},"string.special":{color:"#91cbffff"},"string.special.symbol":{color:"#91cbffff"},tag:{color:"#72f088ff"},"text.literal":{color:"#91cbffff"},title:{color:"#91cbffff",font_weight:700},type:{color:"#ffb757ff"},"type.builtin":{color:"#91cbffff"},variable:{color:"#ffffffff"},"variable.builtin":{color:"#91cbffff"},"variable.parameter":{color:"#ffb757ff"},"variable.special":{color:"#91cbffff"},variant:{color:"#ffb757ff"},namespace:{color:"#FFB757"},selector:{color:"#72F088"},"diff.minus":{color:"#FFB1AF"},"diff.plus":{color:"#72F088"},"selector.class":{color:"#91CBFF"},"selector.id":{color:"#91CBFF"},"selector.pseudo":{color:"#91CBFF"}}}},$B=Object.freeze(Object.defineProperty({__proto__:null,default:zB},Symbol.toStringTag,{value:"Module"})),AQ={name:"GitHub Light",appearance:"light",style:{background:"#ffffff",text:"#444d56","editor.background":"#ffffff","editor.foreground":"#24292e","editor.active_line.background":"#f6f8fa","editor.document_highlight.bracket_background":"#34d05840","search.match_background":"#ffdf5d",players:[{cursor:"#005cc5",selection:"#79b8ff33",background:"#005cc5"},{cursor:"#586069",selection:"#e1e4e833",background:"#586069"},{cursor:"#22863a",selection:"#bef5cb33",background:"#22863a"},{cursor:"#e36209",selection:"#ffd1ac33",background:"#e36209"},{cursor:"#d03592",selection:"#f9b3dd33",background:"#d03592"},{cursor:"#5a32a3",selection:"#d1bcf933",background:"#5a32a3"},{cursor:"#cb2431",selection:"#fdaeb733",background:"#cb2431"},{cursor:"#f9c513",selection:"#fff5b133",background:"#f9c513"}],error:"#cb2431",warning:"#f9c513",info:"#005cc5",hint:"#848d97",created:"#28a745",deleted:"#d73a49",modified:"#005cc5","terminal.ansi.black":"#24292e","terminal.ansi.red":"#d73a49","terminal.ansi.green":"#28a745","terminal.ansi.yellow":"#dbab09","terminal.ansi.blue":"#0366d6","terminal.ansi.magenta":"#5a32a3","terminal.ansi.cyan":"#1b7c83","terminal.ansi.white":"#6a737d","terminal.ansi.bright_black":"#959da5","terminal.ansi.bright_red":"#cb2431","terminal.ansi.bright_green":"#22863a","terminal.ansi.bright_yellow":"#b08800","terminal.ansi.bright_blue":"#005cc5","terminal.ansi.bright_magenta":"#5a32a3","terminal.ansi.bright_cyan":"#3192aa","terminal.ansi.bright_white":"#d1d5da",syntax:{boolean:{color:"#005cc5"},comment:{color:"#6a737d"},"comment.doc":{color:"#6a737d"},"comment.documentation":{color:"#6a737d"},constant:{color:"#005cc5"},"constant.builtin":{color:"#005cc5"},constructor:{color:"#22863a"},emphasis:{color:"#24292e",font_style:"italic"},"emphasis.strong":{color:"#24292e",font_weight:700},enum:{color:"#005cc5"},function:{color:"#6f42c1"},"function.builtin":{color:"#6f42c1"},"function.method":{color:"#6f42c1"},"function.method.call":{color:"#6f42c1"},keyword:{color:"#d73a49"},"keyword.operator":{color:"#d73a49"},label:{color:"#6f42c1"},link_text:{color:"#032f62"},link_uri:{color:"#032f62"},number:{color:"#005cc5"},operator:{color:"#d73a49"},property:{color:"#005cc5"},"punctuation.bracket":{color:"#005cc5"},"punctuation.delimiter":{color:"#d73a49"},string:{color:"#032f62"},"string.escape":{color:"#032f62"},"string.regex":{color:"#032f62"},"string.regexp":{color:"#032f62"},"string.special":{color:"#032f62"},"string.special.symbol":{color:"#032f62"},tag:{color:"#22863a"},"text.literal":{color:"#032f62"},title:{color:"#6f42c1"},type:{color:"#6f42c1"},"type.builtin":{color:"#6f42c1"},"type.class.definition":{color:"#6f42c1"},variable:{color:"#24292e"},"variable.member":{color:"#e36209"},attribute:{color:"#6F42C1"},embedded:{color:"#24292e"},namespace:{color:"#6F42C1"},predictive:{color:"#6a737d"},preproc:{color:"#d73a49"},primary:{color:"#24292e"},punctuation:{color:"#24292e"},selector:{color:"#22863A"},hint:{color:"#848d97"},variant:{color:"#005CC5"},"diff.minus":{color:"#B31D28"},"diff.plus":{color:"#22863A"},"punctuation.list_marker":{color:"#E36209"},"selector.class":{color:"#6F42C1"},"selector.id":{color:"#6F42C1"},"selector.pseudo":{color:"#6F42C1"}}}},BQ=Object.freeze(Object.defineProperty({__proto__:null,default:AQ},Symbol.toStringTag,{value:"Module"})),QQ={name:"GitHub Light Default",appearance:"light",style:{background:"#ffffffff",text:"#1f2328ff","editor.background":"#ffffffff","editor.foreground":"#1f2328ff","editor.active_line.background":"#f6f8faff","search.match_background":"#fae17d4d",players:[{cursor:"#006edbff",background:"#006edbff",selection:"#006edb66"},{cursor:"#30a147ff",background:"#30a147ff",selection:"#30a14766"},{cursor:"#b88700ff",background:"#b88700ff",selection:"#b8870066"},{cursor:"#df0c24ff",background:"#df0c24ff",selection:"#df0c2466"},{cursor:"#ce2c85ff",background:"#ce2c85ff",selection:"#ce2c8566"},{cursor:"#894cebff",background:"#894cebff",selection:"#894ceb66"}],error:"#d1242fff",warning:"#9a6700ff",info:"#9a6700ff",hint:"#59636eff",created:"#1a7f37",deleted:"#cf222e",modified:"#9a6700","terminal.ansi.black":"#1f2328ff","terminal.ansi.red":"#cf222eff","terminal.ansi.green":"#116329ff","terminal.ansi.yellow":"#4d2d00ff","terminal.ansi.blue":"#0969daff","terminal.ansi.magenta":"#8250dfff","terminal.ansi.cyan":"#1b7c83ff","terminal.ansi.white":"#59636eff","terminal.ansi.bright_black":"#393f46ff","terminal.ansi.bright_red":"#a40e26ff","terminal.ansi.bright_green":"#1a7f37ff","terminal.ansi.bright_yellow":"#633c01ff","terminal.ansi.bright_blue":"#218bffff","terminal.ansi.bright_magenta":"#a475f9ff","terminal.ansi.bright_cyan":"#3192aaff","terminal.ansi.bright_white":"#818b98ff",syntax:{attribute:{color:"#0550aeff"},boolean:{color:"#0550aeff"},comment:{color:"#59636eff"},"comment.doc":{color:"#59636eff"},constant:{color:"#0550aeff"},constructor:{color:"#cf222eff"},embedded:{color:"#cf222eff"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},enum:{color:"#953800ff"},function:{color:"#8250dfff"},"function.method":{color:"#8250dfff"},"function.special.definition":{color:"#8250dfff"},hint:{color:"#59636eff",font_weight:700},keyword:{color:"#cf222eff"},"keyword.operator":{color:"#cf222eff"},label:{color:"#0550aeff"},link_text:{color:"#0a3069ff",font_style:"italic"},link_uri:{color:"#0550aeff"},number:{color:"#0550aeff"},operator:{color:"#cf222eff"},predictive:{color:"#59636eff",font_style:"italic"},preproc:{color:"#cf222eff"},primary:{color:"#1f2328ff"},property:{color:"#1f2328ff"},"property.json_key":{color:"#116329ff"},punctuation:{color:"#cf222eff"},"punctuation.bracket":{color:"#1f2328ff"},"punctuation.delimiter":{color:"#1f2328ff"},"punctuation.delimiter.jsx":{color:"#cf222eff"},"punctuation.list_marker":{color:"#953800ff"},"punctuation.special":{color:"#cf222eff"},string:{color:"#0a3069ff"},"string.escape":{color:"#cf222eff"},"string.regex":{color:"#0a3069ff"},"string.special":{color:"#0550aeff"},"string.special.symbol":{color:"#0550aeff"},tag:{color:"#116329ff"},"text.literal":{color:"#0550aeff"},title:{color:"#0550aeff",font_weight:700},type:{color:"#953800ff"},"type.builtin":{color:"#0550aeff"},variable:{color:"#1f2328ff"},"variable.builtin":{color:"#0550aeff"},"variable.parameter":{color:"#953800ff"},"variable.special":{color:"#0550aeff"},variant:{color:"#953800ff"},namespace:{color:"#953800"},selector:{color:"#116329"},"diff.minus":{color:"#82071E"},"diff.plus":{color:"#116329"},"selector.class":{color:"#0550AE"},"selector.id":{color:"#0550AE"},"selector.pseudo":{color:"#0550AE"}}}},EQ=Object.freeze(Object.defineProperty({__proto__:null,default:QQ},Symbol.toStringTag,{value:"Module"})),IQ={name:"GitHub Light High Contrast",appearance:"light",style:{background:"#ffffffff",text:"#010409ff","editor.background":"#ffffffff","editor.foreground":"#010409ff","editor.active_line.background":"#e6eaefff","search.match_background":"#f0ce534d",players:[{cursor:"#006edbff",background:"#006edbff",selection:"#006edb66"},{cursor:"#30a147ff",background:"#30a147ff",selection:"#30a14766"},{cursor:"#b88700ff",background:"#b88700ff",selection:"#b8870066"},{cursor:"#df0c24ff",background:"#df0c24ff",selection:"#df0c2466"},{cursor:"#ce2c85ff",background:"#ce2c85ff",selection:"#ce2c8566"},{cursor:"#894cebff",background:"#894cebff",selection:"#894ceb66"}],error:"#86061dff",warning:"#603700ff",info:"#603700ff",hint:"#454c54ff",created:"#055d20",deleted:"#a0111f",modified:"#744500","terminal.ansi.black":"#010409ff","terminal.ansi.red":"#a0111fff","terminal.ansi.green":"#024c1aff","terminal.ansi.yellow":"#3f2200ff","terminal.ansi.blue":"#0349b4ff","terminal.ansi.magenta":"#622cbcff","terminal.ansi.cyan":"#1b7c83ff","terminal.ansi.white":"#59636eff","terminal.ansi.bright_black":"#393f46ff","terminal.ansi.bright_red":"#86061dff","terminal.ansi.bright_green":"#055d20ff","terminal.ansi.bright_yellow":"#4e2c00ff","terminal.ansi.bright_blue":"#1168e3ff","terminal.ansi.bright_magenta":"#844ae7ff","terminal.ansi.bright_cyan":"#3192aaff","terminal.ansi.bright_white":"#818b98ff",syntax:{attribute:{color:"#023b95ff"},boolean:{color:"#023b95ff"},comment:{color:"#59636eff"},"comment.doc":{color:"#59636eff"},constant:{color:"#023b95ff"},constructor:{color:"#a0111fff"},embedded:{color:"#a0111fff"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},enum:{color:"#702c00ff"},function:{color:"#622cbcff"},"function.method":{color:"#622cbcff"},"function.special.definition":{color:"#622cbcff"},hint:{color:"#454c54ff",font_weight:700},keyword:{color:"#a0111fff"},"keyword.operator":{color:"#a0111fff"},label:{color:"#023b95ff"},link_text:{color:"#032563ff",font_style:"italic"},link_uri:{color:"#023b95ff"},number:{color:"#023b95ff"},operator:{color:"#a0111fff"},predictive:{color:"#454c54ff",font_style:"italic"},preproc:{color:"#a0111fff"},primary:{color:"#010409ff"},property:{color:"#010409ff"},"property.json_key":{color:"#024c1aff"},punctuation:{color:"#a0111fff"},"punctuation.bracket":{color:"#010409ff"},"punctuation.delimiter":{color:"#010409ff"},"punctuation.delimiter.jsx":{color:"#a0111fff"},"punctuation.list_marker":{color:"#702c00ff"},"punctuation.special":{color:"#a0111fff"},string:{color:"#032563ff"},"string.escape":{color:"#a0111fff"},"string.regex":{color:"#032563ff"},"string.special":{color:"#023b95ff"},"string.special.symbol":{color:"#023b95ff"},tag:{color:"#024c1aff"},"text.literal":{color:"#023b95ff"},title:{color:"#023b95ff",font_weight:700},type:{color:"#702c00ff"},"type.builtin":{color:"#023b95ff"},variable:{color:"#010409ff"},"variable.builtin":{color:"#023b95ff"},"variable.parameter":{color:"#702c00ff"},"variable.special":{color:"#023b95ff"},variant:{color:"#702c00ff"},namespace:{color:"#702C00"},selector:{color:"#024C1A"},"diff.minus":{color:"#6E011A"},"diff.plus":{color:"#024C1A"},"selector.class":{color:"#023B95"},"selector.id":{color:"#023B95"},"selector.pseudo":{color:"#023B95"}}}},oQ=Object.freeze(Object.defineProperty({__proto__:null,default:IQ},Symbol.toStringTag,{value:"Module"})),gQ={name:"Gruvbox Dark Hard",appearance:"dark",style:{background:"#4c4642ff",text:"#fbf1c7ff","editor.background":"#1d2021ff","editor.foreground":"#ebdbb2ff","editor.active_line.background":"#393634bf","search.match_background":"#83a59866",players:[{cursor:"#83a598ff",background:"#83a598ff",selection:"#83a5983d"},{cursor:"#a89984ff",background:"#a89984ff",selection:"#a899843d"},{cursor:"#fd801bff",background:"#fd801bff",selection:"#fd801b3d"},{cursor:"#d3869bff",background:"#d3869bff",selection:"#d3869b3d"},{cursor:"#8ec07cff",background:"#8ec07cff",selection:"#8ec07c3d"},{cursor:"#fb4a35ff",background:"#fb4a35ff",selection:"#fb4a353d"},{cursor:"#f9bd2fff",background:"#f9bd2fff",selection:"#f9bd2f3d"},{cursor:"#b7bb26ff",background:"#b7bb26ff",selection:"#b7bb263d"}],error:"#fb4a35ff",warning:"#f9bd2fff",info:"#83a598ff",hint:"#6a695bff",created:"#ebdbb2",deleted:"#cc241d",modified:"#d79921","terminal.ansi.black":"#282828ff","terminal.ansi.red":"#cc241dff","terminal.ansi.green":"#98971aff","terminal.ansi.yellow":"#d79921ff","terminal.ansi.blue":"#458588ff","terminal.ansi.magenta":"#b16286ff","terminal.ansi.cyan":"#689d6aff","terminal.ansi.white":"#a89984ff","terminal.ansi.bright_black":"#928374ff","terminal.ansi.bright_red":"#fb4934ff","terminal.ansi.bright_green":"#b8bb26ff","terminal.ansi.bright_yellow":"#fabd2fff","terminal.ansi.bright_blue":"#83a598ff","terminal.ansi.bright_magenta":"#d3869bff","terminal.ansi.bright_cyan":"#8ec07cff","terminal.ansi.bright_white":"#fbf1c7ff",syntax:{attribute:{color:"#83a598ff"},boolean:{color:"#d3869bff"},comment:{color:"#a89984ff"},"comment.doc":{color:"#c6b697ff"},constant:{color:"#fabd2eff"},constructor:{color:"#83a598ff"},embedded:{color:"#8ec07cff"},emphasis:{color:"#83a598ff"},"emphasis.strong":{color:"#83a598ff",font_weight:700},enum:{color:"#fe7f18ff"},function:{color:"#b8bb25ff"},"function.builtin":{color:"#fb4833ff"},hint:{color:"#8c957dff"},keyword:{color:"#fb4833ff"},label:{color:"#83a598ff"},link_text:{color:"#8ec07cff",font_style:"italic"},link_uri:{color:"#d3869bff"},namespace:{color:"#83a598ff"},number:{color:"#d3869bff"},operator:{color:"#8ec07cff"},predictive:{color:"#717363ff",font_style:"italic"},preproc:{color:"#fb4833ff"},primary:{color:"#ebdbb2ff"},property:{color:"#ebdbb2ff"},punctuation:{color:"#d5c4a1ff"},"punctuation.bracket":{color:"#a89984ff"},"punctuation.delimiter":{color:"#e5d5adff"},"punctuation.list_marker":{color:"#ebdbb2ff"},"punctuation.markup":{color:"#83a598ff"},"punctuation.special":{color:"#e5d5adff"},selector:{color:"#fabd2eff"},"selector.pseudo":{color:"#83a598ff"},string:{color:"#b8bb25ff"},"string.escape":{color:"#c6b697ff"},"string.regex":{color:"#fe7f18ff"},"string.special":{color:"#d3869bff"},"string.special.symbol":{color:"#8ec07cff"},tag:{color:"#8ec07cff"},"text.literal":{color:"#83a598ff"},title:{color:"#b8bb25ff",font_weight:700},type:{color:"#fabd2eff"},variable:{color:"#ebdbb2ff"},"variable.parameter":{color:"#ebdbb2ff"},"variable.special":{color:"#83a598ff"},variant:{color:"#83a598ff"},"diff.plus":{color:"#b8bb26ff"},"diff.minus":{color:"#fb4934ff"}}}},CQ=Object.freeze(Object.defineProperty({__proto__:null,default:gQ},Symbol.toStringTag,{value:"Module"})),iQ={name:"Gruvbox Dark Medium",appearance:"dark",style:{background:"#4c4642ff",text:"#fbf1c7ff","editor.background":"#282828ff","editor.foreground":"#ebdbb2ff","editor.active_line.background":"#3a3735bf","search.match_background":"#83a59866",players:[{cursor:"#83a598ff",background:"#83a598ff",selection:"#83a5983d"},{cursor:"#a89984ff",background:"#a89984ff",selection:"#a899843d"},{cursor:"#fd801bff",background:"#fd801bff",selection:"#fd801b3d"},{cursor:"#d3869bff",background:"#d3869bff",selection:"#d3869b3d"},{cursor:"#8ec07cff",background:"#8ec07cff",selection:"#8ec07c3d"},{cursor:"#fb4a35ff",background:"#fb4a35ff",selection:"#fb4a353d"},{cursor:"#f9bd2fff",background:"#f9bd2fff",selection:"#f9bd2f3d"},{cursor:"#b7bb26ff",background:"#b7bb26ff",selection:"#b7bb263d"}],error:"#fb4a35ff",warning:"#f9bd2fff",info:"#83a598ff",hint:"#8c957dff",created:"#ebdbb2",deleted:"#cc241d",modified:"#d79921","terminal.ansi.black":"#282828ff","terminal.ansi.red":"#cc241dff","terminal.ansi.green":"#98971aff","terminal.ansi.yellow":"#d79921ff","terminal.ansi.blue":"#458588ff","terminal.ansi.magenta":"#b16286ff","terminal.ansi.cyan":"#689d6aff","terminal.ansi.white":"#a89984ff","terminal.ansi.bright_black":"#928374ff","terminal.ansi.bright_red":"#fb4934ff","terminal.ansi.bright_green":"#b8bb26ff","terminal.ansi.bright_yellow":"#fabd2fff","terminal.ansi.bright_blue":"#83a598ff","terminal.ansi.bright_magenta":"#d3869bff","terminal.ansi.bright_cyan":"#8ec07cff","terminal.ansi.bright_white":"#fbf1c7ff",syntax:{attribute:{color:"#83a598ff"},boolean:{color:"#d3869bff"},comment:{color:"#a89984ff"},"comment.doc":{color:"#c6b697ff"},constant:{color:"#fabd2eff"},constructor:{color:"#83a598ff"},embedded:{color:"#8ec07cff"},emphasis:{color:"#83a598ff"},"emphasis.strong":{color:"#83a598ff",font_weight:700},enum:{color:"#fe7f18ff"},function:{color:"#b8bb25ff"},"function.builtin":{color:"#fb4833ff"},hint:{color:"#8c957dff"},keyword:{color:"#fb4833ff"},label:{color:"#83a598ff"},link_text:{color:"#8ec07cff",font_style:"italic"},link_uri:{color:"#d3869bff"},namespace:{color:"#83a598ff"},number:{color:"#d3869bff"},operator:{color:"#8ec07cff"},predictive:{color:"#717363ff",font_style:"italic"},preproc:{color:"#fb4833ff"},primary:{color:"#ebdbb2ff"},property:{color:"#ebdbb2ff"},punctuation:{color:"#d5c4a1ff"},"punctuation.bracket":{color:"#a89984ff"},"punctuation.delimiter":{color:"#e5d5adff"},"punctuation.list_marker":{color:"#ebdbb2ff"},"punctuation.markup":{color:"#83a598ff"},"punctuation.special":{color:"#e5d5adff"},selector:{color:"#fabd2eff"},"selector.pseudo":{color:"#83a598ff"},string:{color:"#b8bb25ff"},"string.escape":{color:"#c6b697ff"},"string.regex":{color:"#fe7f18ff"},"string.special":{color:"#d3869bff"},"string.special.symbol":{color:"#8ec07cff"},tag:{color:"#8ec07cff"},"text.literal":{color:"#83a598ff"},title:{color:"#b8bb25ff",font_weight:700},type:{color:"#fabd2eff"},variable:{color:"#ebdbb2ff"},"variable.parameter":{color:"#ebdbb2ff"},"variable.special":{color:"#83a598ff"},variant:{color:"#83a598ff"},"diff.plus":{color:"#b8bb26ff"},"diff.minus":{color:"#fb4934ff"}}}},cQ=Object.freeze(Object.defineProperty({__proto__:null,default:iQ},Symbol.toStringTag,{value:"Module"})),eQ={name:"Gruvbox Dark Soft",appearance:"dark",style:{background:"#4c4642ff",text:"#fbf1c7ff","editor.background":"#32302fff","editor.foreground":"#ebdbb2ff","editor.active_line.background":"#3b3735bf","search.match_background":"#83a59866",players:[{cursor:"#83a598ff",background:"#83a598ff",selection:"#83a5983d"},{cursor:"#a89984ff",background:"#a89984ff",selection:"#a899843d"},{cursor:"#fd801bff",background:"#fd801bff",selection:"#fd801b3d"},{cursor:"#d3869bff",background:"#d3869bff",selection:"#d3869b3d"},{cursor:"#8ec07cff",background:"#8ec07cff",selection:"#8ec07c3d"},{cursor:"#fb4a35ff",background:"#fb4a35ff",selection:"#fb4a353d"},{cursor:"#f9bd2fff",background:"#f9bd2fff",selection:"#f9bd2f3d"},{cursor:"#b7bb26ff",background:"#b7bb26ff",selection:"#b7bb263d"}],error:"#fb4a35ff",warning:"#f9bd2fff",info:"#83a598ff",hint:"#8c957dff",created:"#ebdbb2",deleted:"#cc241d",modified:"#d79921","terminal.ansi.black":"#282828ff","terminal.ansi.red":"#cc241dff","terminal.ansi.green":"#98971aff","terminal.ansi.yellow":"#d79921ff","terminal.ansi.blue":"#458588ff","terminal.ansi.magenta":"#b16286ff","terminal.ansi.cyan":"#689d6aff","terminal.ansi.white":"#a89984ff","terminal.ansi.bright_black":"#928374ff","terminal.ansi.bright_red":"#fb4934ff","terminal.ansi.bright_green":"#b8bb26ff","terminal.ansi.bright_yellow":"#fabd2fff","terminal.ansi.bright_blue":"#83a598ff","terminal.ansi.bright_magenta":"#d3869bff","terminal.ansi.bright_cyan":"#8ec07cff","terminal.ansi.bright_white":"#fbf1c7ff",syntax:{attribute:{color:"#83a598ff"},boolean:{color:"#d3869bff"},comment:{color:"#a89984ff"},"comment.doc":{color:"#c6b697ff"},constant:{color:"#fabd2eff"},constructor:{color:"#83a598ff"},embedded:{color:"#8ec07cff"},emphasis:{color:"#83a598ff"},"emphasis.strong":{color:"#83a598ff",font_weight:700},enum:{color:"#fe7f18ff"},function:{color:"#b8bb25ff"},"function.builtin":{color:"#fb4833ff"},hint:{color:"#8c957dff"},keyword:{color:"#fb4833ff"},label:{color:"#83a598ff"},link_text:{color:"#8ec07cff",font_style:"italic"},link_uri:{color:"#d3869bff"},namespace:{color:"#83a598ff"},number:{color:"#d3869bff"},operator:{color:"#8ec07cff"},predictive:{color:"#717363ff",font_style:"italic"},preproc:{color:"#fb4833ff"},primary:{color:"#ebdbb2ff"},property:{color:"#ebdbb2ff"},punctuation:{color:"#d5c4a1ff"},"punctuation.bracket":{color:"#a89984ff"},"punctuation.delimiter":{color:"#e5d5adff"},"punctuation.list_marker":{color:"#ebdbb2ff"},"punctuation.markup":{color:"#83a598ff"},"punctuation.special":{color:"#e5d5adff"},selector:{color:"#fabd2eff"},"selector.pseudo":{color:"#83a598ff"},string:{color:"#b8bb25ff"},"string.escape":{color:"#c6b697ff"},"string.regex":{color:"#fe7f18ff"},"string.special":{color:"#d3869bff"},"string.special.symbol":{color:"#8ec07cff"},tag:{color:"#8ec07cff"},"text.literal":{color:"#83a598ff"},title:{color:"#b8bb25ff",font_weight:700},type:{color:"#fabd2eff"},variable:{color:"#ebdbb2ff"},"variable.parameter":{color:"#ebdbb2ff"},"variable.special":{color:"#83a598ff"},variant:{color:"#83a598ff"},"diff.plus":{color:"#b8bb26ff"},"diff.minus":{color:"#fb4934ff"}}}},rQ=Object.freeze(Object.defineProperty({__proto__:null,default:eQ},Symbol.toStringTag,{value:"Module"})),tQ={name:"Gruvbox Light Hard",appearance:"light",style:{background:"#d9c8a4ff",text:"#282828ff","editor.background":"#f9f5d7ff","editor.foreground":"#282828ff","editor.active_line.background":"#ecddb5bf","search.match_background":"#0b667866",players:[{cursor:"#0b6678ff",background:"#0b6678ff",selection:"#0b66783d"},{cursor:"#7c6f64ff",background:"#7c6f64ff",selection:"#7c6f643d"},{cursor:"#af3a04ff",background:"#af3a04ff",selection:"#af3a043d"},{cursor:"#8f3f70ff",background:"#8f3f70ff",selection:"#8f3f703d"},{cursor:"#437b59ff",background:"#437b59ff",selection:"#437b593d"},{cursor:"#9d0308ff",background:"#9d0308ff",selection:"#9d03083d"},{cursor:"#b57615ff",background:"#b57615ff",selection:"#b576153d"},{cursor:"#797410ff",background:"#797410ff",selection:"#7974103d"}],error:"#9d0308ff",warning:"#b57615ff",info:"#0b6678ff",hint:"#677562ff",created:"#3c3836",deleted:"#cc241d",modified:"#d79921","terminal.ansi.black":"#fbf1c7ff","terminal.ansi.red":"#cc241dff","terminal.ansi.green":"#98971aff","terminal.ansi.yellow":"#d79921ff","terminal.ansi.blue":"#458588ff","terminal.ansi.magenta":"#b16286ff","terminal.ansi.cyan":"#689d6aff","terminal.ansi.white":"#7c6f64ff","terminal.ansi.bright_black":"#928374ff","terminal.ansi.bright_red":"#9d0006ff","terminal.ansi.bright_green":"#79740eff","terminal.ansi.bright_yellow":"#b57614ff","terminal.ansi.bright_blue":"#076678ff","terminal.ansi.bright_magenta":"#8f3f71ff","terminal.ansi.bright_cyan":"#427b58ff","terminal.ansi.bright_white":"#282828ff",syntax:{attribute:{color:"#0b6678ff"},boolean:{color:"#8f3e71ff"},comment:{color:"#7c6f64ff"},"comment.doc":{color:"#5d544eff"},constant:{color:"#b57613ff"},constructor:{color:"#0b6678ff"},embedded:{color:"#427b58ff"},emphasis:{color:"#0b6678ff"},"emphasis.strong":{color:"#0b6678ff",font_weight:700},enum:{color:"#af3a02ff"},function:{color:"#79740eff"},"function.builtin":{color:"#9d0006ff"},hint:{color:"#677562ff"},keyword:{color:"#9d0006ff"},label:{color:"#0b6678ff"},link_text:{color:"#427b58ff",font_style:"italic"},link_uri:{color:"#8f3e71ff"},namespace:{color:"#066578ff"},number:{color:"#8f3e71ff"},operator:{color:"#427b58ff"},predictive:{color:"#7c9780ff",font_style:"italic"},preproc:{color:"#9d0006ff"},primary:{color:"#282828ff"},property:{color:"#282828ff"},punctuation:{color:"#3c3836ff"},"punctuation.bracket":{color:"#665c54ff"},"punctuation.delimiter":{color:"#413d3aff"},"punctuation.list_marker":{color:"#282828ff"},"punctuation.markup":{color:"#066578ff"},"punctuation.special":{color:"#413d3aff"},selector:{color:"#b57613ff"},"selector.pseudo":{color:"#0b6678ff"},string:{color:"#79740eff"},"string.escape":{color:"#5d544eff"},"string.regex":{color:"#af3a02ff"},"string.special":{color:"#8f3e71ff"},"string.special.symbol":{color:"#427b58ff"},tag:{color:"#427b58ff"},"text.literal":{color:"#066578ff"},title:{color:"#79740eff",font_weight:700},type:{color:"#b57613ff"},variable:{color:"#282828ff"},"variable.parameter":{color:"#282828ff"},"variable.special":{color:"#066578ff"},variant:{color:"#0b6678ff"},"diff.plus":{color:"#79740eff"},"diff.minus":{color:"#9d0006ff"}}}},aQ=Object.freeze(Object.defineProperty({__proto__:null,default:tQ},Symbol.toStringTag,{value:"Module"})),lQ={name:"Gruvbox Light Medium",appearance:"light",style:{background:"#d9c8a4ff",text:"#282828ff","editor.background":"#fbf1c7ff","editor.foreground":"#282828ff","editor.active_line.background":"#ecddb4bf","search.match_background":"#0b667866",players:[{cursor:"#0b6678ff",background:"#0b6678ff",selection:"#0b66783d"},{cursor:"#7c6f64ff",background:"#7c6f64ff",selection:"#7c6f643d"},{cursor:"#af3a04ff",background:"#af3a04ff",selection:"#af3a043d"},{cursor:"#8f3f70ff",background:"#8f3f70ff",selection:"#8f3f703d"},{cursor:"#437b59ff",background:"#437b59ff",selection:"#437b593d"},{cursor:"#9d0308ff",background:"#9d0308ff",selection:"#9d03083d"},{cursor:"#b57615ff",background:"#b57615ff",selection:"#b576153d"},{cursor:"#797410ff",background:"#797410ff",selection:"#7974103d"}],error:"#9d0308ff",warning:"#b57615ff",info:"#0b6678ff",hint:"#677562ff",created:"#3c3836",deleted:"#cc241d",modified:"#d79921","terminal.ansi.black":"#fbf1c7ff","terminal.ansi.red":"#cc241dff","terminal.ansi.green":"#98971aff","terminal.ansi.yellow":"#d79921ff","terminal.ansi.blue":"#458588ff","terminal.ansi.magenta":"#b16286ff","terminal.ansi.cyan":"#689d6aff","terminal.ansi.white":"#7c6f64ff","terminal.ansi.bright_black":"#928374ff","terminal.ansi.bright_red":"#9d0006ff","terminal.ansi.bright_green":"#79740eff","terminal.ansi.bright_yellow":"#b57614ff","terminal.ansi.bright_blue":"#076678ff","terminal.ansi.bright_magenta":"#8f3f71ff","terminal.ansi.bright_cyan":"#427b58ff","terminal.ansi.bright_white":"#282828ff",syntax:{attribute:{color:"#0b6678ff"},boolean:{color:"#8f3e71ff"},comment:{color:"#7c6f64ff"},"comment.doc":{color:"#5d544eff"},constant:{color:"#b57613ff"},constructor:{color:"#0b6678ff"},embedded:{color:"#427b58ff"},emphasis:{color:"#0b6678ff"},"emphasis.strong":{color:"#0b6678ff",font_weight:700},enum:{color:"#af3a02ff"},function:{color:"#79740eff"},"function.builtin":{color:"#9d0006ff"},hint:{color:"#677562ff"},keyword:{color:"#9d0006ff"},label:{color:"#0b6678ff"},link_text:{color:"#427b58ff",font_style:"italic"},link_uri:{color:"#8f3e71ff"},namespace:{color:"#066578ff"},number:{color:"#8f3e71ff"},operator:{color:"#427b58ff"},predictive:{color:"#7c9780ff",font_style:"italic"},preproc:{color:"#9d0006ff"},primary:{color:"#282828ff"},property:{color:"#282828ff"},punctuation:{color:"#3c3836ff"},"punctuation.bracket":{color:"#665c54ff"},"punctuation.delimiter":{color:"#413d3aff"},"punctuation.list_marker":{color:"#282828ff"},"punctuation.markup":{color:"#066578ff"},"punctuation.special":{color:"#413d3aff"},selector:{color:"#b57613ff"},"selector.pseudo":{color:"#0b6678ff"},string:{color:"#79740eff"},"string.escape":{color:"#5d544eff"},"string.regex":{color:"#af3a02ff"},"string.special":{color:"#8f3e71ff"},"string.special.symbol":{color:"#427b58ff"},tag:{color:"#427b58ff"},"text.literal":{color:"#066578ff"},title:{color:"#79740eff",font_weight:700},type:{color:"#b57613ff"},variable:{color:"#282828ff"},"variable.parameter":{color:"#282828ff"},"variable.special":{color:"#066578ff"},variant:{color:"#0b6678ff"},"diff.plus":{color:"#79740eff"},"diff.minus":{color:"#9d0006ff"}}}},nQ=Object.freeze(Object.defineProperty({__proto__:null,default:lQ},Symbol.toStringTag,{value:"Module"})),sQ={name:"Gruvbox Light Soft",appearance:"light",style:{background:"#d9c8a4ff",text:"#282828ff","editor.background":"#f2e5bcff","editor.foreground":"#282828ff","editor.active_line.background":"#ecdcb3bf","search.match_background":"#0b667866",players:[{cursor:"#0b6678ff",background:"#0b6678ff",selection:"#0b66783d"},{cursor:"#7c6f64ff",background:"#7c6f64ff",selection:"#7c6f643d"},{cursor:"#af3a04ff",background:"#af3a04ff",selection:"#af3a043d"},{cursor:"#8f3f70ff",background:"#8f3f70ff",selection:"#8f3f703d"},{cursor:"#437b59ff",background:"#437b59ff",selection:"#437b593d"},{cursor:"#9d0308ff",background:"#9d0308ff",selection:"#9d03083d"},{cursor:"#b57615ff",background:"#b57615ff",selection:"#b576153d"},{cursor:"#797410ff",background:"#797410ff",selection:"#7974103d"}],error:"#9d0308ff",warning:"#b57615ff",info:"#0b6678ff",hint:"#677562ff",created:"#3c3836",deleted:"#cc241d",modified:"#d79921","terminal.ansi.black":"#fbf1c7ff","terminal.ansi.red":"#cc241dff","terminal.ansi.green":"#98971aff","terminal.ansi.yellow":"#d79921ff","terminal.ansi.blue":"#458588ff","terminal.ansi.magenta":"#b16286ff","terminal.ansi.cyan":"#689d6aff","terminal.ansi.white":"#7c6f64ff","terminal.ansi.bright_black":"#928374ff","terminal.ansi.bright_red":"#9d0006ff","terminal.ansi.bright_green":"#79740eff","terminal.ansi.bright_yellow":"#b57614ff","terminal.ansi.bright_blue":"#076678ff","terminal.ansi.bright_magenta":"#8f3f71ff","terminal.ansi.bright_cyan":"#427b58ff","terminal.ansi.bright_white":"#282828ff",syntax:{attribute:{color:"#0b6678ff"},boolean:{color:"#8f3e71ff"},comment:{color:"#7c6f64ff"},"comment.doc":{color:"#5d544eff"},constant:{color:"#b57613ff"},constructor:{color:"#0b6678ff"},embedded:{color:"#427b58ff"},emphasis:{color:"#0b6678ff"},"emphasis.strong":{color:"#0b6678ff",font_weight:700},enum:{color:"#af3a02ff"},function:{color:"#79740eff"},"function.builtin":{color:"#9d0006ff"},hint:{color:"#677562ff"},keyword:{color:"#9d0006ff"},label:{color:"#0b6678ff"},link_text:{color:"#427b58ff",font_style:"italic"},link_uri:{color:"#8f3e71ff"},namespace:{color:"#066578ff"},number:{color:"#8f3e71ff"},operator:{color:"#427b58ff"},predictive:{color:"#7c9780ff",font_style:"italic"},preproc:{color:"#9d0006ff"},primary:{color:"#282828ff"},property:{color:"#282828ff"},punctuation:{color:"#3c3836ff"},"punctuation.bracket":{color:"#665c54ff"},"punctuation.delimiter":{color:"#413d3aff"},"punctuation.list_marker":{color:"#282828ff"},"punctuation.markup":{color:"#066578ff"},"punctuation.special":{color:"#413d3aff"},selector:{color:"#b57613ff"},"selector.pseudo":{color:"#0b6678ff"},string:{color:"#79740eff"},"string.escape":{color:"#5d544eff"},"string.regex":{color:"#af3a02ff"},"string.special":{color:"#8f3e71ff"},"string.special.symbol":{color:"#427b58ff"},tag:{color:"#427b58ff"},"text.literal":{color:"#066578ff"},title:{color:"#79740eff",font_weight:700},type:{color:"#b57613ff"},variable:{color:"#282828ff"},"variable.parameter":{color:"#282828ff"},"variable.special":{color:"#066578ff"},variant:{color:"#0b6678ff"},"diff.plus":{color:"#79740eff"},"diff.minus":{color:"#9d0006ff"}}}},fQ=Object.freeze(Object.defineProperty({__proto__:null,default:sQ},Symbol.toStringTag,{value:"Module"})),wQ={name:"Horizon",appearance:"dark",style:{background:"#1C1E26",text:"#D5D8DA","editor.background":"#1C1E26","editor.active_line.background":"#2E303E4D",players:[],error:"#F43E5C",warning:"#27D797B3",hint:"#969696ff",created:"#27D797B3",deleted:"#F43E5C",modified:"#FAB38E","terminal.ansi.black":"#000000f2","terminal.ansi.red":"#E95678","terminal.ansi.green":"#29D398","terminal.ansi.yellow":"#FAB795","terminal.ansi.blue":"#26BBD9","terminal.ansi.magenta":"#EE64AC","terminal.ansi.cyan":"#59E1E3","terminal.ansi.white":"#eeeeecff","terminal.ansi.bright_black":"#000000e6","terminal.ansi.bright_red":"#EC6A88","terminal.ansi.bright_green":"#3FDAA4","terminal.ansi.bright_yellow":"#FBC3A7","terminal.ansi.bright_blue":"#3FC4DE","terminal.ansi.bright_magenta":"#F075B5","terminal.ansi.bright_cyan":"#6BE4E6","terminal.ansi.bright_white":"#b5b3adff",syntax:{attribute:{color:"#F09483E6"},comment:{color:"#BBBBBB4D",font_style:"italic"},"comment.doc":{color:"#BBBBBB4D",font_style:"italic"},constant:{color:"#F09483E6"},constructor:{color:"#E95678E6"},emphasis:{color:"#25B0BCE6",font_style:"italic"},"emphasis.strong":{color:"#B877DBE6",font_weight:700},function:{color:"#25B0BCE6"},keyword:{color:"#B877DBE6"},label:{color:"#FAC29AE6"},link_text:{color:"#FAB795E6"},link_uri:{color:"#FAB795E6"},number:{color:"#F09483E6"},operator:{color:"#BBBBBB"},property:{color:"#E95678E6"},punctuation:{color:"#BBBBBB"},"punctuation.bracket":{color:"#BBBBBB"},"punctuation.delimiter":{color:"#BBBBBB"},"punctuation.list_marker":{color:"#BBBBBB"},"punctuation.special":{color:"#BBBBBB"},tag:{color:"#E95678E6"},title:{color:"#FAC29AE6"},type:{color:"#FAC29AE6"},variable:{color:"#E95678E6"},"variable.special":{color:"#FAC29AE6",font_style:"italic"},boolean:{color:"#F09483E6"},embedded:{color:"#D5D8DA"},namespace:{color:"#FAC29AE6"},predictive:{color:"#BBBBBB4D"},preproc:{color:"#B877DBE6"},primary:{color:"#D5D8DA"},selector:{color:"#E95678E6"},string:{color:"#FAB795E6"},enum:{color:"#FAC29AE6"},hint:{color:"#969696ff"},variant:{color:"#E95678E6"},"diff.minus":{color:"#F43E5C"},"diff.plus":{color:"#27D797B3"},"selector.class":{color:"#F09483E6"},"selector.id":{color:"#25B0BCE6"},"string.escape":{color:"#25B0BCE6"},"string.regex":{color:"#F09483E6"},"text.literal":{color:"#F09483E6"},"selector.pseudo":{color:"#FAB795E6"},"string.special.symbol":{color:"#F09483E6"}}}},dQ=Object.freeze(Object.defineProperty({__proto__:null,default:wQ},Symbol.toStringTag,{value:"Module"})),RQ={name:"Horizon Bright",appearance:"light",style:{background:"#FDF0ED",text:"#06060C","editor.background":"#FDF0ED","editor.active_line.background":"#F9CBBE4D",players:[],error:"#F43E5C",warning:"#1EB980B3",hint:"#969696ff",created:"#1EB980B3",deleted:"#F43E5C",modified:"#AF5427","terminal.ansi.black":"#000000f2","terminal.ansi.red":"#E95678","terminal.ansi.green":"#29D398","terminal.ansi.yellow":"#FAB795","terminal.ansi.blue":"#26BBD9","terminal.ansi.magenta":"#EE64AC","terminal.ansi.cyan":"#59E1E3","terminal.ansi.white":"#21201cff","terminal.ansi.bright_black":"#000000e6","terminal.ansi.bright_red":"#EC6A88","terminal.ansi.bright_green":"#3FDAA4","terminal.ansi.bright_yellow":"#FBC3A7","terminal.ansi.bright_blue":"#3FC4DE","terminal.ansi.bright_magenta":"#F075B5","terminal.ansi.bright_cyan":"#6BE4E6","terminal.ansi.bright_white":"#63635eff",syntax:{attribute:{color:"#DC3318"},comment:{color:"#33333380",font_style:"italic"},"comment.doc":{color:"#33333380",font_style:"italic"},constant:{color:"#DC3318"},constructor:{color:"#DA103F"},emphasis:{color:"#1D8991",font_style:"italic"},"emphasis.strong":{color:"#8A31B9",font_weight:700},function:{color:"#1D8991"},keyword:{color:"#8A31B9"},label:{color:"#F77D26"},link_text:{color:"#F6661E"},link_uri:{color:"#F6661E"},number:{color:"#DC3318"},operator:{color:"#333333"},property:{color:"#DA103F"},punctuation:{color:"#333333"},"punctuation.bracket":{color:"#333333"},"punctuation.delimiter":{color:"#333333"},"punctuation.list_marker":{color:"#333333"},"punctuation.special":{color:"#333333"},tag:{color:"#DA103F"},title:{color:"#F77D26"},type:{color:"#F77D26"},variable:{color:"#DA103F"},"variable.special":{color:"#F77D26",font_style:"italic"},boolean:{color:"#DC3318"},embedded:{color:"#06060C"},namespace:{color:"#F77D26"},predictive:{color:"#33333380"},preproc:{color:"#8A31B9"},primary:{color:"#06060C"},selector:{color:"#DA103F"},string:{color:"#F6661E"},enum:{color:"#F77D26"},hint:{color:"#969696ff"},variant:{color:"#DA103F"},"diff.minus":{color:"#F43E5C"},"diff.plus":{color:"#1EB980B3"},"selector.class":{color:"#DC3318"},"selector.id":{color:"#1D8991"},"string.escape":{color:"#1D8991"},"string.regex":{color:"#DC3318"},"text.literal":{color:"#DC3318"},"selector.pseudo":{color:"#F6661E"},"string.special.symbol":{color:"#DC3318"}}}},FQ=Object.freeze(Object.defineProperty({__proto__:null,default:RQ},Symbol.toStringTag,{value:"Module"})),kQ={name:"Houston",appearance:"dark",style:{background:"#17191e",text:"#cccccc","editor.background":"#17191e","editor.foreground":"#eef0f9","editor.active_line.background":"#23262d","editor.document_highlight.bracket_background":"#545864","search.match_background":"#ea5c0054",players:[{cursor:"#ffffff",background:"#ffffff",selection:"#ad5dca44"},{cursor:"#4bf3c8",background:"#4bf3c8",selection:"#4bf3c840"},{cursor:"#54b9ff",background:"#54b9ff",selection:"#54b9ff40"},{cursor:"#acafff",background:"#acafff",selection:"#acafff40"},{cursor:"#ffd493",background:"#ffd493",selection:"#ffd49340"},{cursor:"#00daef",background:"#00daef",selection:"#00daef40"},{cursor:"#ad5dca",background:"#ad5dca",selection:"#ad5dca40"},{cursor:"#f06788",background:"#f06788",selection:"#f0678840"}],error:"#f4587e",warning:"#fbc23b",info:"#54b9ff",hint:"#00daef",created:"#4bf3c8",deleted:"#f4587e",modified:"#ffd493","terminal.ansi.black":"#17191e","terminal.ansi.red":"#dc3657","terminal.ansi.green":"#23d18b","terminal.ansi.yellow":"#ffc368","terminal.ansi.blue":"#2b7eca","terminal.ansi.magenta":"#ad5dca","terminal.ansi.cyan":"#24c0cf","terminal.ansi.white":"#eef0f9","terminal.ansi.bright_black":"#545864","terminal.ansi.bright_red":"#f4587e","terminal.ansi.bright_green":"#4bf3c8","terminal.ansi.bright_yellow":"#ffd493","terminal.ansi.bright_blue":"#54b9ff","terminal.ansi.bright_magenta":"#cc75f4","terminal.ansi.bright_cyan":"#00daef","terminal.ansi.bright_white":"#fafafa",syntax:{comment:{color:"#eef0f98f",font_style:"italic"},"comment.doc":{color:"#eef0f98f",font_style:"italic"},"comment.documentation":{color:"#eef0f98f",font_style:"italic"},"comment.note":{color:"#00daef"},"comment.warning":{color:"#fbc23b"},"comment.error":{color:"#f4587e"},punctuation:{color:"#eef0f9"},"punctuation.bracket":{color:"#eef0f9"},"punctuation.delimiter":{color:"#eef0f9"},"punctuation.list_marker":{color:"#4bf3c8"},"punctuation.special":{color:"#54b9ff"},keyword:{color:"#54b9ff"},"keyword.conditional":{color:"#54b9ff"},"keyword.conditional.ternary":{color:"#54b9ff"},"keyword.return":{color:"#54b9ff"},"keyword.repeat":{color:"#54b9ff"},"keyword.exception":{color:"#54b9ff"},"keyword.import":{color:"#00daef"},"keyword.export":{color:"#00daef"},"keyword.type":{color:"#acafff"},"keyword.function":{color:"#54b9ff"},"keyword.modifier":{color:"#54b9ff"},"keyword.operator":{color:"#54b9ff"},"keyword.directive":{color:"#acafff"},"keyword.directive.define":{color:"#acafff"},"keyword.coroutine":{color:"#54b9ff"},"keyword.debug":{color:"#fbc23b"},string:{color:"#ffd493"},"string.escape":{color:"#eef0f9"},"string.regex":{color:"#eef0f9"},"string.regexp":{color:"#eef0f9"},"string.special":{color:"#acafff"},"string.special.symbol":{color:"#acafff"},"string.special.path":{color:"#00daef"},"string.special.url":{color:"#00daef",font_style:"italic"},"string.doc":{color:"#ffd493"},"string.documentation":{color:"#ffd493"},boolean:{color:"#ffd493"},character:{color:"#ffd493"},"character.special":{color:"#eef0f9"},variable:{color:"#4bf3c8"},"variable.builtin":{color:"#acafff"},"variable.parameter":{color:"#eef0f9"},"variable.member":{color:"#4bf3c8"},"variable.special":{color:"#acafff"},constant:{color:"#ffd493"},"constant.builtin":{color:"#ffd493"},number:{color:"#ffd493"},"number.float":{color:"#ffd493"},type:{color:"#acafff"},"type.builtin":{color:"#acafff"},"type.definition":{color:"#acafff"},"type.interface":{color:"#acafff"},"type.class.definition":{color:"#acafff"},"type.super":{color:"#acafff"},enum:{color:"#acafff"},variant:{color:"#eef0f9"},function:{color:"#00daef"},"function.builtin":{color:"#00daef"},"function.call":{color:"#00daef"},"function.method":{color:"#00daef"},"function.method.call":{color:"#00daef"},"function.macro":{color:"#00daef"},"function.decorator":{color:"#acafff"},constructor:{color:"#00daef"},namespace:{color:"#acafff"},module:{color:"#acafff"},operator:{color:"#eef0f9"},parameter:{color:"#eef0f9"},field:{color:"#eef0f9"},label:{color:"#fbc23b"},title:{color:"#4bf3c8",font_weight:700},emphasis:{color:"#54b9ff",font_style:"italic"},"emphasis.strong":{color:"#ffd493",font_weight:700},"text.literal":{color:"#ffd493"},link_text:{color:"#00daef",font_style:"italic"},link_uri:{color:"#00daef",font_style:"italic"},tag:{color:"#54b9ff"},attribute:{color:"#4bf3c8"},"tag.attribute":{color:"#acafff"},"tag.delimiter":{color:"#eef0f9"},"tag.doctype":{color:"#858b98"},"diff.plus":{color:"#4bf3c8"},"diff.minus":{color:"#f06788"},preproc:{color:"#acafff"},predoc:{color:"#acafff"},embedded:{color:"#eef0f9"},primary:{color:"#eef0f9"},parent:{color:"#eef0f9"},concept:{color:"#acafff"},symbol:{color:"#acafff"},predictive:{color:"#eef0f98f"},property:{color:"#4BF3C8"},selector:{color:"#54B9FF"},hint:{color:"#00daef"},"selector.class":{color:"#4BF3C8"},"selector.id":{color:"#00DAEF"},"selector.pseudo":{color:"#EEF0F9"}}}},yQ=Object.freeze(Object.defineProperty({__proto__:null,default:kQ},Symbol.toStringTag,{value:"Module"})),bQ={name:"Kanagawa Dragon",appearance:"dark",style:{background:"#181616",text:"#c5c9c5","editor.background":"#181616","editor.foreground":"#c5c9c5","editor.active_line.background":"#c5c9c50d","search.match_background":"#8ea4a233",players:[{cursor:"#c5c9c5",selection:"#625e5a80",background:"#c5c9c5"},{cursor:"#8ba4b0",selection:"#8ba4b033",background:"#8ba4b0"},{cursor:"#8992a7",selection:"#8992a733",background:"#8992a7"},{cursor:"#7fb4ca",selection:"#7fb4ca33",background:"#7fb4ca"},{cursor:"#a292a3",selection:"#a292a333",background:"#a292a3"},{cursor:"#a6a69c",selection:"#a6a69c33",background:"#a6a69c"},{cursor:"#8ea4a2",selection:"#8ea4a233",background:"#8ea4a2"},{cursor:"#8a9a7b",selection:"#8a9a7b33",background:"#8a9a7b"}],error:"#e82424",warning:"#ff9e3b",info:"#8ba4b0",hint:"#8ea4a2","terminal.ansi.black":"#0d0c0c","terminal.ansi.red":"#c4746e","terminal.ansi.green":"#8a9a7b","terminal.ansi.yellow":"#c4b28a","terminal.ansi.blue":"#8ba4b0","terminal.ansi.magenta":"#a292a3","terminal.ansi.cyan":"#8ea4a2","terminal.ansi.white":"#c5c9c5","terminal.ansi.bright_black":"#a6a69c","terminal.ansi.bright_red":"#e46876","terminal.ansi.bright_green":"#87a987","terminal.ansi.bright_yellow":"#e6c384","terminal.ansi.bright_blue":"#7fb4ca","terminal.ansi.bright_magenta":"#938aa9","terminal.ansi.bright_cyan":"#7aa89f","terminal.ansi.bright_white":"#c5c9c5",syntax:{attribute:{color:"#c4b28a"},boolean:{color:"#ff9e3b"},comment:{color:"#7a8382",font_style:"italic"},"comment.doc":{color:"#7a8382",font_style:"italic"},constant:{color:"#b98d7b"},constructor:{color:"#8ba4b0"},embedded:{color:"#e82424"},emphasis:{color:"#e82424",font_style:"italic"},"emphasis.strong":{color:"#e82424",font_weight:700},enum:{color:"#8ea4a2",font_weight:700},function:{color:"#8ba4b0",font_style:"italic"},hint:{color:"#8ea4a2",font_style:"italic"},keyword:{color:"#E46876"},link_text:{color:"#8ba4b0"},link_uri:{color:"#8ba4b0"},number:{color:"#a292a3"},operator:{color:"#b6927b"},predictive:{color:"#625e5a"},predoc:{color:"#e82424"},primary:{color:"#e46876"},property:{color:"#E7BD6E"},punctuation:{color:"#8ea4a2"},"punctuation.bracket":{color:"#8ea4a2"},"punctuation.delimiter":{color:"#625e5a"},"punctuation.list_marker":{color:"#8ea4a2"},"punctuation.special":{color:"#8ea4a2"},"punctuation.special.symbol":{color:"#e82424"},string:{color:"#8A9A7B"},"string.escape":{color:"#e46876"},"string.regex":{color:"#e46876"},"string.special":{color:"#e46876"},"string.special.symbol":{color:"#ff5d62"},tag:{color:"#8ba4b0"},"text.literal":{color:"#87a987"},title:{color:"#c5c9c5",font_weight:800},type:{color:"#8ea4a2"},"type.interface":{color:"#8ea4a2"},"type.super":{color:"#8ea4a2"},variable:{color:"#c5c9c5"},"variable.member":{color:"#c5c9c5"},"variable.parameter":{color:"#9e9b93",font_style:"italic"},"variable.special":{color:"#a292a3",font_style:"italic"},variant:{color:"#e82424"},label:{color:"#8EA4A2"},namespace:{color:"#C4B28A"},preproc:{color:"#E46876"},selector:{color:"#C4B28A"},"diff.minus":{color:"#C34043"},"diff.plus":{color:"#76946A"},"selector.id":{color:"#8992A7"},"selector.pseudo":{color:"#8992A7"}}}},MQ=Object.freeze(Object.defineProperty({__proto__:null,default:bQ},Symbol.toStringTag,{value:"Module"})),GQ={name:"Kanagawa Lotus",appearance:"light",style:{background:"#f2ecbc",text:"#545464","editor.background":"#f2ecbc","editor.foreground":"#545464","editor.active_line.background":"#5454640d","search.match_background":"#597b7533",players:[{cursor:"#545464",selection:"#8a898080",background:"#545464"},{cursor:"#5d57a3",selection:"#5d57a333",background:"#5d57a3"},{cursor:"#766b90",selection:"#766b9033",background:"#766b90"},{cursor:"#9fb5c9",selection:"#9fb5c933",background:"#9fb5c9"},{cursor:"#766b90",selection:"#766b9033",background:"#766b90"},{cursor:"#8a8980",selection:"#8a898033",background:"#8a8980"},{cursor:"#597b75",selection:"#597b7533",background:"#597b75"},{cursor:"#6e915f",selection:"#6e915f33",background:"#6e915f"}],error:"#e82424",warning:"#cc6d00",info:"#5a7785",hint:"#5e857a","terminal.ansi.black":"#43436c","terminal.ansi.red":"#c84053","terminal.ansi.green":"#6e915f","terminal.ansi.yellow":"#de9800","terminal.ansi.blue":"#4d699b","terminal.ansi.magenta":"#766b90","terminal.ansi.cyan":"#5e857a","terminal.ansi.white":"#dcd5ac","terminal.ansi.bright_black":"#8a8980","terminal.ansi.bright_red":"#d7474b","terminal.ansi.bright_green":"#6f894e","terminal.ansi.bright_yellow":"#f9d791","terminal.ansi.bright_blue":"#9fb5c9","terminal.ansi.bright_magenta":"#a09cac","terminal.ansi.bright_cyan":"#b7d0ae","terminal.ansi.bright_white":"#dcd5ac",syntax:{attribute:{color:"#de9800"},boolean:{color:"#cc6d00"},comment:{color:"#8a8980",font_style:"italic"},"comment.doc":{color:"#8a8980",font_style:"italic"},constant:{color:"#cc6d00"},constructor:{color:"#4d699b"},embedded:{color:"#e82424"},emphasis:{color:"#e82424",font_style:"italic"},"emphasis.strong":{color:"#e82424",font_weight:700},enum:{color:"#5e857a",font_weight:700},function:{color:"#4d699b",font_style:"italic"},hint:{color:"#5e857a",font_style:"italic"},keyword:{color:"#766b90"},link_text:{color:"#4d699b"},link_uri:{color:"#4d699b"},number:{color:"#b35b79"},operator:{color:"#836f4a"},predictive:{color:"#8a8980"},predoc:{color:"#e82424"},primary:{color:"#c84053"},property:{color:"#4d699b"},punctuation:{color:"#5e857a"},"punctuation.bracket":{color:"#5e857a"},"punctuation.delimiter":{color:"#8a8980"},"punctuation.list_marker":{color:"#5e857a"},"punctuation.special":{color:"#5e857a"},"punctuation.special.symbol":{color:"#e82424"},string:{color:"#6f894e"},"string.escape":{color:"#c84053"},"string.regex":{color:"#c84053"},"string.special":{color:"#c84053"},"string.special.symbol":{color:"#d7474b"},tag:{color:"#4d699b"},"text.literal":{color:"#6f894e"},title:{color:"#545464",font_weight:800},type:{color:"#5e857a"},"type.interface":{color:"#5e857a"},"type.super":{color:"#5e857a"},variable:{color:"#545464"},"variable.member":{color:"#545464"},"variable.parameter":{color:"#766b90",font_style:"italic"},"variable.special":{color:"#b35b79",font_style:"italic"},variant:{color:"#e82424"},label:{color:"#597B75"},namespace:{color:"#77713F"},preproc:{color:"#766b90"},selector:{color:"#77713F"},"diff.minus":{color:"#D7474B"},"diff.plus":{color:"#6E915F"},"selector.id":{color:"#624C83"},"selector.pseudo":{color:"#624C83"}}}},hQ=Object.freeze(Object.defineProperty({__proto__:null,default:GQ},Symbol.toStringTag,{value:"Module"})),SQ={name:"Kanagawa Wave",appearance:"dark",style:{background:"#1F1F28",text:"#DCD7BA","editor.background":"#1F1F28","editor.foreground":"#DCD7BA","editor.active_line.background":"#DCD7BA0d","search.match_background":"#6A958933",players:[{cursor:"#DCD7BA",selection:"#4F4F6680",background:"#DCD7BA"},{cursor:"#7E9CD8",selection:"#7E9CD833",background:"#7E9CD8"},{cursor:"#9CABCA",selection:"#9CABCA33",background:"#9CABCA"},{cursor:"#7FB4CA",selection:"#7FB4CA33",background:"#7FB4CA"},{cursor:"#957FB8",selection:"#957FB833",background:"#957FB8"},{cursor:"#727169",selection:"#72716933",background:"#727169"},{cursor:"#6A9589",selection:"#6A958933",background:"#6A9589"},{cursor:"#76946A",selection:"#76946A33",background:"#76946A"}],error:"#E82424",warning:"#FF9E3B",info:"#7E9CD8",hint:"#6A9589","terminal.ansi.black":"#16161D","terminal.ansi.red":"#C34043","terminal.ansi.green":"#76946A","terminal.ansi.yellow":"#DCA561","terminal.ansi.blue":"#7E9CD8","terminal.ansi.magenta":"#957FB8","terminal.ansi.cyan":"#6A9589","terminal.ansi.white":"#DCD7BA","terminal.ansi.bright_black":"#727169","terminal.ansi.bright_red":"#E82424","terminal.ansi.bright_green":"#98BB6C","terminal.ansi.bright_yellow":"#E6C384","terminal.ansi.bright_blue":"#7FB4CA","terminal.ansi.bright_magenta":"#938AA9","terminal.ansi.bright_cyan":"#7AA89F","terminal.ansi.bright_white":"#DCD7BA",syntax:{attribute:{color:"#DCA561"},boolean:{color:"#FF9E3B"},comment:{color:"#727169",font_style:"italic"},"comment.doc":{color:"#727169",font_style:"italic"},constant:{color:"#FFA066"},constructor:{color:"#7E9CD8"},embedded:{color:"#E82424"},emphasis:{color:"#E82424",font_style:"italic"},"emphasis.strong":{color:"#E82424",font_weight:700},enum:{color:"#6A9589",font_weight:700},function:{color:"#7E9CD8",font_style:"italic"},hint:{color:"#6A9589",font_style:"italic"},keyword:{color:"#957FB8"},link_text:{color:"#7E9CD8"},link_uri:{color:"#7E9CD8"},number:{color:"#D27E99"},operator:{color:"#C0A36E"},predictive:{color:"#4F4F66"},predoc:{color:"#E82424"},primary:{color:"#E46876"},property:{color:"#7E9CD8"},punctuation:{color:"#6A9589"},"punctuation.bracket":{color:"#6A9589"},"punctuation.delimiter":{color:"#4F4F66"},"punctuation.list_marker":{color:"#6A9589"},"punctuation.special":{color:"#6A9589"},"punctuation.special.symbol":{color:"#E82424"},string:{color:"#98BB6C"},"string.escape":{color:"#E46876"},"string.regex":{color:"#E46876"},"string.special":{color:"#E46876"},"string.special.symbol":{color:"#FF5D62"},tag:{color:"#7E9CD8"},"text.literal":{color:"#98BB6C"},title:{color:"#DCD7BA",font_weight:800},type:{color:"#6A9589"},"type.interface":{color:"#6A9589"},"type.super":{color:"#6A9589"},variable:{color:"#DCD7BA"},"variable.member":{color:"#DCD7BA"},"variable.parameter":{color:"#b8b4d0",font_style:"italic"},"variable.special":{color:"#957FB8",font_style:"italic"},variant:{color:"#E82424"},label:{color:"#7AA89F"},namespace:{color:"#E6C384"},preproc:{color:"#957FB8"},selector:{color:"#E6C384"},"diff.minus":{color:"#C34043"},"diff.plus":{color:"#76946A"},"selector.id":{color:"#957FB8"},"selector.pseudo":{color:"#957FB8"}}}},DQ=Object.freeze(Object.defineProperty({__proto__:null,default:SQ},Symbol.toStringTag,{value:"Module"})),UQ={name:"LaserWave",appearance:"dark",style:{background:"#27212e","editor.background":"#27212e",text:"#ffffff","editor.foreground":"#ffffff","search.match_background":"#40b4c48c",error:"#ff3e7b",players:[{cursor:"#ffffff",selection:"#eb64b927"}],deleted:"#b381c5",modified:"#74dfc4","terminal.ansi.black":"#000000","terminal.ansi.red":"#EB64B9","terminal.ansi.green":"#74dfc4","terminal.ansi.yellow":"#ffe261","terminal.ansi.blue":"#40b4c4","terminal.ansi.magenta":"#b381c5","terminal.ansi.cyan":"#b4dce7","terminal.ansi.white":"#e5e5e5","terminal.ansi.bright_black":"#666666","terminal.ansi.bright_red":"#f14c4c","terminal.ansi.bright_green":"#23d18b","terminal.ansi.bright_yellow":"#f5f543","terminal.ansi.bright_blue":"#3b8eea","terminal.ansi.bright_magenta":"#d670d6","terminal.ansi.bright_cyan":"#29b8db","terminal.ansi.bright_white":"#e5e5e5",syntax:{attribute:{color:"#EB64B9"},boolean:{color:"#ffe261"},comment:{color:"#91889b"},"comment.doc":{color:"#91889b"},constant:{color:"#ffe261"},constructor:{color:"#74dfc4"},emphasis:{color:"#EB64B9"},"emphasis.strong":{color:"#EB64B9"},function:{color:"#EB64B9"},keyword:{color:"#40b4c4"},number:{color:"#b381c5"},operator:{color:"#74dfc4"},punctuation:{color:"#7b6995"},"punctuation.bracket":{color:"#7b6995"},"punctuation.delimiter":{color:"#7b6995"},"punctuation.list_marker":{color:"#7b6995"},"punctuation.special":{color:"#7b6995"},string:{color:"#b4dce7"},"string.escape":{color:"#b4dce7"},"string.regex":{color:"#b4dce7"},"string.special":{color:"#b4dce7"},"string.special.symbol":{color:"#b4dce7"},tag:{color:"#74dfc4"},"text.literal":{color:"#b4dce7"},type:{color:"#a96bc0"},embedded:{color:"#ffffff"},label:{color:"#ffffff"},namespace:{color:"#a96bc0"},predictive:{color:"#91889b"},preproc:{color:"#40b4c4"},primary:{color:"#ffffff"},property:{color:"#ffffff"},selector:{color:"#74DFC4"},title:{color:"#40B4C4"},variable:{color:"#FFF"},enum:{color:"#A96BC0"},hint:{color:"#91889b"},link_text:{color:"#B4DCE7"},link_uri:{color:"#b4dce7"},variant:{color:"#EB64B9"},"diff.minus":{color:"#EB64B9"},"diff.plus":{color:"#74DFC4"},"property.json_key":{color:"#40B4C4"},"selector.class":{color:"#EB64B9"},"selector.id":{color:"#EB64B9"},"selector.pseudo":{color:"#EB64B9"}}}},JQ=Object.freeze(Object.defineProperty({__proto__:null,default:UQ},Symbol.toStringTag,{value:"Module"})),LQ={name:"Light Plus",appearance:"light",style:{background:"#ffffffff",text:"#000000ff","editor.background":"#ffffffff","editor.foreground":"#000000ff","editor.active_line.background":"#0000000a","editor.document_highlight.bracket_background":"#0000001a","search.match_background":"#00000033",players:[{cursor:"#000000ff",background:"#00000026",selection:"#00000033"},{cursor:"#806c33ff",background:"#806c3326",selection:"#806c334d"},{cursor:"#598033ff",background:"#59803326",selection:"#5980334d"},{cursor:"#338046ff",background:"#33804626",selection:"#3380464d"},{cursor:"#338080ff",background:"#33808026",selection:"#3380804d"},{cursor:"#334680ff",background:"#33468026",selection:"#3346804d"},{cursor:"#593380ff",background:"#59338026",selection:"#5933804d"},{cursor:"#80336cff",background:"#80336c26",selection:"#80336c4d"}],error:"#f44747ff",warning:"#cca700ff",info:"#3794ffff",hint:"#969696ff","terminal.ansi.black":"#000000ff","terminal.ansi.red":"#cd3131ff","terminal.ansi.green":"#0dbc79ff","terminal.ansi.yellow":"#e5e510ff","terminal.ansi.blue":"#2472c8ff","terminal.ansi.magenta":"#bc3fbcff","terminal.ansi.cyan":"#11a8cdff","terminal.ansi.white":"#e5e5e5ff","terminal.ansi.bright_black":"#666666ff","terminal.ansi.bright_red":"#f14c4cff","terminal.ansi.bright_green":"#23d18bff","terminal.ansi.bright_yellow":"#f5f543ff","terminal.ansi.bright_blue":"#3b8eeaff","terminal.ansi.bright_magenta":"#d670d6ff","terminal.ansi.bright_cyan":"#29b8dbff","terminal.ansi.bright_white":"#e5e5e5ff",syntax:{comment:{color:"#008000ff"},"comment.doc":{color:"#008000ff"},string:{color:"#a31515ff"},"string.regex":{color:"#811f3fff"},"string.escape":{color:"#ee0000ff"},link_text:{color:"#a31515ff"},number:{color:"#098658ff"},boolean:{color:"#0000ffff"},"constant.builtin":{color:"#0000ffff"},constant:{color:"#0070C1"},variable:{color:"#001080ff"},"variable.special":{color:"#0000ffff"},"variable.parameter":{color:"#001080ff"},keyword:{color:"#0000ffff"},operator:{color:"#000000ff"},type:{color:"#267f99ff"},"type.builtin":{color:"#267f99ff"},function:{color:"#795e26ff"},"function.builtin":{color:"#795e26ff"},tag:{color:"#800000ff"},attribute:{color:"#e50000ff"},"punctuation.special":{color:"#0000ffff"},"punctuation.bracket":{color:"#000000ff"},"punctuation.delimiter":{color:"#000000ff"},"punctuation.list_marker":{color:"#0451a5ff"},punctuation:{color:"#000000ff"},preproc:{color:"#0000ffff"},title:{color:"#800000ff",font_weight:700},"emphasis.strong":{color:"#000080ff",font_weight:700},emphasis:{color:"#800080ff",font_style:"italic"},"text.literal":{color:"#800000ff"},enum:{color:"#267f99ff"},property:{color:"#001080ff"},label:{color:"#000000"},constructor:{color:"#795e26ff"},namespace:{color:"#267f99ff"},"diff.minus":{color:"#a31515ff"},"diff.plus":{color:"#098658ff"},embedded:{color:"#000000ff"},selector:{color:"#800000ff"},"selector.pseudo":{color:"#800000"},variant:{color:"#0070c1ff"},"string.special":{color:"#a31515ff"},"punctuation.markup":{color:"#000000ff"},"property.json_key":{color:"#0451a5ff"},primary:{color:"#000000ff"},link_uri:{color:"#000000ff"},hint:{color:"#00000066"},predictive:{color:"#00000066"},"string.special.symbol":{color:"#000000ff"},"keyword.control":{color:"#AF00DB"},"keyword.import":{color:"#AF00DB"},"tag.doctype":{color:"#000000ff"},"punctuation.bracket.html":{color:"#800000"},"punctuation.bracket.jsx":{color:"#800000"},"punctuation.delimiter.html":{color:"#800000"},"punctuation.delimiter.jsx":{color:"#800000"},"tag.component.jsx":{color:"#267F99"}},created:"#587c0c",deleted:"#ad0707",modified:"#895503"}},mQ=Object.freeze(Object.defineProperty({__proto__:null,default:LQ},Symbol.toStringTag,{value:"Module"})),pQ={name:"Material Theme",appearance:"dark",style:{background:"#263238",text:"#EEFFFF","editor.background":"#263238","editor.foreground":"#EEFFFF","editor.active_line.background":"#00000050",players:[],error:"#f0717870",warning:"#FFCB6B70",info:"#82AAFF70",hint:"#969696ff",deleted:"#f0717890",modified:"#82AAFF90","terminal.ansi.black":"#000000","terminal.ansi.red":"#f07178","terminal.ansi.green":"#C3E88D","terminal.ansi.yellow":"#FFCB6B","terminal.ansi.blue":"#82AAFF","terminal.ansi.magenta":"#C792EA","terminal.ansi.cyan":"#89DDFF","terminal.ansi.white":"#ffffff","terminal.ansi.bright_black":"#546E7A","terminal.ansi.bright_red":"#f07178","terminal.ansi.bright_green":"#C3E88D","terminal.ansi.bright_yellow":"#FFCB6B","terminal.ansi.bright_blue":"#82AAFF","terminal.ansi.bright_magenta":"#C792EA","terminal.ansi.bright_cyan":"#89DDFF","terminal.ansi.bright_white":"#ffffff",syntax:{attribute:{color:"#C792EA"},comment:{color:"#546E7A",font_style:"italic"},"comment.doc":{color:"#546E7A",font_style:"italic"},constructor:{color:"#f07178"},emphasis:{color:"#f07178",font_style:"italic"},"emphasis.strong":{color:"#f07178",font_weight:700},function:{color:"#82AAFF"},keyword:{color:"#89DDFF",font_style:"italic"},number:{color:"#F78C6C"},punctuation:{color:"#89DDFF"},"punctuation.bracket":{color:"#89DDFF"},"punctuation.delimiter":{color:"#89DDFF"},"punctuation.list_marker":{color:"#89DDFF"},"punctuation.special":{color:"#89DDFF"},string:{color:"#C3E88D"},"string.escape":{color:"#C3E88D"},"string.regex":{color:"#C3E88D"},"string.special":{color:"#C3E88D"},"string.special.symbol":{color:"#C3E88D"},tag:{color:"#f07178"},"text.literal":{color:"#C3E88D"},boolean:{color:"#FF9CAC"},constant:{color:"#EEFFFF"},embedded:{color:"#EEFFFF"},label:{color:"#FFCB6B"},namespace:{color:"#FFCB6B"},operator:{color:"#89DDFF"},predictive:{color:"#546E7A"},preproc:{color:"#89DDFF",font_style:"italic"},primary:{color:"#EEFFFF"},property:{color:"#F07178"},selector:{color:"#FFCB6B"},title:{color:"#89DDFF"},type:{color:"#FFCB6B"},variable:{color:"#EEFFFF"},enum:{color:"#FFCB6B"},hint:{color:"#969696ff"},link_text:{color:"#C3E88D"},link_uri:{color:"#EEFFFF"},variant:{color:"#EEFFFF"},"constant.builtin":{color:"#89DDFF"},"diff.minus":{color:"#F07178"},"diff.plus":{color:"#C3E88D"},"selector.id":{color:"#F78C6C"},"variable.parameter":{color:"#EEFFFF",font_style:"italic"},"selector.pseudo":{color:"#C792EA"}}}},uQ=Object.freeze(Object.defineProperty({__proto__:null,default:pQ},Symbol.toStringTag,{value:"Module"})),jQ={name:"Material Theme Darker",appearance:"dark",style:{background:"#212121",text:"#EEFFFF","editor.background":"#212121","editor.foreground":"#EEFFFF","editor.active_line.background":"#00000050",players:[],error:"#f0717870",warning:"#FFCB6B70",info:"#82AAFF70",hint:"#969696ff",deleted:"#f0717890",modified:"#82AAFF90","terminal.ansi.black":"#000000","terminal.ansi.red":"#f07178","terminal.ansi.green":"#C3E88D","terminal.ansi.yellow":"#FFCB6B","terminal.ansi.blue":"#82AAFF","terminal.ansi.magenta":"#C792EA","terminal.ansi.cyan":"#89DDFF","terminal.ansi.white":"#ffffff","terminal.ansi.bright_black":"#545454","terminal.ansi.bright_red":"#f07178","terminal.ansi.bright_green":"#C3E88D","terminal.ansi.bright_yellow":"#FFCB6B","terminal.ansi.bright_blue":"#82AAFF","terminal.ansi.bright_magenta":"#C792EA","terminal.ansi.bright_cyan":"#89DDFF","terminal.ansi.bright_white":"#ffffff",syntax:{attribute:{color:"#C792EA"},comment:{color:"#545454",font_style:"italic"},"comment.doc":{color:"#545454",font_style:"italic"},constructor:{color:"#f07178"},emphasis:{color:"#f07178",font_style:"italic"},"emphasis.strong":{color:"#f07178",font_weight:700},function:{color:"#82AAFF"},keyword:{color:"#89DDFF",font_style:"italic"},number:{color:"#F78C6C"},punctuation:{color:"#89DDFF"},"punctuation.bracket":{color:"#89DDFF"},"punctuation.delimiter":{color:"#89DDFF"},"punctuation.list_marker":{color:"#89DDFF"},"punctuation.special":{color:"#89DDFF"},string:{color:"#C3E88D"},"string.escape":{color:"#C3E88D"},"string.regex":{color:"#C3E88D"},"string.special":{color:"#C3E88D"},"string.special.symbol":{color:"#C3E88D"},tag:{color:"#f07178"},"text.literal":{color:"#C3E88D"},boolean:{color:"#FF9CAC"},constant:{color:"#EEFFFF"},embedded:{color:"#EEFFFF"},label:{color:"#FFCB6B"},namespace:{color:"#FFCB6B"},operator:{color:"#89DDFF"},predictive:{color:"#545454"},preproc:{color:"#89DDFF",font_style:"italic"},primary:{color:"#EEFFFF"},property:{color:"#F07178"},selector:{color:"#FFCB6B"},title:{color:"#89DDFF"},type:{color:"#FFCB6B"},variable:{color:"#EEFFFF"},enum:{color:"#FFCB6B"},hint:{color:"#969696ff"},link_text:{color:"#C3E88D"},link_uri:{color:"#EEFFFF"},variant:{color:"#EEFFFF"},"constant.builtin":{color:"#89DDFF"},"diff.minus":{color:"#F07178"},"diff.plus":{color:"#C3E88D"},"selector.id":{color:"#F78C6C"},"variable.parameter":{color:"#EEFFFF",font_style:"italic"},"selector.pseudo":{color:"#C792EA"}}}},YQ=Object.freeze(Object.defineProperty({__proto__:null,default:jQ},Symbol.toStringTag,{value:"Module"})),NQ={name:"Material Theme Lighter",appearance:"light",style:{background:"#FAFAFA",text:"#90A4AE","editor.background":"#FAFAFA","editor.foreground":"#90A4AE","editor.active_line.background":"#CCD7DA50",players:[],error:"#E5393570",warning:"#E2931D70",info:"#6182B870",hint:"#969696ff",deleted:"#E5393590",modified:"#6182B890","terminal.ansi.black":"#000000","terminal.ansi.red":"#E53935","terminal.ansi.green":"#91B859","terminal.ansi.yellow":"#E2931D","terminal.ansi.blue":"#6182B8","terminal.ansi.magenta":"#9C3EDA","terminal.ansi.cyan":"#39ADB5","terminal.ansi.white":"#FFFFFF","terminal.ansi.bright_black":"#90A4AE","terminal.ansi.bright_red":"#E53935","terminal.ansi.bright_green":"#91B859","terminal.ansi.bright_yellow":"#E2931D","terminal.ansi.bright_blue":"#6182B8","terminal.ansi.bright_magenta":"#9C3EDA","terminal.ansi.bright_cyan":"#39ADB5","terminal.ansi.bright_white":"#FFFFFF",syntax:{attribute:{color:"#9C3EDA"},comment:{color:"#90A4AE",font_style:"italic"},"comment.doc":{color:"#90A4AE",font_style:"italic"},constructor:{color:"#E53935"},emphasis:{color:"#E53935",font_style:"italic"},"emphasis.strong":{color:"#E53935",font_weight:700},function:{color:"#6182B8"},keyword:{color:"#39ADB5",font_style:"italic"},number:{color:"#F76D47"},punctuation:{color:"#39ADB5"},"punctuation.bracket":{color:"#39ADB5"},"punctuation.delimiter":{color:"#39ADB5"},"punctuation.list_marker":{color:"#39ADB5"},"punctuation.special":{color:"#39ADB5"},string:{color:"#91B859"},"string.escape":{color:"#91B859"},"string.regex":{color:"#91B859"},"string.special":{color:"#91B859"},"string.special.symbol":{color:"#91B859"},tag:{color:"#E53935"},"text.literal":{color:"#91B859"},boolean:{color:"#FF5370"},constant:{color:"#90A4AE"},embedded:{color:"#90A4AE"},label:{color:"#E2931D"},namespace:{color:"#E2931D"},operator:{color:"#39ADB5"},predictive:{color:"#90A4AE"},preproc:{color:"#39ADB5",font_style:"italic"},primary:{color:"#90A4AE"},property:{color:"#E53935"},selector:{color:"#E2931D"},title:{color:"#39ADB5"},type:{color:"#E2931D"},variable:{color:"#90A4AE"},enum:{color:"#E2931D"},hint:{color:"#969696ff"},link_text:{color:"#91B859"},link_uri:{color:"#90A4AE"},variant:{color:"#90A4AE"},"constant.builtin":{color:"#39ADB5"},"diff.minus":{color:"#E53935"},"diff.plus":{color:"#91B859"},"selector.id":{color:"#F76D47"},"variable.parameter":{color:"#90A4AE",font_style:"italic"},"selector.pseudo":{color:"#9C3EDA"}}}},HQ=Object.freeze(Object.defineProperty({__proto__:null,default:NQ},Symbol.toStringTag,{value:"Module"})),ZQ={name:"Material Theme Ocean",appearance:"dark",style:{background:"#0F111A",text:"#babed8","editor.background":"#0F111A","editor.foreground":"#babed8","editor.active_line.background":"#00000050",players:[],error:"#f0717870",warning:"#FFCB6B70",info:"#82AAFF70",hint:"#969696ff",deleted:"#f0717890",modified:"#82AAFF90","terminal.ansi.black":"#000000","terminal.ansi.red":"#f07178","terminal.ansi.green":"#C3E88D","terminal.ansi.yellow":"#FFCB6B","terminal.ansi.blue":"#82AAFF","terminal.ansi.magenta":"#C792EA","terminal.ansi.cyan":"#89DDFF","terminal.ansi.white":"#ffffff","terminal.ansi.bright_black":"#464B5D","terminal.ansi.bright_red":"#f07178","terminal.ansi.bright_green":"#C3E88D","terminal.ansi.bright_yellow":"#FFCB6B","terminal.ansi.bright_blue":"#82AAFF","terminal.ansi.bright_magenta":"#C792EA","terminal.ansi.bright_cyan":"#89DDFF","terminal.ansi.bright_white":"#ffffff",syntax:{attribute:{color:"#C792EA"},comment:{color:"#464B5D",font_style:"italic"},"comment.doc":{color:"#464B5D",font_style:"italic"},constructor:{color:"#f07178"},emphasis:{color:"#f07178",font_style:"italic"},"emphasis.strong":{color:"#f07178",font_weight:700},function:{color:"#82AAFF"},keyword:{color:"#89DDFF",font_style:"italic"},number:{color:"#F78C6C"},punctuation:{color:"#89DDFF"},"punctuation.bracket":{color:"#89DDFF"},"punctuation.delimiter":{color:"#89DDFF"},"punctuation.list_marker":{color:"#89DDFF"},"punctuation.special":{color:"#89DDFF"},string:{color:"#C3E88D"},"string.escape":{color:"#C3E88D"},"string.regex":{color:"#C3E88D"},"string.special":{color:"#C3E88D"},"string.special.symbol":{color:"#C3E88D"},tag:{color:"#f07178"},"text.literal":{color:"#C3E88D"},boolean:{color:"#FF9CAC"},constant:{color:"#BABED8"},embedded:{color:"#BABED8"},label:{color:"#FFCB6B"},namespace:{color:"#FFCB6B"},operator:{color:"#89DDFF"},predictive:{color:"#464B5D"},preproc:{color:"#89DDFF",font_style:"italic"},primary:{color:"#babed8"},property:{color:"#F07178"},selector:{color:"#FFCB6B"},title:{color:"#89DDFF"},type:{color:"#FFCB6B"},variable:{color:"#BABED8"},enum:{color:"#FFCB6B"},hint:{color:"#969696ff"},link_text:{color:"#C3E88D"},link_uri:{color:"#babed8"},variant:{color:"#BABED8"},"constant.builtin":{color:"#89DDFF"},"diff.minus":{color:"#F07178"},"diff.plus":{color:"#C3E88D"},"selector.id":{color:"#F78C6C"},"variable.parameter":{color:"#BABED8",font_style:"italic"},"selector.pseudo":{color:"#C792EA"}}}},xQ=Object.freeze(Object.defineProperty({__proto__:null,default:ZQ},Symbol.toStringTag,{value:"Module"})),TQ={name:"Material Theme Palenight",appearance:"dark",style:{background:"#292D3E",text:"#babed8","editor.background":"#292D3E","editor.foreground":"#babed8","editor.active_line.background":"#00000050",players:[],error:"#f0717870",warning:"#FFCB6B70",info:"#82AAFF70",hint:"#969696ff",deleted:"#f0717890",modified:"#82AAFF90","terminal.ansi.black":"#000000","terminal.ansi.red":"#f07178","terminal.ansi.green":"#C3E88D","terminal.ansi.yellow":"#FFCB6B","terminal.ansi.blue":"#82AAFF","terminal.ansi.magenta":"#C792EA","terminal.ansi.cyan":"#89DDFF","terminal.ansi.white":"#ffffff","terminal.ansi.bright_black":"#676E95","terminal.ansi.bright_red":"#f07178","terminal.ansi.bright_green":"#C3E88D","terminal.ansi.bright_yellow":"#FFCB6B","terminal.ansi.bright_blue":"#82AAFF","terminal.ansi.bright_magenta":"#C792EA","terminal.ansi.bright_cyan":"#89DDFF","terminal.ansi.bright_white":"#ffffff",syntax:{attribute:{color:"#C792EA"},comment:{color:"#676E95",font_style:"italic"},"comment.doc":{color:"#676E95",font_style:"italic"},constructor:{color:"#f07178"},emphasis:{color:"#f07178",font_style:"italic"},"emphasis.strong":{color:"#f07178",font_weight:700},function:{color:"#82AAFF"},keyword:{color:"#89DDFF",font_style:"italic"},number:{color:"#F78C6C"},punctuation:{color:"#89DDFF"},"punctuation.bracket":{color:"#89DDFF"},"punctuation.delimiter":{color:"#89DDFF"},"punctuation.list_marker":{color:"#89DDFF"},"punctuation.special":{color:"#89DDFF"},string:{color:"#C3E88D"},"string.escape":{color:"#C3E88D"},"string.regex":{color:"#C3E88D"},"string.special":{color:"#C3E88D"},"string.special.symbol":{color:"#C3E88D"},tag:{color:"#f07178"},"text.literal":{color:"#C3E88D"},boolean:{color:"#FF9CAC"},constant:{color:"#BABED8"},embedded:{color:"#BABED8"},label:{color:"#FFCB6B"},namespace:{color:"#FFCB6B"},operator:{color:"#89DDFF"},predictive:{color:"#676E95"},preproc:{color:"#89DDFF",font_style:"italic"},primary:{color:"#babed8"},property:{color:"#F07178"},selector:{color:"#FFCB6B"},title:{color:"#89DDFF"},type:{color:"#FFCB6B"},variable:{color:"#BABED8"},enum:{color:"#FFCB6B"},hint:{color:"#969696ff"},link_text:{color:"#C3E88D"},link_uri:{color:"#babed8"},variant:{color:"#BABED8"},"constant.builtin":{color:"#89DDFF"},"diff.minus":{color:"#F07178"},"diff.plus":{color:"#C3E88D"},"selector.id":{color:"#F78C6C"},"variable.parameter":{color:"#BABED8",font_style:"italic"},"selector.pseudo":{color:"#C792EA"}}}},WQ=Object.freeze(Object.defineProperty({__proto__:null,default:TQ},Symbol.toStringTag,{value:"Module"})),_Q={name:"Min Dark",appearance:"dark",style:{background:"#141414",text:"#999999","editor.background":"#1A1A1A","editor.foreground":"#BBBBBB","search.match_background":"#FFAB7064",players:[],error:"#F97583",warning:"#FFE62A",hint:"#969696ff","terminal.ansi.black":"#1A1A1A","terminal.ansi.red":"#FA7584","terminal.ansi.green":"#79B8FF","terminal.ansi.yellow":"#FFAB70","terminal.ansi.blue":"#B392F1","terminal.ansi.magenta":"#E394DC","terminal.ansi.cyan":"#79B8FF","terminal.ansi.white":"#BBBBBB","terminal.ansi.bright_black":"#5C5C5C","terminal.ansi.bright_red":"#FF9CAA","terminal.ansi.bright_green":"#A3D0FF","terminal.ansi.bright_yellow":"#FFC9A3","terminal.ansi.bright_blue":"#CFB8FF","terminal.ansi.bright_magenta":"#F3B8EC","terminal.ansi.bright_cyan":"#A3D0FF","terminal.ansi.bright_white":"#F8F8F8",syntax:{attribute:{color:"#B392F1"},boolean:{color:"#79B8FF"},comment:{color:"#888888"},"comment.doc":{color:"#888888"},constant:{color:"#79B8FF"},enum:{color:"#B392F1"},function:{color:"#B392F1"},keyword:{color:"#FA7584"},number:{color:"#F8F8F8"},operator:{color:"#FA7584"},property:{color:"#BBBBBB"},punctuation:{color:"#D1D1D1"},string:{color:"#FFAB70"},"string.escape":{color:"#FA7584",font_style:"normal",font_weight:400},tag:{color:"#FFAB70",font_style:"normal",font_weight:400},"text.literal":{color:"#E394DC",font_style:"normal",font_weight:400},type:{color:"#79B8FF",font_style:"normal",font_weight:400},"type.builtin":{color:"#79B8FF",font_style:"normal",font_weight:400},variable:{color:"#bbbbbb",font_style:"normal",font_weight:400},"variable.special":{color:"#79B8FF",font_style:"normal",font_weight:400},constructor:{color:"#B392F0"},embedded:{color:"#BBBBBB"},emphasis:{color:"#BBBBBB",font_style:"italic"},label:{color:"#bbbbbb",font_style:"normal",font_weight:400},namespace:{color:"#79B8FF",font_style:"normal",font_weight:400},predictive:{color:"#888888"},preproc:{color:"#FA7584"},primary:{color:"#BBBBBB"},selector:{color:"#FFAB70"},title:{color:"#79B8FF",font_style:"normal",font_weight:400},hint:{color:"#969696ff"},link_text:{color:"#79B8FF"},link_uri:{color:"#FFAB70"},variant:{color:"#79B8FF"},"diff.minus":{color:"#BBBBBB"},"diff.plus":{color:"#BBBBBB"},"emphasis.strong":{color:"#BBBBBB",font_style:"italic",font_weight:700},"selector.class":{color:"#B392F0"},"selector.id":{color:"#B392F0"},"selector.pseudo":{color:"#B392F0"}},created:"#81b88b",deleted:"#c74e39",modified:"#E2C08D"}},PQ=Object.freeze(Object.defineProperty({__proto__:null,default:_Q},Symbol.toStringTag,{value:"Module"})),XQ={name:"Min Light",appearance:"light",style:{background:"#FBFBFB",text:"#606060","editor.background":"#FFFFFF","editor.foreground":"#212121","search.match_background":"#E7C54764",players:[],error:"#D32F2F",warning:"#FFE62A",hint:"#757575","terminal.ansi.black":"#333333","terminal.ansi.red":"#D32F2F","terminal.ansi.green":"#388E3C","terminal.ansi.yellow":"#F57C00","terminal.ansi.blue":"#1976D2","terminal.ansi.magenta":"#C2185B","terminal.ansi.cyan":"#0097A7","terminal.ansi.white":"#B1B1B1","terminal.ansi.bright_black":"#A1A1A1","terminal.ansi.bright_red":"#E57373","terminal.ansi.bright_green":"#81C784","terminal.ansi.bright_yellow":"#FFB74D","terminal.ansi.bright_blue":"#64B5F6","terminal.ansi.bright_magenta":"#F06292","terminal.ansi.bright_cyan":"#4DD0E1","terminal.ansi.bright_white":"#B1B1B1",syntax:{attribute:{color:"#6F42C1"},boolean:{color:"#1976D2"},comment:{color:"#C2C3C5"},"comment.doc":{color:"#C2C3C5"},constant:{color:"#1976D2"},enum:{color:"#6F42C1"},function:{color:"#6F42C1"},keyword:{color:"#D32F2F"},number:{color:"#212121"},operator:{color:"#D32F2F"},property:{color:"#212121"},punctuation:{color:"#424242"},string:{color:"#22863A"},"string.escape":{color:"#D32F2F",font_style:"normal",font_weight:400},tag:{color:"#22863A",font_style:"normal",font_weight:400},"text.literal":{color:"#C2185B",font_style:"normal",font_weight:400},type:{color:"#1976D2",font_style:"normal",font_weight:400},"type.builtin":{color:"#1976D2",font_style:"normal",font_weight:400},variable:{color:"#212121",font_style:"normal",font_weight:400},"variable.special":{color:"#1976D2",font_style:"normal",font_weight:400},constructor:{color:"#6F42C1"},embedded:{color:"#212121"},emphasis:{color:"#212121",font_style:"italic"},label:{color:"#212121",font_style:"normal",font_weight:400},namespace:{color:"#1976D2",font_style:"normal",font_weight:400},predictive:{color:"#C2C3C5"},preproc:{color:"#D32F2F"},primary:{color:"#212121"},selector:{color:"#22863A"},title:{color:"#1976D2",font_style:"normal",font_weight:400},hint:{color:"#757575"},link_text:{color:"#D32F2F"},link_uri:{color:"#22863A"},variant:{color:"#1976D2"},"diff.minus":{color:"#D32F2F"},"diff.plus":{color:"#77cc00"},"emphasis.strong":{color:"#212121",font_style:"italic",font_weight:700},"selector.class":{color:"#6F42C1"},"selector.id":{color:"#6F42C1"},"selector.pseudo":{color:"#6F42C1"}}}},KQ=Object.freeze(Object.defineProperty({__proto__:null,default:XQ},Symbol.toStringTag,{value:"Module"})),VQ={name:"Monokai",appearance:"dark",style:{background:"#272822ff",text:"#f8f8f2ff","editor.background":"#272822ff","editor.foreground":"#f8f8f2ff","editor.active_line.background":"#3e3d32ff","editor.document_highlight.bracket_background":"#f8f8f21a","search.match_background":"#f8f8f233",players:[{cursor:"#f8f8f0ff",background:"#f8f8f026",selection:"#878b9180"},{cursor:"#88f863ff",background:"#88f86326",selection:"#88f8634d"},{cursor:"#63f8aeff",background:"#63f8ae26",selection:"#63f8ae4d"},{cursor:"#63d3f8ff",background:"#63d3f826",selection:"#63d3f84d"},{cursor:"#6363f8ff",background:"#6363f826",selection:"#6363f84d"},{cursor:"#d363f8ff",background:"#d363f826",selection:"#d363f84d"},{cursor:"#f863aeff",background:"#f863ae26",selection:"#f863ae4d"},{cursor:"#f88863ff",background:"#f8886326",selection:"#f888634d"}],error:"#f44747ff",warning:"#cca700ff",info:"#3794ffff",hint:"#969696ff","terminal.ansi.black":"#333333ff","terminal.ansi.red":"#c4265eff","terminal.ansi.green":"#86b42bff","terminal.ansi.yellow":"#b3b42bff","terminal.ansi.blue":"#6a7ec8ff","terminal.ansi.magenta":"#8c6bc8ff","terminal.ansi.cyan":"#56adbcff","terminal.ansi.white":"#e3e3ddff","terminal.ansi.bright_black":"#666666ff","terminal.ansi.bright_red":"#f92672ff","terminal.ansi.bright_green":"#a6e22eff","terminal.ansi.bright_yellow":"#e2e22eff","terminal.ansi.bright_blue":"#819affff","terminal.ansi.bright_magenta":"#ae81ffff","terminal.ansi.bright_cyan":"#66d9efff","terminal.ansi.bright_white":"#f8f8f2ff",syntax:{comment:{color:"#88846fff"},"comment.doc":{color:"#88846fff"},string:{color:"#e6db74ff"},"string.regex":{color:"#e6db74ff"},"string.escape":{color:"#ae81ffff"},link_text:{color:"#ae81ffff"},link_uri:{color:"#e6db74ff"},number:{color:"#ae81ffff"},boolean:{color:"#ae81ffff"},"constant.builtin":{color:"#ae81ffff"},constant:{color:"#F8F8F2"},variable:{color:"#f8f8f2ff"},"variable.special":{color:"#fd971fff"},"variable.parameter":{color:"#fd971fff",font_style:"italic"},keyword:{color:"#f92672ff"},operator:{color:"#f92672ff"},type:{color:"#a6e22eff"},"type.builtin":{color:"#66d9efff",font_style:"italic"},function:{color:"#a6e22eff"},"function.builtin":{color:"#66d9efff"},tag:{color:"#f92672ff"},attribute:{color:"#a6e22eff"},"punctuation.special":{color:"#f92672ff"},"punctuation.delimiter":{color:"#f8f8f2ff"},"punctuation.list_marker":{color:"#a6e22eff"},punctuation:{color:"#f8f8f2ff"},preproc:{color:"#f8f8f2ff"},title:{color:"#a6e22eff"},"emphasis.strong":{color:"#66D9EF",font_weight:700},emphasis:{color:"#66D9EF",font_style:"italic"},"text.literal":{color:"#fd971fff"},enum:{color:"#a6e22eff"},property:{color:"#f8f8f2ff"},label:{color:"#f8f8f2ff"},constructor:{color:"#a6e22eff"},namespace:{color:"#a6e22eff"},"diff.minus":{color:"#f92672ff"},"diff.plus":{color:"#a6e22eff"},embedded:{color:"#f8f8f2ff"},selector:{color:"#f92672ff"},"selector.pseudo":{color:"#a6e22eff"},variant:{color:"#f8f8f2ff"},"string.special":{color:"#e6db74ff"},"string.special.symbol":{color:"#ae81ffff"},primary:{color:"#f8f8f2ff"},hint:{color:"#f8f8f266"},predictive:{color:"#f8f8f266"},"punctuation.bracket":{color:"#f8f8f2ff"},"punctuation.markup":{color:"#f8f8f2ff"},"keyword.declaration":{color:"#66D9EF",font_style:"italic"},"property.json_key":{color:"#66D9EF",font_style:"italic"},"selector.class":{color:"#A6E22E"},"selector.id":{color:"#A6E22E"},"tag.doctype":{color:"#f8f8f2ff"},"keyword.jsdoc":{color:"#66D9EF",font_style:"italic"},"tag.component.jsx":{color:"#66D9EF",font_style:"italic"}},created:"#81b88b",deleted:"#c74e39",modified:"#E2C08D"}},qQ=Object.freeze(Object.defineProperty({__proto__:null,default:VQ},Symbol.toStringTag,{value:"Module"})),vQ={name:"Night Owl",appearance:"dark",style:{background:"#011627",text:"#d6deeb","editor.background":"#011627","editor.foreground":"#d6deeb","editor.active_line.background":"#28707d29","editor.document_highlight.bracket_background":"#f6bbe533","search.match_background":"#1085bb5d",players:[{cursor:"#80a4c2",background:"#80a4c2",selection:"#4373c250"},{cursor:"#7e57c2",background:"#7e57c2",selection:"#7e57c23d"},{cursor:"#c792ea",background:"#c792ea",selection:"#c792ea3d"},{cursor:"#7fdbca",background:"#7fdbca",selection:"#7fdbca3d"},{cursor:"#F78C6C",background:"#F78C6C",selection:"#F78C6C3d"},{cursor:"#EF5350",background:"#EF5350",selection:"#EF53503d"},{cursor:"#ffcb8b",background:"#ffcb8b",selection:"#ffcb8b3d"},{cursor:"#9CCC65",background:"#9CCC65",selection:"#9CCC653d"}],error:"#EF5350",warning:"#b39554",info:"#82aaff",hint:"#829D9D",deleted:"#EF535090",modified:"#a2bffc","terminal.ansi.black":"#011627","terminal.ansi.red":"#EF5350","terminal.ansi.green":"#22da6e","terminal.ansi.yellow":"#c5e478","terminal.ansi.blue":"#82AAFF","terminal.ansi.magenta":"#C792EA","terminal.ansi.cyan":"#21c7a8","terminal.ansi.white":"#ffffff","terminal.ansi.bright_black":"#575656","terminal.ansi.bright_red":"#EF5350","terminal.ansi.bright_green":"#22da6e","terminal.ansi.bright_yellow":"#ffeb95","terminal.ansi.bright_blue":"#82AAFF","terminal.ansi.bright_magenta":"#C792EA","terminal.ansi.bright_cyan":"#7fdbca","terminal.ansi.bright_white":"#ffffff",syntax:{attribute:{color:"#c5e478",font_style:"italic"},boolean:{color:"#ff5874"},comment:{color:"#637777",font_style:"italic"},"comment.doc":{color:"#637777",font_style:"italic"},constant:{color:"#82AAFF"},"constant.builtin":{color:"#ff5874"},constructor:{color:"#82aaff",font_style:"normal"},"diff.minus":{color:"#EF5350"},"diff.plus":{color:"#9CCC65"},embedded:{color:"#d6deeb"},emphasis:{color:"#82aaff",font_style:"italic"},"emphasis.strong":{color:"#ffcb8b",font_weight:700},enum:{color:"#ffcb8b"},function:{color:"#82aaff",font_style:"italic"},"function.method":{color:"#82aaff",font_style:"italic"},hint:{color:"#829D9D"},keyword:{color:"#c792ea",font_style:"italic"},"keyword.control":{color:"#c792ea",font_style:"italic"},"keyword.declaration":{color:"#c792ea",font_style:"normal"},label:{color:"#82aaff"},link_text:{color:"#82aaff",font_style:"normal"},link_uri:{color:"#7fdbca"},namespace:{color:"#d6deeb"},number:{color:"#F78C6C"},operator:{color:"#c792ea"},predictive:{color:"#5f7e97",font_style:"italic"},preproc:{color:"#c792ea",font_style:"italic"},primary:{color:"#d6deeb"},property:{color:"#d6deeb"},punctuation:{color:"#d6deeb",font_style:"normal"},"punctuation.bracket":{color:"#ffd602",font_style:"normal"},"punctuation.delimiter":{color:"#d6deeb",font_style:"normal"},"punctuation.list_marker":{color:"#7fdbca"},"punctuation.markup":{color:"#7fdbca"},"punctuation.special":{color:"#82aaff",font_style:"italic"},selector:{color:"#c5e478"},"selector.pseudo":{color:"#82aaff"},string:{color:"#ecc48d"},"string.escape":{color:"#F78C6C"},"string.regex":{color:"#5ca7e4"},"string.special":{color:"#ecc48d"},"string.special.symbol":{color:"#ecc48d"},tag:{color:"#caece6"},"text.literal":{color:"#ecc48d"},title:{color:"#82aaff",font_weight:700},type:{color:"#ffcb8b"},"type.builtin":{color:"#c5e478"},variable:{color:"#d6deeb"},"variable.special":{color:"#7fdbca"},variant:{color:"#ffcb8b"}}}},OQ=Object.freeze(Object.defineProperty({__proto__:null,default:vQ},Symbol.toStringTag,{value:"Module"})),zQ={name:"Night Owl Light",appearance:"light",style:{background:"#FBFBFB",text:"#403f53","editor.background":"#FBFBFB","editor.foreground":"#403f53","editor.active_line.background":"#F0F0F0","editor.document_highlight.bracket_background":"#994cc333","search.match_background":"#93A1A16c",players:[{cursor:"#2AA298",background:"#2AA298",selection:"#2AA29850"},{cursor:"#994cc3",background:"#994cc3",selection:"#994cc33d"},{cursor:"#4876d6",background:"#4876d6",selection:"#4876d63d"},{cursor:"#0c969b",background:"#0c969b",selection:"#0c969b3d"},{cursor:"#d6438a",background:"#d6438a",selection:"#d6438a3d"},{cursor:"#de3d3b",background:"#de3d3b",selection:"#de3d3b3d"},{cursor:"#daaa01",background:"#daaa01",selection:"#daaa013d"},{cursor:"#49d0c5",background:"#49d0c5",selection:"#49d0c53d"}],error:"#E64D49",warning:"#daaa01",info:"#288ed7",hint:"#969696","terminal.ansi.black":"#403f53","terminal.ansi.red":"#de3d3b","terminal.ansi.green":"#08916a","terminal.ansi.yellow":"#E0AF02","terminal.ansi.blue":"#288ed7","terminal.ansi.magenta":"#d6438a","terminal.ansi.cyan":"#2AA298","terminal.ansi.white":"#93A1A1","terminal.ansi.bright_black":"#403f53","terminal.ansi.bright_red":"#de3d3b","terminal.ansi.bright_green":"#08916a","terminal.ansi.bright_yellow":"#daaa01","terminal.ansi.bright_blue":"#288ed7","terminal.ansi.bright_magenta":"#d6438a","terminal.ansi.bright_cyan":"#2AA298","terminal.ansi.bright_white":"#93A1A1",syntax:{attribute:{color:"#4876d6",font_style:"italic"},boolean:{color:"#bc5454"},comment:{color:"#989fb1",font_style:"italic"},"comment.doc":{color:"#989fb1",font_style:"italic"},constant:{color:"#4876d6"},"constant.builtin":{color:"#bc5454"},constructor:{color:"#994cc3",font_style:"italic"},"diff.minus":{color:"#f76e6e"},"diff.plus":{color:"#49d0c5"},embedded:{color:"#403f53"},emphasis:{color:"#994cc3",font_style:"italic"},"emphasis.strong":{color:"#4876d6",font_weight:700},enum:{color:"#4876d6"},function:{color:"#4876d6",font_style:"italic"},"function.method":{color:"#4876d6",font_style:"italic"},hint:{color:"#969696"},keyword:{color:"#994cc3",font_style:"italic"},"keyword.control":{color:"#994cc3",font_style:"italic"},"keyword.declaration":{color:"#994cc3",font_style:"normal"},label:{color:"#4876d6"},link_text:{color:"#403f53",font_style:"normal"},link_uri:{color:"#ff869a"},namespace:{color:"#403f53"},number:{color:"#aa0982"},operator:{color:"#0c969b"},predictive:{color:"#93A1A1",font_style:"italic"},preproc:{color:"#994cc3",font_style:"italic"},primary:{color:"#403f53"},property:{color:"#0c969b"},punctuation:{color:"#403f53",font_style:"normal"},"punctuation.bracket":{color:"#994cc3",font_style:"italic"},"punctuation.delimiter":{color:"#403f53",font_style:"normal"},"punctuation.list_marker":{color:"#4876d6"},"punctuation.markup":{color:"#4876d6"},"punctuation.special":{color:"#994cc3",font_style:"italic"},selector:{color:"#994cc3",font_style:"italic"},"selector.pseudo":{color:"#994cc3"},string:{color:"#c96765"},"string.escape":{color:"#aa0982"},"string.regex":{color:"#5ca7e4"},"string.special":{color:"#c96765"},"string.special.symbol":{color:"#c96765"},tag:{color:"#994cc3"},"text.literal":{color:"#0c969b"},title:{color:"#4876d6",font_weight:700},type:{color:"#4876d6"},"type.builtin":{color:"#bc5454"},variable:{color:"#403f53"},"variable.special":{color:"#0c969b"},variant:{color:"#4876d6"}}}},$Q=Object.freeze(Object.defineProperty({__proto__:null,default:zQ},Symbol.toStringTag,{value:"Module"})),AE={name:"Nord",appearance:"dark",style:{background:"#2e3440",text:"#eceff4","editor.background":"#2e3440","editor.foreground":"#d8dee9","editor.active_line.background":"#3b4252","search.match_background":"#88c0d033",players:[{cursor:"#eceff4",background:"#434c5e99",selection:"#434c5e99"},{cursor:"#eceff4",background:"#eceff4",selection:"#3b4252"},{cursor:"#d08770",background:"#d08770",selection:"#d087703d"},{cursor:"#a3be8c",background:"#a3be8c",selection:"#a3be8c3d"},{cursor:"#b48ead",background:"#b48ead",selection:"#b48ead3d"},{cursor:"#d08770",background:"#d08770",selection:"#d087703d"}],error:"#bf616a",warning:"#ebcb8b",info:"#5e81ac",hint:"#5e81ac",deleted:"#bf616a",modified:"#ebcb8b","terminal.ansi.black":"#3b4252","terminal.ansi.red":"#bf616a","terminal.ansi.green":"#a3be8c","terminal.ansi.yellow":"#ebcb8b","terminal.ansi.blue":"#81a1c1","terminal.ansi.magenta":"#b48ead","terminal.ansi.cyan":"#6c99a6","terminal.ansi.white":"#e5e9f0","terminal.ansi.bright_black":"#4c566a","terminal.ansi.bright_red":"#bf616a","terminal.ansi.bright_green":"#a3be8c","terminal.ansi.bright_yellow":"#ebcb8b","terminal.ansi.bright_blue":"#81a1c1","terminal.ansi.bright_magenta":"#b48ead","terminal.ansi.bright_cyan":"#8fbcbb","terminal.ansi.bright_white":"#eceff4",syntax:{attribute:{color:"#8FBCBB"},boolean:{color:"#81A1C1"},comment:{color:"#4C566A",font_style:"italic"},"comment.doc":{color:"#4C566A",font_style:"italic"},constant:{color:"#D8DEE9"},constructor:{color:"#81A1C1"},function:{color:"#88c0d0"},keyword:{color:"#81A1C1"},number:{color:"#B48EAD"},operator:{color:"#81A1C1"},preproc:{color:"#5E81AC"},punctuation:{color:"#ECEFF4"},"punctuation.bracket":{color:"#ECEFF4"},"punctuation.delimiter":{color:"#81A1C1"},"punctuation.list_marker":{color:"#ECEFF4"},"punctuation.special":{color:"#ECEFF4"},string:{color:"#A3BE8C"},"string.escape":{color:"#EBCB8B"},"string.regex":{color:"#A3BE8C"},"string.special":{color:"#A3BE8C"},"string.special.symbol":{color:"#A3BE8C"},tag:{color:"#81A1C1"},"text.literal":{color:"#A3BE8C"},type:{color:"#8FBCBB"},variable:{color:"#D8DEE9"},"variable.special":{color:"#D8DEE9"},property:{color:"#88C0D0"},embedded:{color:"#d8dee9"},emphasis:{color:"#d8dee9",font_style:"italic"},label:{color:"#D8DEE9"},namespace:{color:"#8FBCBB"},predictive:{color:"#4C566A"},primary:{color:"#d8dee9"},selector:{color:"#81A1C1"},title:{color:"#88C0D0"},enum:{color:"#8FBCBB"},hint:{color:"#5e81ac"},link_text:{color:"#A3BE8C"},link_uri:{color:"#A3BE8C"},variant:{color:"#D8DEE9"},"diff.minus":{color:"#BF616A"},"diff.plus":{color:"#A3BE8C"},"emphasis.strong":{color:"#d8dee9",font_weight:700},"selector.class":{color:"#8FBCBB"},"selector.id":{color:"#8FBCBB"},"selector.pseudo":{color:"#8FBCBB"}}}},BE=Object.freeze(Object.defineProperty({__proto__:null,default:AE},Symbol.toStringTag,{value:"Module"})),QE={name:"One Dark Pro",appearance:"dark",style:{background:"#23272e",text:"#cdd3e0","editor.background":"#23272e","editor.foreground":"#abb2bf","editor.active_line.background":"#2c313c","editor.document_highlight.bracket_background":"#abb2bf30","search.match_background":"#d19a6644",players:[{cursor:"#74ade8ff",background:"#74ade8ff",selection:"#67769640"},{cursor:"#be5046ff",background:"#be5046ff",selection:"#be504640"},{cursor:"#bf956aff",background:"#bf956aff",selection:"#bf956a40"},{cursor:"#b477cfff",background:"#b477cfff",selection:"#b477cf40"},{cursor:"#6eb4bfff",background:"#6eb4bfff",selection:"#6eb4bf40"},{cursor:"#d07277ff",background:"#d07277ff",selection:"#d0727740"},{cursor:"#dec184ff",background:"#dec184ff",selection:"#dec18440"},{cursor:"#a1c181ff",background:"#a1c181ff",selection:"#a1c18140"}],error:"#c24038",warning:"#d19a66",hint:"#7a849c","terminal.ansi.black":"#3f4451","terminal.ansi.red":"#e05561","terminal.ansi.green":"#8cc265","terminal.ansi.yellow":"#d18f52","terminal.ansi.blue":"#4aa5f0","terminal.ansi.magenta":"#c162de","terminal.ansi.cyan":"#42b3c2","terminal.ansi.white":"#d7dae0","terminal.ansi.bright_black":"#4f5666","terminal.ansi.bright_red":"#ff616e","terminal.ansi.bright_green":"#a5e075","terminal.ansi.bright_yellow":"#f0a45d","terminal.ansi.bright_blue":"#4dc4ff","terminal.ansi.bright_magenta":"#de73ff","terminal.ansi.bright_cyan":"#4cd1e0","terminal.ansi.bright_white":"#e6e6e6",syntax:{comment:{color:"#7F838C"},"comment.doc":{color:"#7f848e"},attribute:{color:"#d19a66"},boolean:{color:"#d19a66"},constant:{color:"#d19a66"},constructor:{color:"#e06c75"},embedded:{color:"#abb2bf"},emphasis:{color:"#c678dd"},enum:{color:"#56b6c2"},function:{color:"#61afef"},keyword:{color:"#c678dd"},"keyword.operator":{color:"#c678dd"},link_text:{color:"#61afef"},link_uri:{color:"#61afef"},number:{color:"#d19a66"},operator:{color:"#abb2bf"},predictive:{color:"#4d5970",font_style:"italic"},property:{color:"#e06c75"},punctuation:{color:"#abb2bf"},"punctuation.list_marker":{color:"#d07277ff"},string:{color:"#98c379"},"string.escape":{color:"#56b6c2"},"string.regex":{color:"#e06c75"},"string.special":{color:"#e06c75"},"string.special.symbol":{color:"#e06c75"},tag:{color:"#e06c75"},"text.literal":{color:"#98c379"},title:{color:"#d07277ff"},type:{color:"#e5c07b"},variable:{color:"#e06c75"},"variable.special":{color:"#e5c07b"},variant:{color:"#61afef"},label:{color:"#E06C75"},namespace:{color:"#E5C07B"},preproc:{color:"#c678dd"},primary:{color:"#abb2bf"},selector:{color:"#E06C75"},hint:{color:"#7a849c"},"diff.minus":{color:"#E06C75"},"diff.plus":{color:"#98C379"},"selector.class":{color:"#D19A66"},"selector.id":{color:"#61AFEF"},"selector.pseudo":{color:"#56B6C2"}}}},EE=Object.freeze(Object.defineProperty({__proto__:null,default:QE},Symbol.toStringTag,{value:"Module"})),IE={name:"One Light",appearance:"light",style:{background:"#FAFAFA",text:"#383A42","editor.background":"#FAFAFA","editor.foreground":"#383A42","editor.active_line.background":"#383A420C","editor.document_highlight.bracket_background":"#526FFF3D","search.match_background":"#526FFF3D",players:[{cursor:"#526FFF",background:"#526FFF",selection:"#E5E5E6"},{cursor:"#50A14F",background:"#50A14F",selection:"#50A14F26"},{cursor:"#A626A4",background:"#A626A4",selection:"#A626A426"},{cursor:"#986801",background:"#986801",selection:"#98680126"},{cursor:"#E45649",background:"#E45649",selection:"#E4564926"},{cursor:"#0184BC",background:"#0184BC",selection:"#0184BC26"},{cursor:"#C18401",background:"#C18401",selection:"#C1840126"},{cursor:"#4078F2",background:"#4078F2",selection:"#4078F226"}],error:"#E45649",warning:"#C18401",info:"#4078F2",hint:"#9D9D9F","terminal.ansi.black":"#383A42","terminal.ansi.red":"#E45649","terminal.ansi.green":"#50A14F","terminal.ansi.yellow":"#C18401","terminal.ansi.blue":"#4078F2","terminal.ansi.magenta":"#A626A4","terminal.ansi.cyan":"#0184BC","terminal.ansi.white":"#FAFAFA","terminal.ansi.bright_black":"#696C77","terminal.ansi.bright_red":"#E45649","terminal.ansi.bright_green":"#50A14F","terminal.ansi.bright_yellow":"#C18401","terminal.ansi.bright_blue":"#4078F2","terminal.ansi.bright_magenta":"#A626A4","terminal.ansi.bright_cyan":"#0184BC","terminal.ansi.bright_white":"#FFFFFF",syntax:{attribute:{color:"#986801"},boolean:{color:"#986801"},comment:{color:"#A0A1A7",font_style:"italic"},"comment.doc":{color:"#A0A1A7",font_style:"italic"},constant:{color:"#986801"},constructor:{color:"#4078F2"},embedded:{color:"#383A42"},emphasis:{color:"#A626A4",font_style:"italic"},"emphasis.strong":{color:"#986801",font_weight:700},enum:{color:"#C18401"},function:{color:"#4078F2"},"function.method":{color:"#4078F2"},"function.special.definition":{color:"#4078F2"},hint:{color:"#9D9D9F"},keyword:{color:"#A626A4"},"keyword.operator":{color:"#A626A4"},label:{color:"#E45649"},link_text:{color:"#4078F2"},link_uri:{color:"#A626A4"},number:{color:"#986801"},operator:{color:"#0184BC"},predictive:{color:"#A0A1A7",font_style:"italic"},preproc:{color:"#A626A4"},primary:{color:"#383A42"},property:{color:"#E45649"},"property.json_key":{color:"#E45649"},punctuation:{color:"#383A42"},"punctuation.bracket":{color:"#383A42"},"punctuation.delimiter":{color:"#383A42"},"punctuation.list_marker":{color:"#E45649"},"punctuation.special":{color:"#CA1243"},string:{color:"#50A14F"},"string.escape":{color:"#0184BC"},"string.regex":{color:"#0184BC"},"string.special":{color:"#0184BC"},"string.special.symbol":{color:"#0184BC"},tag:{color:"#E45649"},"text.literal":{color:"#50A14F"},title:{color:"#E45649",font_weight:700},type:{color:"#C18401"},"type.builtin":{color:"#0184BC"},variable:{color:"#E45649"},"variable.builtin":{color:"#E45649"},"variable.parameter":{color:"#383A42"},"variable.special":{color:"#E45649"},variant:{color:"#C18401"},namespace:{color:"#C18401"},selector:{color:"#E45649"},"diff.minus":{color:"#E45649"},"diff.plus":{color:"#50A14F"},"selector.class":{color:"#986801"},"selector.id":{color:"#4078F2"},"selector.pseudo":{color:"#986801"}},created:"#587c0c",deleted:"#ad0707",modified:"#895503"}},oE=Object.freeze(Object.defineProperty({__proto__:null,default:IE},Symbol.toStringTag,{value:"Module"})),gE={name:"Pierre Dark",appearance:"dark",style:{background:"#171717",text:"#fafafa","editor.background":"#0a0a0a","editor.foreground":"#fafafa","editor.active_line.background":"#19283c8c",players:[{cursor:"#009fff",selection:"#009fff4d"}],created:"#07c480",deleted:"#ff2e3f",modified:"#009fff","terminal.ansi.black":"#171717","terminal.ansi.red":"#ff2e3f","terminal.ansi.green":"#0dbe4e","terminal.ansi.yellow":"#ffca00","terminal.ansi.blue":"#009fff","terminal.ansi.magenta":"#e130ac","terminal.ansi.cyan":"#08c0ef","terminal.ansi.white":"#bcbcbc","terminal.ansi.bright_black":"#171717","terminal.ansi.bright_red":"#ff2e3f","terminal.ansi.bright_green":"#86c427","terminal.ansi.bright_yellow":"#ffca00","terminal.ansi.bright_blue":"#009fff","terminal.ansi.bright_magenta":"#e130ac","terminal.ansi.bright_cyan":"#08c0ef","terminal.ansi.bright_white":"#bcbcbc",syntax:{comment:{color:"#737373"},"comment.doc":{color:"#737373"},string:{color:"#5ecc71"},"string.escape":{color:"#61d5c0"},"string.regex":{color:"#64d1db"},"string.special":{color:"#61d5c0"},"string.special.symbol":{color:"#ffd452"},number:{color:"#68cdf2"},constant:{color:"#ffd452"},boolean:{color:"#68cdf2"},keyword:{color:"#ff678d"},"keyword.operator":{color:"#08c0ef"},function:{color:"#9d6afb"},"function.method":{color:"#9d6afb"},"function.builtin":{color:"#9d6afb"},"function.special.definition":{color:"#9d6afb"},"function.call":{color:"#9d6afb"},type:{color:"#d568ea"},"type.builtin":{color:"#d568ea"},constructor:{color:"#d568ea"},variable:{color:"#ffa359"},"variable.builtin":{color:"#ffab16"},"variable.member":{color:"#ffa359"},"variable.parameter":{color:"#a3a3a3"},"variable.special":{color:"#ffab16"},property:{color:"#ffa359"},"property.css":{color:"#009fff"},"property.definition":{color:"#009fff"},property_name:{color:"#009fff"},value:{color:"#68cdf2"},"constant.css":{color:"#ffd452"},"string.plain":{color:"#68cdf2"},plain_value:{color:"#68cdf2"},"tag.css":{color:"#ff855e"},tag_name:{color:"#ff855e"},class:{color:"#60d199"},class_name:{color:"#60d199"},"selector.class":{color:"#60d199"},"selector.id":{color:"#9d6afb"},id_name:{color:"#9d6afb"},"selector.pseudo":{color:"#08c0ef"},pseudo_class_selector:{color:"#08c0ef"},pseudo_element_selector:{color:"#08c0ef"},"keyword.directive":{color:"#ff678d"},"keyword.control.at-rule":{color:"#ff678d"},at_keyword:{color:"#ff678d"},"variable.scss":{color:"#ffa359"},"variable.css":{color:"#ffa359"},"property.custom":{color:"#ffa359"},unit:{color:"#68cdf2"},"number.unit":{color:"#68cdf2"},color:{color:"#ffd452"},"constant.color":{color:"#ffd452"},"keyword.important":{color:"#ff678d"},"variable.language":{color:"#ffab16"},this:{color:"#ffab16"},self:{color:"#ffab16"},"type.class":{color:"#d568ea"},"property.object":{color:"#ffa359"},property_identifier:{color:"#ffa359"},shorthand_property_identifier:{color:"#ffa359"},shorthand_property_identifier_pattern:{color:"#ffa359"},method_definition:{color:"#9d6afb"},"function.method.call":{color:"#9d6afb"},"string.template":{color:"#5ecc71"},template_string:{color:"#5ecc71"},"tag.jsx":{color:"#ff855e"},"tag.component":{color:"#d568ea"},punctuation:{color:"#636363"},"punctuation.bracket":{color:"#636363"},"punctuation.delimiter":{color:"#636363"},"punctuation.list_marker":{color:"#636363"},"punctuation.special":{color:"#ff678d"},operator:{color:"#08c0ef"},tag:{color:"#ff855e"},attribute:{color:"#60d199"},label:{color:"#ffab16"},namespace:{color:"#ffab16"},decorator:{color:"#69b1ff"},"attribute.builtin":{color:"#69b1ff"},embedded:{color:"#fafafa"},preproc:{color:"#ff678d"},"text.literal":{color:"#5ecc71"},"markup.heading":{color:"#ff855e",font_weight:700},"markup.bold":{color:"#ffd452",font_weight:700},"markup.italic":{color:"#ff678d",font_style:"italic"},"markup.strikethrough":{color:"#737373"},"markup.link.url":{color:"#009fff"},"markup.link.text":{color:"#9d6afb"},"markup.quote":{color:"#737373",font_style:"italic"},"markup.list":{color:"#ff855e"},"markup.list.numbered":{color:"#ff855e"},"markup.list.unnumbered":{color:"#ff855e"},"markup.raw":{color:"#5ecc71"},"markup.raw.inline":{color:"#5ecc71"},"markup.raw.block":{color:"#5ecc71"},"diff.plus":{color:"#07c480"},"diff.minus":{color:"#ff2e3f"},"diff.delta":{color:"#ffca00"},link_text:{color:"#009fff"},link_uri:{color:"#ff678d"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},primary:{color:"#009fff"},title:{color:"#ff855e",font_weight:700},predictive:{color:"#636363",font_style:"italic"},selector:{color:"#ff855e"},enum:{color:"#d568ea"},hint:{color:"#737373"},variant:{color:"#ffd452"}}}},CE=Object.freeze(Object.defineProperty({__proto__:null,default:gE},Symbol.toStringTag,{value:"Module"})),iE={name:"Pierre Dark Protanopia & Deuteranopia",appearance:"dark",style:{background:"#171717",text:"#fafafa","editor.background":"#0a0a0a","editor.foreground":"#fafafa","editor.active_line.background":"#19283c8c",players:[{cursor:"#009fff",selection:"#009fff4d"}],created:"#97c4ff",deleted:"#fe8c2c",modified:"#009fff","terminal.ansi.black":"#171717","terminal.ansi.red":"#ffa359","terminal.ansi.green":"#69b1ff","terminal.ansi.yellow":"#ffd452","terminal.ansi.blue":"#009fff","terminal.ansi.magenta":"#b969f3","terminal.ansi.cyan":"#68cdf2","terminal.ansi.white":"#bcbcbc","terminal.ansi.bright_black":"#171717","terminal.ansi.bright_red":"#ffba82","terminal.ansi.bright_green":"#97c4ff","terminal.ansi.bright_yellow":"#ffde80","terminal.ansi.bright_blue":"#69b1ff","terminal.ansi.bright_magenta":"#ce90f7","terminal.ansi.bright_cyan":"#96d9f6","terminal.ansi.bright_white":"#bcbcbc",syntax:{comment:{color:"#737373"},"comment.doc":{color:"#737373"},string:{color:"#97c4ff"},"string.escape":{color:"#64d1db"},"string.regex":{color:"#68cdf2"},"string.special":{color:"#64d1db"},"string.special.symbol":{color:"#ffcc81"},number:{color:"#96d9f6"},constant:{color:"#ffcc81"},boolean:{color:"#96d9f6"},keyword:{color:"#b969f3"},"keyword.operator":{color:"#08c0ef"},function:{color:"#ba8ffd"},"function.method":{color:"#ba8ffd"},"function.builtin":{color:"#ba8ffd"},"function.special.definition":{color:"#ba8ffd"},"function.call":{color:"#ba8ffd"},type:{color:"#e290f0"},"type.builtin":{color:"#e290f0"},constructor:{color:"#e290f0"},variable:{color:"#ffa359"},"variable.builtin":{color:"#ffbc56"},"variable.member":{color:"#ffa359"},"variable.parameter":{color:"#a3a3a3"},"variable.special":{color:"#ffbc56"},property:{color:"#ffa359"},"property.css":{color:"#009fff"},"property.definition":{color:"#009fff"},property_name:{color:"#009fff"},value:{color:"#96d9f6"},"constant.css":{color:"#ffcc81"},"string.plain":{color:"#96d9f6"},plain_value:{color:"#96d9f6"},"tag.css":{color:"#ffa359"},tag_name:{color:"#ffa359"},class:{color:"#ffbc56"},class_name:{color:"#ffbc56"},"selector.class":{color:"#ffbc56"},"selector.id":{color:"#ba8ffd"},id_name:{color:"#ba8ffd"},"selector.pseudo":{color:"#08c0ef"},pseudo_class_selector:{color:"#08c0ef"},pseudo_element_selector:{color:"#08c0ef"},"keyword.directive":{color:"#b969f3"},"keyword.control.at-rule":{color:"#b969f3"},at_keyword:{color:"#b969f3"},"variable.scss":{color:"#ffa359"},"variable.css":{color:"#ffa359"},"property.custom":{color:"#ffa359"},unit:{color:"#96d9f6"},"number.unit":{color:"#96d9f6"},color:{color:"#ffcc81"},"constant.color":{color:"#ffcc81"},"keyword.important":{color:"#b969f3"},"variable.language":{color:"#ffbc56"},this:{color:"#ffbc56"},self:{color:"#ffbc56"},"type.class":{color:"#e290f0"},"property.object":{color:"#ffa359"},property_identifier:{color:"#ffa359"},shorthand_property_identifier:{color:"#ffa359"},shorthand_property_identifier_pattern:{color:"#ffa359"},method_definition:{color:"#ba8ffd"},"function.method.call":{color:"#ba8ffd"},"string.template":{color:"#97c4ff"},template_string:{color:"#97c4ff"},"tag.jsx":{color:"#ffa359"},"tag.component":{color:"#e290f0"},punctuation:{color:"#636363"},"punctuation.bracket":{color:"#636363"},"punctuation.delimiter":{color:"#636363"},"punctuation.list_marker":{color:"#636363"},"punctuation.special":{color:"#b969f3"},operator:{color:"#08c0ef"},tag:{color:"#ffa359"},attribute:{color:"#ffbc56"},label:{color:"#ffbc56"},namespace:{color:"#ffbc56"},decorator:{color:"#69b1ff"},"attribute.builtin":{color:"#69b1ff"},embedded:{color:"#fafafa"},preproc:{color:"#b969f3"},"text.literal":{color:"#97c4ff"},"markup.heading":{color:"#ffa359",font_weight:700},"markup.bold":{color:"#ffcc81",font_weight:700},"markup.italic":{color:"#b969f3",font_style:"italic"},"markup.strikethrough":{color:"#737373"},"markup.link.url":{color:"#009fff"},"markup.link.text":{color:"#ba8ffd"},"markup.quote":{color:"#737373",font_style:"italic"},"markup.list":{color:"#ffa359"},"markup.list.numbered":{color:"#ffa359"},"markup.list.unnumbered":{color:"#ffa359"},"markup.raw":{color:"#97c4ff"},"markup.raw.inline":{color:"#97c4ff"},"markup.raw.block":{color:"#97c4ff"},"diff.plus":{color:"#97c4ff"},"diff.minus":{color:"#fe8c2c"},"diff.delta":{color:"#ffde80"},link_text:{color:"#009fff"},link_uri:{color:"#b969f3"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},primary:{color:"#009fff"},title:{color:"#ffa359",font_weight:700},predictive:{color:"#636363",font_style:"italic"},selector:{color:"#ffa359"},enum:{color:"#e290f0"},hint:{color:"#737373"},variant:{color:"#ffcc81"}}}},cE=Object.freeze(Object.defineProperty({__proto__:null,default:iE},Symbol.toStringTag,{value:"Module"})),eE={name:"Pierre Dark Soft",appearance:"dark",style:{background:"#101010",text:"#d4d4d4","editor.background":"#171717","editor.foreground":"#d4d4d4","editor.active_line.background":"#1f3e5e8c",players:[{cursor:"#69b1ff",selection:"#69b1ff4d"}],created:"#60d199",deleted:"#ff6762",modified:"#69b1ff","terminal.ansi.black":"#171717","terminal.ansi.red":"#ff2e3f","terminal.ansi.green":"#0dbe4e","terminal.ansi.yellow":"#ffca00","terminal.ansi.blue":"#009fff","terminal.ansi.magenta":"#e130ac","terminal.ansi.cyan":"#08c0ef","terminal.ansi.white":"#bcbcbc","terminal.ansi.bright_black":"#171717","terminal.ansi.bright_red":"#ff2e3f","terminal.ansi.bright_green":"#86c427","terminal.ansi.bright_yellow":"#ffca00","terminal.ansi.bright_blue":"#009fff","terminal.ansi.bright_magenta":"#e130ac","terminal.ansi.bright_cyan":"#08c0ef","terminal.ansi.bright_white":"#bcbcbc",syntax:{comment:{color:"#636363"},"comment.doc":{color:"#636363"},string:{color:"#8cda94"},"string.escape":{color:"#8fe0d0"},"string.regex":{color:"#92dde4"},"string.special":{color:"#8fe0d0"},"string.special.symbol":{color:"#ffde80"},number:{color:"#96d9f6"},constant:{color:"#ffde80"},boolean:{color:"#96d9f6"},keyword:{color:"#ff91a8"},"keyword.operator":{color:"#68cdf2"},function:{color:"#ba8ffd"},"function.method":{color:"#ba8ffd"},"function.builtin":{color:"#ba8ffd"},"function.special.definition":{color:"#ba8ffd"},"function.call":{color:"#ba8ffd"},type:{color:"#e290f0"},"type.builtin":{color:"#e290f0"},constructor:{color:"#e290f0"},variable:{color:"#ffba82"},"variable.builtin":{color:"#ffbc56"},"variable.member":{color:"#ffba82"},"variable.parameter":{color:"#8a8a8a"},"variable.special":{color:"#ffbc56"},property:{color:"#ffba82"},"property.css":{color:"#69b1ff"},"property.definition":{color:"#69b1ff"},property_name:{color:"#69b1ff"},value:{color:"#96d9f6"},"constant.css":{color:"#ffde80"},"string.plain":{color:"#96d9f6"},plain_value:{color:"#96d9f6"},"tag.css":{color:"#ffa685"},tag_name:{color:"#ffa685"},class:{color:"#8eddb2"},class_name:{color:"#8eddb2"},"selector.class":{color:"#8eddb2"},"selector.id":{color:"#ba8ffd"},id_name:{color:"#ba8ffd"},"selector.pseudo":{color:"#68cdf2"},pseudo_class_selector:{color:"#68cdf2"},pseudo_element_selector:{color:"#68cdf2"},"keyword.directive":{color:"#ff91a8"},"keyword.control.at-rule":{color:"#ff91a8"},at_keyword:{color:"#ff91a8"},"variable.scss":{color:"#ffba82"},"variable.css":{color:"#ffba82"},"property.custom":{color:"#ffba82"},unit:{color:"#96d9f6"},"number.unit":{color:"#96d9f6"},color:{color:"#ffde80"},"constant.color":{color:"#ffde80"},"keyword.important":{color:"#ff91a8"},"variable.language":{color:"#ffbc56"},this:{color:"#ffbc56"},self:{color:"#ffbc56"},"type.class":{color:"#e290f0"},"property.object":{color:"#ffba82"},property_identifier:{color:"#ffba82"},shorthand_property_identifier:{color:"#ffba82"},shorthand_property_identifier_pattern:{color:"#ffba82"},method_definition:{color:"#ba8ffd"},"function.method.call":{color:"#ba8ffd"},"string.template":{color:"#8cda94"},template_string:{color:"#8cda94"},"tag.jsx":{color:"#ffa685"},"tag.component":{color:"#e290f0"},punctuation:{color:"#737373"},"punctuation.bracket":{color:"#737373"},"punctuation.delimiter":{color:"#737373"},"punctuation.list_marker":{color:"#737373"},"punctuation.special":{color:"#ff91a8"},operator:{color:"#68cdf2"},tag:{color:"#ffa685"},attribute:{color:"#8eddb2"},label:{color:"#ffbc56"},namespace:{color:"#ffbc56"},decorator:{color:"#97c4ff"},"attribute.builtin":{color:"#97c4ff"},embedded:{color:"#d4d4d4"},preproc:{color:"#ff91a8"},"text.literal":{color:"#8cda94"},"markup.heading":{color:"#ffa685",font_weight:700},"markup.bold":{color:"#ffde80",font_weight:700},"markup.italic":{color:"#ff91a8",font_style:"italic"},"markup.strikethrough":{color:"#636363"},"markup.link.url":{color:"#69b1ff"},"markup.link.text":{color:"#ba8ffd"},"markup.quote":{color:"#636363",font_style:"italic"},"markup.list":{color:"#ffa685"},"markup.list.numbered":{color:"#ffa685"},"markup.list.unnumbered":{color:"#ffa685"},"markup.raw":{color:"#8cda94"},"markup.raw.inline":{color:"#8cda94"},"markup.raw.block":{color:"#8cda94"},"diff.plus":{color:"#60d199"},"diff.minus":{color:"#ff6762"},"diff.delta":{color:"#ffd452"},link_text:{color:"#69b1ff"},link_uri:{color:"#ff91a8"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},primary:{color:"#69b1ff"},title:{color:"#ffa685",font_weight:700},predictive:{color:"#525252",font_style:"italic"},selector:{color:"#ffa685"},enum:{color:"#e290f0"},hint:{color:"#636363"},variant:{color:"#ffde80"}}}},rE=Object.freeze(Object.defineProperty({__proto__:null,default:eE},Symbol.toStringTag,{value:"Module"})),tE={name:"Pierre Dark Tritanopia",appearance:"dark",style:{background:"#171717",text:"#fafafa","editor.background":"#0a0a0a","editor.foreground":"#fafafa","editor.active_line.background":"#19283c8c",players:[{cursor:"#009fff",selection:"#009fff4d"}],created:"#92dde4",deleted:"#ff855e",modified:"#009fff","terminal.ansi.black":"#171717","terminal.ansi.red":"#ff855e","terminal.ansi.green":"#64d1db","terminal.ansi.yellow":"#ffbc56","terminal.ansi.blue":"#69b1ff","terminal.ansi.magenta":"#ea68bc","terminal.ansi.cyan":"#92dde4","terminal.ansi.white":"#bcbcbc","terminal.ansi.bright_black":"#171717","terminal.ansi.bright_red":"#ffa685","terminal.ansi.bright_green":"#92dde4","terminal.ansi.bright_yellow":"#ffcc81","terminal.ansi.bright_blue":"#97c4ff","terminal.ansi.bright_magenta":"#f191cc","terminal.ansi.bright_cyan":"#92dde4","terminal.ansi.bright_white":"#bcbcbc",syntax:{comment:{color:"#737373"},"comment.doc":{color:"#737373"},string:{color:"#92dde4"},"string.escape":{color:"#64d1db"},"string.regex":{color:"#64d1db"},"string.special":{color:"#64d1db"},"string.special.symbol":{color:"#ffcc81"},number:{color:"#69b1ff"},constant:{color:"#ffcc81"},boolean:{color:"#69b1ff"},keyword:{color:"#d568ea"},"keyword.operator":{color:"#00c5d2"},function:{color:"#97c4ff"},"function.method":{color:"#97c4ff"},"function.builtin":{color:"#97c4ff"},"function.special.definition":{color:"#97c4ff"},"function.call":{color:"#97c4ff"},type:{color:"#ea68bc"},"type.builtin":{color:"#ea68bc"},constructor:{color:"#ea68bc"},variable:{color:"#ff855e"},"variable.builtin":{color:"#ff855e"},"variable.member":{color:"#ff855e"},"variable.parameter":{color:"#a3a3a3"},"variable.special":{color:"#ff855e"},property:{color:"#ff855e"},"property.css":{color:"#009fff"},"property.definition":{color:"#009fff"},property_name:{color:"#009fff"},value:{color:"#69b1ff"},"constant.css":{color:"#ffcc81"},"string.plain":{color:"#69b1ff"},plain_value:{color:"#69b1ff"},"tag.css":{color:"#ff855e"},tag_name:{color:"#ff855e"},class:{color:"#64d1db"},class_name:{color:"#64d1db"},"selector.class":{color:"#64d1db"},"selector.id":{color:"#97c4ff"},id_name:{color:"#97c4ff"},"selector.pseudo":{color:"#00c5d2"},pseudo_class_selector:{color:"#00c5d2"},pseudo_element_selector:{color:"#00c5d2"},"keyword.directive":{color:"#d568ea"},"keyword.control.at-rule":{color:"#d568ea"},at_keyword:{color:"#d568ea"},"variable.scss":{color:"#ff855e"},"variable.css":{color:"#ff855e"},"property.custom":{color:"#ff855e"},unit:{color:"#69b1ff"},"number.unit":{color:"#69b1ff"},color:{color:"#ffcc81"},"constant.color":{color:"#ffcc81"},"keyword.important":{color:"#d568ea"},"variable.language":{color:"#ff855e"},this:{color:"#ff855e"},self:{color:"#ff855e"},"type.class":{color:"#ea68bc"},"property.object":{color:"#ff855e"},property_identifier:{color:"#ff855e"},shorthand_property_identifier:{color:"#ff855e"},shorthand_property_identifier_pattern:{color:"#ff855e"},method_definition:{color:"#97c4ff"},"function.method.call":{color:"#97c4ff"},"string.template":{color:"#92dde4"},template_string:{color:"#92dde4"},"tag.jsx":{color:"#ff855e"},"tag.component":{color:"#ea68bc"},punctuation:{color:"#636363"},"punctuation.bracket":{color:"#636363"},"punctuation.delimiter":{color:"#636363"},"punctuation.list_marker":{color:"#636363"},"punctuation.special":{color:"#d568ea"},operator:{color:"#00c5d2"},tag:{color:"#ff855e"},attribute:{color:"#64d1db"},label:{color:"#ff855e"},namespace:{color:"#ff855e"},decorator:{color:"#69b1ff"},"attribute.builtin":{color:"#69b1ff"},embedded:{color:"#fafafa"},preproc:{color:"#d568ea"},"text.literal":{color:"#92dde4"},"markup.heading":{color:"#ff855e",font_weight:700},"markup.bold":{color:"#ffcc81",font_weight:700},"markup.italic":{color:"#d568ea",font_style:"italic"},"markup.strikethrough":{color:"#737373"},"markup.link.url":{color:"#009fff"},"markup.link.text":{color:"#97c4ff"},"markup.quote":{color:"#737373",font_style:"italic"},"markup.list":{color:"#ff855e"},"markup.list.numbered":{color:"#ff855e"},"markup.list.unnumbered":{color:"#ff855e"},"markup.raw":{color:"#92dde4"},"markup.raw.inline":{color:"#92dde4"},"markup.raw.block":{color:"#92dde4"},"diff.plus":{color:"#92dde4"},"diff.minus":{color:"#ff855e"},"diff.delta":{color:"#ffbc56"},link_text:{color:"#009fff"},link_uri:{color:"#d568ea"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},primary:{color:"#009fff"},title:{color:"#ff855e",font_weight:700},predictive:{color:"#636363",font_style:"italic"},selector:{color:"#ff855e"},enum:{color:"#ea68bc"},hint:{color:"#737373"},variant:{color:"#ffcc81"}}}},aE=Object.freeze(Object.defineProperty({__proto__:null,default:tE},Symbol.toStringTag,{value:"Module"})),lE={name:"Pierre Dark Vibrant",appearance:"dark",style:{background:"color(display-p3 0.090196 0.090196 0.090196)",text:"color(display-p3 0.980392 0.980392 0.980392)","editor.background":"color(display-p3 0.039216 0.039216 0.039216)","editor.foreground":"color(display-p3 0.980392 0.980392 0.980392)","editor.active_line.background":"color(display-p3 0.098734 0.152326 0.240886 / 0.550000)",players:[{cursor:"color(display-p3 0.308664 0.645271 1.000000)",selection:"color(display-p3 0.308664 0.645271 1.000000 / 0.250000)"}],created:"color(display-p3 0.304148 0.801790 0.517191)",deleted:"color(display-p3 1.000000 0.250216 0.262337)",modified:"color(display-p3 0.308664 0.645271 1.000000)","terminal.ansi.black":"color(display-p3 0.090196 0.090196 0.090196)","terminal.ansi.red":"color(display-p3 1.000000 0.250216 0.262337)","terminal.ansi.green":"color(display-p3 0.298067 0.776115 0.322484)","terminal.ansi.yellow":"color(display-p3 1.000000 0.832068 0.300621)","terminal.ansi.blue":"color(display-p3 0.308664 0.645271 1.000000)","terminal.ansi.magenta":"color(display-p3 0.885558 0.236588 0.705659)","terminal.ansi.cyan":"color(display-p3 0.327292 0.790977 0.995660)","terminal.ansi.white":"color(display-p3 0.737255 0.737255 0.737255)","terminal.ansi.bright_black":"color(display-p3 0.090196 0.090196 0.090196)","terminal.ansi.bright_red":"color(display-p3 1.000000 0.250216 0.262337)","terminal.ansi.bright_green":"color(display-p3 0.613906 0.826741 0.264677)","terminal.ansi.bright_yellow":"color(display-p3 1.000000 0.832068 0.300621)","terminal.ansi.bright_blue":"color(display-p3 0.308664 0.645271 1.000000)","terminal.ansi.bright_magenta":"color(display-p3 0.885558 0.236588 0.705659)","terminal.ansi.bright_cyan":"color(display-p3 0.327292 0.790977 0.995660)","terminal.ansi.bright_white":"color(display-p3 0.737255 0.737255 0.737255)",syntax:{comment:{color:"color(display-p3 0.450980 0.450980 0.450980)"},"comment.doc":{color:"color(display-p3 0.450980 0.450980 0.450980)"},string:{color:"color(display-p3 0.451324 0.823458 0.446819)"},"string.escape":{color:"color(display-p3 0.466798 0.860904 0.775090)"},"string.regex":{color:"color(display-p3 0.520590 0.857139 0.902107)"},"string.special":{color:"color(display-p3 0.466798 0.860904 0.775090)"},"string.special.symbol":{color:"color(display-p3 1.000000 0.868456 0.454295)"},number:{color:"color(display-p3 0.452682 0.814110 0.989434)"},constant:{color:"color(display-p3 1.000000 0.868456 0.454295)"},boolean:{color:"color(display-p3 0.452682 0.814110 0.989434)"},keyword:{color:"color(display-p3 0.994741 0.445201 0.573499)"},"keyword.operator":{color:"color(display-p3 0.327292 0.790977 0.995660)"},function:{color:"color(display-p3 0.615613 0.445256 1.000000)"},"function.method":{color:"color(display-p3 0.615613 0.445256 1.000000)"},"function.builtin":{color:"color(display-p3 0.615613 0.445256 1.000000)"},"function.special.definition":{color:"color(display-p3 0.615613 0.445256 1.000000)"},"function.call":{color:"color(display-p3 0.615613 0.445256 1.000000)"},type:{color:"color(display-p3 0.829375 0.434619 0.954315)"},"type.builtin":{color:"color(display-p3 0.829375 0.434619 0.954315)"},constructor:{color:"color(display-p3 0.829375 0.434619 0.954315)"},variable:{color:"color(display-p3 1.000000 0.688063 0.418777)"},"variable.builtin":{color:"color(display-p3 1.000000 0.719280 0.270071)"},"variable.member":{color:"color(display-p3 1.000000 0.688063 0.418777)"},"variable.parameter":{color:"color(display-p3 0.639216 0.639216 0.639216)"},"variable.special":{color:"color(display-p3 1.000000 0.719280 0.270071)"},property:{color:"color(display-p3 1.000000 0.688063 0.418777)"},"property.css":{color:"color(display-p3 0.308664 0.645271 1.000000)"},"property.definition":{color:"color(display-p3 0.308664 0.645271 1.000000)"},property_name:{color:"color(display-p3 0.308664 0.645271 1.000000)"},value:{color:"color(display-p3 0.452682 0.814110 0.989434)"},"constant.css":{color:"color(display-p3 1.000000 0.868456 0.454295)"},"string.plain":{color:"color(display-p3 0.452682 0.814110 0.989434)"},plain_value:{color:"color(display-p3 0.452682 0.814110 0.989434)"},"tag.css":{color:"color(display-p3 1.000000 0.566977 0.409224)"},tag_name:{color:"color(display-p3 1.000000 0.566977 0.409224)"},class:{color:"color(display-p3 0.460672 0.843934 0.608755)"},class_name:{color:"color(display-p3 0.460672 0.843934 0.608755)"},"selector.class":{color:"color(display-p3 0.460672 0.843934 0.608755)"},"selector.id":{color:"color(display-p3 0.615613 0.445256 1.000000)"},id_name:{color:"color(display-p3 0.615613 0.445256 1.000000)"},"selector.pseudo":{color:"color(display-p3 0.327292 0.790977 0.995660)"},pseudo_class_selector:{color:"color(display-p3 0.327292 0.790977 0.995660)"},pseudo_element_selector:{color:"color(display-p3 0.327292 0.790977 0.995660)"},"keyword.directive":{color:"color(display-p3 0.994741 0.445201 0.573499)"},"keyword.control.at-rule":{color:"color(display-p3 0.994741 0.445201 0.573499)"},at_keyword:{color:"color(display-p3 0.994741 0.445201 0.573499)"},"variable.scss":{color:"color(display-p3 1.000000 0.688063 0.418777)"},"variable.css":{color:"color(display-p3 1.000000 0.688063 0.418777)"},"property.custom":{color:"color(display-p3 1.000000 0.688063 0.418777)"},unit:{color:"color(display-p3 0.452682 0.814110 0.989434)"},"number.unit":{color:"color(display-p3 0.452682 0.814110 0.989434)"},color:{color:"color(display-p3 1.000000 0.868456 0.454295)"},"constant.color":{color:"color(display-p3 1.000000 0.868456 0.454295)"},"keyword.important":{color:"color(display-p3 0.994741 0.445201 0.573499)"},"variable.language":{color:"color(display-p3 1.000000 0.719280 0.270071)"},this:{color:"color(display-p3 1.000000 0.719280 0.270071)"},self:{color:"color(display-p3 1.000000 0.719280 0.270071)"},"type.class":{color:"color(display-p3 0.829375 0.434619 0.954315)"},"property.object":{color:"color(display-p3 1.000000 0.688063 0.418777)"},property_identifier:{color:"color(display-p3 1.000000 0.688063 0.418777)"},shorthand_property_identifier:{color:"color(display-p3 1.000000 0.688063 0.418777)"},shorthand_property_identifier_pattern:{color:"color(display-p3 1.000000 0.688063 0.418777)"},method_definition:{color:"color(display-p3 0.615613 0.445256 1.000000)"},"function.method.call":{color:"color(display-p3 0.615613 0.445256 1.000000)"},"string.template":{color:"color(display-p3 0.451324 0.823458 0.446819)"},template_string:{color:"color(display-p3 0.451324 0.823458 0.446819)"},"tag.jsx":{color:"color(display-p3 1.000000 0.566977 0.409224)"},"tag.component":{color:"color(display-p3 0.829375 0.434619 0.954315)"},punctuation:{color:"color(display-p3 0.388235 0.388235 0.388235)"},"punctuation.bracket":{color:"color(display-p3 0.388235 0.388235 0.388235)"},"punctuation.delimiter":{color:"color(display-p3 0.388235 0.388235 0.388235)"},"punctuation.list_marker":{color:"color(display-p3 0.388235 0.388235 0.388235)"},"punctuation.special":{color:"color(display-p3 0.994741 0.445201 0.573499)"},operator:{color:"color(display-p3 0.327292 0.790977 0.995660)"},tag:{color:"color(display-p3 1.000000 0.566977 0.409224)"},attribute:{color:"color(display-p3 0.460672 0.843934 0.608755)"},label:{color:"color(display-p3 1.000000 0.719280 0.270071)"},namespace:{color:"color(display-p3 1.000000 0.719280 0.270071)"},decorator:{color:"color(display-p3 0.453315 0.683106 1.000000)"},"attribute.builtin":{color:"color(display-p3 0.453315 0.683106 1.000000)"},embedded:{color:"color(display-p3 0.980392 0.980392 0.980392)"},preproc:{color:"color(display-p3 0.994741 0.445201 0.573499)"},"text.literal":{color:"color(display-p3 0.451324 0.823458 0.446819)"},"markup.heading":{color:"color(display-p3 1.000000 0.566977 0.409224)",font_weight:700},"markup.bold":{color:"color(display-p3 1.000000 0.868456 0.454295)",font_weight:700},"markup.italic":{color:"color(display-p3 0.994741 0.445201 0.573499)",font_style:"italic"},"markup.strikethrough":{color:"color(display-p3 0.450980 0.450980 0.450980)"},"markup.link.url":{color:"color(display-p3 0.308664 0.645271 1.000000)"},"markup.link.text":{color:"color(display-p3 0.615613 0.445256 1.000000)"},"markup.quote":{color:"color(display-p3 0.450980 0.450980 0.450980)",font_style:"italic"},"markup.list":{color:"color(display-p3 1.000000 0.566977 0.409224)"},"markup.list.numbered":{color:"color(display-p3 1.000000 0.566977 0.409224)"},"markup.list.unnumbered":{color:"color(display-p3 1.000000 0.566977 0.409224)"},"markup.raw":{color:"color(display-p3 0.451324 0.823458 0.446819)"},"markup.raw.inline":{color:"color(display-p3 0.451324 0.823458 0.446819)"},"markup.raw.block":{color:"color(display-p3 0.451324 0.823458 0.446819)"},"diff.plus":{color:"color(display-p3 0.304148 0.801790 0.517191)"},"diff.minus":{color:"color(display-p3 1.000000 0.250216 0.262337)"},"diff.delta":{color:"color(display-p3 1.000000 0.832068 0.300621)"},link_text:{color:"color(display-p3 0.308664 0.645271 1.000000)"},link_uri:{color:"color(display-p3 0.994741 0.445201 0.573499)"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},primary:{color:"color(display-p3 0.308664 0.645271 1.000000)"},title:{color:"color(display-p3 1.000000 0.566977 0.409224)",font_weight:700},predictive:{color:"color(display-p3 0.388235 0.388235 0.388235)",font_style:"italic"},selector:{color:"color(display-p3 1.000000 0.566977 0.409224)"},enum:{color:"color(display-p3 0.829375 0.434619 0.954315)"},hint:{color:"color(display-p3 0.450980 0.450980 0.450980)"},variant:{color:"color(display-p3 1.000000 0.868456 0.454295)"}}}},nE=Object.freeze(Object.defineProperty({__proto__:null,default:lE},Symbol.toStringTag,{value:"Module"})),sE={name:"Pierre Light",appearance:"light",style:{background:"#f5f5f5",text:"#0a0a0a","editor.background":"#ffffff","editor.foreground":"#0a0a0a","editor.active_line.background":"#dfebff8c",players:[{cursor:"#009fff",selection:"#009fff2e"}],created:"#18a46c",deleted:"#d52c36",modified:"#009fff","terminal.ansi.black":"#1d1d1d","terminal.ansi.red":"#d52c36","terminal.ansi.green":"#18a46c","terminal.ansi.yellow":"#d5a910","terminal.ansi.blue":"#1a85d4","terminal.ansi.magenta":"#bd2e90","terminal.ansi.cyan":"#1ca1c7","terminal.ansi.white":"#bcbcbc","terminal.ansi.bright_black":"#1d1d1d","terminal.ansi.bright_red":"#d52c36","terminal.ansi.bright_green":"#77a42a","terminal.ansi.bright_yellow":"#d5a910","terminal.ansi.bright_blue":"#1a85d4","terminal.ansi.bright_magenta":"#bd2e90","terminal.ansi.bright_cyan":"#1ca1c7","terminal.ansi.bright_white":"#bcbcbc",syntax:{comment:{color:"#737373"},"comment.doc":{color:"#737373"},string:{color:"#199f43"},"string.escape":{color:"#16a994"},"string.regex":{color:"#17a5af"},"string.special":{color:"#16a994"},"string.special.symbol":{color:"#d5a910"},number:{color:"#1ca1c7"},constant:{color:"#d5a910"},boolean:{color:"#1ca1c7"},keyword:{color:"#d32a61"},"keyword.operator":{color:"#08c0ef"},function:{color:"#693acf"},"function.method":{color:"#693acf"},"function.builtin":{color:"#693acf"},"function.special.definition":{color:"#693acf"},"function.call":{color:"#693acf"},type:{color:"#a631be"},"type.builtin":{color:"#a631be"},constructor:{color:"#a631be"},variable:{color:"#d47628"},"variable.builtin":{color:"#d5901c"},"variable.member":{color:"#d47628"},"variable.parameter":{color:"#636363"},"variable.special":{color:"#d5901c"},property:{color:"#d47628"},"property.css":{color:"#009fff"},"property.definition":{color:"#009fff"},property_name:{color:"#009fff"},value:{color:"#1ca1c7"},"constant.css":{color:"#d5a910"},"string.plain":{color:"#1ca1c7"},plain_value:{color:"#1ca1c7"},"tag.css":{color:"#d5512f"},tag_name:{color:"#d5512f"},class:{color:"#18a46c"},class_name:{color:"#18a46c"},"selector.class":{color:"#18a46c"},"selector.id":{color:"#693acf"},id_name:{color:"#693acf"},"selector.pseudo":{color:"#08c0ef"},pseudo_class_selector:{color:"#08c0ef"},pseudo_element_selector:{color:"#08c0ef"},"keyword.directive":{color:"#d32a61"},"keyword.control.at-rule":{color:"#d32a61"},at_keyword:{color:"#d32a61"},"variable.scss":{color:"#d47628"},"variable.css":{color:"#d47628"},"property.custom":{color:"#d47628"},unit:{color:"#1ca1c7"},"number.unit":{color:"#1ca1c7"},color:{color:"#d5a910"},"constant.color":{color:"#d5a910"},"keyword.important":{color:"#d32a61"},"variable.language":{color:"#d5901c"},this:{color:"#d5901c"},self:{color:"#d5901c"},"type.class":{color:"#a631be"},"property.object":{color:"#d47628"},property_identifier:{color:"#d47628"},shorthand_property_identifier:{color:"#d47628"},shorthand_property_identifier_pattern:{color:"#d47628"},method_definition:{color:"#693acf"},"function.method.call":{color:"#693acf"},"string.template":{color:"#199f43"},template_string:{color:"#199f43"},"tag.jsx":{color:"#d5512f"},"tag.component":{color:"#a631be"},punctuation:{color:"#636363"},"punctuation.bracket":{color:"#636363"},"punctuation.delimiter":{color:"#636363"},"punctuation.list_marker":{color:"#636363"},"punctuation.special":{color:"#d32a61"},operator:{color:"#08c0ef"},tag:{color:"#d5512f"},attribute:{color:"#18a46c"},label:{color:"#d5901c"},namespace:{color:"#d5901c"},decorator:{color:"#1a85d4"},"attribute.builtin":{color:"#1a85d4"},embedded:{color:"#0a0a0a"},preproc:{color:"#d32a61"},"text.literal":{color:"#199f43"},"markup.heading":{color:"#d5512f",font_weight:700},"markup.bold":{color:"#d5a910",font_weight:700},"markup.italic":{color:"#d32a61",font_style:"italic"},"markup.strikethrough":{color:"#737373"},"markup.link.url":{color:"#009fff"},"markup.link.text":{color:"#693acf"},"markup.quote":{color:"#737373",font_style:"italic"},"markup.list":{color:"#d5512f"},"markup.list.numbered":{color:"#d5512f"},"markup.list.unnumbered":{color:"#d5512f"},"markup.raw":{color:"#199f43"},"markup.raw.inline":{color:"#199f43"},"markup.raw.block":{color:"#199f43"},"diff.plus":{color:"#18a46c"},"diff.minus":{color:"#d52c36"},"diff.delta":{color:"#d5a910"},link_text:{color:"#009fff"},link_uri:{color:"#d32a61"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},primary:{color:"#009fff"},title:{color:"#d5512f",font_weight:700},predictive:{color:"#8a8a8a",font_style:"italic"},selector:{color:"#d5512f"},enum:{color:"#a631be"},hint:{color:"#737373"},variant:{color:"#d5a910"}}}},fE=Object.freeze(Object.defineProperty({__proto__:null,default:sE},Symbol.toStringTag,{value:"Module"})),wE={name:"Pierre Light Protanopia & Deuteranopia",appearance:"light",style:{background:"#f5f5f5",text:"#0a0a0a","editor.background":"#ffffff","editor.foreground":"#0a0a0a","editor.active_line.background":"#dfebff8c",players:[{cursor:"#009fff",selection:"#009fff2e"}],created:"#216cab",deleted:"#ac6023",modified:"#009fff","terminal.ansi.black":"#1d1d1d","terminal.ansi.red":"#ac6023","terminal.ansi.green":"#216cab","terminal.ansi.yellow":"#ffca00","terminal.ansi.blue":"#1a85d4","terminal.ansi.magenta":"#8836c7","terminal.ansi.cyan":"#2182a1","terminal.ansi.white":"#bcbcbc","terminal.ansi.bright_black":"#1d1d1d","terminal.ansi.bright_red":"#d47628","terminal.ansi.bright_green":"#1a85d4","terminal.ansi.bright_yellow":"#ffca00","terminal.ansi.bright_blue":"#009fff","terminal.ansi.bright_magenta":"#a13cee","terminal.ansi.bright_cyan":"#1ca1c7","terminal.ansi.bright_white":"#bcbcbc",syntax:{comment:{color:"#737373"},"comment.doc":{color:"#737373"},string:{color:"#215584"},"string.escape":{color:"#1e858e"},"string.regex":{color:"#2182a1"},"string.special":{color:"#1e858e"},"string.special.symbol":{color:"#ac741d"},number:{color:"#2182a1"},constant:{color:"#ac741d"},boolean:{color:"#2182a1"},keyword:{color:"#8836c7"},"keyword.operator":{color:"#2182a1"},function:{color:"#5731a7"},"function.method":{color:"#5731a7"},"function.builtin":{color:"#5731a7"},"function.special.definition":{color:"#5731a7"},"function.call":{color:"#5731a7"},type:{color:"#a631be"},"type.builtin":{color:"#a631be"},constructor:{color:"#a631be"},variable:{color:"#ac6023"},"variable.builtin":{color:"#ac741d"},"variable.member":{color:"#ac6023"},"variable.parameter":{color:"#636363"},"variable.special":{color:"#ac741d"},property:{color:"#ac6023"},"property.css":{color:"#009fff"},"property.definition":{color:"#009fff"},property_name:{color:"#009fff"},value:{color:"#2182a1"},"constant.css":{color:"#ac741d"},"string.plain":{color:"#2182a1"},plain_value:{color:"#2182a1"},"tag.css":{color:"#ac6023"},tag_name:{color:"#ac6023"},class:{color:"#ac741d"},class_name:{color:"#ac741d"},"selector.class":{color:"#ac741d"},"selector.id":{color:"#5731a7"},id_name:{color:"#5731a7"},"selector.pseudo":{color:"#2182a1"},pseudo_class_selector:{color:"#2182a1"},pseudo_element_selector:{color:"#2182a1"},"keyword.directive":{color:"#8836c7"},"keyword.control.at-rule":{color:"#8836c7"},at_keyword:{color:"#8836c7"},"variable.scss":{color:"#ac6023"},"variable.css":{color:"#ac6023"},"property.custom":{color:"#ac6023"},unit:{color:"#2182a1"},"number.unit":{color:"#2182a1"},color:{color:"#ac741d"},"constant.color":{color:"#ac741d"},"keyword.important":{color:"#8836c7"},"variable.language":{color:"#ac741d"},this:{color:"#ac741d"},self:{color:"#ac741d"},"type.class":{color:"#a631be"},"property.object":{color:"#ac6023"},property_identifier:{color:"#ac6023"},shorthand_property_identifier:{color:"#ac6023"},shorthand_property_identifier_pattern:{color:"#ac6023"},method_definition:{color:"#5731a7"},"function.method.call":{color:"#5731a7"},"string.template":{color:"#215584"},template_string:{color:"#215584"},"tag.jsx":{color:"#ac6023"},"tag.component":{color:"#a631be"},punctuation:{color:"#636363"},"punctuation.bracket":{color:"#636363"},"punctuation.delimiter":{color:"#636363"},"punctuation.list_marker":{color:"#636363"},"punctuation.special":{color:"#8836c7"},operator:{color:"#2182a1"},tag:{color:"#ac6023"},attribute:{color:"#ac741d"},label:{color:"#ac741d"},namespace:{color:"#ac741d"},decorator:{color:"#216cab"},"attribute.builtin":{color:"#216cab"},embedded:{color:"#0a0a0a"},preproc:{color:"#8836c7"},"text.literal":{color:"#215584"},"markup.heading":{color:"#ac6023",font_weight:700},"markup.bold":{color:"#ac741d",font_weight:700},"markup.italic":{color:"#8836c7",font_style:"italic"},"markup.strikethrough":{color:"#737373"},"markup.link.url":{color:"#009fff"},"markup.link.text":{color:"#5731a7"},"markup.quote":{color:"#737373",font_style:"italic"},"markup.list":{color:"#ac6023"},"markup.list.numbered":{color:"#ac6023"},"markup.list.unnumbered":{color:"#ac6023"},"markup.raw":{color:"#215584"},"markup.raw.inline":{color:"#215584"},"markup.raw.block":{color:"#215584"},"diff.plus":{color:"#216cab"},"diff.minus":{color:"#ac6023"},"diff.delta":{color:"#ffca00"},link_text:{color:"#009fff"},link_uri:{color:"#8836c7"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},primary:{color:"#009fff"},title:{color:"#ac6023",font_weight:700},predictive:{color:"#8a8a8a",font_style:"italic"},selector:{color:"#ac6023"},enum:{color:"#a631be"},hint:{color:"#737373"},variant:{color:"#ac741d"}}}},dE=Object.freeze(Object.defineProperty({__proto__:null,default:wE},Symbol.toStringTag,{value:"Module"})),RE={name:"Pierre Light Soft",appearance:"light",style:{background:"#f7f7f7",text:"#525252","editor.background":"#ffffff","editor.foreground":"#525252","editor.active_line.background":"#dfebff8c",players:[{cursor:"#009fff",selection:"#009fff2e"}],created:"#07c480",deleted:"#ff2e3f",modified:"#009fff","terminal.ansi.black":"#1d1d1d","terminal.ansi.red":"#ff2e3f","terminal.ansi.green":"#0dbe4e","terminal.ansi.yellow":"#ffca00","terminal.ansi.blue":"#009fff","terminal.ansi.magenta":"#e130ac","terminal.ansi.cyan":"#08c0ef","terminal.ansi.white":"#bcbcbc","terminal.ansi.bright_black":"#1d1d1d","terminal.ansi.bright_red":"#ff2e3f","terminal.ansi.bright_green":"#86c427","terminal.ansi.bright_yellow":"#ffca00","terminal.ansi.bright_blue":"#009fff","terminal.ansi.bright_magenta":"#e130ac","terminal.ansi.bright_cyan":"#08c0ef","terminal.ansi.bright_white":"#bcbcbc",syntax:{comment:{color:"#8a8a8a"},"comment.doc":{color:"#8a8a8a"},string:{color:"#0dbe4e"},"string.escape":{color:"#00cab1"},"string.regex":{color:"#00c5d2"},"string.special":{color:"#00cab1"},"string.special.symbol":{color:"#ffca00"},number:{color:"#08c0ef"},constant:{color:"#ffca00"},boolean:{color:"#08c0ef"},keyword:{color:"#ff678d"},"keyword.operator":{color:"#68cdf2"},function:{color:"#9d6afb"},"function.method":{color:"#9d6afb"},"function.builtin":{color:"#9d6afb"},"function.special.definition":{color:"#9d6afb"},"function.call":{color:"#9d6afb"},type:{color:"#d568ea"},"type.builtin":{color:"#d568ea"},constructor:{color:"#d568ea"},variable:{color:"#fe8c2c"},"variable.builtin":{color:"#ffab16"},"variable.member":{color:"#fe8c2c"},"variable.parameter":{color:"#737373"},"variable.special":{color:"#ffab16"},property:{color:"#fe8c2c"},"property.css":{color:"#009fff"},"property.definition":{color:"#009fff"},property_name:{color:"#009fff"},value:{color:"#08c0ef"},"constant.css":{color:"#ffca00"},"string.plain":{color:"#08c0ef"},plain_value:{color:"#08c0ef"},"tag.css":{color:"#ff5d36"},tag_name:{color:"#ff5d36"},class:{color:"#07c480"},class_name:{color:"#07c480"},"selector.class":{color:"#07c480"},"selector.id":{color:"#9d6afb"},id_name:{color:"#9d6afb"},"selector.pseudo":{color:"#68cdf2"},pseudo_class_selector:{color:"#68cdf2"},pseudo_element_selector:{color:"#68cdf2"},"keyword.directive":{color:"#ff678d"},"keyword.control.at-rule":{color:"#ff678d"},at_keyword:{color:"#ff678d"},"variable.scss":{color:"#fe8c2c"},"variable.css":{color:"#fe8c2c"},"property.custom":{color:"#fe8c2c"},unit:{color:"#08c0ef"},"number.unit":{color:"#08c0ef"},color:{color:"#ffca00"},"constant.color":{color:"#ffca00"},"keyword.important":{color:"#ff678d"},"variable.language":{color:"#ffab16"},this:{color:"#ffab16"},self:{color:"#ffab16"},"type.class":{color:"#d568ea"},"property.object":{color:"#fe8c2c"},property_identifier:{color:"#fe8c2c"},shorthand_property_identifier:{color:"#fe8c2c"},shorthand_property_identifier_pattern:{color:"#fe8c2c"},method_definition:{color:"#9d6afb"},"function.method.call":{color:"#9d6afb"},"string.template":{color:"#0dbe4e"},template_string:{color:"#0dbe4e"},"tag.jsx":{color:"#ff5d36"},"tag.component":{color:"#d568ea"},punctuation:{color:"#737373"},"punctuation.bracket":{color:"#737373"},"punctuation.delimiter":{color:"#737373"},"punctuation.list_marker":{color:"#737373"},"punctuation.special":{color:"#ff678d"},operator:{color:"#68cdf2"},tag:{color:"#ff5d36"},attribute:{color:"#07c480"},label:{color:"#ffab16"},namespace:{color:"#ffab16"},decorator:{color:"#69b1ff"},"attribute.builtin":{color:"#69b1ff"},embedded:{color:"#525252"},preproc:{color:"#ff678d"},"text.literal":{color:"#0dbe4e"},"markup.heading":{color:"#ff5d36",font_weight:700},"markup.bold":{color:"#ffca00",font_weight:700},"markup.italic":{color:"#ff678d",font_style:"italic"},"markup.strikethrough":{color:"#8a8a8a"},"markup.link.url":{color:"#009fff"},"markup.link.text":{color:"#9d6afb"},"markup.quote":{color:"#8a8a8a",font_style:"italic"},"markup.list":{color:"#ff5d36"},"markup.list.numbered":{color:"#ff5d36"},"markup.list.unnumbered":{color:"#ff5d36"},"markup.raw":{color:"#0dbe4e"},"markup.raw.inline":{color:"#0dbe4e"},"markup.raw.block":{color:"#0dbe4e"},"diff.plus":{color:"#07c480"},"diff.minus":{color:"#ff2e3f"},"diff.delta":{color:"#ffca00"},link_text:{color:"#009fff"},link_uri:{color:"#ff678d"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},primary:{color:"#009fff"},title:{color:"#ff5d36",font_weight:700},predictive:{color:"#a3a3a3",font_style:"italic"},selector:{color:"#ff5d36"},enum:{color:"#d568ea"},hint:{color:"#8a8a8a"},variant:{color:"#ffca00"}}}},FE=Object.freeze(Object.defineProperty({__proto__:null,default:RE},Symbol.toStringTag,{value:"Module"})),kE={name:"Pierre Light Tritanopia",appearance:"light",style:{background:"#f5f5f5",text:"#0a0a0a","editor.background":"#ffffff","editor.foreground":"#0a0a0a","editor.active_line.background":"#dfebff8c",players:[{cursor:"#009fff",selection:"#009fff2e"}],created:"#1e858e",deleted:"#d5512f",modified:"#009fff","terminal.ansi.black":"#1d1d1d","terminal.ansi.red":"#d5512f","terminal.ansi.green":"#1e858e","terminal.ansi.yellow":"#d5901c","terminal.ansi.blue":"#1a85d4","terminal.ansi.magenta":"#992a75","terminal.ansi.cyan":"#17a5af","terminal.ansi.white":"#bcbcbc","terminal.ansi.bright_black":"#1d1d1d","terminal.ansi.bright_red":"#ff5d36","terminal.ansi.bright_green":"#17a5af","terminal.ansi.bright_yellow":"#ffab16","terminal.ansi.bright_blue":"#009fff","terminal.ansi.bright_magenta":"#bd2e90","terminal.ansi.bright_cyan":"#00c5d2","terminal.ansi.bright_white":"#bcbcbc",syntax:{comment:{color:"#737373"},"comment.doc":{color:"#737373"},string:{color:"#1e858e"},"string.escape":{color:"#1e858e"},"string.regex":{color:"#1e858e"},"string.special":{color:"#1e858e"},"string.special.symbol":{color:"#ac741d"},number:{color:"#1a85d4"},constant:{color:"#ac741d"},boolean:{color:"#1a85d4"},keyword:{color:"#a631be"},"keyword.operator":{color:"#1e858e"},function:{color:"#216cab"},"function.method":{color:"#216cab"},"function.builtin":{color:"#216cab"},"function.special.definition":{color:"#216cab"},"function.call":{color:"#216cab"},type:{color:"#bd2e90"},"type.builtin":{color:"#bd2e90"},constructor:{color:"#bd2e90"},variable:{color:"#ad4529"},"variable.builtin":{color:"#d5512f"},"variable.member":{color:"#ad4529"},"variable.parameter":{color:"#636363"},"variable.special":{color:"#d5512f"},property:{color:"#ad4529"},"property.css":{color:"#009fff"},"property.definition":{color:"#009fff"},property_name:{color:"#009fff"},value:{color:"#1a85d4"},"constant.css":{color:"#ac741d"},"string.plain":{color:"#1a85d4"},plain_value:{color:"#1a85d4"},"tag.css":{color:"#d5512f"},tag_name:{color:"#d5512f"},class:{color:"#1e858e"},class_name:{color:"#1e858e"},"selector.class":{color:"#1e858e"},"selector.id":{color:"#216cab"},id_name:{color:"#216cab"},"selector.pseudo":{color:"#1e858e"},pseudo_class_selector:{color:"#1e858e"},pseudo_element_selector:{color:"#1e858e"},"keyword.directive":{color:"#a631be"},"keyword.control.at-rule":{color:"#a631be"},at_keyword:{color:"#a631be"},"variable.scss":{color:"#ad4529"},"variable.css":{color:"#ad4529"},"property.custom":{color:"#ad4529"},unit:{color:"#1a85d4"},"number.unit":{color:"#1a85d4"},color:{color:"#ac741d"},"constant.color":{color:"#ac741d"},"keyword.important":{color:"#a631be"},"variable.language":{color:"#d5512f"},this:{color:"#d5512f"},self:{color:"#d5512f"},"type.class":{color:"#bd2e90"},"property.object":{color:"#ad4529"},property_identifier:{color:"#ad4529"},shorthand_property_identifier:{color:"#ad4529"},shorthand_property_identifier_pattern:{color:"#ad4529"},method_definition:{color:"#216cab"},"function.method.call":{color:"#216cab"},"string.template":{color:"#1e858e"},template_string:{color:"#1e858e"},"tag.jsx":{color:"#d5512f"},"tag.component":{color:"#bd2e90"},punctuation:{color:"#636363"},"punctuation.bracket":{color:"#636363"},"punctuation.delimiter":{color:"#636363"},"punctuation.list_marker":{color:"#636363"},"punctuation.special":{color:"#a631be"},operator:{color:"#1e858e"},tag:{color:"#d5512f"},attribute:{color:"#1e858e"},label:{color:"#d5512f"},namespace:{color:"#d5512f"},decorator:{color:"#1a85d4"},"attribute.builtin":{color:"#1a85d4"},embedded:{color:"#0a0a0a"},preproc:{color:"#a631be"},"text.literal":{color:"#1e858e"},"markup.heading":{color:"#d5512f",font_weight:700},"markup.bold":{color:"#ac741d",font_weight:700},"markup.italic":{color:"#a631be",font_style:"italic"},"markup.strikethrough":{color:"#737373"},"markup.link.url":{color:"#009fff"},"markup.link.text":{color:"#216cab"},"markup.quote":{color:"#737373",font_style:"italic"},"markup.list":{color:"#d5512f"},"markup.list.numbered":{color:"#d5512f"},"markup.list.unnumbered":{color:"#d5512f"},"markup.raw":{color:"#1e858e"},"markup.raw.inline":{color:"#1e858e"},"markup.raw.block":{color:"#1e858e"},"diff.plus":{color:"#1e858e"},"diff.minus":{color:"#d5512f"},"diff.delta":{color:"#ffab16"},link_text:{color:"#009fff"},link_uri:{color:"#a631be"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},primary:{color:"#009fff"},title:{color:"#d5512f",font_weight:700},predictive:{color:"#8a8a8a",font_style:"italic"},selector:{color:"#d5512f"},enum:{color:"#bd2e90"},hint:{color:"#737373"},variant:{color:"#ac741d"}}}},yE=Object.freeze(Object.defineProperty({__proto__:null,default:kE},Symbol.toStringTag,{value:"Module"})),bE={name:"Pierre Light Vibrant",appearance:"light",style:{background:"color(display-p3 0.960784 0.960784 0.960784)",text:"color(display-p3 0.039216 0.039216 0.039216)","editor.background":"color(display-p3 1.000000 1.000000 1.000000)","editor.foreground":"color(display-p3 0.039216 0.039216 0.039216)","editor.active_line.background":"color(display-p3 0.883107 0.920057 0.992610 / 0.550000)",players:[{cursor:"color(display-p3 0.308664 0.645271 1.000000)",selection:"color(display-p3 0.308664 0.645271 1.000000 / 0.250000)"}],created:"color(display-p3 0.266455 0.667541 0.435918)",deleted:"color(display-p3 0.838044 0.219378 0.220424)",modified:"color(display-p3 0.308664 0.645271 1.000000)","terminal.ansi.black":"color(display-p3 0.113725 0.113725 0.113725)","terminal.ansi.red":"color(display-p3 0.838044 0.219378 0.220424)","terminal.ansi.green":"color(display-p3 0.266455 0.667541 0.435918)","terminal.ansi.yellow":"color(display-p3 0.883654 0.721037 0.210874)","terminal.ansi.blue":"color(display-p3 0.227104 0.537899 0.881328)","terminal.ansi.magenta":"color(display-p3 0.733164 0.179473 0.572580)","terminal.ansi.cyan":"color(display-p3 0.246852 0.642335 0.817202)","terminal.ansi.white":"color(display-p3 0.737255 0.737255 0.737255)","terminal.ansi.bright_black":"color(display-p3 0.113725 0.113725 0.113725)","terminal.ansi.bright_red":"color(display-p3 0.838044 0.219378 0.220424)","terminal.ansi.bright_green":"color(display-p3 0.516667 0.680013 0.208825)","terminal.ansi.bright_yellow":"color(display-p3 0.883654 0.721037 0.210874)","terminal.ansi.bright_blue":"color(display-p3 0.227104 0.537899 0.881328)","terminal.ansi.bright_magenta":"color(display-p3 0.733164 0.179473 0.572580)","terminal.ansi.bright_cyan":"color(display-p3 0.246852 0.642335 0.817202)","terminal.ansi.bright_white":"color(display-p3 0.737255 0.737255 0.737255)",syntax:{comment:{color:"color(display-p3 0.450980 0.450980 0.450980)"},"comment.doc":{color:"color(display-p3 0.450980 0.450980 0.450980)"},string:{color:"color(display-p3 0.259723 0.647032 0.276349)"},"string.escape":{color:"color(display-p3 0.272343 0.688141 0.603353)"},"string.regex":{color:"color(display-p3 0.262058 0.668164 0.717478)"},"string.special":{color:"color(display-p3 0.272343 0.688141 0.603353)"},"string.special.symbol":{color:"color(display-p3 0.883654 0.721037 0.210874)"},number:{color:"color(display-p3 0.246852 0.642335 0.817202)"},constant:{color:"color(display-p3 0.883654 0.721037 0.210874)"},boolean:{color:"color(display-p3 0.246852 0.642335 0.817202)"},keyword:{color:"color(display-p3 0.834880 0.207921 0.387456)"},"keyword.operator":{color:"color(display-p3 0.327292 0.790977 0.995660)"},function:{color:"color(display-p3 0.391345 0.215644 0.853560)"},"function.method":{color:"color(display-p3 0.391345 0.215644 0.853560)"},"function.builtin":{color:"color(display-p3 0.391345 0.215644 0.853560)"},"function.special.definition":{color:"color(display-p3 0.391345 0.215644 0.853560)"},"function.call":{color:"color(display-p3 0.391345 0.215644 0.853560)"},type:{color:"color(display-p3 0.660755 0.179954 0.815400)"},"type.builtin":{color:"color(display-p3 0.660755 0.179954 0.815400)"},constructor:{color:"color(display-p3 0.660755 0.179954 0.815400)"},variable:{color:"color(display-p3 0.854172 0.502144 0.209646)"},"variable.builtin":{color:"color(display-p3 0.870477 0.613222 0.203432)"},"variable.member":{color:"color(display-p3 0.854172 0.502144 0.209646)"},"variable.parameter":{color:"color(display-p3 0.388235 0.388235 0.388235)"},"variable.special":{color:"color(display-p3 0.870477 0.613222 0.203432)"},property:{color:"color(display-p3 0.854172 0.502144 0.209646)"},"property.css":{color:"color(display-p3 0.308664 0.645271 1.000000)"},"property.definition":{color:"color(display-p3 0.308664 0.645271 1.000000)"},property_name:{color:"color(display-p3 0.308664 0.645271 1.000000)"},value:{color:"color(display-p3 0.246852 0.642335 0.817202)"},"constant.css":{color:"color(display-p3 0.883654 0.721037 0.210874)"},"string.plain":{color:"color(display-p3 0.246852 0.642335 0.817202)"},plain_value:{color:"color(display-p3 0.246852 0.642335 0.817202)"},"tag.css":{color:"color(display-p3 0.846123 0.351499 0.208754)"},tag_name:{color:"color(display-p3 0.846123 0.351499 0.208754)"},class:{color:"color(display-p3 0.266455 0.667541 0.435918)"},class_name:{color:"color(display-p3 0.266455 0.667541 0.435918)"},"selector.class":{color:"color(display-p3 0.266455 0.667541 0.435918)"},"selector.id":{color:"color(display-p3 0.391345 0.215644 0.853560)"},id_name:{color:"color(display-p3 0.391345 0.215644 0.853560)"},"selector.pseudo":{color:"color(display-p3 0.327292 0.790977 0.995660)"},pseudo_class_selector:{color:"color(display-p3 0.327292 0.790977 0.995660)"},pseudo_element_selector:{color:"color(display-p3 0.327292 0.790977 0.995660)"},"keyword.directive":{color:"color(display-p3 0.834880 0.207921 0.387456)"},"keyword.control.at-rule":{color:"color(display-p3 0.834880 0.207921 0.387456)"},at_keyword:{color:"color(display-p3 0.834880 0.207921 0.387456)"},"variable.scss":{color:"color(display-p3 0.854172 0.502144 0.209646)"},"variable.css":{color:"color(display-p3 0.854172 0.502144 0.209646)"},"property.custom":{color:"color(display-p3 0.854172 0.502144 0.209646)"},unit:{color:"color(display-p3 0.246852 0.642335 0.817202)"},"number.unit":{color:"color(display-p3 0.246852 0.642335 0.817202)"},color:{color:"color(display-p3 0.883654 0.721037 0.210874)"},"constant.color":{color:"color(display-p3 0.883654 0.721037 0.210874)"},"keyword.important":{color:"color(display-p3 0.834880 0.207921 0.387456)"},"variable.language":{color:"color(display-p3 0.870477 0.613222 0.203432)"},this:{color:"color(display-p3 0.870477 0.613222 0.203432)"},self:{color:"color(display-p3 0.870477 0.613222 0.203432)"},"type.class":{color:"color(display-p3 0.660755 0.179954 0.815400)"},"property.object":{color:"color(display-p3 0.854172 0.502144 0.209646)"},property_identifier:{color:"color(display-p3 0.854172 0.502144 0.209646)"},shorthand_property_identifier:{color:"color(display-p3 0.854172 0.502144 0.209646)"},shorthand_property_identifier_pattern:{color:"color(display-p3 0.854172 0.502144 0.209646)"},method_definition:{color:"color(display-p3 0.391345 0.215644 0.853560)"},"function.method.call":{color:"color(display-p3 0.391345 0.215644 0.853560)"},"string.template":{color:"color(display-p3 0.259723 0.647032 0.276349)"},template_string:{color:"color(display-p3 0.259723 0.647032 0.276349)"},"tag.jsx":{color:"color(display-p3 0.846123 0.351499 0.208754)"},"tag.component":{color:"color(display-p3 0.660755 0.179954 0.815400)"},punctuation:{color:"color(display-p3 0.388235 0.388235 0.388235)"},"punctuation.bracket":{color:"color(display-p3 0.388235 0.388235 0.388235)"},"punctuation.delimiter":{color:"color(display-p3 0.388235 0.388235 0.388235)"},"punctuation.list_marker":{color:"color(display-p3 0.388235 0.388235 0.388235)"},"punctuation.special":{color:"color(display-p3 0.834880 0.207921 0.387456)"},operator:{color:"color(display-p3 0.327292 0.790977 0.995660)"},tag:{color:"color(display-p3 0.846123 0.351499 0.208754)"},attribute:{color:"color(display-p3 0.266455 0.667541 0.435918)"},label:{color:"color(display-p3 0.870477 0.613222 0.203432)"},namespace:{color:"color(display-p3 0.870477 0.613222 0.203432)"},decorator:{color:"color(display-p3 0.227104 0.537899 0.881328)"},"attribute.builtin":{color:"color(display-p3 0.227104 0.537899 0.881328)"},embedded:{color:"color(display-p3 0.039216 0.039216 0.039216)"},preproc:{color:"color(display-p3 0.834880 0.207921 0.387456)"},"text.literal":{color:"color(display-p3 0.259723 0.647032 0.276349)"},"markup.heading":{color:"color(display-p3 0.846123 0.351499 0.208754)",font_weight:700},"markup.bold":{color:"color(display-p3 0.883654 0.721037 0.210874)",font_weight:700},"markup.italic":{color:"color(display-p3 0.834880 0.207921 0.387456)",font_style:"italic"},"markup.strikethrough":{color:"color(display-p3 0.450980 0.450980 0.450980)"},"markup.link.url":{color:"color(display-p3 0.308664 0.645271 1.000000)"},"markup.link.text":{color:"color(display-p3 0.391345 0.215644 0.853560)"},"markup.quote":{color:"color(display-p3 0.450980 0.450980 0.450980)",font_style:"italic"},"markup.list":{color:"color(display-p3 0.846123 0.351499 0.208754)"},"markup.list.numbered":{color:"color(display-p3 0.846123 0.351499 0.208754)"},"markup.list.unnumbered":{color:"color(display-p3 0.846123 0.351499 0.208754)"},"markup.raw":{color:"color(display-p3 0.259723 0.647032 0.276349)"},"markup.raw.inline":{color:"color(display-p3 0.259723 0.647032 0.276349)"},"markup.raw.block":{color:"color(display-p3 0.259723 0.647032 0.276349)"},"diff.plus":{color:"color(display-p3 0.266455 0.667541 0.435918)"},"diff.minus":{color:"color(display-p3 0.838044 0.219378 0.220424)"},"diff.delta":{color:"color(display-p3 0.883654 0.721037 0.210874)"},link_text:{color:"color(display-p3 0.308664 0.645271 1.000000)"},link_uri:{color:"color(display-p3 0.834880 0.207921 0.387456)"},emphasis:{font_style:"italic"},"emphasis.strong":{font_weight:700},primary:{color:"color(display-p3 0.308664 0.645271 1.000000)"},title:{color:"color(display-p3 0.846123 0.351499 0.208754)",font_weight:700},predictive:{color:"color(display-p3 0.541176 0.541176 0.541176)",font_style:"italic"},selector:{color:"color(display-p3 0.846123 0.351499 0.208754)"},enum:{color:"color(display-p3 0.660755 0.179954 0.815400)"},hint:{color:"color(display-p3 0.450980 0.450980 0.450980)"},variant:{color:"color(display-p3 0.883654 0.721037 0.210874)"}}}},ME=Object.freeze(Object.defineProperty({__proto__:null,default:bE},Symbol.toStringTag,{value:"Module"})),GE={name:"Plastic",appearance:"dark",style:{background:"#21252Bff",text:"#F5F7FAff","editor.background":"#21252Bff","editor.foreground":"#A9B2C3ff","editor.active_line.background":"#A9B2C31A","search.match_background":"#1085FF44",players:[{cursor:"#1085FFff",background:"#1085FFff",selection:"#1085FF3d"},{cursor:"#E06C75ff",background:"#E06C75ff",selection:"#E06C753d"},{cursor:"#D19A66ff",background:"#D19A66ff",selection:"#D19A663d"},{cursor:"#B57EDCff",background:"#B57EDCff",selection:"#B57EDC3d"},{cursor:"#56B6C2ff",background:"#56B6C2ff",selection:"#56B6C23d"},{cursor:"#E5C07Bff",background:"#E5C07Bff",selection:"#E5C07B3d"},{cursor:"#98C379ff",background:"#98C379ff",selection:"#98C3793d"},{cursor:"#61AFEFff",background:"#61AFEFff",selection:"#61AFEF3d"}],error:"#D74E42ff",warning:"#E9D16Cff",info:"#1085FFff",hint:"#5F6672ff",deleted:"#E06C75",modified:"#D19A66","terminal.ansi.black":"#5F6672ff","terminal.ansi.red":"#E06C75ff","terminal.ansi.green":"#98C379ff","terminal.ansi.yellow":"#E5C07Bff","terminal.ansi.blue":"#61AFEFff","terminal.ansi.magenta":"#B57EDCff","terminal.ansi.cyan":"#56B6C2ff","terminal.ansi.white":"#A9B2C3ff","terminal.ansi.bright_black":"#5F6672ff","terminal.ansi.bright_red":"#E06C75ff","terminal.ansi.bright_green":"#98C379ff","terminal.ansi.bright_yellow":"#E5C07Bff","terminal.ansi.bright_blue":"#61AFEFff","terminal.ansi.bright_magenta":"#B57EDCff","terminal.ansi.bright_cyan":"#56B6C2ff","terminal.ansi.bright_white":"#A9B2C3ff",syntax:{attribute:{color:"#D19A66ff"},boolean:{color:"#56B6C2ff"},comment:{color:"#5F6672ff"},"comment.doc":{color:"#5F6672ff"},constant:{color:"#56B6C2ff"},constructor:{color:"#61AFEFff"},embedded:{color:"#A9B2C3ff"},emphasis:{color:"#E06C75ff"},"emphasis.strong":{color:"#D19A66ff",font_weight:700},enum:{color:"#E5C07Bff"},function:{color:"#B57EDCff"},hint:{color:"#5F6672ff"},keyword:{color:"#E06C75ff"},label:{color:"#E5C07Bff"},link_text:{color:"#61AFEFff",font_style:"normal"},link_uri:{color:"#56B6C2ff"},namespace:{color:"#61AFEFff"},number:{color:"#56B6C2ff"},operator:{color:"#A9B2C3ff"},predictive:{color:"#5F6672ff",font_style:"italic"},preproc:{color:"#E06C75ff"},primary:{color:"#A9B2C3ff"},property:{color:"#C6CCD7ff"},punctuation:{color:"#A9B2C3ff"},"punctuation.bracket":{color:"#A9B2C3ff"},"punctuation.delimiter":{color:"#A9B2C3ff"},"punctuation.list_marker":{color:"#E06C75ff"},"punctuation.markup":{color:"#E06C75ff"},"punctuation.special":{color:"#E06C75ff"},selector:{color:"#E5C07Bff"},"selector.pseudo":{color:"#61AFEFff"},string:{color:"#98C379ff"},"string.escape":{color:"#56B6C2ff"},"string.regex":{color:"#56B6C2ff"},"string.special":{color:"#D19A66ff"},"string.special.symbol":{color:"#D19A66ff"},tag:{color:"#E5C07Bff"},"text.literal":{color:"#98C379ff"},title:{color:"#E5C07Bff",font_weight:400},type:{color:"#E5C07Bff"},variable:{color:"#C6CCD7ff"},"variable.special":{color:"#E06C75ff"},variant:{color:"#61AFEFff"},"diff.minus":{color:"#E06C75"},"diff.plus":{color:"#98C379"}}}},hE=Object.freeze(Object.defineProperty({__proto__:null,default:GE},Symbol.toStringTag,{value:"Module"})),SE={name:"Poimandres",appearance:"dark",style:{background:"#1b1e28","editor.background":"#1b1e28",text:"#a6accd","editor.foreground":"#a6accd","editor.active_line.background":"#717cb425","editor.document_highlight.bracket_background":"#00000000","search.match_background":"#ADD7FF40",error:"#d0679d",warning:"#fffac2",info:"#ADD7FF",hint:"#7390AAb3",players:[{cursor:"#a6accd",selection:"#717cb425"}],created:"#5fb3a1",deleted:"#d0679d",modified:"#ADD7FF","terminal.ansi.black":"#1b1e28","terminal.ansi.red":"#d0679d","terminal.ansi.green":"#5DE4c7","terminal.ansi.yellow":"#fffac2","terminal.ansi.blue":"#89ddff","terminal.ansi.magenta":"#f087bd","terminal.ansi.cyan":"#89ddff","terminal.ansi.white":"#ffffff","terminal.ansi.bright_black":"#a6accd","terminal.ansi.bright_red":"#d0679d","terminal.ansi.bright_green":"#5DE4c7","terminal.ansi.bright_yellow":"#fffac2","terminal.ansi.bright_blue":"#ADD7FF","terminal.ansi.bright_magenta":"#f087bd","terminal.ansi.bright_cyan":"#ADD7FF","terminal.ansi.bright_white":"#ffffff",syntax:{attribute:{color:"#91B4D5",font_style:"italic"},boolean:{color:"#5DE4c7"},comment:{color:"#767c9dB0",font_style:"italic"},"comment.doc":{color:"#767c9dB0",font_style:"italic"},constant:{color:"#5DE4c7"},constructor:{color:"#5DE4c7"},emphasis:{color:"#7390AA",font_style:"italic"},"emphasis.strong":{color:"#7390AA",font_weight:700},function:{color:"#ADD7FF"},keyword:{color:"#a6accd"},label:{color:"#91B4D5"},link_text:{color:"#5DE4c7"},link_uri:{color:"#5DE4c7"},number:{color:"#5DE4c7"},operator:{color:"#91B4D5"},punctuation:{color:"#a6accd"},"punctuation.bracket":{color:"#a6accd"},"punctuation.delimiter":{color:"#a6accd"},"punctuation.list_marker":{color:"#a6accd"},"punctuation.special":{color:"#a6accd"},string:{color:"#5DE4c7"},"string.escape":{color:"#5DE4c7"},"string.regex":{color:"#5DE4c7"},"string.special":{color:"#5DE4c7"},"string.special.symbol":{color:"#5DE4c7"},tag:{color:"#5DE4c7"},"text.literal":{color:"#5DE4c7"},title:{color:"#91B4D5"},type:{color:"#a6accdC0"},variable:{color:"#ADD7FF",font_style:"italic"},"variable.special":{color:"#ADD7FF",font_style:"italic"},embedded:{color:"#a6accd"},namespace:{color:"#91B4D5"},predictive:{color:"#767c9dB0"},preproc:{color:"#a6accd"},primary:{color:"#a6accd"},property:{color:"#ADD7FF",font_style:"italic"},selector:{color:"#5DE4C7"},enum:{color:"#A6ACCDC0"},hint:{color:"#7390AAb3"},variant:{color:"#E4F0FB"},"diff.minus":{color:"#506477"},"diff.plus":{color:"#ADD7FF"},"property.json_key":{color:"#A6ACCDC0"},"selector.class":{color:"#5FB3A1",font_style:"italic"},"selector.id":{color:"#91B4D5",font_style:"italic"},"selector.pseudo":{color:"#91B4D5",font_style:"italic"}}}},DE=Object.freeze(Object.defineProperty({__proto__:null,default:SE},Symbol.toStringTag,{value:"Module"})),UE={name:"Red",appearance:"dark",style:{background:"#390000ff",text:"#f8f8f8ff","editor.background":"#390000ff","editor.foreground":"#f8f8f8ff","editor.active_line.background":"#ff000033","editor.document_highlight.bracket_background":"#f8f8f81a","search.match_background":"#f8f8f833",players:[{cursor:"#970000ff",background:"#97000026",selection:"#750000ff"},{cursor:"#977100ff",background:"#97710026",selection:"#9771004d"},{cursor:"#4c9700ff",background:"#4c970026",selection:"#4c97004d"},{cursor:"#009726ff",background:"#00972626",selection:"#0097264d"},{cursor:"#009797ff",background:"#00979726",selection:"#0097974d"},{cursor:"#002697ff",background:"#00269726",selection:"#0026974d"},{cursor:"#4c0097ff",background:"#4c009726",selection:"#4c00974d"},{cursor:"#970071ff",background:"#97007126",selection:"#9700714d"}],error:"#f44747ff",warning:"#cca700ff",info:"#3794ffff",hint:"#969696ff","terminal.ansi.black":"#000000ff","terminal.ansi.red":"#cd3131ff","terminal.ansi.green":"#0dbc79ff","terminal.ansi.yellow":"#e5e510ff","terminal.ansi.blue":"#2472c8ff","terminal.ansi.magenta":"#bc3fbcff","terminal.ansi.cyan":"#11a8cdff","terminal.ansi.white":"#e5e5e5ff","terminal.ansi.bright_black":"#666666ff","terminal.ansi.bright_red":"#f14c4cff","terminal.ansi.bright_green":"#23d18bff","terminal.ansi.bright_yellow":"#f5f543ff","terminal.ansi.bright_blue":"#3b8eeaff","terminal.ansi.bright_magenta":"#d670d6ff","terminal.ansi.bright_cyan":"#29b8dbff","terminal.ansi.bright_white":"#e5e5e5ff",syntax:{comment:{color:"#e7c0c0ff",font_style:"italic"},"comment.doc":{color:"#e7c0c0ff",font_style:"italic"},string:{color:"#cd8d8dff"},"string.regex":{color:"#ffb454ff"},"string.escape":{color:"#ffe862ff"},link_text:{color:"#cd8d8dff"},number:{color:"#994646ff"},boolean:{color:"#994646ff"},"constant.builtin":{color:"#994646ff"},constant:{color:"#994646ff"},variable:{color:"#fb9a4bff",font_style:"italic"},"variable.special":{color:"#fb9a4bff",font_style:"italic"},"variable.parameter":{color:"#fb9a4bff",font_style:"italic"},keyword:{color:"#f12727ff"},operator:{color:"#f12727ff"},type:{color:"#fec758ff"},"type.builtin":{color:"#9DF39FFF"},function:{color:"#fec758ff"},"function.builtin":{color:"#ffb454ff"},tag:{color:"#fec758ff"},attribute:{color:"#fec758ff"},"punctuation.special":{color:"#ec0d1eff"},"punctuation.delimiter":{color:"#f8f8f8ff"},punctuation:{color:"#f8f8f8ff"},preproc:{color:"#f8f8f8ff"},title:{color:"#fec758ff",font_weight:700},"emphasis.strong":{font_weight:700},emphasis:{color:"#FB9A4BFF",font_style:"italic"},"text.literal":{color:"#cd8d8dff"},enum:{color:"#fec758ff"},property:{color:"#fb9a4bff",font_style:"italic"},label:{color:"#fec758ff"},constructor:{color:"#fec758ff"},namespace:{color:"#fec758ff"},"diff.minus":{color:"#ec9799ff"},"diff.plus":{color:"#41a83eff"},embedded:{color:"#f8f8f8ff"},selector:{color:"#fec758ff"},"selector.pseudo":{color:"#fec758ff"},variant:{color:"#fb9a4bff",font_style:"italic"},"string.special":{color:"#cd8d8dff"},"string.special.symbol":{color:"#994646ff"},"punctuation.markup":{color:"#f8f8f8ff"},primary:{color:"#f8f8f8ff"},link_uri:{color:"#f8f8f8ff"},hint:{color:"#f8f8f866"},predictive:{color:"#f8f8f866"},"punctuation.bracket":{color:"#f8f8f8ff"},"punctuation.list_marker":{color:"#f8f8f8ff"},"keyword.declaration":{color:"#FF6262FF",font_weight:700},"property.json_key":{color:"#9DF39FFF"},"tag.doctype":{color:"#EC0D1EFF"},"keyword.jsdoc":{color:"#FF6262FF",font_weight:700},"tag.component.jsx":{color:"#9DF39FFF"}},created:"#81b88b",deleted:"#c74e39",modified:"#E2C08D"}},JE=Object.freeze(Object.defineProperty({__proto__:null,default:UE},Symbol.toStringTag,{value:"Module"})),LE={name:"Rosé Pine",appearance:"dark",style:{background:"#191724",text:"#e0def4","editor.background":"#191724","editor.foreground":"#e0def4","editor.active_line.background":"#1f1d2e","search.match_background":"#f6c1774d",players:[{cursor:"#e0def4",background:"#e0def4",selection:"#e0def422"},{cursor:"#9ccfd8",background:"#9ccfd8",selection:"#9ccfd844"},{cursor:"#c4a7e7",background:"#c4a7e7",selection:"#c4a7e744"},{cursor:"#31748f",background:"#31748f",selection:"#31748f44"},{cursor:"#eb6f92",background:"#eb6f92",selection:"#eb6f9244"}],error:"#eb6f92",warning:"#f6c177",info:"#31748f",hint:"#908caa",created:"#9ccfd8",deleted:"#908caa",modified:"#ebbcba","terminal.ansi.black":"#21202e","terminal.ansi.red":"#eb6f92","terminal.ansi.green":"#31748f","terminal.ansi.yellow":"#f6c177","terminal.ansi.blue":"#9ccfd8","terminal.ansi.magenta":"#c4a7e7","terminal.ansi.cyan":"#ebbcba","terminal.ansi.white":"#e0def4","terminal.ansi.bright_black":"#908caa","terminal.ansi.bright_red":"#eb6f92","terminal.ansi.bright_green":"#31748f","terminal.ansi.bright_yellow":"#f6c177","terminal.ansi.bright_blue":"#9ccfd8","terminal.ansi.bright_magenta":"#c4a7e7","terminal.ansi.bright_cyan":"#ebbcba","terminal.ansi.bright_white":"#e0def4",syntax:{attribute:{color:"#c4a7e7"},boolean:{color:"#ebbcba"},comment:{color:"#6e6a86",font_style:"italic"},"comment.doc":{color:"#908caa"},constant:{color:"#f6c177"},constructor:{color:"#9ccfd8"},embedded:{color:"#e0def4"},emphasis:{color:"#c4a7e7",font_style:"italic"},"emphasis.strong":{color:"#9ccfd8",font_weight:700},enum:{color:"#31748f"},function:{color:"#ebbcba"},hint:{color:"#c4a7e7"},keyword:{color:"#31748f"},label:{color:"#9ccfd8"},link_text:{color:"#c4a7e7"},link_uri:{color:"#31748f"},number:{color:"#f6c177"},operator:{color:"#908caa"},predictive:{color:"#908caa"},preproc:{color:"#f6c177"},primary:{color:"#c4a7e7"},property:{color:"#9ccfd8"},punctuation:{color:"#908caa"},"punctuation.bracket":{color:"#908caa"},"punctuation.delimiter":{color:"#908caa"},"punctuation.list_marker":{color:"#908caa",font_weight:700},"punctuation.special":{color:"#908caa"},string:{color:"#f6c177"},"string.escape":{color:"#31748f"},"string.regex":{color:"#c4a7e7"},"string.special":{color:"#31748f"},"string.special.symbol":{color:"#31748f"},tag:{color:"#9ccfd8"},"text.literal":{color:"#f6c177"},title:{color:"#eb6f92",font_weight:700},type:{color:"#9ccfd8"},variable:{color:"#e0def4"},"variable.special":{color:"#eb6f92"},variant:{color:"#ebbcba"},namespace:{color:"#9CCFD8"},selector:{color:"#9CCFD8"},"diff.minus":{color:"#908caa"},"diff.plus":{color:"#9ccfd8"},"selector.class":{color:"#C4A7E7",font_style:"italic"},"selector.id":{color:"#C4A7E7",font_style:"italic"},"selector.pseudo":{color:"#C4A7E7",font_style:"italic"}}}},mE=Object.freeze(Object.defineProperty({__proto__:null,default:LE},Symbol.toStringTag,{value:"Module"})),pE={name:"Rosé Pine Dawn",appearance:"light",style:{background:"#faf4ed",text:"#575279","editor.background":"#faf4ed","editor.foreground":"#575279","editor.active_line.background":"#fffaf3","search.match_background":"#ea9d344d",players:[{cursor:"#575279",background:"#575279",selection:"#57527922"},{cursor:"#56949f",background:"#56949f",selection:"#56949f44"},{cursor:"#907aa9",background:"#907aa9",selection:"#907aa944"},{cursor:"#286983",background:"#286983",selection:"#28698344"},{cursor:"#b4637a",background:"#b4637a",selection:"#b4637a44"}],error:"#b4637a",warning:"#ea9d34",info:"#286983",hint:"#797593",created:"#56949f",deleted:"#797593",modified:"#d7827e","terminal.ansi.black":"#f4ede8","terminal.ansi.red":"#b4637a","terminal.ansi.green":"#286983","terminal.ansi.yellow":"#ea9d34","terminal.ansi.blue":"#56949f","terminal.ansi.magenta":"#907aa9","terminal.ansi.cyan":"#d7827e","terminal.ansi.white":"#575279","terminal.ansi.bright_black":"#797593","terminal.ansi.bright_red":"#b4637a","terminal.ansi.bright_green":"#286983","terminal.ansi.bright_yellow":"#ea9d34","terminal.ansi.bright_blue":"#56949f","terminal.ansi.bright_magenta":"#907aa9","terminal.ansi.bright_cyan":"#d7827e","terminal.ansi.bright_white":"#575279",syntax:{attribute:{color:"#907aa9"},boolean:{color:"#d7827e"},comment:{color:"#9893a5",font_style:"italic"},"comment.doc":{color:"#797593"},constant:{color:"#ea9d34"},constructor:{color:"#56949f"},embedded:{color:"#575279"},emphasis:{color:"#907aa9",font_style:"italic"},"emphasis.strong":{color:"#56949f",font_weight:700},enum:{color:"#286983"},function:{color:"#d7827e"},hint:{color:"#907aa9"},keyword:{color:"#286983"},label:{color:"#56949f"},link_text:{color:"#907aa9"},link_uri:{color:"#286983"},number:{color:"#ea9d34"},operator:{color:"#797593"},predictive:{color:"#797593"},preproc:{color:"#ea9d34"},primary:{color:"#907aa9"},property:{color:"#56949f"},punctuation:{color:"#797593"},"punctuation.bracket":{color:"#797593"},"punctuation.delimiter":{color:"#797593"},"punctuation.list_marker":{color:"#797593",font_weight:700},"punctuation.special":{color:"#797593"},string:{color:"#ea9d34"},"string.escape":{color:"#286983"},"string.regex":{color:"#907aa9"},"string.special":{color:"#286983"},"string.special.symbol":{color:"#286983"},tag:{color:"#56949f"},"text.literal":{color:"#ea9d34"},title:{color:"#b4637a",font_weight:700},type:{color:"#56949f"},variable:{color:"#575279"},"variable.special":{color:"#b4637a"},variant:{color:"#d7827e"},namespace:{color:"#56949F"},selector:{color:"#56949F"},"diff.minus":{color:"#797593"},"diff.plus":{color:"#56949f"},"selector.class":{color:"#907AA9",font_style:"italic"},"selector.id":{color:"#907AA9",font_style:"italic"},"selector.pseudo":{color:"#907AA9",font_style:"italic"}}}},uE=Object.freeze(Object.defineProperty({__proto__:null,default:pE},Symbol.toStringTag,{value:"Module"})),jE={name:"Rosé Pine Moon",appearance:"dark",style:{background:"#232136",text:"#e0def4","editor.background":"#232136","editor.foreground":"#e0def4","editor.active_line.background":"#2a273f","search.match_background":"#f6c1774d",players:[{cursor:"#e0def4",background:"#e0def4",selection:"#e0def422"},{cursor:"#9ccfd8",background:"#9ccfd8",selection:"#9ccfd844"},{cursor:"#c4a7e7",background:"#c4a7e7",selection:"#c4a7e744"},{cursor:"#3e8fb0",background:"#3e8fb0",selection:"#3e8fb044"},{cursor:"#eb6f92",background:"#eb6f92",selection:"#eb6f9244"}],error:"#eb6f92",warning:"#f6c177",info:"#3e8fb0",hint:"#908caa",created:"#9ccfd8",deleted:"#908caa",modified:"#ea9a97","terminal.ansi.black":"#2a283e","terminal.ansi.red":"#eb6f92","terminal.ansi.green":"#3e8fb0","terminal.ansi.yellow":"#f6c177","terminal.ansi.blue":"#9ccfd8","terminal.ansi.magenta":"#c4a7e7","terminal.ansi.cyan":"#ea9a97","terminal.ansi.white":"#e0def4","terminal.ansi.bright_black":"#908caa","terminal.ansi.bright_red":"#eb6f92","terminal.ansi.bright_green":"#3e8fb0","terminal.ansi.bright_yellow":"#f6c177","terminal.ansi.bright_blue":"#9ccfd8","terminal.ansi.bright_magenta":"#c4a7e7","terminal.ansi.bright_cyan":"#ea9a97","terminal.ansi.bright_white":"#e0def4",syntax:{attribute:{color:"#c4a7e7"},boolean:{color:"#ea9a97"},comment:{color:"#6e6a86",font_style:"italic"},"comment.doc":{color:"#908caa"},constant:{color:"#f6c177"},constructor:{color:"#9ccfd8"},embedded:{color:"#e0def4"},emphasis:{color:"#c4a7e7",font_style:"italic"},"emphasis.strong":{color:"#9ccfd8",font_weight:700},enum:{color:"#3e8fb0"},function:{color:"#ea9a97"},hint:{color:"#c4a7e7"},keyword:{color:"#3e8fb0"},label:{color:"#9ccfd8"},link_text:{color:"#c4a7e7"},link_uri:{color:"#3e8fb0"},number:{color:"#f6c177"},operator:{color:"#908caa"},predictive:{color:"#908caa"},preproc:{color:"#f6c177"},primary:{color:"#c4a7e7"},property:{color:"#9ccfd8"},punctuation:{color:"#908caa"},"punctuation.bracket":{color:"#908caa"},"punctuation.delimiter":{color:"#908caa"},"punctuation.list_marker":{color:"#908caa",font_weight:700},"punctuation.special":{color:"#908caa"},string:{color:"#f6c177"},"string.escape":{color:"#3e8fb0"},"string.regex":{color:"#c4a7e7"},"string.special":{color:"#3e8fb0"},"string.special.symbol":{color:"#3e8fb0"},tag:{color:"#9ccfd8"},"text.literal":{color:"#f6c177"},title:{color:"#eb6f92",font_weight:700},type:{color:"#9ccfd8"},variable:{color:"#e0def4"},"variable.special":{color:"#eb6f92"},variant:{color:"#ea9a97"},namespace:{color:"#9CCFD8"},selector:{color:"#9CCFD8"},"diff.minus":{color:"#908caa"},"diff.plus":{color:"#9ccfd8"},"selector.class":{color:"#C4A7E7",font_style:"italic"},"selector.id":{color:"#C4A7E7",font_style:"italic"},"selector.pseudo":{color:"#C4A7E7",font_style:"italic"}}}},YE=Object.freeze(Object.defineProperty({__proto__:null,default:jE},Symbol.toStringTag,{value:"Module"})),NE={name:"Slack Dark",appearance:"dark",style:{background:"#222222","editor.background":"#222222",text:"#E6E6E6","editor.foreground":"#E6E6E6","editor.active_line.background":"#141414",players:[{cursor:"#E6E6E6"}],created:"#ECB22E",deleted:"#FFF",modified:"#ECB22E","terminal.ansi.black":"#000000","terminal.ansi.red":"#cd3131","terminal.ansi.green":"#0dbc79","terminal.ansi.yellow":"#e5e510","terminal.ansi.blue":"#2472c8","terminal.ansi.magenta":"#bc3fbc","terminal.ansi.cyan":"#11a8cd","terminal.ansi.white":"#e5e5e5","terminal.ansi.bright_black":"#666666","terminal.ansi.bright_red":"#f14c4c","terminal.ansi.bright_green":"#23d18b","terminal.ansi.bright_yellow":"#f5f543","terminal.ansi.bright_blue":"#3b8eea","terminal.ansi.bright_magenta":"#d670d6","terminal.ansi.bright_cyan":"#29b8db","terminal.ansi.bright_white":"#e5e5e5",syntax:{attribute:{color:"#9cdcfe"},boolean:{color:"#569cd6"},comment:{color:"#6A9955"},"comment.doc":{color:"#6A9955"},constant:{color:"#569cd6"},constructor:{color:"#569cd6"},embedded:{color:"#D4D4D4"},"emphasis.strong":{color:"#569cd6",font_weight:700},function:{color:"#DCDCAA"},keyword:{color:"#569cd6"},number:{color:"#b5cea8"},operator:{color:"#d4d4d4"},preproc:{color:"#569cd6"},property:{color:"#9cdcfe"},punctuation:{color:"#808080"},"punctuation.bracket":{color:"#808080"},"punctuation.delimiter":{color:"#808080"},"punctuation.list_marker":{color:"#808080"},"punctuation.special":{color:"#808080"},string:{color:"#ce9178"},"string.escape":{color:"#569cd6"},"string.regex":{color:"#ce9178"},"string.special":{color:"#ce9178"},"string.special.symbol":{color:"#ce9178"},tag:{color:"#569cd6"},"text.literal":{color:"#ce9178"},type:{color:"#4EC9B0"},variable:{color:"#9CDCFE"},"variable.special":{color:"#569cd6"},emphasis:{color:"#E6E6E6",font_style:"italic"},label:{color:"#9CDCFE"},namespace:{color:"#4EC9B0"},predictive:{color:"#6A9955"},primary:{color:"#E6E6E6"},selector:{color:"#D7BA7D"},title:{color:"#569CD6",font_weight:700},enum:{color:"#4EC9B0"},hint:{color:"#6A9955"},link_text:{color:"#CE9178"},link_uri:{color:"#E6E6E6"},variant:{color:"#9CDCFE"},"diff.minus":{color:"#CE9178"},"diff.plus":{color:"#B5CEA8"}}}},HE=Object.freeze(Object.defineProperty({__proto__:null,default:NE},Symbol.toStringTag,{value:"Module"})),ZE={name:"Slack Ochin",appearance:"light",style:{background:"#FFFFFF","editor.background":"#FFFFFF",text:"#000000","editor.foreground":"#000000","editor.active_line.background":"#EEEEEE","search.match_background":"#AED4FB",hint:"#F9F9F9",players:[{cursor:"#000000",selection:"#AED4FB"}],created:"#ECB22E",deleted:"#e53935",modified:"#ECB22E","terminal.ansi.black":"#000000","terminal.ansi.red":"#e53935","terminal.ansi.green":"#91b859","terminal.ansi.yellow":"#ffb62c","terminal.ansi.blue":"#6182b8","terminal.ansi.magenta":"#7c4dff","terminal.ansi.cyan":"#39adb5","terminal.ansi.white":"#ffffff","terminal.ansi.bright_black":"#90a4ae","terminal.ansi.bright_red":"#e53935","terminal.ansi.bright_green":"#91b859","terminal.ansi.bright_yellow":"#ffb62c","terminal.ansi.bright_blue":"#6182b8","terminal.ansi.bright_magenta":"#7c4dff","terminal.ansi.bright_cyan":"#39adb5","terminal.ansi.bright_white":"#ffffff",syntax:{attribute:{color:"#df8618",font_style:"italic"},comment:{color:"#357b42",font_style:"italic"},"comment.doc":{color:"#357b42",font_style:"italic"},constant:{color:"#174781"},constructor:{color:"#0444ac"},emphasis:{color:"#174781",font_style:"italic"},"emphasis.strong":{color:"#08134A",font_weight:700},function:{color:"#7eb233"},keyword:{color:"#7b30d0"},number:{color:"#174781"},string:{color:"#a44185"},"string.escape":{color:"#174781"},"string.regex":{color:"#a44185"},"string.special":{color:"#a44185"},"string.special.symbol":{color:"#a44185"},tag:{color:"#0444ac"},"text.literal":{color:"#a44185"},type:{color:"#0444ac"},variable:{color:"#2f86d2"},"variable.special":{color:"#2f86d2"},boolean:{color:"#174781"},embedded:{color:"#000000"},label:{color:"#2f86d2"},namespace:{color:"#0444ac"},operator:{color:"#7B30D0"},predictive:{color:"#357b42"},preproc:{color:"#7b30d0"},primary:{color:"#000000"},property:{color:"#2F86D2"},punctuation:{color:"#000000"},selector:{color:"#0444AC"},title:{color:"#0444ac"},enum:{color:"#0444AC"},hint:{color:"#F9F9F9"},link_text:{color:"#A44185"},link_uri:{color:"#924205"},variant:{color:"#2F86D2"},"diff.minus":{color:"#e53935"},"diff.plus":{color:"#ECB22E"},"property.json_key":{color:"#DC3EB7"},"selector.class":{color:"#DF8618",font_style:"italic"},"selector.id":{color:"#DF8618",font_style:"italic"},"selector.pseudo":{color:"#DF8618",font_style:"italic"}}}},xE=Object.freeze(Object.defineProperty({__proto__:null,default:ZE},Symbol.toStringTag,{value:"Module"})),TE={name:"Snazzy Light",appearance:"light",style:{background:"#fafbfc",foreground:"#565869",text:"#565869","editor.background":"#fafbfc","editor.foreground":"#565869","editor.active_line.background":"#f3f4f5","search.match_background":"#00e6e06a",error:"#ff5c57",warning:"#b38700",info:"#09a1ed",modified:"#00A39F","terminal.ansi.black":"#565869","terminal.ansi.red":"#ff5c57","terminal.ansi.green":"#2dae58","terminal.ansi.yellow":"#cf9c00","terminal.ansi.blue":"#09a1ed","terminal.ansi.magenta":"#f767bb","terminal.ansi.cyan":"#13bbb7","terminal.ansi.white":"#fafbf9","terminal.ansi.bright_black":"#75798f","terminal.ansi.bright_red":"#ffaeac","terminal.ansi.bright_green":"#35cf68","terminal.ansi.bright_yellow":"#f5b900","terminal.ansi.bright_blue":"#14b1ff","terminal.ansi.bright_magenta":"#ff94d2","terminal.ansi.bright_cyan":"#13bbb7","terminal.ansi.bright_white":"#ffffff",syntax:{comment:{color:"#adb1c2",font_style:"italic"},"comment.doc":{color:"#adb1c2"},function:{color:"#09a1ed"},"function.method":{color:"#09a1ed"},"function.builtin":{color:"#11658f"},"function.constructor":{color:"#09a1ed"},string:{color:"#cf9c00"},"string.escape":{color:"#f5b900"},"string.regex":{color:"#13bbb7"},"string.special":{color:"#cf9c00"},type:{color:"#2dae58"},"type.builtin":{color:"#2dae58"},constant:{color:"#2dae58"},"constant.builtin":{color:"#2dae58"},"constant.macro":{color:"#11658f"},number:{color:"#ff5c57"},boolean:{color:"#2dae58"},property:{color:"#11658f"},operator:{color:"#adb1c2"},punctuation:{color:"#adb1c2"},"punctuation.bracket":{color:"#adb1c2"},"punctuation.delimiter":{color:"#adb1c2"},variable:{color:"#565869"},"variable.special":{color:"#13bbb7"},"variable.parameter":{color:"#565869"},tag:{color:"#13bbb7"},attribute:{color:"#ff8380"},constructor:{color:"#13bbb7"},embedded:{color:"#565869"},keyword:{color:"#f767bb"},emphasis:{color:"#13BBB7",font_style:"italic"},label:{color:"#565869"},namespace:{color:"#2dae58"},predictive:{color:"#adb1c2"},preproc:{color:"#f767bb"},primary:{color:"#565869"},selector:{color:"#F767BB"},title:{color:"#2DAE58"},enum:{color:"#2dae58"},hint:{color:"#adb1c2"},link_text:{color:"#09A1ED"},link_uri:{color:"#565869"},variant:{color:"#565869"},"diff.minus":{color:"#888888"},"diff.plus":{color:"#888888"},"emphasis.strong":{color:"#13BBB7",font_weight:700},"text.literal":{color:"#F767BB"}}}},WE=Object.freeze(Object.defineProperty({__proto__:null,default:TE},Symbol.toStringTag,{value:"Module"})),_E={name:"Solarized Dark",appearance:"dark",style:{background:"#002b36ff",text:"#839496ff","editor.background":"#002b36ff","editor.foreground":"#839496ff","editor.active_line.background":"#073642ff","editor.document_highlight.bracket_background":"#8394961a","search.match_background":"#83949633",players:[{cursor:"#d30102ff",background:"#d3010226",selection:"#274642ff"},{cursor:"#d39d01ff",background:"#d39d0126",selection:"#d39d014d"},{cursor:"#6bd301ff",background:"#6bd30126",selection:"#6bd3014d"},{cursor:"#01d334ff",background:"#01d33426",selection:"#01d3344d"},{cursor:"#01d3d2ff",background:"#01d3d226",selection:"#01d3d24d"},{cursor:"#0136d3ff",background:"#0136d326",selection:"#0136d34d"},{cursor:"#6901d3ff",background:"#6901d326",selection:"#6901d34d"},{cursor:"#d3019fff",background:"#d3019f26",selection:"#d3019f4d"}],error:"#f44747ff",warning:"#cca700ff",info:"#3794ffff",hint:"#969696ff","terminal.ansi.black":"#073642ff","terminal.ansi.red":"#dc322fff","terminal.ansi.green":"#859900ff","terminal.ansi.yellow":"#b58900ff","terminal.ansi.blue":"#268bd2ff","terminal.ansi.magenta":"#d33682ff","terminal.ansi.cyan":"#2aa198ff","terminal.ansi.white":"#eee8d5ff","terminal.ansi.bright_black":"#002b36ff","terminal.ansi.bright_red":"#cb4b16ff","terminal.ansi.bright_green":"#586e75ff","terminal.ansi.bright_yellow":"#657b83ff","terminal.ansi.bright_blue":"#839496ff","terminal.ansi.bright_magenta":"#6c71c4ff","terminal.ansi.bright_cyan":"#93a1a1ff","terminal.ansi.bright_white":"#fdf6e3ff",syntax:{comment:{color:"#586e75ff",font_style:"italic"},"comment.doc":{color:"#586e75ff",font_style:"italic"},string:{color:"#2aa198ff"},"string.regex":{color:"#dc322fff"},"string.escape":{color:"#cb4b16ff"},link_text:{color:"#2aa198ff"},number:{color:"#d33682ff"},boolean:{color:"#b58900ff"},"constant.builtin":{color:"#b58900ff"},constant:{color:"#268BD2"},variable:{color:"#268BD2"},"variable.special":{color:"#268bd2ff"},keyword:{color:"#859900ff"},operator:{color:"#859900ff"},type:{color:"#cb4b16ff"},"type.builtin":{color:"#859900ff"},function:{color:"#268bd2ff"},"function.builtin":{color:"#268bd2ff"},tag:{color:"#268bd2ff"},attribute:{color:"#93a1a1ff"},"punctuation.special":{color:"#839496ff"},"punctuation.bracket":{color:"#839496ff"},"punctuation.delimiter":{color:"#839496ff"},punctuation:{color:"#839496ff"},preproc:{color:"#b58900ff"},title:{color:"#268bd2ff",font_weight:700},"emphasis.strong":{font_weight:700},emphasis:{color:"#D33682",font_style:"italic"},"text.literal":{color:"#2aa198ff"},enum:{color:"#cb4b16ff"},property:{color:"#839496ff"},label:{color:"#839496ff"},constructor:{color:"#268bd2ff"},namespace:{color:"#cb4b16ff"},"diff.minus":{color:"#dc322fff"},"diff.plus":{color:"#859900ff"},embedded:{color:"#839496ff"},selector:{color:"#268bd2ff"},"selector.pseudo":{color:"#93a1a1ff"},variant:{color:"#268bd2ff"},"string.special":{color:"#2aa198ff"},"string.special.symbol":{color:"#cb4b16ff"},primary:{color:"#839496ff"},link_uri:{color:"#839496ff"},hint:{color:"#83949666"},predictive:{color:"#83949666"},"punctuation.list_marker":{color:"#839496ff"},"punctuation.markup":{color:"#839496ff"},"keyword.declaration":{color:"#93A1A1",font_weight:700},"property.json_key":{color:"#859900"},"selector.class":{color:"#93A1A1"},"selector.id":{color:"#93A1A1"},"tag.doctype":{color:"#839496ff"},"variable.parameter":{color:"#839496ff"},"keyword.jsdoc":{color:"#93A1A1",font_weight:700},"punctuation.bracket.html":{color:"#586E75"},"punctuation.bracket.jsx":{color:"#586E75"},"punctuation.delimiter.html":{color:"#586E75"},"punctuation.delimiter.jsx":{color:"#586E75"},"tag.component.jsx":{color:"#859900"}},created:"#81b88b",deleted:"#c74e39",modified:"#E2C08D"}},PE=Object.freeze(Object.defineProperty({__proto__:null,default:_E},Symbol.toStringTag,{value:"Module"})),XE={name:"Solarized Light",appearance:"light",style:{background:"#fdf6e3ff",text:"#657b83ff","editor.background":"#fdf6e3ff","editor.foreground":"#657b83ff","editor.active_line.background":"#eee8d5ff","editor.document_highlight.bracket_background":"#657b831a","search.match_background":"#657b8333",players:[{cursor:"#657b83ff",background:"#657b8326",selection:"#eee8d5ff"},{cursor:"#666583ff",background:"#66658326",selection:"#6665834d"},{cursor:"#7c6583ff",background:"#7c658326",selection:"#7c65834d"},{cursor:"#836573ff",background:"#83657326",selection:"#8365734d"},{cursor:"#836d65ff",background:"#836d6526",selection:"#836d654d"},{cursor:"#838365ff",background:"#83836526",selection:"#8383654d"},{cursor:"#6c8365ff",background:"#6c836526",selection:"#6c83654d"},{cursor:"#658374ff",background:"#65837426",selection:"#6583744d"}],error:"#f44747ff",warning:"#cca700ff",info:"#3794ffff",hint:"#969696ff","terminal.ansi.black":"#073642ff","terminal.ansi.red":"#dc322fff","terminal.ansi.green":"#859900ff","terminal.ansi.yellow":"#b58900ff","terminal.ansi.blue":"#268bd2ff","terminal.ansi.magenta":"#d33682ff","terminal.ansi.cyan":"#2aa198ff","terminal.ansi.white":"#eee8d5ff","terminal.ansi.bright_black":"#002b36ff","terminal.ansi.bright_red":"#cb4b16ff","terminal.ansi.bright_green":"#586e75ff","terminal.ansi.bright_yellow":"#657b83ff","terminal.ansi.bright_blue":"#839496ff","terminal.ansi.bright_magenta":"#6c71c4ff","terminal.ansi.bright_cyan":"#93a1a1ff","terminal.ansi.bright_white":"#fdf6e3ff",syntax:{comment:{color:"#93a1a1ff",font_style:"italic"},"comment.doc":{color:"#93a1a1ff",font_style:"italic"},string:{color:"#2aa198ff"},"string.regex":{color:"#dc322fff"},"string.escape":{color:"#cb4b16ff"},link_text:{color:"#2aa198ff"},number:{color:"#d33682ff"},boolean:{color:"#b58900ff"},"constant.builtin":{color:"#b58900ff"},constant:{color:"#268BD2"},variable:{color:"#268BD2"},"variable.special":{color:"#268bd2ff"},keyword:{color:"#859900ff"},operator:{color:"#859900ff"},type:{color:"#cb4b16ff"},"type.builtin":{color:"#859900ff"},function:{color:"#268bd2ff"},"function.builtin":{color:"#268bd2ff"},tag:{color:"#268bd2ff"},attribute:{color:"#93a1a1ff"},"punctuation.special":{color:"#657b83ff"},"punctuation.bracket":{color:"#657b83ff"},"punctuation.delimiter":{color:"#657b83ff"},punctuation:{color:"#657b83ff"},preproc:{color:"#b58900ff"},title:{color:"#268bd2ff",font_weight:700},"emphasis.strong":{font_weight:700},emphasis:{color:"#D33682",font_style:"italic"},"text.literal":{color:"#2aa198ff"},enum:{color:"#cb4b16ff"},property:{color:"#657b83ff"},label:{color:"#657b83ff"},constructor:{color:"#268bd2ff"},namespace:{color:"#cb4b16ff"},"diff.minus":{color:"#dc322fff"},"diff.plus":{color:"#859900ff"},embedded:{color:"#657b83ff"},selector:{color:"#268bd2ff"},"selector.pseudo":{color:"#93a1a1ff"},variant:{color:"#268bd2ff"},"string.special":{color:"#2aa198ff"},"string.special.symbol":{color:"#cb4b16ff"},primary:{color:"#657b83ff"},link_uri:{color:"#657b83ff"},hint:{color:"#657b8366"},predictive:{color:"#657b8366"},"punctuation.list_marker":{color:"#657b83ff"},"punctuation.markup":{color:"#657b83ff"},"keyword.declaration":{color:"#586E75",font_weight:700},"property.json_key":{color:"#859900"},"selector.class":{color:"#93A1A1"},"selector.id":{color:"#93A1A1"},"tag.doctype":{color:"#657b83ff"},"variable.parameter":{color:"#657b83ff"},"keyword.jsdoc":{color:"#586E75",font_weight:700},"punctuation.bracket.html":{color:"#93A1A1"},"punctuation.bracket.jsx":{color:"#93A1A1"},"punctuation.delimiter.html":{color:"#93A1A1"},"punctuation.delimiter.jsx":{color:"#93A1A1"},"tag.component.jsx":{color:"#859900"}},created:"#587c0c",deleted:"#ad0707",modified:"#895503"}},KE=Object.freeze(Object.defineProperty({__proto__:null,default:XE},Symbol.toStringTag,{value:"Module"})),VE={name:"Synthwave '84",appearance:"dark",style:{background:"#241b2f",foreground:"#ffffff",text:"#ffffff","editor.background":"#262335","editor.foreground":"#ffffff","editor.active_line.background":"#2a2139","search.match_background":"#ff7edb40",players:[{cursor:"#f97e72",background:"#f97e72",selection:"#f97e7240"},{cursor:"#36f9f6",background:"#36f9f6",selection:"#36f9f640"},{cursor:"#ff7edb",background:"#ff7edb",selection:"#ff7edb40"},{cursor:"#fede5d",background:"#fede5d",selection:"#fede5d40"},{cursor:"#72f1b8",background:"#72f1b8",selection:"#72f1b840"},{cursor:"#03edf9",background:"#03edf9",selection:"#03edf940"},{cursor:"#ff8b39",background:"#ff8b39",selection:"#ff8b3940"},{cursor:"#b893ce",background:"#b893ce",selection:"#b893ce40"}],error:"#fe4450",warning:"#fede5d",info:"#03edf9",hint:"#03edf9",created:"#72f1b8cc",deleted:"#fe4450",modified:"#b893ceee","terminal.ansi.black":"#241b2f","terminal.ansi.red":"#fe4450","terminal.ansi.green":"#72f1b8","terminal.ansi.yellow":"#fede5d","terminal.ansi.blue":"#03edf9","terminal.ansi.magenta":"#ff7edb","terminal.ansi.cyan":"#36f9f6","terminal.ansi.white":"#ffffff","terminal.ansi.bright_black":"#495495","terminal.ansi.bright_red":"#fe4450","terminal.ansi.bright_green":"#72f1b8","terminal.ansi.bright_yellow":"#fede5d","terminal.ansi.bright_blue":"#03edf9","terminal.ansi.bright_magenta":"#ff7edb","terminal.ansi.bright_cyan":"#36f9f6","terminal.ansi.bright_white":"#ffffff",syntax:{JSXAttribute:{color:"#fede5d"},JSXClosingElement:{color:"#ff7edb"},JSXOpeningElement:{color:"#ff7edb"},"ai.suggestion":{color:"#36f9f6",font_style:"italic"},"ai.suggestion.hover":{color:"#03edf9",font_style:"italic"},assistant:{color:"#72f1b8"},attribute:{color:"#fede5d"},boolean:{color:"#f97e72",font_weight:700},"brackethighlighter.tag":{color:"#fede5d"},"brackethighlighter.unmatched":{color:"#fe4450"},comment:{color:"#848bbd",font_style:"italic"},"comment.doc":{color:"#848bbd",font_style:"italic"},constant:{color:"#f97e72"},"constant.character.escape":{color:"#72f1b8"},"constant.language":{color:"#f97e72",font_weight:700},"constant.numeric":{color:"#f97e72"},"constant.other.key.yaml":{color:"#ff7edb"},constructor:{color:"#36f9f6"},"copilot.suggestion":{color:"#36f9f6",font_style:"italic"},"copilot.suggestion.hover":{color:"#03edf9",font_style:"italic"},embedded:{color:"#ffffff",font_style:"normal"},emphasis:{color:"#ff7edb",font_style:"italic"},"emphasis.strong":{color:"#ff7edb",font_weight:700},"entity.name.function":{color:"#36f9f6"},"entity.name.function.async":{color:"#36f9f6"},"entity.name.function.decorator.python":{color:"#36f9f6"},"entity.name.function.generator":{color:"#36f9f6"},"entity.name.function.go":{color:"#36f9f6"},"entity.name.lifetime.rust":{color:"#ff7edb"},"entity.name.macro":{color:"#72f1b8"},"entity.name.section":{color:"#36f9f6"},"entity.name.section.toml":{color:"#36f9f6"},"entity.name.tag":{color:"#ff7edb"},"entity.name.tag.html":{color:"#ff7edb"},"entity.name.tag.toml":{color:"#ff7edb"},"entity.name.tag.yaml":{color:"#ff7edb"},"entity.name.type":{color:"#ff7edb"},"entity.name.type.class":{color:"#72f1b8",font_weight:700},"entity.name.type.class.cpp":{color:"#72f1b8",font_weight:700},"entity.name.type.class.java":{color:"#72f1b8",font_weight:700},"entity.name.type.class.python":{color:"#72f1b8",font_weight:700},"entity.name.type.class.ruby":{color:"#72f1b8",font_weight:700},"entity.name.type.conditional":{color:"#fede5d"},"entity.name.type.cpp":{color:"#72f1b8"},"entity.name.type.enum.cpp":{color:"#72f1b8"},"entity.name.type.enum.java":{color:"#72f1b8"},"entity.name.type.enum.rust":{color:"#72f1b8"},"entity.name.type.generic":{color:"#72f1b8"},"entity.name.type.go":{color:"#72f1b8"},"entity.name.type.interface":{color:"#72f1b8"},"entity.name.type.interface.go":{color:"#ff7edb"},"entity.name.type.interface.java":{color:"#ff7edb"},"entity.name.type.intersection":{color:"#ff7edb"},"entity.name.type.mapped":{color:"#36f9f6"},"entity.name.type.module":{color:"#ff7edb"},"entity.name.type.module.ruby":{color:"#ff7edb"},"entity.name.type.namespace.cpp":{color:"#ff7edb"},"entity.name.type.option":{color:"#72f1b8"},"entity.name.type.result":{color:"#36f9f6"},"entity.name.type.rust":{color:"#72f1b8"},"entity.name.type.struct.rust":{color:"#72f1b8"},"entity.name.type.trait.rust":{color:"#ff7edb"},"entity.name.type.union":{color:"#36f9f6"},"entity.other.attribute-name":{color:"#fede5d"},"entity.other.attribute-name.class.css":{color:"#72f1b8"},"entity.other.attribute-name.html":{color:"#fede5d"},"entity.other.attribute-name.id.css":{color:"#fede5d"},"entity.other.attribute-name.jsx":{color:"#fede5d"},"entity.other.attribute-name.pseudo-class.css":{color:"#36f9f6"},"entity.other.attribute-name.pseudo-element.css":{color:"#36f9f6"},"entity.other.attribute-name.tsx":{color:"#fede5d"},"entity.other.inherited-class":{color:"#72f1b8"},enum:{color:"#ff7edb"},function:{color:"#36f9f6"},ghost_text:{color:"#36f9f6",font_style:"italic"},hint:{color:"#03edf9",font_style:"italic"},inlay_hint:{color:"#848bbd",font_style:"italic"},"inlay_hint.parameter":{color:"#ff7edb",font_style:"italic"},"inlay_hint.type":{color:"#72f1b8",font_style:"italic"},inline_completion:{color:"#36f9f6",font_style:"italic"},"inline_completion.highlight":{color:"#ff7edb"},invalid:{color:"#ffffff"},"invalid.deprecated":{color:"#ffffff"},keyword:{color:"#fede5d"},"keyword.channel.go":{color:"#fede5d"},"keyword.control":{color:"#fede5d"},"keyword.control.conditional":{color:"#fede5d"},"keyword.control.go":{color:"#fede5d"},"keyword.control.import":{color:"#ff7edb"},"keyword.function":{color:"#ff7edb"},"keyword.function.go":{color:"#ff7edb"},"keyword.operator":{color:"#fede5d"},"keyword.operator.in":{color:"#fede5d"},"keyword.operator.is":{color:"#fede5d"},"keyword.operator.keyof":{color:"#ff7edb"},"keyword.operator.logical.python":{color:"#fede5d"},"keyword.operator.type":{color:"#fede5d"},"keyword.operator.typeof":{color:"#ff7edb"},"keyword.other":{color:"#fede5d"},"keyword.other.DDL.sql":{color:"#ff7edb"},"keyword.other.DML.sql":{color:"#ff7edb"},"keyword.other.abstract":{color:"#ff7edb"},"keyword.other.as":{color:"#fede5d"},"keyword.other.async.rust":{color:"#ff7edb"},"keyword.other.const":{color:"#fede5d"},"keyword.other.dyn":{color:"#ff7edb"},"keyword.other.impl":{color:"#fede5d"},"keyword.other.macro":{color:"#72f1b8"},"keyword.other.override":{color:"#ff7edb"},"keyword.other.readonly":{color:"#fede5d"},"keyword.other.satisfies":{color:"#fede5d"},"keyword.other.special-method.ruby":{color:"#36f9f6"},"keyword.other.sql":{color:"#fede5d"},"keyword.other.trait":{color:"#ff7edb"},"keyword.other.unsafe.rust":{color:"#fe4450"},"keyword.other.using":{color:"#ff7edb"},"keyword.other.where":{color:"#fede5d"},label:{color:"#ff7edb"},link_text:{color:"#03edf9"},link_uri:{color:"#72f1b8"},"markup.bold":{color:"#ff7edb",font_weight:700},"markup.bold.markdown":{color:"#ff7edb",font_weight:700},"markup.heading":{color:"#36f9f6"},"markup.heading.markdown":{color:"#36f9f6"},"markup.italic":{color:"#ff7edb",font_style:"italic"},"markup.italic.markdown":{color:"#ff7edb",font_style:"italic"},"markup.list":{color:"#ff7edb"},"markup.quote":{color:"#848bbd",font_style:"italic"},"markup.raw":{color:"#72f1b8",font_style:"italic"},"markup.raw.inline":{color:"#72f1b8",font_style:"italic"},"markup.raw.inline.markdown":{color:"#72f1b8",font_style:"italic"},"markup.underline":{color:"#72f1b8"},"markup.underline.link.markdown":{color:"#72f1b8"},"meta.attribute.rust":{color:"#fede5d"},"meta.diff.header":{color:"#36f9f6"},"meta.function-call.python":{color:"#36f9f6"},"meta.jsx.children":{color:"#ffffff"},"meta.output":{color:"#848bbd",font_style:"italic"},"meta.separator":{color:"#848bbd",font_style:"italic"},"meta.tag.jsx":{color:"#ff7edb"},number:{color:"#f97e72"},operator:{color:"#fede5d"},predictive:{color:"#36f9f6",font_style:"italic"},preproc:{color:"#ff7edb"},primary:{color:"#ffffff"},property:{color:"#ff7edb"},punctuation:{color:"#ffffff"},"punctuation.bracket":{color:"#ffffff"},"punctuation.definition.list.begin.markdown":{color:"#ff7edb"},"punctuation.delimiter":{color:"#ffffff"},"punctuation.list_marker":{color:"#ff7edb"},"punctuation.special":{color:"#fede5d"},"source.c":{color:"#ffffff"},"source.cpp":{color:"#ffffff"},"source.css":{color:"#ffffff"},"source.go":{color:"#ffffff"},"source.html":{color:"#ffffff"},"source.java":{color:"#ffffff"},"source.js":{color:"#ffffff"},"source.json":{color:"#ffffff"},"source.jsx":{color:"#ffffff"},"source.markdown":{color:"#ffffff"},"source.python":{color:"#ffffff"},"source.ruby":{color:"#ffffff"},"source.rust":{color:"#ffffff"},"source.shell":{color:"#ffffff"},"source.sql":{color:"#ffffff"},"source.toml":{color:"#ffffff"},"source.ts":{color:"#ffffff"},"source.tsx":{color:"#ffffff"},"source.yaml":{color:"#ffffff"},storage:{color:"#fede5d"},"storage.modifier":{color:"#fede5d"},"storage.modifier.async":{color:"#ff7edb"},"storage.modifier.java":{color:"#fede5d"},"storage.type":{color:"#ff7edb"},"storage.type.annotation.java":{color:"#ff7edb"},string:{color:"#ff8b39"},"string.escape":{color:"#72f1b8"},"string.regex":{color:"#72f1b8"},"string.special":{color:"#72f1b8",font_style:"italic"},"string.special.symbol":{color:"#ff8b39"},"support.class":{color:"#72f1b8",font_weight:700},"support.constant":{color:"#f97e72"},"support.function":{color:"#72f1b8"},"support.other.namespace":{color:"#ff7edb"},"support.type":{color:"#72f1b8"},"support.type.property-name":{color:"#ff7edb"},"support.type.property-name.css":{color:"#ff7edb"},"support.type.property-name.json":{color:"#ff7edb"},tag:{color:"#ff7edb"},"text.literal":{color:"#ff8b39"},title:{color:"#36f9f6"},type:{color:"#ff7edb"},"type.builtin":{color:"#ff7edb"},variable:{color:"#ff7edb"},"variable.function":{color:"#36f9f6"},"variable.language":{color:"#ff7edb"},"variable.other.bracket.shell":{color:"#ff7edb"},"variable.other.member":{color:"#ff7edb"},"variable.other.normal.shell":{color:"#ff7edb"},"variable.other.readwrite.class.ruby":{color:"#ff7edb"},"variable.other.readwrite.instance.ruby":{color:"#ff7edb"},"variable.parameter":{color:"#f97e72",font_style:"italic"},"variable.parameter.function.language.special.cls.python":{color:"#ff7edb"},"variable.parameter.function.language.special.self.python":{color:"#ff7edb"},"variable.special":{color:"#ff7edb"},variant:{color:"#36f9f6"},"ghost_text.background":{color:"#36f9f615"},"ghost_text.border":{color:"#36f9f640"},"assistant.background":{color:"#72f1b815"},"assistant.border":{color:"#72f1b840"},"inlay_hint.background":{color:"#262335"},namespace:{color:"#FE4450"},selector:{color:"#72F1B8"},"diff.minus":{color:"#fe4450"},"diff.plus":{color:"#72f1b8cc"},"selector.class":{color:"#FEDE5D"},"selector.id":{color:"#36F9F6"},"selector.pseudo":{color:"#D50"}}}},qE=Object.freeze(Object.defineProperty({__proto__:null,default:VE},Symbol.toStringTag,{value:"Module"})),vE={name:"Tokyo Night",appearance:"dark",style:{background:"#1a1b26",text:"#a9b1d6","editor.background":"#1a1b26","editor.foreground":"#a9b1d6","editor.active_line.background":"#1e202e","editor.document_highlight.bracket_background":"#414868","search.match_background":"#414868",players:[{cursor:"#7c7f93",background:"#7c7f93",selection:"#267ead3d"}],error:"#f7768e",warning:"#e0af68",info:"#0da0ba",hint:"#51597d",created:"#449dab",deleted:"#914c54",modified:"#6183bb","terminal.ansi.black":"#363b54","terminal.ansi.red":"#f7768e","terminal.ansi.green":"#73daca","terminal.ansi.yellow":"#e0af68","terminal.ansi.blue":"#7aa2f7","terminal.ansi.magenta":"#bb9af7","terminal.ansi.cyan":"#7dcfff","terminal.ansi.white":"#787c99","terminal.ansi.bright_black":"#363b54","terminal.ansi.bright_red":"#f7768e","terminal.ansi.bright_green":"#41a6b5","terminal.ansi.bright_yellow":"#e0af68","terminal.ansi.bright_blue":"#7aa2f7","terminal.ansi.bright_magenta":"#bb9af7","terminal.ansi.bright_cyan":"#7dcfff","terminal.ansi.bright_white":"#acb0d0",syntax:{attribute:{color:"#bb9af7"},boolean:{color:"#ff9e64"},comment:{color:"#51597d"},"comment.doc":{color:"#51597d"},constant:{color:"#ff9e64"},constructor:{color:"#f7768e"},emphasis:{color:"#f7768e",font_style:"italic"},"emphasis.strong":{color:"#f7768e",font_weight:700},function:{color:"#7aa2f7"},keyword:{color:"#bb9af7"},label:{color:"#c0caf5"},link_text:{color:"#73daca"},link_uri:{color:"#73daca"},number:{color:"#ff9e64"},operator:{color:"#89ddff"},preproc:{color:"#73daca"},punctuation:{color:"#89ddff"},"punctuation.bracket":{color:"#89ddff"},"punctuation.delimiter":{color:"#89ddff"},"punctuation.list_marker":{color:"#89ddff"},"punctuation.special":{color:"#89ddff"},string:{color:"#9ece6a"},"string.escape":{color:"#bb9af7"},"string.regex":{color:"#9ece6a"},"string.special":{color:"#9ece6a"},"string.special.symbol":{color:"#9ece6a"},tag:{color:"#f7768e"},"text.literal":{color:"#9ece6a"},title:{color:"#ff9e64"},type:{color:"#0db9d7"},variable:{color:"#c0caf5"},"variable.special":{color:"#f7768e"},character:{color:"#9ece6a"},"character.special":{color:"#bb9af7"},"comment.documentation":{color:"#51597d"},"comment.error":{color:"#f7768e"},"comment.hint":{color:"#0da0ba"},"comment.note":{color:"#7dcfff"},"comment.todo":{color:"#e0af68"},"comment.warning":{color:"#e0af68"},concept:{color:"#bb9af7"},"constant.builtin":{color:"#ff9e64"},"constant.macro":{color:"#bb9af7"},"diff.minus":{color:"#f7768e"},"diff.plus":{color:"#9ece6a"},embedded:{color:"#c0caf5"},enum:{color:"#0db9d7"},field:{color:"#c0caf5"},float:{color:"#ff9e64"},"function.builtin":{color:"#7aa2f7"},"function.call":{color:"#7aa2f7"},"function.decorator":{color:"#bb9af7"},"function.macro":{color:"#bb9af7"},"function.method":{color:"#7aa2f7"},"function.method.call":{color:"#7aa2f7"},"keyword.conditional":{color:"#bb9af7"},"keyword.conditional.ternary":{color:"#bb9af7"},"keyword.coroutine":{color:"#bb9af7"},"keyword.debug":{color:"#f7768e"},"keyword.directive":{color:"#bb9af7"},"keyword.directive.define":{color:"#bb9af7"},"keyword.exception":{color:"#bb9af7"},"keyword.export":{color:"#bb9af7"},"keyword.function":{color:"#bb9af7"},"keyword.import":{color:"#bb9af7"},"keyword.modifier":{color:"#bb9af7"},"keyword.operator":{color:"#89ddff"},"keyword.repeat":{color:"#bb9af7"},"keyword.return":{color:"#bb9af7"},"keyword.type":{color:"#bb9af7"},module:{color:"#c0caf5"},namespace:{color:"#c0caf5"},"number.float":{color:"#ff9e64"},parameter:{color:"#c0caf5"},parent:{color:"#c0caf5"},predoc:{color:"#51597d"},primary:{color:"#c0caf5"},property:{color:"#c0caf5"},"string.doc":{color:"#9ece6a"},"string.documentation":{color:"#9ece6a"},"string.regexp":{color:"#9ece6a"},"string.special.path":{color:"#9ece6a"},"string.special.url":{color:"#7dcfff"},symbol:{color:"#c0caf5"},"tag.attribute":{color:"#bb9af7"},"tag.delimiter":{color:"#89ddff"},"tag.doctype":{color:"#51597d"},"type.builtin":{color:"#0db9d7"},"type.class.definition":{color:"#0db9d7"},"type.definition":{color:"#0db9d7"},"type.interface":{color:"#0db9d7"},"type.super":{color:"#0db9d7"},"variable.builtin":{color:"#f7768e"},"variable.member":{color:"#c0caf5"},"variable.parameter":{color:"#c0caf5"},variant:{color:"#c0caf5"},predictive:{color:"#51597d"},selector:{color:"#0DB9D7"},hint:{color:"#51597d"},"selector.class":{color:"#9ECE6A"},"selector.id":{color:"#FC7B7B"},"selector.pseudo":{color:"#BB9AF7"}}}},OE=Object.freeze(Object.defineProperty({__proto__:null,default:vE},Symbol.toStringTag,{value:"Module"})),zE={name:"Vesper",appearance:"dark",style:{background:"#101010",text:"#FFFFFF","editor.background":"#101010","editor.foreground":"#FFFFFF","editor.active_line.background":"#101010","search.match_background":"#575757",players:[{cursor:"#FFC799ff",background:"#FFC799ff",selection:"#FFC7993d"},{cursor:"#99FFE4ff",background:"#99FFE4ff",selection:"#99FFE43d"}],error:"#FF8080ff",warning:"#FFC799ff",info:"#7E7E7Eff",hint:"#A0A0A0","terminal.ansi.black":"#101010","terminal.ansi.red":"#f5a191","terminal.ansi.green":"#90b99f","terminal.ansi.yellow":"#e6b99d","terminal.ansi.blue":"#aca1cf","terminal.ansi.magenta":"#e29eca","terminal.ansi.cyan":"#ea83a5","terminal.ansi.white":"#A0A0A0","terminal.ansi.bright_black":"#7E7E7E","terminal.ansi.bright_red":"#ff8080","terminal.ansi.bright_green":"#99FFE4","terminal.ansi.bright_yellow":"#FFC799","terminal.ansi.bright_blue":"#b9aeda","terminal.ansi.bright_magenta":"#ecaad6","terminal.ansi.bright_cyan":"#f591b2","terminal.ansi.bright_white":"#ffffff",syntax:{attribute:{color:"#A0A0A0"},comment:{color:"#8b8b8b94"},"comment.doc":{color:"#8b8b8b94"},constant:{color:"#FFC799"},constructor:{color:"#FFC799"},emphasis:{color:"#FFFFFF",font_style:"italic"},"emphasis.strong":{color:"#FFFFFF",font_weight:700},function:{color:"#FFC799"},keyword:{color:"#A0A0A0"},label:{color:"#FFC799"},link_text:{color:"#FFFFFF"},link_uri:{color:"#FFFFFF"},number:{color:"#FFC799"},operator:{color:"#A0A0A0"},punctuation:{color:"#A0A0A0"},"punctuation.bracket":{color:"#A0A0A0"},"punctuation.delimiter":{color:"#A0A0A0"},"punctuation.list_marker":{color:"#A0A0A0"},"punctuation.special":{color:"#A0A0A0"},string:{color:"#99FFE4"},"string.escape":{color:"#FFC799"},"string.regex":{color:"#99FFE4"},"string.special":{color:"#99FFE4"},"string.special.symbol":{color:"#99FFE4"},tag:{color:"#FFC799"},"text.literal":{color:"#99FFE4"},title:{color:"#FFC799"},type:{color:"#FFC799"},variable:{color:"#FFFFFF"},"variable.special":{color:"#A0A0A0"},boolean:{color:"#FFC799"},embedded:{color:"#FFFFFF"},namespace:{color:"#FFC799"},predictive:{color:"#8b8b8b94"},preproc:{color:"#A0A0A0"},primary:{color:"#FFFFFF"},property:{color:"#FFF"},selector:{color:"#FFC799"},enum:{color:"#FFC799"},hint:{color:"#A0A0A0"},variant:{color:"#FFF"},"diff.minus":{color:"#FF8080"},"diff.plus":{color:"#99FFE4"},"property.json_key":{color:"#FFC799"},"selector.pseudo":{color:"#A0A0A0"}},created:"#81b88b",deleted:"#c74e39",modified:"#E2C08D"}},$E=Object.freeze(Object.defineProperty({__proto__:null,default:zE},Symbol.toStringTag,{value:"Module"})),AI={name:"Vitesse Black",appearance:"dark",style:{background:"#000000",text:"#dbd7cacc","editor.background":"#000000","editor.foreground":"#dbd7cacc","editor.active_line.background":"#121212","editor.document_highlight.bracket_background":"#eeeeee18","search.match_background":"#121212",players:[{cursor:"#dbd7cacc",background:"#dbd7cacc",selection:"#363636"},{cursor:"#d4976c",background:"#d4976c",selection:"#d4976c4D"},{cursor:"#e6cc77",background:"#e6cc77",selection:"#e6cc774D"},{cursor:"#4d9375",background:"#4d9375",selection:"#4d93754D"},{cursor:"#5eaab5",background:"#5eaab5",selection:"#5eaab54D"},{cursor:"#6394bf",background:"#6394bf",selection:"#6394bf4D"},{cursor:"#d9739f",background:"#d9739f",selection:"#d9739f4D"},{cursor:"#cb7676",background:"#cb7676",selection:"#cb76764D"}],error:"#cb7676",warning:"#d4976c",info:"#6394bf",hint:"#444444",created:"#4d9375",deleted:"#cb7676",modified:"#6394bf","terminal.ansi.black":"#dbd7cacc","terminal.ansi.red":"#cb7676","terminal.ansi.green":"#4d9375","terminal.ansi.yellow":"#e6cc77","terminal.ansi.blue":"#6394bf","terminal.ansi.magenta":"#d9739f","terminal.ansi.cyan":"#5eaab5","terminal.ansi.white":"#dbd7ca","terminal.ansi.bright_black":"#777777","terminal.ansi.bright_red":"#cb7676","terminal.ansi.bright_green":"#4d9375","terminal.ansi.bright_yellow":"#e6cc77","terminal.ansi.bright_blue":"#6394bf","terminal.ansi.bright_magenta":"#d9739f","terminal.ansi.bright_cyan":"#5eaab5","terminal.ansi.bright_white":"#dbd7ca",syntax:{attribute:{color:"#bd976a"},boolean:{color:"#4d9375"},character:{color:"#dbd7cacc"},"character.special":{color:"#dbd7cacc"},comment:{color:"#758575dd"},"comment.doc":{color:"#758575dd"},concept:{color:"#dbd7cacc"},constant:{color:"#bd976a"},"constant.builtin":{color:"#cb7676"},"constant.macro":{color:"#c99076"},constructor:{color:"#4d9375"},diff:{color:"#dbd7cacc"},"diff.minus":{color:"#dbd7cacc"},"diff.plus":{color:"#dbd7cacc"},embedded:{color:"#dbd7cacc"},emphasis:{color:"#dbd7cacc",font_style:"italic"},"emphasis.strong":{color:"#dbd7cacc",font_weight:700},enum:{color:"#dbd7cacc"},field:{color:"#dbd7cacc"},float:{color:"#dbd7cacc"},function:{color:"#80a665"},"function.builtin":{color:"#80a665"},"function.call":{color:"#80a665"},"function.decorator":{color:"#80a665"},"function.macro":{color:"#80a665"},"function.method":{color:"#80a665"},"function.method.call":{color:"#80a665"},hint:{color:"#dbd7cacc"},keyword:{color:"#cb7676"},"keyword.conditional":{color:"#4d9375"},"keyword.conditional.ternary":{color:"#4d9375"},"keyword.coroutine":{color:"#4d9375"},"keyword.debug":{color:"#4d9375"},"keyword.directive":{color:"#4d9375"},"keyword.directive.define":{color:"#4d9375"},"keyword.exception":{color:"#4d9375"},"keyword.export":{color:"#4d9375"},"keyword.function":{color:"#4d9375"},"keyword.import":{color:"#4d9375"},"keyword.modifier":{color:"#4d9375"},"keyword.operator":{color:"#4d9375"},"keyword.repeat":{color:"#4d9375"},"keyword.return":{color:"#4d9375"},"keyword.type":{color:"#5DA994"},label:{color:"#80a665"},link_text:{color:"#c98a7d"},link_uri:{color:"#758575dd"},module:{color:"#dbd7cacc"},namespace:{color:"#5d99a9"},number:{color:"#4C9A91"},"number.float":{color:"#dbd7cacc"},operator:{color:"#cb7676"},parameter:{color:"#bd976a"},parent:{color:"#dbd7cacc"},predictive:{color:"#dbd7cacc"},predoc:{color:"#dbd7cacc"},preproc:{color:"#dbd7cacc"},primary:{color:"#4d9375"},property:{color:"#b8a965"},"property.json_key":{color:"#b8a965"},punctuation:{color:"#444444"},"punctuation.bracket":{color:"#444444"},"punctuation.delimiter":{color:"#444444"},"punctuation.delimiter.jsx":{color:"#444444"},"punctuation.list_marker":{color:"#444444"},"punctuation.special":{color:"#444444"},"punctuation.special.symbol":{color:"#444444"},selector:{color:"#bd976a"},"selector.pseudo":{color:"#80a665"},string:{color:"#c98a7d"},"string.doc":{color:"#c98a7d"},"string.documentation":{color:"#c98a7d"},"string.escape":{color:"#6872ab"},"punctuation.markup":{color:"#444444"},"string.regex":{color:"#c4704f"},"string.regexp":{color:"#c4704f"},"string.special":{color:"#c98a7d"},"string.special.path":{color:"#c98a7d"},"string.special.symbol":{color:"#c98a7d"},"string.special.url":{color:"#c98a7d"},symbol:{color:"#c98a7d"},tag:{color:"#4d9375"},"tag.attribute":{color:"#4d9375"},"tag.delimiter":{color:"#4d9375"},"tag.doctype":{color:"#4d9375"},text:{color:"#dbd7cacc"},"text.literal":{color:"#dedcd590"},title:{color:"#4d9375",font_weight:700},type:{color:"#5d99a9"},"type.builtin":{color:"#5DA994"},"type.builtin.class":{color:"#6872ab"},"type.class.definition":{color:"#5DA994"},"type.definition":{color:"#5DA994"},"type.interface":{color:"#5DA994"},"type.super":{color:"#5DA994"},variable:{color:"#bd976a"},"variable.builtin":{color:"#bd976a"},"variable.member":{color:"#bd976a"},"variable.parameter":{color:"#bd976a"},"variable.special":{color:"#c99076"},variant:{color:"#bd976a"},"constant.comment.todo":{color:"#5eaab5"},"string.comment.info":{color:"#6394bf"},"keyword.comment.warn":{color:"#d4976c"},"property.comment.error":{color:"#cb7676"}}}},BI=Object.freeze(Object.defineProperty({__proto__:null,default:AI},Symbol.toStringTag,{value:"Module"})),QI={name:"Vitesse Dark",appearance:"dark",style:{background:"#121212",text:"#dbd7caee","editor.background":"#121212","editor.foreground":"#dbd7caee","editor.active_line.background":"#181818","editor.document_highlight.bracket_background":"#eeeeee18","search.match_background":"#181818",players:[{cursor:"#dbd7caee",background:"#dbd7caee",selection:"#363636"},{cursor:"#d4976c",background:"#d4976c",selection:"#d4976c4D"},{cursor:"#e6cc77",background:"#e6cc77",selection:"#e6cc774D"},{cursor:"#4d9375",background:"#4d9375",selection:"#4d93754D"},{cursor:"#5eaab5",background:"#5eaab5",selection:"#5eaab54D"},{cursor:"#6394bf",background:"#6394bf",selection:"#6394bf4D"},{cursor:"#d9739f",background:"#d9739f",selection:"#d9739f4D"},{cursor:"#cb7676",background:"#cb7676",selection:"#cb76764D"}],error:"#cb7676",warning:"#d4976c",info:"#6394bf",hint:"#666666",created:"#4d9375",deleted:"#cb7676",modified:"#6394bf","terminal.ansi.black":"#dbd7caee","terminal.ansi.red":"#cb7676","terminal.ansi.green":"#4d9375","terminal.ansi.yellow":"#e6cc77","terminal.ansi.blue":"#6394bf","terminal.ansi.magenta":"#d9739f","terminal.ansi.cyan":"#5eaab5","terminal.ansi.white":"#dbd7ca","terminal.ansi.bright_black":"#777777","terminal.ansi.bright_red":"#cb7676","terminal.ansi.bright_green":"#4d9375","terminal.ansi.bright_yellow":"#e6cc77","terminal.ansi.bright_blue":"#6394bf","terminal.ansi.bright_magenta":"#d9739f","terminal.ansi.bright_cyan":"#5eaab5","terminal.ansi.bright_white":"#dbd7ca",syntax:{attribute:{color:"#bd976a"},boolean:{color:"#4d9375"},character:{color:"#dbd7caee"},"character.special":{color:"#dbd7caee"},comment:{color:"#758575dd"},"comment.doc":{color:"#758575dd"},concept:{color:"#dbd7caee"},constant:{color:"#bd976a"},"constant.builtin":{color:"#cb7676"},"constant.macro":{color:"#c99076"},constructor:{color:"#4d9375"},diff:{color:"#dbd7caee"},"diff.minus":{color:"#dbd7caee"},"diff.plus":{color:"#dbd7caee"},embedded:{color:"#dbd7caee"},emphasis:{color:"#dbd7caee",font_style:"italic"},"emphasis.strong":{color:"#dbd7caee",font_weight:700},enum:{color:"#dbd7caee"},field:{color:"#dbd7caee"},float:{color:"#dbd7caee"},function:{color:"#80a665"},"function.builtin":{color:"#80a665"},"function.call":{color:"#80a665"},"function.decorator":{color:"#80a665"},"function.macro":{color:"#80a665"},"function.method":{color:"#80a665"},"function.method.call":{color:"#80a665"},hint:{color:"#dbd7caee"},keyword:{color:"#cb7676"},"keyword.conditional":{color:"#4d9375"},"keyword.conditional.ternary":{color:"#4d9375"},"keyword.coroutine":{color:"#4d9375"},"keyword.debug":{color:"#4d9375"},"keyword.directive":{color:"#4d9375"},"keyword.directive.define":{color:"#4d9375"},"keyword.exception":{color:"#4d9375"},"keyword.export":{color:"#4d9375"},"keyword.function":{color:"#4d9375"},"keyword.import":{color:"#4d9375"},"keyword.modifier":{color:"#4d9375"},"keyword.operator":{color:"#4d9375"},"keyword.repeat":{color:"#4d9375"},"keyword.return":{color:"#4d9375"},"keyword.type":{color:"#5DA994"},label:{color:"#80a665"},link_text:{color:"#c98a7d"},link_uri:{color:"#758575dd"},module:{color:"#dbd7caee"},namespace:{color:"#5d99a9"},number:{color:"#4C9A91"},"number.float":{color:"#dbd7caee"},operator:{color:"#cb7676"},parameter:{color:"#bd976a"},parent:{color:"#dbd7caee"},predictive:{color:"#dbd7caee"},predoc:{color:"#dbd7caee"},preproc:{color:"#dbd7caee"},primary:{color:"#4d9375"},property:{color:"#b8a965"},"property.json_key":{color:"#b8a965"},punctuation:{color:"#666666"},"punctuation.bracket":{color:"#666666"},"punctuation.delimiter":{color:"#666666"},"punctuation.delimiter.jsx":{color:"#666666"},"punctuation.list_marker":{color:"#666666"},"punctuation.special":{color:"#666666"},"punctuation.special.symbol":{color:"#666666"},selector:{color:"#bd976a"},"selector.pseudo":{color:"#80a665"},string:{color:"#c98a7d"},"string.doc":{color:"#c98a7d"},"string.documentation":{color:"#c98a7d"},"string.escape":{color:"#6872ab"},"punctuation.markup":{color:"#666666"},"string.regex":{color:"#c4704f"},"string.regexp":{color:"#c4704f"},"string.special":{color:"#c98a7d"},"string.special.path":{color:"#c98a7d"},"string.special.symbol":{color:"#c98a7d"},"string.special.url":{color:"#c98a7d"},symbol:{color:"#c98a7d"},tag:{color:"#4d9375"},"tag.attribute":{color:"#4d9375"},"tag.delimiter":{color:"#4d9375"},"tag.doctype":{color:"#4d9375"},text:{color:"#dbd7caee"},"text.literal":{color:"#dedcd590"},title:{color:"#4d9375",font_weight:700},type:{color:"#5d99a9"},"type.builtin":{color:"#5DA994"},"type.builtin.class":{color:"#6872ab"},"type.class.definition":{color:"#5DA994"},"type.definition":{color:"#5DA994"},"type.interface":{color:"#5DA994"},"type.super":{color:"#5DA994"},variable:{color:"#bd976a"},"variable.builtin":{color:"#bd976a"},"variable.member":{color:"#bd976a"},"variable.parameter":{color:"#bd976a"},"variable.special":{color:"#c99076"},variant:{color:"#bd976a"},"constant.comment.todo":{color:"#5eaab5"},"string.comment.info":{color:"#6394bf"},"keyword.comment.warn":{color:"#d4976c"},"property.comment.error":{color:"#cb7676"}}}},EI=Object.freeze(Object.defineProperty({__proto__:null,default:QI},Symbol.toStringTag,{value:"Module"})),II={name:"Vitesse Light",appearance:"light",style:{background:"#ffffff",text:"#393a34","editor.background":"#ffffff","editor.foreground":"#393a34","editor.active_line.background":"#f7f7f7","editor.document_highlight.bracket_background":"#22222218","search.match_background":"#f7f7f7",players:[{cursor:"#393a34",background:"#393a34",selection:"#dcdbd6"},{cursor:"#a65e2b",background:"#a65e2b",selection:"#a65e2b4D"},{cursor:"#bda437",background:"#bda437",selection:"#bda4374D"},{cursor:"#1e754f",background:"#1e754f",selection:"#1e754f4D"},{cursor:"#2993a3",background:"#2993a3",selection:"#2993a34D"},{cursor:"#296aa3",background:"#296aa3",selection:"#296aa34D"},{cursor:"#a13865",background:"#a13865",selection:"#a138654D"},{cursor:"#ab5959",background:"#ab5959",selection:"#ab59594D"}],error:"#ab5959",warning:"#a65e2b",info:"#296aa3",hint:"#999999",created:"#1e754f",deleted:"#ab5959",modified:"#296aa3","terminal.ansi.black":"#ffffff","terminal.ansi.red":"#ab5959","terminal.ansi.green":"#1e754f","terminal.ansi.yellow":"#bda437","terminal.ansi.blue":"#296aa3","terminal.ansi.magenta":"#a13865","terminal.ansi.cyan":"#2993a3","terminal.ansi.white":"#dbd7ca","terminal.ansi.bright_black":"#aaaaaa","terminal.ansi.bright_red":"#ab5959","terminal.ansi.bright_green":"#1e754f","terminal.ansi.bright_yellow":"#bda437","terminal.ansi.bright_blue":"#296aa3","terminal.ansi.bright_magenta":"#a13865","terminal.ansi.bright_cyan":"#2993a3","terminal.ansi.bright_white":"#dbd7ca",syntax:{attribute:{color:"#b07d48"},boolean:{color:"#1e754f"},character:{color:"#393a34"},"character.special":{color:"#393a34"},comment:{color:"#a0ada0"},"comment.doc":{color:"#a0ada0"},concept:{color:"#393a34"},constant:{color:"#b07d48"},"constant.builtin":{color:"#ab5959"},"constant.macro":{color:"#a65e2b"},constructor:{color:"#1e754f"},diff:{color:"#393a34"},"diff.minus":{color:"#393a34"},"diff.plus":{color:"#393a34"},embedded:{color:"#393a34"},emphasis:{color:"#393a34",font_style:"italic"},"emphasis.strong":{color:"#393a34",font_weight:700},enum:{color:"#393a34"},field:{color:"#393a34"},float:{color:"#393a34"},function:{color:"#59873a"},"function.builtin":{color:"#59873a"},"function.call":{color:"#59873a"},"function.decorator":{color:"#59873a"},"function.macro":{color:"#59873a"},"function.method":{color:"#59873a"},"function.method.call":{color:"#59873a"},hint:{color:"#393a34"},keyword:{color:"#ab5959"},"keyword.conditional":{color:"#1e754f"},"keyword.conditional.ternary":{color:"#1e754f"},"keyword.coroutine":{color:"#1e754f"},"keyword.debug":{color:"#1e754f"},"keyword.directive":{color:"#1e754f"},"keyword.directive.define":{color:"#1e754f"},"keyword.exception":{color:"#1e754f"},"keyword.export":{color:"#1e754f"},"keyword.function":{color:"#1e754f"},"keyword.import":{color:"#1e754f"},"keyword.modifier":{color:"#1e754f"},"keyword.operator":{color:"#1e754f"},"keyword.repeat":{color:"#1e754f"},"keyword.return":{color:"#1e754f"},"keyword.type":{color:"#2e8f82"},label:{color:"#59873a"},link_text:{color:"#b56959"},link_uri:{color:"#a0ada0"},module:{color:"#393a34"},namespace:{color:"#2e808f"},number:{color:"#2f798a"},"number.float":{color:"#393a34"},operator:{color:"#ab5959"},parameter:{color:"#b07d48"},parent:{color:"#393a34"},predictive:{color:"#393a34"},predoc:{color:"#393a34"},preproc:{color:"#393a34"},primary:{color:"#1c6b48"},property:{color:"#998418"},"property.json_key":{color:"#998418"},punctuation:{color:"#999999"},"punctuation.bracket":{color:"#999999"},"punctuation.delimiter":{color:"#999999"},"punctuation.delimiter.jsx":{color:"#999999"},"punctuation.list_marker":{color:"#999999"},"punctuation.special":{color:"#999999"},"punctuation.special.symbol":{color:"#999999"},selector:{color:"#b07d48"},"selector.pseudo":{color:"#59873a"},string:{color:"#b56959"},"string.doc":{color:"#b56959"},"string.documentation":{color:"#b56959"},"string.escape":{color:"#5a6aa6"},"punctuation.markup":{color:"#999999"},"string.regex":{color:"#ab5e3f"},"string.regexp":{color:"#ab5e3f"},"string.special":{color:"#b56959"},"string.special.path":{color:"#b56959"},"string.special.symbol":{color:"#b56959"},"string.special.url":{color:"#b56959"},symbol:{color:"#b56959"},tag:{color:"#1e754f"},"tag.attribute":{color:"#1e754f"},"tag.delimiter":{color:"#1e754f"},"tag.doctype":{color:"#1e754f"},text:{color:"#393a34"},"text.literal":{color:"#393a3490"},title:{color:"#1c6b48",font_weight:700},type:{color:"#2e808f"},"type.builtin":{color:"#2e8f82"},"type.builtin.class":{color:"#5a6aa6"},"type.class.definition":{color:"#2e8f82"},"type.definition":{color:"#2e8f82"},"type.interface":{color:"#2e8f82"},"type.super":{color:"#2e8f82"},variable:{color:"#b07d48"},"variable.builtin":{color:"#b07d48"},"variable.member":{color:"#b07d48"},"variable.parameter":{color:"#b07d48"},"variable.special":{color:"#a65e2b"},variant:{color:"#b07d48"},"constant.comment.todo":{color:"#2993a3"},"string.comment.info":{color:"#296aa3"},"keyword.comment.warn":{color:"#a65e2b"},"property.comment.error":{color:"#ab5959"}}}},oI=Object.freeze(Object.defineProperty({__proto__:null,default:II},Symbol.toStringTag,{value:"Module"}));export{cI as L,iI as c,CI as i,eI as l}; diff --git a/Resources/review-diff-viewer/chunks/pierre-theming.mjs b/Resources/review-diff-viewer/chunks/pierre-theming.mjs index 6b1863de1..bf47c58b6 100644 --- a/Resources/review-diff-viewer/chunks/pierre-theming.mjs +++ b/Resources/review-diff-viewer/chunks/pierre-theming.mjs @@ -1 +1 @@ -import{_ as r}from"./preload-helper.mjs";import{n as B}from"./shiki-core.mjs";function R(e){const i=[],t=new Set;for(const n of C(e.themes)){const _=w(n)?n.getThemes():[n];for(const h of _){if(t.has(h.name))throw new Error(`Theme collection already contains theme "${h.name}"`);t.add(h.name),i.push(h)}}const o=Object.freeze([...i]),s=Object.freeze(o.filter(n=>n.colorScheme==="light")),u=Object.freeze(o.filter(n=>n.colorScheme==="dark")),c=new Map(o.map(n=>[n.name,n])),m=Object.freeze(o.map(n=>n.name)),T=Object.freeze(s.map(n=>n.name)),E=Object.freeze(u.map(n=>n.name));function g(n){if(n==null)return o;const{colorScheme:_,collection:h}=n;return h==null?_==="light"?s:_==="dark"?u:o:o.filter(l=>l.collection!==h?!1:_==null||l.colorScheme===_)}return{getTheme(n){return c.get(n)},getThemes(n){return g(n)},getThemeNames(n){return n?.collection==null?n?.colorScheme==="light"?T:n?.colorScheme==="dark"?E:m:g(n).map(_=>_.name)},hasTheme(n){return c.has(n)},orderBy(n){return R({themes:o.map((_,h)=>({descriptor:_,index:h})).sort((_,h)=>{const l=n(_.descriptor,h.descriptor);return l!==0?l:_.index-h.index}).map(_=>_.descriptor)})},pick(n){const _=[],h=new Set;for(const l of n){if(h.has(l))throw new Error(`Theme collection pick already includes theme "${l}"`);h.add(l);const I=c.get(l);if(I==null)throw new Error(`Theme collection does not contain theme "${l}"`);_.push(I)}return R({themes:_})},registerInto(n){for(const _ of o)n.registerThemeIfAbsent(_.name,_.load)}}}function C(e){return N(e)?[e]:e}function N(e){return w(e)||j(e)}function j(e){return typeof e.name=="string"&&typeof e.load=="function"}function w(e){return typeof e.getThemes=="function"}function S(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var F=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},$=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},G=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function pe(){const e=new Map,i=new Map,t=new Map;let o=0;function s(a,d){if(e.has(a))throw new F(a);e.set(a,d)}function u(a,d){return e.has(a)?!1:(e.set(a,d),!0)}function c(a){return e.has(a)}function m(a){const d=i.get(a);if(d!==void 0)return Promise.resolve(d);const f=t.get(a);if(f!==void 0)return f;const v=e.get(a);if(v===void 0)return Promise.reject(new $(a));const M=o,P=v().then(k=>{const O=S(k);return M===o&&i.set(a,O),t.get(a)===P&&t.delete(a),O}).catch(k=>{throw t.get(a)===P&&t.delete(a),k});return t.set(a,P),P}function T(a){return Promise.all(a.map(d=>m(d)))}function E(a,d){i.set(a,d)}function g(a){for(const[d,f]of a)E(d,f)}function n(a){return i.get(a)}function _(a){const d=[];for(const f of a){const v=i.get(f);if(v===void 0)throw new G(f);d.push(v)}return d}function h(a){return i.has(a)}function l(a){for(const d of a)if(!i.has(d))return!1;return!0}function I(a){const d=i.get(a);return d!==void 0?d:m(a)}function H(){o++,i.clear(),t.clear()}return{clearResolvedThemes:H,getResolvedOrResolveTheme:I,getResolvedTheme:n,getResolvedThemes:_,hasRegisteredTheme:c,hasResolvedTheme:h,hasResolvedThemes:l,registerTheme:s,registerThemeIfAbsent:u,resolveTheme:m,resolveThemes:T,seedResolvedTheme:E,seedResolvedThemes:g}}const K=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,U=/^0(?:\.0+)?%?$/;function W(e){const i=e.indexOf("(");if(i<=0||!e.endsWith(")"))return;const t=e.slice(0,i).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(t))return;const o=e.slice(i+1,-1).trim();if(o.length===0)return;const s=o.lastIndexOf("/");if(s!==-1)return o.slice(s+1).trim();if(/^(?:rgba|hsla)$/i.test(t)){const u=o.split(",");if(u.length===4)return u[3]?.trim()}}function X(e){const i=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(i==null)return null;const t=i[1];let o,s=1;return t.length===3?o=t.split("").map(u=>u+u).join(""):t.length===6?o=t:(o=t.slice(0,6),s=parseInt(t.slice(6,8),16)/255),[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),s]}function L(e){if(e==null)return null;const i=X(e);if(i==null)return null;const t=i[0]/255,o=i[1]/255,s=i[2]/255,u=c=>c<=.03928?c/12.92:((c+.055)/1.055)**2.4;return .2126*u(t)+.7152*u(o)+.0722*u(s)}function A(e){if(e==null)return!1;const i=e.trim().toLowerCase();if(i==="transparent"||K.test(i))return!0;const t=W(i);return t!=null&&U.test(t)}function Y(e,i,t){if(i==null||t==null)return!1;const o=L(e),s=L(i),u=L(t);return o==null||s==null||u==null?!1:Math.abs(o-u)B(S(await e()))}const J="pierre",Q=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],y=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],ee=[...y,...Q],re=new Set(y);function te(e){return re.has(e)?"light":"dark"}const oe={"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"},ie={"pierre-dark":()=>r(()=>import("./pierre-theme-pierre-dark.mjs"),[]),"pierre-dark-soft":()=>r(()=>import("./pierre-theme-pierre-dark-soft.mjs"),[]),"pierre-dark-vibrant":()=>r(()=>import("./pierre-theme-pierre-dark-vibrant.mjs"),[]),"pierre-dark-protanopia-deuteranopia":()=>r(()=>import("./pierre-theme-pierre-dark-protanopia-deuteranopia.mjs"),[]),"pierre-dark-tritanopia":()=>r(()=>import("./pierre-theme-pierre-dark-tritanopia.mjs"),[]),"pierre-light":()=>r(()=>import("./pierre-theme-pierre-light.mjs"),[]),"pierre-light-soft":()=>r(()=>import("./pierre-theme-pierre-light-soft.mjs"),[]),"pierre-light-vibrant":()=>r(()=>import("./pierre-theme-pierre-light-vibrant.mjs"),[]),"pierre-light-protanopia-deuteranopia":()=>r(()=>import("./pierre-theme-pierre-light-protanopia-deuteranopia.mjs"),[]),"pierre-light-tritanopia":()=>r(()=>import("./pierre-theme-pierre-light-tritanopia.mjs"),[])};function ne(e){return x({name:e,collection:J,colorScheme:te(e),displayName:oe[e],load:ie[e]})}const ae=R({themes:ee.map(e=>ne(e))}),_e="shiki",z=["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"],se=["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"],ue=new Set(z);function de(e){return ue.has(e)?"light":"dark"}const he={andromeeda:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a),[]),"aurora-x":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.b),[]),"ayu-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.c),[]),"ayu-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.d),[]),"ayu-mirage":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.e),[]),"catppuccin-frappe":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.f),[]),"catppuccin-latte":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.g),[]),"catppuccin-macchiato":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.h),[]),"catppuccin-mocha":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.i),[]),"dark-plus":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.j),[]),dracula:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.k),[]),"dracula-soft":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.l),[]),"everforest-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.m),[]),"everforest-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.n),[]),"github-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.o),[]),"github-dark-default":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.p),[]),"github-dark-dimmed":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.q),[]),"github-dark-high-contrast":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.r),[]),"github-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.s),[]),"github-light-default":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.t),[]),"github-light-high-contrast":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.u),[]),"gruvbox-dark-hard":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.v),[]),"gruvbox-dark-medium":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.w),[]),"gruvbox-dark-soft":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.x),[]),"gruvbox-light-hard":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.y),[]),"gruvbox-light-medium":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.z),[]),"gruvbox-light-soft":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.A),[]),horizon:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.B),[]),"horizon-bright":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.C),[]),houston:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.D),[]),"kanagawa-dragon":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.E),[]),"kanagawa-lotus":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.F),[]),"kanagawa-wave":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.G),[]),laserwave:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.H),[]),"light-plus":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.I),[]),"material-theme":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.J),[]),"material-theme-darker":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.K),[]),"material-theme-lighter":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.L),[]),"material-theme-ocean":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.M),[]),"material-theme-palenight":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.N),[]),"min-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.O),[]),"min-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.P),[]),monokai:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.Q),[]),"night-owl":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.R),[]),"night-owl-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.S),[]),nord:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.T),[]),"one-dark-pro":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.U),[]),"one-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.V),[]),plastic:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.W),[]),poimandres:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.X),[]),red:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.Y),[]),"rose-pine":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.Z),[]),"rose-pine-dawn":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e._),[]),"rose-pine-moon":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.$),[]),"slack-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a0),[]),"slack-ochin":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a1),[]),"snazzy-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a2),[]),"solarized-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a3),[]),"solarized-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a4),[]),"synthwave-84":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a5),[]),"tokyo-night":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a6),[]),vesper:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a7),[]),"vitesse-black":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a8),[]),"vitesse-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a9),[]),"vitesse-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.aa),[])};function b(e){return x({name:e,collection:_e,colorScheme:de(e),load:he[e]})}const ce=R({themes:Object.freeze([...z.map(e=>b(e)),...se.map(e=>b(e))])});R({themes:[ae,ce]});export{pe as c,Ee as n,ae as p,ce as s}; +import{_ as r}from"./preload-helper.mjs";const $=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,G=/^0(?:\.0+)?%?$/;function K(e){const i=e.indexOf("(");if(i<=0||!e.endsWith(")"))return;const t=e.slice(0,i).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(t))return;const o=e.slice(i+1,-1).trim();if(o.length===0)return;const s=o.lastIndexOf("/");if(s!==-1)return o.slice(s+1).trim();if(/^(?:rgba|hsla)$/i.test(t)){const u=o.split(",");if(u.length===4)return u[3]?.trim()}}function U(e){const i=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(i==null)return null;const t=i[1];let o,s=1;return t.length===3?o=t.split("").map(u=>u+u).join(""):t.length===6?o=t:(o=t.slice(0,6),s=parseInt(t.slice(6,8),16)/255),[parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16),s]}function L(e){if(e==null)return null;const i=U(e);if(i==null)return null;const t=i[0]/255,o=i[1]/255,s=i[2]/255,u=h=>h<=.03928?h/12.92:((h+.055)/1.055)**2.4;return .2126*u(t)+.7152*u(o)+.0722*u(s)}function b(e){if(e==null)return!1;const i=e.trim().toLowerCase();if(i==="transparent"||$.test(i))return!0;const t=K(i);return t!=null&&G.test(t)}function W(e,i,t){if(i==null||t==null)return!1;const o=L(e),s=L(i),u=L(t);return o==null||s==null||u==null?!1:Math.abs(o-u)a.colorScheme==="light")),u=Object.freeze(o.filter(a=>a.colorScheme==="dark")),h=new Map(o.map(a=>[a.name,a])),p=Object.freeze(o.map(a=>a.name)),E=Object.freeze(s.map(a=>a.name)),f=Object.freeze(u.map(a=>a.name));function g(a){if(a==null)return o;const{colorScheme:_,collection:c}=a;return c==null?_==="light"?s:_==="dark"?u:o:o.filter(l=>l.collection!==c?!1:_==null||l.colorScheme===_)}return{getTheme(a){return h.get(a)},getThemes(a){return g(a)},getThemeNames(a){return a?.collection==null?a?.colorScheme==="light"?E:a?.colorScheme==="dark"?f:p:g(a).map(_=>_.name)},hasTheme(a){return h.has(a)},orderBy(a){return R({themes:o.map((_,c)=>({descriptor:_,index:c})).sort((_,c)=>{const l=a(_.descriptor,c.descriptor);return l!==0?l:_.index-c.index}).map(_=>_.descriptor)})},pick(a){const _=[],c=new Set;for(const l of a){if(c.has(l))throw new Error(`Theme collection pick already includes theme "${l}"`);c.add(l);const I=h.get(l);if(I==null)throw new Error(`Theme collection does not contain theme "${l}"`);_.push(I)}return R({themes:_})},registerInto(a){for(const _ of o)a.registerThemeIfAbsent(_.name,_.load)}}}function Y(e){return Z(e)?[e]:e}function Z(e){return y(e)||q(e)}function q(e){return typeof e.name=="string"&&typeof e.load=="function"}function y(e){return typeof e.getThemes=="function"}function z(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var J=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},S=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},Q=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function fe(e={}){const i=new Map,t=new Map,o=new Map;let s=0;function u(n,d){if(i.has(n))throw new J(n);i.set(n,d)}function h(n,d){return i.has(n)?!1:(i.set(n,d),!0)}function p(n){return i.has(n)}function E(n){const d=t.get(n);if(d!==void 0)return Promise.resolve(d);const T=o.get(n);if(T!==void 0)return T;const v=i.get(n);if(v===void 0&&e.fallbackLoader===void 0)return Promise.reject(new S(n));const F=s,P=Promise.resolve().then(()=>v!==void 0?v():e.fallbackLoader?.(n)).then(async k=>{if(k===void 0)throw new S(n);const A=z(k),V=e.normalizeTheme===void 0?A:await e.normalizeTheme(A,n);return F===s&&t.set(n,V),o.get(n)===P&&o.delete(n),V}).catch(k=>{throw o.get(n)===P&&o.delete(n),k});return o.set(n,P),P}function f(n){return Promise.all(n.map(d=>E(d)))}function g(n,d){t.set(n,d)}function a(n){for(const[d,T]of n)g(d,T)}function _(n){return t.get(n)}function c(n){const d=[];for(const T of n){const v=t.get(T);if(v===void 0)throw new Q(T);d.push(v)}return d}function l(n){return t.has(n)}function I(n){for(const d of n)if(!t.has(d))return!1;return!0}function N(n){const d=t.get(n);return d!==void 0?d:E(n)}function j(){s++,t.clear(),o.clear()}return{clearResolvedThemes:j,getResolvedOrResolveTheme:N,getResolvedTheme:_,getResolvedThemes:c,hasRegisteredTheme:p,hasResolvedTheme:l,hasResolvedThemes:I,registerTheme:u,registerThemeIfAbsent:h,resolveTheme:E,resolveThemes:f,seedResolvedTheme:g,seedResolvedThemes:a}}function D({name:e,load:i,colorScheme:t,collection:o,displayName:s}){return{name:e,colorScheme:t,collection:o,displayName:s,load:ee(i)}}function ee(e){return async()=>{const[i,{normalizeTheme:t}]=await Promise.all([e(),r(()=>import("./shiki-core.mjs").then(o=>o.f),[])]);return t(z(i))}}const re="pierre",te=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],H=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],oe=[...H,...te],ie=new Set(H);function ne(e){return ie.has(e)?"light":"dark"}const ae={"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"},_e={"pierre-dark":()=>r(()=>import("./pierre-theme-pierre-dark.mjs"),[]),"pierre-dark-soft":()=>r(()=>import("./pierre-theme-pierre-dark-soft.mjs"),[]),"pierre-dark-vibrant":()=>r(()=>import("./pierre-theme-pierre-dark-vibrant.mjs"),[]),"pierre-dark-protanopia-deuteranopia":()=>r(()=>import("./pierre-theme-pierre-dark-protanopia-deuteranopia.mjs"),[]),"pierre-dark-tritanopia":()=>r(()=>import("./pierre-theme-pierre-dark-tritanopia.mjs"),[]),"pierre-light":()=>r(()=>import("./pierre-theme-pierre-light.mjs"),[]),"pierre-light-soft":()=>r(()=>import("./pierre-theme-pierre-light-soft.mjs"),[]),"pierre-light-vibrant":()=>r(()=>import("./pierre-theme-pierre-light-vibrant.mjs"),[]),"pierre-light-protanopia-deuteranopia":()=>r(()=>import("./pierre-theme-pierre-light-protanopia-deuteranopia.mjs"),[]),"pierre-light-tritanopia":()=>r(()=>import("./pierre-theme-pierre-light-tritanopia.mjs"),[])};function se(e){return D({name:e,collection:re,colorScheme:ne(e),displayName:ae[e],load:_e[e]})}const M=R({themes:oe.map(e=>se(e))}),ue="shiki",B=["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"],de=["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"],ce=new Set(B);function he(e){return ce.has(e)?"light":"dark"}const le={andromeeda:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a),[]),"aurora-x":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.b),[]),"ayu-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.c),[]),"ayu-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.d),[]),"ayu-mirage":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.e),[]),"catppuccin-frappe":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.f),[]),"catppuccin-latte":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.g),[]),"catppuccin-macchiato":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.h),[]),"catppuccin-mocha":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.i),[]),"dark-plus":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.j),[]),dracula:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.k),[]),"dracula-soft":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.l),[]),"everforest-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.m),[]),"everforest-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.n),[]),"github-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.o),[]),"github-dark-default":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.p),[]),"github-dark-dimmed":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.q),[]),"github-dark-high-contrast":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.r),[]),"github-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.s),[]),"github-light-default":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.t),[]),"github-light-high-contrast":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.u),[]),"gruvbox-dark-hard":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.v),[]),"gruvbox-dark-medium":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.w),[]),"gruvbox-dark-soft":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.x),[]),"gruvbox-light-hard":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.y),[]),"gruvbox-light-medium":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.z),[]),"gruvbox-light-soft":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.A),[]),horizon:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.B),[]),"horizon-bright":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.C),[]),houston:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.D),[]),"kanagawa-dragon":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.E),[]),"kanagawa-lotus":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.F),[]),"kanagawa-wave":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.G),[]),laserwave:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.H),[]),"light-plus":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.I),[]),"material-theme":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.J),[]),"material-theme-darker":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.K),[]),"material-theme-lighter":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.L),[]),"material-theme-ocean":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.M),[]),"material-theme-palenight":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.N),[]),"min-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.O),[]),"min-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.P),[]),monokai:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.Q),[]),"night-owl":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.R),[]),"night-owl-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.S),[]),nord:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.T),[]),"one-dark-pro":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.U),[]),"one-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.V),[]),plastic:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.W),[]),poimandres:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.X),[]),red:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.Y),[]),"rose-pine":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.Z),[]),"rose-pine-dawn":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e._),[]),"rose-pine-moon":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.$),[]),"slack-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a0),[]),"slack-ochin":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a1),[]),"snazzy-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a2),[]),"solarized-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a3),[]),"solarized-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a4),[]),"synthwave-84":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a5),[]),"tokyo-night":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a6),[]),vesper:()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a7),[]),"vitesse-black":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a8),[]),"vitesse-dark":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.a9),[]),"vitesse-light":()=>r(()=>import("./shiki-theme-stub.mjs").then(e=>e.aa),[])};function x(e){return D({name:e,collection:ue,colorScheme:he(e),load:le[e]})}const me=Object.freeze([...B.map(e=>x(e)),...de.map(e=>x(e))]),C=R({themes:me}),pe=R({themes:[M,C]}),Te=Object.freeze(Object.defineProperty({__proto__:null,createTheme:D,pierreThemes:M,shikiThemes:C,themes:pe},Symbol.toStringTag,{value:"Module"}));export{fe as c,ge as n,Te as t}; diff --git a/Resources/review-diff-viewer/chunks/shiki-Ci4cdHsM.mjs b/Resources/review-diff-viewer/chunks/shiki-Ci4cdHsM.mjs new file mode 100644 index 000000000..90ce4723e --- /dev/null +++ b/Resources/review-diff-viewer/chunks/shiki-Ci4cdHsM.mjs @@ -0,0 +1 @@ +import{_ as x}from"./preload-helper.mjs";import{D as H,c as N,B as G,i as J}from"./stream-tokenizer-DK9xp5M5.mjs";import{d as K,R as V,a as W,e as D,g as _}from"./diff-worker.mjs";import{b as U,e as Z,I as w,E as A}from"./shiki-core.mjs";import"./pierre-theming.mjs";async function F(t){if(typeof __DIFFS_WORKER__<"u"?__DIFFS_WORKER__:J())throw new Error(`resolveLanguage("${t}") 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 e=_.get(t);if(e!=null)return e;const s=(async()=>{let i=V.get(t);if(i==null){const{bundledLanguages:h}=await x(async()=>{const{bundledLanguages:r}=await import("./shiki-core.mjs").then(o=>o.l);return{bundledLanguages:r}},[]);Object.prototype.hasOwnProperty.call(h,t)&&(i=h[t])}if(i==null)throw new Error(`resolveLanguage: "${t}" not found in bundled or custom languages`);const{default:n}=await i(),a={name:t,data:n};return D.has(t)||D.set(t,a),a})();_.set(t,s);try{return await s}finally{_.get(t)===s&&_.delete(t)}}function Q(t){return D.get(t)??F(t)}async function X(t){const e=[],s=[];for(const i of t){if(i==="text"||i==="ansi")continue;const n=Q(i)??F(i);"then"in n?s.push(n):e.push(n)}return s.length>0&&await Promise.all(s).then(i=>{for(const n of i){if(n==null)throw new Error("resolvedLanguages: unable to resolve language");e.push(n)}}),e}function Y(t,e){let s;return function(...i){clearTimeout(s),s=setTimeout(()=>t.apply(this,i),e)}}const B=0;let tt=0;var et=class{backend;#i;#e;#k;#w;#s;#I;#_;#l;#S;#M=!1;#t=[w];#u=[];#c=0;#g=[];#d=-1;#n=!0;#a=!1;#r=0;#C=++tt;#h=-1;#f=-1;#b;#L=0;#o=[];#E=!1;#B=Y(async t=>{if(this.#M)return;const{startingLine:e=0,totalLines:s=1/0}=t??{},i=Math.min(s===1/0?1/0:e+s,this.#s.lineCount);if(this.#e==null&&!M(this.#s.languageId)){if(await this.backend?.loadLanguages([this.#s.languageId]),this.#M)return;this.#e=this.#i.getLanguage(this.#s.languageId)}this.#m(),this.#A(i)},500);#D=({data:t})=>{if(typeof t!="object"||t===null)return;const{type:e,tokenizerId:s,jobId:i}=t;e==="tokenize"&&s===this.#C&&typeof i=="number"&&i===this.#r&&(this.#h>=0?this.#V(i):this.#F(i))};getStringCommentRegexpRangesInLine(t){if(!this.#l||t<0||t>=this.#s.lineCount||(this.#R(),this.#e==null))return null;if(this.#o[t]===void 0){this.#v(t);const e=this.#t[t]??w,s=this.#y(t,e);this.#t[t+1]=s.state}return this.#o[t]??null}constructor(t,e,s){this.backend=s,this.#i=t,this.#s=e.textDocument,this.#k=e.theme,this.#w=[],this.#I=e.tokenizeMaxLineLength??1e3,this.#_=e.onDeferTokenize,this.#l=e.matchBrackets!==!1,this.#S=e.__debug??!1,this.#R(),this.#m()}setTheme(t){this.#k!==t&&(this.#k=t,this.#m(),this.stopBackgroundTokenize(),this.#t=[w],this.#u=[],this.#c=0,this.#g=[],this.#e!=null&&this.#s.lineCount>0&&this.#x(0))}#m(){if(this.#k==="")return;this.backend?.getTheme(this.#k);const{colorMap:t}=this.#i.setTheme(this.#k);this.#w=t}dispose(){this.#M=!0,this.stopBackgroundTokenize(),this.#P()}tokenize(t,e,s=!1){if(this.#R(),this.#m(),this.#e==null&&!M(this.#s.languageId))throw new Error(`Grammar for language "${this.#s.languageId}" not loaded`);const{lineCount:i}=this.#s,{startingLine:n=0,totalLines:a=1/0}=e??{},h=a===1/0?i:Math.min(n+a,i),r=t.startLine,o=Math.max(n,r),f=e!=null&&a!==1/0&&t.lineDelta>0&&r=h,l=t.lineDelta===0&&(t.changedLineChanges?.every(([,,c])=>c===0)??!0);this.#l&&!l&&(this.#o.length=Math.min(this.#o.length,t.startLine));const k=s&&t.lineDelta!==0&&r>=n,g=l||e==null||r>=o,m=t.changedLineRanges??[[r,t.endLine]];this.#u=[],this.#c=0,this.#g=[];let p=-1;if(r=r&&(l||t.lineDelta<0);l?this.#v(r):(this.#$(t),(e==null||r>=o)&&this.#v(o));let T=0,C=m[T][1],b,O=0,u=l?m[T][0]:o,E=!1;const P=new Map,S=z?new Map:void 0;if(S!=null&&!l){const c=Math.min(p+1,o,h);if(c>r){this.#v(c);let d=r,R=this.#t[d]??w;for(;d=o?P.set(u,d):S?.set(u,d),g&&(this.#t[u+1]=v),E=u>=C&&(l||k)&&c!=null&&v.equals(c),E){T++;const L=m[T];if(L==null)break;if(L[0]>=h){b=L[0],O=T;break}let y=this.#t[L[0]];if(k)for(let I=u+2;I<=L[0]&&(y=this.#z(I),y!=null);I++)this.#t[I]=y;y==null?(C=L[1],u++):(u=L[0],v=y,C=L[1]),E=!1;continue}u++}if(g&&(u0&&this.#_(S),b!=null)this.#l&&l&&(this.#o.length=Math.min(this.#o.length,b)),this.#x(b,m,O);else if(!E&&u=o?h:r=0&&(this.#f=Math.max(this.#f,this.#h)),this.#h=-1,this.#b=e,this.#L=s,this.#O(),this.#p(i)}#A(t){if(this.#e==null||this.#t.length>t)return;if(!this.#n){this.#h>=0?this.#h=Math.max(this.#h,t):this.#f=Math.max(this.#f,t);return}const e=++this.#r;this.#n=!1,this.#a=!1,this.#d=this.#t.length-1,this.#h=t,this.#f=-1,this.#b=void 0,this.#L=0,this.#O(),this.#p(e)}#y(t,e){const s=this.#s.getLineText(t);if(s.length>=this.#I)return console.warn(`[diffs] Line(${t}) too long to tokenize: ${s.length}`),this.#T(t,null),{resolvedTokens:[[0,"",s]],state:e};if(this.#e==null||s===""||s.trim()==="")return this.#T(t,null),{resolvedTokens:[[0,"",s]],state:e};const i=$(this.#e,this.#w,s,e,B,this.#l);return this.#T(t,i.bracketIgnoredRanges),{resolvedTokens:i.resolvedTokens,state:i.ruleStack}}#T(t,e){this.#l&&(this.#o[t]=e)}#$(t){const e=t.changedLineChanges??[[t.startLine,t.endLine,t.lineDelta]],s=t.startLine+1;s<=this.#t.length-s?(this.#u=this.#t,this.#c=0,this.#t=this.#t.slice(0,s)):(this.#c=s,this.#u=this.#t.slice(s),this.#t.length=Math.min(this.#t.length,s)),this.#g=e}#z(t){let e=t;for(let s=this.#g.length-1;s>=0;s--){const[i,n,a]=this.#g[s];if(a!==0){if(e>n)e-=a;else if(e>i)return this.#t[t]}}return this.#u[e-this.#c]??this.#t[t]}#v(t,e){const s=Math.min(Math.max(0,t),this.#s.lineCount);if(this.#t.length>s||this.#e==null)return!0;const i=e==null?0:performance.now();let n=this.#t.length-1,a=this.#t[n]??w;for(;ne)break}return n>=s}#V(t){if(this.#n||this.#a||this.#e==null||t!==this.#r)return;this.#m();const e=this.#v(this.#h,1);if(!(this.#n||this.#a||t!==this.#r)){if(e){this.stopBackgroundTokenize();return}this.#d=this.#t.length-1,this.#p(t)}}#F(t){if(this.#n||this.#a||this.#e==null||t!==this.#r)return;this.#m();const e=performance.now(),s=new Map,i=this.#s.lineCount,n=this.#b;let a=this.#d,h=this.#t[a]??w,r=!1,o=this.#L,f=n?.[o]?.[1];for(;a=f&&l!=null&&h.equals(l),a++,r){o++;const g=n?.[o];if(g==null)break;if(f=g[1],this.#t[g[0]]==null)r=!1;else{a=g[0],h=this.#t[a]??h,r=!1;continue}}if(performance.now()-e>1)break}if(this.#_(s),!(this.#n||this.#a||t!==this.#r)){if(r||a>=i){const l=this.#f;this.stopBackgroundTokenize(),l>=0&&this.#A(l);return}this.#d=a,this.#L=o,this.#p(t)}}};function $(t,e,s,i,n,a=!0,h=!0){const r=t.tokenizeLine2(s,i,n);r.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${s.substring(0,100)}`);const o=r.tokens,f=o.length/2,l=[],k=[];if(!h&&!a)return{ruleStack:r.ruleStack,resolvedTokens:l,bracketIgnoredRanges:k};for(let g=0;g0&&k.push([m,p])}return{ruleStack:r.ruleStack,resolvedTokens:l,bracketIgnoredRanges:k}}function M(t){return t==="text"||t==="ansi"}var st=class j extends G{highlighter;options;#i="";#e;constructor(e,s){super(),this.highlighter=e,this.options=s}tokenizeChunk(e,s){const i=(this.#i+e).split(/(\r\n|\r|\n)/);let n=[];for(let a=0;a({...f,offset:f.offset+this.stableOffset}));a+1{const{createOnigurumaEngine:n}=await import("./shiki-core.mjs").then(a=>a.g);return{createOnigurumaEngine:n}},[])).createOnigurumaEngine(x(()=>import("./shiki-wasm.mjs"),[])):(await x(async()=>{const{createJavaScriptRegexEngine:n}=await import("./shiki-core.mjs").then(a=>a.h);return{createJavaScriptRegexEngine:n}},[])).createJavaScriptRegexEngine(),i=await U({themes:[],langs:[],engine:s});return new q(e,i)}constructor(e,s){super(e,N(e)),this.raw=s}getTheme(e){this.assertNotDisposed();const s=this.loadedThemes.get(e),i=this.themeResolver.getResolvedTheme(e)??s;if(i==null)throw new Error(`Theme "${e}" has not been resolved`);if(s!==i){const n=i.textmate??(i.cssVariables!=null?Z(i.cssVariables):void 0);if(n==null)throw new Error(`Theme "${e}" does not support Shiki`);this.raw.setTheme({...n,name:e}),this.loadedThemes.set(e,i)}return i}codeToTokens(e,s){return this.raw.codeToTokens(e,this.resolveOptions(s))}createEditorTokenizer(e){return new et(this.raw,e,this)}createStreamTokenizer(e){return new st(this.raw,this.resolveOptions(e))}async loadLanguages(e){this.assertNotDisposed();const s=e.filter(i=>!this.attachedLanguages.has(i));K(await X(s),this)}hasLoadedLanguages(e){if(this.disposed)return!1;let s;return e.every(i=>this.attachedLanguages.has(i)?!0:V.has(i)?!1:(s??=this.raw.getLoadedLanguages(),s.includes(i)))}attachLanguages(e){this.assertNotDisposed();for(const s of e){if(this.attachedLanguages.has(s.name))continue;const i=s.data.find(n=>n.name===s.name||n.aliases?.includes(s.name)===!0);if(i==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${s.name}" as its name or an alias.`);this.raw.loadLanguageSync(s.data);try{this.raw.getLanguage(s.name)}catch{throw new Error(`attachResolvedLanguages: "${i.name}" is already loaded without alias "${s.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(s.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:e,themes:s,...i}){if(this.assertNotDisposed(),e!=null)return this.getTheme(e),{...i,theme:e};if(s==null)throw new Error("A theme or themes option is required");for(const n of Object.values(s))this.getTheme(n);return{...i,themes:s}}};export{ot as ShikiHighlighter}; diff --git a/Resources/review-diff-viewer/chunks/shiki-core.mjs b/Resources/review-diff-viewer/chunks/shiki-core.mjs index ff252dfbf..4b6303783 100644 --- a/Resources/review-diff-viewer/chunks/shiki-core.mjs +++ b/Resources/review-diff-viewer/chunks/shiki-core.mjs @@ -1,6 +1,16 @@ -import{_ as d}from"./preload-helper.mjs";var Tt=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,Si=Object.getOwnPropertyNames,Ii=Object.prototype.hasOwnProperty,Li=(e,t)=>{let n={};for(var r in e)Tt(n,r,{get:e[r],enumerable:!0});return Tt(n,Symbol.toStringTag,{value:"Module"}),n},ki=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Si(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=Ai(t,a))||r.enumerable});return e},Ri=(e,t,n)=>(ki(e,t,"default"),n),k=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Pi(e){return Zt(e)}function Zt(e){return Array.isArray(e)?Ti(e):e instanceof RegExp?e:typeof e=="object"?xi(e):e}function Ti(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function ur(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?ur(e.substring(0,e.length-1)):e.substr(~t+1)}var gt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ne=class{static hasCaptures(e){return e===null?!1:(gt.lastIndex=0,gt.test(e))}static replaceCaptures(e,t,n){return e.replace(gt,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function cr(e,t){return et?1:0}function dr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>Oi(e.parent,i.parentScopes));return r?new fr(r.fontStyle,r.foreground,r.background):null}},_t=class Ue{constructor(t,n){this.parent=t,this.scopeName=n}parent;scopeName;static push(t,n){for(const r of n)t=new Ue(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Di(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Di(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var fr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}fontStyle;foregroundId;backgroundId};function Ni(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(b=m.slice(0,m.length-1),b.reverse()),n[r++]=new Vi(y,b,i,l,u,c)}}return n}var Vi=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}scope;parentScopes;index;fontStyle;foreground;background},$=(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))($||{});function Mi(e,t){e.sort((l,u)=>{let c=cr(l.scope,u.scope);return c!==0||(c=dr(l.parentScopes,u.parentScopes),c!==0)?c:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new $i(t),s=new fr(n,o.getId(r),o.getId(i)),a=new Bi(new xt(0,null,-1,0,0),[]);for(let l=0,u=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},Bi=class Ot{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_mainRule;_children;_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ot._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let c;this._children.hasOwnProperty(l)?c=this._children[l]:(c=new Ot(this._mainRule.clone(),xt.cloneArr(this._rulesWithParentScopes)),this._children[l]=c),c.insert(t+1,u,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>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,r,i,o,s,a){let l=U.getLanguageId(t),u=U.getTokenType(t),c=U.containsBalancedBrackets(t)?1:0,p=U.getFontStyle(t),f=U.getForeground(t),h=U.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(c=i?1:0),o!==-1&&(p=o),s!==0&&(f=s),a!==0&&(h=a),(l<<0|u<<8|c<<10|p<<11|f<<15|h<<24)>>>0}};function ze(e,t){const n=[],r=Fi(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(mn(i)){const l=[];do l.push(i),i=r.next();while(mn(i));return u=>t(l,u)}return null}function s(){const l=[];let u=o();for(;u;)l.push(u),u=o();return c=>l.every(p=>p(c))}function a(){const l=[];let u=s();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return c=>l.some(p=>p(c))}}function mn(e){return!!e&&!!e.match(/[\w\.:]+/)}function Fi(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function gr(e){typeof e.dispose=="function"&&e.dispose()}var Le=class{constructor(e){this.scopeName=e}scopeName;toKey(){return this.scopeName}},Ui=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;toKey(){return`${this.scopeName}#${this.ruleName}`}},ji=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))}},Wi=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Le(this.initialScopeName)]}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new ji;for(const n of e)Hi(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Le){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 Hi(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Le?je({baseGrammar:o,selfGrammar:i},r):Dt(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Le(a))}function Dt(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];qe([r],t,n)}}function je(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&qe(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&qe(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function qe(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?lr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&qe(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=_r(o);switch(s.kind){case 0:je({...t,selfGrammar:t.baseGrammar},n);break;case 1:je(t,n);break;case 2:Dt(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?Dt(s.ruleName,l,n):je(l,n)}else s.kind===4?n.add(new Ui(s.scopeName,s.ruleName)):n.add(new Le(s.scopeName));break}}}var zi=class{kind=0},qi=class{kind=1},Xi=class{constructor(e){this.ruleName=e}ruleName;kind=2},Ki=class{constructor(e){this.scopeName=e}scopeName;kind=3},Qi=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;kind=4};function _r(e){if(e==="$base")return new zi;if(e==="$self")return new qi;const t=e.indexOf("#");if(t===-1)return new Ki(e);if(t===0)return new Xi(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new Qi(n,r)}}var Ji=/\\(\d+)/,gn=/\\(\d+)/g,Zi=-1,yr=-2;var xe=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ne.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ne.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${ur(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:Ne.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ne.replaceCaptures(this._contentName,e,t)}},Yi=class extends xe{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},eo=class extends xe{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new ke(r,this.id),this.captures=i,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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},_n=class extends xe{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Re,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Nt=class extends xe{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r),this._begin=new ke(i,this.id),this.beginCaptures=o,this._end=new ke(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.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,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;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}},Xe=class extends xe{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new ke(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new ke(s,yr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Re;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,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Re,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},Er=class M{static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new Yi(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new eo(t.$vscodeTextmateLocation,t.id,t.name,t.match,M._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=lr({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new _n(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,M._compilePatterns(o,n,r))}return t.while?new Xe(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,M._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,M._compileCaptures(t.whileCaptures||t.captures,n,r),M._compilePatterns(t.patterns,n,r)):new Nt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,M._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,M._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,M._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=M.getCompiledRuleId(t[s],n,r)),i[a]=M.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return gn.lastIndex=0,this.source.replace(gn,(i,o)=>pr(r[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=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new yn(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 r=this._items.map(i=>i.resolveAnchors(t,n));return new yn(e,r,this._items.map(i=>i.ruleId))}},yn=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}regExps;rules;scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new yt(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Vt.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/},no=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,r])=>pr(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])}},En=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}stack;stoppedEarly};function wr(e,t,n,r,i,o,s,a){const l=t.content.length;let u=!1,c=-1;if(s){const h=ro(e,t,n,r,i,o);i=h.stack,r=h.linePos,n=h.isFirstLine,c=h.anchorPosition}const p=Date.now();for(;!u;){if(a!==0&&Date.now()-p>a)return new En(i,!0);f()}return new En(i,!1);function f(){const h=io(e,t,n,r,i,c);if(!h){o.produce(i,l),u=!0;return}const m=h.captureIndices,y=h.matchedRuleId,b=m&&m.length>0?m[0].end>r:!1;if(y===Zi){const _=i.getRule(e);o.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ae(e,t,n,i,o,_.endCaptures,m),o.produce(i,m[0].end);const g=i;if(i=i.parent,c=g.getAnchorPos(),!b&&g.getEnterPos()===r){i=g,o.produce(i,l),u=!0;return}}else{const _=e.getRule(y);o.produce(i,m[0].start);const g=i,E=_.getName(t.content,m),v=i.contentNameScopesList.pushAttributed(E,e);if(i=i.push(y,r,c,m[0].end===l,null,v,v),_ instanceof Nt){const C=_;Ae(e,t,n,i,o,C.beginCaptures,m),o.produce(i,m[0].end),c=m[0].end;const L=C.getContentName(t.content,m),P=v.pushAttributed(L,e);if(i=i.withContentNameScopesList(P),C.endHasBackReferences&&(i=i.withEndRule(C.getEndWithResolvedBackReferences(t.content,m))),!b&&g.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(_ instanceof Xe){const C=_;Ae(e,t,n,i,o,C.beginCaptures,m),o.produce(i,m[0].end),c=m[0].end;const L=C.getContentName(t.content,m),P=v.pushAttributed(L,e);if(i=i.withContentNameScopesList(P),C.whileHasBackReferences&&(i=i.withEndRule(C.getWhileWithResolvedBackReferences(t.content,m))),!b&&g.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(Ae(e,t,n,i,o,_.captures,m),o.produce(i,m[0].end),i=i.pop(),!b){i=i.safePop(),o.produce(i,l),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function ro(e,t,n,r,i,o){let s=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const u=l.getRule(e);u instanceof Xe&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:c}=ao(l.rule,e,l.stack.endRule,n,r===s),p=u.findNextMatchSync(t,r,c);if(p){if(p.ruleId!==yr){i=l.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(o.produce(l.stack,p.captureIndices[0].start),Ae(e,t,n,l.stack,o,l.rule.whileCaptures,p.captureIndices),o.produce(l.stack,p.captureIndices[0].end),s=p.captureIndices[0].end,p.captureIndices[0].end>r&&(r=p.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:s,isFirstLine:n}}function io(e,t,n,r,i,o){const s=oo(e,t,n,r,i,o),a=e.getInjections();if(a.length===0)return s;const l=so(a,e,t,n,r,i,o);if(!l)return s;if(!s)return l;const u=s.captureIndices[0].start,c=l.captureIndices[0].start;return c=a)&&(a=E,l=g.captureIndices,u=g.ruleId,c=m.priority,a===i))break}return l?{priorityMatch:c===-1,captureIndices:l,matchedRuleId:u}:null}function vr(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function ao(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Ae(e,t,n,r,i,o,s){if(o.length===0)return;const a=t.content,l=Math.min(o.length,s.length),u=[],c=s[0].end;for(let p=0;pc)break;for(;u.length>0&&u[u.length-1].endPos<=h.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,h.start):i.produce(r,h.start),f.retokenizeCapturedWithRuleId){const y=f.getName(a,s),b=r.contentNameScopesList.pushAttributed(y,e),_=f.getContentName(a,s),g=b.pushAttributed(_,e),E=r.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,b,g),v=e.createOnigString(a.substring(0,h.end));wr(e,v,n&&h.start===0,h.start,E,i,!1,0),gr(v);continue}const m=f.getName(a,s);if(m!==null){const b=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new lo(b,h.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var lo=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function uo(e,t,n,r,i,o,s,a){return new po(e,t,n,r,i,o,s,a)}function bn(e,t,n,r,i){const o=ze(t,Ke),s=Er.getCompiledRuleId(n,r,i.repository);for(const a of o)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:i,priority:a.priority})}function Ke(e,t){if(t.length{for(let i=n;in&&e.substr(0,n)===t&&e[n]==="."}var po=class{constructor(e,t,n,r,i,o,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new to(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=wn(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=ze(l,Ke);for(const c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:i[l]})}}_rootScopeName;balancedBracketSelectors;_onigLib;_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:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let s in i)bn(t,s,i[s],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const l=a.injectionSelector;l&&bn(t,l,a,this,a)}})}return t.sort((i,o)=>i.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]=wn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Er.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Mt.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),p=ue.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),f=this.getRule(this._rootId).getName(null,null);let h;f?h=Se.createRootAndLookUpScopeName(f,p,this):h=Se.createRoot("unknown",p),t=new Mt(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,t.reset();e=e+` -`;const o=this.createOnigString(e),s=o.content.length,a=new fo(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=wr(this,o,i,0,t,a,!0,r);return gr(o),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function wn(e,t){return e=Pi(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 Se=class X{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}parent;scopePath;tokenAttributes;static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const o of n)i=_t.push(i,o.scopeNames),r=new X(r,i,o.encodedTokenAttributes);return r}static createRoot(t,n){return new X(null,new _t(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),o=new _t(null,t),s=r.themeProvider.themeMatch(o),a=X.mergeAttributes(n,i,s);return new X(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return X.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,r){let i=-1,o=0,s=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,s=r.backgroundId),ue.set(t,n.languageId,n.tokenType,null,i,o,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return X._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const o of r)i=X._pushAttributed(i,o,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),o=t.scopePath.push(n),s=r.themeProvider.themeMatch(o),a=X.mergeAttributes(t.tokenAttributes,i,s);return new X(t,o,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Mt=class oe{constructor(t,n,r,i,o,s,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}parent;ruleId;beginRuleCapturedEOL;endRule;nameScopesList;contentNameScopesList;_stackElementBrand=void 0;static NULL=new oe(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:oe._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Se.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(){oe._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,o,s,a){return new oe(this,t,n,r,i,o,s,a)}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 oe(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 r=Se.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new oe(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Se.fromExtension(r,n.contentNameScopesList))}},ho=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):ze(n,Ke).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>ze(n,Ke).map(r=>r.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}},fo=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}balancedBracketSelectors;_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 r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!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)&&(r=ue.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=ue.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),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 r=0,i=this._binaryTokens.length;r0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,r,i,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 r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,o)}},$t=Mt.NULL;function Qe(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[i]=o:i===r&&Object.assign(n,o);return n}function re(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function _o(e){return Array.isArray(e)?e:[e]}async function Cr(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function nt(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Ar(e){return e==="ansi"||nt(e)}function rt(e){return e==="none"}function Sr(e){return rt(e)}const yo=/(\r?\n)/g;function it(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(yo);let r=0;const i=[];for(let o=0;o!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?vn.light:vn.dark),n||(n=t.type==="light"?Cn.light:Cn.dark),t.fg=r,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 i=0;const o=new Map;function s(a){if(o.has(a))return o.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?s(a):(o.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const c={...a,settings:{...a.settings}};if(l){const p=s(a.settings.foreground);t.colorReplacements[p]=a.settings.foreground,c.settings.foreground=p}if(u){const p=s(a.settings.background);t.colorReplacements[p]=a.settings.background,c.settings.background=p}return c});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,An,{enumerable:!1,writable:!1,value:!0}),t}async function Ir(e){return[...new Set((await Promise.all(e.filter(t=>!Ar(t)).map(async t=>await Cr(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Lr(e){return(await Promise.all(e.map(async t=>Sr(t)?null:Yt(await Cr(t))))).filter(t=>!!t)}function kr(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 k(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var Eo=class extends go{_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,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Yt(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=He.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=kr(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._syncRegistry?._grammars?.get(i.scopeName)?.dispose(),this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,i])=>!i);if(n.length){const r=t.filter(([i,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(s=>n.map(([a])=>a).includes(s)):!1).filter(i=>!n.includes(i));throw new k(`Missing languages ${n.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of t)this._resolver.addLanguage(i);for(const[r,i]of t)this.loadLanguage(i)}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))}},bo=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).includes(e.scopeName)||this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const i=t.slice(0,r).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let Ce=0;function wo(e){Ce+=1,e.warnings!==!1&&Ce>=10&&Ce%10===0&&console.warn(`[Shiki] ${Ce} 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 k("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Yt),i=new Eo(new bo(e.engine,n),r,n,e.langAlias);let o;function s(g){return kr(g,e.langAlias)}function a(g){b();const E=i.getGrammar(typeof g=="string"?g:g.name);if(!E)throw new k(`Language \`${g}\` not found, you may need to load it first`);return E}function l(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const E=i.getTheme(g);if(!E)throw new k(`Theme \`${g}\` not found, you may need to load it first`);return E}function u(g){b();const E=l(g);return o!==g&&(i.setTheme(E),o=g),{theme:E,colorMap:i.getColorMap()}}function c(){return b(),i.getLoadedThemes()}function p(){return b(),i.getLoadedLanguages()}function f(...g){b(),i.loadLanguages(g.flat(1))}async function h(...g){return f(await Ir(g))}function m(...g){b();for(const E of g.flat(1))i.loadTheme(E)}async function y(...g){return b(),m(await Lr(g))}function b(){if(t)throw new k("Shiki instance has been disposed")}function _(){t||(t=!0,i.dispose(),Ce-=1)}return{setTheme:u,getTheme:l,getLanguage:a,getLoadedThemes:c,getLoadedLanguages:p,resolveLangAlias:s,loadLanguage:h,loadLanguageSync:f,loadTheme:y,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function vo(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Lr(e.themes||[]),Ir(e.langs||[]),e.engine]);return wo({...e,themes:t,langs:n,engine:r})}const Rr=new WeakMap;function ot(e,t){Rr.set(e,t)}function Pe(e){return Rr.get(e)}var st=class Pr{_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 Pr(Object.fromEntries(_o(n).map(r=>[r,$t])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Co(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Co(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const o=i?.nameScopesList?.scopeName;o&&t.push(o),i.parent&&r(i.parent)}return r(e),t}function Ao(e,t){if(!(e instanceof st))throw new k("Invalid grammar state");return e.getInternalStack(t)}const So=/,/,Io=/ /;function Tr(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(nt(e.resolveLangAlias(n.lang||"text"))||rt(r))return it(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:o}=e.setTheme(r),s=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new k(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(i.name))throw new k(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return ko(t,s,i,o,n)}function Lo(...e){if(e.length===2)return Pe(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:o=t.getLoadedThemes()[0]}=r;if(nt(i)||rt(o))throw new k("Plain language does not have grammar state");if(i==="ansi")throw new k("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(o),l=t.getLanguage(i);return new st(en(n,l,s,a,r).stateStack,l.name,s.name)}function ko(e,t,n,r,i){const o=en(e,t,n,r,i),s=new st(o.stateStack,t.name,n.name);return ot(o.tokens,s),o.tokens}function en(e,t,n,r,i){const o=Qe(n,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=i,u=it(e);let c=i.grammarState?Ao(i.grammarState,n.name)??$t:i.grammarContextCode!=null?en(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:$t,p=[];const f=[];for(let h=0,m=u.length;h0&&y.length>=s){p=[],f.push([{content:y,offset:b,color:"",fontStyle:0}]);continue}let _,g,E;l&&l!=="tokenType"&&(_=t.tokenizeLine(y,c,a),g=_.tokens,E=0);const v=t.tokenizeLine2(y,c,a),C=v.tokens.length/2;for(let L=0;Lmt.trim());break;case"object":fe=Q.scope;break;default:continue}pn.push({settings:Q,selectors:fe.map(mt=>mt.split(Io))})}q.explanation=[];let hn=0;for(;P+hn({scopeName:t}))}function Po(e,t){const n=[];for(let r=0,i=t.length;r=0&&i>=0;)Sn(e[r],n[i])&&(r-=1),i-=1;return r===-1}function xo(e,t,n){const r=[];for(const{selectors:i,settings:o}of e)for(const s of i)if(To(s,t,n)){r.push(o);break}return r}function xr(e,t,n,r=Tr){const i=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),o=i.map(u=>{const c=r(e,t,{...n,theme:u.theme});return{tokens:c,state:Pe(c),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),s=Oo(...o.map(u=>u.tokens)),a=s[0].map((u,c)=>u.map((p,f)=>{const h={content:p.content,variants:{},offset:p.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=p.explanation),s.forEach((m,y)=>{const{content:b,explanation:_,offset:g,...E}=m[c][f];h.variants[i[y].color]=E}),h})),l=o[0].state?new st(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return l&&ot(a,l),a}function Oo(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;rl[r]),o=t.map(()=>[]);t.forEach((l,u)=>l.push(o[u]));const s=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;u4&&n.slice(0,4)==="data"&&Go.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Ln,Uo);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Ln.test(o)){let s=o.replace($o,Fo);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=tn}return new i(r,t)}function Fo(e){return"-"+e.toLowerCase()}function Uo(e){return e.charAt(1).toUpperCase()}const jo=Or([Dr,Vo,Mr,$r,Gr],"html"),Br=Or([Dr,Mo,Mr,$r,Gr],"svg"),kn={}.hasOwnProperty;function Wo(e,t){const n=t||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&kn.call(i,e)){const l=String(i[e]);s=kn.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Ho=/["&'<>`]/g,zo=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,qo=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Xo=/[|\\{}()[\]^$+*?.]/g,Rn=new WeakMap;function Ko(e,t){if(e=e.replace(t.subset?Qo(t.subset):Ho,r),t.subset||t.escapeOnly)return e;return e.replace(zo,n).replace(qo,r);function n(i,o,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function r(i,o,s){return t.format(i.charCodeAt(0),s.charCodeAt(o+1),t)}}function Qo(e){let t=Rn.get(e);return t||(t=Jo(e),Rn.set(e,t)),t}function Jo(e){const t=[];let n=-1;for(;++n",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:"€"},rs=["cent","copy","divide","gt","lt","not","para","times"],Fr={}.hasOwnProperty,Ut={};let Ve;for(Ve in bt)Fr.call(bt,Ve)&&(Ut[bt[Ve]]=Ve);const is=/[^\dA-Za-z]/;function os(e,t,n,r){const i=String.fromCharCode(e);if(Fr.call(Ut,i)){const o=Ut[i],s="&"+o;return n&&ns.includes(o)&&!rs.includes(o)&&(!r||t&&t!==61&&is.test(String.fromCharCode(t)))?s:s+";"}return""}function ss(e,t,n){let r=Yo(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=os(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=ts(e,t,n.omitOptionalSemicolons);o.length|^->||--!>|"],us=["<",">"];function cs(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return Ee(o,Object.assign({},r.settings.characterReferences,{subset:us}))}}function ds(e,t,n,r){return""}function Pn(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ps(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function hs(e){return e.join(" ").trim()}const fs=/[ \t\n\f\r]/g;function nn(e){return typeof e=="object"?e.type==="text"?Tn(e.value):!1:Tn(e)}function Tn(e){return e.replace(fs,"")===""}const D=jr(1),Ur=jr(-1),ms=[];function jr(e){return t;function t(n,r,i){const o=n?n.children:ms;let s=(r||0)+e,a=o[s];if(!i)for(;a&&nn(a);)s+=e,a=o[s];return a}}const gs={}.hasOwnProperty;function Wr(e){return t;function t(n,r,i){return gs.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const rn=Wr({body:ys,caption:wt,colgroup:wt,dd:vs,dt:ws,head:wt,html:_s,li:bs,optgroup:Cs,option:As,p:Es,rp:xn,rt:xn,tbody:Is,td:On,tfoot:Ls,th:On,thead:Ss,tr:ks});function wt(e,t,n){const r=D(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&nn(r.value.charAt(0)))}function _s(e,t,n){const r=D(n,t);return!r||r.type!=="comment"}function ys(e,t,n){const r=D(n,t);return!r||r.type!=="comment"}function Es(e,t,n){const r=D(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.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 bs(e,t,n){const r=D(n,t);return!r||r.type==="element"&&r.tagName==="li"}function ws(e,t,n){const r=D(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function vs(e,t,n){const r=D(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function xn(e,t,n){const r=D(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Cs(e,t,n){const r=D(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function As(e,t,n){const r=D(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Ss(e,t,n){const r=D(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Is(e,t,n){const r=D(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Ls(e,t,n){return!D(n,t)}function ks(e,t,n){const r=D(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function On(e,t,n){const r=D(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Rs=Wr({body:xs,colgroup:Os,head:Ts,html:Ps,tbody:Ds});function Ps(e){const t=D(e,-1);return!t||t.type!=="comment"}function Ts(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function xs(e){const t=D(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&nn(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Os(e,t,n){const r=Ur(n,t),i=D(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&rn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Ds(e,t,n){const r=Ur(n,t),i=D(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&rn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Me={name:[[` +import{_ as p}from"./preload-helper.mjs";class nn{diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const o=this.castInput(t,r),s=this.castInput(n,r),a=this.removeEmpty(this.tokenize(o,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(a,l,r,i)}diffWithOptionsObj(t,n,r,i){var o;const s=g=>{if(g=this.postProcess(g,r),i){setTimeout(function(){i(g)},0);return}else return g},a=n.length,l=t.length;let u=1,d=a+l;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const c=(o=r.timeout)!==null&&o!==void 0?o:1/0,h=Date.now()+c,f=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(f[0],n,t,0,r);if(f[0].oldPos+1>=l&&m+1>=a)return s(this.buildValues(f[0].lastComponent,n,t));let _=-1/0,b=1/0;const y=()=>{for(let g=Math.max(_,-u);g<=Math.min(b,u);g+=2){let w;const v=f[g-1],C=f[g+1];v&&(f[g-1]=void 0);let L=!1;if(C){const B=C.oldPos-g;L=C&&0<=B&&B=l&&m+1>=a)return s(this.buildValues(w.lastComponent,n,t))||!0;f[g]=w,w.oldPos+1>=l&&(b=Math.min(b,g-1)),m+1>=a&&(_=Math.max(_,g+1))}u++};if(i)(function g(){setTimeout(function(){if(u>d||Date.now()>h)return i(void 0);y()||g()},0)})();else for(;u<=d&&Date.now()<=h;){const g=y();if(g)return g}}addToPath(t,n,r,i,o){const s=t.lastComponent;return s&&!o.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,i,o){const s=n.length,a=r.length;let l=t.oldPos,u=l-i,d=0;for(;u+1h.length?m:h}),d.value=this.join(c)}else d.value=this.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}}return i}}class Ki extends nn{}const Ji=new Ki;function hc(e,t,n){return Ji.diff(e,t,n)}const In="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 Yi extends nn{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${In}]+|[^\\S\\n\\r]+|[^${In}]`,"ug");return t.match(n)||[]}}const Zi=new Yi;function pc(e,t,n){return Zi.diff(e,t,n)}class eo extends nn{constructor(){super(...arguments),this.tokenize=no}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(` +`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(` +`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(` +`)&&(t=t.slice(0,-1)),n.endsWith(` +`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const to=new eo;function Ln(e,t,n){return to.diff(e,t,n)}function no(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,` +`));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i"~"||e[t]==='"'||e[t]==="\\")return!0;return!1}function te(e){if(!ro(e))return e;let t='"';const n=new TextEncoder().encode(e);let r=0;for(;r=32&&i<=126?t+=String.fromCharCode(i):t+="\\"+i.toString(8).padStart(3,"0"),r++}return t+='"',t}const Rn={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Pn(e,t,n,r,i,o,s){let a;s?typeof s=="function"?a={callback:s}:a=s:a={},typeof a.context>"u"&&(a.context=4);const l=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){const{callback:d}=a;Ln(n,r,Object.assign(Object.assign({},a),{callback:c=>{const h=u(c);d(h)}}))}else return u(Ln(n,r,a));function u(d){if(!d)return;d.push({value:"",lines:[]});function c(g){return g.map(function(w){return" "+w})}const h=[];let f=0,m=0,_=[],b=1,y=1;for(let g=0;g0?c(C.lines.slice(-l)):[],f-=_.length,m-=_.length)}for(const C of v)_.push((w.added?"+":"-")+C);w.added?y+=v.length:b+=v.length}else{if(f)if(v.length<=l*2&&g1&&!t.includeFileHeaders&&!e.every(d=>d.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(d=>$t(d,t)).join(` +`)}const l=[];if(e.isGit){if(t=Rn,!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 d=e.oldFileName,c=e.newFileName;e.isCreate&&d==="/dev/null"?d=c.replace(/^b\//,"a/"):e.isDelete&&c==="/dev/null"&&(c=d.replace(/^a\//,"b/")),l.push("diff --git "+te(d)+" "+te(c)),e.isDelete&&l.push("deleted file mode "+((n=e.oldMode)!==null&&n!==void 0?n:"100644")),e.isCreate&&l.push("new file mode "+((r=e.newMode)!==null&&r!==void 0?r:"100644")),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(l.push("old mode "+e.oldMode),l.push("new mode "+e.newMode)),e.isRename&&(l.push("rename from "+te(((i=e.oldFileName)!==null&&i!==void 0?i:"").replace(/^a\//,""))),l.push("rename to "+te(((o=e.newFileName)!==null&&o!==void 0?o:"").replace(/^b\//,"")))),e.isCopy&&(l.push("copy from "+te(((s=e.oldFileName)!==null&&s!==void 0?s:"").replace(/^a\//,""))),l.push("copy to "+te(((a=e.newFileName)!==null&&a!==void 0?a:"").replace(/^b\//,""))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&l.push("Index: "+e.oldFileName),t.includeUnderline&&l.push("===================================================================");const u=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||u)&&(l.push("--- "+te(e.oldFileName)+(e.oldHeader?" "+e.oldHeader:"")),l.push("+++ "+te(e.newFileName)+(e.newHeader?" "+e.newHeader:"")));for(let d=0;d{a(l?$t(l,s.headerOptions):void 0)}}))}else{const a=Pn(e,t,n,r,i,o,s);return a?$t(a,s?.headerOptions):void 0}}function io(e){const t=e.endsWith(` +`),n=e.split(` +`).map(r=>r+` +`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}const oo=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Ve{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ve.prototype.normal={};Ve.prototype.property={};Ve.prototype.space=void 0;function vr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ve(n,r,t)}function Vt(e){return e.toLowerCase()}class G{constructor(t,n){this.attribute=n,this.property=t}}G.prototype.attribute="";G.prototype.booleanish=!1;G.prototype.boolean=!1;G.prototype.commaOrSpaceSeparated=!1;G.prototype.commaSeparated=!1;G.prototype.defined=!1;G.prototype.mustUseProperty=!1;G.prototype.number=!1;G.prototype.overloadedBoolean=!1;G.prototype.property="";G.prototype.spaceSeparated=!1;G.prototype.space=void 0;let so=0;const S=he(),T=he(),Gt=he(),E=he(),k=he(),ue=he(),F=he();function he(){return 2**++so}const Bt=Object.freeze(Object.defineProperty({__proto__:null,boolean:S,booleanish:T,commaOrSpaceSeparated:F,commaSeparated:ue,number:E,overloadedBoolean:Gt,spaceSeparated:k},Symbol.toStringTag,{value:"Module"})),vt=Object.keys(Bt);class rn extends G{constructor(t,n,r,i){let o=-1;if(super(t,n),Tn(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&co.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(xn,fo);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!xn.test(o)){let s=o.replace(uo,po);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=rn}return new i(r,t)}function po(e){return"-"+e.toLowerCase()}function fo(e){return e.charAt(1).toUpperCase()}const mo=vr([Cr,ao,kr,Ir,Lr],"html"),Rr=vr([Cr,lo,kr,Ir,Lr],"svg"),On={}.hasOwnProperty;function go(e,t){const n=t||{};function r(i,...o){let s=r.invalid;const a=r.handlers;if(i&&On.call(i,e)){const l=String(i[e]);s=On.call(a,l)?a[l]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const _o=/["&'<>`]/g,yo=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,bo=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,wo=/[|\\{}()[\]^$+*?.]/g,Dn=new WeakMap;function Eo(e,t){if(e=e.replace(t.subset?vo(t.subset):_o,r),t.subset||t.escapeOnly)return e;return e.replace(yo,n).replace(bo,r);function n(i,o,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function r(i,o,s){return t.format(i.charCodeAt(0),s.charCodeAt(o+1),t)}}function vo(e){let t=Dn.get(e);return t||(t=Co(e),Dn.set(e,t)),t}function Co(e){const t=[];let n=-1;for(;++n",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:"€"},Ro=["cent","copy","divide","gt","lt","not","para","times"],Pr={}.hasOwnProperty,Ft={};let We;for(We in Ct)Pr.call(Ct,We)&&(Ft[Ct[We]]=We);const Po=/[^\dA-Za-z]/;function To(e,t,n,r){const i=String.fromCharCode(e);if(Pr.call(Ft,i)){const o=Ft[i],s="&"+o;return n&&Lo.includes(o)&&!Ro.includes(o)&&(!r||t&&t!==61&&Po.test(String.fromCharCode(t)))?s:s+";"}return""}function xo(e,t,n){let r=Ao(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=To(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=Io(e,t,n.omitOptionalSemicolons);o.length|^->||--!>|"],No=["<",">"];function Mo(e,t,n,r){return r.settings.bogusComments?"":"";function i(o){return be(o,Object.assign({},r.settings.characterReferences,{subset:No}))}}function $o(e,t,n,r){return""}function Nn(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Vo(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Go(e){return e.join(" ").trim()}const Bo=/[ \t\n\f\r]/g;function on(e){return typeof e=="object"?e.type==="text"?Mn(e.value):!1:Mn(e)}function Mn(e){return e.replace(Bo,"")===""}const D=xr(1),Tr=xr(-1),Fo=[];function xr(e){return t;function t(n,r,i){const o=n?n.children:Fo;let s=(r||0)+e,a=o[s];if(!i)for(;a&&on(a);)s+=e,a=o[s];return a}}const Uo={}.hasOwnProperty;function Or(e){return t;function t(n,r,i){return Uo.call(e,n.tagName)&&e[n.tagName](n,r,i)}}const sn=Or({body:Wo,caption:St,colgroup:St,dd:Xo,dt:qo,head:St,html:jo,li:zo,optgroup:Qo,option:Ko,p:Ho,rp:$n,rt:$n,tbody:Yo,td:Vn,tfoot:Zo,th:Vn,thead:Jo,tr:es});function St(e,t,n){const r=D(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&on(r.value.charAt(0)))}function jo(e,t,n){const r=D(n,t);return!r||r.type!=="comment"}function Wo(e,t,n){const r=D(n,t);return!r||r.type!=="comment"}function Ho(e,t,n){const r=D(n,t);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.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 zo(e,t,n){const r=D(n,t);return!r||r.type==="element"&&r.tagName==="li"}function qo(e,t,n){const r=D(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Xo(e,t,n){const r=D(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function $n(e,t,n){const r=D(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Qo(e,t,n){const r=D(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Ko(e,t,n){const r=D(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Jo(e,t,n){const r=D(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Yo(e,t,n){const r=D(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Zo(e,t,n){return!D(n,t)}function es(e,t,n){const r=D(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Vn(e,t,n){const r=D(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const ts=Or({body:is,colgroup:os,head:rs,html:ns,tbody:ss});function ns(e){const t=D(e,-1);return!t||t.type!=="comment"}function rs(e){const t=new Set;for(const r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}const n=e.children[0];return!n||n.type==="element"}function is(e){const t=D(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&on(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function os(e,t,n){const r=Tr(n,t),i=D(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function ss(e,t,n){const r=Tr(n,t),i=D(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const He={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 @@ -8,10 +18,12 @@ import{_ as d}from"./preload-helper.mjs";var Tt=Object.defineProperty,Ai=Object. \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Ns(e,t,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=Br);const u=Vs(r,e.properties),c=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,c&&(s=!1),(u||!o||!Rs(e,t,n))&&(a.push("<",e.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(c),!s&&(!o||!rn(e,t,n))&&a.push(""),a.join("")}function Vs(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const o=Ms(e,i,t[i]);o&&n.push(o)}}for(;++rPn(n,e.alternative)&&(s=e.alternative),a=s+Ee(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Me.single:Me.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}const $s=["<","&"];function Hr(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Ee(e.value,Object.assign({},r.settings.characterReferences,{subset:$s}))}function Gs(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Hr(e,t,n,r)}function Bs(e,t,n,r){return r.all(e)}const Fs=Wo("type",{invalid:Us,unknown:js,handlers:{comment:cs,doctype:ds,element:Ns,raw:Gs,root:Bs,text:Hr}});function Us(e){throw new Error("Expected node, not `"+e+"`")}function js(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Ws={},Hs={},zs=[];function qs(e,t){const n=t||Ws,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Xs,all:Ks,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||Do,characterReferences:n.characterReferences||Hs,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Br:jo,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Xs(e,t,n){return Fs(e,t,n,this)}function Ks(e){const t=[],n=e&&e.children||zs;let r=-1;for(;++ri);function n(i){if(i===e.length)return{line:t.length-1,character:t.at(-1).length};let o=i,s=0;for(const a of t){if(on&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n>1);e[i]<=t?n=i+1:r=i}return n}function ea(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const o=i.offset+i.content.length,s=Ys(n,i.offset);let a=s;for(;aJe(e.variants[c])),a=new Set(s.flatMap(c=>Object.keys(c))),l={},u=(c,p)=>{const f=p==="color"?"":p==="background-color"?"-bg":`-${p}`;return n+t[c]+(p==="color"?"":f)};return s.forEach((c,p)=>{for(const f of a){const h=c[f]||"inherit";if(p===0&&r&&Js.includes(f))if(r==="light-dark()"&&s.length>1){const m=t.findIndex(g=>g==="light"),y=t.findIndex(g=>g==="dark");if(m===-1||y===-1)throw new k('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=s[m][f]||"inherit",_=s[y][f]||"inherit";l[f]=`light-dark(${b}, ${_})`,i==="css-vars"&&(l[u(p,f)]=h)}else l[f]=h;else i==="css-vars"&&(l[u(p,f)]=h)}}),o.htmlStyle=l,o}function Je(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&$.Italic&&(t["font-style"]="italic"),e.fontStyle&$.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&$.Underline&&n.push("underline"),e.fontStyle&$.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function jt(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function na(){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 k(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const a=r.lines[s.line];if(a===void 0)throw new k(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let l=s.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new k(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${a.length}`);return{...s,character:l,offset:r.posToIndex(s.line,l)}}};const r=Qs(n.source),o=(n.options.decorations||[]).map(s=>({...s,start:i(s.start),end:i(s.end)}));ra(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 ea(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),i=[...n.children].filter(c=>c.type==="element"&&c.tagName==="span");if(i.length!==r.converter.lines.length)throw new k(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(c,p,f,h){const m=i[c];let y="",b=-1,_=-1;if(p===0&&(b=0),f===0&&(_=0),f===Number.POSITIVE_INFINITY&&(_=m.children.length),b===-1||_===-1)for(let E=0;Ey);return c.tagName=p.tagName||"span",c.properties={...c.properties,...h,class:c.properties.class},p.properties?.class&&zr(c,p.properties.class),c=m(c,f)||c,c}const l=[],u=r.decorations.sort((c,p)=>p.start.offset-c.start.offset||c.end.offset-p.end.offset);for(const c of u){const{start:p,end:f}=c;if(p.line===f.line)o(p.line,p.character,f.character,c);else if(p.lines(h,c));o(f.line,0,f.character,c)}}l.forEach(c=>c())}}}function ra(e){for(let t=0;tn.end.offset)throw new k(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;rNumber.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function aa(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)vt[r]&&t.push({type:"setDecoration",value:vt[r]});else if(r<=29){const i=vt[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:ae[r-30]}});else if(r===38){const i=Nn(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:ae[r-40]}});else if(r===48){const i=Nn(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:ae[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:ae[r-100+8]}})}return t}function la(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let o=0;do{const s=sa(r,o),a=s.sequence?r.substring(o,s.startPosition):r.substring(o);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const l=aa(s.sequence);for(const u of l)u.type==="resetAll"?(e=null,t=null,n.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of l)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&n.add(u.value)}o=s.position}while(oMath.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let u=0;u{const l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,e.colors?.[l]||ha[a]]}))),s=la();return i.map(a=>s.parse(a[0]).map(l=>{let u,c;l.decorations.has("reverse")?(u=l.background?o.value(l.background):e.bg,c=l.foreground?o.value(l.foreground):e.fg):(u=l.foreground?o.value(l.foreground):e.fg,c=l.background?o.value(l.background):void 0),u=re(u,r),c=re(c,r),l.decorations.has("dim")&&(u=ma(u));let p=$.None;return l.decorations.has("bold")&&(p|=$.Bold),l.decorations.has("italic")&&(p|=$.Italic),l.decorations.has("underline")&&(p|=$.Underline),l.decorations.has("strikethrough")&&(p|=$.Strikethrough),{content:l.value,offset:a[1],color:u,bgColor:c,fontStyle:p}}))}function ma(e){const t=e.match(da);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],o=r[1],s=r[2],a=r[3];return`#${i}${i}${o}${o}${s}${s}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const i=r[0],o=r[1],s=r[2];return`#${i}${i}${o}${o}${s}${s}80`}}}const n=e.match(pa);return n?`var(${n[1]}-dim)`:e}function Wt(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=n;if(!nt(r)&&!rt(i)&&r==="ansi"){const{theme:o}=e.setTheme(i);return fa(o,t,n)}return Tr(e,t,n)}function Ye(e,t,n){let r,i,o,s,a,l;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:c="--shiki-",colorsRendering:p="css-vars"}=n,f=Object.entries(n.themes).filter(_=>_[1]).map(_=>({color:_[0],theme:_[1]})).sort((_,g)=>_.color===u?-1:g.color===u?1:0);if(f.length===0)throw new k("`themes` option must not be empty");const h=xr(e,t,n,Wt);if(l=Pe(h),u&&u!=="light-dark()"&&!f.some(_=>_.color===u))throw new k(`\`themes\` option must contain the defaultColor key \`${u}\``);const m=f.map(_=>e.getTheme(_.theme)),y=f.map(_=>_.color);o=h.map(_=>_.map(g=>ta(g,y,c,u,p))),l&&ot(o,l);const b=f.map(_=>Qe(_.theme,n));i=Vn(f,m,b,c,u,"fg",p),r=Vn(f,m,b,c,u,"bg",p),s=`shiki-themes ${m.map(_=>_.name).join(" ")}`,a=u?void 0:[i,r].join(";")}else if("theme"in n){const u=Qe(n.theme,n);o=Wt(e,t,n);const c=e.getTheme(n.theme);r=re(c.bg,u),i=re(c.fg,u),s=c.name,l=Pe(o)}else throw new k("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:i,bg:r,themeName:s,rootStyle:a,grammarState:l}}function Vn(e,t,n,r,i,o,s){return e.map((a,l)=>{const u=re(t[l][o],n[l])||"inherit",c=`${r+a.color}${o==="bg"?"-bg":""}:${u}`;if(l===0&&i){if(i==="light-dark()"&&e.length>1){const p=e.findIndex(h=>h.color==="light"),f=e.findIndex(h=>h.color==="dark");if(p===-1||f===-1)throw new k('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${re(t[p][o],n[p])||"inherit"}, ${re(t[f][o],n[f])||"inherit"});${c}`}return u}return s==="css-vars"?c:null}).filter(a=>!!a).join(";")}const Xr=/^\s+$/,ga=/^(\s*)(.*?)(\s*)$/;function et(e,t,n,r={meta:{},options:n,codeToHast:(i,o)=>et(e,i,o),codeToTokens:(i,o)=>Ye(e,i,o)}){let i=t;for(const m of Ze(n))i=m.preprocess?.call(r,i,n)||i;let{tokens:o,fg:s,bg:a,themeName:l,rootStyle:u,grammarState:c}=Ye(e,i,n);const{mergeWhitespaces:p=!0,mergeSameStyleTokens:f=!1}=n;p===!0?o=ya(o):p==="never"&&(o=Ea(o)),f&&(o=ba(o));const h={...r,get source(){return i}};for(const m of Ze(n))o=m.tokens?.call(h,o)||o;return _a(o,{...n,fg:s,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},h,c)}function _a(e,t,n,r=Pe(e)){const i=Ze(t),o=[],s={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(const[y,b]of Object.entries(t.meta||{}))y.startsWith("_")||(u[y]=b);let c={type:"element",tagName:"pre",properties:u,children:[],data:t.data},p={type:"element",tagName:"code",properties:{},children:o};const f=[],h={...n,structure:a,addClassToHast:zr,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return c},get code(){return p},get lines(){return f}};if(e.forEach((y,b)=>{b&&(a==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&o.push({type:"text",value:` -`}));let _={type:"element",tagName:"span",properties:{class:"line"},children:[]},g=0;for(const E of y){let v={type:"element",tagName:"span",properties:{...E.htmlAttrs},children:[{type:"text",value:E.content}]};const C=jt(E.htmlStyle||Je(E));C&&(v.properties.style=C);for(const L of i)v=L?.span?.call(h,v,b+1,g,_,E)||v;a==="inline"?s.children.push(v):a==="classic"&&_.children.push(v),g+=E.content.length}if(a==="classic"){for(const E of i)_=E?.line?.call(h,_,b+1)||_;f.push(_),o.push(_)}else a==="inline"&&f.push(_)}),a==="classic"){for(const y of i)p=y?.code?.call(h,p)||p;c.children.push(p);for(const y of i)c=y?.pre?.call(h,c)||c;s.children.push(c)}else if(a==="inline"){const y=[];let b={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const g of s.children)g.type==="element"&&g.tagName==="br"?(y.push(b),b={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(g.type==="element"||g.type==="text")&&b.children.push(g);y.push(b);let _={type:"element",tagName:"code",properties:{},children:y};for(const g of i)_=g?.code?.call(h,_)||_;s.children=[];for(let g=0;g<_.children.length;g++){g>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const E=_.children[g];E.type==="element"&&s.children.push(...E.children)}}let m=s;for(const y of i)m=y?.root?.call(h,m)||m;return r&&ot(m,r),m}function ya(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((o,s)=>{const a=!(o.fontStyle&&(o.fontStyle&$.Underline||o.fontStyle&$.Strikethrough));a&&Xr.test(o.content)&&t[s+1]?(i===void 0&&(i=o.offset),r+=o.content):r?(a?n.push({...o,offset:i,content:r+o.content}):n.push({content:r,offset:i},o),i=void 0,r=""):n.push(o)}),n})}function Ea(e){return e.map(t=>t.flatMap(n=>{if(Xr.test(n.content))return n;const r=n.content.match(ga);if(!r)return n;const[,i,o,s]=r;if(!i&&!s)return n;const a=[{...n,offset:n.offset+i.length,content:o}];return i&&a.unshift({content:i,offset:n.offset}),s&&a.push({content:s,offset:n.offset+i.length+o.length}),a}))}function ba(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n.at(-1),o=jt(i.htmlStyle||Je(i)),s=jt(r.htmlStyle||Je(r)),a=i.fontStyle&&(i.fontStyle&$.Underline||i.fontStyle&$.Strikethrough),l=r.fontStyle&&(r.fontStyle&$.Underline||r.fontStyle&$.Strikethrough);!a&&!l&&o===s?i.content+=r.content:n.push({...r})}return n})}const wa=qs;function va(e,t,n){const r={meta:{},options:n,codeToHast:(o,s)=>et(e,o,s),codeToTokens:(o,s)=>Ye(e,o,s)};let i=wa(et(e,t,n,r));for(const o of Ze(n))i=o.postprocess?.call(r,i,n)||i;return i}async function Ca(e){const t=await vo(e);return{getLastGrammarState:(...n)=>Lo(t,...n),codeToTokensBase:(n,r)=>Wt(t,n,r),codeToTokensWithThemes:(n,r)=>xr(t,n,r),codeToTokens:(n,r)=>Ye(t,n,r),codeToHast:(n,r)=>et(t,n,r),codeToHtml:(n,r)=>va(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Aa(e){const t=e.langs,n=e.themes,r=e.engine;async function i(o){function s(p){if(typeof p=="string"){if(p=o.langAlias?.[p]||p,Ar(p))return[];const f=t[p];if(!f)throw new k(`Language \`${p}\` is not included in this bundle. You may want to load it from external source.`);return f}return p}function a(p){if(Sr(p))return"none";if(typeof p=="string"){const f=n[p];if(!f)throw new k(`Theme \`${p}\` is not included in this bundle. You may want to load it from external source.`);return f}return p}const l=(o.themes??[]).map(p=>a(p)),u=(o.langs??[]).map(p=>s(p)),c=await Ca({engine:o.engine??r(),...o,themes:l,langs:u});return{...c,loadLanguage(...p){return c.loadLanguage(...p.map(s))},loadTheme(...p){return c.loadTheme(...p.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}const Mn=4294967295;function Sa(e){return!e.sticky&&!e.rawOptions?.strategy}function $n(e,t){return{index:e,captureIndices:t.map(n=>n==null?{start:Mn,end:Mn,length:0}:{start:n[0],end:n[1],length:n[1]-n[0]})}}var Ia=class{patterns;options;regexps;lastSearches;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const s=r?.get(o);if(s){if(s instanceof RegExp)return s;if(n)return null;throw s}try{const a=i(o);return r?.set(o,a),a}catch(a){if(r?.set(o,a),n)return null;throw a}}),this.lastSearches=this.regexps.map(o=>o&&Sa(o)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,i=typeof e=="string"?0:e.id||0;let o=-1,s=0,a=null;for(let l=0;l=t))p=c.matchIndex,f=c.indices;else{u.lastIndex=t;const h=u.exec(r);p=h?h.index:-1,f=h?h.indices:null,c&&(c.strId=i,c.searchedFrom=t,c.matchIndex=p,c.indices=f)}if(p===-1)continue;if(p===t)return $n(l,f);(o===-1||p\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function as(e,t,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const a=[];let l;i.space==="html"&&e.tagName==="svg"&&(r.schema=Rr);const u=ls(r,e.properties),d=r.all(i.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=i,d&&(s=!1),(u||!o||!ts(e,t,n))&&(a.push("<",e.tagName,u?" "+u:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(d),!s&&(!o||!sn(e,t,n))&&a.push(""),a.join("")}function ls(e,t){const n=[];let r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){const o=us(e,i,t[i]);o&&n.push(o)}}for(;++rNn(n,e.alternative)&&(s=e.alternative),a=s+be(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?He.single:He.double)[i][o],attribute:!0}))+s),l+(a&&"="+a))}const cs=["<","&"];function Dr(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:be(e.value,Object.assign({},r.settings.characterReferences,{subset:cs}))}function ds(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Dr(e,t,n,r)}function hs(e,t,n,r){return r.all(e)}const ps=go("type",{invalid:fs,unknown:ms,handlers:{comment:Mo,doctype:$o,element:as,raw:ds,root:hs,text:Dr}});function fs(e){throw new Error("Expected node, not `"+e+"`")}function ms(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const gs={},_s={},ys=[];function bs(e,t){const n=t||gs,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ws,all:Es,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||oo,characterReferences:n.characterReferences||_s,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Rr:mo,quote:r,alternative:i}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ws(e,t,n){return ps(e,t,n,this)}function Es(e){const t=[],n=e&&e.children||ys;let r=-1;for(;++rthis.limit&&this.shift(),this)}shift(){var c=this.oldest;if(c)return this.oldest[r]?(this.oldest=this.oldest[r],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),c[r]=c[i]=void 0,this._keymap.delete(c.key),--this.size,[c.key,c.value]}find(c){let h=this._keymap.get(c);return h?h.value:void 0}has(c){return this._keymap.has(c)}delete(c){var h=this._keymap.get(c);return h?(this._keymap.delete(h.key),h[r]&&h[i]?(h[i][r]=h[r],h[r][i]=h[i]):h[r]?(h[r][i]=void 0,this.oldest=h[r]):h[i]?(h[i][r]=void 0,this.newest=h[i]):this.oldest=this.newest=void 0,this.size--,h.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new l(this.oldest)}values(){return new u(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(c,h){typeof h!="object"&&(h=this);let f=this.oldest;for(;f;)c.call(h,f.value,f.key,this),f=f[r]}toJSON(){for(var c=new Array(this.size),h=0,f=this.oldest;f;)c[h++]={key:f.key,value:f.value},f=f[r];return c}toString(){for(var c="",h=this.oldest;h;)c+=String(h.key)+":"+h.value,h=h[r],h&&(c+=" < ");return c}}n.LRUMap=o;function s(d,c){this.key=d,this.value=c,this[r]=void 0,this[i]=void 0}function a(d){this.entry=d}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let d=this.entry;return d?(this.entry=d[r],{done:!1,value:[d.key,d.value]}):{done:!0,value:void 0}};function l(d){this.entry=d}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let d=this.entry;return d?(this.entry=d[r],{done:!1,value:d.key}):{done:!0,value:void 0}};function u(d){this.entry=d}u.prototype[Symbol.iterator]=function(){return this},u.prototype.next=function(){let d=this.entry;return d?(this.entry=d[r],{done:!1,value:d.value}):{done:!0,value:void 0}}})})(ke,ke.exports)),ke.exports}var As=Ss();const mc=vs(As);var Ut=Object.defineProperty,ks=Object.getOwnPropertyDescriptor,Is=Object.getOwnPropertyNames,Ls=Object.prototype.hasOwnProperty,Rs=(e,t)=>{let n={};for(var r in e)Ut(n,r,{get:e[r],enumerable:!0});return Ut(n,Symbol.toStringTag,{value:"Module"}),n},Ps=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var i=Is(t),o=0,s=i.length,a;ot[l]).bind(null,a),enumerable:!(r=ks(t,a))||r.enumerable});return e},Ts=(e,t,n)=>(Ps(e,t,"default"),n),I=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function xs(e){return an(e)}function an(e){return Array.isArray(e)?Os(e):e instanceof RegExp?e:typeof e=="object"?Ds(e):e}function Os(e){let t=[];for(let n=0,r=e.length;n{for(let r in n)e[r]=n[r]}),e}function Mr(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Mr(e.substring(0,e.length-1)):e.substr(~t+1)}var At=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ze=class{static hasCaptures(e){return e===null?!1:(At.lastIndex=0,At.test(e))}static replaceCaptures(e,t,n){return e.replace(At,(r,i,o,s)=>{let a=n[parseInt(i||o,10)];if(a){let l=t.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function $r(e,t){return et?1:0}function Vr(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;ithis._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>Ns(e.parent,i.parentScopes));return r?new Fr(r.fontStyle,r.foreground,r.background):null}},kt=class Je{constructor(t,n){this.parent=t,this.scopeName=n}parent;scopeName;static push(t,n){for(const r of n)t=new Je(t,r);return t}static from(...t){let n=null;for(let r=0;r"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Ms(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Ms(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Fr=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}fontStyle;foregroundId;backgroundId};function $s(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,o=t.length;i1&&(b=m.slice(0,m.length-1),b.reverse()),n[r++]=new Vs(_,b,i,l,u,d)}}return n}var Vs=class{constructor(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}scope;parentScopes;index;fontStyle;foreground;background},V=(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))(V||{});function Gs(e,t){e.sort((l,u)=>{let d=$r(l.scope,u.scope);return d!==0||(d=Vr(l.parentScopes,u.parentScopes),d!==0)?d:l.index-u.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let o=new Bs(t),s=new Fr(n,o.getId(r),o.getId(i)),a=new Us(new jt(0,null,-1,0,0),[]);for(let l=0,u=e.length;lt?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},Us=class Wt{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_mainRule;_children;_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-t.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,o;if(r===-1?(i=t,o=""):(i=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Wt._cmpBySpecificity),n}insert(t,n,r,i,o,s){if(n===""){this._doInsertHere(t,r,i,o,s);return}let a=n.indexOf("."),l,u;a===-1?(l=n,u=""):(l=n.substring(0,a),u=n.substring(a+1));let d;this._children.hasOwnProperty(l)?d=this._children[l]:(d=new Wt(this._mainRule.clone(),jt.cloneArr(this._rulesWithParentScopes)),this._children[l]=d),d.insert(t+1,u,r,i,o,s)}_doInsertHere(t,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(t,r,i,o);return}for(let s=0,a=this._rulesWithParentScopes.length;s>>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,r,i,o,s,a){let l=U.getLanguageId(t),u=U.getTokenType(t),d=U.containsBalancedBrackets(t)?1:0,c=U.getFontStyle(t),h=U.getForeground(t),f=U.getBackground(t);return n!==0&&(l=n),r!==8&&(u=r),i!==null&&(d=i?1:0),o!==-1&&(c=o),s!==0&&(h=s),a!==0&&(f=a),(l<<0|u<<8|d<<10|c<<11|h<<15|f<<24)>>>0}};function tt(e,t){const n=[],r=js(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let u=s();if(n.push({matcher:u,priority:l}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const l=o();return u=>!!l&&!l(u)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(Fn(i)){const l=[];do l.push(i),i=r.next();while(Fn(i));return u=>t(l,u)}return null}function s(){const l=[];let u=o();for(;u;)l.push(u),u=o();return d=>l.every(c=>c(d))}function a(){const l=[];let u=s();for(;u&&(l.push(u),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");u=s()}return d=>l.some(c=>c(d))}}function Fn(e){return!!e&&!!e.match(/[\w\.:]+/)}function js(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function jr(e){typeof e.dispose=="function"&&e.dispose()}var Pe=class{constructor(e){this.scopeName=e}scopeName;toKey(){return this.scopeName}},Ws=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;toKey(){return`${this.scopeName}#${this.ruleName}`}},Hs=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))}},zs=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Pe(this.initialScopeName)]}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new Hs;for(const n of e)qs(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Pe){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 qs(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Pe?Ye({baseGrammar:o,selfGrammar:i},r):Ht(e.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(e.scopeName);if(s)for(const a of s)r.add(new Pe(a))}function Ht(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];nt([r],t,n)}}function Ye(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&nt(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&nt(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function nt(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Nr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&nt(r.patterns,{...t,repository:i},n);const o=r.include;if(!o)continue;const s=Wr(o);switch(s.kind){case 0:Ye({...t,selfGrammar:t.baseGrammar},n);break;case 1:Ye(t,n);break;case 2:Ht(s.ruleName,{...t,repository:i},n);break;case 3:case 4:const a=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(a){const l={baseGrammar:t.baseGrammar,selfGrammar:a,repository:i};s.kind===4?Ht(s.ruleName,l,n):Ye(l,n)}else s.kind===4?n.add(new Ws(s.scopeName,s.ruleName)):n.add(new Pe(s.scopeName));break}}}var Xs=class{kind=0},Qs=class{kind=1},Ks=class{constructor(e){this.ruleName=e}ruleName;kind=2},Js=class{constructor(e){this.scopeName=e}scopeName;kind=3},Ys=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;kind=4};function Wr(e){if(e==="$base")return new Xs;if(e==="$self")return new Qs;const t=e.indexOf("#");if(t===-1)return new Js(e);if(t===0)return new Ks(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new Ys(n,r)}}var Zs=/\\(\d+)/,Un=/\\(\d+)/g,ea=-1,Hr=-2;var Ge=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=ze.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ze.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Mr(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:ze.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ze.replaceCaptures(this._contentName,e,t)}},ta=class extends Ge{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},na=class extends Ge{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Te(r,this.id),this.captures=i,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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new xe,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},jn=class extends Ge{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new xe,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},zt=class extends Ge{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,o,s,a,l,u){super(e,t,n,r),this._begin=new Te(i,this.id),this.beginCaptures=o,this._end=new Te(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.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,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new xe;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}},rt=class extends Ge{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,o,s,a,l){super(e,t,n,r),this._begin=new Te(i,this.id),this.beginCaptures=o,this.whileCaptures=a,this._while=new Te(s,Hr),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.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,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new xe;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,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new xe,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},zr=class ${static createCaptureRule(t,n,r,i,o){return t.registerRule(s=>new ta(n,s,r,i,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new na(t.$vscodeTextmateLocation,t.id,t.name,t.match,$._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Nr({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new jn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,$._compilePatterns(o,n,r))}return t.while?new rt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,$._compileCaptures(t.whileCaptures||t.captures,n,r),$._compilePatterns(t.patterns,n,r)):new zt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,$._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,$._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,$._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);a>o&&(o=a)}for(let s=0;s<=o;s++)i[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const a=parseInt(s,10);let l=0;t[s].patterns&&(l=$.getCompiledRuleId(t[s],n,r)),i[a]=$.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let o=0,s=t.length;ot.substring(i.start,i.end));return Un.lastIndex=0,this.source.replace(Un,(i,o)=>Gr(r[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=[],r=[],i=[],o,s,a,l;for(o=0,s=this.source.length;on.source);this._cached=new Wn(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 r=this._items.map(i=>i.resolveAnchors(t,n));return new Wn(e,r,this._items.map(i=>i.ruleId))}},Wn=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}regExps;rules;scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new It(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(qt.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/},ia=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,r])=>Gr(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])}},Hn=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}stack;stoppedEarly};function Xr(e,t,n,r,i,o,s,a){const l=t.content.length;let u=!1,d=-1;if(s){const f=oa(e,t,n,r,i,o);i=f.stack,r=f.linePos,n=f.isFirstLine,d=f.anchorPosition}const c=Date.now();for(;!u;){if(a!==0&&Date.now()-c>a)return new Hn(i,!0);h()}return new Hn(i,!1);function h(){const f=sa(e,t,n,r,i,d);if(!f){o.produce(i,l),u=!0;return}const m=f.captureIndices,_=f.matchedRuleId,b=m&&m.length>0?m[0].end>r:!1;if(_===ea){const y=i.getRule(e);o.produce(i,m[0].start),i=i.withContentNameScopesList(i.nameScopesList),Ie(e,t,n,i,o,y.endCaptures,m),o.produce(i,m[0].end);const g=i;if(i=i.parent,d=g.getAnchorPos(),!b&&g.getEnterPos()===r){i=g,o.produce(i,l),u=!0;return}}else{const y=e.getRule(_);o.produce(i,m[0].start);const g=i,w=y.getName(t.content,m),v=i.contentNameScopesList.pushAttributed(w,e);if(i=i.push(_,r,d,m[0].end===l,null,v,v),y instanceof zt){const C=y;Ie(e,t,n,i,o,C.beginCaptures,m),o.produce(i,m[0].end),d=m[0].end;const L=C.getContentName(t.content,m),P=v.pushAttributed(L,e);if(i=i.withContentNameScopesList(P),C.endHasBackReferences&&(i=i.withEndRule(C.getEndWithResolvedBackReferences(t.content,m))),!b&&g.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(y instanceof rt){const C=y;Ie(e,t,n,i,o,C.beginCaptures,m),o.produce(i,m[0].end),d=m[0].end;const L=C.getContentName(t.content,m),P=v.pushAttributed(L,e);if(i=i.withContentNameScopesList(P),C.whileHasBackReferences&&(i=i.withEndRule(C.getWhileWithResolvedBackReferences(t.content,m))),!b&&g.hasSameRuleAs(i)){i=i.pop(),o.produce(i,l),u=!0;return}}else if(Ie(e,t,n,i,o,y.captures,m),o.produce(i,m[0].end),i=i.pop(),!b){i=i.safePop(),o.produce(i,l),u=!0;return}}m[0].end>r&&(r=m[0].end,n=!1)}}function oa(e,t,n,r,i,o){let s=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const u=l.getRule(e);u instanceof rt&&a.push({rule:u,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:u,findOptions:d}=ua(l.rule,e,l.stack.endRule,n,r===s),c=u.findNextMatchSync(t,r,d);if(c){if(c.ruleId!==Hr){i=l.stack.pop();break}c.captureIndices&&c.captureIndices.length&&(o.produce(l.stack,c.captureIndices[0].start),Ie(e,t,n,l.stack,o,l.rule.whileCaptures,c.captureIndices),o.produce(l.stack,c.captureIndices[0].end),s=c.captureIndices[0].end,c.captureIndices[0].end>r&&(r=c.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:s,isFirstLine:n}}function sa(e,t,n,r,i,o){const s=aa(e,t,n,r,i,o),a=e.getInjections();if(a.length===0)return s;const l=la(a,e,t,n,r,i,o);if(!l)return s;if(!s)return l;const u=s.captureIndices[0].start,d=l.captureIndices[0].start;return d=a)&&(a=w,l=g.captureIndices,u=g.ruleId,d=m.priority,a===i))break}return l?{priorityMatch:d===-1,captureIndices:l,matchedRuleId:u}:null}function Qr(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function ua(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Ie(e,t,n,r,i,o,s){if(o.length===0)return;const a=t.content,l=Math.min(o.length,s.length),u=[],d=s[0].end;for(let c=0;cd)break;for(;u.length>0&&u[u.length-1].endPos<=f.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,f.start):i.produce(r,f.start),h.retokenizeCapturedWithRuleId){const _=h.getName(a,s),b=r.contentNameScopesList.pushAttributed(_,e),y=h.getContentName(a,s),g=b.pushAttributed(y,e),w=r.push(h.retokenizeCapturedWithRuleId,f.start,-1,!1,null,b,g),v=e.createOnigString(a.substring(0,f.end));Xr(e,v,n&&f.start===0,f.start,w,i,!1,0),jr(v);continue}const m=h.getName(a,s);if(m!==null){const b=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,e);u.push(new ca(b,f.end))}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var ca=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function da(e,t,n,r,i,o,s,a){return new pa(e,t,n,r,i,o,s,a)}function zn(e,t,n,r,i){const o=tt(t,it),s=zr.getCompiledRuleId(n,r,i.repository);for(const a of o)e.push({debugSelector:t,matcher:a.matcher,ruleId:s,grammar:i,priority:a.priority})}function it(e,t){if(t.length{for(let i=n;in&&e.substr(0,n)===t&&e[n]==="."}var pa=class{constructor(e,t,n,r,i,o,s,a){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=a,this._basicScopeAttributesProvider=new ra(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=qn(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const u=tt(l,it);for(const d of u)this._tokenTypeMatchers.push({matcher:d.matcher,type:i[l]})}}_rootScopeName;balancedBracketSelectors;_onigLib;_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:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let s in i)zn(t,s,i[s],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const a=this.getExternalGrammar(s);if(a){const l=a.injectionSelector;l&&zn(t,l,a,this,a)}})}return t.sort((i,o)=>i.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]=qn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=zr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Xt.NULL){i=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),d=this.themeProvider.getDefaults(),c=ce.set(0,u.languageId,u.tokenType,null,d.fontStyle,d.foregroundId,d.backgroundId),h=this.getRule(this._rootId).getName(null,null);let f;h?f=Le.createRootAndLookUpScopeName(h,c,this):f=Le.createRoot("unknown",c),t=new Xt(null,this._rootId,-1,-1,!1,null,f,f)}else i=!1,t.reset();e=e+` +`;const o=this.createOnigString(e),s=o.content.length,a=new ma(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Xr(this,o,i,0,t,a,!0,r);return jr(o),{lineLength:s,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function qn(e,t){return e=xs(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 Le=class X{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}parent;scopePath;tokenAttributes;static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(const o of n)i=kt.push(i,o.scopeNames),r=new X(r,i,o.encodedTokenAttributes);return r}static createRoot(t,n){return new X(null,new kt(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const i=r.getMetadataForScope(t),o=new kt(null,t),s=r.themeProvider.themeMatch(o),a=X.mergeAttributes(n,i,s);return new X(null,o,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return X.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,r){let i=-1,o=0,s=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,s=r.backgroundId),ce.set(t,n.languageId,n.tokenType,null,i,o,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return X._pushAttributed(this,t,n);const r=t.split(/ /g);let i=this;for(const o of r)i=X._pushAttributed(i,o,n);return i}static _pushAttributed(t,n,r){const i=r.getMetadataForScope(n),o=t.scopePath.push(n),s=r.themeProvider.themeMatch(o),a=X.mergeAttributes(t.tokenAttributes,i,s);return new X(t,o,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Xt=class oe{constructor(t,n,r,i,o,s,a,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}parent;ruleId;beginRuleCapturedEOL;endRule;nameScopesList;contentNameScopesList;_stackElementBrand=void 0;static NULL=new oe(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:oe._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Le.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(){oe._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,o,s,a){return new oe(this,t,n,r,i,o,s,a)}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 oe(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 r=Le.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new oe(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Le.fromExtension(r,n.contentNameScopesList))}},fa=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):tt(n,it).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>tt(n,it).map(r=>r.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}},ma=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}balancedBracketSelectors;_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 r=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!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)&&(r=ce.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=ce.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),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 r=0,i=this._binaryTokens.length;r0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,r,i,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 r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,i=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,i)}_grammarForScopeName(t,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,i,o)}},Qt=Xt.NULL;function Oe(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[i,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[i]=o:i===r&&Object.assign(n,o);return n}function ee(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Kr(e){return Array.isArray(e)?e:[e]}async function ln(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Be(e){return!e||["plaintext","txt","text","plain"].includes(e)}function un(e){return e==="ansi"||Be(e)}function Fe(e){return e==="none"}function cn(e){return Fe(e)}const ya=/(\r?\n)/g;function Ue(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(ya);let r=0;const i=[];for(let o=0;o!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?Xn.light:Xn.dark),n||(n=t.type==="light"?Qn.light:Qn.dark),t.fg=r,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 i=0;const o=new Map;function s(a){if(o.has(a))return o.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?s(a):(o.set(a,l),l)}t.settings=t.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),u=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!u)return a;const d={...a,settings:{...a.settings}};if(l){const c=s(a.settings.foreground);t.colorReplacements[c]=a.settings.foreground,d.settings.foreground=c}if(u){const c=s(a.settings.background);t.colorReplacements[c]=a.settings.background,d.settings.background=c}return d});for(const a of Object.keys(t.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!t.colors[a]?.startsWith("#")){const l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}return Object.defineProperty(t,Kn,{enumerable:!1,writable:!1,value:!0}),t}async function Jr(e){return[...new Set((await Promise.all(e.filter(t=>!un(t)).map(async t=>await ln(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function Yr(e){return(await Promise.all(e.map(async t=>cn(t)?null:lt(await ln(t))))).filter(t=>!!t)}function Zr(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 I(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var ba=class extends _a{_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,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=lt(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=et.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Zr(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,t.size)for(const i of t)this._syncRegistry?._grammars?.get(i.scopeName)?.dispose(),this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,i])=>!i);if(n.length){const r=t.filter(([i,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(s=>n.map(([a])=>a).includes(s)):!1).filter(i=>!n.includes(i));throw new I(`Missing languages ${n.map(([i])=>`\`${i}\``).join(", ")}, required by ${r.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[r,i]of t)this._resolver.addLanguage(i);for(const[r,i]of t)this.loadLanguage(i)}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))}},wa=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).includes(e.scopeName)||this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const i=t.slice(0,r).join(".");n=[...n,...this._injections.get(i)||[]]}return n}};let Ae=0;function ut(e){Ae+=1,e.warnings!==!1&&Ae>=10&&Ae%10===0&&console.warn(`[Shiki] ${Ae} 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 I("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(lt),i=new ba(new wa(e.engine,n),r,n,e.langAlias);let o;function s(g){return Zr(g,e.langAlias)}function a(g){b();const w=i.getGrammar(typeof g=="string"?g:g.name);if(!w)throw new I(`Language \`${g}\` not found, you may need to load it first`);return w}function l(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};b();const w=i.getTheme(g);if(!w)throw new I(`Theme \`${g}\` not found, you may need to load it first`);return w}function u(g){b();const w=l(g);return o!==g&&(i.setTheme(w),o=g),{theme:w,colorMap:i.getColorMap()}}function d(){return b(),i.getLoadedThemes()}function c(){return b(),i.getLoadedLanguages()}function h(...g){b(),i.loadLanguages(g.flat(1))}async function f(...g){return h(await Jr(g))}function m(...g){b();for(const w of g.flat(1))i.loadTheme(w)}async function _(...g){return b(),m(await Yr(g))}function b(){if(t)throw new I("Shiki instance has been disposed")}function y(){t||(t=!0,i.dispose(),Ae-=1)}return{setTheme:u,getTheme:l,getLanguage:a,getLoadedThemes:d,getLoadedLanguages:c,resolveLangAlias:s,loadLanguage:f,loadLanguageSync:h,loadTheme:_,loadThemeSync:m,dispose:y,[Symbol.dispose]:y}}const Ea=ut;async function dn(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([Yr(e.themes||[]),Jr(e.langs||[]),e.engine]);return ut({...e,themes:t,langs:n,engine:r})}const va=dn,ei=new WeakMap;function ct(e,t){ei.set(e,t)}function De(e){return ei.get(e)}var dt=class ti{_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 ti(Object.fromEntries(Kr(n).map(r=>[r,Qt])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,i]=t;this.lang=r,this._stacks={[i]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Ca(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Ca(e){const t=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const o=i?.nameScopesList?.scopeName;o&&t.push(o),i.parent&&r(i.parent)}return r(e),t}function Sa(e,t){if(!(e instanceof dt))throw new I("Invalid grammar state");return e.getInternalStack(t)}const Aa=/,/,ka=/ /;function ni(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(Be(e.resolveLangAlias(n.lang||"text"))||Fe(r))return Ue(t).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:o}=e.setTheme(r),s=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new I(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(i.name))throw new I(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return ri(t,s,i,o,n)}function hn(...e){if(e.length===2)return De(e[1]);const[t,n,r={}]=e,{lang:i="text",theme:o=t.getLoadedThemes()[0]}=r;if(Be(i)||Fe(o))throw new I("Plain language does not have grammar state");if(i==="ansi")throw new I("ANSI language does not have grammar state");const{theme:s,colorMap:a}=t.setTheme(o),l=t.getLanguage(i);return new dt(pn(n,l,s,a,r).stateStack,l.name,s.name)}function ri(e,t,n,r,i){const o=pn(e,t,n,r,i),s=new dt(o.stateStack,t.name,n.name);return ct(o.tokens,s),o.tokens}function pn(e,t,n,r,i){const o=Oe(n,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=i,u=Ue(e);let d=i.grammarState?Sa(i.grammarState,n.name)??Qt:i.grammarContextCode!=null?pn(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Qt,c=[];const h=[];for(let f=0,m=u.length;f0&&_.length>=s){c=[],h.push([{content:_,offset:b,color:"",fontStyle:0}]);continue}let y,g,w;l&&l!=="tokenType"&&(y=t.tokenizeLine(_,d,a),g=y.tokens,w=0);const v=t.tokenizeLine2(_,d,a),C=v.tokens.length/2;for(let L=0;LEt.trim());break;case"object":fe=K.scope;break;default:continue}An.push({settings:K,selectors:fe.map(Et=>Et.split(ka))})}q.explanation=[];let kn=0;for(;P+kn({scopeName:t}))}function La(e,t){const n=[];for(let r=0,i=t.length;r=0&&i>=0;)Jn(e[r],n[i])&&(r-=1),i-=1;return r===-1}function Pa(e,t,n){const r=[];for(const{selectors:i,settings:o}of e)for(const s of i)if(Ra(s,t,n)){r.push(o);break}return r}function ht(e,t,n,r=ni){const i=Object.entries(n.themes).filter(u=>u[1]).map(u=>({color:u[0],theme:u[1]})),o=i.map(u=>{const d=r(e,t,{...n,theme:u.theme});return{tokens:d,state:De(d),theme:typeof u.theme=="string"?u.theme:u.theme.name}}),s=Ta(...o.map(u=>u.tokens)),a=s[0].map((u,d)=>u.map((c,h)=>{const f={content:c.content,variants:{},offset:c.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=c.explanation),s.forEach((m,_)=>{const{content:b,explanation:y,offset:g,...w}=m[d][h];f.variants[i[_].color]=w}),f})),l=o[0].state?new dt(Object.fromEntries(o.map(u=>[u.theme,u.state?.getInternalStack(u.theme)])),o[0].state.lang):void 0;return l&&ct(a,l),a}function Ta(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;rl[r]),o=t.map(()=>[]);t.forEach((l,u)=>l.push(o[u]));const s=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(u=>u.content.length));for(let u=0;ui);function n(i){if(i===e.length)return{line:t.length-1,character:t.at(-1).length};let o=i,s=0;for(const a of t){if(oo&&i[o])}const Va=["color","background-color"];function oi(e,t){let n=0;const r=[];for(const i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n>1);e[i]<=t?n=i+1:r=i}return n}function si(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,i)=>r-i);return n.length?e.map(r=>r.flatMap(i=>{const o=i.offset+i.content.length,s=Ga(n,i.offset);let a=s;for(;aNe(e.variants[d])),a=new Set(s.flatMap(d=>Object.keys(d))),l={},u=(d,c)=>{const h=c==="color"?"":c==="background-color"?"-bg":`-${c}`;return n+t[d]+(c==="color"?"":h)};return s.forEach((d,c)=>{for(const h of a){const f=d[h]||"inherit";if(c===0&&r&&Va.includes(h))if(r==="light-dark()"&&s.length>1){const m=t.findIndex(g=>g==="light"),_=t.findIndex(g=>g==="dark");if(m===-1||_===-1)throw new I('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const b=s[m][h]||"inherit",y=s[_][h]||"inherit";l[h]=`light-dark(${b}, ${y})`,i==="css-vars"&&(l[u(c,h)]=f)}else l[h]=f;else i==="css-vars"&&(l[u(c,h)]=f)}}),o.htmlStyle=l,o}function Ne(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&V.Italic&&(t["font-style"]="italic"),e.fontStyle&V.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&V.Underline&&n.push("underline"),e.fontStyle&V.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function ot(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function li(){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 I(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...r.indexToPos(s),offset:s}}else{const a=r.lines[s.line];if(a===void 0)throw new I(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let l=s.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new I(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${a.length}`);return{...s,character:l,offset:r.posToIndex(s.line,l)}}};const r=ii(n.source),o=(n.options.decorations||[]).map(s=>({...s,start:i(s.start),end:i(s.end)}));Ba(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 si(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),i=[...n.children].filter(d=>d.type==="element"&&d.tagName==="span");if(i.length!==r.converter.lines.length)throw new I(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(d,c,h,f){const m=i[d];let _="",b=-1,y=-1;if(c===0&&(b=0),h===0&&(y=0),h===Number.POSITIVE_INFINITY&&(y=m.children.length),b===-1||y===-1)for(let w=0;w_);return d.tagName=c.tagName||"span",d.properties={...d.properties,...f,class:d.properties.class},c.properties?.class&&fn(d,c.properties.class),d=m(d,h)||d,d}const l=[],u=r.decorations.sort((d,c)=>c.start.offset-d.start.offset||d.end.offset-c.end.offset);for(const d of u){const{start:c,end:h}=d;if(c.line===h.line)o(c.line,c.character,h.character,d);else if(c.lines(f,d));o(h.line,0,h.character,d)}}l.forEach(d=>d())}}}function Ba(e){for(let t=0;tn.end.offset)throw new I(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;rNumber.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Wa(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)Lt[r]&&t.push({type:"setDecoration",value:Lt[r]});else if(r<=29){const i=Lt[r-20];i&&(t.push({type:"resetDecoration",value:i}),i==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:ae[r-30]}});else if(r===38){const i=Zn(e);i&&t.push({type:"setForegroundColor",value:i})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:ae[r-40]}});else if(r===48){const i=Zn(e);i&&t.push({type:"setBackgroundColor",value:i})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:ae[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:ae[r-100+8]}})}return t}function Ha(){let e=null,t=null,n=new Set;return{parse(r){const i=[];let o=0;do{const s=ja(r,o),a=s.sequence?r.substring(o,s.startPosition):r.substring(o);if(a.length>0&&i.push({value:a,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const l=Wa(s.sequence);for(const u of l)u.type==="resetAll"?(e=null,t=null,n.clear()):u.type==="resetForegroundColor"?e=null:u.type==="resetBackgroundColor"?t=null:u.type==="resetDecoration"&&n.delete(u.value);for(const u of l)u.type==="setForegroundColor"?e=u.value:u.type==="setBackgroundColor"?t=u.value:u.type==="setDecoration"&&n.add(u.value)}o=s.position}while(oMath.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let u=0;u{const l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,e.colors?.[l]||Ka[a]]}))),s=Ha();return i.map(a=>s.parse(a[0]).map(l=>{let u,d;l.decorations.has("reverse")?(u=l.background?o.value(l.background):e.bg,d=l.foreground?o.value(l.foreground):e.fg):(u=l.foreground?o.value(l.foreground):e.fg,d=l.background?o.value(l.background):void 0),u=ee(u,r),d=ee(d,r),l.decorations.has("dim")&&(u=Ja(u));let c=V.None;return l.decorations.has("bold")&&(c|=V.Bold),l.decorations.has("italic")&&(c|=V.Italic),l.decorations.has("underline")&&(c|=V.Underline),l.decorations.has("strikethrough")&&(c|=V.Strikethrough),{content:l.value,offset:a[1],color:u,bgColor:d,fontStyle:c}}))}function Ja(e){const t=e.match(Xa);if(t){const r=t[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],o=r[1],s=r[2],a=r[3];return`#${i}${i}${o}${o}${s}${s}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const i=r[0],o=r[1],s=r[2];return`#${i}${i}${o}${o}${s}${s}80`}}}const n=e.match(Qa);return n?`var(${n[1]}-dim)`:e}function Me(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:i=e.getLoadedThemes()[0]}=n;if(!Be(r)&&!Fe(i)&&r==="ansi"){const{theme:o}=e.setTheme(i);return ci(o,t,n)}return ni(e,t,n)}function we(e,t,n){let r,i,o,s,a,l;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:d="--shiki-",colorsRendering:c="css-vars"}=n,h=Object.entries(n.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,g)=>y.color===u?-1:g.color===u?1:0);if(h.length===0)throw new I("`themes` option must not be empty");const f=ht(e,t,n,Me);if(l=De(f),u&&u!=="light-dark()"&&!h.some(y=>y.color===u))throw new I(`\`themes\` option must contain the defaultColor key \`${u}\``);const m=h.map(y=>e.getTheme(y.theme)),_=h.map(y=>y.color);o=f.map(y=>y.map(g=>ai(g,_,d,u,c))),l&&ct(o,l);const b=h.map(y=>Oe(y.theme,n));i=er(h,m,b,d,u,"fg",c),r=er(h,m,b,d,u,"bg",c),s=`shiki-themes ${m.map(y=>y.name).join(" ")}`,a=u?void 0:[i,r].join(";")}else if("theme"in n){const u=Oe(n.theme,n);o=Me(e,t,n);const d=e.getTheme(n.theme);r=ee(d.bg,u),i=ee(d.fg,u),s=d.name,l=De(o)}else throw new I("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:i,bg:r,themeName:s,rootStyle:a,grammarState:l}}function er(e,t,n,r,i,o,s){return e.map((a,l)=>{const u=ee(t[l][o],n[l])||"inherit",d=`${r+a.color}${o==="bg"?"-bg":""}:${u}`;if(l===0&&i){if(i==="light-dark()"&&e.length>1){const c=e.findIndex(f=>f.color==="light"),h=e.findIndex(f=>f.color==="dark");if(c===-1||h===-1)throw new I('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${ee(t[c][o],n[c])||"inherit"}, ${ee(t[h][o],n[h])||"inherit"});${d}`}return u}return s==="css-vars"?d:null}).filter(a=>!!a).join(";")}const di=/^\s+$/,Ya=/^(\s*)(.*?)(\s*)$/;function Ee(e,t,n,r={meta:{},options:n,codeToHast:(i,o)=>Ee(e,i,o),codeToTokens:(i,o)=>we(e,i,o)}){let i=t;for(const m of st(n))i=m.preprocess?.call(r,i,n)||i;let{tokens:o,fg:s,bg:a,themeName:l,rootStyle:u,grammarState:d}=we(e,i,n);const{mergeWhitespaces:c=!0,mergeSameStyleTokens:h=!1}=n;c===!0?o=Za(o):c==="never"&&(o=el(o)),h&&(o=tl(o));const f={...r,get source(){return i}};for(const m of st(n))o=m.tokens?.call(f,o)||o;return hi(o,{...n,fg:s,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??u},f,d)}function hi(e,t,n,r=De(e)){const i=st(t),o=[],s={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,u={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?u.style=t.rootStyle:u.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(const[_,b]of Object.entries(t.meta||{}))_.startsWith("_")||(u[_]=b);let d={type:"element",tagName:"pre",properties:u,children:[],data:t.data},c={type:"element",tagName:"code",properties:{},children:o};const h=[],f={...n,structure:a,addClassToHast:fn,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return d},get code(){return c},get lines(){return h}};if(e.forEach((_,b)=>{b&&(a==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&o.push({type:"text",value:` +`}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},g=0;for(const w of _){let v={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]};const C=ot(w.htmlStyle||Ne(w));C&&(v.properties.style=C);for(const L of i)v=L?.span?.call(f,v,b+1,g,y,w)||v;a==="inline"?s.children.push(v):a==="classic"&&y.children.push(v),g+=w.content.length}if(a==="classic"){for(const w of i)y=w?.line?.call(f,y,b+1)||y;h.push(y),o.push(y)}else a==="inline"&&h.push(y)}),a==="classic"){for(const _ of i)c=_?.code?.call(f,c)||c;d.children.push(c);for(const _ of i)d=_?.pre?.call(f,d)||d;s.children.push(d)}else if(a==="inline"){const _=[];let b={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const g of s.children)g.type==="element"&&g.tagName==="br"?(_.push(b),b={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(g.type==="element"||g.type==="text")&&b.children.push(g);_.push(b);let y={type:"element",tagName:"code",properties:{},children:_};for(const g of i)y=g?.code?.call(f,y)||y;s.children=[];for(let g=0;g0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const w=y.children[g];w.type==="element"&&s.children.push(...w.children)}}let m=s;for(const _ of i)m=_?.root?.call(f,m)||m;return r&&ct(m,r),m}function Za(e){return e.map(t=>{const n=[];let r="",i;return t.forEach((o,s)=>{const a=!(o.fontStyle&&(o.fontStyle&V.Underline||o.fontStyle&V.Strikethrough));a&&di.test(o.content)&&t[s+1]?(i===void 0&&(i=o.offset),r+=o.content):r?(a?n.push({...o,offset:i,content:r+o.content}):n.push({content:r,offset:i},o),i=void 0,r=""):n.push(o)}),n})}function el(e){return e.map(t=>t.flatMap(n=>{if(di.test(n.content))return n;const r=n.content.match(Ya);if(!r)return n;const[,i,o,s]=r;if(!i&&!s)return n;const a=[{...n,offset:n.offset+i.length,content:o}];return i&&a.unshift({content:i,offset:n.offset}),s&&a.push({content:s,offset:n.offset+i.length+o.length}),a}))}function tl(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const i=n.at(-1),o=ot(i.htmlStyle||Ne(i)),s=ot(r.htmlStyle||Ne(r)),a=i.fontStyle&&(i.fontStyle&V.Underline||i.fontStyle&V.Strikethrough),l=r.fontStyle&&(r.fontStyle&V.Underline||r.fontStyle&V.Strikethrough);!a&&!l&&o===s?i.content+=r.content:n.push({...r})}return n})}const pi=bs;function mn(e,t,n){const r={meta:{},options:n,codeToHast:(o,s)=>Ee(e,o,s),codeToTokens:(o,s)=>we(e,o,s)};let i=pi(Ee(e,t,n,r));for(const o of st(n))i=o.postprocess?.call(r,i,n)||i;return i}async function gn(e){const t=await dn(e);return{getLastGrammarState:(...n)=>hn(t,...n),codeToTokensBase:(n,r)=>Me(t,n,r),codeToTokensWithThemes:(n,r)=>ht(t,n,r),codeToTokens:(n,r)=>we(t,n,r),codeToHast:(n,r)=>Ee(t,n,r),codeToHtml:(n,r)=>mn(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function nl(e){const t=ut(e);return{getLastGrammarState:(...n)=>hn(t,...n),codeToTokensBase:(n,r)=>Me(t,n,r),codeToTokensWithThemes:(n,r)=>ht(t,n,r),codeToTokens:(n,r)=>we(t,n,r),codeToHast:(n,r)=>Ee(t,n,r),codeToHtml:(n,r)=>mn(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function fi(e){let t;async function n(r){if(t){const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}else return t=e({...r,themes:r.themes||[],langs:r.langs||[]}),t}return n}const rl=fi(gn);function il(e){const t=e.langs,n=e.themes,r=e.engine;async function i(o){function s(c){if(typeof c=="string"){if(c=o.langAlias?.[c]||c,un(c))return[];const h=t[c];if(!h)throw new I(`Language \`${c}\` is not included in this bundle. You may want to load it from external source.`);return h}return c}function a(c){if(cn(c))return"none";if(typeof c=="string"){const h=n[c];if(!h)throw new I(`Theme \`${c}\` is not included in this bundle. You may want to load it from external source.`);return h}return c}const l=(o.themes??[]).map(c=>a(c)),u=(o.langs??[]).map(c=>s(c)),d=await gn({engine:o.engine??r(),...o,themes:l,langs:u});return{...d,loadLanguage(...c){return d.loadLanguage(...c.map(s))},loadTheme(...c){return d.loadTheme(...c.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function mi(e){let t;async function n(r={}){if(t){const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}else{t=e({...r,themes:[],langs:[]});const i=await t;return await Promise.all([i.loadTheme(...r.themes||[]),i.loadLanguage(...r.langs||[])]),i}}return n}function ol(e,t){const n=mi(e);async function r(i,o){const s=await n({langs:[o.lang],themes:"theme"in o?[o.theme]:Object.values(o.themes)}),a=await t?.guessEmbeddedLanguages?.(i,o.lang,s);return a&&await s.loadLanguage(...a),s}return{getSingletonHighlighter(i){return n(i)},async codeToHtml(i,o){return(await r(i,o)).codeToHtml(i,o)},async codeToHast(i,o){return(await r(i,o)).codeToHast(i,o)},async codeToTokens(i,o){return(await r(i,o)).codeToTokens(i,o)},async codeToTokensBase(i,o){return(await r(i,o)).codeToTokensBase(i,o)},async codeToTokensWithThemes(i,o){return(await r(i,o)).codeToTokensWithThemes(i,o)},async getLastGrammarState(i,o){return(await n({langs:[o.lang],themes:[o.theme]})).getLastGrammarState(i,o)}}}function sl(e={}){const{name:t="css-variables",variablePrefix:n="--shiki-",fontStyle:r=!0}=e,i=s=>e.variableDefaults?.[s]?`var(${n}${s}, ${e.variableDefaults[s]})`:`var(${n}${s})`,o={name:t,type:"dark",colors:{"editor.foreground":i("foreground"),"editor.background":i("background"),"terminal.ansiBlack":i("ansi-black"),"terminal.ansiRed":i("ansi-red"),"terminal.ansiGreen":i("ansi-green"),"terminal.ansiYellow":i("ansi-yellow"),"terminal.ansiBlue":i("ansi-blue"),"terminal.ansiMagenta":i("ansi-magenta"),"terminal.ansiCyan":i("ansi-cyan"),"terminal.ansiWhite":i("ansi-white"),"terminal.ansiBrightBlack":i("ansi-bright-black"),"terminal.ansiBrightRed":i("ansi-bright-red"),"terminal.ansiBrightGreen":i("ansi-bright-green"),"terminal.ansiBrightYellow":i("ansi-bright-yellow"),"terminal.ansiBrightBlue":i("ansi-bright-blue"),"terminal.ansiBrightMagenta":i("ansi-bright-magenta"),"terminal.ansiBrightCyan":i("ansi-bright-cyan"),"terminal.ansiBrightWhite":i("ansi-bright-white")},tokenColors:[{scope:["keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],settings:{foreground:i("foreground")}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:["strong","markup.heading.markdown","markup.bold.markdown"],settings:{fontStyle:"bold"}},{scope:["markup.italic.markdown"],settings:{fontStyle:"italic"}},{scope:"meta.link.inline.markdown",settings:{fontStyle:"underline",foreground:i("token-link")}},{scope:["string","markup.fenced_code","markup.inline"],settings:{foreground:i("token-string")}},{scope:["comment","string.quoted.docstring.multi"],settings:{foreground:i("token-comment")}},{scope:["constant.numeric","constant.language","constant.other.placeholder","constant.character.format.placeholder","variable.language.this","variable.other.object","variable.other.class","variable.other.constant","meta.property-name","meta.property-value","support"],settings:{foreground:i("token-constant")}},{scope:["keyword","storage.modifier","storage.type","storage.control.clojure","entity.name.function.clojure","entity.name.tag.yaml","support.function.node","support.type.property-name.json","punctuation.separator.key-value","punctuation.definition.template-expression"],settings:{foreground:i("token-keyword")}},{scope:"variable.parameter.function",settings:{foreground:i("token-parameter")}},{scope:["support.function","entity.name.type","entity.other.inherited-class","meta.function-call","meta.instance.constructor","entity.other.attribute-name","entity.name.function","constant.keyword.clojure"],settings:{foreground:i("token-function")}},{scope:["entity.name.tag","string.quoted","string.regexp","string.interpolated","string.template","string.unquoted.plain.out.yaml","keyword.other.template"],settings:{foreground:i("token-string-expression")}},{scope:["punctuation.definition.arguments","punctuation.definition.dict","punctuation.separator","meta.function-call.arguments"],settings:{foreground:i("token-punctuation")}},{scope:["markup.underline.link","punctuation.definition.metadata.markdown"],settings:{foreground:i("token-link")}},{scope:["beginning.punctuation.definition.list.markdown"],settings:{foreground:i("token-string")}},{scope:["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","string.other.link.title.markdown","string.other.link.description.markdown"],settings:{foreground:i("token-keyword")}},{scope:["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],settings:{foreground:i("token-inserted")}},{scope:["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],settings:{foreground:i("token-deleted")}},{scope:["markup.changed","punctuation.definition.changed"],settings:{foreground:i("token-changed")}}]};return r||(o.tokenColors=o.tokenColors?.map(s=>(s.settings?.fontStyle&&delete s.settings.fontStyle,s))),o}const yc=Object.freeze(Object.defineProperty({__proto__:null,ShikiError:I,addClassToHast:fn,applyColorReplacements:ee,codeToHast:Ee,codeToHtml:mn,codeToTokens:we,codeToTokensBase:Me,codeToTokensWithThemes:ht,createBundledHighlighter:il,createCssVariablesTheme:sl,createHighlighterCore:gn,createHighlighterCoreSync:nl,createPositionConverter:ii,createShikiInternal:va,createShikiInternalSync:Ea,createShikiPrimitive:ut,createShikiPrimitiveAsync:dn,createSingletonShorthands:ol,flatTokenVariants:ai,getLastGrammarState:hn,getSingletonHighlighterCore:rl,getTokenStyleObject:Ne,guessEmbeddedLanguages:$a,hastToHtml:pi,isNoneTheme:Fe,isPlainLang:Be,isSpecialLang:un,isSpecialTheme:cn,makeSingletonHighlighter:mi,makeSingletonHighlighterCore:fi,normalizeGetter:ln,normalizeTheme:lt,resolveColorReplacements:Oe,splitLines:Ue,splitToken:oi,splitTokens:si,stringifyTokenStyle:ot,toArray:Kr,tokenizeAnsiWithTheme:ci,tokenizeWithTheme:ri,tokensToHast:hi,transformerDecorations:li},Symbol.toStringTag,{value:"Module"})),_n=[{id:"abap",name:"ABAP",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a),[]))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b),[]))},{id:"ada",name:"Ada",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c),[]))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.d),[]))},{id:"ahk2",name:"AutoHotkey2",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.e),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.f),[]))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.g),[]))},{id:"apache",name:"Apache Conf",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.h),[]))},{id:"apex",name:"Apex",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.i),[]))},{id:"apl",name:"APL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.j),[]))},{id:"applescript",name:"AppleScript",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.k),[]))},{id:"ara",name:"Ara",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.l),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.m),[]))},{id:"asm",name:"Assembly",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.n),[]))},{id:"astro",name:"Astro",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.o),[]))},{id:"awk",name:"AWK",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.p),[]))},{id:"ballerina",name:"Ballerina",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.q),[]))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.r),[]))},{id:"beancount",name:"Beancount",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.s),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.t),[]))},{id:"bibtex",name:"BibTeX",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.u),[]))},{id:"bicep",name:"Bicep",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.v),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.w),[]))},{id:"blade",name:"Blade",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.x),[]))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.y),[]))},{id:"c",name:"C",import:(()=>p(()=>import("./shiki-lang-c.mjs"),[]))},{id:"c3",name:"C3",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.z),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.A),[]))},{id:"cairo",name:"Cairo",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.B),[]))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.C),[]))},{id:"clarity",name:"Clarity",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.D),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.E),[]))},{id:"cmake",name:"CMake",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.F),[]))},{id:"cobol",name:"COBOL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.G),[]))},{id:"codeowners",name:"CODEOWNERS",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.H),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.I),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.J),[]))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.K),[]))},{id:"coq",name:"Rocq",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.L),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>p(()=>import("./shiki-lang-cpp.mjs"),[]))},{id:"crystal",name:"Crystal",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.M),[]))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.N),[]))},{id:"css",name:"CSS",import:(()=>p(()=>import("./shiki-lang-css.mjs"),[]))},{id:"csv",name:"CSV",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.O),[]))},{id:"cue",name:"CUE",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.P),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.Q),[]))},{id:"d",name:"D",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.R),[]))},{id:"dart",name:"Dart",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.S),[]))},{id:"dax",name:"DAX",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.T),[]))},{id:"desktop",name:"Desktop",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.U),[]))},{id:"diff",name:"Diff",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.V),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.W),[]))},{id:"dotenv",name:"dotEnv",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.X),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.Y),[]))},{id:"edge",name:"Edge",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.Z),[]))},{id:"elixir",name:"Elixir",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e._),[]))},{id:"elm",name:"Elm",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.$),[]))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a0),[]))},{id:"erb",name:"ERB",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a1),[]))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a2),[]))},{id:"fennel",name:"Fennel",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a3),[]))},{id:"fish",name:"Fish",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a4),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a5),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a6),[]))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a7),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a8),[]))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a9),[]))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aa),[]))},{id:"gdshader",name:"GDShader",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ab),[]))},{id:"genie",name:"Genie",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ac),[]))},{id:"gherkin",name:"Gherkin",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ad),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ae),[]))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.af),[]))},{id:"gleam",name:"Gleam",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ag),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ah),[]))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ai),[]))},{id:"glsl",name:"GLSL",import:(()=>p(()=>import("./shiki-lang-glsl.mjs"),[]))},{id:"gn",name:"GN",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aj),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ak),[]))},{id:"go",name:"Go",import:(()=>p(()=>import("./shiki-lang-go.mjs"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.al),[]))},{id:"groovy",name:"Groovy",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.am),[]))},{id:"hack",name:"Hack",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.an),[]))},{id:"haml",name:"Ruby Haml",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ao),[]))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ap),[]))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aq),[]))},{id:"haxe",name:"Haxe",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ar),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.as),[]))},{id:"hjson",name:"Hjson",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.at),[]))},{id:"hlsl",name:"HLSL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.au),[]))},{id:"html",name:"HTML",import:(()=>p(()=>import("./shiki-lang-html.mjs"),[]))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.av),[]))},{id:"http",name:"HTTP",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aw),[]))},{id:"hurl",name:"Hurl",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ax),[]))},{id:"hxml",name:"HXML",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ay),[]))},{id:"hy",name:"Hy",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.az),[]))},{id:"imba",name:"Imba",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aA),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aB),[]))},{id:"java",name:"Java",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aC),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>p(()=>import("./shiki-lang-javascript.mjs"),[]))},{id:"jinja",name:"Jinja",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aD),[]))},{id:"jison",name:"Jison",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aE),[]))},{id:"json",name:"JSON",import:(()=>p(()=>import("./shiki-lang-json.mjs"),[]))},{id:"json5",name:"JSON5",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aF),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>p(()=>import("./shiki-lang-jsonc.mjs"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aG),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aH),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aI),[]))},{id:"jsx",name:"JSX",import:(()=>p(()=>import("./shiki-lang-jsx.mjs"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aJ),[]))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aK),[]))},{id:"kdl",name:"KDL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aL),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aM),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aN),[]))},{id:"latex",name:"LaTeX",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aO),[]))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aP),[]))},{id:"less",name:"Less",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aQ),[]))},{id:"liquid",name:"Liquid",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aR),[]))},{id:"llvm",name:"LLVM IR",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aS),[]))},{id:"log",name:"Log file",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aT),[]))},{id:"logo",name:"Logo",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aU),[]))},{id:"lua",name:"Lua",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aV),[]))},{id:"luau",name:"Luau",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aW),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aX),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>p(()=>import("./shiki-lang-markdown.mjs"),[]))},{id:"marko",name:"Marko",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aY),[]))},{id:"matlab",name:"MATLAB",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.aZ),[]))},{id:"mdc",name:"MDC",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a_),[]))},{id:"mdx",name:"MDX",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.a$),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b0),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b1),[]))},{id:"mojo",name:"Mojo",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b2),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b3),[]))},{id:"move",name:"Move",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b4),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b5),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b6),[]))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b7),[]))},{id:"nginx",name:"Nginx",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b8),[]))},{id:"nim",name:"Nim",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b9),[]))},{id:"nix",name:"Nix",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ba),[]))},{id:"nsis",name:"NSIS",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bb),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bc),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bd),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.be),[]))},{id:"ocaml",name:"OCaml",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bf),[]))},{id:"odin",name:"Odin",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bg),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bh),[]))},{id:"org",name:"Org Markup",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bi),[]))},{id:"pascal",name:"Pascal",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bj),[]))},{id:"perl",name:"Perl",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bk),[]))},{id:"php",name:"PHP",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bl),[]))},{id:"pkl",name:"Pkl",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bm),[]))},{id:"plsql",name:"PL/SQL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bn),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bo),[]))},{id:"polar",name:"Polar",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bp),[]))},{id:"postcss",name:"PostCSS",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bq),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.br),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bs),[]))},{id:"prisma",name:"Prisma",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bt),[]))},{id:"prolog",name:"Prolog",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bu),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bv),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bw),[]))},{id:"puppet",name:"Puppet",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bx),[]))},{id:"purescript",name:"PureScript",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.by),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>p(()=>import("./shiki-lang-python.mjs"),[]))},{id:"qml",name:"QML",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bz),[]))},{id:"qmldir",name:"QML Directory",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bA),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bB),[]))},{id:"r",name:"R",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bC),[]))},{id:"racket",name:"Racket",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bD),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bE),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bF),[]))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bG),[]))},{id:"reg",name:"Windows Registry Script",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bH),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>p(()=>import("./shiki-lang-regexp.mjs"),[]))},{id:"rel",name:"Rel",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bI),[]))},{id:"riscv",name:"RISC-V",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bJ),[]))},{id:"ron",name:"RON",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bK),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bL),[]))},{id:"rst",name:"reStructuredText",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bM),[]))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bN),[]))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>p(()=>import("./shiki-lang-rust.mjs"),[]))},{id:"sas",name:"SAS",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bO),[]))},{id:"sass",name:"Sass",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bP),[]))},{id:"scala",name:"Scala",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bQ),[]))},{id:"scheme",name:"Scheme",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bR),[]))},{id:"scss",name:"SCSS",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bS),[]))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bT),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bU),[]))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>p(()=>import("./shiki-lang-shellscript.mjs"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bV),[]))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bW),[]))},{id:"smithy",name:"Smithy",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bX),[]))},{id:"solidity",name:"Solidity",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bY),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.bZ),[]))},{id:"sparql",name:"SPARQL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b_),[]))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.b$),[]))},{id:"sql",name:"SQL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c0),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c1),[]))},{id:"stata",name:"Stata",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c2),[]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c3),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c4),[]))},{id:"svelte",name:"Svelte",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c5),[]))},{id:"swift",name:"Swift",import:(()=>p(()=>import("./shiki-lang-swift.mjs"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c6),[]))},{id:"systemd",name:"Systemd Units",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c7),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c8),[]))},{id:"tasl",name:"Tasl",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.c9),[]))},{id:"tcl",name:"Tcl",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ca),[]))},{id:"templ",name:"Templ",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cb),[]))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cc),[]))},{id:"tex",name:"TeX",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cd),[]))},{id:"toml",name:"TOML",import:(()=>p(()=>import("./shiki-lang-toml.mjs"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ce),[]))},{id:"tsv",name:"TSV",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cf),[]))},{id:"tsx",name:"TSX",import:(()=>p(()=>import("./shiki-lang-tsx.mjs"),[]))},{id:"turtle",name:"Turtle",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cg),[]))},{id:"twig",name:"Twig",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ch),[]))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>p(()=>import("./shiki-lang-typescript.mjs"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ci),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cj),[]))},{id:"v",name:"V",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ck),[]))},{id:"vala",name:"Vala",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cl),[]))},{id:"vb",name:"Visual Basic",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cm),[]))},{id:"verilog",name:"Verilog",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cn),[]))},{id:"vhdl",name:"VHDL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.co),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cp),[]))},{id:"vue",name:"Vue",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cq),[]))},{id:"vue-html",name:"Vue HTML",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cr),[]))},{id:"vue-vine",name:"Vue Vine",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cs),[]))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.ct),[]))},{id:"wasm",name:"WebAssembly",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cu),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cv),[]))},{id:"wgsl",name:"WGSL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cw),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cx),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cy),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cz),[]))},{id:"xml",name:"XML",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cA),[]))},{id:"xsl",name:"XSL",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cB),[]))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>p(()=>import("./shiki-lang-yaml.mjs"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>p(()=>import("./shiki-lang-stub.mjs").then(e=>e.cC),[]))},{id:"zig",name:"Zig",import:(()=>p(()=>import("./shiki-lang-zig.mjs"),[]))}],gi=Object.fromEntries(_n.map(e=>[e.id,e.import])),_i=Object.fromEntries(_n.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),al={...gi,..._i},bc=Object.freeze(Object.defineProperty({__proto__:null,bundledLanguages:al,bundledLanguagesAlias:_i,bundledLanguagesBase:gi,bundledLanguagesInfo:_n},Symbol.toStringTag,{value:"Module"}));var yn=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function ll(){return 2147483648}function ul(){return typeof performance<"u"?performance.now():Date.now()}const cl=(e,t)=>e+(t-e%t)%t;async function dl(e){let t,n;const r={};function i(f){n=f,r.HEAPU8=new Uint8Array(f),r.HEAPU32=new Uint32Array(f)}function o(f,m,_){r.HEAPU8.copyWithin(f,m,m+_)}function s(f){try{return t.grow(f-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(f){const m=r.HEAPU8.length;f=f>>>0;const _=ll();if(f>_)return!1;for(let b=1;b<=4;b*=2){let y=m*(1+.2/b);y=Math.min(y,f+100663296);const g=Math.min(_,cl(Math.max(f,y),65536));if(s(g))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(f,m,_=1024){const b=m+_;let y=m;for(;f[y]&&!(y>=b);)++y;if(y-m>16&&f.buffer&&l)return l.decode(f.subarray(m,y));let g="";for(;m>10,56320|L&1023)}}return g}function d(f,m){return f?u(r.HEAPU8,f,m):""}const c={emscripten_get_now:ul,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function h(){const m=await e({env:c,wasi_snapshot_preview1:c});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=d}return await h(),r}var hl=Object.defineProperty,pl=(e,t,n)=>t in e?hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,x=(e,t,n)=>pl(e,typeof t!="symbol"?t+"":t,n);let N=null;function fl(e){throw new yn(e.UTF8ToString(e.getLastOnigError()))}class pt{constructor(t){x(this,"utf16Length"),x(this,"utf8Length"),x(this,"utf16Value"),x(this,"utf8Value"),x(this,"utf16OffsetToUtf8"),x(this,"utf8OffsetToUtf16");const n=t.length,r=pt._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&d<=56319&&u+1=56320&&f<=57343&&(c=(d-55296<<10)+65536|f-56320,h=!0)}i&&(o[u]=l,h&&(o[u+1]=l),c<=127?s[l+0]=u:c<=2047?(s[l+0]=u,s[l+1]=u):c<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),c<=127?a[l++]=c:c<=2047?(a[l++]=192|(c&1984)>>>6,a[l++]=128|(c&63)>>>0):c<=65535?(a[l++]=224|(c&61440)>>>12,a[l++]=128|(c&4032)>>>6,a[l++]=128|(c&63)>>>0):(a[l++]=240|(c&1835008)>>>18,a[l++]=128|(c&258048)>>>12,a[l++]=128|(c&4032)>>>6,a[l++]=128|(c&63)>>>0),h&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const ft=class Q{constructor(t){if(x(this,"id",++Q.LAST_ID),x(this,"_onigBinding"),x(this,"content"),x(this,"utf16Length"),x(this,"utf8Length"),x(this,"utf16OffsetToUtf8"),x(this,"utf8OffsetToUtf16"),x(this,"ptr"),!N)throw new yn("Must invoke loadWasm first.");this._onigBinding=N,this.content=t;const n=new pt(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Q._sharedPtrInUse?(Q._sharedPtr||(Q._sharedPtr=N.omalloc(1e4)),Q._sharedPtrInUse=!0,N.HEAPU8.set(n.utf8Value,Q._sharedPtr),this.ptr=Q._sharedPtr):this.ptr=n.createString(N)}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===Q._sharedPtr?Q._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};x(ft,"LAST_ID",0);x(ft,"_sharedPtr",0);x(ft,"_sharedPtrInUse",!1);let yi=ft;class ml{constructor(t){if(x(this,"_onigBinding"),x(this,"_ptr"),!N)throw new yn("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),gl(r)?r=await r.instantiator(n):_l(r)?r=await r.default(n):(yl(r)&&(r=r.data),bl(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await El(r)(n):r=await vl(r)(n):wl(r)?r=await Rt(r)(n):r instanceof WebAssembly.Module?r=await Rt(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Rt(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return qe=t(),qe}function Rt(e){return t=>WebAssembly.instantiate(e,t)}function El(e){return t=>WebAssembly.instantiateStreaming(e,t)}function vl(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let bi;function wi(e){bi=e}function Ei(){return bi}async function vi(e){return e&&await bn(e),{createScanner(t){return new ml(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new yi(t)}}}const Cl=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:vi,getDefaultWasmLoader:Ei,loadWasm:bn,setDefaultWasmLoader:wi},Symbol.toStringTag,{value:"Module"}));var Ci=Rs({});Ts(Ci,Cl);const wc=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:vi,getDefaultWasmLoader:Ei,loadWasm:bn,setDefaultWasmLoader:wi,t:Ci},Symbol.toStringTag,{value:"Module"})),tr=4294967295;function Sl(e){return!e.sticky&&!e.rawOptions?.strategy}function nr(e,t){return{index:e,captureIndices:t.map(n=>n==null?{start:tr,end:tr,length:0}:{start:n[0],end:n[1],length:n[1]-n[0]})}}var Si=class{patterns;options;regexps;lastSearches;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const s=r?.get(o);if(s){if(s instanceof RegExp)return s;if(n)return null;throw s}try{const a=i(o);return r?.set(o,a),a}catch(a){if(r?.set(o,a),n)return null;throw a}}),this.lastSearches=this.regexps.map(o=>o&&Sl(o)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,i=typeof e=="string"?0:e.id||0;let o=-1,s=0,a=null;for(let l=0;l=t))c=d.matchIndex,h=d.indices;else{u.lastIndex=t;const f=u.exec(r);c=f?f.index:-1,h=f?f.indices:null,d&&(d.strId=i,d.searchedFrom=t,d.matchIndex=c,d.indices=h)}if(c===-1)continue;if(c===t)return nr(l,h);(o===-1||c]*>? | [gk]'[^']*'? | . @@ -28,20 +40,20 @@ import{_ as d}from"./preload-helper.mjs";var Tt=Object.defineProperty,Ai=Object. )? | \*[^\)]*\)? )? - | (?:${sn.source})+ - | ${Kr} + | (?:${En.source})+ + | ${Ai} | . -`.replace(/\s+/g,""),"gsu"),Ct=new RegExp(V` +`.replace(/\s+/g,""),"gsu"),Pt=new RegExp(M` \\ (?: - ${Qr} + ${ki} | . ) | \[:(?:\^?\p{Alpha}+|\^):\] - | ${Kr} + | ${Ai} | && | . -`.replace(/\s+/g,""),"gsu");function Pa(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 r=Ka(n.flags),i=[r.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(p){i.push(p)},replaceCurrentModX(p){i[i.length-1]=p},singleline:n.rules.singleline};let s=[],a;for($e.lastIndex=0;a=$e.exec(e);){const p=Ta(o,e,a[0],$e.lastIndex);p.tokens?s.push(...p.tokens):p.token&&s.push(p.token),p.lastIndex!==void 0&&($e.lastIndex=p.lastIndex)}const l=[];let u=0;s.filter(p=>p.type==="GroupOpen").forEach(p=>{p.kind==="capturing"?p.number=++u:p.raw==="("&&l.push(p)}),u||l.forEach((p,f)=>{p.kind="capturing",p.number=f+1});const c=u||l.length;return{tokens:s.map(p=>p.type==="EscapedNumber"?Ja(p,c):p).flat(),flags:r}}function Ta(e,t,n,r){const[i,o]=n;if(n==="["||n==="[^"){const s=xa(t,n,r);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(o))return{token:Gn(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Ua(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Zr(n)}}if(o==="K")return{token:Yr("keep",n)};if(o==="N"||o==="R")return{token:le("newline",n,{negate:o==="N"})};if(o==="O")return{token:le("any",n)};if(o==="X")return{token:le("text_segment",n)};const s=Jr(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(i==="("){if(o==="*")return{token:za(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Ha(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:_e("group",n)};if(n==="(?>")return{token:_e("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?")||n.startsWith("(?'")&&n.endsWith("'"))return{token:_e("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:_e("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:Ga(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(` -`,r);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=r,{lastIndex:s.exec(t)?s.lastIndex:r}}}if(n===".")return{token:le("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":V`\A`,$:V`\Z`}[n]:n;return{token:Gn(s,n)}}return n==="|"?{token:Da(n)}:sn.test(n)?{tokens:Za(n)}:{token:Y(we(n),n)}}function xa(e,t,n){const r=[Bn(t[1]==="^",t)];let i=1,o;for(Ct.lastIndex=n;o=Ct.exec(e);){const s=o[0];if(s[0]==="["&&s[1]!==":")i++,r.push(Bn(s[1]==="^",s));else if(s==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Y(93,s));else if(i--,r.push(Na(s)),!i)break}else{const a=Oa(s);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:Ct.lastIndex||e.length}}function Oa(e){if(e[0]==="\\")return Jr(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?\^?)(?[a-z]+):\]/.exec(e);if(!t||!on.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return le("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?Va(e):e==="&&"?Ma(e):Y(we(e),e)}function Jr(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return Wa(e);if("dDhHsSwW".includes(n))return qa(e);if(e.startsWith(V`\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 Xa(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),o=new TextEncoder;return[...i].map(s=>{const a=[...o.encode(s)].map(l=>`\\x${l.toString(16)}`).join("");return Y(we(s),a)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Y(Qa(e),e);if(Fn.has(n))return Y(Fn.get(n),e);if(/\d/.test(n))return $a(t,e);if(e==="\\")throw new Error(V`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Y(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Da(e){return{type:"Alternator",raw:e}}function Gn(e,t){return{type:"Assertion",kind:e,raw:t}}function Zr(e){return{type:"Backreference",raw:e}}function Y(e,t){return{type:"Character",value:e,raw:t}}function Na(e){return{type:"CharacterClassClose",raw:e}}function Va(e){return{type:"CharacterClassHyphen",raw:e}}function Ma(e){return{type:"CharacterClassIntersector",raw:e}}function Bn(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function le(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Yr(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:ve(n.flags),raw:t}}function $a(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function Ga(e){return{type:"GroupClose",raw:e}}function _e(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Ba(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function Fa(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function Ua(e){return{type:"Subroutine",raw:e}}const ja=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Fn=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Wa(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 Y(we(t.toUpperCase())-64,e)}function Ha(e,t){let{on:n,off:r}=/^\(\?(?[imx]*)(?:-(?[-imx]*))?/.exec(e).groups;r??="";const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),o=jn(n),s=jn(r),a={};if(o&&(a.enable=o),s&&(a.disable=s),e.endsWith(")"))return t.replaceCurrentModX(i),Yr("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,_e("group",e,{...(o||s)&&{flags:a}});throw new Error(`Unexpected flag modifier "${e}"`)}function za(e){const t=/\(\*(?[A-Za-z_]\w*)?(?:\[(?(?:[A-Za-z_]\w*)?)\])?(?:\{(?[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const o=i?i.split(",").filter(c=>c!=="").map(c=>/^[+-]?\d+$/.test(c)?+c:c):[],[s,a,l]=o,u=ja.has(n)?n.toLowerCase():"custom";switch(u){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 a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);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 a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${u}"`)}return Ba(u,r??null,i?.split(",")??null,e)}function Un(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:o}=/^\{(?\d*)(?:,(?\d*))?/.exec(e).groups,s=1e5;if(+i>s||o&&+o>s)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=o===void 0?+i:o===""?1/0:+o,n>r&&(t="possessive",[n,r]=[r,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,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Fa(t,n,r,e)}function qa(e){const t=e[1].toLowerCase();return le({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function Xa(e){const{p:t,neg:n,value:r}=/^\\(?

[pP])\{(?\^?)(?[^}]+)/.exec(e).groups;return le("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function jn(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 Ka(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Ja(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[Zr(n)];const o=[],s=i.match(/^[0-7]+|\d/g);for(let a=0;a127)throw new Error(V`Octal encoded byte above 177 unsupported "${n}"`)}else u=we(l);o.push(Y(u,(a===0?"\\":"")+l))}return o}function Za(e){const t=[],n=new RegExp(sn,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const o=/^\{(?\d+),(?\d+)\}\??$/.exec(i);if(o){const{min:s,max:a}=o.groups;if(+s>+a&&i.endsWith("?")){n.lastIndex--,t.push(Un(i.slice(0,-1)));continue}}}t.push(Un(i))}return t}function ei(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(r=>t[r]===n[r])}function Ya(e){return el.has(e.type)}const el=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function ti(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Pa(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(f,h)=>{const m=r.tokens[o.nextIndex];switch(o.parent=f,o.nextIndex++,m.type){case"Alternator":return de();case"Assertion":return tl(m);case"Backreference":return nl(m,o);case"Character":return at(m.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return rl(m,o,h);case"CharacterClassOpen":return il(m,o,h);case"CharacterSet":return ol(m,o);case"Directive":return dl(m.kind,{flags:m.flags});case"GroupOpen":return sl(m,o,h);case"NamedCallout":return hl(m.kind,m.tag,m.arguments);case"Quantifier":return al(m,o);case"Subroutine":return ll(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:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},s=ml(pl(r.flags));let a=s.body[0];for(;o.nextIndexl.length)throw new Error("Subroutine uses a group number that's not defined");f&&(l[f-1].isSubroutined=!0)}else if(c.has(f)){if(c.get(f).length>1)throw new Error(V`Subroutine uses a duplicate group name "\g<${f}>"`);c.get(f)[0].isSubroutined=!0}else throw new Error(V`Subroutine uses a group name that's not defined "\g<${f}>"`);return s}function tl({kind:e}){return Ht(ve({"^":"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===V`\B`||e===V`\Y`})}function nl({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(o,s=!1)=>{const a=t.capturingGroups.length;let l=!1;if(o>a)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,zt(s?a+1-o:o,{orphan:l})};if(n){const o=/^(?-?)0*(?[1-9]\d*)$/.exec(r);if(o)return i(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return zt(r)}return i(+r)}function rl(e,t,n){const{tokens:r,walk:i}=t,o=t.parent,s=o.body.at(-1),a=r[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=i(o,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&l.type==="Character")return o.body.pop(),cl(s,l);throw new Error("Invalid character class range")}return at(we("-"))}function il({negate:e},t,n){const{tokens:r,walk:i}=t,o=[We()],s=r[t.nextIndex];let a=zn(s);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")o.push(We()),t.nextIndex++;else{const u=o.at(-1);u.body.push(i(u,n))}a=zn(r[t.nextIndex],s)}const l=We({negate:e});return o.length===1?l.body=o[0].body:(l.kind="intersection",l.body=o.map(u=>u.body.length===1?u.body[0]:u)),t.nextIndex++,l}function ol({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s}=r;if(e==="property"){const a=lt(n);if(on.has(a)&&!s?.has(a))e="posix",n=a;else return ye(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s})}return e==="posix"?fl(n,{negate:t}):qt(e,{negate:t})}function sl(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:o,skipLookbehindValidation:s,walk:a}=t,l=gl(e),u=l.type==="AbsenceFunction",c=Hn(l),p=c&&l.negate;if(l.type==="CapturingGroup"&&(i.push(l),l.name&&Ra(o,l.name,[]).push(l)),u&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=qn(r[t.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")l.body.push(de()),t.nextIndex++;else{const h=l.body.at(-1),m=a(h,{...n,isInAbsenceFunction:n.isInAbsenceFunction||u,isInLookbehind:n.isInLookbehind||c,isInNegLookbehind:n.isInNegLookbehind||p});if(h.body.push(m),(c||n.isInLookbehind)&&!s){const y="Lookbehind includes a pattern not allowed by Oniguruma";if(p||n.isInNegLookbehind){if(Wn(m)||m.type==="CapturingGroup")throw new Error(y)}else if(Wn(m)||Hn(m)&&m.negate)throw new Error(y)}}f=qn(r[t.nextIndex])}return t.nextIndex++,l}function al({kind:e,min:t,max:n},r){const i=r.parent,o=i.body.at(-1);if(!o||!Ya(o))throw new Error("Quantifier requires a repeatable token");const s=ri(e,t,n,o);return i.body.pop(),s}function ll({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const o=/^(?[-+]?)0*(?[1-9]\d*)$/.exec(i);if(o){const a=+o.groups.num,l=n.length;if(t.hasNumberedRef=!0,i={"":a,"+":l+a,"-":l+1-a}[o.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const s=ii(i);return r.push(s),s}function ul(e,t){return{type:"AbsenceFunction",kind:e,body:De(t?.body)}}function de(e){return{type:"Alternative",body:oi(e?.body)}}function Ht(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function zt(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function ni(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!_l(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:De(t?.body)}}function at(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function We(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:oi(e?.body)}}function cl(e,t){if(t.valuen)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function ml(e,t){return{type:"Regex",body:De(t?.body),flags:e}}function ii(e){return{type:"Subroutine",ref:e}}function ye(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(lt(e));if(!r){if(n.normalizeUnknownPropertyNames)r=yl(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(V`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function gl({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return ul("repeater");case"atomic":return H({atomic:!0});case"capturing":return ni(i,{name:n});case"group":return H({flags:e});case"lookahead":case"lookbehind":return se({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function De(e){if(e===void 0)e=[de()];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 oi(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 Wn(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Hn(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function _l(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function yl(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 lt(e){return e.replace(/[- _]+/g,"").toLowerCase()}function zn(e,t){const n=t;return ve(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function qn(e){return ve(e,"Unclosed group")}function Ie(e,t,n=null){function r(o,s){for(let a=0;aA-Za-z\-]|<[=!]|\(DEFINE\))`;function bl(e,t){for(let n=0;n=t&&e[n]++}function wl(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const W=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function an(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let s=0,a="";for(const l of e.matchAll(i)){const{0:u,groups:{$skip:c}}=l;if(!c&&(!r||r===W.DEFAULT==!s)){n instanceof Function?a+=n(l,{context:s?W.CHAR_CLASS:W.DEFAULT,negated:o[o.length-1]}):a+=n;continue}u[0]==="["?(s++,o.push(u[1]==="^")):u==="]"&&s&&(s--,o.pop()),a+=u}return a}function si(e,t,n,r){an(e,t,n,r)}function vl(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let o=0,s;for(;s=i.exec(e);){const{0:a,groups:{$skip:l}}=s;if(!l&&(!r||r===W.DEFAULT==!o))return s;a==="["?o++:a==="]"&&o&&o--,i.lastIndex==s.index&&i.lastIndex++}return null}function Be(e,t,n){return!!vl(e,t,0,n)}function Cl(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,o=1,s;for(;s=n.exec(e);){const[a]=s;if(a==="[")i++;else if(i)a==="]"&&i--;else if(a==="(")o++;else if(a===")"&&(o--,!o)){r=s.index;break}}return e.slice(t,r)}const Xn=new RegExp(String.raw`(?${El})|(?\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Al(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",o="(?:(?=(",s=[0],a=[];let l=0,u=0,c=NaN,p;do{p=!1;let f=0,h=0,m=!1,y;for(Xn.lastIndex=Number.isNaN(c)?0:c+o.length;y=Xn.exec(e);){const{0:b,index:_,groups:{capturingStart:g,noncapturingStart:E}}=y;if(b==="[")f++;else if(f)b==="]"&&f--;else if(b===i&&!m)c=_,m=!0;else if(m&&E)h++;else if(g)m?h++:(l++,s.push(l+u));else if(b===")"&&m){if(!h){u++;const v=l+u;if(e=`${e.slice(0,c)}${o}${e.slice(c+i.length,_)}))<$$${v}>)${e.slice(_+1)}`,p=!0,a.push(v),bl(n,v),r.size){const C=new Map;r.forEach((L,P)=>{C.set(P>=v?P+1:P,L.map(B=>B>=v?B+1:B))}),r=C}break}h--}}}while(p);return n.push(...a),e=an(e,String.raw`\\(?[1-9]\d*)|<\$\$(?\d+)>`,({0:f,groups:{backrefNum:h,wrappedBackrefNum:m}})=>{if(h){const y=+h;if(y>s.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${s[y]}`}return`\\${m}`},W.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const ai=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,At=new RegExp(String.raw` +`.replace(/\s+/g,""),"gsu");function Ll(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 r=ql(n.flags),i=[r.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(c){i.push(c)},replaceCurrentModX(c){i[i.length-1]=c},singleline:n.rules.singleline};let s=[],a;for(Xe.lastIndex=0;a=Xe.exec(e);){const c=Rl(o,e,a[0],Xe.lastIndex);c.tokens?s.push(...c.tokens):c.token&&s.push(c.token),c.lastIndex!==void 0&&(Xe.lastIndex=c.lastIndex)}const l=[];let u=0;s.filter(c=>c.type==="GroupOpen").forEach(c=>{c.kind==="capturing"?c.number=++u:c.raw==="("&&l.push(c)}),u||l.forEach((c,h)=>{c.kind="capturing",c.number=h+1});const d=u||l.length;return{tokens:s.map(c=>c.type==="EscapedNumber"?Ql(c,d):c).flat(),flags:r}}function Rl(e,t,n,r){const[i,o]=n;if(n==="["||n==="[^"){const s=Pl(t,n,r);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(o))return{token:rr(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Bl(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Li(n)}}if(o==="K")return{token:Ri("keep",n)};if(o==="N"||o==="R")return{token:le("newline",n,{negate:o==="N"})};if(o==="O")return{token:le("any",n)};if(o==="X")return{token:le("text_segment",n)};const s=Ii(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(i==="("){if(o==="*")return{token:Wl(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:jl(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:_e("group",n)};if(n==="(?>")return{token:_e("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?")||n.startsWith("(?'")&&n.endsWith("'"))return{token:_e("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:_e("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:$l(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(` +`,r);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=r,{lastIndex:s.exec(t)?s.lastIndex:r}}}if(n===".")return{token:le("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":M`\A`,$:M`\Z`}[n]:n;return{token:rr(s,n)}}return n==="|"?{token:xl(n)}:En.test(n)?{tokens:Kl(n)}:{token:Z(Ce(n),n)}}function Pl(e,t,n){const r=[ir(t[1]==="^",t)];let i=1,o;for(Pt.lastIndex=n;o=Pt.exec(e);){const s=o[0];if(s[0]==="["&&s[1]!==":")i++,r.push(ir(s[1]==="^",s));else if(s==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Z(93,s));else if(i--,r.push(Ol(s)),!i)break}else{const a=Tl(s);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:Pt.lastIndex||e.length}}function Tl(e){if(e[0]==="\\")return Ii(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?\^?)(?[a-z]+):\]/.exec(e);if(!t||!wn.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return le("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?Dl(e):e==="&&"?Nl(e):Z(Ce(e),e)}function Ii(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return Ul(e);if("dDhHsSwW".includes(n))return Hl(e);if(e.startsWith(M`\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 zl(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),o=new TextEncoder;return[...i].map(s=>{const a=[...o.encode(s)].map(l=>`\\x${l.toString(16)}`).join("");return Z(Ce(s),a)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Z(Xl(e),e);if(or.has(n))return Z(or.get(n),e);if(/\d/.test(n))return Ml(t,e);if(e==="\\")throw new Error(M`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Z(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function xl(e){return{type:"Alternator",raw:e}}function rr(e,t){return{type:"Assertion",kind:e,raw:t}}function Li(e){return{type:"Backreference",raw:e}}function Z(e,t){return{type:"Character",value:e,raw:t}}function Ol(e){return{type:"CharacterClassClose",raw:e}}function Dl(e){return{type:"CharacterClassHyphen",raw:e}}function Nl(e){return{type:"CharacterClassIntersector",raw:e}}function ir(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function le(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Ri(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Se(n.flags),raw:t}}function Ml(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function $l(e){return{type:"GroupClose",raw:e}}function _e(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Vl(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function Gl(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function Bl(e){return{type:"Subroutine",raw:e}}const Fl=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),or=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Ul(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 Z(Ce(t.toUpperCase())-64,e)}function jl(e,t){let{on:n,off:r}=/^\(\?(?[imx]*)(?:-(?[-imx]*))?/.exec(e).groups;r??="";const i=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),o=ar(n),s=ar(r),a={};if(o&&(a.enable=o),s&&(a.disable=s),e.endsWith(")"))return t.replaceCurrentModX(i),Ri("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(i),t.numOpenGroups++,_e("group",e,{...(o||s)&&{flags:a}});throw new Error(`Unexpected flag modifier "${e}"`)}function Wl(e){const t=/\(\*(?[A-Za-z_]\w*)?(?:\[(?(?:[A-Za-z_]\w*)?)\])?(?:\{(?[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:i}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const o=i?i.split(",").filter(d=>d!=="").map(d=>/^[+-]?\d+$/.test(d)?+d:d):[],[s,a,l]=o,u=Fl.has(n)?n.toLowerCase():"custom";switch(u){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 a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);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 a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${u}"`)}return Vl(u,r??null,i?.split(",")??null,e)}function sr(e){let t=null,n,r;if(e[0]==="{"){const{minStr:i,maxStr:o}=/^\{(?\d*)(?:,(?\d*))?/.exec(e).groups,s=1e5;if(+i>s||o&&+o>s)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=o===void 0?+i:o===""?1/0:+o,n>r&&(t="possessive",[n,r]=[r,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,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Gl(t,n,r,e)}function Hl(e){const t=e[1].toLowerCase();return le({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function zl(e){const{p:t,neg:n,value:r}=/^\\(?

[pP])\{(?\^?)(?[^}]+)/.exec(e).groups;return le("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function ar(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 ql(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Ql(e,t){const{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=t))return[Li(n)];const o=[],s=i.match(/^[0-7]+|\d/g);for(let a=0;a127)throw new Error(M`Octal encoded byte above 177 unsupported "${n}"`)}else u=Ce(l);o.push(Z(u,(a===0?"\\":"")+l))}return o}function Kl(e){const t=[],n=new RegExp(En,"gy");let r;for(;r=n.exec(e);){const i=r[0];if(i[0]==="{"){const o=/^\{(?\d+),(?\d+)\}\??$/.exec(i);if(o){const{min:s,max:a}=o.groups;if(+s>+a&&i.endsWith("?")){n.lastIndex--,t.push(sr(i.slice(0,-1)));continue}}}t.push(sr(i))}return t}function Pi(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(r=>t[r]===n[r])}function Jl(e){return Yl.has(e.type)}const Yl=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Ti(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Ll(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(h,f)=>{const m=r.tokens[o.nextIndex];switch(o.parent=h,o.nextIndex++,m.type){case"Alternator":return de();case"Assertion":return Zl(m);case"Backreference":return eu(m,o);case"Character":return mt(m.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return tu(m,o,f);case"CharacterClassOpen":return nu(m,o,f);case"CharacterSet":return ru(m,o);case"Directive":return uu(m.kind,{flags:m.flags});case"GroupOpen":return iu(m,o,f);case"NamedCallout":return du(m.kind,m.tag,m.arguments);case"Quantifier":return ou(m,o);case"Subroutine":return su(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:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},s=pu(cu(r.flags));let a=s.body[0];for(;o.nextIndexl.length)throw new Error("Subroutine uses a group number that's not defined");h&&(l[h-1].isSubroutined=!0)}else if(d.has(h)){if(d.get(h).length>1)throw new Error(M`Subroutine uses a duplicate group name "\g<${h}>"`);d.get(h)[0].isSubroutined=!0}else throw new Error(M`Subroutine uses a group name that's not defined "\g<${h}>"`);return s}function Zl({kind:e}){return Kt(Se({"^":"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===M`\B`||e===M`\Y`})}function eu({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(o,s=!1)=>{const a=t.capturingGroups.length;let l=!1;if(o>a)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Jt(s?a+1-o:o,{orphan:l})};if(n){const o=/^(?-?)0*(?[1-9]\d*)$/.exec(r);if(o)return i(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return Jt(r)}return i(+r)}function tu(e,t,n){const{tokens:r,walk:i}=t,o=t.parent,s=o.body.at(-1),a=r[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=i(o,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&l.type==="Character")return o.body.pop(),lu(s,l);throw new Error("Invalid character class range")}return mt(Ce("-"))}function nu({negate:e},t,n){const{tokens:r,walk:i}=t,o=[Ze()],s=r[t.nextIndex];let a=cr(s);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")o.push(Ze()),t.nextIndex++;else{const u=o.at(-1);u.body.push(i(u,n))}a=cr(r[t.nextIndex],s)}const l=Ze({negate:e});return o.length===1?l.body=o[0].body:(l.kind="intersection",l.body=o.map(u=>u.body.length===1?u.body[0]:u)),t.nextIndex++,l}function ru({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s}=r;if(e==="property"){const a=gt(n);if(wn.has(a)&&!s?.has(a))e="posix",n=a;else return ye(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:o,unicodePropertyMap:s})}return e==="posix"?hu(n,{negate:t}):Yt(e,{negate:t})}function iu(e,t,n){const{tokens:r,capturingGroups:i,namedGroupsByName:o,skipLookbehindValidation:s,walk:a}=t,l=fu(e),u=l.type==="AbsenceFunction",d=ur(l),c=d&&l.negate;if(l.type==="CapturingGroup"&&(i.push(l),l.name&&Il(o,l.name,[]).push(l)),u&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=dr(r[t.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")l.body.push(de()),t.nextIndex++;else{const f=l.body.at(-1),m=a(f,{...n,isInAbsenceFunction:n.isInAbsenceFunction||u,isInLookbehind:n.isInLookbehind||d,isInNegLookbehind:n.isInNegLookbehind||c});if(f.body.push(m),(d||n.isInLookbehind)&&!s){const _="Lookbehind includes a pattern not allowed by Oniguruma";if(c||n.isInNegLookbehind){if(lr(m)||m.type==="CapturingGroup")throw new Error(_)}else if(lr(m)||ur(m)&&m.negate)throw new Error(_)}}h=dr(r[t.nextIndex])}return t.nextIndex++,l}function ou({kind:e,min:t,max:n},r){const i=r.parent,o=i.body.at(-1);if(!o||!Jl(o))throw new Error("Quantifier requires a repeatable token");const s=Oi(e,t,n,o);return i.body.pop(),s}function su({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let i=e.slice(3,-1);const o=/^(?[-+]?)0*(?[1-9]\d*)$/.exec(i);if(o){const a=+o.groups.num,l=n.length;if(t.hasNumberedRef=!0,i={"":a,"+":l+a,"-":l+1-a}[o.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const s=Di(i);return r.push(s),s}function au(e,t){return{type:"AbsenceFunction",kind:e,body:je(t?.body)}}function de(e){return{type:"Alternative",body:Ni(e?.body)}}function Kt(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Jt(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function xi(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!mu(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:je(t?.body)}}function mt(e,t){const n={useLastValid:!1,...t};if(e>1114111){const r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function Ze(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Ni(e?.body)}}function lu(e,t){if(t.valuen)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function pu(e,t){return{type:"Regex",body:je(t?.body),flags:e}}function Di(e){return{type:"Subroutine",ref:e}}function ye(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(gt(e));if(!r){if(n.normalizeUnknownPropertyNames)r=gu(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(M`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function fu({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case"absence_repeater":return au("repeater");case"atomic":return H({atomic:!0});case"capturing":return xi(i,{name:n});case"group":return H({flags:e});case"lookahead":case"lookbehind":return se({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function je(e){if(e===void 0)e=[de()];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 Ni(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 lr(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function ur(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function mu(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function gu(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 gt(e){return e.replace(/[- _]+/g,"").toLowerCase()}function cr(e,t){const n=t;return Se(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function dr(e){return Se(e,"Unclosed group")}function Re(e,t,n=null){function r(o,s){for(let a=0;aA-Za-z\-]|<[=!]|\(DEFINE\))`;function yu(e,t){for(let n=0;n=t&&e[n]++}function bu(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const W=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function vn(e,t,n,r){const i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let s=0,a="";for(const l of e.matchAll(i)){const{0:u,groups:{$skip:d}}=l;if(!d&&(!r||r===W.DEFAULT==!s)){n instanceof Function?a+=n(l,{context:s?W.CHAR_CLASS:W.DEFAULT,negated:o[o.length-1]}):a+=n;continue}u[0]==="["?(s++,o.push(u[1]==="^")):u==="]"&&s&&(s--,o.pop()),a+=u}return a}function Mi(e,t,n,r){vn(e,t,n,r)}function wu(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const i=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let o=0,s;for(;s=i.exec(e);){const{0:a,groups:{$skip:l}}=s;if(!l&&(!r||r===W.DEFAULT==!o))return s;a==="["?o++:a==="]"&&o&&o--,i.lastIndex==s.index&&i.lastIndex++}return null}function Ke(e,t,n){return!!wu(e,t,0,n)}function Eu(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,o=1,s;for(;s=n.exec(e);){const[a]=s;if(a==="[")i++;else if(i)a==="]"&&i--;else if(a==="(")o++;else if(a===")"&&(o--,!o)){r=s.index;break}}return e.slice(t,r)}const hr=new RegExp(String.raw`(?${_u})|(?\((?:\?<[^>]+>)?)|\\?.`,"gsu");function vu(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const i="(?>",o="(?:(?=(",s=[0],a=[];let l=0,u=0,d=NaN,c;do{c=!1;let h=0,f=0,m=!1,_;for(hr.lastIndex=Number.isNaN(d)?0:d+o.length;_=hr.exec(e);){const{0:b,index:y,groups:{capturingStart:g,noncapturingStart:w}}=_;if(b==="[")h++;else if(h)b==="]"&&h--;else if(b===i&&!m)d=y,m=!0;else if(m&&w)f++;else if(g)m?f++:(l++,s.push(l+u));else if(b===")"&&m){if(!f){u++;const v=l+u;if(e=`${e.slice(0,d)}${o}${e.slice(d+i.length,y)}))<$$${v}>)${e.slice(y+1)}`,c=!0,a.push(v),yu(n,v),r.size){const C=new Map;r.forEach((L,P)=>{C.set(P>=v?P+1:P,L.map(B=>B>=v?B+1:B))}),r=C}break}f--}}}while(c);return n.push(...a),e=vn(e,String.raw`\\(?[1-9]\d*)|<\$\$(?\d+)>`,({0:h,groups:{backrefNum:f,wrappedBackrefNum:m}})=>{if(f){const _=+f;if(_>s.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${s[_]}`}return`\\${m}`},W.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const $i=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Tt=new RegExp(String.raw` \\(?: \d+ | c[A-Za-z] | [gk]<[^>]+> @@ -54,9 +66,9 @@ import{_ as d}from"./preload-helper.mjs";var Tt=Object.defineProperty,Ai=Object. | [A-Za-z\-]+: | \(DEFINE\) ))? -| (?${ai})(?[?+]?)(?[?*+\{]?) +| (?${$i})(?[?+]?)(?[?*+\{]?) | \\?. -`.replace(/\s+/g,""),"gsu");function Sl(e){if(!new RegExp(`${ai}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",o=0,s;for(At.lastIndex=0;s=At.exec(e);){const{0:a,index:l,groups:{qBase:u,qMod:c,invalidQ:p}}=s;if(a==="[")o||(r=l),o++;else if(a==="]")o?o--:r=null;else if(!o)if(c==="+"&&i&&!i.startsWith("(")){if(p)throw new Error(`Invalid quantifier "${a}"`);let f=-1;if(/^\{\d+\}$/.test(u))e=wl(e,l+u.length,c,"");else{if(i===")"||i==="]"){const h=i===")"?n:r;if(h===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,h)}(?>${e.slice(h,l)}${u})${e.slice(l+a.length)}`}else e=`${e.slice(0,l-i.length)}(?>${i}${u})${e.slice(l+a.length)}`;f+=4}At.lastIndex+=f}else a[0]==="("?t.push(l):a===")"&&(n=t.length?t.pop():null);i=a}return{pattern:e}}const j=String.raw,Il=j`\\g<(?[^>&]+)&R=(?[^>]+)>`,Xt=j`\(\?R=(?[^\)]+)\)|${Il}`,ut=j`\(\?<(?![=!])(?[^>]+)>`,li=j`${ut}|(?\()(?!\?)`,ie=new RegExp(j`${ut}|${Xt}|\(\?|\\?.`,"gsu"),St="Cannot use multiple overlapping recursions";function Ll(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=t?.captureTransfers??new Map;if(!new RegExp(Xt,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&Be(e,j`\(\?\(DEFINE\)`,W.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],s=Be(e,j`\\[1-9]`,W.DEFAULT),a=new Map,l=[];let u=!1,c=0,p=0,f;for(ie.lastIndex=0;f=ie.exec(e);){const{0:h,groups:{captureName:m,rDepth:y,gRNameOrNum:b,gRDepth:_}}=f;if(h==="[")c++;else if(c)h==="]"&&c--;else if(y){if(Kn(y),u)throw new Error(St);if(s)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const g=e.slice(0,f.index),E=e.slice(ie.lastIndex);if(Be(E,Xt,W.DEFAULT))throw new Error(St);const v=+y-1;e=Qn(g,E,v,!1,n,o,p),i=Zn(i,g,v,o.length,0,p);break}else if(b){Kn(_);let g=!1;for(const q of l)if(q.name===b||q.num===+b){if(g=!0,q.hasRecursedWithin)throw new Error(St);break}if(!g)throw new Error(j`Recursive \g cannot be used outside the referenced group "${r==="external"?b:j`\g<${b}&R=${_}>`}"`);const E=a.get(b),v=Cl(e,E);if(s&&Be(v,j`${ut}|\((?!\?)`,W.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const C=e.slice(E,f.index),L=v.slice(C.length+h.length),P=o.length,B=+_-1,he=Qn(C,L,B,!0,n,o,p);i=Zn(i,C,B,o.length-P,P,p);const ht=e.slice(0,E),ft=e.slice(E+v.length);e=`${ht}${he}${ft}`,ie.lastIndex+=he.length-h.length-C.length-L.length,l.forEach(q=>q.hasRecursedWithin=!0),u=!0}else if(m)p++,a.set(String(p),ie.lastIndex),a.set(m,ie.lastIndex),l.push({num:p,name:m});else if(h[0]==="("){const g=h==="(";g&&(p++,a.set(String(p),ie.lastIndex)),l.push(g?{num:p}:{})}else h===")"&&l.pop()}return n.push(...o),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Kn(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 Qn(e,t,n,r,i,o,s){const a=new Set;r&&si(e+t,ut,({groups:{captureName:u}})=>{a.add(u)},W.DEFAULT);const l=[n,r?a:null,i,o,s];return`${e}${Jn(`(?:${e}`,"forward",...l)}(?:)${Jn(`${t})`,"backward",...l)}${t}`}function Jn(e,t,n,r,i,o,s){const l=c=>t==="forward"?c+2:n-c+2-1;let u="";for(let c=0;c[^>]+)>`,({0:f,groups:{captureName:h,unnamed:m,backref:y}})=>{if(y&&r&&!r.has(y))return f;const b=`_$${p}`;if(m||h){const _=s+o.length+1;return o.push(_),kl(i,_),m?f:`(?<${h}${b}>`}return j`\k<${y}${b}>`},W.DEFAULT)}return u}function kl(e,t){for(let n=0;n=t&&e[n]++}function Zn(e,t,n,r,i,o){if(e.size&&r){let s=0;si(t,li,()=>s++,W.DEFAULT);const a=o-s+i,l=new Map;return e.forEach((u,c)=>{const p=(r-s*n)/n,f=s*n,h=c>a+s?c+r:c,m=[];for(const y of u)if(y<=a)m.push(y);else if(y>a+s+p)m.push(y+r);else if(y<=a+s)for(let b=0;b<=n;b++)m.push(y+s*b);else for(let b=0;b<=n;b++)m.push(y+f+p*b);l.set(h,m)}),l}return e}var x=String.fromCodePoint,S=String.raw,z={},ct=globalThis.RegExp;z.flagGroups=(()=>{try{new ct("(?i:)")}catch{return!1}return!0})();z.unicodeSets=(()=>{try{new ct("[[]]","v")}catch{return!1}return!0})();z.bugFlagVLiteralHyphenIsRange=z.unicodeSets?(()=>{try{new ct(S`[\d\-a]`,"v")}catch{return!0}return!1})():!1;z.bugNestedClassIgnoresNegation=z.unicodeSets&&new ct("[[^a]]","v").test("a");function tt(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Te(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Kt(e,t){return Yn[e]>=Yn[t]}function Rl(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Yn={ES2025:2025,ES2024:2024,ES2018:2018},Pl={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function ui(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!Pl[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=z.flagGroups?"ES2025":z.unicodeSets?"ES2024":"ES2018"),t}var Tl="[ -\r ]",xl=new Set([x(304),x(305)]),J=S`[\p{L}\p{M}\p{N}\p{Pc}]`;function ci(e){if(xl.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Nl.get(n),o=Ol.get(n),s=Dl.get(n);return[...r].length===1&&t.add(r),s&&t.add(s),i&&t.add(i),t.add(n),o&&t.add(o),[...t]}var ln=new Map(`C Other +`.replace(/\s+/g,""),"gsu");function Cu(e){if(!new RegExp(`${$i}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,i="",o=0,s;for(Tt.lastIndex=0;s=Tt.exec(e);){const{0:a,index:l,groups:{qBase:u,qMod:d,invalidQ:c}}=s;if(a==="[")o||(r=l),o++;else if(a==="]")o?o--:r=null;else if(!o)if(d==="+"&&i&&!i.startsWith("(")){if(c)throw new Error(`Invalid quantifier "${a}"`);let h=-1;if(/^\{\d+\}$/.test(u))e=bu(e,l+u.length,d,"");else{if(i===")"||i==="]"){const f=i===")"?n:r;if(f===null)throw new Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,f)}(?>${e.slice(f,l)}${u})${e.slice(l+a.length)}`}else e=`${e.slice(0,l-i.length)}(?>${i}${u})${e.slice(l+a.length)}`;h+=4}Tt.lastIndex+=h}else a[0]==="("?t.push(l):a===")"&&(n=t.length?t.pop():null);i=a}return{pattern:e}}const j=String.raw,Su=j`\\g<(?[^>&]+)&R=(?[^>]+)>`,Zt=j`\(\?R=(?[^\)]+)\)|${Su}`,_t=j`\(\?<(?![=!])(?[^>]+)>`,Vi=j`${_t}|(?\()(?!\?)`,ie=new RegExp(j`${_t}|${Zt}|\(\?|\\?.`,"gsu"),xt="Cannot use multiple overlapping recursions";function Au(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let i=t?.captureTransfers??new Map;if(!new RegExp(Zt,"su").test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&Ke(e,j`\(\?\(DEFINE\)`,W.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],s=Ke(e,j`\\[1-9]`,W.DEFAULT),a=new Map,l=[];let u=!1,d=0,c=0,h;for(ie.lastIndex=0;h=ie.exec(e);){const{0:f,groups:{captureName:m,rDepth:_,gRNameOrNum:b,gRDepth:y}}=h;if(f==="[")d++;else if(d)f==="]"&&d--;else if(_){if(pr(_),u)throw new Error(xt);if(s)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const g=e.slice(0,h.index),w=e.slice(ie.lastIndex);if(Ke(w,Zt,W.DEFAULT))throw new Error(xt);const v=+_-1;e=fr(g,w,v,!1,n,o,c),i=gr(i,g,v,o.length,0,c);break}else if(b){pr(y);let g=!1;for(const q of l)if(q.name===b||q.num===+b){if(g=!0,q.hasRecursedWithin)throw new Error(xt);break}if(!g)throw new Error(j`Recursive \g cannot be used outside the referenced group "${r==="external"?b:j`\g<${b}&R=${y}>`}"`);const w=a.get(b),v=Eu(e,w);if(s&&Ke(v,j`${_t}|\((?!\?)`,W.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const C=e.slice(w,h.index),L=v.slice(C.length+f.length),P=o.length,B=+y-1,pe=fr(C,L,B,!0,n,o,c);i=gr(i,C,B,o.length-P,P,c);const bt=e.slice(0,w),wt=e.slice(w+v.length);e=`${bt}${pe}${wt}`,ie.lastIndex+=pe.length-f.length-C.length-L.length,l.forEach(q=>q.hasRecursedWithin=!0),u=!0}else if(m)c++,a.set(String(c),ie.lastIndex),a.set(m,ie.lastIndex),l.push({num:c,name:m});else if(f[0]==="("){const g=f==="(";g&&(c++,a.set(String(c),ie.lastIndex)),l.push(g?{num:c}:{})}else f===")"&&l.pop()}return n.push(...o),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function pr(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 fr(e,t,n,r,i,o,s){const a=new Set;r&&Mi(e+t,_t,({groups:{captureName:u}})=>{a.add(u)},W.DEFAULT);const l=[n,r?a:null,i,o,s];return`${e}${mr(`(?:${e}`,"forward",...l)}(?:)${mr(`${t})`,"backward",...l)}${t}`}function mr(e,t,n,r,i,o,s){const l=d=>t==="forward"?d+2:n-d+2-1;let u="";for(let d=0;d[^>]+)>`,({0:h,groups:{captureName:f,unnamed:m,backref:_}})=>{if(_&&r&&!r.has(_))return h;const b=`_$${c}`;if(m||f){const y=s+o.length+1;return o.push(y),ku(i,y),m?h:`(?<${f}${b}>`}return j`\k<${_}${b}>`},W.DEFAULT)}return u}function ku(e,t){for(let n=0;n=t&&e[n]++}function gr(e,t,n,r,i,o){if(e.size&&r){let s=0;Mi(t,Vi,()=>s++,W.DEFAULT);const a=o-s+i,l=new Map;return e.forEach((u,d)=>{const c=(r-s*n)/n,h=s*n,f=d>a+s?d+r:d,m=[];for(const _ of u)if(_<=a)m.push(_);else if(_>a+s+c)m.push(_+r);else if(_<=a+s)for(let b=0;b<=n;b++)m.push(_+s*b);else for(let b=0;b<=n;b++)m.push(_+h+c*b);l.set(f,m)}),l}return e}var O=String.fromCodePoint,A=String.raw,z={},yt=globalThis.RegExp;z.flagGroups=(()=>{try{new yt("(?i:)")}catch{return!1}return!0})();z.unicodeSets=(()=>{try{new yt("[[]]","v")}catch{return!1}return!0})();z.bugFlagVLiteralHyphenIsRange=z.unicodeSets?(()=>{try{new yt(A`[\d\-a]`,"v")}catch{return!0}return!1})():!1;z.bugNestedClassIgnoresNegation=z.unicodeSets&&new yt("[[^a]]","v").test("a");function at(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function $e(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function en(e,t){return _r[e]>=_r[t]}function Iu(e,t){if(e==null)throw new Error(t??"Value expected");return e}var _r={ES2025:2025,ES2024:2024,ES2018:2018},Lu={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Gi(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!Lu[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=z.flagGroups?"ES2025":z.unicodeSets?"ES2024":"ES2018"),t}var Ru="[ -\r ]",Pu=new Set([O(304),O(305)]),J=A`[\p{L}\p{M}\p{N}\p{Pc}]`;function Bi(e){if(Pu.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Ou.get(n),o=Tu.get(n),s=xu.get(n);return[...r].length===1&&t.add(r),s&&t.add(s),i&&t.add(i),t.add(n),o&&t.add(o),[...t]}var Cn=new Map(`C Other Cc Control cntrl Cf Format Cn Unassigned @@ -146,19 +158,7 @@ Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC -XID_Start XIDS`.split(/\s/).map(e=>[lt(e),e])),Ol=new Map([["s",x(383)],[x(383),"s"]]),Dl=new Map([[x(223),x(7838)],[x(107),x(8490)],[x(229),x(8491)],[x(969),x(8486)]]),Nl=new Map([te(453),te(456),te(459),te(498),...It(8072,8079),...It(8088,8095),...It(8104,8111),te(8124),te(8140),te(8188)]),Vl=new Map([["alnum",S`[\p{Alpha}\p{Nd}]`],["alpha",S`\p{Alpha}`],["ascii",S`\p{ASCII}`],["blank",S`[\p{Zs}\t]`],["cntrl",S`\p{Cc}`],["digit",S`\p{Nd}`],["graph",S`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",S`\p{Lower}`],["print",S`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",S`[\p{P}\p{S}]`],["space",S`\p{space}`],["upper",S`\p{Upper}`],["word",S`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",S`\p{AHex}`]]);function Ml(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function te(e){const t=x(e);return[t.toLowerCase(),t]}function It(e,t){return Ml(e,t).map(n=>te(n))}var di=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function $l(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};pi(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Kt(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};Ie(e,Gl,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},o={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Ie(e,Bl,o);const s={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return Ie(e,Fl,s),e._originMap=o.groupOriginByCopy,e._strategy=r.strategy,e}var Gl={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const o=H();o.body[0].body.push(se({negate:!0,body:r}),ye("Any"));const s=H();s.body[0].body.push(ri("greedy",0,1/0,o)),n(R(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(o=>o.kind==="flags");for(let o=n+1;o\r\n|${i?S`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(ne(ye("AHex",{negate:u}),t));else if(l==="newline")n(R(Z(u?`[^ +XID_Start XIDS`.split(/\s/).map(e=>[gt(e),e])),Tu=new Map([["s",O(383)],[O(383),"s"]]),xu=new Map([[O(223),O(7838)],[O(107),O(8490)],[O(229),O(8491)],[O(969),O(8486)]]),Ou=new Map([ne(453),ne(456),ne(459),ne(498),...Ot(8072,8079),...Ot(8088,8095),...Ot(8104,8111),ne(8124),ne(8140),ne(8188)]),Du=new Map([["alnum",A`[\p{Alpha}\p{Nd}]`],["alpha",A`\p{Alpha}`],["ascii",A`\p{ASCII}`],["blank",A`[\p{Zs}\t]`],["cntrl",A`\p{Cc}`],["digit",A`\p{Nd}`],["graph",A`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",A`\p{Lower}`],["print",A`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",A`[\p{P}\p{S}]`],["space",A`\p{space}`],["upper",A`\p{Upper}`],["word",A`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",A`\p{AHex}`]]);function Nu(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ne(e){const t=O(e);return[t.toLowerCase(),t]}function Ot(e,t){return Nu(e,t).map(n=>ne(n))}var Fi=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Mu(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Ui(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:en(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};Re(e,$u,r);const i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},o={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};Re(e,Vu,o);const s={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return Re(e,Gu,s),e._originMap=o.groupOriginByCopy,e._strategy=r.strategy,e}var $u={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:i}=e;if(i==="repeater"){const o=H();o.body[0].body.push(se({negate:!0,body:r}),ye("Any"));const s=H();s.body[0].body.push(Oi("greedy",0,1/0,o)),n(R(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const i=e.body.filter(o=>o.kind==="flags");for(let o=n+1;o\r\n|${i?A`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(re(ye("AHex",{negate:u}),t));else if(l==="newline")n(R(Y(u?`[^ ]`:`(?>\r ?|[ -\v\f…\u2028\u2029])`),t));else if(l==="posix")if(!i&&(c==="graph"||c==="print")){if(r==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let p={graph:"!-~",print:" -~"}[c];u&&(p=`\0-${x(p.codePointAt(0)-1)}${x(p.codePointAt(2)+1)}-􏿿`),n(R(Z(`[${p}]`),t))}else n(R(Rt(Z(Vl.get(c)),u),t));else if(l==="property")ln.has(lt(c))||(e.key="sc");else if(l==="space")n(ne(ye("space",{negate:u}),t));else if(l==="word")n(R(Rt(Z(J),u),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:o,removeAllNextSiblings:s}){const{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)r();else{const u=H({flags:l});u.body[0].body=s(),i(R(u,t),{traverse:!0})}else if(a==="keep"){const u=n.body[0],p=n.body.length===1&&ei(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==p||p.body.length>1)throw new Error(S`Uses "\K" in a way that's unsupported`);const f=se({behind:!0});f.body[0].body=o(),i(R(f,t))}else throw new Error(`Unexpected directive kind "${a}"`)},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:r}=e;if(r==="fail")n(R(se({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=H();t.body[0].body.push(e.body),e.body=R(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const o of e.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const s=gi(o.body);s?(r=!0,Array.isArray(s)?n.push(...s):n.push(s)):i=!0}r&&!i&&n.forEach(o=>t.add(o))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(S`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!kt(n)&&(n=Lt(n,t),e.ref=n)}},Bl={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:a,reffedNodesByReferencer:l}){const u=i.get(e);if(u&&a.has(e.number)){const p=ne(er(e.number),t);l.set(p,a.get(e.number)),n(p);return}a.set(e.number,e),s.set(e.number,[]),e.name&&Te(s,e.name,[]);const c=s.get(e.name??e.number);for(let p=0;pf.type==="Group"&&!!f.flags)),p=c?tt(r.globalFlags,c):r.globalFlags;Ul(p,r.currentFlags)||(u=H({flags:Hl(p)}),u.body[0].body.push(l))}n(R(u,t),{traverse:!a})}},Fl={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const o=r.reffedNodesByReferencer.get(e).filter(s=>jl(s,e));if(!o.length)n(R(se({negate:!0}),t));else if(o.length>1){const s=H({atomic:!0,body:o.reverse().map(a=>de({body:[zt(a.number)]}))});n(R(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 r=0;r{t.forEach(i=>{r.enable?.[i]&&(delete n.disable[i],n.enable[i]=!0),r.disable?.[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Hl({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 mi(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function gi(e){const t=e.find(n=>n.kind==="search_start"||Xl(n,{negate:!1})||!zl(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 r of t.body){const i=gi(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function _i(e,t){const n=mi(e)??[];for(const r of n)if(r===t||_i(r,t))return!0;return!1}function zl({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function ql(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Xl(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&ei(e.body[0],{type:"Assertion",kind:"search_start"})}function kt(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Z(e,t){const r=ti(e,{...t,unicodePropertyMap:ln}).body;return r.length>1||r[0].body.length>1?H({body:r}):r[0].body[0]}function Rt(e,t){return e.negate=t,e}function ne(e,t){return e.parent=t,e}function R(e,t){return pi(e),e.parent=t,e}function Kl(e,t){const n=ui(t),r=Kt(n.target,"ES2024"),i=Kt(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,a=null;if(!i){const h=[e.flags.ignoreCase];Ie(e,Ql,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(m){h.push(m)},setHasCasedChar(){h.at(-1)?s=!0:a=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!a)};let u=e;const c={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!i&&s&&a),useFlagMods:i,useFlagV:r,verbose:n.verbose};function p(h){return c.lastNode=u,u=h,Rl(Jl[h.type],`Unexpected node type "${h.type}"`)(h,c,p)}const f={pattern:e.body.map(p).join("|"),flags:p(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],c.captureMap.forEach((h,m)=>{h.hidden&&f._hiddenCaptures.push(m),h.transferTo&&Te(f._captureTransfers,h.transferTo,[]).push(m)}),f}var Ql={"*":{enter({node:e},t){if(nr(e)){const n=t.getCurrentModI();t.pushModI(e.flags?tt({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){nr(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){un(x(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),yi(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&di.has(e.value)&&t.setHasCasedChar()}},Jl={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?S`\B`:S`\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:r,name:i,number:o}=e,s={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(s.hidden=!0,o>a.number&&(s.transferTo=a.number)),t.captureMap.set(o,s),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=x(e),r=ge(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&un(n)){const i=ci(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:o}=e;let{body:s}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");z.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(rr)&&(s=[at(45),...s.filter(u=>!rr(u))]);const a=()=>`[${i?"^":""}${s.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||z.bugNestedClassIgnoresNegation)&&!i){const c=s.filter(p=>p.type==="CharacterClass"&&p.kind==="union"&&p.negate);if(c.length){const p=H(),f=p.body[0];return p.parent=o,f.parent=p,s=s.filter(h=>!c.includes(h)),e.body=s,s.length?(e.parent=f,f.body.push(e)):p.body.pop(),c.forEach(h=>{const m=de({body:[h]});h.parent=m,m.parent=p,p.body.push(m)}),n(p)}}t.inCharClass=!0;const u=a();return t.inCharClass=!1,u}const l=s[0];if(r==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&o.kind==="union"&&!(z.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&o.kind==="intersection"&&s.length===1&&l.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 a()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=ge(n,i),s=ge(r,i),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=yi(e);nu(l).forEach(c=>{a.add(Array.isArray(c)?`${ge(c[0],i)}-${ge(c[1],i)}`:ge(c,i))})}return`${o}-${s}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":S`[^\n]`;if(e==="digit")return t?S`\D`:S`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&di.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?S`\P`:S`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?S`\W`:S`\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:r},i,o){const s=i.currentFlags;n&&(i.currentFlags=tt(s,n));const a=t.map(o).join("|"),l=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?a:`(?${ru(e,n,i.useFlagMods)}${a})`;return i.currentFlags=s,l},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+iu(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:S`\g<${t}&R=${r}>`}},Zl=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Yl=new Set(["-","\\","]","^","["]),eu=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),tr=new Map([[9,S`\t`],[10,S`\n`],[11,S`\v`],[12,S`\f`],[13,S`\r`],[8232,S`\u2028`],[8233,S`\u2029`],[65279,S`\uFEFF`]]),tu=new RegExp("^\\p{Cased}$","u");function un(e){return tu.test(e)}function yi(e,t){const n=!!t?.firstOnly,r=e.min.value,i=e.max.value,o=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return o;for(let s=r;s<=i;s++){const a=x(s);if(!un(a))continue;const l=ci(a).filter(u=>{const c=u.codePointAt(0);return ci});if(l.length&&(o.push(...l),n))break}return o}function ge(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(tr.has(e))return tr.get(e);if(e<32||e>126&&e<160||e>262143||t&&ou(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?eu:Yl:Zl,o=x(e);return(i.has(o)?"\\":"")+o}function nu(e){const t=e.map(i=>i.codePointAt(0)).sort((i,o)=>i-o),n=[];let r=null;for(let i=0;i";let r="";if(t&&n){const{enable:i,disable:o}=t;r=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${r}:`}function iu({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function nr({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function ou(e){return e>47&&e<58}function rr({type:e,value:t}){return e==="Character"&&t===45}var su=class Qt extends RegExp{#t=new Map;#e=null;#r;#n=null;#i=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){const i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const o=t;super(o,n),this.#r=o.source,o instanceof Qt&&(this.#t=o.#t,this.#n=o.#n,this.#i=o.#i,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#r=t,this.#t=lu(o.hiddenCaptures,o.transfers),this.#i=o.strategy,this.rawOptions=r??{}}i||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:i,...o}=this.rawOptions;this.#e=new Qt(this.#r,this.flags,o)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#i==="clip_search"&&n&&r){this.lastIndex=0;const i=this.#o(t.slice(r));return i&&(au(i,r,t,this.hasIndices),this.lastIndex+=r),i}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 r=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const o=[0];for(let s=1;s{const a=o[s];a&&(o[s]=[a[0]+t,a[1]+t])})}}function lu(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const o of i)Te(n,o,{}).transferTo=r;return n}function uu(e){const t=/(?\((?:\?<(?![=!])(?[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,o;for(;o=t.exec(e);){const{0:s,groups:{capture:a,name:l}}=o;s==="["?r++:r?s==="]"&&r--:a&&(i++,l&&n.set(i,l))}return n}function cu(e,t){const n=du(e,t);return n.options?new su(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function du(e,t){const n=ui(t),r=ti(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:ln}),i=$l(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=Kl(i,n),s=Ll(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),a=Sl(s.pattern),l=Al(a.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),u={pattern:l.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 c=l.hiddenCaptures.sort((m,y)=>m-y),p=Array.from(l.captureTransfers),f=i._strategy,h=u.pattern.length>=n.lazyCompileLength;(c.length||p.length||f||h)&&(u.options={...c.length&&{hiddenCaptures:c},...p.length&&{transfers:p},...f&&{strategy:f},...h&&{lazyCompile:h}})}return u}function pu(e,t){return cu(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Qu(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>pu(n,{target:t.target}),{createScanner(n){return new Ia(n,t)},createString:ka}}var cn=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function hu(){return 2147483648}function fu(){return typeof performance<"u"?performance.now():Date.now()}const mu=(e,t)=>e+(t-e%t)%t;async function gu(e){let t,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function o(h,m,y){r.HEAPU8.copyWithin(h,m,m+y)}function s(h){try{return t.grow(h-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function a(h){const m=r.HEAPU8.length;h=h>>>0;const y=hu();if(h>y)return!1;for(let b=1;b<=4;b*=2){let _=m*(1+.2/b);_=Math.min(_,h+100663296);const g=Math.min(y,mu(Math.max(h,_),65536));if(s(g))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,m,y=1024){const b=m+y;let _=m;for(;h[_]&&!(_>=b);)++_;if(_-m>16&&h.buffer&&l)return l.decode(h.subarray(m,_));let g="";for(;m<_;){let E=h[m++];if(!(E&128)){g+=String.fromCharCode(E);continue}const v=h[m++]&63;if((E&224)===192){g+=String.fromCharCode((E&31)<<6|v);continue}const C=h[m++]&63;if((E&240)===224?E=(E&15)<<12|v<<6|C:E=(E&7)<<18|v<<12|C<<6|h[m++]&63,E<65536)g+=String.fromCharCode(E);else{const L=E-65536;g+=String.fromCharCode(55296|L>>10,56320|L&1023)}}return g}function c(h,m){return h?u(r.HEAPU8,h,m):""}const p={emscripten_get_now:fu,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const m=await e({env:p,wasi_snapshot_preview1:p});t=m.memory,i(t.buffer),Object.assign(r,m),r.UTF8ToString=c}return await f(),r}var _u=Object.defineProperty,yu=(e,t,n)=>t in e?_u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t,n)=>yu(e,typeof t!="symbol"?t+"":t,n);let N=null;function Eu(e){throw new cn(e.UTF8ToString(e.getLastOnigError()))}class dt{constructor(t){O(this,"utf16Length"),O(this,"utf8Length"),O(this,"utf16Value"),O(this,"utf8Value"),O(this,"utf16OffsetToUtf8"),O(this,"utf8OffsetToUtf16");const n=t.length,r=dt._utf8ByteLength(t),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const a=new Uint8Array(r);let l=0;for(let u=0;u=55296&&c<=56319&&u+1=56320&&h<=57343&&(p=(c-55296<<10)+65536|h-56320,f=!0)}i&&(o[u]=l,f&&(o[u+1]=l),p<=127?s[l+0]=u:p<=2047?(s[l+0]=u,s[l+1]=u):p<=65535?(s[l+0]=u,s[l+1]=u,s[l+2]=u):(s[l+0]=u,s[l+1]=u,s[l+2]=u,s[l+3]=u)),p<=127?a[l++]=p:p<=2047?(a[l++]=192|(p&1984)>>>6,a[l++]=128|(p&63)>>>0):p<=65535?(a[l++]=224|(p&61440)>>>12,a[l++]=128|(p&4032)>>>6,a[l++]=128|(p&63)>>>0):(a[l++]=240|(p&1835008)>>>18,a[l++]=128|(p&258048)>>>12,a[l++]=128|(p&4032)>>>6,a[l++]=128|(p&63)>>>0),f&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let r=0,i=t.length;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(s=(o-55296<<10)+65536|l-56320,a=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,a&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const pt=class K{constructor(t){if(O(this,"id",++K.LAST_ID),O(this,"_onigBinding"),O(this,"content"),O(this,"utf16Length"),O(this,"utf8Length"),O(this,"utf16OffsetToUtf8"),O(this,"utf8OffsetToUtf16"),O(this,"ptr"),!N)throw new cn("Must invoke loadWasm first.");this._onigBinding=N,this.content=t;const n=new dt(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!K._sharedPtrInUse?(K._sharedPtr||(K._sharedPtr=N.omalloc(1e4)),K._sharedPtrInUse=!0,N.HEAPU8.set(n.utf8Value,K._sharedPtr),this.ptr=K._sharedPtr):this.ptr=n.createString(N)}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===K._sharedPtr?K._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};O(pt,"LAST_ID",0);O(pt,"_sharedPtr",0);O(pt,"_sharedPtrInUse",!1);let Ei=pt;class bu{constructor(t){if(O(this,"_onigBinding"),O(this,"_ptr"),!N)throw new cn("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=t.length;a{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),wu(r)?r=await r.instantiator(n):vu(r)?r=await r.default(n):(Cu(r)&&(r=r.data),Au(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Iu(r)(n):r=await Lu(r)(n):Su(r)?r=await Pt(r)(n):r instanceof WebAssembly.Module?r=await Pt(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Pt(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return Fe=t(),Fe}function Pt(e){return t=>WebAssembly.instantiate(e,t)}function Iu(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Lu(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let wi;function ku(e){wi=e}function Ru(){return wi}async function Pu(e){return e&&await bi(e),{createScanner(t){return new bu(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new Ei(t)}}}const Tu=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:Pu,getDefaultWasmLoader:Ru,loadWasm:bi,setDefaultWasmLoader:ku},Symbol.toStringTag,{value:"Module"}));var vi=Li({});Ri(vi,Tu);class dn{diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const o=this.castInput(t,r),s=this.castInput(n,r),a=this.removeEmpty(this.tokenize(o,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(a,l,r,i)}diffWithOptionsObj(t,n,r,i){var o;const s=g=>{if(g=this.postProcess(g,r),i){setTimeout(function(){i(g)},0);return}else return g},a=n.length,l=t.length;let u=1,c=a+l;r.maxEditLength!=null&&(c=Math.min(c,r.maxEditLength));const p=(o=r.timeout)!==null&&o!==void 0?o:1/0,f=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=l&&m+1>=a)return s(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,b=1/0;const _=()=>{for(let g=Math.max(y,-u);g<=Math.min(b,u);g+=2){let E;const v=h[g-1],C=h[g+1];v&&(h[g-1]=void 0);let L=!1;if(C){const B=C.oldPos-g;L=C&&0<=B&&B=l&&m+1>=a)return s(this.buildValues(E.lastComponent,n,t))||!0;h[g]=E,E.oldPos+1>=l&&(b=Math.min(b,g-1)),m+1>=a&&(y=Math.max(y,g+1))}u++};if(i)(function g(){setTimeout(function(){if(u>c||Date.now()>f)return i(void 0);_()||g()},0)})();else for(;u<=c&&Date.now()<=f;){const g=_();if(g)return g}}addToPath(t,n,r,i,o){const s=t.lastComponent;return s&&!o.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,i,o){const s=n.length,a=r.length;let l=t.oldPos,u=l-i,c=0;for(;u+1f.length?m:f}),c.value=this.join(p)}else c.value=this.join(n.slice(l,l+c.count));l+=c.count,c.added||(u+=c.count)}}return i}}class xu extends dn{}const Ou=new xu;function Ju(e,t,n){return Ou.diff(e,t,n)}const ir="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 Du extends dn{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${ir}]+|[^\\S\\n\\r]+|[^${ir}]`,"ug");return t.match(n)||[]}}const Nu=new Du;function Zu(e,t,n){return Nu.diff(e,t,n)}class Vu extends dn{constructor(){super(...arguments),this.tokenize=$u}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(` -`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(` -`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(` -`)&&(t=t.slice(0,-1)),n.endsWith(` -`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}}const Mu=new Vu;function or(e,t,n){return Mu.diff(e,t,n)}function $u(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,` -`));const n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i"~"||e[t]==='"'||e[t]==="\\")return!0;return!1}function ee(e){if(!Gu(e))return e;let t='"';const n=new TextEncoder().encode(e);let r=0;for(;r=32&&i<=126?t+=String.fromCharCode(i):t+="\\"+i.toString(8).padStart(3,"0"),r++}return t+='"',t}const sr={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function ar(e,t,n,r,i,o,s){let a;s?typeof s=="function"?a={callback:s}:a=s:a={},typeof a.context>"u"&&(a.context=4);const l=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){const{callback:c}=a;or(n,r,Object.assign(Object.assign({},a),{callback:p=>{const f=u(p);c(f)}}))}else return u(or(n,r,a));function u(c){if(!c)return;c.push({value:"",lines:[]});function p(g){return g.map(function(E){return" "+E})}const f=[];let h=0,m=0,y=[],b=1,_=1;for(let g=0;g0?p(C.lines.slice(-l)):[],h-=y.length,m-=y.length)}for(const C of v)y.push((E.added?"+":"-")+C);E.added?_+=v.length:b+=v.length}else{if(h)if(v.length<=l*2&&g1&&!t.includeFileHeaders&&!e.every(c=>c.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(c=>Jt(c,t)).join(` -`)}const l=[];if(e.isGit){if(t=sr,!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 c=e.oldFileName,p=e.newFileName;e.isCreate&&c==="/dev/null"?c=p.replace(/^b\//,"a/"):e.isDelete&&p==="/dev/null"&&(p=c.replace(/^a\//,"b/")),l.push("diff --git "+ee(c)+" "+ee(p)),e.isDelete&&l.push("deleted file mode "+((n=e.oldMode)!==null&&n!==void 0?n:"100644")),e.isCreate&&l.push("new file mode "+((r=e.newMode)!==null&&r!==void 0?r:"100644")),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(l.push("old mode "+e.oldMode),l.push("new mode "+e.newMode)),e.isRename&&(l.push("rename from "+ee(((i=e.oldFileName)!==null&&i!==void 0?i:"").replace(/^a\//,""))),l.push("rename to "+ee(((o=e.newFileName)!==null&&o!==void 0?o:"").replace(/^b\//,"")))),e.isCopy&&(l.push("copy from "+ee(((s=e.oldFileName)!==null&&s!==void 0?s:"").replace(/^a\//,""))),l.push("copy to "+ee(((a=e.newFileName)!==null&&a!==void 0?a:"").replace(/^b\//,""))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&l.push("Index: "+e.oldFileName),t.includeUnderline&&l.push("===================================================================");const u=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||u)&&(l.push("--- "+ee(e.oldFileName)+(e.oldHeader?" "+e.oldHeader:"")),l.push("+++ "+ee(e.newFileName)+(e.newHeader?" "+e.newHeader:"")));for(let c=0;c{a(l?Jt(l,s.headerOptions):void 0)}}))}else{const a=ar(e,t,n,r,i,o,s);return a?Jt(a,s?.headerOptions):void 0}}function Bu(e){const t=e.endsWith(` -`),n=e.split(` -`).map(r=>r+` -`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function ec(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:r=a=>a}=e,i=new Map;function o(a){return Object.entries(a).map(([l,u])=>`${l}:${u}`).join(";")}function s(a){const l=typeof a=="string"?a:o(a);let u=t+Fu(l)+n;return u=r(u),i.has(u)||i.set(u,typeof a=="string"?a:{...a}),u}return{name:"@shikijs/transformers:style-to-class",pre(a){if(!a.properties.style)return;const l=s(a.properties.style);delete a.properties.style,this.addClassToHast(a,l)},tokens(a){for(const l of a)for(const u of l){if(!u.htmlStyle)continue;const c=s(u.htmlStyle);u.htmlStyle={},u.htmlAttrs||={},u.htmlAttrs.class?u.htmlAttrs.class+=` ${c}`:u.htmlAttrs.class=c}},getClassRegistry(){return i},getCSS(){let a="";for(const[l,u]of i.entries())a+=`.${l}{${typeof u=="string"?u:o(u)}}`;return a},clearRegistry(){i.clear()}}}function Fu(e,t=0){let n=3735928559^t,r=1103547991^t;for(let i=0,o;i>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}const Ci=[{id:"abap",name:"ABAP",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a),[]))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b),[]))},{id:"ada",name:"Ada",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c),[]))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.d),[]))},{id:"ahk2",name:"AutoHotkey2",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.e),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.f),[]))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.g),[]))},{id:"apache",name:"Apache Conf",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.h),[]))},{id:"apex",name:"Apex",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.i),[]))},{id:"apl",name:"APL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.j),[]))},{id:"applescript",name:"AppleScript",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.k),[]))},{id:"ara",name:"Ara",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.l),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.m),[]))},{id:"asm",name:"Assembly",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.n),[]))},{id:"astro",name:"Astro",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.o),[]))},{id:"awk",name:"AWK",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.p),[]))},{id:"ballerina",name:"Ballerina",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.q),[]))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.r),[]))},{id:"beancount",name:"Beancount",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.s),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.t),[]))},{id:"bibtex",name:"BibTeX",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.u),[]))},{id:"bicep",name:"Bicep",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.v),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.w),[]))},{id:"blade",name:"Blade",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.x),[]))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.y),[]))},{id:"c",name:"C",import:(()=>d(()=>import("./shiki-lang-c.mjs"),[]))},{id:"c3",name:"C3",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.z),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.A),[]))},{id:"cairo",name:"Cairo",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.B),[]))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.C),[]))},{id:"clarity",name:"Clarity",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.D),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.E),[]))},{id:"cmake",name:"CMake",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.F),[]))},{id:"cobol",name:"COBOL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.G),[]))},{id:"codeowners",name:"CODEOWNERS",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.H),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.I),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.J),[]))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.K),[]))},{id:"coq",name:"Rocq",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.L),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>d(()=>import("./shiki-lang-cpp.mjs"),[]))},{id:"crystal",name:"Crystal",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.M),[]))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.N),[]))},{id:"css",name:"CSS",import:(()=>d(()=>import("./shiki-lang-css.mjs"),[]))},{id:"csv",name:"CSV",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.O),[]))},{id:"cue",name:"CUE",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.P),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.Q),[]))},{id:"d",name:"D",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.R),[]))},{id:"dart",name:"Dart",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.S),[]))},{id:"dax",name:"DAX",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.T),[]))},{id:"desktop",name:"Desktop",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.U),[]))},{id:"diff",name:"Diff",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.V),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.W),[]))},{id:"dotenv",name:"dotEnv",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.X),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.Y),[]))},{id:"edge",name:"Edge",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.Z),[]))},{id:"elixir",name:"Elixir",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e._),[]))},{id:"elm",name:"Elm",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.$),[]))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a0),[]))},{id:"erb",name:"ERB",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a1),[]))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a2),[]))},{id:"fennel",name:"Fennel",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a3),[]))},{id:"fish",name:"Fish",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a4),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a5),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a6),[]))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a7),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a8),[]))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a9),[]))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aa),[]))},{id:"gdshader",name:"GDShader",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ab),[]))},{id:"genie",name:"Genie",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ac),[]))},{id:"gherkin",name:"Gherkin",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ad),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ae),[]))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.af),[]))},{id:"gleam",name:"Gleam",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ag),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ah),[]))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ai),[]))},{id:"glsl",name:"GLSL",import:(()=>d(()=>import("./shiki-lang-glsl.mjs"),[]))},{id:"gn",name:"GN",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aj),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ak),[]))},{id:"go",name:"Go",import:(()=>d(()=>import("./shiki-lang-go.mjs"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.al),[]))},{id:"groovy",name:"Groovy",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.am),[]))},{id:"hack",name:"Hack",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.an),[]))},{id:"haml",name:"Ruby Haml",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ao),[]))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ap),[]))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aq),[]))},{id:"haxe",name:"Haxe",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ar),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.as),[]))},{id:"hjson",name:"Hjson",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.at),[]))},{id:"hlsl",name:"HLSL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.au),[]))},{id:"html",name:"HTML",import:(()=>d(()=>import("./shiki-lang-html.mjs"),[]))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.av),[]))},{id:"http",name:"HTTP",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aw),[]))},{id:"hurl",name:"Hurl",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ax),[]))},{id:"hxml",name:"HXML",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ay),[]))},{id:"hy",name:"Hy",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.az),[]))},{id:"imba",name:"Imba",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aA),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aB),[]))},{id:"java",name:"Java",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aC),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>d(()=>import("./shiki-lang-javascript.mjs"),[]))},{id:"jinja",name:"Jinja",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aD),[]))},{id:"jison",name:"Jison",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aE),[]))},{id:"json",name:"JSON",import:(()=>d(()=>import("./shiki-lang-json.mjs"),[]))},{id:"json5",name:"JSON5",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aF),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>d(()=>import("./shiki-lang-jsonc.mjs"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aG),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aH),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aI),[]))},{id:"jsx",name:"JSX",import:(()=>d(()=>import("./shiki-lang-jsx.mjs"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aJ),[]))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aK),[]))},{id:"kdl",name:"KDL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aL),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aM),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aN),[]))},{id:"latex",name:"LaTeX",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aO),[]))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aP),[]))},{id:"less",name:"Less",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aQ),[]))},{id:"liquid",name:"Liquid",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aR),[]))},{id:"llvm",name:"LLVM IR",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aS),[]))},{id:"log",name:"Log file",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aT),[]))},{id:"logo",name:"Logo",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aU),[]))},{id:"lua",name:"Lua",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aV),[]))},{id:"luau",name:"Luau",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aW),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aX),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>d(()=>import("./shiki-lang-markdown.mjs"),[]))},{id:"marko",name:"Marko",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aY),[]))},{id:"matlab",name:"MATLAB",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.aZ),[]))},{id:"mdc",name:"MDC",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a_),[]))},{id:"mdx",name:"MDX",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.a$),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b0),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b1),[]))},{id:"mojo",name:"Mojo",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b2),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b3),[]))},{id:"move",name:"Move",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b4),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b5),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b6),[]))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b7),[]))},{id:"nginx",name:"Nginx",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b8),[]))},{id:"nim",name:"Nim",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b9),[]))},{id:"nix",name:"Nix",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ba),[]))},{id:"nsis",name:"NSIS",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bb),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bc),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bd),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.be),[]))},{id:"ocaml",name:"OCaml",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bf),[]))},{id:"odin",name:"Odin",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bg),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bh),[]))},{id:"org",name:"Org Markup",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bi),[]))},{id:"pascal",name:"Pascal",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bj),[]))},{id:"perl",name:"Perl",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bk),[]))},{id:"php",name:"PHP",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bl),[]))},{id:"pkl",name:"Pkl",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bm),[]))},{id:"plsql",name:"PL/SQL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bn),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bo),[]))},{id:"polar",name:"Polar",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bp),[]))},{id:"postcss",name:"PostCSS",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bq),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.br),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bs),[]))},{id:"prisma",name:"Prisma",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bt),[]))},{id:"prolog",name:"Prolog",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bu),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bv),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bw),[]))},{id:"puppet",name:"Puppet",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bx),[]))},{id:"purescript",name:"PureScript",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.by),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>d(()=>import("./shiki-lang-python.mjs"),[]))},{id:"qml",name:"QML",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bz),[]))},{id:"qmldir",name:"QML Directory",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bA),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bB),[]))},{id:"r",name:"R",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bC),[]))},{id:"racket",name:"Racket",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bD),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bE),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bF),[]))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bG),[]))},{id:"reg",name:"Windows Registry Script",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bH),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>d(()=>import("./shiki-lang-regexp.mjs"),[]))},{id:"rel",name:"Rel",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bI),[]))},{id:"riscv",name:"RISC-V",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bJ),[]))},{id:"ron",name:"RON",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bK),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bL),[]))},{id:"rst",name:"reStructuredText",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bM),[]))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bN),[]))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>d(()=>import("./shiki-lang-rust.mjs"),[]))},{id:"sas",name:"SAS",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bO),[]))},{id:"sass",name:"Sass",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bP),[]))},{id:"scala",name:"Scala",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bQ),[]))},{id:"scheme",name:"Scheme",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bR),[]))},{id:"scss",name:"SCSS",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bS),[]))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bT),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bU),[]))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>d(()=>import("./shiki-lang-shellscript.mjs"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bV),[]))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bW),[]))},{id:"smithy",name:"Smithy",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bX),[]))},{id:"solidity",name:"Solidity",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bY),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.bZ),[]))},{id:"sparql",name:"SPARQL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b_),[]))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.b$),[]))},{id:"sql",name:"SQL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c0),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c1),[]))},{id:"stata",name:"Stata",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c2),[]))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c3),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c4),[]))},{id:"svelte",name:"Svelte",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c5),[]))},{id:"swift",name:"Swift",import:(()=>d(()=>import("./shiki-lang-swift.mjs"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c6),[]))},{id:"systemd",name:"Systemd Units",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c7),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c8),[]))},{id:"tasl",name:"Tasl",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.c9),[]))},{id:"tcl",name:"Tcl",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ca),[]))},{id:"templ",name:"Templ",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cb),[]))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cc),[]))},{id:"tex",name:"TeX",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cd),[]))},{id:"toml",name:"TOML",import:(()=>d(()=>import("./shiki-lang-toml.mjs"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ce),[]))},{id:"tsv",name:"TSV",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cf),[]))},{id:"tsx",name:"TSX",import:(()=>d(()=>import("./shiki-lang-tsx.mjs"),[]))},{id:"turtle",name:"Turtle",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cg),[]))},{id:"twig",name:"Twig",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ch),[]))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>d(()=>import("./shiki-lang-typescript.mjs"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ci),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cj),[]))},{id:"v",name:"V",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ck),[]))},{id:"vala",name:"Vala",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cl),[]))},{id:"vb",name:"Visual Basic",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cm),[]))},{id:"verilog",name:"Verilog",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cn),[]))},{id:"vhdl",name:"VHDL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.co),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cp),[]))},{id:"vue",name:"Vue",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cq),[]))},{id:"vue-html",name:"Vue HTML",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cr),[]))},{id:"vue-vine",name:"Vue Vine",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cs),[]))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.ct),[]))},{id:"wasm",name:"WebAssembly",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cu),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cv),[]))},{id:"wgsl",name:"WGSL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cw),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cx),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cy),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cz),[]))},{id:"xml",name:"XML",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cA),[]))},{id:"xsl",name:"XSL",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cB),[]))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>d(()=>import("./shiki-lang-yaml.mjs"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>d(()=>import("./shiki-lang-stub.mjs").then(e=>e.cC),[]))},{id:"zig",name:"Zig",import:(()=>d(()=>import("./shiki-lang-zig.mjs"),[]))}],Uu=Object.fromEntries(Ci.map(e=>[e.id,e.import])),ju=Object.fromEntries(Ci.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Wu={...Uu,...ju},Hu=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.b),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.c),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.d),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.e),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.f),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.g),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.h),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.i),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.j),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.k),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.l),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.m),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.n),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.o),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.p),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.q),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.r),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.s),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.t),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.u),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.v),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.w),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.x),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.y),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.z),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.A),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.B),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.C),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.D),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.E),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.F),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.G),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.H),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.I),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.J),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.K),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.L),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.M),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.N),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.O),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.P),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.Q),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.R),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.S),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.T),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.U),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.V),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.W),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.X),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.Y),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.Z),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e._),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.$),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a0),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a1),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a2),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a3),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a4),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a5),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a6),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a7),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a8),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.a9),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>d(()=>import("./shiki-theme-stub.mjs").then(e=>e.aa),[]))}],zu=Object.fromEntries(Hu.map(e=>[e.id,e.import])),tc=Aa({langs:Wu,themes:zu,engine:()=>(0,vi.createOnigurumaEngine)(d(()=>import("./shiki-wasm.mjs"),[]))});export{Pu as a,Wu as b,tc as c,Qu as d,ec as e,Yu as f,Ju as g,Zu as h,Ca as i,Yt as n,qs as t}; +\v\f…\u2028\u2029])`),t));else if(l==="posix")if(!i&&(d==="graph"||d==="print")){if(r==="strict")throw new Error(`POSIX class "${d}" requires min target ES2024 or non-strict accuracy`);let c={graph:"!-~",print:" -~"}[d];u&&(c=`\0-${O(c.codePointAt(0)-1)}${O(c.codePointAt(2)+1)}-􏿿`),n(R(Y(`[${c}]`),t))}else n(R(Mt(Y(Du.get(d)),u),t));else if(l==="property")Cn.has(gt(d))||(e.key="sc");else if(l==="space")n(re(ye("space",{negate:u}),t));else if(l==="word")n(R(Mt(Y(J),u),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:o,removeAllNextSiblings:s}){const{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)r();else{const u=H({flags:l});u.body[0].body=s(),i(R(u,t),{traverse:!0})}else if(a==="keep"){const u=n.body[0],c=n.body.length===1&&Pi(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==c||c.body.length>1)throw new Error(A`Uses "\K" in a way that's unsupported`);const h=se({behind:!0});h.body[0].body=o(),i(R(h,t))}else throw new Error(`Unexpected directive kind "${a}"`)},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:r}=e;if(r==="fail")n(R(se({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=H();t.body[0].body.push(e.body),e.body=R(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,i=!1;for(const o of e.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const s=zi(o.body);s?(r=!0,Array.isArray(s)?n.push(...s):n.push(s)):i=!0}r&&!i&&n.forEach(o=>t.add(o))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(A`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Nt(n)&&(n=Dt(n,t),e.ref=n)}},Vu={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:a,reffedNodesByReferencer:l}){const u=i.get(e);if(u&&a.has(e.number)){const c=re(yr(e.number),t);l.set(c,a.get(e.number)),n(c);return}a.set(e.number,e),s.set(e.number,[]),e.name&&$e(s,e.name,[]);const d=s.get(e.name??e.number);for(let c=0;ch.type==="Group"&&!!h.flags)),c=d?at(r.globalFlags,d):r.globalFlags;Bu(c,r.currentFlags)||(u=H({flags:ju(c)}),u.body[0].body.push(l))}n(R(u,t),{traverse:!a})}},Gu={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const o=r.reffedNodesByReferencer.get(e).filter(s=>Fu(s,e));if(!o.length)n(R(se({negate:!0}),t));else if(o.length>1){const s=H({atomic:!0,body:o.reverse().map(a=>de({body:[Jt(a.number)]}))});n(R(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 r=0;r{t.forEach(i=>{r.enable?.[i]&&(delete n.disable[i],n.enable[i]=!0),r.disable?.[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function ju({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 Hi(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function zi(e){const t=e.find(n=>n.kind==="search_start"||zu(n,{negate:!1})||!Wu(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 r of t.body){const i=zi(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function qi(e,t){const n=Hi(e)??[];for(const r of n)if(r===t||qi(r,t))return!0;return!1}function Wu({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Hu(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function zu(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Pi(e.body[0],{type:"Assertion",kind:"search_start"})}function Nt(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Y(e,t){const r=Ti(e,{...t,unicodePropertyMap:Cn}).body;return r.length>1||r[0].body.length>1?H({body:r}):r[0].body[0]}function Mt(e,t){return e.negate=t,e}function re(e,t){return e.parent=t,e}function R(e,t){return Ui(e),e.parent=t,e}function qu(e,t){const n=Gi(t),r=en(n.target,"ES2024"),i=en(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,a=null;if(!i){const f=[e.flags.ignoreCase];Re(e,Xu,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(m){f.push(m)},setHasCasedChar(){f.at(-1)?s=!0:a=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!a)};let u=e;const d={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!i&&s&&a),useFlagMods:i,useFlagV:r,verbose:n.verbose};function c(f){return d.lastNode=u,u=f,Iu(Qu[f.type],`Unexpected node type "${f.type}"`)(f,d,c)}const h={pattern:e.body.map(c).join("|"),flags:c(e.flags),options:{...e.options}};return r||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],d.captureMap.forEach((f,m)=>{f.hidden&&h._hiddenCaptures.push(m),f.transferTo&&$e(h._captureTransfers,f.transferTo,[]).push(m)}),h}var Xu={"*":{enter({node:e},t){if(wr(e)){const n=t.getCurrentModI();t.pushModI(e.flags?at({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){wr(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Sn(O(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Xi(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Fi.has(e.value)&&t.setHasCasedChar()}},Qu={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?A`\B`:A`\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:r,name:i,number:o}=e,s={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);return a&&(s.hidden=!0,o>a.number&&(s.transferTo=a.number)),t.captureMap.set(o,s),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=O(e),r=ge(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Sn(n)){const i=Bi(n);return t.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:i,parent:o}=e;let{body:s}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");z.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(Er)&&(s=[mt(45),...s.filter(u=>!Er(u))]);const a=()=>`[${i?"^":""}${s.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||z.bugNestedClassIgnoresNegation)&&!i){const d=s.filter(c=>c.type==="CharacterClass"&&c.kind==="union"&&c.negate);if(d.length){const c=H(),h=c.body[0];return c.parent=o,h.parent=c,s=s.filter(f=>!d.includes(f)),e.body=s,s.length?(e.parent=h,h.body.push(e)):c.body.pop(),d.forEach(f=>{const m=de({body:[f]});f.parent=m,m.parent=c,c.body.push(m)}),n(c)}}t.inCharClass=!0;const u=a();return t.inCharClass=!1,u}const l=s[0];if(r==="union"&&!i&&l&&((!t.useFlagV||!t.verbose)&&o.kind==="union"&&!(z.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&o.kind==="intersection"&&s.length===1&&l.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 a()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=ge(n,i),s=ge(r,i),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=Xi(e);ec(l).forEach(d=>{a.add(Array.isArray(d)?`${ge(d[0],i)}-${ge(d[1],i)}`:ge(d,i))})}return`${o}-${s}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":A`[^\n]`;if(e==="digit")return t?A`\D`:A`\d`;if(e==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Fi.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?A`\P`:A`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?A`\W`:A`\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:r},i,o){const s=i.currentFlags;n&&(i.currentFlags=at(s,n));const a=t.map(o).join("|"),l=!i.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!i.useFlagMods||!n)?a:`(?${tc(e,n,i.useFlagMods)}${a})`;return i.currentFlags=s,l},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(i).join("|")})`},Quantifier(e,t,n){return n(e.body)+nc(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:A`\g<${t}&R=${r}>`}},Ku=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Ju=new Set(["-","\\","]","^","["]),Yu=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),br=new Map([[9,A`\t`],[10,A`\n`],[11,A`\v`],[12,A`\f`],[13,A`\r`],[8232,A`\u2028`],[8233,A`\u2029`],[65279,A`\uFEFF`]]),Zu=new RegExp("^\\p{Cased}$","u");function Sn(e){return Zu.test(e)}function Xi(e,t){const n=!!t?.firstOnly,r=e.min.value,i=e.max.value,o=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return o;for(let s=r;s<=i;s++){const a=O(s);if(!Sn(a))continue;const l=Bi(a).filter(u=>{const d=u.codePointAt(0);return di});if(l.length&&(o.push(...l),n))break}return o}function ge(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(br.has(e))return br.get(e);if(e<32||e>126&&e<160||e>262143||t&&rc(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?Yu:Ju:Ku,o=O(e);return(i.has(o)?"\\":"")+o}function ec(e){const t=e.map(i=>i.codePointAt(0)).sort((i,o)=>i-o),n=[];let r=null;for(let i=0;i";let r="";if(t&&n){const{enable:i,disable:o}=t;r=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${r}:`}function nc({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function wr({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function rc(e){return e>47&&e<58}function Er({type:e,value:t}){return e==="Character"&&t===45}var ic=class tn extends RegExp{#t=new Map;#e=null;#r;#n=null;#i=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){const i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const o=t;super(o,n),this.#r=o.source,o instanceof tn&&(this.#t=o.#t,this.#n=o.#n,this.#i=o.#i,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":t,n),this.#r=t,this.#t=sc(o.hiddenCaptures,o.transfers),this.#i=o.strategy,this.rawOptions=r??{}}i||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:i,...o}=this.rawOptions;this.#e=new tn(this.#r,this.flags,o)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#i==="clip_search"&&n&&r){this.lastIndex=0;const i=this.#o(t.slice(r));return i&&(oc(i,r,t,this.hasIndices),this.lastIndex+=r),i}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 r=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const o=[0];for(let s=1;s{const a=o[s];a&&(o[s]=[a[0]+t,a[1]+t])})}}function sc(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,i]of t)for(const o of i)$e(n,o,{}).transferTo=r;return n}function ac(e){const t=/(?\((?:\?<(?![=!])(?[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,o;for(;o=t.exec(e);){const{0:s,groups:{capture:a,name:l}}=o;s==="["?r++:r?s==="]"&&r--:a&&(i++,l&&n.set(i,l))}return n}function lc(e,t){const n=uc(e,t);return n.options?new ic(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function uc(e,t){const n=Gi(t),r=Ti(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Cn}),i=Mu(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=qu(i,n),s=Au(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),a=Cu(s.pattern),l=vu(a.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),u={pattern:l.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 d=l.hiddenCaptures.sort((m,_)=>m-_),c=Array.from(l.captureTransfers),h=i._strategy,f=u.pattern.length>=n.lazyCompileLength;(d.length||c.length||h||f)&&(u.options={...d.length&&{hiddenCaptures:d},...c.length&&{transfers:c},...h&&{strategy:h},...f&&{lazyCompile:f}})}return u}function Qi(e,t){return lc(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function cc(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>Qi(n,{target:t.target}),{createScanner(n){return new Si(n,t)},createString:kl}}const Ec=Object.freeze(Object.defineProperty({__proto__:null,JavaScriptScanner:Si,createJavaScriptRegexEngine:cc,defaultJavaScriptRegexConstructor:Qi},Symbol.toStringTag,{value:"Module"}));export{ce as E,Qt as I,mc as L,pc as a,gn as b,fc as c,hc as d,sl as e,yc as f,wc as g,Ec as h,bc as l,bs as t}; diff --git a/Resources/review-diff-viewer/chunks/stream-tokenizer-DK9xp5M5.mjs b/Resources/review-diff-viewer/chunks/stream-tokenizer-DK9xp5M5.mjs new file mode 100644 index 000000000..a807fb2cc --- /dev/null +++ b/Resources/review-diff-viewer/chunks/stream-tokenizer-DK9xp5M5.mjs @@ -0,0 +1,4 @@ +import{_ as m}from"./preload-helper.mjs";import{b as R,r as v,H as C,c as $}from"./diff-worker.mjs";import{c as A}from"./pierre-theming.mjs";import{t as g}from"./shiki-core.mjs";function S(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function p(e){let r;return()=>r??=e().then(t=>(r=t,t),t=>{throw r=void 0,t})}const O=new Map,T=new Map,D=p(()=>m(()=>import("./pierre-highlights.mjs").then(e=>e.l),[])),H=p(()=>m(()=>import("./pierre-theming.mjs").then(e=>e.t),[])),z=p(()=>m(()=>import("./shiki-core.mjs").then(e=>e.f),[])),N=[["editor.lineHighlightBackground","editor.active_line.background"],["editor.selectionBackground","element.selected"],["editor.findMatchBackground","search.match_background"],["editor.findMatchHighlightBackground","search.match_background"],["editorBracketMatch.background","editor.document_highlight.bracket_background"],["editorError.foreground","error"],["editorWarning.foreground","warning"],["editorInfo.foreground","info"],["editorHint.foreground","hint"],["gitDecoration.addedResourceForeground","created","terminal.ansi.green"],["gitDecoration.deletedResourceForeground","deleted","terminal.ansi.red"],["gitDecoration.modifiedResourceForeground","modified","terminal.ansi.blue"]];function y(e,r){const t="themes"in r?r.themes[0]:r;if(t==null)throw new Error(`Theme "${e}" is an empty Zed theme family.`);const i={...t,name:e},s={};for(const[n,c]of Object.entries(i.style))typeof c=="string"&&(s[n]=c);const o=i.style.players?.[0];o?.cursor!=null&&(s["editorCursor.foreground"]??=o.cursor),o?.selection!=null&&(s["editor.selectionBackground"]??=o.selection);for(const[n,...c]of N){if(s[n]!=null)continue;const l=c.find(d=>s[d]!=null);l!=null&&(s[n]=s[l])}if(i.cssVariables===!0)s["editor.foreground"]="var(--hls-foreground)",s["editor.background"]="var(--hls-background)";else if(typeof i.cssVariables=="object"){s["editor.foreground"]??=s.text??s.foreground??"foreground",s["editor.background"]??=s.background??"background";const{prefix:n="--hls-",defaults:c}=i.cssVariables;for(const[l,d]of Object.entries(s)){const f=c?.[d];s[l]=`var(${n}${d}${f?`, ${f}`:""})`}}const a=i.appearance==="light"?"light":"dark";return{name:e,type:a,colors:s,zed:i,fg:s["editor.foreground"]??s.text??s.foreground??(a==="light"?"#333333":"#bbbbbb"),bg:s["editor.background"]??s.background??(a==="light"?"#ffffff":"#1e1e1e")}}function J(e){let r=T.get(e);return r!=null||(r=A({fallbackLoader:async t=>{if(typeof __DIFFS_WORKER__<"u"?__DIFFS_WORKER__:S())throw new Error(`Theme "${t}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedThemes parameter.`);const i=O.get(t);if(e==="highlights"){const s=i?.zed??i?.diffs;if(s!=null){const c=await s(),l="default"in c?c.default:c;if("zed"in l&&l.zed!=null)return l;if("style"in l||"themes"in l)return y(t,l);throw new Error(`Theme "${t}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`)}const o=D(),{themes:a}=o instanceof Promise?await o:o,n=a[t];if(n!=null)return y(t,(await n()).default);if(i?.textmate!=null)throw new Error(`Theme "${t}" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`)}else{const s=i?.textmate??i?.diffs;let o;if(s!=null){const d=await s();o="default"in d?d.default:d}else{const d=H(),{themes:f}=d instanceof Promise?await d:d,u=f.getTheme(t);if(u==null&&i?.zed!=null)throw new Error(`Theme "${t}" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`);if(u==null)throw new Error(`No valid theme loader registered for "${t}"`);const h=await u.load();o="default"in h?h.default:h}if("style"in o||"themes"in o)throw new Error(`Theme "${t}" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`);const a=z(),{normalizeTheme:n,createCssVariablesTheme:c}=a instanceof Promise?await a:a;if("cssVariables"in o&&o.cssVariables!=null)return{...o,textmate:n(c(o.cssVariables))};if("textmate"in o&&o.textmate!=null)return{...o,textmate:n(o.textmate)};const l=n(o);return{name:l.name,type:l.type,fg:l.fg,bg:l.bg,colors:l.colors,textmate:l}}throw new Error(`No valid theme loader registered for "${t}"`)},normalizeTheme:(t,i)=>{if(t.name!==i)throw new Error(`resolvedTheme: themeName: ${i} does not match theme.name: ${t.name}`);return t}}),T.set(e,r)),r}const L=new Set(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"]),I=new Set(["svg","template","script","style"]),M={class:"class",className:"class",id:"id",role:"role",style:"style",tabIndex:"tabindex",tabindex:"tabindex",title:"title"},B=/^data-[\w.:-]+$/,V=/[<&]/g,P=/[\0"&'`]/g,W={"<":"<","&":"&",'"':""","'":"'","`":"`","\0":"�"},F=256;function j(e){const r=new Map;return Array.isArray(e)?b(e,r):E(e,r)}function b(e,r){let t="";for(const i of e)t+=E(i,r);return t}function E(e,r){switch(e.type){case"text":return w(e.value);case"element":return Z(e,r);case"root":return b(e.children,r);default:return g(e)}}function Z(e,r){const{tagName:t}=e;if(t==="span"&&e.children.length===1&&e.children[0].type==="text"&&typeof e.properties?.style=="string"){let a=!0;for(const n in e.properties)if(n!=="style"&&e.properties[n]!=null){a=!1;break}if(a)return`${w(e.children[0].value)}`}if(I.has(t))return g(e);const i=G(e.properties,r);if(i==null)return g(e);const s=i===""?`<${t}>`:`<${t} ${i}>`,o=b(e.children,r);return o===""&&L.has(t.toLowerCase())?s:`${s}${o}`}function _(e,r){let t=r.get(e);return t==null&&(t=`style="${k(e)}"`,r.sizetypeof n.start=="number"||typeof n.end=="number")===!0)for(let n=e.indexOf(` +`);n!==-1;n=e.indexOf(` +`,n+1))s.push(n+1);const o={type:"element",tagName:"code",properties:{},children:[]},a=$(r.tokens,{decorations:t.decorations,mergeWhitespaces:t.mergeWhitespaces,lineOffsets:s,cacheHtmlStyles:i});for(let n=0;n0&&o.children.push({type:"text",value:` +`}),o.children.push(a[n]);return j({type:"root",children:[{type:"element",tagName:"pre",properties:{class:"diffs",style:r.rootStyle===!1?void 0:r.rootStyle??[r.fg!=null?`color:${r.fg}`:"",r.bg!=null?`background-color:${r.bg}`:""].filter(Boolean).join(";"),tabIndex:0},children:[o]}]})}var Q=class{name;themeResolver;disposed=!1;constructor(e,r){this.name=e,this.themeResolver=r,R(e)}codeToHtml(e,r){return U(e,this.codeToTokens(e,r),r,this.name==="highlights")}get isDisposed(){return this.disposed}dispose(){this.disposed||(this.disposed=!0,this.releaseResources(),v())}assertNotDisposed(){if(this.disposed)throw new C}},ee=class{disposed=!1;stableOffset=0;unstable=[];pendingCarriageReturn="";enqueue(e){this.assertActive(),e=this.pendingCarriageReturn+e,this.pendingCarriageReturn=e.endsWith("\r")?"\r":"",this.pendingCarriageReturn!==""&&(e=e.slice(0,-1));const r=this.unstable.length,t=[],{unstable:i,tailLength:s}=this.tokenizeChunk(e,t);return this.pendingCarriageReturn!==""&&i.push({content:"\r",offset:this.stableOffset+s}),this.unstable=i,{recall:r,stable:t,unstable:i}}pushLineBreak(e,r,t){for(let i=0;inew Worker(new URL("/chunks/diff-worker.mjs",location.href),{type:"module"})},highlighterOptions:{langs:["text"],preferredHighlighter:"shiki-wasm",lineDiffType:"word",maxLineDiffLength:1e3,tokenizeMaxLineLength:1e3,useTokenTransformer:!1}});function x(e,t){if(t.item.type!=="diff")return;const r=e.side??"additions",o=e.endSide??r;r!=="additions"||o!=="additions"||d({type:"selectLines",filePath:t.item.fileDiff.name,side:"additions",startLine:Math.min(e.start,e.end),endLine:Math.max(e.start,e.end)})}function l(e){return{theme:{dark:"pierre-dark",light:"pierre-light"},themeType:"system",diffStyle:e,diffIndicators:"bars",overflow:"scroll",lineDiffType:"word",maxLineDiffLength:1e3,tokenizeMaxLineLength:1e3,lineHoverHighlight:"number",enableLineSelection:!0,enableGutterUtility:!0,stickyHeaders:!0,layout:{paddingTop:0,gap:1,paddingBottom:16},unsafeCSS:v,onGutterUtilityClick:x}}const v=` +import{g,C as u,p as w,a as y}from"./chunks/diff-vendor.mjs";import"./chunks/shiki-core.mjs";import"./chunks/preload-helper.mjs";import"./chunks/pierre-theming.mjs";const k=new Set(["c","cpp","cpp-macro","css","glsl","go","html","javascript","json","jsonc","jsx","markdown","python","regexp","rust","shellscript","swift","toml","tsx","typescript","yaml","zig"]),S=new Set([...k,"bash","sh","shell","yml","zsh"]);function c(e){window.webkit?.messageHandlers?.programaReview?.postMessage(e)}const d=document.getElementById("root");if(!d)throw new Error("Missing #root");const b=new URLSearchParams(location.search).get("style")==="unified"?"unified":"split",L=g({poolOptions:{poolSize:2,workerFactory:()=>new Worker(new URL("/chunks/diff-worker.mjs",location.href),{type:"module"})},highlighterOptions:{langs:["text"],preferredHighlighter:"shiki-wasm",lineDiffType:"word",maxLineDiffLength:1e3,tokenizeMaxLineLength:1e3,useTokenTransformer:!1}});function x(e,t){if(t.item.type!=="diff")return;const r=e.side??"additions",o=e.endSide??r;r!=="additions"||o!=="additions"||c({type:"selectLines",filePath:t.item.fileDiff.name,side:"additions",startLine:Math.min(e.start,e.end),endLine:Math.max(e.start,e.end)})}function l(e){return{theme:{dark:"pierre-dark",light:"pierre-light"},themeType:"system",diffStyle:e,diffIndicators:"bars",overflow:"scroll",lineDiffType:"word",maxLineDiffLength:1e3,tokenizeMaxLineLength:1e3,lineHoverHighlight:"number",enableLineSelection:!0,enableGutterUtility:!0,stickyHeaders:!0,layout:{paddingTop:0,gap:1,paddingBottom:16},unsafeCSS:v,onGutterUtilityClick:x}}const v=` :host { --diffs-light-bg: transparent; --diffs-dark-bg: transparent; @@ -14,4 +14,4 @@ import{g,C as u,p as w,a as y}from"./chunks/diff-vendor.mjs";import"./chunks/shi -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); } -`;let s=b;const n=new u(l(s),L);n.setup(c);let f=0;function M(e,t){const r=[],o=new Map;for(const m of w(e,t))for(const i of m.files){const h=y(i.name);S.has(h)||(i.lang="text");const a=o.get(i.name)??0;o.set(i.name,a+1),r.push({id:a===0?i.name:`${i.name}#${a}`,type:"diff",fileDiff:i,version:f})}return r}async function p(){const e=++f;try{const t=await fetch("/patch",{cache:"no-store"});if(!t.ok)throw new Error(`patch request failed: ${t.status}`);const r=await t.text();if(e!==f)return;n.setItems(M(r,`review-${e}`)),n.render()}catch(t){d({type:"error",message:String(t?.stack??t)})}}window.programaReview={reload:p,setDiffStyle(e){e!==s&&(s=e,n.setOptions(l(s)),n.render())}};window.addEventListener("error",e=>d({type:"error",message:String(e.message)}));p(); +`;let s=b;const n=new u(l(s),L);n.setup(d);let f=0;function M(e,t){const r=[],o=new Map;for(const m of w(e,{cacheKeyPrefix:t}))for(const i of m.files){const h=y(i.name);S.has(h)||(i.lang="text");const a=o.get(i.name)??0;o.set(i.name,a+1),r.push({id:a===0?i.name:`${i.name}#${a}`,type:"diff",fileDiff:i,version:f})}return r}async function p(){const e=++f;try{const t=await fetch("/patch",{cache:"no-store"});if(!t.ok)throw new Error(`patch request failed: ${t.status}`);const r=await t.text();if(e!==f)return;n.setItems(M(r,`review-${e}`)),n.render()}catch(t){c({type:"error",message:String(t?.stack??t)})}}window.programaReview={reload:p,setDiffStyle(e){e!==s&&(s=e,n.setOptions(l(s)),n.render())}};window.addEventListener("error",e=>c({type:"error",message:String(e.message)}));p(); diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md index e87e207d7..7d0414872 100644 --- a/THIRD_PARTY_LICENSES.md +++ b/THIRD_PARTY_LICENSES.md @@ -193,7 +193,7 @@ SOFTWARE. - **License:** Apache License 2.0 - **Copyright:** Copyright 2025 Pierre Computer Company - **Source:** https://www.npmjs.com/package/@pierre/diffs -- **Used for:** the review diff viewer bundle in `Resources/review-diff-viewer`, built from `webviews/review-diff` at version 1.5.2 +- **Used for:** the review diff viewer bundle in `Resources/review-diff-viewer`, built from `webviews/review-diff` at version 1.6.4 Apache License Version 2.0, January 2004 @@ -387,6 +387,15 @@ specific language governing permissions and limitations under the License. --- +## @pierre/highlights + +- **License:** Apache License 2.0 (text above, under @pierre/diffs) +- **Copyright:** Copyright Pierre Computer Company +- **Source:** https://www.npmjs.com/package/@pierre/highlights +- **Used for:** syntax highlighting in the review diff viewer bundle, pulled in by `@pierre/diffs` (`@pierre/highlights` 0.4.0) + +--- + ## @pierre/theme and @pierre/theming - **License:** Apache License 2.0 (text above, under @pierre/diffs) diff --git a/core/Cargo.lock b/core/Cargo.lock index b5ccac080..de04175da 100644 --- a/core/Cargo.lock +++ b/core/Cargo.lock @@ -182,9 +182,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.29.0" +version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d" dependencies = [ "bitflags", "cfg-if", diff --git a/core/Cargo.toml b/core/Cargo.toml index edf72d7f5..bd9d5a952 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -18,7 +18,7 @@ serde = { version = "1.0.229", features = ["derive"] } serde_json = "1.0.151" thiserror = "2.0.20" tokio = { version = "1.47", features = ["rt-multi-thread", "net", "io-util", "signal", "sync", "time", "fs", "macros", "process"] } -nix = { version = "0.29", features = ["fs", "term", "process", "socket", "signal", "poll", "user", "uio"] } +nix = { version = "0.31", features = ["fs", "term", "process", "socket", "signal", "poll", "user", "uio"] } libc = "0.2.169" uuid = { version = "1.11", features = ["v4"] } base64 = "0.22" diff --git a/core/crates/programad/src/fdpass.rs b/core/crates/programad/src/fdpass.rs index dd99f2df1..b805da902 100644 --- a/core/crates/programad/src/fdpass.rs +++ b/core/crates/programad/src/fdpass.rs @@ -72,7 +72,10 @@ fn owned_fd_from_raw_checked(raw: RawFd) -> io::Result { )); } use nix::fcntl::{fcntl, FcntlArg, FdFlag}; - if let Err(error) = fcntl(raw, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC)) { + // SAFETY: `raw` was just produced by the kernel via `SCM_RIGHTS` and stays + // open until it is closed or taken into ownership below. + let borrowed = unsafe { std::os::fd::BorrowedFd::borrow_raw(raw) }; + if let Err(error) = fcntl(borrowed, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC)) { // SAFETY: `raw` was just produced by the kernel via `SCM_RIGHTS`, and // this branch transfers it directly to `close` exactly once. unsafe { libc::close(raw) }; @@ -448,7 +451,7 @@ mod tests { ); let received = stream.take_fd().await.unwrap(); assert!(received.as_raw_fd() >= 0); - let flags = nix::fcntl::fcntl(received.as_raw_fd(), nix::fcntl::FcntlArg::F_GETFD).unwrap(); + let flags = nix::fcntl::fcntl(&received, nix::fcntl::FcntlArg::F_GETFD).unwrap(); assert!( nix::fcntl::FdFlag::from_bits_truncate(flags).contains(nix::fcntl::FdFlag::FD_CLOEXEC) ); diff --git a/core/crates/programad/src/pty.rs b/core/crates/programad/src/pty.rs index 969cdec7c..aa6f1053b 100644 --- a/core/crates/programad/src/pty.rs +++ b/core/crates/programad/src/pty.rs @@ -12,7 +12,7 @@ //! `exec`, which is the supported way to do exactly this dance. use std::io; -use std::os::fd::{AsRawFd, OwnedFd, RawFd}; +use std::os::fd::{AsFd, AsRawFd, OwnedFd, RawFd}; use std::os::unix::process::CommandExt; use std::path::Path; use std::process::{Child, Command, Stdio}; @@ -131,9 +131,9 @@ pub fn spawn(params: SpawnParams) -> io::Result { Ok(PtySession { master, child }) } -pub(crate) fn set_cloexec(fd: &impl AsRawFd) -> io::Result<()> { +pub(crate) fn set_cloexec(fd: &impl AsFd) -> io::Result<()> { use nix::fcntl::{fcntl, FcntlArg, FdFlag}; - fcntl(fd.as_raw_fd(), FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC)) + fcntl(fd, FcntlArg::F_SETFD(FdFlag::FD_CLOEXEC)) .map(|_| ()) .map_err(io::Error::from) } @@ -156,10 +156,9 @@ pub fn resize(fd: &OwnedFd, cols: u16, rows: u16) -> io::Result<()> { fn set_nonblocking(fd: &OwnedFd) -> io::Result<()> { use nix::fcntl::{fcntl, FcntlArg, OFlag}; - let raw = fd.as_raw_fd(); - let flags = fcntl(raw, FcntlArg::F_GETFL).map_err(io::Error::from)?; + let flags = fcntl(fd, FcntlArg::F_GETFL).map_err(io::Error::from)?; let mut flags = OFlag::from_bits_truncate(flags); flags.insert(OFlag::O_NONBLOCK); - fcntl(raw, FcntlArg::F_SETFL(flags)).map_err(io::Error::from)?; + fcntl(fd, FcntlArg::F_SETFL(flags)).map_err(io::Error::from)?; Ok(()) } diff --git a/core/crates/programad/src/session.rs b/core/crates/programad/src/session.rs index 4ee2d2e4d..435cf8b18 100644 --- a/core/crates/programad/src/session.rs +++ b/core/crates/programad/src/session.rs @@ -350,7 +350,7 @@ fn attachment_input_loop(inner: Arc, input_r: OwnedFd, stop_r: OwnedFd) { { continue; } - match nix::unistd::read(input_raw, &mut buf) { + match nix::unistd::read(&input_r, &mut buf) { Ok(0) => return, Ok(read) => { if write_all_to_master(inner.master.as_raw_fd(), &buf[..read], stop_raw).is_err() { @@ -491,7 +491,7 @@ fn reader_loop(inner: Arc, wake_r: OwnedFd) { } loop { - match nix::unistd::read(master_raw, &mut buf) { + match nix::unistd::read(&inner.master, &mut buf) { Ok(0) => { finish_on_exit(&inner, wake_raw); return; diff --git a/core/crates/programad/tests/integration.rs b/core/crates/programad/tests/integration.rs index a4ae86092..81ede4753 100644 --- a/core/crates/programad/tests/integration.rs +++ b/core/crates/programad/tests/integration.rs @@ -11,7 +11,7 @@ //! `src/main.rs`). #![cfg(unix)] -use std::os::fd::{AsRawFd, OwnedFd}; +use std::os::fd::OwnedFd; use std::sync::Mutex; use std::time::Duration; @@ -180,7 +180,7 @@ async fn full_session_lifecycle_survives_client_disconnect() { // through session.read/WAL, so the daemon remains the sole PTY reader. let mut byte = [0u8; 1]; assert_eq!( - nix::unistd::read(master_fd.as_raw_fd(), &mut byte).unwrap_err(), + nix::unistd::read(&master_fd, &mut byte).unwrap_err(), nix::errno::Errno::EBADF ); @@ -271,13 +271,9 @@ async fn full_session_lifecycle_survives_client_disconnect() { // master and drains into the WAL regardless. { use std::io::Write; - // SAFETY: dup returns a new descriptor owned by this File; dropping - // it leaves the separately owned handed-off descriptor open. - let mut file = unsafe { - ::from_raw_fd( - nix::unistd::dup(master_fd.as_raw_fd()).unwrap(), - ) - }; + // dup returns a new descriptor owned by this File; dropping it leaves + // the separately owned handed-off descriptor open. + let mut file = std::fs::File::from(nix::unistd::dup(&master_fd).unwrap()); file.write_all(b"hello from client A\n").unwrap(); file.flush().unwrap(); } diff --git a/scripts/sparkle_generate_appcast.sh b/scripts/sparkle_generate_appcast.sh index 804e712ef..9e7966d41 100755 --- a/scripts/sparkle_generate_appcast.sh +++ b/scripts/sparkle_generate_appcast.sh @@ -38,8 +38,8 @@ fi # This tool runs next to SPARKLE_PRIVATE_KEY, so it is pinned to an exact commit, not # just a tag (tags can be moved). Bump both together; the SHA is the tag's commit # (git ls-remote https://github.com/sparkle-project/Sparkle refs/tags/). -SPARKLE_VERSION="2.9.6" -SPARKLE_COMMIT="ac2def288cbff5cfc7df3ffef6abdf45b72bcb0a" +SPARKLE_VERSION="2.10.1" +SPARKLE_COMMIT="ab7d71291238df6e0492143b120c9b696a35f603" DOWNLOAD_URL_PREFIX="${DOWNLOAD_URL_PREFIX:-https://github.com/darkroomengineering/programa/releases/download/$TAG/}" RELEASE_NOTES_URL="${RELEASE_NOTES_URL:-https://github.com/darkroomengineering/programa/releases/tag/$TAG}" diff --git a/scripts/sparkle_generate_keys.sh b/scripts/sparkle_generate_keys.sh index 8ba6102ab..30653975b 100755 --- a/scripts/sparkle_generate_keys.sh +++ b/scripts/sparkle_generate_keys.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -SPARKLE_VERSION="${SPARKLE_VERSION:-2.9.6}" +SPARKLE_VERSION="${SPARKLE_VERSION:-2.10.1}" # Legacy cmux name: the existing Sparkle signing key lives under this keychain account. SPARKLE_KEYCHAIN_ACCOUNT="${SPARKLE_KEYCHAIN_ACCOUNT:-cmux}" SPARKLE_ENV_FILE="${SPARKLE_ENV_FILE:-.env}" diff --git a/webviews/review-diff/bun.lock b/webviews/review-diff/bun.lock index 4abf4a84f..bb38e1c09 100644 --- a/webviews/review-diff/bun.lock +++ b/webviews/review-diff/bun.lock @@ -5,10 +5,10 @@ "": { "name": "@programa/review-diff-viewer", "dependencies": { - "@pierre/diffs": "1.5.2", + "@pierre/diffs": "1.6.4", }, "devDependencies": { - "typescript": "5.9.3", + "typescript": "7.0.2", "vite": "7.3.7", }, }, @@ -68,11 +68,13 @@ "@napi-rs/lzma-linux-x64-gnu": ["@napi-rs/lzma-linux-x64-gnu@1.5.1", "", { "os": "linux", "cpu": "x64", "libc": "glibc" }, "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ=="], - "@pierre/diffs": ["@pierre/diffs@1.5.2", "", { "dependencies": { "@pierre/theme": "2.0.0", "@pierre/theming": "1.0.1", "@shikijs/transformers": "^3.0.0 || ^4.0.0", "diff": "9.0.0", "hast-util-to-html": "9.0.5", "lru_map": "0.4.1", "shiki": "^3.0.0 || ^4.0.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" }, "optionalPeers": ["react", "react-dom"] }, "sha512-QVxIWQEnNoko22k63maERzozd29+FtaUNpRrZiw603WMe5R1mFSED+jMtPkcVP3SDYS1DWg5K7sa7sJbr3xkNQ=="], + "@pierre/diffs": ["@pierre/diffs@1.6.4", "", { "dependencies": { "@pierre/highlights": "0.4.0", "@pierre/theme": "2.0.0", "@pierre/theming": "1.0.2", "diff": "9.0.0", "hast-util-to-html": "9.0.5", "lru_map": "0.4.1", "shiki": "^3.0.0 || ^4.0.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" }, "optionalPeers": ["react", "react-dom"] }, "sha512-RsKoruCOp50qaDM3a7BQan5K77xMkGWT1NF01fiYP1PfT3v4CvIjwytNk5WjZG0BesBkMOP2UbrBIDigB1k0ug=="], + + "@pierre/highlights": ["@pierre/highlights@0.4.0", "", {}, "sha512-2a38H7ep3KweGi1fGQpJk+Krod2OMpDIXagKPlqBd1Y9P460T7zQmc66Wm2JAH1SpIG93wCyyhZVrkc5dnAJVQ=="], "@pierre/theme": ["@pierre/theme@2.0.0", "", {}, "sha512-yNDd9GYLQl1mEUJR8AneJ5e4ohLIHQd/wZLWr4fagt78vS2RwwZNW530vVgHqXFAyFVcFlRmGUD5ramXH46OXw=="], - "@pierre/theming": ["@pierre/theming@1.0.1", "", { "peerDependencies": { "@pierre/theme": "^1.1.0 || ^2.0.0", "@shikijs/themes": "^3.0.0 || ^4.0.0", "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0", "shiki": "^3.0.0 || ^4.0.0" }, "optionalPeers": ["@pierre/theme", "@shikijs/themes", "react", "react-dom", "shiki"] }, "sha512-WCI5Qd7iprDpISL9fBYOLe8RV53+b7mFNA3bPzl60/2CKCSrsKN8zEcep6Y3BAzvARlmca50zGjDodqPGiTUKA=="], + "@pierre/theming": ["@pierre/theming@1.0.2", "", { "peerDependencies": { "@pierre/theme": "^1.1.0 || ^2.0.0", "@shikijs/themes": "^3.0.0 || ^4.0.0", "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0", "shiki": "^3.0.0 || ^4.0.0" }, "optionalPeers": ["@pierre/theme", "@shikijs/themes", "react", "react-dom", "shiki"] }, "sha512-RmXLLqtx31UGcR8kZyO5hGAQ1EXz6loT1Cu0BFAGsbnBboIxp2BlomkLfWyvdT4WZXnBGyu25onL1gKpFQuSUw=="], "@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.66.0", "", { "os": "android", "cpu": "arm" }, "sha512-7y4XeoUHPecjfUDRmap8U0q6bjfLAPn7uOGT8BKyqy8uNDOjsGS8rlBhOx6sZLVwwjN6hapvGl2mW9/IS6UNww=="], @@ -136,8 +138,6 @@ "@shikijs/themes": ["@shikijs/themes@4.5.0", "", { "dependencies": { "@shikijs/types": "4.5.0" } }, "sha512-zGb87H3UBbpuI4yoh5UguB1XbU+2BDU3kflM7UfZ+Cy2hWo9lBtqjSVK20gmLY6ukYl040hAypGXMgud9vul8Q=="], - "@shikijs/transformers": ["@shikijs/transformers@4.5.0", "", { "dependencies": { "@shikijs/core": "4.5.0", "@shikijs/types": "4.5.0" } }, "sha512-LM7twi043qCC3gRyGQfjoC2/sowzbEltWuruyRtT3RlBlk1hKzWk9ETnU7RcDBoVWQBmC8Mebnr7p28W7kPoaA=="], - "@shikijs/types": ["@shikijs/types@4.5.0", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-drtPrtD8N0DENyD2cyt6Ajy+IWsiCLgMxODwLTpvH1UsN6a9jf90tNTPjqwHvA+0Lzu9e0txk8DjfqH1p9UJRw=="], "@shikijs/vscode-textmate": ["@shikijs/vscode-textmate@10.1.0", "", {}, "sha512-cVBuhDQjBZaNMTwBquYfPydrUP+E3hE6oYGasx8h6ZrODIM7/r+gxLDXdd66oszbrggZHEntdE6j+5gYIVyMWQ=="], @@ -150,6 +150,46 @@ "@types/unist": ["@types/unist@3.0.3", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="], + "@typescript/typescript-aix-ppc64": ["@typescript/typescript-aix-ppc64@7.0.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ=="], + + "@typescript/typescript-darwin-arm64": ["@typescript/typescript-darwin-arm64@7.0.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA=="], + + "@typescript/typescript-darwin-x64": ["@typescript/typescript-darwin-x64@7.0.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA=="], + + "@typescript/typescript-freebsd-arm64": ["@typescript/typescript-freebsd-arm64@7.0.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ=="], + + "@typescript/typescript-freebsd-x64": ["@typescript/typescript-freebsd-x64@7.0.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw=="], + + "@typescript/typescript-linux-arm": ["@typescript/typescript-linux-arm@7.0.2", "", { "os": "linux", "cpu": "arm" }, "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ=="], + + "@typescript/typescript-linux-arm64": ["@typescript/typescript-linux-arm64@7.0.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ=="], + + "@typescript/typescript-linux-loong64": ["@typescript/typescript-linux-loong64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ=="], + + "@typescript/typescript-linux-mips64el": ["@typescript/typescript-linux-mips64el@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA=="], + + "@typescript/typescript-linux-ppc64": ["@typescript/typescript-linux-ppc64@7.0.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA=="], + + "@typescript/typescript-linux-riscv64": ["@typescript/typescript-linux-riscv64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ=="], + + "@typescript/typescript-linux-s390x": ["@typescript/typescript-linux-s390x@7.0.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw=="], + + "@typescript/typescript-linux-x64": ["@typescript/typescript-linux-x64@7.0.2", "", { "os": "linux", "cpu": "x64" }, "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A=="], + + "@typescript/typescript-netbsd-arm64": ["@typescript/typescript-netbsd-arm64@7.0.2", "", { "os": "none", "cpu": "arm64" }, "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA=="], + + "@typescript/typescript-netbsd-x64": ["@typescript/typescript-netbsd-x64@7.0.2", "", { "os": "none", "cpu": "x64" }, "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA=="], + + "@typescript/typescript-openbsd-arm64": ["@typescript/typescript-openbsd-arm64@7.0.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ=="], + + "@typescript/typescript-openbsd-x64": ["@typescript/typescript-openbsd-x64@7.0.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg=="], + + "@typescript/typescript-sunos-x64": ["@typescript/typescript-sunos-x64@7.0.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g=="], + + "@typescript/typescript-win32-arm64": ["@typescript/typescript-win32-arm64@7.0.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ=="], + + "@typescript/typescript-win32-x64": ["@typescript/typescript-win32-x64@7.0.2", "", { "os": "win32", "cpu": "x64" }, "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g=="], + "@ungap/structured-clone": ["@ungap/structured-clone@1.4.0", "", {}, "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ=="], "ccount": ["ccount@2.0.1", "", {}, "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg=="], @@ -226,7 +266,7 @@ "trim-lines": ["trim-lines@3.0.1", "", {}, "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg=="], - "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + "typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="], "unist-util-is": ["unist-util-is@6.0.1", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g=="], diff --git a/webviews/review-diff/package.json b/webviews/review-diff/package.json index 01f4ece9e..1a7d53a55 100644 --- a/webviews/review-diff/package.json +++ b/webviews/review-diff/package.json @@ -8,10 +8,10 @@ "build": "tsc --noEmit && vite build" }, "dependencies": { - "@pierre/diffs": "1.5.2" + "@pierre/diffs": "1.6.4" }, "devDependencies": { - "typescript": "5.9.3", + "typescript": "7.0.2", "vite": "7.3.7" } } diff --git a/webviews/review-diff/src/main.ts b/webviews/review-diff/src/main.ts index 65ab16fe8..681b58e90 100644 --- a/webviews/review-diff/src/main.ts +++ b/webviews/review-diff/src/main.ts @@ -116,7 +116,7 @@ let generation = 0; function itemsFromPatch(patchText: string, cacheKey: string): CodeViewDiffItem[] { const items: CodeViewDiffItem[] = []; const seenIds = new Map(); - for (const patch of parsePatchFiles(patchText, cacheKey)) { + for (const patch of parsePatchFiles(patchText, { cacheKeyPrefix: cacheKey })) { for (const fileDiff of patch.files) { const filetype = getFiletypeFromFileName(fileDiff.name); if (!HIGHLIGHTED_LANGUAGE_IDS.has(filetype)) { diff --git a/webviews/review-diff/vite.config.mjs b/webviews/review-diff/vite.config.mjs index 0210b9c23..4eed0f7d3 100644 --- a/webviews/review-diff/vite.config.mjs +++ b/webviews/review-diff/vite.config.mjs @@ -4,6 +4,10 @@ import { HIGHLIGHTED_GRAMMAR_MODULES } from "./src/languages.ts"; const grammarModulePattern = /\/@shikijs\/langs\/dist\/([^/]+)\.mjs$/; const shikiThemeModulePattern = /\/@shikijs\/themes\/dist\/[^/]+\.mjs$/; +const workerOnlyModulePattern = + /\/@pierre\/diffs\/dist\/worker\/(worker|worker-portable|shiki-[^/]+|highlights-[^/]+|stream-tokenizer-[^/]+)\.js$/; +const mainThreadHighlightsBackendPattern = + /\/@pierre\/diffs\/dist\/highlighter\/(backends\/highlights|highlights-stream|highlights-editor)\.js$/; export default defineConfig({ define: { @@ -74,21 +78,22 @@ export default defineConfig({ return "preload-helper"; } // The worker entry keeps its own chunk so starting a worker does not - // evaluate the main-thread renderer. - if (id.endsWith("/@pierre/diffs/dist/worker/worker.js")) { + // evaluate the main-thread renderer. Its lazy highlighter backends import + // back into `worker.js`; inside `diff-vendor` they would drag the worker + // entry in with them. + if (workerOnlyModulePattern.test(id)) { return undefined; } - if (!id.includes("node_modules")) { + // The highlights backend (and its inlined wasm) only loads when it is the + // preferred highlighter. The viewer prefers shiki-wasm, so keep it lazy. + if (id.includes("/@pierre/highlights/")) { + return "pierre-highlights"; + } + if (mainThreadHighlightsBackendPattern.test(id)) { return undefined; } - if ( - id.includes("/shiki/") || - id.includes("/@shikijs/") || - id.includes("/oniguruma-parser/") || - id.includes("/oniguruma-to-es/") || - id.includes("/node_modules/diff/") - ) { - return "shiki-core"; + if (!id.includes("node_modules")) { + return undefined; } // Theming is shared by both threads; inside `diff-vendor` it would make // every worker evaluate the main-thread renderer. @@ -98,7 +103,11 @@ export default defineConfig({ if (id.includes("/@pierre/")) { return "diff-vendor"; } - return undefined; + // Every other third-party module (shiki, diff, the hast serializer + // shiki and Pierre both use) goes to `shiki-core`, which both threads + // load. Left unassigned, a module shared with Pierre lands in + // `diff-vendor` and `shiki-core` imports it back (a circular chunk). + return "shiki-core"; }, }, }, From 2d017fb365b2ad1213332e655422e175ff34b85f Mon Sep 17 00:00:00 2001 From: arzafran Date: Wed, 4 Nov 2026 19:40:17 -0300 Subject: [PATCH 2/2] ci: stop restoring DerivedData across Package.resolved changes (INC-493) A dependency bump restored the previous DerivedData, whose precompiled Sparkle module no longer matched the new headers, so build-app and the unit shards failed with "modified since the module file was built". Restore only from the same Package.resolved hash. --- .github/workflows/ci.yml | 2 -- .github/workflows/nightly-extended-tests.yml | 1 - 2 files changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9dd8a081..76a376982 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -396,7 +396,6 @@ jobs: key: deriveddata-build-app-macos26-${{ hashFiles('GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}-${{ hashFiles('GhosttyTabs.xcodeproj/project.pbxproj') }} restore-keys: | deriveddata-build-app-macos26-${{ hashFiles('GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}- - deriveddata-build-app-macos26- - name: Cache Swift packages uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 @@ -543,7 +542,6 @@ jobs: key: deriveddata-tests-macos26-shard${{ matrix.shard }}-${{ hashFiles('GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}-${{ hashFiles('GhosttyTabs.xcodeproj/project.pbxproj') }} restore-keys: | deriveddata-tests-macos26-shard${{ matrix.shard }}-${{ hashFiles('GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}- - deriveddata-tests-macos26-shard${{ matrix.shard }}- - name: Cache Swift packages uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 diff --git a/.github/workflows/nightly-extended-tests.yml b/.github/workflows/nightly-extended-tests.yml index 930c1c3b1..de743aa74 100644 --- a/.github/workflows/nightly-extended-tests.yml +++ b/.github/workflows/nightly-extended-tests.yml @@ -137,7 +137,6 @@ jobs: key: deriveddata-build-app-macos26-${{ hashFiles('GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}-${{ hashFiles('GhosttyTabs.xcodeproj/project.pbxproj') }} restore-keys: | deriveddata-build-app-macos26-${{ hashFiles('GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}- - deriveddata-build-app-macos26- - name: Cache Swift packages uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4