@shinsa/darwin-arm64 1.0.0-canary.63 → 1.0.0-canary.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/shinsa CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bin/shinsa
3
3
  size: 94495792 bytes
4
- sha256: d100469aad5cf68335c0997f68121cb290f7ae8a0cc9f2f9fc03d6a484e36eea
4
+ sha256: 0ddbdd0186b911a8b376fa02ac964c10afc5ebe1384af6e090efa25e74efa336
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shinsa/darwin-arm64",
3
- "version": "1.0.0-canary.63",
3
+ "version": "1.0.0-canary.65",
4
4
  "description": "The Shinsa engine for darwin arm64. Install shinsa rather than this package.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "homepage": "https://shinsa.dev",
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/loader-CGUuKGp-.js","assets/index-Bpei0VEJ.js","assets/index-CDRooW3F.css","assets/themes-BsWq6Nlx.js","assets/index-D2fX9oHN.js","assets/core-CS-N12zA.js","assets/highlights-DvbkyePu.js","assets/stream-tokenizer-BuSlLJ9O.js","assets/shiki-B9HWpnY0.js"])))=>i.map(i=>d[i]);
2
- import{_ as qe,a as _,j as $,g2 as ur,g3 as cr,g4 as hr,g5 as fr,g6 as pr,a4 as gr,g7 as mr,g8 as mn,g9 as vr}from"./index-Bpei0VEJ.js";import{t as Ut}from"./index-D2fX9oHN.js";const fi="diffs-container";(()=>{try{return!1}catch{return!1}})();const br=/(?=^From [a-f0-9]+ .+$)/m,pi=/(?=^diff --git)/gm,Sr=new RegExp("(?<=\\n)"),yr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Cr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,gi="header-prefix",mi="header-filename-suffix",vi="header-metadata",sn="header-custom",ge={dark:"pierre-dark",light:"pierre-light"},xr="data-theme-css",kr="data-unsafe-css",Lr="data-diffs-scrollbar-measure",bi="--diffs-scrollbar-gutter-measured",wr=1e5,Er={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},Rr=Object.freeze({fromStart:0,fromEnd:0}),vn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Si=Object.freeze([]),Ar={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};let Le,_t=0;var pt=class extends Error{constructor(){super("Highlighter is disposed"),this.name="HighlighterDisposedError"}};function Dr(){return Le}function an(e){return e??Le??"shiki-js"}function Tr(e){if(Le!=null&&Le!==e)throw new Error(`Cannot load the "${e}" highlighter while "${Le}" is in use. Only one highlighter type can be active at a time; dispose every "${Le}" instance (disposeHighlighter() disposes the shared one) before switching.`)}function Hr(e){Tr(e),Le=e,_t++}function Ir(){_t--,_t===0&&(Le=void 0)}const yd=new Map,Cd=new Map,xd=new Map,Mr=new Set;function ln(e=ge){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Fr(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function dn(e){let t;return()=>t??=e().then(n=>(t=n,n),n=>{throw t=void 0,n})}function Pr(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Nr=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},bn=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},zr=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Or(e={}){const t=new Map,n=new Map,i=new Map;let r=0;function o(m,S){if(t.has(m))throw new Nr(m);t.set(m,S)}function a(m,S){return t.has(m)?!1:(t.set(m,S),!0)}function l(m){return t.has(m)}function s(m){const S=n.get(m);if(S!==void 0)return Promise.resolve(S);const C=i.get(m);if(C!==void 0)return C;const y=t.get(m);if(y===void 0&&e.fallbackLoader===void 0)return Promise.reject(new bn(m));const x=r,k=Promise.resolve().then(()=>y!==void 0?y():e.fallbackLoader?.(m)).then(async E=>{if(E===void 0)throw new bn(m);const w=Pr(E),D=e.normalizeTheme===void 0?w:await e.normalizeTheme(w,m);return x===r&&n.set(m,D),i.get(m)===k&&i.delete(m),D}).catch(E=>{throw i.get(m)===k&&i.delete(m),E});return i.set(m,k),k}function u(m){return Promise.all(m.map(S=>s(S)))}function d(m,S){n.set(m,S)}function c(m){for(const[S,C]of m)d(S,C)}function f(m){return n.get(m)}function h(m){const S=[];for(const C of m){const y=n.get(C);if(y===void 0)throw new zr(C);S.push(y)}return S}function g(m){return n.has(m)}function p(m){for(const S of m)if(!n.has(S))return!1;return!0}function v(m){const S=n.get(m);return S!==void 0?S:s(m)}function b(){r++,n.clear(),i.clear()}return{clearResolvedThemes:b,getResolvedOrResolveTheme:v,getResolvedTheme:f,getResolvedThemes:h,hasRegisteredTheme:l,hasResolvedTheme:g,hasResolvedThemes:p,registerTheme:o,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:u,seedResolvedTheme:d,seedResolvedThemes:c}}const Bt=new Map,Sn=new Map,Ur=dn(()=>qe(()=>import("./loader-CGUuKGp-.js"),__vite__mapDeps([0,1,2]))),_r=dn(()=>qe(()=>import("./themes-BsWq6Nlx.js"),__vite__mapDeps([3,1,2,4]))),Br=dn(()=>qe(()=>import("./core-CS-N12zA.js").then(e=>e.M),__vite__mapDeps([5,4,1,2]))),$r=[["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 yn(e,t){const n="themes"in t?t.themes[0]:t;if(n==null)throw new Error(`Theme "${e}" is an empty Zed theme family.`);const i={...n,name:e},r={};for(const[l,s]of Object.entries(i.style))typeof s=="string"&&(r[l]=s);const o=i.style.players?.[0];o?.cursor!=null&&(r["editorCursor.foreground"]??=o.cursor),o?.selection!=null&&(r["editor.selectionBackground"]??=o.selection);for(const[l,...s]of $r){if(r[l]!=null)continue;const u=s.find(d=>r[d]!=null);u!=null&&(r[l]=r[u])}if(i.cssVariables===!0)r["editor.foreground"]="var(--hls-foreground)",r["editor.background"]="var(--hls-background)";else if(typeof i.cssVariables=="object"){r["editor.foreground"]??=r.text??r.foreground??"foreground",r["editor.background"]??=r.background??"background";const{prefix:l="--hls-",defaults:s}=i.cssVariables;for(const[u,d]of Object.entries(r)){const c=s?.[d];r[u]=`var(${l}${d}${c?`, ${c}`:""})`}}const a=i.appearance==="light"?"light":"dark";return{name:e,type:a,colors:r,zed:i,fg:r["editor.foreground"]??r.text??r.foreground??(a==="light"?"#333333":"#bbbbbb"),bg:r["editor.background"]??r.background??(a==="light"?"#ffffff":"#1e1e1e")}}function Wr(e){let t=Sn.get(e);return t!=null||(t=Or({fallbackLoader:async n=>{if(typeof __DIFFS_WORKER__<"u"?__DIFFS_WORKER__:Fr())throw new Error(`Theme "${n}" 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=Bt.get(n);if(e==="highlights"){const r=i?.zed??i?.diffs;if(r!=null){const s=await r(),u="default"in s?s.default:s;if("zed"in u&&u.zed!=null)return u;if("style"in u||"themes"in u)return yn(n,u);throw new Error(`Theme "${n}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`)}const o=Ur(),{themes:a}=o instanceof Promise?await o:o,l=a[n];if(l!=null)return yn(n,(await l()).default);if(i?.textmate!=null)throw new Error(`Theme "${n}" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`)}else{const r=i?.textmate??i?.diffs;let o;if(r!=null){const d=await r();o="default"in d?d.default:d}else{const d=_r(),{themes:c}=d instanceof Promise?await d:d,f=c.getTheme(n);if(f==null&&i?.zed!=null)throw new Error(`Theme "${n}" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`);if(f==null)throw new Error(`No valid theme loader registered for "${n}"`);const h=await f.load();o="default"in h?h.default:h}if("style"in o||"themes"in o)throw new Error(`Theme "${n}" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`);const a=Br(),{normalizeTheme:l,createCssVariablesTheme:s}=a instanceof Promise?await a:a;if("cssVariables"in o&&o.cssVariables!=null)return{...o,textmate:l(s(o.cssVariables))};if("textmate"in o&&o.textmate!=null)return{...o,textmate:l(o.textmate)};const u=l(o);return{name:u.name,type:u.type,fg:u.fg,bg:u.bg,colors:u.colors,textmate:u}}throw new Error(`No valid theme loader registered for "${n}"`)},normalizeTheme:(n,i)=>{if(n.name!==i)throw new Error(`resolvedTheme: themeName: ${i} does not match theme.name: ${n.name}`);return n}}),Sn.set(e,t)),t}function $t(e,t=an()){return typeof t!="string"&&t.isDisposed?!1:(typeof t=="string"?Wr(t):t.themeResolver).hasResolvedThemes(ln(e))}let oe;async function Vr(e){const t=an(e);Hr(t);try{if(t==="highlights"){const{HighlightsHighlighter:i}=await qe(async()=>{const{HighlightsHighlighter:r}=await import("./highlights-DvbkyePu.js");return{HighlightsHighlighter:r}},__vite__mapDeps([6,7,1,2,4]));return new i}const{ShikiHighlighter:n}=await qe(async()=>{const{ShikiHighlighter:i}=await import("./shiki-B9HWpnY0.js");return{ShikiHighlighter:i}},__vite__mapDeps([8,1,2,7,5,4]));return await n.create(t)}finally{Ir()}}async function un({themes:e,langs:t,preferredHighlighter:n}){yi();const i=oe??=Vr(Dr()??n);let r;try{r=await i}catch(o){throw oe===i&&(oe=void 0),o}if(oe===i&&(oe=r),await Promise.all([r.themeResolver.resolveThemes(e),r.loadLanguages(t)]),r.isDisposed)throw new pt;return r}function yi(){oe!=null&&!("then"in oe)&&oe.isDisposed&&(oe=void 0)}function Ne({theme:e,lang:t,langs:n}={}){yi();const i=oe;if(!(i==null||"then"in i||e!=null&&!$t(e,i)||(t!=null||n!=null)&&!i.hasLoadedLanguages([...t!=null?[t]:[],...n??[]])))return i}async function jr(e){await un(e)}const Oe=new Set;let Ue=null;function Ci(e){Oe.add(e),Ue??=requestAnimationFrame(xi)}function Wt(e){Oe.delete(e)&&Oe.size===0&&Ue!=null&&(cancelAnimationFrame(Ue),Ue=null)}function xi(e){const t=new Set(Oe);Oe.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Oe.size>0?Ue=requestAnimationFrame(xi):Ue=null}function Vt(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const a of r)if(o.delete(a),!i.has(a)&&(!(a in t)||e[a]!==t[a]))return!1;for(const a of Array.from(o))if(!i.has(a))return!1;return!0}function cn(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ki(e,t){const n=e?.theme??ge,i=t?.theme??ge,r=Cn(e),o=Cn(t);return cn(n,i)&&Vt(e,t,["theme","parseDiffOptions"])&&Vt(r,o)}function Cn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function jt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function se(e){return{type:"text",value:e}}function M({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function gt({name:e,width:t=16,height:n=16,properties:i}){return M({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[M({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function Ye(e){return M({tagName:"div",properties:{"data-gutter":""},children:e})}function Gr(e,t,n,i={}){return M({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[M({tagName:"span",properties:{"data-line-number-content":""},children:[se(`${t}`)]})]:void 0})}function ee(e,t,n){return M({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function qr(){return M({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[gt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}const Kr=new Set(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"]),Xr=new Set(["svg","template","script","style"]),Yr={class:"class",className:"class",id:"id",role:"role",style:"style",tabIndex:"tabindex",tabindex:"tabindex",title:"title"},Zr=/^data-[\w.:-]+$/,Jr=/[<&]/g,Qr=/[\0"&'`]/g,eo={"<":"&#x3C;","&":"&#x26;",'"':"&#x22;","'":"&#x27;","`":"&#x60;","\0":"&#x0;"},to=256;function we(e){const t=new Map;return Array.isArray(e)?hn(e,t):Li(e,t)}function hn(e,t){let n="";for(const i of e)n+=Li(i,t);return n}function Li(e,t){switch(e.type){case"text":return Ei(e.value);case"element":return no(e,t);case"root":return hn(e.children,t);default:return Ut(e)}}function no(e,t){const{tagName:n}=e;if(n==="span"&&e.children.length===1&&e.children[0].type==="text"&&typeof e.properties?.style=="string"){let a=!0;for(const l in e.properties)if(l!=="style"&&e.properties[l]!=null){a=!1;break}if(a)return`<span ${wi(e.properties.style,t)}>${Ei(e.children[0].value)}</span>`}if(Xr.has(n))return Ut(e);const i=io(e.properties,t);if(i==null)return Ut(e);const r=i===""?`<${n}>`:`<${n} ${i}>`,o=hn(e.children,t);return o===""&&Kr.has(n.toLowerCase())?r:`${r}${o}</${n}>`}function wi(e,t){let n=t.get(e);return n==null&&(n=`style="${Ri(e)}"`,t.size<to&&t.set(e,n)),n}function io(e,t){let n="";for(const i in e){const r=e[i];if(r==null)continue;const o=Yr[i]??(Zr.test(i)?i:void 0);if(o==null)return;if(r===!1||typeof r=="number"&&Number.isNaN(r))continue;const a=i==="style"&&typeof r=="string"?wi(r,t):r===!0?o:`${o}="${Ri(Array.isArray(r)?r.join(" ").trim():String(r))}"`;n+=n===""?a:` ${a}`}return n}function Ei(e){return e.indexOf("<")<0&&e.indexOf("&")<0?e:e.replace(Jr,Ai)}function Ri(e){return e.replace(Qr,Ai)}function Ai(e){return eo[e]}function ro(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Ze(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 oo=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(),Wt(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){const n=!(e===this.selectedRange||jt(e??void 0,this.selectedRange??void 0)),i=t?.lineNumberOnly??!1,r=t?.activeLineSide!==this.selectedRangeHighlightSide||i!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!r||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=i,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){const i=e!==this.editorActiveLine,r=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!i&&!r||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&Ze(e.composedPath())||(ue(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:a=!1}=this.options;t==="disabled"&&!a&&n==null&&i==null&&r==null&&o==null||(ue(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(ue(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){ue(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();ue(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);ue(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:a,onLineEnter:l,onLineLeave:s,onTokenClick:u,onTokenEnter:d,onTokenLeave:c,onHunkExpand:f,onMergeConflictActionClick:h}=this.options;switch(e){case"move":{const g=kt(r)&&this.hoveredLine?.lineElement===r.lineElement;ut(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ut(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),d?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(s?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),kt(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(lo(r)&&h!=null){h(r);break}if(ao(r)&&f!=null){f(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!kt(r))break;ut(r)&&u!=null&&u(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);a!=null&&r.numberColumn?a({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:a,onTokenClick:l,onTokenEnter:s,onTokenLeave:u,onHunkExpand:d,onMergeConflictActionClick:c,enableGutterUtility:f=!1,enableLineSelection:h=!1,onGutterUtilityClick:g}=this.options,p=g!=null,v=n!=="disabled"||i!=null||r!=null||o!=null||a!=null||l!=null||s!=null||u!=null||d!=null||c!=null||f||h||p;v&&!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,ue(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const S=[];return(t==="both"||t==="click")&&(i!=null&&S.push("onLineClick"),r!=null&&S.push("onLineNumberClick"),d!=null&&S.push("expandable hunk separators"),c!=null&&S.push("merge conflict actions")),S})()),ue(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),ue(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!v&&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 b=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",m=this.pointerSession.mode==="gutterSelecting";(!h&&b||!p&&m)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();Ze(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:a}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const s=l.start<=l.end?a>=l.start:a<=l.end;this.selectionAnchor={lineNumber:s?this.selectedRange.start:this.selectedRange.end,side:s?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{onGutterUtilityClick:t}=this.options;if(t==null)return;const n=this.currentSelectionEnds(),i=n?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),r=n?.top??i;i==null||r==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:r,current:i},this.selectionAnchor={lineNumber:r.lineNumber,side:r.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;const n={lineNumber:t.lineNumber,side:t.eventSide};if(ro(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{const{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(n.current=i,this.updateSelection(i.lineNumber,i.side));const r=this.buildSelectedLineRange(n.anchor,n.current);t?.({...r}),this.selectionAnchor=void 0,this.notifySelectionEnd(r),this.notifySelectionCommitted(r),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=we(qr());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);We(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(_e(r));if(We(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(We(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(We(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Ze(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=_e(e);if(t&&Ze(n))return;const i=co(e);return i!=null?_e(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=ho(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute("data-line")||t.hasAttribute("data-column-number")))return _e(t);const n=po(fo(e));if(n==null)return;const i=this.targetForSelectionPoint(n);return i!=null?_e(i.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=Ln(t)?t:Ln(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,a=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(a,e,o,t)}jt(i??void 0,r??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,Ci(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;const i=this.getIndexesFromSelection(e.range,t);if(i==null)throw console.error({rowRange:i,range:e.range}),new Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return i}getLineRenderColumns(e,t,n,i){if(this.pre==null||t==null&&i==null)return[];const{children:r}=this.pre;if(r.length>2)throw console.error(r),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const o=[];for(const a of r){const l=a.hasAttribute("data-deletions")?"deletions":a.hasAttribute("data-additions")?"additions":void 0,s=e!=null&&t!=null&&(e.highlightSide==null||l==null||e.highlightSide===l),u=n!=null&&i!=null&&(n.highlightSide==null||l==null||n.highlightSide===l);if(!s&&!u)continue;const[d,c]=a.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");o.push({content:c,gutter:d,renderEditorActiveLine:u,renderSelectedLines:s})}return o}renderSelection=()=>{Wt(this.renderSelection);const e=this.getSelectionRenderState();if(this.pre==null)return;const{editorActiveLine:t,selectedLines:n}=e,i=!wn(this.renderedSelectedLinesState,n),r=!wn(this.renderedEditorActiveLineState,t);if(!i&&!r)return;i&&(this.renderedSelectedLinesState=void 0),r&&(this.renderedEditorActiveLineState=void 0);const o=this.pre.getAttribute("data-diff-type")==="split",a=i?this.resolveLineRenderRange(n,o,"selected-lines"):void 0,l=r?this.resolveLineRenderRange(t,o,"editor-active-line"):void 0,s=this.getLineRenderColumns(i?n:void 0,a,r?t:void 0,l),u=n.range==null||s.some(p=>p.renderSelectedLines),d=t.range==null||s.some(p=>p.renderEditorActiveLine);if(i)for(const p of this.pre.querySelectorAll("[data-selected-line]"))p.removeAttribute("data-selected-line");if(r)for(const p of this.pre.querySelectorAll("[data-editor-active-line]"))p.removeAttribute("data-editor-active-line");const c=a==null?void 0:Math.min(a.start,a.end),f=a==null?void 0:Math.max(a.start,a.end),h=c===f,g=l?.start;for(const p of s){const{content:v,gutter:b,renderEditorActiveLine:m,renderSelectedLines:S}=p,C=Math.max(S?f??-1/0:-1/0,m?g??-1/0:-1/0),y=v.children.length;for(let x=0;x<y;x++){const k=v.children[x],E=b.children[x];if(!(k instanceof HTMLElement)||!(E instanceof HTMLElement))continue;const w=this.parseLineIndex(k,o);if((w??0)>C)break;if(w!=null){if(S&&c!=null&&f!=null&&w>=c&&w<=f){let D=h?"single":w===c?"first":w===f?"last":"";E.setAttribute("data-selected-line",D),n.lineNumberOnly||(k.setAttribute("data-selected-line",D),E.nextSibling instanceof HTMLElement&&k.nextSibling instanceof HTMLElement&&(k.nextSibling.hasAttribute("data-line-annotation")||k.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(h?(D="last",k.setAttribute("data-selected-line","first")):w===c?D="":w===f&&k.setAttribute("data-selected-line",""),k.nextSibling.setAttribute("data-selected-line",D),E.nextSibling.setAttribute("data-selected-line",D)))}m&&w===g&&(E.setAttribute("data-editor-active-line",""),t.lineNumberOnly||k.setAttribute("data-editor-active-line",""))}}}i&&u&&(this.renderedSelectedLinesState=n),r&&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:n,side:i,tokenElement:r,tokenText:o}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:r,tokenText:o}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...n!=null?{side:n}:{},...n!==i&&i!=null?{endSide:i}:{}}}resolvePointerTarget(e){let t=!1,n,i,r,o,a,l,s,u,d,c;for(const h of e){if(!(h instanceof HTMLElement))continue;if(c==null&&h.hasAttribute("data-merge-conflict-action")){const b=h.getAttribute("data-merge-conflict-action")??void 0,m=h.getAttribute("data-merge-conflict-conflict-index")??void 0,S=m!=null?Number.parseInt(m,10):NaN;uo(b)&&Number.isFinite(S)&&(c={kind:"merge-conflict-action",resolution:b,conflictIndex:S})}if(l==null&&h.hasAttribute("data-char")){l=h;const b=h.getAttribute("data-char");if(b!=null){const m=Number.parseInt(b,10);if(!Number.isNaN(m)){const S=h.textContent??"",C=m+S.length;(S.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(s={tokenElement:l,lineCharStart:m,lineCharEnd:C,tokenText:S});continue}}}const g=a==null?h.getAttribute("data-column-number")??void 0:void 0;if(g!=null){a=h,d=Number.parseInt(g,10),t=!0,n=Rn(h),o=h.getAttribute("data-line-index")??void 0;continue}const p=r==null?h.getAttribute("data-line")??void 0:void 0;if(p!=null){r=h,d=Number.parseInt(p,10),n=Rn(h),o=h.getAttribute("data-line-index")??void 0;continue}if(u==null&&(h.hasAttribute("data-expand-button")||h.hasAttribute("data-unmodified-lines"))){u={hunkIndex:void 0,direction:h.hasAttribute("data-expand-up")?"up":h.hasAttribute("data-expand-down")?"down":"both",all:h.hasAttribute("data-expand-all-button")};continue}const v=u!=null?h.getAttribute("data-expand-index")??void 0:void 0;if(u!=null&&v!=null){const b=Number.parseInt(v,10);Number.isNaN(b)||(u.hunkIndex=b);continue}if(i==null&&h.hasAttribute("data-code")){i=h;break}}if(c!=null)return c;if(u?.hunkIndex!=null)return{type:"line-info",hunkIndex:u.hunkIndex,direction:u.direction,all:u.all};if(r??=o!=null?kn(i,`[data-line][data-line-index="${o}"]`):void 0,a??=o!=null?kn(i,`[data-column-number][data-line-index="${o}"]`):void 0,i==null||r==null||a==null||n==null||d==null||Number.isNaN(d))return;const f=this.parseLineIndex(r,this.isSplitDiff());return s!=null?this.mode==="file"?{kind:"token",lineType:n,lineElement:r,lineNumber:d,numberColumn:t,numberElement:a,side:void 0,splitLineIndex:f,...s}:{kind:"token",lineType:n,lineElement:r,lineNumber:d,numberColumn:t,numberElement:a,side:En(n,i),splitLineIndex:f,...s}:this.mode==="file"?{kind:"line",lineType:n,lineElement:r,lineNumber:d,numberColumn:t,numberElement:a,side:void 0,splitLineIndex:f}:{kind:"line",lineType:n,lineElement:r,lineNumber:d,numberColumn:t,numberElement:a,side:En(n,i),splitLineIndex:f}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const n=(e.getAttribute("data-line-index")??"").split(",").map(i=>Number.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function xn({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:a,onLineNumberClick:l,onTokenClick:s,onTokenEnter:u,onTokenLeave:d,renderGutterUtility:c,__debugPointerEvents:f,enableLineSelection:h,controlledSelection:g,onLineSelected:p,onLineSelectionStart:v,onLineSelectionChange:b,onLineSelectionEnd:m},S,C,y){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:so({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:S,onMergeConflictActionClick:y,onLineClick:r,onLineEnter:o,onLineLeave:a,onLineNumberClick:l,onTokenClick:s,onTokenEnter:u,onTokenLeave:d,__debugPointerEvents:f,enableLineSelection:h,controlledSelection:g,onLineSelected:p,onLineSelectionStart:v,onLineSelectionChange:b,onLineSelectionEnd:m,getLineIndex:C}}function so({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function We(e){return e!=null&&"kind"in e&&e.kind==="line"}function ut(e){return e!=null&&"kind"in e&&e.kind==="token"}function kt(e){return We(e)||ut(e)}function ao(e){return"type"in e&&e.type==="line-info"}function lo(e){return"kind"in e&&e.kind==="merge-conflict-action"}function uo(e){return e==="current"||e==="incoming"||e==="both"}function kn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function _e(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function co(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function ho(e){const t=e.closest('[slot^="annotation-"]'),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName==="SLOT"?e:void 0)?.closest("[data-line-annotation]");return n instanceof HTMLElement?n:void 0}function fo(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function po(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function Ln(e){return e!=null&&typeof e.elementFromPoint=="function"}function go(e,t){return e===t||jt(e??void 0,t??void 0)}function wn(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&go(e?.range??null,t.range)}function En(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function Rn(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 ue(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return}console.log(...n)}var mo=class fe{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=fe.resizeObserver??new ResizeObserver(fe.handleSharedResizeEntries);return fe.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=fe.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,{disableAnnotations:n,columnVariables:i="apply"}){const r=new Set,o=i==="apply";let a=0;const l=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(a===2)break;const u=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(u==null)continue;a++;let d=l.get(u);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=u.firstElementChild;c instanceof HTMLElement||(c=null),d!=null?(this.observedNodes.set(u,d),l.delete(u),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,So(d,o)):(d={type:"code",codeElement:u,numberElement:c,codeWidth:"auto",numberWidth:0,applyColumnVariables:o},this.observedNodes.set(u,d),this.observe(u),c!=null&&(this.observedNodes.set(c,d),this.observe(c)))}if(a>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),u=new Map;for(const d of s){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 f=u.get(c);f==null&&(f=[],u.set(c,f)),f.push(d)}for(const[d,c]of u){if(c.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",d,c);continue}const[f,h]=c,g=f.firstElementChild,p=h.firstElementChild;if(!(f instanceof HTMLElement)||!(h instanceof HTMLElement)||!(g instanceof HTMLElement)||!(p instanceof HTMLElement))continue;let v=l.get(g);if(v!=null){this.observedNodes.set(g,v),this.observedNodes.set(p,v),l.delete(g),l.delete(p);continue}const b=g.getBoundingClientRect().height,m=p.getBoundingClientRect().height;v={type:"annotations",column1:{container:f,child:g,childHeight:b},column2:{container:h,child:p,childHeight:m},currentHeight:"auto"},r.add({child1:g,child2:p,item:v,newHeight:Math.max(b,m)})}for(const d of r)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);r.clear()}for(const[s,u]of l)this.unobserve(s),u.type==="code"?yo(u):Co(u);l.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=fe,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),fe.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=fe,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),fe.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:a,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const s=this.observedNodes.get(o);if(s==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(s.type==="annotations"){const u=(()=>{if(o===s.column1.child)return s.column1;if(o===s.column2.child)return s.column2})();if(u==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:s,target:o});continue}u.childHeight=a[0].blockSize,i.add(s)}else if(s.type==="code"){const u=n.get(s)??{},d=l[0].inlineSize;o===s.codeElement?u.codeInlineSize=d:o===s.numberElement&&(u.numberInlineSize=d),n.set(s,u)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?vo(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?bo(i.numberInlineSize):n.numberWidth,a=r!==n.codeWidth,l=o!==n.numberWidth;!a&&!l||(n.codeWidth=r,n.numberWidth=o,n.applyColumnVariables&&Di(n,{codeWidthChanged:a,numberWidthChanged:l}))}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function vo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function bo(e){return Math.max(Math.ceil(e),0)}function So(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?Di(e,{codeWidthChanged:!0,numberWidthChanged:!0}):Ti(e))}function Di(e,{codeWidthChanged:t,numberWidthChanged:n}){const{codeElement:i,codeWidth:r,numberWidth:o}=e;if(t&&i.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),n&&i.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),t||n&&r!=="auto"){const a=typeof r=="number"?Math.max(r-o,0):0;i.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}function Ti(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 yo(e){e.codeElement.isConnected&&Ti(e)}function Co(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 An(e,t){const n=Array.isArray(e)?e:[e];return t!=null?t.hasLoadedLanguages(n):n.every(i=>i==="text"||i==="ansi"||Mr.has(i))}function Hi(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 xo(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 ko(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 Lo({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return M({tagName:"div",children:[t==="custom"?M({tagName:"slot",properties:{name:sn}}):wo({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Eo(i)]],properties:r})}function wo({name:e,prevName:t,iconType:n}){const i=[M({tagName:"slot",properties:{name:gi}}),gt({name:ko(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(M({tagName:"div",children:[M({tagName:"bdi",children:[se(t)]})],properties:{"data-prev-name":""}})),i.push(gt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(M({tagName:"div",children:[M({tagName:"bdi",children:[se(e)]})],properties:{"data-title":""}})),i.push(M({tagName:"slot",properties:{name:mi}})),M({tagName:"div",children:i,properties:{"data-header-content":""}})}function Eo(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(M({tagName:"span",children:[se(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(M({tagName:"span",children:[se(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(M({tagName:"slot",properties:{name:vi}})),M({tagName:"div",children:t,properties:{"data-metadata":""}})}function Ro(e){return M({tagName:"pre",properties:Ao(e)})}function Ao({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:a,customProperties:l}){return{...l,"data-diff":a==="diff"?"":void 0,"data-file":a==="file"?"":void 0,"data-diff-type":a==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const Me=new Map,Fe={"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 ae(e){const t=Dn(e);if(t!=null)return t;const n=e.split(/[/\\]/).pop()??e;return n===e?"text":Dn(n)??"text"}function Dn(e){if(Me.has(e))return Me.get(e)??"text";if(Object.hasOwn(Fe,e))return Fe[e]??null;const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Me.has(t[1]))return Me.get(t[1])??"text";if(Object.hasOwn(Fe,t[1]))return Fe[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Me.has(n)?Me.get(n)??"text":Object.hasOwn(Fe,n)?Fe[n]??"text":null}function Do(e,{theme:t,preferredHighlighter:n}){return{langs:Array.isArray(e)?e:[e??"text"],themes:ln(t),preferredHighlighter:an(n)}}function Te(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function Gt(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function te(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const To=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Ho=/^0(?:\.0+)?%?$/;function Io(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const r=i.lastIndexOf("/");if(r!==-1)return i.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const o=i.split(",");if(o.length===4)return o[3]?.trim()}}function Mo(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let i,r=1;return n.length===3?i=n.split("").map(o=>o+o).join(""):n.length===6?i=n:(i=n.slice(0,6),r=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),r]}function Lt(e){if(e==null)return null;const t=Mo(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,r=t[2]/255,o=a=>a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(i)+.0722*o(r)}function Tn(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||To.test(t))return!0;const n=Io(t);return n!=null&&Ho.test(n)}function Fo(e,t,n){if(t==null||n==null)return!1;const i=Lt(e),r=Lt(t),o=Lt(n);return i==null||r==null||o==null?!1:Math.abs(i-o)<Math.abs(i-r)}const Hn=new WeakMap;function Po(e){const t=Hn.get(e);if(t!=null)return t;const n=e.colors??{},i={...n},r=n["editor.background"]??e.bg,o=n["editor.foreground"]??e.fg,a=n["sideBar.background"]??r,l=n["sideBar.foreground"]??o;re(i,"editor.background",r),re(i,"editor.foreground",o),re(i,"sideBar.background",a),re(i,"sideBar.foreground",l),re(i,"input.background",n["input.background"]??a),re(i,"sideBarSectionHeader.foreground",n["sideBarSectionHeader.foreground"]??l),re(i,"list.activeSelectionForeground",n["list.activeSelectionForeground"]??l),re(i,"gitDecoration.addedResourceForeground",wt(n["gitDecoration.addedResourceForeground"],n["terminal.ansiGreen"],n["editorGutter.addedBackground"])),re(i,"gitDecoration.modifiedResourceForeground",wt(n["gitDecoration.modifiedResourceForeground"],n["terminal.ansiBlue"],n["editorGutter.modifiedBackground"])),re(i,"gitDecoration.deletedResourceForeground",wt(n["gitDecoration.deletedResourceForeground"],n["terminal.ansiRed"],n["editorGutter.deletedBackground"]));const s=(Tn(n["list.focusOutline"])?void 0:n["list.focusOutline"])??(Tn(n.focusBorder)?void 0:n.focusBorder);s!=null?i["list.focusOutline"]=s:delete i["list.focusOutline"];const u=n["list.hoverBackground"];u!=null&&(No(u,a)||Fo(u,a,l))&&delete i["list.hoverBackground"];const d=Object.freeze({...e,colors:Object.freeze(i)});return Hn.set(e,d),d}function re(e,t,n){n!=null&&n!==""&&(e[t]=n)}function wt(...e){for(const t of e)if(t!=null&&t!=="")return t}function No(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function zo({theme:e=ge,highlighter:t,prefix:n}){let i="";if(typeof e=="string"){const r=t.getTheme(e),o=Et(r,t);i+=`color:${o.fg};`,i+=`background-color:${o.bg};`,i+=`${te("global")}fg:${o.fg};`,i+=`${te("global")}bg:${o.bg};`,i+=Rt(r,n)}else{let r=t.getTheme(e.dark),o=Et(r,t);i+=`${te("global")}dark:${o.fg};`,i+=`${te("global")}dark-bg:${o.bg};`,i+=Rt(r,"dark"),r=t.getTheme(e.light),o=Et(r,t),i+=`${te("global")}light:${o.fg};`,i+=`${te("global")}light-bg:${o.bg};`,i+=Rt(r,"light")}return i}function Et(e,t){if(t.name==="highlights"&&e.zed?.cssVariables===!0){const n=te("token");return{fg:`var(${n}foreground)`,bg:`var(${n}background)`}}return Po(e)}function Rt(e,t){t=t!=null?`${t}-`:"";let n="";const i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];i!=null&&(n+=`${te("global")}${t}addition-color:${i};`);const r=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];r!=null&&(n+=`${te("global")}${t}deletion-color:${r};`);const o=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return o!=null&&(n+=`${te("global")}${t}modified-color:${o};`),n}function Oo(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(se(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/loader-B0k4m_RU.js","assets/index-G40HCr6c.js","assets/index-CDRooW3F.css","assets/themes-CZFvVd62.js","assets/index-DTT9hs3o.js","assets/core-BuUwdFD1.js","assets/highlights-BNmyg0mo.js","assets/stream-tokenizer-yVQRbc4f.js","assets/shiki-Bu6w0lug.js"])))=>i.map(i=>d[i]);
2
+ import{_ as qe,a as _,j as $,g4 as ur,g5 as cr,g6 as hr,g7 as fr,g8 as pr,a4 as gr,g9 as mr,ga as mn,gb as vr}from"./index-G40HCr6c.js";import{t as Ut}from"./index-DTT9hs3o.js";const fi="diffs-container";(()=>{try{return!1}catch{return!1}})();const br=/(?=^From [a-f0-9]+ .+$)/m,pi=/(?=^diff --git)/gm,Sr=new RegExp("(?<=\\n)"),yr=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Cr=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,gi="header-prefix",mi="header-filename-suffix",vi="header-metadata",sn="header-custom",ge={dark:"pierre-dark",light:"pierre-light"},xr="data-theme-css",kr="data-unsafe-css",Lr="data-diffs-scrollbar-measure",bi="--diffs-scrollbar-gutter-measured",wr=1e5,Er={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},Rr=Object.freeze({fromStart:0,fromEnd:0}),vn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Si=Object.freeze([]),Ar={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};let Le,_t=0;var pt=class extends Error{constructor(){super("Highlighter is disposed"),this.name="HighlighterDisposedError"}};function Dr(){return Le}function an(e){return e??Le??"shiki-js"}function Tr(e){if(Le!=null&&Le!==e)throw new Error(`Cannot load the "${e}" highlighter while "${Le}" is in use. Only one highlighter type can be active at a time; dispose every "${Le}" instance (disposeHighlighter() disposes the shared one) before switching.`)}function Hr(e){Tr(e),Le=e,_t++}function Ir(){_t--,_t===0&&(Le=void 0)}const yd=new Map,Cd=new Map,xd=new Map,Mr=new Set;function ln(e=ge){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Fr(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function dn(e){let t;return()=>t??=e().then(n=>(t=n,n),n=>{throw t=void 0,n})}function Pr(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Nr=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},bn=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},zr=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Or(e={}){const t=new Map,n=new Map,i=new Map;let r=0;function o(m,S){if(t.has(m))throw new Nr(m);t.set(m,S)}function a(m,S){return t.has(m)?!1:(t.set(m,S),!0)}function l(m){return t.has(m)}function s(m){const S=n.get(m);if(S!==void 0)return Promise.resolve(S);const C=i.get(m);if(C!==void 0)return C;const y=t.get(m);if(y===void 0&&e.fallbackLoader===void 0)return Promise.reject(new bn(m));const x=r,k=Promise.resolve().then(()=>y!==void 0?y():e.fallbackLoader?.(m)).then(async E=>{if(E===void 0)throw new bn(m);const w=Pr(E),D=e.normalizeTheme===void 0?w:await e.normalizeTheme(w,m);return x===r&&n.set(m,D),i.get(m)===k&&i.delete(m),D}).catch(E=>{throw i.get(m)===k&&i.delete(m),E});return i.set(m,k),k}function u(m){return Promise.all(m.map(S=>s(S)))}function d(m,S){n.set(m,S)}function c(m){for(const[S,C]of m)d(S,C)}function f(m){return n.get(m)}function h(m){const S=[];for(const C of m){const y=n.get(C);if(y===void 0)throw new zr(C);S.push(y)}return S}function g(m){return n.has(m)}function p(m){for(const S of m)if(!n.has(S))return!1;return!0}function v(m){const S=n.get(m);return S!==void 0?S:s(m)}function b(){r++,n.clear(),i.clear()}return{clearResolvedThemes:b,getResolvedOrResolveTheme:v,getResolvedTheme:f,getResolvedThemes:h,hasRegisteredTheme:l,hasResolvedTheme:g,hasResolvedThemes:p,registerTheme:o,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:u,seedResolvedTheme:d,seedResolvedThemes:c}}const Bt=new Map,Sn=new Map,Ur=dn(()=>qe(()=>import("./loader-B0k4m_RU.js"),__vite__mapDeps([0,1,2]))),_r=dn(()=>qe(()=>import("./themes-CZFvVd62.js"),__vite__mapDeps([3,1,2,4]))),Br=dn(()=>qe(()=>import("./core-BuUwdFD1.js").then(e=>e.M),__vite__mapDeps([5,4,1,2]))),$r=[["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 yn(e,t){const n="themes"in t?t.themes[0]:t;if(n==null)throw new Error(`Theme "${e}" is an empty Zed theme family.`);const i={...n,name:e},r={};for(const[l,s]of Object.entries(i.style))typeof s=="string"&&(r[l]=s);const o=i.style.players?.[0];o?.cursor!=null&&(r["editorCursor.foreground"]??=o.cursor),o?.selection!=null&&(r["editor.selectionBackground"]??=o.selection);for(const[l,...s]of $r){if(r[l]!=null)continue;const u=s.find(d=>r[d]!=null);u!=null&&(r[l]=r[u])}if(i.cssVariables===!0)r["editor.foreground"]="var(--hls-foreground)",r["editor.background"]="var(--hls-background)";else if(typeof i.cssVariables=="object"){r["editor.foreground"]??=r.text??r.foreground??"foreground",r["editor.background"]??=r.background??"background";const{prefix:l="--hls-",defaults:s}=i.cssVariables;for(const[u,d]of Object.entries(r)){const c=s?.[d];r[u]=`var(${l}${d}${c?`, ${c}`:""})`}}const a=i.appearance==="light"?"light":"dark";return{name:e,type:a,colors:r,zed:i,fg:r["editor.foreground"]??r.text??r.foreground??(a==="light"?"#333333":"#bbbbbb"),bg:r["editor.background"]??r.background??(a==="light"?"#ffffff":"#1e1e1e")}}function Wr(e){let t=Sn.get(e);return t!=null||(t=Or({fallbackLoader:async n=>{if(typeof __DIFFS_WORKER__<"u"?__DIFFS_WORKER__:Fr())throw new Error(`Theme "${n}" 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=Bt.get(n);if(e==="highlights"){const r=i?.zed??i?.diffs;if(r!=null){const s=await r(),u="default"in s?s.default:s;if("zed"in u&&u.zed!=null)return u;if("style"in u||"themes"in u)return yn(n,u);throw new Error(`Theme "${n}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`)}const o=Ur(),{themes:a}=o instanceof Promise?await o:o,l=a[n];if(l!=null)return yn(n,(await l()).default);if(i?.textmate!=null)throw new Error(`Theme "${n}" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`)}else{const r=i?.textmate??i?.diffs;let o;if(r!=null){const d=await r();o="default"in d?d.default:d}else{const d=_r(),{themes:c}=d instanceof Promise?await d:d,f=c.getTheme(n);if(f==null&&i?.zed!=null)throw new Error(`Theme "${n}" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`);if(f==null)throw new Error(`No valid theme loader registered for "${n}"`);const h=await f.load();o="default"in h?h.default:h}if("style"in o||"themes"in o)throw new Error(`Theme "${n}" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`);const a=Br(),{normalizeTheme:l,createCssVariablesTheme:s}=a instanceof Promise?await a:a;if("cssVariables"in o&&o.cssVariables!=null)return{...o,textmate:l(s(o.cssVariables))};if("textmate"in o&&o.textmate!=null)return{...o,textmate:l(o.textmate)};const u=l(o);return{name:u.name,type:u.type,fg:u.fg,bg:u.bg,colors:u.colors,textmate:u}}throw new Error(`No valid theme loader registered for "${n}"`)},normalizeTheme:(n,i)=>{if(n.name!==i)throw new Error(`resolvedTheme: themeName: ${i} does not match theme.name: ${n.name}`);return n}}),Sn.set(e,t)),t}function $t(e,t=an()){return typeof t!="string"&&t.isDisposed?!1:(typeof t=="string"?Wr(t):t.themeResolver).hasResolvedThemes(ln(e))}let oe;async function Vr(e){const t=an(e);Hr(t);try{if(t==="highlights"){const{HighlightsHighlighter:i}=await qe(async()=>{const{HighlightsHighlighter:r}=await import("./highlights-BNmyg0mo.js");return{HighlightsHighlighter:r}},__vite__mapDeps([6,7,1,2,4]));return new i}const{ShikiHighlighter:n}=await qe(async()=>{const{ShikiHighlighter:i}=await import("./shiki-Bu6w0lug.js");return{ShikiHighlighter:i}},__vite__mapDeps([8,1,2,7,5,4]));return await n.create(t)}finally{Ir()}}async function un({themes:e,langs:t,preferredHighlighter:n}){yi();const i=oe??=Vr(Dr()??n);let r;try{r=await i}catch(o){throw oe===i&&(oe=void 0),o}if(oe===i&&(oe=r),await Promise.all([r.themeResolver.resolveThemes(e),r.loadLanguages(t)]),r.isDisposed)throw new pt;return r}function yi(){oe!=null&&!("then"in oe)&&oe.isDisposed&&(oe=void 0)}function Ne({theme:e,lang:t,langs:n}={}){yi();const i=oe;if(!(i==null||"then"in i||e!=null&&!$t(e,i)||(t!=null||n!=null)&&!i.hasLoadedLanguages([...t!=null?[t]:[],...n??[]])))return i}async function jr(e){await un(e)}const Oe=new Set;let Ue=null;function Ci(e){Oe.add(e),Ue??=requestAnimationFrame(xi)}function Wt(e){Oe.delete(e)&&Oe.size===0&&Ue!=null&&(cancelAnimationFrame(Ue),Ue=null)}function xi(e){const t=new Set(Oe);Oe.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}Oe.size>0?Ue=requestAnimationFrame(xi):Ue=null}function Vt(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const a of r)if(o.delete(a),!i.has(a)&&(!(a in t)||e[a]!==t[a]))return!1;for(const a of Array.from(o))if(!i.has(a))return!1;return!0}function cn(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ki(e,t){const n=e?.theme??ge,i=t?.theme??ge,r=Cn(e),o=Cn(t);return cn(n,i)&&Vt(e,t,["theme","parseDiffOptions"])&&Vt(r,o)}function Cn(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function jt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function se(e){return{type:"text",value:e}}function M({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function gt({name:e,width:t=16,height:n=16,properties:i}){return M({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[M({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function Ye(e){return M({tagName:"div",properties:{"data-gutter":""},children:e})}function Gr(e,t,n,i={}){return M({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[M({tagName:"span",properties:{"data-line-number-content":""},children:[se(`${t}`)]})]:void 0})}function ee(e,t,n){return M({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function qr(){return M({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[gt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}const Kr=new Set(["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"]),Xr=new Set(["svg","template","script","style"]),Yr={class:"class",className:"class",id:"id",role:"role",style:"style",tabIndex:"tabindex",tabindex:"tabindex",title:"title"},Zr=/^data-[\w.:-]+$/,Jr=/[<&]/g,Qr=/[\0"&'`]/g,eo={"<":"&#x3C;","&":"&#x26;",'"':"&#x22;","'":"&#x27;","`":"&#x60;","\0":"&#x0;"},to=256;function we(e){const t=new Map;return Array.isArray(e)?hn(e,t):Li(e,t)}function hn(e,t){let n="";for(const i of e)n+=Li(i,t);return n}function Li(e,t){switch(e.type){case"text":return Ei(e.value);case"element":return no(e,t);case"root":return hn(e.children,t);default:return Ut(e)}}function no(e,t){const{tagName:n}=e;if(n==="span"&&e.children.length===1&&e.children[0].type==="text"&&typeof e.properties?.style=="string"){let a=!0;for(const l in e.properties)if(l!=="style"&&e.properties[l]!=null){a=!1;break}if(a)return`<span ${wi(e.properties.style,t)}>${Ei(e.children[0].value)}</span>`}if(Xr.has(n))return Ut(e);const i=io(e.properties,t);if(i==null)return Ut(e);const r=i===""?`<${n}>`:`<${n} ${i}>`,o=hn(e.children,t);return o===""&&Kr.has(n.toLowerCase())?r:`${r}${o}</${n}>`}function wi(e,t){let n=t.get(e);return n==null&&(n=`style="${Ri(e)}"`,t.size<to&&t.set(e,n)),n}function io(e,t){let n="";for(const i in e){const r=e[i];if(r==null)continue;const o=Yr[i]??(Zr.test(i)?i:void 0);if(o==null)return;if(r===!1||typeof r=="number"&&Number.isNaN(r))continue;const a=i==="style"&&typeof r=="string"?wi(r,t):r===!0?o:`${o}="${Ri(Array.isArray(r)?r.join(" ").trim():String(r))}"`;n+=n===""?a:` ${a}`}return n}function Ei(e){return e.indexOf("<")<0&&e.indexOf("&")<0?e:e.replace(Jr,Ai)}function Ri(e){return e.replace(Qr,Ai)}function Ai(e){return eo[e]}function ro(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Ze(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 oo=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(),Wt(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){const n=!(e===this.selectedRange||jt(e??void 0,this.selectedRange??void 0)),i=t?.lineNumberOnly??!1,r=t?.activeLineSide!==this.selectedRangeHighlightSide||i!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!r||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=i,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){const i=e!==this.editorActiveLine,r=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!i&&!r||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&Ze(e.composedPath())||(ue(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:a=!1}=this.options;t==="disabled"&&!a&&n==null&&i==null&&r==null&&o==null||(ue(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(ue(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){ue(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();ue(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);ue(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:a,onLineEnter:l,onLineLeave:s,onTokenClick:u,onTokenEnter:d,onTokenLeave:c,onHunkExpand:f,onMergeConflictActionClick:h}=this.options;switch(e){case"move":{const g=kt(r)&&this.hoveredLine?.lineElement===r.lineElement;ut(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ut(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),d?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(s?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),kt(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(lo(r)&&h!=null){h(r);break}if(ao(r)&&f!=null){f(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!kt(r))break;ut(r)&&u!=null&&u(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);a!=null&&r.numberColumn?a({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:a,onTokenClick:l,onTokenEnter:s,onTokenLeave:u,onHunkExpand:d,onMergeConflictActionClick:c,enableGutterUtility:f=!1,enableLineSelection:h=!1,onGutterUtilityClick:g}=this.options,p=g!=null,v=n!=="disabled"||i!=null||r!=null||o!=null||a!=null||l!=null||s!=null||u!=null||d!=null||c!=null||f||h||p;v&&!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,ue(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const S=[];return(t==="both"||t==="click")&&(i!=null&&S.push("onLineClick"),r!=null&&S.push("onLineNumberClick"),d!=null&&S.push("expandable hunk separators"),c!=null&&S.push("merge conflict actions")),S})()),ue(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),ue(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!v&&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 b=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",m=this.pointerSession.mode==="gutterSelecting";(!h&&b||!p&&m)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();Ze(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:r,eventSide:o,lineIndex:a}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const s=l.start<=l.end?a>=l.start:a<=l.end;this.selectionAnchor={lineNumber:s?this.selectedRange.start:this.selectedRange.end,side:s?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{onGutterUtilityClick:t}=this.options;if(t==null)return;const n=this.currentSelectionEnds(),i=n?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),r=n?.top??i;i==null||r==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:r,current:i},this.selectionAnchor={lineNumber:r.lineNumber,side:r.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;const n={lineNumber:t.lineNumber,side:t.eventSide};if(ro(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{const{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(n.current=i,this.updateSelection(i.lineNumber,i.side));const r=this.buildSelectedLineRange(n.anchor,n.current);t?.({...r}),this.selectionAnchor=void 0,this.notifySelectionEnd(r),this.notifySelectionCommitted(r),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=we(qr());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);We(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(_e(r));if(We(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if(We(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(We(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&Ze(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=_e(e);if(t&&Ze(n))return;const i=co(e);return i!=null?_e(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=ho(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute("data-line")||t.hasAttribute("data-column-number")))return _e(t);const n=po(fo(e));if(n==null)return;const i=this.targetForSelectionPoint(n);return i!=null?_e(i.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=Ln(t)?t:Ln(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,a=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(a,e,o,t)}jt(i??void 0,r??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,Ci(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;const i=this.getIndexesFromSelection(e.range,t);if(i==null)throw console.error({rowRange:i,range:e.range}),new Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return i}getLineRenderColumns(e,t,n,i){if(this.pre==null||t==null&&i==null)return[];const{children:r}=this.pre;if(r.length>2)throw console.error(r),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const o=[];for(const a of r){const l=a.hasAttribute("data-deletions")?"deletions":a.hasAttribute("data-additions")?"additions":void 0,s=e!=null&&t!=null&&(e.highlightSide==null||l==null||e.highlightSide===l),u=n!=null&&i!=null&&(n.highlightSide==null||l==null||n.highlightSide===l);if(!s&&!u)continue;const[d,c]=a.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");o.push({content:c,gutter:d,renderEditorActiveLine:u,renderSelectedLines:s})}return o}renderSelection=()=>{Wt(this.renderSelection);const e=this.getSelectionRenderState();if(this.pre==null)return;const{editorActiveLine:t,selectedLines:n}=e,i=!wn(this.renderedSelectedLinesState,n),r=!wn(this.renderedEditorActiveLineState,t);if(!i&&!r)return;i&&(this.renderedSelectedLinesState=void 0),r&&(this.renderedEditorActiveLineState=void 0);const o=this.pre.getAttribute("data-diff-type")==="split",a=i?this.resolveLineRenderRange(n,o,"selected-lines"):void 0,l=r?this.resolveLineRenderRange(t,o,"editor-active-line"):void 0,s=this.getLineRenderColumns(i?n:void 0,a,r?t:void 0,l),u=n.range==null||s.some(p=>p.renderSelectedLines),d=t.range==null||s.some(p=>p.renderEditorActiveLine);if(i)for(const p of this.pre.querySelectorAll("[data-selected-line]"))p.removeAttribute("data-selected-line");if(r)for(const p of this.pre.querySelectorAll("[data-editor-active-line]"))p.removeAttribute("data-editor-active-line");const c=a==null?void 0:Math.min(a.start,a.end),f=a==null?void 0:Math.max(a.start,a.end),h=c===f,g=l?.start;for(const p of s){const{content:v,gutter:b,renderEditorActiveLine:m,renderSelectedLines:S}=p,C=Math.max(S?f??-1/0:-1/0,m?g??-1/0:-1/0),y=v.children.length;for(let x=0;x<y;x++){const k=v.children[x],E=b.children[x];if(!(k instanceof HTMLElement)||!(E instanceof HTMLElement))continue;const w=this.parseLineIndex(k,o);if((w??0)>C)break;if(w!=null){if(S&&c!=null&&f!=null&&w>=c&&w<=f){let D=h?"single":w===c?"first":w===f?"last":"";E.setAttribute("data-selected-line",D),n.lineNumberOnly||(k.setAttribute("data-selected-line",D),E.nextSibling instanceof HTMLElement&&k.nextSibling instanceof HTMLElement&&(k.nextSibling.hasAttribute("data-line-annotation")||k.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(h?(D="last",k.setAttribute("data-selected-line","first")):w===c?D="":w===f&&k.setAttribute("data-selected-line",""),k.nextSibling.setAttribute("data-selected-line",D),E.nextSibling.setAttribute("data-selected-line",D)))}m&&w===g&&(E.setAttribute("data-editor-active-line",""),t.lineNumberOnly||k.setAttribute("data-editor-active-line",""))}}}i&&u&&(this.renderedSelectedLinesState=n),r&&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:n,side:i,tokenElement:r,tokenText:o}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:r,tokenText:o}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...n!=null?{side:n}:{},...n!==i&&i!=null?{endSide:i}:{}}}resolvePointerTarget(e){let t=!1,n,i,r,o,a,l,s,u,d,c;for(const h of e){if(!(h instanceof HTMLElement))continue;if(c==null&&h.hasAttribute("data-merge-conflict-action")){const b=h.getAttribute("data-merge-conflict-action")??void 0,m=h.getAttribute("data-merge-conflict-conflict-index")??void 0,S=m!=null?Number.parseInt(m,10):NaN;uo(b)&&Number.isFinite(S)&&(c={kind:"merge-conflict-action",resolution:b,conflictIndex:S})}if(l==null&&h.hasAttribute("data-char")){l=h;const b=h.getAttribute("data-char");if(b!=null){const m=Number.parseInt(b,10);if(!Number.isNaN(m)){const S=h.textContent??"",C=m+S.length;(S.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(s={tokenElement:l,lineCharStart:m,lineCharEnd:C,tokenText:S});continue}}}const g=a==null?h.getAttribute("data-column-number")??void 0:void 0;if(g!=null){a=h,d=Number.parseInt(g,10),t=!0,n=Rn(h),o=h.getAttribute("data-line-index")??void 0;continue}const p=r==null?h.getAttribute("data-line")??void 0:void 0;if(p!=null){r=h,d=Number.parseInt(p,10),n=Rn(h),o=h.getAttribute("data-line-index")??void 0;continue}if(u==null&&(h.hasAttribute("data-expand-button")||h.hasAttribute("data-unmodified-lines"))){u={hunkIndex:void 0,direction:h.hasAttribute("data-expand-up")?"up":h.hasAttribute("data-expand-down")?"down":"both",all:h.hasAttribute("data-expand-all-button")};continue}const v=u!=null?h.getAttribute("data-expand-index")??void 0:void 0;if(u!=null&&v!=null){const b=Number.parseInt(v,10);Number.isNaN(b)||(u.hunkIndex=b);continue}if(i==null&&h.hasAttribute("data-code")){i=h;break}}if(c!=null)return c;if(u?.hunkIndex!=null)return{type:"line-info",hunkIndex:u.hunkIndex,direction:u.direction,all:u.all};if(r??=o!=null?kn(i,`[data-line][data-line-index="${o}"]`):void 0,a??=o!=null?kn(i,`[data-column-number][data-line-index="${o}"]`):void 0,i==null||r==null||a==null||n==null||d==null||Number.isNaN(d))return;const f=this.parseLineIndex(r,this.isSplitDiff());return s!=null?this.mode==="file"?{kind:"token",lineType:n,lineElement:r,lineNumber:d,numberColumn:t,numberElement:a,side:void 0,splitLineIndex:f,...s}:{kind:"token",lineType:n,lineElement:r,lineNumber:d,numberColumn:t,numberElement:a,side:En(n,i),splitLineIndex:f,...s}:this.mode==="file"?{kind:"line",lineType:n,lineElement:r,lineNumber:d,numberColumn:t,numberElement:a,side:void 0,splitLineIndex:f}:{kind:"line",lineType:n,lineElement:r,lineNumber:d,numberColumn:t,numberElement:a,side:En(n,i),splitLineIndex:f}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const n=(e.getAttribute("data-line-index")??"").split(",").map(i=>Number.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function xn({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:a,onLineNumberClick:l,onTokenClick:s,onTokenEnter:u,onTokenLeave:d,renderGutterUtility:c,__debugPointerEvents:f,enableLineSelection:h,controlledSelection:g,onLineSelected:p,onLineSelectionStart:v,onLineSelectionChange:b,onLineSelectionEnd:m},S,C,y){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:so({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:i}),usesCustomGutterUtility:c!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:S,onMergeConflictActionClick:y,onLineClick:r,onLineEnter:o,onLineLeave:a,onLineNumberClick:l,onTokenClick:s,onTokenEnter:u,onTokenLeave:d,__debugPointerEvents:f,enableLineSelection:h,controlledSelection:g,onLineSelected:p,onLineSelectionStart:v,onLineSelectionChange:b,onLineSelectionEnd:m,getLineIndex:C}}function so({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function We(e){return e!=null&&"kind"in e&&e.kind==="line"}function ut(e){return e!=null&&"kind"in e&&e.kind==="token"}function kt(e){return We(e)||ut(e)}function ao(e){return"type"in e&&e.type==="line-info"}function lo(e){return"kind"in e&&e.kind==="merge-conflict-action"}function uo(e){return e==="current"||e==="incoming"||e==="both"}function kn(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function _e(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function co(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function ho(e){const t=e.closest('[slot^="annotation-"]'),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName==="SLOT"?e:void 0)?.closest("[data-line-annotation]");return n instanceof HTMLElement?n:void 0}function fo(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function po(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function Ln(e){return e!=null&&typeof e.elementFromPoint=="function"}function go(e,t){return e===t||jt(e??void 0,t??void 0)}function wn(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&go(e?.range??null,t.range)}function En(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function Rn(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 ue(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return}console.log(...n)}var mo=class fe{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=fe.resizeObserver??new ResizeObserver(fe.handleSharedResizeEntries);return fe.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=fe.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,{disableAnnotations:n,columnVariables:i="apply"}){const r=new Set,o=i==="apply";let a=0;const l=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(a===2)break;const u=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(u==null)continue;a++;let d=l.get(u);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=u.firstElementChild;c instanceof HTMLElement||(c=null),d!=null?(this.observedNodes.set(u,d),l.delete(u),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,So(d,o)):(d={type:"code",codeElement:u,numberElement:c,codeWidth:"auto",numberWidth:0,applyColumnVariables:o},this.observedNodes.set(u,d),this.observe(u),c!=null&&(this.observedNodes.set(c,d),this.observe(c)))}if(a>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),u=new Map;for(const d of s){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 f=u.get(c);f==null&&(f=[],u.set(c,f)),f.push(d)}for(const[d,c]of u){if(c.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",d,c);continue}const[f,h]=c,g=f.firstElementChild,p=h.firstElementChild;if(!(f instanceof HTMLElement)||!(h instanceof HTMLElement)||!(g instanceof HTMLElement)||!(p instanceof HTMLElement))continue;let v=l.get(g);if(v!=null){this.observedNodes.set(g,v),this.observedNodes.set(p,v),l.delete(g),l.delete(p);continue}const b=g.getBoundingClientRect().height,m=p.getBoundingClientRect().height;v={type:"annotations",column1:{container:f,child:g,childHeight:b},column2:{container:h,child:p,childHeight:m},currentHeight:"auto"},r.add({child1:g,child2:p,item:v,newHeight:Math.max(b,m)})}for(const d of r)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);r.clear()}for(const[s,u]of l)this.unobserve(s),u.type==="code"?yo(u):Co(u);l.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=fe,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),fe.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=fe,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),fe.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const r of t){const{target:o,borderBoxSize:a,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const s=this.observedNodes.get(o);if(s==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(s.type==="annotations"){const u=(()=>{if(o===s.column1.child)return s.column1;if(o===s.column2.child)return s.column2})();if(u==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:s,target:o});continue}u.childHeight=a[0].blockSize,i.add(s)}else if(s.type==="code"){const u=n.get(s)??{},d=l[0].inlineSize;o===s.codeElement?u.codeInlineSize=d:o===s.numberElement&&(u.numberInlineSize=d),n.set(s,u)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?vo(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?bo(i.numberInlineSize):n.numberWidth,a=r!==n.codeWidth,l=o!==n.numberWidth;!a&&!l||(n.codeWidth=r,n.numberWidth=o,n.applyColumnVariables&&Di(n,{codeWidthChanged:a,numberWidthChanged:l}))}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function vo(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function bo(e){return Math.max(Math.ceil(e),0)}function So(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?Di(e,{codeWidthChanged:!0,numberWidthChanged:!0}):Ti(e))}function Di(e,{codeWidthChanged:t,numberWidthChanged:n}){const{codeElement:i,codeWidth:r,numberWidth:o}=e;if(t&&i.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),n&&i.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),t||n&&r!=="auto"){const a=typeof r=="number"?Math.max(r-o,0):0;i.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}function Ti(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 yo(e){e.codeElement.isConnected&&Ti(e)}function Co(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 An(e,t){const n=Array.isArray(e)?e:[e];return t!=null?t.hasLoadedLanguages(n):n.every(i=>i==="text"||i==="ansi"||Mr.has(i))}function Hi(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 xo(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 ko(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 Lo({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return M({tagName:"div",children:[t==="custom"?M({tagName:"slot",properties:{name:sn}}):wo({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Eo(i)]],properties:r})}function wo({name:e,prevName:t,iconType:n}){const i=[M({tagName:"slot",properties:{name:gi}}),gt({name:ko(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(M({tagName:"div",children:[M({tagName:"bdi",children:[se(t)]})],properties:{"data-prev-name":""}})),i.push(gt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(M({tagName:"div",children:[M({tagName:"bdi",children:[se(e)]})],properties:{"data-title":""}})),i.push(M({tagName:"slot",properties:{name:mi}})),M({tagName:"div",children:i,properties:{"data-header-content":""}})}function Eo(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push(M({tagName:"span",children:[se(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(M({tagName:"span",children:[se(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(M({tagName:"slot",properties:{name:vi}})),M({tagName:"div",children:t,properties:{"data-metadata":""}})}function Ro(e){return M({tagName:"pre",properties:Ao(e)})}function Ao({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:a,customProperties:l}){return{...l,"data-diff":a==="diff"?"":void 0,"data-file":a==="file"?"":void 0,"data-diff-type":a==="diff"?r?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const Me=new Map,Fe={"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 ae(e){const t=Dn(e);if(t!=null)return t;const n=e.split(/[/\\]/).pop()??e;return n===e?"text":Dn(n)??"text"}function Dn(e){if(Me.has(e))return Me.get(e)??"text";if(Object.hasOwn(Fe,e))return Fe[e]??null;const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Me.has(t[1]))return Me.get(t[1])??"text";if(Object.hasOwn(Fe,t[1]))return Fe[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Me.has(n)?Me.get(n)??"text":Object.hasOwn(Fe,n)?Fe[n]??"text":null}function Do(e,{theme:t,preferredHighlighter:n}){return{langs:Array.isArray(e)?e:[e??"text"],themes:ln(t),preferredHighlighter:an(n)}}function Te(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function Gt(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function te(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const To=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Ho=/^0(?:\.0+)?%?$/;function Io(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const r=i.lastIndexOf("/");if(r!==-1)return i.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const o=i.split(",");if(o.length===4)return o[3]?.trim()}}function Mo(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let i,r=1;return n.length===3?i=n.split("").map(o=>o+o).join(""):n.length===6?i=n:(i=n.slice(0,6),r=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),r]}function Lt(e){if(e==null)return null;const t=Mo(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,r=t[2]/255,o=a=>a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(i)+.0722*o(r)}function Tn(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||To.test(t))return!0;const n=Io(t);return n!=null&&Ho.test(n)}function Fo(e,t,n){if(t==null||n==null)return!1;const i=Lt(e),r=Lt(t),o=Lt(n);return i==null||r==null||o==null?!1:Math.abs(i-o)<Math.abs(i-r)}const Hn=new WeakMap;function Po(e){const t=Hn.get(e);if(t!=null)return t;const n=e.colors??{},i={...n},r=n["editor.background"]??e.bg,o=n["editor.foreground"]??e.fg,a=n["sideBar.background"]??r,l=n["sideBar.foreground"]??o;re(i,"editor.background",r),re(i,"editor.foreground",o),re(i,"sideBar.background",a),re(i,"sideBar.foreground",l),re(i,"input.background",n["input.background"]??a),re(i,"sideBarSectionHeader.foreground",n["sideBarSectionHeader.foreground"]??l),re(i,"list.activeSelectionForeground",n["list.activeSelectionForeground"]??l),re(i,"gitDecoration.addedResourceForeground",wt(n["gitDecoration.addedResourceForeground"],n["terminal.ansiGreen"],n["editorGutter.addedBackground"])),re(i,"gitDecoration.modifiedResourceForeground",wt(n["gitDecoration.modifiedResourceForeground"],n["terminal.ansiBlue"],n["editorGutter.modifiedBackground"])),re(i,"gitDecoration.deletedResourceForeground",wt(n["gitDecoration.deletedResourceForeground"],n["terminal.ansiRed"],n["editorGutter.deletedBackground"]));const s=(Tn(n["list.focusOutline"])?void 0:n["list.focusOutline"])??(Tn(n.focusBorder)?void 0:n.focusBorder);s!=null?i["list.focusOutline"]=s:delete i["list.focusOutline"];const u=n["list.hoverBackground"];u!=null&&(No(u,a)||Fo(u,a,l))&&delete i["list.hoverBackground"];const d=Object.freeze({...e,colors:Object.freeze(i)});return Hn.set(e,d),d}function re(e,t,n){n!=null&&n!==""&&(e[t]=n)}function wt(...e){for(const t of e)if(t!=null&&t!=="")return t}function No(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function zo({theme:e=ge,highlighter:t,prefix:n}){let i="";if(typeof e=="string"){const r=t.getTheme(e),o=Et(r,t);i+=`color:${o.fg};`,i+=`background-color:${o.bg};`,i+=`${te("global")}fg:${o.fg};`,i+=`${te("global")}bg:${o.bg};`,i+=Rt(r,n)}else{let r=t.getTheme(e.dark),o=Et(r,t);i+=`${te("global")}dark:${o.fg};`,i+=`${te("global")}dark-bg:${o.bg};`,i+=Rt(r,"dark"),r=t.getTheme(e.light),o=Et(r,t),i+=`${te("global")}light:${o.fg};`,i+=`${te("global")}light-bg:${o.bg};`,i+=Rt(r,"light")}return i}function Et(e,t){if(t.name==="highlights"&&e.zed?.cssVariables===!0){const n=te("token");return{fg:`var(${n}foreground)`,bg:`var(${n}background)`}}return Po(e)}function Rt(e,t){t=t!=null?`${t}-`:"";let n="";const i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];i!=null&&(n+=`${te("global")}${t}addition-color:${i};`);const r=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];r!=null&&(n+=`${te("global")}${t}deletion-color:${r};`);const o=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return o!=null&&(n+=`${te("global")}${t}modified-color:${o};`),n}function Oo(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(se(`
3
3
  `)),e}const In=new WeakMap;function Ii(e,t=!1){const{htmlStyle:n}=e;if(n!=null){let r=t?In.get(n):void 0;if(r==null){r="";for(const o in n)r+=`${r===""?"":";"}${o}:${n[o]}`;t&&In.set(n,r)}return r}let i=e.color!=null?`color:${e.color}`:"";if(e.bgColor!=null&&(i+=`;background-color:${e.bgColor}`),e.fontStyle!=null){(e.fontStyle&1)!==0&&(i+=";font-style:italic"),(e.fontStyle&2)!==0&&(i+=";font-weight:bold");const r=(e.fontStyle&4)!==0,o=(e.fontStyle&8)!==0;(r||o)&&(i+=`;text-decoration:${r?"underline":""}${r&&o?" ":""}${o?"line-through":""}`)}return i.replace(/^;/,"")}function Mi(e,t,n){let i=!1,r;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return i||(r=n(),i=!0),Object.getOwnPropertyDescriptor(e,t)?.configurable===!0&&Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:r}),r},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,i=!0}}})}const Je=Symbol("no-token"),At=Symbol("multiple-tokens");function Fi(e){const t=Uo(e);if(t!=null)return t;let n=Je;const i=[];let r=[],o;const a=()=>{if(r.length===0||o==null){r=[],o=void 0;return}if(r.length===1){const s=r[0];if(s?.type==="element"){_o(s,o);for(const u of s.children)ct(u)}else ct(s);i.push(s),r=[],o=void 0;return}for(const s of r)ct(s);i.push(M({tagName:"span",properties:{"data-char":o},children:r})),r=[],o=void 0},l=s=>{if(s!==Je){if(s===At){n=At;return}if(n===Je){n=s;return}n!==s&&(n=At)}};for(const s of e.children){const u=s.type==="element"?Fi(s):Je;if(l(u),typeof u!="number"){a(),i.push(s);continue}o!=null&&o!==u&&a(),o??=u,r.push(s)}return a(),e.children=i,n}function Uo(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function ct(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)ct(t)}}function _o(e,t){e.properties["data-char"]=t}function Bo(e,{state:t,lazyLineAST:n=!1,cacheHtmlStyles:i=!1,useTokenTransformer:r=!1,mergeWhitespaces:o="always",decorations:a=[],lineOffsets:l=[]}){let s;for(const c of a){const f=s??=new Map,h={...c,start:Mn(c.start,l),end:Mn(c.end,l)},g=Math.min(h.end.line,e.length-1);for(let p=h.start.line;p<=g;p++){let v=f.get(p);v==null&&f.set(p,v=[]),v.push(h)}}const u=(c,f)=>{let h;if(r||o!=="never"){let b="",m=0;for(let S=0;S<c.length;S++){let C=c[S];if(r){const y=C.content.trim();if(y!==""&&y!==C.content){h??=c.slice(0,S);const x=C.content.indexOf(y);x>0&&h.push({content:C.content.slice(0,x),offset:C.offset}),h.push({...C,content:y,offset:C.offset+x});const k=x+y.length;k<C.content.length&&h.push({content:C.content.slice(k),offset:C.offset+k});continue}}else{const y=((C.fontStyle??0)&12)!==0;if(!y&&/^\s+$/.test(C.content)&&S<c.length-1){h??=c.slice(0,S),b===""&&(m=C.offset),b+=C.content;continue}b!==""&&h!=null&&(y?h.push({content:b,offset:m}):C={...C,content:b+C.content,offset:m},b="")}h?.push(C)}}h??=c;const g={type:"element",tagName:t==null?"span":"div",properties:t==null?{class:"line"}:{},children:[]},p=s?.get(f),v=p==null?$o(g,h,r,i):Wo(g,h,p,f,r,i);return r&&v===0&&g.children.push({type:"element",tagName:"br",properties:{},children:[]}),r&&p!=null&&Fi(g),t==null?g:Oo(g,f+1,t)};if(!n)return e.map(u);const d=new Array(e.length);for(let c=0;c<e.length;c++){const f=e[c];Mi(d,c,()=>u(f,c))}return d}function $o(e,t,n,i){let r=0;for(const o of t)o.content!==""&&(e.children.push(Pi(o,Ii(o,i),o.content,r,n)),r+=o.content.length);return r}function Wo(e,t,n,i,r,o){n.length>1&&n.sort((v,b)=>v.start.line!==b.start.line?v.start.line-b.start.line:v.start.character!==b.start.character?v.start.character-b.start.character:v.end.line!==b.end.line?b.end.line-v.end.line:b.end.character-v.end.character);const a=t.reduce((v,b)=>v+b.content.length,0),l=[];for(let v=0;v<n.length;v++){const b=n[v],m={decoration:b,order:v,from:b.start.line===i?b.start.character:0,to:b.end.line===i?b.end.character:a};l.push({position:Math.max(0,Math.min(m.from,a)),range:m,start:!0},{position:Math.max(0,Math.min(m.to,a)),range:m,start:!1})}l.sort((v,b)=>v.position-b.position);const s=[],u=[];let d=0;const c=(v,b)=>{let m=0,S=s.length;for(;m<S;){const C=m+S>>>1;s[C].order<v.order?m=C+1:S=C}b?s.splice(m,0,v):s[m]===v&&s.splice(m,1)},f=()=>{let v=e,b=0;for(const m of s){if(u[b]?.range!==m){u.length=b;const S={type:"element",tagName:"span",properties:{...m.decoration.properties},children:[]};v.children.push(S),u.push({range:m,node:S})}v=u[b++].node}return u.length=b,v};let h=e;const g=v=>{const b=d;for(;l[d]?.position===v;)d++;let m=!1;for(let S=b;S<d;S++){const{range:C,start:y}=l[S];!y&&C.from!==C.to&&v<a&&c(C,!1)}for(let S=b;S<d;S++){const{range:C,start:y}=l[S];y&&C.from<=v&&C.to>=v&&(C.to>v||C.from===v||v===a)&&(c(C,!0),C.from===C.to&&(m=!0))}if(m){f();for(let S=b;S<d;S++){const{range:C,start:y}=l[S];y&&C.from===C.to&&c(C,!1)}}v<a&&(h=f())};let p=0;for(const v of t){if(v.content==="")continue;const b=p,m=b+v.content.length,S=Ii(v,o);for(;p<m;){l[d]?.position===p&&g(p);const C=Math.min(m,l[d]?.position??m);h.children.push(Pi(v,S,p===b&&C===m?v.content:v.content.slice(p-b,C-b),b,r)),p=C}}return l[d]?.position===p&&g(p),p}function Pi(e,t,n,i,r){const o=e.htmlAttrs!=null?{...e.htmlAttrs}:{};return t!==""&&(o.style=t),r&&(o["data-char"]=i),{type:"element",tagName:"span",properties:o,children:[{type:"text",value:n}]}}function Mn(e,t){if(typeof e!="number")return e;let n=0,i=t.length;for(;n+1<i;){const r=n+i>>>1;t[r]<=e?n=r:i=r}return{line:n,character:e-(t[n]??0)}}function Vo(e,t){for(const n of t)e.push(n)}function jo(e,t,n){return{lang:e,...typeof t=="string"?{theme:t}:{themes:t},defaultColor:!1,cssVariablePrefix:te("token"),tokenizeMaxLineLength:n,tokenizeTimeLimit:0}}function Ni(e,t){return e?.getPreferredHighlighter()??t.preferredHighlighter}function Fn(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 Go="-1,-1";function qo(e){return e?.some(t=>t.lineNumber===0)??!1}function Pn(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function zi(e){return e.startingLine===0&&e.totalLines>0}function Ko(e,t){return e.endsWith(`\r
4
4
  `)?t+`\r
5
5
  `:e.endsWith("\r")?t+"\r":e.endsWith(`
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DuIGzFZE.js","assets/commands-C30s37KG.js","assets/index-B8i_Npwx.js","assets/index-ErfaDdfx.js","assets/index-Bs28LYAL.js","assets/index-Dl6dJHXS.js","assets/index-BTJDQCx7.js","assets/index-DYQMUdQi.js","assets/index-BrHERoQu.js","assets/index-Bg8XC6PL.js","assets/index-BvwOxJUs.js","assets/index-DsCq3C1F.js","assets/index-Bqsc65tu.js","assets/index-CWD5WvZ2.js","assets/index-Cf5v_iOJ.js","assets/index-Cl1kAC6E.js","assets/index-HGQTBwgf.js","assets/index-Cy4rJbGi.js","assets/index-DdqggMxb.js","assets/index-BO5QshFZ.js","assets/index-UKKSElMc.js","assets/index-CO3ht2SW.js","assets/dockerfile-BKs6k2Af.js","assets/simple-mode-GW_nhZxv.js","assets/factor-kuTfRLto.js","assets/nsis-LY0VT_u5.js","assets/pug-DeIclll2.js","assets/javascript-iXu5QeM3.js","assets/index-DGti80WN.js","assets/index-BeO3HZi8.js"])))=>i.map(i=>d[i]);
2
- import{b7 as ze,b8 as Ge,b9 as Ke,a as x,j as p,ao as Qe,U as Ae,B as q,ap as $e,_ as a,ba as We,bb as Je,b6 as Ue,bc as re,O as Xe,ak as H}from"./index-Bpei0VEJ.js";import{_ as U,$ as Ye,a0 as Ze,a1 as De,S as M,l as X,m as L,n as et,a2 as tt,a3 as nt,a4 as ot,k as b,W as Y,a5 as Oe,G as rt,a6 as st,a7 as it,H as D,a8 as at,a9 as lt,aa as ct,ab as ut,ac as dt,ad as mt,ae as ft,o as ht,af as z,ag as G,ah as Re,ai as _t,aj as pt,ak as gt,al as xt,am as Et,an as se,ao as ie,K as s,a as vt,ap as bt,aq as Pe,E as Lt,F as kt,ar as C,h as w,as as Tt,at as yt,au as At,av as Dt,aw as B,A as Ot,ax as Rt,ay as Pt,Q as St,g as It,U as Vt,V as Ct}from"./commands-C30s37KG.js";import{r as wt}from"./quick-open-CTZVxNgL.js";const Mt=999;class jt{#t;#e;constructor(){this.#t=new Set,this.#e={panel:null,replace:!1,version:0}}createPanel=t=>{const n=document.createElement("div");return n.className="cm-find",{dom:n,top:!0,mount:()=>this.#n({dom:n,view:t}),update:o=>{(o.docChanged||o.selectionSet||o.transactions.length>0)&&this.#n(this.#e.panel)},destroy:()=>{this.#e.panel?.dom===n&&this.#n(null)}}};subscribe=t=>(this.#t.add(t),()=>{this.#t.delete(t)});read=()=>this.#e;open=(t,n)=>{this.#e={...this.#e,replace:n},De(t),this.#n(this.#e.panel)};showReplace=t=>{this.#e={...this.#e,replace:t},this.#n(this.#e.panel)};#n(t){this.#e={...this.#e,panel:t,version:this.#e.version+1};for(const n of this.#t)n()}}function Se(e){const t=U(e);return{text:t.search,replace:t.replace,caseSensitive:t.caseSensitive,wholeWord:t.wholeWord,regex:t.regexp}}function K(e,t,n){const o=new Ye({search:t,replace:n.replace??U(e.state).replace,caseSensitive:n.caseSensitive,wholeWord:n.wholeWord,regexp:n.regex});e.dispatch({effects:Ze.of(o)})}function Nt(e){const t=U(e);if(!t.valid)return{total:0,current:0,capped:!1};const n=t.getCursor(e),o=e.selection.main;let r=0,i=0;for(let c=n.next();!c.done;c=n.next())if(r+=1,c.value.from===o.from&&c.value.to===o.to&&(i=r),r>=Mt)return{total:r,current:i,capped:!0};return{total:r,current:i,capped:!1}}function Bt(e,t){if(!t)return"";if(e.total===0)return"No results";const n=e.capped?`${e.total}+`:String(e.total);return e.current>0?`${e.current} of ${n}`:`${n} found`}class Ft{#t;#e;constructor(){this.#t=new Map,this.#e=new Map}select(t){return this.#t.get(t)??null}upsert(t){const n=this.#t.get(t);if(n)return n;const o=document.createElement("div");return o.className="cm-note-slot",o.dataset.slot=t,this.#t.set(t,o),o}retain(t){for(const[n,o]of this.#t)t.has(n)||(o.remove(),this.#t.delete(n),this.#e.delete(n))}recordHeight(t,n){n>0&&this.#e.set(t,n)}readHeight(t){return this.#e.get(t)??-1}list(){return[...this.#t.values()]}}function qt(e,t){const n=document.createElement("div");return n.className="cm-note-block",n.appendChild(t.upsert(e)),n}function Ht(e,t,n){const o=t.select(e);o?.parentElement===n&&(t.recordHeight(e,o.offsetHeight),o.remove())}const Q={notes:[],oldNotes:[],spots:[],keep:[],focus:null},$=M.define();function Ie(e){let t=null;for(const n of e)n.is($)&&(t=n.value);return t}class Ve extends Y{constructor(t,n){super(),this.key=t,this.registry=n}key;registry;eq(t){return t.key===this.key&&t.registry===this.registry}get estimatedHeight(){return this.registry.readHeight(this.key)}toDOM(){return qt(this.key,this.registry)}destroy(t){Ht(this.key,this.registry,t)}ignoreEvent(){return!0}}class zt extends Oe{constructor(t,n,o=null){super(),this.tone=t,this.label=n,this.hints=o}tone;label;hints;eq(t){return t.tone===this.tone&&t.label===this.label}toDOM(){const t=document.createElement("div");return t.className=`cm-spotMark cm-spot-${this.tone}`,t.setAttribute("aria-label",this.label),this.hints?.add(t,this.label),t}destroy(t){this.hints?.remove(t)}}function Gt(e,t){return e.line(Math.min(Math.max(t,1),e.lines))}function W(e,t,n){const o=[];for(let r=Math.max(t,1);r<=Math.min(n,e.lines);r+=1)o.push(r);return o}const ae=["red","amber","orange","purple","blue","green","neutral"];function le(e){const t=ae.indexOf(e);return t<0?ae.length:t}function Kt(e,t,n=null){const o=new Map;for(const i of t)for(const c of W(e,i.from,i.to)){const u=o.get(c);if(!u){o.set(c,{tone:i.tone,labels:[i.label]});continue}le(i.tone)<le(u.tone)&&(u.tone=i.tone),u.labels.includes(i.label)||u.labels.push(i.label)}const r=[...o].map(([i,c])=>new zt(c.tone,c.labels.join(`
2
+ import{b7 as ze,b8 as Ge,b9 as Ke,a as x,j as p,ao as Qe,U as Ae,B as q,ap as $e,_ as a,ba as We,bb as Je,b6 as Ue,bc as re,O as Xe,ak as H}from"./index-G40HCr6c.js";import{_ as U,$ as Ye,a0 as Ze,a1 as De,S as M,l as X,m as L,n as et,a2 as tt,a3 as nt,a4 as ot,k as b,W as Y,a5 as Oe,G as rt,a6 as st,a7 as it,H as D,a8 as at,a9 as lt,aa as ct,ab as ut,ac as dt,ad as mt,ae as ft,o as ht,af as z,ag as G,ah as Re,ai as _t,aj as pt,ak as gt,al as xt,am as Et,an as se,ao as ie,K as s,a as vt,ap as bt,aq as Pe,E as Lt,F as kt,ar as C,h as w,as as Tt,at as yt,au as At,av as Dt,aw as B,A as Ot,ax as Rt,ay as Pt,Q as St,g as It,U as Vt,V as Ct}from"./commands-C30s37KG.js";import{r as wt}from"./quick-open-BRg9nAI_.js";const Mt=999;class jt{#t;#e;constructor(){this.#t=new Set,this.#e={panel:null,replace:!1,version:0}}createPanel=t=>{const n=document.createElement("div");return n.className="cm-find",{dom:n,top:!0,mount:()=>this.#n({dom:n,view:t}),update:o=>{(o.docChanged||o.selectionSet||o.transactions.length>0)&&this.#n(this.#e.panel)},destroy:()=>{this.#e.panel?.dom===n&&this.#n(null)}}};subscribe=t=>(this.#t.add(t),()=>{this.#t.delete(t)});read=()=>this.#e;open=(t,n)=>{this.#e={...this.#e,replace:n},De(t),this.#n(this.#e.panel)};showReplace=t=>{this.#e={...this.#e,replace:t},this.#n(this.#e.panel)};#n(t){this.#e={...this.#e,panel:t,version:this.#e.version+1};for(const n of this.#t)n()}}function Se(e){const t=U(e);return{text:t.search,replace:t.replace,caseSensitive:t.caseSensitive,wholeWord:t.wholeWord,regex:t.regexp}}function K(e,t,n){const o=new Ye({search:t,replace:n.replace??U(e.state).replace,caseSensitive:n.caseSensitive,wholeWord:n.wholeWord,regexp:n.regex});e.dispatch({effects:Ze.of(o)})}function Nt(e){const t=U(e);if(!t.valid)return{total:0,current:0,capped:!1};const n=t.getCursor(e),o=e.selection.main;let r=0,i=0;for(let c=n.next();!c.done;c=n.next())if(r+=1,c.value.from===o.from&&c.value.to===o.to&&(i=r),r>=Mt)return{total:r,current:i,capped:!0};return{total:r,current:i,capped:!1}}function Bt(e,t){if(!t)return"";if(e.total===0)return"No results";const n=e.capped?`${e.total}+`:String(e.total);return e.current>0?`${e.current} of ${n}`:`${n} found`}class Ft{#t;#e;constructor(){this.#t=new Map,this.#e=new Map}select(t){return this.#t.get(t)??null}upsert(t){const n=this.#t.get(t);if(n)return n;const o=document.createElement("div");return o.className="cm-note-slot",o.dataset.slot=t,this.#t.set(t,o),o}retain(t){for(const[n,o]of this.#t)t.has(n)||(o.remove(),this.#t.delete(n),this.#e.delete(n))}recordHeight(t,n){n>0&&this.#e.set(t,n)}readHeight(t){return this.#e.get(t)??-1}list(){return[...this.#t.values()]}}function qt(e,t){const n=document.createElement("div");return n.className="cm-note-block",n.appendChild(t.upsert(e)),n}function Ht(e,t,n){const o=t.select(e);o?.parentElement===n&&(t.recordHeight(e,o.offsetHeight),o.remove())}const Q={notes:[],oldNotes:[],spots:[],keep:[],focus:null},$=M.define();function Ie(e){let t=null;for(const n of e)n.is($)&&(t=n.value);return t}class Ve extends Y{constructor(t,n){super(),this.key=t,this.registry=n}key;registry;eq(t){return t.key===this.key&&t.registry===this.registry}get estimatedHeight(){return this.registry.readHeight(this.key)}toDOM(){return qt(this.key,this.registry)}destroy(t){Ht(this.key,this.registry,t)}ignoreEvent(){return!0}}class zt extends Oe{constructor(t,n,o=null){super(),this.tone=t,this.label=n,this.hints=o}tone;label;hints;eq(t){return t.tone===this.tone&&t.label===this.label}toDOM(){const t=document.createElement("div");return t.className=`cm-spotMark cm-spot-${this.tone}`,t.setAttribute("aria-label",this.label),this.hints?.add(t,this.label),t}destroy(t){this.hints?.remove(t)}}function Gt(e,t){return e.line(Math.min(Math.max(t,1),e.lines))}function W(e,t,n){const o=[];for(let r=Math.max(t,1);r<=Math.min(n,e.lines);r+=1)o.push(r);return o}const ae=["red","amber","orange","purple","blue","green","neutral"];function le(e){const t=ae.indexOf(e);return t<0?ae.length:t}function Kt(e,t,n=null){const o=new Map;for(const i of t)for(const c of W(e,i.from,i.to)){const u=o.get(c);if(!u){o.set(c,{tone:i.tone,labels:[i.label]});continue}le(i.tone)<le(u.tone)&&(u.tone=i.tone),u.labels.includes(i.label)||u.labels.push(i.label)}const r=[...o].map(([i,c])=>new zt(c.tone,c.labels.join(`
3
3
  `),n).range(e.line(i).from));return ot.of(r,!0)}function Qt(e,t,n){const o=[];for(const i of t.spots)if(i.selected)for(const c of W(e,i.from,i.to))o.push(b.line({class:"cm-spot-selected"}).range(e.line(c).from));const r=t.focus;if(r){const i=r.flash?"cm-focus-line cm-focus-flash":"cm-focus-line";for(const c of W(e,r.from,r.to))o.push(b.line({class:i}).range(e.line(c).from))}for(const i of t.notes){const c=Gt(e,i.line);o.push(b.widget({block:!0,side:1,widget:new Ve(i.key,n)}).range(c.to))}return b.set(o,!0)}function ce(e,t,n,o){return{decorations:Qt(e,t,n),markers:Kt(e,t.spots,o)}}function $t(e,t,n=null){const o=X.define({create:r=>ce(r.doc,t,e,n),update(r,i){const c=Ie(i.effects);return c?ce(i.state.doc,c,e,n):i.docChanged?{decorations:r.decorations.map(i.changes),markers:r.markers.map(i.changes)}:r},provide:r=>L.decorations.from(r,i=>i.decorations)});return[o,et.highest(tt({class:"cm-spotGutter",markers:r=>r.state.field(o).markers}))]}function Wt(e){const{from:t,to:n}=e.state.selection.main;return t===n?null:{from:e.state.doc.lineAt(t).number,to:e.state.doc.lineAt(n).number}}function Jt(e){return(t,n,o)=>o.button!==0?!1:e(t.state.doc.lineAt(n.from).number,t)}function Ut(e){return nt({domEventHandlers:{mousedown:Jt(e)}})}const Xt=5e3,F=new WeakMap;function ue(e,t){let n=0;for(const o of e)if(o===" ")n+=1;else if(o===" ")n+=t-n%t;else return n;return-1}function Yt(e,t){const n=e.doc,o=n.lineAt(t),r=F.get(n)?.get(o.number);if(r!==void 0)return r;const i=e.tabSize,c=ue(o.text,i);let u=o.number;if(c>=0){const E=Math.min(n.lines,o.number+Xt);for(let g=o.number+1;g<=E;g+=1){const _=ue(n.line(g).text,i);if(!(_<0)){if(_<=c)break;u=g}}}const d=u>o.number?{from:o.to,to:n.line(u).to}:null,h=F.get(n)??new Map;return h.set(o.number,d),F.set(n,h),d}const de=rt.of((e,t)=>Yt(e,t));function Zt(e,t){const n=document.createElement("span");return n.className="cm-foldPlaceholder",n.textContent="⋯",n.setAttribute("aria-label","Folded lines"),n.onclick=t,n}function en(e){return[st({placeholderDOM:Zt}),it({markerDOM:t=>e.create(t)})]}function tn(e){return{create:t=>{const n=document.createElement("span");return n.className=t?"cm-fold-open":"cm-fold-closed",n.innerHTML=e(),n}}}const nn=["neutral","blue","amber","orange","green","red","purple"],on={neutral:"var(--fg-2)",blue:"var(--primary-4)",amber:"var(--amber-4)",orange:"var(--orange-4)",green:"var(--green-4)",red:"var(--red-4)",purple:"var(--purple-4)"};function rn(){return Object.fromEntries(nn.map(e=>[`.cm-spotMark.cm-spot-${e}`,{backgroundColor:on[e]}]))}const sn="inset 2px 0 0 var(--green-4)",an="inset 2px 0 0 var(--red-4)",me={position:"sticky",left:"var(--cm-gutter-width, 0px)",boxSizing:"border-box",width:"calc(100cqw - var(--cm-gutter-width, 0px))"};function ln(){const e={};for(const t of ze()){const n=Ge(t);n&&(e[`.${n}`]={color:t})}for(const t of Object.values(Ke))e[`.${t.className}`]={...t.style};return{...e,".tm-italic":{fontStyle:"italic"},".tm-bold":{fontWeight:"600"},".tm-underline":{textDecoration:"underline"},".tm-strike":{textDecoration:"line-through"}}}const cn=L.theme({"&":{height:"100%",color:"var(--fg-4)",backgroundColor:"transparent",fontSize:"var(--text-2xs)",containerType:"inline-size"},".cm-scroller":{fontFamily:"var(--font-mono)",lineHeight:"18px",overflow:"auto"},".cm-content":{padding:"4px 0",caretColor:"var(--fg-4)"},".cm-line":{padding:"0 24px 0 8px"},"&.cm-focused":{outline:"none"},".cm-cursor":{borderLeftColor:"var(--fg-4)"},".cm-selectionBackground, &.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"var(--primary-a2) !important"},".cm-gutters":{backgroundColor:"var(--background)",color:"var(--fg-2)",border:"none",fontVariantNumeric:"tabular-nums"},".cm-lineNumbers .cm-gutterElement":{padding:"0 4px 0 6px",minWidth:"34px",cursor:"pointer"},".cm-foldGutter .cm-gutterElement":{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",color:"var(--fg-2)",cursor:"pointer"},".cm-foldGutter .cm-gutterElement:hover":{color:"var(--fg-4)"},".cm-fold-open, .cm-fold-closed":{display:"flex"},".cm-fold-open":{visibility:"hidden",transform:"rotate(90deg)"},".cm-gutters:hover .cm-fold-open":{visibility:"visible"},".cm-foldPlaceholder":{display:"inline-block",margin:"0 4px",padding:"0 4px",border:"none",borderRadius:"3px",backgroundColor:"var(--bg-a2)",color:"var(--fg-2)",lineHeight:"16px",cursor:"pointer"},".cm-foldPlaceholder:hover":{backgroundColor:"var(--bg-a3)",color:"var(--fg-4)"},...ln(),".cm-lineNumbers .cm-gutterElement:hover":{color:"var(--primary-text)"},".cm-activeLine, .cm-activeLineGutter":{backgroundColor:"transparent"},".cm-line.cm-insertedLine, &.cm-merge-b .cm-line.cm-changedLine":{backgroundColor:"var(--code-added)",boxShadow:sn},".cm-insertedText, &.cm-merge-b .cm-changedText":{backgroundColor:"var(--code-added-strong)",background:"var(--code-added-strong)",textDecoration:"none"},".cm-deletedChunk .cm-deletedLine, &.cm-merge-a .cm-line.cm-changedLine":{backgroundColor:"var(--code-removed)",boxShadow:an},".cm-deletedText, &.cm-merge-a .cm-changedText":{backgroundColor:"var(--code-removed-strong)",background:"var(--code-removed-strong)",textDecoration:"none"},"ins.cm-insertedLine, del.cm-deletedLine":{backgroundColor:"transparent",padding:"0",textDecoration:"none"},".cm-deletedChunk":{padding:"0",backgroundColor:"transparent"},".cm-deletedChunk .cm-deletedLine":{padding:"0 24px 0 8px",textDecoration:"none"},".cm-deletedLine del":{textDecoration:"none"},".cm-oldLines":{display:"flex",flexDirection:"column",color:"var(--red-text)"},".cm-oldLines > div":{height:"18px",cursor:"pointer"},".cm-oldLines > div:hover":{color:"var(--primary-text)"},".cm-collapsedLines":{...me,backgroundColor:"var(--bg-a1)",backgroundImage:"none",color:"var(--fg-2)",fontFamily:"var(--font-sans)",fontSize:"var(--text-2xs)",padding:"3px 8px",cursor:"pointer"},".cm-collapsedLines:before, .cm-collapsedLines:after":{content:"none",display:"none"},".cm-collapsedLines:hover":{backgroundColor:"var(--bg-a2)",color:"var(--fg-4)"},".cm-mergeSpacer":{backgroundColor:"var(--bg-a1)"},".cm-spotGutter":{width:"12px"},".cm-spotGutter .cm-gutterElement":{display:"flex",justifyContent:"flex-end"},".cm-spotMark":{width:"3px",height:"100%",marginLeft:"auto",cursor:"default"},...rn(),".cm-line.cm-spot-selected, .cm-line.cm-focus-line":{backgroundImage:"linear-gradient(var(--primary-a1), var(--primary-a1))"},".cm-line.cm-focus-flash":{backgroundImage:"linear-gradient(var(--primary-a3), var(--primary-a3))"},".cm-searchMatch":{backgroundColor:"var(--amber-a2)",outline:"none"},".cm-searchMatch-selected":{backgroundColor:"var(--amber-a4)"},".cm-selectionMatch":{backgroundColor:"var(--bg-a2)"},".cm-panels":{backgroundColor:"var(--background)",color:"var(--fg-3)",fontFamily:"var(--font-sans)"},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--border)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--border)"},".cm-panel":{fontSize:"var(--text-2xs)",padding:"6px 8px"},".cm-panel.cm-find":{padding:"0"},".cm-textfield":{backgroundColor:"var(--bg-2)",border:"none",borderRadius:"var(--radius-control-sm)",color:"var(--fg-4)",fontSize:"var(--text-2xs)",padding:"3px 8px",outline:"none"},".cm-button":{backgroundColor:"var(--bg-a2)",backgroundImage:"none",border:"none",borderRadius:"var(--radius-control-sm)",color:"var(--fg-3)",fontSize:"var(--text-2xs)",padding:"3px 8px"},".cm-button:hover, .cm-button:active":{backgroundColor:"var(--bg-a3)",backgroundImage:"none",color:"var(--fg-4)"},".cm-note-slot":{...me,padding:"6px 8px",fontFamily:"var(--font-sans)",whiteSpace:"normal"}}),un=[cn],dn=[{key:"F3",run:G,shift:z,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Re,scope:"editor search-panel"}],mn={create:e=>{const t=document.createElement("span");return t.className=e?"cm-fold-open":"cm-fold-closed",t}},fn={save:()=>{},openFind:e=>{De(e)}};function hn(e){return e.altKey&&!e.shiftKey}function _n(e){return e.altKey&&e.shiftKey}function Ce(e){return[D.readOnly.of(!e),L.editable.of(!0)]}function pn(e){const t=e.actions??(()=>fn);return[un,e.language??[],lt(),ct(),D.allowMultipleSelections.of(!0),L.clickAddsSelectionRange.of(hn),ut({eventFilter:_n}),dt(),at,mt({top:!0,createPanel:e.findPanel}),ft(),ht.of([...Et(t),...dn,_t,...pt,...gt,...xt]),Ut(e.onLine),en(e.markers??mn),e.editable.of(Ce(!1))]}function V({label:e,icon:t,size:n="icon-xs",onClick:o}){return p.jsx(Ae,{label:e,children:p.jsx(q,{variant:"secondary",size:n,icon:t,"aria-label":e,onClick:o})})}function J(e){Re(e),e.focus()}function gn({view:e}){const t=Se(e.state);return p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"size-5.5 shrink-0"}),p.jsx($e,{value:t.replace,placeholder:"Replace with","aria-label":"Replace with","main-field":"true",className:"max-w-80 flex-initial basis-80",onChange:n=>K(e,t.text,{...t,replace:n.target.value}),onKeyDown:n=>{n.key==="Enter"&&(n.preventDefault(),n.metaKey||n.ctrlKey?se(e):ie(e)),n.key==="Escape"&&(n.preventDefault(),J(e))}}),p.jsx(q,{variant:"secondary",size:"xs",onClick:()=>ie(e),children:"Replace"}),p.jsx(q,{variant:"secondary",size:"xs",onClick:()=>se(e),children:"Replace all"})]})}function xn({view:e,replace:t,canReplace:n,onReplace:o}){const r=Se(e.state),i=x.useRef(null);x.useEffect(()=>{i.current?.focus(),i.current?.select()},[]);const c=Bt(Nt(e.state),r.text),u=t&&n;return p.jsxs("div",{className:"flex flex-col gap-1 px-2 py-1.5 font-sans",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[n&&p.jsx(V,{label:u?"Hide replace":"Show replace",icon:u?"IconChevronDownSmall":"IconChevronRightSmall",onClick:()=>o(!u)}),p.jsx(Qe,{value:r.text,options:r,placeholder:"Find in this file",inputRef:i,onValueChange:d=>K(e,d,r),onOptionsChange:d=>K(e,r.text,d),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),d.shiftKey?z(e):G(e)),d.key==="Escape"&&(d.preventDefault(),J(e))},className:"max-w-80 flex-initial basis-80"}),p.jsxs("span",{className:"flex shrink-0 items-center",children:[p.jsx(V,{label:"Previous match",icon:"IconChevronTopMedium",onClick:()=>z(e)}),p.jsx(V,{label:"Next match",icon:"IconChevronDownMedium",onClick:()=>G(e)})]}),p.jsx("span",{"aria-live":"polite",className:"shrink-0 truncate text-2xs text-fg-2 tabular-nums",children:c}),p.jsx("span",{className:"flex-1"}),p.jsx(V,{label:"Close",icon:"IconCrossSmall",size:"icon-sm",onClick:()=>J(e)})]}),u&&p.jsx(gn,{view:e})]})}function l(e){return new vt(bt.define(e))}function k(e){return a(()=>import("./index-DuIGzFZE.js"),__vite__mapDeps([0,1,2,3])).then(t=>t.sql({dialect:t[e]}))}const we=[s.of({name:"C",extensions:["c","h","ino"],load(){return a(()=>import("./index-Bs28LYAL.js"),__vite__mapDeps([4,2,1])).then(e=>e.cpp())}}),s.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return a(()=>import("./index-Bs28LYAL.js"),__vite__mapDeps([4,2,1])).then(e=>e.cpp())}}),s.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return k("Cassandra")}}),s.of({name:"CSS",extensions:["css"],load(){return a(()=>import("./index-Dl6dJHXS.js"),__vite__mapDeps([5,2,1])).then(e=>e.css())}}),s.of({name:"Go",extensions:["go"],load(){return a(()=>import("./index-BTJDQCx7.js"),__vite__mapDeps([6,2,1,3])).then(e=>e.go())}}),s.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return a(()=>import("./index-DYQMUdQi.js"),__vite__mapDeps([7,2,1,5,8,3])).then(e=>e.html())}}),s.of({name:"Java",extensions:["java"],load(){return a(()=>import("./index-Bg8XC6PL.js"),__vite__mapDeps([9,2,1])).then(e=>e.java())}}),s.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return a(()=>import("./index-BrHERoQu.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript())}}),s.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return a(()=>import("./index-BvwOxJUs.js"),__vite__mapDeps([10,1,7,2,5,8,3])).then(e=>e.jinja())}}),s.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return a(()=>import("./index-DsCq3C1F.js"),__vite__mapDeps([11,2,1])).then(e=>e.json())}}),s.of({name:"JSX",extensions:["jsx"],load(){return a(()=>import("./index-BrHERoQu.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript({jsx:!0}))}}),s.of({name:"LESS",extensions:["less"],load(){return a(()=>import("./index-Bqsc65tu.js"),__vite__mapDeps([12,1,5,2])).then(e=>e.less())}}),s.of({name:"Liquid",extensions:["liquid"],load(){return a(()=>import("./index-CWD5WvZ2.js"),__vite__mapDeps([13,1,7,2,5,8,3])).then(e=>e.liquid())}}),s.of({name:"MariaDB SQL",load(){return k("MariaSQL")}}),s.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return a(()=>import("./index-Cf5v_iOJ.js"),__vite__mapDeps([14,1,3,7,2,5,8])).then(e=>e.markdown())}}),s.of({name:"MS SQL",load(){return k("MSSQL")}}),s.of({name:"MySQL",load(){return k("MySQL")}}),s.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return a(()=>import("./index-Cl1kAC6E.js"),__vite__mapDeps([15,2,1,7,5,8,3])).then(e=>e.php())}}),s.of({name:"PLSQL",extensions:["pls"],load(){return k("PLSQL")}}),s.of({name:"PostgreSQL",load(){return k("PostgreSQL")}}),s.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return a(()=>import("./index-HGQTBwgf.js"),__vite__mapDeps([16,2,1,3])).then(e=>e.python())}}),s.of({name:"Rust",extensions:["rs"],load(){return a(()=>import("./index-Cy4rJbGi.js"),__vite__mapDeps([17,2,1])).then(e=>e.rust())}}),s.of({name:"Sass",extensions:["sass"],load(){return a(()=>import("./index-DdqggMxb.js"),__vite__mapDeps([18,2,1,5])).then(e=>e.sass({indented:!0}))}}),s.of({name:"SCSS",extensions:["scss"],load(){return a(()=>import("./index-DdqggMxb.js"),__vite__mapDeps([18,2,1,5])).then(e=>e.sass())}}),s.of({name:"SQL",extensions:["sql"],load(){return k("StandardSQL")}}),s.of({name:"SQLite",load(){return k("SQLite")}}),s.of({name:"TSX",extensions:["tsx"],load(){return a(()=>import("./index-BrHERoQu.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript({jsx:!0,typescript:!0}))}}),s.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return a(()=>import("./index-BrHERoQu.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript({typescript:!0}))}}),s.of({name:"WebAssembly",extensions:["wat","wast"],load(){return a(()=>import("./index-BO5QshFZ.js"),__vite__mapDeps([19,1,2])).then(e=>e.wast())}}),s.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return a(()=>import("./index-UKKSElMc.js"),__vite__mapDeps([20,2,1])).then(e=>e.xml())}}),s.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return a(()=>import("./index-CO3ht2SW.js"),__vite__mapDeps([21,2,1])).then(e=>e.yaml())}}),s.of({name:"APL",extensions:["dyalog","apl"],load(){return a(()=>import("./apl-B4CMkyY2.js"),[]).then(e=>l(e.apl))}}),s.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return a(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(e=>l(e.asciiArmor))}}),s.of({name:"ASN.1",extensions:["asn","asn1"],load(){return a(()=>import("./asn1-EdZsLKOL.js"),[]).then(e=>l(e.asn1({})))}}),s.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return a(()=>import("./asterisk-B-8jnY81.js"),[]).then(e=>l(e.asterisk))}}),s.of({name:"Brainfuck",extensions:["b","bf"],load(){return a(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(e=>l(e.brainfuck))}}),s.of({name:"Cobol",extensions:["cob","cpy"],load(){return a(()=>import("./cobol-CWcv1MsR.js"),[]).then(e=>l(e.cobol))}}),s.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return a(()=>import("./clike-B9uivgTg.js"),[]).then(e=>l(e.csharp))}}),s.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return a(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>l(e.clojure))}}),s.of({name:"ClojureScript",extensions:["cljs"],load(){return a(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>l(e.clojure))}}),s.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return a(()=>import("./css-BnMrqG3P.js"),[]).then(e=>l(e.gss))}}),s.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return a(()=>import("./cmake-BQqOBYOt.js"),[]).then(e=>l(e.cmake))}}),s.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return a(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(e=>l(e.coffeeScript))}}),s.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return a(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(e=>l(e.commonLisp))}}),s.of({name:"Cypher",extensions:["cyp","cypher"],load(){return a(()=>import("./cypher-C_CwsFkJ.js"),[]).then(e=>l(e.cypher))}}),s.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return a(()=>import("./python-BuPzkPfP.js"),[]).then(e=>l(e.cython))}}),s.of({name:"Crystal",extensions:["cr"],load(){return a(()=>import("./crystal-SjHAIU92.js"),[]).then(e=>l(e.crystal))}}),s.of({name:"D",extensions:["d"],load(){return a(()=>import("./d-pRatUO7H.js"),[]).then(e=>l(e.d))}}),s.of({name:"Dart",extensions:["dart"],load(){return a(()=>import("./clike-B9uivgTg.js"),[]).then(e=>l(e.dart))}}),s.of({name:"diff",extensions:["diff","patch"],load(){return a(()=>import("./diff-DbItnlRl.js"),[]).then(e=>l(e.diff))}}),s.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return a(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([22,23])).then(e=>l(e.dockerFile))}}),s.of({name:"DTD",extensions:["dtd"],load(){return a(()=>import("./dtd-DF_7sFjM.js"),[]).then(e=>l(e.dtd))}}),s.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return a(()=>import("./dylan-DwRh75JA.js"),[]).then(e=>l(e.dylan))}}),s.of({name:"EBNF",load(){return a(()=>import("./ebnf-CDyGwa7X.js"),[]).then(e=>l(e.ebnf))}}),s.of({name:"ECL",extensions:["ecl"],load(){return a(()=>import("./ecl-Cabwm37j.js"),[]).then(e=>l(e.ecl))}}),s.of({name:"edn",extensions:["edn"],load(){return a(()=>import("./clojure-BMjYHr_A.js"),[]).then(e=>l(e.clojure))}}),s.of({name:"Eiffel",extensions:["e"],load(){return a(()=>import("./eiffel-CnydiIhH.js"),[]).then(e=>l(e.eiffel))}}),s.of({name:"Elm",extensions:["elm"],load(){return a(()=>import("./elm-vLlmbW-K.js"),[]).then(e=>l(e.elm))}}),s.of({name:"Erlang",extensions:["erl"],load(){return a(()=>import("./erlang-BNw1qcRV.js"),[]).then(e=>l(e.erlang))}}),s.of({name:"Esper",load(){return a(()=>import("./sql-D0XecflT.js"),[]).then(e=>l(e.esper))}}),s.of({name:"Factor",extensions:["factor"],load(){return a(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([24,23])).then(e=>l(e.factor))}}),s.of({name:"FCL",load(){return a(()=>import("./fcl-Kvtd6kyn.js"),[]).then(e=>l(e.fcl))}}),s.of({name:"Forth",extensions:["forth","fth","4th"],load(){return a(()=>import("./forth-Ffai-XNe.js"),[]).then(e=>l(e.forth))}}),s.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return a(()=>import("./fortran-DYz_wnZ1.js"),[]).then(e=>l(e.fortran))}}),s.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return a(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>l(e.fSharp))}}),s.of({name:"Gas",extensions:["s"],load(){return a(()=>import("./gas-Bneqetm1.js"),[]).then(e=>l(e.gas))}}),s.of({name:"Gherkin",extensions:["feature"],load(){return a(()=>import("./gherkin-heZmZLOM.js"),[]).then(e=>l(e.gherkin))}}),s.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return a(()=>import("./groovy-D9Dt4D0W.js"),[]).then(e=>l(e.groovy))}}),s.of({name:"Haskell",extensions:["hs"],load(){return a(()=>import("./haskell-Cw1EW3IL.js"),[]).then(e=>l(e.haskell))}}),s.of({name:"Haxe",extensions:["hx"],load(){return a(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>l(e.haxe))}}),s.of({name:"HXML",extensions:["hxml"],load(){return a(()=>import("./haxe-H-WmDvRZ.js"),[]).then(e=>l(e.hxml))}}),s.of({name:"HTTP",load(){return a(()=>import("./http-DBlCnlav.js"),[]).then(e=>l(e.http))}}),s.of({name:"IDL",extensions:["pro"],load(){return a(()=>import("./idl-BEugSyMb.js"),[]).then(e=>l(e.idl))}}),s.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return a(()=>import("./javascript-iXu5QeM3.js"),[]).then(e=>l(e.jsonld))}}),s.of({name:"Julia",extensions:["jl"],load(){return a(()=>import("./julia-DuME0IfC.js"),[]).then(e=>l(e.julia))}}),s.of({name:"Kotlin",extensions:["kt","kts"],load(){return a(()=>import("./clike-B9uivgTg.js"),[]).then(e=>l(e.kotlin))}}),s.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return a(()=>import("./livescript-BwQOo05w.js"),[]).then(e=>l(e.liveScript))}}),s.of({name:"Lua",extensions:["lua"],load(){return a(()=>import("./lua-VAEuO923.js"),[]).then(e=>l(e.lua))}}),s.of({name:"mIRC",extensions:["mrc"],load(){return a(()=>import("./mirc-CjQqDB4T.js"),[]).then(e=>l(e.mirc))}}),s.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return a(()=>import("./mathematica-DTrFuWx2.js"),[]).then(e=>l(e.mathematica))}}),s.of({name:"Modelica",extensions:["mo"],load(){return a(()=>import("./modelica-Dc1JOy9r.js"),[]).then(e=>l(e.modelica))}}),s.of({name:"MUMPS",extensions:["mps"],load(){return a(()=>import("./mumps-BT43cFF4.js"),[]).then(e=>l(e.mumps))}}),s.of({name:"Mbox",extensions:["mbox"],load(){return a(()=>import("./mbox-CNhZ1qSd.js"),[]).then(e=>l(e.mbox))}}),s.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return a(()=>import("./nginx-DdIZxoE0.js"),[]).then(e=>l(e.nginx))}}),s.of({name:"NSIS",extensions:["nsh","nsi"],load(){return a(()=>import("./nsis-LY0VT_u5.js"),__vite__mapDeps([25,23])).then(e=>l(e.nsis))}}),s.of({name:"NTriples",extensions:["nt","nq"],load(){return a(()=>import("./ntriples-BfvgReVJ.js"),[]).then(e=>l(e.ntriples))}}),s.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return a(()=>import("./clike-B9uivgTg.js"),[]).then(e=>l(e.objectiveC))}}),s.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return a(()=>import("./clike-B9uivgTg.js"),[]).then(e=>l(e.objectiveCpp))}}),s.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return a(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>l(e.oCaml))}}),s.of({name:"Octave",extensions:["m"],load(){return a(()=>import("./octave-Ck1zUtKM.js"),[]).then(e=>l(e.octave))}}),s.of({name:"Oz",extensions:["oz"],load(){return a(()=>import("./oz-BzwKVEFT.js"),[]).then(e=>l(e.oz))}}),s.of({name:"Pascal",extensions:["p","pas"],load(){return a(()=>import("./pascal--L3eBynH.js"),[]).then(e=>l(e.pascal))}}),s.of({name:"Perl",extensions:["pl","pm"],load(){return a(()=>import("./perl-CdXCOZ3F.js"),[]).then(e=>l(e.perl))}}),s.of({name:"Pig",extensions:["pig"],load(){return a(()=>import("./pig-CevX1Tat.js"),[]).then(e=>l(e.pig))}}),s.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return a(()=>import("./powershell-CFHJl5sT.js"),[]).then(e=>l(e.powerShell))}}),s.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return a(()=>import("./properties-C78fOPTZ.js"),[]).then(e=>l(e.properties))}}),s.of({name:"ProtoBuf",extensions:["proto"],load(){return a(()=>import("./protobuf-ChK-085T.js"),[]).then(e=>l(e.protobuf))}}),s.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return a(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([26,27])).then(e=>l(e.pug))}}),s.of({name:"Puppet",extensions:["pp"],load(){return a(()=>import("./puppet-DMA9R1ak.js"),[]).then(e=>l(e.puppet))}}),s.of({name:"Q",extensions:["q"],load(){return a(()=>import("./q-pXgVlZs6.js"),[]).then(e=>l(e.q))}}),s.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return a(()=>import("./r-B6wPVr8A.js"),[]).then(e=>l(e.r))}}),s.of({name:"RPM Changes",load(){return a(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>l(e.rpmChanges))}}),s.of({name:"RPM Spec",extensions:["spec"],load(){return a(()=>import("./rpm-CTu-6PCP.js"),[]).then(e=>l(e.rpmSpec))}}),s.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return a(()=>import("./ruby-BK5aLJev.js"),[]).then(e=>l(e.ruby))}}),s.of({name:"SAS",extensions:["sas"],load(){return a(()=>import("./sas-B4kiWyti.js"),[]).then(e=>l(e.sas))}}),s.of({name:"Scala",extensions:["scala"],load(){return a(()=>import("./clike-B9uivgTg.js"),[]).then(e=>l(e.scala))}}),s.of({name:"Scheme",extensions:["scm","ss"],load(){return a(()=>import("./scheme-C41bIUwD.js"),[]).then(e=>l(e.scheme))}}),s.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return a(()=>import("./shell-CjFT_Tl9.js"),[]).then(e=>l(e.shell))}}),s.of({name:"Sieve",extensions:["siv","sieve"],load(){return a(()=>import("./sieve-C3Gn_uJK.js"),[]).then(e=>l(e.sieve))}}),s.of({name:"Smalltalk",extensions:["st"],load(){return a(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(e=>l(e.smalltalk))}}),s.of({name:"Solr",load(){return a(()=>import("./solr-DehyRSwq.js"),[]).then(e=>l(e.solr))}}),s.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return a(()=>import("./mllike-CXdrOF99.js"),[]).then(e=>l(e.sml))}}),s.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return a(()=>import("./sparql-DkYu6x3z.js"),[]).then(e=>l(e.sparql))}}),s.of({name:"Spreadsheet",alias:["excel","formula"],load(){return a(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(e=>l(e.spreadsheet))}}),s.of({name:"Squirrel",extensions:["nut"],load(){return a(()=>import("./clike-B9uivgTg.js"),[]).then(e=>l(e.squirrel))}}),s.of({name:"Stylus",extensions:["styl"],load(){return a(()=>import("./stylus-B533Al4x.js"),[]).then(e=>l(e.stylus))}}),s.of({name:"Swift",extensions:["swift"],load(){return a(()=>import("./swift-BzpIVaGY.js"),[]).then(e=>l(e.swift))}}),s.of({name:"sTeX",load(){return a(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>l(e.stex))}}),s.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return a(()=>import("./stex-C3f8Ysf7.js"),[]).then(e=>l(e.stex))}}),s.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return a(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>l(e.verilog))}}),s.of({name:"Tcl",extensions:["tcl"],load(){return a(()=>import("./tcl-DVfN8rqt.js"),[]).then(e=>l(e.tcl))}}),s.of({name:"Textile",extensions:["textile"],load(){return a(()=>import("./textile-CnDTJFAw.js"),[]).then(e=>l(e.textile))}}),s.of({name:"TiddlyWiki",load(){return a(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(e=>l(e.tiddlyWiki))}}),s.of({name:"Tiki wiki",load(){return a(()=>import("./tiki-DGYXhP31.js"),[]).then(e=>l(e.tiki))}}),s.of({name:"TOML",extensions:["toml"],load(){return a(()=>import("./toml-Bm5Em-hy.js"),[]).then(e=>l(e.toml))}}),s.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return a(()=>import("./troff-wAsdV37c.js"),[]).then(e=>l(e.troff))}}),s.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return a(()=>import("./ttcn-CfJYG6tj.js"),[]).then(e=>l(e.ttcn))}}),s.of({name:"TTCN_CFG",extensions:["cfg"],load(){return a(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(e=>l(e.ttcnCfg))}}),s.of({name:"Turtle",extensions:["ttl"],load(){return a(()=>import("./turtle-B1tBg_DP.js"),[]).then(e=>l(e.turtle))}}),s.of({name:"Web IDL",extensions:["webidl"],load(){return a(()=>import("./webidl-ZXfAyPTL.js"),[]).then(e=>l(e.webIDL))}}),s.of({name:"VB.NET",extensions:["vb"],load(){return a(()=>import("./vb-CmGdzxic.js"),[]).then(e=>l(e.vb))}}),s.of({name:"VBScript",extensions:["vbs"],load(){return a(()=>import("./vbscript-BuJXcnF6.js"),[]).then(e=>l(e.vbScript))}}),s.of({name:"Velocity",extensions:["vtl"],load(){return a(()=>import("./velocity-D8B20fx6.js"),[]).then(e=>l(e.velocity))}}),s.of({name:"Verilog",extensions:["v"],load(){return a(()=>import("./verilog-C6RDOZhf.js"),[]).then(e=>l(e.verilog))}}),s.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return a(()=>import("./vhdl-lSbBsy5d.js"),[]).then(e=>l(e.vhdl))}}),s.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return a(()=>import("./xquery-DzFWVndE.js"),[]).then(e=>l(e.xQuery))}}),s.of({name:"Yacas",extensions:["ys"],load(){return a(()=>import("./yacas-BJ4BC0dw.js"),[]).then(e=>l(e.yacas))}}),s.of({name:"Z80",extensions:["z80"],load(){return a(()=>import("./z80-Hz9HOZM7.js"),[]).then(e=>l(e.z80))}}),s.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return a(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>l(e.mscgen))}}),s.of({name:"Xù",extensions:["xu"],load(){return a(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>l(e.xu))}}),s.of({name:"MsGenny",extensions:["msgenny"],load(){return a(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(e=>l(e.msgenny))}}),s.of({name:"Vue",extensions:["vue"],load(){return a(()=>import("./index-DGti80WN.js"),__vite__mapDeps([28,1,7,2,5,8,3])).then(e=>e.vue())}}),s.of({name:"Angular Template",load(){return a(()=>import("./index-BeO3HZi8.js"),__vite__mapDeps([29,1,7,2,5,8,3])).then(e=>e.angular())}})],fe=new Map;function En(e,t=we){const n=e.slice(e.lastIndexOf("/")+1);return s.matchFilename(t,n)}function vn(e,t=we){const n=En(e,t);if(!n)return Promise.resolve(null);const o=fe.get(n.name);if(o)return o;const r=n.load().catch(()=>null);return fe.set(n.name,r),r}const A={margin:3,minSize:4};function bn(e,t,n){const o=new Array(e+2).fill(!1);for(const c of t){const u=Math.max(1,c.from-A.margin),d=Math.min(e,c.to+A.margin);for(let h=u;h<=d;h+=1)o[h]=!0}const r=[];let i=1;for(;i<=e;){if(o[i]){i+=1;continue}const c=i;for(;i<=e&&!o[i];)i+=1;const u={from:c,to:i-1};u.to-u.from+1>=A.minSize&&!n.has(u.from)&&r.push(u)}return r}function Ln(e,t){return e.find(n=>n.from<=t&&t<=n.to)??null}function Me(e){const t=[];for(const n of e.facet(L.decorations))typeof n!="function"&&n.between(0,e.doc.length,(o,r,i)=>{o<r&&i.spec.block&&i.spec.widget&&t.push({from:o,to:r})});return t}function kn(e,t,n,o){const r=e.find(i=>i.from<=t&&t<=i.to);return r?t>=n?r.to<o?r.to+1:Math.max(r.from-1,0):r.from>0?r.from-1:Math.min(r.to+1,o):null}function Tn(e){const t=e.selection;if(!t||e.docChanged||!t.main.empty)return e;const n=e.startState,o=kn(Me(n),t.main.head,n.selection.main.head,n.doc.length);return o===null?e:[e,{selection:Lt.cursor(o),sequential:!0}]}const yn=D.transactionFilter.of(Tn);function An(e,t){const n=`${t}px`;e.dom.style.getPropertyValue("--cm-gutter-width")!==n&&e.dom.style.setProperty("--cm-gutter-width",n)}function he(e){e.requestMeasure({key:"shinsa-gutter-width",read:()=>e.dom.querySelector(".cm-gutters")?.offsetWidth??0,write:t=>An(e,t)})}const Dn=Pe.define(e=>(he(e),{update:t=>{(t.geometryChanged||t.viewportChanged)&&he(t.view)}})),P={scanLimit:500,timeout:20},Z=M.define(),je=kt.define({combine:e=>e[0]??[]}),Ne=M.define();function On(e,t,n){const o=[],r=e?.lines[t-1];if(!e||!r)return o;let i=n;for(let c=0;c<r.length;c+=2){const u=n+(r[c]??0),d=e.classes[r[c+1]??0];d&&u>i&&o.push({from:i,to:u,classes:d}),i=Math.max(i,u)}return o}function Rn(e,t,n,o){const r=t+e.length,i=new Set([t,r]);for(const d of[...n,...o])d.from>t&&d.from<r&&i.add(d.from),d.to>t&&d.to<r&&i.add(d.to);const c=[...i].sort((d,h)=>d-h),u=[];for(const[d,h]of c.slice(0,-1).entries()){const E=c[d+1]??r,g=n.find(m=>m.from<=h&&m.to>=E)?.classes??"",_=o.some(m=>m.from<=h&&m.to>=E);u.push({from:h,to:E,classes:[g,_?"cm-deletedText":""].filter(Boolean).join(" ")})}return u}class Be extends Y{constructor(t,n,o){super(),this.chunk=t,this.a=n,this.tokens=o}chunk;a;tokens;get lines(){const t=this.a.lineAt(this.chunk.fromA).number,n=this.a.lineAt(this.chunk.endA).number;return Array.from({length:n-t+1},(o,r)=>t+r)}eq(t){return t.chunk===this.chunk&&t.tokens===this.tokens}toDOM(){const t=document.createElement("div");t.className="cm-deletedChunk";const n=this.chunk.changes.filter(o=>o.toA>o.fromA).map(o=>({from:this.chunk.fromA+o.fromA,to:this.chunk.fromA+o.toA}));for(const o of this.lines){const r=this.a.line(o),i=t.appendChild(document.createElement("div"));i.className="cm-deletedLine";const c=On(this.tokens,o,r.from);for(const u of Rn(r.text,r.from,c,n)){const d=i.appendChild(document.createElement("span"));u.classes&&(d.className=u.classes),d.textContent=this.a.sliceString(u.from,u.to)}r.length===0&&i.appendChild(document.createElement("br"))}return t}}class Pn extends Oe{constructor(t,n){super(),this.lines=t,this.onOldLine=n}lines;onOldLine;eq(t){return t.lines.join()===this.lines.join()}toDOM(){const t=document.createElement("div");t.className="cm-oldLines";for(const n of this.lines){const o=t.appendChild(document.createElement("div"));o.textContent=String(n),o.addEventListener("mousedown",r=>{r.preventDefault(),r.stopPropagation(),this.onOldLine(n)})}return t}}class Sn extends Y{constructor(t){super(),this.range=t}range;eq(t){return t.range.from===this.range.from&&t.range.to===this.range.to}toDOM(t){const n=document.createElement("div");n.className="cm-collapsedLines";const o=this.range.to-this.range.from+1;return n.textContent=`${o} unchanged ${o===1?"line":"lines"}`,n.addEventListener("mousedown",r=>{r.preventDefault(),t.dispatch({effects:Z.of(this.range.from)})}),n}ignoreEvent(t){return t instanceof MouseEvent}}function In(e,t,n){return[...t.map(r=>({from:e.lineAt(Math.min(r.fromB,e.length)).number,to:e.lineAt(Math.min(Math.max(r.fromB,r.endB),e.length)).number})),...n.map(r=>({from:r,to:r}))]}function Vn(e,t,n){if(n<1||n>e.lines)return null;const o=e.line(n).from;return t.find(r=>r.fromA<r.toA&&r.fromA<=o&&o<=r.endA)??null}function _e(e,t,n){const o=[];for(const r of t.chunks){const i=Math.min(r.fromB,e.length);if(r.toA>r.fromA){const d=new Be(r,t.a,t.tokens);o.push(b.widget({block:!0,side:-2,widget:d}).range(e.lineAt(i).from))}if(r.toB<=r.fromB)continue;const c=e.lineAt(i).number,u=e.lineAt(Math.min(r.endB,e.length)).number;for(let d=c;d<=u;d+=1)o.push(b.line({class:"cm-insertedLine"}).range(e.line(d).from));if(!(!r.precise||r.toA<=r.fromA))for(const d of r.changes)d.toB<=d.fromB||o.push(b.mark({class:"cm-insertedText"}).range(r.fromB+d.fromB,r.fromB+d.toB))}for(const r of t.annotations.oldNotes){const i=Vn(t.a,t.chunks,r.line);if(!i)continue;const c=e.lineAt(Math.min(i.fromB,e.length)).from;o.push(b.widget({block:!0,side:-1,widget:new Ve(r.key,n.registry)}).range(c))}for(const r of t.collapsed)o.push(b.replace({block:!0,widget:new Sn(r)}).range(e.line(r.from).from,e.line(r.to).to));return b.set(o,!0)}function pe(e,t,n,o,r){return bn(e.lines,In(e,t,o),n)}function Cn(e){const t=X.define({create(n){const o=w.of(e.original.split(`
4
4
  `)),r=C.build(o,n.doc,P),i=new Set,c=pe(n.doc,r,i,e.annotations.keep),u={a:o,chunks:r,expanded:i,annotations:e.annotations,collapsed:c,tokens:e.tokens};return{...u,decorations:_e(n.doc,u,e)}},update(n,o){const r=o.state.doc,i=o.docChanged?C.updateB(n.chunks,n.a,r,o.changes,P):n.chunks,c=Ie(o.effects)??n.annotations,u=new Set(n.expanded);let d=n.tokens;for(const _ of o.effects){if(_.is(Ne)&&(d=_.value),!_.is(Z))continue;const m=Ln(n.collapsed,_.value);m&&u.add(m.from)}if(!(i!==n.chunks||c!==n.annotations||u.size!==n.expanded.size||d!==n.tokens))return n;const E=pe(r,i,u,c.keep),g={a:n.a,chunks:i,expanded:u,annotations:c,collapsed:E,tokens:d};return{...g,decorations:_e(r,g,e)}},provide:n=>L.decorations.from(n,o=>o.decorations)});return[t,je.from(t,n=>n.chunks),Tt.of((n,o)=>o instanceof Be?new Pn(o.lines,e.onOldLine):null)]}const ge=/\r\n?|\n/,xe=L.theme({"&":{height:"auto"},".cm-scroller":{overflowX:"auto",overflowY:"hidden"}});function wn(e,t){let n=0,o=0;for(const r of e){if(r.fromB>=t)break;n=r.toB,o=r.toA}return o+Math.max(0,t-n)}function Ee(e,t){const n=Me(e.state).filter(o=>t.some(r=>o.from<=r&&r<=o.to)).map(o=>o.from);return[...new Set(n)].map(o=>yt.of(o))}function Mn(e,t){const n=e.b.state.doc,o=t.filter(c=>c>=1&&c<=n.lines).map(c=>n.line(c).from),r=Ee(e.b,o);if(r.length===0)return;const i=Ee(e.a,o.map(c=>wn(e.chunks,c)));e.b.dispatch({effects:r}),i.length>0&&e.a.dispatch({effects:i})}function ve(e){const t=Reflect.get(e,"config"),n=typeof t=="object"&&t!==null?Reflect.get(t,"base"):null;if(!Array.isArray(n))throw new Error("CodeMirror no longer keeps a state’s extensions on its config.");return n}class be{merge;#t;#e=null;#n=0;#o={a:0,b:0};constructor(){const t=new At({a:{doc:""},b:{doc:""},collapseUnchanged:{margin:A.margin,minSize:A.minSize},diffConfig:P,gutter:!1});t.dom.style.height="100%",t.dom.style.overflow="auto",this.merge=t,this.#t={a:ve(t.a.state),b:ve(t.b.state)},t.dom.addEventListener("scroll",()=>this.#a(),{passive:!0});for(const n of["a","b"]){const o=t[n].scrollDOM;o.addEventListener("scroll",()=>{this.#o[n]=o.scrollLeft},{passive:!0})}}createPair(t,n,o){const r=w.of(t.split(ge)),i=w.of(n.split(ge)),c=C.build(r,i,P),u=this.merge.chunks;this.merge.chunks=c;try{return{a:D.create({doc:r,extensions:[o.a,xe,this.#t.a]}),b:D.create({doc:i,extensions:[o.b,xe,this.#t.b]}),chunks:c,scroll:null}}finally{this.merge.chunks=u}}show(t){const n=this.merge;n.chunks=t.chunks,n.a.setState(t.a),n.b.setState(t.b);for(const o of["a","b"])this.#o[o]!==0&&(n[o].scrollDOM.scrollLeft=0),this.#o[o]=0;this.#e=t.scroll,t.scroll?n.b.dispatch({effects:t.scroll}):this.#n!==0&&(n.dom.scrollTop=0),n.reconfigure({})}remember(t){const n=this.merge;t.a=n.a.state,t.b=n.b.state,t.chunks=n.chunks,t.scroll=this.#e}#a(){const t=this.merge;if(this.#n=t.dom.scrollTop,this.#n<=0){this.#e=null;return}const n=t.dom.getBoundingClientRect().top-t.b.documentTop,o=t.b.lineBlockAtHeight(n);this.#e=L.scrollIntoView(o.from,{y:"start",yMargin:o.top-n})}}function jn(e,t){const n=t[0];return n?e.lineAt(Math.min(n.fromB,e.length)).number:null}function Nn(e,t){return C.build(w.of(e.split(`
5
5
  `)),t,P)}function Bn(e,t,n){const o=e.state.doc,r=Math.min(n,o.lines),i=e.documentTop-t.getBoundingClientRect().top,c=i+e.lineBlockAt(o.line(r).from).top;if(c>=0&&c<t.clientHeight/2)return null;const u=e.lineBlockAt(o.line(Math.max(1,r-A.margin)).from);return Math.max(0,t.scrollTop+i+u.top)}function Fn(e,t,n){e.requestMeasure({key:"shinsa-first-change",read:()=>Bn(e,t,n),write:o=>{o!==null&&(t.scrollTop=o)}})}class qn{#t;#e;#n;#o;#a;constructor(){this.#t=new Map,this.#e=new Set,this.#n=[],this.#o=0,this.#a=!1}add(t,n){this.#o+=1,this.#t.set(t,{id:this.#o,element:t,label:n}),this.#s()}remove(t){this.#t.delete(t)&&this.#s()}subscribe=t=>(this.#e.add(t),()=>{this.#e.delete(t)});read=()=>this.#n;#s(){this.#a||(this.#a=!0,queueMicrotask(()=>{this.#a=!1,this.#n=[...this.#t.values()];for(const t of this.#e)t()}))}}const Fe=M.define(),qe={lines:[],classes:[""],version:0},Hn=30,Le=new Map;function zn(e){const t=Le.get(e);if(t)return t;const n=b.mark({class:e});return Le.set(e,n),n}function Gn(e,t,n,o){const r=[];let i=0;t.iterChangedRanges((c,u,d,h)=>{const E=n.lineAt(c).number-1,g=n.lineAt(u).number-1,_=o.lineAt(h).number-1;for(let m=i;m<E;m+=1)r.push(e[m]);for(;r.length<=_;)r.push(void 0);i=Math.max(i,g+1)});for(let c=i;c<n.lines;c+=1)r.push(e[c]);return r}function ke(e,t){let n=-1,o=-1;for(let r=0;r<t;r+=1)e[r]===void 0&&(n<0&&(n=r),o=r+1);return n<0?null:{from:n,to:o}}const T=X.define({create:()=>qe,update(e,t){let n=e;t.docChanged&&(n={lines:Gn(e.lines,t.changes,t.startState.doc,t.state.doc),classes:e.classes,version:e.version+1});for(const o of t.effects){if(!o.is(Fe)||o.value.version!==n.version)continue;const r=n.lines.slice(0,o.value.total);for(const[i,c]of o.value.lines.entries())r[o.value.from+i]=c;n={lines:r,classes:o.value.classes,version:n.version}}return n}});function Te(e){const t=new Dt,{lines:n,classes:o}=e.state.field(T),r=e.state.doc;for(const{from:i,to:c}of e.visibleRanges)for(let u=r.lineAt(i).number;u<=r.lines;u+=1){const d=r.line(u);if(d.from>c)break;const h=n[u-1];if(!h)continue;let E=d.from;for(let g=0;g<h.length;g+=2){const _=Math.min(d.to,d.from+(h[g]??0)),m=o[h[g+1]??0];m&&_>E&&t.add(E,_,zn(m)),E=Math.max(E,_)}}return t.finish()}class Kn{constructor(t,n){this.view=t,this.options=n,this.decorations=Te(t);const o=t.state.field(T);ke(o.lines,t.state.doc.lines)&&this.#o(void 0)}view;options;decorations;#t=null;#e=null;update(t){const n=t.startState.field(T)!==t.state.field(T);t.docChanged&&this.#n(),(n||t.viewportChanged)&&(this.decorations=Te(t.view))}destroy(){this.#t?.(),this.#e&&clearTimeout(this.#e)}#n(){this.options.grammar&&(this.#e&&clearTimeout(this.#e),this.#e=setTimeout(()=>{this.#e=null;const t=this.view.state.field(T);this.#o(ke(t.lines,this.view.state.doc.lines))},this.options.delayMs??Hn))}#o(t){const n=this.options.grammar;if(!n)return;this.#t?.();const o={doc:this.options.doc,grammar:n,text:this.view.state.doc.toString(),version:this.view.state.field(T).version,...t===void 0?{}:{need:t}};this.#t=this.options.client.request(o,r=>{We(r)||this.view.dispatch({effects:Fe.of({version:r.version,from:r.from,lines:Je(r.offsets,r.data),total:r.total,classes:r.classes})})})}}function Qn(e){const t=e.initial;return[T.init(()=>t?{lines:t.lines,classes:t.classes,version:0}:qe),Pe.define(n=>new Kn(n,e),{decorations:n=>n.decorations})]}const He=Ot.define(),$n=24;function Wn(e){typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:250}):setTimeout(e,16)}function ye(e,t){return e.doc.length===t.length&&e.doc.toString()===t}class Jn{registry=new Ft;spotHints=new qn;findHost=new jt;editable=new B;language=new B;latest={onComment:null,onEdit:()=>{},onSave:()=>{}};chevronMarkup="";#t;#e;#n=new Map;#o=new Map;#a=tn(()=>this.chevronMarkup);#s=null;#l=null;#r=null;#u=!1;#c=null;#m=null;#i=null;#d=!1;constructor(t){this.#t=t,this.#e=t.tokens??Ue}get views(){return this.#i===null?null:this.#u&&this.#r?{a:this.#r.merge.a,b:this.#r.merge.b}:this.#s?{a:null,b:this.#s}:null}get current(){return this.#i}get chunks(){return this.#u&&this.#r?this.#r.merge.chunks:[]}selectView(t){return this.#i===t?this.views?.b??null:null}readText(t){const n=this.selectView(t);return n?n.state.doc.toString():(this.#n.get(t)?.state??this.#o.get(t)?.b)?.doc.toString()??null}show(t,n){this.#p(),this.#i=n.key,n.split&&n.original!==null?this.#v(t,n,n.original):this.#E(t,n)}prefetchPair(t){this.#d||t.key===this.#i||(this.#r??=new be,this.#g(this.#r,{...t,baseline:null,target:!1,split:!0,annotations:{a:Q,b:Q}}))}hide(t){this.#p(),this.#l?.parentElement===t&&this.#l.remove(),this.#r?.merge.dom.parentElement===t&&this.#r.merge.dom.remove(),this.#i=null,this.#c=null}destroy(){this.#d=!0,this.#r?.merge.destroy(),this.#s?.destroy(),this.#r=null,this.#s=null,this.#l=null,this.#n.clear(),this.#o.clear(),this.#i=null,this.#c=null}#p(){if(this.#i===null)return;if(this.#u){const o=this.#o.get(this.#i);o&&this.#r&&this.#r.remember(o);return}const t=this.#s,n=this.#n.get(this.#i);!t||!n||(n.state=t.state,this.#m!==n&&(n.scroll=t.scrollSnapshot()))}#E(t,n){this.#r?.merge.dom.remove(),this.#u=!1;const o=this.#b(),r=this.#l;r.parentElement!==t&&t.appendChild(r);const i=this.#L(n);this.#c=i,o.setState(i.state),i.scroll?o.dispatch({effects:i.scroll}):i.placed||this.#T(o,n),i.placed=!0,this.#k(o,i),n.original!==null&&this.#D(o,n,n.original),this.#x(i,[o])}#v(t,n,o){this.#l?.remove(),this.#r??=new be;const r=this.#r;r.merge.dom.parentElement!==t&&t.appendChild(r.merge.dom),this.#u=!0;const i=this.#g(r,{...n,original:o});this.#c=i,r.show(i),!i.placed&&!n.target&&this.#h(r.merge.b,r.merge.dom,i.chunks),i.placed=!0,this.#x(i,[r.merge.a,r.merge.b])}#g(t,n){const o=n.original,r=this.#o.get(n.key);if(r&&r.original===o&&ye(r.b,n.content))return this.#f(this.#o,r),r;const i={key:n.key,path:n.path,original:o,attached:!1,placed:!1,...t.createPair(o,n.content,{a:this.#_("old",n,!1),b:this.#_("new",n,!1)})};return this.#f(this.#o,i),i}#f(t,n){t.delete(n.key),t.set(n.key,n);for(const[o]of t){if(t.size<=(this.#t.limit??$n))break;o!==n.key&&o!==this.#i&&t.delete(o)}}#b(){if(this.#s)return this.#s;const t=document.createElement("div");return t.className="flex min-h-0 flex-1 flex-col",this.#l=t,this.#s=new L({parent:t}),this.#s}#L(t){const n=this.#n.get(t.key);if(n&&n.original===t.original&&ye(n.state,t.content))return this.#f(this.#n,n),n;const o={key:t.key,path:t.path,original:t.original,state:D.create({doc:t.content,extensions:this.#_("new",t,t.original!==null)}),scroll:null,attached:!1,placed:!1};return this.#f(this.#n,o),o}#k(t,n){this.#m=n,t.requestMeasure({key:"shinsa-settled",read:()=>null,write:()=>{this.#m===n&&(this.#m=null)}})}#T(t,n){t.scrollDOM.scrollTop=0,!n.target&&(n.original!==null?this.#h(t,t.scrollDOM,t.state.facet(je)):n.baseline!==null&&this.#h(t,t.scrollDOM,Nn(n.baseline,t.state.doc)))}#h(t,n,o){const r=jn(t.state.doc,o);r!==null&&Fn(t,n,r)}#_(t,n,o){const r=t==="old"?n.original??"":n.content,i=re(n.path,r),c=i?this.#e.select(i,r):null,u=[pn({language:null,editable:t==="new"?this.editable:new B,onLine:(d,h)=>this.#A(t,d,h),findPanel:this.findHost.createPanel,actions:()=>({save:()=>this.latest.onSave(),openFind:this.findHost.open}),markers:this.#a}),this.language.of(de),yn,Dn,$t(this.registry,t==="new"?n.annotations.b:n.annotations.a,this.spotHints),Qn({client:this.#e,doc:`${n.key}\0${t}`,grammar:i,initial:c})];return t==="new"&&u.push(this.#y()),o&&n.original!==null&&u.push(Cn({original:n.original,tokens:i?this.#e.select(i,n.original):null,registry:this.registry,annotations:n.annotations.b,onOldLine:d=>this.latest.onComment?.("old",d,null)})),u}#y(){return L.updateListener.of(t=>{t.docChanged&&t.transactions.some(n=>!n.annotation(He))&&this.latest.onEdit()})}#A(t,n,o){const r=this.latest.onComment;if(!r)return!1;const i=wt(n,Wt(o));return r(t,i.line,i.endLine),!0}#D(t,n,o){const r=re(n.path,o);if(!r)return;const i=u=>{this.#i===n.key&&!this.#d&&t.dispatch({effects:Ne.of(u)})},c=this.#e.select(r,o);if(c){i(c);return}this.#e.request({doc:`${n.key}\0original`,grammar:r,text:o,version:0},u=>{if(!("done"in u)||!u.done)return;const d=this.#e.select(r,o);d&&i(d)})}#x(t,n){if(t.attached)return;(this.#t.idle??Wn)(()=>{this.#d||this.#c!==t||this.#t.language(t.path).then(r=>{if(!(this.#d||this.#c!==t||t.attached)){t.attached=!0;for(const i of n)i.dispatch({effects:this.language.reconfigure(r??de)})}})})}}function Un(e,t){const n=e.state.doc.toString();if(n===t)return;const o=St(n,t).map(r=>({from:r.fromA,to:r.toA,insert:t.slice(r.fromB,r.toB)}));e.dispatch({changes:o,annotations:[He.of(!0),It.addToHistory.of(!1)]})}function Xn(e,t,n,o,r){const i=d=>e.filter(h=>h.side===d).map(h=>({key:h.key,line:h.line})),c={notes:i("new"),oldNotes:r?[]:i("old"),spots:t,keep:n,focus:o};return{a:{...Q,notes:i("old")},b:c}}function Yn(e,t){const n=e.state.doc,o=n.line(Math.min(Math.max(t,1),n.lines));e.dispatch({effects:[Z.of(o.number),L.scrollIntoView(o.from,{y:"center"})],selection:{anchor:o.from}})}function Zn({registry:e}){return x.useSyncExternalStore(e.subscribe,e.read).map(n=>p.jsx(x.Fragment,{children:H.createPortal(p.jsx(Ae,{side:"right",followCursor:!0,label:p.jsx("span",{className:"whitespace-pre-line",children:n.label}),children:p.jsx("span",{className:"block size-full"})}),n.element)},n.id))}function eo(e){const t=x.useRef(null),n=e??t;return n.current??=new Jn({language:vn}),x.useEffect(()=>{if(!e)return()=>{t.current?.destroy(),t.current=null}},[e]),n.current}function ro(e){const{path:t,original:n,split:o,editable:r,notes:i,spots:c,keep:u,focus:d,reveal:h,handle:E}=e,g=n!==null,_=e.docKey??`${t}\0${g?"diff":"file"}`,m=eo(e.session);m.latest=e;const j=x.useRef(null),ee=x.useRef(null),O=x.useRef(e);O.current=e;const S=x.useSyncExternalStore(m.findHost.subscribe,m.findHost.read),I=JSON.stringify(Xn(i,c,u,d,o&&g)),N=i.map(f=>f.key).join("\0"),te=x.useRef(I);return te.current=I,x.useLayoutEffect(()=>{const f=j.current;m.chevronMarkup=ee.current?.innerHTML??"",f&&(m.show(f,{key:_,path:t,content:O.current.content,original:n,baseline:O.current.baseline??null,target:O.current.reveal!==null,split:o&&n!==null,annotations:JSON.parse(te.current)}),Vt(Ct.shown,t))},[m,_,t,n,o]),x.useLayoutEffect(()=>{const f=j.current;return()=>{f&&m.hide(f)}},[m]),x.useLayoutEffect(()=>{const f=m.views;if(!f||m.current!==_)return;const v=JSON.parse(I);f.b.dispatch({effects:$.of(v.b)}),f.a?.dispatch({effects:$.of(v.a)}),f.a&&Mn({a:f.a,b:f.b,chunks:m.chunks},v.b.keep)},[m,I,_,n,o]),x.useLayoutEffect(()=>{m.current===_&&m.views?.b.dispatch({effects:m.editable.reconfigure(Ce(r))})},[m,r,_,n,o]),x.useLayoutEffect(()=>{const f=m.views;!f||!h||m.current!==_||Yn(h.side==="old"&&f.a?f.a:f.b,h.line)},[m,h?.key,_,n,o]),x.useLayoutEffect(()=>{const f=m.registry,v=new Set(N?N.split("\0"):[]);if(f.retain(v),typeof ResizeObserver>"u"||v.size===0)return;const R=new ResizeObserver(y=>{for(const ne of y){const oe=ne.target.dataset.slot;oe&&f.recordHeight(oe,ne.target.offsetHeight)}m.views?.b.requestMeasure(),m.views?.a?.requestMeasure()});for(const y of f.list())R.observe(y);return()=>R.disconnect()},[m,N]),x.useImperativeHandle(E,()=>({openFind:()=>{const f=m.selectView(_);f&&m.findHost.open(f,!1)},openGotoLine:()=>{const f=m.selectView(_);f&&Pt(f)},run:f=>{const v=m.views,R=Rt(f);if(!v||!R||m.current!==_)return;const y=v.a?.hasFocus?v.a:v.b;y.focus(),R.run(y,{save:()=>m.latest.onSave(),openFind:m.findHost.open})},readText:()=>m.readText(_)??O.current.content,replaceText:f=>{const v=m.selectView(_);v&&Un(v,f)}}),[m,_]),p.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[p.jsx("span",{ref:ee,hidden:!0,children:p.jsx(Xe,{name:"IconChevronRightSmall"})}),p.jsx("div",{ref:j,className:"@container flex min-h-0 flex-1 flex-col"}),S.panel&&H.createPortal(p.jsx(xn,{view:S.panel.view,replace:S.replace,canReplace:r,onReplace:m.findHost.showReplace}),S.panel.dom),p.jsx(Zn,{registry:m.spotHints}),i.map(f=>p.jsx(x.Fragment,{children:H.createPortal(e.renderNote(f),m.registry.upsert(f.key))},f.key))]})}export{ro as default,vn as requestLanguage};