@aiworker/web 1.23.1 → 1.23.2
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/assets/{CodeMirrorCommentWidgets-teB3HmBT.js → CodeMirrorCommentWidgets-COGJG0Iv.js} +1 -1
- package/dist/assets/{DiffView-DC9RX3MF.js → DiffView-BviYY3zL.js} +1 -1
- package/dist/assets/{DirtyBranchSwitchDialog-DwPkzXsS.js → DirtyBranchSwitchDialog-C26DvfVJ.js} +1 -1
- package/dist/assets/{FilesView-BFZkuu4O.js → FilesView-D0ZU_nCt.js} +1 -1
- package/dist/assets/{GitView-B_x52MHY.js → GitView-CYgiDRH-.js} +1 -1
- package/dist/assets/{JsonTreeView-cmAzUTiw.js → JsonTreeView-GsV9UScz.js} +1 -1
- package/dist/assets/{LinearIssuesView-Dehh5afm.js → LinearIssuesView-shqUS8nl.js} +1 -1
- package/dist/assets/{MarkdownImageGallery-DgNOqqhE.js → MarkdownImageGallery-CQSTFp6m.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-DusmMZ_p.js → MarkdownRendererImpl-DJWP3A8X.js} +1 -1
- package/dist/assets/{OnboardingScreen-B8fm1H4m.js → OnboardingScreen-CTuu4lgo.js} +1 -1
- package/dist/assets/{PatchDiff-BVr7gJU0.js → PatchDiff-Dp53v2pl.js} +1 -1
- package/dist/assets/{PierreDiffViewer-DzLt-nel.js → PierreDiffViewer-B5l0djPS.js} +1 -1
- package/dist/assets/{PlanView-BmQUYT_z.js → PlanView-CLUWkGiG.js} +1 -1
- package/dist/assets/{SettingsView-ChWmAcZT.js → SettingsView-CojPQVHx.js} +1 -1
- package/dist/assets/{SettingsWindow-Dy3M6ZB9.js → SettingsWindow-DbgEnZ6T.js} +1 -1
- package/dist/assets/{ToolOutputDialog-cTl_eLIH.js → ToolOutputDialog-Du-RZj-a.js} +1 -1
- package/dist/assets/{ToolPartDiffPreview-C_3iYNJQ.js → ToolPartDiffPreview-HBLSokoe.js} +1 -1
- package/dist/assets/{VirtualizedFileDiff-CAWthkoy.js → VirtualizedFileDiff-Bzp3hClU.js} +1 -1
- package/dist/assets/{WalkthroughView-C7AHOpCA.js → WalkthroughView-CpgA4s9w.js} +1 -1
- package/dist/assets/{computeVirtualFileMetrics-BkiDSlTW.js → computeVirtualFileMetrics-CI1PC_z2.js} +1 -1
- package/dist/assets/{de-DJsQr-p7.js → de-BX8b4hDD.js} +1 -1
- package/dist/assets/{es-BuYMlA9g.js → es-e98cS-yM.js} +1 -1
- package/dist/assets/{fr-ePDay33C.js → fr-BOiqxJAs.js} +1 -1
- package/dist/assets/{index-n6O3hklM.js → index-Cmn74sw-.js} +1 -1
- package/dist/assets/{isDiffPlainText-GMdPz-71.js → isDiffPlainText-DVralkU-.js} +1 -1
- package/dist/assets/{isFilePlainText-BVuH1zH9.js → isFilePlainText-CgTREsRX.js} +1 -1
- package/dist/assets/{ja-BzR9xOY_.js → ja-aoO55hGu.js} +1 -1
- package/dist/assets/{ko-BEjHAm14.js → ko-BGzFLogk.js} +1 -1
- package/dist/assets/{main-D3ZDQglc.js → main-BgfXQ-4g.js} +2 -2
- package/dist/assets/{main-BydQ1tr_.js → main-DGYUWmIt.js} +4 -4
- package/dist/assets/{markdownCore-Cb2MdZnV.js → markdownCore-BesaNs_G.js} +1 -1
- package/dist/assets/{miniChat-d01k801U.js → miniChat-DHKXp-_I.js} +2 -2
- package/dist/assets/{mobile-D7VV-Ufz.js → mobile-lXQ08VnX.js} +2 -2
- package/dist/assets/{patchFileDiff-CdztVMz0.js → patchFileDiff-i1lTtNbn.js} +1 -1
- package/dist/assets/{pl-rQmpxNIF.js → pl-B5x19laq.js} +1 -1
- package/dist/assets/{pt-BR-CorbsSW-.js → pt-BR-C3oU51Il.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-BGG9UIlh.js → renderElectronMiniChatApp-CuO4ue6B.js} +2 -2
- package/dist/assets/{renderMobileApp-BRP3J1iv.js → renderMobileApp-B3zFlHy4.js} +3 -3
- package/dist/assets/{runtimeEndpointReset-BhT_-c52.js → runtimeEndpointReset-BLzrtrmj.js} +3 -3
- package/dist/assets/{shikiHighlight-BzXUjlby.js → shikiHighlight-ctlcPvvx.js} +1 -1
- package/dist/assets/{tr-CoAMXPtI.js → tr-C0QQa7et.js} +1 -1
- package/dist/assets/{uk-YlAX0rRU.js → uk-CqLSe9wT.js} +1 -1
- package/dist/assets/{useAppFontEffects-Cwyhjfl5.js → useAppFontEffects-B6OfEypo.js} +8 -8
- package/dist/assets/{useGitComparison-BCZVefdE.js → useGitComparison-BXZXEAW6.js} +1 -1
- package/dist/assets/{useInlineCommentController-DDkpBEU8.js → useInlineCommentController-CgbrpEWu.js} +1 -1
- package/dist/assets/{useRootScrollLock-CwjoWuC4.js → useRootScrollLock-Me41OjBT.js} +1 -1
- package/dist/assets/{vendor-codemirror-language-data-Cb1YnICj.js → vendor-codemirror-language-data-SJuFp0a0.js} +2 -2
- package/dist/assets/{web-components-LV3vjTxy.js → web-components-D8GS8Ork.js} +1 -1
- package/dist/assets/{zh-CN-DDYg0Jl7.js → zh-CN-iJEie4d6.js} +6 -6
- package/dist/assets/{zh-TW-CQKaCayr.js → zh-TW-CyslEwlK.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/mini-chat.html +1 -1
- package/dist/mobile.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as N,f as ue,j as o,c as He}from"./vendor-react-BUCujlKS.js";import{R as Ke,fV as Xe,i1 as Qe,f as Me,h as pe,I as P,i2 as et,cn as _e,au as $e,i3 as tt,i4 as it,i5 as ot,i6 as rt,i7 as nt,c8 as We,i8 as st,i9 as at,em as lt,en as Le,ia as ct,bO as mt,bN as dt}from"./useAppFontEffects-
|
|
1
|
+
import{R as N,f as ue,j as o,c as He}from"./vendor-react-BUCujlKS.js";import{R as Ke,fV as Xe,i1 as Qe,f as Me,h as pe,I as P,i2 as et,cn as _e,au as $e,i3 as tt,i4 as it,i5 as ot,i6 as rt,i7 as nt,c8 as We,i8 as st,i9 as at,em as lt,en as Le,ia as ct,bO as mt,bN as dt}from"./useAppFontEffects-B6OfEypo.js";import{F as Ue,J as ut}from"./JsonTreeView-GsV9UScz.js";import{P as ft}from"./PatchDiff-Dp53v2pl.js";import{cF as Ne,h as pt}from"./index-BD8ILbxF.js";import{ensurePierreThemeRegistered as Ee}from"./appThemeRegistry-BK0dHKa6.js";import{u as ht}from"./vendor-tanstack-react-virtual-g05Cx3z9.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-zustand-BAGL70zf.js";import"./vendor-base-ui-BY_5qla_.js";import"./vendor-floating-ui-utils-D6FqdtJt.js";import"./vendor-floating-ui-react-dom-DxYCWdHj.js";import"./vendor-floating-ui-dom-BTvzWks8.js";import"./vendor-floating-ui-core-PuGzNPnN.js";import"./vendor-use-sync-external-store-D6wYuSt-.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-dnd-kit-core-BZknOX2w.js";import"./vendor-dnd-kit-utilities-B_MdXhJC.js";import"./vendor-dnd-kit-accessibility-BHxJPORy.js";import"./vendor-dnd-kit-sortable-CsEagZ81.js";import"./vendor-framer-motion-livSKyyV.js";import"./vendor-motion-dom-D_o3BTI3.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./contextPanelEmbeddedChat-BdA6bdky.js";import"./vendor-sonner-DFyL3AvE.js";import"./vendor-cmdk-DgLInKvT.js";import"./vendor-radix-ui-react-dialog-B94Bt2qq.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-DcAh5WdT.js";import"./vendor-radix-ui-react-context-Czxm7Z62.js";import"./vendor-radix-ui-react-id-f5BLKEVw.js";import"./vendor-radix-ui-react-use-layout-effect-D_3IhJdJ.js";import"./vendor-radix-ui-react-use-controllable-state-BFT5YmkA.js";import"./vendor-radix-ui-react-dismissable-layer-D7kXcwgJ.js";import"./vendor-radix-ui-react-primitive-DhVoX9SD.js";import"./vendor-radix-ui-react-slot-BQgQOasS.js";import"./vendor-radix-ui-react-use-callback-ref-BZPnuXAC.js";import"./vendor-radix-ui-react-use-escape-keydown-oph88g-F.js";import"./vendor-radix-ui-react-focus-scope-CiaxW4dD.js";import"./vendor-radix-ui-react-portal-BMJYHWck.js";import"./vendor-radix-ui-react-presence-CNxf-uq4.js";import"./vendor-radix-ui-react-focus-guards-B6qJXYua.js";import"./vendor-react-remove-scroll-DO7dCTnK.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-BcFYyj3E.js";import"./vendor-react-style-singleton-q6EMHnwf.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-zDC0RhA3.js";import"./vendor-use-callback-ref-D3RC8gqK.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-codemirror-language-BgPj_McA.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-codemirror-state-C9awkmn-.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-CiLROUVV.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-lezer-highlight-CDMHUZ74.js";import"./vendor-codemirror-lang-javascript-Cc2ZYbgX.js";import"./vendor-lezer-javascript-D7Tj24ot.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-codemirror-autocomplete-DzPz9Wgq.js";import"./vendor-codemirror-lang-json-CMBS2tG9.js";import"./vendor-lezer-json-Iaex0UN-.js";import"./vendor-codemirror-lang-css-O0cZX78y.js";import"./vendor-lezer-css-C5xB6jxd.js";import"./vendor-codemirror-lang-html-CfgK872x.js";import"./vendor-lezer-html-C0I1p52t.js";import"./vendor-codemirror-lang-markdown-BPGOH9ye.js";import"./vendor-lezer-markdown-C6g-d6P3.js";import"./vendor-codemirror-language-data-SJuFp0a0.js";import"./vendor-codemirror-lang-python-HahnQaAS.js";import"./vendor-lezer-python-CvuFxeZl.js";import"./vendor-codemirror-commands-B7H_j0iU.js";import"./vendor-legendapp-list-BuBPBC3R.js";import"./vendor-zod-B6551dwG.js";import"./vendor-tailwind-merge-CPcsbTWB.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./web-components-D8GS8Ork.js";import"./computeVirtualFileMetrics-CI1PC_z2.js";import"./vendor-shiki-Bbf2GEcE.js";import"./vendor-shikijs-core-CGM_jqPK.js";import"./vendor-shikijs-types-CPSbSeK6.js";import"./vendor-shikijs-vscode-textmate-BgLrS_2D.js";import"./vendor-hast-util-to-html-BKBhbTDb.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-property-information-rJCbAzvX.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-comma-separated-tokens-D8TqSuIK.js";import"./vendor-space-separated-tokens-DD3iYX1K.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-shikijs-engine-oniguruma-DPWuIF1G.js";import"./themeResolver-BmJyTmjJ.js";import"./vendor-pierre-theming-C6Z4M5_u.js";import"./vendor-shikijs-engine-javascript-Cme4830A.js";import"./vendor-oniguruma-to-es-DLBnFDCE.js";import"./vendor-oniguruma-parser-C0D4_9rT.js";import"./vendor-regex-BBWcyTkg.js";import"./vendor-regex-utilities-2BQyy0xI.js";import"./vendor-regex-recursion-JU4mF-dD.js";import"./vendor-shikijs-transformers-CZWsLLKm.js";import"./Virtualizer-CZlLSacm.js";import"./isFilePlainText-CgTREsRX.js";import"./VirtualizedFileDiff-Bzp3hClU.js";import"./isDiffPlainText-DVralkU-.js";import"./vendor-diff-C3JhlQdm.js";import"./vendor-opencode-sdk-BJ73u-bH.js";import"./registerCustomTheme-BBXUCRnG.js";import"./vendor-tanstack-virtual-core-Dubg10g5.js";const gt=80,Oe=20,qe=N.memo(i=>{const e=ue.c(26),{lines:t,language:a,maxHeight:c,showLineNumbers:r,lineStyles:l}=i,n=c===void 0?"60vh":c,s=r===void 0?!0:r,{currentTheme:f}=Ke();let d;e[0]!==f?(d=Xe(f),e[0]=f,e[1]=d):d=e[1];const y=d;let T;e[2]!==t?(T=t.map(xt).join(`
|
|
2
2
|
`),e[2]=t,e[3]=T):T=e[3];const b=Qe(T,a).lines;if(!(t.length>gt)){const v=y;let w;e[4]!==n||e[5]!==v?(w={...v,maxHeight:n,overflow:"auto"},e[4]=n,e[5]=v,e[6]=w):w=e[6];let x;if(e[7]!==b||e[8]!==l||e[9]!==t||e[10]!==s){let h;e[12]!==b||e[13]!==l||e[14]!==s?(h=(S,L)=>o.jsx(Pe,{line:S,html:b?.[L],showLineNumbers:s,style:l?.(S)},L),e[12]=b,e[13]=l,e[14]=s,e[15]=h):h=e[15],x=t.map(h),e[7]=b,e[8]=l,e[9]=t,e[10]=s,e[11]=x}else x=e[11];let u;return e[16]!==w||e[17]!==x?(u=o.jsx("div",{className:"typography-code font-mono w-full min-w-0",style:w,children:x}),e[16]=w,e[17]=x,e[18]=u):u=e[18],u}let k;return e[19]!==b||e[20]!==l||e[21]!==t||e[22]!==n||e[23]!==s||e[24]!==y?(k=o.jsx(Be,{lines:t,highlighted:b,syntaxVars:y,maxHeight:n,showLineNumbers:s,lineStyles:l}),e[19]=b,e[20]=l,e[21]=t,e[22]=n,e[23]=s,e[24]=y,e[25]=k):k=e[25],k});qe.displayName="VirtualizedCodeBlock";const Be=N.memo(({lines:i,highlighted:e,syntaxVars:t,maxHeight:a,showLineNumbers:c,lineStyles:r})=>{const l=N.useRef(null),n=`min(${i.length*Oe}px, ${a})`,s=ht({count:i.length,getScrollElement:()=>l.current,estimateSize:()=>Oe,overscan:20}),f=s.getVirtualItems();return o.jsx("div",{ref:l,className:"typography-code font-mono w-full min-w-0",style:{...t,height:n,maxHeight:a,overflow:"auto"},children:o.jsx("div",{style:{height:s.getTotalSize(),position:"relative"},children:f.map(d=>{const y=i[d.index];return y?o.jsx("div",{"data-index":d.index,ref:s.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${d.start}px)`},children:o.jsx(Pe,{line:y,html:e?.[d.index],showLineNumbers:c,style:r?.(y)})},d.index):null})})})});Be.displayName="VirtualizedRows";const Pe=N.memo(i=>{const e=ue.c(12),{line:t,html:a,showLineNumbers:c,style:r}=i;let l;e[0]!==t.isInfo||e[1]!==t.lineNumber||e[2]!==c?(l=c&&o.jsx("span",{className:"w-10 flex-shrink-0 text-right pr-3 select-none border-r mr-3 -my-0.5 py-0.5",style:{color:"var(--tools-edit-line-number)",borderColor:"var(--tools-border)"},children:!t.isInfo&&t.lineNumber!=null?t.lineNumber:""}),e[0]=t.isInfo,e[1]=t.lineNumber,e[2]=c,e[3]=l):l=e[3];let n;e[4]!==a||e[5]!==t.isInfo||e[6]!==t.text?(n=o.jsx("div",{className:"flex-1 min-w-0",children:t.isInfo?o.jsx("div",{className:"whitespace-pre-wrap break-words text-muted-foreground/70 italic",children:t.text}):a!==void 0?o.jsx("div",{className:"whitespace-pre",dangerouslySetInnerHTML:{__html:a}}):o.jsx("div",{className:"whitespace-pre",children:t.text})}),e[4]=a,e[5]=t.isInfo,e[6]=t.text,e[7]=n):n=e[7];let s;return e[8]!==r||e[9]!==l||e[10]!==n?(s=o.jsxs("div",{className:"typography-code font-mono flex w-full min-w-0",style:r,children:[l,n]}),e[8]=r,e[9]=l,e[10]=n,e[11]=s):s=e[11],s});Pe.displayName="VirtualizedCodeBlock.Row";function xt(i){return i.text}class Ce extends Error{key;params;constructor(e,t){super(e),this.name="MermaidLoadFailure",this.key=e,this.params=t}}const wt=(i,e)=>new Ce(i,e),bt=i=>i instanceof Ce,yt=i=>i+1,Ae=(i,e)=>i===e,vt=i=>{const e=i.indexOf(",");if(e<0)throw wt("chat.toolOutputDialog.mermaid.dataUrlMalformed");const t=i.slice(0,e).toLowerCase(),a=i.slice(e+1);return t.includes(";base64")?atob(a):decodeURIComponent(a)},jt=i=>Promise.resolve().then(()=>vt(i)),Ie=(i,e)=>new Ce(i,e),Nt=i=>{const e="h-3.5 w-3.5 flex-shrink-0",t=i.toLowerCase();return t==="reasoning"?o.jsx(P,{name:"brain-ai-3",className:e}):t==="image-preview"?o.jsx(P,{name:"file-image",className:e}):t==="mermaid-preview"?o.jsx(P,{name:"file-list-2",className:e}):t==="edit"||t==="multiedit"||t==="apply_patch"||t==="str_replace"||t==="str_replace_based_edit_tool"?o.jsx(P,{name:"pencil-ai",className:e}):t==="write"||t==="create"||t==="file_write"?o.jsx(P,{name:"file-pdf",className:e}):t==="read"||t==="view"||t==="file_read"||t==="cat"?o.jsx(P,{name:"file-pdf",className:e}):t==="bash"||t==="shell"||t==="cmd"||t==="terminal"?o.jsx(P,{name:"terminal-box",className:e}):t==="list"||t==="ls"||t==="dir"||t==="list_files"?o.jsx(P,{name:"folder-6",className:e}):t==="search"||t==="grep"||t==="find"||t==="ripgrep"?o.jsx(P,{name:"search",className:e}):t==="glob"?o.jsx(P,{name:"file-search",className:e}):t==="fetch"||t==="curl"||t==="wget"||t==="webfetch"?o.jsx(P,{name:"global",className:e}):t==="web-search"||t==="websearch"||t==="search_web"||t==="google"||t==="bing"||t==="duckduckgo"?o.jsx(P,{name:"search",className:e}):t==="todowrite"||t==="todoread"?o.jsx(P,{name:"list-check-3",className:e}):t==="plan_enter"?o.jsx(P,{name:"file-list-2",className:e}):t==="plan_exit"?o.jsx(P,{name:"task",className:e}):t.startsWith("git")?o.jsx(P,{name:"git-branch",className:e}):o.jsx(P,{name:"tools",className:e})},Fe=150,St=40,kt=120,Tt=3,Re={style:{background:"transparent",backgroundColor:"transparent",fontSize:"inherit"}},_t={download:!1,copy:!1,showPanZoomControls:!0},Rt=`
|
|
3
3
|
[data-diff-header],
|
|
4
4
|
[data-diff] {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as D,f as x,j as b}from"./vendor-react-BUCujlKS.js";import{P as E}from"./PatchDiff-
|
|
1
|
+
import{R as D,f as x,j as b}from"./vendor-react-BUCujlKS.js";import{P as E}from"./PatchDiff-Dp53v2pl.js";import{em as P,en as k,ib as _}from"./useAppFontEffects-B6OfEypo.js";import{ensurePierreThemeRegistered as S}from"./appThemeRegistry-BK0dHKa6.js";import"./vendor-scheduler-7OC5HNn7.js";import"./web-components-D8GS8Ork.js";import"./computeVirtualFileMetrics-CI1PC_z2.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-shiki-Bbf2GEcE.js";import"./vendor-shikijs-core-CGM_jqPK.js";import"./vendor-shikijs-types-CPSbSeK6.js";import"./vendor-shikijs-vscode-textmate-BgLrS_2D.js";import"./vendor-hast-util-to-html-BKBhbTDb.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-property-information-rJCbAzvX.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-comma-separated-tokens-D8TqSuIK.js";import"./vendor-space-separated-tokens-DD3iYX1K.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-shikijs-engine-oniguruma-DPWuIF1G.js";import"./themeResolver-BmJyTmjJ.js";import"./vendor-pierre-theming-C6Z4M5_u.js";import"./vendor-shikijs-engine-javascript-Cme4830A.js";import"./vendor-oniguruma-to-es-DLBnFDCE.js";import"./vendor-oniguruma-parser-C0D4_9rT.js";import"./vendor-regex-BBWcyTkg.js";import"./vendor-regex-utilities-2BQyy0xI.js";import"./vendor-regex-recursion-JU4mF-dD.js";import"./vendor-shikijs-transformers-CZWsLLKm.js";import"./Virtualizer-CZlLSacm.js";import"./VirtualizedFileDiff-Bzp3hClU.js";import"./isDiffPlainText-DVralkU-.js";import"./vendor-diff-C3JhlQdm.js";import"./index-BD8ILbxF.js";import"./vendor-zod-B6551dwG.js";import"./vendor-zustand-BAGL70zf.js";import"./vendor-opencode-sdk-BJ73u-bH.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-base-ui-BY_5qla_.js";import"./vendor-floating-ui-utils-D6FqdtJt.js";import"./vendor-floating-ui-react-dom-DxYCWdHj.js";import"./vendor-floating-ui-dom-BTvzWks8.js";import"./vendor-floating-ui-core-PuGzNPnN.js";import"./vendor-use-sync-external-store-D6wYuSt-.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-dnd-kit-core-BZknOX2w.js";import"./vendor-dnd-kit-utilities-B_MdXhJC.js";import"./vendor-dnd-kit-accessibility-BHxJPORy.js";import"./vendor-dnd-kit-sortable-CsEagZ81.js";import"./vendor-framer-motion-livSKyyV.js";import"./vendor-motion-dom-D_o3BTI3.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./vendor-tanstack-react-virtual-g05Cx3z9.js";import"./vendor-tanstack-virtual-core-Dubg10g5.js";import"./contextPanelEmbeddedChat-BdA6bdky.js";import"./vendor-sonner-DFyL3AvE.js";import"./vendor-cmdk-DgLInKvT.js";import"./vendor-radix-ui-react-dialog-B94Bt2qq.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-DcAh5WdT.js";import"./vendor-radix-ui-react-context-Czxm7Z62.js";import"./vendor-radix-ui-react-id-f5BLKEVw.js";import"./vendor-radix-ui-react-use-layout-effect-D_3IhJdJ.js";import"./vendor-radix-ui-react-use-controllable-state-BFT5YmkA.js";import"./vendor-radix-ui-react-dismissable-layer-D7kXcwgJ.js";import"./vendor-radix-ui-react-primitive-DhVoX9SD.js";import"./vendor-radix-ui-react-slot-BQgQOasS.js";import"./vendor-radix-ui-react-use-callback-ref-BZPnuXAC.js";import"./vendor-radix-ui-react-use-escape-keydown-oph88g-F.js";import"./vendor-radix-ui-react-focus-scope-CiaxW4dD.js";import"./vendor-radix-ui-react-portal-BMJYHWck.js";import"./vendor-radix-ui-react-presence-CNxf-uq4.js";import"./vendor-radix-ui-react-focus-guards-B6qJXYua.js";import"./vendor-react-remove-scroll-DO7dCTnK.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-BcFYyj3E.js";import"./vendor-react-style-singleton-q6EMHnwf.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-zDC0RhA3.js";import"./vendor-use-callback-ref-D3RC8gqK.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-codemirror-language-BgPj_McA.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-codemirror-state-C9awkmn-.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-CiLROUVV.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-lezer-highlight-CDMHUZ74.js";import"./vendor-codemirror-lang-javascript-Cc2ZYbgX.js";import"./vendor-lezer-javascript-D7Tj24ot.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-codemirror-autocomplete-DzPz9Wgq.js";import"./vendor-codemirror-lang-json-CMBS2tG9.js";import"./vendor-lezer-json-Iaex0UN-.js";import"./vendor-codemirror-lang-css-O0cZX78y.js";import"./vendor-lezer-css-C5xB6jxd.js";import"./vendor-codemirror-lang-html-CfgK872x.js";import"./vendor-lezer-html-C0I1p52t.js";import"./vendor-codemirror-lang-markdown-BPGOH9ye.js";import"./vendor-lezer-markdown-C6g-d6P3.js";import"./vendor-codemirror-language-data-SJuFp0a0.js";import"./vendor-codemirror-lang-python-HahnQaAS.js";import"./vendor-lezer-python-CvuFxeZl.js";import"./vendor-codemirror-commands-B7H_j0iU.js";import"./vendor-legendapp-list-BuBPBC3R.js";import"./vendor-tailwind-merge-CPcsbTWB.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./registerCustomTheme-BBXUCRnG.js";const C=`
|
|
2
2
|
[data-diff-header],
|
|
3
3
|
[data-diff] {
|
|
4
4
|
[data-separator] {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as Te,c as Qe,g as et,s as tt,d as Xe,e as Fe,f as it,h as nt,i as Ye,j as Ne,k as he,l as st,R as rt,I as ot,p as Ue,m as at,n as lt,o as ht,q as Pe,S as dt,r as ut,w as ft,t as Oe,u as ct,v as pt,x as Ae,y as gt,z as mt,A as Ct,B as St,C as vt,a as yt,F as Lt}from"./web-components-
|
|
1
|
+
import{b as Te,c as Qe,g as et,s as tt,d as Xe,e as Fe,f as it,h as nt,i as Ye,j as Ne,k as he,l as st,R as rt,I as ot,p as Ue,m as at,n as lt,o as ht,q as Pe,S as dt,r as ut,w as ft,t as Oe,u as ct,v as pt,x as Ae,y as gt,z as mt,A as Ct,B as St,C as vt,a as yt,F as Lt}from"./web-components-D8GS8Ork.js";import{j as w,m as Se,k as Ht,n as Tt,d as At,i as ke,o as U,q as ce,s as kt,b as Rt,f as Be,t as Y,u as Je,w as Re}from"./computeVirtualFileMetrics-CI1PC_z2.js";import{h as xt,a as se,i as be,b as re,r as Dt,g as Et,c as ve,d as we,e as oe,f as Me,j as ae}from"./isDiffPlainText-DVralkU-.js";import{hr as bt,hH as wt,hI as Ie,fL as _,hJ as Mt,hK as It,hL as Ve,hM as zt,hx as Ft,hy as Nt,hz as Ut,hA as Pt}from"./useAppFontEffects-B6OfEypo.js";import{c as Ot}from"./vendor-diff-C3JhlQdm.js";import{t as le}from"./vendor-hast-util-to-html-BKBhbTDb.js";function J(e,t,i,n=!1){const s=bt(Ot(e.name,t.name,e.contents,t.contents,e.header,t.header,i),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:n});if(s==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return t.lang!=null&&(s.lang=t.lang),s}var Bt=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,i){if(t==null||i==null)for(const n of e.children??[])n instanceof HTMLElement&&("deletions"in n.dataset?t=n:"additions"in n.dataset&&(i=n));if(i==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==i&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=i,i.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function pe(e){return w({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function ge(e){return w({tagName:"div",children:[w({tagName:"span",children:[Se("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function xe(e){return w({tagName:"div",children:[Ht({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function K({type:e,content:t,expandIndex:i,chunked:n=!1,slotName:s,isFirstHunk:r,isLastHunk:o}){let a=0;const l=[];if(e==="metadata"&&t!=null&&l.push(w({tagName:"div",children:[Se(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const u=[];i!=null&&(n?(r||(u.push(xe("up")),a++),o||(u.push(xe("down")),a++)):(u.push(xe(!r&&!o?"both":r?"down":"up")),a++)),u.push(w({tagName:"div",children:[w({tagName:"span",children:[Se(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),n&&i!=null&&u.push(w({tagName:"div",children:[Se("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),l.push(w({tagName:"div",children:u,properties:{"data-separator-wrapper":"","data-separator-multi-button":a>1?"":void 0}}))}return e==="custom"&&s!=null&&l.push(w({tagName:"slot",properties:{name:s}})),w({tagName:"div",children:l,properties:{"data-separator":l.length===0?"simple":e,"data-expand-index":i,"data-separator-first":r?"":void 0,"data-separator-last":o?"":void 0}})}function Vt(e,t){return`hunk-separator-${e}-${t}`}function Gt(e){const t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function Wt(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function $t(e){return e!==""?e.split(wt):[]}function G(e,t){const i=J({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:i.hunks,splitLineCount:i.splitLineCount,unifiedLineCount:i.unifiedLineCount,additionLines:i.additionLines,deletionLines:i.deletionLines,type:i.type}}function _t(e,t){const i=e.deletionLines.join(""),n=i===`
|
|
2
2
|
`?`
|
|
3
3
|
`:`
|
|
4
4
|
`,s=J({name:e.prevName??e.name,contents:i},{name:e.name,contents:n,lang:e.lang},t);return{hunks:s.hunks,splitLineCount:s.splitLineCount,unifiedLineCount:s.unifiedLineCount,additionLines:[""],deletionLines:s.deletionLines,type:s.type}}function jt(e,t,i){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return B(e,G(e,i));const n=Array.from(t);if(n.length===0)return B(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(const r of n){const o=e.additionLines[r],a=e.deletionLines[r];if(o==null||a==null||Ie(o)===Ie(a))return B(e,G(e,i))}const s=qt(e,n);if(s.size===0)return B(e,G(e,i));for(const r of s)if(!Xt(e,r,i))return B(e,G(e,i));return Qt(e),xt(e)?B(e,G(e,i)):B(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function B(e,t){return Object.assign(e,t),t}function qt(e,t){const i=new Set;for(const n of t){const s=Kt(e,n);if(s==null)return new Set;i.add(s)}return i}function Kt(e,t){for(const[i,n]of e.hunks.entries()){const s=n.additionLineIndex+n.additionCount;if(t>=n.additionLineIndex&&t<s)return i}}function Xt(e,t,i){const n=e.hunks[t];if(n==null)return!1;const s=e.deletionLines.slice(n.deletionLineIndex,n.deletionLineIndex+n.deletionCount),r=e.additionLines.slice(n.additionLineIndex,n.additionLineIndex+n.additionCount),o=J({name:e.prevName??e.name,contents:s.join("")},{name:e.name,contents:r.join(""),lang:e.lang},{...i,context:0}),a=o.hunks[0];return a==null||o.hunks.length!==1?!1:(Jt(n,a),Yt(e,t),!0)}function Yt(e,t){const i=e.hunks[t];if(i==null)return;if(t!==e.hunks.length-1){i.noEOFCRAdditions=!1,i.noEOFCRDeletions=!1;return}const n=e.additionLines.at(-1),s=e.deletionLines.at(-1);i.noEOFCRAdditions=n!=null&&n!==""&&!n.endsWith(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,j as s,f as G}from"./vendor-react-BUCujlKS.js";import{f as ee,l as ft,I as j,dG as xt,B,h as J,au as rs,a9 as kt,aa as bt,ab as wt,aw as ns,af as as,ag as is,J as we,ah as ls,Y as cs,H as us,ao as it,ap as lt,ar as ct,as as ut,bW as dt,at as he,bc as pt,o as ds}from"./useAppFontEffects-
|
|
1
|
+
import{r as u,j as s,f as G}from"./vendor-react-BUCujlKS.js";import{f as ee,l as ft,I as j,dG as xt,B,h as J,au as rs,a9 as kt,aa as bt,ab as wt,aw as ns,af as as,ag as is,J as we,ah as ls,Y as cs,H as us,ao as it,ap as lt,ar as ct,as as ut,bW as dt,at as he,bc as pt,o as ds}from"./useAppFontEffects-B6OfEypo.js";import{f as ps,u as hs,b as ms,a as gs,c as fs,B as xs,C as ks,P as ht}from"./patchFileDiff-i1lTtNbn.js";import{h as vt,q as bs,u as me,dz as ws,dy as vs}from"./index-BD8ILbxF.js";import{u as L,W as ys}from"./main-DGYUWmIt.js";import{P as js}from"./PierreDiffViewer-B5l0djPS.js";import{e as Ss,d as Ns}from"./runtimeEndpointReset-BLzrtrmj.js";import"./vendor-scheduler-7OC5HNn7.js";import"./vendor-simplewebauthn-browser-VDA66rT_.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-zustand-BAGL70zf.js";import"./vendor-base-ui-BY_5qla_.js";import"./vendor-floating-ui-utils-D6FqdtJt.js";import"./vendor-floating-ui-react-dom-DxYCWdHj.js";import"./vendor-floating-ui-dom-BTvzWks8.js";import"./vendor-floating-ui-core-PuGzNPnN.js";import"./vendor-use-sync-external-store-D6wYuSt-.js";import"./vendor-class-variance-authority-5VPnzWs2.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-dnd-kit-core-BZknOX2w.js";import"./vendor-dnd-kit-utilities-B_MdXhJC.js";import"./vendor-dnd-kit-accessibility-BHxJPORy.js";import"./vendor-dnd-kit-sortable-CsEagZ81.js";import"./vendor-framer-motion-livSKyyV.js";import"./vendor-motion-dom-D_o3BTI3.js";import"./vendor-motion-utils-BGh8QBgx.js";import"./vendor-tanstack-react-virtual-g05Cx3z9.js";import"./vendor-tanstack-virtual-core-Dubg10g5.js";import"./contextPanelEmbeddedChat-BdA6bdky.js";import"./vendor-sonner-DFyL3AvE.js";import"./vendor-cmdk-DgLInKvT.js";import"./vendor-radix-ui-react-dialog-B94Bt2qq.js";import"./vendor-radix-ui-primitive-Dc_FVRD7.js";import"./vendor-radix-ui-react-compose-refs-DcAh5WdT.js";import"./vendor-radix-ui-react-context-Czxm7Z62.js";import"./vendor-radix-ui-react-id-f5BLKEVw.js";import"./vendor-radix-ui-react-use-layout-effect-D_3IhJdJ.js";import"./vendor-radix-ui-react-use-controllable-state-BFT5YmkA.js";import"./vendor-radix-ui-react-dismissable-layer-D7kXcwgJ.js";import"./vendor-radix-ui-react-primitive-DhVoX9SD.js";import"./vendor-radix-ui-react-slot-BQgQOasS.js";import"./vendor-radix-ui-react-use-callback-ref-BZPnuXAC.js";import"./vendor-radix-ui-react-use-escape-keydown-oph88g-F.js";import"./vendor-radix-ui-react-focus-scope-CiaxW4dD.js";import"./vendor-radix-ui-react-portal-BMJYHWck.js";import"./vendor-radix-ui-react-presence-CNxf-uq4.js";import"./vendor-radix-ui-react-focus-guards-B6qJXYua.js";import"./vendor-react-remove-scroll-DO7dCTnK.js";import"./vendor-tslib-De9GV7Vy.js";import"./vendor-react-remove-scroll-bar-BcFYyj3E.js";import"./vendor-react-style-singleton-q6EMHnwf.js";import"./vendor-get-nonce-C-Z93AgS.js";import"./vendor-use-sidecar-zDC0RhA3.js";import"./vendor-use-callback-ref-D3RC8gqK.js";import"./vendor-aria-hidden-DvXkyWUv.js";import"./vendor-codemirror-language-BgPj_McA.js";import"./vendor-lezer-common-B3-cUCR_.js";import"./vendor-codemirror-state-C9awkmn-.js";import"./vendor-marijn-find-cluster-break-DXwl3gUT.js";import"./vendor-codemirror-view-CiLROUVV.js";import"./vendor-style-mod-NZ5MEPvj.js";import"./vendor-w3c-keyname-Vcq4gwWv.js";import"./vendor-crelt-C8TCjufn.js";import"./vendor-lezer-highlight-CDMHUZ74.js";import"./vendor-codemirror-lang-javascript-Cc2ZYbgX.js";import"./vendor-lezer-javascript-D7Tj24ot.js";import"./vendor-lezer-lr-bhwg1HMg.js";import"./vendor-codemirror-autocomplete-DzPz9Wgq.js";import"./vendor-codemirror-lang-json-CMBS2tG9.js";import"./vendor-lezer-json-Iaex0UN-.js";import"./vendor-codemirror-lang-css-O0cZX78y.js";import"./vendor-lezer-css-C5xB6jxd.js";import"./vendor-codemirror-lang-html-CfgK872x.js";import"./vendor-lezer-html-C0I1p52t.js";import"./vendor-codemirror-lang-markdown-BPGOH9ye.js";import"./vendor-lezer-markdown-C6g-d6P3.js";import"./vendor-codemirror-language-data-SJuFp0a0.js";import"./vendor-codemirror-lang-python-HahnQaAS.js";import"./vendor-lezer-python-CvuFxeZl.js";import"./vendor-codemirror-commands-B7H_j0iU.js";import"./vendor-legendapp-list-BuBPBC3R.js";import"./vendor-zod-B6551dwG.js";import"./vendor-tailwind-merge-CPcsbTWB.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./VirtualizedFileDiff-Bzp3hClU.js";import"./web-components-D8GS8Ork.js";import"./computeVirtualFileMetrics-CI1PC_z2.js";import"./vendor-shiki-Bbf2GEcE.js";import"./vendor-shikijs-core-CGM_jqPK.js";import"./vendor-shikijs-types-CPSbSeK6.js";import"./vendor-shikijs-vscode-textmate-BgLrS_2D.js";import"./vendor-hast-util-to-html-BKBhbTDb.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-property-information-rJCbAzvX.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-comma-separated-tokens-D8TqSuIK.js";import"./vendor-space-separated-tokens-DD3iYX1K.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-shikijs-engine-oniguruma-DPWuIF1G.js";import"./themeResolver-BmJyTmjJ.js";import"./vendor-pierre-theming-C6Z4M5_u.js";import"./vendor-shikijs-engine-javascript-Cme4830A.js";import"./vendor-oniguruma-to-es-DLBnFDCE.js";import"./vendor-oniguruma-parser-C0D4_9rT.js";import"./vendor-regex-BBWcyTkg.js";import"./vendor-regex-utilities-2BQyy0xI.js";import"./vendor-regex-recursion-JU4mF-dD.js";import"./vendor-shikijs-transformers-CZWsLLKm.js";import"./isDiffPlainText-DVralkU-.js";import"./vendor-diff-C3JhlQdm.js";import"./vendor-opencode-sdk-BJ73u-bH.js";import"./useRootScrollLock-Me41OjBT.js";import"./scheduledTasksApi-BEuUF_cj.js";import"./vendor-cron-parser-CUcP7OfX.js";import"./vendor-luxon-BZ0puJYg.js";import"./Virtualizer-D_a8gKmg.js";import"./useInlineCommentController-CgbrpEWu.js";import"./appThemeRegistry-BK0dHKa6.js";import"./registerCustomTheme-BBXUCRnG.js";const Cs=n=>{if(!n?.walkthrough)return null;const t=new Map(n.hunks.map(a=>[a.id,a])),e=new Set,o=[],l=[];for(const[a,h]of n.walkthrough.chapters.entries()){const c=[];for(const g of h.stops){const m=[],p=[];for(const i of g.hunkIds){const v=t.get(i);v?(m.push(v),e.add(i)):p.push(i)}const f={stop:g,chapter:h,chapterIndex:a,position:o.length+1,hunks:m,missingHunkIds:p,isStale:p.length>0};o.push(f),c.push(f)}l.push({chapter:h,stops:c})}return{walkthrough:n.walkthrough,stops:o,chapters:l,uncoveredHunks:n.hunks.filter(a=>!e.has(a.id)),staleStopCount:o.filter(a=>a.isStale).length,isStale:o.some(a=>a.isStale)}},Rs=n=>{const t=new Map;for(const e of n){const o=t.get(e.path);if(o){o.added+=e.added,o.deleted+=e.deleted;continue}t.set(e.path,{path:e.path,added:e.added,deleted:e.deleted})}return[...t.values()]},yt=n=>{const t=[];for(const e of n){const o=t.at(-1);if(o&&o.path===e.path){o.hunks.push(e);continue}t.push({path:e.path,hunks:[e]})}return t},Ms=n=>{if(n.length===0)return"";if(n.length===1)return n[0].patch;const t=n[0].patch,e=t.indexOf(`
|
|
2
2
|
@@`);if(e===-1)return t;const o=t.slice(0,e),l=n.map(a=>{const h=a.patch.indexOf(`
|
|
3
3
|
@@`);return h===-1?"":a.patch.slice(h+1)});return`${o}
|
|
4
4
|
${l.join("")}`},Is=n=>n?`${n.providerID}/${n.modelID}`:"",Ts=({reason:n,model:t,requiredChars:e,availableChars:o,onRetry:l})=>{const{t:a}=ee(),h=ft(k=>k.modelsMetadata),[c,g]=u.useState(void 0),[m,p]=u.useState(!1),f=n==="context-too-small"||n==="structured-output-unsupported"||n==="output-exhausted";u.useEffect(()=>{if(!f||c!==void 0)return;let k=!1;return(async()=>{try{const x=await vt("/api/small-model",{method:"GET",headers:{Accept:"application/json"}});if(!x.ok)return;const M=await x.json().catch(()=>null);!k&&Array.isArray(M?.authenticatedProviders)&&g(M.authenticatedProviders.filter(I=>typeof I=="string"))}catch{}})(),()=>{k=!0}},[f,c]);const i=u.useCallback(async(k,x)=>{if(!k||!x||m)return;const M=`${k}/${x}`;p(!0);try{await bs({walkthroughModelOverride:M}),l()}catch(I){console.warn("Failed to save small model override:",I)}finally{p(!1)}},[l,m]),v=u.useCallback((k,x)=>h.get(`${k}/${x}`)?.structured_output!==!1,[h]),b=Is(t),w=()=>{if(n==="no-model")return a("walkthrough.blocked.noModel.description");if(n==="empty-diff")return a("walkthrough.blocked.emptyDiff.description");if(n==="only-generated")return a("walkthrough.blocked.onlyGenerated.description");if(n==="server-unsupported")return a("walkthrough.blocked.serverUnsupported.description");if(n==="output-exhausted")return b?a("walkthrough.blocked.outputExhausted.description",{model:b}):a("walkthrough.blocked.outputExhausted.descriptionUnknownModel");if(n==="structured-output-unsupported")return b?a("walkthrough.blocked.structuredOutput.description",{model:b}):a("walkthrough.blocked.structuredOutput.descriptionUnknownModel");const k=Math.ceil((e??0)/1e3),x=Math.ceil((o??0)/1e3);return b?a("walkthrough.blocked.contextTooSmall.description",{model:b,required:k,available:x}):a("walkthrough.blocked.contextTooSmall.descriptionUnknownModel",{required:k,available:x})},y=()=>a(n==="no-model"?"walkthrough.blocked.noModel.title":n==="empty-diff"?"walkthrough.blocked.emptyDiff.title":n==="only-generated"?"walkthrough.blocked.onlyGenerated.title":n==="server-unsupported"?"walkthrough.blocked.serverUnsupported.title":n==="output-exhausted"?"walkthrough.blocked.outputExhausted.title":n==="structured-output-unsupported"?"walkthrough.blocked.structuredOutput.title":"walkthrough.blocked.contextTooSmall.title");return s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:[s.jsx(j,{name:n==="empty-diff"||n==="only-generated"?"information":"error-warning",className:"size-6 text-muted-foreground"}),s.jsx("h3",{className:"typography-ui-label font-semibold text-foreground",children:y()}),s.jsx("p",{className:"typography-meta max-w-md text-muted-foreground",children:w()}),f&&s.jsxs("div",{className:"flex flex-col items-center gap-2 pt-2",children:[s.jsx("span",{className:"typography-micro text-muted-foreground",children:a("walkthrough.blocked.chooseModel")}),s.jsx(xt,{providerId:t?.providerID??"",modelId:t?.modelID??"",onChange:(k,x)=>{i(k,x)},allowedProviderIds:c??[],isModelAllowed:v})]}),(n==="empty-diff"||n==="only-generated"||n==="server-unsupported")&&s.jsx(B,{type:"button",variant:"outline",size:"sm",onClick:l,children:a("walkthrough.action.refresh")})]})},Ps=[{labelKey:"walkthrough.stage.collecting"},{labelKey:"walkthrough.stage.asking"},{labelKey:"walkthrough.stage.assembling"}],Es=n=>{const t=G.c(6),{progress:e}=n,{t:o}=ee(),{completedCount:l,activeIndex:a}=e;let h;t[0]!==a||t[1]!==l||t[2]!==o?(h=Ps.map((g,m)=>{const p=m<l,f=a===m;return s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:p?s.jsx(j,{name:"check",className:"size-3.5 text-status-success"}):f?s.jsx(j,{name:"loader-4",className:"size-3.5 animate-spin text-[var(--status-info)]"}):s.jsx("span",{className:"size-1.5 rounded-full bg-surface-muted"})}),s.jsx("span",{className:J("typography-meta",f?"text-foreground":p?"text-muted-foreground":"text-muted-foreground/60"),children:o(g.labelKey)})]},g.labelKey)}),t[0]=a,t[1]=l,t[2]=o,t[3]=h):h=t[3];let c;return t[4]!==h?(c=s.jsx("ul",{className:"flex flex-col gap-2 text-left",children:h}),t[4]=h,t[5]=c):c=t[5],c},ae=["collecting","asking","assembling"],Oe=450,As=n=>n==="retrying"?ae.indexOf("asking"):n?ae.indexOf(n):-1,zs=(n,t)=>Math.min(n+1,t),Os=(n,t)=>{const e=G.c(17),[o,l]=u.useState(-1),a=u.useRef(0);let h;e[0]!==t||e[1]!==o||e[2]!==n?(h=t?Math.max(As(n),0):o<0?-1:ae.length,e[0]=t,e[1]=o,e[2]=n,e[3]=h):h=e[3];const c=h;let g,m;e[4]!==t||e[5]!==o||e[6]!==c?(g=()=>{if(c<=o){c<o&&t&&(l(c),a.current=Date.now());return}const k=Date.now()-a.current,x=()=>{a.current=Date.now(),l(I=>zs(I,c))};if(o<0||k>=Oe){x();return}const M=setTimeout(x,Oe-k);return()=>clearTimeout(M)},m=[t,o,c],e[4]=t,e[5]=o,e[6]=c,e[7]=g,e[8]=m):(g=e[7],m=e[8]),u.useEffect(g,m);let p,f;e[9]!==t||e[10]!==o?(p=()=>{if(t||o<ae.length)return;const k=setTimeout(()=>l(-1),Oe);return()=>clearTimeout(k)},f=[t,o],e[9]=t,e[10]=o,e[11]=p,e[12]=f):(p=e[11],f=e[12]),u.useEffect(p,f);const i=o>=ae.length,v=Math.max(0,Math.min(o,ae.length)),b=i||o<0?null:o,w=!t&&o>=0;let y;return e[13]!==v||e[14]!==b||e[15]!==w?(y={completedCount:v,activeIndex:b,holding:w},e[13]=v,e[14]=b,e[15]=w,e[16]=y):y=e[16],y},jt=u.memo(function(t){const e=G.c(11),{path:o,hunks:l,renderSideBySide:a,wrapLines:h}=t;let c;if(e[0]!==l||e[1]!==o){const f=Ms(l);c=f?ps(o,f):void 0,e[0]=l,e[1]=o,e[2]=c}else c=e[2];const g=c;if(!g)return null;let m;e[3]!==o?(m=rs(o)||"",e[3]=o,e[4]=m):m=e[4];let p;return e[5]!==g||e[6]!==o||e[7]!==a||e[8]!==m||e[9]!==h?(p=s.jsx(js,{original:"",modified:"",fileDiff:g,language:m,fileName:o,renderSideBySide:a,wrapLines:h,layout:"inline"}),e[5]=g,e[6]=o,e[7]=a,e[8]=m,e[9]=h,e[10]=p):p=e[10],p}),He=n=>`walkthrough-stop-${n}`,Hs={critical:"border border-[var(--interactive-border)] font-medium text-foreground",normal:"bg-surface-muted text-muted-foreground",context:"bg-surface-muted text-muted-foreground"},Ls=n=>{const t=G.c(22),{stopView:e}=n,{t:o}=ee(),{stop:l}=e;let a;t[0]!==e.position?(a=s.jsx("span",{className:"typography-micro flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-surface-muted px-1.5 tabular-nums text-muted-foreground",children:e.position}),t[0]=e.position,t[1]=a):a=t[1];let h;t[2]!==l.title?(h=s.jsx("h3",{className:"typography-ui-label font-semibold text-foreground",children:l.title}),t[2]=l.title,t[3]=h):h=t[3];let c;t[4]!==l.importance||t[5]!==o?(c=l.importance!=="normal"&&s.jsxs(kt,{children:[s.jsx(bt,{className:J("typography-micro flex h-5 items-center rounded px-1.5 leading-none",Hs[l.importance]),children:l.importance==="critical"?o("walkthrough.importance.critical"):o("walkthrough.importance.context")}),s.jsx(wt,{className:"max-w-64",children:s.jsx("p",{className:"typography-micro leading-tight",children:l.importance==="critical"?o("walkthrough.importance.criticalHint"):o("walkthrough.importance.contextHint")})})]}),t[4]=l.importance,t[5]=o,t[6]=c):c=t[6];let g;t[7]!==a||t[8]!==h||t[9]!==c?(g=s.jsxs("div",{className:"flex items-center gap-2",children:[a,h,c]}),t[7]=a,t[8]=h,t[9]=c,t[10]=g):g=t[10];let m;t[11]!==l.prose?(m=s.jsx("p",{className:"typography-body text-muted-foreground",children:l.prose}),t[11]=l.prose,t[12]=m):m=t[12];let p;t[13]!==e.hunks||t[14]!==e.isStale||t[15]!==e.missingHunkIds||t[16]!==o?(p=e.isStale&&s.jsxs("p",{className:"typography-meta flex items-center gap-1.5 text-status-warning",children:[s.jsx(j,{name:"error-warning",className:"size-3.5 shrink-0"}),e.hunks.length===0?o("walkthrough.stop.staleAll"):o("walkthrough.stop.stalePartial",{count:e.missingHunkIds.length})]}),t[13]=e.hunks,t[14]=e.isStale,t[15]=e.missingHunkIds,t[16]=o,t[17]=p):p=t[17];let f;return t[18]!==g||t[19]!==m||t[20]!==p?(f=s.jsxs("header",{className:"flex flex-col gap-2 px-4 pt-5 pb-3",children:[g,m,p]}),t[18]=g,t[19]=m,t[20]=p,t[21]=f):f=t[21],f},St=n=>{const t=G.c(2),{path:e}=n;let o;return t[0]!==e?(o=s.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-1.5 border-b border-[var(--interactive-border)]/35 bg-[var(--surface-elevated)]/90 px-4 py-1.5 backdrop-blur-md supports-[backdrop-filter]:bg-[var(--surface-elevated)]/80",children:[s.jsx(ns,{filePath:e,className:"size-3.5 shrink-0"}),s.jsx("span",{className:"typography-meta truncate font-mono text-foreground",children:e})]}),t[0]=e,t[1]=o):o=t[1],o},Ds=n=>{const t=G.c(11),{hunks:e,renderSideBySide:o,wrapLines:l}=n;let a;t[0]!==e?(a=yt(e),t[0]=e,t[1]=a):a=t[1];const h=a;let c;if(t[2]!==o||t[3]!==h||t[4]!==l){let m;t[6]!==o||t[7]!==l?(m=(p,f)=>s.jsxs("div",{children:[s.jsx(St,{path:p.path}),s.jsx(jt,{path:p.path,hunks:p.hunks,renderSideBySide:o,wrapLines:l})]},`${p.path}-${f}`),t[6]=o,t[7]=l,t[8]=m):m=t[8],c=h.map(m),t[2]=o,t[3]=h,t[4]=l,t[5]=c}else c=t[5];let g;return t[9]!==c?(g=s.jsx(s.Fragment,{children:c}),t[9]=c,t[10]=g):g=t[10],g},Bs=u.memo(function(t){const e=G.c(35),{view:o,activeStopId:l,scrollToStopId:a,onActiveStopChange:h,onScrollHandled:c,renderSideBySide:g,wrapLines:m}=t,{t:p}=ee(),f=u.useRef(null),[i,v]=u.useState(!1),b=u.useRef(null),w=u.useRef(null);let y,k;e[0]===Symbol.for("react.memo_cache_sentinel")?(y=()=>()=>{w.current!==null&&window.clearTimeout(w.current)},k=[],e[0]=y,e[1]=k):(y=e[0],k=e[1]),u.useEffect(y,k);let x,M;e[2]!==c||e[3]!==a?(x=()=>{if(!a)return;const R=document.getElementById(He(a));R&&(b.current=a,R.scrollIntoView({behavior:"auto",block:"start"}),w.current!==null&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{b.current=null,w.current=null},250)),c()},M=[a,c],e[2]=c,e[3]=a,e[4]=x,e[5]=M):(x=e[4],M=e[5]),u.useEffect(x,M);let I;e[6]!==h?(I=R=>{const T=R.filter(Ws).sort($s)[0];if(!T)return;const q=T.target.getAttribute("data-stop-id");if(!q)return;const X=b.current;if(X){q===X&&(b.current=null);return}h(q)},e[6]=h,e[7]=I):I=e[7];const te=I;let W,se;e[8]!==te||e[9]!==o.stops?(W=()=>{const R=f.current;if(!R)return;const T=new IntersectionObserver(te,{root:R,rootMargin:"0px 0px -70% 0px",threshold:0});for(const q of o.stops){const X=document.getElementById(He(q.stop.id));X&&T.observe(X)}return()=>T.disconnect()},se=[te,o.stops],e[8]=te,e[9]=o.stops,e[10]=W,e[11]=se):(W=e[10],se=e[11]),u.useEffect(W,se);let O;e[12]!==o.uncoveredHunks?(O=yt(o.uncoveredHunks),e[12]=o.uncoveredHunks,e[13]=O):O=e[13];const z=O;let H;if(e[14]!==l||e[15]!==g||e[16]!==p||e[17]!==o.stops||e[18]!==m){let R;e[20]!==l||e[21]!==g||e[22]!==p||e[23]!==m?(R=T=>s.jsxs("section",{id:He(T.stop.id),"data-stop-id":T.stop.id,className:J("border-b border-border/60",l===T.stop.id&&"bg-interactive-selection/5"),children:[s.jsx(Ls,{stopView:T}),T.hunks.length>0?s.jsx(Ds,{hunks:T.hunks,renderSideBySide:g,wrapLines:m}):s.jsx("p",{className:"typography-meta px-4 pb-4 text-muted-foreground",children:p("walkthrough.stop.noCode")})]},T.stop.id),e[20]=l,e[21]=g,e[22]=p,e[23]=m,e[24]=R):R=e[24],H=o.stops.map(R),e[14]=l,e[15]=g,e[16]=p,e[17]=o.stops,e[18]=m,e[19]=H}else H=e[19];let $;e[25]!==g||e[26]!==p||e[27]!==i||e[28]!==z||e[29]!==o.uncoveredHunks.length||e[30]!==m?($=o.uncoveredHunks.length>0&&s.jsxs("section",{className:"border-b border-border/60",children:[s.jsxs(B,{type:"button",variant:"ghost",className:"h-auto w-full justify-start gap-2 px-4 py-3",onClick:()=>v(Gs),"aria-expanded":i,children:[s.jsx(j,{name:i?"arrow-down-s":"arrow-right-s",className:"size-4 shrink-0"}),s.jsx("span",{className:"typography-ui-label text-muted-foreground",children:p("walkthrough.uncovered.title",{count:o.uncoveredHunks.length})})]}),!i&&s.jsx("p",{className:"typography-meta px-4 pb-3 pl-10 text-muted-foreground",children:p("walkthrough.uncovered.description")}),i&&z.map((R,T)=>s.jsxs("div",{children:[s.jsx(St,{path:R.path}),s.jsx(jt,{path:R.path,hunks:R.hunks,renderSideBySide:g,wrapLines:m})]},`${R.path}-${T}`))]}),e[25]=g,e[26]=p,e[27]=i,e[28]=z,e[29]=o.uncoveredHunks.length,e[30]=m,e[31]=$):$=e[31];let oe;return e[32]!==$||e[33]!==H?(oe=s.jsxs("div",{ref:f,className:"min-h-0 flex-1 overflow-y-auto","data-diff-virtual-root":!0,"data-diff-virtual-content":!0,children:[H,$]}),e[32]=$,e[33]=H,e[34]=oe):oe=e[34],oe});function Ws(n){return n.isIntersecting}function $s(n,t){return n.boundingClientRect.top-t.boundingClientRect.top}function Gs(n){return!n}const qs={bug:"bug",wrench:"tools",path:"compass-3",flask:"flask",doc:"file-text",gear:"settings-3"},Fs=n=>{const t=G.c(30),{stopView:e,isActive:o,isVisited:l,onSelect:a,activeRef:h}=n,{t:c}=ee();let g;if(t[0]!==h||t[1]!==o||t[2]!==l||t[3]!==a||t[4]!==e.hunks||t[5]!==e.isStale||t[6]!==e.position||t[7]!==e.stop.title||t[8]!==c){const m=Rs(e.hunks),p=o&&"bg-interactive-selection text-interactive-selection-foreground";let f;t[10]!==p?(f=J("flex w-full flex-col gap-1 rounded px-2 py-1.5 text-left transition-colors","hover:bg-interactive-hover",p),t[10]=p,t[11]=f):f=t[11];const i=o?"bg-interactive-selection-foreground/20":l?"bg-status-success/15 text-status-success":"bg-surface-muted text-muted-foreground";let v;t[12]!==i?(v=J("typography-micro flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1 tabular-nums",i),t[12]=i,t[13]=v):v=t[13];let b;t[14]!==o||t[15]!==l||t[16]!==e.position?(b=l&&!o?s.jsx(j,{name:"check",className:"size-2.5"}):e.position,t[14]=o,t[15]=l,t[16]=e.position,t[17]=b):b=t[17];let w;t[18]!==v||t[19]!==b?(w=s.jsx("span",{className:v,children:b}),t[18]=v,t[19]=b,t[20]=w):w=t[20];let y;t[21]!==e.stop.title?(y=s.jsx("span",{className:"typography-meta truncate font-medium",children:e.stop.title}),t[21]=e.stop.title,t[22]=y):y=t[22];let k;t[23]!==e.isStale||t[24]!==c?(k=e.isStale&&s.jsx(j,{name:"error-warning",className:"size-3 shrink-0 text-status-warning","aria-label":c("walkthrough.stop.staleShort")}),t[23]=e.isStale,t[24]=c,t[25]=k):k=t[25];let x;t[26]!==w||t[27]!==y||t[28]!==k?(x=s.jsxs("span",{className:"flex items-center gap-2",children:[w,y,k]}),t[26]=w,t[27]=y,t[28]=k,t[29]=x):x=t[29],g=s.jsx("li",{children:s.jsxs("button",{ref:o?h:void 0,type:"button",onClick:a,"aria-current":o?"step":void 0,className:f,children:[x,m.length>0&&s.jsxs("span",{className:"typography-micro flex flex-col gap-0.5 pl-6 text-muted-foreground",children:[m.slice(0,3).map(_s),m.length>3&&s.jsx("span",{children:c("walkthrough.toc.moreFiles",{count:m.length-3})})]})]})}),t[0]=h,t[1]=o,t[2]=l,t[3]=a,t[4]=e.hunks,t[5]=e.isStale,t[6]=e.position,t[7]=e.stop.title,t[8]=c,t[9]=g}else g=t[9];return g},Us=u.memo(function(t){const e=G.c(20),{view:o,activeStopId:l,visitedStopIds:a,onSelectStop:h,width:c}=t,{t:g}=ee(),m=u.useRef(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{m.current?.scrollIntoView({block:"nearest"})},e[0]=p):p=e[0];let f;e[1]!==l?(f=[l],e[1]=l,e[2]=f):f=e[2],u.useEffect(p,f);let i;e[3]!==c?(i={width:c},e[3]=c,e[4]=i):i=e[4];let v;e[5]!==o.walkthrough.focus?(v=o.walkthrough.focus&&s.jsx("p",{className:"typography-meta px-2 pb-3 pt-1 text-muted-foreground",children:o.walkthrough.focus}),e[5]=o.walkthrough.focus,e[6]=v):v=e[6];let b;e[7]!==l||e[8]!==h||e[9]!==o.chapters||e[10]!==a?(b=o.chapters.map(k=>{const{chapter:x,stops:M}=k;return s.jsxs("section",{className:"pb-3",children:[s.jsxs("h4",{className:"typography-micro flex items-center gap-1.5 px-2 py-1 font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(j,{name:qs[x.icon]??"file-text",className:"size-3 shrink-0"}),s.jsx("span",{className:"truncate",children:x.title})]}),s.jsx("ul",{className:"flex flex-col gap-0.5",children:M.map(I=>s.jsx(Fs,{stopView:I,isActive:l===I.stop.id,isVisited:a.has(I.stop.id),onSelect:()=>h(I.stop.id),activeRef:m},I.stop.id))})]},x.id)}),e[7]=l,e[8]=h,e[9]=o.chapters,e[10]=a,e[11]=b):b=e[11];let w;e[12]!==g||e[13]!==o.uncoveredHunks.length?(w=o.uncoveredHunks.length>0&&s.jsx("p",{className:"typography-micro mt-auto px-2 pt-3 text-muted-foreground",children:g("walkthrough.toc.uncovered",{count:o.uncoveredHunks.length})}),e[12]=g,e[13]=o.uncoveredHunks.length,e[14]=w):w=e[14];let y;return e[15]!==i||e[16]!==v||e[17]!==b||e[18]!==w?(y=s.jsxs("nav",{className:"flex shrink-0 flex-col overflow-y-auto border-r border-border/60 p-2",style:i,children:[v,b,w]}),e[15]=i,e[16]=v,e[17]=b,e[18]=w,e[19]=y):y=e[19],y});function _s(n){return s.jsx("span",{className:"truncate font-mono",children:n.path},n.path)}const Ks=["all","staged","working"],Vs="https://docs.aiworker.dev/walkthrough/",mt="typography-meta font-normal text-muted-foreground",gt=720,ne=180,Le=.5,Js=680,mn=({directory:n,visible:t=!0})=>{const{t:e,locale:o,locales:l,label:a}=ee(),h=u.useRef(null),[c,g]=u.useState(0),{rootIsGitRepo:m,gitDirectory:p,nestedRepos:f}=as(n||null,{enabled:t}),i=p??n;u.useEffect(()=>{const r=h.current;if(!r||typeof ResizeObserver>"u")return;const N=new ResizeObserver(A=>{g(A[0]?.contentRect.width??0)});return N.observe(r),()=>N.disconnect()},[]);const v=me(r=>r.walkthroughTocWidth),b=me(r=>r.setWalkthroughTocWidth),[w,y]=u.useState(!1),k=c===0||c>=gt,x=c>0&&c<Js,M=Math.min(Math.max(v,ne),Math.max(ne,(c||gt)*Le)),I=u.useCallback(r=>{r.preventDefault();const N=r.clientX,A=M,Z=Math.max(ne,(h.current?.clientWidth??0)*Le);y(!0);const at=ss=>{const os=Math.min(Z,Math.max(ne,A+ss.clientX-N));b(os)},be=()=>{y(!1),window.removeEventListener("pointermove",at),window.removeEventListener("pointerup",be),window.removeEventListener("pointercancel",be)};window.addEventListener("pointermove",at),window.addEventListener("pointerup",be),window.addEventListener("pointercancel",be)},[b,M]),te=u.useCallback(r=>{const N=r.shiftKey?40:10,A=r.key==="ArrowLeft"?-N:r.key==="ArrowRight"?N:0;if(A===0)return;r.preventDefault();const Z=Math.max(ne,(h.current?.clientWidth??0)*Le);b(Math.min(Z,Math.max(ne,M+A)))},[b,M]),[W,se]=u.useState("all"),[O,z]=u.useState(null),[H,$]=u.useState(null),[oe,R]=u.useState(null),[T,q]=u.useState(()=>new Set),X=me(r=>r.diffLayoutPreference),Nt=me(r=>r.diffWrapLines),Ct=X==="side-by-side",P=L(r=>r.requestedSource[i]),ie=L(r=>r.clearRequestedSource),Rt=me(r=>r.openContextPanelTab),Mt=is(i||null),ge=we(r=>r.runtimeKey),[It,Tt]=u.useState(0);u.useEffect(()=>ws(r=>{r===vs(i,ge)&&Tt(N=>N+1)}),[i,ge]);const Pt=ls(i||null),Et=hs(r=>r.setOverride),De=we(r=>r.ensureAll),{git:Be}=cs();u.useEffect(()=>{t&&i&&De(i,Be)},[i,De,Be,t]);const E=Mt?.current??null,fe=O?.directory===i&&O.kind==="commit"&&!P,Y=fe||P?.kind==="commit",F=ms(i||null,E,t&&Y,P?.kind==="commit"?P.hash:void 0),U=F.selectedCommit?.hash??(P?.kind==="commit"?P.hash:null),{base:le,resolved:At,revision:zt}=gs(i||null,E,t),_=u.useMemo(()=>!E||!le||le===E?null:{kind:"branch",baseRef:le,headRef:E},[le,E]),ve=O?.directory===i&&O.kind==="pr"&&!P,K=ve||P?.kind==="pr",re=fs(i||null,E,t&&K,P?.kind==="pr"?P:void 0),V=re.selectedSource,C=u.useMemo(()=>K&&V?V:Y&&U?{kind:"commit",hash:U}:P?.kind==="branch"?_??P:P??{kind:"working-tree",scope:W},[_,Y,K,P,W,U,V]),xe=O?.directory===i&&O.kind==="branch"&&!P,ye=xe||C.kind==="branch",We=xe||C.kind==="branch"&&!_,$e=fe||Y&&!U,Ge=K&&!V,ce=We||$e||Ge,Ot=u.useCallback(r=>{z(null),ie(i),se(r)},[ie,i]),d=L(r=>r.getEntry(i,C)),je=L(r=>r.load),qe=L(r=>r.generate),Ht=L(r=>r.cancel),Q=L(r=>r.requestSource);u.useEffect(()=>{!ve||!V||(Q(i,V),z(null))},[ve,i,Q,V]),u.useEffect(()=>{!xe||!_||(Q(i,_),z(null))},[_,xe,i,Q]),u.useEffect(()=>{!fe||!U||(Q(i,{kind:"commit",hash:U}),z(null))},[fe,i,Q,U]);const Lt=L(r=>r.selectModel),ue=L(r=>r.getSelectedModel(i,C)),Dt=L(r=>r.selectLanguage),Se=L(r=>r.getSelectedLanguage(i,C)),Ne=d.result?.language,D=Se&&l.includes(Se)?Se:Ne&&l.includes(Ne)?Ne:o,Bt=C.kind==="branch"?zt:"",Fe=C.kind==="pr"?It:0,Ue=u.useRef(null);u.useEffect(()=>{if(!(!t||ce)){if(C.kind==="pr"){const r=JSON.stringify([ge,i,C,D,ue,Fe]);if(Ue.current===r)return;Ue.current=r}je(i,C,{language:D})}},[D,ce,i,je,C,ue,Bt,t,ge,Fe]);const S=u.useMemo(()=>ce?null:Cs(d.result),[ce,d.result]),Ce=d.result?.generatedAt,_e=u.useRef(void 0);u.useEffect(()=>{_e.current!==Ce&&(_e.current=Ce,q(new Set),$(S?.stops[0]?.stop.id??null))},[Ce,S]);const Re=u.useCallback(r=>{$(r),q(N=>{if(N.has(r))return N;const A=new Set(N);return A.add(r),A})},[]),Me=u.useCallback(r=>{Re(r),R(r)},[Re]),Ke=u.useCallback(r=>{if(!S||S.stops.length===0)return;const N=S.stops.findIndex(Z=>Z.stop.id===H),A=Math.min(S.stops.length-1,Math.max(0,(N<0?0:N)+r));Me(S.stops[A].stop.id)},[H,Me,S]),[Wt,Ve]=u.useState(!1),[$t,Je]=u.useState(!1),Gt=K?"pr":Y?"commit":ye?"branch":C.kind==="working-tree"?C.scope:C.kind,qt=K?e("session.githubIntegration.tabs.pullRequests"):Y?e("commitComparison.mode"):ye?e("walkthrough.scope.branch"):C.kind==="pr"?e("walkthrough.scope.pullRequest",{number:C.number}):e(W==="all"?"walkthrough.scope.all":W==="staged"?"walkthrough.scope.staged":"walkthrough.scope.working"),Xe=ft(r=>r.modelsMetadata),[de,Ft]=u.useState(void 0),Ie=r=>!r||de===void 0?!1:de.includes(r),Ut=d.readiness?.model&&d.readiness.model.hasLogin!==!1&&Ie(d.readiness.model.providerID)?`${d.readiness.model.providerID}/${d.readiness.model.modelID}`:void 0,_t=d.result?.model&&Ie(d.result.model.providerID)?`${d.result.model.providerID}/${d.result.model.modelID}`:void 0,ke=(ue&&Ie(ue.split("/")[0])?ue:void 0)??_t??Ut,[Kt,...Vt]=(ke??"").split("/"),Ye=Vt.join("/");u.useEffect(()=>{if(de!==void 0)return;let r=!1;return(async()=>{try{const N=await vt("/api/small-model",{method:"GET",headers:{Accept:"application/json"}});if(!N.ok)return;const A=await N.json().catch(()=>null);!r&&Array.isArray(A?.authenticatedProviders)&&Ft(A.authenticatedProviders.filter(Z=>typeof Z=="string"))}catch{}})(),()=>{r=!0}},[de]);const Jt=u.useCallback((r,N)=>Xe.get(`${r}/${N}`)?.structured_output!==!1,[Xe]),Qe=d.status==="generating",Ze=d.result?.model?`${d.result.model.providerID}/${d.result.model.modelID}`:void 0,Te=d.result?.language,Pe=Te&&l.includes(Te)?Te:void 0,et=d.status==="ready"&&!!S,Ee=et&&!!Pe&&Pe!==D,tt=et&&!!Ze&&!!ke&&Ze!==ke,st=Os(d.stage,d.status==="generating"),ot=u.useRef(!1),rt=u.useRef(d.status);u.useEffect(()=>{rt.current!=="generating"&&d.status==="generating"&&(ot.current=!S),rt.current=d.status},[d.status,S]);const Xt=ot.current&&(d.status==="generating"||st.holding),Ae=d.error?.code==="context-too-small"||d.error?.code==="structured-output-unsupported"||d.error?.code==="no-model"||d.error?.code==="empty-diff"||d.error?.code==="only-generated"||d.error?.code==="output-exhausted"||d.error?.code==="server-unsupported"?d.error.code:d.readiness&&!d.readiness.ready&&!S&&d.readiness.reason!=="no-provider-login"?d.readiness.reason:void 0,Yt=d.error?.model??d.readiness?.model,Qt=d.error?.requiredChars??d.readiness?.requiredChars,Zt=d.error?.availableChars??d.readiness?.availableChars,pe=ce||!ke||!!(d.readiness&&!d.readiness.ready),ze=u.useCallback(r=>{pe||qe(i,C,{force:r,language:D})},[D,i,qe,pe,C]),nt=us(p||null),es=we(r=>r.ensureNestedRepos),ts=we(r=>r.selectNestedRepo);return m===!1&&nt!==!0?s.jsx(Ss,{rootIsGitRepo:m,resolvedIsGitRepo:nt,nestedRepos:f,onRetryDiscovery:()=>{n&&es(n,{force:!0})}}):s.jsxs("div",{ref:h,className:"flex h-full min-h-0 flex-col",children:[s.jsxs("header",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-border/60 px-3 py-2",children:[m===!1&&Array.isArray(f)&&f.length>0?s.jsx(Ns,{repositories:f,selectedRepository:p??null,onSelectRepository:r=>{n&&ts(n,r)},repositoryRoot:n??void 0}):null,s.jsxs(it,{open:Wt,onOpenChange:Ve,children:[s.jsx(lt,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex h-8 flex-shrink-0 items-center gap-1.5 rounded-md px-2 typography-ui-label font-semibold text-foreground outline-none hover:bg-interactive-hover focus-visible:ring-2 focus-visible:ring-ring","aria-label":e("walkthrough.scope.selectorAria"),children:[s.jsx("span",{className:"whitespace-nowrap",children:qt}),s.jsx(j,{name:"arrow-down-s",className:"size-4 flex-shrink-0 opacity-60"})]})}),s.jsx(ct,{align:"start",className:"w-48",children:s.jsxs(ut,{value:Gt,onValueChange:r=>{if(Ve(!1),r==="commit"){ie(i),z({directory:i,kind:"commit"});return}if(r==="branch"){_?(z(null),Q(i,_)):(ie(i),z({directory:i,kind:"branch"}));return}if(r==="pr"){ie(i),z({directory:i,kind:"pr"});return}Ot(r)},children:[s.jsx(dt,{className:mt,children:e("walkthrough.scope.group.workingTree")}),Ks.map(r=>s.jsx(he,{value:r,children:e(r==="all"?"walkthrough.scope.all":r==="staged"?"walkthrough.scope.staged":"walkthrough.scope.working")},r)),E&&s.jsxs(s.Fragment,{children:[s.jsx(pt,{}),s.jsx(he,{value:"branch",children:e("walkthrough.scope.branch")})]}),s.jsx(pt,{}),s.jsx(he,{value:"commit",children:e("commitComparison.mode")}),s.jsx(he,{value:"pr",children:e("session.githubIntegration.tabs.pullRequests")})]})})]}),ye&&s.jsx(xs,{branches:Pt?.all??[],currentBranch:E,base:le,onSelect:r=>{i&&E&&Et(i,E,r)}},JSON.stringify([i,E])),Y&&s.jsx(ks,{commits:F.commits,selectedHash:U,loading:F.loading,error:F.error,onSelect:F.select,onRefresh:()=>{F.refresh()}},JSON.stringify([i,E])),K&&s.jsx(ht,{comparison:re},JSON.stringify([i,E])),s.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-1",children:[K&&V&&s.jsxs(B,{variant:"ghost",size:"sm","aria-label":e("contextPanel.mode.diff"),title:e("contextPanel.mode.diff"),onClick:()=>Rt(n,{mode:"diff",diffScope:"pr"}),children:[s.jsx(j,{name:"arrow-left-right",className:"size-4"}),!x&&e("contextPanel.mode.diff")]}),s.jsxs(kt,{children:[s.jsx(bt,{asChild:!0,children:s.jsx(B,{type:"button",variant:"ghost",size:"sm","aria-label":e("walkthrough.help.guide"),onClick:()=>{ds(Vs)},children:s.jsx(j,{name:"question",className:"size-4"})})}),s.jsx(wt,{children:s.jsx("p",{className:"typography-micro leading-tight",children:e("walkthrough.help.guide")})})]}),s.jsxs(it,{open:$t,onOpenChange:Je,children:[s.jsx(lt,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex h-8 min-w-0 flex-shrink items-center gap-1.5 rounded-md px-2 typography-ui-label text-muted-foreground outline-none hover:bg-interactive-hover hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring","aria-label":e("walkthrough.language.selectorAria"),title:x?a(D):void 0,children:[s.jsx(j,{name:"global",className:"size-4 flex-shrink-0 opacity-70"}),!x&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate",children:a(D)}),s.jsx(j,{name:"arrow-down-s",className:"size-4 flex-shrink-0 opacity-60"})]})]})}),s.jsxs(ct,{align:"end",className:"w-48",children:[s.jsx(dt,{className:mt,children:e("walkthrough.language.menuLabel")}),s.jsx(ut,{value:D,onValueChange:r=>{Je(!1),Dt(i,C,r)},children:l.map(r=>s.jsx(he,{value:r,children:a(r)},r))})]})]}),s.jsx(xt,{providerId:Kt??"",modelId:Ye,onChange:(r,N)=>{Lt(i,C,r&&N?`${r}/${N}`:null)},allowedProviderIds:de??[],isModelAllowed:Jt,tooltipsEnabled:!1,dropdownPortalToBody:!0,compact:x,className:J("h-8 min-w-0",!x&&"max-w-48")}),S&&s.jsxs(s.Fragment,{children:[s.jsx(B,{type:"button",variant:"ghost",size:"sm","aria-label":e("walkthrough.action.previous"),onClick:()=>Ke(-1),children:s.jsx(j,{name:"arrow-right-s",className:"size-4 rotate-180"})}),s.jsx(B,{type:"button",variant:"ghost",size:"sm","aria-label":e("walkthrough.action.next"),onClick:()=>Ke(1),children:s.jsx(j,{name:"arrow-right-s",className:"size-4"})})]}),Qe?s.jsx(B,{type:"button",variant:"outline",size:"sm","aria-label":x?e("walkthrough.action.cancel"):void 0,title:x?e("walkthrough.action.cancel"):void 0,onClick:()=>Ht(i,C),children:x?s.jsx(j,{name:"stop",className:"size-3.5"}):e("walkthrough.action.cancel")}):s.jsxs(B,{type:"button",variant:"outline",size:"sm",className:pe?"border-border text-muted-foreground":ys,disabled:pe,"aria-label":x?e(S?"walkthrough.action.regenerate":"walkthrough.action.generate"):void 0,title:x?e(S?"walkthrough.action.regenerate":"walkthrough.action.generate"):void 0,onClick:()=>ze(!!S),children:[s.jsx(j,{name:S?"refresh":"route",className:"size-3.5"}),!x&&e(S?"walkthrough.action.regenerate":"walkthrough.action.generate")]})]})]}),d.status==="generating"&&S&&s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 bg-[var(--status-info-background)] px-3 py-2",children:[s.jsx(j,{name:"loader-4",className:"size-4 shrink-0 animate-spin text-[var(--status-info)]"}),s.jsx("span",{className:"typography-meta text-foreground",children:d.stage==="collecting"?e("walkthrough.stage.collecting"):d.stage==="assembling"?e("walkthrough.stage.assembling"):e("walkthrough.stage.asking")})]}),(Ee||tt)&&s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 bg-[var(--status-info-background)] px-3 py-2",children:[s.jsx(j,{name:"information",className:"size-4 shrink-0 text-[var(--status-info)]"}),s.jsx("span",{className:"typography-meta text-foreground",children:Ee&&tt?e("walkthrough.missing.languageAndModel"):Ee?e("walkthrough.missing.language",{requested:a(D),shown:a(Pe)}):e("walkthrough.missing.model",{model:Ye})}),s.jsx(B,{type:"button",variant:"ghost",size:"xs",className:"ml-auto",disabled:pe,onClick:()=>ze(!1),children:e("walkthrough.action.generate")})]}),S?.isStale&&d.status!=="generating"&&s.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 bg-status-warning/10 px-3 py-2",children:[s.jsx(j,{name:"error-warning",className:"size-4 shrink-0 text-status-warning"}),s.jsx("span",{className:"typography-meta text-foreground",children:e("walkthrough.stale.banner",{count:S.staleStopCount})}),s.jsx(B,{type:"button",variant:"ghost",size:"xs",className:"ml-auto",disabled:Qe,onClick:()=>ze(!0),children:e("walkthrough.action.regenerate")})]}),d.error&&!Ae&&d.error.code!=="no-provider-login"&&s.jsxs("div",{className:"flex shrink-0 items-start gap-2 border-b border-border/60 bg-status-error/10 px-3 py-2",children:[s.jsx(j,{name:"error-warning",className:"mt-0.5 size-4 shrink-0 text-status-error"}),s.jsx("span",{className:"typography-meta line-clamp-2 text-foreground",title:d.error.message,children:d.error.message})]}),s.jsx("div",{className:J("flex min-h-0 flex-1",k?"flex-row":"flex-col"),children:Ge?s.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:[s.jsx("p",{className:"typography-meta text-muted-foreground",children:re.error??(re.loading?e("session.githubPrPicker.loading.pullRequests"):e("pullRequestComparison.select"))}),!re.loading&&s.jsx(ht,{comparison:re})]}):$e?s.jsx("div",{className:"flex flex-1 items-center justify-center gap-2 p-8 typography-meta text-muted-foreground",children:F.loading?s.jsx(j,{name:"loader-4",className:"size-6 animate-spin"}):F.error??e("commitComparison.noCommits")}):We?s.jsx("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:!At&&E?s.jsx(j,{name:"loader-4",className:"size-6 animate-spin text-muted-foreground"}):s.jsx("p",{className:"typography-meta text-muted-foreground",children:e("gitView.pr.toast.baseBranchRequired")})}):Ae?s.jsx(Ts,{reason:Ae,model:Yt,requiredChars:Qt,availableChars:Zt,onRetry:()=>{je(i,C)}}):Xt?s.jsx("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8",children:s.jsx(Es,{progress:st})}):S?s.jsxs(s.Fragment,{children:[k&&s.jsxs(s.Fragment,{children:[s.jsx(Us,{view:S,activeStopId:H,visitedStopIds:T,onSelectStop:Me,width:M}),s.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":e("walkthrough.toc.resize"),tabIndex:0,onPointerDown:I,onKeyDown:te,className:J("group relative w-1 shrink-0 cursor-col-resize","before:absolute before:inset-y-0 before:-left-1 before:-right-1 before:content-['']","hover:bg-interactive-selection focus-visible:bg-interactive-selection focus-visible:outline-none",w&&"bg-interactive-selection")})]}),s.jsx(Bs,{view:S,activeStopId:H,scrollToStopId:oe,onActiveStopChange:Re,onScrollHandled:()=>R(null),renderSideBySide:Ct,wrapLines:Nt})]}):s.jsx("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-8 text-center",children:d.status==="loading"?s.jsx(j,{name:"loader-4",className:"size-6 animate-spin text-muted-foreground"}):s.jsxs(s.Fragment,{children:[s.jsx(j,{name:"route",className:"size-6 text-muted-foreground"}),s.jsx("h3",{className:"typography-ui-label font-semibold text-foreground",children:e("walkthrough.empty.title")}),s.jsx("p",{className:"typography-meta max-w-md text-muted-foreground",children:e("walkthrough.empty.description")})]})})})]})};export{mn as WalkthroughView};
|
package/dist/assets/{computeVirtualFileMetrics-BkiDSlTW.js → computeVirtualFileMetrics-CI1PC_z2.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-shiki-Bbf2GEcE.js","assets/vendor-vite-runtime-DD1OZmLC.js","assets/vendor-shikijs-core-CGM_jqPK.js","assets/vendor-shikijs-types-CPSbSeK6.js","assets/vendor-shikijs-vscode-textmate-BgLrS_2D.js","assets/vendor-hast-util-to-html-BKBhbTDb.js","assets/vendor-html-void-elements-CkdplsNl.js","assets/vendor-property-information-rJCbAzvX.js","assets/vendor-zwitch-C2o2j-tx.js","assets/vendor-stringify-entities-CsH1VEn9.js","assets/vendor-character-entities-legacy-BpoLgcEt.js","assets/vendor-character-entities-html4-D7taRCQ7.js","assets/vendor-ccount-c2V3InAJ.js","assets/vendor-comma-separated-tokens-D8TqSuIK.js","assets/vendor-space-separated-tokens-DD3iYX1K.js","assets/vendor-hast-util-whitespace-D4Wp6AEg.js","assets/vendor-shikijs-engine-oniguruma-DPWuIF1G.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as I}from"./vendor-vite-runtime-DD1OZmLC.js";import{b as j,c as O}from"./vendor-shiki-Bbf2GEcE.js";import{t as f}from"./themeResolver-BmJyTmjJ.js";import{s as M,p as F,n as v}from"./vendor-pierre-theming-C6Z4M5_u.js";import{c as N}from"./vendor-shikijs-engine-oniguruma-DPWuIF1G.js";import{c as z}from"./vendor-shikijs-engine-javascript-Cme4830A.js";import{fL as L,hG as G}from"./useAppFontEffects-Cwyhjfl5.js";import{t as H}from"./vendor-shikijs-transformers-CZWsLLKm.js";function pe(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ue(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function S(e){return{type:"text",value:e}}function m({tagName:e,children:t=[],properties:r={}}){return{type:"element",tagName:e,properties:r,children:t}}function fe({name:e,width:t=16,height:r=16,properties:n}){return m({tagName:"svg",properties:{width:t,height:r,viewBox:"0 0 16 16",...n},children:[m({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function V(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function de(e){return m({tagName:"div",properties:{"data-gutter":""},children:e})}function me(e,t,r,n={}){return m({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":r,...n},children:t!=null?[m({tagName:"span",properties:{"data-line-number-content":""},children:[S(`${t}`)]})]:void 0})}function he(e,t,r){return m({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":r,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${r};`:`grid-row: span ${r};min-height:calc(${r} * 1lh);`}})}const g=new Map,k=new Map,A=new Map,T=new Set;function E(e,t){e=Array.isArray(e)?e:[e];for(const r of e){if(T.has(r.name))continue;let n=g.get(r.name);n==null&&(n=r,g.set(r.name,n)),T.add(n.name),t.loadLanguageSync(n.data)}}function q(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function D(e){if(q())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=k.get(e);if(t!=null)return t;try{let r=A.get(e);if(r==null&&Object.prototype.hasOwnProperty.call(j,e)&&(r=j[e]),r==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const n=r().then(({default:o})=>{const s={name:e,data:o};return g.has(e)||g.set(e,s),s});return k.set(e,n),await n}finally{k.delete(e)}}function W(e){return g.get(e)??D(e)}const $=new Set;function R(e,t){e=Array.isArray(e)?e:[e];for(let r of e){let n;if(typeof r=="string"){if(n=f.getResolvedTheme(r),n==null)throw new Error(`loadResolvedThemes: ${r} is not resolved, you must resolve it before calling loadResolvedThemes`)}else n=r,r=r.name,f.getResolvedTheme(r)==null&&f.seedResolvedTheme(r,n);$.has(r)||($.add(r),t.loadThemeSync(n))}}function P(e){if(q())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(f.hasRegisteredTheme(e))return;const t=M.getTheme(e);if(t!=null){f.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function U(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function K(e){P(e);const t=await f.resolveTheme(e);return U(e,t),t}function X(e){return f.getResolvedTheme(e)??K(e)}let c;async function ge({themes:e,langs:t,preferredHighlighter:r="shiki-js"}){c??=O({themes:[],langs:["text"],engine:r==="shiki-wasm"?N(I(()=>import("./vendor-shiki-Bbf2GEcE.js").then(a=>a.w),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))):z()});const n=B(c)?await c:c;c=n;const o=[];for(const a of t){if(a==="text"||a==="ansi")continue;const i=W(a);"then"in i?o.push(i):E(i,n)}const s=[];for(const a of e){const i=X(a);"then"in i?s.push(i):R(i,c)}return(o.length>0||s.length>0)&&await Promise.all([Promise.all(o).then(a=>{E(a,n)}),Promise.all(s).then(a=>{R(a,n)})]),n}function be(){if(c!=null&&!("then"in c))return c}function B(e=c){return e!=null&&"then"in e}for(const e of F.getThemes())f.registerThemeIfAbsent(e.name,e.load);function ye(e=L){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}const d=new Map;let J=0;const h={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function ve(e){if(d.has(e))return d.get(e)??"text";if(h[e]!=null)return h[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(d.has(t[1]))return d.get(t[1])??"text";if(h[t[1]]!=null)return h[t[1]]??"text"}const r=e.match(/\.([^.]+)$/)?.[1]??"";return d.has(r)?d.get(r)??"text":h[r]??"text"}function ke(){return J}function we(){return Object.fromEntries(d)}function Q(e,t,r){const n=typeof r.lineInfo=="function"?r.lineInfo(t):r.lineInfo[t-1];if(n==null){const o=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(o,{node:e,line:t,state:r}),new Error(o)}return e.tagName="div",e.properties["data-line"]=n.lineNumber,e.properties["data-alt-line"]=n.altLineNumber,e.properties["data-line-type"]=n.type,e.properties["data-line-index"]=n.lineIndex,e.children.length===0&&e.children.push(S(`
|
|
2
|
+
import{_ as I}from"./vendor-vite-runtime-DD1OZmLC.js";import{b as j,c as O}from"./vendor-shiki-Bbf2GEcE.js";import{t as f}from"./themeResolver-BmJyTmjJ.js";import{s as M,p as F,n as v}from"./vendor-pierre-theming-C6Z4M5_u.js";import{c as N}from"./vendor-shikijs-engine-oniguruma-DPWuIF1G.js";import{c as z}from"./vendor-shikijs-engine-javascript-Cme4830A.js";import{fL as L,hG as G}from"./useAppFontEffects-B6OfEypo.js";import{t as H}from"./vendor-shikijs-transformers-CZWsLLKm.js";function pe(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ue(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function S(e){return{type:"text",value:e}}function m({tagName:e,children:t=[],properties:r={}}){return{type:"element",tagName:e,properties:r,children:t}}function fe({name:e,width:t=16,height:r=16,properties:n}){return m({tagName:"svg",properties:{width:t,height:r,viewBox:"0 0 16 16",...n},children:[m({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function V(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function de(e){return m({tagName:"div",properties:{"data-gutter":""},children:e})}function me(e,t,r,n={}){return m({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":r,...n},children:t!=null?[m({tagName:"span",properties:{"data-line-number-content":""},children:[S(`${t}`)]})]:void 0})}function he(e,t,r){return m({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":r,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${r};`:`grid-row: span ${r};min-height:calc(${r} * 1lh);`}})}const g=new Map,k=new Map,A=new Map,T=new Set;function E(e,t){e=Array.isArray(e)?e:[e];for(const r of e){if(T.has(r.name))continue;let n=g.get(r.name);n==null&&(n=r,g.set(r.name,n)),T.add(n.name),t.loadLanguageSync(n.data)}}function q(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function D(e){if(q())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=k.get(e);if(t!=null)return t;try{let r=A.get(e);if(r==null&&Object.prototype.hasOwnProperty.call(j,e)&&(r=j[e]),r==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const n=r().then(({default:o})=>{const s={name:e,data:o};return g.has(e)||g.set(e,s),s});return k.set(e,n),await n}finally{k.delete(e)}}function W(e){return g.get(e)??D(e)}const $=new Set;function R(e,t){e=Array.isArray(e)?e:[e];for(let r of e){let n;if(typeof r=="string"){if(n=f.getResolvedTheme(r),n==null)throw new Error(`loadResolvedThemes: ${r} is not resolved, you must resolve it before calling loadResolvedThemes`)}else n=r,r=r.name,f.getResolvedTheme(r)==null&&f.seedResolvedTheme(r,n);$.has(r)||($.add(r),t.loadThemeSync(n))}}function P(e){if(q())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(f.hasRegisteredTheme(e))return;const t=M.getTheme(e);if(t!=null){f.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function U(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function K(e){P(e);const t=await f.resolveTheme(e);return U(e,t),t}function X(e){return f.getResolvedTheme(e)??K(e)}let c;async function ge({themes:e,langs:t,preferredHighlighter:r="shiki-js"}){c??=O({themes:[],langs:["text"],engine:r==="shiki-wasm"?N(I(()=>import("./vendor-shiki-Bbf2GEcE.js").then(a=>a.w),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))):z()});const n=B(c)?await c:c;c=n;const o=[];for(const a of t){if(a==="text"||a==="ansi")continue;const i=W(a);"then"in i?o.push(i):E(i,n)}const s=[];for(const a of e){const i=X(a);"then"in i?s.push(i):R(i,c)}return(o.length>0||s.length>0)&&await Promise.all([Promise.all(o).then(a=>{E(a,n)}),Promise.all(s).then(a=>{R(a,n)})]),n}function be(){if(c!=null&&!("then"in c))return c}function B(e=c){return e!=null&&"then"in e}for(const e of F.getThemes())f.registerThemeIfAbsent(e.name,e.load);function ye(e=L){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}const d=new Map;let J=0;const h={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function ve(e){if(d.has(e))return d.get(e)??"text";if(h[e]!=null)return h[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(d.has(t[1]))return d.get(t[1])??"text";if(h[t[1]]!=null)return h[t[1]]??"text"}const r=e.match(/\.([^.]+)$/)?.[1]??"";return d.has(r)?d.get(r)??"text":h[r]??"text"}function ke(){return J}function we(){return Object.fromEntries(d)}function Q(e,t,r){const n=typeof r.lineInfo=="function"?r.lineInfo(t):r.lineInfo[t-1];if(n==null){const o=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(o,{node:e,line:t,state:r}),new Error(o)}return e.tagName="div",e.properties["data-line"]=n.lineNumber,e.properties["data-alt-line"]=n.altLineNumber,e.properties["data-line-type"]=n.type,e.properties["data-line-index"]=n.lineIndex,e.children.length===0&&e.children.push(S(`
|
|
3
3
|
`)),e}const b=Symbol("no-token"),w=Symbol("multiple-tokens");function _(e){const t=Y(e);if(t!=null)return t;let r=b;const n=[];let o=[],s;const a=()=>{if(o.length===0||s==null){o=[],s=void 0;return}if(o.length===1){const l=o[0];if(l?.type==="element"){Z(l,s);for(const p of l.children)y(p)}else y(l);n.push(l),o=[],s=void 0;return}for(const l of o)y(l);n.push(m({tagName:"span",properties:{"data-char":s},children:o})),o=[],s=void 0},i=l=>{if(l!==b){if(l===w){r=w;return}if(r===b){r=l;return}r!==l&&(r=w)}};for(const l of e.children){const p=l.type==="element"?_(l):b;if(i(p),typeof p!="number"){a(),n.push(l);continue}s!=null&&s!==p&&a(),s??=p,o.push(l)}return a(),e.children=n,r}function Y(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function y(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)y(t)}}function Z(e,t){e.properties["data-char"]=t}function xe(e=!1,t=!1){const r={lineInfo:[]},n=[{line(o){return delete o.properties.class,o},pre(o){const s=V(o),a=[];if(s!=null){let i=1;for(const l of s.children)l.type==="element"&&(e&&_(l),a.push(Q(l,i,r)),i++);s.children=a}return o},...e?{tokens(o){for(const s of o){let a=0;for(const i of s){const l=i;l.__lineChar??=a,a+=i.content.length}}},preprocess(o,s){s.mergeWhitespaces="never"},span(o,s,a,i,l){if(l?.offset!=null&&l.content!=null){const p=l.__lineChar;return p!=null&&(o.properties["data-char"]=p),o}return o}}:null}];return t&&n.push(ee,C),e&&n.push({line:o=>(o.type==="element"&&o.children.length===0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]}),o)}),{state:r,transformers:n,toClass:C}}const C=H({classPrefix:"hl-"}),ee={name:"token-style-normalizer",tokens(e){for(const t of e)for(const r of t){if(r.htmlStyle!=null)continue;const n={};r.color!=null&&(n.color=r.color),r.bgColor!=null&&(n["background-color"]=r.bgColor),r.fontStyle!=null&&r.fontStyle!==0&&((r.fontStyle&1)!==0&&(n["font-style"]="italic"),(r.fontStyle&2)!==0&&(n["font-weight"]="bold"),(r.fontStyle&4)!==0&&(n["text-decoration"]="underline")),Object.keys(n).length>0&&(r.htmlStyle=n)}}};function u(e){return`--${e==="token"?"diffs-token":"diffs"}-`}function je({theme:e=L,highlighter:t,prefix:r}){let n="";if(typeof e=="string"){const o=t.getTheme(e),s=v(o);n+=`color:${s.fg};`,n+=`background-color:${s.bg};`,n+=`${u("global")}fg:${s.fg};`,n+=`${u("global")}bg:${s.bg};`,n+=x(o,r)}else{let o=t.getTheme(e.dark),s=v(o);n+=`${u("global")}dark:${s.fg};`,n+=`${u("global")}dark-bg:${s.bg};`,n+=x(o,"dark"),o=t.getTheme(e.light),s=v(o),n+=`${u("global")}light:${s.fg};`,n+=`${u("global")}light-bg:${s.bg};`,n+=x(o,"light")}return n}function x(e,t){t=t!=null?`${t}-`:"";let r="";const n=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];n!=null&&(r+=`${u("global")}${t}addition-color:${n};`);const o=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];o!=null&&(r+=`${u("global")}${t}deletion-color:${o};`);const s=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return s!=null&&(r+=`${u("global")}${t}modified-color:${s};`),r}function Te(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}function Ee(e){return{...G,...e}}function $e(e,t){const r=te(e,t);return t?r:e.diffHeaderHeight+r}function te(e,t){return e.paddingTop??(t?e.spacing:0)}function Re(e){return e.paddingBottom??e.spacing}function Ce(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}export{T as A,u as B,Te as C,g as R,ye as a,pe as b,R as c,ge as d,we as e,ue as f,W as g,ke as h,ve as i,m as j,fe as k,$ as l,S as m,be as n,he as o,P as p,de as q,D as r,me as s,$e as t,Re as u,U as v,Ee as w,Ce as x,je as y,xe as z};
|