trident-git 0.4.0 → 0.5.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 (196) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +14 -11
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +27 -3
  5. package/.next/routes-manifest.json +18 -0
  6. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  7. package/.next/server/app/_global-error.html +2 -2
  8. package/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/_not-found.html +1 -1
  17. package/.next/server/app/_not-found.rsc +3 -3
  18. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  19. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  21. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  24. package/.next/server/app/api/credentials/route_client-reference-manifest.js +1 -1
  25. package/.next/server/app/api/custom-scripts/route_client-reference-manifest.js +1 -1
  26. package/.next/server/app/api/fs/open/route.js +1 -0
  27. package/.next/server/app/api/fs/open/route.js.nft.json +1 -0
  28. package/.next/server/app/api/fs/open/route_client-reference-manifest.js +1 -0
  29. package/.next/server/app/api/fs/open-terminal/route.js +1 -0
  30. package/.next/server/app/api/fs/open-terminal/route.js.nft.json +1 -0
  31. package/.next/server/app/api/fs/open-terminal/route_client-reference-manifest.js +1 -0
  32. package/.next/server/app/api/fs/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/git/action/route.js +1 -1
  34. package/.next/server/app/api/git/action/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/git/branches/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/git/diff/route.js +1 -1
  37. package/.next/server/app/api/git/diff/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/git/log/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/git/status/route_client-reference-manifest.js +1 -1
  40. package/.next/server/app/api/repos/clone/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/repos/route.js +1 -1
  42. package/.next/server/app/api/repos/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/credentials/page_client-reference-manifest.js +1 -1
  45. package/.next/server/app/credentials.html +1 -1
  46. package/.next/server/app/credentials.rsc +3 -3
  47. package/.next/server/app/credentials.segments/_full.segment.rsc +3 -3
  48. package/.next/server/app/credentials.segments/_head.segment.rsc +1 -1
  49. package/.next/server/app/credentials.segments/_index.segment.rsc +3 -3
  50. package/.next/server/app/credentials.segments/_tree.segment.rsc +2 -2
  51. package/.next/server/app/credentials.segments/credentials/__PAGE__.segment.rsc +1 -1
  52. package/.next/server/app/credentials.segments/credentials.segment.rsc +1 -1
  53. package/.next/server/app/index.html +1 -1
  54. package/.next/server/app/index.rsc +5 -5
  55. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  56. package/.next/server/app/index.segments/_full.segment.rsc +5 -5
  57. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  58. package/.next/server/app/index.segments/_index.segment.rsc +3 -3
  59. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  60. package/.next/server/app/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/workspace/changes/page_client-reference-manifest.js +1 -1
  62. package/.next/server/app/workspace/changes.html +1 -1
  63. package/.next/server/app/workspace/changes.rsc +6 -6
  64. package/.next/server/app/workspace/changes.segments/_full.segment.rsc +6 -6
  65. package/.next/server/app/workspace/changes.segments/_head.segment.rsc +1 -1
  66. package/.next/server/app/workspace/changes.segments/_index.segment.rsc +3 -3
  67. package/.next/server/app/workspace/changes.segments/_tree.segment.rsc +2 -2
  68. package/.next/server/app/workspace/changes.segments/workspace/changes/__PAGE__.segment.rsc +2 -2
  69. package/.next/server/app/workspace/changes.segments/workspace/changes.segment.rsc +1 -1
  70. package/.next/server/app/workspace/changes.segments/workspace.segment.rsc +3 -3
  71. package/.next/server/app/workspace/conflicts/page.js +2 -0
  72. package/.next/server/app/workspace/conflicts/page.js.nft.json +1 -0
  73. package/.next/server/app/workspace/conflicts/page_client-reference-manifest.js +1 -0
  74. package/.next/server/app/workspace/conflicts.html +1 -0
  75. package/.next/server/app/workspace/conflicts.meta +16 -0
  76. package/.next/server/app/workspace/conflicts.rsc +26 -0
  77. package/.next/server/app/workspace/conflicts.segments/_full.segment.rsc +26 -0
  78. package/.next/server/app/workspace/conflicts.segments/_head.segment.rsc +6 -0
  79. package/.next/server/app/workspace/conflicts.segments/_index.segment.rsc +8 -0
  80. package/.next/server/app/workspace/conflicts.segments/_tree.segment.rsc +7 -0
  81. package/.next/server/app/workspace/conflicts.segments/workspace/conflicts/__PAGE__.segment.rsc +10 -0
  82. package/.next/server/app/workspace/conflicts.segments/workspace/conflicts.segment.rsc +4 -0
  83. package/.next/server/app/workspace/conflicts.segments/workspace.segment.rsc +7 -0
  84. package/.next/server/app/workspace/custom-scripts/page_client-reference-manifest.js +1 -1
  85. package/.next/server/app/workspace/custom-scripts.html +1 -1
  86. package/.next/server/app/workspace/custom-scripts.rsc +6 -6
  87. package/.next/server/app/workspace/custom-scripts.segments/_full.segment.rsc +6 -6
  88. package/.next/server/app/workspace/custom-scripts.segments/_head.segment.rsc +1 -1
  89. package/.next/server/app/workspace/custom-scripts.segments/_index.segment.rsc +3 -3
  90. package/.next/server/app/workspace/custom-scripts.segments/_tree.segment.rsc +2 -2
  91. package/.next/server/app/workspace/custom-scripts.segments/workspace/custom-scripts/__PAGE__.segment.rsc +2 -2
  92. package/.next/server/app/workspace/custom-scripts.segments/workspace/custom-scripts.segment.rsc +1 -1
  93. package/.next/server/app/workspace/custom-scripts.segments/workspace.segment.rsc +3 -3
  94. package/.next/server/app/workspace/history/page.js +2 -2
  95. package/.next/server/app/workspace/history/page.js.nft.json +1 -1
  96. package/.next/server/app/workspace/history/page_client-reference-manifest.js +1 -1
  97. package/.next/server/app/workspace/history.html +1 -1
  98. package/.next/server/app/workspace/history.rsc +6 -6
  99. package/.next/server/app/workspace/history.segments/_full.segment.rsc +6 -6
  100. package/.next/server/app/workspace/history.segments/_head.segment.rsc +1 -1
  101. package/.next/server/app/workspace/history.segments/_index.segment.rsc +3 -3
  102. package/.next/server/app/workspace/history.segments/_tree.segment.rsc +2 -2
  103. package/.next/server/app/workspace/history.segments/workspace/history/__PAGE__.segment.rsc +2 -2
  104. package/.next/server/app/workspace/history.segments/workspace/history.segment.rsc +1 -1
  105. package/.next/server/app/workspace/history.segments/workspace.segment.rsc +3 -3
  106. package/.next/server/app/workspace/page.js +1 -1
  107. package/.next/server/app/workspace/page.js.nft.json +1 -1
  108. package/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
  109. package/.next/server/app/workspace/settings/page_client-reference-manifest.js +1 -1
  110. package/.next/server/app/workspace/settings.html +1 -1
  111. package/.next/server/app/workspace/settings.rsc +6 -6
  112. package/.next/server/app/workspace/settings.segments/_full.segment.rsc +6 -6
  113. package/.next/server/app/workspace/settings.segments/_head.segment.rsc +1 -1
  114. package/.next/server/app/workspace/settings.segments/_index.segment.rsc +3 -3
  115. package/.next/server/app/workspace/settings.segments/_tree.segment.rsc +2 -2
  116. package/.next/server/app/workspace/settings.segments/workspace/settings/__PAGE__.segment.rsc +2 -2
  117. package/.next/server/app/workspace/settings.segments/workspace/settings.segment.rsc +1 -1
  118. package/.next/server/app/workspace/settings.segments/workspace.segment.rsc +3 -3
  119. package/.next/server/app/workspace/stashes/page_client-reference-manifest.js +1 -1
  120. package/.next/server/app/workspace/stashes.html +1 -1
  121. package/.next/server/app/workspace/stashes.rsc +6 -6
  122. package/.next/server/app/workspace/stashes.segments/_full.segment.rsc +6 -6
  123. package/.next/server/app/workspace/stashes.segments/_head.segment.rsc +1 -1
  124. package/.next/server/app/workspace/stashes.segments/_index.segment.rsc +3 -3
  125. package/.next/server/app/workspace/stashes.segments/_tree.segment.rsc +2 -2
  126. package/.next/server/app/workspace/stashes.segments/workspace/stashes/__PAGE__.segment.rsc +2 -2
  127. package/.next/server/app/workspace/stashes.segments/workspace/stashes.segment.rsc +1 -1
  128. package/.next/server/app/workspace/stashes.segments/workspace.segment.rsc +3 -3
  129. package/.next/server/app/workspace.html +1 -1
  130. package/.next/server/app/workspace.rsc +6 -6
  131. package/.next/server/app/workspace.segments/_full.segment.rsc +6 -6
  132. package/.next/server/app/workspace.segments/_head.segment.rsc +1 -1
  133. package/.next/server/app/workspace.segments/_index.segment.rsc +3 -3
  134. package/.next/server/app/workspace.segments/_tree.segment.rsc +2 -2
  135. package/.next/server/app/workspace.segments/workspace/__PAGE__.segment.rsc +2 -2
  136. package/.next/server/app/workspace.segments/workspace.segment.rsc +3 -3
  137. package/.next/server/app-paths-manifest.json +14 -11
  138. package/.next/server/chunks/386.js +1 -1
  139. package/.next/server/chunks/392.js +1 -1
  140. package/.next/server/chunks/471.js +4 -4
  141. package/.next/server/chunks/557.js +4 -4
  142. package/.next/server/chunks/725.js +7 -0
  143. package/.next/server/chunks/946.js +1 -1
  144. package/.next/server/pages/404.html +1 -1
  145. package/.next/server/pages/500.html +2 -2
  146. package/.next/server/server-reference-manifest.json +1 -1
  147. package/.next/static/VVpGnBxPAXMCVjOD1KoU3/_buildManifest.js +1 -0
  148. package/.next/static/chunks/26-a76b3447d31c0f53.js +1 -0
  149. package/.next/static/chunks/446-c08c83aa2f787ad4.js +8 -0
  150. package/.next/static/chunks/app/_global-error/page-2c17ff49390f8b16.js +1 -0
  151. package/.next/static/chunks/app/api/credentials/route-2c17ff49390f8b16.js +1 -0
  152. package/.next/static/chunks/app/api/custom-scripts/route-2c17ff49390f8b16.js +1 -0
  153. package/.next/static/chunks/app/api/fs/open/route-2c17ff49390f8b16.js +1 -0
  154. package/.next/static/chunks/app/api/fs/open-terminal/route-2c17ff49390f8b16.js +1 -0
  155. package/.next/static/chunks/app/api/fs/route-2c17ff49390f8b16.js +1 -0
  156. package/.next/static/chunks/app/api/git/action/route-2c17ff49390f8b16.js +1 -0
  157. package/.next/static/chunks/app/api/git/branches/route-2c17ff49390f8b16.js +1 -0
  158. package/.next/static/chunks/app/api/git/diff/route-2c17ff49390f8b16.js +1 -0
  159. package/.next/static/chunks/app/api/git/log/route-2c17ff49390f8b16.js +1 -0
  160. package/.next/static/chunks/app/api/git/status/route-2c17ff49390f8b16.js +1 -0
  161. package/.next/static/chunks/app/api/repos/clone/route-2c17ff49390f8b16.js +1 -0
  162. package/.next/static/chunks/app/api/repos/route-2c17ff49390f8b16.js +1 -0
  163. package/.next/static/chunks/app/api/settings/route-2c17ff49390f8b16.js +1 -0
  164. package/.next/static/chunks/app/workspace/conflicts/page-4e3388cbfeb080ce.js +1 -0
  165. package/.next/static/chunks/app/workspace/history/{page-89bfc9747faed53b.js → page-023ae7cc39ee9664.js} +1 -1
  166. package/.next/static/chunks/app/workspace/layout-586ee7be4f6abf20.js +1 -0
  167. package/.next/static/chunks/app/workspace/{page-2b043ff528917d81.js → page-f7b05714b4e0eb2a.js} +1 -1
  168. package/.next/static/chunks/next/dist/client/components/builtin/app-error-2c17ff49390f8b16.js +1 -0
  169. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-2c17ff49390f8b16.js +1 -0
  170. package/.next/static/chunks/next/dist/client/components/builtin/not-found-2c17ff49390f8b16.js +1 -0
  171. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2c17ff49390f8b16.js +1 -0
  172. package/.next/static/css/{c4117eb58c7d0642.css → c4d257db89c36a31.css} +1 -1
  173. package/README.md +2 -0
  174. package/package.json +1 -1
  175. package/.next/server/chunks/739.js +0 -7
  176. package/.next/static/IsI_X7X1cKXUpjpCKYBiv/_buildManifest.js +0 -1
  177. package/.next/static/chunks/147-64f7ae9eceb783be.js +0 -8
  178. package/.next/static/chunks/26-71a5a763fed8540a.js +0 -1
  179. package/.next/static/chunks/app/_global-error/page-10b66af9ca2c453f.js +0 -1
  180. package/.next/static/chunks/app/api/credentials/route-10b66af9ca2c453f.js +0 -1
  181. package/.next/static/chunks/app/api/custom-scripts/route-10b66af9ca2c453f.js +0 -1
  182. package/.next/static/chunks/app/api/fs/route-10b66af9ca2c453f.js +0 -1
  183. package/.next/static/chunks/app/api/git/action/route-10b66af9ca2c453f.js +0 -1
  184. package/.next/static/chunks/app/api/git/branches/route-10b66af9ca2c453f.js +0 -1
  185. package/.next/static/chunks/app/api/git/diff/route-10b66af9ca2c453f.js +0 -1
  186. package/.next/static/chunks/app/api/git/log/route-10b66af9ca2c453f.js +0 -1
  187. package/.next/static/chunks/app/api/git/status/route-10b66af9ca2c453f.js +0 -1
  188. package/.next/static/chunks/app/api/repos/clone/route-10b66af9ca2c453f.js +0 -1
  189. package/.next/static/chunks/app/api/repos/route-10b66af9ca2c453f.js +0 -1
  190. package/.next/static/chunks/app/api/settings/route-10b66af9ca2c453f.js +0 -1
  191. package/.next/static/chunks/app/workspace/layout-75643230bfa68574.js +0 -1
  192. package/.next/static/chunks/next/dist/client/components/builtin/app-error-10b66af9ca2c453f.js +0 -1
  193. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-10b66af9ca2c453f.js +0 -1
  194. package/.next/static/chunks/next/dist/client/components/builtin/not-found-10b66af9ca2c453f.js +0 -1
  195. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-10b66af9ca2c453f.js +0 -1
  196. /package/.next/static/{IsI_X7X1cKXUpjpCKYBiv → VVpGnBxPAXMCVjOD1KoU3}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- exports.id=386,exports.ids=[386],exports.modules={2597:(a,b,c)=>{Promise.resolve().then(c.bind(c,5229)),Promise.resolve().then(c.bind(c,3246))},3246:(a,b,c)=>{"use strict";c.d(b,{WorkspaceRepoOpenTracker:()=>g});var d=c(7484),e=c(9099),f=c(4626);function g(){(0,e.usePathname)(),(0,e.useSearchParams)().get("path");let{data:a}=(0,f.uG)();return(0,f.Lp)(),(0,d.useRef)(null),null}},4528:(a,b,c)=>{"use strict";let d,e;c.d(b,{Ck:()=>p,Ir:()=>q,NV:()=>n,Xx:()=>u,cZ:()=>v,jD:()=>r,mt:()=>t});var f=c(9021),g=c.n(f),h=c(1820),i=c.n(h),j=c(3873),k=c.n(j);let l=(d=process.platform,e=i().homedir(),"win32"===d?k().join(process.env.APPDATA||k().join(e,"AppData","Roaming"),"trident"):"darwin"===d?k().join(e,"Library","Application Support","trident"):k().join(process.env.XDG_CONFIG_HOME||k().join(e,".config"),"trident")),m=k().join(l,"repos.json");function n(){if(!g().existsSync(m))return[];try{let a=g().readFileSync(m,"utf-8");return JSON.parse(a)}catch(a){return console.error("Failed to parse repos.json",a),[]}}function o(a){if(void 0===a)return;if(null===a)return null;let b=a.trim();return b.length>0?b:null}function p(a,b,c){let d=n();if(d.find(b=>b.path===a))throw Error("Repository already exists");let e=o(c),f={path:a,name:b||k().basename(a),...e?{displayName:e}:{}};return d.push(f),g().writeFileSync(m,JSON.stringify(d,null,2)),f}function q(a,b){let c=n(),d=c.findIndex(b=>b.path===a);if(-1===d)throw Error("Repository not found");let e={...b};"displayName"in e&&(e.displayName=o(e.displayName));let f={...c[d],...e};return c[d]=f,g().writeFileSync(m,JSON.stringify(c,null,2)),f}function r(a,b){let{deleteLocalFolder:c=!1}=b||{};if(c){let b=k().resolve(a),c=k().parse(b).root;if(b===c)throw Error("Refusing to delete a filesystem root path");g().rmSync(b,{recursive:!0,force:!0})}let d=n();d=d.filter(b=>b.path!==a),g().writeFileSync(m,JSON.stringify(d,null,2))}g().existsSync(l)||g().mkdirSync(l,{recursive:!0});let s=k().join(l,"settings.json");function t(){let a={defaultRootFolder:null,sidebarCollapsed:!1};if(!g().existsSync(s))return a;try{let b=g().readFileSync(s,"utf-8"),c=JSON.parse(b);return{...a,...c}}catch(b){return console.error("Failed to parse settings.json",b),a}}function u(a){let b={...t(),...a};return g().writeFileSync(s,JSON.stringify(b,null,2)),b}function v(){let a=t();if(a.defaultRootFolder)try{if(g().existsSync(a.defaultRootFolder)&&g().statSync(a.defaultRootFolder).isDirectory())return a.defaultRootFolder}catch{}return i().homedir()}},4763:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>i});var d=c(5735),e=c(9671),f=c(1986),g=c(6920),h=c(4528);function i({children:a}){let b=(0,h.mt)().sidebarCollapsed??!1;return(0,d.jsxs)("div",{className:"flex min-h-screen max-h-screen bg-base-100",children:[(0,d.jsx)(f.Suspense,{fallback:null,children:(0,d.jsx)(g.WorkspaceRepoOpenTracker,{})}),(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("div",{className:`${b?"w-16":"w-64"} border-r border-base-300 min-h-screen bg-base-200/30 flex items-center justify-center`,children:(0,d.jsx)("span",{className:"loading loading-spinner"})}),children:(0,d.jsx)(e.Sidebar,{initialCollapsed:b})}),(0,d.jsx)("main",{className:"flex-1 overflow-auto",children:a})]})}},5229:(a,b,c)=>{"use strict";c.d(b,{Sidebar:()=>l});var d=c(8249),e=c(4490),f=c(2116),g=c.n(f),h=c(781),i=c(9099),j=c(7484),k=c(4626);function l({className:a,initialCollapsed:b=!1}){let c=(0,i.usePathname)(),f=(0,i.useSearchParams)(),l=(0,i.useRouter)(),m=f.get("path")||"",n=(0,k.GK)(m||null),[o,p]=(0,j.useState)(b),[q,r]=(0,j.useState)(!1),[s,t]=(0,j.useState)(!1),u=(0,k.Y5)(),{data:v}=(0,k.en)(m||null),w=v?.files?.length??0,x=n?(0,e.iu)(n):m?(0,e.kj)(m):"",y=(0,j.useCallback)(()=>{let a=!o;p(a),u.mutate({sidebarCollapsed:a})},[o,u]),z=(a="")=>{let b=new URLSearchParams(f.toString());return b.delete("tab"),`/workspace${a}?${b.toString()}`},A=a=>"status"===a?"/workspace/changes"===c:"history"===a?"/workspace"===c||c.startsWith("/workspace/history"):"custom-scripts"===a?c.startsWith("/workspace/custom-scripts"):"settings"===a?c.startsWith("/workspace/settings"):"stashes"===a&&c.startsWith("/workspace/stashes"),B=o?64:256;return(0,d.jsxs)("div",{style:{width:B},className:(0,e.cn)("pb-12 border-r border-base-300 min-h-screen bg-base-100 relative",q&&"transition-all duration-300",a),children:[(0,d.jsx)("div",{className:"space-y-4 py-4",children:(0,d.jsxs)("div",{className:(0,e.cn)("px-3 py-2",o&&"px-2"),children:[(0,d.jsxs)("div",{className:(0,e.cn)("mb-6 flex items-center",o?"flex-col gap-2 px-0":"justify-between px-4"),children:[!o&&(0,d.jsxs)("a",{href:"/",onClick:a=>{a.metaKey||a.ctrlKey||(a.preventDefault(),l.push("/"))},className:"flex items-center gap-2 hover:opacity-80 transition-opacity cursor-pointer text-base-content overflow-hidden",title:x?`${x} - Go to Home`:"Go to Home",children:[(0,d.jsx)("img",{src:"/icon.png",alt:"Trident",className:"h-5 w-5 flex-shrink-0"}),(0,d.jsx)("h2",{className:"text-lg font-bold tracking-tight truncate",children:x||"Trident"})]}),o&&(0,d.jsx)("a",{href:"/",onClick:a=>{a.metaKey||a.ctrlKey||(a.preventDefault(),l.push("/"))},className:"flex items-center justify-center h-8 w-8 hover:opacity-80 transition-opacity cursor-pointer",title:x?`${x} - Go to Home`:"Go to Home",children:(0,d.jsx)("img",{src:"/icon.png",alt:x||"Trident",className:"h-5 w-5"})}),(0,d.jsx)("div",{className:(0,e.cn)("flex items-center gap-1",o&&"flex-col"),children:(0,d.jsx)("button",{className:"btn btn-ghost btn-sm btn-square",onClick:y,title:o?"Expand sidebar":"Collapse sidebar",children:o?(0,d.jsx)("i",{className:"iconoir-fast-arrow-right text-[16px]","aria-hidden":"true"}):(0,d.jsx)("i",{className:"iconoir-fast-arrow-left text-[16px]","aria-hidden":"true"})})})]}),!o&&m&&(0,d.jsx)("div",{className:"px-4 mb-6",children:(0,d.jsx)("p",{className:"text-[10px] font-mono opacity-60 break-all border border-base-300 rounded p-2 bg-base-200/30",title:m,children:m})}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsxs)(g(),{href:z(),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",A("history")&&"btn-active font-medium"),title:o?"History":void 0,children:[(0,d.jsx)("i",{className:(0,e.cn)("iconoir-git-fork text-[20px]",!o&&"mr-2"),"aria-hidden":"true"}),!o&&"History"]}),(0,d.jsxs)(g(),{href:z("/changes"),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",A("status")&&"btn-active font-medium"),title:o?`Changes${w>0?` (${w})`:""}`:void 0,children:[(0,d.jsxs)("div",{className:(0,e.cn)("relative flex items-center",!o&&"mr-2"),children:[(0,d.jsx)("i",{className:"iconoir-clock text-[20px]","aria-hidden":"true"}),o&&w>0&&(0,d.jsx)("span",{className:"absolute -top-1 -right-1 badge badge-primary badge-xs scale-75",children:w>99?"99+":w})]}),!o&&(0,d.jsxs)("span",{className:"flex-1 flex justify-between items-center",children:["Changes",w>0&&(0,d.jsx)("span",{className:"badge badge-sm",children:w})]})]}),(0,d.jsxs)(g(),{href:z("/stashes"),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",A("stashes")&&"btn-active font-medium"),title:o?"Stashes":void 0,children:[(0,d.jsx)("i",{className:(0,e.cn)("iconoir-download-square text-[20px]",!o&&"mr-2"),"aria-hidden":"true"}),!o&&"Stashes"]}),(0,d.jsxs)(g(),{href:z("/custom-scripts"),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",A("custom-scripts")&&"btn-active font-medium"),title:o?"Custom scripts":void 0,children:[(0,d.jsx)("i",{className:(0,e.cn)("iconoir-terminal text-[20px]",!o&&"mr-2"),"aria-hidden":"true"}),!o&&"Custom scripts"]}),(0,d.jsxs)(g(),{href:z("/settings"),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",A("settings")&&"btn-active font-medium"),title:o?"Settings":void 0,children:[(0,d.jsx)("i",{className:(0,e.cn)("iconoir-settings text-[20px]",!o&&"mr-2"),"aria-hidden":"true"}),!o&&"Settings"]})]})]})}),(0,d.jsx)("div",{className:(0,e.cn)("absolute bottom-4 left-0 w-full",o?"px-2":"px-6"),children:(0,d.jsxs)("div",{className:(0,e.cn)("flex items-center",o?"justify-center":"gap-2"),children:[(0,d.jsx)("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>t(!0),title:o?"Preferences":void 0,children:(0,d.jsx)("i",{className:"iconoir-ios-settings text-[20px]","aria-hidden":"true"})}),!o&&(0,d.jsx)("span",{className:"text-xs opacity-70",children:"Preferences"})]})}),(0,d.jsx)(h.g,{open:s,onOpenChange:t})]})}},6920:(a,b,c)=>{"use strict";c.d(b,{WorkspaceRepoOpenTracker:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call WorkspaceRepoOpenTracker() from the server but WorkspaceRepoOpenTracker is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/tangqh/Downloads/projects/trident/src/components/workspace-repo-open-tracker.tsx","WorkspaceRepoOpenTracker")},7536:(a,b,c)=>{"use strict";c.d(b,{J:()=>e}),c(7484);var d=c(4626);function e(a,b){(0,d.GK)(a)}c(4490)},8677:(a,b,c)=>{Promise.resolve().then(c.bind(c,9671)),Promise.resolve().then(c.bind(c,6920))},9671:(a,b,c)=>{"use strict";c.d(b,{Sidebar:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/tangqh/Downloads/projects/trident/src/components/layout/sidebar.tsx","Sidebar")}};
1
+ exports.id=386,exports.ids=[386],exports.modules={2597:(a,b,c)=>{Promise.resolve().then(c.bind(c,5229)),Promise.resolve().then(c.bind(c,3246))},3246:(a,b,c)=>{"use strict";c.d(b,{WorkspaceRepoOpenTracker:()=>g});var d=c(7484),e=c(9099),f=c(4626);function g(){(0,e.usePathname)(),(0,e.useSearchParams)().get("path");let{data:a}=(0,f.uG)();return(0,f.Lp)(),(0,d.useRef)(null),null}},4528:(a,b,c)=>{"use strict";let d,e;c.d(b,{Ck:()=>p,Ir:()=>q,NV:()=>n,Xx:()=>u,cZ:()=>v,jD:()=>r,mt:()=>t});var f=c(9021),g=c.n(f),h=c(1820),i=c.n(h),j=c(3873),k=c.n(j);let l=(d=process.platform,e=i().homedir(),"win32"===d?k().join(process.env.APPDATA||k().join(e,"AppData","Roaming"),"trident"):"darwin"===d?k().join(e,"Library","Application Support","trident"):k().join(process.env.XDG_CONFIG_HOME||k().join(e,".config"),"trident")),m=k().join(l,"repos.json");function n(){if(!g().existsSync(m))return[];try{let a=g().readFileSync(m,"utf-8");return JSON.parse(a)}catch(a){return console.error("Failed to parse repos.json",a),[]}}function o(a){if(void 0===a)return;if(null===a)return null;let b=a.trim();return b.length>0?b:null}function p(a,b,c){let d=n();if(d.find(b=>b.path===a))throw Error("Repository already exists");let e=o(c),f={path:a,name:b||k().basename(a),...e?{displayName:e}:{}};return d.push(f),g().writeFileSync(m,JSON.stringify(d,null,2)),f}function q(a,b){let c=n(),d=c.findIndex(b=>b.path===a);if(-1===d)throw Error("Repository not found");let e={...b};"displayName"in e&&(e.displayName=o(e.displayName));let f={...c[d],...e};return c[d]=f,g().writeFileSync(m,JSON.stringify(c,null,2)),f}function r(a,b){let{deleteLocalFolder:c=!1}=b||{};if(c){let b=k().resolve(a),c=k().parse(b).root;if(b===c)throw Error("Refusing to delete a filesystem root path");g().rmSync(b,{recursive:!0,force:!0})}let d=n();d=d.filter(b=>b.path!==a),g().writeFileSync(m,JSON.stringify(d,null,2))}g().existsSync(l)||g().mkdirSync(l,{recursive:!0});let s=k().join(l,"settings.json");function t(){let a={defaultRootFolder:null,sidebarCollapsed:!1};if(!g().existsSync(s))return a;try{let b=g().readFileSync(s,"utf-8"),c=JSON.parse(b);return{...a,...c}}catch(b){return console.error("Failed to parse settings.json",b),a}}function u(a){let b={...t(),...a};return g().writeFileSync(s,JSON.stringify(b,null,2)),b}function v(){let a=t();if(a.defaultRootFolder)try{if(g().existsSync(a.defaultRootFolder)&&g().statSync(a.defaultRootFolder).isDirectory())return a.defaultRootFolder}catch{}return i().homedir()}},4763:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>i});var d=c(5735),e=c(9671),f=c(1986),g=c(6920),h=c(4528);function i({children:a}){let b=(0,h.mt)().sidebarCollapsed??!1;return(0,d.jsxs)("div",{className:"flex min-h-screen max-h-screen bg-base-100",children:[(0,d.jsx)(f.Suspense,{fallback:null,children:(0,d.jsx)(g.WorkspaceRepoOpenTracker,{})}),(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("div",{className:`${b?"w-16":"w-64"} border-r border-base-300 min-h-screen bg-base-200/30 flex items-center justify-center`,children:(0,d.jsx)("span",{className:"loading loading-spinner"})}),children:(0,d.jsx)(e.Sidebar,{initialCollapsed:b})}),(0,d.jsx)("main",{className:"flex-1 overflow-auto",children:a})]})}},5229:(a,b,c)=>{"use strict";c.d(b,{Sidebar:()=>l});var d=c(8249),e=c(4490),f=c(2116),g=c.n(f),h=c(781),i=c(9099),j=c(7484),k=c(4626);function l({className:a,initialCollapsed:b=!1}){let c=(0,i.usePathname)(),f=(0,i.useSearchParams)(),l=(0,i.useRouter)(),m=f.get("path")||"",n=(0,k.GK)(m||null),[o,p]=(0,j.useState)(b),[q,r]=(0,j.useState)(!1),[s,t]=(0,j.useState)(!1),u=(0,k.Y5)(),{data:v}=(0,k.en)(m||null),w=v?.files?.length??0,x=v?.conflicted?.length??0,y=v?.current?.trim(),z=n?(0,e.iu)(n):m?(0,e.kj)(m):"",A=(0,j.useCallback)(()=>{let a=!o;p(a),u.mutate({sidebarCollapsed:a})},[o,u]),B=(a="")=>{let b=new URLSearchParams(f.toString());return b.delete("tab"),m&&y?b.set("branch",y):m||b.delete("branch"),`/workspace${a}?${b.toString()}`},C=a=>"status"===a?"/workspace/changes"===c:"history"===a?"/workspace"===c||c.startsWith("/workspace/history"):"conflicts"===a?c.startsWith("/workspace/conflicts"):"custom-scripts"===a?c.startsWith("/workspace/custom-scripts"):"settings"===a?c.startsWith("/workspace/settings"):"stashes"===a&&c.startsWith("/workspace/stashes"),D=o?64:256;return(0,d.jsxs)("div",{style:{width:D},className:(0,e.cn)("pb-12 border-r border-base-300 min-h-screen bg-base-100 relative",q&&"transition-all duration-300",a),children:[(0,d.jsx)("div",{className:"space-y-4 py-4",children:(0,d.jsxs)("div",{className:(0,e.cn)("px-3 py-2",o&&"px-2"),children:[(0,d.jsxs)("div",{className:(0,e.cn)("mb-6 flex items-center",o?"flex-col gap-2 px-0":"justify-between px-4"),children:[!o&&(0,d.jsxs)("a",{href:"/",onClick:a=>{a.metaKey||a.ctrlKey||(a.preventDefault(),l.push("/"))},className:"flex items-center gap-2 hover:opacity-80 transition-opacity cursor-pointer text-base-content overflow-hidden",title:z?`${z} - Go to Home`:"Go to Home",children:[(0,d.jsx)("img",{src:"/icon.png",alt:"Trident",className:"h-5 w-5 flex-shrink-0"}),(0,d.jsx)("h2",{className:"text-lg font-bold tracking-tight truncate",children:z||"Trident"})]}),o&&(0,d.jsx)("a",{href:"/",onClick:a=>{a.metaKey||a.ctrlKey||(a.preventDefault(),l.push("/"))},className:"flex items-center justify-center h-8 w-8 hover:opacity-80 transition-opacity cursor-pointer",title:z?`${z} - Go to Home`:"Go to Home",children:(0,d.jsx)("img",{src:"/icon.png",alt:z||"Trident",className:"h-5 w-5"})}),(0,d.jsx)("div",{className:(0,e.cn)("flex items-center gap-1",o&&"flex-col"),children:(0,d.jsx)("button",{className:"btn btn-ghost btn-sm btn-square",onClick:A,title:o?"Expand sidebar":"Collapse sidebar",children:o?(0,d.jsx)("i",{className:"iconoir-fast-arrow-right text-[16px]","aria-hidden":"true"}):(0,d.jsx)("i",{className:"iconoir-fast-arrow-left text-[16px]","aria-hidden":"true"})})})]}),!o&&m&&(0,d.jsx)("div",{className:"px-4 mb-6",children:(0,d.jsx)("p",{className:"text-[10px] font-mono opacity-60 break-all border border-base-300 rounded p-2 bg-base-200/30",title:m,children:m})}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsxs)(g(),{href:B(),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",C("history")&&"btn-active font-medium"),title:o?"History":void 0,children:[(0,d.jsx)("i",{className:(0,e.cn)("iconoir-git-fork text-[20px]",!o&&"mr-2"),"aria-hidden":"true"}),!o&&"History"]}),(0,d.jsxs)(g(),{href:B("/changes"),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",C("status")&&"btn-active font-medium"),title:o?`Changes${w>0?` (${w})`:""}`:void 0,children:[(0,d.jsxs)("div",{className:(0,e.cn)("relative flex items-center",!o&&"mr-2"),children:[(0,d.jsx)("i",{className:"iconoir-clock text-[20px]","aria-hidden":"true"}),o&&w>0&&(0,d.jsx)("span",{className:"absolute -top-1 -right-1 badge badge-primary badge-xs scale-75",children:w>99?"99+":w})]}),!o&&(0,d.jsxs)("span",{className:"flex-1 flex justify-between items-center",children:["Changes",w>0&&(0,d.jsx)("span",{className:"badge badge-sm",children:w})]})]}),(0,d.jsxs)(g(),{href:B("/conflicts"),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",C("conflicts")&&"btn-active font-medium"),title:o?`Conflicts${x>0?` (${x})`:""}`:void 0,children:[(0,d.jsxs)("div",{className:(0,e.cn)("relative flex items-center",!o&&"mr-2"),children:[(0,d.jsx)("i",{className:"iconoir-warning-triangle text-[20px]","aria-hidden":"true"}),o&&x>0&&(0,d.jsx)("span",{className:"absolute -top-1 -right-1 badge badge-error badge-xs scale-75",children:x>99?"99+":x})]}),!o&&(0,d.jsxs)("span",{className:"flex-1 flex justify-between items-center",children:["Conflicts",x>0&&(0,d.jsx)("span",{className:"badge badge-sm badge-error",children:x})]})]}),(0,d.jsxs)(g(),{href:B("/stashes"),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",C("stashes")&&"btn-active font-medium"),title:o?"Stashes":void 0,children:[(0,d.jsx)("i",{className:(0,e.cn)("iconoir-download-square text-[20px]",!o&&"mr-2"),"aria-hidden":"true"}),!o&&"Stashes"]}),(0,d.jsxs)(g(),{href:B("/custom-scripts"),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",C("custom-scripts")&&"btn-active font-medium"),title:o?"Custom scripts":void 0,children:[(0,d.jsx)("i",{className:(0,e.cn)("iconoir-terminal text-[20px]",!o&&"mr-2"),"aria-hidden":"true"}),!o&&"Custom scripts"]}),(0,d.jsxs)(g(),{href:B("/settings"),className:(0,e.cn)("btn btn-ghost w-full justify-start font-normal",o?"px-0 justify-center":"",C("settings")&&"btn-active font-medium"),title:o?"Settings":void 0,children:[(0,d.jsx)("i",{className:(0,e.cn)("iconoir-settings text-[20px]",!o&&"mr-2"),"aria-hidden":"true"}),!o&&"Settings"]})]})]})}),(0,d.jsx)("div",{className:(0,e.cn)("absolute bottom-4 left-0 w-full",o?"px-2":"px-6"),children:(0,d.jsxs)("div",{className:(0,e.cn)("flex items-center",o?"justify-center":"gap-2"),children:[(0,d.jsx)("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>t(!0),title:o?"Preferences":void 0,children:(0,d.jsx)("i",{className:"iconoir-ios-settings text-[20px]","aria-hidden":"true"})}),!o&&(0,d.jsx)("span",{className:"text-xs opacity-70",children:"Preferences"})]})}),(0,d.jsx)(h.g,{open:s,onOpenChange:t})]})}},6920:(a,b,c)=>{"use strict";c.d(b,{WorkspaceRepoOpenTracker:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call WorkspaceRepoOpenTracker() from the server but WorkspaceRepoOpenTracker is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/tangqh/Downloads/projects/trident/src/components/workspace-repo-open-tracker.tsx","WorkspaceRepoOpenTracker")},7536:(a,b,c)=>{"use strict";c.d(b,{J:()=>e}),c(7484);var d=c(4626);function e(a,b){(0,d.GK)(a)}c(4490)},8677:(a,b,c)=>{Promise.resolve().then(c.bind(c,9671)),Promise.resolve().then(c.bind(c,6920))},9671:(a,b,c)=>{"use strict";c.d(b,{Sidebar:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/tangqh/Downloads/projects/trident/src/components/layout/sidebar.tsx","Sidebar")}};