git-truck 3.2.1 → 4.0.0

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.
Files changed (61) hide show
  1. package/README.md +47 -28
  2. package/build/client/assets/ChevronButton-ANoRM4oe.js +1 -0
  3. package/build/client/assets/CollapsibleHeader-Bu4p-oqI.js +1 -0
  4. package/build/client/assets/Tooltip-DRu0grUy.js +5 -0
  5. package/build/client/assets/api.abort-CX5xkHwa.js +1 -0
  6. package/build/client/assets/api.abort-DxAkeS-W.js +1 -0
  7. package/build/client/assets/api.commits-DAF4WH2m.js +1 -0
  8. package/build/client/assets/api.commits-iEgBtL-A.js +1 -0
  9. package/build/client/assets/api.progress-BENNzkFW.js +1 -0
  10. package/build/client/assets/api.progress-DICNnGq5.js +1 -0
  11. package/build/client/assets/browse-DGrdg-dm.js +1 -0
  12. package/build/client/assets/browse-Mvd04mK4.js +1 -0
  13. package/build/client/assets/clear-cache-BTEuD7P-.js +1 -0
  14. package/build/client/assets/clear-cache-BdU23_cx.js +1 -0
  15. package/build/client/assets/crashedTruck_48x-DZ8PrkDC.gif +0 -0
  16. package/build/client/assets/dist-QDdB6dtJ.js +2 -0
  17. package/build/client/assets/drivingTruck_32x-C9OqTj6H.gif +0 -0
  18. package/build/client/assets/drivingTruck_48x-CILwQUl6.gif +0 -0
  19. package/build/client/assets/{entry.client-Ci1gLbyI.js → entry.client-GhdqqEEy.js} +4 -4
  20. package/build/client/assets/jsx-runtime-GK6fC0y1.js +26 -0
  21. package/build/client/assets/loadingTruck_48x-ClwSXdP8.gif +0 -0
  22. package/build/client/assets/manifest-a38e366c.js +1 -0
  23. package/build/client/assets/react-YTRJEZSD.js +1 -0
  24. package/build/client/assets/react-dom-QjzVRb79.js +1 -0
  25. package/build/client/assets/root-CA2KruPD.js +3 -0
  26. package/build/client/assets/root-CV-2KSQa.css +2 -0
  27. package/build/client/assets/ui-HOyuwkxV.js +1 -0
  28. package/build/client/assets/unloadingTruck_48x-stS0XDD5.gif +0 -0
  29. package/build/client/assets/util-CPW5oMgy.js +44 -0
  30. package/build/client/assets/view-Cwcd1vTK.js +4 -0
  31. package/build/client/assets/viewParams-BaE5Z0S4.js +1 -0
  32. package/build/server/assets/dist-Cm7_4uo5.js +6716 -0
  33. package/build/server/assets/server-build-D8iMgYfe.js +65279 -0
  34. package/build/server/index.js +23040 -4
  35. package/cli.mjs +798 -2463
  36. package/package.json +122 -98
  37. package/build/client/assets/RepoTabs-CxO-avi8.js +0 -1
  38. package/build/client/assets/browse-Bvc2-R26.js +0 -1
  39. package/build/client/assets/browse-n3hSveGT.js +0 -9
  40. package/build/client/assets/clear-cache-BJQQzFka.js +0 -1
  41. package/build/client/assets/clear-cache-DkN7P69Z.js +0 -1
  42. package/build/client/assets/dist-Bpk5WHYg.js +0 -2
  43. package/build/client/assets/jsx-runtime-s_YwNCZb.js +0 -26
  44. package/build/client/assets/manifest-1770f4ad.js +0 -1
  45. package/build/client/assets/react-dom-B9ui1jR3.js +0 -1
  46. package/build/client/assets/root-BK0u4vgl.css +0 -1
  47. package/build/client/assets/root-CGqKHKfX.js +0 -3
  48. package/build/client/assets/truck-BgAoc4Gr.gif +0 -0
  49. package/build/client/assets/ui-Dwu6e1gT.js +0 -1
  50. package/build/client/assets/view-PpNM0R4w.js +0 -1
  51. package/build/client/assets/view._index-jmCCN9mA.js +0 -1
  52. package/build/client/assets/view.commits-CUFKse0G.js +0 -1
  53. package/build/client/assets/view.details-12HQVV2q.js +0 -1
  54. package/build/server/assets/server-build-UP6uUcLa.js +0 -15737
  55. /package/build/client/assets/{_-CT17qCl3.js → _-BvRk9kiK.js} +0 -0
  56. /package/build/client/assets/{_._well-known._-8QUD84tm.js → _._well-known._-BvRk9kiK.js} +0 -0
  57. /package/build/client/assets/{_index-VLoUE117.js → _index-BvRk9kiK.js} +0 -0
  58. /package/build/client/assets/{_path-DzSNgPJP.js → _path-BvRk9kiK.js} +0 -0
  59. /package/build/client/assets/{commitcount-B_3CeIvr.js → api.commit-intervals-BvRk9kiK.js} +0 -0
  60. /package/build/client/assets/{commits-DDIAHyHU.js → api.contributor-distribution-BvRk9kiK.js} +0 -0
  61. /package/build/client/assets/{view.progress-CEmcNaLe.js → api.metrics-BvRk9kiK.js} +0 -0
@@ -1 +0,0 @@
1
- import{H as e,W as t,t as n,z as r}from"./jsx-runtime-s_YwNCZb.js";import"./react-dom-B9ui1jR3.js";import{Dn as i,Un as a,V as o,g as s,rn as c,vn as l}from"./dist-Bpk5WHYg.js";import{C as u,S as d,_ as f,b as p,c as m,d as h,f as g,g as _,h as v,p as y,r as b,u as x,v as S,x as C,y as w}from"./browse-n3hSveGT.js";var T=t(e(),1),E=t(n(),1),D={repo:{repositoryName:`mock-repo`,repositoryPath:`mock/path`,parentDirPath:`mock`,parentDirName:`mock`,status:`Success`,isAnalyzed:!0,refs:{Branches:{},Tags:{}},reasons:[],analyzedHeads:{},data:{cached:!1,interfaceVersion:17,hiddenFiles:[],repo:`mock-repo`,repositoryPath:`mock/path`,branch:`main`,commit:{type:`commit`,hash:``,tree:{type:`tree`,name:`root`,path:``,hash:``,children:[]},parent:``,parent2:null,author:{name:``,email:``,timestamp:0,timezone:``},committer:{name:``,email:``,timestamp:0,timezone:``},message:``,description:``,coauthors:[],fileCount:0},authors:[],authorsUnion:[],currentVersion:``,lastRunEpoch:0,commits:{}},currentHead:`main`,lastChanged:0},databaseInfo:{dominantAuthors:{},commitCounts:{},lastChanged:{},authorCounts:{},maxCommitCount:0,minCommitCount:0,newestChangeDate:0,oldestChangeDate:0,authors:[],authorUnions:[],fileTree:{type:`tree`,name:`root`,path:``,hash:``,children:[]},hiddenFiles:[],lastRunInfo:{time:0,hash:``},fileCount:0,repo:`mock-repo`,branch:`main`,timerange:[0,0],colorSeed:null,authorColors:{},commitCountPerTimeInterval:[],commitCountPerTimeIntervalUnit:`day`,selectedRange:[0,0],analyzedRepos:[],contribSumPerFile:{},maxMinContribCounts:{max:0,min:0},commitCount:0}};function O({handleType:e=`round`}){let t=[0,100],[n,r]=(0,T.useState)([20,80]),i=e=>{r([e[0],e[1]])};return(0,E.jsxs)(`div`,{className:`space-y-4`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`p`,{className:`text-xs tracking-wide text-gray-500 uppercase dark:text-gray-400`,children:`Selected window`}),(0,E.jsxs)(`p`,{className:`text-lg font-semibold`,children:[n[0],`% – `,n[1],`%`]})]}),(0,E.jsxs)(C,{className:`relative`,mode:2,step:1,domain:t,values:n,onUpdate:i,onChange:i,children:[(0,E.jsx)(p,{children:_}),(0,E.jsx)(w,{children:({handles:n,getHandleProps:r})=>(0,E.jsx)(`div`,{children:n.map((n,i)=>(0,E.jsx)(v,{handle:n,domain:t,getHandleProps:r,handleType:e,title:`Drag to adjust the ${i===0?`start`:`end`} threshold`},n.id))})}),(0,E.jsx)(d,{left:!1,right:!1,children:({tracks:t,getTrackProps:n})=>(0,E.jsx)(`div`,{children:t.map(({id:t,...r})=>(0,E.jsx)(S,{trackType:e,...r,getTrackProps:n,backgroundColor:`#7aa0c4`},t))})})]}),(0,E.jsxs)(`div`,{className:`flex justify-between text-sm font-medium`,children:[(0,E.jsxs)(`span`,{children:[`Start: `,n[0],`%`]}),(0,E.jsxs)(`span`,{children:[`End: `,n[1],`%`]})]}),(0,E.jsx)(f,{below:!0,count:5,tickToLabel:e=>`${Math.round(e*100)}%`})]})}var k=r(function(){let[e,t]=(0,T.useState)(!1);return(0,E.jsx)(g,{data:D,children:(0,E.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-8 p-2`,children:[(0,E.jsx)(`h1`,{className:`mb-4 text-2xl font-bold`,children:`UI Components`}),(0,E.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-2`,children:[(0,E.jsxs)(`div`,{className:`card`,children:[(0,E.jsx)(`h2`,{className:`card__title`,children:`Default Card`}),(0,E.jsx)(`p`,{className:`text-sm`,children:`This is a simple card with some text content.`})]}),(0,E.jsxs)(`div`,{className:`card`,children:[(0,E.jsxs)(`div`,{className:`card__header`,children:[(0,E.jsx)(`span`,{className:`icon`,children:`🚚`}),(0,E.jsx)(`h2`,{className:`card__title`,children:`Card with Header`})]}),(0,E.jsx)(`div`,{className:`card__content`,children:(0,E.jsx)(`p`,{className:`text-sm`,children:`Card with header, subtitle, and content.`})})]}),(0,E.jsxs)(`div`,{className:`card`,children:[(0,E.jsx)(`h2`,{className:`card__title`,children:`Buttons`}),(0,E.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,E.jsx)(`button`,{className:`btn`,children:`Default`}),(0,E.jsx)(`button`,{className:`btn btn--text`,children:`Default text`}),(0,E.jsx)(`button`,{className:`btn btn--primary`,children:`Primary`}),(0,E.jsx)(`button`,{className:`btn btn--primary btn--outlined`,children:`Primary Outlined`}),(0,E.jsx)(`button`,{className:`btn btn--primary btn--text`,children:`Primary Text`}),(0,E.jsx)(`button`,{className:`btn btn--danger`,children:`Danger`}),(0,E.jsx)(`button`,{className:`btn btn--danger btn--outlined`,children:`Danger Outlined`}),(0,E.jsx)(`button`,{className:`btn btn--danger btn--text`,children:`Danger Text`}),(0,E.jsx)(`button`,{className:`btn btn--icon`,children:(0,E.jsx)(a,{path:i,size:`1.25em`})}),(0,E.jsx)(`button`,{className:`btn btn--icon btn--primary`,children:(0,E.jsx)(a,{path:c,size:`1.25em`})}),(0,E.jsx)(`button`,{className:`btn btn--icon btn--outlined`,children:(0,E.jsx)(a,{path:l,size:`1.25em`})}),(0,E.jsxs)(`button`,{className:`btn btn--hover-swap`,children:[(0,E.jsx)(`span`,{children:`Hover me`}),(0,E.jsx)(`span`,{className:`hover-swap`,children:`🎉`})]}),(0,E.jsx)(o,{open:!1}),(0,E.jsx)(o,{open:!0}),(0,E.jsxs)(`button`,{className:`btn btn--icon`,children:[(0,E.jsx)(a,{path:i,size:`1.25em`}),(0,E.jsx)(`span`,{className:`badge`,children:`13`})]})]})]}),(0,E.jsxs)(`div`,{className:`card`,children:[(0,E.jsx)(`h2`,{className:`card__title`,children:`Inputs & Labels`}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsx)(`label`,{className:`label`,htmlFor:`input1`,children:`Label`}),(0,E.jsx)(`input`,{className:`input`,id:`input1`,placeholder:`Type here...`}),(0,E.jsx)(`label`,{className:`label`,htmlFor:`select1`,children:`Select`}),(0,E.jsxs)(`select`,{className:`input`,id:`select1`,children:[(0,E.jsx)(`option`,{children:`Option 1`}),(0,E.jsx)(`option`,{children:`Option 2`})]}),(0,E.jsx)(`label`,{className:`label`,htmlFor:`revisionSelect`,children:`Revision Select`}),(0,E.jsx)(m,{headGroups:{Branches:{main:`abcdef`},Tags:{}},disabled:!1,analyzedBranches:[],className:`input`})]})]}),(0,E.jsxs)(`div`,{className:`card`,children:[(0,E.jsx)(`h2`,{className:`card__title`,children:`LoadingIndicator`}),(0,E.jsx)(y,{loadingText:`Loading something...`,showProgress:!1})]}),(0,E.jsx)(`div`,{className:`card`,children:(0,E.jsx)(s,{installedVersion:`1.0.0`,latestVersion:`1.0.0`})}),(0,E.jsx)(`div`,{className:`card`,children:(0,E.jsx)(s,{installedVersion:`1.0.0`,latestVersion:`1.0.1`})}),(0,E.jsx)(`div`,{className:`card`,children:(0,E.jsx)(s,{installedVersion:`0.0.0-98822df`,latestVersion:`1.0.1`})}),(0,E.jsxs)(`div`,{className:`card`,children:[(0,E.jsx)(`h2`,{className:`card__title`,children:`Slider, round handles`}),(0,E.jsx)(`p`,{className:`text-sm`,children:`Demonstrates the same rail, handles, and tracks that power the in-app time range picker.`}),(0,E.jsx)(O,{handleType:`round`})]}),(0,E.jsxs)(`div`,{className:`card`,children:[(0,E.jsx)(`h2`,{className:`card__title`,children:`Slider, qquare Handles`}),(0,E.jsx)(`p`,{className:`text-sm`,children:`Same range selector with the column-style handles used in tighter layouts.`}),(0,E.jsx)(O,{handleType:`square`})]}),(0,E.jsxs)(`div`,{className:`card`,children:[(0,E.jsx)(`h2`,{className:`card__title`,children:`IconRadioGroup`}),(()=>(0,E.jsx)(u,{ariaLabel:`Select demo option`,group:{A:`Alpha`,B:`Beta`,C:`Gamma`},defaultValue:`A`,iconMap:{A:`M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z`,B:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z`,C:`M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z`},onChange:()=>{}}))(),(()=>(0,E.jsx)(u,{large:!0,ariaLabel:`Select demo option large`,group:{A:`Alpha`,B:`Beta`,C:`Gamma`},defaultValue:`A`,iconMap:{A:`M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z`,B:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z`,C:`M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z`},onChange:()=>{}}))()]}),(0,E.jsxs)(`div`,{className:`card`,children:[(0,E.jsx)(`h2`,{className:`card__title`,children:`Breadcrumb`}),(0,E.jsx)(b,{})]}),(0,E.jsx)(`div`,{className:`card relative`,children:(0,E.jsx)(h,{})}),(0,E.jsxs)(`div`,{className:`card`,children:[(0,E.jsx)(`h2`,{className:`card__title`,children:`Tooltip (Demo)`}),(0,E.jsxs)(`div`,{className:`flex flex-col items-start gap-2 p-4`,children:[(0,E.jsx)(`span`,{children:`Hover over the button to show tooltip:`}),(0,E.jsxs)(`div`,{className:``,children:[(0,E.jsxs)(`button`,{className:`btn btn--icon`,onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),children:[(0,E.jsx)(`span`,{className:`icon`,children:`🛈`}),` Hover me`]}),e&&(0,E.jsx)(x,{hoveredObject:{type:`blob`,name:`demo.txt`,path:`src/demo.txt`,hash:`abc123`,sizeInBytes:42}})]})]})]})]})]})})});export{k as default};
@@ -1 +0,0 @@
1
- import"./jsx-runtime-s_YwNCZb.js";import"./react-dom-B9ui1jR3.js";import"./dist-Bpk5WHYg.js";import{i as e,s as t}from"./browse-n3hSveGT.js";export{t as default,e as meta};
@@ -1 +0,0 @@
1
- import{W as e,t,z as n}from"./jsx-runtime-s_YwNCZb.js";var r=e(t(),1),i=n(function(){return(0,r.jsx)(`div`,{className:`space-y-4 text-sm`,children:(0,r.jsxs)(`div`,{className:`space-y-1`,children:[(0,r.jsxs)(`p`,{className:`flex items-center gap-1`,children:[(0,r.jsx)(a,{title:`Left click`,children:`Click`}),` to inspect`]}),(0,r.jsxs)(`p`,{className:`flex items-center gap-1`,children:[(0,r.jsx)(a,{title:`Double click`,children:`Double click`}),` or `,(0,r.jsx)(a,{title:`Scroll`,children:`Scroll`}),` to zoom`]})]})})});function a({children:e,title:t}){return(0,r.jsx)(`kbd`,{className:`bg-primary-bg dark:bg-primary-bg-dark h-button flex w-max min-w-max items-center rounded-sm border px-2`,title:t,children:e})}export{i as default};
@@ -1 +0,0 @@
1
- import{A as e,H as t,L as n,P as r,W as i,j as a,n as o,t as s,z as c}from"./jsx-runtime-s_YwNCZb.js";import"./react-dom-B9ui1jR3.js";import{B as l,C as u,It as d,_t as f,ht as p}from"./dist-Bpk5WHYg.js";import{w as m}from"./browse-n3hSveGT.js";import{t as h}from"./RepoTabs-CxO-avi8.js";var g=i(t()),_=i(s());function v(e){let[,t]=l();return e.items.map(e=>(0,_.jsx)(x,{authorColor:t.get(e.author)??`grey`,value:e},e.hash+`--itemContentAccordion`))}function y(e){return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`div`,{className:`flex grow overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre`,children:e.keyString}),(0,_.jsx)(`p`,{className:`text-sm break-all text-ellipsis`,children:e.value})]})}function b(e){return(0,_.jsx)(`div`,{className:`max-h-64 overflow-auto`,children:(0,_.jsx)(`div`,{className:`grid max-w-lg grid-cols-[auto_auto_1fr] gap-x-3 gap-y-1`,children:e.filechanges.map(e=>(0,_.jsxs)(g.Fragment,{children:[(0,_.jsxs)(`div`,{className:`flex grow overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre text-green-600`,children:[`+`,e.insertions]}),(0,_.jsxs)(`div`,{className:`flex grow overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre text-red-600`,children:[`-`,e.deletions]}),(0,_.jsx)(`div`,{className:`grow overflow-hidden text-ellipsis whitespace-nowrap`,children:e.path})]},e.path))})})}function x(e){return(0,_.jsxs)(`div`,{title:`By: ${e.value.author}`,className:`flex items-center gap-2 overflow-hidden text-ellipsis`,children:[(0,_.jsx)(u,{className:`ml-1`,dotColor:e.authorColor,authorColorToChange:e.value.author}),(0,_.jsxs)(d,{positions:[`left`,`top`,`bottom`,`right`],popoverTitle:`Commit Details`,trigger:({onClick:t})=>(0,_.jsx)(`button`,{className:`cursor-pointer truncate font-bold opacity-80 hover:opacity-70`,onClick:t,children:e.value.message}),children:[(0,_.jsxs)(`div`,{className:`grid max-w-lg grid-cols-[auto_1fr] gap-x-3 gap-y-1`,children:[(0,_.jsx)(y,{keyString:`Hash`,value:e.value.hash}),(0,_.jsx)(y,{keyString:`Author`,value:e.value.author}),e.value.committertime===e.value.authortime?(0,_.jsx)(y,{keyString:`Date`,value:`${f(e.value.committertime*1e3)} (${p(e.value.committertime)})`}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(y,{keyString:`Date committed`,value:`${f(e.value.committertime*1e3)} (${p(e.value.committertime)})`}),(0,_.jsx)(y,{keyString:`Date authored`,value:`${f(e.value.authortime*1e3)} (${p(e.value.authortime)})`})]}),(0,_.jsx)(y,{keyString:`Message`,value:e.value.message}),(0,_.jsx)(`div`,{className:`flex grow overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre`,children:`Body`}),(0,_.jsx)(`div`,{className:`max-h-64 overflow-auto`,children:(0,_.jsx)(`p`,{className:`text-sm break-all text-ellipsis`,children:e.value.body.length>0?e.value.body:`<none>`})}),(0,_.jsx)(y,{keyString:`File changes`,value:e.value.fileChanges.length+` files (+`+e.value.fileChanges.reduce((e,t)=>e+t.insertions,0)+`, -`+e.value.fileChanges.reduce((e,t)=>e+t.deletions,0)+`)`})]}),(0,_.jsx)(b,{filechanges:e.value.fileChanges})]})]})}function S({commits:e,commitCount:t}){let i=r(),o=a(),[s,c]=n(),l=Number(s.get(`count`)??`10`),{clickedObject:u}=m();if(!u)throw Error(`Clicked object is null in CommitHistory`);return e?e.length===0?(0,_.jsx)(`h3`,{className:`font-bold`,children:`No commit history`}):(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(`div`,{children:[(0,_.jsx)(v,{items:e,count:l}),i.state===`idle`?l<t?(0,_.jsx)(`button`,{className:`text-xs font-medium whitespace-pre opacity-70 hover:cursor-pointer`,onClick:()=>c(e=>(e.set(`count`,String(Number(e.get(`count`)??`10`)+10)),e),{state:o.state}),children:`Show more commits`}):null:(0,_.jsx)(`h3`,{children:`Loading commits...`})]})}):(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(`h3`,{children:`Loading commits...`})})}var C=c(function(){let{commitCount:t,commitsPromise:n}=e();return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(h,{}),(0,_.jsx)(g.Suspense,{fallback:(0,_.jsx)(`p`,{children:`Loading commits...`}),children:(0,_.jsx)(o,{resolve:n,children:e=>(0,_.jsx)(S,{commits:e,commitCount:t??0})})})]})});export{C as default};
@@ -1 +0,0 @@
1
- import{A as e,H as t,P as n,V as r,W as i,i as a,j as o,n as s,o as c,t as l,z as u}from"./jsx-runtime-s_YwNCZb.js";import"./react-dom-B9ui1jR3.js";import{B as d,C as f,Cn as p,En as m,Ot as h,Pt as g,Un as _,V as v,jt as y,ln as b,lt as x,mt as S,s as C,yt as w}from"./dist-Bpk5WHYg.js";import{a as T,l as E,m as D,o as O,w as k}from"./browse-n3hSveGT.js";import{t as A}from"./RepoTabs-CxO-avi8.js";var j=i(t()),M=i(l());function N(e){let[,t]=d();return e.show?(0,M.jsx)(M.Fragment,{children:e.items.map(n=>{let r=n.contribs,i=n.author,a=Math.round(r/e.contribSum*100),o=a===0?`<1`:a;return(0,M.jsxs)(j.Fragment,{children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,M.jsx)(f,{authorColorToChange:i,dotColor:t.get(i)??`grey`}),(0,M.jsx)(`span`,{className:`overflow-hidden text-sm font-bold text-ellipsis whitespace-pre`,children:i})]}),(0,M.jsxs)(`span`,{className:`text-right text-sm break-all`,children:[o,`%`]})]},i+r)})}):null}var P={},F=new WeakMap,I={metric:[{from:0,to:1e3,unit:`B`,long:`bytes`},{from:1e3,to:1e6,unit:`kB`,long:`kilobytes`},{from:1e6,to:1e9,unit:`MB`,long:`megabytes`},{from:1e9,to:0xe8d4a51000,unit:`GB`,long:`gigabytes`},{from:0xe8d4a51000,to:0x38d7ea4c68000,unit:`TB`,long:`terabytes`},{from:0x38d7ea4c68000,to:0xde0b6b3a7640000,unit:`PB`,long:`petabytes`},{from:0xde0b6b3a7640000,to:1e21,unit:`EB`,long:`exabytes`},{from:1e21,to:1e24,unit:`ZB`,long:`zettabytes`},{from:1e24,to:1e27,unit:`YB`,long:`yottabytes`}],metric_octet:[{from:0,to:1e3,unit:`o`,long:`octets`},{from:1e3,to:1e6,unit:`ko`,long:`kilooctets`},{from:1e6,to:1e9,unit:`Mo`,long:`megaoctets`},{from:1e9,to:0xe8d4a51000,unit:`Go`,long:`gigaoctets`},{from:0xe8d4a51000,to:0x38d7ea4c68000,unit:`To`,long:`teraoctets`},{from:0x38d7ea4c68000,to:0xde0b6b3a7640000,unit:`Po`,long:`petaoctets`},{from:0xde0b6b3a7640000,to:1e21,unit:`Eo`,long:`exaoctets`},{from:1e21,to:1e24,unit:`Zo`,long:`zettaoctets`},{from:1e24,to:1e27,unit:`Yo`,long:`yottaoctets`}],iec:[{from:0,to:1024**1,unit:`B`,long:`bytes`},{from:1024**1,to:1024**2,unit:`KiB`,long:`kibibytes`},{from:1024**2,to:1024**3,unit:`MiB`,long:`mebibytes`},{from:1024**3,to:1024**4,unit:`GiB`,long:`gibibytes`},{from:1024**4,to:1024**5,unit:`TiB`,long:`tebibytes`},{from:1024**5,to:1024**6,unit:`PiB`,long:`pebibytes`},{from:1024**6,to:1024**7,unit:`EiB`,long:`exbibytes`},{from:1024**7,to:1024**8,unit:`ZiB`,long:`zebibytes`},{from:1024**8,to:1024**9,unit:`YiB`,long:`yobibytes`}],iec_octet:[{from:0,to:1024**1,unit:`o`,long:`octets`},{from:1024**1,to:1024**2,unit:`Kio`,long:`kibioctets`},{from:1024**2,to:1024**3,unit:`Mio`,long:`mebioctets`},{from:1024**3,to:1024**4,unit:`Gio`,long:`gibioctets`},{from:1024**4,to:1024**5,unit:`Tio`,long:`tebioctets`},{from:1024**5,to:1024**6,unit:`Pio`,long:`pebioctets`},{from:1024**6,to:1024**7,unit:`Eio`,long:`exbioctets`},{from:1024**7,to:1024**8,unit:`Zio`,long:`zebioctets`},{from:1024**8,to:1024**9,unit:`Yio`,long:`yobioctets`}]},L=class{constructor(e,t){t=Object.assign({units:`metric`,precision:1,locale:void 0},P,t),F.set(this,t),Object.assign(I,t.customUnits);let n=e<0?`-`:``;e=Math.abs(e);let r=I[t.units];if(r){let i=r.find(t=>e>=t.from&&e<t.to);if(i){let r=new Intl.NumberFormat(t.locale,{style:`decimal`,maximumFractionDigits:t.precision});this.value=i.from===0?n+r.format(e):n+r.format(e/i.from),this.unit=i.unit,this.long=i.long}else this.value=n+e,this.unit=``,this.long=``}else throw Error(`Invalid units specified: ${t.units}`)}toString(){let e=F.get(this);return e.toStringFn?e.toStringFn.bind(this)():`${this.value} ${this.unit}`}};function R(e,t){return new L(e,t)}R.defaultOptions=function(e){P=e};var z=R;function B(){let e=g(),[t,n]=C(T);return{path:t.path??e.repo.repositoryPath,setPath:(0,j.useCallback)(e=>n(t=>({...t,path:e})),[n])}}const V=r(function(){return(0,M.jsx)(`div`,{children:`Loading...`})});var H=2;function U(e){if(!e)return!1;for(let{contribs:t}of e)if(t>0)return!0;return!1}var W=u(function(){let{setPath:t}=B(),{path:r,authorDistributionPromise:i}=e(),l=g(),{state:u}=n(),d=o(),f=x(),m=d.state?.clickedObject,v=E(),[S]=C(T),w=d.pathname+O({...S,zoomPath:r});if((0,j.useEffect)(()=>{v(!!m)},[m,v]),!m)return(0,M.jsx)(`p`,{className:`p-4`,children:`No file or folder selected`});let k=l.databaseInfo.commitCounts[r],N=m.type===`blob`,P=h(m.name.split(`.`));return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(A,{}),(0,M.jsxs)(`div`,{className:`flex grow flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1`,children:[N?(0,M.jsx)(K,{}):null,N?(0,M.jsx)(q,{count:k??0}):null,N?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(X,{size:m.sizeInBytes,isBinary:!1}),(0,M.jsx)(J,{epoch:l.databaseInfo.lastChanged[r]})]}):(0,M.jsx)(Z,{clickedTree:m}),(0,M.jsx)(Y,{path:m.path})]}),(0,M.jsx)(`div`,{className:`card`,children:(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(`p`,{children:`Loading authors...`}),children:(0,M.jsx)(s,{resolve:i,children:e=>(0,M.jsx)(G,{authorDistribution:e})})})})]}),(0,M.jsx)(D,{}),(0,M.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,M.jsxs)(c,{className:`btn`,to:w,children:[(0,M.jsx)(_,{path:p}),`Zoom to this `,N?`file`:`folder`]}),N?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(a,{className:`w-max`,method:`post`,action:f,children:[(0,M.jsx)(`input`,{type:`hidden`,name:`hide`,value:m.path}),(0,M.jsxs)(`button`,{className:`btn`,disabled:u!==`idle`,title:`Hide this file`,children:[(0,M.jsx)(_,{path:b}),`Hide`]})]}),m.name.includes(`.`)?(0,M.jsxs)(a,{className:`w-max`,method:`post`,action:f,children:[(0,M.jsx)(`input`,{type:`hidden`,name:`hide`,value:`*.${P}`}),(0,M.jsxs)(`button`,{className:`btn`,disabled:u!==`idle`,title:`Hide all files with .${P} extension`,children:[(0,M.jsx)(_,{path:b}),(0,M.jsxs)(`span`,{children:[`Hide *.`,P]})]})]}):null]}):(0,M.jsxs)(a,{method:`post`,action:f,children:[(0,M.jsx)(`input`,{type:`hidden`,name:`hide`,value:m.path}),(0,M.jsxs)(`button`,{className:`btn`,disabled:u!==`idle`,onClick:()=>{t(y(r))},children:[(0,M.jsx)(_,{path:b}),`Hide this folder`]})]})]})]})});function G({authorDistribution:e}){let t=(0,j.useId)(),[n,r]=(0,j.useState)(!0),i=(e?.length??0)>H+1,a=e?e.reduce((e,t)=>e+t.contribs,0):0;return(0,M.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex justify-between ${i?`hover:text-secondary-text dark:hover:text-secondary-text-dark cursor-pointer`:``}`,children:[(0,M.jsx)(`label`,{className:`label grow`,htmlFor:t,children:(0,M.jsx)(`h3`,{className:`font-bold`,children:`Author distribution`})}),i?(0,M.jsx)(v,{id:t,open:!n,onClick:()=>r(!n)}):null]}),(0,M.jsx)(`div`,{className:`grid grid-cols-[1fr_auto] items-center justify-center gap-1`,children:i?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(N,{show:!0,items:e.slice(0,H),contribSum:a}),(0,M.jsx)(N,{show:!n,items:e.slice(H),contribSum:a}),n?(0,M.jsxs)(`button`,{className:`cursor-pointer text-left text-xs opacity-70 hover:opacity-100`,onClick:()=>r(!n),children:[`+ `,(e?.slice(H)??[]).length,` more`]}):null]}):(0,M.jsx)(M.Fragment,{children:(e??[]).length>0&&U(e)?(0,M.jsx)(N,{show:!0,items:e??[],contribSum:a}):(0,M.jsx)(`p`,{children:`No authors found`})})})]})}function K(){let{clickedObject:e}=k();return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:`flex grow items-center overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre`,children:`Type`}),(0,M.jsx)(`div`,{className:`flex gap-1 text-sm`,children:e?w(e.path):`N/A`})]})}function q(e){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:`flex grow items-center overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre`,children:`Commits`}),(0,M.jsx)(`p`,{className:`text-sm break-all`,children:e.count??`unknown`})]})}function J(e){return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:`flex grow items-center overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre`,children:`Last changed`}),(0,M.jsx)(`p`,{className:`text-sm break-all`,children:e.epoch?S(e.epoch):`unknown`})]})}function Y(e){let{state:t}=n(),{clickedObject:r}=k(),i=x();return r?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:`flex grow items-center overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre`,children:`Located at`}),(0,M.jsxs)(`div`,{className:`grid grid-cols-[1fr_auto] items-center justify-between gap-2 text-sm break-all`,children:[(0,M.jsx)(`p`,{className:`truncate`,title:e.path,children:e.path}),(0,M.jsxs)(a,{method:`post`,action:i,children:[(0,M.jsx)(`input`,{type:`hidden`,name:`open`,value:r.path}),(0,M.jsx)(`button`,{className:`btn--icon`,disabled:t!==`idle`,title:r.type===`blob`?`Open file in default app`:`Browse folder in system explorer`,children:(0,M.jsx)(_,{path:m,size:`1.25em`,className:`w-max`})})]})]})]}):null}function X(e){let t=z(e.size??0);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:`flex items-center overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre`,children:`Size`}),(0,M.jsxs)(`p`,{className:`text-sm break-all`,children:[t.value,` `,t.unit,` `,(0,M.jsx)(`span`,{className:`opacity-50`,children:e.isBinary?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`br`,{}),`(binary file)`]}):null})]})]})}function Z(e){let t=e.clickedTree.children.filter(e=>e.type===`tree`).length,n=e.clickedTree.children.length-t;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:`flex grow items-center overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre`,children:`Files`}),(0,M.jsx)(`p`,{className:`text-sm break-all`,children:n}),(0,M.jsx)(`div`,{className:`flex grow items-center overflow-hidden text-sm font-semibold text-ellipsis whitespace-pre`,children:`Folders`}),(0,M.jsx)(`p`,{className:`text-sm break-all`,children:t})]})}export{V as HydrateFallback,W as default};