beads-map 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +2 -2
- package/.next/app-path-routes-manifest.json +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/api/beads.body +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +2 -2
- package/.next/server/app/page.js +3 -3
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +1 -1
- package/.next/server/functions-config-manifest.json +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/app/page-40b0a256ec8af9de.js +1 -0
- package/.next/static/css/454d96c40653b263.css +3 -0
- package/app/page.tsx +23 -0
- package/components/DescriptionModal.tsx +507 -11
- package/components/HelpPanel.tsx +4 -1
- package/components/NodeDetail.tsx +3 -1
- package/components/SettingsModal.tsx +237 -0
- package/components/TutorialOverlay.tsx +3 -3
- package/lib/settings.ts +42 -0
- package/lib/tts.ts +397 -0
- package/package.json +1 -1
- package/.next/static/chunks/app/page-cf8e14cb4afc8112.js +0 -1
- package/.next/static/css/ade5301262971664.css +0 -3
- /package/.next/static/{JmL0suxsggbSwPxWcmUFV → msGLXabX0J07WQq7roVpb}/_buildManifest.js +0 -0
- /package/.next/static/{JmL0suxsggbSwPxWcmUFV → msGLXabX0J07WQq7roVpb}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{6284:function(e,t,n){Promise.resolve().then(n.bind(n,3935))},3935:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return eY}});var r=n(3890),s=n(8496);let i={status:"Status",priority:"Priority",owner:"Owner",assignee:"Assignee",prefix:"Prefix"},l={open:"#10b981",in_progress:"#f59e0b",blocked:"#ef4444",deferred:"#8b5cf6",closed:"#a1a1aa"},a={open:"Open",in_progress:"In Progress",blocked:"Blocked",deferred:"Deferred",closed:"Closed"},o={0:"P0 - Critical",1:"P1 - High",2:"P2 - Medium",3:"P3 - Low",4:"P4 - Backlog"},c={0:"#ef4444",1:"#f97316",2:"#3b82f6",3:"#a1a1aa",4:"#d4d4d8"},d=["#d20f39","#179299","#fe640b","#1e66f5","#40a02b","#8839ef","#df8e1d","#209fb5","#ea76cb","#04a5e5","#e64553","#7287fd","#dd7878","#dc8a78"],u={bug:"\uD83D\uDC1B",feature:"✨",task:"\uD83D\uDCDD",epic:"\uD83C\uDFAF",chore:"\uD83D\uDD27"};function x(e){return e.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function h(e){if(!e)return"#acb0be";let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=16777619*t>>>0;return d[t%d.length]}let m=new Proxy({},{get:(e,t)=>x(t),has:()=>!0}),p=new Proxy({},{get:(e,t)=>(function(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=16777619*t>>>0;let n=t%360;return"hsl(".concat(n,", 65%, 55%)")})(t),has:()=>!0});function f(e){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;return"".concat(t,"->").concat(n,":").concat(e.type)}function g(e,t){if(!e)return{addedNodeIds:new Set(t.graphData.nodes.map(e=>e.id)),removedNodeIds:new Set,changedNodes:new Map,addedLinkKeys:new Set(t.graphData.links.map(f)),removedLinkKeys:new Set,hasChanges:!0};let n=new Map(e.graphData.nodes.map(e=>[e.id,e])),r=new Map(t.graphData.nodes.map(e=>[e.id,e])),s=new Set,i=new Set,l=new Map;for(let[e,t]of r)if(n.has(e)){let r=n.get(e),s=[];r.status!==t.status&&s.push({field:"status",from:r.status,to:t.status}),r.priority!==t.priority&&s.push({field:"priority",from:String(r.priority),to:String(t.priority)}),r.title!==t.title&&s.push({field:"title",from:r.title,to:t.title}),(r.owner||"")!==(t.owner||"")&&s.push({field:"owner",from:r.owner||"",to:t.owner||""}),s.length>0&&l.set(e,s)}else s.add(e);for(let e of n.keys())r.has(e)||i.add(e);let a=new Set(e.graphData.links.map(f)),o=new Set(t.graphData.links.map(f)),c=new Set,d=new Set;for(let e of o)a.has(e)||c.add(e);for(let e of a)o.has(e)||d.add(e);let u=s.size>0||i.size>0||l.size>0||c.size>0||d.size>0;return{addedNodeIds:s,removedNodeIds:i,changedNodes:l,addedLinkKeys:c,removedLinkKeys:d,hasChanges:u}}var v=n(6297),b=n(21),j=n(4295),y=n(2528);let w=null;function k(e){let t=e.blockerCount+e.dependentCount;return"epic"===e.issueType&&(t+=3),5+17*Math.min(t/6,1)}let N="status";function C(e){switch(N){case"priority":return c[e.priority]||c[2];case"owner":return h(e.createdBy);case"assignee":return h(e.assignee);case"prefix":return h(e.prefix);default:return l[e.status]||l.open}}function z(e){return 1-(1-e)*(1-e)}let M=new Map;function S(e,t){let n=M.get(e);if("loading"===n||"failed"===n)return null;if(n)return n;M.set(e,"loading");let r=new Image;return r.onload=()=>{M.set(e,r),t()},r.onerror=()=>{M.set(e,"failed")},r.src=e,null}function L(e,t,n,r,s,i){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fillStyle="#e4e4e7",e.fill();let l=s.replace("@","").charAt(0).toUpperCase();e.font="600 ".concat(Math.min(7,Math.max(3,1.3*r)),"px 'Inter', system-ui, sans-serif"),e.textAlign="center",e.textBaseline="middle",e.fillStyle="#71717a",e.fillText(l,t,n+.3)}function A(e,t){let n=new Set([e]),r=[{id:e,depth:0}];for(;r.length>0;){let{id:e,depth:s}=r.shift();if(!(s>=2))for(let i of t){let t="object"==typeof i.source?i.source.id:i.source,l="object"==typeof i.target?i.target.id:i.target;t!==e||n.has(l)||(n.add(l),r.push({id:l,depth:s+1})),l!==e||n.has(t)||(n.add(t),r.push({id:t,depth:s+1}))}}return n}function T(e){let t=e.current;if(!t)return;let n=t.zoom();"number"!=typeof n||isNaN(n)||(t.zoom(1.000001*n,0),requestAnimationFrame(()=>{e.current&&e.current.zoom(n,0)}))}let D=(0,s.forwardRef)(function(e,t){var d;let{nodes:u,links:m,selectedNode:p,hoveredNode:f,onNodeClick:g,onNodeHover:M,onBackgroundClick:D,onNodeRightClick:B,commentedNodeIds:I,claimedNodeAvatars:W,onAvatarHover:P,timelineActive:F,stats:R,sidebarOpen:_,collapsedEpicIds:O,onCollapseAll:H,onExpandAll:U,colorMode:V="status",onColorModeChange:Y,autoFit:q=!0,onAutoFitToggle:K,pulseNodeId:X,showPulse:$=!0,onShowPulseToggle:G,focusedEpicId:J,onExitFocusedEpic:Z}=e,Q=(0,s.useRef)(null),ee=(0,s.useRef)(null),et=(0,s.useRef)(null),en=(0,s.useRef)(0),er=(0,s.useRef)(()=>{}),[es,ei]=(0,s.useState)({width:800,height:600}),el=(0,s.useRef)(!1),[ea,eo]=(0,s.useState)({w:160,h:120}),ec=ea.w,ed=ea.h,eu=(0,s.useRef)(null),[ex,eh]=(0,s.useState)(w);(0,s.useEffect)(()=>{w||n.e(149).then(n.bind(n,3149)).then(e=>{w=e.default||e,eh(()=>w)})},[]);let[em,ep]=(0,s.useState)("dag"),[ef,eg]=(0,s.useState)(!0),ev=(0,s.useRef)(p),eb=(0,s.useRef)(f),ej=(0,s.useRef)(new Set),ey=(0,s.useRef)(I||new Map),ew=(0,s.useRef)(W||new Map),ek=(0,s.useRef)(V),eN=(0,s.useRef)(X||null),eC=(0,s.useRef)($),ez=(0,s.useRef)(()=>{});ez.current=()=>T(Q);let eM=(0,s.useRef)(P);eM.current=P;let eS=(0,s.useRef)(null),eL=(0,s.useRef)({x:0,y:0}),eA=(0,s.useRef)(u),eT=(0,s.useRef)([]),{viewNodes:eD,viewLinks:eE}=(0,s.useMemo)(()=>{let e=u,t=m;if(J){let n=new Map;for(let e of t){let t="object"==typeof e.source?e.source.id:e.source,r="object"==typeof e.target?e.target.id:e.target;"parent-child"===e.type&&n.set(r,t)}let r=new Set(e.map(e=>e.id));for(let t of e)if(!n.has(t.id)&&t.id.includes(".")){let e=t.id.split(".")[0];r.has(e)&&n.set(t.id,e)}let s=new Set;for(let[e,t]of(s.add(J),n))t===J&&s.add(e);for(let e of t){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;"parent-child"!==e.type&&(s.has(t)&&r.has(n)&&s.add(n),s.has(n)&&r.has(t)&&s.add(t))}e=e.filter(e=>s.has(e.id)),t=t.filter(e=>{let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;return s.has(t)&&s.has(n)})}if(!O||0===O.size)return{viewNodes:e,viewLinks:t};let n=new Map;for(let e of t){let t="object"==typeof e.source?e.source.id:e.source,r="object"==typeof e.target?e.target.id:e.target;"parent-child"===e.type&&n.set(r,t)}let r=new Set(e.map(e=>e.id));for(let t of e)if(!n.has(t.id)&&t.id.includes(".")){let e=t.id.split(".")[0];r.has(e)&&n.set(t.id,e)}let s=new Set;for(let[e,t]of n)O.has(t)&&s.add(e);if(0===s.size)return{viewNodes:e,viewLinks:t};let i=new Map;for(let e of s)i.set(e,n.get(e));let l=new Map,a=new Map,o=new Map;for(let[t,n]of i){l.set(n,(l.get(n)||0)+1);let r=e.find(e=>e.id===t);r&&(a.set(n,(a.get(n)||0)+r.blockerCount),o.set(n,(o.get(n)||0)+r.dependentCount))}let c=e.filter(e=>!s.has(e.id)).map(e=>({...e,blockerCount:e.blockerCount+(a.get(e.id)||0),dependentCount:e.dependentCount+(o.get(e.id)||0),collapsedCount:l.get(e.id)||0})),d=[],x=new Set;for(let e of t){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;if("parent-child"===e.type&&s.has(n)||(t=i.get(t)||t)===(n=i.get(n)||n))continue;let r="".concat(t,"->").concat(n,":").concat(e.type);x.has(r)||(x.add(r),d.push({source:t,target:n,type:e.type}))}return{viewNodes:c,viewLinks:d}},[u,m,O,J]);eA.current=eD,(0,s.useEffect)(()=>{let e=new Map;for(let t of m){let n="object"==typeof t.source?t.source.id:t.source,r="object"==typeof t.target?t.target.id:t.target;"parent-child"===t.type&&e.set(r,n)}let t=new Set(u.map(e=>e.id));for(let n of u)if(!e.has(n.id)&&n.id.includes(".")){let r=n.id.split(".")[0];t.has(r)&&e.set(n.id,r)}let n=new Map;for(let[t,r]of e){let e=n.get(r)||[];e.push(t),n.set(r,e)}let r=new Map(u.map(e=>[e.id,e])),s=[];for(let[e,t]of n){let n=r.get(e);n&&s.push({parentId:e,title:n.title||e,prefix:n.prefix,memberIds:[e,...t]})}eT.current=s},[u,m]);let eB=(0,s.useMemo)(()=>{if("status"===V||"priority"===V)return[];let e=new Map;for(let t of eD)switch(V){case"owner":{let n=t.createdBy||void 0;e.set(n||"Unassigned",h(n));break}case"assignee":{let n=t.assignee||void 0;e.set(n||"Unassigned",h(n));break}case"prefix":e.set(x(t.prefix),h(t.prefix))}return Array.from(e.entries()).sort((e,t)=>{let[n]=e,[r]=t;return"Unassigned"===n?1:"Unassigned"===r?-1:n.localeCompare(r)}).map(e=>{let[t,n]=e;return{label:t,color:n}})},[V,eD]);(0,s.useEffect)(()=>{ev.current=p;let e=eb.current||p;e?ej.current=A(e.id,eE):ej.current=new Set,T(Q),cancelAnimationFrame(en.current),en.current=requestAnimationFrame(()=>er.current())},[p,eE]),(0,s.useEffect)(()=>{eb.current=f;let e=f||ev.current;e?ej.current=A(e.id,eE):ej.current=new Set,T(Q),cancelAnimationFrame(en.current),en.current=requestAnimationFrame(()=>er.current())},[f,eE]),(0,s.useEffect)(()=>{ey.current=I||new Map,T(Q)},[I]),(0,s.useEffect)(()=>{ew.current=W||new Map,T(Q)},[W]),(0,s.useEffect)(()=>{ek.current=V,N=V,T(Q),en.current=requestAnimationFrame(()=>er.current())},[V]),(0,s.useEffect)(()=>{eN.current=X||null,eC.current=$,T(Q)},[X,$]),(0,s.useEffect)(()=>{let e=ee.current;if(!e)return;let t=t=>{let n;eL.current={x:t.clientX,y:t.clientY};let r=Q.current,s=eM.current;if(!r||!s)return;let i=ew.current;if(0===i.size){eS.current&&(eS.current=null,s(null));return}let l=e.getBoundingClientRect(),a=t.clientX-l.left,o=t.clientY-l.top;try{n=r.screen2GraphCoords(a,o)}catch(e){return}let c=Math.max(4,10/(r.zoom()||1));for(let e of eA.current){if(null==e.x||null==e.y)continue;let r=i.get(e.id);if(!r)continue;let l=k(e),a=e.x+.7*l,o=e.y+.7*l,d=n.x-a,u=n.y-o;if(d*d+u*u<=c*c){eS.current!==e.id&&(eS.current=e.id,s({handle:r.handle,avatar:r.avatar,claimedAt:r.claimedAt,did:r.did,x:t.clientX,y:t.clientY}));return}}eS.current&&(eS.current=null,s(null))};return e.addEventListener("mousemove",t),()=>e.removeEventListener("mousemove",t)},[]),(0,s.useEffect)(()=>{let e=()=>{if(ee.current){let e=ee.current.getBoundingClientRect();ei({width:e.width,height:e.height})}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let eI=(0,s.useCallback)(e=>{let t=Q.current;if(!t)return;let n=eD.find(t=>t.id===e.id);n&&void 0!==n.x&&void 0!==n.y&&(t.centerAt(n.x,n.y,500),t.zoom(2.5,500),g(e))},[g,eD]);(0,s.useImperativeHandle)(t,()=>({focusNode:eI}),[eI]),(0,s.useEffect)(()=>{var e,t,n,r,s,i,l,a,o,c,d,u,x,h,m;let p;let f=Q.current;if(!f||0===eD.length)return;let g=()=>{f.d3Force("radial",null),f.d3Force("x",null),f.d3Force("y",null)},w=()=>{eD.forEach(e=>{delete e.fx,delete e.fy})};if("dag"===em)g(),null===(e=f.d3Force("charge"))||void 0===e||e.strength(-80).distanceMax(300),null===(t=f.d3Force("link"))||void 0===t||t.distance(50).strength(.3),null===(n=f.d3Force("center"))||void 0===n||n.strength(.01),f.d3Force("collision",null);else if("radial"===em){g(),w();let e=new Map;for(let t of eE){if("parent-child"===t.type)continue;let n="object"==typeof t.target?t.target.id:t.target,r="object"==typeof t.source?t.source.id:t.source;e.has(n)||e.set(n,[]),e.get(n).push(r)}let t=new Map,n=[];eD.forEach(r=>{e.has(r.id)||(t.set(r.id,0),n.push(r.id))});let l=0;for(;l<n.length;){let e=n[l++],r=t.get(e);for(let s of eE){if("parent-child"===s.type)continue;let i="object"==typeof s.source?s.source.id:s.source,l="object"==typeof s.target?s.target.id:s.target;i!==e||t.has(l)||(t.set(l,r+1),n.push(l))}}eD.forEach(e=>{var n;e._depth=null!==(n=t.get(e.id))&&void 0!==n?n:0}),Array.from(t.values());let a=Math.max(200,4*eD.length);null===(r=f.d3Force("charge"))||void 0===r||r.strength(-300).distanceMax(800),null===(s=f.d3Force("link"))||void 0===s||s.distance(150).strength(.15),null===(i=f.d3Force("center"))||void 0===i||i.strength(0),f.d3Force("radial",(0,v.Z)(e=>(e._depth||0)*a,0,0).strength(.8)),f.d3Force("x",null),f.d3Force("y",null),f.d3Force("collision",(0,b.Z)().radius(e=>k(e)+10).strength(.9))}else if("cluster"===em){g(),w();let e=[...new Set(eD.map(e=>e.prefix))],t=Math.max(400,5*eD.length,150*e.length),n=new Map;e.forEach((r,s)=>{let i=2*Math.PI*s/e.length-Math.PI/2;n.set(r,{x:Math.cos(i)*t,y:Math.sin(i)*t})}),null===(l=f.d3Force("charge"))||void 0===l||l.strength(-200).distanceMax(600),null===(a=f.d3Force("link"))||void 0===a||a.distance(100).strength(.15),null===(o=f.d3Force("center"))||void 0===o||o.strength(0),f.d3Force("x",(0,j.Z)(e=>{var t;return(null===(t=n.get(e.prefix))||void 0===t?void 0:t.x)||0}).strength(.5)),f.d3Force("y",(0,y.Z)(e=>{var t;return(null===(t=n.get(e.prefix))||void 0===t?void 0:t.y)||0}).strength(.5)),f.d3Force("collision",(0,b.Z)().radius(e=>k(e)+10).strength(.9))}else"spread"===em?(g(),w(),null===(c=f.d3Force("charge"))||void 0===c||c.strength(-300).distanceMax(500),null===(d=f.d3Force("link"))||void 0===d||d.distance(180).strength(.4),null===(u=f.d3Force("center"))||void 0===u||u.strength(.02),f.d3Force("collision",(0,b.Z)().radius(e=>k(e)+8).strength(.8))):(g(),w(),null===(x=f.d3Force("charge"))||void 0===x||x.strength(-180).distanceMax(400),null===(h=f.d3Force("link"))||void 0===h||h.distance(e=>{var t,n,r,s;return(((null===(t=e.source)||void 0===t?void 0:t.blockerCount)||0)+((null===(n=e.source)||void 0===n?void 0:n.dependentCount)||0)+(((null===(r=e.target)||void 0===r?void 0:r.blockerCount)||0)+((null===(s=e.target)||void 0===s?void 0:s.dependentCount)||0)))/2>4?90:120}).strength(.6),null===(m=f.d3Force("center"))||void 0===m||m.strength(.03),f.d3Force("collision",(0,b.Z)().radius(e=>k(e)+6).strength(.7)));return f.d3ReheatSimulation(),q&&(p=setTimeout(()=>{Q.current&&Q.current.zoomToFit(400,60)},el.current?600:1e3)),el.current=!0,()=>{p&&clearTimeout(p)}},[em,eD,eE,q]);let eW=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(eW.current||!ex||0===u.length)return;eW.current=!0;let e=setTimeout(()=>{ep("force")},15);return()=>clearTimeout(e)},[ex,u.length]),(0,s.useEffect)(()=>{if(!F&&q&&Q.current&&u.length>0){let e=setTimeout(()=>{Q.current.zoomToFit(400,60)},800);return()=>clearTimeout(e)}},[u.length,F,q]);let eP=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{if(void 0===eP.current){eP.current=null!=J?J:null;return}eP.current=null!=J?J:null;let e=Q.current;if(!e)return;let t=setTimeout(()=>{e.zoomToFit(400,60)},100);return()=>clearTimeout(t)},[J]);let eF=(0,s.useMemo)(()=>{let e=Math.sqrt(eD.length)||1;return eD.forEach((t,n)=>{if(null==t.x&&null==t.y){let r=n*Math.PI*(3-Math.sqrt(5)),s=300*Math.sqrt(.5+n)/e;t.x=s*Math.cos(r),t.y=s*Math.sin(r)}}),{nodes:eD,links:eE}},[eD,eE]),eR=(0,s.useCallback)((e,t,n)=>{var r,s,i;let a=k(e),o=C(e),c=h(e.prefix),d=(null===(r=ev.current)||void 0===r?void 0:r.id)===e.id,u=(null===(s=eb.current)||void 0===s?void 0:s.id)===e.id,x=ej.current,m=x.has(e.id),p=x.size>0,f=Date.now(),g=1,v=e._spawnTime;if(v){let e=f-v;e<500&&(g=1+2.70158*Math.pow((i=e/500)-1,3)+1.70158*Math.pow(i-1,2))}let b=1,j=1,y=e._removeTime;if(y){let e=f-y;if(e<400){let t=e/400;b=1-z(t),j=1-t}else b=0,j=0}let w=g*b;if(w<=.01)return;let N=a*w,M=(p&&!m?.15:"closed"===e.status?.5:1)*j;if(M<=.01)return;t.save(),t.globalAlpha=M,m&&p&&(t.shadowColor="#10b981",t.shadowBlur=d?20:u?16:10),n>.3&&(t.beginPath(),t.arc(e.x,e.y,N+2,0,2*Math.PI),t.strokeStyle=c,t.lineWidth=2,t.stroke()),t.beginPath(),t.arc(e.x,e.y,N,0,2*Math.PI),t.fillStyle=o,t.fill(),t.strokeStyle=d?"#10b981":u?"#3f3f46":"#e4e4e7",t.lineWidth=d?2.5:u?2:1,t.stroke(),t.shadowBlur=0;let A=e._changedAt;if(A){let n=f-A;if(n<800){let r=n/800,s=l[e.status]||"#a1a1aa";t.beginPath(),t.arc(e.x,e.y,N+4+20*r,0,2*Math.PI),t.strokeStyle=s,t.lineWidth=2*(1-r),t.globalAlpha=(1-r)*.6,t.stroke(),t.globalAlpha=M}}if(eC.current&&eN.current===e.id){let r=N+Math.max(25,30/n);for(let s=0;s<3;s++){let i=(f+500*s)%2e3/2e3,l=N+2/n+i*(r-N),a=(1-i)*.6;t.beginPath(),t.arc(e.x,e.y,l,0,2*Math.PI),t.strokeStyle="#10b981",t.lineWidth=Math.max(1.5/n,.5),t.globalAlpha=a*M,t.stroke()}t.globalAlpha=M}if(v){let n=f-v;if(n<500){let r=n/500;t.beginPath(),t.arc(e.x,e.y,N+6+8*r,0,2*Math.PI),t.strokeStyle="#10b981",t.lineWidth=3*(1-r),t.globalAlpha=(1-r)*.4,t.stroke(),t.globalAlpha=M}}if(e.priority<=1&&n>.5&&(t.font="".concat(Math.min(10,Math.max(4,12/n)),"px sans-serif"),t.textAlign="center",t.textBaseline="bottom",t.fillText(0===e.priority?"\uD83D\uDD25\uD83D\uDD25":"\uD83D\uDD25",e.x,e.y-N-2)),n>.5){let r=Math.min(7,Math.max(3,10/n));t.font="500 ".concat(r,"px 'Inter', system-ui, sans-serif"),t.textAlign="center",t.textBaseline="top",t.fillStyle="#3f3f46",t.globalAlpha=.85*M;let s=e.id;n>1.5?s=E(e.title||e.id,30):n>.9&&(s=E(e.title||e.id,18)),t.fillText(s,e.x,e.y+N+3);let i=e.collapsedCount;i&&i>0&&(t.font="400 ".concat(Math.min(5.5,Math.max(2.5,8/n)),"px 'Inter', system-ui, sans-serif"),t.fillStyle="#a1a1aa",t.fillText("".concat(i," task").concat(1!==i?"s":""),e.x,e.y+N+3+r+1))}let T=ey.current.get(e.id);if(T&&T>0&&n>.4){let r=Math.min(6,Math.max(3.5,8/n)),s=e.x+.75*N,i=e.y-.75*N,l=T>99?"99+":String(T);t.save(),t.globalAlpha=Math.min(M,.95),t.beginPath(),t.arc(s,i,r,0,2*Math.PI),t.fillStyle="#ef4444",t.fill(),t.strokeStyle="#ffffff",t.lineWidth=Math.max(.8,1.2/n),t.stroke(),t.font="600 ".concat(Math.min(7,Math.max(3,1.3*r)),"px 'Inter', system-ui, sans-serif"),t.textAlign="center",t.textBaseline="middle",t.fillStyle="#ffffff",t.fillText(l,s,i+.3),t.restore()}let D=ew.current.get(e.id);if(D){let r=Math.max(4,10/n),s=e.x+.7*N,i=e.y+.7*N;if(t.save(),t.globalAlpha=1,D.avatar){let e=S(D.avatar,()=>ez.current());e?(t.save(),t.beginPath(),t.arc(s,i,r,0,2*Math.PI),t.clip(),t.drawImage(e,s-r,i-r,2*r,2*r),t.restore()):L(t,s,i,r,D.handle,n)}else L(t,s,i,r,D.handle,n);t.beginPath(),t.arc(s,i,r,0,2*Math.PI),t.strokeStyle="#ffffff",t.lineWidth=Math.max(.8,1.2/n),t.stroke(),t.restore()}t.restore()},[]),e_=(0,s.useCallback)((e,t,n)=>{let r=e.source,s=e.target;if(void 0===r.x||void 0===s.x)return;let i=Date.now(),l=1,a=1,o=e._spawnTime;if(o){let e=i-o;if(e<500){let t=e/500;l=z(t),a=1+(1-t)*1.5}}let c=1,d=e._removeTime;if(d){let e=i-d;if(!(e<400))return;c=1-z(e/400)}let u=l*c;if(u<=.01)return;let x=r.id||e.source,h=s.id||e.target,m="parent-child"===e.type,p=ej.current,f=p.size>0,g=f&&p.has(x)&&p.has(h),v=(m?f?g?.5:.05:.2:f?g?.8:.08:.35)*u;if(v<=.01)return;t.save(),t.globalAlpha=v,m?(t.strokeStyle=g?"#71717a":"#a1a1aa",t.lineWidth=Math.max(.6,1.5/n)*a,t.setLineDash([4,3])):(t.strokeStyle=g?"#10b981":"#d4d4d8",t.lineWidth=(g?Math.max(2,2.5/n):Math.max(.8,1.2/n))*a);let b=s.x-r.x,j=s.y-r.y,y=Math.sqrt(b*b+j*j),w=(r.x+s.x)/2+.15*j,N=(r.y+s.y)/2-.15*b;if(t.beginPath(),t.moveTo(r.x,r.y),t.quadraticCurveTo(w,N,s.x,s.y),t.stroke(),m&&t.setLineDash([]),o){let e=i-o;e<300&&(t.save(),t.globalAlpha=(1-e/300)*.5,t.strokeStyle="#10b981",t.lineWidth=(m?3:4)/n,t.beginPath(),t.moveTo(r.x,r.y),t.quadraticCurveTo(w,N,s.x,s.y),t.stroke(),t.restore())}if(!m){let e=k(s);if(y<e+1){t.restore();return}let i=Math.min(8,6/n),l=1-e/y,a=r.x+l*b,o=r.y+l*j,c=Math.atan2(j,b);t.fillStyle=g?"#10b981":"#d4d4d8",t.beginPath(),t.moveTo(a,o),t.lineTo(a-i*Math.cos(c-Math.PI/7),o-i*Math.sin(c-Math.PI/7)),t.lineTo(a-i*Math.cos(c+Math.PI/7),o-i*Math.sin(c+Math.PI/7)),t.closePath(),t.fill()}t.restore()},[]),eO=(0,s.useCallback)((e,t)=>{if(!ef)return;let n=t>=.8?0:t<=.4?1:(.8-t)/.4;if(n<=.01)return;let r=eT.current;if(0===r.length)return;let s=new Map;for(let e of eD)null!=e.x&&null!=e.y&&s.set(e.id,{x:e.x,y:e.y});for(let i of(e.save(),r)){let r=0,l=0,a=0;for(let e of i.memberIds){let t=s.get(e);t&&(r+=t.x,l+=t.y,a++)}if(0===a)continue;let o=r/a,c=l/a,d=0;for(let e of i.memberIds){let t=s.get(e);if(t){let e=t.x-o,n=t.y-c,r=Math.sqrt(e*e+n*n);r>d&&(d=r)}}let u=d+30,x=h(i.prefix);e.beginPath(),e.arc(o,c,u,0,2*Math.PI),e.globalAlpha=.05*n,e.fillStyle=x,e.fill(),e.globalAlpha=.25*n,e.strokeStyle=x,e.lineWidth=1.5/t,e.setLineDash([8/t,4/t]),e.stroke(),e.setLineDash([]);let m=Math.min(24,Math.max(10,14/t)),p=Math.min(12,Math.max(5,8/t)),f=.35*m;e.font="500 ".concat(p,"px 'Inter', system-ui, sans-serif"),e.textAlign="center",e.textBaseline="middle",e.globalAlpha=.45*n,e.fillStyle="#71717a",e.fillText(i.parentId,o,c-.5*m-f),e.font="600 ".concat(m,"px 'Inter', system-ui, sans-serif"),e.globalAlpha=.85*n,e.fillStyle="#18181b";let g=i.title.length>40?i.title.slice(0,39)+"…":i.title;e.fillText(g,o,c+.15*m);let v=Math.min(14,Math.max(6,9/t));e.font="400 ".concat(v,"px 'Inter', system-ui, sans-serif"),e.globalAlpha=.5*n,e.fillStyle="#71717a",e.fillText("".concat(i.memberIds.length," issue").concat(1!==i.memberIds.length?"s":""),o,c+.15*m+.7*m)}e.restore()},[eD,u,ef]),eH=(0,s.useCallback)((e,t,n)=>{let r=k(e)+5;n.fillStyle=t,n.beginPath(),n.arc(e.x,e.y,r,0,2*Math.PI),n.fill()},[]),eU=(0,s.useCallback)(()=>{},[]),eV=(0,s.useCallback)(()=>{var e,t;let n=et.current,r=Q.current;if(!n||!r)return;let s=n.getContext("2d");if(!s)return;let i=1/0,l=-1/0,a=1/0,o=-1/0,c=!1;for(let e of eD)null!=e.x&&null!=e.y&&(c=!0,e.x<i&&(i=e.x),e.x>l&&(l=e.x),e.y<a&&(a=e.y),e.y>o&&(o=e.y));if(!c)return;let d=(l+=40)-(i-=40)||1,u=(o+=40)-(a-=40)||1,x=ec-16,h=ed-16,m=Math.min(x/d,h/u),p=8+(x-d*m)/2,f=8+(h-u*m)/2,g=window.devicePixelRatio||1;(n.width!==ec*g||n.height!==ed*g)&&(n.width=ec*g,n.height=ed*g,s.setTransform(g,0,0,g,0,0)),s.clearRect(0,0,ec,ed),s.fillStyle="rgba(250, 250, 250, 0.92)",s.beginPath(),s.roundRect(0,0,ec,ed,6),s.fill();let v=ej.current,b=v.size>0,j=(null===(e=eb.current)||void 0===e?void 0:e.id)||(null===(t=ev.current)||void 0===t?void 0:t.id)||null;for(let e of eE){let t=e.source,n=e.target;if(null==t.x||null==n.x)continue;let r=t.id||e.source,l=n.id||e.target,o=b&&v.has(r)&&v.has(l);s.globalAlpha=b?o?.5:.04:.1,s.strokeStyle=o?"#10b981":"#a1a1aa",s.lineWidth=o?1:.5;let c=p+(t.x-i)*m,d=f+(t.y-a)*m,u=p+(n.x-i)*m,x=f+(n.y-a)*m;s.beginPath(),s.moveTo(c,d),s.lineTo(u,x),s.stroke()}for(let e of(s.globalAlpha=1,eD)){if(null==e.x||null==e.y)continue;let t=p+(e.x-i)*m,n=f+(e.y-a)*m,r=e.id===j,l=v.has(e.id);b&&!l?s.globalAlpha=.1:"closed"===e.status?s.globalAlpha=.35:s.globalAlpha=.85,s.fillStyle=C(e);let o="epic"===e.issueType?3:2;r?o=5:b&&l&&(o=4),r&&(s.globalAlpha=.4,s.fillStyle="#10b981",s.beginPath(),s.arc(t,n,o+2,0,2*Math.PI),s.fill(),s.globalAlpha=1,s.fillStyle=C(e)),s.fillRect(t-o/2,n-o/2,o,o)}s.globalAlpha=1;let y=ew.current;if(y.size>0)for(let e of eD){if(null==e.x||null==e.y)continue;let t=y.get(e.id);if(!t)continue;let n=p+(e.x-i)*m,r=f+(e.y-a)*m;if(s.save(),s.globalAlpha=1,t.avatar){let e=S(t.avatar,()=>ez.current());e?(s.save(),s.beginPath(),s.arc(n,r,5,0,2*Math.PI),s.clip(),s.drawImage(e,n-5,r-5,10,10),s.restore()):(s.beginPath(),s.arc(n,r,5,0,2*Math.PI),s.fillStyle="#d4d4d8",s.fill())}else s.beginPath(),s.arc(n,r,5,0,2*Math.PI),s.fillStyle="#d4d4d8",s.fill();s.beginPath(),s.arc(n,r,5,0,2*Math.PI),s.strokeStyle="#ffffff",s.lineWidth=1,s.stroke(),s.restore()}try{let e=r.screen2GraphCoords(0,0),t=r.screen2GraphCoords(es.width,es.height),n=p+(e.x-i)*m,l=f+(e.y-a)*m,o=(t.x-e.x)*m,c=(t.y-e.y)*m,d=Math.max(0,n),u=Math.max(0,l),x=Math.min(ec-d,o-(d-n)),h=Math.min(ed-u,c-(u-l));x>0&&h>0&&(s.fillStyle="rgba(16, 185, 129, 0.06)",s.fillRect(d,u,x,h),s.strokeStyle="rgba(16, 185, 129, 0.5)",s.lineWidth=1.5,s.strokeRect(d,u,x,h))}catch(e){}},[eD,eE,es,ec,ed,8]);er.current=eV;let eY=(0,s.useCallback)(()=>{cancelAnimationFrame(en.current),en.current=requestAnimationFrame(()=>{eV()})},[eV]);(0,s.useEffect)(()=>{if(!ex||0===u.length)return;let e=setInterval(()=>{eV()},200);return()=>clearInterval(e)},[ex,u.length,eV]),(0,s.useEffect)(()=>{let e;let t=!0;return function n(){if(!t)return;let r=Date.now();(eD.some(e=>!!e._spawnTime&&r-e._spawnTime<500||!!e._removeTime&&r-e._removeTime<400||!!e._changedAt&&r-e._changedAt<800)||eE.some(e=>!!e._spawnTime&&r-e._spawnTime<500||!!e._removeTime&&r-e._removeTime<400))&&T(Q),e=requestAnimationFrame(n)}(),()=>{t=!1,cancelAnimationFrame(e)}},[eD,eE]);let eq=(0,s.useCallback)(e=>{let t=Q.current;if(!t)return;let n=e.currentTarget.getBoundingClientRect(),r=e.clientX-n.left,s=e.clientY-n.top,i=1/0,l=-1/0,a=1/0,o=-1/0;for(let e of eD)null!=e.x&&null!=e.y&&(e.x<i&&(i=e.x),e.x>l&&(l=e.x),e.y<a&&(a=e.y),e.y>o&&(o=e.y));let c=(l+=40)-(i-=40)||1,d=(o+=40)-(a-=40)||1,u=ec-16,x=ed-16,h=Math.min(u/c,x/d),m=i+(r-(8+(u-c*h)/2))/h,p=a+(s-(8+(x-d*h)/2))/h;t.centerAt(m,p,300)},[eD,ec,ed,8]);return(0,r.jsxs)("div",{ref:ee,className:"w-full h-full relative","data-tutorial":"graph",children:[(0,r.jsxs)("div",{className:"absolute top-3 left-3 sm:top-4 sm:left-4 z-10 flex flex-col gap-1.5 sm:gap-2",children:[J&&Z&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs font-medium bg-emerald-50/90 backdrop-blur-sm rounded-lg border border-emerald-200 shadow-sm text-emerald-700",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M16.5 20.25H18A2.25 2.25 0 0020.25 18v-1.5M7.5 20.25H6A2.25 2.25 0 013.75 18v-1.5"})}),(0,r.jsxs)("span",{className:"truncate max-w-[180px]",children:["Focused: ",(0,r.jsx)("span",{className:"font-semibold",children:(null===(d=u.find(e=>e.id===J))||void 0===d?void 0:d.title)||J})]}),(0,r.jsx)("button",{onClick:Z,className:"ml-auto p-0.5 rounded hover:bg-emerald-200/50 transition-colors flex-shrink-0",title:"Show full graph",children:(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex items-start gap-1.5 sm:gap-2",children:(0,r.jsxs)("div",{className:"flex bg-white/90 backdrop-blur-sm rounded-lg border border-zinc-200 shadow-sm overflow-hidden","data-tutorial":"layouts",children:[(0,r.jsx)("button",{onClick:()=>ep("force"),className:"px-3 py-1.5 text-xs font-medium transition-colors ".concat("force"===em?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"4",cy:"4",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"12",cy:"3",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"3",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"13",cy:"11",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("line",{x1:"4",y1:"4",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"12",y1:"3",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"3",y1:"12",x2:"8",y2:"8",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"13",y1:"11",x2:"8",y2:"8",strokeOpacity:"0.5"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Force"})]})}),(0,r.jsx)("div",{className:"w-px bg-zinc-200"}),(0,r.jsx)("button",{onClick:()=>ep("dag"),className:"px-3 py-1.5 text-xs font-medium transition-colors ".concat("dag"===em?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"2.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"4",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"12",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"2",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"6",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"12",cy:"13.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("line",{x1:"8",y1:"4",x2:"4",y2:"6.5",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"8",y1:"4",x2:"12",y2:"6.5",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"4",y1:"9.5",x2:"2",y2:"12",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"4",y1:"9.5",x2:"6",y2:"12",strokeOpacity:"0.5"}),(0,r.jsx)("line",{x1:"12",y1:"9.5",x2:"12",y2:"12",strokeOpacity:"0.5"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"DAG"})]})}),(0,r.jsx)("div",{className:"w-px bg-zinc-200"}),(0,r.jsx)("button",{onClick:()=>ep("radial"),className:"px-3 py-1.5 text-xs font-medium transition-colors ".concat("radial"===em?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"2",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"5",fill:"none",strokeOpacity:"0.5"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"7.5",fill:"none",strokeOpacity:"0.3"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Radial"})]})}),(0,r.jsx)("div",{className:"w-px bg-zinc-200"}),(0,r.jsx)("button",{onClick:()=>ep("cluster"),className:"px-3 py-1.5 text-xs font-medium transition-colors ".concat("cluster"===em?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"3.5",cy:"4",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"6",cy:"6",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"3",cy:"7",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"11",cy:"10",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"13.5",cy:"11.5",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"11",cy:"13",r:"1.5",fill:"currentColor",stroke:"none"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Cluster"})]})}),(0,r.jsx)("div",{className:"w-px bg-zinc-200"}),(0,r.jsx)("button",{onClick:()=>ep("spread"),className:"px-3 py-1.5 text-xs font-medium transition-colors ".concat("spread"===em?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50"),children:(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"2",cy:"2",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"14",cy:"3",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"3",cy:"14",r:"1.5",fill:"currentColor",stroke:"none"}),(0,r.jsx)("circle",{cx:"13",cy:"13",r:"1.5",fill:"currentColor",stroke:"none"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Spread"})]})})]})}),(0,r.jsxs)("div",{className:"flex items-start gap-1.5 sm:gap-2","data-tutorial":"view-controls",children:[(H||U)&&(0,r.jsx)("button",{onClick:O&&O.size>0?U:H,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-white/90 backdrop-blur-sm rounded-lg border border-zinc-200 shadow-sm text-zinc-500 hover:text-zinc-700 hover:bg-zinc-50 transition-colors",children:O&&O.size>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Expand all"})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Collapse all"})]})}),(0,r.jsxs)("button",{onClick:()=>eg(e=>!e),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium backdrop-blur-sm rounded-lg border shadow-sm transition-colors ".concat(ef?"bg-emerald-500 text-white border-emerald-500":"bg-white/90 text-zinc-500 border-zinc-200 hover:text-zinc-700 hover:bg-zinc-50"),title:ef?"Hide cluster labels":"Show cluster labels",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"2.5 2",strokeOpacity:ef?1:.5}),(0,r.jsx)("line",{x1:"5",y1:"8",x2:"11",y2:"8",strokeOpacity:ef?1:.4}),(0,r.jsx)("line",{x1:"6",y1:"10",x2:"10",y2:"10",strokeOpacity:ef?.6:.25,strokeWidth:"1"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Clusters"})]}),(0,r.jsxs)("button",{onClick:()=>null==K?void 0:K(),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium backdrop-blur-sm rounded-lg border shadow-sm transition-colors ".concat(q?"bg-emerald-500 text-white border-emerald-500":"bg-white/90 text-zinc-500 border-zinc-200 hover:text-zinc-700 hover:bg-zinc-50"),title:q?"Auto-fit enabled: camera adjusts after updates":"Auto-fit disabled: camera stays fixed",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:[(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M20.25 16.5V18A2.25 2.25 0 0118 20.25h-1.5M3.75 16.5V18A2.25 2.25 0 006 20.25h1.5"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Auto-fit"})]}),(0,r.jsxs)("button",{onClick:()=>null==G?void 0:G(),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium backdrop-blur-sm rounded-lg border shadow-sm transition-colors ".concat($?"bg-emerald-500 text-white border-emerald-500":"bg-white/90 text-zinc-500 border-zinc-200 hover:text-zinc-700 hover:bg-zinc-50"),title:$?"Pulse enabled: ripple highlights most recent activity":"Pulse disabled: no activity highlight",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.07 4.93A10 10 0 014.93 19.07M4.93 4.93a10 10 0 0114.14 14.14",strokeOpacity:"0.5"}),(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.24 7.76a6 6 0 01.01 8.49M7.76 7.76a6 6 0 000 8.49",strokeOpacity:"0.7"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Pulse"})]})]})]}),!F&&(0,r.jsxs)("div",{className:"absolute bottom-4 z-10 bg-white/90 backdrop-blur-sm rounded-lg border border-zinc-200 shadow-sm px-3 py-2 text-xs text-zinc-400 transition-[right] duration-300 ease-out","data-tutorial":"legend",style:{right:_?"calc(360px + 1rem)":"1rem",maxWidth:320},children:[R&&(0,r.jsxs)("div",{className:"text-zinc-500 mb-1.5",children:[(0,r.jsx)("strong",{className:"text-zinc-700",children:R.total})," issues"," \xb7 ",(0,r.jsx)("strong",{className:"text-zinc-700",children:R.edges})," deps"," \xb7 ",(0,r.jsx)("strong",{className:"text-emerald-600",children:R.prefixes.length}),1===R.prefixes.length?" project":" projects"]}),(0,r.jsx)("div",{className:"hidden sm:flex bg-zinc-100 rounded-md overflow-hidden mb-1.5",children:["status","priority","owner","assignee","prefix"].map(e=>(0,r.jsx)("button",{onClick:()=>null==Y?void 0:Y(e),className:"flex-1 px-2 py-1 text-[10px] font-medium transition-colors ".concat(V===e?"bg-emerald-500 text-white":"text-zinc-500 hover:text-zinc-700 hover:bg-zinc-200/60"),children:i[e]},e))}),(0,r.jsx)("div",{className:"hidden sm:flex flex-wrap gap-x-3 gap-y-1 mb-1.5",children:"status"===V?(0,r.jsx)(r.Fragment,{children:["open","in_progress","blocked","deferred","closed"].map(e=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:l[e]}}),(0,r.jsx)("span",{className:"text-zinc-500",children:a[e]})]},e))}):"priority"===V?(0,r.jsx)(r.Fragment,{children:[0,1,2,3,4].map(e=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c[e]}}),(0,r.jsx)("span",{className:"text-zinc-500",children:o[e]})]},e))}):(0,r.jsx)(r.Fragment,{children:eB.map(e=>{let{label:t,color:n}=e;return(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:n}}),(0,r.jsx)("span",{className:"text-zinc-500 truncate max-w-[80px]",children:t})]},t)})})}),(0,r.jsx)("div",{className:"hidden sm:flex flex-col gap-0.5 text-zinc-400",children:(0,r.jsxs)("span",{children:["Size = importance \xb7 Ring = project","status"!==V&&" \xb7 Fill = ".concat(i[V].toLowerCase())]})}),(0,r.jsx)("span",{className:"sm:hidden",children:"Tap a node for details"})]}),(0,r.jsxs)("div",{className:"hidden sm:block absolute bottom-4 left-4 z-10","data-tutorial":"minimap",style:{width:ec,height:ed},children:[(0,r.jsx)("canvas",{ref:et,width:ec,height:ed,onClick:eq,className:"rounded-lg border border-zinc-200 shadow-sm cursor-crosshair",style:{width:ec,height:ed}}),(0,r.jsx)("div",{className:"absolute top-0 left-2 right-2 h-1.5 cursor-n-resize hover:bg-zinc-300/40 rounded-t-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),eu.current={edge:"top",startX:e.clientX,startY:e.clientY,startW:ec,startH:ed};let t=e=>{if(!eu.current)return;let t=eu.current.startY-e.clientY,n=Math.max(80,Math.min(400,eu.current.startH+t));eo(e=>({...e,h:n}))},n=()=>{eu.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}}),(0,r.jsx)("div",{className:"absolute top-2 right-0 bottom-2 w-1.5 cursor-e-resize hover:bg-zinc-300/40 rounded-r-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),eu.current={edge:"right",startX:e.clientX,startY:e.clientY,startW:ec,startH:ed};let t=e=>{if(!eu.current)return;let t=e.clientX-eu.current.startX,n=Math.max(100,Math.min(500,eu.current.startW+t));eo(e=>({...e,w:n}))},n=()=>{eu.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}}),(0,r.jsx)("div",{className:"absolute top-0 right-0 w-3 h-3 cursor-ne-resize hover:bg-zinc-300/40 rounded-tr-lg transition-colors",onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),eu.current={edge:"top-right",startX:e.clientX,startY:e.clientY,startW:ec,startH:ed};let t=e=>{if(!eu.current)return;let t=e.clientX-eu.current.startX,n=eu.current.startY-e.clientY;eo({w:Math.max(100,Math.min(500,eu.current.startW+t)),h:Math.max(80,Math.min(400,eu.current.startH+n))})},n=()=>{eu.current=null,window.removeEventListener("mousemove",t),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",t),window.addEventListener("mouseup",n)}})]}),ex?(0,r.jsx)(ex,{ref:Q,graphData:eF,width:es.width,height:es.height,nodeCanvasObject:eR,nodeCanvasObjectMode:()=>"replace",nodePointerAreaPaint:eH,onRenderFramePost:eO,linkCanvasObject:e_,linkCanvasObjectMode:()=>"replace",linkDirectionalParticles:e=>"parent-child"===e.type?0:2,linkDirectionalParticleSpeed:.004,linkDirectionalParticleWidth:2.5,linkDirectionalParticleColor:()=>"#10b981",dagMode:"dag"===em?"td":void 0,dagLevelDistance:60,onDagError:eU,d3AlphaDecay:.02,d3VelocityDecay:.3,cooldownTicks:300,warmupTicks:50,onNodeClick:e=>g(e),onNodeHover:e=>M(e||null,eL.current.x,eL.current.y),onNodeRightClick:(e,t)=>{t.preventDefault(),null==B||B(e,t)},onBackgroundClick:D,onZoom:eY,backgroundColor:"transparent",autoPauseRedraw:!($&&X)}):(0,r.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,r.jsx)("div",{className:"text-zinc-400 text-sm animate-pulse-soft",children:"Loading graph engine..."})})]})});function E(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}var B=n(5777),I=n(7827),W=n(1720);function P(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/1e3);if(n<60)return"just now";let r=Math.floor(n/60);if(r<60)return"".concat(r,"m ago");let s=Math.floor(r/60);if(s<24)return"".concat(s,"h ago");let i=Math.floor(s/24);return i<7?"".concat(i,"d ago"):t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function F(e,t){let n=[];return n.push("[".concat(x(e.prefix),"] ").concat(e.id)),t&&n.push(t),n.push(""),n.push(e.description||""),n.join("\n")}let R="beads-map-settings",_={elevenLabsVoiceId:"UgBBYS2sOqTuMpoF3BR0",elevenLabsModel:"eleven_turbo_v2_5"};function O(){try{let e=localStorage.getItem(R);if(!e)return{..._};return{..._,...JSON.parse(e)}}catch(e){return{..._}}}function H(){let e=O();return!!e.elevenLabsApiKey&&e.elevenLabsApiKey.trim().length>0}let U=new Map;function V(e){return e.replace(/\s+/g," ").trim().toLowerCase()}let Y=null,q=null,K=null;function X(e){Y&&(Y.playbackRate=e)}function $(){Y&&(Y.pause(),Y.currentTime=0,Y.onended=null,Y.onerror=null,Y.ontimeupdate=null,Y=null),q&&(URL.revokeObjectURL(q),q=null),K=null}function G(e,t){K=null;let n=URL.createObjectURL(e);q=n;let r=new Audio(n);Y=r,t("playing"),r.onended=()=>{$(),t("idle")},r.onerror=()=>{$(),t("error","Audio playback failed")},r.play()}async function J(e,t){var n;$();let r=O();if(!r.elevenLabsApiKey){t("error","No API key configured");return}let s=r.elevenLabsVoiceId,i=(n=r.elevenLabsModel,"".concat(s,":").concat(n,":").concat(e)),l=function(e){let t=U.get(e);return t&&(U.delete(e),U.set(e,t)),t}(i);if(l){G(l.blob,t);return}t("loading");try{let n=await fetch("https://api.elevenlabs.io/v1/text-to-speech/".concat(s,"/with-timestamps?output_format=mp3_44100_128"),{method:"POST",headers:{"Content-Type":"application/json","xi-api-key":r.elevenLabsApiKey},body:JSON.stringify({text:e,model_id:r.elevenLabsModel})});if(!n.ok){let e=await n.text().catch(()=>n.statusText);throw Error("ElevenLabs API error (".concat(n.status,"): ").concat(e))}let{audio_base64:l,alignment:a}=await n.json(),o=atob(l),c=new Uint8Array(o.length);for(let e=0;e<o.length;e++)c[e]=o.charCodeAt(e);let d=new Blob([c],{type:"audio/mpeg"}),u={blob:d,alignment:{characters:a.characters,characterStartTimesSeconds:a.character_start_times_seconds,characterEndTimesSeconds:a.character_end_times_seconds},strippedText:e};!function(e,t){if(U.size>=10){let e=U.keys().next().value;e&&U.delete(e)}U.set(e,t)}(i,u),G(d,t)}catch(e){$(),t("error",e instanceof Error?e.message:"TTS failed")}}async function Z(e,t){$();let n=function(e){let t=V(e);if(!t)return null;for(let e of U.values()){let n=V(e.strippedText).indexOf(t);if(-1===n)continue;let{strippedText:r,alignment:s}=e,i=[],l=0,a=!1;for(let e=0;e<r.length;e++)/\s/.test(r[e])?(!a&&l>0?(i.push(l),l++):i.push(-1),a=!0):(i.push(l),l++,a=!1);let o=n+t.length-1,c=-1,d=-1;for(let e=0;e<i.length;e++)i[e]===n&&-1===c&&(c=e),i[e]===o&&(d=e);if(-1===c||-1===d)continue;let u=s.characterStartTimesSeconds.length;if(0===u)continue;let x=Math.min(c,u-1),h=Math.min(d,s.characterEndTimesSeconds.length-1);if(!(x<0)&&!(h<0))return{blob:e.blob,startTime:s.characterStartTimesSeconds[x],endTime:s.characterEndTimesSeconds[h]}}return null}(e);if(n){let{blob:e,startTime:r,endTime:s}=n,i=URL.createObjectURL(e);q=i;let l=new Audio(i);Y=l,K=s,l.onended=()=>{$(),t("idle")},l.onerror=()=>{$(),t("error","Audio playback failed")},l.ontimeupdate=()=>{null!==K&&l.currentTime>=K&&($(),t("idle"))},l.currentTime=r,t("playing"),await l.play();return}await J(e,t)}let Q=[{label:"Normal",value:1},{label:"1.25x",value:1.25},{label:"1.5x",value:1.5},{label:"1.75x",value:1.75},{label:"2x",value:2}];function ee(e){let{node:t,onClose:n,repoUrl:i,onOpenSettings:l}=e,[a,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)("idle"),[u,x]=(0,s.useState)(null),[h,m]=(0,s.useState)(1),[p,f]=(0,s.useState)(!1),[g,v]=(0,s.useState)(""),[b,j]=(0,s.useState)(!1),y=(0,s.useRef)(null),w=(0,s.useRef)(null),[k,N]=(0,s.useState)(null),C=(0,s.useRef)(null),z=(0,s.useRef)(!1),M=(0,s.useCallback)((e,t)=>{d(e),t&&x(t)},[]),S=(0,s.useCallback)(()=>{if(!H()){null==l||l();return}let e=(t.description||"").replace(/```[\s\S]*?```/g,"").replace(/`([^`]+)`/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/(\*{1,3}|_{1,3})(.*?)\1/g,"$2").replace(/~~(.*?)~~/g,"$1").replace(/^[-*_]{3,}\s*$/gm,"").replace(/^>\s+/gm,"").replace(/^[\s]*[-*+]\s+/gm,"").replace(/^[\s]*\d+\.\s+/gm,"").replace(/<[^>]+>/g,"").replace(/\n{3,}/g,"\n\n").trim();e&&(x(null),J(e,M))},[t.description,l,M]),L=(0,s.useCallback)(()=>{$(),d("idle"),f(!1),j(!1)},[]),A=(0,s.useCallback)(()=>{Y&&!Y.paused&&Y.pause(),d("paused")},[]),T=(0,s.useCallback)(()=>{Y&&Y.paused&&Y.currentTime>0&&Y.play(),d("playing")},[]),D=(0,s.useCallback)(e=>{let t=Math.max(.25,Math.min(4,e));m(t),X(t),f(!1),j(!1)},[]);(0,s.useEffect)(()=>{"playing"===c&&X(h)},[c,h]),(0,s.useEffect)(()=>{if(!p)return;let e=e=>{w.current&&!w.current.contains(e.target)&&y.current&&!y.current.contains(e.target)&&(f(!1),j(!1))},t=setTimeout(()=>window.addEventListener("mousedown",e),50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[p]);let E=(0,s.useCallback)(()=>{setTimeout(()=>{let e=window.getSelection();if(!e||e.isCollapsed)return;let t=e.toString().trim();if(!(t.length<3))try{let n=e.getRangeAt(0).getBoundingClientRect();N({text:t,x:n.left+n.width/2,y:n.top-8})}catch(e){}},10)},[]);(0,s.useEffect)(()=>{let e=()=>{if(z.current)return;let e=window.getSelection();e&&!e.isCollapsed&&e.toString().trim()||N(null)};return document.addEventListener("selectionchange",e),()=>document.removeEventListener("selectionchange",e)},[]);let P=(0,s.useCallback)(()=>{if(!k)return;let e=k.text;if(e.trim()){if(!H()){null==l||l(),N(null);return}z.current=!0,x(null),N(null),Z(e,M),setTimeout(()=>{z.current=!1},100)}},[k,l,M]);return((0,s.useEffect)(()=>()=>{$(),f(!1),N(null)},[]),t.description)?(0,W.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/40 backdrop-blur-sm",onClick:n,children:[(0,r.jsxs)("div",{className:"bg-white rounded-xl shadow-2xl w-[90vw] max-w-2xl max-h-[80vh] flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)("span",{className:"text-xs font-mono font-semibold text-emerald-600 shrink-0",children:t.id}),(0,r.jsx)("span",{className:"text-sm font-semibold text-zinc-900 truncate",children:t.title})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,r.jsx)("button",{onClick:()=>{t.description&&navigator.clipboard.writeText(F(t,i)).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",title:"Copy description",children:a?(0,r.jsx)("svg",{className:"w-4 h-4 text-emerald-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}):(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9.75a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"})})}),"loading"===c?(0,r.jsx)("button",{disabled:!0,className:"p-1 text-zinc-300 cursor-wait",title:"Loading audio...",children:(0,r.jsxs)("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:4}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):"playing"===c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:A,className:"p-1 text-emerald-500 hover:text-amber-500 hover:bg-amber-50 rounded transition-colors",title:"Pause",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25v13.5m-7.5-13.5v13.5"})})}),(0,r.jsx)("button",{onClick:L,className:"p-1 text-zinc-400 hover:text-red-500 hover:bg-red-50 rounded transition-colors",title:"Stop",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})})})]}):"paused"===c?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:T,className:"p-1 text-amber-500 hover:text-emerald-500 hover:bg-emerald-50 rounded transition-colors",title:"Resume",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 010 1.972l-11.54 6.347a1.125 1.125 0 01-1.667-.986V5.653z"})})}),(0,r.jsx)("button",{onClick:L,className:"p-1 text-zinc-400 hover:text-red-500 hover:bg-red-50 rounded transition-colors",title:"Stop",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})})})]}):(0,r.jsx)("button",{onClick:S,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",title:"Read aloud",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.009 9.009 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})})}),("playing"===c||"loading"===c||"paused"===c)&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("button",{ref:y,onClick:()=>f(e=>!e),className:"px-1.5 py-0.5 text-[11px] font-mono font-medium rounded text-zinc-500 hover:text-zinc-700 hover:bg-zinc-100 transition-colors",title:"Playback speed",children:1===h?"1x":"".concat(h,"x")}),p&&(0,r.jsxs)("div",{ref:w,className:"absolute right-0 top-full mt-1 bg-white border border-zinc-200 rounded-lg shadow-lg overflow-hidden z-[110]",style:{minWidth:150},onClick:e=>e.stopPropagation(),children:[Q.map(e=>(0,r.jsxs)("button",{onClick:()=>D(e.value),className:"w-full px-3 py-2 text-xs text-left flex items-center justify-between hover:bg-zinc-50 transition-colors ".concat(h===e.value?"text-emerald-600 font-medium":"text-zinc-700"),children:[(0,r.jsx)("span",{children:e.label}),h===e.value&&(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})]},e.value)),(0,r.jsx)("div",{className:"border-t border-zinc-100"}),b?(0,r.jsxs)("div",{className:"px-3 py-2 flex items-center gap-2",children:[(0,r.jsx)("input",{type:"number",min:.25,max:4,step:.25,value:g,onChange:e=>v(e.target.value),onKeyDown:e=>{if("Enter"===e.key){let e=parseFloat(g);!isNaN(e)&&e>=.25&&e<=4&&D(e)}"Escape"===e.key&&(j(!1),f(!1))},onBlur:()=>{let e=parseFloat(g);!isNaN(e)&&e>=.25&&e<=4?D(e):j(!1)},autoFocus:!0,className:"w-16 rounded border border-zinc-200 bg-zinc-50 px-2 py-1 text-xs text-zinc-900 focus:outline-none focus:ring-1 focus:ring-emerald-500"}),(0,r.jsx)("span",{className:"text-[11px] text-zinc-400",children:"x"})]}):(0,r.jsxs)("button",{onClick:()=>{j(!0),v(String(h))},className:"w-full px-3 py-2 text-xs text-left flex items-center justify-between hover:bg-zinc-50 transition-colors ".concat(Q.some(e=>e.value===h)?"text-zinc-700":"text-emerald-600 font-medium"),children:[(0,r.jsxs)("span",{children:["Custom",Q.some(e=>e.value===h)?"...":" (".concat(h,"x)")]}),!Q.some(e=>e.value===h)&&(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})]})]})]}),(0,r.jsx)("button",{onClick:n,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]}),u&&(0,r.jsxs)("div",{className:"px-5 py-2 text-xs text-red-500 bg-red-50 border-b border-red-100 flex items-center justify-between",children:[(0,r.jsx)("span",{children:u}),(0,r.jsx)("button",{onClick:()=>x(null),className:"text-red-400 hover:text-red-600 ml-2",children:(0,r.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto px-5 py-4 custom-scrollbar description-markdown text-sm text-zinc-700 leading-relaxed",onMouseUp:E,children:(0,r.jsx)(B.UG,{remarkPlugins:[I.Z],children:t.description})})]}),k&&(0,r.jsx)("div",{ref:C,className:"fixed z-[110] flex items-center gap-1.5 px-2.5 py-1.5 bg-zinc-800 text-white text-xs rounded-lg shadow-lg select-none",style:{left:k.x,top:k.y,transform:"translate(-50%, -100%)",pointerEvents:"auto"},onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:(0,r.jsxs)("button",{onClick:P,className:"flex items-center gap-1 hover:text-emerald-300 transition-colors",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.009 9.009 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}),(0,r.jsx)("span",{children:"Read aloud"})]})})]}),document.body):null}function et(e){let{className:t="w-3 h-3",filled:n=!1}=e;return n?(0,r.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M11.645 20.91l-.007-.003-.022-.012a15.247 15.247 0 01-.383-.218 25.18 25.18 0 01-4.244-3.17C4.688 15.36 2.25 12.174 2.25 8.25 2.25 5.322 4.714 3 7.688 3A5.5 5.5 0 0112 5.052 5.5 5.5 0 0116.313 3c2.973 0 5.437 2.322 5.437 5.25 0 3.925-2.438 7.111-4.739 9.256a25.175 25.175 0 01-4.244 3.17 15.247 15.247 0 01-.383.219l-.022.012-.007.004-.003.001a.752.752 0 01-.704 0l-.003-.001z"})}):(0,r.jsx)("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12z"})})}function en(e){let{node:t,allNodes:n,onNodeNavigate:i,comments:d,onPostComment:x,onDeleteComment:h,onLikeComment:f,onReplyComment:g,isAuthenticated:v,currentDid:b,repoUrls:j,onOpenSettings:y}=e,[w,k]=(0,s.useState)(null),[N,C]=(0,s.useState)(""),[z,M]=(0,s.useState)(!1),[S,L]=(0,s.useState)(!1),[A,T]=(0,s.useState)(!1),D=e=>{k(e.uri),C("")},E=()=>{k(null),C("")},W=async()=>{if(N.trim()&&w&&g){M(!0);try{let e=t=>{for(let n of t){if(n.uri===w)return n;let t=e(n.replies);if(t)return t}},t=d?e(d):void 0;t&&await g(t,N.trim()),k(null),C("")}catch(e){console.error("Failed to post reply:",e)}finally{M(!1)}}};if(!t)return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-zinc-100 flex items-center justify-center mb-4",children:(0,r.jsx)("svg",{className:"w-6 h-6 text-zinc-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"})})}),(0,r.jsx)("p",{className:"text-sm text-zinc-500 leading-relaxed",children:"Click a node to see details"}),(0,r.jsx)("p",{className:"text-xs text-zinc-400 mt-1",children:"Hover to highlight connections"})]});let P=u[t.issueType]||"\uD83D\uDCCB",R=l[t.status]||l.open,_=a[t.status]||t.status,O=o[t.priority]||"P".concat(t.priority),H=c[t.priority]||"#a1a1aa",U=m[t.prefix]||t.prefix,V=p[t.prefix]||"#a1a1aa",Y=null==j?void 0:j[t.prefix],q=t.blockerIds.map(e=>n.find(t=>t.id===e)).filter(Boolean),K=t.dependentIds.map(e=>n.find(t=>t.id===e)).filter(Boolean),X=e=>{try{let t=new Date(e),n=t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),r=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!1});return"".concat(n," at ").concat(r)}catch(t){return e}};return(0,r.jsxs)("div",{className:"animate-fade-in",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 mb-4",children:[(0,r.jsx)("span",{className:"text-2xl mt-0.5",children:P}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"text-xs font-mono font-semibold text-emerald-600",children:t.id})}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-zinc-900 mt-1 leading-snug",children:t.title})]})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2 mb-4",children:[(0,r.jsxs)("span",{className:"status-badge",style:{backgroundColor:R+"18",color:R,border:"1px solid ".concat(R,"30")},children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full mr-1.5",style:{backgroundColor:R}}),_]}),(0,r.jsx)("span",{className:"status-badge",style:{backgroundColor:H+"15",color:H,border:"1px solid ".concat(H,"25")},children:O}),Y?(0,r.jsxs)("a",{href:Y,target:"_blank",rel:"noopener noreferrer",className:"status-badge hover:opacity-80 transition-opacity",style:{backgroundColor:V+"15",color:V,border:"1px solid ".concat(V,"25"),textDecoration:"none"},children:[U,(0,r.jsx)("svg",{className:"w-2.5 h-2.5 ml-1 opacity-50",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})})]}):(0,r.jsx)("span",{className:"status-badge",style:{backgroundColor:V+"15",color:V,border:"1px solid ".concat(V,"25")},children:U})]}),Y&&(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsxs)("a",{href:Y,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-[11px] text-zinc-400 hover:text-zinc-600 transition-colors",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"currentColor",children:(0,r.jsx)("path",{d:"M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z"})}),Y.replace(/^https?:\/\//,"")]})}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[(0,r.jsx)(es,{label:"Blocks",value:t.blockerCount,color:t.blockerCount>0?"#f59e0b":void 0}),(0,r.jsx)(es,{label:"Blocked by",value:t.dependentCount,color:t.dependentCount>0?"#ef4444":void 0})]}),(0,r.jsxs)("div",{className:"space-y-1.5 mb-4 text-xs text-zinc-500",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Created"}),(0,r.jsx)("span",{className:"text-zinc-700 font-medium",children:X(t.createdAt)})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Updated"}),(0,r.jsx)("span",{className:"text-zinc-700 font-medium",children:X(t.updatedAt)})]}),t.closedAt&&(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Closed"}),(0,r.jsx)("span",{className:"text-zinc-700 font-medium",children:X(t.closedAt)})]}),t.closeReason&&(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Reason"}),(0,r.jsx)("span",{className:"text-zinc-700 font-medium truncate ml-2",children:t.closeReason})]}),t.owner&&(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Owner"}),(0,r.jsx)("span",{className:"text-zinc-700 font-medium truncate ml-2",children:t.owner})]})]}),t.description&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("h4",{className:"text-xs font-semibold text-zinc-500 uppercase tracking-wider",children:"Description"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:()=>{if(!t.description)return;let e=null==j?void 0:j[t.prefix];navigator.clipboard.writeText(F(t,e)).then(()=>{T(!0),setTimeout(()=>T(!1),1500)})},className:"text-zinc-400 hover:text-zinc-600 transition-colors",title:"Copy description",children:A?(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}):(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9.75a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"})})}),(0,r.jsx)("button",{onClick:()=>L(!0),className:"text-[10px] text-zinc-400 hover:text-zinc-600 transition-colors",children:"View in window"})]})]}),(0,r.jsx)("div",{className:"text-xs text-zinc-600 leading-relaxed bg-zinc-50 rounded-lg p-3 max-h-40 overflow-y-auto custom-scrollbar border border-zinc-100 description-markdown",children:(0,r.jsx)(B.UG,{remarkPlugins:[I.Z],children:t.description})})]}),S&&t.description&&(0,r.jsx)(ee,{node:t,onClose:()=>L(!1),repoUrl:null==j?void 0:j[t.prefix],onOpenSettings:y}),q.length>0&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 uppercase tracking-wider mb-2",children:["Blocks (",q.length,")"]}),(0,r.jsx)("div",{className:"space-y-1",children:q.map(e=>(0,r.jsx)(ei,{node:e,onClick:()=>i(e.id)},e.id))})]}),K.length>0&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 uppercase tracking-wider mb-2",children:["Blocked by (",K.length,")"]}),(0,r.jsx)("div",{className:"space-y-1",children:K.map(e=>(0,r.jsx)(ei,{node:e,onClick:()=>i(e.id)},e.id))})]}),(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("h4",{className:"text-xs font-semibold text-zinc-500 uppercase tracking-wider mb-2",children:["Comments"," ",d&&d.length>0&&(0,r.jsx)("span",{className:"ml-1 px-1.5 py-0.5 bg-emerald-50 text-emerald-600 rounded-full text-[10px] font-medium",children:d.length})]}),d&&d.length>0?(0,r.jsx)("div",{className:"space-y-1",children:d.map(e=>(0,r.jsx)(el,{comment:e,currentDid:b,isAuthenticated:v,onDelete:h,onLike:f,onStartReply:D,replyingToUri:w,replyText:N,onReplyTextChange:C,onSubmitReply:W,onCancelReply:E,isSubmittingReply:z,depth:0},e.uri))}):(0,r.jsx)("p",{className:"text-xs text-zinc-400 italic",children:"No comments yet"}),v&&x?(0,r.jsx)(ea,{onSubmit:x}):v?null:(0,r.jsx)("p",{className:"text-xs text-zinc-400 mt-2",children:"Sign in to leave a comment"})]})]})}function er(e){let{replyingTo:t,replyText:n,onTextChange:s,onSubmit:i,onCancel:l,isSubmitting:a}=e;return(0,r.jsxs)("div",{className:"mt-2 ml-4 pl-3 border-l border-emerald-200 space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] text-zinc-400",children:[(0,r.jsx)("span",{children:"Replying to"}),(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(t.did),target:"_blank",rel:"noopener noreferrer",className:"font-medium text-zinc-600 hover:text-emerald-600 transition-colors",children:t.displayName||t.handle})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("input",{type:"text",value:n,onChange:e=>s(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||i()},placeholder:"Write a reply...",disabled:a,autoFocus:!0,className:"flex-1 px-2 py-1 text-xs bg-white border border-zinc-200 rounded placeholder-zinc-400 focus:outline-none focus:border-emerald-400 disabled:opacity-50"}),(0,r.jsx)("button",{onClick:i,disabled:!n.trim()||a,className:"px-2 py-1 text-[10px] font-medium text-emerald-600 hover:text-emerald-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:a?"...":"Reply"}),(0,r.jsx)("button",{onClick:l,disabled:a,className:"px-2 py-1 text-[10px] text-zinc-400 hover:text-zinc-600 disabled:opacity-50 transition-colors",children:"Cancel"})]})]})}function es(e){let{label:t,value:n,color:s}=e;return(0,r.jsxs)("div",{className:"bg-zinc-50 rounded-lg p-3 border border-zinc-100",children:[(0,r.jsx)("div",{className:"text-xl font-bold",style:{color:s||"#3f3f46"},children:n}),(0,r.jsx)("div",{className:"text-[10px] text-zinc-400 uppercase tracking-wider mt-0.5",children:t})]})}function ei(e){let{node:t,onClick:n}=e,s=l[t.status]||l.open;return(0,r.jsxs)("button",{onClick:n,className:"w-full flex items-center gap-2 px-2.5 py-1.5 rounded-md hover:bg-zinc-50 transition-colors text-left group border border-transparent hover:border-zinc-200",children:[(0,r.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:s}}),(0,r.jsx)("span",{className:"text-xs font-mono text-emerald-600 group-hover:text-emerald-700 shrink-0",children:t.id}),(0,r.jsx)("span",{className:"text-xs text-zinc-500 truncate",children:t.title})]})}function el(e){let{comment:t,currentDid:n,isAuthenticated:i,onDelete:l,onLike:a,onStartReply:o,replyingToUri:c,replyText:d,onReplyTextChange:u,onSubmitReply:x,onCancelReply:h,isSubmittingReply:m,depth:p}=e,[f,g]=(0,s.useState)(!1),[v,b]=(0,s.useState)(!1),j=n&&n===t.did,y=!!n&&t.likes.some(e=>e.did===n),w=c===t.uri,k=async()=>{if(l&&!f){g(!0);try{await l(t)}catch(e){console.error("Failed to delete comment:",e)}finally{g(!1)}}},N=async()=>{if(a&&!v){b(!0);try{await a(t)}catch(e){console.error("Failed to toggle like:",e)}finally{b(!1)}}};return(0,r.jsxs)("div",{className:"".concat(p>0?"ml-4 pl-3 border-l border-zinc-100":""),children:[(0,r.jsxs)("div",{className:"py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,r.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 overflow-hidden",children:t.avatar?(0,r.jsx)("img",{src:t.avatar,alt:"",className:"w-full h-full object-cover"}):(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[8px] font-medium text-zinc-400",children:(t.handle||t.did).charAt(0).toUpperCase()})}),(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(t.did),target:"_blank",rel:"noopener noreferrer",className:"text-xs font-medium text-zinc-600 truncate hover:text-emerald-600 transition-colors",children:t.displayName||t.handle||t.did.slice(0,16)+"..."}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-300 shrink-0",children:P(t.createdAt)})]}),(0,r.jsx)("p",{className:"text-xs text-zinc-500 leading-relaxed whitespace-pre-wrap break-words",children:t.text}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px]",children:[(0,r.jsxs)("button",{onClick:N,disabled:!i||v,className:"flex items-center gap-0.5 transition-colors ".concat(y?"text-rose-500":"text-zinc-300 hover:text-rose-500"," disabled:opacity-50"),children:[(0,r.jsx)(et,{className:"w-3 h-3",filled:y}),t.likes.length>0&&(0,r.jsx)("span",{children:t.likes.length})]}),(0,r.jsx)("button",{onClick:()=>o(t),disabled:!i,className:"transition-colors disabled:opacity-50 ".concat(w?"text-emerald-500":"text-zinc-300 hover:text-zinc-500"),children:"reply"}),j&&l&&(0,r.jsx)("button",{onClick:k,disabled:f,className:"ml-auto shrink-0 text-zinc-300 hover:text-red-400 disabled:opacity-50 transition-colors",children:f?"...":"delete"})]})]}),w&&(0,r.jsx)(er,{replyingTo:t,replyText:d,onTextChange:u,onSubmit:x,onCancel:h,isSubmitting:m}),t.replies.length>0&&(0,r.jsx)("div",{children:t.replies.map(e=>(0,r.jsx)(el,{comment:e,currentDid:n,isAuthenticated:i,onDelete:l,onLike:a,onStartReply:o,replyingToUri:c,replyText:d,onReplyTextChange:u,onSubmitReply:x,onCancelReply:h,isSubmittingReply:m,depth:p+1},e.uri))})]})}function ea(e){let{onSubmit:t}=e,[n,i]=(0,s.useState)(""),[l,a]=(0,s.useState)(!1),o=async()=>{if(n.trim()&&!l){a(!0);try{await t(n.trim()),i("")}catch(e){console.error("Failed to post comment:",e)}finally{a(!1)}}};return(0,r.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,r.jsx)("textarea",{value:n,onChange:e=>i(e.target.value),placeholder:"Leave a comment...",rows:2,className:"w-full px-2.5 py-1.5 text-xs border border-zinc-200 rounded-md bg-zinc-50 text-zinc-700 placeholder-zinc-400 resize-none focus:outline-none focus:ring-1 focus:ring-emerald-500 focus:border-emerald-500"}),(0,r.jsx)("button",{onClick:o,disabled:!n.trim()||l,className:"px-3 py-1 text-xs font-medium text-white bg-emerald-500 rounded-md hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l?"Sending...":"Comment"})]})}var eo=n(7796);function ec(){let{isAuthenticated:e,isLoading:t,session:n,login:i,logout:l}=(0,eo.a)(),[a,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)(!1),[u,x]=(0,s.useState)(""),[h,m]=(0,s.useState)(!1),[p,f]=(0,s.useState)(""),g=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(!c)return;let e=e=>{g.current&&!g.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]);let v=async e=>{if(e.preventDefault(),u.trim()){m(!0),f("");try{await i(u.trim())}catch(e){f(e instanceof Error?e.message:"Login failed"),m(!1)}}},b=async()=>{d(!1),await l()};return t?(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border-2 border-zinc-200 border-t-zinc-400 animate-spin"}):e&&n?(0,r.jsxs)("div",{className:"relative",ref:g,children:[(0,r.jsxs)("button",{onClick:()=>d(e=>!e),className:"flex items-center gap-2 px-3 py-1.5 rounded-full hover:bg-zinc-50 transition-colors cursor-pointer",children:[n.avatar?(0,r.jsx)("img",{src:n.avatar,alt:n.handle,width:24,height:24,className:"rounded-full"}):(0,r.jsx)("div",{className:"w-6 h-6 rounded-full bg-emerald-100 flex items-center justify-center text-[11px] text-emerald-700 font-medium",children:(n.displayName||n.handle).charAt(0).toUpperCase()}),(0,r.jsx)("span",{className:"text-sm text-zinc-600 max-w-[100px] truncate",children:n.displayName||n.handle})]}),c&&(0,r.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-44 bg-white rounded-xl shadow-xl border border-zinc-100 py-2 z-50",children:[(0,r.jsxs)("a",{href:n.did?"https://www.impactindexer.org/data?did=".concat(n.did):"#",target:"_blank",rel:"noopener noreferrer",className:"block px-3 py-1.5 text-xs text-zinc-400 truncate hover:text-emerald-600 transition-colors",children:["@",n.handle]}),(0,r.jsx)("div",{className:"h-px bg-zinc-100 my-1"}),(0,r.jsxs)("button",{onClick:b,className:"flex items-center gap-2 w-full px-3 py-1.5 text-xs text-zinc-600 hover:bg-zinc-50 transition-colors cursor-pointer",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15m-3 0-3-3m0 0 3-3m-3 3H15"})}),"Sign out"]})]})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>o(!0),className:"px-4 py-1.5 text-sm font-medium text-zinc-600 rounded-full hover:text-zinc-900 hover:bg-zinc-50 transition-colors cursor-pointer whitespace-nowrap",children:"Sign in"}),a&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[20vh]",onClick:()=>o(!1),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/20 backdrop-blur-sm"}),(0,r.jsxs)("div",{className:"relative w-full max-w-sm mx-4 bg-white rounded-xl shadow-lg border border-zinc-200 p-6",onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 mb-1",children:"Sign in with ATProto"}),(0,r.jsx)("p",{className:"text-sm text-zinc-400 mb-5",children:"Enter your Bluesky handle to connect."}),(0,r.jsxs)("form",{onSubmit:v,children:[(0,r.jsx)("label",{htmlFor:"auth-handle",className:"block text-sm text-zinc-600 mb-1.5",children:"Handle"}),(0,r.jsx)("input",{id:"auth-handle",type:"text",value:u,onChange:e=>x(e.target.value),placeholder:"alice.bsky.social",disabled:h,autoFocus:!0,className:"w-full px-3 py-2 text-sm bg-white border border-zinc-200 rounded-lg placeholder:text-zinc-300 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-400 disabled:opacity-50 disabled:cursor-not-allowed"}),(0,r.jsx)("p",{className:"text-xs text-zinc-300 mt-1.5",children:"Just a username? We'll add .bsky.social for you."}),p&&(0,r.jsx)("p",{className:"text-sm text-red-500 mt-2",children:p}),(0,r.jsxs)("div",{className:"flex gap-2 mt-5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>o(!1),disabled:h,className:"flex-1 px-3 py-2 text-sm text-zinc-600 bg-zinc-50 rounded-lg hover:bg-zinc-100 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),(0,r.jsx)("button",{type:"submit",disabled:h||!u.trim(),className:"flex-1 px-3 py-2 text-sm text-white bg-emerald-600 rounded-lg hover:bg-emerald-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:h?"Connecting...":"Connect"})]})]})]})]})]})}function ed(e){let{className:t}=e;return(0,r.jsxs)("svg",{viewBox:"0 0 32 32",fill:"none",className:t,"aria-hidden":"true",children:[(0,r.jsx)("polygon",{points:"16,3 27,9.5 27,22.5 16,29 5,22.5 5,9.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none",opacity:"0.7",strokeLinejoin:"round",children:(0,r.jsx)("animateTransform",{attributeName:"transform",type:"rotate",values:"0 16 16;360 16 16",dur:"40s",repeatCount:"indefinite"})}),(0,r.jsx)("polygon",{points:"16,8 22.5,11.5 22.5,20.5 16,24 9.5,20.5 9.5,11.5",stroke:"currentColor",strokeWidth:"0.8",fill:"none",opacity:"0.35",strokeLinejoin:"round",children:(0,r.jsx)("animateTransform",{attributeName:"transform",type:"rotate",values:"360 16 16;0 16 16",dur:"30s",repeatCount:"indefinite"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"16",y2:"3",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"27",y2:"9.5",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite",begin:"0.5s"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"27",y2:"22.5",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite",begin:"1s"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"16",y2:"29",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite",begin:"1.5s"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"5",y2:"22.5",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite",begin:"2s"})}),(0,r.jsx)("line",{x1:"16",y1:"16",x2:"5",y2:"9.5",stroke:"currentColor",strokeWidth:"0.6",opacity:"0.2",children:(0,r.jsx)("animate",{attributeName:"opacity",values:"0.15;0.35;0.15",dur:"3s",repeatCount:"indefinite",begin:"2.5s"})}),(0,r.jsxs)("circle",{cx:"16",cy:"16",r:"2.5",fill:"currentColor",opacity:"0.8",children:[(0,r.jsx)("animate",{attributeName:"r",values:"2;3;2",dur:"3s",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.7;1;0.7",dur:"3s",repeatCount:"indefinite"})]}),(0,r.jsxs)("circle",{cx:"16",cy:"3",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite"})]}),(0,r.jsxs)("circle",{cx:"27",cy:"9.5",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite",begin:"0.4s"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite",begin:"0.4s"})]}),(0,r.jsxs)("circle",{cx:"27",cy:"22.5",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite",begin:"0.8s"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite",begin:"0.8s"})]}),(0,r.jsxs)("circle",{cx:"16",cy:"29",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite",begin:"1.2s"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite",begin:"1.2s"})]}),(0,r.jsxs)("circle",{cx:"5",cy:"22.5",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite",begin:"1.6s"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite",begin:"1.6s"})]}),(0,r.jsxs)("circle",{cx:"5",cy:"9.5",r:"1.5",fill:"currentColor",opacity:"0.5",children:[(0,r.jsx)("animate",{attributeName:"r",values:"1.2;2;1.2",dur:"2.5s",repeatCount:"indefinite",begin:"2s"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.4;0.7;0.4",dur:"2.5s",repeatCount:"indefinite",begin:"2s"})]}),(0,r.jsxs)("circle",{cx:"16",cy:"16",r:"10",stroke:"currentColor",strokeWidth:"0.4",fill:"none",opacity:"0.15",children:[(0,r.jsx)("animate",{attributeName:"r",values:"9;11;9",dur:"4s",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"4s",repeatCount:"indefinite"})]})]})}function eu(e){var t;let{node:n,x:i,y:l,onClose:a,onSubmit:o,isAuthenticated:c,existingComments:d}=e,[u,x]=(0,s.useState)(""),[h,m]=(0,s.useState)(!1),f=(0,s.useRef)(null),g=(0,s.useRef)(null),[v,b]=(0,s.useState)({x:0,y:0}),[j,y]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!f.current)return;let e=f.current.getBoundingClientRect(),t=window.innerWidth,n=window.innerHeight,r=i+14,s=l-e.height-14;r+e.width>t-16&&(r=t-e.width-16),r<16&&(r=16),s<16&&(s=l+28),s+e.height>n-16&&(s=n-e.height-16),b({x:r,y:s}),y(!0)},[i,l]),(0,s.useEffect)(()=>{if(c){let e=setTimeout(()=>{var e;return null===(e=g.current)||void 0===e?void 0:e.focus()},100);return()=>clearTimeout(e)}},[c]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&a()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a]),(0,s.useEffect)(()=>{let e=e=>{f.current&&!f.current.contains(e.target)&&a()},t=setTimeout(()=>{window.addEventListener("mousedown",e)},50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[a]);let w=(0,s.useCallback)(async()=>{if(u.trim()&&!h){m(!0);try{await o(u.trim()),x("")}catch(e){console.error("Failed to post comment:",e)}finally{m(!1)}}},[u,h,o]),k=(0,s.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),w())},[w]),N=p[n.prefix]||"#a1a1aa",C=(null==d?void 0:d.length)||0;return(0,r.jsxs)("div",{ref:f,style:{position:"fixed",left:v.x,top:v.y,width:320,zIndex:100,opacity:j?1:0,transform:j?"translateY(0)":"translateY(4px)",transition:"opacity 0.2s ease, transform 0.2s ease"},className:"bg-white border border-zinc-200 rounded-lg overflow-hidden",onContextMenu:e=>e.preventDefault(),children:[(0,r.jsx)("style",{children:"\n .comment-tooltip-shadow {\n box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.08);\n }\n "}),(0,r.jsxs)("div",{className:"comment-tooltip-shadow p-[18px_20px]",children:[(0,r.jsx)("div",{className:"rounded-sm mb-2.5",style:{width:24,height:2,background:N,opacity:.6}}),(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("span",{className:"text-xs font-mono text-emerald-600",children:n.id}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-zinc-800 leading-tight mt-0.5",children:n.title})]}),C>0&&d&&(0,r.jsxs)("div",{className:"mb-3 pb-3 border-b border-zinc-100",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-blue-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"})}),(0,r.jsxs)("span",{className:"text-[10px] font-medium text-zinc-500 uppercase tracking-wider",children:[C," comment",1!==C?"s":""]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[d.slice(0,2).map(e=>(0,r.jsxs)("div",{className:"flex gap-1.5",children:[(0,r.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 overflow-hidden mt-0.5",children:e.avatar?(0,r.jsx)("img",{src:e.avatar,alt:"",className:"w-full h-full object-cover"}):(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[7px] font-medium text-zinc-400",children:(e.handle||e.did).charAt(0).toUpperCase()})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(e.did),target:"_blank",rel:"noopener noreferrer",className:"text-[10px] font-medium text-zinc-500 hover:text-emerald-600 transition-colors",children:e.displayName||e.handle}),(0,r.jsx)("p",{className:"text-[11px] text-zinc-500 line-clamp-2 leading-tight",children:e.text})]})]},e.uri)),C>2&&(0,r.jsxs)("p",{className:"text-[10px] text-zinc-400 italic",children:["+",C-2," more — see detail panel"]})]})]}),c?(0,r.jsxs)("div",{children:[(0,r.jsx)("textarea",{ref:g,value:u,onChange:e=>x(e.target.value),onKeyDown:k,placeholder:"Leave a comment...",rows:3,className:"w-full px-2.5 py-2 text-xs border border-zinc-200 rounded-md bg-zinc-50 text-zinc-700 placeholder-zinc-400 resize-none focus:outline-none focus:ring-1 focus:ring-emerald-500 focus:border-emerald-500"}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,r.jsxs)("span",{className:"text-[10px] text-zinc-300",children:["undefined"!=typeof navigator&&(null===(t=navigator.platform)||void 0===t?void 0:t.includes("Mac"))?"⌘":"Ctrl","+Enter to send"]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:a,className:"px-2.5 py-1 text-[11px] text-zinc-400 hover:text-zinc-600 transition-colors",children:"Cancel"}),(0,r.jsx)("button",{onClick:w,disabled:!u.trim()||h,className:"px-3 py-1 text-[11px] font-medium text-white bg-emerald-500 rounded-md hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:h?(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsxs)("svg",{className:"w-3 h-3 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Sending"]}):"Send"})]})]})]}):(0,r.jsxs)("div",{className:"text-center py-3",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-zinc-300 mx-auto mb-1.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})}),(0,r.jsx)("p",{className:"text-xs text-zinc-400",children:"Sign in to comment"})]})]})]})}function ex(e){let{node:t,x:n,y:i,onShowDescription:l,onAddComment:a,onClaimTask:o,onUnclaimTask:c,onCollapseEpic:d,onUncollapseEpic:u,onFocusEpic:x,onExitFocusEpic:h,onClose:m}=e,p=(0,s.useRef)(null),[f,g]=(0,s.useState)({x:0,y:0}),[v,b]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(!p.current)return;let e=p.current.getBoundingClientRect(),t=window.innerWidth,r=window.innerHeight,s=n+4,l=i+4;s+e.width>t-16&&(s=t-e.width-16),s<16&&(s=16),l+e.height>r-16&&(l=r-e.height-16),l<16&&(l=16),g({x:s,y:l}),b(!0)},[n,i]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&m()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[m]),(0,s.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&m()},t=setTimeout(()=>window.addEventListener("mousedown",e),50);return()=>{clearTimeout(t),window.removeEventListener("mousedown",e)}},[m]),(0,r.jsx)("div",{ref:p,style:{position:"fixed",left:f.x,top:f.y,zIndex:100,opacity:v?1:0,transform:v?"translateY(0)":"translateY(2px)",transition:"opacity 0.15s ease, transform 0.15s ease"},onContextMenu:e=>e.preventDefault(),children:(0,r.jsxs)("div",{className:"bg-white border border-zinc-200 rounded-lg overflow-hidden",style:{minWidth:180,boxShadow:"0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06)"},children:[t.description&&(0,r.jsxs)("button",{onClick:l,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors border-b border-zinc-100",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),"Show description"]}),(0,r.jsxs)("button",{onClick:a,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors".concat(o||c||d||u||x||h?" border-b border-zinc-100":""),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 20.25c4.97 0 9-3.694 9-8.25s-4.03-8.25-9-8.25S3 7.444 3 12c0 2.104.859 4.023 2.273 5.48.432.447.74 1.04.586 1.641a4.483 4.483 0 01-.923 1.785A5.969 5.969 0 006 21c1.282 0 2.47-.402 3.445-1.087.81.22 1.668.337 2.555.337z"})}),"Add comment"]}),o&&(0,r.jsxs)("button",{onClick:o,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors".concat(d||u||x||h?" border-b border-zinc-100":""),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),"Claim task"]}),c&&(0,r.jsxs)("button",{onClick:c,className:"w-full px-3 py-2.5 text-xs text-red-500 hover:bg-red-50 flex items-center gap-2 transition-colors".concat(d||u||x||h?" border-b border-zinc-100":""),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-red-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M22 10.5h-6m-2.25-4.125a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zM4 19.235v-.11a6.375 6.375 0 0112.75 0v.109A12.318 12.318 0 0110.374 21c-2.331 0-4.512-.645-6.374-1.766z"})}),"Unclaim task"]}),d&&(0,r.jsxs)("button",{onClick:d,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors".concat(x||h?" border-b border-zinc-100":""),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})}),"Collapse epic"]}),u&&(0,r.jsxs)("button",{onClick:u,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors".concat(x||h?" border-b border-zinc-100":""),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Uncollapse epic"]}),x&&(0,r.jsxs)("button",{onClick:x,className:"w-full px-3 py-2.5 text-xs text-zinc-700 hover:bg-zinc-50 flex items-center gap-2 transition-colors",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-zinc-400",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5M16.5 20.25H18A2.25 2.25 0 0020.25 18v-1.5M7.5 20.25H6A2.25 2.25 0 013.75 18v-1.5"})}),"Focus on epic"]}),h&&(0,r.jsxs)("button",{onClick:h,className:"w-full px-3 py-2.5 text-xs text-emerald-600 hover:bg-emerald-50 flex items-center gap-2 transition-colors",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 text-emerald-500",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})}),"Show full graph"]})]})})}let eh={bg:"#FFFFFF",border:"#E5E7EB",borderLight:"#F3F4F6",shadow:"rgba(0,0,0,0.08)",text:"#131316",textMuted:"#737680",textDim:"#7F818B"};function em(e){let{node:t,x:n,y:i,prefixColor:l,allNodes:a}=e,d=(0,s.useRef)(null),[u,h]=(0,s.useState)({x:0,y:0});(0,s.useEffect)(()=>{if(!d.current)return;let e=d.current.getBoundingClientRect(),t=n+14,r=i-e.height-14;t+e.width>window.innerWidth-16&&(t=n-e.width-14),t<16&&(t=16),r<16&&(r=i+14+8),r+e.height>window.innerHeight-16&&(r=window.innerHeight-e.height-16),h({x:t,y:r})},[n,i]);let m=t.dependentIds.map(e=>{let t=a.find(t=>t.id===e);return t?{id:e,title:t.title}:{id:e,title:e}}).filter(Boolean),p=o[t.priority]||"P".concat(t.priority),f=c[t.priority]||"#a1a1aa";return(0,r.jsxs)("div",{ref:d,className:"bead-tooltip",style:{position:"fixed",left:u.x,top:u.y,width:280,zIndex:100,pointerEvents:"none",background:eh.bg,border:"1px solid ".concat(eh.border),boxShadow:"0 8px 32px ".concat(eh.shadow,", 0 2px 8px ").concat(eh.shadow),borderRadius:8,padding:"16px 18px",animation:"beadTooltipFade 0.2s ease"},children:[(0,r.jsx)("div",{style:{width:24,height:2,background:l,opacity:.5,marginBottom:8,borderRadius:1}}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[(0,r.jsx)("span",{style:{fontSize:10,fontWeight:600,color:l,letterSpacing:.5,textTransform:"uppercase"},children:x(t.prefix)}),(0,r.jsx)("span",{style:{fontSize:10,fontFamily:"monospace",color:eh.textDim},children:t.id})]}),(0,r.jsx)("div",{style:{fontSize:14,fontWeight:600,color:eh.text,lineHeight:1.25,marginBottom:12,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:t.title}),(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:ep,children:"Created"}),(0,r.jsx)("div",{style:ef,children:P(t.createdAt)})]}),t.owner&&(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:ep,children:"Owner"}),(0,r.jsx)("div",{style:ef,children:t.owner})]}),(t.assignee||t.createdBy)&&(0,r.jsxs)("div",{children:[t.assignee&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:ep,children:"Assignee"}),(0,r.jsx)("div",{style:ef,children:t.assignee})]}),t.createdBy&&!t.assignee&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:ep,children:"Created by"}),(0,r.jsx)("div",{style:ef,children:t.createdBy})]}),t.createdBy&&t.assignee&&t.createdBy!==t.assignee&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{...ep,marginTop:4},children:"Created by"}),(0,r.jsx)("div",{style:ef,children:t.createdBy})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:ep,children:"Blocked by"}),0===m.length?(0,r.jsx)("div",{style:{...ef,color:"#10b981"},children:"None"}):(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:3},children:m.map(e=>(0,r.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,r.jsx)("span",{style:{fontSize:10,fontFamily:"monospace",color:eh.textDim,flexShrink:0},children:e.id}),(0,r.jsx)("span",{style:{fontSize:12,color:eh.textMuted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]},e.id))})]}),(0,r.jsxs)("div",{style:{borderTop:"1px solid ".concat(eh.borderLight),paddingTop:8},children:[(0,r.jsx)("div",{style:ep,children:"Priority"}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,r.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:f,flexShrink:0}}),(0,r.jsx)("span",{style:ef,children:p})]})]})]})]})}let ep={fontSize:10,fontWeight:600,letterSpacing:1.5,textTransform:"uppercase",color:"#7F818B",marginBottom:3},ef={fontSize:12,color:"#737680",lineHeight:1.45};function eg(e){let{isOpen:t,onClose:n,allComments:s,onNodeNavigate:i,isAuthenticated:l,currentDid:a,onLikeComment:o,onDeleteComment:c}=e;return(0,r.jsxs)("aside",{className:"hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white border-l border-zinc-200 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ".concat(t?"translate-x-0":"translate-x-full"),children:[(0,r.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"All Comments"}),s.length>0&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 text-emerald-600 rounded-full text-[10px] font-medium",children:s.length})]}),(0,r.jsx)("button",{onClick:n,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors rounded-full hover:bg-zinc-100",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-5 py-3",children:s.length>0?(0,r.jsx)("div",{className:"space-y-0",children:s.filter(e=>!e.replyTo).map(e=>(0,r.jsx)(ev,{comment:e,currentDid:a,isAuthenticated:l,onNodeNavigate:i,onLike:o,onDelete:c,depth:0},e.uri))}):(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)("svg",{className:"w-8 h-8 text-zinc-200 mb-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 011.037-.443 48.282 48.282 0 005.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),(0,r.jsx)("p",{className:"text-xs text-zinc-400",children:"No comments yet"}),(0,r.jsx)("p",{className:"text-[10px] text-zinc-300 mt-1",children:"Right-click a node to leave a comment"})]})}),(0,r.jsx)("div",{className:"shrink-0 px-5 py-2.5 border-t border-zinc-100 bg-zinc-50/50",children:(0,r.jsxs)("div",{className:"text-[10px] text-zinc-400",children:[s.length," comment",1!==s.length?"s":""," across all issues"]})})]})}function ev(e){let{comment:t,currentDid:n,isAuthenticated:i,onNodeNavigate:l,onLike:a,onDelete:o,depth:c}=e,[d,u]=(0,s.useState)(!1),[x,h]=(0,s.useState)(!1),m=n&&n===t.did,p=!!n&&t.likes.some(e=>e.did===n),f=async()=>{if(a&&!d){u(!0);try{await a(t)}catch(e){console.error("Failed to toggle like:",e)}finally{u(!1)}}},g=async()=>{if(o&&!x){h(!0);try{await o(t)}catch(e){console.error("Failed to delete comment:",e)}finally{h(!1)}}};return(0,r.jsxs)("div",{className:"".concat(c>0?"ml-4 pl-3 border-l border-zinc-100":""),children:[(0,r.jsxs)("div",{className:"py-3 ".concat(0===c?"border-b border-zinc-50":""),children:[0===c&&(0,r.jsx)("button",{onClick:()=>l(t.nodeId),className:"inline-flex items-center px-1.5 py-0.5 mb-1.5 rounded text-[10px] font-mono bg-emerald-50 text-emerald-600 hover:bg-emerald-100 transition-colors",children:t.nodeId}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,r.jsx)("div",{className:"shrink-0 w-4 h-4 rounded-full bg-zinc-100 overflow-hidden",children:t.avatar?(0,r.jsx)("img",{src:t.avatar,alt:"",className:"w-full h-full object-cover"}):(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center text-[8px] font-medium text-zinc-400",children:(t.handle||t.did).charAt(0).toUpperCase()})}),(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(t.did),target:"_blank",rel:"noopener noreferrer",className:"text-xs font-medium text-zinc-600 truncate hover:text-emerald-600 transition-colors",children:t.displayName||t.handle||t.did.slice(0,16)+"..."}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-300 shrink-0",children:P(t.createdAt)})]}),(0,r.jsx)("p",{className:"text-xs text-zinc-500 leading-relaxed whitespace-pre-wrap break-words",children:t.text}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-[10px]",children:[(0,r.jsxs)("button",{onClick:f,disabled:!i||d,className:"flex items-center gap-0.5 transition-colors ".concat(p?"text-rose-500":"text-zinc-300 hover:text-rose-500"," disabled:opacity-50"),children:[(0,r.jsx)(et,{className:"w-3 h-3",filled:p}),t.likes.length>0&&(0,r.jsx)("span",{children:t.likes.length})]}),m&&o&&(0,r.jsx)("button",{onClick:g,disabled:x,className:"ml-auto text-zinc-300 hover:text-red-400 disabled:opacity-50 transition-colors",children:x?"...":"delete"})]})]}),t.replies.length>0&&(0,r.jsx)("div",{children:t.replies.map(e=>(0,r.jsx)(ev,{comment:e,currentDid:n,isAuthenticated:i,onNodeNavigate:l,onLike:a,onDelete:o,depth:c+1},e.uri))})]})}function eb(e){let{type:t,className:n}=e,s=n||"w-3.5 h-3.5 shrink-0";switch(t){case"node-created":return(0,r.jsxs)("svg",{className:"".concat(s," text-emerald-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("line",{x1:"8",y1:"5",x2:"8",y2:"11"}),(0,r.jsx)("line",{x1:"5",y1:"8",x2:"11",y2:"8"})]});case"node-closed":return(0,r.jsxs)("svg",{className:"".concat(s," text-zinc-400"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("polyline",{points:"5.5,8 7.5,10 10.5,6"})]});case"node-status-changed":return(0,r.jsx)("svg",{className:"".concat(s," text-amber-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)("path",{d:"M3 8h10M10 5l3 3-3 3"})});case"node-priority-changed":return(0,r.jsx)("svg",{className:"".concat(s," text-amber-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)("path",{d:"M8 3v7M5 6l3-3 3 3M4 13h8"})});case"node-title-changed":return(0,r.jsx)("svg",{className:"".concat(s," text-amber-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)("path",{d:"M3 4h10M3 8h6M3 12h8"})});case"node-owner-changed":return(0,r.jsxs)("svg",{className:"".concat(s," text-amber-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"6",cy:"6",r:"2.5"}),(0,r.jsx)("path",{d:"M1.5 13c0-2 1.8-3.5 4.5-3.5M10 9l2 2 3-3"})]});case"link-added":return(0,r.jsx)("svg",{className:"".concat(s," text-blue-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)("path",{d:"M6.5 9.5l3-3M4 11a2.5 2.5 0 003.5 0l1-1M8.5 6a2.5 2.5 0 013.5 0l0 0"})});case"link-removed":return(0,r.jsxs)("svg",{className:"".concat(s," text-red-400"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("path",{d:"M4 11a2.5 2.5 0 003.5 0l1-1M8.5 6a2.5 2.5 0 013.5 0l0 0"}),(0,r.jsx)("line",{x1:"3",y1:"3",x2:"13",y2:"13",strokeWidth:"1.5"})]});case"comment-added":case"reply-added":return(0,r.jsx)("svg",{className:"".concat(s," text-blue-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,r.jsx)("path",{d:"M2 4.5a1.5 1.5 0 011.5-1.5h9A1.5 1.5 0 0114 4.5v5a1.5 1.5 0 01-1.5 1.5H5L2 14V4.5z"})});case"task-claimed":return(0,r.jsxs)("svg",{className:"".concat(s," text-emerald-500"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"5.5",r:"2.5"}),(0,r.jsx)("path",{d:"M3 13.5c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5"})]});case"task-unclaimed":return(0,r.jsxs)("svg",{className:"".concat(s," text-red-400"),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"5.5",r:"2.5"}),(0,r.jsx)("path",{d:"M3 13.5c0-2.5 2.2-4.5 5-4.5s5 2 5 4.5"}),(0,r.jsx)("line",{x1:"11",y1:"3",x2:"13",y2:"5"})]});case"like-added":return(0,r.jsx)("svg",{className:"".concat(s," text-rose-400"),viewBox:"0 0 16 16",fill:"currentColor",children:(0,r.jsx)("path",{d:"M8 13.7l-.6-.5C4 10.2 2 8.3 2 6a3 3 0 016-1 3 3 0 016 1c0 2.3-2 4.2-5.4 7.2l-.6.5z"})})}}function ej(e){switch(e){case"node-created":case"task-claimed":return"bg-emerald-400";case"node-closed":return"bg-zinc-300";case"node-status-changed":case"node-priority-changed":case"node-title-changed":case"node-owner-changed":return"bg-amber-400";case"link-added":case"comment-added":case"reply-added":return"bg-blue-400";case"link-removed":case"task-unclaimed":return"bg-red-300";case"like-added":return"bg-rose-300"}}function ey(e){var t,n,r;switch(e.type){case"node-created":{let n=(null===(t=e.meta)||void 0===t?void 0:t.issueType)||"task";return"".concat(n," created")}case"node-closed":return"closed".concat(e.detail&&"Closed"!==e.detail?" (".concat(e.detail,")"):"");case"node-status-changed":return e.detail||"status changed";case"node-priority-changed":return"priority ".concat(e.detail||"changed");case"node-title-changed":return"title updated";case"node-owner-changed":return"owner ".concat(e.detail||"changed");case"link-added":return"dep added: ".concat((null===(n=e.meta)||void 0===n?void 0:n.target)||"");case"link-removed":return"dep removed: ".concat((null===(r=e.meta)||void 0===r?void 0:r.target)||"");case"comment-added":return e.detail||"commented";case"reply-added":return e.detail||"replied";case"task-claimed":return"claimed this task";case"task-unclaimed":return"unclaimed this task";case"like-added":return e.detail||"liked a comment"}}function ew(e){let{event:t,onNodeClick:n}=e;return(0,r.jsxs)("div",{className:"flex items-center gap-2 py-2 px-3 group hover:bg-zinc-50/60 transition-colors",children:[(0,r.jsx)("div",{className:"w-1 h-1 rounded-full shrink-0 ".concat(ej(t.type))}),(0,r.jsx)(eb,{type:t.type,className:"w-3 h-3 shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 text-[11px] text-zinc-600 truncate",children:[t.actor?(0,r.jsxs)(r.Fragment,{children:[t.actor.did?(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(t.actor.did),target:"_blank",rel:"noopener noreferrer",className:"font-medium text-zinc-800 hover:text-emerald-600 transition-colors",children:t.actor.handle.split(".")[0]}):(0,r.jsx)("span",{className:"font-medium text-zinc-800",children:t.actor.handle.split(".")[0]})," "]}):n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>n(t.nodeId),className:"font-medium text-zinc-700 hover:text-emerald-600 transition-colors",children:t.nodeId})," "]}):null,(0,r.jsx)("span",{className:"text-zinc-500",children:ey(t)})]}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-400 shrink-0 tabular-nums opacity-0 group-hover:opacity-100 transition-opacity",children:P(new Date(t.time).toISOString())})]})}function ek(e){var t;let{event:n,onNodeClick:s}=e;return(0,r.jsxs)("div",{className:"flex gap-3 py-3 px-4 hover:bg-zinc-50/50 transition-colors group",children:[(0,r.jsx)("div",{className:"w-0.5 self-stretch rounded-full shrink-0 ".concat(ej(n.type))}),(0,r.jsx)("div",{className:"mt-0.5 shrink-0",children:(null===(t=n.actor)||void 0===t?void 0:t.avatar)?(0,r.jsx)("img",{src:n.actor.avatar,alt:n.actor.handle,className:"w-7 h-7 rounded-full ring-1 ring-zinc-100"}):n.actor?(0,r.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-100 flex items-center justify-center text-[11px] font-medium text-zinc-500",children:n.actor.handle.charAt(0).toUpperCase()}):(0,r.jsx)("div",{className:"w-7 h-7 rounded-full bg-zinc-50 flex items-center justify-center",children:(0,r.jsx)(eb,{type:n.type,className:"w-3.5 h-3.5"})})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-baseline gap-1.5 text-[12px] leading-snug",children:[n.actor&&(n.actor.did?(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(n.actor.did),target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-zinc-800 hover:text-emerald-600 transition-colors truncate max-w-[140px]",children:n.actor.handle.split(".")[0]}):(0,r.jsx)("span",{className:"font-semibold text-zinc-800 truncate max-w-[140px]",children:n.actor.handle.split(".")[0]})),(0,r.jsx)("span",{className:"text-zinc-500",children:ey(n)})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[s&&(0,r.jsx)("button",{onClick:()=>s(n.nodeId),className:"inline-flex items-center px-1.5 py-0.5 text-[10px] font-mono font-medium text-emerald-700 bg-emerald-50 rounded-md hover:bg-emerald-100 transition-colors",children:n.nodeId}),n.nodeTitle&&(0,r.jsx)("span",{className:"text-[11px] text-zinc-400 truncate",children:n.nodeTitle})]})]}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-400 shrink-0 tabular-nums mt-0.5",children:P(new Date(n.time).toISOString())})]})}function eN(e){let{event:t,variant:n="compact",onNodeClick:s}=e;return"compact"===n?(0,r.jsx)(ew,{event:t,onNodeClick:s}):(0,r.jsx)(ek,{event:t,onNodeClick:s})}function eC(e){let{events:t,collapsed:n,onToggleCollapse:s,onExpandPanel:i,onNodeClick:l}=e,a=t.filter(e=>Date.now()-e.time<3e5).length;return n?(0,r.jsxs)("button",{onClick:s,className:"group flex items-center gap-2 px-3 py-2 bg-white/90 backdrop-blur-sm rounded-full border border-zinc-200/80 shadow-sm hover:bg-white hover:shadow-md transition-all",title:"Show activity feed",children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5 text-zinc-400 group-hover:text-emerald-500 transition-colors",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,r.jsx)("span",{className:"text-xs text-zinc-500 group-hover:text-zinc-700 transition-colors",children:"Activity"}),a>0&&(0,r.jsx)("span",{className:"text-[10px] font-medium text-white bg-emerald-500 rounded-full px-1.5 py-0.5 min-w-[18px] text-center leading-tight",children:a})]}):(0,r.jsxs)("div",{className:"w-72 bg-white/95 backdrop-blur-sm rounded-xl border border-zinc-200/80 shadow-lg overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-zinc-100/80",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),(0,r.jsx)("span",{className:"text-[11px] font-semibold text-zinc-600",children:"Live Activity"})]}),(0,r.jsx)("button",{onClick:s,className:"text-zinc-400 hover:text-zinc-600 transition-colors p-1 -mr-0.5 rounded-full hover:bg-zinc-100",title:"Collapse",children:(0,r.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})})]}),(0,r.jsx)("div",{className:"py-0.5 max-h-[260px] overflow-y-auto custom-scrollbar",children:0===t.length?(0,r.jsxs)("div",{className:"py-6 text-center",children:[(0,r.jsxs)("svg",{className:"w-5 h-5 text-zinc-200 mx-auto mb-1.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,r.jsx)("p",{className:"text-[11px] text-zinc-400",children:"No activity yet"})]}):t.slice(0,6).map((e,t)=>(0,r.jsx)("div",{className:0===t?"bg-emerald-50/30":"",children:(0,r.jsx)(eN,{event:e,variant:"compact",onNodeClick:l})},e.id))}),t.length>0&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-3.5 py-2 border-t border-zinc-100/80 bg-zinc-50/30",children:[(0,r.jsxs)("span",{className:"text-[10px] text-zinc-400",children:[t.length," event",1!==t.length?"s":""]}),(0,r.jsxs)("button",{onClick:i,className:"text-[11px] text-emerald-600 hover:text-emerald-700 transition-colors font-medium flex items-center gap-1",children:["See all",(0,r.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]})]})]})}function ez(e,t){let n=new Set(e.map(e=>e.id)),r=[...e];for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>t.time-e.time),r.slice(0,200)}let eM=[{key:"issues",label:"Issues",icon:"circle"},{key:"deps",label:"Deps",icon:"link"},{key:"comments",label:"Comments",icon:"chat"},{key:"claims",label:"Claims",icon:"user"},{key:"likes",label:"Likes",icon:"heart"}];function eS(e){let{events:t,isOpen:n,onClose:i,onNodeClick:l}=e,[a,o]=(0,s.useState)(""),[c,d]=(0,s.useState)(new Set(eM.map(e=>e.key))),u=e=>{d(t=>{let n=new Set(t);return n.has(e)?n.size>1&&n.delete(e):n.add(e),n})},x=(0,s.useMemo)(()=>{let e=t;if(e=e.filter(e=>c.has(function(e){switch(e){case"node-created":case"node-closed":case"node-status-changed":case"node-priority-changed":case"node-title-changed":case"node-owner-changed":return"issues";case"link-added":case"link-removed":return"deps";case"comment-added":case"reply-added":return"comments";case"task-claimed":case"task-unclaimed":return"claims";case"like-added":return"likes"}}(e.type))),a.trim()){let t=a.trim().toLowerCase();e=e.filter(e=>{var n;return e.nodeId.toLowerCase().includes(t)||e.nodeTitle&&e.nodeTitle.toLowerCase().includes(t)||(null===(n=e.actor)||void 0===n?void 0:n.handle)&&e.actor.handle.toLowerCase().includes(t)||e.detail&&e.detail.toLowerCase().includes(t)})}return e},[t,c,a]),h=(0,s.useMemo)(()=>(function(e){let t=new Map,n=[];for(let r of e){let e=function(e){let t=Date.now()-e,n=t/36e5,r=t/864e5;return n<1?"Just now":n<24?"Today":r<2?"Yesterday":r<7?"This week":r<30?"This month":"Older"}(r.time);t.has(e)||(t.set(e,[]),n.push(e)),t.get(e).push(r)}return n.map(e=>({label:e,events:t.get(e)}))})(x),[x]),m=c.size===eM.length;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("aside",{className:"hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white border-l border-zinc-200 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ".concat(n?"translate-x-0":"translate-x-full"),children:[(0,r.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"Activity"}),t.length>0&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 text-emerald-600 rounded-full text-[10px] font-medium",children:t.length})]}),(0,r.jsx)("button",{onClick:i,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors rounded-full hover:bg-zinc-100",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"px-4 pt-3 pb-2 shrink-0",children:(0,r.jsxs)("div",{className:"flex items-center bg-zinc-50/80 rounded-full border border-zinc-200/60 overflow-hidden",children:[(0,r.jsx)("div",{className:"pl-3 pr-1 text-zinc-400",children:(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,r.jsx)("input",{type:"text",value:a,onChange:e=>o(e.target.value),placeholder:"Search activity...",className:"flex-1 px-2 py-2 text-xs text-zinc-800 bg-transparent outline-none placeholder:text-zinc-400"}),a&&(0,r.jsx)("button",{onClick:()=>o(""),className:"pr-3 text-zinc-400 hover:text-zinc-600",children:(0,r.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5 px-4 pb-3 shrink-0",children:eM.map(e=>{let t=c.has(e.key);return(0,r.jsx)("button",{onClick:()=>u(e.key),className:"px-2.5 py-1 text-[11px] font-medium rounded-full border transition-all ".concat(t?"bg-emerald-50 text-emerald-700 border-emerald-200 shadow-sm":"bg-white text-zinc-400 border-zinc-200 hover:text-zinc-600 hover:border-zinc-300"),children:e.label},e.key)})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar border-t border-zinc-100",children:0===x.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)("svg",{className:"w-8 h-8 text-zinc-200 mb-3",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,r.jsx)("p",{className:"text-xs text-zinc-400",children:a.trim()?"No activity matching your search":"No activity yet"}),a.trim()&&(0,r.jsx)("button",{onClick:()=>o(""),className:"text-[11px] text-emerald-600 hover:text-emerald-700 mt-1.5",children:"Clear search"})]}):h.map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"sticky top-0 z-[1] px-4 py-1.5 bg-zinc-50/95 backdrop-blur-sm border-b border-zinc-100/60",children:(0,r.jsx)("span",{className:"text-[10px] font-semibold text-zinc-400 uppercase tracking-wider",children:e.label})}),(0,r.jsx)("div",{className:"divide-y divide-zinc-50",children:e.events.map(e=>(0,r.jsx)(eN,{event:e,variant:"full",onNodeClick:l},e.id))})]},e.label))}),(0,r.jsx)("div",{className:"shrink-0 px-5 py-2.5 border-t border-zinc-100 bg-zinc-50/50",children:(0,r.jsxs)("div",{className:"text-[10px] text-zinc-400",children:[x.length," event",1!==x.length?"s":"",!m&&" (filtered)",a.trim()&&' matching "'.concat(a.trim(),'"')]})})]}),(0,r.jsx)("div",{className:"md:hidden fixed inset-x-0 bottom-0 z-20 transition-transform duration-300 ease-out ".concat(n?"translate-y-0":"translate-y-full"),children:(0,r.jsxs)("div",{className:"bg-white rounded-t-2xl shadow-xl border-t border-zinc-200 max-h-[60vh] flex flex-col",children:[(0,r.jsx)("div",{className:"flex justify-center pt-3 pb-1",children:(0,r.jsx)("div",{className:"w-8 h-1 bg-zinc-300 rounded-full"})}),(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold text-zinc-900",children:"Activity"}),t.length>0&&(0,r.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-50 text-emerald-600 rounded-full text-[10px] font-medium",children:t.length})]}),(0,r.jsx)("button",{onClick:i,className:"p-1 text-zinc-400 hover:text-zinc-600",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5 px-5 pb-3",children:eM.map(e=>(0,r.jsx)("button",{onClick:()=>u(e.key),className:"px-2.5 py-1 text-[11px] font-medium rounded-full border transition-colors ".concat(c.has(e.key)?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-white text-zinc-400 border-zinc-200"),children:e.label},e.key))}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:0===x.length?(0,r.jsx)("div",{className:"py-8 text-center text-xs text-zinc-400",children:"No activity matching filters"}):h.map(e=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"sticky top-0 z-[1] px-5 py-1.5 bg-zinc-50/95 backdrop-blur-sm border-b border-zinc-100/60",children:(0,r.jsx)("span",{className:"text-[10px] font-semibold text-zinc-400 uppercase tracking-wider",children:e.label})}),(0,r.jsx)("div",{className:"divide-y divide-zinc-50",children:e.events.map(e=>(0,r.jsx)(eN,{event:e,variant:"full",onNodeClick:l},e.id))})]},e.label))})]})})]})}let eL=[{target:"graph",title:"The Dependency Graph",description:"Each circle is a task or issue. The flowing particles between them show the direction of dependencies — what needs to happen before something else can start. Bigger circles mean more connections.",padding:0},{target:"layouts",title:"Layout Modes",description:"Switch how the graph is arranged. Force is organic and physics-based. DAG gives you a clean top-down tree. Radial spreads nodes in rings. Cluster groups by project. Spread spaces everything out for screenshots."},{target:"view-controls",title:"View Controls",description:"Collapse or expand epic groups, toggle cluster label overlays, control auto-fit, and toggle the pulse animation. When auto-fit is on (green), the camera re-centers after every update. Pulse highlights the most recently active node with emerald ripples."},{target:"legend",title:"Color Modes & Legend",description:"Color nodes by Status, Priority, Owner, Assignee, or Prefix. The ring around each node always shows which project it belongs to."},{target:"minimap",title:"Minimap",description:"A bird’s-eye view of your entire graph. Click anywhere to jump there. Drag the edges to resize it."},{target:"search",title:"Search",description:"Press Cmd+F (or Ctrl+F) to search by name, ID, owner, assignee, or commenter. Arrow keys to navigate, Enter to focus."},{target:"graph",title:"Interacting with Nodes",description:"Click a node to see details. Hover for a quick tooltip. Right-click for actions like viewing descriptions, commenting, claiming tasks, collapsing epics, or focusing on an epic to isolate its subgraph.",padding:0},{target:"nav-pills",title:"Navigation Bar",description:"Replay steps through your project’s history. Comments shows conversations across your beads. Activity is a real-time feed filtered to only your local issues. And Learn brings you right back here."}];function eA(e){let{step:t,onNext:n,onEnd:i}=e,[l,a]=(0,s.useState)(null),o=(0,s.useCallback)(()=>{if(null===t){a(null);return}let e=eL[t];if(!e){a(null);return}let n=document.querySelector('[data-tutorial="'.concat(e.target,'"]'));if(n){var r;let t=n.getBoundingClientRect(),s=null!==(r=e.padding)&&void 0!==r?r:8;a({left:t.left-s,top:t.top-s,width:t.width+2*s,height:t.height+2*s})}else a(null)},[t]);if((0,s.useEffect)(()=>{o();let e=()=>o();window.addEventListener("resize",e);let t=setTimeout(o,150);return()=>{window.removeEventListener("resize",e),clearTimeout(t)}},[o]),null===t)return null;let c=t===eL.length-1;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-[55] cursor-pointer",onClick:()=>{c?i():n()},children:(0,r.jsxs)("svg",{className:"absolute inset-0 w-full h-full",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("mask",{id:"tutorial-mask",children:[(0,r.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),l&&(0,r.jsx)("rect",{x:l.left,y:l.top,width:l.width,height:l.height,rx:8,ry:8,fill:"black"})]})}),(0,r.jsx)("rect",{width:"100%",height:"100%",fill:"rgba(0,0,0,0.45)",mask:"url(#tutorial-mask)"})]})}),l&&(0,r.jsx)("div",{className:"fixed rounded-lg ring-2 ring-emerald-400/60 animate-pulse z-[56]",style:{left:l.left,top:l.top,width:l.width,height:l.height,pointerEvents:"none"}})]})}let eT={red:"#d20f39",teal:"#179299",peach:"#fe640b",blue:"#1e66f5",green:"#40a02b",mauve:"#8839ef",surface:"#dce0e8"};function eD(e){let{isOpen:t,onClose:n,tutorialStep:s=null,onStartTutorial:i,onNextStep:l,onPrevStep:a,onEndTutorial:o}=e,c=null!==s,d=c?"Tutorial":"Welcome to Heartbeads",u=c?(0,r.jsx)(eE,{step:s,onNext:l,onPrev:a,onEnd:o}):(0,r.jsx)(eW,{onStartTutorial:i});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("aside",{className:"hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white border-l border-zinc-200 flex-col shadow-xl transform transition-transform duration-300 ease-out ".concat(t?"translate-x-0":"translate-x-full"," ").concat(c?"z-[60]":"z-30"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 shrink-0",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold text-zinc-900",children:d}),(0,r.jsx)("button",{onClick:n,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:u})]}),(0,r.jsx)("div",{className:"md:hidden fixed inset-x-0 bottom-0 transform transition-transform duration-300 ease-out ".concat(t?"translate-y-0":"translate-y-full"," ").concat(c?"z-[60]":"z-20"),children:(0,r.jsxs)("div",{className:"bg-white rounded-t-2xl shadow-2xl border-t border-zinc-200 max-h-[70vh] flex flex-col",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b border-zinc-100 shrink-0",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold text-zinc-900",children:d}),(0,r.jsx)("button",{onClick:n,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:u})]})})]})}function eE(e){let{step:t,onNext:n,onPrev:s,onEnd:i}=e,l=eL[t],a=eL.length,o=t===a-1;return(0,r.jsxs)("div",{className:"px-5 py-4 flex flex-col min-h-[300px]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("span",{className:"text-xs font-medium",style:{color:eT.teal},children:[t+1," / ",a]}),(0,r.jsx)("div",{className:"flex gap-1",children:Array.from({length:a}).map((e,n)=>(0,r.jsx)("div",{className:"w-1.5 h-1.5 rounded-full transition-colors",style:{backgroundColor:n===t?eT.green:n<t?eT.teal:eT.surface}},n))})]}),(0,r.jsx)("h3",{className:"text-base font-semibold text-zinc-900 mb-2",children:l.title}),(0,r.jsx)("p",{className:"text-[13px] text-zinc-600 leading-relaxed mb-6",children:l.description}),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsxs)("div",{className:"flex items-center gap-2 pt-4 border-t border-zinc-100",children:[0===t?(0,r.jsx)("button",{onClick:i,className:"px-4 py-2 text-sm font-medium text-zinc-400 hover:text-zinc-600 rounded-lg hover:bg-zinc-50 transition-colors",children:"Skip"}):(0,r.jsx)("button",{onClick:s,className:"px-4 py-2 text-sm font-medium rounded-lg hover:bg-zinc-50 transition-colors",style:{color:eT.blue},children:"Back"}),(0,r.jsx)("div",{className:"flex-1"}),o?(0,r.jsx)("button",{onClick:i,className:"px-4 py-2 text-sm font-medium text-white rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:"Done"}):(0,r.jsx)("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-white rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:"Next"})]})]})}function eB(e){let{color:t,children:n}=e;return(0,r.jsxs)("li",{className:"flex gap-2.5 items-start",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 rounded-full mt-[6px] shrink-0",style:{backgroundColor:t}}),(0,r.jsx)("span",{children:n})]})}function eI(e){let{children:t,color:n}=e;return(0,r.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-widest mb-2 mt-5 first:mt-0",style:{color:n},children:t})}function eW(e){let{onStartTutorial:t}=e;return(0,r.jsxs)("div",{className:"px-5 py-4 text-[13px] text-zinc-600 leading-relaxed",children:[t&&(0,r.jsxs)("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 mb-5 text-white text-sm font-medium rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:[(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})}),"Take the guided tour"]}),(0,r.jsx)("p",{className:"text-zinc-900 font-medium mb-1",children:"Your command center for AI coding tasks."}),(0,r.jsx)("p",{className:"mb-4 text-zinc-500",children:"Heartbeads shows everything your AI agents are working on as a live, interactive graph — tasks, dependencies, who's doing what, and what's blocking progress."}),(0,r.jsx)(eI,{color:eT.red,children:"The graph"}),(0,r.jsxs)("p",{className:"mb-2",children:["Each ",(0,r.jsx)("strong",{children:"circle"})," is a task. ",(0,r.jsx)("strong",{children:"Flowing particles"})," ","stream between them to show dependency direction."]}),(0,r.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,r.jsxs)(eB,{color:eT.red,children:[(0,r.jsx)("strong",{children:"Bigger circles"})," — more connected, more important"]}),(0,r.jsxs)(eB,{color:eT.red,children:[(0,r.jsx)("strong",{children:"Solid lines + particles"})," — “blocks” (A must finish before B)"]}),(0,r.jsxs)(eB,{color:eT.red,children:[(0,r.jsx)("strong",{children:"Dashed lines"})," — parent-child grouping"]}),(0,r.jsxs)(eB,{color:eT.red,children:[(0,r.jsx)("strong",{children:"Colored ring"})," — which project it belongs to"]})]}),(0,r.jsx)(eI,{color:eT.blue,children:"Navigation"}),(0,r.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,r.jsxs)(eB,{color:eT.blue,children:[(0,r.jsx)("strong",{children:"Click"})," a node to open its details"]}),(0,r.jsxs)(eB,{color:eT.blue,children:[(0,r.jsx)("strong",{children:"Hover"})," for a quick summary"]}),(0,r.jsxs)(eB,{color:eT.blue,children:[(0,r.jsx)("strong",{children:"Right-click"})," for actions — descriptions, comments, claims, collapse, or focus on an epic"]}),(0,r.jsxs)(eB,{color:eT.blue,children:[(0,r.jsx)("strong",{children:"Scroll"})," to zoom, ",(0,r.jsx)("strong",{children:"drag"})," to pan"]}),(0,r.jsxs)(eB,{color:eT.blue,children:[(0,r.jsx)("strong",{children:"Cmd/Ctrl+F"})," to search by name, ID, owner, or commenter"]})]}),(0,r.jsx)(eI,{color:eT.teal,children:"Layouts"}),(0,r.jsx)("p",{className:"mb-2",children:"Top-left buttons rearrange the graph:"}),(0,r.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,r.jsxs)(eB,{color:eT.teal,children:[(0,r.jsx)("strong",{children:"Force"})," — organic, physics-based"]}),(0,r.jsxs)(eB,{color:eT.teal,children:[(0,r.jsx)("strong",{children:"DAG"})," — clean top-down tree"]}),(0,r.jsxs)(eB,{color:eT.teal,children:[(0,r.jsx)("strong",{children:"Radial"})," — rings from center outward"]}),(0,r.jsxs)(eB,{color:eT.teal,children:[(0,r.jsx)("strong",{children:"Cluster"})," — grouped by project"]}),(0,r.jsxs)(eB,{color:eT.teal,children:[(0,r.jsx)("strong",{children:"Spread"})," — spaced out for screenshots"]})]}),(0,r.jsx)(eI,{color:eT.peach,children:"Color modes"}),(0,r.jsx)("p",{className:"mb-2",children:"Bottom-right panel — paint nodes by:"}),(0,r.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,r.jsxs)(eB,{color:eT.peach,children:[(0,r.jsx)("strong",{children:"Status"})," — open, in progress, blocked, closed"]}),(0,r.jsxs)(eB,{color:eT.peach,children:[(0,r.jsx)("strong",{children:"Priority"})," — P0 critical to P4 backlog"]}),(0,r.jsxs)(eB,{color:eT.peach,children:[(0,r.jsx)("strong",{children:"Owner"})," — who created it"]}),(0,r.jsxs)(eB,{color:eT.peach,children:[(0,r.jsx)("strong",{children:"Assignee"})," — who's working on it"]}),(0,r.jsxs)(eB,{color:eT.peach,children:[(0,r.jsx)("strong",{children:"Prefix"})," — which project"]})]}),(0,r.jsx)(eI,{color:eT.mauve,children:"More"}),(0,r.jsxs)("ul",{className:"space-y-1.5 mb-3",children:[(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Collapse/Expand"})," — tidy up epics into single nodes"]}),(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Focus on epic"})," — right-click an epic to isolate its subgraph (children + dependencies). Click the banner or right-click again to return"]}),(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Clusters"})," — dashed circles grouping projects when zoomed out"]}),(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Replay"})," — step through your project's history"]}),(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Comments"})," — leave notes on tasks (sign in first)"]}),(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Activity feed"})," — real-time feed filtered to only your local beads, not global"]}),(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Claim tasks"})," — right-click to mark as yours"]}),(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Minimap"})," — click to jump, drag edges to resize"]}),(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Auto-fit"})," — top-left toggle to lock/unlock automatic camera reframing"]}),(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Pulse"})," — the most recently active node pulses with emerald ripples. Toggle it on/off in view controls"]}),(0,r.jsxs)(eB,{color:eT.mauve,children:[(0,r.jsx)("strong",{children:"Copy"})," — clipboard icon copies task with project info"]})]}),(0,r.jsxs)("div",{className:"mt-5 pt-4 border-t border-zinc-100 text-xs text-zinc-400",children:["Built with"," ",(0,r.jsx)("a",{href:"https://github.com/GainForest/beads",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 transition-colors",style:{color:eT.green},children:"beads"})," ","— open-source issue tracking for AI-native development. Heartbeads is built for the GainForest agentic workflow and open-sourced at"," ",(0,r.jsx)("a",{href:"https://github.com/daviddao/heartbeads",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 transition-colors",style:{color:eT.green},children:"github.com/daviddao/heartbeads"}),"."]})]})}function eP(e){let{isOpen:t,onClose:n}=e,[i,l]=(0,s.useState)(""),[a,o]=(0,s.useState)(""),[c,d]=(0,s.useState)(""),[u,x]=(0,s.useState)(!1),[h,m]=(0,s.useState)(!1);(0,s.useEffect)(()=>{m(!0)},[]),(0,s.useEffect)(()=>{if(t){let e=O();l(e.elevenLabsApiKey||""),o(e.elevenLabsVoiceId),d(e.elevenLabsModel),x(!1)}},[t]),(0,s.useEffect)(()=>{if(!t)return;let e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,n]);let p=(0,s.useCallback)(()=>{!function(e){let t={...O(),...e};localStorage.setItem(R,JSON.stringify(t))}({elevenLabsApiKey:i.trim()||void 0,elevenLabsVoiceId:a.trim()||"UgBBYS2sOqTuMpoF3BR0",elevenLabsModel:c||"eleven_turbo_v2_5"}),n()},[i,a,c,n]);return t&&h?(0,W.createPortal)((0,r.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center",style:{backgroundColor:"rgba(0,0,0,0.4)",backdropFilter:"blur(4px)"},onClick:n,children:(0,r.jsxs)("div",{className:"bg-white rounded-xl shadow-2xl w-[90vw] max-w-md flex flex-col",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-zinc-100",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold text-zinc-900",children:"Settings"}),(0,r.jsx)("button",{onClick:n,className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsxs)("div",{className:"px-5 py-4 space-y-4 overflow-y-auto max-h-[60vh]",children:[(0,r.jsx)("h3",{className:"text-[11px] font-semibold uppercase tracking-widest text-teal-600",children:"Text-to-Speech"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-zinc-700 mb-1",children:"ElevenLabs API Key"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:u?"text":"password",value:i,onChange:e=>l(e.target.value),placeholder:"sk_...",className:"w-full rounded-lg border border-zinc-200 bg-zinc-50 px-3 py-2 text-sm text-zinc-900 placeholder:text-zinc-400 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-500 pr-10"}),(0,r.jsx)("button",{type:"button",onClick:()=>x(e=>!e),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-zinc-400 hover:text-zinc-600 transition-colors",title:u?"Hide key":"Show key",children:u?(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})}):(0,r.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:[(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})]}),(0,r.jsxs)("p",{className:"mt-1 text-[11px] text-zinc-400",children:["Get your key at"," ",(0,r.jsx)("a",{href:"https://elevenlabs.io/app/settings/api-keys",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 text-teal-500 hover:text-teal-600",children:"elevenlabs.io/app/settings"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-zinc-700 mb-1",children:"Voice ID"}),(0,r.jsx)("input",{type:"text",value:a,onChange:e=>o(e.target.value),placeholder:"UgBBYS2sOqTuMpoF3BR0",className:"w-full rounded-lg border border-zinc-200 bg-zinc-50 px-3 py-2 text-sm text-zinc-900 placeholder:text-zinc-400 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-500"}),(0,r.jsxs)("p",{className:"mt-1 text-[11px] text-zinc-400",children:["Default: Mark - Natural Conversations. Find voice IDs in the"," ",(0,r.jsx)("a",{href:"https://elevenlabs.io/app/voice-library",target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2 text-teal-500 hover:text-teal-600",children:"ElevenLabs Voice Library"}),"."]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-zinc-700 mb-1",children:"Model"}),(0,r.jsxs)("select",{value:c,onChange:e=>d(e.target.value),className:"w-full rounded-lg border border-zinc-200 bg-zinc-50 px-3 py-2 text-sm text-zinc-900 focus:outline-none focus:ring-2 focus:ring-emerald-500/30 focus:border-emerald-500",children:[(0,r.jsx)("option",{value:"eleven_turbo_v2_5",children:"Turbo v2.5 (default, fast & cheap)"}),(0,r.jsx)("option",{value:"eleven_flash_v2_5",children:"Flash v2.5 (fastest, cheapest)"}),(0,r.jsx)("option",{value:"eleven_multilingual_v2",children:"Multilingual v2 (highest quality)"})]})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2 px-5 py-3.5 border-t border-zinc-100",children:[(0,r.jsx)("button",{onClick:n,className:"px-4 py-2 text-sm font-medium text-zinc-500 hover:text-zinc-700 rounded-lg hover:bg-zinc-50 transition-colors",children:"Cancel"}),(0,r.jsx)("button",{onClick:p,className:"px-4 py-2 text-sm font-medium text-white rounded-lg bg-emerald-500 hover:bg-emerald-600 transition-colors",children:"Save"})]})]})}),document.body):null}let eF=new Map,eR=new Map;async function e_(e){let t=eF.get(e);if(t)return t;let n=eR.get(e);if(n)return n;let r=(async()=>{try{let t=await fetch("https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=".concat(encodeURIComponent(e)));if(!t.ok)throw Error("Profile fetch failed: ".concat(t.status));let n=await t.json(),r={did:e,handle:n.handle||e,displayName:n.displayName||void 0,avatar:n.avatar||void 0};return eF.set(e,r),r}catch(n){let t={did:e,handle:e.slice(0,20)+"..."};return eF.set(e,t),t}finally{eR.delete(e)}})();return eR.set(e,r),r}async function eO(e){let t;let n=[],r=!0,s=0;for(;r&&s<5;){var i,l;let a=await fetch("https://hypergoat-app-production.up.railway.app/graphql",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:"\n query FetchRecords($collection: String!, $first: Int, $after: String) {\n records(collection: $collection, first: $first, after: $after) {\n edges {\n node {\n cid\n collection\n did\n rkey\n uri\n value\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n",variables:{collection:e,first:100,after:t}})});if(!a.ok)throw Error("Indexer fetch failed: ".concat(a.status));let o=await a.json();if(null===(i=o.errors)||void 0===i?void 0:i.length)throw Error(o.errors[0].message);let c=null===(l=o.data)||void 0===l?void 0:l.records;if(!c)break;for(let e of c.edges)n.push(e.node);r=c.pageInfo.hasNextPage,t=c.pageInfo.endCursor,s++}return n}function eH(e){let{totalSteps:t,currentStep:n,currentTime:i,isPlaying:l,speed:a,onStepChange:o,onPlayPause:c,onSpeedChange:d}=e,u=(0,s.useCallback)(e=>{o(Number(e.target.value))},[o]),x=(0,s.useCallback)(()=>{d(1===a?2:2===a?4:1)},[a,d]),h=t>1;return(0,r.jsx)("div",{className:"bg-white/90 backdrop-blur-sm rounded-lg border border-zinc-200 shadow-sm px-3 py-2 min-w-[280px] max-w-[480px]",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{onClick:c,disabled:!h,className:"shrink-0 w-6 h-6 flex items-center justify-center rounded transition-colors ".concat(l?"text-emerald-500 hover:text-emerald-600":"text-zinc-500 hover:text-zinc-700"," disabled:opacity-40 disabled:cursor-not-allowed"),children:l?(0,r.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:[(0,r.jsx)("rect",{x:"3",y:"2",width:"3.5",height:"12",rx:"1"}),(0,r.jsx)("rect",{x:"9.5",y:"2",width:"3.5",height:"12",rx:"1"})]}):(0,r.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"currentColor",children:(0,r.jsx)("path",{d:"M4 2l10 6-10 6V2z"})})}),(0,r.jsx)("input",{type:"range",min:0,max:Math.max(t-1,0),value:n,onChange:u,disabled:!h,className:"timeline-slider flex-1 h-4 disabled:opacity-40"}),(0,r.jsxs)("span",{className:"shrink-0 text-xs text-zinc-500 font-medium text-right whitespace-nowrap",children:[(0,r.jsxs)("span",{className:"text-zinc-400",children:[n+1,"/",t]})," ",new Date(i).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]}),(0,r.jsxs)("button",{onClick:x,className:"shrink-0 px-1.5 py-0.5 text-[10px] font-semibold rounded transition-colors ".concat(a>1?"bg-emerald-500 text-white":"text-zinc-500 border border-zinc-200 hover:text-zinc-700"),children:[a,"x"]})]})})}function eU(e,t,n){let r=Date.now(),s=new Map(e.graphData.nodes.map(e=>[e.id,e])),i=new Set(e.graphData.links.map(f)),l=t.graphData.nodes.map(e=>{let i=s.get(e.id);if(!i){let n=function(e,t,n){for(let r of t){let t="object"==typeof r.source?r.source.id:r.source,s="object"==typeof r.target?r.target.id:r.target;if(t===e&&n.has(s)){let e=n.get(s);if(null!=e.x&&null!=e.y)return{x:e.x,y:e.y}}if(s===e&&n.has(t)){let e=n.get(t);if(null!=e.x&&null!=e.y)return{x:e.x,y:e.y}}}return null}(e.id,t.graphData.links,s);return{...e,_spawnTime:r,x:n?n.x+(Math.random()-.5)*40:void 0,y:n?n.y+(Math.random()-.5)*40:void 0}}let l={...e,x:i.x,y:i.y,fx:i.fx,fy:i.fy};if(n.changedNodes.has(e.id)){let t=n.changedNodes.get(e.id).find(e=>"status"===e.field);t&&(l._changedAt=r,l._prevStatus=t.from)}return l});for(let e of n.removedNodeIds){let t=s.get(e);t&&l.push({...t,_removeTime:r})}let a=t.graphData.links.map(e=>{let t=f(e);return i.has(t)?e:{...e,_spawnTime:r}});for(let t of n.removedLinkKeys){let n=e.graphData.links.find(e=>f(e)===t);n&&a.push({source:"object"==typeof n.source?n.source.id:n.source,target:"object"==typeof n.target?n.target.id:n.target,type:n.type,_removeTime:r})}return{...t,graphData:{nodes:l,links:a}}}let eV={open:"bg-emerald-500",in_progress:"bg-amber-500",blocked:"bg-red-500",deferred:"bg-violet-500",closed:"bg-zinc-400"};function eY(){var e,t,n;let[i,l]=(0,s.useState)(null),[a,o]=(0,s.useState)(!0),[c,d]=(0,s.useState)(null),[u,x]=(0,s.useState)(null),[m,p]=(0,s.useState)(null),[f,v]=(0,s.useState)(new Set),[b,j]=(0,s.useState)(null),[y,w]=(0,s.useState)("status"),[k,N]=(0,s.useState)("Beads"),[C,z]=(0,s.useState)(0),[M,S]=(0,s.useState)({}),{isAuthenticated:L,session:A}=(0,eo.a)(),{commentsByNode:T,commentedNodeIds:E,allComments:B,refetch:I}=function(){let[e,t]=(0,s.useState)(new Map),[n,r]=(0,s.useState)(new Map),[i,l]=(0,s.useState)([]),[a,o]=(0,s.useState)(!0),[c,d]=(0,s.useState)(null),u=(0,s.useRef)(!1),x=(0,s.useCallback)(async()=>{try{o(!0),d(null);let[e,n]=await Promise.all([eO("org.impactindexer.review.comment"),eO("org.impactindexer.review.like")]),s=e.filter(e=>{let t=e.value.subject;return(null==t?void 0:t.uri)&&"string"==typeof t.uri&&t.uri.startsWith("beads:")}),i=new Map;for(let e of n){let t=e.value.subject;if((null==t?void 0:t.uri)&&"string"==typeof t.uri&&t.uri.startsWith("at://")){let n=i.get(t.uri)||[];n.push(e),i.set(t.uri,n)}}let a=new Set;for(let e of s)a.add(e.did);for(let e of n)a.add(e.did);let c=await Promise.all([...a].map(e=>e_(e))),x=new Map(c.map(e=>[e.did,e])),h=[];for(let e of s){let t=e.value,n=t.subject.uri.replace(/^beads:/,""),r=t.text||"",s=t.createdAt||"",l=t.replyTo||void 0,a=x.get(e.did),o=(i.get(e.uri)||[]).map(e=>{let t=x.get(e.did),n=e.value;return{did:e.did,handle:(null==t?void 0:t.handle)||e.did.slice(0,20)+"...",displayName:null==t?void 0:t.displayName,avatar:null==t?void 0:t.avatar,createdAt:n.createdAt||"",uri:e.uri,rkey:e.rkey}}),c={did:e.did,handle:(null==a?void 0:a.handle)||e.did.slice(0,20)+"...",displayName:null==a?void 0:a.displayName,avatar:null==a?void 0:a.avatar,text:r,createdAt:s,uri:e.uri,rkey:e.rkey,nodeId:n,replyTo:l,likes:o,replies:[]};h.push(c)}let m=new Map;for(let e of h)m.set(e.uri,e);let p=[];for(let e of h){if(e.replyTo){let t=m.get(e.replyTo);if(t){t.replies.push(e);continue}}p.push(e)}p.sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()),function e(t){for(let n of t)n.replies.sort((e,t)=>new Date(e.createdAt).getTime()-new Date(t.createdAt).getTime()),e(n.replies)}(p);let f=new Map;for(let e of p){let t=f.get(e.nodeId)||[];t.push(e),f.set(e.nodeId,t)}let g=new Map;for(let e of h)g.set(e.nodeId,(g.get(e.nodeId)||0)+1);let v=[...h].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());u.current||(t(f),r(g),l(v))}catch(e){if(!u.current){let t=e instanceof Error?e.message:"Failed to fetch comments";console.error("Failed to fetch beads comments:",e),d(t)}}finally{u.current||o(!1)}},[]);return(0,s.useEffect)(()=>(u.current=!1,x(),()=>{u.current=!0}),[x]),{commentsByNode:e,commentedNodeIds:n,allComments:i,isLoading:a,error:c,refetch:x}}(),[W,F]=(0,s.useState)(new Map),[R,_]=(0,s.useState)(new Set),O=(0,s.useMemo)(()=>{let e=new Map;if(B)for(let t of B){if(e.has(t.nodeId)||R.has(t.nodeId))continue;let n=t.text.trim();n.startsWith("@")&&-1===n.indexOf(" ")&&e.set(t.nodeId,{avatar:t.avatar,handle:t.handle,claimedAt:t.createdAt,did:t.did,rkey:t.rkey})}for(let[t,n]of W)e.has(t)||R.has(t)||e.set(t,n);return e},[B,W,R]),[H,U]=(0,s.useState)(!1),[V,Y]=(0,s.useState)([]),[q,K]=(0,s.useState)(!1),[X,$]=(0,s.useState)(!1),[G,J]=(0,s.useState)(!1),[Z,Q]=(0,s.useState)(null),et=(0,s.useMemo)(()=>i?new Set(i.graphData.nodes.map(e=>e.id)):new Set,[i]);(0,s.useEffect)(()=>{if(!i)return;let e=B?B.filter(e=>et.has(e.nodeId)):null,t=function(e,t,n){let r=[],s=new Set;function i(e){s.has(e.id)||(s.add(e.id),r.push(e))}for(let t of e){if(t.createdAt){let e=new Date(t.createdAt).getTime();isNaN(e)||i({id:"node-created:".concat(t.id,":").concat(e),type:"node-created",time:e,nodeId:t.id,nodeTitle:t.title,detail:t.issueType,meta:{issueType:t.issueType,prefix:t.prefix}})}if(t.closedAt){let e=new Date(t.closedAt).getTime();isNaN(e)||i({id:"node-closed:".concat(t.id,":").concat(e),type:"node-closed",time:e,nodeId:t.id,nodeTitle:t.title,detail:t.closeReason||"Closed",meta:{prefix:t.prefix}})}}for(let e of t)if(e.createdAt){let t=new Date(e.createdAt).getTime();if(!isNaN(t)){let n="object"==typeof e.source?e.source.id:e.source,r="object"==typeof e.target?e.target.id:e.target;i({id:"link-added:".concat(n,"->").concat(r,":").concat(t),type:"link-added",time:t,nodeId:n,detail:"".concat(e.type," ").concat(r),meta:{linkType:e.type,target:r}})}}if(n)for(let e of n){let t=new Date(e.createdAt).getTime();if(isNaN(t))continue;let n={handle:e.handle,avatar:e.avatar,did:e.did};for(let r of(i(e.text.startsWith("@")&&-1===e.text.trim().indexOf(" ")?{id:"task-claimed:".concat(e.nodeId,":").concat(t),type:"task-claimed",time:t,nodeId:e.nodeId,actor:n,detail:e.text}:e.replyTo?{id:"reply-added:".concat(e.nodeId,":").concat(e.rkey),type:"reply-added",time:t,nodeId:e.nodeId,actor:n,detail:e.text.length>80?e.text.slice(0,80)+"...":e.text}:{id:"comment-added:".concat(e.nodeId,":").concat(e.rkey),type:"comment-added",time:t,nodeId:e.nodeId,actor:n,detail:e.text.length>80?e.text.slice(0,80)+"...":e.text}),e.likes)){let t=new Date(r.createdAt).getTime();isNaN(t)||i({id:"like-added:".concat(e.nodeId,":").concat(r.rkey),type:"like-added",time:t,nodeId:e.nodeId,actor:{handle:r.handle,avatar:r.avatar,did:r.did},detail:"Liked comment by ".concat(e.handle)})}}return r.sort((e,t)=>t.time-e.time),r}(i.graphData.nodes,i.graphData.links,e);Y(e=>ez(e,t))},[i,B,et]);let[er,es]=(0,s.useState)(null),[ei,el]=(0,s.useState)(null),[ea,eh]=(0,s.useState)(null),[ep,ef]=(0,s.useState)(!1),[ev,eb]=(0,s.useState)(null),[ej,ey]=(0,s.useState)(null),[ew,ek]=(0,s.useState)(!1),[eN,eM]=(0,s.useState)(""),[eT,eE]=(0,s.useState)(0),[eB,eI]=(0,s.useState)(!1),[eW,eF]=(0,s.useState)(0),[eR,eY]=(0,s.useState)(!1),[eq,eK]=(0,s.useState)(1),[eX,e$]=(0,s.useState)(null),[eG,eJ]=(0,s.useState)(!0),[eZ,eQ]=(0,s.useState)(!0),e0=(0,s.useRef)(null),e1=(0,s.useRef)(null),e5=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=null,t=null,n=null,r=!0;return function s(){(e=new EventSource("/api/beads/stream")).onmessage=e=>{if(r)try{let t=JSON.parse(e.data);if(t.error){d(t.error),o(!1);return}let n=e5.current,r=g(n,t);if(!n){e5.current=t,l(t),o(!1);return}if(!r.hasChanges)return;let s=function(e,t){let n=[],r=Date.now(),s=new Map(t.map(e=>[e.id,e]));for(let t of e.addedNodeIds){let e=s.get(t);n.push({id:"node-created:".concat(t,":").concat(r),type:"node-created",time:r,nodeId:t,nodeTitle:null==e?void 0:e.title,detail:(null==e?void 0:e.issueType)||"task",meta:e?{issueType:e.issueType,prefix:e.prefix}:void 0})}for(let t of e.removedNodeIds)n.push({id:"node-closed:".concat(t,":").concat(r),type:"node-closed",time:r,nodeId:t,detail:"Removed"});for(let[t,i]of e.changedNodes){let e=s.get(t);for(let s of i){let i;switch(s.field){case"status":default:i="node-status-changed";break;case"priority":i="node-priority-changed";break;case"title":i="node-title-changed";break;case"owner":i="node-owner-changed"}n.push({id:"".concat(i,":").concat(t,":").concat(r,":").concat(s.field),type:i,time:r,nodeId:t,nodeTitle:null==e?void 0:e.title,detail:"".concat(s.from," → ").concat(s.to),meta:{field:s.field,from:s.from,to:s.to}})}}for(let t of e.addedLinkKeys){let e=t.match(/^(.+)->(.+):(.+)$/);if(e){let[,s,i,l]=e;n.push({id:"link-added:".concat(t,":").concat(r),type:"link-added",time:r,nodeId:s,detail:"".concat(l," ").concat(i),meta:{linkType:l,target:i}})}}for(let t of e.removedLinkKeys){let e=t.match(/^(.+)->(.+):(.+)$/);if(e){let[,s,i,l]=e;n.push({id:"link-removed:".concat(t,":").concat(r),type:"link-removed",time:r,nodeId:s,detail:"".concat(l," ").concat(i),meta:{linkType:l,target:i}})}}return n}(r,t.graphData.nodes);s.length>0&&Y(e=>ez(e,s));let i=eU(n,t,r);e5.current=i,l(i)}catch(e){console.error("Failed to parse SSE message:",e)}},e.onerror=()=>{(null==e?void 0:e.readyState)===EventSource.CLOSED&&(t=setTimeout(s,5e3))},n=setTimeout(()=>{r&&!e5.current&&fetch("/api/beads").then(e=>e.json()).then(e=>{r&&!e5.current&&(e5.current=e,l(e),o(!1))}).catch(()=>{})},5e3)}(),()=>{r=!1,null==e||e.close(),t&&clearTimeout(t),n&&clearTimeout(n)}},[]),(0,s.useEffect)(()=>{fetch("/api/config").then(e=>e.json()).then(e=>{e.name&&N(e.name),e.repoCount&&z(e.repoCount),e.repoUrls&&S(e.repoUrls)}).catch(()=>{})},[]),(0,s.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>{let e=Date.now(),t=i.graphData.nodes.filter(t=>!t._removeTime||e-t._removeTime<600),n=i.graphData.links.filter(t=>!t._removeTime||e-t._removeTime<600);(t.length!==i.graphData.nodes.length||n.length!==i.graphData.links.length)&&l(e=>e?{...e,graphData:{nodes:t,links:n}}:e)},700);return()=>clearTimeout(e)},[i]);let e2=(0,s.useMemo)(()=>i?function(e,t){let n=[];for(let t of e){let e=new Date(t.createdAt).getTime();if(isNaN(e)||n.push({time:e,type:"node-created",id:t.id}),t.closedAt){let e=new Date(t.closedAt).getTime();isNaN(e)||n.push({time:e,type:"node-closed",id:t.id})}}n.sort((e,t)=>e.time-t.time);let r=n.length>0?n[0].time:Date.now(),s=n.length>0?n[n.length-1].time:Date.now();return{events:n,minTime:r,maxTime:s}}(i.graphData.nodes,i.graphData.links):null,[i]),e4=(0,s.useCallback)(()=>{eI(e=>{let t=!e;return t&&eF(-1),eY(!1),e$(null),t})},[]);(0,s.useEffect)(()=>{if(!eR||!eB||!e2)return;let e=setInterval(()=>{eF(e=>{let t=e+1;return t>=e2.events.length?(eY(!1),e):t})},2e3/eq);return()=>clearInterval(e)},[eR,eB,eq,e2]),(0,s.useEffect)(()=>{if(!eB||!i||!e2)return;if(-1===eW){e$(e=>{let t={...i,graphData:{nodes:[],links:[]}};if(!e)return t;let n=g(e,t);return n.hasChanges?eU(e,t,n):e});return}if(0===e2.events.length)return;let e=e2.events[eW];if(!e)return;let t=function(e,t,n){let r=new Set,s=[];for(let t of e){let e=new Date(t.createdAt).getTime();if(isNaN(e)||e>n)continue;r.add(t.id);let i=t.status;if(t.closedAt){let e=new Date(t.closedAt).getTime();!isNaN(e)&&e<=n?i="closed":"closed"===t.status&&(i="open")}i!==t.status?s.push({...t,status:i}):s.push(t)}let i=[];for(let e of t){let t="object"==typeof e.source?e.source.id:e.source,n="object"==typeof e.target?e.target.id:e.target;r.has(t)&&r.has(n)&&i.push({...e,source:t,target:n})}return{nodes:s,links:i}}(i.graphData.nodes,i.graphData.links,e.time),n={...i,graphData:{nodes:t.nodes,links:t.links}};e$(e=>{if(!e)return n;let t=g(e,n);return t.hasChanges?eU(e,n,t):e})},[eB,i,e2,eW]);let e3=(0,s.useCallback)(e=>{x(t=>(null==t?void 0:t.id)===e.id?null:e),U(!1),K(!1),J(!1),Q(null)},[]),e6=(0,s.useCallback)((e,t,n)=>{p(e),ey(e?{node:e,x:t,y:n}:null)},[]),e8=(0,s.useCallback)(e=>{v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),e7=(0,s.useMemo)(()=>{if(!i)return new Set;let{nodes:e,links:t}=i.graphData,n=new Set;for(let e of t)if("parent-child"===e.type){let t="object"==typeof e.source?e.source.id:e.source;n.add(t)}let r=new Set(e.map(e=>e.id));for(let t of e)if(t.id.includes(".")){let e=t.id.split(".")[0];r.has(e)&&n.add(e)}return n},[i]),e9=(0,s.useCallback)(()=>{v(new Set(e7))},[e7]),te=(0,s.useCallback)(()=>{v(new Set)},[]),tt=(0,s.useCallback)(e=>{j(e)},[]),tn=(0,s.useCallback)(()=>{j(null)},[]),tr=(0,s.useCallback)(()=>{J(!0),x(null),U(!1),K(!1),Q(0)},[]),ts=(0,s.useCallback)(()=>{Q(e=>null===e?null:e>=eL.length-1?e:e+1)},[]),ti=(0,s.useCallback)(()=>{Q(e=>null===e||e<=0?e:e-1)},[]),tl=(0,s.useCallback)(()=>{Q(null)},[]),ta=(0,s.useCallback)(()=>{x(null),es(null),el(null)},[]),to=(0,s.useCallback)((e,t)=>{el(null),ey(null),e.description||L||"epic"===e.issueType?es({node:e,x:t.clientX,y:t.clientY}):el({node:e,x:t.clientX,y:t.clientY})},[L]),tc=(0,s.useCallback)(async(e,t)=>{let n=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.comment",record:{$type:"org.impactindexer.review.comment",subject:{uri:"beads:".concat(e),type:"record"},text:t,createdAt:new Date().toISOString()}})});if(!n.ok)throw Error((await n.json()).error||"Failed to post comment");await I()},[I]),td=(0,s.useCallback)(async e=>{if(!(null==A?void 0:A.handle))return;let t=A.avatar;if(!t&&A.did)try{let e=await fetch("https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=".concat(encodeURIComponent(A.did)));e.ok&&(t=(await e.json()).avatar)}catch(e){}F(n=>{let r=new Map(n);return r.set(e,{avatar:t,claimedAt:new Date().toISOString(),handle:A.handle}),r}),await tc(e,"@".concat(A.handle)),setTimeout(()=>I(),3e3)},[null==A?void 0:A.handle,null==A?void 0:A.did,null==A?void 0:A.avatar,tc,I]),tu=(0,s.useCallback)(async e=>{let t=await fetch("/api/records?collection=".concat(encodeURIComponent("org.impactindexer.review.comment"),"&rkey=").concat(encodeURIComponent(e.rkey)),{method:"DELETE"});if(!t.ok)throw Error((await t.json()).error||"Failed to delete comment");await I()},[I]),tx=(0,s.useCallback)(async e=>{let t=O.get(e);t&&(_(t=>new Set(t).add(e)),F(t=>{let n=new Map(t);return n.delete(e),n}),t.rkey?(await tu({rkey:t.rkey}),_(t=>{let n=new Set(t);return n.delete(e),n})):setTimeout(async()=>{await I(),_(t=>{let n=new Set(t);return n.delete(e),n})},3e3))},[O,tu,I]),th=(0,s.useCallback)(async e=>{let t=e.likes.find(e=>e.did===(null==A?void 0:A.did));if(t){let e=await fetch("/api/records?collection=".concat(encodeURIComponent("org.impactindexer.review.like"),"&rkey=").concat(encodeURIComponent(t.rkey)),{method:"DELETE"});if(!e.ok)throw Error((await e.json()).error||"Failed to unlike")}else{let t=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.like",record:{subject:{uri:e.uri,type:"record"},createdAt:new Date().toISOString()}})});if(!t.ok)throw Error((await t.json()).error||"Failed to like")}await I()},[null==A?void 0:A.did,I]),tm=(0,s.useCallback)(async(e,t)=>{let n=await fetch("/api/records",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({collection:"org.impactindexer.review.comment",record:{subject:{uri:"beads:".concat(e.nodeId),type:"record"},text:t,replyTo:e.uri,createdAt:new Date().toISOString()}})});if(!n.ok)throw Error((await n.json()).error||"Failed to post reply");await I()},[I]),tp=(0,s.useCallback)(e=>{if(!i)return;let t=i.graphData.nodes.find(t=>t.id===e);t&&x(t)},[i]),tf=(0,s.useMemo)(()=>{let e=new Map;if(!B)return e;let t=new Map;for(let e of B)t.has(e.nodeId)||t.set(e.nodeId,new Set),t.get(e.nodeId).add(e.handle),e.displayName&&t.get(e.nodeId).add(e.displayName);for(let[n,r]of t)e.set(n,Array.from(r).join(" "));return e},[B]),tg=(0,s.useMemo)(()=>{if(!i||!eN.trim())return[];let e=eN.toLowerCase();return i.graphData.nodes.filter(t=>{let n=tf.get(t.id)||"";return"".concat(t.id," ").concat(t.title," ").concat(t.prefix," ").concat(t.owner||""," ").concat(t.assignee||""," ").concat(t.createdBy||""," ").concat(n).toLowerCase().includes(e)}).slice(0,8)},[eN,i,tf]);(0,s.useEffect)(()=>{eE(0)},[eN]);let tv=(0,s.useCallback)(e=>{var t;null===(t=e0.current)||void 0===t||t.focusNode(e),ek(!1),eM(""),eE(0)},[]);(0,s.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&"f"===e.key&&(e.preventDefault(),ek(!0),setTimeout(()=>{var e;return null===(e=e1.current)||void 0===e?void 0:e.focus()},50)),"Escape"===e.key&&ew&&(ek(!1),eM(""),eE(0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ew]);let tb=(0,s.useCallback)(e=>{"ArrowDown"===e.key?(e.preventDefault(),eE(e=>Math.min(e+1,tg.length-1))):"ArrowUp"===e.key?(e.preventDefault(),eE(e=>Math.max(e-1,0))):"Enter"===e.key&&tg.length>0&&(e.preventDefault(),tv(tg[eT]))},[tg,eT,tv]);return a?(0,r.jsxs)("div",{className:"h-screen flex flex-col items-center justify-center bg-white",children:[(0,r.jsxs)("div",{className:"relative mb-6",children:[(0,r.jsx)("div",{className:"w-12 h-12 border-2 border-zinc-200 border-t-emerald-500 rounded-full animate-spin"}),(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("div",{className:"w-2 h-2 rounded-full bg-emerald-500"})})]}),(0,r.jsx)("p",{className:"text-sm text-zinc-500 animate-pulse-soft",children:"Loading beads graph..."}),(0,r.jsx)("p",{className:"text-xs text-zinc-400 mt-1",children:"Parsing issues and dependencies"})]}):c?(0,r.jsx)("div",{className:"h-screen flex items-center justify-center bg-white",children:(0,r.jsxs)("div",{className:"max-w-sm text-center",children:[(0,r.jsx)("div",{className:"w-14 h-14 mx-auto mb-4 bg-red-50 rounded-full flex items-center justify-center",children:(0,r.jsx)("svg",{className:"w-7 h-7 text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,r.jsx)("h2",{className:"text-lg font-semibold text-zinc-900 mb-1",children:"Unable to load data"}),(0,r.jsx)("p",{className:"text-sm text-zinc-500 mb-4",children:c}),(0,r.jsxs)("button",{onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2 px-4 py-2 bg-emerald-600 text-white text-sm rounded-lg hover:bg-emerald-700 transition-colors",children:[(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Try Again"]})]})}):i?(0,r.jsxs)("div",{className:"h-screen flex flex-col overflow-hidden bg-white",children:[(0,r.jsx)("header",{className:"sticky top-0 z-50 shrink-0 bg-white/95 backdrop-blur-sm border-b border-zinc-200/80",children:(0,r.jsxs)("div",{className:"px-6 h-14 flex items-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 shrink-0 group",children:[(0,r.jsx)(ed,{className:"w-8 h-8 text-emerald-500 transition-transform group-hover:scale-105"}),(0,r.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,r.jsx)("h1",{className:"text-[15px] font-semibold text-zinc-900 tracking-tight",children:k}),(0,r.jsx)("span",{className:"font-normal text-zinc-400 text-[15px] hidden sm:inline",children:"heartbeads"}),C>1&&(0,r.jsxs)("span",{className:"text-[10px] text-zinc-400 bg-zinc-100 rounded-full px-1.5 py-0.5 font-medium hidden sm:inline",children:[C," repos"]})]})]}),(0,r.jsx)("div",{className:"flex-1 flex justify-center px-4",children:(0,r.jsx)("div",{className:"relative w-full max-w-md","data-tutorial":"search",children:ew?(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsxs)("div",{className:"flex items-center bg-white rounded-full border border-zinc-200 shadow-sm overflow-hidden",children:[(0,r.jsx)("div",{className:"pl-3 pr-1 text-zinc-400",children:(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,r.jsx)("input",{ref:e1,type:"text",value:eN,onChange:e=>eM(e.target.value),onKeyDown:tb,placeholder:"Search issues...",className:"flex-1 px-2 py-1.5 text-xs text-zinc-800 bg-transparent outline-none placeholder:text-zinc-400",autoFocus:!0}),(0,r.jsx)("button",{onClick:()=>{ek(!1),eM(""),eE(0)},className:"px-2 py-1.5 text-zinc-400 hover:text-zinc-600",children:(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),eN.trim()&&(0,r.jsxs)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-white rounded-xl border border-zinc-100 shadow-xl overflow-hidden max-h-72 overflow-y-auto z-50",children:[0===tg.length?(0,r.jsx)("div",{className:"px-3 py-3 text-xs text-zinc-400 text-center",children:"No matching issues"}):tg.map((e,t)=>(0,r.jsxs)("button",{onClick:()=>tv(e),onMouseEnter:()=>eE(t),className:"w-full text-left px-3 py-2 text-xs transition-colors flex items-start gap-2.5 ".concat(t===eT?"bg-emerald-50":"hover:bg-zinc-50"),children:[(0,r.jsx)("div",{className:"shrink-0 mt-1",children:(0,r.jsx)("div",{className:"w-2 h-2 rounded-full ".concat(eV[e.status]||"bg-zinc-400")})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"font-medium text-zinc-600 shrink-0",children:e.id}),e.priority<=1&&(0,r.jsx)("span",{className:"text-[10px]",children:0===e.priority?"\uD83D\uDD25\uD83D\uDD25":"\uD83D\uDD25"})]}),(0,r.jsx)("div",{className:"text-zinc-400 truncate mt-0.5",children:e.title})]}),(0,r.jsx)("span",{className:"shrink-0 text-[10px] text-zinc-400 bg-zinc-100 rounded px-1 py-0.5 mt-0.5",children:e.prefix})]},e.id)),tg.length>0&&(0,r.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-zinc-400 border-t border-zinc-100 bg-zinc-50/50 flex items-center justify-between",children:[(0,r.jsxs)("span",{children:[tg.length," result",1!==tg.length?"s":""]}),(0,r.jsxs)("span",{children:[(0,r.jsx)("kbd",{className:"px-1 py-0.5 bg-white rounded border border-zinc-200 text-[9px] font-mono",children:"Enter"})," ","to focus"]})]})]})]}):(0,r.jsxs)("button",{onClick:()=>{ek(!0),setTimeout(()=>{var e;return null===(e=e1.current)||void 0===e?void 0:e.focus()},50)},className:"w-full flex items-center gap-2 px-3.5 py-1.5 text-sm text-zinc-400 rounded-full bg-zinc-50/80 border border-zinc-200/60 hover:text-zinc-500 hover:border-zinc-300 hover:bg-zinc-100/50 transition-all",title:"Search issues (Ctrl+F)",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5 shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,r.jsx)("span",{className:"flex-1 text-left",children:"Search issues..."}),(0,r.jsxs)("kbd",{className:"hidden sm:inline-block px-1 py-0.5 bg-zinc-100 rounded border border-zinc-200 text-[9px] font-mono text-zinc-400",children:["undefined"!=typeof navigator&&(null===(e=navigator.platform)||void 0===e?void 0:e.includes("Mac"))?"⌘":"Ctrl","F"]})]})})}),(0,r.jsxs)("div",{className:"hidden md:flex items-center gap-1 shrink-0","data-tutorial":"nav-pills",children:[(0,r.jsxs)("button",{onClick:e4,className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ".concat(eB?"text-emerald-700 bg-emerald-50":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50"),children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Replay"})]}),(0,r.jsxs)("button",{onClick:()=>{U(e=>!e),H||(x(null),K(!1),J(!1),Q(null))},className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ".concat(H?"text-emerald-700 bg-emerald-50":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50"),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 011.037-.443 48.282 48.282 0 005.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Comments"})]}),(0,r.jsxs)("button",{onClick:()=>{K(e=>!e),q||(x(null),U(!1),J(!1),Q(null))},className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ".concat(q?"text-emerald-700 bg-emerald-50":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50"),children:[(0,r.jsxs)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6"}),(0,r.jsx)("polyline",{points:"8,4 8,8 11,10"})]}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Activity"})]}),(0,r.jsxs)("button",{onClick:()=>{J(e=>!e),G||(x(null),U(!1),K(!1))},className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-full transition-colors ".concat(G?"text-emerald-700 bg-emerald-50":"text-zinc-500 hover:text-zinc-900 hover:bg-zinc-50"),children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Learn"})]}),(0,r.jsx)("div",{className:"w-px h-5 bg-zinc-200 mx-2"}),(0,r.jsx)("button",{onClick:()=>ef(!0),className:"p-2 text-zinc-400 hover:text-zinc-600 hover:bg-zinc-50 rounded-full transition-colors",title:"Settings",children:(0,r.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:[(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 010 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 010-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28z"}),(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),(0,r.jsx)(ec,{})]})]})}),(0,r.jsxs)("div",{className:"flex-1 flex overflow-hidden relative",children:[(0,r.jsxs)("div",{className:"flex-1 relative bg-zinc-50/50",children:[(0,r.jsx)("div",{className:"absolute inset-0 opacity-[0.03]",style:{backgroundImage:"radial-gradient(circle, #000 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,r.jsx)(D,{ref:e0,nodes:eB&&eX?eX.graphData.nodes:i.graphData.nodes,links:eB&&eX?eX.graphData.links:i.graphData.links,selectedNode:u,hoveredNode:m,onNodeClick:e3,onNodeHover:e6,onBackgroundClick:ta,onNodeRightClick:to,commentedNodeIds:E,claimedNodeAvatars:O,onAvatarHover:eb,timelineActive:eB,stats:i.stats,sidebarOpen:!!u||H||q||G,collapsedEpicIds:f,onCollapseAll:e9,onExpandAll:te,focusedEpicId:b,onExitFocusedEpic:tn,colorMode:y,onColorModeChange:w,autoFit:eG,onAutoFitToggle:()=>eJ(e=>!e),pulseNodeId:V.length>0?V[0].nodeId:null,showPulse:eZ,onShowPulseToggle:()=>eQ(e=>!e)}),eB&&e2&&e2.events.length>0&&(0,r.jsx)("div",{className:"absolute bottom-4 z-10 transition-[right] duration-300 ease-out",style:{right:u||H||q?"calc(360px + 1rem)":"1rem"},children:(0,r.jsx)(eH,{totalSteps:e2.events.length,currentStep:Math.max(eW,0),currentTime:eW>=0&&null!==(n=null===(t=e2.events[eW])||void 0===t?void 0:t.time)&&void 0!==n?n:e2.minTime,isPlaying:eR,speed:eq,onStepChange:eF,onPlayPause:()=>eY(e=>!e),onSpeedChange:eK})}),!u&&!H&&!q&&!G&&!eB&&(0,r.jsx)("div",{className:"absolute top-3 right-3 sm:top-4 sm:right-4 z-10",children:(0,r.jsx)(eC,{events:V,collapsed:X,onToggleCollapse:()=>$(e=>!e),onExpandPanel:()=>{K(!0),x(null),U(!1),J(!1)},onNodeClick:e=>{let t=null==i?void 0:i.graphData.nodes.find(t=>t.id===e);t&&tv(t)}})}),er&&(0,r.jsx)(ex,{node:er.node,x:er.x,y:er.y,onShowDescription:()=>{eh(er.node),es(null)},onAddComment:()=>{el({node:er.node,x:er.x,y:er.y}),es(null)},onClaimTask:L&&!O.has(er.node.id)?()=>{td(er.node.id),es(null)}:void 0,onUnclaimTask:(()=>{if(!L)return;let e=O.get(er.node.id);if(e&&(e.did===(null==A?void 0:A.did)||!e.did))return()=>{tx(er.node.id),es(null)}})(),onCollapseEpic:"epic"!==er.node.issueType||f.has(er.node.id)?void 0:()=>{e8(er.node.id),es(null)},onUncollapseEpic:"epic"===er.node.issueType&&f.has(er.node.id)?()=>{e8(er.node.id),es(null)}:void 0,onFocusEpic:"epic"!==er.node.issueType||b?void 0:()=>{tt(er.node.id),es(null)},onExitFocusEpic:"epic"===er.node.issueType&&b===er.node.id?()=>{tn(),es(null)}:void 0,onClose:()=>es(null)}),ei&&(0,r.jsx)(eu,{node:ei.node,x:ei.x,y:ei.y,onClose:()=>el(null),onSubmit:async e=>{await tc(ei.node.id,e),el(null)},isAuthenticated:L,existingComments:T.get(ei.node.id)}),ea&&(0,r.jsx)(ee,{node:ea,onClose:()=>eh(null),repoUrl:M[ea.prefix],onOpenSettings:()=>ef(!0)}),(0,r.jsx)(eP,{isOpen:ep,onClose:()=>ef(!1)}),ej&&!ev&&(0,r.jsx)(em,{node:ej.node,x:ej.x,y:ej.y,prefixColor:h(ej.node.prefix),allNodes:eB&&eX?eX.graphData.nodes:i.graphData.nodes}),ev&&(0,r.jsx)("div",{style:{position:"fixed",left:ev.x+12,top:ev.y-8,zIndex:90,pointerEvents:"none"},children:(0,r.jsxs)("div",{className:"flex items-center gap-2 bg-white border border-zinc-200 rounded-lg shadow-lg px-2.5 py-2",children:[ev.avatar?(0,r.jsx)("img",{src:ev.avatar,alt:"",className:"w-6 h-6 rounded-full shrink-0"}):(0,r.jsx)("div",{className:"w-6 h-6 rounded-full bg-zinc-200 flex items-center justify-center text-[10px] font-medium text-zinc-500 shrink-0",children:ev.handle.charAt(0).toUpperCase()}),(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsxs)("span",{className:"text-xs text-zinc-700 whitespace-nowrap",children:[ev.did?(0,r.jsx)("a",{href:"https://www.impactindexer.org/data?did=".concat(ev.did),target:"_blank",rel:"noopener noreferrer",className:"font-semibold text-zinc-800 hover:text-emerald-600 transition-colors",style:{pointerEvents:"auto"},children:ev.handle}):(0,r.jsx)("span",{className:"font-semibold text-zinc-800",children:ev.handle})," claimed this task"]}),(0,r.jsx)("span",{className:"text-[10px] text-zinc-400",children:P(ev.claimedAt)})]})]})})]}),(0,r.jsxs)("aside",{className:"hidden md:flex absolute top-0 right-0 h-full w-[360px] bg-white border-l border-zinc-200 flex-col shadow-xl z-30 transform transition-transform duration-300 ease-out ".concat(u?"translate-x-0":"translate-x-full"),children:[(0,r.jsxs)("div",{className:"shrink-0 px-5 py-3 border-b border-zinc-100 flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-xs font-semibold text-zinc-400 uppercase tracking-wider",children:"Node Detail"}),(0,r.jsx)("button",{onClick:()=>{x(null)},className:"p-1 text-zinc-400 hover:text-zinc-600 transition-colors rounded-full hover:bg-zinc-100",children:(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-5 py-4 space-y-5",children:(0,r.jsx)(en,{node:u,allNodes:i.graphData.nodes,onNodeNavigate:tp,comments:u?T.get(u.id):void 0,onPostComment:u?e=>tc(u.id,e):void 0,onDeleteComment:tu,onLikeComment:th,onReplyComment:tm,isAuthenticated:L,currentDid:null==A?void 0:A.did,repoUrls:M,onOpenSettings:()=>ef(!0)})})]}),(0,r.jsx)("div",{className:"md:hidden fixed inset-x-0 bottom-0 z-20 transform transition-transform duration-300 ease-out ".concat(u?"translate-y-0":"translate-y-full"),children:(0,r.jsxs)("div",{className:"bg-white rounded-t-2xl border-t border-zinc-200 shadow-lg max-h-[60vh] flex flex-col",children:[(0,r.jsxs)("div",{className:"shrink-0 flex items-center justify-between px-4 pt-3 pb-2",children:[(0,r.jsx)("div",{className:"w-8 h-1 bg-zinc-300 rounded-full mx-auto"}),(0,r.jsx)("button",{onClick:()=>x(null),className:"absolute right-3 top-3 p-1 text-zinc-400 hover:text-zinc-600",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar px-4 pb-6 space-y-4",children:(0,r.jsx)(en,{node:u,allNodes:i.graphData.nodes,onNodeNavigate:tp,comments:u?T.get(u.id):void 0,onPostComment:u?e=>tc(u.id,e):void 0,onDeleteComment:tu,onLikeComment:th,onReplyComment:tm,isAuthenticated:L,currentDid:null==A?void 0:A.did,repoUrls:M,onOpenSettings:()=>ef(!0)})})]})}),(0,r.jsx)(eg,{isOpen:H,onClose:()=>U(!1),allComments:B.filter(e=>et.has(e.nodeId)),onNodeNavigate:e=>{tp(e),U(!1)},isAuthenticated:L,currentDid:null==A?void 0:A.did,onLikeComment:th,onDeleteComment:tu}),(0,r.jsx)(eS,{events:V,isOpen:q,onClose:()=>K(!1),onNodeClick:e=>{let t=null==i?void 0:i.graphData.nodes.find(t=>t.id===e);t&&(tv(t),K(!1))}}),(0,r.jsx)(eD,{isOpen:G,onClose:()=>{J(!1),Q(null)},tutorialStep:Z,onStartTutorial:tr,onNextStep:ts,onPrevStep:ti,onEndTutorial:tl})]}),(0,r.jsx)(eA,{step:Z,onNext:ts,onPrev:ti,onEnd:tl})]}):null}},7796:function(e,t,n){"use strict";n.d(t,{AuthProvider:function(){return l},a:function(){return a}});var r=n(3890),s=n(8496);let i=(0,s.createContext)(null);function l(e){let{children:t}=e,[n,l]=(0,s.useState)({status:"idle",session:null,error:null,isLoading:!0});(0,s.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/status");if(t.ok){let n=await t.json();if(n.did&&!e){l({status:"authenticated",session:{did:n.did,handle:n.handle||n.did,displayName:n.displayName,avatar:n.avatar},error:null,isLoading:!1});return}}}catch(e){console.error("Failed to check auth status:",e)}e||l(e=>({...e,isLoading:!1}))})(),()=>{e=!0}},[]);let a=(0,s.useCallback)(async e=>{l(e=>({...e,status:"authorizing",isLoading:!0,error:null}));try{let t=e.includes(".")?e:"".concat(e,".bsky.social"),n=await fetch("/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({handle:t,returnTo:window.location.pathname+window.location.search})});if(!n.ok){let e=await n.json();throw Error(e.error||"Login failed")}let r=await n.json();window.location.href=r.redirectUrl}catch(t){let e=t instanceof Error?t:Error("Login failed");throw l({status:"error",session:null,error:e,isLoading:!1}),e}},[]),o=(0,s.useCallback)(async()=>{try{await fetch("/api/logout",{method:"POST"})}catch(e){console.error("Logout request failed:",e)}l({status:"idle",session:null,error:null,isLoading:!1})},[]);return(0,r.jsx)(i.Provider,{value:{state:n,login:a,logout:o},children:t})}function a(){let e=(0,s.useContext)(i);if(!e)throw Error("useAuth must be used within an AuthProvider");let{state:t,login:n,logout:r}=e;return{status:t.status,session:t.session,error:t.error,isLoading:t.isLoading,isAuthenticated:"authenticated"===t.status,login:n,logout:r}}}},function(e){e.O(0,[971,649,945,744],function(){return e(e.s=6284)}),_N_E=e.O()}]);
|