difit 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{index-C8Y3FhY9.js → index-D4cUmPep.js} +2 -2
- package/dist/client/assets/{prism-java-CqT3wyAZ.js → prism-java-YjVNUoZz.js} +1 -1
- package/dist/client/assets/{prism-php-Ca6N7dZW.js → prism-php-Bj70n5ta.js} +1 -1
- package/dist/client/assets/{prism-ruby-CDGa4vUg.js → prism-ruby-CjzUUBVm.js} +1 -1
- package/dist/client/assets/{prism-solidity-CrbQqPeX.js → prism-solidity-DS27wgzj.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
|
@@ -190,11 +190,11 @@ prismjs/prism.js:
|
|
|
190
190
|
* @namespace
|
|
191
191
|
* @public
|
|
192
192
|
*)
|
|
193
|
-
*/const Tb="modulepreload",Nb=function(i){return"/"+i},Td={},Nt=function(f,y,c){let x=Promise.resolve();if(y&&y.length>0){let _=function(g){return Promise.all(g.map(h=>Promise.resolve(h).then(O=>({status:"fulfilled",value:O}),O=>({status:"rejected",reason:O}))))};document.getElementsByTagName("link");const j=document.querySelector("meta[property=csp-nonce]"),L=j?.nonce||j?.getAttribute("nonce");x=_(y.map(g=>{if(g=Nb(g),g in Td)return;Td[g]=!0;const h=g.endsWith(".css"),O=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${O}`))return;const G=document.createElement("link");if(G.rel=h?"stylesheet":Tb,h||(G.as="script"),G.crossOrigin="",G.href=g,L&&G.setAttribute("nonce",L),document.head.appendChild(G),h)return new Promise((Q,S)=>{G.addEventListener("load",Q),G.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${g}`)))})}))}function m(j){const L=new Event("vite:preloadError",{cancelable:!0});if(L.payload=j,window.dispatchEvent(L),!L.defaultPrevented)throw j}return x.then(j=>{for(const L of j||[])L.status==="rejected"&&m(L.reason);return f().catch(m)})},qu={};function Id(i){if(!qu[i]){const y={bash:()=>Nt(()=>import("./prism-bash-DTkDXsAh.js"),[]),sh:()=>Nt(()=>import("./prism-bash-DTkDXsAh.js"),[]),shell:()=>Nt(()=>import("./prism-bash-DTkDXsAh.js"),[]),php:async()=>(await Nt(()=>import("./prism-markup-templating-Ct1xsyfA.js"),[]),Nt(()=>import("./prism-php-Ca6N7dZW.js").then(c=>c.p),[])),sql:()=>Nt(()=>import("./prism-sql-AgAyy5H_.js"),[]),ruby:()=>Nt(()=>import("./prism-ruby-CDGa4vUg.js").then(c=>c.p),[]),java:()=>Nt(()=>import("./prism-java-CqT3wyAZ.js").then(c=>c.p),[]),scala:async()=>(await Id("java"),Nt(()=>import("./prism-scala-BjNo2HkN.js"),[])),solidity:()=>Nt(()=>import("./prism-solidity-CrbQqPeX.js").then(c=>c.p),[]),vim:()=>Nt(()=>import("./prism-vim-uciLQ2PQ.js"),[]),dart:()=>Nt(()=>import("./prism-dart-MjriiaMt.js"),[])}[i];if(!y)return console.warn(`No loader available for language: ${i}`),Promise.reject(new Error(`Unsupported language: ${i}`));qu[i]=y().then(()=>{}).catch(c=>{throw delete qu[i],console.warn(`Failed to load language: ${i}`,c),c})}return qu[i]}typeof global<"u"?global.Prism=B:typeof window<"u"&&(window.Prism=B);const Nd=["markup","html","xml","svg","javascript","js","typescript","ts","jsx","tsx","css","c","cpp","swift","kotlin","objectivec","reason","rust","go","graphql","yaml","yml","json","markdown","md","python","py"];function wb(i,f){const[y,c]=te.useState(()=>Nd.includes(f)||!!B.languages[f]);return te.useEffect(()=>{if(!y){if(Nd.includes(f)){c(!0);return}Id(f).then(()=>{c(!0)}).catch(()=>{c(!1)})}},[f,y]),{ready:y,actualLang:y?f:"text"}}const wd=[{id:"github",label:"GitHub Light"},{id:"vsLight",label:"VS Light"},{id:"oneLight",label:"One Light"},{id:"gruvboxMaterialLight",label:"Gruvbox Material Light"},{id:"nightOwlLight",label:"Night Owl Light"}],Od=[{id:"vsDark",label:"VS Dark"},{id:"oneDark",label:"One Dark"},{id:"gruvboxMaterialDark",label:"Gruvbox Material Dark"},{id:"nightOwl",label:"Night Owl"},{id:"dracula",label:"Dracula"},{id:"okaidia",label:"Okaidia"}];function Ob(i){return{...i,styles:i.styles.map(f=>({...f,style:{...f.style,background:void 0,backgroundColor:void 0}}))}}function Cb(i){let f;switch(i){case"github":f=yt.github;break;case"vsLight":f=yt.vsLight;break;case"oneLight":f=yt.oneLight;break;case"gruvboxMaterialLight":f=yt.gruvboxMaterialLight;break;case"nightOwlLight":f=yt.nightOwlLight;break;case"vsDark":f=yt.vsDark;break;case"oneDark":f=yt.oneDark;break;case"gruvboxMaterialDark":f=yt.gruvboxMaterialDark;break;case"nightOwl":f=yt.nightOwl;break;case"dracula":f=yt.dracula;break;case"okaidia":f=yt.okaidia;break;default:f=yt.vsDark}return Ob(f)}function zb(i){const f=mh(i).toLowerCase(),y=Zd(i),c={dockerfile:"docker",makefile:"makefile",".gitignore":"git",".env":"bash",".bashrc":"bash",".zshrc":"bash",".bash_profile":"bash",".profile":"bash"};return c[f]?c[f]:{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",css:"css",scss:"css",html:"html",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",php:"php",sql:"sql",xml:"xml",swift:"swift",kt:"kotlin",scala:"scala",r:"r",lua:"lua",perl:"perl",dockerfile:"docker",makefile:"makefile",gitignore:"git",env:"bash",conf:"nginx",ini:"ini",toml:"toml",sol:"solidity",vim:"vim",dart:"dart"}[y||""]||"text"}let Pd="";function Db(i){Pd=i}function ds({code:i,language:f,className:y,syntaxTheme:c="vsDark"}){const x=f||zb(Pd),{actualLang:m}=wb(i,x),j=Cb(c);return o.jsx(_b,{code:i,language:m,theme:j,prism:B,children:({style:L,tokens:_,getLineProps:g,getTokenProps:h})=>o.jsx("span",{className:y,style:{...L,background:"transparent",backgroundColor:"transparent"},children:_.map((O,G)=>o.jsx("span",{...g({line:O}),children:O.map((Q,S)=>o.jsx("span",{...h({token:Q})},S))},G))})})}function jb({chunk:i,comments:f,onAddComment:y,onGeneratePrompt:c,onRemoveComment:x,onUpdateComment:m,syntaxTheme:j}){const[L,_]=te.useState(null),[g,h]=te.useState(null),O=v=>{h(g===v?null:v)},G=()=>{h(null)},Q=async v=>{g!==null&&(await y(g,v),h(null))},S=v=>f.filter(X=>Array.isArray(X.line)?X.line[1]===v:X.line===v),N=v=>v.oldLine?.type==="delete"&&v.newLine?.type==="add"?v.newLineNumber?"right":"left":v.oldLine?.type==="delete"?"left":v.newLine?.type==="add"?"right":"full",R=(v,X)=>{if(!g)return"";const F=Array.isArray(g)?g[0]:g,Y=Array.isArray(g)?g[1]:g;return v==="old"&&X.oldLine?.type==="delete"&&X.oldLineNumber&&X.oldLineNumber>=F&&X.oldLineNumber<=Y||v==="new"&&X.newLine?.type==="add"&&X.newLineNumber&&X.newLineNumber>=F&&X.newLineNumber<=Y?"after:bg-diff-selected-bg after:absolute after:inset-0 after:border-l-5 after:border-l-diff-selected-border":""},z=(v=>{const X=[];let F=i.oldStart,Y=i.newStart,W=0;for(;W<v.length;){const ae=v[W];if(!ae){W++;continue}if(ae.type==="normal")X.push({oldLine:ae,newLine:{...ae},oldLineNumber:F,newLineNumber:Y}),F++,Y++,W++;else if(ae.type==="delete"){let ue=W+1;for(;ue<v.length&&v[ue]?.type==="delete";)ue++;const Ce=v.slice(W,ue),Ne=[];for(;ue<v.length&&v[ue]?.type==="add";){const je=v[ue];je&&Ne.push(je),ue++}const be=Math.max(Ce.length,Ne.length);for(let je=0;je<be;je++){const ve=Ce[je],pe=Ne[je];X.push({oldLine:ve,newLine:pe,oldLineNumber:ve?F+je:void 0,newLineNumber:pe?Y+je:void 0})}F+=Ce.length,Y+=Ne.length,W=ue}else ae.type==="add"&&(X.push({newLine:ae,newLineNumber:Y}),Y++,W++)}return X})(i.lines);return o.jsx("div",{className:"bg-github-bg-primary border border-github-border rounded-md overflow-hidden",children:o.jsx("table",{className:"w-full border-collapse font-mono text-xs leading-5",children:o.jsx("tbody",{children:z.map((v,X)=>{const F=v.newLineNumber?S(v.newLineNumber):v.oldLineNumber?S(v.oldLineNumber):[];return o.jsxs(ps.Fragment,{children:[o.jsxs("tr",{className:"group",children:[o.jsx("td",{className:"w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:v.oldLineNumber||""}),o.jsx("td",{className:`w-1/2 p-0 align-top border-r border-github-border relative ${v.oldLine?.type==="delete"?"bg-diff-deletion-bg cursor-pointer":v.oldLine?.type==="normal"?"bg-transparent":"bg-github-bg-secondary"} ${R("old",v)}`,onMouseDown:()=>v.oldLine?.type==="delete"&&v.oldLineNumber&&_(v.oldLineNumber),onMouseUp:()=>{if(!(v.oldLine?.type!=="delete"||v.oldLineNumber===void 0)){if(!L||L===v.oldLineNumber){O(v.oldLineNumber),_(null);return}O([L,v.oldLineNumber]),_(null)}},title:v.oldLine?.type==="delete"&&v.oldLineNumber?"Click to add comment":"",children:v.oldLine&&o.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:o.jsx(ds,{code:v.oldLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:j})})}),o.jsx("td",{className:"w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:v.newLineNumber||""}),o.jsx("td",{className:`w-1/2 p-0 align-top relative ${v.newLine?.type==="add"?"bg-diff-addition-bg cursor-pointer":v.newLine?.type==="normal"?"bg-transparent cursor-pointer":"bg-github-bg-secondary"} ${R("new",v)}`,onMouseDown:()=>(v.newLine?.type==="add"||v.newLine?.type==="normal")&&v.newLineNumber&&_(v.newLineNumber),onMouseUp:()=>{if(!(v.newLine?.type!=="add"&&v.newLine?.type!=="normal"||v.newLineNumber===void 0)){if(!L||L===v.newLineNumber){O(v.newLineNumber),_(null);return}O([L,v.newLineNumber]),_(null)}},title:(v.newLine?.type==="add"||v.newLine?.type==="normal")&&v.newLineNumber?"Click to add comment":"",children:v.newLine&&o.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:o.jsx(ds,{code:v.newLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:j})})})]}),F.length>0&&o.jsx("tr",{className:"bg-github-bg-secondary",children:o.jsx("td",{colSpan:4,className:"p-0 border-t border-github-border",children:F.map(Y=>{const W=N(v);return o.jsx("div",{className:`flex ${W==="left"?"justify-start":W==="right"?"justify-end":"justify-center"}`,children:o.jsx("div",{className:`${W==="full"?"w-full":"w-1/2"}`,children:o.jsx(Vd,{comment:Y,onGeneratePrompt:c,onRemoveComment:x,onUpdateComment:m})})},Y.id)})})}),g&&(g===v.oldLineNumber&&v.oldLine?.type==="delete"||g===v.newLineNumber&&(v.newLine?.type==="add"||v.newLine?.type==="normal")||Array.isArray(g)&&(g[1]===v.newLineNumber||g[1]===v.oldLineNumber))&&o.jsx("tr",{className:"bg-github-bg-secondary",children:o.jsx("td",{colSpan:4,className:"p-0 border-t border-github-border",children:o.jsx("div",{className:`flex ${N(v)==="left"?"justify-start":N(v)==="right"?"justify-end":"justify-center"}`,children:o.jsx("div",{className:`${N(v)==="full"?"w-full":"w-1/2"}`,children:o.jsx(Xd,{onSubmit:Q,onCancel:G})})})})})]},X)})})})})}function Rb({chunk:i,comments:f,onAddComment:y,onGeneratePrompt:c,onRemoveComment:x,onUpdateComment:m,mode:j="inline",syntaxTheme:L}){const[_,g]=te.useState(null),[h,O]=te.useState(null),[G,Q]=te.useState(null),S=Y=>{switch(Y.type){case"add":return"bg-diff-addition-bg";case"delete":return"bg-diff-deletion-bg";default:return"bg-transparent"}},N=Y=>{switch(Y.type){case"add":return"+";case"delete":return"-";default:return" "}},R=(Y,W)=>{h===Y?(O(null),Q(null)):(O(Y),Q(W||null))},E=()=>{O(null),Q(null)},z=async Y=>{h!==null&&(await y(h,Y,G||void 0),O(null),Q(null))},v=Y=>f.filter(W=>Array.isArray(W.line)?W.line[1]===Y:W.line===Y),X=Y=>{if(j==="inline")return"full";switch(Y.type){case"delete":return"left";case"add":return"right";default:return"full"}},F=Y=>{if(!h||!Y)return"";const W=Array.isArray(h)?h[0]:h,ae=Array.isArray(h)?h[1]:h;return Y>=W&&Y<=ae?"after:bg-diff-selected-bg after:absolute after:inset-0 after:border-l-5 after:border-l-diff-selected-border":""};return j==="side-by-side"?o.jsx(jb,{chunk:i,comments:f,onAddComment:y,onGeneratePrompt:c,onRemoveComment:x,onUpdateComment:m,syntaxTheme:L}):o.jsx("div",{className:"bg-github-bg-primary",children:o.jsx("table",{className:"w-full border-collapse font-mono text-xs leading-5",children:o.jsx("tbody",{children:i.lines.map((Y,W)=>{const ae=v(Y.newLineNumber||Y.oldLineNumber||0);return o.jsxs(ps.Fragment,{children:[o.jsxs("tr",{className:`cursor-pointer group ${S(Y)} relative ${F(Y.newLineNumber||Y.oldLineNumber)}`,onMouseDown:()=>{const ue=Y.newLineNumber||Y.oldLineNumber;ue&&g(ue)},onMouseUp:()=>{const ue=Y.newLineNumber||Y.oldLineNumber;if(ue){if(!_||_===ue){R(ue,Y.content),g(null);return}R([_,ue]),g(null)}},title:"Click to add comment",children:[o.jsx("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:Y.oldLineNumber||""}),o.jsx("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:Y.newLineNumber||""}),o.jsx("td",{className:"p-0 w-full relative align-top",children:o.jsxs("div",{className:"flex items-center relative min-h-[20px]",children:[o.jsx("span",{className:`w-5 text-center text-github-text-muted flex-shrink-0 bg-github-bg-secondary border-r border-github-border ${Y.type==="add"?"text-github-accent bg-diff-addition-bg":Y.type==="delete"?"text-github-danger bg-diff-deletion-bg":""}`,children:N(Y)}),o.jsx(ds,{code:Y.content,className:"flex-1 px-3 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:L})]})})]}),ae.map(ue=>{const Ce=X(Y);return o.jsx("tr",{className:"bg-github-bg-secondary",children:o.jsx("td",{colSpan:3,className:"p-0 border-t border-github-border",children:o.jsx("div",{className:`flex ${Ce==="left"?"justify-start":Ce==="right"?"justify-end":"justify-center"}`,children:o.jsx("div",{className:`${Ce==="full"?"w-full":"w-1/2"}`,children:o.jsx(Vd,{comment:ue,onGeneratePrompt:c,onRemoveComment:x,onUpdateComment:m})})})})},ue.id)}),h&&(h===(Y.newLineNumber||Y.oldLineNumber)||Array.isArray(h)&&h[1]===(Y.newLineNumber||Y.oldLineNumber))&&o.jsx("tr",{className:"bg-[var(--bg-secondary)]",children:o.jsx("td",{colSpan:3,className:"p-0 border-t border-[var(--border-muted)]",children:o.jsx("div",{className:`flex ${X(Y)==="left"?"justify-start":X(Y)==="right"?"justify-end":"justify-center"}`,children:o.jsx("div",{className:`${X(Y)==="full"?"w-full":"w-1/2"}`,children:o.jsx(Xd,{onSubmit:z,onCancel:E})})})})})]},W)})})})})}function Mb({file:i,mode:f="inline",baseCommitish:y,targetCommitish:c}){const x=i.status==="deleted",m=i.status==="added",j=i.status==="modified"||i.status==="renamed",L=y||"HEAD~1",_=c||"HEAD",[g,h]=te.useState({}),[O,G]=te.useState({}),Q=async(E,z)=>{try{const v=E.naturalWidth,X=E.naturalHeight,W=(await(await fetch(E.src)).blob()).size;z({width:v,height:X,size:W})}catch(v){console.error("Failed to get image info:",v)}},S=E=>E?E<1024?`${E} B`:E<1024*1024?`${(E/1024).toFixed(1)} KB`:`${(E/(1024*1024)).toFixed(1)} MB`:"",N=E=>!E.width||!E.height?"":`W: ${E.width}px | H: ${E.height}px`,R={backgroundImage:`
|
|
193
|
+
*/const Tb="modulepreload",Nb=function(i){return"/"+i},Td={},Nt=function(f,y,c){let x=Promise.resolve();if(y&&y.length>0){let _=function(g){return Promise.all(g.map(h=>Promise.resolve(h).then(O=>({status:"fulfilled",value:O}),O=>({status:"rejected",reason:O}))))};document.getElementsByTagName("link");const j=document.querySelector("meta[property=csp-nonce]"),L=j?.nonce||j?.getAttribute("nonce");x=_(y.map(g=>{if(g=Nb(g),g in Td)return;Td[g]=!0;const h=g.endsWith(".css"),O=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${O}`))return;const G=document.createElement("link");if(G.rel=h?"stylesheet":Tb,h||(G.as="script"),G.crossOrigin="",G.href=g,L&&G.setAttribute("nonce",L),document.head.appendChild(G),h)return new Promise((Q,S)=>{G.addEventListener("load",Q),G.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${g}`)))})}))}function m(j){const L=new Event("vite:preloadError",{cancelable:!0});if(L.payload=j,window.dispatchEvent(L),!L.defaultPrevented)throw j}return x.then(j=>{for(const L of j||[])L.status==="rejected"&&m(L.reason);return f().catch(m)})},qu={};function Id(i){if(!qu[i]){const y={bash:()=>Nt(()=>import("./prism-bash-DTkDXsAh.js"),[]),sh:()=>Nt(()=>import("./prism-bash-DTkDXsAh.js"),[]),shell:()=>Nt(()=>import("./prism-bash-DTkDXsAh.js"),[]),php:async()=>(await Nt(()=>import("./prism-markup-templating-Ct1xsyfA.js"),[]),Nt(()=>import("./prism-php-Bj70n5ta.js").then(c=>c.p),[])),sql:()=>Nt(()=>import("./prism-sql-AgAyy5H_.js"),[]),ruby:()=>Nt(()=>import("./prism-ruby-CjzUUBVm.js").then(c=>c.p),[]),java:()=>Nt(()=>import("./prism-java-YjVNUoZz.js").then(c=>c.p),[]),scala:async()=>(await Id("java"),Nt(()=>import("./prism-scala-BjNo2HkN.js"),[])),solidity:()=>Nt(()=>import("./prism-solidity-DS27wgzj.js").then(c=>c.p),[]),vim:()=>Nt(()=>import("./prism-vim-uciLQ2PQ.js"),[]),dart:()=>Nt(()=>import("./prism-dart-MjriiaMt.js"),[])}[i];if(!y)return console.warn(`No loader available for language: ${i}`),Promise.reject(new Error(`Unsupported language: ${i}`));qu[i]=y().then(()=>{}).catch(c=>{throw delete qu[i],console.warn(`Failed to load language: ${i}`,c),c})}return qu[i]}typeof global<"u"?global.Prism=B:typeof window<"u"&&(window.Prism=B);const Nd=["markup","html","xml","svg","javascript","js","typescript","ts","jsx","tsx","css","c","cpp","swift","kotlin","objectivec","reason","rust","go","graphql","yaml","yml","json","markdown","md","python","py"];function wb(i,f){const[y,c]=te.useState(()=>Nd.includes(f)||!!B.languages[f]);return te.useEffect(()=>{if(!y){if(Nd.includes(f)){c(!0);return}Id(f).then(()=>{c(!0)}).catch(()=>{c(!1)})}},[f,y]),{ready:y,actualLang:y?f:"text"}}const wd=[{id:"github",label:"GitHub Light"},{id:"vsLight",label:"VS Light"},{id:"oneLight",label:"One Light"},{id:"gruvboxMaterialLight",label:"Gruvbox Material Light"},{id:"nightOwlLight",label:"Night Owl Light"}],Od=[{id:"vsDark",label:"VS Dark"},{id:"oneDark",label:"One Dark"},{id:"gruvboxMaterialDark",label:"Gruvbox Material Dark"},{id:"nightOwl",label:"Night Owl"},{id:"dracula",label:"Dracula"},{id:"okaidia",label:"Okaidia"}];function Ob(i){return{...i,styles:i.styles.map(f=>({...f,style:{...f.style,background:void 0,backgroundColor:void 0}}))}}function Cb(i){let f;switch(i){case"github":f=yt.github;break;case"vsLight":f=yt.vsLight;break;case"oneLight":f=yt.oneLight;break;case"gruvboxMaterialLight":f=yt.gruvboxMaterialLight;break;case"nightOwlLight":f=yt.nightOwlLight;break;case"vsDark":f=yt.vsDark;break;case"oneDark":f=yt.oneDark;break;case"gruvboxMaterialDark":f=yt.gruvboxMaterialDark;break;case"nightOwl":f=yt.nightOwl;break;case"dracula":f=yt.dracula;break;case"okaidia":f=yt.okaidia;break;default:f=yt.vsDark}return Ob(f)}function zb(i){const f=mh(i).toLowerCase(),y=Zd(i),c={dockerfile:"docker",makefile:"makefile",".gitignore":"git",".env":"bash",".bashrc":"bash",".zshrc":"bash",".bash_profile":"bash",".profile":"bash"};return c[f]?c[f]:{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",css:"css",scss:"css",html:"html",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",php:"php",sql:"sql",xml:"xml",swift:"swift",kt:"kotlin",scala:"scala",r:"r",lua:"lua",perl:"perl",dockerfile:"docker",makefile:"makefile",gitignore:"git",env:"bash",conf:"nginx",ini:"ini",toml:"toml",sol:"solidity",vim:"vim",dart:"dart"}[y||""]||"text"}let Pd="";function Db(i){Pd=i}function ds({code:i,language:f,className:y,syntaxTheme:c="vsDark"}){const x=f||zb(Pd),{actualLang:m}=wb(i,x),j=Cb(c);return o.jsx(_b,{code:i,language:m,theme:j,prism:B,children:({style:L,tokens:_,getLineProps:g,getTokenProps:h})=>o.jsx("span",{className:y,style:{...L,background:"transparent",backgroundColor:"transparent"},children:_.map((O,G)=>o.jsx("span",{...g({line:O}),children:O.map((Q,S)=>o.jsx("span",{...h({token:Q})},S))},G))})})}function jb({chunk:i,comments:f,onAddComment:y,onGeneratePrompt:c,onRemoveComment:x,onUpdateComment:m,syntaxTheme:j}){const[L,_]=te.useState(null),[g,h]=te.useState(null),O=v=>{h(g===v?null:v)},G=()=>{h(null)},Q=async v=>{g!==null&&(await y(g,v),h(null))},S=v=>f.filter(X=>Array.isArray(X.line)?X.line[1]===v:X.line===v),N=v=>v.oldLine?.type==="delete"&&v.newLine?.type==="add"?v.newLineNumber?"right":"left":v.oldLine?.type==="delete"?"left":v.newLine?.type==="add"?"right":"full",R=(v,X)=>{if(!g)return"";const F=Array.isArray(g)?g[0]:g,Y=Array.isArray(g)?g[1]:g;return v==="old"&&X.oldLine?.type==="delete"&&X.oldLineNumber&&X.oldLineNumber>=F&&X.oldLineNumber<=Y||v==="new"&&X.newLine?.type==="add"&&X.newLineNumber&&X.newLineNumber>=F&&X.newLineNumber<=Y?"after:bg-diff-selected-bg after:absolute after:inset-0 after:border-l-5 after:border-l-diff-selected-border":""},z=(v=>{const X=[];let F=i.oldStart,Y=i.newStart,W=0;for(;W<v.length;){const ae=v[W];if(!ae){W++;continue}if(ae.type==="normal")X.push({oldLine:ae,newLine:{...ae},oldLineNumber:F,newLineNumber:Y}),F++,Y++,W++;else if(ae.type==="delete"){let ue=W+1;for(;ue<v.length&&v[ue]?.type==="delete";)ue++;const Ce=v.slice(W,ue),Ne=[];for(;ue<v.length&&v[ue]?.type==="add";){const je=v[ue];je&&Ne.push(je),ue++}const be=Math.max(Ce.length,Ne.length);for(let je=0;je<be;je++){const ve=Ce[je],pe=Ne[je];X.push({oldLine:ve,newLine:pe,oldLineNumber:ve?F+je:void 0,newLineNumber:pe?Y+je:void 0})}F+=Ce.length,Y+=Ne.length,W=ue}else ae.type==="add"&&(X.push({newLine:ae,newLineNumber:Y}),Y++,W++)}return X})(i.lines);return o.jsx("div",{className:"bg-github-bg-primary border border-github-border rounded-md overflow-hidden",children:o.jsx("table",{className:"w-full border-collapse font-mono text-xs leading-5",children:o.jsx("tbody",{children:z.map((v,X)=>{const F=v.newLineNumber?S(v.newLineNumber):v.oldLineNumber?S(v.oldLineNumber):[];return o.jsxs(ps.Fragment,{children:[o.jsxs("tr",{className:"group",children:[o.jsx("td",{className:"w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:v.oldLineNumber||""}),o.jsx("td",{className:`w-1/2 p-0 align-top border-r border-github-border relative ${v.oldLine?.type==="delete"?"bg-diff-deletion-bg cursor-pointer":v.oldLine?.type==="normal"?"bg-transparent":"bg-github-bg-secondary"} ${R("old",v)}`,onMouseDown:()=>v.oldLine?.type==="delete"&&v.oldLineNumber&&_(v.oldLineNumber),onMouseUp:()=>{if(!(v.oldLine?.type!=="delete"||v.oldLineNumber===void 0)){if(!L||L===v.oldLineNumber){O(v.oldLineNumber),_(null);return}O([L,v.oldLineNumber]),_(null)}},title:v.oldLine?.type==="delete"&&v.oldLineNumber?"Click to add comment":"",children:v.oldLine&&o.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:o.jsx(ds,{code:v.oldLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:j})})}),o.jsx("td",{className:"w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:v.newLineNumber||""}),o.jsx("td",{className:`w-1/2 p-0 align-top relative ${v.newLine?.type==="add"?"bg-diff-addition-bg cursor-pointer":v.newLine?.type==="normal"?"bg-transparent cursor-pointer":"bg-github-bg-secondary"} ${R("new",v)}`,onMouseDown:()=>(v.newLine?.type==="add"||v.newLine?.type==="normal")&&v.newLineNumber&&_(v.newLineNumber),onMouseUp:()=>{if(!(v.newLine?.type!=="add"&&v.newLine?.type!=="normal"||v.newLineNumber===void 0)){if(!L||L===v.newLineNumber){O(v.newLineNumber),_(null);return}O([L,v.newLineNumber]),_(null)}},title:(v.newLine?.type==="add"||v.newLine?.type==="normal")&&v.newLineNumber?"Click to add comment":"",children:v.newLine&&o.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:o.jsx(ds,{code:v.newLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:j})})})]}),F.length>0&&o.jsx("tr",{className:"bg-github-bg-secondary",children:o.jsx("td",{colSpan:4,className:"p-0 border-t border-github-border",children:F.map(Y=>{const W=N(v);return o.jsx("div",{className:`flex ${W==="left"?"justify-start":W==="right"?"justify-end":"justify-center"}`,children:o.jsx("div",{className:`${W==="full"?"w-full":"w-1/2"}`,children:o.jsx(Vd,{comment:Y,onGeneratePrompt:c,onRemoveComment:x,onUpdateComment:m})})},Y.id)})})}),g&&(g===v.oldLineNumber&&v.oldLine?.type==="delete"||g===v.newLineNumber&&(v.newLine?.type==="add"||v.newLine?.type==="normal")||Array.isArray(g)&&(g[1]===v.newLineNumber||g[1]===v.oldLineNumber))&&o.jsx("tr",{className:"bg-github-bg-secondary",children:o.jsx("td",{colSpan:4,className:"p-0 border-t border-github-border",children:o.jsx("div",{className:`flex ${N(v)==="left"?"justify-start":N(v)==="right"?"justify-end":"justify-center"}`,children:o.jsx("div",{className:`${N(v)==="full"?"w-full":"w-1/2"}`,children:o.jsx(Xd,{onSubmit:Q,onCancel:G})})})})})]},X)})})})})}function Rb({chunk:i,comments:f,onAddComment:y,onGeneratePrompt:c,onRemoveComment:x,onUpdateComment:m,mode:j="inline",syntaxTheme:L}){const[_,g]=te.useState(null),[h,O]=te.useState(null),[G,Q]=te.useState(null),S=Y=>{switch(Y.type){case"add":return"bg-diff-addition-bg";case"delete":return"bg-diff-deletion-bg";default:return"bg-transparent"}},N=Y=>{switch(Y.type){case"add":return"+";case"delete":return"-";default:return" "}},R=(Y,W)=>{h===Y?(O(null),Q(null)):(O(Y),Q(W||null))},E=()=>{O(null),Q(null)},z=async Y=>{h!==null&&(await y(h,Y,G||void 0),O(null),Q(null))},v=Y=>f.filter(W=>Array.isArray(W.line)?W.line[1]===Y:W.line===Y),X=Y=>{if(j==="inline")return"full";switch(Y.type){case"delete":return"left";case"add":return"right";default:return"full"}},F=Y=>{if(!h||!Y)return"";const W=Array.isArray(h)?h[0]:h,ae=Array.isArray(h)?h[1]:h;return Y>=W&&Y<=ae?"after:bg-diff-selected-bg after:absolute after:inset-0 after:border-l-5 after:border-l-diff-selected-border":""};return j==="side-by-side"?o.jsx(jb,{chunk:i,comments:f,onAddComment:y,onGeneratePrompt:c,onRemoveComment:x,onUpdateComment:m,syntaxTheme:L}):o.jsx("div",{className:"bg-github-bg-primary",children:o.jsx("table",{className:"w-full border-collapse font-mono text-xs leading-5",children:o.jsx("tbody",{children:i.lines.map((Y,W)=>{const ae=v(Y.newLineNumber||Y.oldLineNumber||0);return o.jsxs(ps.Fragment,{children:[o.jsxs("tr",{className:`cursor-pointer group ${S(Y)} relative ${F(Y.newLineNumber||Y.oldLineNumber)}`,onMouseDown:()=>{const ue=Y.newLineNumber||Y.oldLineNumber;ue&&g(ue)},onMouseUp:()=>{const ue=Y.newLineNumber||Y.oldLineNumber;if(ue){if(!_||_===ue){R(ue,Y.content),g(null);return}R([_,ue]),g(null)}},title:"Click to add comment",children:[o.jsx("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:Y.oldLineNumber||""}),o.jsx("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:Y.newLineNumber||""}),o.jsx("td",{className:"p-0 w-full relative align-top",children:o.jsxs("div",{className:"flex items-center relative min-h-[20px]",children:[o.jsx("span",{className:`w-5 text-center text-github-text-muted flex-shrink-0 bg-github-bg-secondary border-r border-github-border ${Y.type==="add"?"text-github-accent bg-diff-addition-bg":Y.type==="delete"?"text-github-danger bg-diff-deletion-bg":""}`,children:N(Y)}),o.jsx(ds,{code:Y.content,className:"flex-1 px-3 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit",syntaxTheme:L})]})})]}),ae.map(ue=>{const Ce=X(Y);return o.jsx("tr",{className:"bg-github-bg-secondary",children:o.jsx("td",{colSpan:3,className:"p-0 border-t border-github-border",children:o.jsx("div",{className:`flex ${Ce==="left"?"justify-start":Ce==="right"?"justify-end":"justify-center"}`,children:o.jsx("div",{className:`${Ce==="full"?"w-full":"w-1/2"}`,children:o.jsx(Vd,{comment:ue,onGeneratePrompt:c,onRemoveComment:x,onUpdateComment:m})})})})},ue.id)}),h&&(h===(Y.newLineNumber||Y.oldLineNumber)||Array.isArray(h)&&h[1]===(Y.newLineNumber||Y.oldLineNumber))&&o.jsx("tr",{className:"bg-[var(--bg-secondary)]",children:o.jsx("td",{colSpan:3,className:"p-0 border-t border-[var(--border-muted)]",children:o.jsx("div",{className:`flex ${X(Y)==="left"?"justify-start":X(Y)==="right"?"justify-end":"justify-center"}`,children:o.jsx("div",{className:`${X(Y)==="full"?"w-full":"w-1/2"}`,children:o.jsx(Xd,{onSubmit:z,onCancel:E})})})})})]},W)})})})})}function Mb({file:i,mode:f="inline",baseCommitish:y,targetCommitish:c}){const x=i.status==="deleted",m=i.status==="added",j=i.status==="modified"||i.status==="renamed",L=y||"HEAD~1",_=c||"HEAD",[g,h]=te.useState({}),[O,G]=te.useState({}),Q=async(E,z)=>{try{const v=E.naturalWidth,X=E.naturalHeight,W=(await(await fetch(E.src)).blob()).size;z({width:v,height:X,size:W})}catch(v){console.error("Failed to get image info:",v)}},S=E=>E?E<1024?`${E} B`:E<1024*1024?`${(E/1024).toFixed(1)} KB`:`${(E/(1024*1024)).toFixed(1)} MB`:"",N=E=>!E.width||!E.height?"":`W: ${E.width}px | H: ${E.height}px`,R={backgroundImage:`
|
|
194
194
|
linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%),
|
|
195
195
|
linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%)
|
|
196
196
|
`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px",backgroundColor:"white"};return x?o.jsx("div",{className:"bg-github-bg-primary p-4",children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"mb-2",children:o.jsx("span",{className:"text-github-danger font-medium",children:"Deleted Image"})}),o.jsxs("div",{className:"inline-block border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[o.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Previous version:"}),o.jsx("img",{src:`/api/blob/${i.oldPath||i.path}?ref=${L}`,alt:`Previous version of ${i.oldPath||i.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:R,onLoad:E=>Q(E.currentTarget,h),onError:E=>{const z=E.target;z.style.display="none",z.nextElementSibling?.classList.remove("hidden")}}),o.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(g.width||g.size)&&o.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[N(g),N(g)&&S(g.size)&&" | ",S(g.size)]})]})]})}):m?o.jsx("div",{className:"bg-github-bg-primary p-4",children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"mb-2",children:o.jsx("span",{className:"text-github-accent font-medium",children:"Added Image"})}),o.jsxs("div",{className:"inline-block border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[o.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"New file:"}),o.jsx("img",{src:`/api/blob/${i.path}?ref=${_}`,alt:`New image ${i.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:R,onLoad:E=>Q(E.currentTarget,G),onError:E=>{const z=E.target;z.style.display="none",z.nextElementSibling?.classList.remove("hidden")}}),o.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(O.width||O.size)&&o.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[N(O),N(O)&&S(O.size)&&" | ",S(O.size)]})]})]})}):j?f==="side-by-side"?o.jsxs("div",{className:"bg-github-bg-primary p-4",children:[o.jsx("div",{className:"text-center mb-4",children:o.jsx("span",{className:"text-github-text-primary font-medium",children:"Modified Image"})}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx("div",{className:"text-center",children:o.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[o.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Previous version:"}),o.jsx("img",{src:`/api/blob/${i.oldPath||i.path}?ref=${L}`,alt:`Previous version of ${i.oldPath||i.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:R,onLoad:E=>Q(E.currentTarget,h),onError:E=>{const z=E.target;z.style.display="none",z.nextElementSibling?.classList.remove("hidden")}}),o.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(g.width||g.size)&&o.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[N(g),N(g)&&S(g.size)&&" | ",S(g.size)]})]})}),o.jsx("div",{className:"text-center",children:o.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary",children:[o.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Current version:"}),o.jsx("img",{src:`/api/blob/${i.path}?ref=${_}`,alt:`Current version of ${i.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:R,onLoad:E=>Q(E.currentTarget,G),onError:E=>{const z=E.target;z.style.display="none",z.nextElementSibling?.classList.remove("hidden")}}),o.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(O.width||O.size)&&o.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[N(O),N(O)&&S(O.size)&&" | ",S(O.size)]})]})})]})]}):o.jsxs("div",{className:"bg-github-bg-primary p-4",children:[o.jsx("div",{className:"text-center mb-4",children:o.jsx("span",{className:"text-github-text-primary font-medium",children:"Modified Image"})}),o.jsxs("div",{className:"space-y-6",children:[o.jsx("div",{className:"text-center",children:o.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary inline-block",children:[o.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Previous version:"}),o.jsx("img",{src:`/api/blob/${i.oldPath||i.path}?ref=${L}`,alt:`Previous version of ${i.oldPath||i.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:R,onLoad:E=>Q(E.currentTarget,h),onError:E=>{const z=E.target;z.style.display="none",z.nextElementSibling?.classList.remove("hidden")}}),o.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(g.width||g.size)&&o.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[N(g),N(g)&&S(g.size)&&" | ",S(g.size)]})]})}),o.jsx("div",{className:"text-center",children:o.jsxs("div",{className:"border border-github-border rounded-md p-4 bg-github-bg-secondary inline-block",children:[o.jsx("div",{className:"text-github-text-muted mb-2",style:{fontSize:"14px"},children:"Current version:"}),o.jsx("img",{src:`/api/blob/${i.path}?ref=${_}`,alt:`Current version of ${i.path}`,className:"max-w-full max-h-96 border border-github-border rounded mx-auto",style:R,onLoad:E=>Q(E.currentTarget,G),onError:E=>{const z=E.target;z.style.display="none",z.nextElementSibling?.classList.remove("hidden")}}),o.jsx("div",{className:"hidden text-github-text-muted text-sm mt-2",children:"Image could not be loaded"}),(O.width||O.size)&&o.jsxs("div",{className:"text-github-text-muted mt-2",style:{fontSize:"14px"},children:[N(O),N(O)&&S(O.size)&&" | ",S(O.size)]})]})})]})]}):null}function kb({file:i,comments:f,diffMode:y,reviewedFiles:c,onToggleReviewed:x,onAddComment:m,onGeneratePrompt:j,onRemoveComment:L,onUpdateComment:_,syntaxTheme:g,baseCommitish:h,targetCommitish:O}){const G=c.has(i.path),[Q,S]=te.useState(!1);Db(i.path);const N=E=>{switch(E){case"added":return o.jsx(Bd,{size:16,className:"text-github-accent"});case"deleted":return o.jsx(Hd,{size:16,className:"text-github-danger"});case"renamed":return o.jsx(Ud,{size:16,className:"text-github-warning"});default:return o.jsx(Ld,{size:16,className:"text-github-text-secondary"})}},R=async(E,z,v)=>{try{await m(i.path,E,z,v)}catch(X){console.error("Failed to add comment:",X)}};return o.jsxs("div",{className:"bg-github-bg-primary",children:[o.jsxs("div",{className:"bg-github-bg-secondary border-t-2 border-t-github-accent border-b border-github-border px-5 py-4 flex items-center justify-between flex-wrap gap-3 sticky top-0 z-10",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[o.jsx("button",{onClick:()=>x(i.path),className:"text-github-text-muted hover:text-github-text-primary transition-colors cursor-pointer",title:G?"Expand file":"Collapse file",children:G?o.jsx(Md,{size:16}):o.jsx(Rd,{size:16})}),N(i.status),o.jsx("h2",{className:"text-sm font-mono text-github-text-primary m-0 overflow-hidden text-ellipsis whitespace-nowrap",children:i.path}),o.jsx("button",{className:`bg-transparent border-none cursor-pointer px-1.5 py-1 rounded text-sm transition-all hover:bg-github-bg-tertiary ${Q?"text-github-accent":"text-github-text-secondary hover:text-github-text-primary"}`,onClick:()=>{navigator.clipboard.writeText(i.path).then(()=>{console.log("File path copied to clipboard:",i.path),S(!0),setTimeout(()=>S(!1),2e3)}).catch(E=>{console.error("Failed to copy file path:",E)})},title:"Copy file path",children:Q?o.jsx(Gu,{size:14}):o.jsx(kd,{size:14})}),i.oldPath&&i.oldPath!==i.path&&o.jsxs("span",{className:"text-xs text-github-text-muted italic",children:["(renamed from ",i.oldPath,")"]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o.jsxs("span",{className:"font-medium px-1 py-0.5 rounded text-github-accent bg-green-100/10",children:["+",i.additions]}),o.jsxs("span",{className:"font-medium px-1 py-0.5 rounded text-github-danger bg-red-100/10",children:["-",i.deletions]})]}),o.jsxs("button",{onClick:()=>x(i.path),className:`flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-all duration-200 ${c.has(i.path)?"bg-github-accent text-white":"dark:bg-slate-600 dark:text-white dark:border-slate-500 dark:hover:bg-slate-500 dark:hover:border-slate-400 bg-github-bg-secondary text-github-text-primary border border-github-border hover:bg-github-bg-tertiary hover:border-github-text-muted"}`,title:c.has(i.path)?"Mark as not reviewed":"Mark as reviewed",children:[c.has(i.path)?o.jsx(Gu,{size:14}):o.jsx(hh,{size:14}),"Viewed"]})]})]}),!G&&o.jsx("div",{className:"overflow-y-auto",children:xh(i.path)?o.jsx(Mb,{file:i,mode:y,baseCommitish:h,targetCommitish:O}):i.chunks.map((E,z)=>o.jsxs("div",{className:"border-b border-github-border",children:[o.jsx("div",{className:"bg-github-bg-tertiary px-3 py-2 border-b border-github-border",children:o.jsx("code",{className:"text-github-text-secondary text-xs font-mono",children:E.header})}),o.jsx(Rb,{chunk:E,comments:f,onAddComment:R,onGeneratePrompt:j,onRemoveComment:L,onUpdateComment:_,mode:y,syntaxTheme:g})]},z))})]})}function Lb(i){const f={name:"",path:"",isDirectory:!0,children:[]};i.forEach(c=>{const x=c.path.split("/");let m=f;for(let j=0;j<x.length;j++){const L=x[j];if(!L)continue;const _=j===x.length-1,g=x.slice(0,j+1).join("/");m.children||(m.children=[]);let h=m.children.find(O=>O.name===L);h||(h={name:L,path:g,isDirectory:!_,children:_?void 0:[],file:_?c:void 0},m.children.push(h)),m=h}});const y=c=>{if(!c.isDirectory||!c.children)return c;if(c.children=c.children.map(y),c.children.length===1&&c.children[0]?.isDirectory&&c.children[0]?.children){const x=c.children[0];if(x)return c.name?{...c,name:`${c.name}/${x.name}`,path:x.path,children:x.children}:c}return c};return y(f)}function Ub({files:i,onScrollToFile:f,comments:y,reviewedFiles:c,onToggleReviewed:x}){const m=Lb(i),j=E=>{if(!E.isDirectory||!E.children)return[];const z=[];return E.path&&z.push(E.path),E.children.forEach(v=>{z.push(...j(v))}),z},[L,_]=te.useState(()=>new Set(j(m))),[g,h]=te.useState(""),O=E=>y.filter(z=>z.file===E).length,G=E=>{if(!g.trim())return E;if(E.isDirectory&&E.children){const z=E.children.map(v=>G(v)).filter(v=>v!==null);return z.length>0?{...E,children:z}:null}else if(E.file)return E.file.path.toLowerCase().includes(g.toLowerCase())?E:null;return null},Q=G(m)||{...m,children:[]},S=E=>{switch(E){case"added":return o.jsx(Bd,{size:16,className:"text-github-accent"});case"deleted":return o.jsx(Hd,{size:16,className:"text-github-danger"});case"renamed":return o.jsx(Ud,{size:16,className:"text-github-warning"});default:return o.jsx(Ld,{size:16,className:"text-github-text-secondary"})}},N=E=>{_(z=>{const v=new Set(z);return v.has(E)?v.delete(E):v.add(E),v})},R=(E,z=0)=>{if(E.isDirectory&&E.children){const v=L.has(E.path);return o.jsxs("div",{children:[E.name&&o.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 hover:bg-github-bg-tertiary cursor-pointer",style:{paddingLeft:`${z*16+16}px`},onClick:()=>N(E.path),children:[v?o.jsx(Rd,{size:16}):o.jsx(Md,{size:16}),v?o.jsx(Wy,{size:16,className:"text-github-text-secondary"}):o.jsx(Py,{size:16,className:"text-github-text-secondary"}),o.jsx("span",{className:"text-sm text-github-text-primary font-medium flex-1 overflow-hidden text-ellipsis whitespace-nowrap",title:E.name,children:E.name})]}),(v||!E.name)&&E.children.map(X=>R(X,z+1))]},E.path)}else if(E.file){const v=O(E.file.path),X=c.has(E.file.path);return o.jsxs("div",{className:`flex items-center gap-2 px-4 py-2 hover:bg-github-bg-tertiary cursor-pointer transition-colors ${X?"opacity-70":""}`,style:{paddingLeft:`${z*16+16}px`},onClick:()=>f(E.file.path),children:[o.jsx(Yd,{checked:X,onChange:()=>{x(E.file.path)},title:X?"Mark as not reviewed":"Mark as reviewed",className:"z-10"}),S(E.file.status),o.jsx("span",{className:`text-sm text-github-text-primary flex-1 overflow-hidden text-ellipsis whitespace-nowrap ${X?"line-through text-github-text-muted":""}`,title:E.file.path,children:E.name}),v>0&&o.jsxs("span",{className:"text-github-warning text-sm font-medium ml-auto flex items-center gap-1",children:[o.jsx(lh,{size:14}),v]})]},E.file.path)}return null};return o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"px-4 py-3 border-b border-github-border bg-github-bg-tertiary",children:[o.jsxs("h3",{className:"text-sm font-semibold text-github-text-primary m-0 mb-3",children:["Files changed (",i.length,")"]}),o.jsxs("div",{className:"relative",children:[o.jsx(gh,{size:16,className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-github-text-muted"}),o.jsx("input",{type:"text",placeholder:"Filter files...",value:g,onChange:E=>h(E.target.value),className:"w-full pl-9 pr-3 py-2 text-sm bg-github-bg-primary border border-github-border rounded-md focus:outline-none focus:border-github-accent text-github-text-primary placeholder-github-text-muted"})]})]}),o.jsx("div",{className:"flex-1 overflow-y-auto",children:Q.children?.map(E=>R(E))})]})}function Bb({style:i}){return o.jsxs("svg",{style:i,viewBox:"0 0 720 190",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"difit",role:"img",children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M440.487 5.90627C432.164 9.01695 427.318 16.2817 427.318 25.649C427.318 35.9474 433.206 43.6458 442.714 45.7819C451.336 47.7188 459.606 44.3893 464.84 36.8737C466.923 33.8843 467.35 32.4073 467.606 27.3105C467.773 23.9957 467.492 20.0154 466.983 18.4654C465.699 14.5629 460.869 9.13088 456.854 7.07513C452.57 4.88086 444.73 4.32102 440.487 5.90627ZM596.658 6.653C588.927 9.55794 584.572 15.4908 583.887 24.0465C583.17 33.0212 586.83 39.8868 594.382 43.7278C603.739 48.4877 615.574 44.5081 620.482 34.9515C625.35 25.4728 622.15 13.4916 613.37 8.32678C608.986 5.74808 601.154 4.96365 596.658 6.653ZM368.585 7.68006C367.464 8.80629 367.302 12.903 367.302 40.2286V71.4878L363.832 68.1329C353.432 58.0787 335.595 52.668 319.246 54.6082C310.542 55.641 299.81 59.1369 293.3 63.0607C278.56 71.9427 266.453 89.5576 263.139 106.945C261.765 114.155 261.602 129.431 262.825 136.365C265.723 152.796 274.795 168.36 286.716 177.355C298.275 186.077 310.237 190 325.274 190C340.687 190 353.943 185.273 362.869 176.594L367.302 172.284V178.215C367.302 186.902 366.946 186.724 384.303 186.709C392.243 186.702 399.29 186.347 399.964 185.919C401.04 185.236 401.189 174.47 401.189 97.1224C401.189 23.7236 401.003 8.87842 400.068 7.74809C398.433 5.77021 370.547 5.71037 368.585 7.68006ZM526.937 7.94153C519.783 10.0325 515.359 12.5834 510.029 17.6867C501.959 25.4129 498.766 34.4597 498.766 49.5975V58.8517H490.659C484.378 58.8517 482.263 59.1418 481.268 60.1394C480.214 61.1976 479.986 63.6558 479.986 73.91C479.986 82.5264 480.289 86.6977 480.966 87.3764C481.601 88.0141 484.903 88.36 490.356 88.36H498.766V136.692C498.766 183.638 498.811 185.048 500.345 185.873C502.433 186.994 529.394 186.994 531.482 185.873C533.016 185.048 533.061 183.638 533.061 136.692V88.36H549.334C563.038 88.36 565.809 88.1568 566.89 87.0723C568.782 85.1723 568.782 62.0394 566.89 60.1394C565.808 59.0541 563.029 58.8517 549.231 58.8517H532.856L533.216 51.9721C533.604 44.5499 534.721 41.9147 538.546 39.3958C540.377 38.1901 543.049 37.904 554.661 37.6737C562.626 37.5155 569.018 37.0343 569.602 36.5483C570.892 35.4761 571.046 10.3579 569.777 7.9776C568.978 6.47923 567.918 6.39562 550.384 6.45054C535.269 6.49808 530.93 6.77431 526.937 7.94153ZM654.931 26.4834C653.136 27.7662 653.094 28.1572 653.094 43.3245V58.8517H644.567C633.342 58.8517 633.497 58.6443 633.497 73.6059C633.497 88.5674 633.342 88.36 644.567 88.36H653.094V122.636C653.094 159.998 653.439 163.935 657.362 171.354C661.848 179.838 669.111 184.99 680.857 188.022C687.996 189.866 707.647 189.269 714.309 187.007C719.756 185.158 719.86 184.87 719.969 171.298C720.082 157.364 720.441 157.791 709.174 158.48C695.386 159.324 689.341 156.938 687.388 149.883C686.927 148.214 686.58 134.435 686.577 117.663L686.572 88.36H702.068H717.564L718.87 86.3592C719.946 84.7108 720.129 82.3461 719.91 72.9575C719.719 64.8279 719.321 61.1689 718.522 60.2041C717.553 59.0345 715.315 58.8517 701.987 58.8517H686.572L686.546 43.8926C686.526 31.8556 686.28 28.613 685.288 27.2941C684.156 25.7884 682.945 25.6351 670.412 25.4129C658.94 25.2088 656.476 25.3793 654.931 26.4834ZM431.459 60.1394C430.316 61.2877 430.178 68.0001 430.188 121.82C430.197 168.838 430.429 182.667 431.232 184.262L432.264 186.311L446.657 186.535C458.941 186.725 461.242 186.567 462.353 185.452C463.521 184.279 463.655 177.845 463.655 122.786C463.655 68.0985 463.515 61.2877 462.372 60.1394C460.469 58.2287 433.362 58.2287 431.459 60.1394ZM587.799 60.4369C587.238 61.4894 586.954 82.56 586.954 123.084C586.954 177.502 587.093 184.285 588.236 185.434C590.138 187.342 616.431 187.342 618.333 185.434C619.476 184.285 619.615 177.447 619.615 122.482C619.615 75.6149 619.38 60.5828 618.636 59.8353C617.947 59.1443 613.344 58.8517 603.15 58.8517C589.644 58.8517 588.586 58.9607 587.799 60.4369ZM347.956 87.3469C362.023 93.9543 369.138 107.306 367.775 124.535C366.623 139.097 359.678 149.866 347.83 155.463C337.073 160.544 325.541 160.523 315.049 155.403C293.381 144.83 288.765 112.315 306.417 94.5961C313.92 87.0641 322.021 84.1412 334.301 84.5354C341.49 84.7666 343.224 85.124 347.956 87.3469Z",fill:"currentColor"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.42299 0.744751C4.61699 2.15275 2.03999 5.66375 0.956994 12.2768C-0.369006 20.3728 -0.294006 170.791 1.03899 176.572C2.29699 182.031 4.81699 185.308 9.65399 187.774C13.265 189.615 16.865 189.684 108.63 189.684C163.129 189.684 204.095 189.304 204.41 188.795C206 188.5 206 188.795 207.5 188C211.167 187.079 216.779 180.138 218.005 175.584C218.682 173.068 218.939 143.952 218.756 90.4718C218.487 11.7478 218.417 9.10275 216.535 6.62675C215.466 5.22075 213.441 3.19575 212.035 2.12675C209.546 0.23575 206.839 0.17975 110.978 0.0167504C55.373 -0.0782496 11.148 0.239751 9.42299 0.744751ZM203.778 14.8838C205.558 16.6638 205.509 172.577 203.728 175.005C202.577 176.574 198.865 176.688 156.978 176.446L111.478 176.184L111.226 138.684L110.974 101.184H84.059C69.255 101.184 56.808 101.52 56.397 101.931C55.986 102.343 60.674 107.82 66.814 114.104C72.954 120.388 77.978 126.202 77.978 127.026C77.978 129.577 74.769 134.267 71.896 135.916C69.609 137.229 68.75 137.278 66.704 136.217C63.533 134.572 28.705 99.1448 27.757 96.5998C27.36 95.5348 27.491 93.4308 28.049 91.9238C28.955 89.4768 68.498 49.6838 70.024 49.6838C70.366 49.6838 72.356 51.1627 74.447 52.9697C77.589 55.6867 78.118 56.6658 77.498 58.6198C77.086 59.9198 72.075 65.8308 66.363 71.7568C60.651 77.6818 55.978 83.0148 55.978 83.6068C55.978 84.3488 64.068 84.6838 81.952 84.6838H107.927H110.666C111.144 82.5 110.978 73.4537 110.978 46.2337V13.6838H156.778C191.067 13.6838 202.88 13.9858 203.778 14.8838ZM148.803 52.7217C146.51 54.0597 144.845 59.5997 145.74 62.9107C146.146 64.4107 150.657 69.9308 155.764 75.1788C161.411 80.9788 164.547 84.8988 163.764 85.1788C163.057 85.4318 151.549 85.7608 138.19 85.9108C117.896 86.1388 113.747 86.4308 112.956 87.6838C112.435 88.5088 112.002 91.7228 111.993 94.8268C111.982 99.0598 112.373 100.622 113.56 101.077C114.43 101.411 126.13 101.684 139.56 101.684C156.121 101.684 163.978 102.026 163.978 102.746C163.978 103.33 160.187 107.607 155.554 112.251C146.244 121.582 144.276 125.371 146.069 130.514C147.321 134.107 149.576 135.684 153.463 135.684C155.522 135.684 159.843 131.902 173.778 117.904C191.699 99.9008 194.978 96.0678 194.978 93.1208C194.978 91.1338 157.422 53.8238 154.163 52.5728C151.322 51.4818 150.908 51.4937 148.803 52.7217Z",fill:"currentColor"})]})}const Hb={fontSize:14,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif',theme:"dark",syntaxTheme:"vsDark"},qb=[{name:"System Font",value:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif'},{name:"Menlo",value:'Menlo, Monaco, "Courier New", monospace'},{name:"SF Mono",value:'SF Mono, Consolas, "Liberation Mono", monospace'},{name:"Fira Code",value:'"Fira Code", "Courier New", monospace'},{name:"JetBrains Mono",value:'"JetBrains Mono", "Courier New", monospace'}];function Gb({isOpen:i,onClose:f,settings:y,onSettingsChange:c}){const[x,m]=te.useState(y);te.useEffect(()=>{m(y)},[y]),te.useEffect(()=>{c(x)},[x,c]);const j=()=>x.theme==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":x.theme,L=()=>j()==="light"?wd:Od,_=h=>{const O={...x,theme:h},Q=(h==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h)==="light"?wd:Od;if(!Q.some(N=>N.id===x.syntaxTheme)&&Q.length>0){const N=Q[0];N&&(O.syntaxTheme=N.id)}m(O)},g=()=>{m(Hb)};return i?o.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50 pointer-events-none",children:o.jsxs("div",{className:"bg-github-bg-secondary border border-github-border rounded-lg w-full max-w-md mx-4 pointer-events-auto",children:[o.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-github-border",children:[o.jsxs("h2",{className:"text-lg font-semibold text-github-text-primary flex items-center gap-2",children:[o.jsx(qd,{size:20}),"Appearance Settings"]}),o.jsx("button",{onClick:f,className:"text-github-text-secondary hover:text-github-text-primary p-1",children:o.jsx(Gd,{size:18})})]}),o.jsxs("div",{className:"p-4 space-y-6",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-github-text-primary mb-2",children:"Font Size"}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("input",{type:"range",min:"10",max:"20",step:"1",value:x.fontSize,onChange:h=>m({...x,fontSize:parseInt(h.target.value)}),className:"flex-1 accent-github-accent"}),o.jsxs("span",{className:"text-sm text-github-text-secondary w-8 text-right",children:[x.fontSize,"px"]})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-github-text-primary mb-2",children:"Font Family"}),o.jsx("select",{value:x.fontFamily,onChange:h=>m({...x,fontFamily:h.target.value}),className:"w-full p-2 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary text-sm",children:qb.map(h=>o.jsx("option",{value:h.value,children:h.name},h.value))})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-github-text-primary mb-2",children:"Theme"}),o.jsx("div",{className:"flex gap-2",children:["light","dark","auto"].map(h=>o.jsx("button",{onClick:()=>_(h),className:`px-3 py-2 text-sm rounded border transition-colors ${x.theme===h?"bg-github-accent text-white border-github-accent":"bg-github-bg-tertiary text-github-text-secondary border-github-border hover:text-github-text-primary"}`,children:h.charAt(0).toUpperCase()+h.slice(1)},h))})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-sm font-medium text-github-text-primary mb-2",children:"Syntax Highlighting Theme"}),o.jsx("select",{value:x.syntaxTheme,onChange:h=>m({...x,syntaxTheme:h.target.value}),className:"w-full p-2 bg-github-bg-tertiary border border-github-border rounded text-github-text-primary text-sm",children:L().map(h=>o.jsx("option",{value:h.id,children:h.label},h.id))})]})]}),o.jsxs("div",{className:"flex items-center justify-between p-4 border-t border-github-border",children:[o.jsx("button",{onClick:g,className:"px-3 py-2 text-sm text-github-text-secondary hover:text-github-text-primary",children:"Reset to Default"}),o.jsx("button",{onClick:f,className:"px-4 py-2 text-sm bg-github-accent text-white rounded hover:bg-green-600",children:"Close"})]})]})}):null}const Cd={fontSize:14,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif',theme:"dark",syntaxTheme:"vsDark"},zd="reviewit-appearance-settings";function Yb(){const[i,f]=te.useState(Cd);te.useEffect(()=>{try{const x=localStorage.getItem(zd);if(x){const m=JSON.parse(x);f({...Cd,...m})}}catch(x){console.warn("Failed to load appearance settings from localStorage:",x)}},[]),te.useEffect(()=>{const x=document.documentElement;if(x.style.setProperty("--app-font-size",`${i.fontSize}px`),x.style.setProperty("--app-font-family",i.fontFamily),i.theme==="auto"){const m=window.matchMedia("(prefers-color-scheme: dark)");y(m.matches?"dark":"light");const j=L=>{y(L.matches?"dark":"light")};return m.addEventListener("change",j),()=>m.removeEventListener("change",j)}else{y(i.theme);return}},[i]);const y=x=>{const m=document.documentElement;x==="light"?(m.style.setProperty("--color-github-bg-primary","#ffffff"),m.style.setProperty("--color-github-bg-secondary","#f6f8fa"),m.style.setProperty("--color-github-bg-tertiary","#f1f3f4"),m.style.setProperty("--color-github-border","#d1d9e0"),m.style.setProperty("--color-github-text-primary","#24292f"),m.style.setProperty("--color-github-text-secondary","#656d76"),m.style.setProperty("--color-github-text-muted","#8c959f"),m.style.setProperty("--color-github-accent","#1f883d"),m.style.setProperty("--color-github-danger","#cf222e"),m.style.setProperty("--color-github-warning","#bf8700"),m.style.setProperty("--color-diff-addition-bg","#d1f4cd"),m.style.setProperty("--color-diff-addition-border","#1f883d"),m.style.setProperty("--color-diff-deletion-bg","#ffd8d3"),m.style.setProperty("--color-diff-deletion-border","#cf222e"),m.style.setProperty("--color-diff-neutral-bg","#f1f3f4"),m.style.setProperty("--color-comment-bg","#fff8e1"),m.style.setProperty("--color-comment-border","#ffd54f"),m.style.setProperty("--color-comment-text","#5d4037"),m.style.setProperty("--color-yellow-btn-bg","#fef3c7"),m.style.setProperty("--color-yellow-btn-border","#f59e0b"),m.style.setProperty("--color-yellow-btn-text","#92400e"),m.style.setProperty("--color-yellow-btn-hover-bg","#fde68a"),m.style.setProperty("--color-yellow-btn-hover-border","#d97706"),m.style.setProperty("--color-yellow-path-bg","#fde68a"),m.style.setProperty("--color-yellow-path-text","#92400e")):(m.style.setProperty("--color-github-bg-primary","#0d1117"),m.style.setProperty("--color-github-bg-secondary","#161b22"),m.style.setProperty("--color-github-bg-tertiary","#21262d"),m.style.setProperty("--color-github-border","#30363d"),m.style.setProperty("--color-github-text-primary","#f0f6fc"),m.style.setProperty("--color-github-text-secondary","#8b949e"),m.style.setProperty("--color-github-text-muted","#6e7681"),m.style.setProperty("--color-github-accent","#238636"),m.style.setProperty("--color-github-danger","#da3633"),m.style.setProperty("--color-github-warning","#d29922"),m.style.setProperty("--color-diff-addition-bg","#0d4429"),m.style.setProperty("--color-diff-addition-border","#1b7c3d"),m.style.setProperty("--color-diff-deletion-bg","#67060c"),m.style.setProperty("--color-diff-deletion-border","#da3633"),m.style.setProperty("--color-diff-neutral-bg","#21262d"),m.style.setProperty("--color-comment-bg","#1c2128"),m.style.setProperty("--color-comment-border","#373e47"),m.style.setProperty("--color-comment-text","#e6edf3"),m.style.setProperty("--color-yellow-btn-bg","rgba(180, 83, 9, 0.2)"),m.style.setProperty("--color-yellow-btn-border","rgba(217, 119, 6, 0.5)"),m.style.setProperty("--color-yellow-btn-text","#fbbf24"),m.style.setProperty("--color-yellow-btn-hover-bg","rgba(180, 83, 9, 0.3)"),m.style.setProperty("--color-yellow-btn-hover-border","#d97706"),m.style.setProperty("--color-yellow-path-bg","rgba(180, 83, 9, 0.3)"),m.style.setProperty("--color-yellow-path-text","#fbbf24")),document.body.style.backgroundColor="var(--color-github-bg-primary)",document.body.style.color="var(--color-github-text-primary)"};return{settings:i,updateSettings:x=>{f(x);try{localStorage.setItem(zd,JSON.stringify(x))}catch(m){console.warn("Failed to save appearance settings to localStorage:",m)}}}}function Zb(i){const[f,y]=te.useState([]),c=i?`difit-comments-${i}`:"difit-comments";te.useEffect(()=>{const h=localStorage.getItem(c);if(h)try{y(JSON.parse(h))}catch(O){console.error("Failed to parse saved comments:",O)}},[c]),te.useEffect(()=>{localStorage.setItem(c,JSON.stringify(f))},[f,c]);const x=(h,O,G,Q)=>{console.log("Adding comment with codeContent:",Q);const S={id:`${h}:${Array.isArray(O)?`${O[0]}-${O[1]}`:O}:${Date.now()}`,file:h,line:O,body:G,timestamp:new Date().toISOString(),codeContent:Q};return y(N=>[...N,S]),S},m=h=>{y(O=>O.filter(G=>G.id!==h))},j=(h,O)=>{y(G=>G.map(Q=>Q.id===h?{...Q,body:O}:Q))},L=()=>{y([]),localStorage.removeItem(c)},_=h=>Array.isArray(h.line)?`${h.file}:L${h.line[0]}-L${h.line[1]}
|
|
197
197
|
${h.body}`:`${h.file}:L${h.line}
|
|
198
198
|
${h.body}`;return{comments:f,addComment:x,removeComment:m,updateComment:j,clearAllComments:L,generatePrompt:_,generateAllCommentsPrompt:()=>f.length===0?"No comments available.":f.map(_).join(`
|
|
199
199
|
=====
|
|
200
|
-
`)}}function Xb(){const[i,f]=te.useState(null),[y,c]=te.useState(new Set),[x,m]=te.useState("side-by-side"),[j,L]=te.useState(!0),[_,g]=te.useState(!0),[h,O]=te.useState(null),[G,Q]=te.useState(!1),[S,N]=te.useState(320),[R,E]=te.useState(!1),[z,v]=te.useState(!0),[X,F]=te.useState(!1),{settings:Y,updateSettings:W}=Yb(),{comments:ae,addComment:ue,removeComment:Ce,updateComment:Ne,generatePrompt:be,generateAllCommentsPrompt:je}=Zb(i?.commit),ve=d=>{d.preventDefault(),F(!0);const k=d.clientX,V=S,Z=oe=>{const le=Math.max(200,Math.min(600,V+(oe.clientX-k)));N(le)},I=()=>{F(!1),document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",I)};document.addEventListener("mousemove",Z),document.addEventListener("mouseup",I)};te.useEffect(()=>{M()},[j]),te.useEffect(()=>{const d=()=>{if(ae.length>0){const k=JSON.stringify({comments:ae});navigator.sendBeacon("/api/comments",k)}};return window.addEventListener("beforeunload",d),()=>{window.removeEventListener("beforeunload",d),d()}},[ae]),te.useEffect(()=>{const d=new EventSource("/api/heartbeat");return d.onopen=()=>{console.log("Connected to server heartbeat")},d.onerror=()=>{console.log("Server connection lost"),d.close()},()=>{d.close()}},[]);const pe=d=>{const k=["pnpm-lock.yaml","package-lock.json","yarn.lock","Cargo.lock","Gemfile.lock","composer.lock","Pipfile.lock","poetry.lock","go.sum","mix.lock"],V=d.split("/").pop()||"";return k.includes(V)},M=async()=>{try{const d=await fetch(`/api/diff?ignoreWhitespace=${j}`);if(!d.ok)throw new Error("Failed to fetch diff data");const k=await d.json();f(k),k.mode&&m(k.mode);const V=k.files.filter(Z=>pe(Z.path)).map(Z=>Z.path);V.length>0&&c(Z=>new Set([...Z,...V]))}catch(d){O(d instanceof Error?d.message:"Unknown error")}finally{g(!1)}},K=(d,k,V,Z)=>(ue(d,k,V,Z),Promise.resolve()),J=async()=>{try{const d=je();await navigator.clipboard.writeText(d),Q(!0),setTimeout(()=>Q(!1),2e3)}catch(d){console.error("Failed to copy all comments prompt:",d)}},ye=d=>{c(k=>{const V=new Set(k);return V.has(d)?V.delete(d):(V.add(d),setTimeout(()=>{const I=document.getElementById(`file-${d.replace(/[^a-zA-Z0-9]/g,"-")}`);I&&I.scrollIntoView({behavior:"instant",block:"start"})},100)),V})};return _?o.jsx("div",{className:"flex items-center justify-center h-screen bg-github-bg-primary",children:o.jsx("div",{className:"text-github-text-secondary text-base",children:"Loading diff..."})}):h?o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-github-bg-primary text-center gap-2",children:[o.jsx("h2",{className:"text-github-danger text-2xl mb-2",children:"Error"}),o.jsx("p",{className:"text-github-text-secondary text-base",children:h})]}):i?o.jsxs("div",{className:"h-screen flex flex-col",children:[o.jsxs("header",{className:"bg-github-bg-secondary border-b border-github-border flex items-center",children:[o.jsxs("div",{className:`px-4 py-3 flex items-center justify-between gap-4 ${X?"":"!transition-all !duration-300 !ease-in-out"}`,style:{width:z?`${S}px`:"auto",minWidth:z?"200px":"auto",maxWidth:z?"600px":"auto"},children:[o.jsx("h1",{children:o.jsx(Bb,{style:{height:"18px",color:"var(--color-github-text-secondary)"}})}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("button",{onClick:()=>v(!z),className:"p-2 text-github-text-secondary hover:text-github-text-primary hover:bg-github-bg-tertiary rounded transition-colors",title:z?"Collapse file tree":"Expand file tree","aria-expanded":z,"aria-controls":"file-tree-panel","aria-label":"Toggle file tree panel",children:z?o.jsx(uh,{size:18}):o.jsx(rh,{size:18})}),o.jsx("button",{onClick:()=>E(!0),className:"p-2 text-github-text-secondary hover:text-github-text-primary hover:bg-github-bg-tertiary rounded transition-colors",title:"Appearance Settings",children:o.jsx(qd,{size:18})})]})]}),o.jsx("div",{className:`border-r border-github-border ${X?"":"!transition-all !duration-300 !ease-in-out"}`,style:{width:z?"4px":"0px",height:"calc(100% - 16px)",margin:"8px 0",transform:"translateX(-2px)"}}),o.jsxs("div",{className:"flex-1 px-4 py-3 flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex bg-github-bg-tertiary border border-github-border rounded-md p-1",children:[o.jsxs("button",{onClick:()=>m("side-by-side"),className:`px-3 py-1.5 text-xs font-medium rounded transition-all duration-200 flex items-center gap-1.5 cursor-pointer ${x==="side-by-side"?"bg-github-bg-primary text-github-text-primary shadow-sm":"text-github-text-secondary hover:text-github-text-primary"}`,children:[o.jsx(Xy,{size:14}),"Side by Side"]}),o.jsxs("button",{onClick:()=>m("inline"),className:`px-3 py-1.5 text-xs font-medium rounded transition-all duration-200 flex items-center gap-1.5 cursor-pointer ${x==="inline"?"bg-github-bg-primary text-github-text-primary shadow-sm":"text-github-text-secondary hover:text-github-text-primary"}`,children:[o.jsx(Hy,{size:14}),"Inline"]})]}),o.jsx(Yd,{checked:j,onChange:L,label:"Ignore Whitespace",title:j?"Show whitespace changes":"Ignore whitespace changes"})]}),o.jsxs("div",{className:"flex items-center gap-4 text-sm text-github-text-secondary",children:[ae.length>0&&o.jsxs("button",{onClick:J,className:"text-xs px-3 py-1.5 rounded transition-all whitespace-nowrap flex items-center gap-1.5",style:{backgroundColor:"var(--color-yellow-btn-bg)",color:"var(--color-yellow-btn-text)",border:"1px solid var(--color-yellow-btn-border)"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--color-yellow-btn-hover-bg)",d.currentTarget.style.borderColor="var(--color-yellow-btn-hover-border)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="var(--color-yellow-btn-bg)",d.currentTarget.style.borderColor="var(--color-yellow-btn-border)"},title:`Copy all ${ae.length} comments to AI coding agent`,children:[o.jsx(kd,{size:12}),G?"Copied All!":`Copy All Prompt (${ae.length})`]}),o.jsxs("span",{children:["Reviewing:"," ",o.jsx("code",{className:"bg-github-bg-tertiary px-1.5 py-0.5 rounded text-xs text-github-text-primary",children:i.commit.includes("...")?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"text-github-text-secondary font-medium",children:[i.commit.split("...")[0],"..."]}),o.jsx("span",{className:"font-medium",children:i.commit.split("...")[1]})]}):i.commit})]}),o.jsxs("span",{children:[i.files.length," file",i.files.length!==1?"s":""," changed"]})]})]})]}),o.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[o.jsx("div",{className:`relative overflow-hidden ${X?"":"!transition-all !duration-300 !ease-in-out"}`,style:{width:z?`${S}px`:"0px"},children:o.jsxs("aside",{id:"file-tree-panel",className:"bg-github-bg-secondary border-r border-github-border overflow-y-auto flex flex-col",style:{width:`${S}px`,minWidth:"200px",maxWidth:"600px",height:"100%"},children:[o.jsx("div",{className:"flex-1 overflow-y-auto",children:o.jsx(Ub,{files:i.files,onScrollToFile:d=>{const k=document.getElementById(`file-${d.replace(/[^a-zA-Z0-9]/g,"-")}`);k&&k.scrollIntoView({behavior:"smooth",block:"start"})},comments:ae,reviewedFiles:y,onToggleReviewed:ye})}),o.jsx("div",{className:"p-4 border-t border-github-border flex justify-end",children:o.jsxs("a",{href:"https://github.com/yoshiko-pg/difit",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-github-text-secondary hover:text-github-text-primary transition-colors",title:"View on GitHub",children:[o.jsx("span",{className:"text-sm",children:"Star on GitHub"}),o.jsx(th,{size:18})]})})]})}),o.jsx("div",{className:`bg-github-border hover:bg-github-text-muted cursor-col-resize ${X?"":"!transition-all !duration-300 !ease-in-out"}`,style:{width:z?"4px":"0px"},onMouseDown:ve,title:"Drag to resize file list"}),o.jsx("main",{className:"flex-1 overflow-y-auto",children:i.files.map(d=>o.jsx("div",{id:`file-${d.path.replace(/[^a-zA-Z0-9]/g,"-")}`,className:"mb-6",children:o.jsx(kb,{file:d,comments:ae.filter(k=>k.file===d.path),diffMode:x,reviewedFiles:y,onToggleReviewed:ye,onAddComment:K,onGeneratePrompt:be,onRemoveComment:Ce,onUpdateComment:Ne,syntaxTheme:Y.syntaxTheme,baseCommitish:i.baseCommitish,targetCommitish:i.targetCommitish})},d.path))})]}),o.jsx(Gb,{isOpen:R,onClose:()=>E(!1),settings:Y,onSettingsChange:W})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-github-bg-primary text-center gap-2",children:[o.jsx("h2",{className:"text-github-danger text-2xl mb-2",children:"No data"}),o.jsx("p",{className:"text-github-text-secondary text-base",children:"No diff data available"})]})}jy.createRoot(document.getElementById("root")).render(o.jsx(ps.StrictMode,{children:o.jsx(Xb,{})}));export{Dd as g};
|
|
200
|
+
`)}}function Xb(){const[i,f]=te.useState(null),[y,c]=te.useState(new Set),[x,m]=te.useState("side-by-side"),[j,L]=te.useState(!0),[_,g]=te.useState(!0),[h,O]=te.useState(null),[G,Q]=te.useState(!1),[S,N]=te.useState(320),[R,E]=te.useState(!1),[z,v]=te.useState(!0),[X,F]=te.useState(!1),{settings:Y,updateSettings:W}=Yb(),{comments:ae,addComment:ue,removeComment:Ce,updateComment:Ne,generatePrompt:be,generateAllCommentsPrompt:je}=Zb(i?.commit),ve=d=>{d.preventDefault(),F(!0);const k=d.clientX,V=S,Z=oe=>{const le=Math.max(200,Math.min(600,V+(oe.clientX-k)));N(le)},I=()=>{F(!1),document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",I)};document.addEventListener("mousemove",Z),document.addEventListener("mouseup",I)};te.useEffect(()=>{M()},[j]),te.useEffect(()=>{const d=()=>{if(ae.length>0){const k=JSON.stringify({comments:ae});navigator.sendBeacon("/api/comments",k)}};return window.addEventListener("beforeunload",d),()=>{window.removeEventListener("beforeunload",d),d()}},[ae]),te.useEffect(()=>{const d=new EventSource("/api/heartbeat");return d.onopen=()=>{console.log("Connected to server heartbeat")},d.onerror=()=>{console.log("Server connection lost"),d.close()},()=>{d.close()}},[]);const pe=d=>{const k=["pnpm-lock.yaml","package-lock.json","yarn.lock","Cargo.lock","Gemfile.lock","composer.lock","Pipfile.lock","poetry.lock","go.sum","mix.lock"],V=d.split("/").pop()||"";return k.includes(V)},M=async()=>{try{const d=await fetch(`/api/diff?ignoreWhitespace=${j}`);if(!d.ok)throw new Error("Failed to fetch diff data");const k=await d.json();f(k),k.mode&&m(k.mode);const V=k.files.filter(Z=>pe(Z.path)).map(Z=>Z.path);V.length>0&&c(Z=>new Set([...Z,...V]))}catch(d){O(d instanceof Error?d.message:"Unknown error")}finally{g(!1)}},K=(d,k,V,Z)=>(ue(d,k,V,Z),Promise.resolve()),J=async()=>{try{const d=je();await navigator.clipboard.writeText(d),Q(!0),setTimeout(()=>Q(!1),2e3)}catch(d){console.error("Failed to copy all comments prompt:",d)}},ye=d=>{c(k=>{const V=new Set(k);return V.has(d)?V.delete(d):(V.add(d),setTimeout(()=>{const I=document.getElementById(`file-${d.replace(/[^a-zA-Z0-9]/g,"-")}`);I&&I.scrollIntoView({behavior:"instant",block:"start"})},100)),V})};return _?o.jsx("div",{className:"flex items-center justify-center h-screen bg-github-bg-primary",children:o.jsx("div",{className:"text-github-text-secondary text-base",children:"Loading diff..."})}):h?o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-github-bg-primary text-center gap-2",children:[o.jsx("h2",{className:"text-github-danger text-2xl mb-2",children:"Error"}),o.jsx("p",{className:"text-github-text-secondary text-base",children:h})]}):i?o.jsxs("div",{className:"h-screen flex flex-col",children:[o.jsxs("header",{className:"bg-github-bg-secondary border-b border-github-border flex items-center",children:[o.jsxs("div",{className:`px-4 py-3 flex items-center justify-between gap-4 ${X?"":"!transition-all !duration-300 !ease-in-out"}`,style:{width:z?`${S}px`:"auto",minWidth:z?"200px":"auto",maxWidth:z?"600px":"auto"},children:[o.jsx("h1",{children:o.jsx(Bb,{style:{height:"18px",color:"var(--color-github-text-secondary)"}})}),o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("button",{onClick:()=>v(!z),className:"p-2 text-github-text-secondary hover:text-github-text-primary hover:bg-github-bg-tertiary rounded transition-colors",title:z?"Collapse file tree":"Expand file tree","aria-expanded":z,"aria-controls":"file-tree-panel","aria-label":"Toggle file tree panel",children:z?o.jsx(uh,{size:18}):o.jsx(rh,{size:18})}),o.jsx("button",{onClick:()=>E(!0),className:"p-2 text-github-text-secondary hover:text-github-text-primary hover:bg-github-bg-tertiary rounded transition-colors",title:"Appearance Settings",children:o.jsx(qd,{size:18})})]})]}),o.jsx("div",{className:`border-r border-github-border ${X?"":"!transition-all !duration-300 !ease-in-out"}`,style:{width:z?"4px":"0px",height:"calc(100% - 16px)",margin:"8px 0",transform:"translateX(-2px)"}}),o.jsxs("div",{className:"flex-1 px-4 py-3 flex items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex bg-github-bg-tertiary border border-github-border rounded-md p-1",children:[o.jsxs("button",{onClick:()=>m("side-by-side"),className:`px-3 py-1.5 text-xs font-medium rounded transition-all duration-200 flex items-center gap-1.5 cursor-pointer ${x==="side-by-side"?"bg-github-bg-primary text-github-text-primary shadow-sm":"text-github-text-secondary hover:text-github-text-primary"}`,children:[o.jsx(Xy,{size:14}),"Side by Side"]}),o.jsxs("button",{onClick:()=>m("inline"),className:`px-3 py-1.5 text-xs font-medium rounded transition-all duration-200 flex items-center gap-1.5 cursor-pointer ${x==="inline"?"bg-github-bg-primary text-github-text-primary shadow-sm":"text-github-text-secondary hover:text-github-text-primary"}`,children:[o.jsx(Hy,{size:14}),"Inline"]})]}),o.jsx(Yd,{checked:j,onChange:L,label:"Ignore Whitespace",title:j?"Show whitespace changes":"Ignore whitespace changes"})]}),o.jsxs("div",{className:"flex items-center gap-4 text-sm text-github-text-secondary",children:[ae.length>0&&o.jsxs("button",{onClick:J,className:"text-xs px-3 py-1.5 rounded transition-all whitespace-nowrap flex items-center gap-1.5",style:{backgroundColor:"var(--color-yellow-btn-bg)",color:"var(--color-yellow-btn-text)",border:"1px solid var(--color-yellow-btn-border)"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--color-yellow-btn-hover-bg)",d.currentTarget.style.borderColor="var(--color-yellow-btn-hover-border)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="var(--color-yellow-btn-bg)",d.currentTarget.style.borderColor="var(--color-yellow-btn-border)"},title:`Copy all ${ae.length} comments to AI coding agent`,children:[o.jsx(kd,{size:12}),G?"Copied All!":`Copy All Prompt (${ae.length})`]}),o.jsxs("div",{children:[o.jsxs("div",{children:[y.size," / ",i.files.length," files viewed"]}),o.jsx("progress",{style:{width:"100%"},max:i.files.length,value:y.size})]}),o.jsxs("span",{children:["Reviewing:"," ",o.jsx("code",{className:"bg-github-bg-tertiary px-1.5 py-0.5 rounded text-xs text-github-text-primary",children:i.commit.includes("...")?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"text-github-text-secondary font-medium",children:[i.commit.split("...")[0],"..."]}),o.jsx("span",{className:"font-medium",children:i.commit.split("...")[1]})]}):i.commit})]}),o.jsxs("span",{children:[i.files.length," file",i.files.length!==1?"s":""," changed"]})]})]})]}),o.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[o.jsx("div",{className:`relative overflow-hidden ${X?"":"!transition-all !duration-300 !ease-in-out"}`,style:{width:z?`${S}px`:"0px"},children:o.jsxs("aside",{id:"file-tree-panel",className:"bg-github-bg-secondary border-r border-github-border overflow-y-auto flex flex-col",style:{width:`${S}px`,minWidth:"200px",maxWidth:"600px",height:"100%"},children:[o.jsx("div",{className:"flex-1 overflow-y-auto",children:o.jsx(Ub,{files:i.files,onScrollToFile:d=>{const k=document.getElementById(`file-${d.replace(/[^a-zA-Z0-9]/g,"-")}`);k&&k.scrollIntoView({behavior:"smooth",block:"start"})},comments:ae,reviewedFiles:y,onToggleReviewed:ye})}),o.jsx("div",{className:"p-4 border-t border-github-border flex justify-end",children:o.jsxs("a",{href:"https://github.com/yoshiko-pg/difit",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-github-text-secondary hover:text-github-text-primary transition-colors",title:"View on GitHub",children:[o.jsx("span",{className:"text-sm",children:"Star on GitHub"}),o.jsx(th,{size:18})]})})]})}),o.jsx("div",{className:`bg-github-border hover:bg-github-text-muted cursor-col-resize ${X?"":"!transition-all !duration-300 !ease-in-out"}`,style:{width:z?"4px":"0px"},onMouseDown:ve,title:"Drag to resize file list"}),o.jsx("main",{className:"flex-1 overflow-y-auto",children:i.files.map(d=>o.jsx("div",{id:`file-${d.path.replace(/[^a-zA-Z0-9]/g,"-")}`,className:"mb-6",children:o.jsx(kb,{file:d,comments:ae.filter(k=>k.file===d.path),diffMode:x,reviewedFiles:y,onToggleReviewed:ye,onAddComment:K,onGeneratePrompt:be,onRemoveComment:Ce,onUpdateComment:Ne,syntaxTheme:Y.syntaxTheme,baseCommitish:i.baseCommitish,targetCommitish:i.targetCommitish})},d.path))})]}),o.jsx(Gb,{isOpen:R,onClose:()=>E(!1),settings:Y,onSettingsChange:W})]}):o.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-github-bg-primary text-center gap-2",children:[o.jsx("h2",{className:"text-github-danger text-2xl mb-2",children:"No data"}),o.jsx("p",{className:"text-github-text-secondary text-base",children:"No diff data available"})]})}jy.createRoot(document.getElementById("root")).render(o.jsx(ps.StrictMode,{children:o.jsx(Xb,{})}));export{Dd as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as u}from"./index-
|
|
1
|
+
import{g as u}from"./index-D4cUmPep.js";function p(t,a){for(var r=0;r<a.length;r++){const e=a[r];if(typeof e!="string"&&!Array.isArray(e)){for(const s in e)if(s!=="default"&&!(s in t)){const n=Object.getOwnPropertyDescriptor(e,s);n&&Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var o={},i;function d(){return i||(i=1,function(t){var a=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,e={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[e,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:e.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:e.inside}],keyword:a,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":e,keyword:a,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:e.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:e.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return a.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),o}var c=d();const l=u(c),w=p({__proto__:null,default:l},[c]);export{w as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as c}from"./index-
|
|
1
|
+
import{g as c}from"./index-D4cUmPep.js";function f(e,r){for(var n=0;n<r.length;n++){const t=r[n];if(typeof t!="string"&&!Array.isArray(t)){for(const a in t)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(t,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>t[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var u={},d;function g(){return d||(d=1,function(e){var r=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],t=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,a=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,i=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:r,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:t,operator:a,punctuation:i};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},o=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];e.languages.insertBefore("php","variable",{string:o,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:r,string:o,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:t,operator:a,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",function(s){if(/<\?/.test(s.code)){var p=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;e.languages["markup-templating"].buildPlaceholders(s,"php",p)}}),e.hooks.add("after-tokenize",function(s){e.languages["markup-templating"].tokenizePlaceholders(s,"php")})}(Prism)),u}var b=g();const y=c(b),m=f({__proto__:null,default:y},[b]);export{m as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as l}from"./index-
|
|
1
|
+
import{g as l}from"./index-D4cUmPep.js";function d(e,r){for(var n=0;n<r.length;n++){const t=r[n];if(typeof t!="string"&&!Array.isArray(t)){for(const i in t)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(t,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var a={},o;function g(){return o||(o=1,function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var r={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",t=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:r,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:r,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+t),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+t+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:r,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:r,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:r,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:r,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:r,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism)),a}var u=g();const p=l(u),b=d({__proto__:null,default:p},[u]);export{b as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as u}from"./index-
|
|
1
|
+
import{g as u}from"./index-D4cUmPep.js";function d(t,n){for(var i=0;i<n.length;i++){const e=n[i];if(typeof e!="string"&&!Array.isArray(e)){for(const r in e)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(e,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var o={},a;function c(){return a||(a=1,Prism.languages.solidity=Prism.languages.extend("clike",{"class-name":{pattern:/(\b(?:contract|enum|interface|library|new|struct|using)\s+)(?!\d)[\w$]+/,lookbehind:!0},keyword:/\b(?:_|anonymous|as|assembly|assert|break|calldata|case|constant|constructor|continue|contract|default|delete|do|else|emit|enum|event|external|for|from|function|if|import|indexed|inherited|interface|internal|is|let|library|mapping|memory|modifier|new|payable|pragma|private|public|pure|require|returns?|revert|selfdestruct|solidity|storage|struct|suicide|switch|this|throw|using|var|view|while)\b/,operator:/=>|->|:=|=:|\*\*|\+\+|--|\|\||&&|<<=?|>>=?|[-+*/%^&|<>!=]=?|[~?]/}),Prism.languages.insertBefore("solidity","keyword",{builtin:/\b(?:address|bool|byte|u?int(?:8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?|string|bytes(?:[1-9]|[12]\d|3[0-2])?)\b/}),Prism.languages.insertBefore("solidity","number",{version:{pattern:/([<>]=?|\^)\d+\.\d+\.\d+\b/,lookbehind:!0,alias:"number"}}),Prism.languages.sol=Prism.languages.solidity),o}var l=c();const m=u(l),y=d({__proto__:null,default:m},[l]);export{y as p};
|
package/dist/client/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<link rel="icon" href="/favicon-white.svg" media="(prefers-color-scheme: dark)" />
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
9
9
|
<title>difit - Git Diff Viewer</title>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-D4cUmPep.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="/assets/index-Bo95t_L8.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
package/dist/server/server.js
CHANGED
|
@@ -9,7 +9,7 @@ import { GitDiffParser } from './git-diff.js';
|
|
|
9
9
|
export async function startServer(options) {
|
|
10
10
|
const app = express();
|
|
11
11
|
const parser = new GitDiffParser();
|
|
12
|
-
let diffData
|
|
12
|
+
let diffData;
|
|
13
13
|
let currentIgnoreWhitespace = options.ignoreWhitespace || false;
|
|
14
14
|
const diffMode = options.mode || 'side-by-side';
|
|
15
15
|
app.use(express.json());
|
package/package.json
CHANGED