commandmate 0.2.1 → 0.2.3

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 (164) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +47 -51
  3. package/.next/app-path-routes-manifest.json +1 -1
  4. package/.next/build-manifest.json +7 -7
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/cache/config.json +3 -3
  7. package/.next/cache/webpack/client-production/0.pack +0 -0
  8. package/.next/cache/webpack/client-production/1.pack +0 -0
  9. package/.next/cache/webpack/client-production/2.pack +0 -0
  10. package/.next/cache/webpack/client-production/index.pack +0 -0
  11. package/.next/cache/webpack/client-production/index.pack.old +0 -0
  12. package/.next/cache/webpack/edge-server-production/index.pack +0 -0
  13. package/.next/cache/webpack/server-production/0.pack +0 -0
  14. package/.next/cache/webpack/server-production/index.pack +0 -0
  15. package/.next/next-server.js.nft.json +1 -1
  16. package/.next/prerender-manifest.json +1 -1
  17. package/.next/required-server-files.json +1 -1
  18. package/.next/routes-manifest.json +1 -1
  19. package/.next/server/app/_not-found/page.js +1 -1
  20. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  21. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  22. package/.next/server/app/api/external-apps/[id]/health/route.js.nft.json +1 -1
  23. package/.next/server/app/api/external-apps/[id]/route.js.nft.json +1 -1
  24. package/.next/server/app/api/external-apps/route.js.nft.json +1 -1
  25. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  26. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  27. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  28. package/.next/server/app/api/repositories/excluded/route.js.nft.json +1 -1
  29. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  30. package/.next/server/app/api/repositories/route.js +1 -1
  31. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  32. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  33. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  34. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  35. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  36. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -1
  37. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  38. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  39. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
  40. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  41. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  42. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  43. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  44. package/.next/server/app/api/worktrees/[id]/logs/route.js +4 -4
  45. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  46. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
  47. package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
  48. package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -1
  49. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  50. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  51. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  52. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  53. package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
  54. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  55. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  56. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  57. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
  58. package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
  59. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
  60. package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -1
  61. package/.next/server/app/api/worktrees/route.js +1 -1
  62. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  63. package/.next/server/app/page.js +2 -4
  64. package/.next/server/app/page.js.nft.json +1 -1
  65. package/.next/server/app/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app/proxy/[...path]/route.js.nft.json +1 -1
  67. package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
  68. package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
  69. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  70. package/.next/server/app/worktrees/[id]/page.js +3 -15
  71. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  72. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  73. package/.next/server/app/worktrees/[id]/terminal/page.js +3 -3
  74. package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
  75. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  76. package/.next/server/app-paths-manifest.json +7 -8
  77. package/.next/server/chunks/1287.js +4 -0
  78. package/.next/server/chunks/2683.js +1 -0
  79. package/.next/server/chunks/3348.js +1 -0
  80. package/.next/server/chunks/369.js +1 -0
  81. package/.next/server/chunks/3860.js +1 -0
  82. package/.next/server/chunks/4559.js +1 -0
  83. package/.next/server/chunks/4704.js +35 -0
  84. package/.next/server/chunks/5781.js +1 -0
  85. package/.next/server/chunks/5823.js +1 -0
  86. package/.next/server/chunks/5853.js +1 -0
  87. package/.next/server/chunks/6837.js +1 -0
  88. package/.next/server/chunks/7266.js +1 -0
  89. package/.next/server/chunks/7458.js +1 -0
  90. package/.next/server/chunks/7536.js +1 -1
  91. package/.next/server/chunks/8705.js +1 -0
  92. package/.next/server/chunks/8744.js +1 -0
  93. package/.next/server/chunks/9367.js +2 -2
  94. package/.next/server/chunks/9582.js +1 -0
  95. package/.next/server/functions-config-manifest.json +1 -1
  96. package/.next/server/middleware-build-manifest.js +1 -1
  97. package/.next/server/pages/500.html +1 -1
  98. package/.next/server/pages-manifest.json +1 -1
  99. package/.next/server/server-reference-manifest.json +1 -1
  100. package/.next/static/chunks/1038-3509435b68c0967e.js +1 -0
  101. package/.next/static/chunks/216-f18f4a9d8b04a91e.js +1 -0
  102. package/.next/static/chunks/2330-0299b9879f4977d2.js +1 -0
  103. package/.next/static/chunks/4733-db0112b08802aaa7.js +1 -0
  104. package/.next/static/chunks/6140-389f1951062dcf4f.js +1 -0
  105. package/.next/static/chunks/{816-c254f4e2406e696a.js → 816-bb41b20a51ae924a.js} +1 -1
  106. package/.next/static/chunks/8216-00e20326f32abd12.js +1 -0
  107. package/.next/static/chunks/9234-b0304101384ca079.js +3 -0
  108. package/.next/static/chunks/app/layout-07755491d5d57242.js +1 -0
  109. package/.next/static/chunks/app/page-792c0577dc44e5e5.js +1 -0
  110. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-ce9ac3658f2b7d91.js +1 -0
  111. package/.next/static/chunks/app/worktrees/[id]/page-9d77c6f755d08086.js +1 -0
  112. package/.next/static/chunks/app/worktrees/[id]/terminal/page-5d85a7e508ce36d3.js +1 -0
  113. package/.next/static/chunks/{webpack-4f85dcef6279c6ee.js → webpack-e6531fcf859d9451.js} +1 -1
  114. package/.next/static/css/4eca30cb81bc52b4.css +3 -0
  115. package/.next/trace +5 -5
  116. package/README.md +84 -82
  117. package/dist/server/src/config/auto-yes-config.js +53 -0
  118. package/dist/server/src/config/log-config.js +41 -0
  119. package/dist/server/src/lib/auto-yes-manager.js +6 -4
  120. package/dist/server/src/lib/claude-session.js +6 -0
  121. package/dist/server/src/lib/cli-patterns.js +41 -1
  122. package/dist/server/src/lib/cli-tools/codex.js +16 -3
  123. package/dist/server/src/lib/cli-tools/manager.js +0 -6
  124. package/dist/server/src/lib/log-manager.js +2 -6
  125. package/dist/server/src/lib/pasted-text-helper.js +58 -0
  126. package/dist/server/src/lib/prompt-detector.js +80 -23
  127. package/dist/server/src/lib/response-poller.js +30 -43
  128. package/package.json +2 -1
  129. package/.next/server/app/_not-found.html +0 -1
  130. package/.next/server/app/_not-found.meta +0 -6
  131. package/.next/server/app/_not-found.rsc +0 -10
  132. package/.next/server/app/index.html +0 -9
  133. package/.next/server/app/index.meta +0 -5
  134. package/.next/server/app/index.rsc +0 -8
  135. package/.next/server/app/worktrees/[id]/simple-terminal/page.js +0 -4
  136. package/.next/server/app/worktrees/[id]/simple-terminal/page.js.nft.json +0 -1
  137. package/.next/server/app/worktrees/[id]/simple-terminal/page_client-reference-manifest.js +0 -1
  138. package/.next/server/chunks/3053.js +0 -1
  139. package/.next/server/chunks/434.js +0 -1
  140. package/.next/server/chunks/4471.js +0 -2
  141. package/.next/server/chunks/6550.js +0 -1
  142. package/.next/server/chunks/8174.js +0 -23
  143. package/.next/server/chunks/8887.js +0 -1
  144. package/.next/server/pages/404.html +0 -1
  145. package/.next/static/chunks/2957-327e43ef4c12808f.js +0 -1
  146. package/.next/static/chunks/4343-ebe884a2a80eb033.js +0 -1
  147. package/.next/static/chunks/4851-45df4d388db5623f.js +0 -1
  148. package/.next/static/chunks/6568-38a33aa67d82e12b.js +0 -1
  149. package/.next/static/chunks/6725-f7607851b7d57eb1.js +0 -1
  150. package/.next/static/chunks/7648-325564a6e12a3257.js +0 -1
  151. package/.next/static/chunks/app/layout-4804cfba519283cf.js +0 -1
  152. package/.next/static/chunks/app/page-3926224c4cdf315b.js +0 -1
  153. package/.next/static/chunks/app/worktrees/[id]/files/[...path]/page-9e5adf57cbbbdf05.js +0 -1
  154. package/.next/static/chunks/app/worktrees/[id]/page-8bd88bdc29607413.js +0 -1
  155. package/.next/static/chunks/app/worktrees/[id]/simple-terminal/page-16feb3e86e42f4d1.js +0 -1
  156. package/.next/static/chunks/app/worktrees/[id]/terminal/page-be802baffc84dbd2.js +0 -1
  157. package/.next/static/css/28be35e4727ae7ef.css +0 -3
  158. package/.next/types/app/worktrees/[id]/simple-terminal/page.ts +0 -79
  159. package/dist/server/src/lib/claude-poller.js +0 -341
  160. /package/.next/static/chunks/{2117-d845c2cd62e344a6.js → 2117-e31fa477cb500950.js} +0 -0
  161. /package/.next/static/chunks/app/_not-found/{page-a9d04e58c81115ec.js → page-ac4e4463b39d0cf7.js} +0 -0
  162. /package/.next/static/chunks/{fd9d1056-bbe86e4ae099d5cd.js → fd9d1056-cfdf4f91f13d3485.js} +0 -0
  163. /package/.next/static/{oUD-A998xeBoez6zsrTH3 → rppRTm2sRWa4sZE7ili8A}/_buildManifest.js +0 -0
  164. /package/.next/static/{oUD-A998xeBoez6zsrTH3 → rppRTm2sRWa4sZE7ili8A}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6568],{66625:function(e,t,r){r.d(t,{Vw:function(){return j}});var n=r(57437),s=r(2265);r(27648);var a=r(43241),l=r(58819),o=r(99376),i=r(34021),c=r(8672);function d(e){let{status:t,label:r}=e,s=c.F4[t],a="".concat(r,": ").concat(s.label);return"spinner"===s.type?(0,n.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0 border-2 border-t-transparent animate-spin ".concat(s.className),title:a,"aria-label":a}):(0,n.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0 ".concat(s.className),title:a,"aria-label":a})}let u=(0,s.memo)(function(e){let{branch:t,isSelected:r,onClick:s}=e;return(0,n.jsxs)("button",{"data-testid":"branch-list-item",onClick:s,"aria-current":r?"true":void 0,className:"\n w-full px-4 py-3 flex flex-col gap-1\n hover:bg-gray-800 transition-colors\n focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500\n ".concat(r?"bg-gray-700 border-l-2 border-blue-500":"border-l-2 border-transparent","\n "),children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[t.cliStatus&&(0,n.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0","aria-label":"CLI tool status",children:[(0,n.jsx)(d,{status:t.cliStatus.claude,label:"Claude"}),(0,n.jsx)(d,{status:t.cliStatus.codex,label:"Codex"})]}),(0,n.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-white truncate",children:t.name}),(0,n.jsx)("p",{className:"text-xs text-gray-400 truncate",children:t.repositoryName})]}),t.hasUnread&&(0,n.jsx)("span",{"data-testid":"unread-indicator",className:"w-2 h-2 rounded-full bg-blue-500 flex-shrink-0","aria-label":"Has unread messages"})]}),t.description&&(0,n.jsx)("div",{"data-testid":"branch-description",className:"pl-6 pr-2 mt-1 text-left",children:(0,n.jsx)("p",{className:"text-xs text-gray-400 line-clamp-2",children:t.description})})]})}),m=[{key:"updatedAt",label:"Updated"},{key:"repositoryName",label:"Repository"},{key:"branchName",label:"Branch"},{key:"status",label:"Status"}],x=(0,s.memo)(function(){var e;let{sortKey:t,sortDirection:r,setSortKey:l,setSortDirection:o}=(0,a.Sz)(),[i,c]=(0,s.useState)(!1),d=(0,s.useRef)(null);(0,s.useEffect)(()=>{function e(e){d.current&&!d.current.contains(e.target)&&c(!1)}if(i)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]),(0,s.useEffect)(()=>{function e(e){"Escape"===e.key&&c(!1)}if(i)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]);let u=(0,s.useCallback)(()=>{c(e=>!e)},[]),x=(0,s.useCallback)(e=>{e===t?o("asc"===r?"desc":"asc"):(l(e),o("updatedAt"===e?"desc":"asc")),c(!1)},[t,r,l,o]),b=(0,s.useCallback)(()=>{o("asc"===r?"desc":"asc")},[r,o]),g=(null===(e=m.find(e=>e.key===t))||void 0===e?void 0:e.label)||"Sort";return(0,n.jsxs)("div",{ref:d,className:"relative","data-testid":"sort-selector",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsxs)("button",{type:"button",onClick:u,"aria-expanded":i,"aria-haspopup":"listbox","aria-label":"Sort by ".concat(g),className:" flex items-center gap-1 px-2 py-1 rounded text-xs text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors ",children:[(0,n.jsx)(h,{className:"w-3 h-3"}),(0,n.jsx)("span",{className:"hidden sm:inline",children:g})]}),(0,n.jsx)("button",{type:"button",onClick:b,"aria-label":"asc"===r?"Sort ascending":"Sort descending",className:" p-1 rounded text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors ",children:"asc"===r?(0,n.jsx)(f,{className:"w-3 h-3"}):(0,n.jsx)(p,{className:"w-3 h-3"})})]}),i&&(0,n.jsx)("div",{role:"listbox","aria-label":"Sort options",className:" absolute right-0 top-full mt-1 z-50 min-w-[140px] py-1 rounded-md shadow-lg bg-gray-800 border border-gray-600 ",children:m.map(e=>(0,n.jsxs)("button",{type:"button",role:"option","aria-selected":t===e.key,onClick:()=>x(e.key),className:"\n w-full px-3 py-2 text-left text-sm\n flex items-center justify-between\n hover:bg-gray-700 transition-colors\n ".concat(t===e.key?"text-blue-400":"text-gray-300","\n "),children:[(0,n.jsx)("span",{children:e.label}),t===e.key&&(0,n.jsx)("span",{className:"text-xs",children:"asc"===r?"ASC":"DESC"})]},e.key))})]})});function h(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12"})})}function f(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}function p(e){let{className:t}=e;return(0,n.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}var b=r(47712);let g={waiting:0,ready:1,running:2,generating:3,idle:4},y=(0,s.memo)(function(){let e=(0,o.useRouter)(),{worktrees:t,selectedWorktreeId:r,selectWorktree:l}=(0,i.Mu)(),{closeMobileDrawer:c,sortKey:d,sortDirection:m}=(0,a.Sz)(),[h,f]=(0,s.useState)(""),p=(0,s.useMemo)(()=>{let e=t.map(b.I_),r=e;if(h.trim()){let t=h.toLowerCase();r=e.filter(e=>e.name.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t))}return function(e,t,r){let n=[...e];return n.sort((e,n)=>{let s=0;switch(t){case"updatedAt":{let t=e=>e?e instanceof Date?e.getTime():new Date(e).getTime():0,r=t(e.lastActivity);s=t(n.lastActivity)-r;break}case"repositoryName":{let t=e.repositoryName.toLowerCase(),r=n.repositoryName.toLowerCase();s=t.localeCompare(r);break}case"branchName":{let t=e.name.toLowerCase(),r=n.name.toLowerCase();s=t.localeCompare(r);break}case"status":s=g[e.status]-g[n.status]}return("updatedAt"===t?"desc"===r:"asc"===r)?s:-s}),n}(r,d,m)},[t,h,d,m]),y=t=>{l(t),e.push("/worktrees/".concat(t)),c()};return(0,n.jsxs)("nav",{"data-testid":"sidebar","aria-label":"Branch navigation",className:"h-full flex flex-col bg-gray-900 text-white",role:"navigation",children:[(0,n.jsx)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 px-4 py-4 border-b border-gray-700",children:(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-white",children:"Branches"}),(0,n.jsx)(x,{})]})}),(0,n.jsx)("div",{className:"flex-shrink-0 px-4 py-3 border-b border-gray-700",children:(0,n.jsx)("input",{type:"text",placeholder:"Search branches...",value:h,onChange:e=>f(e.target.value),className:" w-full px-3 py-2 rounded-md bg-gray-800 text-white placeholder-gray-400 border border-gray-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent "})}),(0,n.jsx)("div",{"data-testid":"branch-list",className:"flex-1 overflow-y-auto",children:0===p.length?(0,n.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:h?"No branches found":"No branches available"}):p.map(e=>(0,n.jsx)(u,{branch:e,isSelected:e.id===r,onClick:()=>y(e.id)},e.id))})]})});var v=r(3468);let w="transform transition-transform duration-300 ease-out",j=(0,s.memo)(function(e){let{children:t}=e,{isOpen:r,isMobileDrawerOpen:s,closeMobileDrawer:o}=(0,a.Sz)();return(0,l.d)()?(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[s&&(0,n.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:o,"aria-hidden":"true"}),(0,n.jsx)("aside",{"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72 z-50\n ".concat(w,"\n ").concat(s?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,n.jsx)(y,{})}),(0,n.jsx)("main",{className:"flex-1 min-h-0 overflow-hidden",role:"main",children:t})]}):(0,n.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex",children:[(0,n.jsx)("aside",{"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72\n ".concat(w,"\n ").concat(r?"translate-x-0":"-translate-x-full","\n "),style:{zIndex:v.k.SIDEBAR},role:"complementary","aria-hidden":!r,children:(0,n.jsx)(y,{})}),(0,n.jsx)("main",{className:"\n flex-1 min-w-0 h-full overflow-hidden\n transition-[padding] duration-300 ease-out\n ".concat(r?"md:pl-72":"md:pl-0","\n "),role:"main",children:t})]})})},98702:function(e,t,r){r.d(t,{u:function(){return a}});var n=r(57437),s=r(2265);function a(e){let{isOpen:t,onClose:r,title:a,children:l,size:o="lg",showCloseButton:i=!0,disableClose:c=!1}=e,d=(0,s.useRef)(null);return((0,s.useEffect)(()=>{if(c)return;let e=e=>{"Escape"===e.key&&t&&r()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,r,c]),(0,s.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[t]),t)?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[(0,n.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:c?void 0:r}),(0,n.jsx)("div",{className:"flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,n.jsxs)("div",{ref:d,className:"relative w-full ".concat({sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}[o]," bg-white rounded-lg shadow-xl transform transition-all"),children:[(a||i)&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-gray-200",children:[(0,n.jsx)("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate pr-2",children:a}),i&&(0,n.jsx)("button",{onClick:r,className:"text-gray-400 hover:text-gray-600 transition-colors flex-shrink-0",children:(0,n.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4",children:l})]})})]}):null}},10789:function(e,t,r){r.d(t,{Ct:function(){return c},zx:function(){return s},Zb:function(){return a},aY:function(){return i},Ol:function(){return l},ll:function(){return o},u_:function(){return d.u}});var n=r(57437);function s(e){let{variant:t="primary",size:r="md",fullWidth:s=!1,loading:a=!1,disabled:l,className:o="",children:i,...c}=e,d=["btn",{primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"}[t],{sm:"btn-sm",md:"",lg:"btn-lg"}[r],s?"w-full":"",l||a?"opacity-50 cursor-not-allowed":"",o].filter(Boolean).join(" ");return(0,n.jsxs)("button",{className:d,disabled:l||a,...c,children:[a&&(0,n.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),i]})}function a(e){let{hover:t=!1,padding:r="md",className:s="",children:a,...l}=e,o=["card",t?"card-hover":"",{none:"",sm:"p-3",md:"p-4",lg:"p-6"}[r],s].filter(Boolean).join(" ");return(0,n.jsx)("div",{className:o,...l,children:a})}function l(e){let{className:t="",children:r,...s}=e;return(0,n.jsx)("div",{className:"mb-3 ".concat(t),...s,children:r})}function o(e){let{className:t="",children:r,...s}=e;return(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-900 ".concat(t),...s,children:r})}function i(e){let{className:t="",children:r,...s}=e;return(0,n.jsx)("div",{className:t,...s,children:r})}function c(e){let{variant:t="gray",dot:r=!1,className:s="",children:a,...l}=e,o=["badge",{success:"badge-success",warning:"badge-warning",error:"badge-error",info:"badge-info",gray:"badge-gray"}[t],s].filter(Boolean).join(" ");return(0,n.jsxs)("span",{className:o,...l,children:[r&&(0,n.jsx)("span",{className:"mr-1.5 inline-block h-2 w-2 rounded-full ".concat({success:"bg-green-600",warning:"bg-yellow-600",error:"bg-red-600",info:"bg-blue-600",gray:"bg-gray-600"}[t]),"aria-hidden":"true"}),a]})}r(2265);var d=r(98702)},6940:function(e,t,r){r.d(t,{R:function(){return m}});var n=r(57437),s=r(2265),a=r(3227);function l(e,t){if(!t.trim())return e;let r=t.toLowerCase();return e.map(e=>({...e,commands:e.commands.filter(e=>{let t=e.name.toLowerCase().includes(r),n=e.description.toLowerCase().includes(r);return t||n})})).filter(e=>e.commands.length>0)}function o(e){let{groups:t,onSelect:r,highlightedIndex:s=-1,className:a=""}=e,l=0;return 0===t.length?(0,n.jsx)("div",{className:"text-sm text-gray-500 p-4 text-center ".concat(a),children:"No commands available"}):(0,n.jsx)("div",{className:"overflow-y-auto ".concat(a),children:t.map(e=>(0,n.jsxs)("div",{className:"mb-2",children:[(0,n.jsx)("div",{className:"px-3 py-1.5 text-xs font-semibold text-gray-500 uppercase tracking-wider bg-gray-50",children:e.label}),(0,n.jsx)("div",{children:e.commands.map(e=>{let t=l;l++;let a=t===s;return(0,n.jsxs)("button",{type:"button","data-command-item":!0,"data-highlighted":a,onClick:()=>r(e),className:"w-full px-3 py-2 text-left flex items-start gap-2 hover:bg-blue-50 transition-colors ".concat(a?"bg-blue-100":""),children:[(0,n.jsxs)("span",{className:"text-blue-600 font-mono text-sm flex-shrink-0",children:["/",e.name]}),(0,n.jsx)("span",{className:"text-gray-600 text-sm truncate",children:e.description})]},e.name)})})]},e.category))})}function i(e){let{isOpen:t,groups:r,onSelect:a,onClose:i,isMobile:c=!1,position:d,onFreeInput:u}=e,[m,x]=(0,s.useState)(""),[h,f]=(0,s.useState)(0),p=(0,s.useRef)(null),b=(0,s.useMemo)(()=>l(r,m),[r,m]),g=(0,s.useMemo)(()=>b.flatMap(e=>e.commands),[b]);(0,s.useEffect)(()=>{t&&(x(""),f(0),setTimeout(()=>{var e;null===(e=p.current)||void 0===e||e.focus()},50))},[t]);let y=(0,s.useCallback)(e=>{a(e),i()},[a,i]),v=(0,s.useCallback)(e=>{if(t)switch(e.key){case"Escape":e.preventDefault(),i();break;case"ArrowDown":e.preventDefault(),f(e=>Math.min(e+1,g.length-1));break;case"ArrowUp":e.preventDefault(),f(e=>Math.max(e-1,0));break;case"Enter":e.preventDefault(),g[h]&&y(g[h])}},[t,g,h,i,y]);return((0,s.useEffect)(()=>(document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}),[v]),t)?c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 bg-black/50 z-40",onClick:i,"aria-hidden":"true"}),(0,n.jsxs)("div",{"data-testid":"slash-command-bottom-sheet",className:"fixed bottom-0 left-0 right-0 bg-white rounded-t-xl z-50 max-h-[70vh] flex flex-col shadow-xl",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-200",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold",children:"Commands"}),(0,n.jsx)("button",{type:"button",onClick:i,"aria-label":"Close",className:"p-2 rounded-full hover:bg-gray-100",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"px-4 py-2 border-b border-gray-100",children:(0,n.jsx)("input",{ref:p,type:"text",value:m,onChange:e=>x(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"})}),u&&(0,n.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:u,className:"w-full px-4 py-3 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors",children:[(0,n.jsx)("span",{className:"text-blue-600",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,n.jsx)("span",{className:"text-gray-600",children:"Enter custom command..."})]}),(0,n.jsx)(o,{groups:b,onSelect:y,highlightedIndex:h,className:"flex-1 overflow-y-auto pb-20"})]})]}):(0,n.jsxs)("div",{role:"listbox",className:"absolute bg-white border border-gray-200 rounded-lg shadow-lg z-50 w-80 max-h-96 flex flex-col",style:d?{top:d.top,left:d.left}:{bottom:"100%",left:0,marginBottom:"4px"},children:[(0,n.jsx)("div",{className:"px-3 py-2 border-b border-gray-100",children:(0,n.jsx)("input",{ref:p,type:"text",value:m,onChange:e=>x(e.target.value),placeholder:"Search commands...",className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500"})}),u&&(0,n.jsxs)("button",{type:"button","data-testid":"free-input-button",onClick:u,className:"w-full px-3 py-2 text-left border-b border-gray-100 flex items-center gap-2 hover:bg-blue-50 transition-colors text-sm",children:[(0,n.jsx)("span",{className:"text-blue-600",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),(0,n.jsx)("span",{className:"text-gray-600",children:"Enter custom command..."})]}),(0,n.jsx)(o,{groups:b,onSelect:y,highlightedIndex:h,className:"flex-1 overflow-y-auto"}),(0,n.jsxs)("div",{className:"px-3 py-1.5 border-t border-gray-100 text-xs text-gray-400 flex gap-3",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Enter"})," select"]}),(0,n.jsxs)("span",{children:[(0,n.jsx)("kbd",{className:"px-1 py-0.5 bg-gray-100 rounded",children:"Esc"})," close"]})]})]}):null}function c(e){let{worktreeId:t,cliToolId:r,disabled:a=!1,onInterrupt:l}=e,[o,i]=(0,s.useState)(!1),c=(0,s.useRef)(0),u=(0,s.useCallback)(async()=>{let e=Date.now();if(!(e-c.current<1e3)){c.current=e,i(!0);try{let e=await fetch("/api/worktrees/".concat(t,"/interrupt"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cliToolId:r})});if(e.ok)null==l||l();else{let t=await e.json().catch(()=>({}));console.error("[InterruptButton] Failed to send interrupt:",t.error||e.statusText)}}catch(e){console.error("[InterruptButton] Error sending interrupt:",e)}finally{i(!1)}}},[t,r,l]);return(0,n.jsx)("button",{type:"button",onClick:u,disabled:a||o,className:"flex-shrink-0 p-2 text-orange-600 hover:bg-orange-50 rounded-full transition-colors disabled:text-gray-300 disabled:hover:bg-transparent","aria-label":"Stop processing","data-testid":"interrupt-button",children:o?(0,n.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):(0,n.jsx)(d,{})})}function d(){return(0,n.jsx)("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}var u=r(58819);function m(e){let{worktreeId:t,onMessageSent:r,cliToolId:o,isSessionRunning:d=!1}=e,[m,x]=(0,s.useState)(""),[h,f]=(0,s.useState)(!1),[p,b]=(0,s.useState)(null),[g,y]=(0,s.useState)(!1),[v,w]=(0,s.useState)(!1),j=(0,s.useRef)(null),N=(0,s.useRef)(null),k=(0,s.useRef)(!1),C=(0,s.useRef)(null),S=(0,u.d)(),{groups:E}=function(e,t){let[r,n]=(0,s.useState)([]),[o,i]=(0,s.useState)(!0),[c,d]=(0,s.useState)(null),[u,m]=(0,s.useState)(""),[x,h]=(0,s.useState)(t||"claude"),f=(0,s.useCallback)(async()=>{try{i(!0),d(null);let r=e?"/api/worktrees/".concat(e,"/slash-commands"):"/api/slash-commands";t&&(r+="?cliTool=".concat(t));let s=await fetch(r);if(!s.ok)throw Error("HTTP error ".concat(s.status));let a=await s.json();n(a.groups),h(a.cliTool||t||"claude")}catch(e){d((0,a.zG)(e)),n([])}finally{i(!1)}},[e,t]);(0,s.useEffect)(()=>{f()},[f]);let p=(0,s.useMemo)(()=>r.flatMap(e=>e.commands),[r]),b=(0,s.useMemo)(()=>l(r,u),[r,u]);return{groups:r,filteredGroups:b,allCommands:p,loading:o,error:c,filter:u,setFilter:m,refresh:(0,s.useCallback)(()=>{f()},[f]),cliTool:x}}(t,o);(0,s.useEffect)(()=>{let e=j.current;e&&(m?(e.style.height="auto",e.style.height="".concat(Math.min(e.scrollHeight,160),"px")):e.style.height="24px")},[m]);let L=async()=>{if(!g&&m.trim()&&!h)try{f(!0),b(null);let e=o||"claude";await a.Iv.sendMessage(t,m.trim(),e),x(""),null==r||r(e)}catch(e){b((0,a.zG)(e))}finally{f(!1)}},M=async e=>{e.preventDefault(),await L()},z=()=>{var e;w(!1),null===(e=j.current)||void 0===e||e.focus()};return(0,n.jsxs)("div",{ref:C,className:"space-y-2 relative",children:[p&&(0,n.jsx)("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-sm text-red-800",children:p}),(0,n.jsxs)("form",{onSubmit:M,className:"flex items-end gap-2 bg-white border border-gray-300 rounded-lg px-4 py-2 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500",children:[S&&(0,n.jsx)("button",{type:"button",onClick:()=>w(!0),className:"flex-shrink-0 p-2 text-gray-500 hover:text-blue-600 hover:bg-blue-50 rounded-full transition-colors","aria-label":"Show slash commands","data-testid":"mobile-command-button",children:(0,n.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})})}),(0,n.jsx)("textarea",{ref:j,value:m,onChange:e=>{let t=e.target.value;x(t),"/"===t||t.startsWith("/")&&!t.includes(" ")?w(!0):w(!1)},onKeyDown:e=>{let{keyCode:t}=e.nativeEvent;if(229!==t){if("Escape"===e.key&&v){e.preventDefault(),z();return}if(k.current&&"Enter"===e.key){k.current=!1;return}if("Enter"===e.key&&!g&&!v){if(S)return;e.shiftKey||(e.preventDefault(),L())}}},onCompositionStart:()=>{y(!0),k.current=!1,N.current&&clearTimeout(N.current)},onCompositionEnd:()=>{y(!1),k.current=!0,N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{k.current=!1},300)},placeholder:S?"Type your message...":"Type your message... (/ for commands, Shift+Enter for line break)",disabled:h,rows:1,className:"flex-1 outline-none bg-transparent resize-none py-1 overflow-y-auto scrollbar-thin",style:{minHeight:"24px",maxHeight:"160px"}}),(0,n.jsx)(c,{worktreeId:t,cliToolId:o||"claude",disabled:!d}),(0,n.jsx)("button",{type:"submit",disabled:!m.trim()||h,className:"flex-shrink-0 p-2 text-blue-600 hover:bg-blue-50 rounded-full transition-colors disabled:text-gray-300 disabled:hover:bg-transparent","aria-label":"Send message",children:h?(0,n.jsxs)("svg",{className:"animate-spin h-5 w-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):(0,n.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]}),(0,n.jsx)(i,{isOpen:v,groups:E,onSelect:e=>{var t;x("/".concat(e.name," ")),w(!1),null===(t=j.current)||void 0===t||t.focus()},onClose:z,isMobile:S,onFreeInput:()=>{w(!1),x("/"),setTimeout(()=>{var e;null===(e=j.current)||void 0===e||e.focus()},50)}})]})}},8672:function(e,t,r){r.d(t,{F4:function(){return i},Ie:function(){return d},xh:function(){return c}});let n="bg-gray-500",s="bg-green-500",a="border-blue-500",l="bg-yellow-500",o="bg-red-500",i={idle:{className:n,label:"Idle",type:"dot"},ready:{className:s,label:"Ready",type:"dot"},running:{className:a,label:"Running",type:"spinner"},waiting:{className:l,label:"Waiting for response",type:"dot"},generating:{className:a,label:"Generating",type:"spinner"}},c={idle:{className:n,label:"Idle",type:"dot"},ready:{className:s,label:"Ready",type:"dot"},running:{className:a,label:"Running",type:"spinner"},waiting:{className:l,label:"Waiting for response",type:"dot"},error:{className:o,label:"Error",type:"dot"}},d={idle:{className:n,label:"Idle - No active session",type:"dot"},ready:{className:s,label:"Ready - Waiting for input",type:"dot"},running:{className:a,label:"Running - Processing",type:"spinner"},waiting:{className:l,label:"Waiting - User input required",type:"dot"},error:{className:o,label:"Error",type:"dot"}}},3468:function(e,t,r){r.d(t,{k:function(){return n}});let n={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,CONTEXT_MENU:70}},58819:function(e,t,r){r.d(t,{d:function(){return s}});var n=r(2265);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{breakpoint:t=768}=e,[r,s]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=()=>window.innerWidth<t;s(e());let r=()=>{s(e())};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[t]),r}},47712:function(e,t,r){function n(e){return e?e.isWaitingForResponse?"waiting":e.isProcessing?"running":e.isRunning?"ready":"idle":"idle"}function s(e){var t,r;let s=!!e.lastAssistantMessageAt&&(!e.lastViewedAt||new Date(e.lastAssistantMessageAt)>new Date(e.lastViewedAt));return{id:e.id,name:e.name,repositoryName:e.repositoryName,status:"idle",hasUnread:s,lastActivity:e.updatedAt,description:e.description,cliStatus:{claude:n(null===(t=e.sessionStatusByCli)||void 0===t?void 0:t.claude),codex:n(null===(r=e.sessionStatusByCli)||void 0===r?void 0:r.codex)}}}r.d(t,{He:function(){return n},I_:function(){return s}})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6725],{99376:function(t,e,n){var a=n(35475);n.o(a,"useParams")&&n.d(e,{useParams:function(){return a.useParams}}),n.o(a,"useRouter")&&n.d(e,{useRouter:function(){return a.useRouter}})},94747:function(t,e,n){n.d(e,{Q:function(){return y}});let a=Symbol.for("constructDateFrom");function r(t,e){return"function"==typeof t?t(e):t&&"object"==typeof t&&a in t?t[a](e):t instanceof Date?new t.constructor(e):new Date(e)}let i={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};var o=n(82050);let u={date:(0,o.l)({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:(0,o.l)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,o.l)({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},d={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};var s=n(28172);let l={ordinalNumber:(t,e)=>{let n=Number(t),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:(0,s.Y)({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:(0,s.Y)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:(0,s.Y)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:(0,s.Y)({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:(0,s.Y)({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};var h=n(85186);let m={code:"en-US",formatDistance:(t,e,n)=>{let a;let r=i[t];return(a="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),null==n?void 0:n.addSuffix)?n.comparison&&n.comparison>0?"in "+a:a+" ago":a},formatLong:u,formatRelative:(t,e,n,a)=>d[t],localize:l,match:{ordinalNumber:(0,n(2540).y)({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)}),era:(0,h.t)({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:(0,h.t)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:(0,h.t)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,h.t)({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,h.t)({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},f={};function c(t,e){return r(e||t,t)}function g(t){let e=c(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function v(t){for(var e=arguments.length,n=Array(e>1?e-1:0),a=1;a<e;a++)n[a-1]=arguments[a];let i=r.bind(null,t||n.find(t=>"object"==typeof t));return n.map(i)}function b(t,e){let n=+c(t)-+c(e);return n<0?-1:n>0?1:n}function y(t,e){return function(t,e,n){var a,r,i,o,u,d;let s;let l=null!==(r=null!==(a=null==n?void 0:n.locale)&&void 0!==a?a:f.locale)&&void 0!==r?r:m,h=b(t,e);if(isNaN(h))throw RangeError("Invalid time value");let y=Object.assign({},n,{addSuffix:null==n?void 0:n.addSuffix,comparison:h}),[w,M]=v(null==n?void 0:n.in,...h>0?[e,t]:[t,e]),p=(i=M,o=w,(d=null==void 0?void 0:(void 0).roundingMethod,t=>{let e=(d?Math[d]:Math.trunc)(t);return 0===e?0:e})((+c(i)-+c(o))/1e3)),W=Math.round((p-(g(M)-g(w))/1e3)/60);if(W<2){if(null==n?void 0:n.includeSeconds){if(p<5)return l.formatDistance("lessThanXSeconds",5,y);if(p<10)return l.formatDistance("lessThanXSeconds",10,y);if(p<20)return l.formatDistance("lessThanXSeconds",20,y);if(p<40)return l.formatDistance("halfAMinute",0,y);else if(p<60)return l.formatDistance("lessThanXMinutes",1,y);else return l.formatDistance("xMinutes",1,y)}return 0===W?l.formatDistance("lessThanXMinutes",1,y):l.formatDistance("xMinutes",W,y)}if(W<45)return l.formatDistance("xMinutes",W,y);if(W<90)return l.formatDistance("aboutXHours",1,y);if(W<1440)return l.formatDistance("aboutXHours",Math.round(W/60),y);if(W<2520)return l.formatDistance("xDays",1,y);if(W<43200)return l.formatDistance("xDays",Math.round(W/1440),y);if(W<86400)return s=Math.round(W/43200),l.formatDistance("aboutXMonths",s,y);if((s=function(t,e,n){let[a,r,i]=v(void 0,t,t,e),o=b(r,i),u=Math.abs(function(t,e,n){let[a,r]=v(void 0,t,e);return 12*(a.getFullYear()-r.getFullYear())+(a.getMonth()-r.getMonth())}(r,i));if(u<1)return 0;1===r.getMonth()&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*u);let d=b(r,i)===-o;(function(t,e){let n=c(t,void 0);return+function(t,e){let n=c(t,null==e?void 0:e.in);return n.setHours(23,59,59,999),n}(n,void 0)==+function(t,e){let n=c(t,null==e?void 0:e.in),a=n.getMonth();return n.setFullYear(n.getFullYear(),a+1,0),n.setHours(23,59,59,999),n}(n,void 0)})(a)&&1===u&&1===b(a,i)&&(d=!1);let s=o*(u-+d);return 0===s?0:s}(M,w))<12)return l.formatDistance("xMonths",Math.round(W/43200),y);{let t=s%12,e=Math.trunc(s/12);return t<3?l.formatDistance("aboutXYears",e,y):t<9?l.formatDistance("overXYears",e,y):l.formatDistance("almostXYears",e+1,y)}}(t,r(t,Date.now()),e)}},82050:function(t,e,n){n.d(e,{l:function(){return a}});function a(t){return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}},28172:function(t,e,n){n.d(e,{Y:function(){return a}});function a(t){return(e,n)=>{let a;if("formatting"===((null==n?void 0:n.context)?String(n.context):"standalone")&&t.formattingValues){let e=t.defaultFormattingWidth||t.defaultWidth,r=(null==n?void 0:n.width)?String(n.width):e;a=t.formattingValues[r]||t.formattingValues[e]}else{let e=t.defaultWidth,r=(null==n?void 0:n.width)?String(n.width):t.defaultWidth;a=t.values[r]||t.values[e]}return a[t.argumentCallback?t.argumentCallback(e):e]}}},85186:function(t,e,n){function a(t){return function(e){let n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=a.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;let u=o[0],d=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],s=Array.isArray(d)?function(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}(d,t=>t.test(u)):function(t,e){for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}(d,t=>t.test(u));return n=t.valueCallback?t.valueCallback(s):s,{value:n=a.valueCallback?a.valueCallback(n):n,rest:e.slice(u.length)}}}n.d(e,{t:function(){return a}})},2540:function(t,e,n){n.d(e,{y:function(){return a}});function a(t){return function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=e.match(t.matchPattern);if(!a)return null;let r=a[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];return{value:o=n.valueCallback?n.valueCallback(o):o,rest:e.slice(r.length)}}}},69073:function(t,e,n){n.d(e,{ja:function(){return h}});let a={lessThanXSeconds:{one:"1秒未満",other:"{{count}}秒未満",oneWithSuffix:"約1秒",otherWithSuffix:"約{{count}}秒"},xSeconds:{one:"1秒",other:"{{count}}秒"},halfAMinute:"30秒",lessThanXMinutes:{one:"1分未満",other:"{{count}}分未満",oneWithSuffix:"約1分",otherWithSuffix:"約{{count}}分"},xMinutes:{one:"1分",other:"{{count}}分"},aboutXHours:{one:"約1時間",other:"約{{count}}時間"},xHours:{one:"1時間",other:"{{count}}時間"},xDays:{one:"1日",other:"{{count}}日"},aboutXWeeks:{one:"約1週間",other:"約{{count}}週間"},xWeeks:{one:"1週間",other:"{{count}}週間"},aboutXMonths:{one:"約1か月",other:"約{{count}}か月"},xMonths:{one:"1か月",other:"{{count}}か月"},aboutXYears:{one:"約1年",other:"約{{count}}年"},xYears:{one:"1年",other:"{{count}}年"},overXYears:{one:"1年以上",other:"{{count}}年以上"},almostXYears:{one:"1年近く",other:"{{count}}年近く"}};var r=n(82050);let i={date:(0,r.l)({formats:{full:"y年M月d日EEEE",long:"y年M月d日",medium:"y/MM/dd",short:"y/MM/dd"},defaultWidth:"full"}),time:(0,r.l)({formats:{full:"H時mm分ss秒 zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:(0,r.l)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},o={lastWeek:"先週のeeeeのp",yesterday:"昨日のp",today:"今日のp",tomorrow:"明日のp",nextWeek:"翌週のeeeeのp",other:"P"};var u=n(28172);let d={ordinalNumber:(t,e)=>{let n=Number(t);switch(String(null==e?void 0:e.unit)){case"year":return"".concat(n,"年");case"quarter":return"第".concat(n,"四半期");case"month":return"".concat(n,"月");case"week":return"第".concat(n,"週");case"date":return"".concat(n,"日");case"hour":return"".concat(n,"時");case"minute":return"".concat(n,"分");case"second":return"".concat(n,"秒");default:return"".concat(n)}},era:(0,u.Y)({values:{narrow:["BC","AC"],abbreviated:["紀元前","西暦"],wide:["紀元前","西暦"]},defaultWidth:"wide"}),quarter:(0,u.Y)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["第1四半期","第2四半期","第3四半期","第4四半期"]},defaultWidth:"wide",argumentCallback:t=>Number(t)-1}),month:(0,u.Y)({values:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},defaultWidth:"wide"}),day:(0,u.Y)({values:{narrow:["日","月","火","水","木","金","土"],short:["日","月","火","水","木","金","土"],abbreviated:["日","月","火","水","木","金","土"],wide:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},defaultWidth:"wide"}),dayPeriod:(0,u.Y)({values:{narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},defaultWidth:"wide",formattingValues:{narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},defaultFormattingWidth:"wide"})};var s=n(2540),l=n(85186);let h={code:"ja",formatDistance:(t,e,n)=>{let r;n=n||{};let i=a[t];return(r="string"==typeof i?i:1===e?n.addSuffix&&i.oneWithSuffix?i.oneWithSuffix:i.one:n.addSuffix&&i.otherWithSuffix?i.otherWithSuffix.replace("{{count}}",String(e)):i.other.replace("{{count}}",String(e)),n.addSuffix)?n.comparison&&n.comparison>0?r+"後":r+"前":r},formatLong:i,formatRelative:(t,e,n,a)=>o[t],localize:d,match:{ordinalNumber:(0,s.y)({matchPattern:/^第?\d+(年|四半期|月|週|日|時|分|秒)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}}),era:(0,l.t)({matchPatterns:{narrow:/^(B\.?C\.?|A\.?D\.?)/i,abbreviated:/^(紀元[前後]|西暦)/i,wide:/^(紀元[前後]|西暦)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^B/i,/^A/i],any:[/^(紀元前)/i,/^(西暦|紀元後)/i]},defaultParseWidth:"any"}),quarter:(0,l.t)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^Q[1234]/i,wide:/^第[1234一二三四1234]四半期/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(1|一|1)/i,/(2|二|2)/i,/(3|三|3)/i,/(4|四|4)/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:(0,l.t)({matchPatterns:{narrow:/^([123456789]|1[012])/,abbreviated:/^([123456789]|1[012])月/i,wide:/^([123456789]|1[012])月/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^1\D/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},defaultParseWidth:"any"}),day:(0,l.t)({matchPatterns:{narrow:/^[日月火水木金土]/,short:/^[日月火水木金土]/,abbreviated:/^[日月火水木金土]/,wide:/^[日月火水木金土]曜日/},defaultMatchWidth:"wide",parsePatterns:{any:[/^日/,/^月/,/^火/,/^水/,/^木/,/^金/,/^土/]},defaultParseWidth:"any"}),dayPeriod:(0,l.t)({matchPatterns:{any:/^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^(A|午前)/i,pm:/^(P|午後)/i,midnight:/^深夜|真夜中/i,noon:/^正午/i,morning:/^朝/i,afternoon:/^午後/i,evening:/^夜/i,night:/^深夜/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7648],{27648:function(e,t,n){n.d(t,{default:function(){return o.a}});var r=n(72972),o=n.n(r)},55449:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return r}}),n(33068);let r=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},56958:function(e,t,n){function r(e,t,n,r){return!1}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return r}}),n(33068),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},72972:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return y}});let r=n(47043),o=n(57437),a=r._(n(2265)),i=n(25246),u=n(53552),s=n(57497),l=n(3987),c=n(55449),f=n(25523),d=n(61956),p=n(16081),h=n(56958),_=n(1634),g=n(24673),m=new Set;function E(e,t,n,r,o,a){if("undefined"!=typeof window&&(a||(0,u.isLocalURL)(t))){if(!r.bypassPrefetchedCheck){let o=t+"%"+n+"%"+(void 0!==r.locale?r.locale:"locale"in e?e.locale:void 0);if(m.has(o))return;m.add(o)}(async()=>a?e.prefetch(t,o):e.prefetch(t,n,r))().catch(e=>{})}}function R(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}let y=a.default.forwardRef(function(e,t){let n,r;let{href:s,as:m,children:y,prefetch:P=null,passHref:S,replace:b,shallow:O,scroll:A,locale:v,onClick:T,onMouseEnter:N,onTouchStart:I,legacyBehavior:C=!1,...x}=e;n=y,C&&("string"==typeof n||"number"==typeof n)&&(n=(0,o.jsx)("a",{children:n}));let j=a.default.useContext(f.RouterContext),M=a.default.useContext(d.AppRouterContext),w=null!=j?j:M,L=!j,D=!1!==P,U=null===P?g.PrefetchKind.AUTO:g.PrefetchKind.FULL,{href:k,as:F}=a.default.useMemo(()=>{if(!j){let e=R(s);return{href:e,as:m?R(m):e}}let[e,t]=(0,i.resolveHref)(j,s,!0);return{href:e,as:m?(0,i.resolveHref)(j,m):t||e}},[j,s,m]),X=a.default.useRef(k),W=a.default.useRef(F);C&&(r=a.default.Children.only(n));let G=C?r&&"object"==typeof r&&r.ref:t,[H,Y,B]=(0,p.useIntersection)({rootMargin:"200px"}),K=a.default.useCallback(e=>{(W.current!==F||X.current!==k)&&(B(),W.current=F,X.current=k),H(e),G&&("function"==typeof G?G(e):"object"==typeof G&&(G.current=e))},[F,G,k,B,H]);a.default.useEffect(()=>{w&&Y&&D&&E(w,k,F,{locale:v},{kind:U},L)},[F,k,Y,v,D,null==j?void 0:j.locale,w,L,U]);let V={ref:K,onClick(e){C||"function"!=typeof T||T(e),C&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(e),w&&!e.defaultPrevented&&function(e,t,n,r,o,i,s,l,c){let{nodeName:f}=e.currentTarget;if("A"===f.toUpperCase()&&(function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!c&&!(0,u.isLocalURL)(n)))return;e.preventDefault();let d=()=>{let e=null==s||s;"beforePopState"in t?t[o?"replace":"push"](n,r,{shallow:i,locale:l,scroll:e}):t[o?"replace":"push"](r||n,{scroll:e})};c?a.default.startTransition(d):d()}(e,w,k,F,b,O,A,v,L)},onMouseEnter(e){C||"function"!=typeof N||N(e),C&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),w&&(D||!L)&&E(w,k,F,{locale:v,priority:!0,bypassPrefetchedCheck:!0},{kind:U},L)},onTouchStart:function(e){C||"function"!=typeof I||I(e),C&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),w&&(D||!L)&&E(w,k,F,{locale:v,priority:!0,bypassPrefetchedCheck:!0},{kind:U},L)}};if((0,l.isAbsoluteUrl)(F))V.href=F;else if(!C||S||"a"===r.type&&!("href"in r.props)){let e=void 0!==v?v:null==j?void 0:j.locale,t=(null==j?void 0:j.isLocaleDomain)&&(0,h.getDomainLocale)(F,e,null==j?void 0:j.locales,null==j?void 0:j.domainLocales);V.href=t||(0,_.addBasePath)((0,c.addLocale)(F,e,null==j?void 0:j.defaultLocale))}return C?a.default.cloneElement(r,V):(0,o.jsx)("a",{...x,...V,children:n})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},63515:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{cancelIdleCallback:function(){return r},requestIdleCallback:function(){return n}});let n="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},r="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},25246:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"resolveHref",{enumerable:!0,get:function(){return f}});let r=n(48637),o=n(57497),a=n(17053),i=n(3987),u=n(33068),s=n(53552),l=n(86279),c=n(37205);function f(e,t,n){let f;let d="string"==typeof t?t:(0,o.formatWithValidation)(t),p=d.match(/^[a-zA-Z]{1,}:\/\//),h=p?d.slice(p[0].length):d;if((h.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+d+"' passed to next/router in page: '"+e.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");let t=(0,i.normalizeRepeatedSlashes)(h);d=(p?p[0]:"")+t}if(!(0,s.isLocalURL)(d))return n?[d]:d;try{f=new URL(d.startsWith("#")?e.asPath:e.pathname,"http://n")}catch(e){f=new URL("/","http://n")}try{let e=new URL(d,f);e.pathname=(0,u.normalizePathTrailingSlash)(e.pathname);let t="";if((0,l.isDynamicRoute)(e.pathname)&&e.searchParams&&n){let n=(0,r.searchParamsToUrlQuery)(e.searchParams),{result:i,params:u}=(0,c.interpolateAs)(e.pathname,e.pathname,n);i&&(t=(0,o.formatWithValidation)({pathname:i,hash:e.hash,query:(0,a.omit)(n,u)}))}let i=e.origin===f.origin?e.href.slice(e.origin.length):e.href;return n?[i,t||i]:i}catch(e){return n?[d]:d}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},16081:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return s}});let r=n(2265),o=n(63515),a="function"==typeof IntersectionObserver,i=new Map,u=[];function s(e){let{rootRef:t,rootMargin:n,disabled:s}=e,l=s||!a,[c,f]=(0,r.useState)(!1),d=(0,r.useRef)(null),p=(0,r.useCallback)(e=>{d.current=e},[]);return(0,r.useEffect)(()=>{if(a){if(l||c)return;let e=d.current;if(e&&e.tagName)return function(e,t,n){let{id:r,observer:o,elements:a}=function(e){let t;let n={root:e.root||null,margin:e.rootMargin||""},r=u.find(e=>e.root===n.root&&e.margin===n.margin);if(r&&(t=i.get(r)))return t;let o=new Map;return t={id:n,observer:new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target),n=e.isIntersecting||e.intersectionRatio>0;t&&n&&t(n)})},e),elements:o},u.push(n),i.set(n,t),t}(n);return a.set(e,t),o.observe(e),function(){if(a.delete(e),o.unobserve(e),0===a.size){o.disconnect(),i.delete(r);let e=u.findIndex(e=>e.root===r.root&&e.margin===r.margin);e>-1&&u.splice(e,1)}}}(e,e=>e&&f(e),{root:null==t?void 0:t.current,rootMargin:n})}else if(!c){let e=(0,o.requestIdleCallback)(()=>f(!0));return()=>(0,o.cancelIdleCallback)(e)}},[l,n,t,c,d.current]),[p,c,(0,r.useCallback)(()=>{f(!1)},[])]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},19259:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION_SUFFIX:function(){return s},APP_DIR_ALIAS:function(){return T},CACHE_ONE_YEAR:function(){return y},DOT_NEXT_ALIAS:function(){return A},ESLINT_DEFAULT_DIRS:function(){return B},GSP_NO_RETURNED_VALUE:function(){return F},GSSP_COMPONENT_MEMBER_ERROR:function(){return G},GSSP_NO_RETURNED_VALUE:function(){return X},INSTRUMENTATION_HOOK_FILENAME:function(){return b},MIDDLEWARE_FILENAME:function(){return P},MIDDLEWARE_LOCATION_REGEXP:function(){return S},NEXT_BODY_SUFFIX:function(){return f},NEXT_CACHE_IMPLICIT_TAG_ID:function(){return R},NEXT_CACHE_REVALIDATED_TAGS_HEADER:function(){return h},NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER:function(){return _},NEXT_CACHE_SOFT_TAGS_HEADER:function(){return p},NEXT_CACHE_SOFT_TAG_MAX_LENGTH:function(){return E},NEXT_CACHE_TAGS_HEADER:function(){return d},NEXT_CACHE_TAG_MAX_ITEMS:function(){return g},NEXT_CACHE_TAG_MAX_LENGTH:function(){return m},NEXT_DATA_SUFFIX:function(){return l},NEXT_INTERCEPTION_MARKER_PREFIX:function(){return r},NEXT_META_SUFFIX:function(){return c},NEXT_QUERY_PARAM_PREFIX:function(){return n},NON_STANDARD_NODE_ENV:function(){return H},PAGES_DIR_ALIAS:function(){return O},PRERENDER_REVALIDATE_HEADER:function(){return o},PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER:function(){return a},PUBLIC_DIR_MIDDLEWARE_CONFLICT:function(){return M},ROOT_DIR_ALIAS:function(){return v},RSC_ACTION_CLIENT_WRAPPER_ALIAS:function(){return j},RSC_ACTION_ENCRYPTION_ALIAS:function(){return x},RSC_ACTION_PROXY_ALIAS:function(){return C},RSC_ACTION_VALIDATE_ALIAS:function(){return I},RSC_MOD_REF_PROXY_ALIAS:function(){return N},RSC_PREFETCH_SUFFIX:function(){return i},RSC_SUFFIX:function(){return u},SERVER_PROPS_EXPORT_ERROR:function(){return k},SERVER_PROPS_GET_INIT_PROPS_CONFLICT:function(){return L},SERVER_PROPS_SSG_CONFLICT:function(){return D},SERVER_RUNTIME:function(){return K},SSG_FALLBACK_EXPORT_ERROR:function(){return Y},SSG_GET_INITIAL_PROPS_CONFLICT:function(){return w},STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR:function(){return U},UNSTABLE_REVALIDATE_RENAME_ERROR:function(){return W},WEBPACK_LAYERS:function(){return z},WEBPACK_RESOURCE_QUERIES:function(){return q}});let n="nxtP",r="nxtI",o="x-prerender-revalidate",a="x-prerender-revalidate-if-generated",i=".prefetch.rsc",u=".rsc",s=".action",l=".json",c=".meta",f=".body",d="x-next-cache-tags",p="x-next-cache-soft-tags",h="x-next-revalidated-tags",_="x-next-revalidate-tag-token",g=128,m=256,E=1024,R="_N_T_",y=31536e3,P="middleware",S=`(?:src/)?${P}`,b="instrumentation",O="private-next-pages",A="private-dot-next",v="private-next-root-dir",T="private-next-app-dir",N="private-next-rsc-mod-ref-proxy",I="private-next-rsc-action-validate",C="private-next-rsc-server-reference",x="private-next-rsc-action-encryption",j="private-next-rsc-action-client-wrapper",M="You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict",w="You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps",L="You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.",D="You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps",U="can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props",k="pages with `getServerSideProps` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export",F="Your `getStaticProps` function did not return an object. Did you forget to add a `return`?",X="Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?",W="The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.",G="can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member",H='You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env',Y="Pages with `fallback` enabled in `getStaticPaths` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export",B=["app","pages","components","lib","src"],K={edge:"edge",experimentalEdge:"experimental-edge",nodejs:"nodejs"},V={shared:"shared",reactServerComponents:"rsc",serverSideRendering:"ssr",actionBrowser:"action-browser",api:"api",middleware:"middleware",instrument:"instrument",edgeAsset:"edge-asset",appPagesBrowser:"app-pages-browser",appMetadataRoute:"app-metadata-route",appRouteHandler:"app-route-handler"},z={...V,GROUP:{serverOnly:[V.reactServerComponents,V.actionBrowser,V.appMetadataRoute,V.appRouteHandler,V.instrument],clientOnly:[V.serverSideRendering,V.appPagesBrowser],nonClientServerTarget:[V.middleware,V.api],app:[V.reactServerComponents,V.actionBrowser,V.appMetadataRoute,V.appRouteHandler,V.serverSideRendering,V.appPagesBrowser,V.shared,V.instrument]}},q={edgeSSREntry:"__next_edge_ssr_entry__",metadata:"__next_metadata__",metadataRoute:"__next_metadata_route__",metadataImageMeta:"__next_metadata_image_meta__"}},90042:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return o}});let n=/[|\\{}()[\]^$+*?.-]/,r=/[|\\{}()[\]^$+*?.-]/g;function o(e){return n.test(e)?e.replace(r,"\\$&"):e}},25523:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return r}});let r=n(47043)._(n(2265)).default.createContext(null)},57497:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{formatUrl:function(){return a},formatWithValidation:function(){return u},urlObjectKeys:function(){return i}});let r=n(53099)._(n(48637)),o=/https?|ftp|gopher|file/;function a(e){let{auth:t,hostname:n}=e,a=e.protocol||"",i=e.pathname||"",u=e.hash||"",s=e.query||"",l=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?l=t+e.host:n&&(l=t+(~n.indexOf(":")?"["+n+"]":n),e.port&&(l+=":"+e.port)),s&&"object"==typeof s&&(s=String(r.urlQueryToSearchParams(s)));let c=e.search||s&&"?"+s||"";return a&&!a.endsWith(":")&&(a+=":"),e.slashes||(!a||o.test(a))&&!1!==l?(l="//"+(l||""),i&&"/"!==i[0]&&(i="/"+i)):l||(l=""),u&&"#"!==u[0]&&(u="#"+u),c&&"?"!==c[0]&&(c="?"+c),""+a+l+(i=i.replace(/[?#]/g,encodeURIComponent))+(c=c.replace("#","%23"))+u}let i=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return a(e)}},86279:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getSortedRoutes:function(){return r.getSortedRoutes},isDynamicRoute:function(){return o.isDynamicRoute}});let r=n(14777),o=n(38104)},37205:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"interpolateAs",{enumerable:!0,get:function(){return a}});let r=n(4199),o=n(9964);function a(e,t,n){let a="",i=(0,o.getRouteRegex)(e),u=i.groups,s=(t!==e?(0,r.getRouteMatcher)(i)(t):"")||n;a=e;let l=Object.keys(u);return l.every(e=>{let t=s[e]||"",{repeat:n,optional:r}=u[e],o="["+(n?"...":"")+e+"]";return r&&(o=(t?"":"/")+"["+o+"]"),n&&!Array.isArray(t)&&(t=[t]),(r||e in s)&&(a=a.replace(o,n?t.map(e=>encodeURIComponent(e)).join("/"):encodeURIComponent(t))||"/")})||(a=""),{params:l,result:a}}},38104:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return a}});let r=n(91182),o=/\/\[[^/]+?\](?=\/|$)/;function a(e){return(0,r.isInterceptionRouteAppPath)(e)&&(e=(0,r.extractInterceptionRouteInformation)(e).interceptedRoute),o.test(e)}},53552:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return a}});let r=n(3987),o=n(11283);function a(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,o.hasBasePath)(n.pathname)}catch(e){return!1}}},17053:function(e,t){function n(e,t){let n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"omit",{enumerable:!0,get:function(){return n}})},48637:function(e,t){function n(e){let t={};return e.forEach((e,n)=>{void 0===t[n]?t[n]=e:Array.isArray(t[n])?t[n].push(e):t[n]=[t[n],e]}),t}function r(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[n,o]=e;Array.isArray(o)?o.forEach(e=>t.append(n,r(e))):t.set(n,r(o))}),t}function a(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach(t=>{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,n)=>e.append(n,t))}),e}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{assign:function(){return a},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return o}})},4199:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return o}});let r=n(3987);function o(e){let{re:t,groups:n}=e;return e=>{let o=t.exec(e);if(!o)return!1;let a=e=>{try{return decodeURIComponent(e)}catch(e){throw new r.DecodeError("failed to decode param")}},i={};return Object.keys(n).forEach(e=>{let t=n[e],r=o[t.pos];void 0!==r&&(i[e]=~r.indexOf("/")?r.split("/").map(e=>a(e)):t.repeat?[a(r)]:a(r))}),i}}},9964:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getNamedMiddlewareRegex:function(){return p},getNamedRouteRegex:function(){return d},getRouteRegex:function(){return l},parseParameter:function(){return u}});let r=n(19259),o=n(91182),a=n(90042),i=n(26674);function u(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let n=e.startsWith("...");return n&&(e=e.slice(3)),{key:e,repeat:n,optional:t}}function s(e){let t=(0,i.removeTrailingSlash)(e).slice(1).split("/"),n={},r=1;return{parameterizedRoute:t.map(e=>{let t=o.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t)),i=e.match(/\[((?:\[.*\])|.+)\]/);if(t&&i){let{key:e,optional:o,repeat:s}=u(i[1]);return n[e]={pos:r++,repeat:s,optional:o},"/"+(0,a.escapeStringRegexp)(t)+"([^/]+?)"}if(!i)return"/"+(0,a.escapeStringRegexp)(e);{let{key:e,repeat:t,optional:o}=u(i[1]);return n[e]={pos:r++,repeat:t,optional:o},t?o?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:n}}function l(e){let{parameterizedRoute:t,groups:n}=s(e);return{re:RegExp("^"+t+"(?:/)?$"),groups:n}}function c(e){let{interceptionMarker:t,getSafeRouteKey:n,segment:r,routeKeys:o,keyPrefix:i}=e,{key:s,optional:l,repeat:c}=u(r),f=s.replace(/\W/g,"");i&&(f=""+i+f);let d=!1;(0===f.length||f.length>30)&&(d=!0),isNaN(parseInt(f.slice(0,1)))||(d=!0),d&&(f=n()),i?o[f]=""+i+s:o[f]=s;let p=t?(0,a.escapeStringRegexp)(t):"";return c?l?"(?:/"+p+"(?<"+f+">.+?))?":"/"+p+"(?<"+f+">.+?)":"/"+p+"(?<"+f+">[^/]+?)"}function f(e,t){let n;let u=(0,i.removeTrailingSlash)(e).slice(1).split("/"),s=(n=0,()=>{let e="",t=++n;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),l={};return{namedParameterizedRoute:u.map(e=>{let n=o.INTERCEPTION_ROUTE_MARKERS.some(t=>e.startsWith(t)),i=e.match(/\[((?:\[.*\])|.+)\]/);if(n&&i){let[n]=e.split(i[0]);return c({getSafeRouteKey:s,interceptionMarker:n,segment:i[1],routeKeys:l,keyPrefix:t?r.NEXT_INTERCEPTION_MARKER_PREFIX:void 0})}return i?c({getSafeRouteKey:s,segment:i[1],routeKeys:l,keyPrefix:t?r.NEXT_QUERY_PARAM_PREFIX:void 0}):"/"+(0,a.escapeStringRegexp)(e)}).join(""),routeKeys:l}}function d(e,t){let n=f(e,t);return{...l(e),namedRegex:"^"+n.namedParameterizedRoute+"(?:/)?$",routeKeys:n.routeKeys}}function p(e,t){let{parameterizedRoute:n}=s(e),{catchAll:r=!0}=t;if("/"===n)return{namedRegex:"^/"+(r?".*":"")+"$"};let{namedParameterizedRoute:o}=f(e,!1);return{namedRegex:"^"+o+(r?"(?:(/.*)?)":"")+"$"}}},14777:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return r}});class n{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e){void 0===e&&(e="/");let t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let n=t.map(t=>this.children.get(t)._smoosh(""+e+t+"/")).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&n.push(...this.children.get("[]")._smoosh(e+"["+this.slugName+"]/")),!this.placeholder){let t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'+t+'" and "'+t+"[[..."+this.optionalRestSlugName+']]").');n.unshift(t)}return null!==this.restSlugName&&n.push(...this.children.get("[...]")._smoosh(e+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&n.push(...this.children.get("[[...]]")._smoosh(e+"[[..."+this.optionalRestSlugName+"]]/")),n}_insert(e,t,r){if(0===e.length){this.placeholder=!1;return}if(r)throw Error("Catch-all must be the last part of the URL.");let o=e[0];if(o.startsWith("[")&&o.endsWith("]")){let n=o.slice(1,-1),i=!1;if(n.startsWith("[")&&n.endsWith("]")&&(n=n.slice(1,-1),i=!0),n.startsWith("...")&&(n=n.substring(3),r=!0),n.startsWith("[")||n.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+n+"').");if(n.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+n+"').");function a(e,n){if(null!==e&&e!==n)throw Error("You cannot use different slug names for the same dynamic path ('"+e+"' !== '"+n+"').");t.forEach(e=>{if(e===n)throw Error('You cannot have the same slug name "'+n+'" repeat within a single dynamic path');if(e.replace(/\W/g,"")===o.replace(/\W/g,""))throw Error('You cannot have the slug names "'+e+'" and "'+n+'" differ only by non-word symbols within a single dynamic path')}),t.push(n)}if(r){if(i){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+e[0]+'" ).');a(this.optionalRestSlugName,n),this.optionalRestSlugName=n,o="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+e[0]+'").');a(this.restSlugName,n),this.restSlugName=n,o="[...]"}}else{if(i)throw Error('Optional route parameters are not yet supported ("'+e[0]+'").');a(this.slugName,n),this.slugName=n,o="[]"}}this.children.has(o)||this.children.set(o,new n),this.children.get(o)._insert(e.slice(1),t,r)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function r(e){let t=new n;return e.forEach(e=>t.insert(e)),t.smoosh()}},3987:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DecodeError:function(){return h},MiddlewareNotFoundError:function(){return E},MissingStaticPage:function(){return m},NormalizeError:function(){return _},PageNotFoundError:function(){return g},SP:function(){return d},ST:function(){return p},WEB_VITALS:function(){return n},execOnce:function(){return r},getDisplayName:function(){return s},getLocationOrigin:function(){return i},getURL:function(){return u},isAbsoluteUrl:function(){return a},isResSent:function(){return l},loadGetInitialProps:function(){return f},normalizeRepeatedSlashes:function(){return c},stringifyError:function(){return R}});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function r(e){let t,n=!1;return function(){for(var r=arguments.length,o=Array(r),a=0;a<r;a++)o[a]=arguments[a];return n||(n=!0,t=e(...o)),t}}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,a=e=>o.test(e);function i(){let{protocol:e,hostname:t,port:n}=window.location;return e+"//"+t+(n?":"+n:"")}function u(){let{href:e}=window.location,t=i();return e.substring(t.length)}function s(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function l(e){return e.finished||e.headersSent}function c(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function f(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await f(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&l(n))return r;if(!r)throw Error('"'+s(e)+'.getInitialProps()" should resolve to an object. But found "'+r+'" instead.');return r}let d="undefined"!=typeof performance,p=d&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class h extends Error{}class _ extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class m extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class E extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function R(e){return JSON.stringify({message:e.message,stack:e.stack})}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{22241:function(n,e,r){Promise.resolve().then(r.t.bind(r,2778,23)),Promise.resolve().then(r.bind(r,91795))},91795:function(n,e,r){"use strict";r.d(e,{AppProviders:function(){return s}});var t=r(57437),i=r(43241),u=r(34021);function s(n){let{children:e}=n;return(0,t.jsx)(i.Hn,{children:(0,t.jsx)(u._I,{children:e})})}},2778:function(){}},function(n){n.O(0,[2461,816,2971,2117,1744],function(){return n(n.s=22241)}),_N_E=n.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1931],{14564:function(e,t,a){Promise.resolve().then(a.bind(a,89707))},89707:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return w}});var s=a(57437),r=a(2265),l=a(66625),n=a(27648),i=a(10789),c=a(94747),o=a(69073),d=a(3227);function x(e){let{worktree:t,onSessionKilled:a,onStatusChanged:l}=e,{id:x,name:m,description:p,updatedAt:h,isSessionRunning:u,isWaitingForResponse:g,favorite:y,status:b,link:f}=t,[j,v]=(0,r.useState)(!1),[N,w]=(0,r.useState)(y||!1),[k,C]=(0,r.useState)(!1),[S,z]=(0,r.useState)(b||null),[P,A]=(0,r.useState)(!1),E=h?(0,c.Q)(new Date(h),{addSuffix:!0,locale:o.ja}):null,L="main"===m||"master"===m,D=async e=>{if(e.preventDefault(),e.stopPropagation(),confirm("「".concat(m,"」のセッションを終了しますか?\n\n※全てのメッセージ履歴が削除されます。ログファイルは保持されます。")))try{v(!0),await d.Iv.killSession(x),a&&a()}catch(t){let e=(0,d.zG)(t);alert("セッションの終了に失敗しました: ".concat(e))}finally{v(!1)}},T=async e=>{e.preventDefault(),e.stopPropagation();try{C(!0);let e=!N;await d.Iv.toggleFavorite(x,e),w(e)}catch(t){let e=(0,d.zG)(t);alert("お気に入りの更新に失敗しました: ".concat(e))}finally{C(!1)}},R=async(e,t)=>{t.preventDefault(),t.stopPropagation();try{A(!0),await d.Iv.updateStatus(x,e),z(e),l&&l()}catch(t){let e=(0,d.zG)(t);alert("ステータスの更新に失敗しました: ".concat(e))}finally{A(!1)}};return(0,s.jsx)(n.default,{href:"/worktrees/".concat(x),className:"block",children:(0,s.jsxs)(i.Zb,{hover:!0,padding:"lg",className:"h-full",children:[(0,s.jsx)(i.Ol,{children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)(i.ll,{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("button",{onClick:T,disabled:k,className:"flex-shrink-0 transition-colors hover:scale-110",title:N?"お気に入りを解除":"お気に入りに追加",children:(0,s.jsx)("svg",{className:"w-5 h-5 ".concat(N?"fill-yellow-400 text-yellow-400":"fill-none text-gray-400"),stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})}),(0,s.jsx)("span",{className:"truncate",children:m}),L&&(0,s.jsx)(i.Ct,{variant:"info",children:"Main"}),u&&g&&(0,s.jsx)(i.Ct,{variant:"warning",dot:!0,children:"レスポンス待ち"}),u&&!g&&(0,s.jsx)(i.Ct,{variant:"success",dot:!0,children:"レスポンス完了"})]}),u&&(0,s.jsx)(i.zx,{variant:"danger",size:"sm",onClick:D,disabled:j,className:"flex-shrink-0",children:j?"終了中...":"終了"})]})}),(0,s.jsx)(i.aY,{children:(0,s.jsxs)("div",{className:"space-y-3",children:[p&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:"Description"}),(0,s.jsx)("p",{className:"text-sm text-gray-700 line-clamp-2 whitespace-pre-wrap",children:p})]}),f&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:"Link"}),(0,s.jsxs)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation(),f&&window.open(f,"_blank","noopener,noreferrer")},className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800 hover:underline transition-colors",title:"Open link in new tab",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),(0,s.jsx)("span",{className:"truncate",children:f})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:"Status"}),(0,s.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[(0,s.jsx)("button",{onClick:e=>R(null,e),disabled:P,className:"px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ".concat(null===S?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"),children:"Not set"}),(0,s.jsx)("button",{onClick:e=>R("todo",e),disabled:P,className:"px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ".concat("todo"===S?"bg-gray-100 text-gray-700 border-gray-400":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50"),children:"ToDo"}),(0,s.jsx)("button",{onClick:e=>R("doing",e),disabled:P,className:"px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ".concat("doing"===S?"bg-blue-100 text-blue-700 border-blue-400":"bg-white text-gray-600 border-gray-200 hover:bg-blue-50"),children:"Doing"}),(0,s.jsx)("button",{onClick:e=>R("done",e),disabled:P,className:"px-2 py-1 text-xs font-medium rounded border transition-colors disabled:opacity-50 ".concat("done"===S?"bg-green-100 text-green-700 border-green-400":"bg-white text-gray-600 border-gray-200 hover:bg-green-50"),children:"Done"})]})]}),E&&(0,s.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,s.jsx)("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,s.jsxs)("span",{children:["Updated ",E]})]})]})})]})})}function m(e){let{initialWorktrees:t=[]}=e,[a,l]=(0,r.useState)(t),[n,c]=(0,r.useState)([]),[o,m]=(0,r.useState)(!t.length),[p,h]=(0,r.useState)(null),[u,g]=(0,r.useState)(""),[y,b]=(0,r.useState)("updated"),[f,j]=(0,r.useState)("desc"),[v,N]=(0,r.useState)(null),[w,k]=(0,r.useState)(null),[C,S]=(0,r.useState)(null),[z,P]=(0,r.useState)([]),[A,E]=(0,r.useState)(!1),[L,D]=(0,r.useState)(null),T=(0,r.useCallback)(async()=>{try{let e=await d.J1.getExcluded();e.success&&P(e.repositories)}catch(e){}},[]),R=(0,r.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{e||m(!0),h(null);let t=await d.Iv.getAll();l(t.worktrees),c(t.repositories)}catch(e){h((0,d.zG)(e))}finally{e||m(!1)}},[]),I=e=>!!(e&&"session_status_changed"===e.type),{status:O}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{worktreeIds:t=[],onMessage:a,onStatusChange:s,autoReconnect:l=!0,reconnectDelay:n=3e3}=e,[i,c]=(0,r.useState)("disconnected"),o=(0,r.useRef)(null),d=(0,r.useRef)(),x=(0,r.useRef)(new Set),m=(0,r.useCallback)(e=>{c(e),null==s||s(e)},[s]),p=(0,r.useCallback)(()=>{var e;if((null===(e=o.current)||void 0===e?void 0:e.readyState)===WebSocket.OPEN)return;m("connecting");let t="https:"===window.location.protocol?"wss:":"ws:",s=new WebSocket("".concat(t,"//").concat(window.location.host));s.onopen=()=>{m("connected"),x.current.forEach(e=>{s.send(JSON.stringify({type:"subscribe",worktreeId:e}))})},s.onmessage=e=>{try{let t=JSON.parse(e.data);null==a||a(t)}catch(e){console.error("Failed to parse WebSocket message:",e)}},s.onerror=()=>{m("error")},s.onclose=()=>{m("disconnected"),o.current=null,l&&(d.current=setTimeout(()=>{p()},n))},o.current=s},[m,a,l,n]),h=(0,r.useCallback)(()=>{d.current&&clearTimeout(d.current),o.current&&(o.current.close(1e3,"Client disconnect"),o.current=null),m("disconnected")},[m]),u=(0,r.useCallback)(e=>{var t;(null===(t=o.current)||void 0===t?void 0:t.readyState)===WebSocket.OPEN&&(o.current.send(JSON.stringify({type:"subscribe",worktreeId:e})),x.current.add(e))},[]),g=(0,r.useCallback)(e=>{var t;(null===(t=o.current)||void 0===t?void 0:t.readyState)===WebSocket.OPEN&&(o.current.send(JSON.stringify({type:"unsubscribe",worktreeId:e})),x.current.delete(e))},[]),y=(0,r.useCallback)(e=>{var t;(null===(t=o.current)||void 0===t?void 0:t.readyState)===WebSocket.OPEN&&o.current.send(JSON.stringify(e))},[]);return(0,r.useEffect)(()=>(p(),()=>{h()}),[]),(0,r.useEffect)(()=>{"connected"===i&&t.length>0&&t.forEach(e=>{u(e)})},[i,t]),{status:i,subscribe:u,unsubscribe:g,sendMessage:y,connect:p,disconnect:h}}({onMessage:(0,r.useCallback)(e=>{if(I(e.data)){let t=e.data;l(e=>e.map(e=>e.id===t.worktreeId?{...e,isSessionRunning:t.isRunning}:e))}"broadcast"===e.type&&R(!0)},[R])});(0,r.useEffect)(()=>{t.length||R(),T()},[t.length,R,T]),(0,r.useEffect)(()=>{let e=setInterval(()=>{R(!0)},5e3);return()=>clearInterval(e)},[R]);let M=(0,r.useMemo)(()=>{let e=[...a];if(v&&(e=e.filter(e=>e.repositoryPath===v)),null!==w&&(e="unset"===w?e.filter(e=>!e.status):e.filter(e=>e.status===w)),u){let t=u.toLowerCase();e=e.filter(e=>{var a,s;return e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t)||(null===(a=e.lastMessageSummary)||void 0===a?void 0:a.toLowerCase().includes(t))||(null===(s=e.description)||void 0===s?void 0:s.toLowerCase().includes(t))})}return e.sort((e,t)=>{let a=0;switch(y){case"name":a=e.name.localeCompare(t.name);break;case"updated":a=(e.updatedAt?new Date(e.updatedAt).getTime():0)-(t.updatedAt?new Date(t.updatedAt).getTime():0);break;case"favorite":a=(e.favorite?1:0)-(t.favorite?1:0)}return"asc"===f?a:-a}),e},[a,v,w,u,y,f]),F=(0,r.useMemo)(()=>{let e=new Map;for(let t of M){let a=t.repositoryPath||"unknown";e.has(a)||e.set(a,[]),e.get(a).push(t)}return e},[M]),U=e=>{y===e?j(e=>"asc"===e?"desc":"asc"):(b(e),j("asc"))},W=async e=>{D(e);try{let t=await d.J1.restore(e);t.warning&&h(t.warning),await R(),await T()}catch(e){h((0,d.zG)(e))}finally{D(null)}},_=async(e,t)=>{var a;let s=(null===(a=n.find(t=>t.path===e))||void 0===a?void 0:a.worktreeCount)||0;if("delete"===prompt('Delete repository "'.concat(t,'"?\n\nThis will delete:\n- ').concat(s,' worktree(s)\n- Related chat history\n- Related memos\n\n* Log files will be preserved\n\nThis repository will be added to the exclusion list.\nIt will NOT be re-registered when you run "Sync All".\nYou can restore it from the excluded repositories list.\n\nType "delete" to confirm:'))){S(e);try{await d.J1.delete(e),v===e&&N(null),await R(),await T()}catch(e){h((0,d.zG)(e))}finally{S(null)}}};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)(i.Ct,{variant:"gray",children:[a.length," branches"]}),n.length>0&&(0,s.jsxs)(i.Ct,{variant:"info",children:[n.length," ",1===n.length?"repository":"repositories"]}),"connected"===O&&(0,s.jsx)(i.Ct,{variant:"success",dot:!0,children:"Live"})]}),(0,s.jsx)("div",{className:"flex gap-2 w-full sm:w-auto",children:(0,s.jsx)(i.zx,{variant:"secondary",size:"sm",onClick:()=>R(),disabled:o,children:o?"Loading...":"Refresh"})})]}),(0,s.jsx)("div",{className:"flex flex-col sm:flex-row gap-3",children:(0,s.jsx)("input",{type:"text",placeholder:"Search worktrees...",value:u,onChange:e=>g(e.target.value),className:"input flex-1"})}),n.length>0&&(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,s.jsxs)(i.zx,{variant:null===v?"primary":"ghost",size:"sm",onClick:()=>N(null),children:["All (",a.length,")"]}),n.map(e=>(0,s.jsxs)("div",{className:"relative group inline-flex items-center",children:[(0,s.jsxs)(i.zx,{variant:v===e.path?"primary":"ghost",size:"sm",onClick:()=>N(e.path),className:"pr-6",children:[e.name," (",e.worktreeCount,")"]}),(0,s.jsx)("button",{className:"absolute right-1 opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-500 transition-opacity px-1",onClick:t=>{t.stopPropagation(),_(e.path,e.name)},disabled:C===e.path,title:"Delete repository",children:C===e.path?"...":"x"})]},e.path))]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap items-center",children:[(0,s.jsx)(i.zx,{variant:null===w?"primary":"ghost",size:"sm",onClick:()=>k(null),children:"All"}),(0,s.jsx)(i.zx,{variant:"todo"===w?"primary":"ghost",size:"sm",onClick:()=>k("todo"),children:"\uD83D\uDCDD ToDo"}),(0,s.jsx)(i.zx,{variant:"doing"===w?"primary":"ghost",size:"sm",onClick:()=>k("doing"),children:"\uD83D\uDEA7 Doing"}),(0,s.jsx)(i.zx,{variant:"done"===w?"primary":"ghost",size:"sm",onClick:()=>k("done"),children:"✅ Done"}),(0,s.jsx)(i.zx,{variant:"unset"===w?"primary":"ghost",size:"sm",onClick:()=>k("unset"),children:"Not set"})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 self-center",children:"Sort by:"}),(0,s.jsxs)(i.zx,{variant:"favorite"===y?"primary":"ghost",size:"sm",onClick:()=>U("favorite"),children:["⭐ Favorite ","favorite"===y&&("asc"===f?"↑":"↓")]}),(0,s.jsxs)(i.zx,{variant:"name"===y?"primary":"ghost",size:"sm",onClick:()=>U("name"),children:["Name ","name"===y&&("asc"===f?"↑":"↓")]}),(0,s.jsxs)(i.zx,{variant:"updated"===y?"primary":"ghost",size:"sm",onClick:()=>U("updated"),children:["Updated ","updated"===y&&("asc"===f?"↑":"↓")]})]}),p&&(0,s.jsx)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-red-800",children:p})}),o&&!a.length&&(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),(0,s.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading worktrees..."})]}),!o&&!p&&0===M.length&&(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),(0,s.jsx)("p",{className:"mt-4 text-gray-600",children:u?"No worktrees found matching your search":"No worktrees found"})]}),!o&&M.length>0&&(0,s.jsx)("div",{className:"space-y-8",children:Array.from(F.entries()).map(e=>{let[t,a]=e,r=n.find(e=>e.path===t),l=(null==r?void 0:r.name)||"Unknown Repository";return(0,s.jsxs)("div",{className:"space-y-4",children:[(n.length>1||!v)&&(0,s.jsxs)("div",{className:"flex items-center gap-3 pb-2 border-b border-gray-200",children:[(0,s.jsx)("h3",{className:"text-xl font-semibold text-gray-900",children:l}),(0,s.jsx)(i.Ct,{variant:"gray",children:a.length})]}),(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:a.map(e=>(0,s.jsx)(x,{worktree:e,onSessionKilled:R,onStatusChanged:R},e.id))})]},t)})}),z.length>0&&(0,s.jsxs)("div",{className:"border border-gray-200 rounded-lg",children:[(0,s.jsxs)("button",{className:"w-full flex items-center justify-between p-4 text-left hover:bg-gray-50 transition-colors",onClick:()=>E(!A),children:[(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Excluded Repositories (",z.length,")"]}),(0,s.jsx)("span",{className:"text-gray-400 text-sm",children:A?"Hide":"Show"})]}),A&&(0,s.jsx)("div",{className:"border-t border-gray-200 divide-y divide-gray-100",children:z.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:e.name}),(0,s.jsx)("span",{className:"text-xs text-gray-500 ml-2",children:e.path})]}),(0,s.jsx)(i.zx,{variant:"secondary",size:"sm",onClick:()=>W(e.path),disabled:L===e.path,children:L===e.path?"Restoring...":"Restore"})]},e.id))})]})]})}a(99376),a(34343),a(6940);class p{static getInstance(){return p.instance||(p.instance=new p),p.instance}normalize(e){let t=e.match(/^ssh:\/\/git@([^:\/]+)(:\d+)?\/(.+?)(\.git)?$/);if(t)return"https://".concat(t[1],"/").concat(t[3]).toLowerCase().replace(/\/$/,"");let a=e.match(/^git@([^:]+):(.+?)(\.git)?$/);return a?"https://".concat(a[1],"/").concat(a[2]).toLowerCase().replace(/\/$/,""):e.replace(/\.git\/?$/,"").replace(/\/$/,"").toLowerCase()}isSameRepository(e,t){return this.normalize(e)===this.normalize(t)}extractRepoName(e){let t=e.match(/^ssh:\/\/git@[^\/]+\/(.+?)(\.git)?$/);if(t){let e=t[1].split("/");return e[e.length-1]}let a=e.match(/:(.+?)(\.git)?$/);if(a&&e.startsWith("git@")){let e=a[1].split("/");return e[e.length-1]}let s=e.match(/\/([^\/]+?)(\.git)?$/);return s?s[1]:""}getUrlType(e){return e.startsWith("https://")?"https":e.startsWith("git@")||e.startsWith("ssh://")?"ssh":null}validate(e){if(!e||"string"!=typeof e||""===e.trim())return{valid:!1,error:"EMPTY_URL"};let t=e.trim();return t.startsWith("https://")?/^https:\/\/[^\/]+\/[^\/]+\/[^\/]+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("git@")?/^git@[^:]+:.+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}:t.startsWith("ssh://")&&/^ssh:\/\/git@[^\/]+(:\d+)?\/[^\/]+\/.+(\.git)?$/.test(t)?{valid:!0}:{valid:!1,error:"INVALID_URL_FORMAT"}}constructor(){}}function h(e){let{onRepositoryAdded:t}=e,[a,l]=(0,r.useState)(!1),[n,c]=(0,r.useState)("local"),[o,x]=(0,r.useState)(""),[m,h]=(0,r.useState)(""),[u,g]=(0,r.useState)(!1),[y,b]=(0,r.useState)(!1),[f,j]=(0,r.useState)(!1),[v,N]=(0,r.useState)(null),[w,k]=(0,r.useState)(null),[C,S]=(0,r.useState)(null),z=p.getInstance(),P=(0,r.useCallback)(async e=>{try{let s=await d.J1.getCloneStatus(e);if("completed"===s.status)S("Repository cloned successfully"),j(!1),N(null),h(""),l(!1),t&&t();else if("failed"===s.status){var a;k((null===(a=s.error)||void 0===a?void 0:a.message)||"Clone failed"),j(!1),N(null)}else("running"===s.status||"pending"===s.status)&&setTimeout(()=>P(e),2e3)}catch(e){k((0,d.zG)(e)),j(!1),N(null)}},[t]);(0,r.useEffect)(()=>{v&&f&&P(v)},[v,f,P]);let A=async e=>{if(e.preventDefault(),!o.trim()){k("Repository path is required");return}k(null),S(null),g(!0);try{let e=await d.J1.scan(o);S(e.message),x(""),l(!1),t&&t()}catch(e){k((0,d.zG)(e))}finally{g(!1)}},E=async e=>{if(e.preventDefault(),!m.trim()){k("Clone URL is required");return}let t=z.validate(m.trim());if(!t.valid){"EMPTY_URL"===t.error?k("Clone URL is required"):k("Invalid URL format");return}k(null),S(null),j(!0);try{let e=await d.J1.clone(m.trim());N(e.jobId)}catch(e){k((0,d.zG)(e)),j(!1)}},L=async()=>{k(null),S(null),b(!0);try{let e=await d.J1.sync();S(e.message),t&&t()}catch(e){k((0,d.zG)(e))}finally{b(!1)}},D=()=>{l(!1),x(""),h(""),k(null),c("local")};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[!a&&(0,s.jsx)(i.zx,{variant:"primary",size:"sm",onClick:()=>l(!0),children:"+ Add Repository"}),(0,s.jsx)(i.zx,{variant:"secondary",size:"sm",onClick:L,disabled:y,children:y?"Syncing...":"Sync All"})]}),a&&(0,s.jsx)(i.Zb,{padding:"lg",children:(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{children:(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Add New Repository"})}),(0,s.jsxs)("div",{className:"flex border-b border-gray-200",role:"tablist",children:[(0,s.jsx)("button",{role:"tab","aria-selected":"local"===n,onClick:()=>c("local"),className:"px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ".concat("local"===n?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"),children:"Local Path"}),(0,s.jsx)("button",{role:"tab","aria-selected":"url"===n,onClick:()=>c("url"),className:"px-4 py-2 text-sm font-medium border-b-2 -mb-px transition-colors ".concat("url"===n?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"),children:"Clone URL"})]}),"local"===n&&(0,s.jsxs)("form",{onSubmit:A,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Enter the absolute path to a git repository containing worktrees."}),(0,s.jsx)("label",{htmlFor:"repositoryPath",className:"block text-sm font-medium text-gray-700 mb-2",children:"Repository Path"}),(0,s.jsx)("input",{id:"repositoryPath",type:"text",value:o,onChange:e=>x(e.target.value),placeholder:"/absolute/path/to/repository",className:"input w-full font-mono text-sm",disabled:u}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Example: /Users/username/projects/my-repo"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.zx,{type:"submit",variant:"primary",disabled:u||!o.trim(),children:u?"Scanning...":"Scan & Add"}),(0,s.jsx)(i.zx,{type:"button",variant:"ghost",onClick:D,disabled:u,children:"Cancel"})]})]}),"url"===n&&(0,s.jsxs)("form",{onSubmit:E,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Enter a git clone URL to clone a remote repository."}),(0,s.jsx)("label",{htmlFor:"cloneUrl",className:"block text-sm font-medium text-gray-700 mb-2",children:"Clone URL"}),(0,s.jsx)("input",{id:"cloneUrl",type:"text",value:m,onChange:e=>h(e.target.value),placeholder:"https://github.com/user/repo.git",className:"input w-full font-mono text-sm",disabled:f}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Supports HTTPS and SSH URLs"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.zx,{type:"submit",variant:"primary",disabled:f||!m.trim(),children:f?"Cloning...":"Clone"}),(0,s.jsx)(i.zx,{type:"button",variant:"ghost",onClick:D,disabled:f,children:"Cancel"})]})]})]})}),C&&(0,s.jsx)("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-green-800",children:C})}),w&&(0,s.jsx)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:(0,s.jsx)("p",{className:"text-sm text-red-800",children:w})})]})}function u(e){var t;let{appId:a,pollInterval:l=3e4,showResponseTime:n=!1,compact:i=!1}=e,[c,o]=(0,r.useState)(null),[d,x]=(0,r.useState)(!0),m=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/external-apps/".concat(a,"/health"));if(e.ok){let t=await e.json();o(t)}else o({id:a,healthy:!1,lastChecked:Date.now(),error:"Failed to check health"})}catch(e){o({id:a,healthy:!1,lastChecked:Date.now(),error:"Network error"})}finally{x(!1)}},[a]);if((0,r.useEffect)(()=>{m();let e=setInterval(m,l);return()=>clearInterval(e)},[m,l]),d)return(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-gray-300 animate-pulse"}),!i&&(0,s.jsx)("span",{className:"text-xs text-gray-400",children:"Checking..."})]});let p=null!==(t=null==c?void 0:c.healthy)&&void 0!==t&&t,h=p?"bg-green-500":"bg-gray-400",u=p?"Running":"Stopped";return i?(0,s.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full ".concat(h),title:u}):(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full ".concat(h)}),(0,s.jsx)("span",{className:"text-xs ".concat(p?"text-green-600":"text-gray-500"),children:u}),n&&(null==c?void 0:c.responseTime)!==void 0&&(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["(",c.responseTime,"ms)"]})]})}function g(e){var t;let{app:a,onEdit:l,onDelete:n}=e,[c,o]=(0,r.useState)(!1),[d,x]=(0,r.useState)(!1),m=async()=>{x(!0);try{await n(a.id)}finally{x(!1),o(!1)}},p="/proxy/".concat(a.pathPrefix,"/");return(0,s.jsxs)(i.Zb,{padding:"md",className:"relative",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h4",{className:"text-base font-semibold text-gray-900 truncate",children:a.displayName}),(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:a.name})]}),(0,s.jsx)(i.Ct,{variant:{sveltekit:"warning",streamlit:"error",nextjs:"info",other:"gray"}[a.appType]||"gray",children:{sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"}[t=a.appType]||t})]}),(0,s.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600",children:"Status"}),(0,s.jsx)(u,{appId:a.id,pollInterval:3e4})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600",children:"Port"}),(0,s.jsxs)("span",{className:"text-sm font-mono text-gray-900",children:[":",a.targetPort]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600",children:"Path"}),(0,s.jsxs)("span",{className:"text-sm font-mono text-gray-900 truncate max-w-[150px]",children:["/proxy/",a.pathPrefix,"/"]})]}),a.websocketEnabled&&(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-gray-600",children:"WebSocket"}),(0,s.jsx)(i.Ct,{variant:"info",children:"Enabled"})]}),!a.enabled&&(0,s.jsx)("div",{className:"mt-2 py-1 px-2 bg-yellow-50 border border-yellow-200 rounded text-xs text-yellow-700",children:"This app is disabled"})]}),c?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("p",{className:"text-sm text-gray-600",children:['Delete "',a.displayName,'"?']}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(i.zx,{variant:"danger",size:"sm",onClick:m,disabled:d,loading:d,children:"Delete"}),(0,s.jsx)(i.zx,{variant:"ghost",size:"sm",onClick:()=>o(!1),disabled:d,children:"Cancel"})]})]}):(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsx)(i.zx,{variant:"primary",size:"sm",onClick:()=>window.open(p,"_blank"),disabled:!a.enabled,children:"Open"}),(0,s.jsx)(i.zx,{variant:"secondary",size:"sm",onClick:()=>l(a),children:"Settings"}),(0,s.jsx)(i.zx,{variant:"ghost",size:"sm",onClick:()=>o(!0),className:"text-red-600 hover:bg-red-50",children:"Delete"})]})]})}let y={MIN:1024,MAX:65535},b=/^[a-zA-Z0-9-]+$/,f={sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"},j=["sveltekit","streamlit","nextjs","other"].map(e=>({value:e,label:f[e]}));function v(e){let{isOpen:t,onClose:a,editApp:l,onSave:n}=e,c=!!l,[o,d]=(0,r.useState)(""),[x,m]=(0,r.useState)(""),[p,h]=(0,r.useState)(""),[u,g]=(0,r.useState)(""),[f,v]=(0,r.useState)(""),[N,w]=(0,r.useState)(!1),[k,C]=(0,r.useState)(""),[S,z]=(0,r.useState)(!0),[P,A]=(0,r.useState)({}),[E,L]=(0,r.useState)(!1),[D,T]=(0,r.useState)(null);(0,r.useEffect)(()=>{t&&(l?(d(l.displayName),m(l.name),h(l.pathPrefix),g(l.targetPort),v(l.appType),w(l.websocketEnabled),C(l.description||""),z(l.enabled)):(d(""),m(""),h(""),g(""),v(""),w(!1),C(""),z(!0)),A({}),T(null))},[t,l]);let R=async e=>{e.preventDefault(),T(null);let t=function(e,t){var a,s,r,l;let n={};return((null===(a=e.displayName)||void 0===a?void 0:a.trim())||(n.displayName="Display name is required"),t||((null===(s=e.name)||void 0===s?void 0:s.trim())?b.test(e.name)||(n.name="Only alphanumeric characters and hyphens are allowed"):n.name="Identifier name is required",(null===(r=e.pathPrefix)||void 0===r?void 0:r.trim())?b.test(e.pathPrefix)||(n.pathPrefix="Only alphanumeric characters and hyphens are allowed"):n.pathPrefix="Path prefix is required"),e.targetPort)?"number"!=typeof e.targetPort||Number.isInteger(l=e.targetPort)&&l>=y.MIN&&l<=y.MAX||(n.targetPort="Port must be between ".concat(y.MIN," and ").concat(y.MAX)):n.targetPort="Port number is required",t||e.appType||(n.appType="App type is required"),n}({displayName:o,name:x,pathPrefix:p,targetPort:u,appType:f},c);if(Object.keys(t).length>0){A(t);return}A({}),L(!0);try{if(c&&l){let e=await fetch("/api/external-apps/".concat(l.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,description:k||void 0,targetPort:u||void 0,websocketEnabled:N,enabled:S})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to update app")}}else{let e=await fetch("/api/external-apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:o,name:x,pathPrefix:p,targetPort:u,appType:f,websocketEnabled:N,description:k||void 0})});if(!e.ok){let t=await e.json();throw Error(t.error||"Failed to create app")}}n(),a()}catch(e){T(e instanceof Error?e.message:"An error occurred")}finally{L(!1)}};return(0,s.jsx)(i.u_,{isOpen:t,onClose:a,title:c?"Edit External App":"Add External App",size:"md",children:(0,s.jsxs)("form",{onSubmit:R,className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"displayName",className:"block text-sm font-medium text-gray-700 mb-1",children:["Display Name ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{id:"displayName",type:"text",value:o,onChange:e=>d(e.target.value),className:"input w-full ".concat(P.displayName?"border-red-500":""),placeholder:"My App",disabled:E}),P.displayName&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-500",children:P.displayName})]}),!c&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:["Identifier Name ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{id:"name",type:"text",value:x,onChange:e=>m(e.target.value),className:"input w-full font-mono ".concat(P.name?"border-red-500":""),placeholder:"my-app",disabled:E}),(0,s.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:"Alphanumeric and hyphens only. Cannot be changed later."}),P.name&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-500",children:P.name})]}),!c&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"pathPrefix",className:"block text-sm font-medium text-gray-700 mb-1",children:["Path Prefix ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("span",{className:"text-sm text-gray-500 mr-1",children:"/proxy/"}),(0,s.jsx)("input",{id:"pathPrefix",type:"text",value:p,onChange:e=>h(e.target.value),className:"input flex-1 font-mono ".concat(P.pathPrefix?"border-red-500":""),placeholder:"app-name",disabled:E}),(0,s.jsx)("span",{className:"text-sm text-gray-500 ml-1",children:"/"})]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:"URL path for accessing this app. Cannot be changed later."}),P.pathPrefix&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-500",children:P.pathPrefix})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"targetPort",className:"block text-sm font-medium text-gray-700 mb-1",children:["Port Number ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("input",{id:"targetPort",type:"number",value:u,onChange:e=>g(e.target.value?parseInt(e.target.value,10):""),className:"input w-full font-mono ".concat(P.targetPort?"border-red-500":""),placeholder:"5173",min:y.MIN,max:y.MAX,disabled:E}),(0,s.jsxs)("p",{className:"mt-1 text-xs text-gray-500",children:["Target port (",y.MIN,"-",y.MAX,")"]}),P.targetPort&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-500",children:P.targetPort})]}),!c&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{htmlFor:"appType",className:"block text-sm font-medium text-gray-700 mb-1",children:["App Type ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsxs)("select",{id:"appType",value:f,onChange:e=>v(e.target.value),className:"input w-full ".concat(P.appType?"border-red-500":""),disabled:E,children:[(0,s.jsx)("option",{value:"",children:"Select app type..."}),j.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))]}),P.appType&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-500",children:P.appType})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),(0,s.jsx)("textarea",{id:"description",value:k,onChange:e=>C(e.target.value),className:"input w-full",placeholder:"Optional description...",rows:2,disabled:E})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("input",{id:"websocketEnabled",type:"checkbox",checked:N,onChange:e=>w(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:E}),(0,s.jsx)("label",{htmlFor:"websocketEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable WebSocket support"})]}),c&&(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("input",{id:"enabled",type:"checkbox",checked:S,onChange:e=>z(e.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",disabled:E}),(0,s.jsx)("label",{htmlFor:"enabled",className:"ml-2 text-sm text-gray-700",children:"App is enabled"})]}),D&&(0,s.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded text-sm text-red-700",children:D}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-200",children:[(0,s.jsx)(i.zx,{type:"button",variant:"ghost",onClick:a,disabled:E,children:"Cancel"}),(0,s.jsx)(i.zx,{type:"submit",variant:"primary",loading:E,children:c?"Save Changes":"Add App"})]})]})})}function N(){let[e,t]=(0,r.useState)([]),[a,l]=(0,r.useState)(!0),[n,c]=(0,r.useState)(null),[o,d]=(0,r.useState)(!1),[x,m]=(0,r.useState)(null),p=(0,r.useCallback)(async()=>{try{c(null);let e=await fetch("/api/external-apps");if(!e.ok)throw Error("Failed to fetch external apps");let a=await e.json();t(a.apps||[])}catch(e){c(e instanceof Error?e.message:"An error occurred")}finally{l(!1)}},[]);(0,r.useEffect)(()=>{p();let e=setInterval(p,6e4);return()=>clearInterval(e)},[p]);let h=(0,r.useCallback)(e=>{m(e),d(!0)},[]),u=(0,r.useCallback)(()=>{m(null),d(!0)},[]),y=(0,r.useCallback)(async e=>{try{let t=await fetch("/api/external-apps/".concat(e),{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to delete app")}p()}catch(e){console.error("Failed to delete app:",e)}},[p]),b=(0,r.useCallback)(()=>{p()},[p]),f=(0,r.useCallback)(()=>{d(!1),m(null)},[]);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"External Apps"}),(0,s.jsx)(i.zx,{variant:"primary",size:"sm",onClick:u,children:"+ Add App"})]}),a?(0,s.jsx)(i.Zb,{padding:"lg",children:(0,s.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"}),(0,s.jsx)("span",{className:"ml-3 text-gray-600",children:"Loading apps..."})]})}):n?(0,s.jsx)(i.Zb,{padding:"lg",children:(0,s.jsxs)("div",{className:"text-center py-8",children:[(0,s.jsx)("p",{className:"text-red-600 mb-4",children:"Failed to load external apps"}),(0,s.jsx)(i.zx,{variant:"secondary",size:"sm",onClick:p,children:"Retry"})]})}):0===e.length?(0,s.jsx)(i.Zb,{padding:"lg",children:(0,s.jsxs)("div",{className:"text-center py-8",children:[(0,s.jsx)("p",{className:"text-gray-500 mb-4",children:"No external apps registered yet."}),(0,s.jsx)("p",{className:"text-sm text-gray-400 mb-4",children:"Add an external app to proxy requests to other frontend applications."}),(0,s.jsx)(i.zx,{variant:"primary",size:"sm",onClick:u,children:"Add Your First App"})]})}):(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(e=>(0,s.jsx)(g,{app:e,onEdit:h,onDelete:y},e.id))}),(0,s.jsx)(v,{isOpen:o,onClose:f,editApp:x,onSave:b})]})}function w(){let[e,t]=(0,r.useState)(0),a=(0,r.useCallback)(()=>{t(e=>e+1)},[]);return(0,s.jsx)(l.Vw,{children:(0,s.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,s.jsxs)("div",{className:"mb-8",children:[(0,s.jsx)("h1",{className:"mb-2",children:"CommandMate"}),(0,s.jsx)("p",{className:"text-lg text-gray-600",children:"Git worktree management with Claude CLI and tmux sessions"})]}),(0,s.jsx)("div",{className:"mb-8",children:(0,s.jsx)(h,{onRepositoryAdded:a})}),(0,s.jsx)(m,{},e),(0,s.jsx)("div",{className:"mt-8",children:(0,s.jsx)(N,{})})]})})}}},function(e){e.O(0,[7648,4343,6725,816,6568,2971,2117,1744],function(){return e(e.s=14564)}),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5441],{20084:function(e,r,s){Promise.resolve().then(s.bind(s,50653))},50653:function(e,r,s){"use strict";s.r(r),s.d(r,{default:function(){return d}});var n=s(57437),t=s(2265),a=s(99376),o=s(10789),l=s(53012),c=s(23260),i=s(12158);function d(){let e=(0,a.useRouter)(),r=(0,a.useParams)(),s=r.id,d=r.path.join("/"),[m,x]=(0,t.useState)(null),[u,h]=(0,t.useState)(!0),[p,g]=(0,t.useState)(null),b=(null==m?void 0:m.extension)==="md"||(null==m?void 0:m.extension)==="markdown";return(0,t.useEffect)(()=>{(async()=>{h(!0),g(null);try{let e=await fetch("/api/worktrees/".concat(s,"/files/").concat(d));if(!e.ok){let r=await e.json();throw Error(r.error||"Failed to load file")}let r=await e.json();x(r)}catch(e){g(e instanceof Error?e.message:"Failed to load file")}finally{h(!1)}})()},[s,d]),(0,n.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,n.jsx)("div",{className:"sticky top-0 z-10 bg-white border-b border-gray-200 shadow-sm",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center gap-3",children:[(0,n.jsxs)("button",{onClick:()=>e.back(),className:"flex items-center gap-2 text-gray-600 hover:text-gray-900 transition-colors","aria-label":"戻る",children:[(0,n.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 19l-7-7m0 0l7-7m-7 7h18"})}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"戻る"})]}),(0,n.jsx)("div",{className:"flex-1 min-w-0",children:(0,n.jsx)("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:d})})]})}),(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-6",children:[u&&(0,n.jsx)(o.Zb,{padding:"lg",children:(0,n.jsxs)("div",{className:"flex items-center justify-center py-12",children:[(0,n.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-blue-600"}),(0,n.jsx)("p",{className:"ml-3 text-gray-600",children:"Loading file..."})]})}),p&&(0,n.jsx)(o.Zb,{padding:"lg",children:(0,n.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("svg",{className:"w-5 h-5 text-red-600 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,n.jsx)("p",{className:"text-sm text-red-800",children:p})]})})}),m&&!u&&!p&&(0,n.jsxs)(o.Zb,{padding:"none",children:[(0,n.jsx)("div",{className:"bg-gray-100 px-4 py-3 border-b border-gray-200",children:(0,n.jsxs)("p",{className:"text-xs text-gray-600 font-mono break-all",children:[m.worktreePath,"/",m.path]})}),(0,n.jsx)("div",{className:"p-6 sm:p-8 bg-white",children:b?(0,n.jsx)("div",{className:"prose prose-slate max-w-none prose-headings:font-semibold prose-h1:text-3xl prose-h1:border-b prose-h1:pb-2 prose-h2:text-2xl prose-h2:border-b prose-h2:pb-2 prose-h3:text-xl prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline prose-pre:bg-gray-100 prose-pre:border prose-pre:border-gray-200 prose-code:text-sm prose-code:bg-gray-100 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:before:content-none prose-code:after:content-none prose-img:rounded-lg prose-img:shadow-md",children:(0,n.jsx)(l.UG,{remarkPlugins:[c.Z],rehypePlugins:[i.Z],components:{code:e=>{let{inline:r,className:s,children:t,...a}=e;return r?(0,n.jsx)("code",{className:"bg-gray-100 text-gray-800 px-1.5 py-0.5 rounded text-sm font-mono",...a,children:t}):(0,n.jsx)("code",{className:s,...a,children:t})},pre:e=>{let{children:r}=e;return(0,n.jsx)("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-4 overflow-x-auto",children:r})},table:e=>{let{children:r}=e;return(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsx)("table",{className:"border-collapse border border-gray-300",children:r})})},th:e=>{let{children:r}=e;return(0,n.jsx)("th",{className:"border border-gray-300 bg-gray-100 px-4 py-2 text-left font-semibold",children:r})},td:e=>{let{children:r}=e;return(0,n.jsx)("td",{className:"border border-gray-300 px-4 py-2",children:r})},blockquote:e=>{let{children:r}=e;return(0,n.jsx)("blockquote",{className:"border-l-4 border-gray-300 pl-4 italic text-gray-700",children:r})}},children:m.content})}):(0,n.jsx)("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-4 overflow-x-auto text-sm",children:(0,n.jsx)("code",{className:"language-".concat(m.extension),children:m.content})})})]})]})]})}},98702:function(e,r,s){"use strict";s.d(r,{u:function(){return a}});var n=s(57437),t=s(2265);function a(e){let{isOpen:r,onClose:s,title:a,children:o,size:l="lg",showCloseButton:c=!0,disableClose:i=!1}=e,d=(0,t.useRef)(null);return((0,t.useEffect)(()=>{if(i)return;let e=e=>{"Escape"===e.key&&r&&s()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r,s,i]),(0,t.useEffect)(()=>(r?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[r]),r)?(0,n.jsxs)("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[(0,n.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:i?void 0:s}),(0,n.jsx)("div",{className:"flex min-h-full items-center justify-center p-2 sm:p-4",children:(0,n.jsxs)("div",{ref:d,className:"relative w-full ".concat({sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}[l]," bg-white rounded-lg shadow-xl transform transition-all"),children:[(a||c)&&(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-gray-200",children:[(0,n.jsx)("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate pr-2",children:a}),c&&(0,n.jsx)("button",{onClick:s,className:"text-gray-400 hover:text-gray-600 transition-colors flex-shrink-0",children:(0,n.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4",children:o})]})})]}):null}},10789:function(e,r,s){"use strict";s.d(r,{Ct:function(){return i},zx:function(){return t},Zb:function(){return a},aY:function(){return c},Ol:function(){return o},ll:function(){return l},u_:function(){return d.u}});var n=s(57437);function t(e){let{variant:r="primary",size:s="md",fullWidth:t=!1,loading:a=!1,disabled:o,className:l="",children:c,...i}=e,d=["btn",{primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-500"}[r],{sm:"btn-sm",md:"",lg:"btn-lg"}[s],t?"w-full":"",o||a?"opacity-50 cursor-not-allowed":"",l].filter(Boolean).join(" ");return(0,n.jsxs)("button",{className:d,disabled:o||a,...i,children:[a&&(0,n.jsxs)("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),c]})}function a(e){let{hover:r=!1,padding:s="md",className:t="",children:a,...o}=e,l=["card",r?"card-hover":"",{none:"",sm:"p-3",md:"p-4",lg:"p-6"}[s],t].filter(Boolean).join(" ");return(0,n.jsx)("div",{className:l,...o,children:a})}function o(e){let{className:r="",children:s,...t}=e;return(0,n.jsx)("div",{className:"mb-3 ".concat(r),...t,children:s})}function l(e){let{className:r="",children:s,...t}=e;return(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-900 ".concat(r),...t,children:s})}function c(e){let{className:r="",children:s,...t}=e;return(0,n.jsx)("div",{className:r,...t,children:s})}function i(e){let{variant:r="gray",dot:s=!1,className:t="",children:a,...o}=e,l=["badge",{success:"badge-success",warning:"badge-warning",error:"badge-error",info:"badge-info",gray:"badge-gray"}[r],t].filter(Boolean).join(" ");return(0,n.jsxs)("span",{className:l,...o,children:[s&&(0,n.jsx)("span",{className:"mr-1.5 inline-block h-2 w-2 rounded-full ".concat({success:"bg-green-600",warning:"bg-yellow-600",error:"bg-red-600",info:"bg-blue-600",gray:"bg-gray-600"}[r]),"aria-hidden":"true"}),a]})}s(2265);var d=s(98702)}},function(e){e.O(0,[4851,2971,2117,1744],function(){return e(e.s=20084)}),_N_E=e.O()}]);