@open-mercato/cezar 0.9.1-pr694.813 → 0.9.1-pr694.821
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/codex-ui-mapper.js +27 -0
- package/dist/core/codex-ui-mapper.js.map +1 -1
- package/dist/server/forge/github.d.ts +1 -0
- package/dist/server/forge/github.js +12 -2
- package/dist/server/forge/github.js.map +1 -1
- package/dist/server/forge/types.d.ts +2 -0
- package/dist/server/project-context.d.ts +4 -0
- package/dist/server/project-context.js +2 -1
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/server.d.ts +5 -0
- package/dist/server/server.js +31 -9
- package/dist/server/server.js.map +1 -1
- package/package.json +1 -1
- package/web/dist/assets/arrow-left-BWue3Imk.js +1 -0
- package/web/dist/assets/bundle-mjs-BT31bpU6.js +1 -0
- package/web/dist/assets/{centered-state-D-hkkRHv.js → centered-state-DsblJe6Q.js} +2 -2
- package/web/dist/assets/{chunk-BO2N2NFS-DtrdTCWa.js → chunk-BO2N2NFS-DE6qKn3r.js} +8 -8
- package/web/dist/assets/circle-check-TKq6_8_Y.js +1 -0
- package/web/dist/assets/circle-x-bH39f-Yh.js +1 -0
- package/web/dist/assets/commit-list-CAwllMBX.js +1 -0
- package/web/dist/assets/compare-variants-JnaeMTz5.js +1 -0
- package/web/dist/assets/{core-DePtBHcl.js → core-BCsw8oQw.js} +1 -1
- package/web/dist/assets/diff-Drvekr61.js +3 -0
- package/web/dist/assets/{diff-view-BBgUutQ0.js → diff-view-Ct3kYFRM.js} +2 -2
- package/web/dist/assets/dist-CngV8tyE.js +1 -0
- package/web/dist/assets/{ellipsis-vertical-DFAnsUi4.js → ellipsis-vertical-WowqAN6-.js} +1 -1
- package/web/dist/assets/{file-vT36R94R.js → file-BWgi5VOt.js} +1 -1
- package/web/dist/assets/{git-pull-request-BvjQwr12.js → git-pull-request-D8yt-2Tr.js} +1 -1
- package/web/dist/assets/git-toolbar-BLqu97v8.js +1 -0
- package/web/dist/assets/github-hrWK-ST8.js +1 -0
- package/web/dist/assets/highlighted-body-OFNGDK62-BL-MfFgl.js +1 -0
- package/web/dist/assets/image-preview-B3W7bWIq.js +1 -0
- package/web/dist/assets/index-B96YnNHc.js +22 -0
- package/web/dist/assets/index-DdBHg6_F.css +2 -0
- package/web/dist/assets/lib-BQXq3kEf.js +1 -0
- package/web/dist/assets/lib-BxQXEXDF.js +1 -0
- package/web/dist/assets/mermaid-GHXKKRXX-C4jxqUUb.js +1 -0
- package/web/dist/assets/project-router-CnKsyZKI.js +1 -0
- package/web/dist/assets/react-runtime-CCIEwYL0.js +9 -0
- package/web/dist/assets/{refresh-cw-BgVxWSof.js → refresh-cw-CFp_jUZr.js} +1 -1
- package/web/dist/assets/repo-git-DnkvanyM.js +1 -0
- package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/web/dist/assets/{run-diff-DeWQ1xve.js → run-diff-LyXkHJCR.js} +1 -1
- package/web/dist/assets/run-header-BtH23tbQ.js +1 -0
- package/web/dist/assets/{search-x-CbHLclyX.js → search-x-CaddQd7u.js} +1 -1
- package/web/dist/assets/skill-empty-hint-D5QzmqHj.js +1 -0
- package/web/dist/assets/skills-CE0HAI_G.js +1 -0
- package/web/dist/assets/{square-terminal-DRmz43dF.js → square-terminal-CoE5Kj-S.js} +1 -1
- package/web/dist/assets/tab-link-BbQLZUG5.js +1 -0
- package/web/dist/assets/task-changes-BYNpnV0E.js +1 -0
- package/web/dist/assets/task-commits-DRnMTXtG.js +1 -0
- package/web/dist/assets/task-files-DAqPuHp1.js +2 -0
- package/web/dist/assets/{task-thread-x1axqNnn.js → task-thread-DMM5s2zt.js} +2 -2
- package/web/dist/assets/textarea-Dd8d_Pwi.js +1 -0
- package/web/dist/assets/{trash-2-ObVP5T4c.js → trash-2-aYhsIRM2.js} +1 -1
- package/web/dist/assets/{triangle-alert-CHtGkjPK.js → triangle-alert-BMsU3ymT.js} +1 -1
- package/web/dist/assets/{upload-Dx__Y6Lu.js → upload-DH2pWIfO.js} +1 -1
- package/web/dist/assets/use-desktop-BAHxMKrE.js +1 -0
- package/web/dist/assets/utils-D27OaPrA.js +1 -0
- package/web/dist/assets/{workflows-C3gTBtmF.js → workflows-DCkK4Bsn.js} +2 -2
- package/web/dist/assets/zoomable-image-BBB-AoPi.js +1 -0
- package/web/dist/index.html +14 -12
- package/web/dist/assets/arrow-left-BmHnLe4M.js +0 -1
- package/web/dist/assets/bundle-mjs-BegPhL5c.js +0 -1
- package/web/dist/assets/circle-check-CH4jMJue.js +0 -1
- package/web/dist/assets/commit-list-BXNfseD5.js +0 -1
- package/web/dist/assets/compare-variants-CkvpSWZa.js +0 -1
- package/web/dist/assets/diff-CITBzanN.js +0 -3
- package/web/dist/assets/dist-C553orO_.js +0 -1
- package/web/dist/assets/git-toolbar-ChCEnVjR.js +0 -1
- package/web/dist/assets/github-B8nK4e73.js +0 -1
- package/web/dist/assets/highlighted-body-OFNGDK62-BuFJwunK.js +0 -1
- package/web/dist/assets/image-preview-B6kVovYD.js +0 -1
- package/web/dist/assets/index-BWzcnzgp.js +0 -30
- package/web/dist/assets/index-pJfUoRGK.css +0 -2
- package/web/dist/assets/lib-DPEZDBUN.js +0 -1
- package/web/dist/assets/lib-uHpeUPzK.js +0 -1
- package/web/dist/assets/mermaid-GHXKKRXX-CN2zQue0.js +0 -1
- package/web/dist/assets/project-router-C-gp_QmI.js +0 -1
- package/web/dist/assets/repo-git-DW8ekpNQ.js +0 -1
- package/web/dist/assets/run-header-BaLnTHQf.js +0 -1
- package/web/dist/assets/skill-empty-hint-CzXygdIH.js +0 -1
- package/web/dist/assets/skills-Bt9YVDdo.js +0 -1
- package/web/dist/assets/tab-link-C2tgsylt.js +0 -1
- package/web/dist/assets/task-changes-CluQWIkd.js +0 -1
- package/web/dist/assets/task-commits-BJRUd8fY.js +0 -1
- package/web/dist/assets/task-files-CpWfXD2B.js +0 -2
- package/web/dist/assets/textarea-BhdkPlu6.js +0 -1
- package/web/dist/assets/use-desktop-BB0Ck5sN.js +0 -1
- package/web/dist/assets/utils-B8xGEgP3.js +0 -1
- package/web/dist/assets/zoomable-image-Bb6ydBLq.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./utils-D27OaPrA.js";var t=e(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./utils-D27OaPrA.js";var t=e(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Dn as r}from"./centered-state-DsblJe6Q.js";import{t as i}from"./utils-D27OaPrA.js";import{t as a}from"./lib-BQXq3kEf.js";var o=e(t(),1),s=n(),c=41;function l({slot:e,commits:t,className:n}){let r=t.length>150,l=(0,o.useRef)(null),d=(0,o.useRef)(null),[f,p]=(0,o.useState)(0);(0,o.useLayoutEffect)(()=>{if(!r)return;let e=()=>{let e=l.current,t=d.current;!e||!t||p(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[r]);let m=t.map(e=>(0,s.jsx)(u,{commit:e},e.sha));return(0,s.jsx)(`div`,{ref:e=>{l.current=e,e&&(d.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":r,className:i(`flex flex-col divide-y divide-border px-2 py-1 md:px-4`,n),children:r?(0,s.jsx)(a,{scrollRef:d,startMargin:f,itemSize:c,children:m}):m})}function u({commit:e}){return(0,s.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_41px] [content-visibility:auto]`,children:(0,s.jsxs)(r,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:`flex min-w-0 items-baseline gap-3 rounded-sm px-2 py-2.5 hover:bg-muted`,children:[(0,s.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),(0,s.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:e.subject}),(0,s.jsxs)(`span`,{className:`hidden shrink-0 text-[11px] text-soft-foreground sm:inline`,children:[e.author,` · `,e.when]})]})})}export{l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,Et as i,In as a,Rn as o,V as s,Vn as c,a as l,an as u,i as d,k as f,mt as p,t as m}from"./centered-state-DsblJe6Q.js";import{t as h}from"./utils-D27OaPrA.js";import{t as g}from"./search-x-CaddQd7u.js";import{i as _,n as v,r as y,t as b}from"./run-diff-LyXkHJCR.js";import{c as x,t as S}from"./project-router-CnKsyZKI.js";import{At as C,Ot as w,X as T,Xt as E,Y as D,Z as O,_ as k,an as A,d as j,f as M,g as N,h as P,ht as F,m as I,p as L,t as R,u as z,x as B}from"./index-B96YnNHc.js";var V=e(t(),1),H=n();function U(){let{groupId:e}=a(),t=s(e),n=c();if((0,V.useEffect)(()=>{e&&n.invalidateQueries({queryKey:r.groups.detail(e)})},[n,e,(p().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,H.jsx)(D,{});if(t.isError){let e=t.error instanceof i&&t.error.status===404;return(0,H.jsx)(`div`,{"data-route":`compare`,className:`flex min-h-full flex-col`,children:(0,H.jsx)(m,{icon:e?(0,H.jsx)(g,{}):(0,H.jsx)(E,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load the variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,H.jsx)(l,{asChild:!0,variant:`outline`,children:(0,H.jsx)(S,{to:`/`,children:`Back to tasks`})})})})}return(0,H.jsx)(W,{groupId:e,variants:t.data.runs})}function W({groupId:e,variants:t}){let n=x(),i=c(),[a,s]=(0,V.useState)(null),l=t.every(e=>T.has(e.status)),p=t[0]?F(t[0]):``,m=o({mutationFn:t=>u(e,t),onSuccess:(t,a)=>{i.invalidateQueries({queryKey:r.runs.all}),i.invalidateQueries({queryKey:r.groups.detail(e)}),n(`/tasks/${t.winner?.id??a}`)},onError:e=>d(e.message,{tone:`danger`})});return(0,H.jsxs)(`div`,{"data-route":`compare`,className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-5 md:px-6`,children:[(0,H.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,H.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,H.jsx)(E,{className:`size-5 shrink-0 text-violet`,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,title:p,children:p})]}),(0,H.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[t.length,` variants of the same task, each in its own worktree — pick the diff you want to keep. The others are cancelled and archived, their worktrees and branches removed.`]})]}),(0,H.jsx)(`div`,{"data-slot":`compare-columns`,className:h(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,H.jsx)(G,{variant:e,allTerminal:l,pickPending:m.isPending,onPick:()=>s(e)},e.id))}),(0,H.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-2`,children:t.map(e=>(0,H.jsx)(K,{variant:e},e.id))}),(0,H.jsx)(z,{open:a!==null,onOpenChange:e=>!e&&s(null),children:(0,H.jsxs)(L,{children:[(0,H.jsxs)(N,{children:[(0,H.jsxs)(k,{children:[`Pick variant `,a?.variant,`?`]}),(0,H.jsxs)(I,{children:[`Variant `,a?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,H.jsxs)(P,{children:[(0,H.jsx)(M,{children:`Keep comparing`}),(0,H.jsxs)(j,{"data-slot":`confirm-pick`,onClick:()=>{a&&m.mutate(a.id),s(null)},children:[(0,H.jsx)(f,{"aria-hidden":`true`}),`Pick variant `,a?.variant]})]})]})})]})}function G({variant:e,allTerminal:t,pickPending:n,onPick:r}){let i=C(e),a=O(e.costUsd);return(0,H.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-violet/15 font-mono text-xs font-semibold text-violet`,children:e.variant}),(0,H.jsx)(R,{dot:i.tone,pulse:i.pulse,children:i.label}),(0,H.jsxs)(`span`,{className:`ml-auto shrink-0 font-mono text-[11px] text-soft-foreground tabular-nums`,children:[w(e.tokensUsed),a?` · ${a}`:``]})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,H.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,H.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,H.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,H.jsx)(B,{children:e.handoffExcerpt})}):(0,H.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,H.jsxs)(l,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,H.jsx)(f,{"aria-hidden":`true`}),`Pick this one`]})]})}function K({variant:e}){let[t,n]=(0,V.useState)(!1);return(0,H.jsxs)(v,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,H.jsxs)(_,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,H.jsx)(A,{className:h(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,H.jsx)(y,{children:(0,H.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,H.jsx)(b,{runId:e.id})})})]})}export{U as CompareVariantsRoute};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as e,d as t,i as n,l as r,n as i,o as a,r as o,t as s,u as c}from"./lib-uHpeUPzK.js";var l=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function u(e){return d(e)}function d(e){return Array.isArray(e)?f(e):e instanceof RegExp?e:typeof e==`object`?p(e):e}function f(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=d(e[n]);return t}function p(e){let t={};for(let n in e)t[n]=d(e[n]);return t}function m(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function h(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?h(e.substring(0,e.length-1)):e.substr(~t+1)}var g=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,_=class{static hasCaptures(e){return e===null?!1:(g.lastIndex=0,g.test(e))}static replaceCaptures(e,t,n){return e.replace(g,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function v(e,t){return e<t?-1:+(e>t)}function ee(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=v(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function te(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ne(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var re=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},y=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ce(e),t)}static createFromParsedTheme(e,t){return ue(e,t)}_cachedMatchRoot=new re(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>ae(e.parent,t.parentScopes));return n?new se(n.fontStyle,n.foreground,n.background):null}},ie=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ae(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!oe(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function oe(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var se=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ce(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&te(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&te(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new le(l,u,e,o,s,c)}}return n}var le=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},b=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(b||{});function ue(e,t){e.sort((e,t)=>{let n=v(e.scope,t.scope);return n!==0||(n=ee(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new de(t),o=new se(n,a.getId(r),a.getId(i)),s=new me(new pe(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new y(a,o,s)}var de=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},fe=Object.freeze([]),pe=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||fe,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},me=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),pe.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ee(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new pe(e,t,n,r,i))}},x=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=ge(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function he(e){return e}function ge(e){return e}function S(e,t){let n=[],r=ve(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(_e(i)){let e=[];do e.push(i),i=r.next();while(_e(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function _e(e){return!!e&&!!e.match(/[\w\.:]+/)}function ve(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function ye(e){typeof e.dispose==`function`&&e.dispose()}var C=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},be=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Se=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new C(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new xe;for(let n of e)Ce(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof C){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Ce(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof C?w({baseGrammar:a,selfGrammar:i},r):we(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new C(e))}function we(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Te([r],t,n)}}function w(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Te(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Te(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Te(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?m({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Te(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=je(i);switch(a.kind){case 0:w({...t,selfGrammar:t.baseGrammar},n);break;case 1:w(t,n);break;case 2:we(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?we(a.ruleName,i,n):w(i,n)}else a.kind===4?n.add(new be(a.scopeName,a.ruleName)):n.add(new C(a.scopeName));break}}}var Ee=class{kind=0},De=class{kind=1},Oe=class{constructor(e){this.ruleName=e}kind=2},ke=class{constructor(e){this.scopeName=e}kind=3},Ae=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function je(e){if(e===`$base`)return new Ee;if(e===`$self`)return new De;let t=e.indexOf(`#`);return t===-1?new ke(e):t===0?new Oe(e.substring(1)):new Ae(e.substring(0,t),e.substring(t+1))}var Me=/\\(\d+)/,Ne=/\\(\d+)/g,Pe=-1,Fe=-2;function Ie(e){return e}function Le(e){return e}var T=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=_.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=_.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${h(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:_.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:_.replaceCaptures(this._contentName,e,t)}},Re=class extends T{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},ze=class extends T{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new E(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new D,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Be=class extends T{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new D,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ve=class extends T{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new E(i,this.id),this.beginCaptures=a,this._end=new E(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new D;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},He=class extends T{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new E(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new E(o,Fe),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new D;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new D,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Ue=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Re(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new ze(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=m({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Be(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new He(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Ve(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=je(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Be||e instanceof Ve||e instanceof He)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},E=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Me.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Ne.lastIndex=0,this.source.replace(Ne,(e,t)=>ne(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},D=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new We(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new We(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},We=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
1
|
+
import{c as e,d as t,i as n,l as r,n as i,o as a,r as o,t as s,u as c}from"./lib-BxQXEXDF.js";var l=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function u(e){return d(e)}function d(e){return Array.isArray(e)?f(e):e instanceof RegExp?e:typeof e==`object`?p(e):e}function f(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=d(e[n]);return t}function p(e){let t={};for(let n in e)t[n]=d(e[n]);return t}function m(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function h(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?h(e.substring(0,e.length-1)):e.substr(~t+1)}var g=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,_=class{static hasCaptures(e){return e===null?!1:(g.lastIndex=0,g.test(e))}static replaceCaptures(e,t,n){return e.replace(g,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function v(e,t){return e<t?-1:+(e>t)}function ee(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=v(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function te(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ne(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var re=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},y=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ce(e),t)}static createFromParsedTheme(e,t){return ue(e,t)}_cachedMatchRoot=new re(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>ae(e.parent,t.parentScopes));return n?new se(n.fontStyle,n.foreground,n.background):null}},ie=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ae(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!oe(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function oe(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var se=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ce(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8;break}}let s=null;typeof i.settings.foreground==`string`&&te(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&te(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new le(l,u,e,o,s,c)}}return n}var le=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},b=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(b||{});function ue(e,t){e.sort((e,t)=>{let n=v(e.scope,t.scope);return n!==0||(n=ee(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new de(t),o=new se(n,a.getId(r),a.getId(i)),s=new me(new pe(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new y(a,o,s)}var de=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},fe=Object.freeze([]),pe=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||fe,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},me=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),pe.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ee(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new pe(e,t,n,r,i))}},x=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!=0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=ge(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function he(e){return e}function ge(e){return e}function S(e,t){let n=[],r=ve(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(_e(i)){let e=[];do e.push(i),i=r.next();while(_e(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function _e(e){return!!e&&!!e.match(/[\w\.:]+/)}function ve(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function ye(e){typeof e.dispose==`function`&&e.dispose()}var C=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},be=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xe=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Se=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new C(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new xe;for(let n of e)Ce(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof C){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Ce(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof C?w({baseGrammar:a,selfGrammar:i},r):we(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new C(e))}function we(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Te([r],t,n)}}function w(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Te(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Te(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Te(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?m({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Te(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=je(i);switch(a.kind){case 0:w({...t,selfGrammar:t.baseGrammar},n);break;case 1:w(t,n);break;case 2:we(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?we(a.ruleName,i,n):w(i,n)}else a.kind===4?n.add(new be(a.scopeName,a.ruleName)):n.add(new C(a.scopeName));break}}}var Ee=class{kind=0},De=class{kind=1},Oe=class{constructor(e){this.ruleName=e}kind=2},ke=class{constructor(e){this.scopeName=e}kind=3},Ae=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function je(e){if(e===`$base`)return new Ee;if(e===`$self`)return new De;let t=e.indexOf(`#`);return t===-1?new ke(e):t===0?new Oe(e.substring(1)):new Ae(e.substring(0,t),e.substring(t+1))}var Me=/\\(\d+)/,Ne=/\\(\d+)/g,Pe=-1,Fe=-2;function Ie(e){return e}function Le(e){return e}var T=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=_.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=_.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${h(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:_.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:_.replaceCaptures(this._contentName,e,t)}},Re=class extends T{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},ze=class extends T{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new E(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new D,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Be=class extends T{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new D,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ve=class extends T{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new E(i,this.id),this.beginCaptures=a,this._end=new E(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new D;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},He=class extends T{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new E(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new E(o,Fe),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new D;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new D,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Ue=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Re(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new ze(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=m({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Be(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new He(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Ve(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=je(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Be||e instanceof Ve||e instanceof He)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},E=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Me.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Ne.lastIndex=0,this.source.replace(Ne,(e,t)=>ne(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},D=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new We(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new We(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},We=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
2
2
|
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ge=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Ke=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Ge(e,8),this._embeddedLanguagesMatcher=new qe(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Ge(0,0);_getBasicScopeAttributes=new re(e=>new Ge(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},qe=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>ne(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Je=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Ye(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Xe(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Je(i,!0);f()}return new Je(i,!1);function f(){let o=Ze(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Pe){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),O(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Ve){let r=o;O(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof He){let r=o;O(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(O(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Xe(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof He&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=tt(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Fe){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),O(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Ze(e,t,n,r,i,a){let o=Qe(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=$e(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Qe(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=et(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function $e(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=et(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function et(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function tt(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function O(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Ye(e,p,n&&d.start===0,d.start,f,i,!1,0),ye(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new nt(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var nt=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function rt(e,t,n,r,i,a,o,s){return new ot(e,t,n,r,i,a,o,s)}function it(e,t,n,r,i){let a=S(t,k),o=Ue.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function k(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(at(t[r],e))return n=r+1,!0;return!1})}function at(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var ot=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Ke(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=st(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=S(e,k);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)it(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&it(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Ie(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Le(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=st(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Ue.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===ct.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=x.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?A.createRootAndLookUpScopeName(a,r,this):A.createRoot(`unknown`,r),t=new ct(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
3
3
|
`;let a=this.createOnigString(e),o=a.content.length,s=new ut(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Ye(this,a,i,0,t,s,!0,r);return ye(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function st(e,t){return e=u(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var A=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=ie.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new ie(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new ie(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),x.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},ct=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?A.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Le(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=A.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Ie(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,A.fromExtension(r,n.contentNameScopesList))}},lt=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):S(e,k).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>S(e,k).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ut=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=x.set(n,0,he(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=x.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},dt=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,rt(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},ft=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new dt(y.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(y.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new lt(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Se(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},pt=ct.NULL;function j(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function M(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function mt(e){return Array.isArray(e)?e:[e]}async function ht(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function N(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function gt(e){return e===`ansi`||N(e)}function P(e){return e===`none`}function _t(e){return P(e)}var vt=/(\r?\n)/g;function F(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(vt),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var yt={light:`#333333`,dark:`#bbbbbb`},bt={light:`#fffffe`,dark:`#1e1e1e`},xt=`__shiki_resolved`;function I(e){if(e?.[xt])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?yt.light:yt.dark,n||=t.type===`light`?bt.light:bt.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,xt,{enumerable:!1,writable:!1,value:!0}),t}async function St(e){return[...new Set((await Promise.all(e.filter(e=>!gt(e)).map(async e=>await ht(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Ct(e){return(await Promise.all(e.map(async e=>_t(e)?null:I(await ht(e))))).filter(e=>!!e)}function wt(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new l(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Tt=class extends ft{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=I(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=y.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=wt(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new l(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Et=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},L=0;function R(e){L+=1,e.warnings!==!1&&L>=10&&L%10==0&&console.warn(`[Shiki] ${L} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new l("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(I),i=new Tt(new Et(e.engine,n),r,n,e.langAlias),a;function o(t){return wt(t,e.langAlias)}function s(e){_();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new l(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};_();let t=i.getTheme(e);if(!t)throw new l(`Theme \`${e}\` not found, you may need to load it first`);return t}function u(e){_();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function d(){return _(),i.getLoadedThemes()}function f(){return _(),i.getLoadedLanguages()}function p(...e){_(),i.loadLanguages(e.flat(1))}async function m(...e){return p(await St(e))}function h(...e){_();for(let t of e.flat(1))i.loadTheme(t)}async function g(...e){return _(),h(await Ct(e))}function _(){if(t)throw new l(`Shiki instance has been disposed`)}function v(){t||(t=!0,i.dispose(),--L)}return{setTheme:u,getTheme:c,getLanguage:s,getLoadedThemes:d,getLoadedLanguages:f,resolveLangAlias:o,loadLanguage:m,loadLanguageSync:p,loadTheme:g,loadThemeSync:h,dispose:v,[Symbol.dispose]:v}}var Dt=R;async function Ot(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Ct(e.themes||[]),St(e.langs||[]),e.engine]);return R({...e,themes:t,langs:n,engine:r})}var kt=Ot,At=new WeakMap;function z(e,t){At.set(e,t)}function B(e){return At.get(e)}var V=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(mt(n).map(e=>[e,pt])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return jt(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function jt(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Mt(e,t){if(!(e instanceof V))throw new l(`Invalid grammar state`);return e.getInternalStack(t)}var Nt=/,/,Pt=/ /;function Ft(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(N(e.resolveLangAlias(n.lang||`text`))||P(r))return F(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new l(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new l(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Lt(t,o,i,a,n)}function It(...e){if(e.length===2)return B(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(N(i)||P(a))throw new l(`Plain language does not have grammar state`);if(i===`ansi`)throw new l(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new V(Rt(n,c,o,s,r).stateStack,c.name,o.name)}function Lt(e,t,n,r,i){let a=Rt(e,t,n,r,i),o=new V(a.stateStack,t.name,n.name);return z(a.tokens,o),a.tokens}function Rt(e,t,n,r,i){let a=j(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=F(e),u=i.grammarState?Mt(i.grammarState,n.name)??pt:i.grammarContextCode==null?pt:Rt(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=M(r[x.getForeground(s)],a),u=x.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=x.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Nt).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Pt))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?zt(t.scopes):Bt(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function zt(e){return e.map(e=>({scopeName:e}))}function Bt(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Ut(e,i,t.slice(0,r))}}return n}function Vt(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Ht(e,t,n){if(!Vt(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Vt(e[r],n[i])&&--r,--i;return r===-1}function Ut(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Ht(e,t,n)){r.push(a);break}return r}function H(e,t,n,r=Ft){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:B(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Wt(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new V(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&z(s,c),s}function Wt(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Gt=/["&'<>`]/g,Kt=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,qt=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Jt=/[|\\{}()[\]^$+*?.]/g,Yt=new WeakMap;function Xt(e,t){if(e=e.replace(t.subset?Zt(t.subset):Gt,r),t.subset||t.escapeOnly)return e;return e.replace(Kt,n).replace(qt,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Zt(e){let t=Yt.get(e);return t||(t=Qt(e),Yt.set(e,t)),t}function Qt(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Jt,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var $t=/[\dA-Fa-f]/;function en(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!$t.test(String.fromCharCode(t))?r:r+`;`}var tn=/\d/;function nn(e,t,n){let r=`&#`+String(e);return n&&t&&!tn.test(String.fromCharCode(t))?r:r+`;`}var rn=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),an={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},on=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],sn={}.hasOwnProperty,cn={},U;for(U in an)sn.call(an,U)&&(cn[an[U]]=U);var ln=/[^\dA-Za-z]/;function un(e,t,n,r){let i=String.fromCharCode(e);if(sn.call(cn,i)){let e=cn[i],a=`&`+e;return n&&rn.includes(e)&&!on.includes(e)&&(!r||t&&t!==61&&ln.test(String.fromCharCode(t)))?a:a+`;`}return``}function dn(e,t,n){let r=en(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=un(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=nn(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function W(e,t){return Xt(e,Object.assign({format:dn},t))}var fn=/^>|^->|<!--|-->|--!>|<!-$/g,pn=[`>`],mn=[`<`,`>`];function hn(e,t,n,r){return r.settings.bogusComments?`<?`+W(e.value,Object.assign({},r.settings.characterReferences,{subset:pn}))+`>`:`<!--`+e.value.replace(fn,i)+`-->`;function i(e){return W(e,Object.assign({},r.settings.characterReferences,{subset:mn}))}}function gn(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var G=yn(1),_n=yn(-1),vn=[];function yn(e){return t;function t(t,n,r){let i=t?t.children:vn,a=(n||0)+e,o=i[a];if(!r)for(;o&&s(o);)a+=e,o=i[a];return o}}var bn={}.hasOwnProperty;function xn(e){return t;function t(t,n,r){return bn.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Sn=xn({body:Tn,caption:Cn,colgroup:Cn,dd:kn,dt:On,head:Cn,html:wn,li:Dn,optgroup:jn,option:Mn,p:En,rp:An,rt:An,tbody:Pn,td:Ln,tfoot:Fn,th:Ln,thead:Nn,tr:In});function Cn(e,t,n){let r=G(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&s(r.value.charAt(0)))}function wn(e,t,n){let r=G(n,t);return!r||r.type!==`comment`}function Tn(e,t,n){let r=G(n,t);return!r||r.type!==`comment`}function En(e,t,n){let r=G(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function Dn(e,t,n){let r=G(n,t);return!r||r.type===`element`&&r.tagName===`li`}function On(e,t,n){let r=G(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function kn(e,t,n){let r=G(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function An(e,t,n){let r=G(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function jn(e,t,n){let r=G(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Mn(e,t,n){let r=G(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Nn(e,t,n){let r=G(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Pn(e,t,n){let r=G(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Fn(e,t,n){return!G(n,t)}function In(e,t,n){let r=G(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Ln(e,t,n){let r=G(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Rn=xn({body:Vn,colgroup:Hn,head:Bn,html:zn,tbody:Un});function zn(e){let t=G(e,-1);return!t||t.type!==`comment`}function Bn(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Vn(e){let t=G(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&s(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function Hn(e,t,n){let r=_n(n,t),i=G(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Un(e,t,n){let r=_n(n,t),i=G(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Sn(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var K={name:[[`
|
|
4
4
|
\f\r &/=>`.split(``),`
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-Ct3kYFRM.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CCIEwYL0.js","assets/utils-D27OaPrA.js","assets/bundle-mjs-BT31bpU6.js","assets/index-B96YnNHc.js","assets/centered-state-DsblJe6Q.js","assets/search-x-CaddQd7u.js","assets/triangle-alert-BMsU3ymT.js","assets/textarea-Dd8d_Pwi.js","assets/dist-CngV8tyE.js","assets/project-router-CnKsyZKI.js","assets/chunk-BO2N2NFS-DE6qKn3r.js","assets/lib-BxQXEXDF.js","assets/index-DdBHg6_F.css","assets/lib-BQXq3kEf.js","assets/image-preview-B3W7bWIq.js","assets/zoomable-image-BBB-AoPi.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{i as r}from"./bundle-mjs-BT31bpU6.js";import{t as i}from"./utils-D27OaPrA.js";import{rt as a}from"./index-B96YnNHc.js";import{n as o,t as s}from"./image-preview-B3W7bWIq.js";var c=e(t(),1),l=n();function u(e){let[t,n]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return r(()=>import(`./diff-view-Ct3kYFRM.js`).then(t=>{e||n({View:t.DiffView})},()=>{e||n(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:i(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):t===`failed`?(0,l.jsx)(d,{...e}):t===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:i(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(t.View,{...e})}function d({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:r,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:i(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:t,imageSrc:n,onOpenInApp:r},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:t,imageSrc:n,onOpenInApp:r}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:n,onOpenInApp:r}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:i(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
|
|
3
|
+
`).map((e,t)=>(0,l.jsxs)(`span`,{className:i(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},t))})]})}export{u as t};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-D27OaPrA.js";import{C as i,S as a,an as o,rt as s,w as c}from"./index-B96YnNHc.js";import{t as l}from"./lib-BQXq3kEf.js";import{n as u,t as d}from"./image-preview-B3W7bWIq.js";var f=e(t(),1),p=44;function m(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
|
|
2
2
|
`),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function h(e){return m(e)*20+p}function g(e){return e.reduce((e,t)=>e+m(t),0)}function _(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function v(e){return`${e.oldPath??``}→${e.path}`}function y(e){let t=0;for(let n of e.split(`
|
|
3
3
|
`))n.length>t&&(t=n.length);return t}var b=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,x=300,S=.3;function C(e,t){if(e===t)return null;let n=e.match(b)??[],r=t.match(b)??[];if(n.length===0||r.length===0||n.length>x||r.length>x)return null;let i=r.length+1,a=new Uint16Array((n.length+1)*i);for(let e=1;e<=n.length;e++)for(let t=1;t<=r.length;t++)a[e*i+t]=n[e-1]===r[t-1]?(a[(e-1)*i+(t-1)]??0)+1:Math.max(a[(e-1)*i+t]??0,a[e*i+(t-1)]??0);if((a[n.length*i+r.length]??0)/Math.max(n.length,r.length)<S)return null;let o=Array(n.length).fill(!1),s=Array(r.length).fill(!1),c=n.length,l=r.length;for(;c>0&&l>0;)n[c-1]===r[l-1]?(o[c-1]=!0,s[l-1]=!0,c--,l--):(a[(c-1)*i+l]??0)>=(a[c*i+(l-1)]??0)?c--:l--;return{del:w(n,o),add:w(r,s)}}function w(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function T(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var E=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,D=`… (patch truncated)`;function O(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
|
|
4
|
-
`);o.at(-1)===``&&o.pop();for(let e of o){let o=E.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(D)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function k(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function A(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function j(e,t){let n=Array(e.length),r=Array(t.length),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=C(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function M(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(j(t,i))}else t(i),r++}}function N(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),M(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function P(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),M(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}var F=
|
|
4
|
+
`);o.at(-1)===``&&o.pop();for(let e of o){let o=E.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(D)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function k(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function A(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function j(e,t){let n=Array(e.length),r=Array(t.length),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=C(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function M(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(j(t,i))}else t(i),r++}}function N(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),M(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function P(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),M(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}var F=n(),I=1500,L=new Map;function R(e,t){if(e){for(let n of e.querySelectorAll(`[data-slot="diff-file"]`))if(n.dataset.path===t)return n}}function z({files:e,mode:t=`unified`,wrap:n=!1,loadFileText:i,imageSrc:a,onOpenInApp:o,viewRef:c,className:l}){let u=(0,f.useMemo)(()=>({adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length}),[e]),[d,p]=(0,f.useState)(()=>new Set),[m,y]=(0,f.useState)(()=>new Map),b=(0,f.useCallback)(e=>{p(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),x=(0,f.useCallback)(async(e,t)=>{if(!i)return;let n=await i(e.path);if(n===null)return;let r=A(t,n.split(`
|
|
5
5
|
`));y(n=>{let i=v(e);return new Map(n).set(i,new Map(n.get(i)??L).set(t.beforeHunk,r))})},[i]),S=(0,f.useMemo)(()=>g(e),[e]),[C]=(0,f.useState)(()=>typeof window>`u`?``:window.location.search),w=_(C,S),T=(0,f.useRef)(null),E=(0,f.useRef)(null),D=(0,f.useRef)(null);(0,f.useImperativeHandle)(c,()=>({scrollToPath:t=>{let n=e.findIndex(e=>e.path===t);if(n===-1)return;let r=E.current;r?r.scrollToIndex(n,{align:`start`}):R(D.current,t)?.scrollIntoView({block:`start`,behavior:`smooth`})}}),[e]);let O=e=>{let r=v(e);return(0,F.jsx)(H,{file:e,open:!d.has(r),onToggle:()=>b(r),expanded:m.get(r)??L,onExpand:t=>void x(e,t),mode:t,wrap:n,canExpand:i!==void 0,imageSrc:a,onOpenInApp:o})};return(0,F.jsxs)(`div`,{ref:e=>{D.current=e,e&&(T.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff`,"data-mode":t,className:r(`flex min-w-0 flex-col`,l),children:[(0,F.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 pb-3 text-xs text-muted-foreground`,children:[(0,F.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,F.jsx)(s,{stat:u})]}),w===`virtual`?(0,F.jsx)(B,{files:e,handleRef:E,scrollElRef:T,card:O}):(0,F.jsx)(`div`,{"data-slot":`diff-files`,"data-virtualized":`false`,children:e.map(e=>(0,F.jsx)(`div`,{"data-slot":`diff-file-slot`,style:{containIntrinsicBlockSize:`auto ${h(e)}px`},className:`pb-3 [content-visibility:auto]`,children:O(e)},v(e)))})]})}function B({files:e,handleRef:t,scrollElRef:n,card:r}){let i=(0,f.useRef)(null),[a,o]=(0,f.useState)(0);return(0,f.useLayoutEffect)(()=>{let e=()=>{let e=i.current,t=n.current;!e||!t||o(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n]),(0,F.jsx)(`div`,{ref:e=>{i.current=e,e&&(n.current=e.closest(`[data-slot="main"]`))},"data-slot":`diff-files`,"data-virtualized":`true`,children:(0,F.jsx)(l,{ref:t,scrollRef:n,startMargin:a,children:e.map(e=>(0,F.jsx)(`div`,{"data-slot":`diff-file-slot`,className:`pb-3`,children:r(e)},v(e)))})})}var V={added:`added`,deleted:`deleted`,renamed:`renamed`,copied:`copied`};function H({file:e,open:t,onToggle:n,expanded:i,onExpand:a,mode:c,wrap:l,canExpand:u,imageSrc:d,onOpenInApp:f}){let p=V[e.status];return(0,F.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,F.jsx)(`header`,{className:`sticky top-[var(--diff-sticky-top,0px)] z-10 rounded-t-md border-b border-border/50 bg-card`,children:(0,F.jsxs)(`button`,{type:`button`,"data-slot":`diff-file-header`,"aria-expanded":t,onClick:n,className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted/50`,children:[(0,F.jsx)(o,{className:r(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),(0,F.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`span`,{className:`text-soft-foreground`,children:[e.oldPath,` → `]}),e.path]}):e.path}),p?(0,F.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:p}):null,e.image?(0,F.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:`image`}):e.binary?(0,F.jsx)(`span`,{className:`shrink-0 rounded-sm bg-muted px-1.5 py-px text-[10px] font-medium text-muted-foreground`,children:`binary`}):null,(0,F.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,F.jsx)(s,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]})}),t?(0,F.jsx)(U,{file:e,expanded:i,onExpand:a,mode:c,wrap:l,canExpand:u,imageSrc:d,onOpenInApp:f}):null]})}function U({file:e,expanded:t,onExpand:n,mode:i,wrap:a,canExpand:o,imageSrc:s,onOpenInApp:c}){let l=(0,f.useMemo)(()=>O(e.patch),[e.patch]),p=o&&e.status!==`added`&&e.status!==`deleted`,m=(0,f.useMemo)(()=>k(l.hunks,p),[l.hunks,p]),h=(0,f.useMemo)(()=>{let e=[];l.hunks.forEach((n,r)=>{let i=t.get(r);i&&e.push(...i),e.push(...n.lines)});let n=t.get(l.hunks.length);return n&&e.push(...n),e},[l.hunks,t]),g=(0,f.useMemo)(()=>new Map(h.map((e,t)=>[e,t])),[h]),_=W(e.path,h),v=(0,f.useMemo)(()=>i===`unified`?N(l.hunks,m,t):null,[i,l.hunks,m,t]),b=(0,f.useMemo)(()=>i===`split`?P(l.hunks,m,t):null,[i,l.hunks,m,t]),x=(0,f.useMemo)(()=>i===`unified`&&!a?{minInlineSize:`calc(${y(e.patch)}ch + 7rem)`}:void 0,[i,a,e.patch]);if(u(e))return(0,F.jsx)(d,{file:e,imageSrc:s,onOpenInApp:c});if(e.binary)return(0,F.jsx)(G,{children:`Binary file — no text diff.`});if(l.hunks.length===0)return(0,F.jsx)(G,{children:l.truncated?`Patch truncated by the server.`:`No content changes (metadata only).`});let S=e=>{if(!_)return null;let t=g.get(e);return t===void 0?null:_[t]??null};return(0,F.jsxs)(`div`,{"data-slot":`diff-file-body`,"data-wrap":a||void 0,className:r(`py-1 font-mono text-xs leading-[1.7]`,!a&&`overflow-x-auto`),children:[(0,F.jsxs)(`div`,{"data-slot":`diff-rows`,style:x,className:`[&>*]:[contain-intrinsic-block-size:auto_20px] [&>*]:[content-visibility:auto]`,children:[v?v.map((e,t)=>(0,F.jsx)(Q,{row:e,wrap:a,tokensFor:S,onExpand:p?n:void 0},t)):null,b?b.map((e,t)=>(0,F.jsx)(ee,{row:e,wrap:a,tokensFor:S,onExpand:p?n:void 0},t)):null]}),l.truncated?(0,F.jsx)(G,{children:`Patch truncated by the server — counts above remain exact.`}):null]})}function W(e,t){let n=(0,f.useMemo)(()=>t.length>I?null:t.map(e=>e.text).join(`
|
|
6
6
|
`),[t]),r=(0,f.useMemo)(()=>c(e),[e]),[o,s]=(0,f.useState)(null);return(0,f.useEffect)(()=>{if(n===null||r===null)return;let e=!1;return a(n,r).then(t=>{e||s({text:n,tokens:t.tokens})}),()=>{e=!0}},[n,r]),n===null||r===null?null:o?.text===n?o.tokens:i(n,r)?.tokens??null}function G({children:e}){return(0,F.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}var K={add:`bg-diff-add`,del:`bg-diff-del`,context:void 0},q={add:`+`,del:`−`,context:` `};function J({hunk:e}){return(0,F.jsx)(`div`,{"data-slot":`diff-hunk`,className:`bg-muted/40 px-4 py-0.5 whitespace-pre text-soft-foreground`,children:e.header})}function Y({gap:e,onExpand:t}){let n=e.count===void 0?`⋯ unchanged lines to end of file`:`⋯ ${e.count} unchanged ${e.count===1?`line`:`lines`}`;return t?(0,F.jsxs)(`button`,{type:`button`,"data-slot":`diff-gap`,onClick:()=>t(e),className:`block w-full border-y border-border/40 bg-muted/20 px-4 py-0.5 text-left text-[11px] text-soft-foreground hover:bg-muted/50 hover:text-foreground`,children:[n,` — expand`]}):(0,F.jsx)(`div`,{"data-slot":`diff-gap`,className:`border-y border-border/40 bg-muted/20 px-4 py-0.5 text-[11px] text-soft-foreground`,children:n})}function X({cell:e,tokens:t,wrap:n}){let i=T(t,e.spans,e.line.text),a=e.line.kind===`add`?`bg-diff-add-strong`:`bg-diff-del-strong`;return(0,F.jsxs)(`span`,{className:r(`min-w-0 flex-1 pr-4`,n?`break-words whitespace-pre-wrap`:`whitespace-pre`),children:[i.map((t,n)=>(0,F.jsx)(`span`,{"data-word":t.changed?e.line.kind:void 0,style:t.color===void 0?void 0:{color:t.color},className:t.changed?r(`rounded-[2px]`,a):void 0,children:t.text},n)),e.line.text===``?` `:``]})}function Z({value:e}){return(0,F.jsx)(`span`,{className:`w-10 shrink-0 pr-2 text-right text-soft-foreground/70 tabular-nums select-none`,children:e??``})}function Q({row:e,wrap:t,tokensFor:n,onExpand:i}){if(e.type===`hunk`)return(0,F.jsx)(J,{hunk:e.hunk});if(e.type===`gap`)return(0,F.jsx)(Y,{gap:e.gap,onExpand:i});let{line:a}=e.cell;return(0,F.jsxs)(`div`,{"data-slot":`diff-line`,"data-line":a.kind,className:r(`flex`,K[a.kind]),children:[(0,F.jsx)(Z,{value:a.oldLine}),(0,F.jsx)(Z,{value:a.newLine}),(0,F.jsx)(`span`,{className:`w-4 shrink-0 text-soft-foreground select-none`,children:q[a.kind]}),(0,F.jsx)(X,{cell:e.cell,tokens:n(a),wrap:t})]})}function ee({row:e,wrap:t,tokensFor:n,onExpand:r}){return e.type===`hunk`?(0,F.jsx)(J,{hunk:e.hunk}):e.type===`gap`?(0,F.jsx)(Y,{gap:e.gap,onExpand:r}):(0,F.jsxs)(`div`,{"data-slot":`diff-pair`,className:`grid grid-cols-2`,children:[(0,F.jsx)($,{cell:e.left,side:`old`,tokensFor:n,wrap:t}),(0,F.jsx)($,{cell:e.right,side:`new`,tokensFor:n,wrap:t})]})}function $({cell:e,side:t,tokensFor:n,wrap:i}){if(!e)return(0,F.jsx)(`div`,{"data-slot":`diff-cell-empty`,className:r(`bg-muted/20`,t===`new`&&`border-l border-border/40`)});let{line:a}=e;return(0,F.jsxs)(`div`,{"data-slot":`diff-cell`,"data-line":a.kind,className:r(`flex min-w-0 overflow-x-auto`,K[a.kind],t===`new`&&`border-l border-border/40`),children:[(0,F.jsx)(Z,{value:t===`old`?a.oldLine:a.newLine}),(0,F.jsx)(`span`,{className:`w-4 shrink-0 text-soft-foreground select-none`,children:q[a.kind]}),(0,F.jsx)(X,{cell:e,tokens:n(a),wrap:i})]})}export{z as DiffView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,_ as i,b as a,c as o,d as s,f as c,g as l,h as u,l as d,p as f,s as p,u as m,w as h,x as g,y as _}from"./centered-state-DsblJe6Q.js";var v=e(t(),1),y=n(),b=`Dialog`,[x,S]=a(b),[C,w]=x(b),T=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=v.useRef(null),l=v.useRef(null),[d,f]=i({prop:r,defaultProp:a??!1,onChange:o,caller:b});return(0,y.jsx)(C,{scope:t,triggerRef:c,contentRef:l,contentId:u(),titleId:u(),descriptionId:u(),open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),modal:s,children:n})};T.displayName=b;var E=`DialogTrigger`,D=v.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=w(E,n),o=r(t,a.triggerRef);return(0,y.jsx)(g.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":q(a.open),...i,ref:o,onClick:_(e.onClick,a.onOpenToggle)})});D.displayName=E;var O=`DialogPortal`,[k,A]=x(O,{forceMount:void 0}),j=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=w(O,t);return(0,y.jsx)(k,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,y.jsx)(l,{present:n||a.open,children:(0,y.jsx)(m,{asChild:!0,container:i,children:e})}))})};j.displayName=O;var M=`DialogOverlay`,N=v.forwardRef((e,t)=>{let n=A(M,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(M,e.__scopeDialog);return a.modal?(0,y.jsx)(l,{present:r||a.open,children:(0,y.jsx)(F,{...i,ref:t})}):null});N.displayName=M;var P=h(`DialogOverlay.RemoveScroll`),F=v.forwardRef((e,t)=>{let{__scopeDialog:n,...i}=e,a=w(M,n),s=r(t,f());return(0,y.jsx)(o,{as:P,allowPinchZoom:!0,shards:[a.contentRef],children:(0,y.jsx)(g.div,{"data-state":q(a.open),...i,ref:s,style:{pointerEvents:`auto`,...i.style}})})}),I=`DialogContent`,L=v.forwardRef((e,t)=>{let n=A(I,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=w(I,e.__scopeDialog);return(0,y.jsx)(l,{present:r||a.open,children:a.modal?(0,y.jsx)(R,{...i,ref:t}):(0,y.jsx)(z,{...i,ref:t})})});L.displayName=I;var R=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),i=v.useRef(null),a=r(t,n.contentRef,i);return v.useEffect(()=>{let e=i.current;if(e)return p(e)},[]),(0,y.jsx)(B,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:_(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:_(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:_(e.onFocusOutside,e=>e.preventDefault())})}),z=v.forwardRef((e,t)=>{let n=w(I,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),B=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,l=w(I,n);return d(),(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(s,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,y.jsx)(c,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":q(l.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),V=`DialogTitle`,H=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(V,n);return(0,y.jsx)(g.h2,{id:i.titleId,...r,ref:t})});H.displayName=V;var U=`DialogDescription`,W=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(U,n);return(0,y.jsx)(g.p,{id:i.descriptionId,...r,ref:t})});W.displayName=U;var G=`DialogClose`,K=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(G,n);return(0,y.jsx)(g.button,{type:`button`,...r,ref:t,onClick:_(e.onClick,()=>i.onOpenChange(!1))})});K.displayName=G;function q(e){return e?`open`:`closed`}export{N as a,D as c,W as i,S as l,K as n,j as o,L as r,H as s,T as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-D27OaPrA.js";var t=e(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-D27OaPrA.js";var t=e(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-
|
|
1
|
+
import{r as e}from"./utils-D27OaPrA.js";var t=e(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r}from"./centered-state-DsblJe6Q.js";import{n as i,r as a,t as o}from"./utils-D27OaPrA.js";import{t as s}from"./ellipsis-vertical-WowqAN6-.js";import{n as c}from"./tab-link-BbQLZUG5.js";import{t as l}from"./file-BWgi5VOt.js";import{i as u,n as d,r as f}from"./use-desktop-BAHxMKrE.js";import{t as p}from"./git-pull-request-D8yt-2Tr.js";import{t as m}from"./square-terminal-CoE5Kj-S.js";import{t as h}from"./upload-DH2pWIfO.js";import{an as g,dt as _,lt as v,mt as y,nn as b,rt as x,ut as S}from"./index-B96YnNHc.js";var C=a(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),w=e(t(),1),T=n();function E({root:e,selected:t,onSelect:n}){return(0,T.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function D({adds:e,dels:t}){return(0,T.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,T.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function O({dir:e,depth:t,selected:n,onSelect:r}){let[i,a]=(0,w.useState)(!0);return(0,T.jsxs)(`li`,{children:[(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":i?`open`:`closed`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,T.jsx)(g,{"aria-hidden":`true`,className:o(`size-3.5 shrink-0 transition-transform`,i&&`rotate-90`)}),(0,T.jsx)(b,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]}),i?(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:r}){let i=n===e.path;return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":i?`true`:void 0,onClick:()=>r(e.path),className:o(`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,i?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(l,{"aria-hidden":`true`,className:o(`size-3.5 shrink-0`,k[e.status])}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]})})}function j(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function M(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(M)}}var N=(e,t)=>e.name.localeCompare(t.name);function P(e){let t=j(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=j(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(N),e.files.sort(N)};return i(t),{...t,dirs:t.dirs.map(M)}}function F({bar:e,branch:t,stat:n,mode:i,wrap:a,onModeChange:o,onWrapChange:c,onAction:l}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[t?(0,T.jsx)(d,{branch:t}):null,n?(0,T.jsx)(R,{stat:n}):null,(0,T.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(f,{mode:i,wrap:a,onModeChange:o,onWrapChange:c})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:l},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:l}),e.menu.length>0?(0,T.jsxs)(v,{children:[(0,T.jsx)(y,{asChild:!0,children:(0,T.jsx)(r,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(s,{"aria-hidden":`true`})})}),(0,T.jsx)(S,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(_,{disabled:!e.enabled,title:e.reason,onSelect:()=>l(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(u,{"aria-hidden":`true`}),push:(0,T.jsx)(h,{"aria-hidden":`true`}),"create-pr":(0,T.jsx)(p,{"aria-hidden":`true`}),"view-pr":(0,T.jsx)(c,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(m,{"aria-hidden":`true`})};function L({action:e,variant:t,onAction:n}){return e.id===`view-pr`?i(e.href)?(0,T.jsx)(r,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[I[e.id],e.label]})}):(0,T.jsxs)(r,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[I[e.id],e.label]}):(0,T.jsxs)(r,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[I[e.id],e.label]})}function R({stat:e}){return(0,T.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,T.jsx)(x,{stat:{adds:z(e.adds),dels:z(e.dels),files:e.files}})})}function z(e){let[t,n]=(0,w.useState)(e),r=(0,w.useRef)(e);return(0,w.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{C as a,E as i,F as n,P as r,R as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$t as r,A as i,B as a,In as o,Jt as s,L as c,O as l,R as u,Rn as d,Rt as f,Vn as p,Xt as m,Yt as h,a as g,gt as _,i as v,k as y,ln as b,qn as x,qt as S,t as C,xt as w,yt as ee,z as T,zn as E}from"./centered-state-DsblJe6Q.js";import{n as D,r as O,t as k}from"./utils-D27OaPrA.js";import{t as A}from"./arrow-left-BWue3Imk.js";import{t as j}from"./circle-check-TKq6_8_Y.js";import{t as M}from"./circle-x-bH39f-Yh.js";import{n as N,t as P}from"./tab-link-BbQLZUG5.js";import{t as F}from"./git-pull-request-D8yt-2Tr.js";import{t as te}from"./refresh-cw-CFp_jUZr.js";import{t as ne}from"./triangle-alert-BMsU3ymT.js";import{n as I,t as re}from"./textarea-Dd8d_Pwi.js";import{r as ie,t as L}from"./project-router-CnKsyZKI.js";import{A as ae,Bt as oe,Ct as se,D as ce,E as le,Et as R,F as z,Ft as B,Gt as ue,H as V,Ht as de,It as H,J as fe,Jt as U,Kt as pe,L as W,M as me,Mt as G,N as K,Nt as q,O as he,P as ge,Pt as _e,Qt as ve,R as ye,Rt as be,St as xe,Tt as Se,Ut as Ce,Vt as we,Wt as Te,Yt as Ee,an as De,bt as Oe,in as ke,j as Ae,jt as je,k as Me,kt as J,on as Ne,qt as Pe,rn as Fe,vt as Ie,wt as Le,x as Re,y as ze,z as Be}from"./index-B96YnNHc.js";import{t as Ve}from"./diff-Drvekr61.js";var He=O(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ue=O(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),We=O(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Ge=O(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Y=e(t(),1),X=n();function Z({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`skeleton`,className:k(`animate-pulse rounded-md bg-accent`,e),...t})}function Ke(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function qe(e,t=[]){let n=Ke(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=Je(t)),n}function Je(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function Ye(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function Xe(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function Ze(e,t,n){let r=(n??``).trim();if(!r)return qe(e,t);let i=Ke(e),a=r.startsWith(i)?i+Ye(r.slice(i.length),e):Ye(r,e),o=Xe(a,e)?a:`${i}\n\n${a}`;return t.length?o+Je(t):o}function Qe(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function $e(e,t,n,r,i={}){return t?{...i,workflow:t,task:Ze(e,n,r)}:n.length?{...i,steps:Qe(n),task:Ze(e,[],r)}:{...i,workflow:`quick-task`,task:Ze(e,[],r)}}function et(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function tt(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body}`.toLowerCase().includes(n))}function nt(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}var rt={workflow:null,skills:[]},it=`cez-followup-selection`;function at(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.filter(e=>typeof e==`string`):[]}}function ot(){try{let e=localStorage.getItem(it);return e?at(JSON.parse(e)):{...rt}}catch{return{...rt}}}function st(e){try{localStorage.setItem(it,JSON.stringify(e))}catch{}}var ct=`cez-followup-prompt:`;function lt(e){try{return localStorage.getItem(ct+e)??``}catch{return``}}function ut(e,t){try{t===``?localStorage.removeItem(ct+e):localStorage.setItem(ct+e,t)}catch{}}function dt({item:e,workflows:t,skills:n,workflow:r,onWorkflowChange:a,selectedSkills:o,onSkillsChange:s,engine:c,onEngineChange:l,queuedRunId:u,onQueued:m}){let h=p(),_=ee(),x=e.kind===`pr`?`PR`:`issue`,S=o.filter(e=>n.some(t=>t.name===e)),[C]=(0,Y.useState)(()=>Ke(e)),[w,T]=(0,Y.useState)(()=>lt(e.url)||C),E=Be(c),D=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{ut(e.url,w===C?``:w)},[e.url,w,C]);let O=(0,Y.useMemo)(()=>ae(_.data?.promptTemplates),[_.data?.promptTemplates]),k=e=>{let t=D.current,n=w===C?w.length:t?.selectionStart??w.length,r=Me(w,n,e);T(r.text),requestAnimationFrame(()=>{D.current?.focus(),D.current?.setSelectionRange(r.caret,r.caret)})},A=he(O,S),j=(0,Y.useRef)(w);j.current=w;let M=(0,Y.useRef)(``);(0,Y.useEffect)(()=>{let e=Ae(j.current,M.current,A,C);M.current=e.applied,e.text!==j.current&&T(e.text)},[A,C]);let N=d({mutationFn:async()=>E.canRun?f($e(e,r,S,w,ye(E))):null,onSuccess:t=>{if(t===null)return;let n=`runs`in t?t.runs[0]:t;n&&m(e.url,n.id),v(`Added to the queue — ${x} #${e.number}`),S.length>0&&_.data!==void 0&&b({skillUsage:S.reduce((e,t)=>Ie(e,t),_.data.skillUsage)}).then(()=>h.invalidateQueries({queryKey:i.uiState})).catch(()=>{}),ut(e.url,``),T(C),M.current=``,h.invalidateQueries({queryKey:i.runs.all})},onError:e=>v(e.message,{tone:`danger`})}),P=e=>{le({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!N.isPending&&E.canRun&&N.mutate())},F=e=>s(o.includes(e)?o.filter(t=>t!==e):[...o,e]);return(0,X.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,X.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:[(0,X.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5 text-violet`}),`Hand this to the agent`]}),(0,X.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(ft,{workflows:t,value:r,onChange:a}),(0,X.jsx)(pt,{skills:n,skillUsage:_.data?.skillUsage,selected:S,onToggle:F}),(0,X.jsx)(W,{pick:c,onChange:l,disabled:N.isPending||!E.canRun}),!E.providerPending&&!E.canRun?(0,X.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[E.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,X.jsx)(L,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null,(0,X.jsx)(me,{templates:O,onInsert:k})]}),S.length>0?(0,X.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:S.map(e=>(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>F(e),title:`Remove this skill`,className:`inline-flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-px font-mono text-[11px] font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,X.jsx)(I,{"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,X.jsx)(re,{ref:D,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:w,onChange:e=>T(e.target.value),onKeyDown:P,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`}),(0,X.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2.5`,children:[(0,X.jsxs)(g,{variant:`contrast`,"data-action":`gh-run`,disabled:N.isPending||!E.canRun,onClick:()=>N.mutate(),children:[(0,X.jsx)(ve,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,x]}),(0,X.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[10.5px] font-medium text-muted-foreground`,children:ce()}),u?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,X.jsx)(y,{"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,X.jsx)(L,{to:`/tasks/${u}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-violet hover:underline`,children:`View task →`})]}):null]})]})}function ft({workflows:e,value:t,onChange:n}){let[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(``),s=(0,Y.useRef)(null),c=Se(e,a);return(0,X.jsxs)(K,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,X.jsx)(z,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:k(V,t&&`border-foreground/60 font-mono text-[11.5px] font-semibold text-foreground`),children:[(0,X.jsx)(Pe,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),(0,X.jsx)(`span`,{className:`max-w-44 truncate`,children:t??`workflow`}),(0,X.jsx)(Ne,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,X.jsx)(ge,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,X.jsxs)(je,{shouldFilter:!1,children:[(0,X.jsx)(_e,{placeholder:`search workflows…`,value:a,onValueChange:o,onInput:()=>s.current?.scrollTo(0,0)}),(0,X.jsxs)(H,{ref:s,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[c.length===0?(0,X.jsx)(G,{children:`Nothing matches.`}):null,(0,X.jsx)(q,{children:c.map(e=>{let r=t===e.name;return(0,X.jsxs)(B,{value:`workflow ${e.name}`,keywords:R(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),i(!1)},children:[(0,X.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,X.jsx)(y,{"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-primary`}):null]},e.name)})})]})]})})]})}function pt({skills:e,skillUsage:t,selected:n,onToggle:r}){let[i,a]=(0,Y.useState)(!1),[o,s]=(0,Y.useState)(``),[c,l]=(0,Y.useState)(null),u=(0,Y.useRef)(null),{mostUsed:d,project:f,global:p}=se(Le(e,o,t),t),m=(e,t)=>{let i=n.includes(e.name);return(0,X.jsxs)(B,{value:`skill ${e.name} ${e.path}`,keywords:R(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.name,"data-selected":i?`true`:void 0,onSelect:()=>r(e.name),children:[(0,X.jsx)(`span`,{className:k(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,X.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),l(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,X.jsx)(Fe,{"aria-hidden":`true`,className:`size-3.5`})}),i?(0,X.jsx)(y,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e.path)};return e.length===0?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ze,{skill:c,onClose:()=>l(null)}),(0,X.jsxs)(K,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,X.jsx)(z,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:k(V,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,X.jsx)(U,{"aria-hidden":`true`,className:`size-3 shrink-0 text-violet`}),`skills`,n.length>0?` · ${n.length}`:``,(0,X.jsx)(Ne,{"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,X.jsx)(ge,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,X.jsxs)(je,{shouldFilter:!1,children:[(0,X.jsx)(_e,{placeholder:`search skills…`,value:o,onValueChange:s,onInput:()=>u.current?.scrollTo(0,0)}),(0,X.jsxs)(H,{ref:u,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[d.length===0&&f.length===0&&p.length===0?(0,X.jsx)(G,{children:`Nothing matches.`}):null,d.length>0?(0,X.jsx)(q,{heading:`Most used`,children:d.map(e=>m(e,Oe(e)))}):null,f.length>0?(0,X.jsx)(q,{heading:`Project skills`,children:f.map(e=>m(e,!0))}):null,p.length>0?(0,X.jsx)(q,{heading:`Global`,children:p.map(e=>m(e,!1))}):null]})]})})]})]})}var Q=1e3,mt=100;function ht(){return ee().data?.githubView===`prs`?(0,X.jsx)(ie,{to:`/github/prs`,replace:!0}):(0,X.jsx)(gt,{view:`issues`})}function gt({view:e,changes:t=!1}){let{n}=o(),r=c({limit:Q}),a=r.data,l=n===void 0?null:Number.parseInt(n,10),f=(0,Y.useMemo)(()=>{if(!a?.available)return[];let t=new Set;e===`prs`&&l!==null&&Number.isInteger(l)&&t.add(l);for(let e of a.prs){if(t.size>=mt)break;t.add(e.number)}return[...t]},[a,e,l]),m=u(f,e===`prs`),h=m.data?.available?m.data.checks:void 0,y=p(),T=e=>{y.setQueryData(i.uiState,t=>({...t,githubView:e})),b({githubView:e}).then(e=>y.setQueryData(i.uiState,e)).catch(e=>{v(e instanceof Error?e.message:String(e),{tone:`danger`}),y.invalidateQueries({queryKey:i.uiState})})},E=(0,Y.useRef)(null),D=d({mutationFn:()=>S({refresh:!0,limit:Q}),onSuccess:e=>{y.setQueryData(i.github({limit:Q}),e),y.invalidateQueries({queryKey:i.githubChecks(f)});let t=E.current;if(!t){y.removeQueries({queryKey:[`github`,`comments`]});return}let n=i.githubComments(t.kind,t.number);s(t.kind,t.number,{refresh:!0}).then(e=>y.setQueryData(n,e)).catch(()=>{}),y.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==x(n)})},onError:e=>v(e.message,{tone:`danger`})}),O=w(),A=_(),j=ee(),[M,N]=(0,Y.useState)(()=>ot().workflow),[I,re]=(0,Y.useState)(()=>ot().skills),[ie,ae]=(0,Y.useState)({runner:null,model:null});(0,Y.useEffect)(()=>{st({workflow:M,skills:[...I]})},[M,I]);let oe=O.data?.workflows;(0,Y.useEffect)(()=>{oe&&M!==null&&!oe.some(e=>e.name===M)&&N(null)},[oe,M]);let se=A.data,ce=j.data?.skillUsage,le=(0,Y.useMemo)(()=>xe(se??[],ce),[se,ce]),[R,z]=(0,Y.useState)(new Map),[B,ue]=(0,Y.useState)(``),[V,de]=(0,Y.useState)([]);if(!a)return r.isError?(0,X.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,X.jsx)(C,{icon:(0,X.jsx)(ne,{}),tone:`danger`,title:`Could not load GitHub`,subtitle:r.error.message})}):(0,X.jsx)(fe,{});if(E.current=null,!a.available)return(0,X.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,X.jsx)(C,{icon:(0,X.jsx)(be,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:a.reason??`unknown reason`,actions:(0,X.jsx)(g,{variant:`outline`,"data-action":`gh-retry`,disabled:D.isPending,onClick:()=>D.mutate(),children:`Try again`}),children:(0,X.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,X.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in cezar works without it.`]})})});let H=e===`issues`?a.issues:a.prs,U=a.labelColors??{},pe=et(H),W=tt(H,{query:B,labels:V}),me=B.trim()!==``||V.length>0,G=n===void 0?null:Number.parseInt(n,10),K=G===null?W[0]??null:H.find(e=>e.number===G)??null;E.current=K?{kind:K.kind,number:K.number}:null;let q=e===`issues`?`/github`:`/github/prs`;return(0,X.jsxs)(`div`,{"data-route":`github`,className:`flex h-full min-h-0 items-stretch`,children:[(0,X.jsxs)(`section`,{"data-slot":`gh-list`,className:k(`w-full min-h-0 flex-col overflow-y-auto overscroll-contain border-border md:flex md:w-[360px] md:shrink-0 md:border-r`,n===void 0?`flex`:`hidden`),children:[(0,X.jsxs)(`header`,{"data-slot":`gh-header`,className:`sticky top-0 z-10 border-b border-border bg-background/95 px-4 pt-3 backdrop-blur`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,X.jsx)(`h1`,{className:`text-lg font-semibold`,children:`GitHub`}),a.repo?(0,X.jsx)(`span`,{"data-slot":`gh-repo`,className:`min-w-0 truncate font-mono text-[11px] text-soft-foreground`,children:a.repo}):null,(0,X.jsx)(L,{to:`/automations/new`,className:`ml-auto shrink-0 text-[10px] font-medium text-primary hover:underline`,children:`Set up automations`}),(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:D.isPending,onClick:()=>D.mutate(),className:`flex shrink-0 items-center gap-1 rounded-full border border-border px-1.5 py-px text-[10px] font-medium text-soft-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,X.jsx)(te,{"aria-hidden":`true`,className:k(`size-[9px]`,D.isPending&&`motion-safe:animate-spin`)}),a.syncedAt?`synced ${J(a.syncedAt)} ago`:`refresh`]})]}),(0,X.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`mt-2.5 flex items-end gap-1`,children:[(0,X.jsxs)(P,{to:`/github`,active:e===`issues`,onClick:()=>T(`issues`),children:[`Issues · `,_t(a.issues.length)]}),(0,X.jsxs)(P,{to:`/github/prs`,active:e===`prs`,onClick:()=>T(`prs`),children:[`Pull requests · `,_t(a.prs.length)]})]}),(0,X.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-2 pb-3`,children:[(0,X.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,X.jsx)(Ee,{"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,X.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:`Search #id, title, author…`,value:B,onChange:e=>ue(e.target.value),className:`w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,X.jsx)(yt,{options:pe,colors:U,selected:V,onChange:de})]})]}),W.length===0?(0,X.jsx)(`p`,{className:`px-4 py-4 text-sm text-soft-foreground`,children:me?`No ${e===`issues`?`issues`:`pull requests`} match your filter.`:`No open ${e===`issues`?`issues`:`pull requests`}.`}):(0,X.jsx)(`ul`,{"data-slot":`gh-rows`,className:`flex flex-col gap-0.5 px-2 py-2`,children:W.map(t=>(0,X.jsx)(vt,{item:t,view:e,colors:U,active:K?.url===t.url,queued:R.has(t.url),checks:t.kind===`pr`?h?.[t.number]??t.checks:t.checks},t.url))})]}),(0,X.jsx)(`section`,{"data-slot":`gh-detail`,className:k(`min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overscroll-contain`,n===void 0?`hidden md:flex`:`flex`),children:K?(0,X.jsx)(xt,{item:K,listPath:q,colors:U,changes:t,checks:K.kind===`pr`?h?.[K.number]??K.checks:K.checks,children:(0,X.jsx)(dt,{item:K,workflows:O.data?.workflows??[],skills:le,workflow:M,onWorkflowChange:N,selectedSkills:I,onSkillsChange:re,engine:ie,onEngineChange:ae,queuedRunId:R.get(K.url)??null,onQueued:(e,t)=>z(n=>new Map(n).set(e,t))},K.url)}):(0,X.jsx)(C,{icon:e===`issues`?(0,X.jsx)(Ue,{}):(0,X.jsx)(F,{}),tone:`neutral`,heading:`h2`,title:G===null?`Nothing selected`:`Not in the open list`,subtitle:G===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${G} is not among the open ${e===`issues`?`issues`:`pull requests`} — it may be closed, or still outside the fetched batch.`})})]})}function _t(e){return`${e}${e>=Q?`+`:``}`}function vt({item:e,view:t,colors:n,active:r,queued:a,checks:o}){let c=e.kind===`issue`?Ue:F,l=p(),u=()=>{l.prefetchQuery({queryKey:i.githubComments(e.kind,e.number),queryFn:({signal:t})=>s(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,X.jsx)(`li`,{children:(0,X.jsxs)(L,{to:`${t===`issues`?`/github/issues`:`/github/prs`}/${e.number}`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,qe(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:u,onFocus:u,"data-slot":`gh-row`,"data-number":e.number,"aria-current":r?`page`:void 0,title:`Drag into the composer to prefill a task`,className:k(`flex flex-col gap-1 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,r&&`bg-muted`),children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(c,{"aria-hidden":`true`,className:k(`size-3.5 shrink-0`,e.kind===`issue`?`text-success`:`text-violet`)}),(0,X.jsx)(`span`,{className:k(`min-w-0 truncate text-[13px] font-medium`,r&&`font-semibold`),children:e.title})]}),(0,X.jsxs)(`span`,{className:`flex items-center gap-2 pl-[22px] font-mono text-[10.5px] text-muted-foreground`,children:[(0,X.jsxs)(`span`,{children:[`#`,e.number]}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.author}),(0,X.jsx)(`span`,{children:J(e.createdAt)}),(0,X.jsx)(Rt,{count:e.comments}),o?(0,X.jsx)(Bt,{checks:o}):null,a?(0,X.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-violet`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,X.jsx)(`span`,{className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,X.jsx)(bt,{label:e,color:n[e]},e))}):null]})})}function yt({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,Y.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,X.jsxs)(K,{open:i,onOpenChange:a,children:[(0,X.jsx)(z,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:k(`flex shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-primary/60 text-foreground`),children:[(0,X.jsx)(Ge,{"aria-hidden":`true`,className:`size-3.5`}),n.length>0?`Labels · ${n.length}`:`Labels`]})}),(0,X.jsx)(ge,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,X.jsxs)(je,{children:[(0,X.jsx)(_e,{placeholder:`Filter labels…`}),(0,X.jsxs)(H,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,X.jsx)(G,{children:`No labels.`}),n.length>0?(0,X.jsxs)(B,{value:`__clear__`,onSelect:()=>r([]),className:`text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,X.jsxs)(B,{value:e,onSelect:()=>o(e),children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:nt(t[e])}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,X.jsx)(y,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},e)})]})]})})]})}function bt({label:e,color:t}){return(0,X.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:nt(t),className:`rounded-full border px-1.5 py-px text-[10px] font-medium`,children:e})}function xt({item:e,listPath:t,colors:n,children:r,changes:i,checks:a}){let o=e.kind===`pr`?`pull request`:`issue`,s=e.kind===`pr`&&!!(e.additions||e.deletions);return(0,X.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,X.jsxs)(L,{to:t,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,X.jsx)(A,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),(0,X.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[10.5px] text-soft-foreground`,children:[(0,X.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,X.jsx)(`span`,{children:o}),`·`,(0,X.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,X.jsxs)(`span`,{children:[J(e.createdAt),` ago`]}),e.comments?(0,X.jsxs)(X.Fragment,{children:[`·`,(0,X.jsx)(Rt,{count:e.comments})]}):null,s?(0,X.jsxs)(X.Fragment,{children:[`·`,(0,X.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,X.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions??0]}),` `,(0,X.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions??0]})]})]}):null,`·`,D(e.url)?(0,X.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,X.jsx)(N,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,X.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]}),(0,X.jsx)(`h2`,{className:`mt-2 text-xl leading-snug font-semibold`,children:e.title}),e.kind===`pr`?(0,X.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,X.jsx)(P,{to:`/github/prs/${e.number}`,active:!i,children:`Conversation`}),(0,X.jsx)(P,{to:`/github/prs/${e.number}/changes`,active:i,children:`Changes`})]}):null,e.labels.length>0||a?(0,X.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,X.jsx)(bt,{label:e,color:n[e]},e)),a?(0,X.jsx)(zt,{checks:a,url:e.url}):null]}):null,i&&e.kind===`pr`?(0,X.jsx)(wt,{item:e}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:e.body?(0,X.jsx)(Re,{children:e.body}):(0,X.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,X.jsx)(Tt,{item:e,colors:n}),e.kind===`pr`?(0,X.jsx)(Ct,{number:e.number}):null,r]})]})}var $={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function St({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,X.jsx)(j,{"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:k(t,`text-success`)}):e===`failing`?(0,X.jsx)(M,{"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:k(t,`text-danger`)}):e===`pending`?(0,X.jsx)(l,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:k(t,`animate-spin text-warning`)}):(0,X.jsx)(ke,{"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:k(t,`text-soft-foreground`)})}function Ct({number:e}){let t=p(),n=E({queryKey:i.githubMergeState(e),queryFn:({signal:t})=>m(e,{},{signal:t}),retry:!1}),a=n.data?.available?n.data.mergeState:null,[o,s]=(0,Y.useState)(null),[c,l]=(0,Y.useState)(!1),[u,f]=(0,Y.useState)(!1),h=d({mutationFn:()=>m(e,{refresh:!0}),onSuccess:n=>t.setQueryData(i.githubMergeState(e),n),onError:e=>v(e instanceof Error?e.message:String(e),{tone:`danger`})}),_=o&&a?.methods.includes(o)?o:a?.defaultMethod??a?.methods[0]??null,b=d({mutationFn:()=>{if(!a||!_)throw Error(`No merge method is available.`);return r(e,{method:_,expectedHeadSha:a.headSha,...u&&a.canOverride?{overrideRules:!0}:{}})},onSuccess:()=>{l(!1),v(`Pull request #${e} merged`),t.invalidateQueries({queryKey:i.githubMergeState(e)}),t.invalidateQueries({queryKey:i.github({limit:Q})}),t.invalidateQueries({queryKey:i.githubComments(`pr`,e)})},onError:n=>{v(n instanceof Error?n.message:String(n),{tone:`danger`}),t.invalidateQueries({queryKey:i.githubMergeState(e)})}});if(n.isPending)return(0,X.jsx)(Z,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`});if(!a)return(0,X.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,X.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:n.data?.available===!1?n.data.reason:`GitHub could not load merge requirements.`})]});let x=a.state===`merged`?`Merged`:a.state===`closed`?`Closed`:a.isDraft?`Draft`:a.mergeable===`conflicting`?`Conflicts must be resolved`:a.canMerge?`Ready to merge`:`Merge blocked`,S=a.reviewDecision===`approved`?`passing`:a.reviewDecision===`unknown`?`unknown`:`failing`,C=a.mergeable===`mergeable`?`passing`:a.mergeable===`conflicting`?`failing`:`unknown`,w=!!(_&&(a.canMerge||a.canOverride&&u));return(0,X.jsxs)(`section`,{"data-slot":`gh-merge-box`,"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[a.canMerge?(0,X.jsx)(y,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,X.jsx)(ne,{"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(`h3`,{className:`font-semibold`,children:x}),(0,X.jsxs)(g,{type:`button`,variant:`ghost`,size:`sm`,disabled:h.isPending,onClick:()=>h.mutate(),children:[(0,X.jsx)(te,{"aria-hidden":`true`,className:k(`size-3.5`,h.isPending&&`animate-spin`)}),`Refresh`]})]}),(0,X.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[a.headRef,` (`,a.headSha.slice(0,7),`) → `,a.baseRef]}),(0,X.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,X.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(St,{state:S}),(0,X.jsxs)(`span`,{children:[`Reviews: `,a.reviewDecision.replaceAll(`-`,` `)]})]}),(0,X.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(St,{state:C}),(0,X.jsxs)(`span`,{children:[`Conflicts: `,a.mergeable===`conflicting`?`present`:a.mergeable===`mergeable`?`none`:`unknown`]})]}),a.checks.length===0?(0,X.jsx)(`li`,{children:`No checks configured`}):a.checks.map(e=>(0,X.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(St,{state:e.state}),(0,X.jsxs)(`span`,{children:[e.name,` · `,e.state,e.required===!0?` · required`:e.required===null?` · requiredness unknown`:``]})]}),e.url&&D(e.url)?(0,X.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]},e.name)),a.blockers.map(e=>(0,X.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),a.canOverride?(0,X.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-warning/40 bg-warning/5 p-3 text-xs`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>f(e.target.checked),className:`mt-0.5 size-4 accent-primary`}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,X.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,a.state===`open`&&a.methods.length>0?(0,X.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 sm:flex-row`,children:[(0,X.jsx)(`select`,{"aria-label":`Merge method`,value:_??``,onChange:e=>s(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:a.methods.map(e=>(0,X.jsx)(`option`,{value:e,children:$[e]},e))}),(0,X.jsx)(g,{disabled:!w,onClick:()=>l(!0),children:_?$[_]:`Merge`})]}):null]})]}),(0,X.jsx)(oe,{open:c,onOpenChange:l,children:(0,X.jsxs)(we,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,X.jsxs)(Te,{children:[(0,X.jsxs)(ue,{children:[_?$[_]:`Merge`,` pull request #`,e,`?`]}),(0,X.jsxs)(de,{children:[`This will merge “`,a.title,`” into `,a.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`,u&&a.canOverride?` You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`:``]})]}),b.error?(0,X.jsx)(`p`,{className:`text-sm text-danger`,children:b.error.message}):null,(0,X.jsxs)(Ce,{children:[(0,X.jsx)(g,{variant:`outline`,disabled:b.isPending,onClick:()=>l(!1),children:`Cancel`}),(0,X.jsx)(g,{disabled:b.isPending,onClick:()=>b.mutate(),children:b.isPending?`Merging…`:_?$[_]:`Merge`})]})]})})]})}function wt({item:e}){let t=p(),n=a(e.number),[r,i]=(0,Y.useState)(``),[o,s]=(0,Y.useState)(null),c=n.data,l=c?.available?c.files.filter(e=>e.path.toLowerCase().includes(r.toLowerCase())):[],u=l.findIndex(e=>e.path===o);(0,Y.useEffect)(()=>{l.length>0&&!l.some(e=>e.path===o)&&s(l[0].path)},[c?.available?c.headSha:``,r]);let d=async()=>{let n=c?.available?c.headSha:null,r=await h(e.number,{refresh:!0});t.setQueryData([`github`,`pr-changes`,e.number],r),r.available&&n&&n!==r.headSha&&(s(r.files[0]?.path??null),v(`The reviewed revision changed.`))};if(n.isPending)return(0,X.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!c)return(0,X.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!c.available)return(0,X.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:c.reason});let f=l.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),m=D(e.url)?`${e.url}/files`:null,_=l.find(e=>e.path===o);return(0,X.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,X.jsxs)(`strong`,{children:[c.files.length,` changed files`]}),(0,X.jsxs)(`span`,{className:`text-success`,children:[`+`,c.additions]}),(0,X.jsxs)(`span`,{className:`text-danger`,children:[`−`,c.deletions]}),(0,X.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:c.headSha,children:[`head `,c.headSha.slice(0,8)]}),(0,X.jsx)(g,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void d(),children:`Refresh`})]}),c.truncated?(0,X.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[c.reason??`This response is incomplete.`,` `,m?(0,X.jsx)(`a`,{href:m,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,X.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,X.jsxs)(`aside`,{className:`min-w-0`,children:[(0,X.jsx)(`input`,{"aria-label":`Filter changed files`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,X.jsx)(`select`,{"aria-label":`Select changed file`,value:o??``,onChange:e=>s(e.target.value),className:`mt-2 min-h-11 w-full rounded-md border border-input bg-background px-2 text-sm lg:hidden`,children:l.map(e=>(0,X.jsx)(`option`,{children:e.path},e.path))}),(0,X.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:l.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,onClick:()=>s(e.path),className:k(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,o===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,X.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,X.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,X.jsx)(g,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:u<=0,onClick:()=>s(l[u-1]?.path??null),children:(0,X.jsx)(He,{})}),(0,X.jsx)(g,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:u<0||u>=l.length-1,onClick:()=>s(l[u+1]?.path??null),children:(0,X.jsx)(De,{})})]}),l.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Ve,{files:f.filter(e=>e.path===o),wrap:!0,className:`min-w-0`}),_&&!_.patch?(0,X.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,_.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Tt({item:e,colors:t}){let n=T(e.kind,e.number),r=n.data,i=(0,Y.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(Et(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,X.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,X.jsx)(Z,{className:`mb-3 h-3 w-24`}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(Z,{className:`h-14 w-full`}),(0,X.jsx)(Z,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,X.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,X.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,X.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,X.jsx)(N,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,X.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,X.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-soft-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,X.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Dt(i).map(e=>e.group===`commits`?(0,X.jsx)(Ot,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,X.jsx)(Pt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,X.jsx)(At,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,X.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-soft-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,X.jsx)(N,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var Et=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Dt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function Ot({commits:e,colors:t}){let[n,r]=(0,Y.useState)(!1),i=e[0]?.actor??`?`;return n?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,children:kt.committed}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,X.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,X.jsx)(At,{event:e,colors:t},e.id))]}):(0,X.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,children:kt.committed}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,X.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,X.jsx)(`span`,{className:`shrink-0`,children:J(e[e.length-1].createdAt)})]})})}var kt={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function At({event:e,colors:t}){return(0,X.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:k(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:kt[e.kind]}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,X.jsx)(jt,{event:e,colors:t}),(0,X.jsx)(`span`,{className:`shrink-0`,children:J(e.createdAt)}),e.url?(0,X.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,X.jsx)(N,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function jt({event:e,colors:t}){switch(e.kind){case`committed`:return(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,X.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,X.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,X.jsx)(Mt,{checks:e.checks})]});case`labeled`:case`unlabeled`:return(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,X.jsx)(`span`,{"data-slot":`gh-event-label`,style:nt(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[10px]`,children:e.label.name}):null,(0,X.jsx)(`span`,{className:`shrink-0`,children:`label`})]});case`assigned`:case`unassigned`:return(0,X.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]});case`merged`:return(0,X.jsx)(`span`,{children:`merged this`});case`closed`:return(0,X.jsx)(`span`,{children:`closed this`});case`reopened`:return(0,X.jsx)(`span`,{children:`reopened this`});case`head_ref_force_pushed`:return(0,X.jsx)(`span`,{children:`force-pushed`});case`renamed`:return(0,X.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]});case`cross-referenced`:return(0,X.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}}function Mt({checks:e}){return e?(0,X.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:k(`shrink-0`,Lt[e]),children:It[e]}):null}var Nt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function Pt({comment:e}){let t=e.reviewState?Nt[e.reviewState]:null;return(0,X.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,X.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,X.jsx)(Ft,{url:e.avatarUrl,login:e.author}),(0,X.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,X.jsx)(`span`,{children:J(e.createdAt)}),t?(0,X.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:k(`rounded-full border px-1.5 py-px font-sans text-[10px] font-medium`,t.tone),children:t.label}):null,(0,X.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,X.jsx)(N,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,X.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,X.jsx)(Re,{children:e.body}):(0,X.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function Ft({url:e,login:t}){let[n,r]=(0,Y.useState)(!1);return e&&!n?(0,X.jsx)(`img`,{src:e,alt:``,width:16,height:16,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-4 shrink-0 rounded-full`}):(0,X.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var It={passing:`✓`,failing:`✗`,pending:`○`},Lt={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Rt({count:e}){return e?(0,X.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(We,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function zt({checks:e,url:t}){let n=k(`text-[11px] font-medium`,Lt[e],t&&`hover:underline`),r=`${It[e]} checks ${e}`;return t?(0,X.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,X.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function Bt({checks:e}){return(0,X.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:k(`shrink-0 font-sans text-[11px] font-semibold`,Lt[e]),children:It[e]})}export{ht as GithubIndexRoute,gt as GithubRoute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,r as i,t as a}from"./chunk-BO2N2NFS-DE6qKn3r.js";var o=e(t(),1),s=n(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(r),p=i(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(a,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./zoomable-image-BBB-AoPi.js";var n=e();function r(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function i({file:e,imageSrc:r,onOpenInApp:i}){return e.status===`deleted`?(0,n.jsx)(a,{children:`Image deleted — only the new side can be previewed.`}):r?(0,n.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[(0,n.jsx)(t,{src:r(e.path),alt:e.path,className:`max-h-[60vh] max-w-full rounded-sm`}),i?(0,n.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>i(e.path),className:`text-[11px] font-medium text-soft-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,n.jsx)(a,{children:`Binary file — no text diff.`})}function a({children:e}){return(0,n.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}export{r as n,i as t};
|