failproofai 0.0.9-beta.1 → 0.0.9

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 (154) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +6 -6
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/required-server-files.json +1 -1
  5. package/.next/standalone/.next/server/app/_global-error/page/build-manifest.json +3 -3
  6. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  11. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  12. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  13. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  14. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  15. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page/build-manifest.json +3 -3
  17. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  18. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  21. package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
  22. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  23. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  24. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  25. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  26. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  27. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  28. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js +1 -2
  29. package/.next/standalone/.next/server/app/api/download/[project]/[session]/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/index.html +1 -1
  31. package/.next/standalone/.next/server/app/index.rsc +15 -15
  32. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  33. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  34. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  35. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
  36. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  37. package/.next/standalone/.next/server/app/page/build-manifest.json +3 -3
  38. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  39. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/policies/page/build-manifest.json +3 -3
  42. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  43. package/.next/standalone/.next/server/app/policies/page.js +2 -2
  44. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/project/[name]/page/build-manifest.json +3 -3
  47. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  48. package/.next/standalone/.next/server/app/project/[name]/page.js +1 -1
  49. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/build-manifest.json +3 -3
  52. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  53. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  54. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js +4 -3
  55. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/projects/page/build-manifest.json +3 -3
  58. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  59. package/.next/standalone/.next/server/app/projects/page.js +2 -2
  60. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +1 -1
  63. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0su~k6f._.js +3 -0
  64. package/.next/standalone/.next/server/chunks/lib_codex-projects_ts_07qqk1g._.js +3 -0
  65. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
  66. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01743wx._.js +3 -0
  67. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.f_cyx._.js → [root-of-the-server]__01g_w_e._.js} +2 -2
  68. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
  69. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
  70. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0dub28-._.js → [root-of-the-server]__0_b7pgn._.js} +2 -2
  71. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
  72. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gs6wz4._.js +3 -0
  73. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
  74. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0it81ys._.js +3 -0
  75. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u4a9jq._.js +4 -0
  76. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ymlddl._.js +18 -0
  77. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
  78. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12.h2mg._.js +3 -0
  79. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
  80. package/.next/standalone/.next/server/chunks/ssr/_04w00cm._.js +3 -0
  81. package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
  82. package/.next/standalone/.next/server/chunks/ssr/app_0cdqd9w._.js +3 -0
  83. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
  84. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
  85. package/.next/standalone/.next/server/chunks/ssr/lib_codex-projects_ts_0eosib~._.js +3 -0
  86. package/.next/standalone/.next/server/chunks/ssr/lib_utils_ts_068jk73._.js +3 -0
  87. package/.next/standalone/.next/server/chunks/ssr/{_0zaq1hm._.js → node_modules_0ttbz1~._.js} +2 -2
  88. package/.next/standalone/.next/server/middleware-build-manifest.js +6 -6
  89. package/.next/standalone/.next/server/pages/404.html +2 -2
  90. package/.next/standalone/.next/server/pages/500.html +1 -1
  91. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
  93. package/.next/standalone/.next/static/chunks/{0_c_yox08g_44.js → 01q52wg_amm60.js} +2 -2
  94. package/.next/standalone/.next/static/chunks/06x4-d1~o-opr.js +1 -0
  95. package/.next/standalone/.next/static/chunks/{0bghqwo4iloy0.js → 0756i.7omnnl6.js} +1 -1
  96. package/.next/standalone/.next/static/chunks/{0p5zh2diw90a1.js → 095l4hc7-h.~~.js} +1 -1
  97. package/.next/standalone/.next/static/chunks/09ose_165ra4d.js +1 -0
  98. package/.next/standalone/.next/static/chunks/0n-_j_6fo6jex.js +6 -0
  99. package/.next/standalone/.next/static/chunks/0n~s0gafwnp2y.js +1 -0
  100. package/.next/standalone/.next/static/chunks/{0ufq8smh~i7wc.js → 0pr7k36o_.du1.js} +1 -1
  101. package/.next/standalone/.next/static/chunks/{0z-jh701rc~j8.js → 0t~iusm_fxoao.js} +1 -1
  102. package/.next/standalone/.next/static/chunks/{0jryicwtm9z2g.js → 0u-ys71jc4y68.js} +3 -3
  103. package/.next/standalone/.next/static/chunks/0zig0fh30t6ou.js +1 -0
  104. package/.next/standalone/.next/static/chunks/{0w1f.k~gi-y6..js → 11kt_9zaooda3.js} +1 -1
  105. package/.next/standalone/.next/static/chunks/{0kzk5-mh1_x53.js → 12simlrcfk3g2.js} +1 -1
  106. package/.next/standalone/.next/static/chunks/{turbopack-0s36is87fc9r2.js → turbopack-0o7k.hakttp4k.js} +1 -1
  107. package/.next/standalone/app/components/cli-badge.tsx +24 -0
  108. package/.next/standalone/app/components/project-list.tsx +13 -7
  109. package/.next/standalone/app/components/sessions-list.tsx +4 -2
  110. package/.next/standalone/app/policies/hooks-client.tsx +66 -10
  111. package/.next/standalone/app/project/[name]/page.tsx +49 -22
  112. package/.next/standalone/app/project/[name]/session/[sessionId]/page.tsx +51 -19
  113. package/.next/standalone/components/reach-developers.tsx +6 -1
  114. package/.next/standalone/lib/codex-projects.ts +250 -0
  115. package/.next/standalone/lib/codex-sessions.ts +414 -0
  116. package/.next/standalone/lib/format-date.ts +21 -0
  117. package/.next/standalone/lib/log-entries.ts +3 -3
  118. package/.next/standalone/lib/paths.ts +13 -0
  119. package/.next/standalone/lib/projects.ts +57 -3
  120. package/.next/standalone/lib/utils.ts +6 -22
  121. package/.next/standalone/package.json +1 -1
  122. package/.next/standalone/server.js +1 -1
  123. package/bin/failproofai.mjs +1 -0
  124. package/dist/cli.mjs +1042 -122
  125. package/lib/codex-projects.ts +250 -0
  126. package/lib/codex-sessions.ts +414 -0
  127. package/lib/format-date.ts +21 -0
  128. package/lib/log-entries.ts +3 -3
  129. package/lib/paths.ts +13 -0
  130. package/lib/projects.ts +57 -3
  131. package/lib/utils.ts +6 -22
  132. package/package.json +1 -1
  133. package/scripts/launch.ts +2 -1
  134. package/src/hooks/builtin-policies.ts +7 -1
  135. package/src/hooks/hook-activity-store.ts +3 -0
  136. package/src/hooks/manager.ts +1 -1
  137. package/src/hooks/resolve-permission-mode.ts +6 -91
  138. package/.next/standalone/.next/server/chunks/[externals]__080wern._.js +0 -3
  139. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b57.gk._.js +0 -3
  140. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03rd.z8._.js +0 -3
  141. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e74wa-._.js +0 -3
  142. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vu.o-3._.js +0 -4
  143. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +0 -17
  144. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zqcovi._.js +0 -3
  145. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__105.l_7._.js +0 -3
  146. package/.next/standalone/.next/server/chunks/ssr/_0uy6m~m._.js +0 -3
  147. package/.next/standalone/.next/static/chunks/00b5h4r1el.6f.js +0 -1
  148. package/.next/standalone/.next/static/chunks/0fw2h.g66c0h3.js +0 -1
  149. package/.next/standalone/.next/static/chunks/0gu87mlr5ssnt.js +0 -6
  150. package/.next/standalone/.next/static/chunks/0igf3xbisp1lx.js +0 -1
  151. package/.next/standalone/.next/static/chunks/0vwqucikost_q.js +0 -1
  152. /package/.next/standalone/.next/static/{CiVeb_yiVt-O2JYrzGzB7 → A_Ax17P33facL0OmIwFXj}/_buildManifest.js +0 -0
  153. /package/.next/standalone/.next/static/{CiVeb_yiVt-O2JYrzGzB7 → A_Ax17P33facL0OmIwFXj}/_clientMiddlewareManifest.js +0 -0
  154. /package/.next/standalone/.next/static/{CiVeb_yiVt-O2JYrzGzB7 → A_Ax17P33facL0OmIwFXj}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43418,e=>{"use strict";var t=e.i(43476);e.s(["CliBadge",0,function({cli:e}){let r="codex"===e,a=r?"OpenAI Codex":"Claude Code";return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${r?"bg-purple-500/10 text-purple-400 border-purple-500/20":"bg-orange-500/10 text-orange-400 border-orange-500/20"}`,title:`Agent CLI: ${a}`,children:a})}])},62706,20087,30005,66595,85898,e=>{"use strict";e.s(["formatDate",0,function(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}).format(e)}],62706),e.s(["FILTER_PRESETS",0,[{value:"all",label:"All"},{value:"last-hour",label:"Last Hour"},{value:"today",label:"Today"},{value:"last-7-days",label:"Last 7 Days"},{value:"last-30-days",label:"Last 30 Days"}],"ITEMS_PER_PAGE",0,25,"filterByDate",0,function(e,t,r){if("all"===t)return e;if("custom"===t){let t,a,n=r.from?((t=new Date(r.from)).setHours(0,0,0,0),t):null,l=r.to?((a=new Date(r.to)).setHours(23,59,59,999),a):null;return e.filter(e=>(!n||!(e.lastModified<n))&&(!l||!(e.lastModified>l)))}let a=function(e){let t=new Date;switch(e){case"last-hour":return new Date(t.getTime()-36e5);case"today":return new Date(t.getFullYear(),t.getMonth(),t.getDate());case"last-7-days":return new Date(t.getTime()-6048e5);case"last-30-days":return new Date(t.getTime()-2592e6);default:return null}}(t);return a?e.filter(e=>e.lastModified>=a):e},"rehydrateDates",0,function(e){return e.map(e=>({...e,lastModified:e.lastModified instanceof Date?e.lastModified:new Date(e.lastModified)}))}],20087);var t=e.i(71645);e.s(["useFilterState",0,function(e=[],r){let[a,n]=(0,t.useState)(r?.filterPreset??"all"),[l,s]=(0,t.useState)(r?.dateRange??{from:null,to:null}),[o,i]=(0,t.useState)(r?.currentPage??1),d=`${a}|${JSON.stringify(l)}|${JSON.stringify(e)}`,[c,u]=(0,t.useState)(d);d!==c&&(u(d),i(1));let m=(0,t.useCallback)(e=>{n(e),"custom"!==e&&s({from:null,to:null})},[]);return{filterPreset:a,dateRange:l,currentPage:o,setCurrentPage:i,handlePresetChange:m,handleDateRangeChange:(0,t.useCallback)((e,t)=>{n("custom"),s(r=>({...r,[e]:t?new Date(t):null}))},[]),clearFilters:(0,t.useCallback)(()=>{n("all"),s({from:null,to:null})},[])}}],30005);var r=e.i(56420);let a=(0,r.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,a],66595);var n=e.i(43476);let l=(0,r.default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["default",0,function({id:e,value:t,stringValue:r,onChange:a,"aria-label":s}){let o=null!=r?r:t?t.toISOString().split("T")[0]:"";return(0,n.jsxs)("div",{className:"relative group",children:[(0,n.jsx)("input",{type:"date",id:e,value:o,onChange:e=>a(e.target.value),"aria-label":s,className:"date-input px-3 py-2 pr-8 text-sm bg-input border border-border rounded-md text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all hover:border-primary/50 w-[200px]"}),(0,n.jsx)("label",{htmlFor:e,className:"absolute right-2.5 top-1/2 -translate-y-1/2 cursor-pointer pointer-events-auto z-10 p-1 rounded hover:bg-muted/50 transition-colors",onClick:t=>{t.preventDefault();let r=document.getElementById(e);r&&"function"==typeof r.showPicker?r.showPicker():r?.click()},children:(0,n.jsx)(l,{className:"w-4 h-4 text-primary group-hover:text-primary/80 transition-colors"})})]})}],85898)},24071,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],24071)},67927,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],67927)},73520,e=>{"use strict";var t=e.i(43476),r=e.i(24071),a=e.i(67927);e.s(["default",0,function({currentPage:e,totalPages:n,onPageChange:l}){if(n<=1)return null;let s=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>l(e-1),disabled:1===e,className:s(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(r.ChevronLeft,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(n<=7)return Array.from({length:n},(e,t)=>t+1);let t=[1],r=Math.max(2,e-1),a=Math.min(n-1,e+1);e<=3&&(a=Math.min(5,n-1)),e>=n-2&&(r=Math.max(2,n-4)),r>2&&t.push("ellipsis-start");for(let e=r;e<=a;e++)t.push(e);return a<n-1&&t.push("ellipsis-end"),t.push(n),t})().map(r=>"string"==typeof r?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},r):(0,t.jsx)("button",{onClick:()=>l(r),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${r}`,"aria-current":e===r?"page":void 0,children:r},r))}),(0,t.jsxs)("button",{onClick:()=>l(e+1),disabled:e===n,className:s(e===n),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(a.ChevronRight,{className:"w-4 h-4"})]})]})}])},80060,2711,e=>{"use strict";var t=e.i(18566),r=e.i(71645);function a(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${a}`}function n(e){var t;if(!e||(t=e,!/^\d{4}-\d{2}-\d{2}$/.test(t)||isNaN(Date.parse(t))))return null;let[r,a,n]=e.split("-").map(Number);return new Date(r,a-1,n,12,0,0)}e.s(["useUrlParams",0,function(){let e=(0,t.useSearchParams)(),a=(0,t.useRouter)(),n=(0,t.usePathname)(),l=(0,r.useRef)(null),s=(0,r.useCallback)(t=>e.get(t),[e]),o=(0,r.useCallback)(()=>new URLSearchParams(e.toString()),[e]),i=(0,r.useCallback)(t=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{let r=new URLSearchParams(e.toString());for(let[e,a]of Object.entries(t))void 0===a||""===a?r.delete(e):r.set(e,a);let l=r.toString(),s=l?`${n}?${l}`:n;a.replace(s,{scroll:!1})},150)},[e,n,a]);return(0,r.useEffect)(()=>()=>{l.current&&clearTimeout(l.current)},[]),{get:s,getAll:o,setAll:i}}],80060),e.s(["dateRangeToParams",0,function(e){let t={};return e.from&&(t.from=a(e.from)),e.to&&(t.to=a(e.to)),t},"keywordsToParam",0,function(e){if(0!==e.length)return e.map(e=>encodeURIComponent(e)).join(",")},"pageToParam",0,function(e){return e<=1?void 0:String(e)},"paramToKeywords",0,function(e){return e?e.split(",").map(e=>decodeURIComponent(e.trim())).filter(e=>e.length>0):[]},"paramToPage",0,function(e){if(!e)return 1;let t=parseInt(e,10);return Number.isFinite(t)&&t>=1?t:1},"paramToPreset",0,function(e){return e&&["all","last-hour","today","last-7-days","last-30-days","custom"].includes(e)?e:"all"},"paramsToDateRange",0,function(e,t){return{from:n(e),to:n(t)}},"presetToParam",0,function(e){return"all"===e?void 0:e}],2711)},63676,e=>{"use strict";let t=(0,e.i(56420).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],63676)},45425,(e,t,r)=>{var a;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/next/dist/compiled/os-browserify/"),(a={}).endianness=function(){return"LE"},a.hostname=function(){return"u">typeof location?location.hostname:""},a.loadavg=function(){return[]},a.uptime=function(){return 0},a.freemem=function(){return Number.MAX_VALUE},a.totalmem=function(){return Number.MAX_VALUE},a.cpus=function(){return[]},a.type=function(){return"Browser"},a.release=function(){return"u">typeof navigator?navigator.appVersion:""},a.networkInterfaces=a.getNetworkInterfaces=function(){return{}},a.arch=function(){return"javascript"},a.platform=function(){return"browser"},a.tmpdir=a.tmpDir=function(){return"/tmp"},a.EOL="\n",a.homedir=function(){return"/"},t.exports=a},41790,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,a="",n=0,l=-1,s=0,o=0;o<=e.length;++o){if(o<e.length)r=e.charCodeAt(o);else if(47===r)break;else r=47;if(47===r){if(l===o-1||1===s);else if(l!==o-1&&2===s){if(a.length<2||2!==n||46!==a.charCodeAt(a.length-1)||46!==a.charCodeAt(a.length-2)){if(a.length>2){var i=a.lastIndexOf("/");if(i!==a.length-1){-1===i?(a="",n=0):n=(a=a.slice(0,i)).length-1-a.lastIndexOf("/"),l=o,s=0;continue}}else if(2===a.length||1===a.length){a="",n=0,l=o,s=0;continue}}t&&(a.length>0?a+="/..":a="..",n=2)}else a.length>0?a+="/"+e.slice(l+1,o):a=e.slice(l+1,o),n=o-l-1;l=o,s=0}else 46===r&&-1!==s?++s:s=-1}return a}var a={resolve:function(){for(var e,a,n="",l=!1,s=arguments.length-1;s>=-1&&!l;s--)s>=0?a=arguments[s]:(void 0===e&&(e=""),a=e),t(a),0!==a.length&&(n=a+"/"+n,l=47===a.charCodeAt(0));if(n=r(n,!l),l)if(n.length>0)return"/"+n;else return"/";return n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var a=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!a)).length||a||(e="."),e.length>0&&n&&(e+="/"),a)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var n=arguments[r];t(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":a.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=a.resolve(e))===(r=a.resolve(r)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var l=e.length,s=l-n,o=1;o<r.length&&47===r.charCodeAt(o);++o);for(var i=r.length-o,d=s<i?s:i,c=-1,u=0;u<=d;++u){if(u===d){if(i>d){if(47===r.charCodeAt(o+u))return r.slice(o+u+1);else if(0===u)return r.slice(o+u)}else s>d&&(47===e.charCodeAt(n+u)?c=u:0===u&&(c=0));break}var m=e.charCodeAt(n+u);if(m!==r.charCodeAt(o+u))break;47===m&&(c=u)}var f="";for(u=n+c+1;u<=l;++u)(u===l||47===e.charCodeAt(u))&&(0===f.length?f+="..":f+="/..");return f.length>0?f+r.slice(o+c):(o+=c,47===r.charCodeAt(o)&&++o,r.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),a=47===r,n=-1,l=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!l){n=s;break}}else l=!1;return -1===n?a?"/":".":a&&1===n?"//":e.slice(0,n)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var a,n=0,l=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var o=r.length-1,i=-1;for(a=e.length-1;a>=0;--a){var d=e.charCodeAt(a);if(47===d){if(!s){n=a+1;break}}else -1===i&&(s=!1,i=a+1),o>=0&&(d===r.charCodeAt(o)?-1==--o&&(l=a):(o=-1,l=i))}return n===l?l=i:-1===l&&(l=e.length),e.slice(n,l)}for(a=e.length-1;a>=0;--a)if(47===e.charCodeAt(a)){if(!s){n=a+1;break}}else -1===l&&(s=!1,l=a+1);return -1===l?"":e.slice(n,l)},extname:function(e){t(e);for(var r=-1,a=0,n=-1,l=!0,s=0,o=e.length-1;o>=0;--o){var i=e.charCodeAt(o);if(47===i){if(!l){a=o+1;break}continue}-1===n&&(l=!1,n=o+1),46===i?-1===r?r=o:1!==s&&(s=1):-1!==r&&(s=-1)}return -1===r||-1===n||0===s||1===s&&r===n-1&&r===a+1?"":e.slice(r,n)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,a={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return a;var n=e.charCodeAt(0),l=47===n;l?(a.root="/",r=1):r=0;for(var s=-1,o=0,i=-1,d=!0,c=e.length-1,u=0;c>=r;--c){if(47===(n=e.charCodeAt(c))){if(!d){o=c+1;break}continue}-1===i&&(d=!1,i=c+1),46===n?-1===s?s=c:1!==u&&(u=1):-1!==s&&(u=-1)}return -1===s||-1===i||0===u||1===u&&s===i-1&&s===o+1?-1!==i&&(0===o&&l?a.base=a.name=e.slice(1,i):a.base=a.name=e.slice(o,i)):(0===o&&l?(a.name=e.slice(1,s),a.base=e.slice(1,i)):(a.name=e.slice(o,s),a.base=e.slice(o,i)),a.ext=e.slice(s,i)),o>0?a.dir=e.slice(0,o-1):l&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,e.exports=a}},r={};function a(t){var n=r[t];if(void 0!==n)return n.exports;var l=r[t]={exports:{}},s=!0;try{e[t](l,l.exports,a),s=!1}finally{s&&delete r[t]}return l.exports}a.ab="/ROOT/node_modules/next/dist/compiled/path-browserify/",t.exports=a(114)}()},62481,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(43418);e.i(47167),e.i(45425),e.i(41790);var n=e.i(62706),l=e.i(20087),s=e.i(30005),o=e.i(80060),i=e.i(2711);let d=(0,e.i(56420).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var c=e.i(66595),u=e.i(63676),m=e.i(22016),f=e.i(73520),h=e.i(85898);function g({date:e,formatted:r}){return(0,t.jsx)("span",{children:r||(0,n.formatDate)(e)})}e.s(["default",0,function({folders:e}){let n=(0,o.useUrlParams)(),p=(0,r.useRef)(!1),[x,b]=(0,r.useState)(()=>(0,i.paramToKeywords)(n.get("q"))),[v,y]=(0,r.useState)(""),{filterPreset:j,dateRange:N,currentPage:w,setCurrentPage:C,handlePresetChange:k,handleDateRangeChange:A,clearFilters:T}=(0,s.useFilterState)(x,{filterPreset:(0,i.paramToPreset)(n.get("preset")),dateRange:(0,i.paramsToDateRange)(n.get("from"),n.get("to")),currentPage:(0,i.paramToPage)(n.get("page"))});(0,r.useEffect)(()=>{if(!p.current){p.current=!0;return}n.setAll({preset:(0,i.presetToParam)(j),...(0,i.dateRangeToParams)(N),q:(0,i.keywordsToParam)(x),page:(0,i.pageToParam)(w)})},[j,N,x,w]);let P=e=>{let t=e.trim();t&&!x.includes(t)&&(b([...x,t]),y(""))},S=()=>{b([]),y("")},M=(0,r.useMemo)(()=>(0,l.rehydrateDates)(e),[e]),R=(0,r.useMemo)(()=>{let e=(0,l.filterByDate)(M,j,N);return x.length>0&&(e=e.filter(e=>{let t=e.name.toLowerCase();return x.every(e=>{let r=e.trim().toLowerCase().replace(/\//g,"-");return 0===r.length||t.includes(r)})})),e.sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime())},[M,j,N,x]),E=Math.max(1,Math.ceil(R.length/l.ITEMS_PER_PAGE));(0,r.useEffect)(()=>{w>E&&C(E)},[w,E,C]);let D=(w-1)*l.ITEMS_PER_PAGE,_=Math.min(D+l.ITEMS_PER_PAGE,R.length),I=R.slice(D,_);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-4",children:(0,t.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Filter by:"}),l.FILTER_PRESETS.map(e=>(0,t.jsx)("button",{onClick:()=>k(e.value),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${j===e.value?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:e.label},e.value))]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Search,{className:"w-4 h-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Search Keywords:"})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"text",value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),P(v))},placeholder:"Enter keyword and press Enter",className:"px-3 py-2 text-sm bg-input border border-border rounded-md text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all hover:border-primary/50 w-[250px]","aria-label":"Add keyword"}),(0,t.jsx)("button",{onClick:()=>P(v),className:"px-3 py-2 text-sm bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors","aria-label":"Add keyword",children:"Add"})]}),x.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[x.map((e,r)=>(0,t.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-muted text-muted-foreground rounded-md text-sm",children:[(0,t.jsx)("span",{children:e}),(0,t.jsx)("button",{onClick:()=>{b(x.filter((e,t)=>t!==r))},className:"hover:text-foreground transition-colors p-0.5 rounded hover:bg-muted/80","aria-label":`Remove keyword ${e}`,children:(0,t.jsx)(u.X,{className:"w-3.5 h-3.5"})})]},r)),(0,t.jsx)("button",{onClick:S,className:"px-2 py-1.5 text-xs bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors","aria-label":"Clear all keywords",children:"Clear all"})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Custom Range:"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(h.default,{id:"date-from",value:N.from,onChange:e=>A("from",e),"aria-label":"Filter from date"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"to"}),(0,t.jsx)(h.default,{id:"date-to",value:N.to,onChange:e=>A("to",e),"aria-label":"Filter to date"})]}),("all"!==j||null!==N.from||null!==N.to||x.length>0)&&(0,t.jsx)("button",{onClick:()=>{T(),S()},className:"px-3 py-2 text-sm bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors",children:"Clear"})]}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:0===R.length?(0,t.jsx)(t.Fragment,{children:"No projects found"}):(0,t.jsxs)(t.Fragment,{children:["Showing ",D+1,"-",_," of ",R.length," projects",R.length!==M.length&&(0,t.jsxs)("span",{className:"ml-1",children:["(filtered from ",M.length," total)"]}),x.length>0&&(0,t.jsxs)("span",{className:"ml-1",children:["with ",x.length," keyword",1!==x.length?"s":""]})]})})]})}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-border bg-muted/50",children:[(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground w-12",children:(0,t.jsx)("span",{className:"sr-only",children:"Icon"})}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground max-w-md",children:"Agent Root"}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground hidden md:table-cell",children:"Path"}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground",children:"Last Modified"})]})}),(0,t.jsx)("tbody",{children:0===I.length?(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:4,className:"px-4 py-8 text-center text-muted-foreground",children:"No projects found matching the selected filter."})}):I.map(e=>{var r;return(0,t.jsxs)("tr",{className:"border-b border-border hover:bg-muted/50 transition-colors",children:[(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsx)(d,{className:"w-5 h-5 text-primary"})}),(0,t.jsx)("td",{className:"px-4 py-3 max-w-md",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(m.default,{href:`/project/${encodeURIComponent(e.name)}`,className:"font-semibold text-foreground hover:text-primary transition-colors break-words break-all inline-block max-w-full",children:(r=e.name,/^[A-Za-z]--/.test(r)?r[0]+":/"+r.slice(3).replace(/-/g,"/"):r.replace(/-/g,"/"))}),e.cli.map(e=>(0,t.jsx)(a.CliBadge,{cli:e},e))]})}),(0,t.jsx)("td",{className:"px-4 py-3 text-sm text-muted-foreground hidden md:table-cell truncate max-w-md",children:e.path}),(0,t.jsx)("td",{className:"px-4 py-3 text-sm text-muted-foreground",children:(0,t.jsx)(g,{date:e.lastModified,formatted:e.lastModifiedFormatted})})]},e.name)})})]})}),R.length>0&&(0,t.jsx)(f.default,{currentPage:w,totalPages:E,onPageChange:C})]})]})}],62481)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8734,89664,e=>{"use strict";var t=e.i(56420);let r=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r],8734);let n=(0,t.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,n],89664)},24380,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(8734),o=e.i(89664),l=e.i(47163);function i(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}finally{document.body.removeChild(t)}}e.s(["CopyButton",0,function({text:e,className:a}){let[u,s]=(0,r.useState)(!1),d=(0,r.useCallback)(async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else if(!i(e))throw Error("Both clipboard methods failed");s(!0),setTimeout(()=>s(!1),2e3)}catch(t){console.error("Failed to copy to clipboard:",t);try{i(e)&&(s(!0),setTimeout(()=>s(!1),2e3))}catch{}}},[e]);return(0,t.jsx)("button",{onClick:d,title:"Copy to clipboard",className:(0,l.cn)("inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",a),children:u?(0,t.jsx)(o.Check,{className:"w-3.5 h-3.5 text-green-500"}):(0,t.jsx)(n.Copy,{className:"w-3.5 h-3.5"})})}])},67585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return o}});let n=e.r(32061);function o({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},52157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return u}});let n=e.r(43476),o=e.r(74080),l=e.r(63599),i=e.r(9885),a=e.r(43369);function u({moduleIds:e}){if("u">typeof window)return null;let t=l.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let s=(0,a.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${s}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,o.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return s}});let n=e.r(43476),o=e.r(71645),l=e.r(67585),i=e.r(52157);function a(e){return{default:e&&"default"in e?e.default:e}}let u={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},s=function(e){let t={...u,...e},r=(0,o.lazy)(()=>t.loader().then(a)),s=t.loading;function d(e){let a=s?(0,n.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,u=!t.ssr||!!t.loading,d=u?o.Suspense:o.Fragment,c=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(d,{...u?{fallback:a}:{},children:c})}return d.displayName="LoadableComponent",d}},70703,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let n=e.r(55682)._(e.r(69093));function o(e,t){let r={};"function"==typeof e&&(r.loader=e);let o={...r,...t};return(0,n.default)({...o,modules:o.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},69186,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(70703).default)(()=>e.A(79348),{loadableGenerated:{modules:[5780]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-4 shadow-sm",children:(0,t.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,t.jsx)("div",{className:"animate-pulse text-muted-foreground",children:"Loading log viewer..."})})})});e.s(["default",0,function({entries:e,projectName:n,sessionId:o}){return(0,t.jsx)(r,{entries:e,projectName:n,sessionId:o})}])},79348,e=>{e.v(t=>Promise.all(["static/chunks/0w1f.k~gi-y6..js","static/chunks/0ufq8smh~i7wc.js"].map(t=>e.l(t))).then(()=>t(5780)))}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8734,89664,e=>{"use strict";var t=e.i(56420);let r=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r],8734);let n=(0,t.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,n],89664)},24380,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(8734),o=e.i(89664),l=e.i(47163);function a(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}finally{document.body.removeChild(t)}}e.s(["CopyButton",0,function({text:e,className:i}){let[u,s]=(0,r.useState)(!1),d=(0,r.useCallback)(async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else if(!a(e))throw Error("Both clipboard methods failed");s(!0),setTimeout(()=>s(!1),2e3)}catch(t){console.error("Failed to copy to clipboard:",t);try{a(e)&&(s(!0),setTimeout(()=>s(!1),2e3))}catch{}}},[e]);return(0,t.jsx)("button",{onClick:d,title:"Copy to clipboard",className:(0,l.cn)("inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",i),children:u?(0,t.jsx)(o.Check,{className:"w-3.5 h-3.5 text-green-500"}):(0,t.jsx)(n.Copy,{className:"w-3.5 h-3.5"})})}])},67585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return o}});let n=e.r(32061);function o({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new n.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,r)=>{"use strict";function n(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return n}})},52157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return u}});let n=e.r(43476),o=e.r(74080),l=e.r(63599),a=e.r(9885),i=e.r(43369);function u({moduleIds:e}){if("u">typeof window)return null;let t=l.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let n=t.reactLoadableManifest;for(let t of e){if(!n[t])continue;let e=n[t].files;r.push(...e)}}if(0===r.length)return null;let s=(0,i.getAssetTokenQuery)();return(0,n.jsx)(n.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${s}`;return e.endsWith(".css")?(0,n.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,o.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return s}});let n=e.r(43476),o=e.r(71645),l=e.r(67585),a=e.r(52157);function i(e){return{default:e&&"default"in e?e.default:e}}let u={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},s=function(e){let t={...u,...e},r=(0,o.lazy)(()=>t.loader().then(i)),s=t.loading;function d(e){let i=s?(0,n.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,u=!t.ssr||!!t.loading,d=u?o.Suspense:o.Fragment,c=t.ssr?(0,n.jsxs)(n.Fragment,{children:["u"<typeof window?(0,n.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(l.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(d,{...u?{fallback:i}:{},children:c})}return d.displayName="LoadableComponent",d}},70703,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let n=e.r(55682)._(e.r(69093));function o(e,t){let r={};"function"==typeof e&&(r.loader=e);let o={...r,...t};return(0,n.default)({...o,modules:o.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},69186,e=>{"use strict";var t=e.i(43476);let r=(0,e.i(70703).default)(()=>e.A(79348),{loadableGenerated:{modules:[5780]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"bg-card border border-border rounded-lg p-4 shadow-sm",children:(0,t.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,t.jsx)("div",{className:"animate-pulse text-muted-foreground",children:"Loading log viewer..."})})})});e.s(["default",0,function({entries:e,projectName:n,sessionId:o}){return(0,t.jsx)(r,{entries:e,projectName:n,sessionId:o})}])},79348,e=>{e.v(t=>Promise.all(["static/chunks/11kt_9zaooda3.js","static/chunks/0pr7k36o_.du1.js"].map(t=>e.l(t))).then(()=>t(5780)))}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,53348,e=>{"use strict";var r=e.i(43476),t=e.i(71645),n=e.i(51965),i=e.i(9969);e.s(["default",0,function({error:e,reset:o}){return(0,t.useEffect)(()=>{(0,n.getTelemetryConfig)().then(r=>{(0,i.setClientTelemetryConfig)(r),(0,i.captureClientEvent)("client_error",{error_message:e.message,error_name:e.name,error_digest:e.digest,boundary:"global"})}).catch(()=>{})},[e]),(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#031035",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},children:(0,r.jsxs)("div",{style:{textAlign:"center",padding:"2rem",border:"1px solid rgba(239,68,68,0.4)",borderRadius:"0.5rem",maxWidth:"500px"},children:[(0,r.jsx)("h2",{style:{color:"#ef4444",marginBottom:"0.5rem",fontSize:"1.25rem"},children:"Something went wrong"}),(0,r.jsx)("p",{style:{color:"#94a3b8",marginBottom:"1.5rem"},children:e.message||"An unexpected error occurred."}),(0,r.jsx)("button",{onClick:o,style:{padding:"0.5rem 1.25rem",background:"#3b82f6",color:"white",border:"none",borderRadius:"0.375rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]})})})})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,53348,e=>{"use strict";var r=e.i(43476),t=e.i(71645),n=e.i(51519),i=e.i(9969);e.s(["default",0,function({error:e,reset:o}){return(0,t.useEffect)(()=>{(0,n.getTelemetryConfig)().then(r=>{(0,i.setClientTelemetryConfig)(r),(0,i.captureClientEvent)("client_error",{error_message:e.message,error_name:e.name,error_digest:e.digest,boundary:"global"})}).catch(()=>{})},[e]),(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#031035",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},children:(0,r.jsxs)("div",{style:{textAlign:"center",padding:"2rem",border:"1px solid rgba(239,68,68,0.4)",borderRadius:"0.5rem",maxWidth:"500px"},children:[(0,r.jsx)("h2",{style:{color:"#ef4444",marginBottom:"0.5rem",fontSize:"1.25rem"},children:"Something went wrong"}),(0,r.jsx)("p",{style:{color:"#94a3b8",marginBottom:"1.5rem"},children:e.message||"An unexpected error occurred."}),(0,r.jsx)("button",{onClick:o,style:{padding:"0.5rem 1.25rem",background:"#3b82f6",color:"white",border:"none",borderRadius:"0.375rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]})})})})}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9969,e=>{"use strict";let t=null;e.s(["captureClientEvent",0,function(e,r){if(!t||!t.enabled)return;let n=JSON.stringify({api_key:t.apiKey,event:e,distinct_id:t.distinctId,properties:{...r,$lib:"failproofai-web",failproofai_version:t.version,$current_url:window.location.href,$pathname:window.location.pathname}});fetch(t.host.replace(/\/+$/,"")+"/capture/",{method:"POST",headers:{"Content-Type":"application/json"},body:n,signal:AbortSignal.timeout(5e3)}).catch(()=>{})},"setClientTelemetryConfig",0,function(e){t=e}])},98183,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return a}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});function i(e){let t={};for(let[r,n]of e.entries()){let e=t[r];void 0===e?t[r]=n:Array.isArray(e)?e.push(n):t[r]=[e,n]}return t}function u(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function a(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)t.append(r,u(e));else t.set(r,u(n));return t}function l(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,n]of r.entries())e.append(t,n)}return e}},18967,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={DecodeError:function(){return y},MiddlewareNotFoundError:function(){return S},MissingStaticPage:function(){return P},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return g},ST:function(){return m},WEB_VITALS:function(){return i},execOnce:function(){return u},getDisplayName:function(){return f},getLocationOrigin:function(){return s},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return d},loadGetInitialProps:function(){return h},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return C}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function u(e){let t,r=!1;return(...n)=>(r||(r=!0,t=e(...n)),t)}let a=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>a.test(e);function s(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=s();return e.substring(t.length)}function f(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function h(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await h(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&d(r))return n;if(!n)throw Object.defineProperty(Error(`"${f(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let g="u">typeof performance,m=g&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class y extends Error{}class b extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class P extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class S extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function C(e){return JSON.stringify({message:e.message,stack:e.stack})}},33525,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},96661,5014,e=>{"use strict";let t=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();e.s(["mergeClasses",0,t],96661);var r=e.i(71645),n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,r.createContext)({}),i=(0,r.forwardRef)(({color:e,size:i,strokeWidth:u,absoluteStrokeWidth:a,className:l="",children:s,iconNode:c,...f},d)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,color:m="currentColor",className:y=""}=(0,r.useContext)(o)??{},b=a??g?24*Number(u??h)/Number(i??p):u??h;return(0,r.createElement)("svg",{ref:d,...n,width:i??p??n.width,height:i??p??n.height,stroke:e??m,strokeWidth:b,className:t("lucide",y,l),...!s&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(f)&&{"aria-hidden":"true"},...f},[...c.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(s)?s:[s]])});e.s(["default",0,i],5014)},56420,e=>{"use strict";var t=e.i(71645),r=e.i(96661);let n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var o=e.i(5014);e.s(["default",0,(e,i)=>{let u=(0,t.forwardRef)(({className:u,...a},l)=>(0,t.createElement)(o.default,{ref:l,iconNode:i,className:(0,r.mergeClasses)(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,u),...a}));return u.displayName=n(e),u}],56420)},95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return a},formatWithValidation:function(){return s},urlObjectKeys:function(){return l}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(90809)._(e.r(98183)),u=/https?|ftp|gopher|file/;function a(e){let{auth:t,hostname:r}=e,n=e.protocol||"",o=e.pathname||"",a=e.hash||"",l=e.query||"",s=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?s=t+e.host:r&&(s=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(s+=":"+e.port)),l&&"object"==typeof l&&(l=String(i.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||u.test(n))&&!1!==s?(s="//"+(s||""),o&&"/"!==o[0]&&(o="/"+o)):s||(s=""),a&&"#"!==a[0]&&(a="#"+a),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${s}${o}${c}${a}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function s(e){return a(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(71645);function o(e,t){let r=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(r.current=i(e,n)),t&&(o.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(18967),o=e.r(52817);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return v}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(90809),u=e.r(43476),a=i._(e.r(71645)),l=e.r(95057),s=e.r(8372),c=e.r(18581),f=e.r(18967),d=e.r(5550);e.r(33525);let p=e.r(88540),h=e.r(91949),g=e.r(73668),m=e.r(9396);function y(t){var r,n;let o,i,y,[v,P]=(0,a.useOptimistic)(h.IDLE_LINK_STATUS),S=(0,a.useRef)(null),{href:C,as:_,children:x,prefetch:w=null,passHref:j,replace:O,shallow:E,scroll:R,onClick:T,onMouseEnter:N,onTouchStart:A,legacyBehavior:k=!1,onNavigate:L,transitionTypes:M,ref:$,unstable_dynamicOnHover:U,...I}=t;o=x,k&&("string"==typeof o||"number"==typeof o)&&(o=(0,u.jsx)("a",{children:o}));let B=a.default.useContext(s.AppRouterContext),F=!1!==w,D=!1!==w?null===(n=w)||"auto"===n?m.FetchStrategy.PPR:m.FetchStrategy.Full:m.FetchStrategy.PPR,z="string"==typeof(r=_||C)?r:(0,l.formatUrl)(r);if(k){if(o?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});i=a.default.Children.only(o)}let K=k?i&&"object"==typeof i&&i.ref:$,W=a.default.useCallback(e=>(null!==B&&(S.current=(0,h.mountLinkInstance)(e,z,B,D,F,P)),()=>{S.current&&((0,h.unmountLinkForCurrentNavigation)(S.current),S.current=null),(0,h.unmountPrefetchableInstance)(e)}),[F,z,B,D,P]),q={ref:(0,c.useMergedRef)(W,K),onClick(t){k||"function"!=typeof T||T(t),k&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!B||t.defaultPrevented||function(t,r,n,o,i,u,l){if("u">typeof window){let s,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((s=t.currentTarget.getAttribute("target"))&&"_self"!==s||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,g.isLocalURL)(r)){o&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),u){let e=!1;if(u({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:f}=e.r(99781);a.default.startTransition(()=>{f(r,o?"replace":"push",!1===i?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,l)})}}(t,z,S,O,R,L,M)},onMouseEnter(e){k||"function"!=typeof N||N(e),k&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),B&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===U)},onTouchStart:function(e){k||"function"!=typeof A||A(e),k&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),B&&F&&(0,h.onNavigationIntent)(e.currentTarget,!0===U)}};return(0,f.isAbsoluteUrl)(z)?q.href=z:k&&!j&&("a"!==i.type||"href"in i.props)||(q.href=(0,d.addBasePath)(z)),y=k?a.default.cloneElement(i,q):(0,u.jsx)("a",{...I,...q,children:o}),(0,u.jsx)(b.Provider,{value:v,children:y})}e.r(84508);let b=(0,a.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,a.useContext)(b);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18566,(e,t,r)=>{t.exports=e.r(76562)},51519,e=>{"use strict";var t=e.i(95187);let r=(0,t.createServerReference)("004e0dedcd030bf7aa10787743163b3cb3b61759ca",t.callServer,void 0,t.findSourceMapURL,"getTelemetryConfig");e.s(["getTelemetryConfig",0,r])},68590,e=>{"use strict";let t=(0,e.i(56420).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],68590)},55574,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let n=[],o=0,i=new Set;function u(){for(let e of i)e()}function a(e){return i.add(e),()=>i.delete(e)}function l(){return n}function s({message:e}){let[n,o]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{requestAnimationFrame(()=>o(!0));let e=setTimeout(()=>o(!1),2e3);return()=>clearTimeout(e)},[]),(0,t.jsx)("div",{className:`bg-card border border-border text-foreground text-sm px-4 py-2 rounded-lg shadow-lg transition-opacity duration-300 ${n?"opacity-100":"opacity-0"}`,children:e})}e.s(["Toaster",0,function(){let e=(0,r.useSyncExternalStore)(a,l,l);return(0,t.jsx)("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2",children:e.map(e=>(0,t.jsx)(s,{message:e.message},e.id))})},"toast",0,function(e){let t=o++;n=[...n,{id:t,message:e}],u(),setTimeout(()=>{n=n.filter(e=>e.id!==t),u()},2500)}])},95187,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={callServer:function(){return i.callServer},createServerReference:function(){return a.createServerReference},findSourceMapURL:function(){return u.findSourceMapURL}};for(var o in n)Object.defineProperty(r,o,{enumerable:!0,get:n[o]});let i=e.r(32120),u=e.r(92245),a=e.r(35326)},85881,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let n=(0,r.createContext)(void 0);e.s(["AutoRefreshProvider",0,function({children:e}){let[o,i]=(0,r.useState)(0);return(0,t.jsx)(n.Provider,{value:{intervalSec:o,setIntervalSec:i},children:e})},"useAutoRefresh",0,function(){let e=(0,r.useContext)(n);if(!e)throw Error("useAutoRefresh must be used within AutoRefreshProvider");return e}])},82954,e=>{"use strict";let t=(0,e.i(56420).default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);e.s(["Shield",0,t],82954)},16327,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],16327)},67881,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(47163);let o=r.forwardRef(({className:e,variant:r="default",size:o="default",...i},u)=>(0,t.jsx)("button",{className:(0,n.cn)("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none",{"bg-primary text-primary-foreground hover:bg-primary/90":"default"===r,"hover:bg-muted hover:text-muted-foreground":"ghost"===r,"border border-border bg-background hover:bg-muted":"outline"===r,"h-10 py-2 px-4":"default"===o,"h-10 w-10":"icon"===o,"h-9 px-3":"sm"===o,"h-11 px-8":"lg"===o},e),ref:u,...i}));o.displayName="Button",e.s(["Button",0,o])}]);
@@ -0,0 +1,6 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8734,89664,e=>{"use strict";var t=e.i(56420);let r=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r],8734);let s=(0,t.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,s],89664)},84026,29407,16306,e=>{"use strict";var t=e.i(56420);let r=(0,t.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["ShieldCheck",0,r],84026);let s=(0,t.default)("shield-x",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);e.s(["ShieldX",0,s],29407);let n=(0,t.default)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);e.s(["ShieldAlert",0,n],16306)},66794,81051,e=>{"use strict";let t=(0,e.i(56420).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,t],66794);var r=e.i(95187);let s=(0,r.createServerReference)("606346c40eef9b4d235c6055456a99a6d810ce9435",r.callServer,void 0,r.findSourceMapURL,"searchHookActivityAction");e.s(["searchHookActivityAction",0,s],81051)},34713,e=>{"use strict";e.s(["formatDuration",0,function(e){if(e<1e3)return`${e}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let r=Math.floor(t/60);if(r>=60){let e=Math.floor(r/60);return`${e}h ${r%60}m`}let s=(t%60).toFixed(0);return`${r}m ${s}s`},"formatRelativeTime",0,function(e){let t=Date.now()-e;return t<6e4?`${Math.max(1,Math.floor(t/1e3))}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}])},24071,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],24071)},67927,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],67927)},73520,e=>{"use strict";var t=e.i(43476),r=e.i(24071),s=e.i(67927);e.s(["default",0,function({currentPage:e,totalPages:n,onPageChange:a}){if(n<=1)return null;let o=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>a(e-1),disabled:1===e,className:o(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(r.ChevronLeft,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(n<=7)return Array.from({length:n},(e,t)=>t+1);let t=[1],r=Math.max(2,e-1),s=Math.min(n-1,e+1);e<=3&&(s=Math.min(5,n-1)),e>=n-2&&(r=Math.max(2,n-4)),r>2&&t.push("ellipsis-start");for(let e=r;e<=s;e++)t.push(e);return s<n-1&&t.push("ellipsis-end"),t.push(n),t})().map(r=>"string"==typeof r?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},r):(0,t.jsx)("button",{onClick:()=>a(r),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${r}`,"aria-current":e===r?"page":void 0,children:r},r))}),(0,t.jsxs)("button",{onClick:()=>a(e+1),disabled:e===n,className:o(e===n),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(s.ChevronRight,{className:"w-4 h-4"})]})]})}])},80060,2711,e=>{"use strict";var t=e.i(18566),r=e.i(71645);function s(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${s}`}function n(e){var t;if(!e||(t=e,!/^\d{4}-\d{2}-\d{2}$/.test(t)||isNaN(Date.parse(t))))return null;let[r,s,n]=e.split("-").map(Number);return new Date(r,s-1,n,12,0,0)}e.s(["useUrlParams",0,function(){let e=(0,t.useSearchParams)(),s=(0,t.useRouter)(),n=(0,t.usePathname)(),a=(0,r.useRef)(null),o=(0,r.useCallback)(t=>e.get(t),[e]),l=(0,r.useCallback)(()=>new URLSearchParams(e.toString()),[e]),i=(0,r.useCallback)(t=>{a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{let r=new URLSearchParams(e.toString());for(let[e,s]of Object.entries(t))void 0===s||""===s?r.delete(e):r.set(e,s);let a=r.toString(),o=a?`${n}?${a}`:n;s.replace(o,{scroll:!1})},150)},[e,n,s]);return(0,r.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),{get:o,getAll:l,setAll:i}}],80060),e.s(["dateRangeToParams",0,function(e){let t={};return e.from&&(t.from=s(e.from)),e.to&&(t.to=s(e.to)),t},"keywordsToParam",0,function(e){if(0!==e.length)return e.map(e=>encodeURIComponent(e)).join(",")},"pageToParam",0,function(e){return e<=1?void 0:String(e)},"paramToKeywords",0,function(e){return e?e.split(",").map(e=>decodeURIComponent(e.trim())).filter(e=>e.length>0):[]},"paramToPage",0,function(e){if(!e)return 1;let t=parseInt(e,10);return Number.isFinite(t)&&t>=1?t:1},"paramToPreset",0,function(e){return e&&["all","last-hour","today","last-7-days","last-30-days","custom"].includes(e)?e:"all"},"paramsToDateRange",0,function(e,t){return{from:n(e),to:n(t)}},"presetToParam",0,function(e){return"all"===e?void 0:e}],2711)},63676,e=>{"use strict";let t=(0,e.i(56420).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],63676)},64245,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(74080),n=e.i(22016),a=e.i(56420);let o=(0,a.default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var l=e.i(84026),i=e.i(29407),d=e.i(16306),c=e.i(82954),m=e.i(16327),u=e.i(8734),x=e.i(89664),p=e.i(66794);let h=(0,a.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var f=e.i(63676),g=e.i(73520),b=e.i(95187);let j=(0,b.createServerReference)("407ff439878868ce72f184be57a03505a52de25f29",b.callServer,void 0,b.findSourceMapURL,"getHookActivityAction");var v=e.i(81051);let y=(0,b.createServerReference)("005f7d27289f33091a3fdc52bd971ebe7f9427ba7c",b.callServer,void 0,b.findSourceMapURL,"getHooksConfigAction"),N=(0,b.createServerReference)("60a6e9e79eb81a0bdfe9bbd23a606e78f92af70bd4",b.callServer,void 0,b.findSourceMapURL,"togglePolicyAction"),k=(0,b.createServerReference)("60836e171c104a7a89106a8e529d12f52bbf7d843c",b.callServer,void 0,b.findSourceMapURL,"installHooksWebAction"),w=(0,b.createServerReference)("6046cbf74c3190253e1615cc0f0225e6b9935b3d09",b.callServer,void 0,b.findSourceMapURL,"removeHooksWebAction"),C=(0,b.createServerReference)("6070a705a7c81c983fa4c6dc9917d60843ddeaa557",b.callServer,void 0,b.findSourceMapURL,"updatePolicyParamsAction");var S=e.i(85881),P=e.i(80060),$=e.i(2711),R=e.i(34713),T=e.i(67881);function A({sessionId:e,transcriptPath:r,integration:s,cwd:a}){if(!e)return(0,t.jsx)("span",{className:"text-muted-foreground",children:"\\u2014"});let o=e?e.slice(0,8):"—";if("codex"===s||r?.includes("/.codex/")){let r,s=a?(r=/^([A-Za-z]):[\\/](.*)$/.exec(a))?r[1]+"--"+r[2].replace(/[\\/]/g,"-"):a.replace(/[\\/]/g,"-"):"codex";return(0,t.jsx)(n.default,{href:`/project/${encodeURIComponent(s)}/session/${encodeURIComponent(e)}`,className:"text-primary hover:underline font-mono",onClick:e=>e.stopPropagation(),children:o})}let l=r?function(e){let t=e.replace(/\\/g,"/").split("/").filter(Boolean);if(t.length<2)return null;let r=t[t.length-2];return!r||r.startsWith(".")?null:r}(r):null;return l?(0,t.jsx)(n.default,{href:`/project/${encodeURIComponent(l)}/session/${encodeURIComponent(e)}`,className:"text-primary hover:underline font-mono",onClick:e=>e.stopPropagation(),children:o}):(0,t.jsx)("span",{className:"text-muted-foreground font-mono",children:o})}function I({decision:e}){return"deny"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,t.jsx)(i.ShieldX,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,t.jsx)(d.ShieldAlert,{className:"h-3 w-3"}),"Instruct"]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,t.jsx)(l.ShieldCheck,{className:"h-3 w-3"}),"Allow"]})}function M({eventType:e}){return(0,t.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:e})}function E({integration:e}){if(!e)return null;let r="claude"===e?"Claude Code":"codex"===e?"OpenAI Codex":e,s="codex"===e;return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${s?"bg-purple-500/10 text-purple-400 border-purple-500/20":"bg-orange-500/10 text-orange-400 border-orange-500/20"}`,title:`Agent CLI: ${r}`,children:r})}function U({mode:e}){let r="default"===e;return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${r?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function F({ms:e}){return(0,t.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function D({text:e}){let[s,n]=(0,r.useState)(!1),a=async t=>{t.stopPropagation();try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),n(!0),setTimeout(()=>n(!1),1500)}};return(0,t.jsx)("button",{onClick:a,className:"inline-flex items-center justify-center h-5 w-5 rounded hover:bg-muted/50 text-muted-foreground hover:text-foreground transition-colors",title:"Copy",children:s?(0,t.jsx)(x.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(u.Copy,{className:"h-3 w-3"})})}function L({value:e,onChange:r}){return(0,t.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(s=>(0,t.jsx)("button",{onClick:()=>r(s.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===s.value?"deny"===s.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===s.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===s.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.label},s.value))})}function z({stats:e}){let r=e.totalEvents>0?(e.denyCount/e.totalEvents*100).toFixed(0):"0";return(0,t.jsxs)("div",{className:"flex items-center gap-6 text-[0.7rem] text-muted-foreground",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-foreground font-mono font-semibold",children:e.totalEvents})," total events"]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("span",{className:`font-mono font-semibold ${e.denyCount>0?"text-red-400":"text-foreground"}`,children:[r,"%"]})," ","deny rate"]}),(0,t.jsxs)("div",{className:"hidden sm:block",children:["top policy:"," ",(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.topPolicy??"—"})]})]})}function O({item:e}){return(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:10,className:"px-0 py-0",children:(0,t.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-expand",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,t.jsx)(D,{text:e.sessionId})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,t.jsx)(D,{text:e.cwd})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,t.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"})]})]}),e.policyNames&&e.policyNames.length>1&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.policyNames.join(", ")})]}),e.reason&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,t.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function B({hooksInstalled:e,onSwitchTab:s}){let{intervalSec:n}=(0,S.useAutoRefresh)(),a=(0,P.useUrlParams)(),o=(0,r.useRef)(!1),[l,i]=(0,r.useState)(()=>(0,$.paramToPage)(a.get("page"))),[d,u]=(0,r.useState)(null),[x,p]=(0,r.useState)(null),[h,f]=(0,r.useState)(()=>{let e=a.get("decision");return"allow"===e||"deny"===e||"instruct"===e?e:""}),[b,y]=(0,r.useState)(()=>a.get("event")??""),[N,k]=(0,r.useState)(()=>a.get("policy")??""),[w,C]=(0,r.useState)(()=>a.get("session")??""),[T,D]=(0,r.useState)(()=>{let e=a.get("cli");return"claude"===e||"codex"===e?e:""}),H=(0,r.useRef)(null),X=(0,r.useRef)({filterDecision:h,filterEventType:b,filterPolicy:N,filterSessionId:w,filterCli:T});X.current={filterDecision:h,filterEventType:b,filterPolicy:N,filterSessionId:w,filterCli:T},(0,r.useEffect)(()=>{if(!o.current){o.current=!0;return}a.setAll({decision:h||void 0,event:b||void 0,policy:N||void 0,session:w||void 0,cli:T||void 0,page:(0,$.pageToParam)(l)})},[h,b,N,w,T,l]);let W=""!==h||""!==b||""!==N||""!==w||""!==T,q=(0,r.useCallback)(async e=>{try{let t,{filterDecision:r,filterEventType:s,filterPolicy:n,filterSessionId:a,filterCli:o}=X.current;t=""!==r||""!==s||""!==n||""!==a||""!==o?await (0,v.searchHookActivityAction)({decision:r||void 0,eventType:s||void 0,policyName:n||void 0,sessionId:a||void 0,integration:o||void 0},e):await j(e),u(t)}catch{}},[]);(0,r.useEffect)(()=>{q(l);let e=setInterval(()=>q(l),n>0?1e3*n:5e3);return()=>clearInterval(e)},[l,q,n]),(0,r.useEffect)(()=>(H.current&&clearTimeout(H.current),H.current=setTimeout(()=>{i(1),p(null),q(1)},300),()=>{H.current&&clearTimeout(H.current)}),[h,b,N,w,T]);let V=d?.entries??[],J=d?.totalPages??1;return(0,t.jsxs)(t.Fragment,{children:[d?.stats&&d.stats.totalEvents>0&&(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(z,{stats:d.stats})}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,t.jsx)(L,{value:h,onChange:f}),(0,t.jsxs)("select",{value:b,onChange:e=>y(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,t.jsx)("option",{value:"",children:"All Events"}),(0,t.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,t.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,t.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,t.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,t.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,t.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,t.jsxs)("select",{value:T,onChange:e=>D(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow","aria-label":"Filter by CLI",children:[(0,t.jsx)("option",{value:"",children:"All CLIs"}),(0,t.jsx)("option",{value:"claude",children:"Claude Code"}),(0,t.jsx)("option",{value:"codex",children:"OpenAI Codex"})]}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",value:N,onChange:e=>k(e.target.value),placeholder:"Filter by policy\\u2026",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",value:w,onChange:e=>C(e.target.value),placeholder:"Filter by session…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===V.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 px-4 text-center",children:[(0,t.jsx)(c.Shield,{className:"h-12 w-12 text-muted-foreground/30"}),!1===e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-4 font-medium",children:"Policies are not installed"}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:["Go to the"," ",(0,t.jsx)("button",{className:"underline hover:text-foreground transition-colors",onClick:()=>s?.("policies"),children:"Policies tab"})," ","and click ",(0,t.jsx)("span",{className:"font-mono bg-muted px-1 rounded",children:"Install"})," to enable policy monitoring."]})]}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-4",children:W?"No matching activity.":"Waiting for hook events…"})]}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"CLI"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Session"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/30",children:V.map((e,s)=>{let n="deny"===e.decision,a=x===s,o="instruct"===e.decision;return(0,t.jsxs)(r.default.Fragment,{children:[(0,t.jsxs)("tr",{onClick:()=>{p(e=>e===s?null:s)},className:`cursor-pointer transition-colors ${n?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":o?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":s%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${a?"bg-muted/20":""}`,children:[(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsx)(m.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${a?"rotate-0":"-rotate-90"}`})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(I,{decision:e.decision})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(M,{eventType:e.eventType})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(E,{integration:e.integration})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyNames&&e.policyNames.length>1?(0,t.jsxs)("span",{title:e.policyNames.join(", "),children:[e.policyNames[0],(0,t.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",e.policyNames.length-1]})]}):e.policyName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(F,{ms:e.durationMs})}),(0,t.jsx)("td",{className:"px-3 py-2",title:e.sessionId??"",children:(0,t.jsx)(A,{sessionId:e.sessionId,transcriptPath:e.transcriptPath,integration:e.integration,cwd:e.cwd})}),(0,t.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,t.jsx)(U,{mode:e.permissionMode}):"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,R.formatRelativeTime)(e.timestamp)})]}),a&&(0,t.jsx)(O,{item:e})]},`${e.timestamp}-${s}`)})})]})}),(0,t.jsx)(g.default,{currentPage:l,totalPages:J,onPageChange:e=>{i(e),p(null)}})]})]})}function H({enabled:e,onChange:r,disabled:s}){return(0,t.jsx)("button",{onClick:r,disabled:s,className:`relative inline-flex h-4 w-7 shrink-0 items-center rounded-full transition-colors disabled:opacity-40 ${e?"bg-emerald-500":"bg-muted-foreground/30"}`,"aria-label":e?"Disable policy":"Enable policy",children:(0,t.jsx)("span",{className:`inline-block h-3 w-3 rounded-full bg-white shadow transition-transform ${e?"translate-x-3.5":"translate-x-0.5"}`})})}function X({policy:e,onClose:s,onSave:n}){let a=e.params??{},o=e.currentParams??{},[l,i]=(0,r.useState)(()=>{let e={};for(let[t,r]of Object.entries(a)){let s=t in o?o[t]:r.default;e[t]=s}return e});(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&s()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]);let d=(e,t)=>{i(r=>({...r,[e]:t}))};return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:e=>{e.target===e.currentTarget&&s()},children:(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-mono font-semibold text-foreground",children:e.name}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.description})]}),(0,t.jsx)("button",{onClick:s,className:"text-muted-foreground hover:text-foreground transition-colors",children:(0,t.jsx)(f.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"overflow-y-auto flex-1 px-4 py-4 space-y-4",children:Object.entries(a).map(([e,r])=>(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-xs font-semibold text-foreground mb-1 font-mono",children:e}),(0,t.jsx)("p",{className:"text-[0.65rem] text-muted-foreground mb-1.5",children:r.description}),((e,r)=>{let s=l[e];if("boolean"===r.type)return(0,t.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:!!s,onChange:t=>d(e,t.target.checked),className:"rounded border-border"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:r.description})]});if("number"===r.type)return(0,t.jsx)("input",{type:"number",value:"number"==typeof s?s:"",onChange:t=>d(e,Number(t.target.value)),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"});if("string[]"===r.type){let r=Array.isArray(s)?s.join("\n"):"";return(0,t.jsx)("textarea",{value:r,onChange:t=>d(e,t.target.value.split("\n").filter(e=>""!==e.trim())),rows:4,placeholder:"One entry per line",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground font-mono focus:outline-none focus:ring-2 focus:ring-primary/40 resize-y"})}if("pattern[]"===r.type){let r=Array.isArray(s)?s:[];return(0,t.jsxs)("div",{className:"space-y-1.5",children:[r.map((s,n)=>(0,t.jsxs)("div",{className:"flex gap-1.5 items-center",children:[(0,t.jsx)("input",{type:"text",value:s.regex,onChange:t=>{let s=[...r];s[n]={...s[n],regex:t.target.value},d(e,s)},placeholder:"regex",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs font-mono focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,t.jsx)("input",{type:"text",value:s.label,onChange:t=>{let s=[...r];s[n]={...s[n],label:t.target.value},d(e,s)},placeholder:"label",className:"flex-1 h-6 rounded border border-border bg-background px-2 text-xs focus:outline-none focus:ring-2 focus:ring-primary/40"}),(0,t.jsx)("button",{onClick:()=>d(e,r.filter((e,t)=>t!==n)),className:"text-muted-foreground/50 hover:text-destructive transition-colors",children:(0,t.jsx)(f.X,{className:"h-3.5 w-3.5"})})]},n)),(0,t.jsx)("button",{onClick:()=>d(e,[...r,{regex:"",label:""}]),className:"text-xs text-primary hover:underline",children:"+ Add pattern"})]})}return(0,t.jsx)("input",{type:"text",value:"string"==typeof s?s:"",onChange:t=>d(e,t.target.value),className:"w-full h-7 rounded border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40"})})(e,r)]},e))}),(0,t.jsxs)("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-border",children:[(0,t.jsx)(T.Button,{variant:"outline",size:"sm",onClick:s,className:"h-7 text-xs",children:"Cancel"}),(0,t.jsx)(T.Button,{size:"sm",onClick:()=>n(l),className:"h-7 text-xs",children:"Save"})]})]})})}function W({message:e,onDismiss:r,onInstall:n,isPending:a}){return(0,s.createPortal)((0,t.jsxs)("div",{className:"fixed top-4 right-4 z-[9999] w-full max-w-sm",style:{animation:"slideInFromRight 0.25s ease-out"},children:[(0,t.jsx)("style",{children:`
2
+ @keyframes slideInFromRight {
3
+ from { transform: translateX(calc(100% + 1rem)); opacity: 0; }
4
+ to { transform: translateX(0); opacity: 1; }
5
+ }
6
+ `}),(0,t.jsxs)("div",{className:"rounded-lg border border-red-500/40 bg-red-950/95 shadow-2xl shadow-red-900/40 overflow-hidden backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"h-0.5 w-full bg-gradient-to-r from-red-600 via-red-400 to-red-600"}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"shrink-0 mt-0.5 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 ring-2 ring-red-500/30",children:(0,t.jsx)(f.X,{className:"h-3 w-3 text-white",strokeWidth:3})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-[0.65rem] font-bold uppercase tracking-widest text-red-400 mb-0.5",children:"Error"}),(0,t.jsx)("p",{className:"text-sm text-red-100 leading-snug",children:e})]}),(0,t.jsx)("button",{onClick:r,className:"shrink-0 -mt-0.5 -mr-0.5 rounded p-0.5 text-red-400/60 transition-colors hover:bg-red-500/20 hover:text-red-200","aria-label":"Dismiss",children:(0,t.jsx)(f.X,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,t.jsx)(T.Button,{size:"sm",onClick:()=>{r(),n()},disabled:a,className:"h-7 flex-1 border-0 bg-red-500 px-3 text-xs font-semibold text-white hover:bg-red-400 disabled:opacity-50",children:"Install hooks"}),(0,t.jsx)(T.Button,{variant:"ghost",size:"sm",onClick:r,className:"h-7 px-3 text-xs text-red-400 hover:bg-red-500/10 hover:text-red-200",children:"Dismiss"})]})]})]})]}),document.body)}function q({onHooksInstallChange:e}){let[s,n]=(0,r.useState)(null),[a,o]=(0,r.useTransition)(),[l,i]=(0,r.useState)(null),[d,m]=(0,r.useState)(null),[u,x]=(0,r.useState)(null),f=(0,r.useCallback)(async()=>{try{let t=await y();n(t),e?.(t.installedScopes.length>0)}catch{}},[e]);(0,r.useEffect)(()=>{f()},[f]);let g=()=>{o(async()=>{try{i(null),await k("user"),await f()}catch(e){i(e instanceof Error?e.message:"Failed to install hooks.")}})};if(!s)return(0,t.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading\\u2026"})});let b=s.installedScopes.length>0,j=Array.from(new Set(s.policies.map(e=>e.category)));return(0,t.jsxs)(t.Fragment,{children:[u&&(0,t.jsx)(X,{policy:u,onClose:()=>x(null),onSave:e=>{if(!u)return;let t=u.name;x(null),o(async()=>{try{i(null),await C(t,e),await f()}catch(e){i(e instanceof Error?e.message:"Failed to save configuration.")}})}}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full shrink-0 ${b?"bg-emerald-500":"bg-muted-foreground/50"}`}),(0,t.jsx)("span",{className:"text-sm text-foreground",children:b?"Policies installed":"Policies not installed"}),b&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground font-mono hidden sm:inline",children:["· ",s.installedScopes.join(", ")," scope · ",s.settingsPath]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[b&&(0,t.jsx)(T.Button,{variant:"outline",size:"sm",onClick:()=>{o(async()=>{try{i(null),await w("user"),await f()}catch(e){i(e instanceof Error?e.message:"Failed to remove hooks.")}})},disabled:a,className:"text-xs h-7 px-3",children:"Remove"}),(0,t.jsx)(T.Button,{variant:b?"outline":"default",size:"sm",onClick:g,disabled:a,className:"text-xs h-7 px-3",children:b?"Reinstall":"Install policies"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 bg-muted/5",children:[(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[(0,t.jsx)("span",{className:"font-semibold text-foreground",children:s.enabledPolicies.length})," / ",s.policies.length+(s.customPolicies?.length??0)," ","policies enabled"]}),b&&(0,t.jsxs)("span",{className:"text-[0.65rem] text-muted-foreground/60",children:["· active in ",s.installedScopes.join(", ")," scope"]})]}),l&&(0,t.jsx)("div",{className:"px-4 py-2 bg-red-500/10 border-b border-red-500/20 text-xs text-red-400",children:l}),d&&(0,t.jsx)(W,{message:d,onDismiss:()=>m(null),onInstall:g,isPending:a}),j.map(e=>{let r=s.policies.filter(t=>t.category===e),l=r.filter(e=>e.enabled).length;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,t.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:e}),(0,t.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[l," / ",r.length," enabled"]})]}),r.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors",children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:(0,t.jsx)(H,{enabled:e.enabled,onChange:()=>{var t,r;return t=e.name,r=e.enabled,void(!s||(!(s.installedScopes.length>0)?m("Policies are not installed. Install policies to continue."):(m(null),n(e=>e?{...e,policies:e.policies.map(e=>e.name===t?{...e,enabled:!r}:e),enabledPolicies:r?e.enabledPolicies.filter(e=>e!==t):[...e.enabledPolicies,t]}:e),o(async()=>{try{await N(t,!r)}catch{i("Failed to save policy change."),f()}}))))},disabled:a})}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:e.name}),e.beta&&(0,t.jsx)("span",{className:"shrink-0 text-[0.6rem] px-1 py-0.5 rounded border bg-violet-500/10 text-violet-400 border-violet-500/20",children:"beta"})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground leading-relaxed",children:e.description}),e.eventScope&&(0,t.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block",children:e.eventScope}),e.params&&Object.keys(e.params).length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-1 mt-1.5",children:Object.entries(e.params).map(([r,s])=>{let n=e.currentParams?.[r]??s.default,a=JSON.stringify(n)!==JSON.stringify(s.default);return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 font-mono text-[0.6rem] px-1.5 py-0.5 rounded border ${a?"bg-primary/10 text-primary/70 border-primary/20":"bg-muted/40 text-muted-foreground/55 border-border/40"}`,children:[(0,t.jsxs)("span",{className:"opacity-70",children:[r,":"]}),(0,t.jsx)("span",{children:function(e,t){if("string[]"===e||"pattern[]"===e){let r=Array.isArray(t)?t:[];return 0===r.length?"none":"pattern[]"===e?`${r.length} pattern${1!==r.length?"s":""}`:1===r.length?String(r[0]).slice(0,24):`${r.length} values`}return"boolean"===e?t?"on":"off":null==t||""===t?"—":String(t).slice(0,32)}(s.type,n)})]},r)})})]}),e.params&&Object.keys(e.params).length>0&&(0,t.jsx)("button",{className:"shrink-0 mt-0.5 text-muted-foreground hover:text-primary transition-colors",onClick:()=>x(e),title:"Edit parameters",children:(0,t.jsx)(p.Settings,{className:"h-3.5 w-3.5"})})]},e.name))]},e)}),s.customPoliciesPath&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 bg-muted/20 border-b border-border/50",children:[(0,t.jsx)("span",{className:"text-[0.7rem] font-semibold uppercase tracking-wider text-muted-foreground",children:"Custom Policies"}),(0,t.jsxs)("span",{className:"text-[0.7rem] text-muted-foreground",children:[s.customPolicies?.length??0," detected"]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/20",children:[(0,t.jsx)(h,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground truncate",children:s.customPoliciesPath})]}),(0,t.jsxs)("div",{className:"flex items-start gap-2 px-4 py-2.5 border-b border-border/20 bg-muted/10",children:[(0,t.jsx)(c.Shield,{className:"h-3.5 w-3.5 text-muted-foreground/60 shrink-0 mt-0.5"}),(0,t.jsx)("p",{className:"text-[0.7rem] text-muted-foreground/70 leading-relaxed",children:"Custom policies are always active. To add, remove, or reorder them, edit the JS file above."})]}),s.customPolicies?.map(e=>(0,t.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 border-b border-border/20 hover:bg-muted/20 transition-colors",children:[(0,t.jsx)("div",{className:"h-4 w-7 shrink-0 mt-0.5"}),(0,t.jsx)("div",{className:"flex items-center gap-1.5 min-w-0 w-56 shrink-0 mt-0.5",children:(0,t.jsx)("span",{className:"text-xs font-mono text-foreground truncate",children:e.name})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[e.description&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground leading-relaxed",children:e.description}),e.eventScope&&(0,t.jsx)("span",{className:"block text-[0.65rem] text-muted-foreground/40 font-mono mt-0.5 hidden lg:block",children:e.eventScope})]})]},e.name))]})]})]})}function V({activeTab:e,onChange:r}){return(0,t.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5 mb-5",children:[{id:"activity",label:"Activity"},{id:"policies",label:"Configure"}].map(s=>(0,t.jsx)("button",{onClick:()=>r(s.id),className:`px-3 py-1.5 text-xs font-medium rounded transition-all ${e===s.id?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:s.label},s.id))})}e.s(["default",0,function({initialTab:e="activity"}){let s=(0,P.useUrlParams)(),[a,l]=(0,r.useState)(e),[i,d]=(0,r.useState)(void 0),[c,m]=(0,r.useState)(null);(0,r.useEffect)(()=>{y().then(e=>{d(e.installedScopes.length>0),m({enabled:e.enabledPolicies.length,total:e.policies.length+(e.customPolicies?.length??0)})}).catch(()=>d(void 0))},[]);let u=e=>{l(e),s.setAll({tab:"activity"===e?void 0:e})};return(0,t.jsxs)("div",{className:"min-h-screen bg-background px-4 py-6 sm:px-6 lg:px-10",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsxs)(n.default,{href:"/projects",className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,t.jsx)(o,{className:"h-3.5 w-3.5"}),"Back"]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-foreground tracking-tight",children:"Policies"}),"activity"===a&&(0,t.jsxs)("span",{className:"relative flex h-2.5 w-2.5 mt-0.5",children:[(0,t.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-emerald-500"})]})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"activity"===a?(0,t.jsxs)(t.Fragment,{children:["Policy evaluations for Claude",c&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:[" · ","enabled policies"," ",(0,t.jsxs)("span",{className:"font-mono text-foreground/70",children:[c.enabled,"/",c.total]})]}),(0,t.jsxs)("span",{className:"block text-xs text-muted-foreground/50 mt-0.5",children:["To configure policies,"," ",(0,t.jsx)("button",{className:"underline underline-offset-2 hover:text-foreground transition-colors",onClick:()=>u("policies"),children:"go here"})]})]}):"Configure Policies"})]}),(0,t.jsx)(V,{activeTab:a,onChange:u}),"activity"===a?(0,t.jsx)(B,{hooksInstalled:i,onSwitchTab:u}):(0,t.jsx)(q,{onHooksInstallChange:d})]})}],64245)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8734,89664,e=>{"use strict";var t=e.i(56420);let r=(0,t.default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,r],8734);let a=(0,t.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,a],89664)},24380,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(8734),s=e.i(89664),l=e.i(47163);function n(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t);try{return t.select(),document.execCommand("copy")}finally{document.body.removeChild(t)}}e.s(["CopyButton",0,function({text:e,className:o}){let[i,d]=(0,r.useState)(!1),u=(0,r.useCallback)(async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else if(!n(e))throw Error("Both clipboard methods failed");d(!0),setTimeout(()=>d(!1),2e3)}catch(t){console.error("Failed to copy to clipboard:",t);try{n(e)&&(d(!0),setTimeout(()=>d(!1),2e3))}catch{}}},[e]);return(0,t.jsx)("button",{onClick:u,title:"Copy to clipboard",className:(0,l.cn)("inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors",o),children:i?(0,t.jsx)(s.Check,{className:"w-3.5 h-3.5 text-green-500"}):(0,t.jsx)(a.Copy,{className:"w-3.5 h-3.5"})})}])},24071,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],24071)},67927,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],67927)},73520,e=>{"use strict";var t=e.i(43476),r=e.i(24071),a=e.i(67927);e.s(["default",0,function({currentPage:e,totalPages:s,onPageChange:l}){if(s<=1)return null;let n=e=>`px-3 py-2 text-sm rounded-md transition-colors flex items-center gap-1 bg-muted text-muted-foreground ${e?"opacity-50 cursor-not-allowed":"hover:bg-muted/80"}`;return(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-4",children:[(0,t.jsxs)("button",{onClick:()=>l(e-1),disabled:1===e,className:n(1===e),"aria-label":"Previous page",children:[(0,t.jsx)(r.ChevronLeft,{className:"w-4 h-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1",children:(()=>{if(s<=7)return Array.from({length:s},(e,t)=>t+1);let t=[1],r=Math.max(2,e-1),a=Math.min(s-1,e+1);e<=3&&(a=Math.min(5,s-1)),e>=s-2&&(r=Math.max(2,s-4)),r>2&&t.push("ellipsis-start");for(let e=r;e<=a;e++)t.push(e);return a<s-1&&t.push("ellipsis-end"),t.push(s),t})().map(r=>"string"==typeof r?(0,t.jsx)("span",{className:"px-2 text-muted-foreground",children:"..."},r):(0,t.jsx)("button",{onClick:()=>l(r),className:`min-w-[2.5rem] px-3 py-2 text-sm rounded-md transition-colors ${e===r?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,"aria-label":`Page ${r}`,"aria-current":e===r?"page":void 0,children:r},r))}),(0,t.jsxs)("button",{onClick:()=>l(e+1),disabled:e===s,className:n(e===s),"aria-label":"Next page",children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(a.ChevronRight,{className:"w-4 h-4"})]})]})}])},80060,2711,e=>{"use strict";var t=e.i(18566),r=e.i(71645);function a(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${a}`}function s(e){var t;if(!e||(t=e,!/^\d{4}-\d{2}-\d{2}$/.test(t)||isNaN(Date.parse(t))))return null;let[r,a,s]=e.split("-").map(Number);return new Date(r,a-1,s,12,0,0)}e.s(["useUrlParams",0,function(){let e=(0,t.useSearchParams)(),a=(0,t.useRouter)(),s=(0,t.usePathname)(),l=(0,r.useRef)(null),n=(0,r.useCallback)(t=>e.get(t),[e]),o=(0,r.useCallback)(()=>new URLSearchParams(e.toString()),[e]),i=(0,r.useCallback)(t=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{let r=new URLSearchParams(e.toString());for(let[e,a]of Object.entries(t))void 0===a||""===a?r.delete(e):r.set(e,a);let l=r.toString(),n=l?`${s}?${l}`:s;a.replace(n,{scroll:!1})},150)},[e,s,a]);return(0,r.useEffect)(()=>()=>{l.current&&clearTimeout(l.current)},[]),{get:n,getAll:o,setAll:i}}],80060),e.s(["dateRangeToParams",0,function(e){let t={};return e.from&&(t.from=a(e.from)),e.to&&(t.to=a(e.to)),t},"keywordsToParam",0,function(e){if(0!==e.length)return e.map(e=>encodeURIComponent(e)).join(",")},"pageToParam",0,function(e){return e<=1?void 0:String(e)},"paramToKeywords",0,function(e){return e?e.split(",").map(e=>decodeURIComponent(e.trim())).filter(e=>e.length>0):[]},"paramToPage",0,function(e){if(!e)return 1;let t=parseInt(e,10);return Number.isFinite(t)&&t>=1?t:1},"paramToPreset",0,function(e){return e&&["all","last-hour","today","last-7-days","last-30-days","custom"].includes(e)?e:"all"},"paramsToDateRange",0,function(e,t){return{from:s(e),to:s(t)}},"presetToParam",0,function(e){return"all"===e?void 0:e}],2711)},62706,20087,30005,66595,85898,e=>{"use strict";e.s(["formatDate",0,function(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}).format(e)}],62706),e.s(["FILTER_PRESETS",0,[{value:"all",label:"All"},{value:"last-hour",label:"Last Hour"},{value:"today",label:"Today"},{value:"last-7-days",label:"Last 7 Days"},{value:"last-30-days",label:"Last 30 Days"}],"ITEMS_PER_PAGE",0,25,"filterByDate",0,function(e,t,r){if("all"===t)return e;if("custom"===t){let t,a,s=r.from?((t=new Date(r.from)).setHours(0,0,0,0),t):null,l=r.to?((a=new Date(r.to)).setHours(23,59,59,999),a):null;return e.filter(e=>(!s||!(e.lastModified<s))&&(!l||!(e.lastModified>l)))}let a=function(e){let t=new Date;switch(e){case"last-hour":return new Date(t.getTime()-36e5);case"today":return new Date(t.getFullYear(),t.getMonth(),t.getDate());case"last-7-days":return new Date(t.getTime()-6048e5);case"last-30-days":return new Date(t.getTime()-2592e6);default:return null}}(t);return a?e.filter(e=>e.lastModified>=a):e},"rehydrateDates",0,function(e){return e.map(e=>({...e,lastModified:e.lastModified instanceof Date?e.lastModified:new Date(e.lastModified)}))}],20087);var t=e.i(71645);e.s(["useFilterState",0,function(e=[],r){let[a,s]=(0,t.useState)(r?.filterPreset??"all"),[l,n]=(0,t.useState)(r?.dateRange??{from:null,to:null}),[o,i]=(0,t.useState)(r?.currentPage??1),d=`${a}|${JSON.stringify(l)}|${JSON.stringify(e)}`,[u,c]=(0,t.useState)(d);d!==u&&(c(d),i(1));let m=(0,t.useCallback)(e=>{s(e),"custom"!==e&&n({from:null,to:null})},[]);return{filterPreset:a,dateRange:l,currentPage:o,setCurrentPage:i,handlePresetChange:m,handleDateRangeChange:(0,t.useCallback)((e,t)=>{s("custom"),n(r=>({...r,[e]:t?new Date(t):null}))},[]),clearFilters:(0,t.useCallback)(()=>{s("all"),n({from:null,to:null})},[])}}],30005);var r=e.i(56420);let a=(0,r.default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,a],66595);var s=e.i(43476);let l=(0,r.default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["default",0,function({id:e,value:t,stringValue:r,onChange:a,"aria-label":n}){let o=null!=r?r:t?t.toISOString().split("T")[0]:"";return(0,s.jsxs)("div",{className:"relative group",children:[(0,s.jsx)("input",{type:"date",id:e,value:o,onChange:e=>a(e.target.value),"aria-label":n,className:"date-input px-3 py-2 pr-8 text-sm bg-input border border-border rounded-md text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all hover:border-primary/50 w-[200px]"}),(0,s.jsx)("label",{htmlFor:e,className:"absolute right-2.5 top-1/2 -translate-y-1/2 cursor-pointer pointer-events-auto z-10 p-1 rounded hover:bg-muted/50 transition-colors",onClick:t=>{t.preventDefault();let r=document.getElementById(e);r&&"function"==typeof r.showPicker?r.showPicker():r?.click()},children:(0,s.jsx)(l,{className:"w-4 h-4 text-primary group-hover:text-primary/80 transition-colors"})})]})}],85898)},43418,e=>{"use strict";var t=e.i(43476);e.s(["CliBadge",0,function({cli:e}){let r="codex"===e,a=r?"OpenAI Codex":"Claude Code";return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${r?"bg-purple-500/10 text-purple-400 border-purple-500/20":"bg-orange-500/10 text-orange-400 border-orange-500/20"}`,title:`Agent CLI: ${a}`,children:a})}])},73294,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(62706),s=e.i(20087),l=e.i(30005),n=e.i(80060),o=e.i(2711);let i=(0,e.i(56420).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var d=e.i(66595),u=e.i(22016),c=e.i(73520),m=e.i(85898),f=e.i(24380),p=e.i(43418);e.s(["default",0,function({files:e,projectName:h}){let x=(0,n.useUrlParams)(),g=(0,r.useRef)(!1),[b,y]=(0,r.useState)(()=>x.get("sid")??""),{filterPreset:v,dateRange:j,currentPage:N,setCurrentPage:w,handlePresetChange:C,handleDateRangeChange:k,clearFilters:P}=(0,l.useFilterState)([b],{filterPreset:(0,o.paramToPreset)(x.get("preset")),dateRange:(0,o.paramsToDateRange)(x.get("from"),x.get("to")),currentPage:(0,o.paramToPage)(x.get("page"))});(0,r.useEffect)(()=>{if(!g.current){g.current=!0;return}x.setAll({preset:(0,o.presetToParam)(v),...(0,o.dateRangeToParams)(j),sid:b||void 0,page:(0,o.pageToParam)(N)})},[v,j,b,N]);let T=(0,r.useMemo)(()=>(0,s.rehydrateDates)(e),[e]),S=(0,r.useMemo)(()=>{var e;let t;return(e=(0,s.filterByDate)(T,v,j),!(t=b.trim().toLowerCase())?e:e.filter(e=>e.sessionId?.toLowerCase().includes(t))).sort((e,t)=>t.lastModified.getTime()-e.lastModified.getTime())},[T,b,v,j]),M=Math.max(1,Math.ceil(S.length/s.ITEMS_PER_PAGE));(0,r.useEffect)(()=>{N>M&&w(M)},[N,M,w]);let D=(N-1)*s.ITEMS_PER_PAGE,R=Math.min(D+s.ITEMS_PER_PAGE,S.length),I=S.slice(D,R),E="all"!==v||null!==j.from||null!==j.to||""!==b;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg p-4 flex flex-col gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Filter by:"}),s.FILTER_PRESETS.map(e=>(0,t.jsx)("button",{onClick:()=>C(e.value),className:`px-3 py-1.5 text-sm rounded-md transition-colors ${v===e.value?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"}`,children:e.label},e.value))]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Custom Range:"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m.default,{id:"date-from",value:j.from,onChange:e=>k("from",e),"aria-label":"Filter from date"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"to"}),(0,t.jsx)(m.default,{id:"date-to",value:j.to,onChange:e=>k("to",e),"aria-label":"Filter to date"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Search,{className:"w-4 h-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Filter by Session ID:"}),(0,t.jsx)("input",{type:"text",value:b,onChange:e=>y(e.target.value),placeholder:"Enter session ID (UUID)",className:"px-3 py-2 text-sm bg-input border border-border rounded-md text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all hover:border-primary/50 flex-1 max-w-md","aria-label":"Filter by session ID"}),E&&(0,t.jsx)("button",{onClick:()=>{P(),y("")},className:"px-3 py-2 text-sm bg-muted text-muted-foreground hover:bg-muted/80 rounded-md transition-colors",children:"Clear"})]}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:0===S.length?"No sessions found":(0,t.jsxs)(t.Fragment,{children:["Showing ",D+1,"-",R," of ",S.length," sessions",S.length!==T.length&&(0,t.jsxs)("span",{className:"ml-1",children:["(filtered from ",T.length," total)"]})]})})]}),(0,t.jsxs)("div",{className:"bg-card border border-border rounded-lg overflow-hidden",children:[(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-border bg-muted/50",children:[(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground w-12",children:(0,t.jsx)("span",{className:"sr-only",children:"Icon"})}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground",children:"SessionId"}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3 text-left text-sm font-semibold text-foreground",children:"Modified"})]})}),(0,t.jsx)("tbody",{children:0===I.length?(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:3,className:"px-4 py-8 text-center text-muted-foreground",children:"No sessions found matching the filter."})}):I.map(e=>(0,t.jsxs)("tr",{className:"border-b border-border hover:bg-muted/50 transition-colors",children:[(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsx)(i,{className:"w-5 h-5 text-primary"})}),(0,t.jsx)("td",{className:"px-4 py-3 max-w-md",children:(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[e.sessionId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.default,{href:`/project/${encodeURIComponent(h)}/session/${encodeURIComponent(e.sessionId)}`,className:"font-semibold text-foreground hover:text-primary transition-colors break-words break-all inline-block max-w-full",children:e.name.replace(/\.jsonl$/,"")}),(0,t.jsx)(f.CopyButton,{text:e.sessionId})]}):(0,t.jsx)("span",{className:"font-semibold text-foreground break-words break-all inline-block max-w-full",children:e.name.replace(/\.jsonl$/,"")}),e.cli&&(0,t.jsx)(p.CliBadge,{cli:e.cli})]})}),(0,t.jsx)("td",{className:"px-4 py-3 text-sm text-muted-foreground",children:e.lastModifiedFormatted||(0,a.formatDate)(e.lastModified)})]},e.path))})]})}),S.length>0&&(0,t.jsx)(c.default,{currentPage:N,totalPages:M,onPageChange:w})]})]})}],73294)}]);
@@ -1,4 +1,4 @@
1
1
  (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36406,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(74080);function n(e,t,s){let r,n=s.initialDeps??[],i=!0;function o(){var o,a,l;let d,c;s.key&&(null==(o=s.debug)?void 0:o.call(s))&&(d=Date.now());let u=e();if(!(u.length!==n.length||u.some((e,t)=>n[t]!==e)))return r;if(n=u,s.key&&(null==(a=s.debug)?void 0:a.call(s))&&(c=Date.now()),r=t(...u),s.key&&(null==(l=s.debug)?void 0:l.call(s))){let e=Math.round((Date.now()-d)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,n=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${n(t,5)} /${n(e,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
- color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==s?void 0:s.key)}return(null==s?void 0:s.onChange)&&!(i&&s.skipInitialOnChange)&&s.onChange(r),i=!1,r}return o.updateDeps=e=>{n=e},o}function i(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}e.i(47167);let o=e=>e,a=e=>{let t=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=s;e++)r.push(e);return r},l={passive:!0},d=(e,t)=>{let s=e.scrollElement;if(!s)return;let r=()=>{t({width:s.innerWidth,height:s.innerHeight})};return r(),s.addEventListener("resize",r,l),()=>{s.removeEventListener("resize",r)}},c="u"<typeof window||"onscrollend"in window,u=(e,t)=>{var s,r;let n,i=e.scrollElement;if(!i)return;let o=e.targetWindow;if(!o)return;let a=0,d=e.options.useScrollendEvent&&c?()=>void 0:(s=()=>{t(a,!1)},r=e.options.isScrollingResetDelay,function(...e){o.clearTimeout(n),n=o.setTimeout(()=>s.apply(this,e),r)}),u=s=>()=>{a=i[e.options.horizontal?"scrollX":"scrollY"],d(),t(a,s)},h=u(!0),m=u(!1);i.addEventListener("scroll",h,l);let p=e.options.useScrollendEvent&&c;return p&&i.addEventListener("scrollend",m,l),()=>{i.removeEventListener("scroll",h),p&&i.removeEventListener("scrollend",m)}},h=(e,t,s)=>{if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},m=(e,{adjustments:t=0,behavior:s},r)=>{var n,i;null==(i=null==(n=r.scrollElement)?void 0:n.scrollTo)||i.call(n,{[r.options.horizontal?"left":"top"]:e+t,behavior:s})};class p{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e,t,s;return(null==(s=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:s.call(t))??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,s=this.indexFromElement(t);t.isConnected?this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,e,this)):this.observer.unobserve(t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var s;null==(s=t())||s.disconnect(),e=null},observe:e=>{var s;return null==(s=t())?void 0:s.observe(e,{box:"border-box"})},unobserve:e=>{var s;return null==(s=t())?void 0:s.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,s])=>{void 0===s&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:o,rangeExtractor:a,onChange:()=>{},measureElement:h,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...e}},this.notify=e=>{var t,s;null==(s=(t=this.options).onChange)||s.call(t,this,e)},this.maybeNotify=n(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let s=new Map,r=new Map;for(let n=t-1;n>=0;n--){let t=e[n];if(s.has(t.lane))continue;let i=r.get(t.lane);if(null==i||t.end>i.end?r.set(t.lane,t):t.end<i.end&&s.set(t.lane,!0),s.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=n(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,s,r,n,i,o)=>(void 0!==this.prevLanes&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:n,lanes:i,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=n(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:n,lanes:i,laneAssignmentMode:o},a)=>{if(!n)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let d=this.measurementsCache.slice(0,l),c=Array(i).fill(void 0);for(let e=0;e<l;e++){let t=d[e];t&&(c[t.lane]=e)}for(let n=l;n<e;n++){let e,i,l=r(n),u=this.laneAssignments.get(n),h="estimate"===o||a.has(l);if(void 0!==u&&this.options.lanes>1){let r=c[e=u],n=void 0!==r?d[r]:void 0;i=n?n.end+this.options.gap:t+s}else{let r=1===this.options.lanes?d[n-1]:this.getFurthestMeasurement(d,n);i=r?r.end+this.options.gap:t+s,e=r?r.lane:n%this.options.lanes,this.options.lanes>1&&h&&this.laneAssignments.set(n,e)}let m=a.get(l),p="number"==typeof m?m:this.options.estimateSize(n),x=i+p;d[n]={index:n,start:i,size:p,end:x,key:l,lane:e},c[e]=n}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=n(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,s,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:s,lanes:r}){let n=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:n};let i=x(0,n,t=>e[t].start,s),o=i;if(1===r)for(;o<n&&e[o].end<s+t;)o++;else if(r>1){let a=Array(r).fill(0);for(;o<n&&a.some(e=>e<s+t);){let t=e[o];a[t.lane]=t.end,o++}let l=Array(r).fill(s+t);for(;i>=0&&l.some(e=>e>=s);){let t=e[i];l[t.lane]=t.start,i--}i=Math.max(0,i-i%r),o=Math.min(n,o+(r-1-o%r))}return{startIndex:i,endIndex:o}}({measurements:e,outerSize:t,scrollOffset:s,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=n(()=>{let e=null,t=null,s=this.calculateRange();return s&&(e=s.startIndex,t=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,s,r,n)=>null===r||null===n?[]:e({startIndex:r,endIndex:n,overscan:t,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;let s=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==s&&this.range){let t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,s-t),n=Math.min(this.options.count-1,s+t);return e>=r&&e<=n}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});let t=this.indexFromElement(e),s=this.options.getItemKey(t),r=this.elementsCache.get(s);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(s,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var s;let r=this.measurementsCache[e];if(!r)return;let n=t-(this.itemSizeCache.get(r.key)??r.size);0!==n&&((null==(s=this.scrollState)?void 0:s.behavior)!=="smooth"&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,n,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,t)),this.notify(!1))},this.getVirtualItems=n(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let s=[];for(let r=0,n=e.length;r<n;r++){let n=t[e[r]];s.push(n)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(0!==t.length)return i(t[x(0,t.length-1,e=>i(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,s=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),n=this.getScrollOffset();return"auto"===t&&(t=e>=n+r?"end":"start"),"center"===t?e+=(s-r)/2:"end"===t&&(e-=r),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getSize(),r=this.getScrollOffset(),n=this.measurementsCache[e];if(!n)return;if("auto"===t)if(n.end>=r+s-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=r+this.options.scrollPaddingStart))return[r,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let i="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,t,n.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:s="auto"}={})=>{let r=this.getOffsetForAlignment(e,t),n=this.now();this.scrollState={index:null,align:t,behavior:s,startedAt:n,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t="auto",behavior:s="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[n,i]=r,o=this.now();this.scrollState={index:e,align:i,behavior:s,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t="auto"}={})=>{let s=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:"start",behavior:t,startedAt:r,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var e;let t,s=this.getMeasurements();if(0===s.length)t=this.options.paddingStart;else if(1===this.options.lanes)t=(null==(e=s[s.length-1])?void 0:e.end)??0;else{let e=Array(this.options.lanes).fill(null),r=s.length-1;for(;r>=0&&e.some(e=>null===e);){let t=s[r];null===e[t.lane]&&(e[t.lane]=t.end),r--}t=Math.max(...e.filter(e=>null!==e))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,s=t!==this.scrollState.lastTargetOffset;if(!s&&1.01>Math.abs(t-this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,s&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior="auto",this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}let x=(e,t,s,r)=>{for(;e<=t;){let n=(e+t)/2|0,i=s(n);if(i<r)e=n+1;else{if(!(i>r))return n;t=n-1}}return e>0?e-1:0},g="u">typeof document?s.useLayoutEffect:s.useEffect;var f=e.i(16327),y=e.i(56420);let b=(0,y.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),v=(0,y.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),j=(0,y.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),w=(0,y.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),N=(0,y.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var S=e.i(68590);let M=(0,y.default)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);var k=e.i(34713);let C=s.default.memo(function({entries:e,compact:r=!1}){let n=(0,s.useMemo)(()=>(function(e){let t=0,s=0,r=0,n=0,i=0,o=new Set;for(let a of e)if("user"===a.type&&t++,"queue-operation"===a.type&&i++,"assistant"===a.type){for(let e of(s++,a.message.content))"tool_use"===e.type&&("Task"===e.name&&(e.subagentType||e.subagentId)?n++:r++);a.message.model&&o.add(a.message.model)}let a="";if(e.length>=2){let t=e[e.length-1].timestampMs-e[0].timestampMs;a=(0,k.formatDuration)(t)}return{turnCount:i,userCount:t,assistantCount:s,toolCallCount:r,subagentCount:n,duration:a,models:Array.from(o)}})(e),[e]),i=r?"w-3.5 h-3.5":"w-4 h-4",o=r?"text-xs font-medium":"text-sm font-medium",a=r?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground",l=[...r?[]:[{Icon:S.MessageSquare,color:"text-primary",v:n.turnCount,l:"Turns"}],{Icon:v,color:"text-[color:var(--chart-1)]",v:n.userCount,l:"User"},{Icon:j,color:"text-[color:var(--chart-2)]",v:n.assistantCount,l:"Assistant"},{Icon:b,color:"text-[color:var(--chart-3)]",v:n.toolCallCount,l:r?"Tools":"Tool Calls"},{Icon:M,color:"text-[color:var(--chart-5)]",v:n.subagentCount,l:"Subagents"},{Icon:N,color:"text-[color:var(--chart-4)]",v:n.duration||"—",l:"Duration"},{Icon:w,color:"text-[color:var(--chart-5)]",v:n.models.length>0?n.models.join(", "):"—",l:r?"Model":"Model(s)"}];return(0,t.jsx)("div",{className:r?"bg-muted/30 border border-border/50 rounded-lg p-3 mb-3":"bg-card border border-border rounded-lg p-4",children:(0,t.jsx)("div",{className:`grid grid-cols-2 ${r?"sm:grid-cols-6 gap-3":"sm:grid-cols-4 lg:grid-cols-7 gap-4"}`,children:l.map(({Icon:e,color:s,v:r,l:n})=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:`${i} ${s}`}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:`${o} truncate max-w-[120px]`,children:r}),(0,t.jsx)("div",{className:a,children:n})]})]},n))})})}),E=(0,y.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var I=e.i(67927);function T(e){return JSON.stringify(e.raw,null,2)}let O=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});function A(e){let t=new Date(e),s=O.format(t),r=t.getMilliseconds().toString().padStart(3,"0");return`${s}.${r}`}let z=s.default.memo(function({entry:e,isCollapsed:s,entryCount:r,onToggle:n}){let i="function"==typeof n,o=(0,t.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-medium${i?" group-hover:bg-primary/20 transition-colors":""}`,children:[i?(0,t.jsx)(I.ChevronRight,{className:`w-3 h-3 transition-transform ${s?"":"rotate-90"}`}):(0,t.jsx)(E,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-muted-foreground",children:A(e.timestampMs)}),i&&s&&"number"==typeof r&&(0,t.jsxs)("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-primary/20 text-[10px] leading-none",children:[r," ",1===r?"entry":"entries"]})]});return i?(0,t.jsxs)("button",{type:"button",onClick:n,className:"group flex items-center gap-3 py-3 px-4 w-full cursor-pointer",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),o,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]}):(0,t.jsxs)("div",{className:"flex items-center gap-3 py-3 px-4",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),o,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]})});var F=e.i(47163);let $={user:"User",assistant:"Assistant","file-history-snapshot":"Snapshot",progress:"Progress",system:"System","queue-operation":"Queue"},D={user:"bg-[color:var(--chart-1)]/20 text-[color:var(--chart-1)] border-[color:var(--chart-1)]/30",assistant:"bg-[color:var(--chart-2)]/20 text-[color:var(--chart-2)] border-[color:var(--chart-2)]/30","file-history-snapshot":"bg-[color:var(--chart-3)]/20 text-[color:var(--chart-3)] border-[color:var(--chart-3)]/30",progress:"bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",system:"bg-[color:var(--chart-4)]/20 text-[color:var(--chart-4)] border-[color:var(--chart-4)]/30","queue-operation":"bg-primary/20 text-primary border-primary/30"},R={user:"border-l-[color:var(--chart-1)]",assistant:"border-l-[color:var(--chart-2)]","file-history-snapshot":"border-l-[color:var(--chart-3)]",progress:"border-l-[color:var(--chart-5)]",system:"border-l-[color:var(--chart-4)]","queue-operation":"border-l-primary"},U=(0,y.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),q=(0,y.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var P=e.i(66794);function W({type:e}){let s="w-4 h-4";switch(e){case"user":return(0,t.jsx)(v,{className:s});case"assistant":return(0,t.jsx)(j,{className:s});case"file-history-snapshot":return(0,t.jsx)(U,{className:s});case"progress":return(0,t.jsx)(q,{className:s});case"system":return(0,t.jsx)(P.Settings,{className:s});case"queue-operation":return(0,t.jsx)(E,{className:s})}}function H({type:e}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-mono rounded border ${D[e]}`,children:[(0,t.jsx)(W,{type:e}),$[e]]})}var L=e.i(24380);function _({block:e}){let r=(0,s.useMemo)(()=>JSON.stringify(e.input,null,2),[e]);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Input",(0,t.jsx)(L.CopyButton,{text:r})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:r})]}),e.result?(0,t.jsxs)("div",{className:"border-l-2 border-primary/50 pl-3 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-mono rounded border bg-primary/20 text-primary border-primary/30",children:"Result"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:A(new Date(e.result.timestamp).getTime())})]}),e.result.content&&(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Output",(0,t.jsx)(L.CopyButton,{text:e.result.content})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:e.result.content})]}),e.result.images?.map((e,s)=>(0,t.jsx)("img",{src:`data:${e.mediaType};base64,${e.base64}`,alt:`Tool result image ${s+1}`,className:"mt-2 max-w-full rounded border border-border"},s))]}):(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Tool did not return a result"})]})}let B=(0,y.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),V=s.default.memo(function({block:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o}){switch(e.type){case"text":return(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.text});case"tool_use":if("Task"===e.name&&(e.subagentType||e.subagentId)){let a=e.subagentId&&s?s.get(`agent-${e.subagentId}`):void 0;return(0,t.jsx)(Z,{block:e,subagentEntries:a,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o})}return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(b,{className:"w-4 h-4 text-primary flex-shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-sm text-primary truncate min-w-0",children:e.name}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:e.result.durationFormatted})]}),(0,t.jsx)(_,{block:e})]});case"thinking":return(0,t.jsx)("div",{className:"border border-[color:var(--chart-5)]/30 rounded-lg p-3 bg-[color:var(--chart-5)]/5",children:(0,t.jsxs)("details",{children:[(0,t.jsxs)("summary",{className:"flex items-center gap-2 text-xs cursor-pointer hover:text-foreground transition-colors text-[color:var(--chart-5)]",children:[(0,t.jsx)(B,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Thinking"}),(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",e.thinking.length.toLocaleString()," chars)"]})]}),(0,t.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-muted-foreground p-2 bg-muted/30 rounded max-h-64 overflow-y-auto",children:e.thinking})]})})}});function K({entry:e}){return(0,t.jsx)("div",{children:e.message.content&&(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.message.content})})}let J=s.default.memo(function({entry:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o}){let{content:a}=e.message;return(0,t.jsx)("div",{className:"space-y-3",children:a.map((e,a)=>(0,t.jsx)(V,{block:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o},a))})}),Y=s.default.memo(function({entry:e}){let r=(0,s.useMemo)(()=>{if("progress"===e.type){let t=e.raw.data,s=t?.agentId;return[t?.type,s&&`agent:${s}`].filter(Boolean).join(" | ")}return"file-history-snapshot"===e.type?"File history snapshot":e.type},[e.type,e.raw]);return(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r}),(0,t.jsxs)("details",{className:"mt-1",children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"Show raw JSON"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:T(e)})]})]})}),X=(0,y.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var Q=e.i(55574);function G({uuid:e}){let r=(0,s.useCallback)(async()=>{window.history.replaceState(null,"",`#entry-${e}`);try{await navigator.clipboard.writeText(window.location.href)}catch{let e=document.createElement("textarea");e.value=window.location.href,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}(0,Q.toast)("Link copied")},[e]);return(0,t.jsx)("button",{onClick:r,title:"Copy link to entry",className:"inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(X,{className:"w-3.5 h-3.5"})})}function Z({block:e,subagentEntries:r,projectName:n,sessionId:i,highlightedUuid:o,autoExpandForUuid:a}){let l=!!(a&&r?.some(e=>e.uuid===a)),[d,c]=(0,s.useState)(l);(0,s.useEffect)(()=>{if(!l)return;let e=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(e)},[l]);let u=(0,s.useCallback)(()=>{c(e=>!e)},[]),h=r&&r.length>0;return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(M,{className:"w-4 h-4 text-[color:var(--chart-5)]"}),(0,t.jsx)("span",{className:"font-mono text-sm text-[color:var(--chart-5)]",children:"Subagent"}),e.subagentType&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-mono rounded border bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",children:e.subagentType}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:e.result.durationFormatted})]}),e.subagentDescription&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.subagentDescription}),e.subagentId&&r&&(0,t.jsxs)("button",{onClick:u,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors mb-2",children:[(0,t.jsx)(I.ChevronRight,{className:(0,F.cn)("w-3 h-3 transition-transform",d&&"rotate-90")}),(0,t.jsxs)("span",{children:["agent-",e.subagentId]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:d?"Collapse":"View subagent log"})]}),d&&(0,t.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-primary/30 mt-2 space-y-2",children:[r&&0===r.length&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:"No entries found in subagent log."}),h&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(C,{entries:r,compact:!0})}),r&&r.map(e=>"queue-operation"===e.type?(0,t.jsx)(z,{entry:e},e.uuid||e.timestamp):(0,t.jsx)(et,{entry:e,projectName:n,sessionId:i,isHighlighted:!!o&&e.uuid===o},e.uuid||e.timestamp))]}),(0,t.jsx)(_,{block:e})]})}function ee({entry:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o}){switch(e.type){case"user":return(0,t.jsx)(K,{entry:e});case"assistant":return(0,t.jsx)(J,{entry:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o});case"file-history-snapshot":case"progress":case"system":return(0,t.jsx)(Y,{entry:e})}}let et=s.default.memo(function({entry:e,entriesBySource:s,projectName:r,sessionId:n,isHighlighted:i,highlightedUuid:o,autoExpandForUuid:a}){return(0,t.jsxs)("div",{id:e.uuid?`entry-${e.uuid}`:void 0,className:(0,F.cn)(`group border-l-4 ${R[e.type]} bg-card/50 rounded-r-lg mb-2 hover:bg-muted/30 transition-colors`,i&&"entry-highlighted"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30",children:[(0,t.jsx)(H,{type:e.type}),(0,t.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[e.uuid&&(0,t.jsx)(G,{uuid:e.uuid}),(0,t.jsx)(L.CopyButton,{text:function(e){switch(e.type){case"user":return e.message.content;case"assistant":return e.message.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n");case"file-history-snapshot":case"progress":case"system":return T(e);case"queue-operation":return e.label}}(e)}),(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground whitespace-nowrap",children:A(e.timestampMs)})]})]}),(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsx)(ee,{entry:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:o,autoExpandForUuid:a})})]})},(e,t)=>e.entry===t.entry&&e.entriesBySource===t.entriesBySource&&e.projectName===t.projectName&&e.sessionId===t.sessionId&&e.isHighlighted===t.isHighlighted&&e.highlightedUuid===t.highlightedUuid&&e.autoExpandForUuid===t.autoExpandForUuid);var es=e.i(62301),er=e.i(84026),en=e.i(29407),ei=e.i(16306),eo=e.i(82954),ea=e.i(73520),el=e.i(85881);function ed({decision:e}){return"deny"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,t.jsx)(en.ShieldX,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,t.jsx)(ei.ShieldAlert,{className:"h-3 w-3"}),"Instruct"]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,t.jsx)(er.ShieldCheck,{className:"h-3 w-3"}),"Allow"]})}function ec({eventType:e}){return(0,t.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:e})}function eu({mode:e}){let s="default"===e;return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${s?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function eh({ms:e}){return(0,t.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function em({value:e,onChange:s}){return(0,t.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(r=>(0,t.jsx)("button",{onClick:()=>s(r.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===r.value?"deny"===r.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===r.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===r.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.label},r.value))})}function ep({item:e}){return(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:9,className:"px-0 py-0",children:(0,t.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-expand",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,t.jsx)(L.CopyButton,{text:e.sessionId})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,t.jsx)(L.CopyButton,{text:e.cwd})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,t.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"})]})]}),e.policyNames&&e.policyNames.length>1&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.policyNames.join(", ")})]}),e.reason&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,t.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function ex({sessionId:e,initialData:r}){let{intervalSec:n}=(0,el.useAutoRefresh)(),[i,o]=(0,s.useState)(!1),[a,l]=(0,s.useState)(1),[d,c]=(0,s.useState)(r),[u,h]=(0,s.useState)(null),[m,p]=(0,s.useState)(""),[x,g]=(0,s.useState)(""),[y,b]=(0,s.useState)(""),v=(0,s.useRef)(null),j=(0,s.useRef)({filterDecision:m,filterEventType:x,filterPolicy:y});j.current={filterDecision:m,filterEventType:x,filterPolicy:y};let w=""!==m||""!==x||""!==y,N=(0,s.useCallback)(async t=>{try{let{filterDecision:s,filterEventType:r,filterPolicy:n}=j.current,i=await (0,es.searchHookActivityAction)({sessionId:e,decision:s||void 0,eventType:r||void 0,policyName:n||void 0},t);c(i)}catch{}},[e]);(0,s.useEffect)(()=>{N(a);let e=setInterval(()=>N(a),n>0?1e3*n:5e3);return()=>clearInterval(e)},[a,N,n]),(0,s.useEffect)(()=>(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{l(1),h(null),N(1)},300),()=>{v.current&&clearTimeout(v.current)}),[m,x,y]);let S=d.entries,M=d.totalPages;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>o(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(f.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${i?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Hook Logs"})]}),!i&&(0,t.jsxs)("div",{className:"mt-2 bg-card border border-border rounded-lg overflow-hidden shadow-sm",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,t.jsx)(em,{value:m,onChange:p}),(0,t.jsxs)("select",{value:x,onChange:e=>g(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,t.jsx)("option",{value:"",children:"All Events"}),(0,t.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,t.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,t.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,t.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,t.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,t.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",value:y,onChange:e=>b(e.target.value),placeholder:"Filter by policy…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===S.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[(0,t.jsx)(eo.Shield,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-3",children:w?"No matching hook events.":"No hook events found."})]}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/30",children:S.map((e,r)=>{let n="deny"===e.decision,i=u===r,o="instruct"===e.decision;return(0,t.jsxs)(s.default.Fragment,{children:[(0,t.jsxs)("tr",{onClick:()=>{h(e=>e===r?null:r)},className:`cursor-pointer transition-colors ${n?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":o?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":r%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${i?"bg-muted/20":""}`,children:[(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsx)(f.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${i?"rotate-0":"-rotate-90"}`})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(ed,{decision:e.decision})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(ec,{eventType:e.eventType})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyNames&&e.policyNames.length>1?(0,t.jsxs)("span",{title:e.policyNames.join(", "),children:[e.policyNames[0],(0,t.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",e.policyNames.length-1]})]}):e.policyName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(eh,{ms:e.durationMs})}),(0,t.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,t.jsx)(eu,{mode:e.permissionMode}):"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,k.formatRelativeTime)(e.timestamp)})]}),i&&(0,t.jsx)(ep,{item:e})]},`${e.timestamp}-${r}`)})})]})}),(0,t.jsx)(ea.default,{currentPage:a,totalPages:M,onPageChange:e=>{l(e),h(null)}})]})]})}function eg(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content){if("tool_use"!==e.type||"Task"===e.name&&(e.subagentType||e.subagentId))continue;let s=t.get(e.name)||{count:0,totalDurationMs:0};s.count++,e.result?.durationMs&&(s.totalDurationMs+=e.result.durationMs),t.set(e.name,s)}return Array.from(t.entries()).map(([e,t])=>({name:e,...t})).sort((e,t)=>t.count-e.count)}function ef({tools:e,compact:s}){return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${s?"p-3":"p-4"}`,children:(0,t.jsx)("div",{className:`grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] ${s?"gap-2":"gap-3"}`,children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(b,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:`${s?"text-xs":"text-sm"} font-mono font-medium truncate`,children:e.name}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[e.count," call",1!==e.count?"s":"",e.totalDurationMs>0&&` \xb7 ${(e.totalDurationMs/1e3).toFixed(1)}s`]})]})]},e.name))})})}function ey(e){return`${e.uuid}-${e.timestampMs}`}function eb(){let e=window.location.hash;return e.startsWith("#entry-")?e.slice(7):null}function ev({entries:e,entriesBySource:n,projectName:i,sessionId:o}){let a=(0,s.useMemo)(()=>Array.from(n.values()).flat(),[n]),[l,c]=(0,s.useState)(new Set),[h,x]=(0,s.useState)(0),[f,y]=(0,s.useState)(()=>eb()),b=(0,s.useRef)(void 0),v=(0,s.useRef)(!1),j=(0,s.useCallback)(e=>{e&&x(e.offsetTop)},[]),w=(0,s.useMemo)(()=>(function(e){let t=new Map,s=null,r=0;for(let n of e)"queue-operation"===n.type?(null!==s&&t.set(s,r),s=ey(n),r=0):null!==s&&r++;return null!==s&&t.set(s,r),t})(e),[e]),N=(0,s.useMemo)(()=>{let t;return t=!1,e.filter(e=>"queue-operation"===e.type?(t=l.has(ey(e)),!0):!t)},[e,l]),S=(0,s.useMemo)(()=>{let e=new Map;return N.forEach((t,s)=>{t.uuid&&e.set(t.uuid,s)}),e},[N]),M=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type&&s.uuid)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&t.set(e.subagentId,s.uuid);let s=new Map;for(let r of e){if(!r._source?.startsWith("agent-")||!r.uuid)continue;let e=r._source.slice(6),n=t.get(e);n&&s.set(r.uuid,n)}return s})(a),[a]),k=(0,s.useMemo)(()=>f&&M.has(f)?f:null,[f,M]),C=k?M.get(k)??null:null;(0,s.useEffect)(()=>{if(f)return b.current=setTimeout(()=>y(null),4e3),()=>{b.current&&clearTimeout(b.current)}},[]),(0,s.useEffect)(()=>{let e=()=>{let e=eb();y(e),v.current=!1,b.current&&clearTimeout(b.current),e&&(b.current=setTimeout(()=>y(null),4e3))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let E=(0,s.useMemo)(()=>{if(!f)return null;let t=C??f,s=e.some(e=>e.uuid===t),r=S.has(t);if(s&&!r){let s=null;for(let r of e)if("queue-operation"===r.type)s=ey(r);else if(r.uuid===t&&s)return s}return null},[f,C,e,S]);(0,s.useEffect)(()=>{if(!E)return;let e=requestAnimationFrame(()=>{c(e=>{if(!e.has(E))return e;let t=new Set(e);return t.delete(E),t})});return()=>cancelAnimationFrame(e)},[E]);let I=(0,s.useCallback)(e=>{c(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),T=function({useFlushSync:e=!0,...t}){let n=s.useReducer(()=>({}),{})[1],i={...t,onChange:(s,i)=>{var o;e&&i?(0,r.flushSync)(n):n(),null==(o=t.onChange)||o.call(t,s,i)}},[o]=s.useState(()=>new p(i));return o.setOptions(i),g(()=>o._didMount(),[]),g(()=>o._willUpdate()),o}({getScrollElement:()=>"u">typeof document?window:null,observeElementRect:d,observeElementOffset:u,scrollToFn:m,initialOffset:()=>"u">typeof document?window.scrollY:0,...{count:N.length,estimateSize:e=>(function(e){switch(e.type){case"queue-operation":return 48;case"user":return 90;case"assistant":return 80+120*e.message.content.length;default:return 100}})(N[e]),overscan:5,scrollMargin:h}});return(0,s.useEffect)(()=>{if(!f||v.current)return;let e=C??f,t=S.get(e);null!=t&&(v.current=!0,requestAnimationFrame(()=>{T.scrollToIndex(t,{align:"center"})}))},[f,C,S,T]),(0,t.jsx)("div",{ref:j,children:(0,t.jsx)("div",{style:{height:`${T.getTotalSize()}px`,width:"100%",position:"relative"},children:T.getVirtualItems().map(e=>{let s=N[e.index],r=!!f&&s.uuid===(C??f);return(0,t.jsx)("div",{"data-index":e.index,ref:T.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start-T.options.scrollMargin}px)`},children:"queue-operation"===s.type?(0,t.jsx)(z,{entry:s,isCollapsed:l.has(ey(s)),entryCount:w.get(ey(s))??0,onToggle:()=>I(ey(s))}):(0,t.jsx)(et,{entry:s,entriesBySource:n,projectName:i,sessionId:o,isHighlighted:!k&&r,highlightedUuid:k,autoExpandForUuid:k})},"queue-operation"===s.type?ey(s):s.uuid||s.timestamp)})})})}let ej=[];e.s([],76248),e.i(76248),e.s(["default",0,function({entries:e,projectName:r,sessionId:n}){let i=(0,s.useMemo)(()=>{let t=new Map;for(let s of e){let e=t.get(s._source);e?e.push(s):t.set(s._source,[s])}return t},[e]),o=i.get("session")??ej,a=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&(t.has(e.subagentId)||t.set(e.subagentId,{id:e.subagentId,type:e.subagentType||"unknown",description:e.subagentDescription||""}));return Array.from(t.values())})(e),[e]),l=(0,s.useMemo)(()=>eg(o),[o]),[d,c]=(0,s.useState)(!1),[u,h]=(0,s.useState)(new Set),[m,p]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null);(0,s.useEffect)(()=>{(0,es.searchHookActivityAction)({sessionId:n},1).then(e=>{e.entries.length>0&&g(e)}).catch(()=>{})},[n]),(0,s.useEffect)(()=>{let e=()=>{window.location.hash.startsWith("#entry-")&&p(!1)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let y=(0,s.useCallback)(e=>{h(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(C,{entries:o}),x&&(0,t.jsx)(ex,{sessionId:n,initialData:x},n),a.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>c(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(f.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${d?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Subagents"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",a.length,")"]})]}),!d&&a.map(e=>{let s;return(0,t.jsxs)("div",{className:"pl-3 border-l-2 border-primary/30 space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>y(e.id),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(f.ChevronDown,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${u.has(e.id)?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-bold",children:e.type}),e.description&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[400px]",children:e.description})]}),!u.has(e.id)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(C,{entries:i.get(`agent-${e.id}`)||[],compact:!0}),(s=eg(i.get(`agent-${e.id}`)||[])).length>0?(0,t.jsx)(ef,{tools:s,compact:!0}):null]})]},e.id)})]}),l.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Tools"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",l.reduce((e,t)=>e+t.count,0),")"]})]}),(0,t.jsx)(ef,{tools:l})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>p(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(f.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${m?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Logs"})]}),!m&&(0,t.jsx)("div",{className:"mt-2 bg-card border border-border rounded-lg p-4 shadow-sm",children:0===o.length?(0,t.jsx)("p",{className:"text-muted-foreground text-center py-8",children:"No entries found."}):(0,t.jsx)(ev,{entries:o,entriesBySource:i,projectName:r,sessionId:n})})]})]})}],36406)},5780,e=>{e.n(e.i(36406))}]);
4
+ color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==s?void 0:s.key)}return(null==s?void 0:s.onChange)&&!(i&&s.skipInitialOnChange)&&s.onChange(r),i=!1,r}return o.updateDeps=e=>{n=e},o}function i(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}e.i(47167);let o=e=>e,a=e=>{let t=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=s;e++)r.push(e);return r},l={passive:!0},d=(e,t)=>{let s=e.scrollElement;if(!s)return;let r=()=>{t({width:s.innerWidth,height:s.innerHeight})};return r(),s.addEventListener("resize",r,l),()=>{s.removeEventListener("resize",r)}},c="u"<typeof window||"onscrollend"in window,u=(e,t)=>{var s,r;let n,i=e.scrollElement;if(!i)return;let o=e.targetWindow;if(!o)return;let a=0,d=e.options.useScrollendEvent&&c?()=>void 0:(s=()=>{t(a,!1)},r=e.options.isScrollingResetDelay,function(...e){o.clearTimeout(n),n=o.setTimeout(()=>s.apply(this,e),r)}),u=s=>()=>{a=i[e.options.horizontal?"scrollX":"scrollY"],d(),t(a,s)},h=u(!0),m=u(!1);i.addEventListener("scroll",h,l);let p=e.options.useScrollendEvent&&c;return p&&i.addEventListener("scrollend",m,l),()=>{i.removeEventListener("scroll",h),p&&i.removeEventListener("scrollend",m)}},h=(e,t,s)=>{if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[s.options.horizontal?"inlineSize":"blockSize"])}return e[s.options.horizontal?"offsetWidth":"offsetHeight"]},m=(e,{adjustments:t=0,behavior:s},r)=>{var n,i;null==(i=null==(n=r.scrollElement)?void 0:n.scrollTo)||i.call(n,{[r.options.horizontal?"left":"top"]:e+t,behavior:s})};class p{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e,t,s;return(null==(s=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:s.call(t))??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,s=this.indexFromElement(t);t.isConnected?this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,e,this)):this.observer.unobserve(t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var s;null==(s=t())||s.disconnect(),e=null},observe:e=>{var s;return null==(s=t())?void 0:s.observe(e,{box:"border-box"})},unobserve:e=>{var s;return null==(s=t())?void 0:s.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,s])=>{void 0===s&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:o,rangeExtractor:a,onChange:()=>{},measureElement:h,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...e}},this.notify=e=>{var t,s;null==(s=(t=this.options).onChange)||s.call(t,this,e)},this.maybeNotify=n(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;let t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let s=new Map,r=new Map;for(let n=t-1;n>=0;n--){let t=e[n];if(s.has(t.lane))continue;let i=r.get(t.lane);if(null==i||t.end>i.end?r.set(t.lane,t):t.end<i.end&&s.set(t.lane,!0),s.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=n(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,s,r,n,i,o)=>(void 0!==this.prevLanes&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:n,lanes:i,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=n(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:s,getItemKey:r,enabled:n,lanes:i,laneAssignmentMode:o},a)=>{if(!n)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let d=this.measurementsCache.slice(0,l),c=Array(i).fill(void 0);for(let e=0;e<l;e++){let t=d[e];t&&(c[t.lane]=e)}for(let n=l;n<e;n++){let e,i,l=r(n),u=this.laneAssignments.get(n),h="estimate"===o||a.has(l);if(void 0!==u&&this.options.lanes>1){let r=c[e=u],n=void 0!==r?d[r]:void 0;i=n?n.end+this.options.gap:t+s}else{let r=1===this.options.lanes?d[n-1]:this.getFurthestMeasurement(d,n);i=r?r.end+this.options.gap:t+s,e=r?r.lane:n%this.options.lanes,this.options.lanes>1&&h&&this.laneAssignments.set(n,e)}let m=a.get(l),p="number"==typeof m?m:this.options.estimateSize(n),x=i+p;d[n]={index:n,start:i,size:p,end:x,key:l,lane:e},c[e]=n}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=n(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,s,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:s,lanes:r}){let n=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:n};let i=x(0,n,t=>e[t].start,s),o=i;if(1===r)for(;o<n&&e[o].end<s+t;)o++;else if(r>1){let a=Array(r).fill(0);for(;o<n&&a.some(e=>e<s+t);){let t=e[o];a[t.lane]=t.end,o++}let l=Array(r).fill(s+t);for(;i>=0&&l.some(e=>e>=s);){let t=e[i];l[t.lane]=t.start,i--}i=Math.max(0,i-i%r),o=Math.min(n,o+(r-1-o%r))}return{startIndex:i,endIndex:o}}({measurements:e,outerSize:t,scrollOffset:s,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=n(()=>{let e=null,t=null,s=this.calculateRange();return s&&(e=s.startIndex,t=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,s,r,n)=>null===r||null===n?[]:e({startIndex:r,endIndex:n,overscan:t,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,s=e.getAttribute(t);return s?parseInt(s,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;let s=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==s&&this.range){let t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,s-t),n=Math.min(this.options.count-1,s+t);return e>=r&&e<=n}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});let t=this.indexFromElement(e),s=this.options.getItemKey(t),r=this.elementsCache.get(s);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(s,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var s;let r=this.measurementsCache[e];if(!r)return;let n=t-(this.itemSizeCache.get(r.key)??r.size);0!==n&&((null==(s=this.scrollState)?void 0:s.behavior)!=="smooth"&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,n,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,t)),this.notify(!1))},this.getVirtualItems=n(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let s=[];for(let r=0,n=e.length;r<n;r++){let n=t[e[r]];s.push(n)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(0!==t.length)return i(t[x(0,t.length-1,e=>i(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,s=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),n=this.getScrollOffset();return"auto"===t&&(t=e>=n+r?"end":"start"),"center"===t?e+=(s-r)/2:"end"===t&&(e-=r),Math.max(Math.min(this.getMaxScrollOffset(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let s=this.getSize(),r=this.getScrollOffset(),n=this.measurementsCache[e];if(!n)return;if("auto"===t)if(n.end>=r+s-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=r+this.options.scrollPaddingStart))return[r,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let i="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,t,n.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:s="auto"}={})=>{let r=this.getOffsetForAlignment(e,t),n=this.now();this.scrollState={index:null,align:t,behavior:s,startedAt:n,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t="auto",behavior:s="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[n,i]=r,o=this.now();this.scrollState={index:e,align:i,behavior:s,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t="auto"}={})=>{let s=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:"start",behavior:t,startedAt:r,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var e;let t,s=this.getMeasurements();if(0===s.length)t=this.options.paddingStart;else if(1===this.options.lanes)t=(null==(e=s[s.length-1])?void 0:e.end)??0;else{let e=Array(this.options.lanes).fill(null),r=s.length-1;for(;r>=0&&e.some(e=>null===e);){let t=s[r];null===e[t.lane]&&(e[t.lane]=t.end),r--}t=Math.max(...e.filter(e=>null!==e))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,s=t!==this.scrollState.lastTargetOffset;if(!s&&1.01>Math.abs(t-this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,s&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior="auto",this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}let x=(e,t,s,r)=>{for(;e<=t;){let n=(e+t)/2|0,i=s(n);if(i<r)e=n+1;else{if(!(i>r))return n;t=n-1}}return e>0?e-1:0},g="u">typeof document?s.useLayoutEffect:s.useEffect;var f=e.i(16327),y=e.i(56420);let b=(0,y.default)("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),v=(0,y.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),j=(0,y.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),w=(0,y.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),N=(0,y.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var S=e.i(68590);let M=(0,y.default)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);var k=e.i(34713);let C=s.default.memo(function({entries:e,compact:r=!1}){let n=(0,s.useMemo)(()=>(function(e){let t=0,s=0,r=0,n=0,i=0,o=new Set;for(let a of e)if("user"===a.type&&t++,"queue-operation"===a.type&&i++,"assistant"===a.type){for(let e of(s++,a.message.content))"tool_use"===e.type&&("Task"===e.name&&(e.subagentType||e.subagentId)?n++:r++);a.message.model&&o.add(a.message.model)}let a="";if(e.length>=2){let t=e[e.length-1].timestampMs-e[0].timestampMs;a=(0,k.formatDuration)(t)}return{turnCount:i,userCount:t,assistantCount:s,toolCallCount:r,subagentCount:n,duration:a,models:Array.from(o)}})(e),[e]),i=r?"w-3.5 h-3.5":"w-4 h-4",o=r?"text-xs font-medium":"text-sm font-medium",a=r?"text-[10px] text-muted-foreground":"text-xs text-muted-foreground",l=[...r?[]:[{Icon:S.MessageSquare,color:"text-primary",v:n.turnCount,l:"Turns"}],{Icon:v,color:"text-[color:var(--chart-1)]",v:n.userCount,l:"User"},{Icon:j,color:"text-[color:var(--chart-2)]",v:n.assistantCount,l:"Assistant"},{Icon:b,color:"text-[color:var(--chart-3)]",v:n.toolCallCount,l:r?"Tools":"Tool Calls"},{Icon:M,color:"text-[color:var(--chart-5)]",v:n.subagentCount,l:"Subagents"},{Icon:N,color:"text-[color:var(--chart-4)]",v:n.duration||"—",l:"Duration"},{Icon:w,color:"text-[color:var(--chart-5)]",v:n.models.length>0?n.models.join(", "):"—",l:r?"Model":"Model(s)"}];return(0,t.jsx)("div",{className:r?"bg-muted/30 border border-border/50 rounded-lg p-3 mb-3":"bg-card border border-border rounded-lg p-4",children:(0,t.jsx)("div",{className:`grid grid-cols-2 ${r?"sm:grid-cols-6 gap-3":"sm:grid-cols-4 lg:grid-cols-7 gap-4"}`,children:l.map(({Icon:e,color:s,v:r,l:n})=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:`${i} ${s}`}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:`${o} truncate max-w-[120px]`,children:r}),(0,t.jsx)("div",{className:a,children:n})]})]},n))})})}),E=(0,y.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var I=e.i(67927);function T(e){return JSON.stringify(e.raw,null,2)}let O=new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});function A(e){let t=new Date(e),s=O.format(t),r=t.getMilliseconds().toString().padStart(3,"0");return`${s}.${r}`}let z=s.default.memo(function({entry:e,isCollapsed:s,entryCount:r,onToggle:n}){let i="function"==typeof n,o=(0,t.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-medium${i?" group-hover:bg-primary/20 transition-colors":""}`,children:[i?(0,t.jsx)(I.ChevronRight,{className:`w-3 h-3 transition-transform ${s?"":"rotate-90"}`}):(0,t.jsx)(E,{className:"w-3 h-3"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"text-muted-foreground",children:A(e.timestampMs)}),i&&s&&"number"==typeof r&&(0,t.jsxs)("span",{className:"ml-1 px-1.5 py-0.5 rounded bg-primary/20 text-[10px] leading-none",children:[r," ",1===r?"entry":"entries"]})]});return i?(0,t.jsxs)("button",{type:"button",onClick:n,className:"group flex items-center gap-3 py-3 px-4 w-full cursor-pointer",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),o,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]}):(0,t.jsxs)("div",{className:"flex items-center gap-3 py-3 px-4",children:[(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"}),o,(0,t.jsx)("div",{className:"flex-1 h-px bg-primary/30"})]})});var F=e.i(47163);let $={user:"User",assistant:"Assistant","file-history-snapshot":"Snapshot",progress:"Progress",system:"System","queue-operation":"Queue"},D={user:"bg-[color:var(--chart-1)]/20 text-[color:var(--chart-1)] border-[color:var(--chart-1)]/30",assistant:"bg-[color:var(--chart-2)]/20 text-[color:var(--chart-2)] border-[color:var(--chart-2)]/30","file-history-snapshot":"bg-[color:var(--chart-3)]/20 text-[color:var(--chart-3)] border-[color:var(--chart-3)]/30",progress:"bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",system:"bg-[color:var(--chart-4)]/20 text-[color:var(--chart-4)] border-[color:var(--chart-4)]/30","queue-operation":"bg-primary/20 text-primary border-primary/30"},R={user:"border-l-[color:var(--chart-1)]",assistant:"border-l-[color:var(--chart-2)]","file-history-snapshot":"border-l-[color:var(--chart-3)]",progress:"border-l-[color:var(--chart-5)]",system:"border-l-[color:var(--chart-4)]","queue-operation":"border-l-primary"},U=(0,y.default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),q=(0,y.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var P=e.i(66794);function W({type:e}){let s="w-4 h-4";switch(e){case"user":return(0,t.jsx)(v,{className:s});case"assistant":return(0,t.jsx)(j,{className:s});case"file-history-snapshot":return(0,t.jsx)(U,{className:s});case"progress":return(0,t.jsx)(q,{className:s});case"system":return(0,t.jsx)(P.Settings,{className:s});case"queue-operation":return(0,t.jsx)(E,{className:s})}}function H({type:e}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1.5 px-2 py-0.5 text-xs font-mono rounded border ${D[e]}`,children:[(0,t.jsx)(W,{type:e}),$[e]]})}var L=e.i(24380);function _({block:e}){let r=(0,s.useMemo)(()=>JSON.stringify(e.input,null,2),[e]);return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Input",(0,t.jsx)(L.CopyButton,{text:r})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:r})]}),e.result?(0,t.jsxs)("div",{className:"border-l-2 border-primary/50 pl-3 space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-mono rounded border bg-primary/20 text-primary border-primary/30",children:"Result"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:A(new Date(e.result.timestamp).getTime())})]}),e.result.content&&(0,t.jsxs)("details",{open:!0,children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:["Output",(0,t.jsx)(L.CopyButton,{text:e.result.content})]})}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-48 overflow-y-auto",children:e.result.content})]}),e.result.images?.map((e,s)=>(0,t.jsx)("img",{src:`data:${e.mediaType};base64,${e.base64}`,alt:`Tool result image ${s+1}`,className:"mt-2 max-w-full rounded border border-border"},s))]}):(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:"Tool did not return a result"})]})}let B=(0,y.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),V=s.default.memo(function({block:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o}){switch(e.type){case"text":return(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.text});case"tool_use":if("Task"===e.name&&(e.subagentType||e.subagentId)){let a=e.subagentId&&s?s.get(`agent-${e.subagentId}`):void 0;return(0,t.jsx)(Z,{block:e,subagentEntries:a,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o})}return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(b,{className:"w-4 h-4 text-primary flex-shrink-0"}),(0,t.jsx)("span",{className:"font-mono text-sm text-primary truncate min-w-0",children:e.name}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto flex-shrink-0",children:e.result.durationFormatted})]}),(0,t.jsx)(_,{block:e})]});case"thinking":return(0,t.jsx)("div",{className:"border border-[color:var(--chart-5)]/30 rounded-lg p-3 bg-[color:var(--chart-5)]/5",children:(0,t.jsxs)("details",{children:[(0,t.jsxs)("summary",{className:"flex items-center gap-2 text-xs cursor-pointer hover:text-foreground transition-colors text-[color:var(--chart-5)]",children:[(0,t.jsx)(B,{className:"w-4 h-4"}),(0,t.jsx)("span",{children:"Thinking"}),(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",e.thinking.length.toLocaleString()," chars)"]})]}),(0,t.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-xs text-muted-foreground p-2 bg-muted/30 rounded max-h-64 overflow-y-auto",children:e.thinking})]})})}});function K({entry:e}){return(0,t.jsx)("div",{children:e.message.content&&(0,t.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:e.message.content})})}let J=s.default.memo(function({entry:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o}){let{content:a}=e.message;return(0,t.jsx)("div",{className:"space-y-3",children:a.map((e,a)=>(0,t.jsx)(V,{block:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o},a))})}),Y=s.default.memo(function({entry:e}){let r=(0,s.useMemo)(()=>{if("progress"===e.type){let t=e.raw.data,s=t?.agentId;return[t?.type,s&&`agent:${s}`].filter(Boolean).join(" | ")}return"file-history-snapshot"===e.type?"File history snapshot":e.type},[e.type,e.raw]);return(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:r}),(0,t.jsxs)("details",{className:"mt-1",children:[(0,t.jsx)("summary",{className:"text-xs text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:"Show raw JSON"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:T(e)})]})]})}),X=(0,y.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var Q=e.i(55574);function G({uuid:e}){let r=(0,s.useCallback)(async()=>{window.history.replaceState(null,"",`#entry-${e}`);try{await navigator.clipboard.writeText(window.location.href)}catch{let e=document.createElement("textarea");e.value=window.location.href,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}(0,Q.toast)("Link copied")},[e]);return(0,t.jsx)("button",{onClick:r,title:"Copy link to entry",className:"inline-flex items-center justify-center rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)(X,{className:"w-3.5 h-3.5"})})}function Z({block:e,subagentEntries:r,projectName:n,sessionId:i,highlightedUuid:o,autoExpandForUuid:a}){let l=!!(a&&r?.some(e=>e.uuid===a)),[d,c]=(0,s.useState)(l);(0,s.useEffect)(()=>{if(!l)return;let e=requestAnimationFrame(()=>c(!0));return()=>cancelAnimationFrame(e)},[l]);let u=(0,s.useCallback)(()=>{c(e=>!e)},[]),h=r&&r.length>0;return(0,t.jsxs)("div",{className:"border border-border/50 rounded-lg p-3 bg-muted/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)(M,{className:"w-4 h-4 text-[color:var(--chart-5)]"}),(0,t.jsx)("span",{className:"font-mono text-sm text-[color:var(--chart-5)]",children:"Subagent"}),e.subagentType&&(0,t.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-mono rounded border bg-[color:var(--chart-5)]/20 text-[color:var(--chart-5)] border-[color:var(--chart-5)]/30",children:e.subagentType}),e.result&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-auto",children:e.result.durationFormatted})]}),e.subagentDescription&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.subagentDescription}),e.subagentId&&r&&(0,t.jsxs)("button",{onClick:u,className:"inline-flex items-center gap-1.5 px-2.5 py-1 text-xs font-medium rounded border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 transition-colors mb-2",children:[(0,t.jsx)(I.ChevronRight,{className:(0,F.cn)("w-3 h-3 transition-transform",d&&"rotate-90")}),(0,t.jsxs)("span",{children:["agent-",e.subagentId]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:d?"Collapse":"View subagent log"})]}),d&&(0,t.jsxs)("div",{className:"ml-4 pl-3 border-l-2 border-primary/30 mt-2 space-y-2",children:[r&&0===r.length&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:"No entries found in subagent log."}),h&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(C,{entries:r,compact:!0})}),r&&r.map(e=>"queue-operation"===e.type?(0,t.jsx)(z,{entry:e},e.uuid||e.timestamp):(0,t.jsx)(et,{entry:e,projectName:n,sessionId:i,isHighlighted:!!o&&e.uuid===o},e.uuid||e.timestamp))]}),(0,t.jsx)(_,{block:e})]})}function ee({entry:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o}){switch(e.type){case"user":return(0,t.jsx)(K,{entry:e});case"assistant":return(0,t.jsx)(J,{entry:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:i,autoExpandForUuid:o});case"file-history-snapshot":case"progress":case"system":return(0,t.jsx)(Y,{entry:e})}}let et=s.default.memo(function({entry:e,entriesBySource:s,projectName:r,sessionId:n,isHighlighted:i,highlightedUuid:o,autoExpandForUuid:a}){return(0,t.jsxs)("div",{id:e.uuid?`entry-${e.uuid}`:void 0,className:(0,F.cn)(`group border-l-4 ${R[e.type]} bg-card/50 rounded-r-lg mb-2 hover:bg-muted/30 transition-colors`,i&&"entry-highlighted"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/30",children:[(0,t.jsx)(H,{type:e.type}),(0,t.jsxs)("div",{className:"flex items-center gap-1 ml-auto",children:[e.uuid&&(0,t.jsx)(G,{uuid:e.uuid}),(0,t.jsx)(L.CopyButton,{text:function(e){switch(e.type){case"user":return e.message.content;case"assistant":return e.message.content.filter(e=>"text"===e.type).map(e=>e.text).join("\n");case"file-history-snapshot":case"progress":case"system":return T(e);case"queue-operation":return e.label}}(e)}),(0,t.jsx)("span",{className:"text-xs font-mono text-muted-foreground whitespace-nowrap",children:A(e.timestampMs)})]})]}),(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsx)(ee,{entry:e,entriesBySource:s,projectName:r,sessionId:n,highlightedUuid:o,autoExpandForUuid:a})})]})},(e,t)=>e.entry===t.entry&&e.entriesBySource===t.entriesBySource&&e.projectName===t.projectName&&e.sessionId===t.sessionId&&e.isHighlighted===t.isHighlighted&&e.highlightedUuid===t.highlightedUuid&&e.autoExpandForUuid===t.autoExpandForUuid);var es=e.i(81051),er=e.i(84026),en=e.i(29407),ei=e.i(16306),eo=e.i(82954),ea=e.i(73520),el=e.i(85881);function ed({decision:e}){return"deny"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-red-500/10 text-red-400 border border-red-500/20",children:[(0,t.jsx)(en.ShieldX,{className:"h-3 w-3"}),"Deny"]}):"instruct"===e?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-amber-500/10 text-amber-400 border border-amber-500/20",children:[(0,t.jsx)(ei.ShieldAlert,{className:"h-3 w-3"}),"Instruct"]}):(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[0.65rem] font-semibold tracking-wide uppercase bg-emerald-500/10 text-emerald-400 border border-emerald-500/20",children:[(0,t.jsx)(er.ShieldCheck,{className:"h-3 w-3"}),"Allow"]})}function ec({eventType:e}){return(0,t.jsx)("span",{className:"inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium bg-muted text-muted-foreground border border-border/50",children:e})}function eu({mode:e}){let s="default"===e;return(0,t.jsx)("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[0.6rem] font-medium border ${s?"bg-sky-500/10 text-sky-400 border-sky-500/20":"bg-amber-500/10 text-amber-400 border-amber-500/20"}`,children:e})}function eh({ms:e}){return(0,t.jsx)("span",{className:`font-mono text-[0.7rem] ${e>500?"text-red-400":e>100?"text-amber-400":"text-muted-foreground"}`,children:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`})}function em({value:e,onChange:s}){return(0,t.jsx)("div",{className:"inline-flex items-center rounded-md border border-border bg-muted/30 p-0.5",children:[{label:"All",value:""},{label:"Allow",value:"allow"},{label:"Instruct",value:"instruct"},{label:"Deny",value:"deny"}].map(r=>(0,t.jsx)("button",{onClick:()=>s(r.value),className:`px-2.5 py-1 text-[0.65rem] font-medium rounded transition-all ${e===r.value?"deny"===r.value?"bg-red-500/15 text-red-400 shadow-sm":"allow"===r.value?"bg-emerald-500/15 text-emerald-400 shadow-sm":"instruct"===r.value?"bg-amber-500/15 text-amber-400 shadow-sm":"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:r.label},r.value))})}function ep({item:e}){return(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:9,className:"px-0 py-0",children:(0,t.jsxs)("div",{className:"px-6 py-3 bg-muted/20 border-t border-border/30 space-y-2 text-xs animate-expand",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-1.5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Session ID: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.sessionId??"—"}),e.sessionId&&(0,t.jsx)(L.CopyButton,{text:e.sessionId})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"CWD: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.cwd??"—"}),e.cwd&&(0,t.jsx)(L.CopyButton,{text:e.cwd})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Transcript: "}),(0,t.jsx)("span",{className:"font-mono text-foreground break-all",children:e.transcriptPath??"—"})]})]}),e.policyNames&&e.policyNames.length>1&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Policies: "}),(0,t.jsx)("span",{className:"font-mono text-foreground",children:e.policyNames.join(", ")})]}),e.reason&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Full reason: "}),(0,t.jsx)("span",{className:"text-foreground",children:e.reason})]})]})})})}function ex({sessionId:e,initialData:r}){let{intervalSec:n}=(0,el.useAutoRefresh)(),[i,o]=(0,s.useState)(!1),[a,l]=(0,s.useState)(1),[d,c]=(0,s.useState)(r),[u,h]=(0,s.useState)(null),[m,p]=(0,s.useState)(""),[x,g]=(0,s.useState)(""),[y,b]=(0,s.useState)(""),v=(0,s.useRef)(null),j=(0,s.useRef)({filterDecision:m,filterEventType:x,filterPolicy:y});j.current={filterDecision:m,filterEventType:x,filterPolicy:y};let w=""!==m||""!==x||""!==y,N=(0,s.useCallback)(async t=>{try{let{filterDecision:s,filterEventType:r,filterPolicy:n}=j.current,i=await (0,es.searchHookActivityAction)({sessionId:e,decision:s||void 0,eventType:r||void 0,policyName:n||void 0},t);c(i)}catch{}},[e]);(0,s.useEffect)(()=>{N(a);let e=setInterval(()=>N(a),n>0?1e3*n:5e3);return()=>clearInterval(e)},[a,N,n]),(0,s.useEffect)(()=>(v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{l(1),h(null),N(1)},300),()=>{v.current&&clearTimeout(v.current)}),[m,x,y]);let S=d.entries,M=d.totalPages;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>o(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(f.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${i?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Hook Logs"})]}),!i&&(0,t.jsxs)("div",{className:"mt-2 bg-card border border-border rounded-lg overflow-hidden shadow-sm",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4 py-2.5 border-b border-border bg-muted/20",children:[(0,t.jsx)(em,{value:m,onChange:p}),(0,t.jsxs)("select",{value:x,onChange:e=>g(e.target.value),className:"h-7 rounded-md border border-border bg-background px-2 text-xs text-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow",children:[(0,t.jsx)("option",{value:"",children:"All Events"}),(0,t.jsx)("option",{value:"PreToolUse",children:"PreToolUse"}),(0,t.jsx)("option",{value:"PostToolUse",children:"PostToolUse"}),(0,t.jsx)("option",{value:"SessionStart",children:"SessionStart"}),(0,t.jsx)("option",{value:"SessionEnd",children:"SessionEnd"}),(0,t.jsx)("option",{value:"UserPromptSubmit",children:"UserPromptSubmit"}),(0,t.jsx)("option",{value:"PermissionRequest",children:"PermissionRequest"})]}),(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",value:y,onChange:e=>b(e.target.value),placeholder:"Filter by policy…",className:"h-7 rounded-md border border-border bg-background px-2.5 text-xs text-foreground placeholder:text-muted-foreground w-44 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary/40 transition-shadow"})})]}),0===S.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[(0,t.jsx)(eo.Shield,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-3",children:w?"No matching hook events.":"No hook events found."})]}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-xs",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"text-left text-muted-foreground border-b border-border bg-muted/30",children:[(0,t.jsx)("th",{className:"px-4 py-2.5 font-medium w-6"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Decision"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Event"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Tool"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Policy"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Reason"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Duration"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium",children:"Mode"}),(0,t.jsx)("th",{className:"px-3 py-2.5 font-medium text-right",children:"Time"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-border/30",children:S.map((e,r)=>{let n="deny"===e.decision,i=u===r,o="instruct"===e.decision;return(0,t.jsxs)(s.default.Fragment,{children:[(0,t.jsxs)("tr",{onClick:()=>{h(e=>e===r?null:r)},className:`cursor-pointer transition-colors ${n?"bg-red-500/[0.03] hover:bg-red-500/[0.07] border-l-2 border-l-red-500/40":o?"bg-amber-500/[0.03] hover:bg-amber-500/[0.07] border-l-2 border-l-amber-500/40":r%2==0?"hover:bg-muted/30":"bg-muted/[0.04] hover:bg-muted/30"} ${i?"bg-muted/20":""}`,children:[(0,t.jsx)("td",{className:"px-4 py-2",children:(0,t.jsx)(f.ChevronDown,{className:`h-3.5 w-3.5 text-muted-foreground transition-transform duration-150 ${i?"rotate-0":"-rotate-90"}`})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(ed,{decision:e.decision})}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(ec,{eventType:e.eventType})}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.toolName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 font-mono text-foreground",children:e.policyNames&&e.policyNames.length>1?(0,t.jsxs)("span",{title:e.policyNames.join(", "),children:[e.policyNames[0],(0,t.jsxs)("span",{className:"text-muted-foreground text-[0.6rem]",children:[" +",e.policyNames.length-1]})]}):e.policyName??"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-muted-foreground truncate max-w-[240px]",title:e.reason??"",children:e.reason??"—"}),(0,t.jsx)("td",{className:"px-3 py-2",children:(0,t.jsx)(eh,{ms:e.durationMs})}),(0,t.jsx)("td",{className:"px-3 py-2",children:e.permissionMode?(0,t.jsx)(eu,{mode:e.permissionMode}):"—"}),(0,t.jsx)("td",{className:"px-3 py-2 text-right text-muted-foreground whitespace-nowrap",title:new Date(e.timestamp).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),children:(0,k.formatRelativeTime)(e.timestamp)})]}),i&&(0,t.jsx)(ep,{item:e})]},`${e.timestamp}-${r}`)})})]})}),(0,t.jsx)(ea.default,{currentPage:a,totalPages:M,onPageChange:e=>{l(e),h(null)}})]})]})}function eg(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content){if("tool_use"!==e.type||"Task"===e.name&&(e.subagentType||e.subagentId))continue;let s=t.get(e.name)||{count:0,totalDurationMs:0};s.count++,e.result?.durationMs&&(s.totalDurationMs+=e.result.durationMs),t.set(e.name,s)}return Array.from(t.entries()).map(([e,t])=>({name:e,...t})).sort((e,t)=>t.count-e.count)}function ef({tools:e,compact:s}){return(0,t.jsx)("div",{className:`bg-card border border-border rounded-lg ${s?"p-3":"p-4"}`,children:(0,t.jsx)("div",{className:`grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] ${s?"gap-2":"gap-3"}`,children:e.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(b,{className:"w-3.5 h-3.5 text-muted-foreground flex-shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:`${s?"text-xs":"text-sm"} font-mono font-medium truncate`,children:e.name}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground truncate",children:[e.count," call",1!==e.count?"s":"",e.totalDurationMs>0&&` \xb7 ${(e.totalDurationMs/1e3).toFixed(1)}s`]})]})]},e.name))})})}function ey(e){return`${e.uuid}-${e.timestampMs}`}function eb(){let e=window.location.hash;return e.startsWith("#entry-")?e.slice(7):null}function ev({entries:e,entriesBySource:n,projectName:i,sessionId:o}){let a=(0,s.useMemo)(()=>Array.from(n.values()).flat(),[n]),[l,c]=(0,s.useState)(new Set),[h,x]=(0,s.useState)(0),[f,y]=(0,s.useState)(()=>eb()),b=(0,s.useRef)(void 0),v=(0,s.useRef)(!1),j=(0,s.useCallback)(e=>{e&&x(e.offsetTop)},[]),w=(0,s.useMemo)(()=>(function(e){let t=new Map,s=null,r=0;for(let n of e)"queue-operation"===n.type?(null!==s&&t.set(s,r),s=ey(n),r=0):null!==s&&r++;return null!==s&&t.set(s,r),t})(e),[e]),N=(0,s.useMemo)(()=>{let t;return t=!1,e.filter(e=>"queue-operation"===e.type?(t=l.has(ey(e)),!0):!t)},[e,l]),S=(0,s.useMemo)(()=>{let e=new Map;return N.forEach((t,s)=>{t.uuid&&e.set(t.uuid,s)}),e},[N]),M=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type&&s.uuid)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&t.set(e.subagentId,s.uuid);let s=new Map;for(let r of e){if(!r._source?.startsWith("agent-")||!r.uuid)continue;let e=r._source.slice(6),n=t.get(e);n&&s.set(r.uuid,n)}return s})(a),[a]),k=(0,s.useMemo)(()=>f&&M.has(f)?f:null,[f,M]),C=k?M.get(k)??null:null;(0,s.useEffect)(()=>{if(f)return b.current=setTimeout(()=>y(null),4e3),()=>{b.current&&clearTimeout(b.current)}},[]),(0,s.useEffect)(()=>{let e=()=>{let e=eb();y(e),v.current=!1,b.current&&clearTimeout(b.current),e&&(b.current=setTimeout(()=>y(null),4e3))};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let E=(0,s.useMemo)(()=>{if(!f)return null;let t=C??f,s=e.some(e=>e.uuid===t),r=S.has(t);if(s&&!r){let s=null;for(let r of e)if("queue-operation"===r.type)s=ey(r);else if(r.uuid===t&&s)return s}return null},[f,C,e,S]);(0,s.useEffect)(()=>{if(!E)return;let e=requestAnimationFrame(()=>{c(e=>{if(!e.has(E))return e;let t=new Set(e);return t.delete(E),t})});return()=>cancelAnimationFrame(e)},[E]);let I=(0,s.useCallback)(e=>{c(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),T=function({useFlushSync:e=!0,...t}){let n=s.useReducer(()=>({}),{})[1],i={...t,onChange:(s,i)=>{var o;e&&i?(0,r.flushSync)(n):n(),null==(o=t.onChange)||o.call(t,s,i)}},[o]=s.useState(()=>new p(i));return o.setOptions(i),g(()=>o._didMount(),[]),g(()=>o._willUpdate()),o}({getScrollElement:()=>"u">typeof document?window:null,observeElementRect:d,observeElementOffset:u,scrollToFn:m,initialOffset:()=>"u">typeof document?window.scrollY:0,...{count:N.length,estimateSize:e=>(function(e){switch(e.type){case"queue-operation":return 48;case"user":return 90;case"assistant":return 80+120*e.message.content.length;default:return 100}})(N[e]),overscan:5,scrollMargin:h}});return(0,s.useEffect)(()=>{if(!f||v.current)return;let e=C??f,t=S.get(e);null!=t&&(v.current=!0,requestAnimationFrame(()=>{T.scrollToIndex(t,{align:"center"})}))},[f,C,S,T]),(0,t.jsx)("div",{ref:j,children:(0,t.jsx)("div",{style:{height:`${T.getTotalSize()}px`,width:"100%",position:"relative"},children:T.getVirtualItems().map(e=>{let s=N[e.index],r=!!f&&s.uuid===(C??f);return(0,t.jsx)("div",{"data-index":e.index,ref:T.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start-T.options.scrollMargin}px)`},children:"queue-operation"===s.type?(0,t.jsx)(z,{entry:s,isCollapsed:l.has(ey(s)),entryCount:w.get(ey(s))??0,onToggle:()=>I(ey(s))}):(0,t.jsx)(et,{entry:s,entriesBySource:n,projectName:i,sessionId:o,isHighlighted:!k&&r,highlightedUuid:k,autoExpandForUuid:k})},"queue-operation"===s.type?ey(s):s.uuid||s.timestamp)})})})}let ej=[];e.s([],76248),e.i(76248),e.s(["default",0,function({entries:e,projectName:r,sessionId:n}){let i=(0,s.useMemo)(()=>{let t=new Map;for(let s of e){let e=t.get(s._source);e?e.push(s):t.set(s._source,[s])}return t},[e]),o=i.get("session")??ej,a=(0,s.useMemo)(()=>(function(e){let t=new Map;for(let s of e)if("assistant"===s.type)for(let e of s.message.content)"tool_use"===e.type&&"Task"===e.name&&e.subagentId&&(t.has(e.subagentId)||t.set(e.subagentId,{id:e.subagentId,type:e.subagentType||"unknown",description:e.subagentDescription||""}));return Array.from(t.values())})(e),[e]),l=(0,s.useMemo)(()=>eg(o),[o]),[d,c]=(0,s.useState)(!1),[u,h]=(0,s.useState)(new Set),[m,p]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null);(0,s.useEffect)(()=>{(0,es.searchHookActivityAction)({sessionId:n},1).then(e=>{e.entries.length>0&&g(e)}).catch(()=>{})},[n]),(0,s.useEffect)(()=>{let e=()=>{window.location.hash.startsWith("#entry-")&&p(!1)};return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)},[]);let y=(0,s.useCallback)(e=>{h(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(C,{entries:o}),x&&(0,t.jsx)(ex,{sessionId:n,initialData:x},n),a.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("button",{onClick:()=>c(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(f.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${d?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Subagents"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",a.length,")"]})]}),!d&&a.map(e=>{let s;return(0,t.jsxs)("div",{className:"pl-3 border-l-2 border-primary/30 space-y-2",children:[(0,t.jsxs)("button",{onClick:()=>y(e.id),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(f.ChevronDown,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${u.has(e.id)?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-bold",children:e.type}),e.description&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate max-w-[400px]",children:e.description})]}),!u.has(e.id)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(C,{entries:i.get(`agent-${e.id}`)||[],compact:!0}),(s=eg(i.get(`agent-${e.id}`)||[])).length>0?(0,t.jsx)(ef,{tools:s,compact:!0}):null]})]},e.id)})]}),l.length>0&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Tools"}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",l.reduce((e,t)=>e+t.count,0),")"]})]}),(0,t.jsx)(ef,{tools:l})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>p(e=>!e),className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,t.jsx)(f.ChevronDown,{className:`w-4 h-4 text-muted-foreground transition-transform ${m?"-rotate-90":""}`}),(0,t.jsx)("span",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide",children:"Logs"})]}),!m&&(0,t.jsx)("div",{className:"mt-2 bg-card border border-border rounded-lg p-4 shadow-sm",children:0===o.length?(0,t.jsx)("p",{className:"text-muted-foreground text-center py-8",children:"No entries found."}):(0,t.jsx)(ev,{entries:o,entriesBySource:i,projectName:r,sessionId:n})})]})]})}],36406)},5780,e=>{e.n(e.i(36406))}]);