signetai 0.99.4 → 0.99.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dashboard/_app/immutable/chunks/{DG9BAtnL.js → B-qBK290.js} +1 -1
  2. package/dashboard/_app/immutable/chunks/{luIIGIg3.js → B5lrCws9.js} +1 -1
  3. package/dashboard/_app/immutable/chunks/{Djqk_tSD.js → B6Cive8v.js} +1 -1
  4. package/dashboard/_app/immutable/chunks/{DW6yNtYe.js → BFh_UwBu.js} +1 -1
  5. package/dashboard/_app/immutable/chunks/{CkoJbjQy.js → BJucan2B.js} +1 -1
  6. package/dashboard/_app/immutable/chunks/{Dl8Tci59.js → BMsAQcbx.js} +1 -1
  7. package/dashboard/_app/immutable/chunks/{DzoewAYs.js → BS5O1Puy.js} +1 -1
  8. package/dashboard/_app/immutable/chunks/{DKm5w4GC.js → BVC1mSyy.js} +1 -1
  9. package/dashboard/_app/immutable/chunks/{C1tJUCK8.js → BY6JMlxK.js} +1 -1
  10. package/dashboard/_app/immutable/chunks/{upuFn9iL.js → BZECXRO2.js} +1 -1
  11. package/dashboard/_app/immutable/chunks/{COy2S9B7.js → Bqa2y42c.js} +1 -1
  12. package/dashboard/_app/immutable/chunks/{BvAGO962.js → BtgOjPDd.js} +1 -1
  13. package/dashboard/_app/immutable/chunks/{DfV7ZDK6.js → BySa4D8U.js} +1 -1
  14. package/dashboard/_app/immutable/chunks/{DwG1V69x.js → C37QQt_q.js} +1 -1
  15. package/dashboard/_app/immutable/chunks/{CSLgXZO4.js → C6uASK-X.js} +1 -1
  16. package/dashboard/_app/immutable/chunks/{DDvvRs92.js → CHVEkfA1.js} +1 -1
  17. package/dashboard/_app/immutable/chunks/{Omubrwlt.js → CMlTYJBd.js} +1 -1
  18. package/dashboard/_app/immutable/chunks/{CV8q0vOz.js → CO5tVDYf.js} +1 -1
  19. package/dashboard/_app/immutable/chunks/{2c-qP0_r.js → COVmzYzo.js} +1 -1
  20. package/dashboard/_app/immutable/chunks/{B-ijPW4B.js → CQH5xvty.js} +1 -1
  21. package/dashboard/_app/immutable/chunks/{Bhm1jlec.js → CTzXf5I0.js} +1 -1
  22. package/dashboard/_app/immutable/chunks/{BKVMhX25.js → CWt_c1oW.js} +1 -1
  23. package/dashboard/_app/immutable/chunks/{BKRvfcys.js → Cp5h4mva.js} +1 -1
  24. package/dashboard/_app/immutable/chunks/{BkVbX-P9.js → CzWYPCkA.js} +1 -1
  25. package/dashboard/_app/immutable/chunks/{BN-nfdi2.js → D0-12z-N.js} +1 -1
  26. package/dashboard/_app/immutable/chunks/{CTkozto3.js → D00It2nm.js} +1 -1
  27. package/dashboard/_app/immutable/chunks/{GsPUWmj4.js → D0L5kY4V.js} +1 -1
  28. package/dashboard/_app/immutable/chunks/{XrVkjGkY.js → DAqG7HJA.js} +1 -1
  29. package/dashboard/_app/immutable/chunks/{BSseXeZ1.js → DCDGSC61.js} +1 -1
  30. package/dashboard/_app/immutable/chunks/{DNCiYhnc.js → DJJ87OS5.js} +1 -1
  31. package/dashboard/_app/immutable/chunks/{BhOic_Sj.js → DOn7oLru.js} +1 -1
  32. package/dashboard/_app/immutable/chunks/{Bym3JlsZ.js → DV1Lz39H.js} +1 -1
  33. package/dashboard/_app/immutable/chunks/{BWIrtXd4.js → DVw276oh.js} +1 -1
  34. package/dashboard/_app/immutable/chunks/{Cg0NLENm.js → DYbVnDom.js} +1 -1
  35. package/dashboard/_app/immutable/chunks/{FzzbBJ_o.js → Ddp98Nis.js} +1 -1
  36. package/dashboard/_app/immutable/chunks/{CFs7V0ue.js → De5Vgg65.js} +1 -1
  37. package/dashboard/_app/immutable/chunks/{D3wgY3QD.js → DvfF3_kR.js} +1 -1
  38. package/dashboard/_app/immutable/chunks/{B3mStXdX.js → P9ZI_tln.js} +1 -1
  39. package/dashboard/_app/immutable/chunks/{BxVN3Z54.js → TJiN35vI.js} +3 -3
  40. package/dashboard/_app/immutable/chunks/{d4jwSSHp.js → aR0Qs5FU.js} +1 -1
  41. package/dashboard/_app/immutable/chunks/{mHqg6Dyu.js → b3LeiEbt.js} +1 -1
  42. package/dashboard/_app/immutable/chunks/{CFkNGog0.js → g781kcHO.js} +1 -1
  43. package/dashboard/_app/immutable/chunks/{DKofImZU.js → izQcI5R4.js} +1 -1
  44. package/dashboard/_app/immutable/chunks/{DvGDiLmU.js → j-vHyZXg.js} +1 -1
  45. package/dashboard/_app/immutable/chunks/{BCQorotL.js → mSwAL5NY.js} +1 -1
  46. package/dashboard/_app/immutable/chunks/{D_m6fuaV.js → sYEZEBvM.js} +1 -1
  47. package/dashboard/_app/immutable/chunks/{BcvOjEIK.js → t6pU3Hr6.js} +2 -2
  48. package/dashboard/_app/immutable/chunks/{B7eYY6PO.js → w-Ya5SeI.js} +2 -2
  49. package/dashboard/_app/immutable/entry/{app.C1bwTsFZ.js → app.CVWdsYkj.js} +2 -2
  50. package/dashboard/_app/immutable/entry/start.JjJqmlyc.js +1 -0
  51. package/dashboard/_app/immutable/nodes/{1.DX4_WfjY.js → 1._A78fZ2Q.js} +1 -1
  52. package/dashboard/_app/immutable/nodes/2.HfU5JheB.js +1 -0
  53. package/dashboard/_app/version.json +1 -1
  54. package/dashboard/index.html +6 -6
  55. package/package.json +1 -1
  56. package/dashboard/_app/immutable/entry/start.BPoI4mgT.js +0 -1
  57. package/dashboard/_app/immutable/nodes/2.Cf43HU-I.js +0 -1
@@ -1 +1 @@
1
- import{p as wn,o as p,e as Ie,Q as ne,v as n,j as l,F as hr,i as e,t as d,k as j,l as s,b as u,d as Sn,u as Q,D as fn,O as Y,N as Ar,m as x,P as Mn,g as cr,y as F,B as mt,f as xe,w as gr,aa as Bt,z as h,A as Mt,K as kt,c as vr,q as No,$ as Fo,h as Yt,ac as Jt,ad as Br,I as dr,ae as oa,U as un,af as Po}from"./o6XZc-z-.js";import{L as Co,A as gn,n as ia,N as Lo,O as sa,P as Do,Q as la,R as Ao,T as Ro,h as Oo,i as Yo,U as vn,V as Xo,W as jo,X as Ho,t as Mr}from"./BxVN3Z54.js";import{P as Go}from"./DiLyuexf.js";import{T as zo}from"./BBTUzYSt.js";import{C as Pr,a as Cr,b as Lr}from"./BVExryab.js";import{w as kr,s as Bo}from"./DCVuVDO1.js";import{f as da,a as ca,b as ua,c as ga,e as va,g as pa}from"./qiR1fnXB.js";import{C as Dr}from"./GsPUWmj4.js";const Wr=600,Wo=5e3,fa="signet-embeddings-graph-physics",Ir={centerForce:.28,repelForce:-260,linkForce:.12,linkDistance:92},mn={"claude-code":"#5eada4",clawdbot:"#a78bfa",daemon:"#22c55e","signet-daemon":"#22c55e",openclaw:"#facc15","openclaw-memory":"#facc15",opencode:"#60a5fa",user:"#ef4444",manual:"#f472b6",unknown:"#737373"},ma=3600*1e3,Ko=24*ma,xa=7*Ko,ba=900*1e3,ha=6*ma;function xn(y){const o=(f,S,v)=>Math.min(v,Math.max(S,f));return{centerForce:o(y.centerForce,0,1),repelForce:o(y.repelForce,-600,-10),linkForce:o(y.linkForce,.01,1),linkDistance:o(y.linkDistance,12,280)}}function kn(y){const o=Number.parseInt(y.slice(1),16);return[o>>16&255,o>>8&255,o&255]}function ya(y,o){const[f,S,v]=kn(mn[y??"unknown"]??mn.unknown);return`rgba(${f}, ${S}, ${v}, ${o})`}function _a(y){if(!y)return null;const o=new Date(y).getTime();return Number.isNaN(o)?null:o}function qo(y,o){const f=_a(y);if(f===null)return .22;const S=Math.max(0,o-f);return S<=ba?1:S<=ha?.76:S<=xa?.52:.22}function In(y){return y>=.95?"minutes":y>=.7?"hours":y>=.45?"week":"older"}function wa(y,o){const f=In(y);return f==="minutes"?`rgba(255, 176, 74, ${o})`:f==="hours"?`rgba(168, 34, 98, ${o})`:f==="week"?`rgba(76, 34, 122, ${o})`:`rgba(118, 111, 102, ${o})`}function Uo(y,o){if(o===null)return!1;const f=_a(y);return f===null?!1:f>o}function yr(y){const o=y.content??y.text??"";return o.length>160?`${o.slice(0,160)}...`:o}function Vo(y){const o=y.sourceType??"memory",f=y.sourceId??y.id;return`${o}:${f}`}function Jo(y,o,f,S,v,_){const U=f!==null&&!f.has(y),K=f!==null&&!f.has(o);if(U||K)return"rgba(120, 120, 120, 0.12)";if(_){const V=v.has(y),ve=v.has(o);return V&&ve?"rgba(220, 220, 220, 0.72)":"rgba(90, 90, 90, 0.08)"}return S.get(y)||S.get(o)?"rgba(200, 200, 200, 0.6)":"rgba(180, 180, 180, 0.4)"}const qr={person:"#eab308",project:"#06b6d4",system:"#a855f7",tool:"#10b981",concept:"#f43f5e",skill:"#f59e0b",task:"#64748b",unknown:"#737373"};function bn(y){return qr[y.toLowerCase()]??qr.unknown}function Kr(y,o){const f=bn(y),[S,v,_]=kn(f);return`rgba(${S}, ${v}, ${_}, ${o})`}function Qo(y,o){const f=.8+o*1.2;switch(y){case"uses":case"requires":return{color:"rgba(180, 180, 200, 0.35)",width:f,dash:[]};case"owned_by":return{color:"rgba(160, 160, 180, 0.25)",width:f+.4,dash:[]};case"blocks":return{color:"rgba(220, 100, 100, 0.4)",width:f,dash:[4,3]};case"informs":return{color:"rgba(100, 160, 220, 0.35)",width:f,dash:[2,3]};default:return{color:"rgba(150, 150, 160, 0.3)",width:f,dash:[]}}}function Zo(y){return 5+Math.min(y,1)*3}function $o(y){return 3+Math.min(y,1)}function ei(y){const o=y.aspects.length+y.aspects.reduce((f,S)=>f+S.attributes.length*.5,0);return 10+Math.min(o,24)*.5}function ti(y){switch(y){case"entity":return-200;case"aspect":return-40;case"attribute":return-15;case"memory":return-5;default:return-5}}function Sa(y,o){const[f,S,v]=kn(y);return`rgba(${f}, ${S}, ${v}, ${o})`}const ri=[.85],ni=[.3,.5,.7,.75,.9],hn={};for(const[y,o]of Object.entries(mn)){const f={};for(const S of ri)f[S]=Sa(o,S);hn[y]=f}const yn={};for(const[y,o]of Object.entries(qr)){const f={};for(const S of ni)f[S]=Sa(o,S);yn[y]=f}function _n(y,o){const S=hn[y??"unknown"]?.[o]??hn.unknown?.[o];return S||ya(y,o)}function br(y,o){const f=y.toLowerCase(),S=yn[f]?.[o]??yn.unknown?.[o];return S||Kr(y,o)}const ai={minutes:{.9:"rgba(255, 176, 74, 0.9)",1:"rgba(255, 176, 74, 1)"},hours:{.9:"rgba(168, 34, 98, 0.9)",1:"rgba(168, 34, 98, 1)"},week:{.9:"rgba(76, 34, 122, 0.9)",1:"rgba(76, 34, 122, 1)"},older:{.9:"rgba(118, 111, 102, 0.9)",1:"rgba(118, 111, 102, 1)"}};function oi(y,o){const f=In(y),S=ai[f]?.[o];return S||wa(y,o)}function Ma(y){if(!y)return 0;const o=new Date(y).getTime();return Number.isNaN(o)?0:o}function ii(y,o){if(y===0)return .22;const f=Math.max(0,o-y);return f<=ba?1:f<=ha?.76:f<=xa?.52:.22}class si{fills;constructor(o,f,S,v,_,U,K,V,ve,ot){const ae=new Array(o.length);for(let Ae=0;Ae<o.length;Ae++){const Re=o[Ae];if(Re.nodeType&&Re.nodeType!=="memory"){ae[Ae]="";continue}ae[Ae]=this.compute(Re,f,S,v,_,U,K,V,ve,ot)}this.fills=ae}compute(o,f,S,v,_,U,K,V,ve,ot){const ae=o.data.id,Ae=v.get(ae)??null,Re=S!==null&&!S.has(ae),it=_.has(ae),Oe=K&&!U.has(ae);if(f===ae)return"rgba(255, 255, 255, 0.95)";if(Oe)return Re?"rgba(80, 80, 80, 0.08)":"rgba(95, 95, 95, 0.15)";if(Ae==="similar")return V==="none"?Re?"rgba(160, 170, 185, 0.3)":"rgba(198, 210, 228, 0.84)":Re?"rgba(129, 180, 255, 0.35)":"rgba(129, 180, 255, 0.9)";if(Ae==="dissimilar")return V==="none"?Re?"rgba(165, 150, 150, 0.28)":"rgba(208, 190, 190, 0.8)":Re?"rgba(255, 146, 146, 0.35)":"rgba(255, 146, 146, 0.9)";if(it)return Re?"rgba(220, 220, 220, 0.42)":"rgba(235, 235, 235, 0.95)";if(Re)return"rgba(120, 120, 120, 0.2)";if(V==="none")return"rgba(168, 168, 168, 0.82)";if(V==="newness"){const Je=o.createdMs??Ma(o.data.createdAt),Pt=ii(Je,ve);if(In(Pt)==="older"){const It=o.data.who??"unknown";if(ot!==null&&ot.has(It))return _n(It,.85)}return oi(Pt,.9)}return _n(o.data.who,.85)}}const or=50;class li{minX=-100;maxX=100;minY=-100;maxY=100;cells=new Map;cols=1;offsetX=0;offsetY=0;rebuild(o){if(this.cells.clear(),o.length===0){this.minX=-100,this.maxX=100,this.minY=-100,this.maxY=100,this.cols=1;return}let f=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,v=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(const K of o)K.x<f&&(f=K.x),K.x>S&&(S=K.x),K.y<v&&(v=K.y),K.y>_&&(_=K.y);const U=or;this.minX=f-U,this.maxX=S+U,this.minY=v-U,this.maxY=_+U,this.offsetX=this.minX,this.offsetY=this.minY,this.cols=Math.max(1,Math.ceil((this.maxX-this.minX)/or));for(const K of o){const V=Math.floor((K.x-this.offsetX)/or),ot=Math.floor((K.y-this.offsetY)/or)*this.cols+V,ae=this.cells.get(ot);ae?ae.push(K):this.cells.set(ot,[K])}}query(o,f,S){const v=S+or*.5,_=Math.floor((o-v-this.offsetX)/or),U=Math.floor((o+v-this.offsetX)/or),K=Math.floor((f-v-this.offsetY)/or),V=Math.floor((f+v-this.offsetY)/or),ve=Math.ceil((this.maxY-this.minY)/or),ot=[];for(let ae=Math.max(0,K);ae<=V&&ae<ve;ae++)for(let Ae=Math.max(0,_);Ae<=Math.min(this.cols-1,U);Ae++){const Re=this.cells.get(ae*this.cols+Ae);if(Re)for(const it of Re)ot.push(it)}return ot}}function pn(y,o,f,S){y.beginPath();for(let v=0;v<6;v++){const _=Math.PI/3*v-Math.PI/6,U=o+S*Math.cos(_),K=f+S*Math.sin(_);v===0?y.moveTo(U,K):y.lineTo(U,K)}y.closePath()}var di=x('<canvas class="minimap svelte-reb91a" aria-label="Graph navigation minimap"></canvas>'),ci=x('<div class="canvas-wrapper svelte-reb91a"><canvas class="main-canvas svelte-reb91a"></canvas> <!></div>');function ui(y,o){wn(o,!0);let f=p(null),S=0,v=0,_=.15,U=!1,K=!1,V=!1,ve=null,ot=0,ae=0,Ae=0,Re=0;const it=4;let Oe=null,Je=0,Pt=null,It=!1,tr=0,Te=!0,Qt=null,xt=!1,Wt=new Map;const bt=new li;let Xt=!0,jt=null,ht=[],G=[],Z=[],ue=0,ze=0,dt=!1;const me=160,Ye=120,Be=50;let Ze=p(null),Xe=!0,$e=0;const ct=4;let Ct=p(Ie({minX:-100,maxX:100,minY:-100,maxY:100}));const be=Q(()=>o.nodes.length>Be);let Ue=!1;function pe(){if(Te=!0,Xe=!0,!Je){const i=e(f)?.getContext("2d");i&&(Je=requestAnimationFrame(I=>$(i,I)))}}const ut=12e3,se=8e3,Ee=5e3;function ye(){S=0,v=0,_=.15,xt=!1,je=!1}let je=!1;function st(i){const I=Wt.get(i);I&&(S=I.x,v=I.y,_=Math.max(_,1.6),xt=!0)}function Tt(i,I,B=o.graphPhysics){Oe?.stop(),je=!1;const de=xn(B);Oe=da(i).force("link",ca(I).distance(de.linkDistance).strength(de.linkForce)).force("charge",ua().strength(de.repelForce)).force("x",ga(0).strength(de.centerForce)).force("y",va(0).strength(de.centerForce)).force("collide",pa().radius(H=>H.radius+2)).alphaDecay(.04).on("tick",()=>{Xt=!0,jt=null,pe()}).on("end",()=>{xt||gt()})}function yt(i,I){Oe?.stop(),je=!1;const B=ca(I).distance(H=>{const _e=H.source,ge=H.target;return H.edgeType==="dependency"?120:_e.nodeType==="entity"&&ge.nodeType==="aspect"?50:_e.nodeType==="aspect"&&ge.nodeType==="attribute"?30:_e.nodeType==="attribute"&&ge.nodeType==="memory"?20:50}).strength(H=>{if(H.edgeType==="dependency")return .05;const _e=H.source,ge=H.target;return _e.nodeType==="entity"&&ge.nodeType==="aspect"?.3:_e.nodeType==="aspect"&&ge.nodeType==="attribute"?.4:_e.nodeType==="attribute"&&ge.nodeType==="memory"?.5:.3}),de=ua().strength(H=>ti(H.nodeType));Oe=da(i).force("link",B).force("charge",de).force("x",ga(0).strength(.03)).force("y",va(0).strength(.03)).force("collide",pa().radius(H=>H.radius+2)).alphaDecay(.04).on("tick",()=>{Xt=!0,jt=null,pe()}).on("end",()=>{xt||gt()})}function Lt(i){Oe&&(Tt(o.nodes,o.edges,i),pe())}function fe(){Oe?.stop(),Oe=null}function He(i=!1){lt(),!i&&!xt&&o.nodes.length>0&&gt(),It||(window.addEventListener("resize",lt),It=!0),_t(),Te=!0;const I=e(f)?.getContext("2d");I&&(cancelAnimationFrame(Je),$(I,0))}function We(){Te=!0;const i=e(f)?.getContext("2d");i&&(cancelAnimationFrame(Je),$(i,0))}function Dt(){cancelAnimationFrame(Je)}function lt(){if(!e(f))return;let i=e(f).parentElement;for(;i&&getComputedStyle(i).display==="contents";)i=i.parentElement;const I=i?.getBoundingClientRect();!I||I.width===0||(e(f).width=I.width,e(f).height=I.height,!xt&&je&&gt(),pe())}function gt(){if(!e(f))return;if(o.nodes.length===0){S=0,v=0,_=.15;return}const i=Ht(),I=Math.max(i.maxX-i.minX,1),B=Math.max(i.maxY-i.minY,1),de=Math.max(e(f).width,1),H=Math.max(e(f).height,1),_e=Math.min(de/I,H/B)*.92;S=(i.minX+i.maxX)/2,v=(i.minY+i.maxY)/2,_=Math.max(.08,_e),je=!0}function et(i,I){if(!e(f))return[0,0];const B=e(f).getBoundingClientRect(),de=B.width/2,H=B.height/2;return[(i-B.left-de)/_+S,(I-B.top-H)/_+v]}function tt(i,I){Xt&&(bt.rebuild(o.nodes),Xt=!1);const B=bt.query(i,I,28),de=["entity","aspect","attribute","memory",void 0];for(const H of de)for(let _e=B.length-1;_e>=0;_e--){const ge=B[_e];if(ge.nodeType!==H)continue;const ie=ge.x-i,Ke=ge.y-I,P=ge.radius+(H==="entity"?6:H==="aspect"?5:4);if(ie*ie+Ke*Ke<=P*P)return ge}return null}function Ht(){return o.nodes.length===0?{minX:-100,maxX:100,minY:-100,maxY:100}:Xt?(bt.rebuild(o.nodes),Xt=!1,{minX:bt.minX,maxX:bt.maxX,minY:bt.minY,maxY:bt.maxY}):{minX:bt.minX,maxX:bt.maxX,minY:bt.minY,maxY:bt.maxY}}ne(()=>{o.nodes.length>0&&(Wt=new Map(o.nodes.map(i=>[i.data.id,i])),Xt=!0,jt=null,n(Ct,Ht(),!0),Xe=!0)});function $t(){if(!e(Ze)||!e(f))return;const i=e(Ze).getContext("2d");if(!i)return;const{minX:I,maxX:B,minY:de,maxY:H}=e(Ct),_e=B-I,ge=H-de;i.fillStyle="#050505",i.fillRect(0,0,me,Ye);const ie=(me-8)/_e,Ke=(Ye-8)/ge,P=Math.min(ie,Ke),qe=(me-_e*P)/2,m=(Ye-ge*P)/2;i.fillStyle="rgba(140, 140, 150, 0.5)";for(const ir of o.nodes){const Rr=qe+(ir.x-I)*P,Or=m+(ir.y-de)*P;i.fillRect(Rr-.5,Or-.5,1,1)}const q=e(f).width/_,W=e(f).height/_,C=S-q/2,O=v-W/2;let X=qe+(C-I)*P,we=m+(O-de)*P,Nt=q*P,Ut=W*P;const pt=2;X=Math.max(pt,Math.min(me-pt-1,X)),we=Math.max(pt,Math.min(Ye-pt-1,we)),Nt=Math.max(2,Math.min(me-X-pt,Nt)),Ut=Math.max(2,Math.min(Ye-we-pt,Ut)),i.strokeStyle="rgba(255, 255, 255, 0.75)",i.lineWidth=1.5,i.strokeRect(X,we,Nt,Ut),i.fillStyle="rgba(255, 255, 255, 0.03)",i.fillRect(X,we,Nt,Ut)}function E(i){if(!e(Ze))return null;const I=e(Ze).getBoundingClientRect(),B=i.clientX-I.left,de=i.clientY-I.top,{minX:H,maxX:_e,minY:ge,maxY:ie}=e(Ct),Ke=_e-H,P=ie-ge,qe=(me-8)/Ke,m=(Ye-8)/P,q=Math.min(qe,m),W=(me-Ke*q)/2,C=(Ye-P*q)/2,O=H+(B-W)/q,X=ge+(de-C)/q;return[O,X]}function oe(i){i.preventDefault(),i.stopPropagation(),Ue=!0,Kt(i)}function Ge(i){Ue&&Kt(i)}function Kt(i){const I=E(i);if(!I)return;const[B,de]=I;if(S=B,v=de,Xe=!0,Te=!0,!Je){const H=e(f)?.getContext("2d");H&&(Je=requestAnimationFrame(_e=>$(H,_e)))}}function Et(){Ue=!1}function $(i,I){if(!e(f))return;const B=Oe?.alpha?.()??0;if(!(B>.001)&&!Te){Je=0;return}Te=!1;const H=o.edges.length>14e3||o.nodes.length>2200,_e=B>0&&B<.05,ge=H||_e?33:16;if(I>0&&I-tr<ge){Je=requestAnimationFrame(m=>$(i,m));return}if(tr=I,dt){dt=!1;const[m,q]=et(ue,ze),W=tt(m,q),C=W?.data.id??null;C!==Qt&&(Qt=C,o.onhovernode(W?.data??null)),e(f)&&(e(f).style.cursor=W?"pointer":"grab")}const ie=e(f).width,Ke=e(f).height;i.fillStyle="#050505",i.fillRect(0,0,ie,Ke),i.save(),i.translate(ie/2,Ke/2),i.scale(_,_),i.translate(-S,-v);const P=o.graphSelected?.id??null;jt||(jt=new si(o.nodes,P,o.embeddingFilterIds,o.relationLookup,o.pinnedIds,o.lensIds,o.clusterLensMode,o.colorMode,o.nowMs,o.sourceFocusSources));const qe=_>=1.4?ut:_>=.8?se:Ee;if(ht.length>0){const m=Math.max(1,Math.ceil(ht.length/qe));i.beginPath();for(let q=0;q<ht.length;q+=m){const W=ht[q],C=W.source,O=W.target;typeof C=="number"||typeof O=="number"||!C||!O||(i.moveTo(C.x,C.y),i.lineTo(O.x,O.y))}i.strokeStyle="rgba(255, 255, 255, 0.03)",i.lineWidth=.4/_,i.stroke()}if(G.length>0){const m=Math.max(1,Math.ceil(G.length/qe)),q=new Map;for(let W=0;W<G.length;W+=m){const C=G[W],O=C.source,X=C.target;if(typeof O=="number"||typeof X=="number"||!O||!X)continue;const we=Jo(O.data.id,X.data.id,o.embeddingFilterIds,o.relationLookup,o.lensIds,o.clusterLensMode),Nt=q.get(we);Nt?Nt.push([O.x,O.y,X.x,X.y]):q.set(we,[[O.x,O.y,X.x,X.y]])}i.lineWidth=.8/_;for(const[W,C]of q){i.beginPath();for(const[O,X,we,Nt]of C)i.moveTo(O,X),i.lineTo(we,Nt);i.strokeStyle=W,i.stroke()}}if(Z.length>0){const m=Math.max(1,Math.floor(qe/4)),q=Math.max(1,Math.ceil(Z.length/m));for(let W=0;W<Z.length;W+=q){const C=Z[W],O=C.source,X=C.target;if(typeof O=="number"||typeof X=="number"||!O||!X)continue;const we=Qo(C.dependencyType??"",C.strength??.5);i.beginPath(),we.dash.length>0&&i.setLineDash(we.dash.map(Nt=>Nt/_)),i.moveTo(O.x,O.y),i.lineTo(X.x,X.y),i.strokeStyle=we.color,i.lineWidth=we.width/_,i.stroke(),we.dash.length>0&&i.setLineDash([])}}{const m=new Map,q=[],W=[];let C=null;for(let O=0;O<o.nodes.length;O++){const X=o.nodes[O];if(X.nodeType!=="memory"&&X.nodeType!==void 0)continue;const we=jt.fills[O],Nt=m.get(we);Nt?Nt.push(X):m.set(we,[X]),o.colorMode!=="none"&&o.showNewSinceLastSeen&&Uo(X.data.createdAt,o.lastSeenMs)&&q.push(X),o.pinnedIds.has(X.data.id)&&W.push(X),P===X.data.id&&(C=X)}for(const[O,X]of m){i.beginPath();for(const we of X)i.moveTo(we.x+we.radius,we.y),i.arc(we.x,we.y,we.radius,0,Math.PI*2);i.fillStyle=O,i.fill()}if(q.length>0){i.beginPath();for(const O of q)i.moveTo(O.x+O.radius+2.2,O.y),i.arc(O.x,O.y,O.radius+2.2,0,Math.PI*2);i.strokeStyle="rgba(246, 194, 107, 0.85)",i.lineWidth=1.1/_,i.stroke()}if(W.length>0){i.strokeStyle="rgba(240, 240, 240, 0.8)",i.lineWidth=1.2/_;for(const O of W){const X=(O.radius+2.5)*2;i.strokeRect(O.x-X/2,O.y-X/2,X,X)}}C&&(i.beginPath(),i.arc(C.x,C.y,C.radius+3,0,Math.PI*2),i.strokeStyle="rgba(255, 255, 255, 0.95)",i.lineWidth=1.5/_,i.stroke())}for(const m of o.nodes){if(m.nodeType!=="attribute")continue;const q=m.data.who??"unknown";i.beginPath(),i.arc(m.x,m.y,m.radius,0,Math.PI*2),i.fillStyle=br(q,.3),i.fill(),i.strokeStyle=br(q,.5),i.lineWidth=.6/_,i.stroke(),P===m.data.id&&(i.beginPath(),i.arc(m.x,m.y,m.radius+3,0,Math.PI*2),i.strokeStyle="rgba(255, 255, 255, 0.95)",i.lineWidth=1.5/_,i.stroke())}for(const m of o.nodes){if(m.nodeType!=="aspect")continue;const q=m.data.who??"unknown";if(i.beginPath(),i.arc(m.x,m.y,m.radius,0,Math.PI*2),i.fillStyle=br(q,.5),i.fill(),i.strokeStyle=br(q,.75),i.lineWidth=.8/_,i.stroke(),P===m.data.id&&(i.beginPath(),i.arc(m.x,m.y,m.radius+3,0,Math.PI*2),i.strokeStyle="rgba(255, 255, 255, 0.95)",i.lineWidth=1.5/_,i.stroke()),o.graphHovered&&m.data.id===o.graphHovered.id||P===m.data.id){const W=Math.max(7,9/_);i.font=`${W}px var(--font-mono)`,i.fillStyle="rgba(210, 210, 210, 0.85)",i.textAlign="center",i.fillText(m.aspectData?.name??"",m.x,m.y+m.radius+W+1/_),i.textAlign="start"}}for(const m of o.nodes){if(m.nodeType!=="entity")continue;const q=m.entityData?.entityType??"unknown";i.save(),i.shadowColor=br(q,.5),i.shadowBlur=12/_,pn(i,m.x,m.y,m.radius),i.fillStyle=br(q,.7),i.fill(),i.restore(),pn(i,m.x,m.y,m.radius),i.strokeStyle=br(q,.9),i.lineWidth=1.2/_,i.stroke(),P===m.data.id&&(pn(i,m.x,m.y,m.radius+4),i.strokeStyle="rgba(255, 255, 255, 0.95)",i.lineWidth=1.5/_,i.stroke());const W=Math.max(8,10/_);i.font=`bold ${W}px var(--font-mono)`,i.fillStyle="rgba(230, 230, 230, 0.9)",i.textAlign="center",i.fillText(m.entityData?.name??"",m.x,m.y+m.radius+W+2/_),i.textAlign="start"}if(o.graphHovered){const m=Wt.get(o.graphHovered.id);if(m&&m.nodeType!=="entity"&&m.nodeType!=="aspect"){const q=m.nodeType==="attribute"?m.attributeData?.content??yr(o.graphHovered):yr(o.graphHovered),W=9/_;i.font=`${W}px var(--font-mono)`,i.fillStyle="rgba(220, 220, 220, 0.9)",i.textAlign="left";const C=80;i.fillText(q.length>C?`${q.slice(0,C)}...`:q,m.x+m.radius+5/_,m.y+W*.35),i.textAlign="start"}}i.restore(),e(be)&&($e++,(Xe||$e>=ct)&&($t(),Xe=!1,$e=0)),Je=requestAnimationFrame(m=>$(i,m))}function _t(){if(!e(f))return;Pt&&(Pt(),Pt=null);const i=e(f),I=ie=>{const[Ke,P]=et(ie.clientX,ie.clientY),qe=tt(Ke,P);V=!1,qe?(K=!0,ve=qe,ot=ie.clientX,ae=ie.clientY):(U=!0,ot=ie.clientX,ae=ie.clientY,Ae=S,Re=v)},B=ie=>{if(K&&ve){const Ke=ie.clientX-ot,P=ie.clientY-ae;if(!V&&Ke*Ke+P*P<it*it)return;V||(V=!0,xt=!0,ve.fx=ve.x,ve.fy=ve.y,Oe?.alphaTarget(.3).restart());const[qe,m]=et(ie.clientX,ie.clientY);ve.fx=qe,ve.fy=m,pe();return}if(U){xt=!0,S=Ae-(ie.clientX-ot)/_,v=Re-(ie.clientY-ae)/_,pe();return}ue=ie.clientX,ze=ie.clientY,dt=!0,pe()},de=()=>{if(K&&ve){V&&(ve.fx=null,ve.fy=null,Oe?.alphaTarget(0)),ve=null,K=!1,pe();return}U=!1},H=()=>{U=!1,Qt!==null&&(Qt=null,o.onhovernode(null))},_e=ie=>{if(V)return;const[Ke,P]=et(ie.clientX,ie.clientY),qe=tt(Ke,P);o.onselectnode(qe?.data??null)},ge=ie=>{ie.preventDefault(),xt=!0;const Ke=ie.deltaY>0?.9:1.1,P=Math.max(.1,Math.min(5,_*Ke)),qe=i.getBoundingClientRect(),m=qe.width/2,q=qe.height/2,W=ie.clientX-qe.left-m,C=ie.clientY-qe.top-q,O=W/_+S,X=C/_+v;_=P,S=O-W/_,v=X-C/_,pe()};i.addEventListener("pointerdown",I),i.addEventListener("pointermove",B),i.addEventListener("pointerup",de),i.addEventListener("pointerleave",H),i.addEventListener("click",_e),i.addEventListener("wheel",ge,{passive:!1}),Pt=()=>{i.removeEventListener("pointerdown",I),i.removeEventListener("pointermove",B),i.removeEventListener("pointerup",de),i.removeEventListener("pointerleave",H),i.removeEventListener("click",_e),i.removeEventListener("wheel",ge)}}ne(()=>{o.graphSelected,o.graphHovered,o.embeddingFilterIds,o.relationLookup,o.pinnedIds,o.lensIds,o.clusterLensMode,jt=null,pe()}),ne(()=>{const i=o.edges,I=[],B=[],de=[];for(const H of i)H.edgeType==="hierarchy"?I.push(H):H.edgeType==="dependency"?de.push(H):B.push(H);ht=I,G=B,Z=de}),ne(()=>()=>{Oe?.stop(),Oe=null,Pt&&(Pt(),Pt=null),It&&(window.removeEventListener("resize",lt),It=!1),cancelAnimationFrame(Je)});var rr={resetCamera:ye,focusNode:st,startSimulation:Tt,startKnowledgeGraphSimulation:yt,updatePhysics:Lt,stopSimulation:fe,startRendering:He,resumeRendering:We,stopRendering:Dt,requestRedraw:pe},nr=ci(),ar=l(nr);hr(ar,i=>n(f,i),()=>e(f));var qt=d(ar,2);{var vt=i=>{var I=di();fn(I,"width",me),fn(I,"height",Ye),hr(I,B=>n(Ze,B),()=>e(Ze)),Y("mousedown",I,oe),Y("mousemove",I,Ge),Y("mouseup",I,Et),Ar("mouseleave",I,Et),u(i,I)};j(qt,i=>{e(be)&&i(vt)})}return s(nr),u(y,nr),Sn(rr)}Mn(["mousedown","mousemove","mouseup"]);var gi=x('<button class="text-[11px] text-[var(--sig-accent)] bg-transparent border-none cursor-pointer p-0 hover:underline">Clear</button>'),vi=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),pi=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),fi=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase"> </div> <div class="flex flex-col gap-2"></div>',1),mi=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),xi=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Dependencies</div> <div class="flex flex-col gap-2"></div>',1),bi=x('<div class="flex flex-wrap gap-[6px]"><span class="font-[family-name:var(--font-mono)] text-[10px] border px-[7px] py-[2px]"> </span> <!></div> <div class="font-[family-name:var(--font-mono)] text-[14px] text-[var(--sig-text-bright)] font-bold"> </div> <div class="grid grid-cols-3 gap-1 text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"><div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>aspects</div></div> <div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>attributes</div></div> <div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>deps</div></div></div> <div class="flex gap-2"><button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!> <!>',1),hi=x('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] uppercase">Parent entity</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),yi=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),_i=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase"> </div> <div class="flex flex-col gap-2"></div>',1),wi=x('<div class="flex flex-wrap gap-[6px]"><span class="font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]">aspect</span> <span class="font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span></div> <div class="font-[family-name:var(--font-mono)] text-[14px] text-[var(--sig-text-bright)] font-bold"> </div> <!> <div class="flex gap-2"><button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!>',1),Si=x('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] uppercase">Parent entity</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),Mi=x('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] uppercase">Parent aspect</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),ki=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Linked memory</div> <button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>',1),Ii=x('<div class="flex flex-wrap gap-[6px]"><span class="font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span> <span class="font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span></div> <p class="m-0 text-[13px] leading-[1.55] text-[var(--sig-text-bright)] whitespace-pre-wrap break-words"> </p> <!> <!> <div class="flex gap-2"><button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!>',1),Ti=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span>'),Ei=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),Ni=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span>'),Fi=x('<div class="flex flex-wrap gap-[6px]"></div>'),Pi=x('<div class="border border-dashed border-[var(--sig-danger)] p-2 text-[11px] text-[var(--sig-danger)] leading-[1.5]"> </div>'),Ci=x('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">No related memories in this view.</div>'),Li=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Di=x('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">Finding similar memories...</div>'),Ai=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap">global</span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Ri=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Global similar</div> <div class="flex flex-col gap-2"></div>',1),Oi=x('<div class="flex flex-wrap gap-[6px]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span> <!> <span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span> <!></div> <div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] border border-[var(--sig-border-strong)] px-[7px] py-[5px] bg-transparent break-all"> </div> <p class="m-0 text-[13px] leading-[1.55] text-[var(--sig-text-bright)] whitespace-pre-wrap break-words"> </p> <!> <div class="flex gap-2"><button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed">Center</button> <button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed"> </button> <button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed"> </button></div> <!> <div class="self-start flex border border-[var(--sig-border-strong)] overflow-hidden"><button>Similar</button> <button>Dissimilar</button></div> <div class="flex flex-col gap-2"><!></div> <!>',1),Yi=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Xi=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Search matches</div> <div class="flex flex-col gap-2"></div>',1),ji=x('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">Select a node to inspect content, source metadata, and similar or dissimilar neighbors.</div> <!>',1),Hi=x('<aside><div class="flex items-center justify-between gap-2"><span class="font-[family-name:var(--font-mono)] text-[11px] tracking-[0.06em] uppercase text-[var(--sig-text)]">Inspector</span> <!></div> <!></aside>');function Gi(y,o){wn(o,!0);let f=cr(o,"containerClass",3,""),S=cr(o,"selectedNodeType",3,void 0),v=cr(o,"selectedEntityData",3,null),_=cr(o,"selectedAspectData",3,null),U=cr(o,"selectedAttributeData",3,null),K=cr(o,"parentEntityId",3,null),V=cr(o,"parentAspectId",3,null),ve=cr(o,"constellationOverlay",3,null);const ot=Q(()=>S()==="entity"&&v()!==null),ae=Q(()=>S()==="aspect"&&_()!==null),Ae=Q(()=>S()==="attribute"&&U()!==null),Re=Q(()=>{if(!v()||!ve())return[];const G=v().id;return ve().dependencies.filter(Z=>Z.sourceEntityId===G||Z.targetEntityId===G)}),it=Q(()=>!K()||!ve()?null:ve().entities.find(G=>G.id===K())??null),Oe=Q(()=>!V()||!e(it)?null:e(it).aspects.find(G=>G.id===V())??null);function Je(G){return ve()?ve().entities.find(ue=>ue.id===G)?.name??G:G}function Pt(G){return o.embeddingById.get(G)??null}var It=Hi(),tr=l(It),Te=d(l(tr),2);{var Qt=G=>{var Z=gi();Y("click",Z,function(...ue){o.onclearselection?.apply(this,ue)}),u(G,Z)};j(Te,G=>{o.graphSelected&&G(Qt)})}s(tr);var xt=d(tr,2);{var Wt=G=>{var Z=bi(),ue=xe(Z),ze=l(ue),dt=l(ze,!0);s(ze);var me=d(ze,2);{var Ye=fe=>{var He=vi();u(fe,He)};j(me,fe=>{v().pinned&&fe(Ye)})}s(ue);var Be=d(ue,2),Ze=l(Be,!0);s(Be);var Xe=d(Be,2),$e=l(Xe),ct=l($e),Ct=l(ct,!0);s(ct),gr(2),s($e);var be=d($e,2),Ue=l(be),pe=l(Ue,!0);s(Ue),gr(2),s(be);var ut=d(be,2),se=l(ut),Ee=l(se,!0);s(se),gr(2),s(ut),s(Xe);var ye=d(Xe,2),je=l(ye);s(ye);var st=d(ye,2);{var Tt=fe=>{var He=fi(),We=xe(He),Dt=l(We);s(We);var lt=d(We,2);Mt(lt,21,()=>v().aspects,kt,(gt,et)=>{var tt=pi(),Ht=l(tt),$t=l(Ht);s(Ht);var E=d(Ht,2),oe=l(E,!0);s(E),s(tt),F(Ge=>{h($t,`w${Ge??""}%`),h(oe,e(et).name)},[()=>Math.round(e(et).weight*100)]),Y("click",tt,()=>o.onselectembedding(`aspect:${e(et).id}`)),u(gt,tt)}),s(lt),F(()=>h(Dt,`Aspects (${v().aspects.length??""})`)),u(fe,He)};j(st,fe=>{v().aspects.length>0&&fe(Tt)})}var yt=d(st,2);{var Lt=fe=>{var He=xi(),We=d(xe(He),2);Mt(We,21,()=>e(Re),kt,(Dt,lt)=>{const gt=Q(()=>e(lt).sourceEntityId===v().id),et=Q(()=>e(gt)?e(lt).targetEntityId:e(lt).sourceEntityId);var tt=mi(),Ht=l(tt),$t=l(Ht);s(Ht);var E=d(Ht,2),oe=l(E,!0);s(E),s(tt),F(Ge=>{h($t,`${e(gt)?"->":"<-"} ${e(lt).dependencyType??""}`),h(oe,Ge)},[()=>Je(e(et))]),Y("click",tt,()=>o.onselectembedding(`entity:${e(et)}`)),u(Dt,tt)}),s(We),u(fe,He)};j(yt,fe=>{e(Re).length>0&&fe(Lt)})}F((fe,He)=>{Bt(ze,fe),h(dt,v().entityType),h(Ze,v().name),h(Ct,v().aspects.length),h(pe,He),h(Ee,e(Re).length)},[()=>`color: ${bn(v().entityType)}; border-color: ${bn(v().entityType)}; background: rgba(255,255,255,0.04);`,()=>v().aspects.reduce((fe,He)=>fe+He.attributes.length,0)]),Y("click",je,function(...fe){o.onfocusembedding?.apply(this,fe)}),u(G,Z)},bt=G=>{var Z=wi(),ue=xe(Z),ze=d(l(ue),2),dt=l(ze);s(ze),s(ue);var me=d(ue,2),Ye=l(me,!0);s(me);var Be=d(me,2);{var Ze=be=>{var Ue=hi(),pe=d(l(Ue),2),ut=l(pe,!0);s(pe),s(Ue),F(()=>h(ut,e(it).name)),Y("click",Ue,()=>e(it)&&o.onselectembedding(`entity:${e(it).id}`)),u(be,Ue)};j(Be,be=>{e(it)&&be(Ze)})}var Xe=d(Be,2),$e=l(Xe);s(Xe);var ct=d(Xe,2);{var Ct=be=>{var Ue=_i(),pe=xe(Ue),ut=l(pe);s(pe);var se=d(pe,2);Mt(se,21,()=>_().attributes,kt,(Ee,ye)=>{var je=yi(),st=l(je),Tt=l(st,!0);s(st);var yt=d(st,2),Lt=l(yt,!0);s(yt),s(je),F(()=>{h(Tt,e(ye).kind),h(Lt,e(ye).content)}),Y("click",je,()=>o.onselectembedding(`attr:${e(ye).id}`)),u(Ee,je)}),s(se),F(()=>h(ut,`Attributes (${_().attributes.length??""})`)),u(be,Ue)};j(ct,be=>{_().attributes.length>0&&be(Ct)})}F(be=>{h(dt,`weight ${be??""}%`),h(Ye,_().name)},[()=>Math.round(_().weight*100)]),Y("click",$e,function(...be){o.onfocusembedding?.apply(this,be)}),u(G,Z)},Xt=G=>{var Z=Ii(),ue=xe(Z),ze=l(ue),dt=l(ze,!0);s(ze);var me=d(ze,2),Ye=l(me);s(me),s(ue);var Be=d(ue,2),Ze=l(Be,!0);s(Be);var Xe=d(Be,2);{var $e=se=>{var Ee=Si(),ye=d(l(Ee),2),je=l(ye,!0);s(ye),s(Ee),F(()=>h(je,e(it).name)),Y("click",Ee,()=>e(it)&&o.onselectembedding(`entity:${e(it).id}`)),u(se,Ee)};j(Xe,se=>{e(it)&&se($e)})}var ct=d(Xe,2);{var Ct=se=>{var Ee=Mi(),ye=d(l(Ee),2),je=l(ye,!0);s(ye),s(Ee),F(()=>h(je,e(Oe).name)),Y("click",Ee,()=>e(Oe)&&o.onselectembedding(`aspect:${e(Oe).id}`)),u(se,Ee)};j(ct,se=>{e(Oe)&&se(Ct)})}var be=d(ct,2),Ue=l(be);s(be);var pe=d(be,2);{var ut=se=>{const Ee=Q(()=>o.embeddingById.get(U().memoryId));var ye=vr(),je=xe(ye);{var st=Tt=>{var yt=ki(),Lt=d(xe(yt),2),fe=l(Lt),He=l(fe,!0);s(fe);var We=d(fe,2),Dt=l(We,!0);s(We),s(Lt),F(lt=>{h(He,e(Ee).who??"memory"),h(Dt,lt)},[()=>yr(e(Ee))]),Y("click",Lt,()=>e(Ee)&&o.onselectembedding(e(Ee).id)),u(Tt,yt)};j(je,Tt=>{e(Ee)&&Tt(st)})}u(se,ye)};j(pe,se=>{U().memoryId&&se(ut)})}F(se=>{h(dt,U().kind),h(Ye,`importance ${se??""}%`),h(Ze,U().content)},[()=>Math.round(U().importance*100)]),Y("click",Ue,function(...se){o.onfocusembedding?.apply(this,se)}),u(G,Z)},jt=G=>{var Z=Oi(),ue=xe(Z),ze=l(ue),dt=l(ze,!0);s(ze);var me=d(ze,2);{var Ye=E=>{var oe=Ti(),Ge=l(oe,!0);s(oe),F(()=>h(Ge,o.graphSelected.type)),u(E,oe)};j(me,E=>{o.graphSelected.type&&E(Ye)})}var Be=d(me,2),Ze=l(Be);s(Be);var Xe=d(Be,2);{var $e=E=>{var oe=Ei();u(E,oe)};j(Xe,E=>{o.graphSelected.pinned&&E($e)})}s(ue);var ct=d(ue,2),Ct=l(ct,!0);s(ct);var be=d(ct,2),Ue=l(be,!0);s(be);var pe=d(be,2);{var ut=E=>{var oe=Fi();Mt(oe,21,()=>o.graphSelected.tags.slice(0,8),kt,(Ge,Kt)=>{var Et=Ni(),$=l(Et);s(Et),F(()=>h($,`#${e(Kt)??""}`)),u(Ge,Et)}),s(oe),u(E,oe)};j(pe,E=>{o.graphSelected.tags?.length&&E(ut)})}var se=d(pe,2),Ee=l(se),ye=d(Ee,2),je=l(ye,!0);s(ye);var st=d(ye,2),Tt=l(st,!0);s(st),s(se);var yt=d(se,2);{var Lt=E=>{var oe=Pi(),Ge=l(oe,!0);s(oe),F(()=>h(Ge,o.pinError)),u(E,oe)};j(yt,E=>{o.pinError&&E(Lt)})}var fe=d(yt,2),He=l(fe),We=d(He,2);s(fe);var Dt=d(fe,2),lt=l(Dt);{var gt=E=>{var oe=Ci();u(E,oe)},et=E=>{var oe=vr(),Ge=xe(oe);Mt(Ge,17,()=>o.activeNeighbors,kt,(Kt,Et)=>{const $=Q(()=>Pt(e(Et).id));var _t=vr(),rr=xe(_t);{var nr=ar=>{var qt=Li(),vt=l(qt),i=l(vt,!0);s(vt);var I=d(vt,2),B=l(I,!0);s(I),s(qt),F((de,H)=>{h(i,de),h(B,H)},[()=>Math.round(e(Et).score*1e3)/1e3,()=>yr(e($))]),Y("click",qt,()=>o.onselectembedding(e($).id)),u(ar,qt)};j(rr,ar=>{e($)&&ar(nr)})}u(Kt,_t)}),u(E,oe)};j(lt,E=>{o.activeNeighbors.length===0?E(gt):E(et,-1)})}s(Dt);var tt=d(Dt,2);{var Ht=E=>{var oe=Di();u(E,oe)},$t=E=>{var oe=Ri(),Ge=d(xe(oe),2);Mt(Ge,21,()=>o.globalSimilar,kt,(Kt,Et)=>{var $=Ai(),_t=d(l($),2),rr=l(_t,!0);s(_t),s($),F(()=>h(rr,e(Et).content)),Y("click",$,()=>o.onopenglobalsimilar(e(Et))),u(Kt,$)}),s(Ge),u(E,oe)};j(tt,E=>{o.loadingGlobalSimilar?E(Ht):o.globalSimilar.length>0&&E($t,1)})}F((E,oe)=>{h(dt,o.graphSelected.who??"unknown"),h(Ze,`importance ${E??""}%`),h(Ct,oe),h(Ue,o.graphSelected.content??o.graphSelected.text??"(No content preview available)"),ye.disabled=o.pinBusy,h(je,o.pinBusy?"Saving...":o.graphSelected.pinned?"Unpin":"Pin"),st.disabled=o.loadingGlobalSimilar,h(Tt,o.loadingGlobalSimilar?"Loading...":"Global similar"),mt(He,1,`px-2 py-0.5 text-[10px] font-medium font-[family-name:var(--font-mono)] bg-transparent border-none cursor-pointer tracking-[0.04em] hover:text-[var(--sig-text)] hover:bg-[var(--sig-surface-raised)] ${o.relationMode==="similar"?"text-[var(--sig-text-bright)] bg-[var(--sig-surface-raised)]":"text-[var(--sig-text-muted)]"}`),mt(We,1,`px-2 py-0.5 text-[10px] font-medium font-[family-name:var(--font-mono)] bg-transparent border-none cursor-pointer tracking-[0.04em] hover:text-[var(--sig-text)] hover:bg-[var(--sig-surface-raised)] ${o.relationMode==="dissimilar"?"text-[var(--sig-text-bright)] bg-[var(--sig-surface-raised)]":"text-[var(--sig-text-muted)]"}`)},[()=>Math.round((o.graphSelected.importance??0)*100),()=>Vo(o.graphSelected)]),Y("click",Ee,function(...E){o.onfocusembedding?.apply(this,E)}),Y("click",ye,function(...E){o.onpintoggle?.apply(this,E)}),Y("click",st,function(...E){o.onloadglobalsimilar?.apply(this,E)}),Y("click",He,()=>o.onsetrelationmode("similar")),Y("click",We,()=>o.onsetrelationmode("dissimilar")),u(G,Z)},ht=G=>{var Z=ji(),ue=d(xe(Z),2);{var ze=dt=>{var me=Xi(),Ye=d(xe(me),2);Mt(Ye,21,()=>o.embeddingSearchMatches,kt,(Be,Ze)=>{var Xe=Yi(),$e=l(Xe),ct=l($e,!0);s($e);var Ct=d($e,2),be=l(Ct,!0);s(Ct),s(Xe),F(Ue=>{h(ct,e(Ze).who),h(be,Ue)},[()=>yr(e(Ze))]),Y("click",Xe,()=>o.onselectembedding(e(Ze).id)),u(Be,Xe)}),s(Ye),u(dt,me)};j(ue,dt=>{o.embeddingSearch&&o.embeddingSearchMatches.length>0&&dt(ze)})}u(G,Z)};j(xt,G=>{e(ot)&&v()?G(Wt):e(ae)&&_()?G(bt,1):e(Ae)&&U()?G(Xt,2):o.graphSelected?G(jt,3):G(ht,-1)})}s(It),F(()=>mt(It,1,`flex flex-col gap-3 p-3 overflow-y-auto ${f()}`)),u(y,It),Sn()}Mn(["click"]);var zi=x('<div class="absolute right-3 z-[9] pointer-events-none"><button type="button" class="pointer-events-auto px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] bg-[rgba(5,5,5,0.74)] hover:bg-[var(--sig-text-bright)] hover:text-[var(--sig-bg)]"> </button></div>'),Bi=x('<span class="text-[#c4a24a]"> </span>'),Wi=x('<div class="mt-0.5 font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text-muted)] leading-[1.3]"> </div>'),Ki=x('<div class="mt-1"><div class="flex items-center justify-between font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text-muted)]"><span> </span> <span> </span></div> <div class="mt-1 h-[5px] border border-[rgba(255,255,255,0.2)] bg-[rgba(255,255,255,0.05)]"><div class="h-full bg-[#c4a24a]"></div></div> <div class="mt-1 font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text-muted)]"> </div></div>'),qi=x('<div class="mb-2 border border-[rgba(255,255,255,0.14)] bg-[rgba(255,255,255,0.03)] px-1.5 py-1.5"><div class="font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text)] leading-[1.3]"> </div> <!> <!></div>'),Ui=x('<button type="button" class="mt-1 font-[family-name:var(--font-mono)] text-[9px] text-[#c4a24a] hover:text-[var(--sig-text-bright)] underline underline-offset-2 disabled:opacity-40 disabled:no-underline"> </button>'),Vi=x('<div class="flex items-start gap-1.5 px-1.5 py-1 border border-[rgba(255,255,255,0.1)] bg-[rgba(255,255,255,0.02)]"><span class="inline-block w-[6px] h-[6px] rounded-full shrink-0 mt-[4px]"></span> <div class="flex-1 min-w-0"><div class="flex items-center justify-between gap-2"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)]"> </span> <span class="font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text-muted)] uppercase"> </span></div> <div class="font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text-muted)] leading-[1.3] mt-0.5"> </div> <!></div></div>'),Ji=x('<div class="mt-1 border border-[rgba(255,255,255,0.22)] bg-[rgba(5,5,5,0.92)] px-2 py-2 w-[320px]"><div class="flex items-center justify-between mb-2"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] uppercase tracking-[0.06em]">Constellation Health</span> <span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)]"> </span></div> <!> <div class="space-y-1"></div></div>'),Qi=x('<div class="absolute top-2 right-3 z-[8] pointer-events-none"><div class="pointer-events-auto"><button type="button" class="flex items-center gap-1.5 px-2 py-[4px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[rgba(255,255,255,0.22)] bg-[rgba(5,5,5,0.75)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"><span class="inline-block w-[7px] h-[7px] rounded-full shrink-0"></span> <span class="text-[var(--sig-text-muted)]"> </span> <!></button> <!></div></div>'),Zi=x("<span>Legend</span> <!>",1),$i=x("<span> </span>"),es=x('<div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-[var(--sig-text-muted)] mb-1.5"><span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last few minutes</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last few hours</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last week</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>older</span></div> <div class="flex flex-wrap gap-1 mb-1.5"></div>',1),ts=x('<span><span class="inline-block w-[6px] h-[6px] rounded-full"></span> </span>'),rs=x('<div class="flex flex-wrap gap-1 mb-1.5"></div>'),ns=x('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1.5">No color applied - all nodes are shown in gray.</div>'),as=x('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Outline</span> = new since last seen</div>'),os=x('<span class="h-5 inline-flex items-center gap-1 px-1.5 py-0 font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] border border-[rgba(255,255,255,0.14)] bg-transparent"><span class="inline-block w-[8px] h-[8px]"></span> </span>'),is=x('<div class="mt-2 pt-2 border-t border-[rgba(255,255,255,0.1)]"><div class="text-[10px] font-[family-name:var(--font-mono)] uppercase tracking-[0.06em] text-[var(--sig-text-muted)] mb-1">Knowledge Graph</div> <div class="flex flex-wrap gap-1 mb-1.5"></div> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] space-y-0.5"><div><span class="text-[var(--sig-text)]">Hexagon</span> = entity (large, labeled)</div> <div><span class="text-[var(--sig-text)]">Circle</span> = aspect (medium, orbits entity)</div> <div><span class="text-[var(--sig-text)]">Small dot</span> = attribute (orbits aspect)</div> <div><span class="text-[var(--sig-text)]">Tiny dot</span> = linked memory (leaf node)</div> <div><span class="text-[var(--sig-text)]">Faint lines</span> = parent-child hierarchy</div> <div><span class="text-[var(--sig-text)]">Styled line</span> = entity dependency</div></div></div>'),ss=x('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Color</span> </div> <!> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Radius</span> = importance</div> <div class="flex items-center gap-2 text-[10px] text-[var(--sig-text-muted)] mb-1.5"><span class="inline-block w-[6px] h-[6px] rounded-full border border-[rgba(255,255,255,0.24)]"></span> <span class="inline-block w-[9px] h-[9px] rounded-full border border-[rgba(255,255,255,0.28)]"></span> <span class="inline-block w-[12px] h-[12px] rounded-full border border-[rgba(255,255,255,0.32)]"></span> <span>low to high</span></div> <!> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35]"><span class="text-[var(--sig-text)]">Relation highlight</span> = selected node neighborhood emphasis</div> <!>',1),ls=x("<!> <!>",1),ds=x('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p> </p></div>'),cs=x('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p class="text-[var(--sig-danger)]"> </p></div>'),us=x('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p>No memories found</p></div>'),gs=x('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p>Loading...</p></div>'),vs=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.04)]"> </span>'),ps=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),fs=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.08)]">locked</span>'),ms=x('<div class="grid grid-cols-[1fr_auto] items-start gap-2 border border-[rgba(255,255,255,0.14)] bg-[rgba(255,255,255,0.02)] px-1.5 py-1"><span class="text-[10px] leading-[1.35] text-[var(--sig-text)] line-clamp-1"> </span> <span class="text-[10px] text-[var(--sig-text-muted)]"> </span></div>'),xs=x('<div class="mt-2 pt-2 border-t border-[rgba(255,255,255,0.14)]"><div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] uppercase tracking-[0.06em] mb-1">Local neighbors</div> <div class="space-y-1"></div></div>'),bs=x('<div class="z-[9] w-[320px] pointer-events-none border border-[rgba(255,255,255,0.26)] bg-[rgba(5,5,5,0.92)] px-2 py-2" style="position:absolute;top:0;left:0;will-change:transform"><div class="flex items-center gap-1.5 flex-wrap mb-1.5"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.04)]"> </span> <!> <!> <!></div> <div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] mb-1.5"> </div> <p class="m-0 text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-3"> </p> <div class="mt-1 text-[10px] text-[var(--sig-text-muted)]"> </div> <!></div>'),hs=x('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-text-muted)] font-[family-name:var(--font-mono)] text-[11px]"> </span></div>'),ys=x('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-danger)] font-[family-name:var(--font-mono)] text-[11px]"> </span></div>'),_s=x('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-text-muted)] font-[family-name:var(--font-mono)] text-[11px]"> </span></div>'),ws=x("<span>View Controls</span> <!>",1),Ss=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] border border-[var(--sig-border)] px-2 py-1"> </span>'),Ms=x('<div class="p-2 space-y-2 border-t border-[var(--sig-border)]"><div class="flex items-center gap-2"><input type="text" class="flex-1 font-[family-name:var(--font-mono)] text-[11px] text-[var(--sig-text-bright)] bg-[var(--sig-surface)] border border-[var(--sig-border-strong)] px-[9px] py-[6px] outline-none" placeholder="Search constellation"/> <!></div> <div class="text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"> </div> <div class="flex flex-wrap gap-1"><button>Pinned</button> <button>Neighborhood</button> <button>Lens</button> <button class="px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"> </button></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5"><div class="font-[family-name:var(--font-mono)] text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Color Mode</div> <div class="flex flex-wrap gap-1"><button>Newness</button> <button>Source</button> <button>None</button></div></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5"><div class="font-[family-name:var(--font-mono)] text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Overlays</div> <div class="flex flex-wrap gap-1"><button>New since last seen</button> <button> </button></div></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5" style="accent-color: var(--sig-highlight);"><div class="font-[family-name:var(--font-mono)] text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Graph Physics</div> <label class="block"><div class="flex items-center justify-between text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"><span>center force</span> <span> </span></div> <input type="range" min="0" max="1" step="0.01"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"><span>repel force</span> <span> </span></div> <input type="range" min="-600" max="-10" step="5"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"><span>link force</span> <span> </span></div> <input type="range" min="0.01" max="1" step="0.01"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"><span>link distance</span> <span> </span></div> <input type="range" min="12" max="280" step="1"/></label> <button type="button" class="px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]">Physics Reset</button></div></div>'),ks=x("<!> <!>",1),Is=x("<span>Presets</span> <!>",1),Ts=x("<button> </button>"),Es=x('<div class="inline-flex items-center border border-[var(--sig-border-strong)]"><button> </button> <button class="px-1.5 py-[2px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]">×</button></div>'),Ns=x('<div class="p-2 border-t border-[var(--sig-border)] flex flex-wrap gap-1"><!> <!> <button class="px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"> </button></div>'),Fs=x("<!> <!>",1),Ps=x("<span>Sources</span> <!>",1),Cs=x('<span class="text-[10px] text-[var(--sig-text-muted)]">No sources</span>'),Ls=x("<button> </button>"),Ds=x('<div class="p-2 border-t border-[var(--sig-border)] flex flex-wrap gap-1"><!></div>'),As=x("<!> <!>",1),Rs=x("<span>Advanced</span> <!>",1),Os=x('<div class="flex items-center gap-1 flex-wrap"><input type="date" class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <input type="date" class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/></div>'),Ys=x('<span class="text-[10px] text-[var(--sig-text-muted)] font-[family-name:var(--font-mono)]">none</span>'),Xs=x("<button> </button>"),js=x("<button> </button>"),Hs=x('<div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-[family-name:var(--font-mono)]">Type</span> <!></div>'),Gs=x("<button> </button>"),zs=x('<div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-[family-name:var(--font-mono)]">Source type</span> <!></div>'),Bs=x('<div class="p-2 border-t border-[var(--sig-border)] space-y-2"><div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-[family-name:var(--font-mono)]">Window</span> <input type="number" min="0" max="100000" class="w-[70px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <span class="text-[10px] text-[var(--sig-text-muted)] font-[family-name:var(--font-mono)]">to</span> <input type="number" min="1" max="100000" class="w-[70px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <select class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"><option>time: all</option><option>time: 24h</option><option>time: 7d</option><option>time: 30d</option><option>time: 90d</option><option>time: custom</option></select></div> <!> <div class="flex items-center gap-1 flex-wrap"><select class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"><option>pins: all</option><option>pins: pinned</option><option>pins: unpinned</option></select> <input type="text" class="w-[140px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="server query"/> <input type="text" class="w-[110px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="tags csv"/> <input type="text" class="w-[60px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="imp>"/> <input type="text" class="w-[60px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="imp&lt;"/></div> <div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-[family-name:var(--font-mono)]">Harness</span> <!></div> <!> <!></div>'),Ws=x("<!> <!>",1),Ks=x('<div class="flex flex-col flex-1 min-h-0 overflow-hidden"><!> <div class="flex flex-1 min-h-0 bg-[#050505] max-lg:flex-col"><div class="flex-1 relative overflow-hidden bg-[#050505]" role="presentation"><!> <!> <div class="absolute left-3 top-3 bottom-3 z-[8] pointer-events-none flex flex-col justify-end items-start max-w-[220px]"><!></div> <!> <div class="absolute left-[14px] z-[6] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.08em] uppercase pointer-events-none" aria-hidden="true">:: &#9675; &#9675; 01 10 11 // latent topology</div> <div class="absolute inset-0 pointer-events-none z-[5]" aria-hidden="true"><span class="absolute top-[10px] left-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:1px 0 0 1px"></span> <span class="absolute top-[10px] right-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:1px 1px 0 0"></span> <span class="absolute bottom-[10px] left-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:0 0 1px 1px"></span> <span class="absolute bottom-[10px] right-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:0 1px 1px 0"></span></div> <!> <div><!></div> <div><!></div></div> <div class="w-[360px] min-w-[320px] border-l border-[var(--sig-border)] bg-[var(--sig-surface)] flex flex-col min-h-0 max-lg:w-full max-lg:min-w-0 max-lg:max-h-[48%] max-lg:border-l-0 max-lg:border-t max-lg:border-t-[var(--sig-border)]"><div class="p-3 border-b border-[var(--sig-border)] space-y-2 overflow-y-auto"><!> <!> <!> <!></div> <!></div></div></div>');function tl(y,o){wn(o,!0);let f=cr(o,"embedded",3,!1),S=p(!1),v=p(null),_=p(null),U=p(""),K=p(""),V=p(Ie([])),ve=p(0),ot=p(!1),ae=p(!1),Ae=p(""),Re=p(""),it=0,Oe=p(Ie([])),Je,Pt=p(null),It=p(null),tr=p(null),Te=p(Ie(new Set)),Qt=p(Ie([])),xt=p(!1),Wt=p(!0),bt=p(Ie(new Set)),Xt=p(!1),jt=p(""),ht=p(!0),G=p(Ie(new Set)),Z=p("focus"),ue=p(Ie([])),ze=p(!1),dt=p(!1),me=p(!0),Ye=p(!1),Be=p(!0);const Ze=["daemon","user","opencode"],Xe=new Set(Ze),$e="signet-constellation-color-mode-session",ct="signet-constellation-new-since-session",Ct="signet-constellation-color-mode",be="signet-constellation-new-since",Ue="signet-constellation-last-seen";let pe=p(0),ut=p(Ie(Wr)),se=p("all"),Ee=p(Ie(Date.now())),ye=p(""),je=p(""),st=p(""),Tt=p(""),yt=p("all"),Lt=p(""),fe=p(""),He=p(Ie([])),We=p(Ie(new Set)),Dt=p(Ie([])),lt=p(Ie([])),gt=p(Ie(new Set)),et=p(Ie(new Set)),tt=p(""),Ht=0,$t=p("similar"),E=p(Ie([])),oe=p(Ie([])),Ge=p(Ie([])),Kt=p(!1),Et=p(Ie([])),$=p("source"),_t=p(!1),rr=p(null),nr=p(null),ar=p(!1),qt=p(Ie(Date.now())),vt=p(Ie([])),i=p(Ie([])),I=p(Ie([])),B=p(!1),de=p(null),H=p(!1);const _e="signet-constellation-entity-overlay";let ge=p("2d"),ie=p(Ie([])),Ke=0,P=p(Ie(Ir)),qe=p(!1),m=p(Ie(new Map)),q=p(Ie(new Map)),W=p(Ie(new Map)),C=p(null),O=p(null),X=p(null),we=0,Nt=0,Ut=null,pt=p(null),ir=p(null),Rr=p(null),Or=p(!1),Tn=p(!1),ur=p(null),Ur=p(!1),_r=p(!1),Vr,sr=p(null),lr=p(null),At=p(null),Yr;No(()=>{n(me,kr.embeddings.controlsOpen,!0),n(Ye,kr.embeddings.presetsOpen,!0),n(Be,kr.embeddings.sourcesOpen,!0)});function ka(t){if(ia.activeTab!=="embeddings"||t.defaultPrevented)return;const r=t.target,a=r instanceof HTMLElement&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.tagName==="SELECT"||r.isContentEditable),c=r instanceof HTMLElement&&r.getAttribute("data-memory-tab")==="embeddings";if(t.key==="ArrowDown"&&c){t.preventDefault(),e(me)?Je?.focus():(n(me,!0),un().then(()=>Je?.focus()));return}if(t.key==="ArrowUp"&&r===Je){t.preventDefault();const g=document.querySelector('[data-memory-tab="embeddings"]');g?g.focus():Je?.blur();return}}async function Tr(){n(ur,await Lo(),!0)}function Ia(t){const r=t.match(/cooldown active,\s*(\d+)ms remaining/i);if(!r?.[1])return null;const a=Number.parseInt(r[1],10);return Number.isFinite(a)&&a>=0?a:null}function En(t){const r=Math.ceil(t/1e3);if(r<60)return`${r}s`;const a=Math.floor(r/60),c=r%60;return c>0?`${a}m ${c}s`:`${a}m`}function Ta(t){const r=t.match(/([\d,]+)\s+memories?\s+missing\s+embeddings/i);if(!r?.[1])return null;const a=Number.parseInt(r[1].replaceAll(",",""),10);return Number.isFinite(a)&&a>=0?a:null}function Er(){Yr&&(clearInterval(Yr),Yr=void 0)}function Ea(t){const r=Math.max(1,Math.floor(t/1e3));if(r<60)return`${r}s`;const a=Math.floor(r/60),c=r%60;return c>0?`${a}m ${c}s`:`${a}m`}function Nn(t){Er();const r=Date.now();let a=t,c=!1,g=0;n(sr,"Re-embedding in progress"),n(lr,t===null?"Collecting progress...":`${t.toLocaleString()} missing at start`,!0),n(At,null);const M=async()=>{if(!c){c=!0;try{const b=await vn(),T=Ea(Date.now()-r);if(n(sr,`Re-embedding in progress (${T})`),b){a===null&&(a=b.unembedded);const w=Math.max(0,a??b.unembedded),L=Math.max(0,w-b.unembedded),le=w>0?Math.min(100,L/w*100):100;n(At,{baseline:w,completed:L,remaining:b.unembedded,percent:le,coverage:b.coverage},!0),n(lr,a===null?`${b.unembedded.toLocaleString()} still missing (${b.coverage} coverage)`:`${L.toLocaleString()} completed, ${b.unembedded.toLocaleString()} remaining (${b.coverage} coverage)`,!0)}g%2===0&&await Tr(),g++}finally{c=!1}}};M(),Yr=setInterval(()=>{M()},3e3)}async function Na(t){if(e(_r))return;n(_r,!0);const r=t.name==="coverage"||t.name==="null-vectors";if(r||(n(sr,`Running ${t.name} repair...`),n(lr,null),n(At,null)),r){const a=Ta(t.message);if(a!==null)Nn(a);else{const c=await vn();Nn(c?.unembedded??null)}}try{let a;if(t.name==="orphaned-embeddings")a=await Xo();else if(t.name==="vec-table-sync")a=await jo();else if(t.name==="coverage"||t.name==="null-vectors")a=await Ho();else{Mr(`Repair action not wired for ${t.name}`,"warning");return}if(!a.success){if(Er(),a.status===429){const c=Ia(a.message);c!==null?(n(sr,"Repair blocked by cooldown"),n(lr,`Try again in ${En(c)}.`),Mr(`Repair on cooldown. Try again in ${En(c)}.`,"warning",4500)):(n(sr,"Repair blocked by policy"),n(lr,a.message,!0),Mr(`Repair temporarily blocked: ${a.message}`,"warning",5e3)),await Tr();return}n(sr,"Repair failed"),n(lr,a.message,!0),n(At,null),Mr(`Repair failed: ${a.message}`,"error",5e3);return}if(Er(),n(sr,"Repair completed"),n(lr,a.message,!0),r){const c=await vn();if(c&&e(At)){const g=e(At).baseline,M=Math.max(0,g-c.unembedded);n(At,{baseline:g,completed:M,remaining:c.unembedded,percent:g>0?Math.min(100,M/g*100):100,coverage:c.coverage},!0)}}a.affected>0?Mr(a.message,"success",4500):Mr(a.message,"info",4500),await Tr(),r&&a.affected>0&&await en()}finally{Er(),n(_r,!1)}}function Fa(t){return t==="healthy"?"#4a7a5e":t==="degraded"?"#c4a24a":"#8a4a48"}function Pa(t){return t==="ok"?"#4a7a5e":t==="warn"?"#c4a24a":"#8a4a48"}ne(()=>(Tr(),Vr=setInterval(Tr,6e4),()=>{Er(),Vr&&clearInterval(Vr)}));let Jr=!1;function Xr(){Jr||(Jr=!0,queueMicrotask(()=>{Jr=!1,e(ge)==="3d"&&e(ir)?.refreshAppearance()}))}function Ca(t){return{id:t.id,content:t.content,who:t.who,importance:t.importance,type:t.type,tags:t.tags,pinned:t.pinned??!1,sourceType:t.sourceType,sourceId:t.sourceId,createdAt:t.createdAt}}function La(t){if(!t)return"-";const r=new Date(t);return Number.isNaN(r.getTime())?"-":r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function jr(t,r){const a=new Date(e(qt)-t).toISOString();return wa(qo(a,e(qt)),r)}function Qr(){const t=Number.isFinite(e(pe))?Math.max(0,Math.trunc(e(pe))):0,r=Number.isFinite(e(ut))?Math.max(1,Math.trunc(e(ut))):Wr,a=Math.max(t+1,Math.min(r,t+Wo));return{offset:t,limit:a-t}}function Zr(){const{offset:t,limit:r}=Qr();n(pe,t,!0),n(ut,t+r)}function Fn(t,r){const a=t.trim();if(!a)return;const c=r?"T23:59:59.999":"T00:00:00.000",g=new Date(`${a}${c}`);if(!Number.isNaN(g.getTime()))return g.toISOString()}function Pn(t){const r=t.trim();if(!r)return;const a=Number.parseFloat(r);if(Number.isFinite(a))return Math.min(1,Math.max(0,a))}function Hr(t,r){const a=t.currentTarget;if(!(a instanceof HTMLInputElement))return r;const c=Number.parseFloat(a.value);return Number.isFinite(c)?c:r}function Nr(t){n(P,xn({...e(P),...t}),!0)}function Da(t,r){if(t==="all"||t==="custom")return;const a=t==="24h"?1440*60*1e3:t==="7d"?10080*60*1e3:t==="30d"?720*60*60*1e3:2160*60*60*1e3;return new Date(r-a).toISOString()}function Cn(){const{offset:t,limit:r}=Qr(),a={offset:t,limit:r},c=e(st).trim();c.length>0&&(a.q=c);const g=[...e(We)];g.length>0&&(a.who=g);const M=[...e(gt)];M.length>0&&(a.types=M);const b=[...e(et)];b.length>0&&(a.sourceTypes=b);const T=e(Tt).split(",").map(N=>N.trim()).filter(N=>N.length>0);T.length>0&&(a.tags=T),e(yt)==="pinned"&&(a.pinned=!0),e(yt)==="unpinned"&&(a.pinned=!1);let w,L;e(se)==="custom"?(w=Fn(e(ye),!1),L=Fn(e(je),!0)):w=Da(e(se),e(Ee)),w&&(a.since=w),L&&(a.until=L);let le=Pn(e(Lt)),k=Pn(e(fe));if(typeof le=="number"&&typeof k=="number"&&le>k){const N=le;le=k,k=N}return typeof le=="number"&&(a.importanceMin=le),typeof k=="number"&&(a.importanceMax=k),a}function Ln(t){return JSON.stringify({offset:t.offset??0,limit:t.limit??Wr,q:t.q??"",who:[...t.who??[]].sort(),types:[...t.types??[]].sort(),sourceTypes:[...t.sourceTypes??[]].sort(),tags:[...t.tags??[]].sort(),pinned:t.pinned??"all",since:t.since??"",until:t.until??"",importanceMin:typeof t.importanceMin=="number"?t.importanceMin:"",importanceMax:typeof t.importanceMax=="number"?t.importanceMax:""})}function Aa(t){let r=null;for(const a of t)if(a!==null){if(r===null){r=new Set(a);continue}if(r.size<=a.size)for(const c of r)a.has(c)||r.delete(c);else{const c=new Set;for(const g of a)r.has(g)&&c.add(g);r=c}}return r}function Ra(t,r){const a=e(V).findIndex(M=>M.id===t);if(a<0)return;const c=r(e(V)[a]);e(V)[a]=c,n(V,e(V),!0),e(m).set(t,c),n(m,e(m),!0);const g=e(vt).findIndex(M=>M.data.id===t);g>=0&&(e(vt)[g]={...e(vt)[g],data:c},n(vt,e(vt),!0)),e(v)?.id===t&&n(v,c,!0),e(_)?.id===t&&n(_,c,!0)}function Oa(t){const r=new Set(e(Te));r.has(t)?r.delete(t):r.add(t),n(Te,r,!0)}function Ya(t){const r=new Set(e(We));r.has(t)?r.delete(t):r.add(t),n(We,r,!0)}function Xa(t){const r=new Set(e(gt));r.has(t)?r.delete(t):r.add(t),n(gt,r,!0)}function ja(t){const r=new Set(e(et));r.has(t)?r.delete(t):r.add(t),n(et,r,!0)}function Ha(){n(pe,0),n(ut,Wr,!0),n(se,"all"),n(ye,""),n(je,""),n(st,""),n(Tt,""),n(yt,"all"),n(Lt,""),n(fe,""),n(We,new Set,!0),n(gt,new Set,!0),n(et,new Set,!0),Zr()}function Ga(){n(xt,!e(xt)),n(Z,"custom-live")}function Dn(){if(e(v))return e(v);if(e(Gt))return n(v,e(Gt),!0),e(Gt);const t=e(V)[0]??null;return t&&n(v,t,!0),t}function za(){!e(Wt)&&!Dn()||(n(Wt,!e(Wt)),n(Z,"custom-live"))}function Ba(){!e(ht)&&!Dn()||(n(ht,!e(ht)),n(Z,"custom-live"))}function Wa(t){Oa(t),n(Z,"custom-live")}function An(){if(!e(X)||!Ut)return;const t=Math.max(12,Ut.width-334),r=Math.max(12,Ut.height-170),a=Math.min(Math.max(12,we+14),t),c=Math.min(Math.max(12,Nt+14),r);e(X).style.transform=`translate3d(${a}px, ${c}px, 0)`}function Ka(t){Ut&&(we=t.clientX-Ut.left,Nt=t.clientY-Ut.top,An())}function Rn(t){e(C)||!t&&!e(_)||t&&e(_)&&t.id===e(_).id||n(_,t,!0)}function qa(){e(v)||e(_)&&n(C,e(_).id,!0)}function On(){n(C,null)}function Yn(t){return typeof t=="number"?e(I)[t]??null:t?.data.id??null}const Xn="signet-embeddings-filter-presets",Ua=[{id:"all",name:"All",search:"",sources:[],pinnedOnly:!1,neighborhoodOnly:!1,clusterLensMode:!1},{id:"pinned",name:"Pinned",search:"",sources:[],pinnedOnly:!0,neighborhoodOnly:!1,clusterLensMode:!1},{id:"focus",name:"Focus",search:"",sources:[],pinnedOnly:!1,neighborhoodOnly:!0,clusterLensMode:!0}];function Va(t,r){return{id:r,name:t,search:e(Ae),sources:[...e(Te)],pinnedOnly:e(xt),neighborhoodOnly:e(Wt),clusterLensMode:e(ht)}}function jn(t){n(Ae,t.search,!0),n(Te,new Set(t.sources),!0),n(xt,t.pinnedOnly,!0),n(Wt,t.neighborhoodOnly,!0),n(ht,t.clusterLensMode,!0),n(Z,t.id,!0)}function Ja(){if(typeof window>"u")return;const t=e(v)?`Cluster: ${e(v).who??"source"}`:"Custom preset",a=window.prompt("Preset name",t)?.trim();if(!a)return;const c=`custom-${Date.now()}`,g=Va(a,c);n(ue,[g,...e(ue)].slice(0,8),!0),n(Z,c)}function Qa(t){n(ue,e(ue).filter(r=>r.id!==t),!0),e(Z)===t&&n(Z,"all")}async function Hn(){if(e(ae))return;n(ae,!0),n(K,""),n(U,"Loading projection...");const t=++Ke,r=Cn(),a=Ln(r);try{let c=await sa(2,r),g=0;const M=30;for(;c.status==="computing";){if(t!==Ke)return;if(g++,g>=M){n(K,"Projection timed out after 60s. Try refreshing."),n(tt,a,!0);return}n(U,"Computing layout..."),await new Promise(A=>setTimeout(A,2e3)),c=await sa(2,r)}if(c.status==="error"){n(K,c.message??"Projection computation failed",!0),n(tt,a,!0);return}if(t!==Ke)return;const b=c.nodes??[];if(n(V,b.map(Ca),!0),n(ve,c.total??b.length,!0),n(ot,!!(c.hasMore??(c.count??b.length)<(c.total??b.length)),!0),n(tt,a,!0),n(m,new Map(e(V).map(A=>[A.id,A])),!0),b.length===0){n(U,"");return}let T=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY;for(const A of b)A.x<T&&(T=A.x),A.x>w&&(w=A.x),A.y<L&&(L=A.y),A.y>le&&(le=A.y);const k=w-T||1,N=le-L||1,D=560;if(n(vt,b.map((A,te)=>({x:((A.x-T)/k-.5)*D,y:((A.y-L)/N-.5)*D,radius:2.3+(A.importance??.5)*2.8,color:_n(A.who,.85),data:e(V)[te],createdMs:Ma(A.createdAt)})),!0),n(I,e(V).map(A=>A.id),!0),n(i,(c.edges??[]).map(([A,te])=>({source:A,target:te,edgeType:"knn"})),!0),e(B)&&await Za(),n(U,""),await un(),t!==Ke)return;e(B)?(e(pt)?.startKnowledgeGraphSimulation(e(vt),e(i)),e(pt)?.startRendering(!0)):(e(pt)?.startSimulation(e(vt),e(i),e(P)),e(pt)?.startRendering())}catch(c){n(K,c.message||"Failed to load projection",!0),n(U,""),n(tt,a,!0)}}async function Za(){n(H,!0);try{const t=await Do(o.agentId);if(!t){n(de,null);return}n(de,t,!0);const r=new Map;for(const w of e(vt))r.set(w.data.id,w);const a=[],c=[],g=[],M=new Map,b=new Map,T=400;for(const w of t.entities){const L=`entity:${w.id}`,le=ei(w),k=(Math.random()-.5)*T,N=(Math.random()-.5)*T,D={id:L,content:w.name,who:w.entityType,importance:.9,pinned:w.pinned,tags:[],createdAt:void 0},A=a.length;b.set(w.id,A),a.push({x:k,y:N,radius:le,color:Kr(w.entityType,.7),data:D,nodeType:"entity",entityData:w}),g.push(L),M.set(L,D);for(const te of w.aspects){const Pe=`aspect:${te.id}`,Ce=Zo(te.weight),Se={id:Pe,content:te.name,who:w.entityType,importance:te.weight,pinned:!1,tags:[],createdAt:void 0},R=a.length;a.push({x:k+(Math.random()-.5)*80,y:N+(Math.random()-.5)*80,radius:Ce,color:Kr(w.entityType,.5),data:Se,nodeType:"aspect",aspectData:te,parentEntityId:w.id}),g.push(Pe),M.set(Pe,Se),c.push({source:A,target:R,edgeType:"hierarchy"});for(const z of te.attributes){const re=`attr:${z.id}`,ee=$o(z.importance),Me={id:re,content:z.content,who:w.entityType,importance:z.importance,pinned:!1,tags:[],createdAt:void 0},he=a.length;if(a.push({x:a[R].x+(Math.random()-.5)*40,y:a[R].y+(Math.random()-.5)*40,radius:ee,color:Kr(w.entityType,.3),data:Me,nodeType:"attribute",attributeData:z,parentEntityId:w.id,parentAspectId:te.id}),g.push(re),M.set(re,Me),c.push({source:R,target:he,edgeType:"hierarchy"}),z.memoryId){const ce=r.get(z.memoryId);if(ce){const Le=a.length;a.push({x:a[he].x+(Math.random()-.5)*25,y:a[he].y+(Math.random()-.5)*25,radius:2,color:ce.color,data:ce.data,nodeType:"memory"}),g.push(ce.data.id),M.set(ce.data.id,ce.data),c.push({source:he,target:Le,edgeType:"hierarchy"})}}}}}if(a.length>3e3){const w=new Map;let L=0;for(let k=0;k<a.length;k++)a[k].nodeType!=="memory"&&(w.set(k,L),a[L]=a[k],g[L]=g[k],L++);a.length=L,g.length=L;let le=0;for(const k of c){const N=w.get(k.source),D=w.get(k.target);N!==void 0&&D!==void 0&&(c[le]={...k,source:N,target:D},le++)}c.length=le,M.clear();for(const k of a)M.set(k.data.id,k.data)}for(const w of t.dependencies){const L=b.get(w.sourceEntityId),le=b.get(w.targetEntityId);L!==void 0&&le!==void 0&&c.push({source:L,target:le,edgeType:"dependency",dependencyType:w.dependencyType,strength:w.strength})}n(vt,a,!0),n(I,g,!0),n(i,c,!0),n(m,M,!0)}finally{n(H,!1)}}async function $a(t){if(!t){n(E,[],!0),n(oe,[],!0),n(Ge,[],!0),n(W,new Map,!0);return}const r=await la(t.id,10);n(E,r.map(a=>({id:a.id,score:a.score??0,kind:"similar"})),!0),n(oe,[],!0),n(Ge,e(E),!0),n(W,new Map(e(E).map(a=>[a.id,a.kind])),!0)}function eo(){n(v,null),n(_,null),n(C,null),n(Et,[],!0),n(jt,"")}function $r(t){const r=e(m).get(t)??null;r&&(n(C,null),n(v,r,!0))}function to(t){if(e(ge)==="2d"){e(pt)?.focusNode(t);return}e(ir)?.focusNode(t)}async function ro(){if(!e(v)||e(Xt))return;n(Xt,!0),n(jt,"");const t=e(v).id,r=!(e(v).pinned??!1),a=await Ao(t,r);if(!a.success){n(jt,a.error??"Failed to update pin state",!0),n(Xt,!1);return}Ra(t,c=>({...c,pinned:r})),e(ge)==="3d"&&e(ir)?.refreshAppearance(),n(Xt,!1)}async function no(){if(e(v)){n(Kt,!0);try{n(Et,await la(e(v).id,10,Ro.filterType||void 0),!0)}finally{n(Kt,!1)}}}async function en(){n(ae,!1),n(U,""),n(K,""),n(ie,[],!0),n(v,null),n(_,null),n(C,null),n(Et,[],!0),n(Kt,!1),n(m,new Map,!0),n(W,new Map,!0),n(E,[],!0),n(oe,[],!0),n(Ge,[],!0),n(V,[],!0),n(ve,0),n(ot,!1),n(vt,[],!0),n(i,[],!0),n(I,[],!0),n(jt,""),e(pt)?.stopSimulation(),e(pt)?.stopRendering(),e(pt)?.resetCamera(),e(ir)?.destroy(),n(ge,"2d"),await un(),Hn()}ne(()=>{const t=e(V),r=new Set,a=new Map,c=new Map,g=new Map,M=new Map;for(const b of t){b.pinned&&r.add(b.id);const T=b.who??"unknown";a.set(T,(a.get(T)??0)+1),typeof b.type=="string"&&b.type.length>0&&c.set(b.type,(c.get(b.type)??0)+1);const w=b.sourceType??"memory";g.set(w,(g.get(w)??0)+1),M.set(b.id,[b.content,b.text??"",b.who??"",b.type??"",b.sourceType??"",b.sourceId??"",...b.tags??[]].join(" ").toLowerCase())}if(n(bt,r,!0),n(q,M,!0),n(Qt,[...a.entries()].sort((b,T)=>T[1]-b[1]||b[0].localeCompare(T[0])).map(([b,T])=>({who:b,count:T})),!0),n(Dt,[...c.entries()].sort((b,T)=>T[1]-b[1]||b[0].localeCompare(T[0])).map(([b,T])=>({value:b,count:T})),!0),n(lt,[...g.entries()].sort((b,T)=>T[1]-b[1]||b[0].localeCompare(T[0])).map(([b,T])=>({value:b,count:T})),!0),e(Te).size>0){const b=new Set([...e(Te)].filter(T=>a.has(T)));b.size!==e(Te).size&&n(Te,b,!0)}}),ne(()=>{let t=!1;return(async()=>{const r=await Co();t||n(He,r.filter(a=>a.trim().length>0),!0)})(),()=>{t=!0}}),ne(()=>{if(e(We).size===0||e(He).length===0)return;const t=new Set(e(He)),r=new Set([...e(We)].filter(a=>t.has(a)));r.size!==e(We).size&&n(We,r,!0)}),ne(()=>{const t=e(se);t==="all"||t==="custom"||n(Ee,Date.now(),!0)}),ne(()=>{const t=e(Ae);if(!t.trim()){clearTimeout(it),n(Re,""),n(It,null),n(Oe,[],!0);return}const r=window.setTimeout(()=>{n(Re,t,!0)},180);return it=r,()=>clearTimeout(r)}),ne(()=>{const t=e(Re).trim().toLowerCase(),r=e(V);if(!t){n(It,null),n(Oe,[],!0);return}const a=new Set,c=[];for(const g of r){const M=e(q).get(g.id);M&&M.includes(t)&&(a.add(g.id),c.push(g))}if(e(B))for(const[g,M]of e(m)){if(a.has(g))continue;[M.content,M.who??"",...M.tags??[]].join(" ").toLowerCase().includes(t)&&(a.add(g),c.push(M))}n(It,a,!0),n(Oe,c.slice(0,50),!0)}),ne(()=>{const t=e(Te);if(t.size===0){n(tr,null);return}n(tr,new Set(e(V).filter(r=>t.has(r.who??"unknown")).map(r=>r.id)),!0)}),ne(()=>{if(!(typeof window>"u"||e(ze))){try{const t=window.localStorage.getItem(Xn);if(t){const r=JSON.parse(t);if(Array.isArray(r)){const a=r.filter(c=>{if(typeof c!="object"||c===null)return!1;const g=c;return typeof g.id=="string"&&typeof g.name=="string"&&typeof g.search=="string"&&Array.isArray(g.sources)&&typeof g.pinnedOnly=="boolean"&&typeof g.neighborhoodOnly=="boolean"&&typeof g.clusterLensMode=="boolean"});n(ue,a.slice(0,8),!0)}}}catch{n(ue,[],!0)}n(ze,!0)}}),ne(()=>{typeof window>"u"||!e(ze)||window.localStorage.setItem(Xn,JSON.stringify(e(ue)))}),ne(()=>{if(!(typeof window>"u"||e(qe)))try{const t=window.localStorage.getItem(fa);if(t){const r=JSON.parse(t);if(typeof r=="object"&&r!==null){const a=r;n(P,xn({centerForce:typeof a.centerForce=="number"?a.centerForce:Ir.centerForce,repelForce:typeof a.repelForce=="number"?a.repelForce:Ir.repelForce,linkForce:typeof a.linkForce=="number"?a.linkForce:Ir.linkForce,linkDistance:typeof a.linkDistance=="number"?a.linkDistance:Ir.linkDistance}),!0)}}}finally{n(qe,!0)}}),ne(()=>{typeof window>"u"||!e(qe)||window.localStorage.setItem(fa,JSON.stringify(e(P)))}),ne(()=>{if(!(typeof window>"u"||e(ar))){try{const t=window.sessionStorage.getItem($e);(t==="source"||t==="newness"||t==="none")&&n($,t,!0),window.sessionStorage.getItem(ct)==="true"&&n(_t,!0)}catch{}try{const t=window.localStorage.getItem(Ue);if(t){const r=Number.parseInt(t,10);Number.isNaN(r)||n(rr,r,!0)}}catch{}try{window.localStorage.removeItem(Ct),window.localStorage.removeItem(be)}catch{}n(ar,!0)}}),ne(()=>{if(!(typeof window>"u"||!e(ar))){try{e($)==="source"?window.sessionStorage.removeItem($e):window.sessionStorage.setItem($e,e($))}catch{}try{e(_t)&&e($)!=="none"?window.sessionStorage.setItem(ct,"true"):window.sessionStorage.removeItem(ct)}catch{}try{e(nr)!==null&&window.localStorage.setItem(Ue,String(e(nr)))}catch{}}}),ne(()=>{if(!(typeof window>"u"))try{window.sessionStorage.getItem(_e)==="true"&&n(B,!0)}catch{}}),ne(()=>{if(!(typeof window>"u"))try{e(B)?window.sessionStorage.setItem(_e,"true"):window.sessionStorage.removeItem(_e)}catch{}}),ne(()=>{if(typeof window>"u")return;const t=window.setInterval(()=>{n(qt,Date.now(),!0)},6e4);return()=>window.clearInterval(t)}),ne(()=>{const t=new Set;if(e(ht)){const r=e(v)??e(Gt);if(r){t.add(r.id);const a=e(v)!==null?e(Ge):e(Gr);for(const c of a)t.add(c.id)}}n(G,t,!0)}),ne(()=>{e(ht),e(G),Xr()}),ne(()=>{e($),e(_t),e(qt),e(rr),e(ge)==="2d"&&e(pt)?.requestRedraw(),Xr()}),ne(()=>{!e(ae)||typeof window>"u"||e(nr)===null&&n(nr,Date.now(),!0)}),ne(()=>{e(P),e(ae)&&e(ge)==="2d"&&e(pt)?.updatePhysics(e(P))});const ao=Q(()=>Ln(Cn()));ne(()=>{const t=e(ao);if(!e(ae)||e(U).length>0||t===e(tt))return;clearTimeout(Ht);const r=window.setTimeout(()=>{en()},220);return Ht=r,()=>clearTimeout(r)}),ne(()=>{const t=e(xt)===!0?new Set(e(bt)):null,r=e(v)??e(Gt),a=e(v)?e(Ge):e(Gr),c=e(Wt)===!0&&r?new Set([r.id,...a.map(g=>g.id)]):null;n(Pt,Aa([e(It),e(tr),t,c]),!0),Xr()}),ne(()=>{$a(e(v))}),ne(()=>{const t=e($t),r=e(E),a=e(oe);n(Ge,t==="similar"?r:a,!0),n(W,new Map(e(Ge).map(c=>[c.id,c.kind])),!0),Xr()});const Gt=Q(()=>e(C)?e(m).get(e(C))??null:e(_)),Gn=Q(Qr),oo=Q(()=>{e(I);const t=e(i),r=new Map;for(const a of t){const c=Yn(a.source),g=Yn(a.target);if(!c||!g||c===g)continue;const M=r.get(c)??new Map;M.set(g,(M.get(g)??0)+1),r.set(c,M);const b=r.get(g)??new Map;b.set(c,(b.get(c)??0)+1),r.set(g,b)}return r}),Gr=Q(()=>{const t=e(Gt);if(!t)return[];const r=e(oo).get(t.id);if(!r||r.size===0)return[];const a=[...r.entries()].sort((g,M)=>M[1]-g[1]).slice(0,6),c=a[0]?.[1]??1;return a.map(([g,M])=>({id:g,score:M/c,kind:"similar"}))}),io=Q(()=>new Map(e(Gr).map(t=>[t.id,"similar"]))),zn=Q(()=>e(v)?e(W):e(io)),wr=Q(()=>{const t=e(v);return t?e(vt).find(r=>r.data.id===t.id)??null:null}),tn=Q(()=>e(v)?[]:e(Gr)),Bn=Q(()=>{const t=new Map(e(Qt).map(c=>[c.who,c])),r=Ze.map(c=>t.get(c)).filter(c=>!!c),a=e(Qt).filter(c=>!Xe.has(c.who));return[...r,...a].slice(0,8)});ne(()=>{e(v)&&e(C)&&n(C,null)}),ne(()=>{const t=e(C);t&&(e(m).has(t)||n(C,null))}),ne(()=>{const t=e(O);if(!t)return;Ut=t.getBoundingClientRect();const r=new ResizeObserver(()=>{Ut=t.getBoundingClientRect()});return r.observe(t),()=>r.disconnect()}),ne(()=>{e(X)&&An()}),ne(()=>{if(typeof window>"u")return;const t=r=>{if(r.key==="Shift"){qa();return}r.key==="Escape"&&On()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}}),ne(()=>{if(!e(O))return;const t=new IntersectionObserver(r=>{r[0].isIntersecting&&!e(ae)&&!e(Tn)&&(n(Tn,!0),Hn())},{threshold:.1});return t.observe(e(O)),()=>t.disconnect()}),ne(()=>{kr.embeddings.controlsOpen=e(me),kr.embeddings.presetsOpen=e(Ye),kr.embeddings.sourcesOpen=e(Be),Bo()});var rn=Ks();Ar("keydown",Fo,ka);var Wn=l(rn);{var so=t=>{Go(t,{title:"Constellation",children:(r,a)=>{zo(r,{group:"memory",get tabs(){return Yo},get activeTab(){return ia.activeTab},onselect:(c,g)=>Oo(g)})}})};j(Wn,t=>{f()||t(so)})}var Kn=d(Wn,2),Sr=l(Kn),qn=l(Sr);{var lo=t=>{var r=zi();Bt(r,"",{},{top:"52px"});var a=l(r),c=l(a);s(a),s(r),F(()=>h(c,`${gn.Unlock} preview`)),Y("click",a,On),u(t,r)};j(qn,t=>{e(C)&&t(lo)})}var Un=d(qn,2);{var co=t=>{var r=Qi(),a=l(r),c=l(a),g=l(c),M=d(g),b=d(M),T=l(b);s(b);var w=d(b,2);{var L=N=>{var D=Bi(),A=l(D);s(D),F(te=>h(A,`${te??""}%`),[()=>Math.round(e(At).percent)]),u(N,D)};j(w,N=>{e(_r)&&e(At)&&N(L)})}s(c);var le=d(c,2);{var k=N=>{var D=Ji(),A=l(D),te=d(l(A),2),Pe=l(te);s(te),s(A);var Ce=d(A,2);{var Se=z=>{var re=qi(),ee=l(re),Me=l(ee,!0);s(ee);var he=d(ee,2);{var ce=Ne=>{var ke=Wi(),Fe=l(ke,!0);s(ke),F(()=>h(Fe,e(lr))),u(Ne,ke)};j(he,Ne=>{e(lr)&&Ne(ce)})}var Le=d(he,2);{var Ve=Ne=>{var ke=Ki(),Fe=l(ke),rt=l(Fe),wt=l(rt);s(rt);var ft=d(rt,2),Qe=l(ft);s(ft),s(Fe);var De=d(Fe,2),St=l(De);s(De);var Zt=d(De,2),pr=l(Zt);s(Zt),s(ke),F((fr,mr,J,nt,Vt)=>{h(wt,`${fr??""} / ${mr??""}`),h(Qe,`${J??""}%`),Bt(St,nt),h(pr,`${Vt??""} remaining · ${e(At).coverage??""} coverage`)},[()=>e(At).completed.toLocaleString(),()=>e(At).baseline.toLocaleString(),()=>Math.round(e(At).percent),()=>`width:${Math.max(0,Math.min(100,e(At).percent))}%`,()=>e(At).remaining.toLocaleString()]),u(Ne,ke)};j(Le,Ne=>{e(At)&&Ne(Ve)})}s(re),F(()=>h(Me,e(sr))),u(z,re)};j(Ce,z=>{e(sr)&&z(Se)})}var R=d(Ce,2);Mt(R,21,()=>e(ur).checks,kt,(z,re)=>{var ee=Vi(),Me=l(ee),he=d(Me,2),ce=l(he),Le=l(ce),Ve=l(Le,!0);s(Le);var Ne=d(Le,2),ke=l(Ne,!0);s(Ne),s(ce);var Fe=d(ce,2),rt=l(Fe,!0);s(Fe);var wt=d(Fe,2);{var ft=Qe=>{var De=Ui(),St=l(De,!0);s(De),F(()=>{De.disabled=e(_r),h(St,e(_r)?"running...":e(re).fix)}),Y("click",De,()=>Na(e(re))),u(Qe,De)};j(wt,Qe=>{e(re).fix&&e(re).status!=="ok"&&Qe(ft)})}s(he),s(ee),F(Qe=>{Bt(Me,`background:${Qe??""}`),h(Ve,e(re).name),h(ke,e(re).status),h(rt,e(re).message)},[()=>Pa(e(re).status)]),u(z,ee)}),s(R),s(D),F(()=>h(Pe,`${e(ur).config.provider??""}/${e(ur).config.model??""}`)),u(N,D)};j(le,N=>{e(Ur)&&N(k)})}s(a),s(r),F((N,D)=>{Bt(g,`background:${N??""}`),h(M,` ${e(ur).status??""} `),h(T,`${D??""}%`)},[()=>Fa(e(ur).status),()=>Math.round(e(ur).score*100)]),Y("click",c,()=>n(Ur,!e(Ur))),u(t,r)};j(Un,t=>{e(ur)&&t(co)})}var nn=d(Un,2),uo=l(nn);Yt(uo,()=>Lr,(t,r)=>{r(t,{class:"pointer-events-auto flex min-w-[180px] max-h-full flex-col-reverse",get open(){return e(S)},set open(a){n(S,a,!0)},children:(a,c)=>{var g=ls(),M=xe(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center gap-2 px-3 py-1.5 min-w-[180px] border border-[var(--sig-border)] text-[10px] font-[family-name:var(--font-mono)] uppercase tracking-[0.06em] text-[var(--sig-text-muted)] bg-transparent",get"aria-expanded"(){return e(S)},children:(L,le)=>{var k=Zi(),N=d(xe(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(S)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var b=d(M,2);Yt(b,()=>Cr,(T,w)=>{w(T,{class:"min-h-0 max-h-[min(40vh,24rem)] overflow-y-auto border border-[var(--sig-border)] bg-[rgba(5,5,5,0.88)] px-3 py-2",children:(L,le)=>{var k=ss(),N=xe(k),D=d(l(N));s(N);var A=d(N,2);{var te=ee=>{var Me=es(),he=xe(Me),ce=l(he),Le=l(ce);gr(),s(ce);var Ve=d(ce,2),Ne=l(Ve);gr(),s(Ve);var ke=d(Ve,2),Fe=l(ke);gr(),s(ke);var rt=d(ke,2),wt=l(rt);gr(),s(rt),s(he);var ft=d(he,2);Mt(ft,21,()=>e(Bn),kt,(Qe,De)=>{var St=$i(),Zt=l(St);s(St),F(pr=>{mt(St,1,`h-5 inline-flex items-center gap-1 px-1.5 py-0 font-[family-name:var(--font-mono)] text-[10px] border border-[rgba(255,255,255,0.14)] ${pr??""}`),h(Zt,`${e(De).who??""} ${e(De).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(De).who)?"bg-[rgba(255,255,255,0.08)] text-[var(--sig-text-bright)]":"bg-transparent text-[var(--sig-text-muted)]"]),u(Qe,St)}),s(ft),F((Qe,De,St,Zt)=>{Bt(Le,Qe),Bt(Ne,De),Bt(Fe,St),Bt(wt,Zt)},[()=>`background:${jr(3e5,.95)}`,()=>`background:${jr(108e5,.9)}`,()=>`background:${jr(2592e5,.85)}`,()=>`background:${jr(2592e6,.85)}`]),u(ee,Me)},Pe=ee=>{var Me=rs();Mt(Me,21,()=>e(Bn),kt,(he,ce)=>{var Le=ts(),Ve=l(Le),Ne=d(Ve);s(Le),F((ke,Fe)=>{mt(Le,1,`h-5 inline-flex items-center gap-1 px-1.5 py-0 font-[family-name:var(--font-mono)] text-[10px] border border-[rgba(255,255,255,0.14)] ${ke??""}`),Bt(Ve,Fe),h(Ne,` ${e(ce).who??""} ${e(ce).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(ce).who)?"bg-[rgba(255,255,255,0.08)] text-[var(--sig-text-bright)]":"bg-transparent text-[var(--sig-text-muted)]",()=>`background:${ya(e(ce).who,1)}`]),u(he,Le)}),s(Me),u(ee,Me)},Ce=ee=>{var Me=ns();u(ee,Me)};j(A,ee=>{e($)==="newness"?ee(te):e($)==="source"?ee(Pe,1):ee(Ce,-1)})}var Se=d(A,6);{var R=ee=>{var Me=as();u(ee,Me)};j(Se,ee=>{e(_t)&&e($)!=="none"&&ee(R)})}var z=d(Se,4);{var re=ee=>{var Me=is(),he=d(l(Me),2);Mt(he,21,()=>Object.entries(qr),kt,(ce,Le)=>{var Ve=Q(()=>Po(e(Le),2));let Ne=()=>e(Ve)[0],ke=()=>e(Ve)[1];var Fe=vr(),rt=xe(Fe);{var wt=ft=>{var Qe=os(),De=l(Qe),St=d(De);s(Qe),F(()=>{Bt(De,`background:${ke()}; clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);`),h(St,` ${Ne()??""}`)}),u(ft,Qe)};j(rt,ft=>{Ne()!=="unknown"&&ft(wt)})}u(ce,Fe)}),s(he),gr(2),s(Me),u(ee,Me)};j(z,ee=>{e(B)&&ee(re)})}F(()=>h(D,` = ${e($)==="none"?"off":e($)==="newness"?"by recency":"by source"}`)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})}),s(nn);var Vn=d(nn,2);{var go=t=>{var r=ds(),a=l(r),c=l(a,!0);s(a),s(r),F(()=>h(c,e(U))),u(t,r)},vo=t=>{var r=cs(),a=l(r),c=l(a,!0);s(a),s(r),F(()=>h(c,e(K))),u(t,r)},po=t=>{var r=us();u(t,r)},fo=t=>{var r=gs();u(t,r)};j(Vn,t=>{e(U)?t(go):e(K)?t(vo,1):e(ae)&&e(V).length===0?t(po,2):e(ae)||t(fo,3)})}var Jn=d(Vn,2);Bt(Jn,"",{},{top:"20px"});var Qn=d(Jn,4);{var mo=t=>{var r=bs(),a=l(r),c=l(a),g=l(c,!0);s(c);var M=d(c,2);{var b=R=>{var z=vs(),re=l(z,!0);s(z),F(()=>h(re,e(Gt).type)),u(R,z)};j(M,R=>{e(Gt).type&&R(b)})}var T=d(M,2);{var w=R=>{var z=ps();u(R,z)};j(T,R=>{e(Gt).pinned&&R(w)})}var L=d(T,2);{var le=R=>{var z=fs();u(R,z)};j(L,R=>{e(C)&&R(le)})}s(a);var k=d(a,2),N=l(k);s(k);var D=d(k,2),A=l(D,!0);s(D);var te=d(D,2),Pe=l(te,!0);s(te);var Ce=d(te,2);{var Se=R=>{var z=xs(),re=d(l(z),2);Mt(re,21,()=>e(tn),kt,(ee,Me)=>{const he=Q(()=>e(m).get(e(Me).id));var ce=vr(),Le=xe(ce);{var Ve=Ne=>{var ke=ms(),Fe=l(ke),rt=l(Fe,!0);s(Fe);var wt=d(Fe,2),ft=l(wt);s(wt),s(ke),F((Qe,De)=>{h(rt,Qe),h(ft,`${De??""}%`)},[()=>yr(e(he)),()=>Math.round(e(Me).score*100)]),u(Ne,ke)};j(Le,Ne=>{e(he)&&Ne(Ve)})}u(ee,ce)}),s(re),s(z),u(R,z)};j(Ce,R=>{e(tn).length>0&&R(Se)})}s(r),hr(r,R=>n(X,R),()=>e(X)),F((R,z,re)=>{h(g,e(Gt).who??"unknown"),h(N,`importance ${R??""}% · ${z??""} · linked ${e(tn).length??""}`),h(A,re),h(Pe,e(C)?"ESC or Unlock Preview button":"Hold Shift to lock preview")},[()=>Math.round((e(Gt).importance??0)*100),()=>La(e(Gt).createdAt),()=>yr(e(Gt))]),u(t,r)};j(Qn,t=>{e(Gt)&&t(mo)})}var zr=d(Qn,2);let Zn;var xo=l(zr);{var bo=t=>{{let r=Q(()=>e(ht)&&e(G).size>0),a=Q(()=>e(Te).size>0?e(Te):null);hr(ui(t,{get nodes(){return e(vt)},get edges(){return e(i)},get graphPhysics(){return e(P)},get graphSelected(){return e(v)},get graphHovered(){return e(Gt)},get embeddingFilterIds(){return e(Pt)},get relationLookup(){return e(zn)},get pinnedIds(){return e(bt)},get lensIds(){return e(G)},get clusterLensMode(){return e(r)},get colorMode(){return e($)},get nowMs(){return e(qt)},get showNewSinceLastSeen(){return e(_t)},get lastSeenMs(){return e(rr)},get sourceFocusSources(){return e(a)},onselectnode:c=>{c?$r(c.id):n(v,null)},onhovernode:Rn}),c=>n(pt,c,!0),()=>e(pt))}},ho=t=>{var r=hs(),a=l(r),c=l(a,!0);s(a),s(r),F(()=>h(c,e(U))),u(t,r)},yo=t=>{var r=ys(),a=l(r),c=l(a,!0);s(a),s(r),F(()=>h(c,e(K))),u(t,r)};j(xo,t=>{e(ae)?t(bo):e(U)?t(ho,1):e(K)&&t(yo,2)})}s(zr);var an=d(zr,2);let $n;var _o=l(an);{var wo=t=>{var r=vr(),a=xe(r);{let c=Q(()=>e(ht)&&e(G).size>0),g=Q(()=>e(Te).size>0?e(Te):null);Yt(a,()=>e(Rr),(M,b)=>{hr(b(M,{get embeddings(){return e(V)},get projected3d(){return e(ie)},get graphSelected(){return e(v)},get embeddingFilterIds(){return e(Pt)},get relationLookup(){return e(zn)},get pinnedIds(){return e(bt)},get lensIds(){return e(G)},get clusterLensMode(){return e(c)},get embeddingById(){return e(m)},get colorMode(){return e($)},get nowMs(){return e(qt)},get showNewSinceLastSeen(){return e(_t)},get lastSeenMs(){return e(rr)},get sourceFocusSources(){return e(g)},onselectnode:T=>{T?$r(T.id):n(v,null)},onhovernode:Rn}),T=>n(ir,T,!0),()=>e(ir))})}u(t,r)},So=t=>{var r=_s(),a=l(r),c=l(a,!0);s(a),s(r),F(()=>h(c,e(U)||"Loading 3D...")),u(t,r)};j(_o,t=>{e(Rr)&&!e(Or)?t(wo):e(Or)&&t(So,1)})}s(an),s(Sr),hr(Sr,t=>n(O,t),()=>e(O));var ea=d(Sr,2),on=l(ea),ta=l(on);Yt(ta,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(me)},set open(a){n(me,a,!0)},children:(a,c)=>{var g=ks(),M=xe(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-[family-name:var(--font-mono)] text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=ws(),N=d(xe(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(me)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var b=d(M,2);Yt(b,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Ms(),N=l(k),D=l(N);Jt(D),hr(D,Ft=>Je=Ft,()=>Je);var A=d(D,2);{var te=Ft=>{var Fr=Ss(),cn=l(Fr,!0);s(Fr),F(()=>h(cn,e(Oe).length)),u(Ft,Fr)};j(A,Ft=>{e(Ae)&&Ft(te)})}s(N);var Pe=d(N,2),Ce=l(Pe);s(Pe);var Se=d(Pe,2),R=l(Se),z=d(R,2),re=d(z,2),ee=d(re,2),Me=l(ee,!0);s(ee),s(Se);var he=d(Se,2),ce=d(l(he),2),Le=l(ce),Ve=d(Le,2),Ne=d(Ve,2);s(ce),s(he);var ke=d(he,2),Fe=d(l(ke),2),rt=l(Fe),wt=d(rt,2),ft=l(wt,!0);s(wt),s(Fe),s(ke);var Qe=d(ke,2),De=d(l(Qe),2),St=l(De),Zt=d(l(St),2),pr=l(Zt,!0);s(Zt),s(St);var fr=d(St,2);Jt(fr),s(De);var mr=d(De,2),J=l(mr),nt=d(l(J),2),Vt=l(nt,!0);s(nt),s(J);var Rt=d(J,2);Jt(Rt),s(mr);var at=d(mr,2),zt=l(at),Ot=d(l(zt),2),xr=l(Ot,!0);s(Ot),s(zt);var er=d(zt,2);Jt(er),s(at);var sn=d(at,2),ln=l(sn),aa=d(l(ln),2),Io=l(aa,!0);s(aa),s(ln);var dn=d(ln,2);Jt(dn),s(sn);var To=d(sn,2);s(Qe),s(k),F((Ft,Fr,cn,Eo)=>{h(Ce,`Window ${e(Gn).offset+1}-${e(Gn).offset+e(V).length} / ${e(ve)??""}`),mt(R,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(xt)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),mt(z,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(Wt)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),mt(re,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(ht)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(Me,gn.Reset),mt(Le,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="newness"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),mt(Ve,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="source"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),mt(Ne,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="none"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),mt(rt,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(_t)&&e($)!=="none"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"} ${e($)==="none"?"opacity-60 cursor-not-allowed":""}`),rt.disabled=e($)==="none",mt(wt,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(B)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(ft,e(H)?"Loading...":"Entities"),h(pr,Ft),Br(fr,e(P).centerForce),h(Vt,Fr),Br(Rt,e(P).repelForce),h(xr,cn),Br(er,e(P).linkForce),h(Io,Eo),Br(dn,e(P).linkDistance)},[()=>e(P).centerForce.toFixed(2),()=>Math.round(e(P).repelForce),()=>e(P).linkForce.toFixed(2),()=>Math.round(e(P).linkDistance)]),Y("input",D,()=>n(Z,"custom-live")),dr(D,()=>e(Ae),Ft=>n(Ae,Ft)),Y("click",R,Ga),Y("click",z,za),Y("click",re,Ba),Y("click",ee,Ha),Y("click",Le,()=>n($,"newness")),Y("click",Ve,()=>n($,"source")),Y("click",Ne,()=>{n($,"none"),n(_t,!1)}),Y("click",rt,()=>n(_t,!e(_t))),Y("click",wt,()=>{n(B,!e(B)),e(ae)&&en()}),Y("input",fr,Ft=>Nr({centerForce:Hr(Ft,e(P).centerForce)})),Y("input",Rt,Ft=>Nr({repelForce:Hr(Ft,e(P).repelForce)})),Y("input",er,Ft=>Nr({linkForce:Hr(Ft,e(P).linkForce)})),Y("input",dn,Ft=>Nr({linkDistance:Hr(Ft,e(P).linkDistance)})),Y("click",To,()=>Nr(Ir)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var ra=d(ta,2);Yt(ra,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(Ye)},set open(a){n(Ye,a,!0)},children:(a,c)=>{var g=Fs(),M=xe(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-[family-name:var(--font-mono)] text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Is(),N=d(xe(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(Ye)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var b=d(M,2);Yt(b,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Ns(),N=l(k);Mt(N,17,()=>Ua,kt,(Pe,Ce)=>{var Se=Ts(),R=l(Se,!0);s(Se),F(()=>{mt(Se,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(Z)===e(Ce).id?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(R,e(Ce).name)}),Y("click",Se,()=>jn(e(Ce))),u(Pe,Se)});var D=d(N,2);Mt(D,17,()=>e(ue),kt,(Pe,Ce)=>{var Se=Es(),R=l(Se),z=l(R,!0);s(R);var re=d(R,2);s(Se),F(()=>{mt(R,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] ${e(Z)===e(Ce).id?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(z,e(Ce).name),fn(re,"aria-label",`Delete ${e(Ce).name} preset`)}),Y("click",R,()=>jn(e(Ce))),Y("click",re,()=>Qa(e(Ce).id)),u(Pe,Se)});var A=d(D,2),te=l(A,!0);s(A),s(k),F(()=>h(te,gn.Save)),Y("click",A,Ja),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var na=d(ra,2);Yt(na,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(Be)},set open(a){n(Be,a,!0)},children:(a,c)=>{var g=As(),M=xe(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-[family-name:var(--font-mono)] text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Ps(),N=d(xe(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(Be)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var b=d(M,2);Yt(b,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Ds(),N=l(k);{var D=te=>{var Pe=Cs();u(te,Pe)},A=te=>{var Pe=vr(),Ce=xe(Pe);Mt(Ce,17,()=>e(Qt),kt,(Se,R)=>{var z=Ls(),re=l(z);s(z),F(ee=>{mt(z,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] ${ee??""}`),h(re,`${e(R).who??""} ${e(R).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(R).who)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",z,()=>Wa(e(R).who)),u(Se,z)}),u(te,Pe)};j(N,te=>{e(Qt).length===0?te(D):te(A,-1)})}s(k),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var Mo=d(na,2);Yt(Mo,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(dt)},set open(a){n(dt,a,!0)},children:(a,c)=>{var g=Ws(),M=xe(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-[family-name:var(--font-mono)] text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Rs(),N=d(xe(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(dt)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var b=d(M,2);Yt(b,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Bs(),N=l(k),D=d(l(N),2);Jt(D);var A=d(D,4);Jt(A);var te=d(A,2),Pe=l(te);Pe.value=Pe.__value="all";var Ce=d(Pe);Ce.value=Ce.__value="24h";var Se=d(Ce);Se.value=Se.__value="7d";var R=d(Se);R.value=R.__value="30d";var z=d(R);z.value=z.__value="90d";var re=d(z);re.value=re.__value="custom",s(te),s(N);var ee=d(N,2);{var Me=J=>{var nt=Os(),Vt=l(nt);Jt(Vt);var Rt=d(Vt,2);Jt(Rt),s(nt),dr(Vt,()=>e(ye),at=>n(ye,at)),dr(Rt,()=>e(je),at=>n(je,at)),u(J,nt)};j(ee,J=>{e(se)==="custom"&&J(Me)})}var he=d(ee,2),ce=l(he),Le=l(ce);Le.value=Le.__value="all";var Ve=d(Le);Ve.value=Ve.__value="pinned";var Ne=d(Ve);Ne.value=Ne.__value="unpinned",s(ce);var ke=d(ce,2);Jt(ke);var Fe=d(ke,2);Jt(Fe);var rt=d(Fe,2);Jt(rt);var wt=d(rt,2);Jt(wt),s(he);var ft=d(he,2),Qe=d(l(ft),2);{var De=J=>{var nt=Ys();u(J,nt)},St=J=>{var nt=vr(),Vt=xe(nt);Mt(Vt,17,()=>e(He),kt,(Rt,at)=>{var zt=Xs(),Ot=l(zt,!0);s(zt),F(xr=>{mt(zt,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] ${xr??""}`),h(Ot,e(at))},[()=>e(We).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",zt,()=>Ya(e(at))),u(Rt,zt)}),u(J,nt)};j(Qe,J=>{e(He).length===0?J(De):J(St,-1)})}s(ft);var Zt=d(ft,2);{var pr=J=>{var nt=Hs(),Vt=d(l(nt),2);Mt(Vt,17,()=>[...new Set([...e(gt),...e(Dt).map(Rt=>Rt.value)])],kt,(Rt,at)=>{const zt=Q(()=>e(Dt).find(er=>er.value===e(at))?.count??0);var Ot=js(),xr=l(Ot);s(Ot),F(er=>{mt(Ot,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] ${er??""}`),h(xr,`${e(at)??""}${e(zt)>0?` ${e(zt)}`:""}`)},[()=>e(gt).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",Ot,()=>Xa(e(at))),u(Rt,Ot)}),s(nt),u(J,nt)};j(Zt,J=>{(e(Dt).length>0||e(gt).size>0)&&J(pr)})}var fr=d(Zt,2);{var mr=J=>{var nt=zs(),Vt=d(l(nt),2);Mt(Vt,17,()=>[...new Set([...e(et),...e(lt).map(Rt=>Rt.value)])],kt,(Rt,at)=>{const zt=Q(()=>e(lt).find(er=>er.value===e(at))?.count??0);var Ot=Gs(),xr=l(Ot);s(Ot),F(er=>{mt(Ot,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] ${er??""}`),h(xr,`${e(at)??""}${e(zt)>0?` ${e(zt)}`:""}`)},[()=>e(et).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",Ot,()=>ja(e(at))),u(Rt,Ot)}),s(nt),u(J,nt)};j(fr,J=>{(e(lt).length>0||e(et).size>0)&&J(mr)})}s(k),Ar("blur",D,Zr),dr(D,()=>e(pe),J=>n(pe,J)),Ar("blur",A,Zr),dr(A,()=>e(ut),J=>n(ut,J)),oa(te,()=>e(se),J=>n(se,J)),oa(ce,()=>e(yt),J=>n(yt,J)),dr(ke,()=>e(st),J=>n(st,J)),dr(Fe,()=>e(Tt),J=>n(Tt,J)),dr(rt,()=>e(Lt),J=>n(Lt,J)),dr(wt,()=>e(fe),J=>n(fe,J)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})}),s(on);var ko=d(on,2);{let t=Q(()=>e(wr)?.nodeType??void 0),r=Q(()=>e(wr)?.entityData??null),a=Q(()=>e(wr)?.aspectData??null),c=Q(()=>e(wr)?.attributeData??null),g=Q(()=>e(wr)?.parentEntityId??null),M=Q(()=>e(wr)?.parentAspectId??null);Gi(ko,{containerClass:"flex-1 min-h-0 w-full min-w-0 border-l-0 border-t-0 max-lg:max-h-none",get graphSelected(){return e(v)},get embeddings(){return e(V)},get embeddingById(){return e(m)},get activeNeighbors(){return e(Ge)},get relationMode(){return e($t)},get loadingGlobalSimilar(){return e(Kt)},get globalSimilar(){return e(Et)},get embeddingSearchMatches(){return e(Oe)},get embeddingSearch(){return e(Ae)},get pinBusy(){return e(Xt)},get pinError(){return e(jt)},get selectedNodeType(){return e(t)},get selectedEntityData(){return e(r)},get selectedAspectData(){return e(a)},get selectedAttributeData(){return e(c)},get parentEntityId(){return e(g)},get parentAspectId(){return e(M)},get constellationOverlay(){return e(de)},onselectembedding:$r,onclearselection:eo,onloadglobalsimilar:no,get onopenglobalsimilar(){return o.onopenglobalsimilar},onsetrelationmode:b=>n($t,b,!0),onfocusembedding:()=>e(v)&&to(e(v).id),onpintoggle:ro})}s(ea),s(Kn),s(rn),F(()=>{Zn=Bt(zr,"",Zn,{display:e(ge)==="2d"?"contents":"none"}),$n=Bt(an,"",$n,{display:e(ge)==="3d"?"contents":"none"})}),Y("mousemove",Sr,Ka),Ar("mouseleave",Sr,()=>{e(C)||n(_,null)}),u(y,rn),Sn()}Mn(["mousemove","click","input"]);export{tl as default};
1
+ import{p as wn,o as p,e as Ie,Q as ne,v as n,j as l,F as hr,i as e,t as d,k as j,l as s,b as u,d as Sn,u as Q,D as fn,O as Y,N as Ar,m as x,P as Mn,g as cr,y as F,B as mt,f as xe,w as gr,aa as Bt,z as h,A as Mt,K as kt,c as vr,q as No,$ as Fo,h as Yt,ac as Jt,ad as Br,I as dr,ae as oa,U as un,af as Po}from"./o6XZc-z-.js";import{L as Co,A as gn,n as ia,N as Lo,O as sa,P as Do,Q as la,R as Ao,T as Ro,h as Oo,i as Yo,U as vn,V as Xo,W as jo,X as Ho,t as Mr}from"./TJiN35vI.js";import{P as Go}from"./DiLyuexf.js";import{T as zo}from"./BBTUzYSt.js";import{C as Pr,a as Cr,b as Lr}from"./BVExryab.js";import{w as kr,s as Bo}from"./DCVuVDO1.js";import{f as da,a as ca,b as ua,c as ga,e as va,g as pa}from"./qiR1fnXB.js";import{C as Dr}from"./D0L5kY4V.js";const Wr=600,Wo=5e3,fa="signet-embeddings-graph-physics",Ir={centerForce:.28,repelForce:-260,linkForce:.12,linkDistance:92},mn={"claude-code":"#5eada4",clawdbot:"#a78bfa",daemon:"#22c55e","signet-daemon":"#22c55e",openclaw:"#facc15","openclaw-memory":"#facc15",opencode:"#60a5fa",user:"#ef4444",manual:"#f472b6",unknown:"#737373"},ma=3600*1e3,Ko=24*ma,xa=7*Ko,ba=900*1e3,ha=6*ma;function xn(y){const o=(f,S,v)=>Math.min(v,Math.max(S,f));return{centerForce:o(y.centerForce,0,1),repelForce:o(y.repelForce,-600,-10),linkForce:o(y.linkForce,.01,1),linkDistance:o(y.linkDistance,12,280)}}function kn(y){const o=Number.parseInt(y.slice(1),16);return[o>>16&255,o>>8&255,o&255]}function ya(y,o){const[f,S,v]=kn(mn[y??"unknown"]??mn.unknown);return`rgba(${f}, ${S}, ${v}, ${o})`}function _a(y){if(!y)return null;const o=new Date(y).getTime();return Number.isNaN(o)?null:o}function qo(y,o){const f=_a(y);if(f===null)return .22;const S=Math.max(0,o-f);return S<=ba?1:S<=ha?.76:S<=xa?.52:.22}function In(y){return y>=.95?"minutes":y>=.7?"hours":y>=.45?"week":"older"}function wa(y,o){const f=In(y);return f==="minutes"?`rgba(255, 176, 74, ${o})`:f==="hours"?`rgba(168, 34, 98, ${o})`:f==="week"?`rgba(76, 34, 122, ${o})`:`rgba(118, 111, 102, ${o})`}function Uo(y,o){if(o===null)return!1;const f=_a(y);return f===null?!1:f>o}function yr(y){const o=y.content??y.text??"";return o.length>160?`${o.slice(0,160)}...`:o}function Vo(y){const o=y.sourceType??"memory",f=y.sourceId??y.id;return`${o}:${f}`}function Jo(y,o,f,S,v,_){const U=f!==null&&!f.has(y),K=f!==null&&!f.has(o);if(U||K)return"rgba(120, 120, 120, 0.12)";if(_){const V=v.has(y),ve=v.has(o);return V&&ve?"rgba(220, 220, 220, 0.72)":"rgba(90, 90, 90, 0.08)"}return S.get(y)||S.get(o)?"rgba(200, 200, 200, 0.6)":"rgba(180, 180, 180, 0.4)"}const qr={person:"#eab308",project:"#06b6d4",system:"#a855f7",tool:"#10b981",concept:"#f43f5e",skill:"#f59e0b",task:"#64748b",unknown:"#737373"};function bn(y){return qr[y.toLowerCase()]??qr.unknown}function Kr(y,o){const f=bn(y),[S,v,_]=kn(f);return`rgba(${S}, ${v}, ${_}, ${o})`}function Qo(y,o){const f=.8+o*1.2;switch(y){case"uses":case"requires":return{color:"rgba(180, 180, 200, 0.35)",width:f,dash:[]};case"owned_by":return{color:"rgba(160, 160, 180, 0.25)",width:f+.4,dash:[]};case"blocks":return{color:"rgba(220, 100, 100, 0.4)",width:f,dash:[4,3]};case"informs":return{color:"rgba(100, 160, 220, 0.35)",width:f,dash:[2,3]};default:return{color:"rgba(150, 150, 160, 0.3)",width:f,dash:[]}}}function Zo(y){return 5+Math.min(y,1)*3}function $o(y){return 3+Math.min(y,1)}function ei(y){const o=y.aspects.length+y.aspects.reduce((f,S)=>f+S.attributes.length*.5,0);return 10+Math.min(o,24)*.5}function ti(y){switch(y){case"entity":return-200;case"aspect":return-40;case"attribute":return-15;case"memory":return-5;default:return-5}}function Sa(y,o){const[f,S,v]=kn(y);return`rgba(${f}, ${S}, ${v}, ${o})`}const ri=[.85],ni=[.3,.5,.7,.75,.9],hn={};for(const[y,o]of Object.entries(mn)){const f={};for(const S of ri)f[S]=Sa(o,S);hn[y]=f}const yn={};for(const[y,o]of Object.entries(qr)){const f={};for(const S of ni)f[S]=Sa(o,S);yn[y]=f}function _n(y,o){const S=hn[y??"unknown"]?.[o]??hn.unknown?.[o];return S||ya(y,o)}function br(y,o){const f=y.toLowerCase(),S=yn[f]?.[o]??yn.unknown?.[o];return S||Kr(y,o)}const ai={minutes:{.9:"rgba(255, 176, 74, 0.9)",1:"rgba(255, 176, 74, 1)"},hours:{.9:"rgba(168, 34, 98, 0.9)",1:"rgba(168, 34, 98, 1)"},week:{.9:"rgba(76, 34, 122, 0.9)",1:"rgba(76, 34, 122, 1)"},older:{.9:"rgba(118, 111, 102, 0.9)",1:"rgba(118, 111, 102, 1)"}};function oi(y,o){const f=In(y),S=ai[f]?.[o];return S||wa(y,o)}function Ma(y){if(!y)return 0;const o=new Date(y).getTime();return Number.isNaN(o)?0:o}function ii(y,o){if(y===0)return .22;const f=Math.max(0,o-y);return f<=ba?1:f<=ha?.76:f<=xa?.52:.22}class si{fills;constructor(o,f,S,v,_,U,K,V,ve,ot){const ae=new Array(o.length);for(let Ae=0;Ae<o.length;Ae++){const Re=o[Ae];if(Re.nodeType&&Re.nodeType!=="memory"){ae[Ae]="";continue}ae[Ae]=this.compute(Re,f,S,v,_,U,K,V,ve,ot)}this.fills=ae}compute(o,f,S,v,_,U,K,V,ve,ot){const ae=o.data.id,Ae=v.get(ae)??null,Re=S!==null&&!S.has(ae),it=_.has(ae),Oe=K&&!U.has(ae);if(f===ae)return"rgba(255, 255, 255, 0.95)";if(Oe)return Re?"rgba(80, 80, 80, 0.08)":"rgba(95, 95, 95, 0.15)";if(Ae==="similar")return V==="none"?Re?"rgba(160, 170, 185, 0.3)":"rgba(198, 210, 228, 0.84)":Re?"rgba(129, 180, 255, 0.35)":"rgba(129, 180, 255, 0.9)";if(Ae==="dissimilar")return V==="none"?Re?"rgba(165, 150, 150, 0.28)":"rgba(208, 190, 190, 0.8)":Re?"rgba(255, 146, 146, 0.35)":"rgba(255, 146, 146, 0.9)";if(it)return Re?"rgba(220, 220, 220, 0.42)":"rgba(235, 235, 235, 0.95)";if(Re)return"rgba(120, 120, 120, 0.2)";if(V==="none")return"rgba(168, 168, 168, 0.82)";if(V==="newness"){const Je=o.createdMs??Ma(o.data.createdAt),Pt=ii(Je,ve);if(In(Pt)==="older"){const It=o.data.who??"unknown";if(ot!==null&&ot.has(It))return _n(It,.85)}return oi(Pt,.9)}return _n(o.data.who,.85)}}const or=50;class li{minX=-100;maxX=100;minY=-100;maxY=100;cells=new Map;cols=1;offsetX=0;offsetY=0;rebuild(o){if(this.cells.clear(),o.length===0){this.minX=-100,this.maxX=100,this.minY=-100,this.maxY=100,this.cols=1;return}let f=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,v=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(const K of o)K.x<f&&(f=K.x),K.x>S&&(S=K.x),K.y<v&&(v=K.y),K.y>_&&(_=K.y);const U=or;this.minX=f-U,this.maxX=S+U,this.minY=v-U,this.maxY=_+U,this.offsetX=this.minX,this.offsetY=this.minY,this.cols=Math.max(1,Math.ceil((this.maxX-this.minX)/or));for(const K of o){const V=Math.floor((K.x-this.offsetX)/or),ot=Math.floor((K.y-this.offsetY)/or)*this.cols+V,ae=this.cells.get(ot);ae?ae.push(K):this.cells.set(ot,[K])}}query(o,f,S){const v=S+or*.5,_=Math.floor((o-v-this.offsetX)/or),U=Math.floor((o+v-this.offsetX)/or),K=Math.floor((f-v-this.offsetY)/or),V=Math.floor((f+v-this.offsetY)/or),ve=Math.ceil((this.maxY-this.minY)/or),ot=[];for(let ae=Math.max(0,K);ae<=V&&ae<ve;ae++)for(let Ae=Math.max(0,_);Ae<=Math.min(this.cols-1,U);Ae++){const Re=this.cells.get(ae*this.cols+Ae);if(Re)for(const it of Re)ot.push(it)}return ot}}function pn(y,o,f,S){y.beginPath();for(let v=0;v<6;v++){const _=Math.PI/3*v-Math.PI/6,U=o+S*Math.cos(_),K=f+S*Math.sin(_);v===0?y.moveTo(U,K):y.lineTo(U,K)}y.closePath()}var di=x('<canvas class="minimap svelte-reb91a" aria-label="Graph navigation minimap"></canvas>'),ci=x('<div class="canvas-wrapper svelte-reb91a"><canvas class="main-canvas svelte-reb91a"></canvas> <!></div>');function ui(y,o){wn(o,!0);let f=p(null),S=0,v=0,_=.15,U=!1,K=!1,V=!1,ve=null,ot=0,ae=0,Ae=0,Re=0;const it=4;let Oe=null,Je=0,Pt=null,It=!1,tr=0,Te=!0,Qt=null,xt=!1,Wt=new Map;const bt=new li;let Xt=!0,jt=null,ht=[],G=[],Z=[],ue=0,ze=0,dt=!1;const me=160,Ye=120,Be=50;let Ze=p(null),Xe=!0,$e=0;const ct=4;let Ct=p(Ie({minX:-100,maxX:100,minY:-100,maxY:100}));const be=Q(()=>o.nodes.length>Be);let Ue=!1;function pe(){if(Te=!0,Xe=!0,!Je){const i=e(f)?.getContext("2d");i&&(Je=requestAnimationFrame(I=>$(i,I)))}}const ut=12e3,se=8e3,Ee=5e3;function ye(){S=0,v=0,_=.15,xt=!1,je=!1}let je=!1;function st(i){const I=Wt.get(i);I&&(S=I.x,v=I.y,_=Math.max(_,1.6),xt=!0)}function Tt(i,I,B=o.graphPhysics){Oe?.stop(),je=!1;const de=xn(B);Oe=da(i).force("link",ca(I).distance(de.linkDistance).strength(de.linkForce)).force("charge",ua().strength(de.repelForce)).force("x",ga(0).strength(de.centerForce)).force("y",va(0).strength(de.centerForce)).force("collide",pa().radius(H=>H.radius+2)).alphaDecay(.04).on("tick",()=>{Xt=!0,jt=null,pe()}).on("end",()=>{xt||gt()})}function yt(i,I){Oe?.stop(),je=!1;const B=ca(I).distance(H=>{const _e=H.source,ge=H.target;return H.edgeType==="dependency"?120:_e.nodeType==="entity"&&ge.nodeType==="aspect"?50:_e.nodeType==="aspect"&&ge.nodeType==="attribute"?30:_e.nodeType==="attribute"&&ge.nodeType==="memory"?20:50}).strength(H=>{if(H.edgeType==="dependency")return .05;const _e=H.source,ge=H.target;return _e.nodeType==="entity"&&ge.nodeType==="aspect"?.3:_e.nodeType==="aspect"&&ge.nodeType==="attribute"?.4:_e.nodeType==="attribute"&&ge.nodeType==="memory"?.5:.3}),de=ua().strength(H=>ti(H.nodeType));Oe=da(i).force("link",B).force("charge",de).force("x",ga(0).strength(.03)).force("y",va(0).strength(.03)).force("collide",pa().radius(H=>H.radius+2)).alphaDecay(.04).on("tick",()=>{Xt=!0,jt=null,pe()}).on("end",()=>{xt||gt()})}function Lt(i){Oe&&(Tt(o.nodes,o.edges,i),pe())}function fe(){Oe?.stop(),Oe=null}function He(i=!1){lt(),!i&&!xt&&o.nodes.length>0&&gt(),It||(window.addEventListener("resize",lt),It=!0),_t(),Te=!0;const I=e(f)?.getContext("2d");I&&(cancelAnimationFrame(Je),$(I,0))}function We(){Te=!0;const i=e(f)?.getContext("2d");i&&(cancelAnimationFrame(Je),$(i,0))}function Dt(){cancelAnimationFrame(Je)}function lt(){if(!e(f))return;let i=e(f).parentElement;for(;i&&getComputedStyle(i).display==="contents";)i=i.parentElement;const I=i?.getBoundingClientRect();!I||I.width===0||(e(f).width=I.width,e(f).height=I.height,!xt&&je&&gt(),pe())}function gt(){if(!e(f))return;if(o.nodes.length===0){S=0,v=0,_=.15;return}const i=Ht(),I=Math.max(i.maxX-i.minX,1),B=Math.max(i.maxY-i.minY,1),de=Math.max(e(f).width,1),H=Math.max(e(f).height,1),_e=Math.min(de/I,H/B)*.92;S=(i.minX+i.maxX)/2,v=(i.minY+i.maxY)/2,_=Math.max(.08,_e),je=!0}function et(i,I){if(!e(f))return[0,0];const B=e(f).getBoundingClientRect(),de=B.width/2,H=B.height/2;return[(i-B.left-de)/_+S,(I-B.top-H)/_+v]}function tt(i,I){Xt&&(bt.rebuild(o.nodes),Xt=!1);const B=bt.query(i,I,28),de=["entity","aspect","attribute","memory",void 0];for(const H of de)for(let _e=B.length-1;_e>=0;_e--){const ge=B[_e];if(ge.nodeType!==H)continue;const ie=ge.x-i,Ke=ge.y-I,P=ge.radius+(H==="entity"?6:H==="aspect"?5:4);if(ie*ie+Ke*Ke<=P*P)return ge}return null}function Ht(){return o.nodes.length===0?{minX:-100,maxX:100,minY:-100,maxY:100}:Xt?(bt.rebuild(o.nodes),Xt=!1,{minX:bt.minX,maxX:bt.maxX,minY:bt.minY,maxY:bt.maxY}):{minX:bt.minX,maxX:bt.maxX,minY:bt.minY,maxY:bt.maxY}}ne(()=>{o.nodes.length>0&&(Wt=new Map(o.nodes.map(i=>[i.data.id,i])),Xt=!0,jt=null,n(Ct,Ht(),!0),Xe=!0)});function $t(){if(!e(Ze)||!e(f))return;const i=e(Ze).getContext("2d");if(!i)return;const{minX:I,maxX:B,minY:de,maxY:H}=e(Ct),_e=B-I,ge=H-de;i.fillStyle="#050505",i.fillRect(0,0,me,Ye);const ie=(me-8)/_e,Ke=(Ye-8)/ge,P=Math.min(ie,Ke),qe=(me-_e*P)/2,m=(Ye-ge*P)/2;i.fillStyle="rgba(140, 140, 150, 0.5)";for(const ir of o.nodes){const Rr=qe+(ir.x-I)*P,Or=m+(ir.y-de)*P;i.fillRect(Rr-.5,Or-.5,1,1)}const q=e(f).width/_,W=e(f).height/_,C=S-q/2,O=v-W/2;let X=qe+(C-I)*P,we=m+(O-de)*P,Nt=q*P,Ut=W*P;const pt=2;X=Math.max(pt,Math.min(me-pt-1,X)),we=Math.max(pt,Math.min(Ye-pt-1,we)),Nt=Math.max(2,Math.min(me-X-pt,Nt)),Ut=Math.max(2,Math.min(Ye-we-pt,Ut)),i.strokeStyle="rgba(255, 255, 255, 0.75)",i.lineWidth=1.5,i.strokeRect(X,we,Nt,Ut),i.fillStyle="rgba(255, 255, 255, 0.03)",i.fillRect(X,we,Nt,Ut)}function E(i){if(!e(Ze))return null;const I=e(Ze).getBoundingClientRect(),B=i.clientX-I.left,de=i.clientY-I.top,{minX:H,maxX:_e,minY:ge,maxY:ie}=e(Ct),Ke=_e-H,P=ie-ge,qe=(me-8)/Ke,m=(Ye-8)/P,q=Math.min(qe,m),W=(me-Ke*q)/2,C=(Ye-P*q)/2,O=H+(B-W)/q,X=ge+(de-C)/q;return[O,X]}function oe(i){i.preventDefault(),i.stopPropagation(),Ue=!0,Kt(i)}function Ge(i){Ue&&Kt(i)}function Kt(i){const I=E(i);if(!I)return;const[B,de]=I;if(S=B,v=de,Xe=!0,Te=!0,!Je){const H=e(f)?.getContext("2d");H&&(Je=requestAnimationFrame(_e=>$(H,_e)))}}function Et(){Ue=!1}function $(i,I){if(!e(f))return;const B=Oe?.alpha?.()??0;if(!(B>.001)&&!Te){Je=0;return}Te=!1;const H=o.edges.length>14e3||o.nodes.length>2200,_e=B>0&&B<.05,ge=H||_e?33:16;if(I>0&&I-tr<ge){Je=requestAnimationFrame(m=>$(i,m));return}if(tr=I,dt){dt=!1;const[m,q]=et(ue,ze),W=tt(m,q),C=W?.data.id??null;C!==Qt&&(Qt=C,o.onhovernode(W?.data??null)),e(f)&&(e(f).style.cursor=W?"pointer":"grab")}const ie=e(f).width,Ke=e(f).height;i.fillStyle="#050505",i.fillRect(0,0,ie,Ke),i.save(),i.translate(ie/2,Ke/2),i.scale(_,_),i.translate(-S,-v);const P=o.graphSelected?.id??null;jt||(jt=new si(o.nodes,P,o.embeddingFilterIds,o.relationLookup,o.pinnedIds,o.lensIds,o.clusterLensMode,o.colorMode,o.nowMs,o.sourceFocusSources));const qe=_>=1.4?ut:_>=.8?se:Ee;if(ht.length>0){const m=Math.max(1,Math.ceil(ht.length/qe));i.beginPath();for(let q=0;q<ht.length;q+=m){const W=ht[q],C=W.source,O=W.target;typeof C=="number"||typeof O=="number"||!C||!O||(i.moveTo(C.x,C.y),i.lineTo(O.x,O.y))}i.strokeStyle="rgba(255, 255, 255, 0.03)",i.lineWidth=.4/_,i.stroke()}if(G.length>0){const m=Math.max(1,Math.ceil(G.length/qe)),q=new Map;for(let W=0;W<G.length;W+=m){const C=G[W],O=C.source,X=C.target;if(typeof O=="number"||typeof X=="number"||!O||!X)continue;const we=Jo(O.data.id,X.data.id,o.embeddingFilterIds,o.relationLookup,o.lensIds,o.clusterLensMode),Nt=q.get(we);Nt?Nt.push([O.x,O.y,X.x,X.y]):q.set(we,[[O.x,O.y,X.x,X.y]])}i.lineWidth=.8/_;for(const[W,C]of q){i.beginPath();for(const[O,X,we,Nt]of C)i.moveTo(O,X),i.lineTo(we,Nt);i.strokeStyle=W,i.stroke()}}if(Z.length>0){const m=Math.max(1,Math.floor(qe/4)),q=Math.max(1,Math.ceil(Z.length/m));for(let W=0;W<Z.length;W+=q){const C=Z[W],O=C.source,X=C.target;if(typeof O=="number"||typeof X=="number"||!O||!X)continue;const we=Qo(C.dependencyType??"",C.strength??.5);i.beginPath(),we.dash.length>0&&i.setLineDash(we.dash.map(Nt=>Nt/_)),i.moveTo(O.x,O.y),i.lineTo(X.x,X.y),i.strokeStyle=we.color,i.lineWidth=we.width/_,i.stroke(),we.dash.length>0&&i.setLineDash([])}}{const m=new Map,q=[],W=[];let C=null;for(let O=0;O<o.nodes.length;O++){const X=o.nodes[O];if(X.nodeType!=="memory"&&X.nodeType!==void 0)continue;const we=jt.fills[O],Nt=m.get(we);Nt?Nt.push(X):m.set(we,[X]),o.colorMode!=="none"&&o.showNewSinceLastSeen&&Uo(X.data.createdAt,o.lastSeenMs)&&q.push(X),o.pinnedIds.has(X.data.id)&&W.push(X),P===X.data.id&&(C=X)}for(const[O,X]of m){i.beginPath();for(const we of X)i.moveTo(we.x+we.radius,we.y),i.arc(we.x,we.y,we.radius,0,Math.PI*2);i.fillStyle=O,i.fill()}if(q.length>0){i.beginPath();for(const O of q)i.moveTo(O.x+O.radius+2.2,O.y),i.arc(O.x,O.y,O.radius+2.2,0,Math.PI*2);i.strokeStyle="rgba(246, 194, 107, 0.85)",i.lineWidth=1.1/_,i.stroke()}if(W.length>0){i.strokeStyle="rgba(240, 240, 240, 0.8)",i.lineWidth=1.2/_;for(const O of W){const X=(O.radius+2.5)*2;i.strokeRect(O.x-X/2,O.y-X/2,X,X)}}C&&(i.beginPath(),i.arc(C.x,C.y,C.radius+3,0,Math.PI*2),i.strokeStyle="rgba(255, 255, 255, 0.95)",i.lineWidth=1.5/_,i.stroke())}for(const m of o.nodes){if(m.nodeType!=="attribute")continue;const q=m.data.who??"unknown";i.beginPath(),i.arc(m.x,m.y,m.radius,0,Math.PI*2),i.fillStyle=br(q,.3),i.fill(),i.strokeStyle=br(q,.5),i.lineWidth=.6/_,i.stroke(),P===m.data.id&&(i.beginPath(),i.arc(m.x,m.y,m.radius+3,0,Math.PI*2),i.strokeStyle="rgba(255, 255, 255, 0.95)",i.lineWidth=1.5/_,i.stroke())}for(const m of o.nodes){if(m.nodeType!=="aspect")continue;const q=m.data.who??"unknown";if(i.beginPath(),i.arc(m.x,m.y,m.radius,0,Math.PI*2),i.fillStyle=br(q,.5),i.fill(),i.strokeStyle=br(q,.75),i.lineWidth=.8/_,i.stroke(),P===m.data.id&&(i.beginPath(),i.arc(m.x,m.y,m.radius+3,0,Math.PI*2),i.strokeStyle="rgba(255, 255, 255, 0.95)",i.lineWidth=1.5/_,i.stroke()),o.graphHovered&&m.data.id===o.graphHovered.id||P===m.data.id){const W=Math.max(7,9/_);i.font=`${W}px var(--font-mono)`,i.fillStyle="rgba(210, 210, 210, 0.85)",i.textAlign="center",i.fillText(m.aspectData?.name??"",m.x,m.y+m.radius+W+1/_),i.textAlign="start"}}for(const m of o.nodes){if(m.nodeType!=="entity")continue;const q=m.entityData?.entityType??"unknown";i.save(),i.shadowColor=br(q,.5),i.shadowBlur=12/_,pn(i,m.x,m.y,m.radius),i.fillStyle=br(q,.7),i.fill(),i.restore(),pn(i,m.x,m.y,m.radius),i.strokeStyle=br(q,.9),i.lineWidth=1.2/_,i.stroke(),P===m.data.id&&(pn(i,m.x,m.y,m.radius+4),i.strokeStyle="rgba(255, 255, 255, 0.95)",i.lineWidth=1.5/_,i.stroke());const W=Math.max(8,10/_);i.font=`bold ${W}px var(--font-mono)`,i.fillStyle="rgba(230, 230, 230, 0.9)",i.textAlign="center",i.fillText(m.entityData?.name??"",m.x,m.y+m.radius+W+2/_),i.textAlign="start"}if(o.graphHovered){const m=Wt.get(o.graphHovered.id);if(m&&m.nodeType!=="entity"&&m.nodeType!=="aspect"){const q=m.nodeType==="attribute"?m.attributeData?.content??yr(o.graphHovered):yr(o.graphHovered),W=9/_;i.font=`${W}px var(--font-mono)`,i.fillStyle="rgba(220, 220, 220, 0.9)",i.textAlign="left";const C=80;i.fillText(q.length>C?`${q.slice(0,C)}...`:q,m.x+m.radius+5/_,m.y+W*.35),i.textAlign="start"}}i.restore(),e(be)&&($e++,(Xe||$e>=ct)&&($t(),Xe=!1,$e=0)),Je=requestAnimationFrame(m=>$(i,m))}function _t(){if(!e(f))return;Pt&&(Pt(),Pt=null);const i=e(f),I=ie=>{const[Ke,P]=et(ie.clientX,ie.clientY),qe=tt(Ke,P);V=!1,qe?(K=!0,ve=qe,ot=ie.clientX,ae=ie.clientY):(U=!0,ot=ie.clientX,ae=ie.clientY,Ae=S,Re=v)},B=ie=>{if(K&&ve){const Ke=ie.clientX-ot,P=ie.clientY-ae;if(!V&&Ke*Ke+P*P<it*it)return;V||(V=!0,xt=!0,ve.fx=ve.x,ve.fy=ve.y,Oe?.alphaTarget(.3).restart());const[qe,m]=et(ie.clientX,ie.clientY);ve.fx=qe,ve.fy=m,pe();return}if(U){xt=!0,S=Ae-(ie.clientX-ot)/_,v=Re-(ie.clientY-ae)/_,pe();return}ue=ie.clientX,ze=ie.clientY,dt=!0,pe()},de=()=>{if(K&&ve){V&&(ve.fx=null,ve.fy=null,Oe?.alphaTarget(0)),ve=null,K=!1,pe();return}U=!1},H=()=>{U=!1,Qt!==null&&(Qt=null,o.onhovernode(null))},_e=ie=>{if(V)return;const[Ke,P]=et(ie.clientX,ie.clientY),qe=tt(Ke,P);o.onselectnode(qe?.data??null)},ge=ie=>{ie.preventDefault(),xt=!0;const Ke=ie.deltaY>0?.9:1.1,P=Math.max(.1,Math.min(5,_*Ke)),qe=i.getBoundingClientRect(),m=qe.width/2,q=qe.height/2,W=ie.clientX-qe.left-m,C=ie.clientY-qe.top-q,O=W/_+S,X=C/_+v;_=P,S=O-W/_,v=X-C/_,pe()};i.addEventListener("pointerdown",I),i.addEventListener("pointermove",B),i.addEventListener("pointerup",de),i.addEventListener("pointerleave",H),i.addEventListener("click",_e),i.addEventListener("wheel",ge,{passive:!1}),Pt=()=>{i.removeEventListener("pointerdown",I),i.removeEventListener("pointermove",B),i.removeEventListener("pointerup",de),i.removeEventListener("pointerleave",H),i.removeEventListener("click",_e),i.removeEventListener("wheel",ge)}}ne(()=>{o.graphSelected,o.graphHovered,o.embeddingFilterIds,o.relationLookup,o.pinnedIds,o.lensIds,o.clusterLensMode,jt=null,pe()}),ne(()=>{const i=o.edges,I=[],B=[],de=[];for(const H of i)H.edgeType==="hierarchy"?I.push(H):H.edgeType==="dependency"?de.push(H):B.push(H);ht=I,G=B,Z=de}),ne(()=>()=>{Oe?.stop(),Oe=null,Pt&&(Pt(),Pt=null),It&&(window.removeEventListener("resize",lt),It=!1),cancelAnimationFrame(Je)});var rr={resetCamera:ye,focusNode:st,startSimulation:Tt,startKnowledgeGraphSimulation:yt,updatePhysics:Lt,stopSimulation:fe,startRendering:He,resumeRendering:We,stopRendering:Dt,requestRedraw:pe},nr=ci(),ar=l(nr);hr(ar,i=>n(f,i),()=>e(f));var qt=d(ar,2);{var vt=i=>{var I=di();fn(I,"width",me),fn(I,"height",Ye),hr(I,B=>n(Ze,B),()=>e(Ze)),Y("mousedown",I,oe),Y("mousemove",I,Ge),Y("mouseup",I,Et),Ar("mouseleave",I,Et),u(i,I)};j(qt,i=>{e(be)&&i(vt)})}return s(nr),u(y,nr),Sn(rr)}Mn(["mousedown","mousemove","mouseup"]);var gi=x('<button class="text-[11px] text-[var(--sig-accent)] bg-transparent border-none cursor-pointer p-0 hover:underline">Clear</button>'),vi=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),pi=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),fi=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase"> </div> <div class="flex flex-col gap-2"></div>',1),mi=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),xi=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Dependencies</div> <div class="flex flex-col gap-2"></div>',1),bi=x('<div class="flex flex-wrap gap-[6px]"><span class="font-[family-name:var(--font-mono)] text-[10px] border px-[7px] py-[2px]"> </span> <!></div> <div class="font-[family-name:var(--font-mono)] text-[14px] text-[var(--sig-text-bright)] font-bold"> </div> <div class="grid grid-cols-3 gap-1 text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"><div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>aspects</div></div> <div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>attributes</div></div> <div class="border border-[var(--sig-border-strong)] px-2 py-1 text-center"><div class="text-[var(--sig-text-bright)]"> </div> <div>deps</div></div></div> <div class="flex gap-2"><button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!> <!>',1),hi=x('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] uppercase">Parent entity</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),yi=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),_i=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase"> </div> <div class="flex flex-col gap-2"></div>',1),wi=x('<div class="flex flex-wrap gap-[6px]"><span class="font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]">aspect</span> <span class="font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span></div> <div class="font-[family-name:var(--font-mono)] text-[14px] text-[var(--sig-text-bright)] font-bold"> </div> <!> <div class="flex gap-2"><button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!>',1),Si=x('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] uppercase">Parent entity</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),Mi=x('<button class="w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] uppercase">Parent aspect</span> <div class="text-[12px] text-[var(--sig-text-bright)]"> </div></button>'),ki=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Linked memory</div> <button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>',1),Ii=x('<div class="flex flex-wrap gap-[6px]"><span class="font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span> <span class="font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)] text-[var(--sig-text)]"> </span></div> <p class="m-0 text-[13px] leading-[1.55] text-[var(--sig-text-bright)] whitespace-pre-wrap break-words"> </p> <!> <!> <div class="flex gap-2"><button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)]">Center</button></div> <!>',1),Ti=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span>'),Ei=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),Ni=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span>'),Fi=x('<div class="flex flex-wrap gap-[6px]"></div>'),Pi=x('<div class="border border-dashed border-[var(--sig-danger)] p-2 text-[11px] text-[var(--sig-danger)] leading-[1.5]"> </div>'),Ci=x('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">No related memories in this view.</div>'),Li=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Di=x('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">Finding similar memories...</div>'),Ai=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap">global</span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Ri=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Global similar</div> <div class="flex flex-col gap-2"></div>',1),Oi=x('<div class="flex flex-wrap gap-[6px]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span> <!> <span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-[7px] py-[2px] bg-[rgba(255,255,255,0.04)]"> </span> <!></div> <div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] border border-[var(--sig-border-strong)] px-[7px] py-[5px] bg-transparent break-all"> </div> <p class="m-0 text-[13px] leading-[1.55] text-[var(--sig-text-bright)] whitespace-pre-wrap break-words"> </p> <!> <div class="flex gap-2"><button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed">Center</button> <button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed"> </button> <button class="px-3 py-1 font-[family-name:var(--font-mono)] text-[10px] font-medium tracking-[0.1em] uppercase bg-transparent border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] cursor-pointer enabled:hover:bg-[var(--sig-text-bright)] enabled:hover:text-[var(--sig-bg)] disabled:opacity-40 disabled:cursor-not-allowed"> </button></div> <!> <div class="self-start flex border border-[var(--sig-border-strong)] overflow-hidden"><button>Similar</button> <button>Dissimilar</button></div> <div class="flex flex-col gap-2"><!></div> <!>',1),Yi=x('<button class="grid grid-cols-[auto_1fr] gap-2 items-start w-full text-left border border-[var(--sig-border-strong)] bg-[rgba(255,255,255,0.03)] text-[var(--sig-text)] px-2 py-[7px] cursor-pointer hover:border-[var(--sig-text-muted)] hover:bg-[var(--sig-surface-raised)]"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-accent)] whitespace-nowrap"> </span> <span class="text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-2"> </span></button>'),Xi=x('<div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.04em] uppercase">Search matches</div> <div class="flex flex-col gap-2"></div>',1),ji=x('<div class="border border-dashed border-[var(--sig-border-strong)] p-3 text-[12px] text-[var(--sig-text-muted)] leading-[1.5]">Select a node to inspect content, source metadata, and similar or dissimilar neighbors.</div> <!>',1),Hi=x('<aside><div class="flex items-center justify-between gap-2"><span class="font-[family-name:var(--font-mono)] text-[11px] tracking-[0.06em] uppercase text-[var(--sig-text)]">Inspector</span> <!></div> <!></aside>');function Gi(y,o){wn(o,!0);let f=cr(o,"containerClass",3,""),S=cr(o,"selectedNodeType",3,void 0),v=cr(o,"selectedEntityData",3,null),_=cr(o,"selectedAspectData",3,null),U=cr(o,"selectedAttributeData",3,null),K=cr(o,"parentEntityId",3,null),V=cr(o,"parentAspectId",3,null),ve=cr(o,"constellationOverlay",3,null);const ot=Q(()=>S()==="entity"&&v()!==null),ae=Q(()=>S()==="aspect"&&_()!==null),Ae=Q(()=>S()==="attribute"&&U()!==null),Re=Q(()=>{if(!v()||!ve())return[];const G=v().id;return ve().dependencies.filter(Z=>Z.sourceEntityId===G||Z.targetEntityId===G)}),it=Q(()=>!K()||!ve()?null:ve().entities.find(G=>G.id===K())??null),Oe=Q(()=>!V()||!e(it)?null:e(it).aspects.find(G=>G.id===V())??null);function Je(G){return ve()?ve().entities.find(ue=>ue.id===G)?.name??G:G}function Pt(G){return o.embeddingById.get(G)??null}var It=Hi(),tr=l(It),Te=d(l(tr),2);{var Qt=G=>{var Z=gi();Y("click",Z,function(...ue){o.onclearselection?.apply(this,ue)}),u(G,Z)};j(Te,G=>{o.graphSelected&&G(Qt)})}s(tr);var xt=d(tr,2);{var Wt=G=>{var Z=bi(),ue=xe(Z),ze=l(ue),dt=l(ze,!0);s(ze);var me=d(ze,2);{var Ye=fe=>{var He=vi();u(fe,He)};j(me,fe=>{v().pinned&&fe(Ye)})}s(ue);var Be=d(ue,2),Ze=l(Be,!0);s(Be);var Xe=d(Be,2),$e=l(Xe),ct=l($e),Ct=l(ct,!0);s(ct),gr(2),s($e);var be=d($e,2),Ue=l(be),pe=l(Ue,!0);s(Ue),gr(2),s(be);var ut=d(be,2),se=l(ut),Ee=l(se,!0);s(se),gr(2),s(ut),s(Xe);var ye=d(Xe,2),je=l(ye);s(ye);var st=d(ye,2);{var Tt=fe=>{var He=fi(),We=xe(He),Dt=l(We);s(We);var lt=d(We,2);Mt(lt,21,()=>v().aspects,kt,(gt,et)=>{var tt=pi(),Ht=l(tt),$t=l(Ht);s(Ht);var E=d(Ht,2),oe=l(E,!0);s(E),s(tt),F(Ge=>{h($t,`w${Ge??""}%`),h(oe,e(et).name)},[()=>Math.round(e(et).weight*100)]),Y("click",tt,()=>o.onselectembedding(`aspect:${e(et).id}`)),u(gt,tt)}),s(lt),F(()=>h(Dt,`Aspects (${v().aspects.length??""})`)),u(fe,He)};j(st,fe=>{v().aspects.length>0&&fe(Tt)})}var yt=d(st,2);{var Lt=fe=>{var He=xi(),We=d(xe(He),2);Mt(We,21,()=>e(Re),kt,(Dt,lt)=>{const gt=Q(()=>e(lt).sourceEntityId===v().id),et=Q(()=>e(gt)?e(lt).targetEntityId:e(lt).sourceEntityId);var tt=mi(),Ht=l(tt),$t=l(Ht);s(Ht);var E=d(Ht,2),oe=l(E,!0);s(E),s(tt),F(Ge=>{h($t,`${e(gt)?"->":"<-"} ${e(lt).dependencyType??""}`),h(oe,Ge)},[()=>Je(e(et))]),Y("click",tt,()=>o.onselectembedding(`entity:${e(et)}`)),u(Dt,tt)}),s(We),u(fe,He)};j(yt,fe=>{e(Re).length>0&&fe(Lt)})}F((fe,He)=>{Bt(ze,fe),h(dt,v().entityType),h(Ze,v().name),h(Ct,v().aspects.length),h(pe,He),h(Ee,e(Re).length)},[()=>`color: ${bn(v().entityType)}; border-color: ${bn(v().entityType)}; background: rgba(255,255,255,0.04);`,()=>v().aspects.reduce((fe,He)=>fe+He.attributes.length,0)]),Y("click",je,function(...fe){o.onfocusembedding?.apply(this,fe)}),u(G,Z)},bt=G=>{var Z=wi(),ue=xe(Z),ze=d(l(ue),2),dt=l(ze);s(ze),s(ue);var me=d(ue,2),Ye=l(me,!0);s(me);var Be=d(me,2);{var Ze=be=>{var Ue=hi(),pe=d(l(Ue),2),ut=l(pe,!0);s(pe),s(Ue),F(()=>h(ut,e(it).name)),Y("click",Ue,()=>e(it)&&o.onselectembedding(`entity:${e(it).id}`)),u(be,Ue)};j(Be,be=>{e(it)&&be(Ze)})}var Xe=d(Be,2),$e=l(Xe);s(Xe);var ct=d(Xe,2);{var Ct=be=>{var Ue=_i(),pe=xe(Ue),ut=l(pe);s(pe);var se=d(pe,2);Mt(se,21,()=>_().attributes,kt,(Ee,ye)=>{var je=yi(),st=l(je),Tt=l(st,!0);s(st);var yt=d(st,2),Lt=l(yt,!0);s(yt),s(je),F(()=>{h(Tt,e(ye).kind),h(Lt,e(ye).content)}),Y("click",je,()=>o.onselectembedding(`attr:${e(ye).id}`)),u(Ee,je)}),s(se),F(()=>h(ut,`Attributes (${_().attributes.length??""})`)),u(be,Ue)};j(ct,be=>{_().attributes.length>0&&be(Ct)})}F(be=>{h(dt,`weight ${be??""}%`),h(Ye,_().name)},[()=>Math.round(_().weight*100)]),Y("click",$e,function(...be){o.onfocusembedding?.apply(this,be)}),u(G,Z)},Xt=G=>{var Z=Ii(),ue=xe(Z),ze=l(ue),dt=l(ze,!0);s(ze);var me=d(ze,2),Ye=l(me);s(me),s(ue);var Be=d(ue,2),Ze=l(Be,!0);s(Be);var Xe=d(Be,2);{var $e=se=>{var Ee=Si(),ye=d(l(Ee),2),je=l(ye,!0);s(ye),s(Ee),F(()=>h(je,e(it).name)),Y("click",Ee,()=>e(it)&&o.onselectembedding(`entity:${e(it).id}`)),u(se,Ee)};j(Xe,se=>{e(it)&&se($e)})}var ct=d(Xe,2);{var Ct=se=>{var Ee=Mi(),ye=d(l(Ee),2),je=l(ye,!0);s(ye),s(Ee),F(()=>h(je,e(Oe).name)),Y("click",Ee,()=>e(Oe)&&o.onselectembedding(`aspect:${e(Oe).id}`)),u(se,Ee)};j(ct,se=>{e(Oe)&&se(Ct)})}var be=d(ct,2),Ue=l(be);s(be);var pe=d(be,2);{var ut=se=>{const Ee=Q(()=>o.embeddingById.get(U().memoryId));var ye=vr(),je=xe(ye);{var st=Tt=>{var yt=ki(),Lt=d(xe(yt),2),fe=l(Lt),He=l(fe,!0);s(fe);var We=d(fe,2),Dt=l(We,!0);s(We),s(Lt),F(lt=>{h(He,e(Ee).who??"memory"),h(Dt,lt)},[()=>yr(e(Ee))]),Y("click",Lt,()=>e(Ee)&&o.onselectembedding(e(Ee).id)),u(Tt,yt)};j(je,Tt=>{e(Ee)&&Tt(st)})}u(se,ye)};j(pe,se=>{U().memoryId&&se(ut)})}F(se=>{h(dt,U().kind),h(Ye,`importance ${se??""}%`),h(Ze,U().content)},[()=>Math.round(U().importance*100)]),Y("click",Ue,function(...se){o.onfocusembedding?.apply(this,se)}),u(G,Z)},jt=G=>{var Z=Oi(),ue=xe(Z),ze=l(ue),dt=l(ze,!0);s(ze);var me=d(ze,2);{var Ye=E=>{var oe=Ti(),Ge=l(oe,!0);s(oe),F(()=>h(Ge,o.graphSelected.type)),u(E,oe)};j(me,E=>{o.graphSelected.type&&E(Ye)})}var Be=d(me,2),Ze=l(Be);s(Be);var Xe=d(Be,2);{var $e=E=>{var oe=Ei();u(E,oe)};j(Xe,E=>{o.graphSelected.pinned&&E($e)})}s(ue);var ct=d(ue,2),Ct=l(ct,!0);s(ct);var be=d(ct,2),Ue=l(be,!0);s(be);var pe=d(be,2);{var ut=E=>{var oe=Fi();Mt(oe,21,()=>o.graphSelected.tags.slice(0,8),kt,(Ge,Kt)=>{var Et=Ni(),$=l(Et);s(Et),F(()=>h($,`#${e(Kt)??""}`)),u(Ge,Et)}),s(oe),u(E,oe)};j(pe,E=>{o.graphSelected.tags?.length&&E(ut)})}var se=d(pe,2),Ee=l(se),ye=d(Ee,2),je=l(ye,!0);s(ye);var st=d(ye,2),Tt=l(st,!0);s(st),s(se);var yt=d(se,2);{var Lt=E=>{var oe=Pi(),Ge=l(oe,!0);s(oe),F(()=>h(Ge,o.pinError)),u(E,oe)};j(yt,E=>{o.pinError&&E(Lt)})}var fe=d(yt,2),He=l(fe),We=d(He,2);s(fe);var Dt=d(fe,2),lt=l(Dt);{var gt=E=>{var oe=Ci();u(E,oe)},et=E=>{var oe=vr(),Ge=xe(oe);Mt(Ge,17,()=>o.activeNeighbors,kt,(Kt,Et)=>{const $=Q(()=>Pt(e(Et).id));var _t=vr(),rr=xe(_t);{var nr=ar=>{var qt=Li(),vt=l(qt),i=l(vt,!0);s(vt);var I=d(vt,2),B=l(I,!0);s(I),s(qt),F((de,H)=>{h(i,de),h(B,H)},[()=>Math.round(e(Et).score*1e3)/1e3,()=>yr(e($))]),Y("click",qt,()=>o.onselectembedding(e($).id)),u(ar,qt)};j(rr,ar=>{e($)&&ar(nr)})}u(Kt,_t)}),u(E,oe)};j(lt,E=>{o.activeNeighbors.length===0?E(gt):E(et,-1)})}s(Dt);var tt=d(Dt,2);{var Ht=E=>{var oe=Di();u(E,oe)},$t=E=>{var oe=Ri(),Ge=d(xe(oe),2);Mt(Ge,21,()=>o.globalSimilar,kt,(Kt,Et)=>{var $=Ai(),_t=d(l($),2),rr=l(_t,!0);s(_t),s($),F(()=>h(rr,e(Et).content)),Y("click",$,()=>o.onopenglobalsimilar(e(Et))),u(Kt,$)}),s(Ge),u(E,oe)};j(tt,E=>{o.loadingGlobalSimilar?E(Ht):o.globalSimilar.length>0&&E($t,1)})}F((E,oe)=>{h(dt,o.graphSelected.who??"unknown"),h(Ze,`importance ${E??""}%`),h(Ct,oe),h(Ue,o.graphSelected.content??o.graphSelected.text??"(No content preview available)"),ye.disabled=o.pinBusy,h(je,o.pinBusy?"Saving...":o.graphSelected.pinned?"Unpin":"Pin"),st.disabled=o.loadingGlobalSimilar,h(Tt,o.loadingGlobalSimilar?"Loading...":"Global similar"),mt(He,1,`px-2 py-0.5 text-[10px] font-medium font-[family-name:var(--font-mono)] bg-transparent border-none cursor-pointer tracking-[0.04em] hover:text-[var(--sig-text)] hover:bg-[var(--sig-surface-raised)] ${o.relationMode==="similar"?"text-[var(--sig-text-bright)] bg-[var(--sig-surface-raised)]":"text-[var(--sig-text-muted)]"}`),mt(We,1,`px-2 py-0.5 text-[10px] font-medium font-[family-name:var(--font-mono)] bg-transparent border-none cursor-pointer tracking-[0.04em] hover:text-[var(--sig-text)] hover:bg-[var(--sig-surface-raised)] ${o.relationMode==="dissimilar"?"text-[var(--sig-text-bright)] bg-[var(--sig-surface-raised)]":"text-[var(--sig-text-muted)]"}`)},[()=>Math.round((o.graphSelected.importance??0)*100),()=>Vo(o.graphSelected)]),Y("click",Ee,function(...E){o.onfocusembedding?.apply(this,E)}),Y("click",ye,function(...E){o.onpintoggle?.apply(this,E)}),Y("click",st,function(...E){o.onloadglobalsimilar?.apply(this,E)}),Y("click",He,()=>o.onsetrelationmode("similar")),Y("click",We,()=>o.onsetrelationmode("dissimilar")),u(G,Z)},ht=G=>{var Z=ji(),ue=d(xe(Z),2);{var ze=dt=>{var me=Xi(),Ye=d(xe(me),2);Mt(Ye,21,()=>o.embeddingSearchMatches,kt,(Be,Ze)=>{var Xe=Yi(),$e=l(Xe),ct=l($e,!0);s($e);var Ct=d($e,2),be=l(Ct,!0);s(Ct),s(Xe),F(Ue=>{h(ct,e(Ze).who),h(be,Ue)},[()=>yr(e(Ze))]),Y("click",Xe,()=>o.onselectembedding(e(Ze).id)),u(Be,Xe)}),s(Ye),u(dt,me)};j(ue,dt=>{o.embeddingSearch&&o.embeddingSearchMatches.length>0&&dt(ze)})}u(G,Z)};j(xt,G=>{e(ot)&&v()?G(Wt):e(ae)&&_()?G(bt,1):e(Ae)&&U()?G(Xt,2):o.graphSelected?G(jt,3):G(ht,-1)})}s(It),F(()=>mt(It,1,`flex flex-col gap-3 p-3 overflow-y-auto ${f()}`)),u(y,It),Sn()}Mn(["click"]);var zi=x('<div class="absolute right-3 z-[9] pointer-events-none"><button type="button" class="pointer-events-auto px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-text-bright)] text-[var(--sig-text-bright)] bg-[rgba(5,5,5,0.74)] hover:bg-[var(--sig-text-bright)] hover:text-[var(--sig-bg)]"> </button></div>'),Bi=x('<span class="text-[#c4a24a]"> </span>'),Wi=x('<div class="mt-0.5 font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text-muted)] leading-[1.3]"> </div>'),Ki=x('<div class="mt-1"><div class="flex items-center justify-between font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text-muted)]"><span> </span> <span> </span></div> <div class="mt-1 h-[5px] border border-[rgba(255,255,255,0.2)] bg-[rgba(255,255,255,0.05)]"><div class="h-full bg-[#c4a24a]"></div></div> <div class="mt-1 font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text-muted)]"> </div></div>'),qi=x('<div class="mb-2 border border-[rgba(255,255,255,0.14)] bg-[rgba(255,255,255,0.03)] px-1.5 py-1.5"><div class="font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text)] leading-[1.3]"> </div> <!> <!></div>'),Ui=x('<button type="button" class="mt-1 font-[family-name:var(--font-mono)] text-[9px] text-[#c4a24a] hover:text-[var(--sig-text-bright)] underline underline-offset-2 disabled:opacity-40 disabled:no-underline"> </button>'),Vi=x('<div class="flex items-start gap-1.5 px-1.5 py-1 border border-[rgba(255,255,255,0.1)] bg-[rgba(255,255,255,0.02)]"><span class="inline-block w-[6px] h-[6px] rounded-full shrink-0 mt-[4px]"></span> <div class="flex-1 min-w-0"><div class="flex items-center justify-between gap-2"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)]"> </span> <span class="font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text-muted)] uppercase"> </span></div> <div class="font-[family-name:var(--font-mono)] text-[9px] text-[var(--sig-text-muted)] leading-[1.3] mt-0.5"> </div> <!></div></div>'),Ji=x('<div class="mt-1 border border-[rgba(255,255,255,0.22)] bg-[rgba(5,5,5,0.92)] px-2 py-2 w-[320px]"><div class="flex items-center justify-between mb-2"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] uppercase tracking-[0.06em]">Constellation Health</span> <span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)]"> </span></div> <!> <div class="space-y-1"></div></div>'),Qi=x('<div class="absolute top-2 right-3 z-[8] pointer-events-none"><div class="pointer-events-auto"><button type="button" class="flex items-center gap-1.5 px-2 py-[4px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[rgba(255,255,255,0.22)] bg-[rgba(5,5,5,0.75)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"><span class="inline-block w-[7px] h-[7px] rounded-full shrink-0"></span> <span class="text-[var(--sig-text-muted)]"> </span> <!></button> <!></div></div>'),Zi=x("<span>Legend</span> <!>",1),$i=x("<span> </span>"),es=x('<div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-[var(--sig-text-muted)] mb-1.5"><span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last few minutes</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last few hours</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>last week</span> <span class="inline-flex items-center gap-1"><span class="inline-block w-[8px] h-[8px] rounded-full"></span>older</span></div> <div class="flex flex-wrap gap-1 mb-1.5"></div>',1),ts=x('<span><span class="inline-block w-[6px] h-[6px] rounded-full"></span> </span>'),rs=x('<div class="flex flex-wrap gap-1 mb-1.5"></div>'),ns=x('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1.5">No color applied - all nodes are shown in gray.</div>'),as=x('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Outline</span> = new since last seen</div>'),os=x('<span class="h-5 inline-flex items-center gap-1 px-1.5 py-0 font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] border border-[rgba(255,255,255,0.14)] bg-transparent"><span class="inline-block w-[8px] h-[8px]"></span> </span>'),is=x('<div class="mt-2 pt-2 border-t border-[rgba(255,255,255,0.1)]"><div class="text-[10px] font-[family-name:var(--font-mono)] uppercase tracking-[0.06em] text-[var(--sig-text-muted)] mb-1">Knowledge Graph</div> <div class="flex flex-wrap gap-1 mb-1.5"></div> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] space-y-0.5"><div><span class="text-[var(--sig-text)]">Hexagon</span> = entity (large, labeled)</div> <div><span class="text-[var(--sig-text)]">Circle</span> = aspect (medium, orbits entity)</div> <div><span class="text-[var(--sig-text)]">Small dot</span> = attribute (orbits aspect)</div> <div><span class="text-[var(--sig-text)]">Tiny dot</span> = linked memory (leaf node)</div> <div><span class="text-[var(--sig-text)]">Faint lines</span> = parent-child hierarchy</div> <div><span class="text-[var(--sig-text)]">Styled line</span> = entity dependency</div></div></div>'),ss=x('<div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Color</span> </div> <!> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35] mb-1"><span class="text-[var(--sig-text)]">Radius</span> = importance</div> <div class="flex items-center gap-2 text-[10px] text-[var(--sig-text-muted)] mb-1.5"><span class="inline-block w-[6px] h-[6px] rounded-full border border-[rgba(255,255,255,0.24)]"></span> <span class="inline-block w-[9px] h-[9px] rounded-full border border-[rgba(255,255,255,0.28)]"></span> <span class="inline-block w-[12px] h-[12px] rounded-full border border-[rgba(255,255,255,0.32)]"></span> <span>low to high</span></div> <!> <div class="text-[10px] text-[var(--sig-text-muted)] leading-[1.35]"><span class="text-[var(--sig-text)]">Relation highlight</span> = selected node neighborhood emphasis</div> <!>',1),ls=x("<!> <!>",1),ds=x('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p> </p></div>'),cs=x('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p class="text-[var(--sig-danger)]"> </p></div>'),us=x('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p>No memories found</p></div>'),gs=x('<div class="absolute inset-0 flex items-center justify-center bg-[var(--sig-bg)] z-10"><p>Loading...</p></div>'),vs=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.04)]"> </span>'),ps=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.08)]">pinned</span>'),fs=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] border border-[var(--sig-text-bright)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.08)]">locked</span>'),ms=x('<div class="grid grid-cols-[1fr_auto] items-start gap-2 border border-[rgba(255,255,255,0.14)] bg-[rgba(255,255,255,0.02)] px-1.5 py-1"><span class="text-[10px] leading-[1.35] text-[var(--sig-text)] line-clamp-1"> </span> <span class="text-[10px] text-[var(--sig-text-muted)]"> </span></div>'),xs=x('<div class="mt-2 pt-2 border-t border-[rgba(255,255,255,0.14)]"><div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] uppercase tracking-[0.06em] mb-1">Local neighbors</div> <div class="space-y-1"></div></div>'),bs=x('<div class="z-[9] w-[320px] pointer-events-none border border-[rgba(255,255,255,0.26)] bg-[rgba(5,5,5,0.92)] px-2 py-2" style="position:absolute;top:0;left:0;will-change:transform"><div class="flex items-center gap-1.5 flex-wrap mb-1.5"><span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text)] border border-[var(--sig-border-strong)] px-1.5 py-[1px] bg-[rgba(255,255,255,0.04)]"> </span> <!> <!> <!></div> <div class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] mb-1.5"> </div> <p class="m-0 text-[12px] leading-[1.45] text-[var(--sig-text-bright)] line-clamp-3"> </p> <div class="mt-1 text-[10px] text-[var(--sig-text-muted)]"> </div> <!></div>'),hs=x('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-text-muted)] font-[family-name:var(--font-mono)] text-[11px]"> </span></div>'),ys=x('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-danger)] font-[family-name:var(--font-mono)] text-[11px]"> </span></div>'),_s=x('<div class="absolute inset-0 flex items-center justify-center bg-[#050505]"><span class="text-[var(--sig-text-muted)] font-[family-name:var(--font-mono)] text-[11px]"> </span></div>'),ws=x("<span>View Controls</span> <!>",1),Ss=x('<span class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] border border-[var(--sig-border)] px-2 py-1"> </span>'),Ms=x('<div class="p-2 space-y-2 border-t border-[var(--sig-border)]"><div class="flex items-center gap-2"><input type="text" class="flex-1 font-[family-name:var(--font-mono)] text-[11px] text-[var(--sig-text-bright)] bg-[var(--sig-surface)] border border-[var(--sig-border-strong)] px-[9px] py-[6px] outline-none" placeholder="Search constellation"/> <!></div> <div class="text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"> </div> <div class="flex flex-wrap gap-1"><button>Pinned</button> <button>Neighborhood</button> <button>Lens</button> <button class="px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"> </button></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5"><div class="font-[family-name:var(--font-mono)] text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Color Mode</div> <div class="flex flex-wrap gap-1"><button>Newness</button> <button>Source</button> <button>None</button></div></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5"><div class="font-[family-name:var(--font-mono)] text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Overlays</div> <div class="flex flex-wrap gap-1"><button>New since last seen</button> <button> </button></div></div> <div class="border border-[var(--sig-border)] px-2 py-2 space-y-1.5" style="accent-color: var(--sig-highlight);"><div class="font-[family-name:var(--font-mono)] text-[10px] uppercase tracking-[0.08em] text-[var(--sig-text-muted)]">Graph Physics</div> <label class="block"><div class="flex items-center justify-between text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"><span>center force</span> <span> </span></div> <input type="range" min="0" max="1" step="0.01"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"><span>repel force</span> <span> </span></div> <input type="range" min="-600" max="-10" step="5"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"><span>link force</span> <span> </span></div> <input type="range" min="0.01" max="1" step="0.01"/></label> <label class="block"><div class="flex items-center justify-between text-[10px] font-[family-name:var(--font-mono)] text-[var(--sig-text-muted)]"><span>link distance</span> <span> </span></div> <input type="range" min="12" max="280" step="1"/></label> <button type="button" class="px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]">Physics Reset</button></div></div>'),ks=x("<!> <!>",1),Is=x("<span>Presets</span> <!>",1),Ts=x("<button> </button>"),Es=x('<div class="inline-flex items-center border border-[var(--sig-border-strong)]"><button> </button> <button class="px-1.5 py-[2px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]">×</button></div>'),Ns=x('<div class="p-2 border-t border-[var(--sig-border)] flex flex-wrap gap-1"><!> <!> <button class="px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] text-[var(--sig-text-muted)] hover:text-[var(--sig-text-bright)]"> </button></div>'),Fs=x("<!> <!>",1),Ps=x("<span>Sources</span> <!>",1),Cs=x('<span class="text-[10px] text-[var(--sig-text-muted)]">No sources</span>'),Ls=x("<button> </button>"),Ds=x('<div class="p-2 border-t border-[var(--sig-border)] flex flex-wrap gap-1"><!></div>'),As=x("<!> <!>",1),Rs=x("<span>Advanced</span> <!>",1),Os=x('<div class="flex items-center gap-1 flex-wrap"><input type="date" class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <input type="date" class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/></div>'),Ys=x('<span class="text-[10px] text-[var(--sig-text-muted)] font-[family-name:var(--font-mono)]">none</span>'),Xs=x("<button> </button>"),js=x("<button> </button>"),Hs=x('<div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-[family-name:var(--font-mono)]">Type</span> <!></div>'),Gs=x("<button> </button>"),zs=x('<div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-[family-name:var(--font-mono)]">Source type</span> <!></div>'),Bs=x('<div class="p-2 border-t border-[var(--sig-border)] space-y-2"><div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-[family-name:var(--font-mono)]">Window</span> <input type="number" min="0" max="100000" class="w-[70px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <span class="text-[10px] text-[var(--sig-text-muted)] font-[family-name:var(--font-mono)]">to</span> <input type="number" min="1" max="100000" class="w-[70px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"/> <select class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"><option>time: all</option><option>time: 24h</option><option>time: 7d</option><option>time: 30d</option><option>time: 90d</option><option>time: custom</option></select></div> <!> <div class="flex items-center gap-1 flex-wrap"><select class="font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none"><option>pins: all</option><option>pins: pinned</option><option>pins: unpinned</option></select> <input type="text" class="w-[140px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="server query"/> <input type="text" class="w-[110px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="tags csv"/> <input type="text" class="w-[60px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="imp>"/> <input type="text" class="w-[60px] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-bright)] bg-[var(--sig-bg)] border border-[var(--sig-border-strong)] px-1.5 py-[2px] outline-none" placeholder="imp&lt;"/></div> <div class="flex items-center gap-1 flex-wrap"><span class="px-1 text-[10px] text-[var(--sig-text-muted)] uppercase font-[family-name:var(--font-mono)]">Harness</span> <!></div> <!> <!></div>'),Ws=x("<!> <!>",1),Ks=x('<div class="flex flex-col flex-1 min-h-0 overflow-hidden"><!> <div class="flex flex-1 min-h-0 bg-[#050505] max-lg:flex-col"><div class="flex-1 relative overflow-hidden bg-[#050505]" role="presentation"><!> <!> <div class="absolute left-3 top-3 bottom-3 z-[8] pointer-events-none flex flex-col justify-end items-start max-w-[220px]"><!></div> <!> <div class="absolute left-[14px] z-[6] font-[family-name:var(--font-mono)] text-[10px] text-[var(--sig-text-muted)] tracking-[0.08em] uppercase pointer-events-none" aria-hidden="true">:: &#9675; &#9675; 01 10 11 // latent topology</div> <div class="absolute inset-0 pointer-events-none z-[5]" aria-hidden="true"><span class="absolute top-[10px] left-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:1px 0 0 1px"></span> <span class="absolute top-[10px] right-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:1px 1px 0 0"></span> <span class="absolute bottom-[10px] left-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:0 0 1px 1px"></span> <span class="absolute bottom-[10px] right-[10px] w-[14px] h-[14px] border-[rgba(255,255,255,0.22)]" style="border-style:solid;border-width:0 1px 1px 0"></span></div> <!> <div><!></div> <div><!></div></div> <div class="w-[360px] min-w-[320px] border-l border-[var(--sig-border)] bg-[var(--sig-surface)] flex flex-col min-h-0 max-lg:w-full max-lg:min-w-0 max-lg:max-h-[48%] max-lg:border-l-0 max-lg:border-t max-lg:border-t-[var(--sig-border)]"><div class="p-3 border-b border-[var(--sig-border)] space-y-2 overflow-y-auto"><!> <!> <!> <!></div> <!></div></div></div>');function tl(y,o){wn(o,!0);let f=cr(o,"embedded",3,!1),S=p(!1),v=p(null),_=p(null),U=p(""),K=p(""),V=p(Ie([])),ve=p(0),ot=p(!1),ae=p(!1),Ae=p(""),Re=p(""),it=0,Oe=p(Ie([])),Je,Pt=p(null),It=p(null),tr=p(null),Te=p(Ie(new Set)),Qt=p(Ie([])),xt=p(!1),Wt=p(!0),bt=p(Ie(new Set)),Xt=p(!1),jt=p(""),ht=p(!0),G=p(Ie(new Set)),Z=p("focus"),ue=p(Ie([])),ze=p(!1),dt=p(!1),me=p(!0),Ye=p(!1),Be=p(!0);const Ze=["daemon","user","opencode"],Xe=new Set(Ze),$e="signet-constellation-color-mode-session",ct="signet-constellation-new-since-session",Ct="signet-constellation-color-mode",be="signet-constellation-new-since",Ue="signet-constellation-last-seen";let pe=p(0),ut=p(Ie(Wr)),se=p("all"),Ee=p(Ie(Date.now())),ye=p(""),je=p(""),st=p(""),Tt=p(""),yt=p("all"),Lt=p(""),fe=p(""),He=p(Ie([])),We=p(Ie(new Set)),Dt=p(Ie([])),lt=p(Ie([])),gt=p(Ie(new Set)),et=p(Ie(new Set)),tt=p(""),Ht=0,$t=p("similar"),E=p(Ie([])),oe=p(Ie([])),Ge=p(Ie([])),Kt=p(!1),Et=p(Ie([])),$=p("source"),_t=p(!1),rr=p(null),nr=p(null),ar=p(!1),qt=p(Ie(Date.now())),vt=p(Ie([])),i=p(Ie([])),I=p(Ie([])),B=p(!1),de=p(null),H=p(!1);const _e="signet-constellation-entity-overlay";let ge=p("2d"),ie=p(Ie([])),Ke=0,P=p(Ie(Ir)),qe=p(!1),m=p(Ie(new Map)),q=p(Ie(new Map)),W=p(Ie(new Map)),C=p(null),O=p(null),X=p(null),we=0,Nt=0,Ut=null,pt=p(null),ir=p(null),Rr=p(null),Or=p(!1),Tn=p(!1),ur=p(null),Ur=p(!1),_r=p(!1),Vr,sr=p(null),lr=p(null),At=p(null),Yr;No(()=>{n(me,kr.embeddings.controlsOpen,!0),n(Ye,kr.embeddings.presetsOpen,!0),n(Be,kr.embeddings.sourcesOpen,!0)});function ka(t){if(ia.activeTab!=="embeddings"||t.defaultPrevented)return;const r=t.target,a=r instanceof HTMLElement&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.tagName==="SELECT"||r.isContentEditable),c=r instanceof HTMLElement&&r.getAttribute("data-memory-tab")==="embeddings";if(t.key==="ArrowDown"&&c){t.preventDefault(),e(me)?Je?.focus():(n(me,!0),un().then(()=>Je?.focus()));return}if(t.key==="ArrowUp"&&r===Je){t.preventDefault();const g=document.querySelector('[data-memory-tab="embeddings"]');g?g.focus():Je?.blur();return}}async function Tr(){n(ur,await Lo(),!0)}function Ia(t){const r=t.match(/cooldown active,\s*(\d+)ms remaining/i);if(!r?.[1])return null;const a=Number.parseInt(r[1],10);return Number.isFinite(a)&&a>=0?a:null}function En(t){const r=Math.ceil(t/1e3);if(r<60)return`${r}s`;const a=Math.floor(r/60),c=r%60;return c>0?`${a}m ${c}s`:`${a}m`}function Ta(t){const r=t.match(/([\d,]+)\s+memories?\s+missing\s+embeddings/i);if(!r?.[1])return null;const a=Number.parseInt(r[1].replaceAll(",",""),10);return Number.isFinite(a)&&a>=0?a:null}function Er(){Yr&&(clearInterval(Yr),Yr=void 0)}function Ea(t){const r=Math.max(1,Math.floor(t/1e3));if(r<60)return`${r}s`;const a=Math.floor(r/60),c=r%60;return c>0?`${a}m ${c}s`:`${a}m`}function Nn(t){Er();const r=Date.now();let a=t,c=!1,g=0;n(sr,"Re-embedding in progress"),n(lr,t===null?"Collecting progress...":`${t.toLocaleString()} missing at start`,!0),n(At,null);const M=async()=>{if(!c){c=!0;try{const b=await vn(),T=Ea(Date.now()-r);if(n(sr,`Re-embedding in progress (${T})`),b){a===null&&(a=b.unembedded);const w=Math.max(0,a??b.unembedded),L=Math.max(0,w-b.unembedded),le=w>0?Math.min(100,L/w*100):100;n(At,{baseline:w,completed:L,remaining:b.unembedded,percent:le,coverage:b.coverage},!0),n(lr,a===null?`${b.unembedded.toLocaleString()} still missing (${b.coverage} coverage)`:`${L.toLocaleString()} completed, ${b.unembedded.toLocaleString()} remaining (${b.coverage} coverage)`,!0)}g%2===0&&await Tr(),g++}finally{c=!1}}};M(),Yr=setInterval(()=>{M()},3e3)}async function Na(t){if(e(_r))return;n(_r,!0);const r=t.name==="coverage"||t.name==="null-vectors";if(r||(n(sr,`Running ${t.name} repair...`),n(lr,null),n(At,null)),r){const a=Ta(t.message);if(a!==null)Nn(a);else{const c=await vn();Nn(c?.unembedded??null)}}try{let a;if(t.name==="orphaned-embeddings")a=await Xo();else if(t.name==="vec-table-sync")a=await jo();else if(t.name==="coverage"||t.name==="null-vectors")a=await Ho();else{Mr(`Repair action not wired for ${t.name}`,"warning");return}if(!a.success){if(Er(),a.status===429){const c=Ia(a.message);c!==null?(n(sr,"Repair blocked by cooldown"),n(lr,`Try again in ${En(c)}.`),Mr(`Repair on cooldown. Try again in ${En(c)}.`,"warning",4500)):(n(sr,"Repair blocked by policy"),n(lr,a.message,!0),Mr(`Repair temporarily blocked: ${a.message}`,"warning",5e3)),await Tr();return}n(sr,"Repair failed"),n(lr,a.message,!0),n(At,null),Mr(`Repair failed: ${a.message}`,"error",5e3);return}if(Er(),n(sr,"Repair completed"),n(lr,a.message,!0),r){const c=await vn();if(c&&e(At)){const g=e(At).baseline,M=Math.max(0,g-c.unembedded);n(At,{baseline:g,completed:M,remaining:c.unembedded,percent:g>0?Math.min(100,M/g*100):100,coverage:c.coverage},!0)}}a.affected>0?Mr(a.message,"success",4500):Mr(a.message,"info",4500),await Tr(),r&&a.affected>0&&await en()}finally{Er(),n(_r,!1)}}function Fa(t){return t==="healthy"?"#4a7a5e":t==="degraded"?"#c4a24a":"#8a4a48"}function Pa(t){return t==="ok"?"#4a7a5e":t==="warn"?"#c4a24a":"#8a4a48"}ne(()=>(Tr(),Vr=setInterval(Tr,6e4),()=>{Er(),Vr&&clearInterval(Vr)}));let Jr=!1;function Xr(){Jr||(Jr=!0,queueMicrotask(()=>{Jr=!1,e(ge)==="3d"&&e(ir)?.refreshAppearance()}))}function Ca(t){return{id:t.id,content:t.content,who:t.who,importance:t.importance,type:t.type,tags:t.tags,pinned:t.pinned??!1,sourceType:t.sourceType,sourceId:t.sourceId,createdAt:t.createdAt}}function La(t){if(!t)return"-";const r=new Date(t);return Number.isNaN(r.getTime())?"-":r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function jr(t,r){const a=new Date(e(qt)-t).toISOString();return wa(qo(a,e(qt)),r)}function Qr(){const t=Number.isFinite(e(pe))?Math.max(0,Math.trunc(e(pe))):0,r=Number.isFinite(e(ut))?Math.max(1,Math.trunc(e(ut))):Wr,a=Math.max(t+1,Math.min(r,t+Wo));return{offset:t,limit:a-t}}function Zr(){const{offset:t,limit:r}=Qr();n(pe,t,!0),n(ut,t+r)}function Fn(t,r){const a=t.trim();if(!a)return;const c=r?"T23:59:59.999":"T00:00:00.000",g=new Date(`${a}${c}`);if(!Number.isNaN(g.getTime()))return g.toISOString()}function Pn(t){const r=t.trim();if(!r)return;const a=Number.parseFloat(r);if(Number.isFinite(a))return Math.min(1,Math.max(0,a))}function Hr(t,r){const a=t.currentTarget;if(!(a instanceof HTMLInputElement))return r;const c=Number.parseFloat(a.value);return Number.isFinite(c)?c:r}function Nr(t){n(P,xn({...e(P),...t}),!0)}function Da(t,r){if(t==="all"||t==="custom")return;const a=t==="24h"?1440*60*1e3:t==="7d"?10080*60*1e3:t==="30d"?720*60*60*1e3:2160*60*60*1e3;return new Date(r-a).toISOString()}function Cn(){const{offset:t,limit:r}=Qr(),a={offset:t,limit:r},c=e(st).trim();c.length>0&&(a.q=c);const g=[...e(We)];g.length>0&&(a.who=g);const M=[...e(gt)];M.length>0&&(a.types=M);const b=[...e(et)];b.length>0&&(a.sourceTypes=b);const T=e(Tt).split(",").map(N=>N.trim()).filter(N=>N.length>0);T.length>0&&(a.tags=T),e(yt)==="pinned"&&(a.pinned=!0),e(yt)==="unpinned"&&(a.pinned=!1);let w,L;e(se)==="custom"?(w=Fn(e(ye),!1),L=Fn(e(je),!0)):w=Da(e(se),e(Ee)),w&&(a.since=w),L&&(a.until=L);let le=Pn(e(Lt)),k=Pn(e(fe));if(typeof le=="number"&&typeof k=="number"&&le>k){const N=le;le=k,k=N}return typeof le=="number"&&(a.importanceMin=le),typeof k=="number"&&(a.importanceMax=k),a}function Ln(t){return JSON.stringify({offset:t.offset??0,limit:t.limit??Wr,q:t.q??"",who:[...t.who??[]].sort(),types:[...t.types??[]].sort(),sourceTypes:[...t.sourceTypes??[]].sort(),tags:[...t.tags??[]].sort(),pinned:t.pinned??"all",since:t.since??"",until:t.until??"",importanceMin:typeof t.importanceMin=="number"?t.importanceMin:"",importanceMax:typeof t.importanceMax=="number"?t.importanceMax:""})}function Aa(t){let r=null;for(const a of t)if(a!==null){if(r===null){r=new Set(a);continue}if(r.size<=a.size)for(const c of r)a.has(c)||r.delete(c);else{const c=new Set;for(const g of a)r.has(g)&&c.add(g);r=c}}return r}function Ra(t,r){const a=e(V).findIndex(M=>M.id===t);if(a<0)return;const c=r(e(V)[a]);e(V)[a]=c,n(V,e(V),!0),e(m).set(t,c),n(m,e(m),!0);const g=e(vt).findIndex(M=>M.data.id===t);g>=0&&(e(vt)[g]={...e(vt)[g],data:c},n(vt,e(vt),!0)),e(v)?.id===t&&n(v,c,!0),e(_)?.id===t&&n(_,c,!0)}function Oa(t){const r=new Set(e(Te));r.has(t)?r.delete(t):r.add(t),n(Te,r,!0)}function Ya(t){const r=new Set(e(We));r.has(t)?r.delete(t):r.add(t),n(We,r,!0)}function Xa(t){const r=new Set(e(gt));r.has(t)?r.delete(t):r.add(t),n(gt,r,!0)}function ja(t){const r=new Set(e(et));r.has(t)?r.delete(t):r.add(t),n(et,r,!0)}function Ha(){n(pe,0),n(ut,Wr,!0),n(se,"all"),n(ye,""),n(je,""),n(st,""),n(Tt,""),n(yt,"all"),n(Lt,""),n(fe,""),n(We,new Set,!0),n(gt,new Set,!0),n(et,new Set,!0),Zr()}function Ga(){n(xt,!e(xt)),n(Z,"custom-live")}function Dn(){if(e(v))return e(v);if(e(Gt))return n(v,e(Gt),!0),e(Gt);const t=e(V)[0]??null;return t&&n(v,t,!0),t}function za(){!e(Wt)&&!Dn()||(n(Wt,!e(Wt)),n(Z,"custom-live"))}function Ba(){!e(ht)&&!Dn()||(n(ht,!e(ht)),n(Z,"custom-live"))}function Wa(t){Oa(t),n(Z,"custom-live")}function An(){if(!e(X)||!Ut)return;const t=Math.max(12,Ut.width-334),r=Math.max(12,Ut.height-170),a=Math.min(Math.max(12,we+14),t),c=Math.min(Math.max(12,Nt+14),r);e(X).style.transform=`translate3d(${a}px, ${c}px, 0)`}function Ka(t){Ut&&(we=t.clientX-Ut.left,Nt=t.clientY-Ut.top,An())}function Rn(t){e(C)||!t&&!e(_)||t&&e(_)&&t.id===e(_).id||n(_,t,!0)}function qa(){e(v)||e(_)&&n(C,e(_).id,!0)}function On(){n(C,null)}function Yn(t){return typeof t=="number"?e(I)[t]??null:t?.data.id??null}const Xn="signet-embeddings-filter-presets",Ua=[{id:"all",name:"All",search:"",sources:[],pinnedOnly:!1,neighborhoodOnly:!1,clusterLensMode:!1},{id:"pinned",name:"Pinned",search:"",sources:[],pinnedOnly:!0,neighborhoodOnly:!1,clusterLensMode:!1},{id:"focus",name:"Focus",search:"",sources:[],pinnedOnly:!1,neighborhoodOnly:!0,clusterLensMode:!0}];function Va(t,r){return{id:r,name:t,search:e(Ae),sources:[...e(Te)],pinnedOnly:e(xt),neighborhoodOnly:e(Wt),clusterLensMode:e(ht)}}function jn(t){n(Ae,t.search,!0),n(Te,new Set(t.sources),!0),n(xt,t.pinnedOnly,!0),n(Wt,t.neighborhoodOnly,!0),n(ht,t.clusterLensMode,!0),n(Z,t.id,!0)}function Ja(){if(typeof window>"u")return;const t=e(v)?`Cluster: ${e(v).who??"source"}`:"Custom preset",a=window.prompt("Preset name",t)?.trim();if(!a)return;const c=`custom-${Date.now()}`,g=Va(a,c);n(ue,[g,...e(ue)].slice(0,8),!0),n(Z,c)}function Qa(t){n(ue,e(ue).filter(r=>r.id!==t),!0),e(Z)===t&&n(Z,"all")}async function Hn(){if(e(ae))return;n(ae,!0),n(K,""),n(U,"Loading projection...");const t=++Ke,r=Cn(),a=Ln(r);try{let c=await sa(2,r),g=0;const M=30;for(;c.status==="computing";){if(t!==Ke)return;if(g++,g>=M){n(K,"Projection timed out after 60s. Try refreshing."),n(tt,a,!0);return}n(U,"Computing layout..."),await new Promise(A=>setTimeout(A,2e3)),c=await sa(2,r)}if(c.status==="error"){n(K,c.message??"Projection computation failed",!0),n(tt,a,!0);return}if(t!==Ke)return;const b=c.nodes??[];if(n(V,b.map(Ca),!0),n(ve,c.total??b.length,!0),n(ot,!!(c.hasMore??(c.count??b.length)<(c.total??b.length)),!0),n(tt,a,!0),n(m,new Map(e(V).map(A=>[A.id,A])),!0),b.length===0){n(U,"");return}let T=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY;for(const A of b)A.x<T&&(T=A.x),A.x>w&&(w=A.x),A.y<L&&(L=A.y),A.y>le&&(le=A.y);const k=w-T||1,N=le-L||1,D=560;if(n(vt,b.map((A,te)=>({x:((A.x-T)/k-.5)*D,y:((A.y-L)/N-.5)*D,radius:2.3+(A.importance??.5)*2.8,color:_n(A.who,.85),data:e(V)[te],createdMs:Ma(A.createdAt)})),!0),n(I,e(V).map(A=>A.id),!0),n(i,(c.edges??[]).map(([A,te])=>({source:A,target:te,edgeType:"knn"})),!0),e(B)&&await Za(),n(U,""),await un(),t!==Ke)return;e(B)?(e(pt)?.startKnowledgeGraphSimulation(e(vt),e(i)),e(pt)?.startRendering(!0)):(e(pt)?.startSimulation(e(vt),e(i),e(P)),e(pt)?.startRendering())}catch(c){n(K,c.message||"Failed to load projection",!0),n(U,""),n(tt,a,!0)}}async function Za(){n(H,!0);try{const t=await Do(o.agentId);if(!t){n(de,null);return}n(de,t,!0);const r=new Map;for(const w of e(vt))r.set(w.data.id,w);const a=[],c=[],g=[],M=new Map,b=new Map,T=400;for(const w of t.entities){const L=`entity:${w.id}`,le=ei(w),k=(Math.random()-.5)*T,N=(Math.random()-.5)*T,D={id:L,content:w.name,who:w.entityType,importance:.9,pinned:w.pinned,tags:[],createdAt:void 0},A=a.length;b.set(w.id,A),a.push({x:k,y:N,radius:le,color:Kr(w.entityType,.7),data:D,nodeType:"entity",entityData:w}),g.push(L),M.set(L,D);for(const te of w.aspects){const Pe=`aspect:${te.id}`,Ce=Zo(te.weight),Se={id:Pe,content:te.name,who:w.entityType,importance:te.weight,pinned:!1,tags:[],createdAt:void 0},R=a.length;a.push({x:k+(Math.random()-.5)*80,y:N+(Math.random()-.5)*80,radius:Ce,color:Kr(w.entityType,.5),data:Se,nodeType:"aspect",aspectData:te,parentEntityId:w.id}),g.push(Pe),M.set(Pe,Se),c.push({source:A,target:R,edgeType:"hierarchy"});for(const z of te.attributes){const re=`attr:${z.id}`,ee=$o(z.importance),Me={id:re,content:z.content,who:w.entityType,importance:z.importance,pinned:!1,tags:[],createdAt:void 0},he=a.length;if(a.push({x:a[R].x+(Math.random()-.5)*40,y:a[R].y+(Math.random()-.5)*40,radius:ee,color:Kr(w.entityType,.3),data:Me,nodeType:"attribute",attributeData:z,parentEntityId:w.id,parentAspectId:te.id}),g.push(re),M.set(re,Me),c.push({source:R,target:he,edgeType:"hierarchy"}),z.memoryId){const ce=r.get(z.memoryId);if(ce){const Le=a.length;a.push({x:a[he].x+(Math.random()-.5)*25,y:a[he].y+(Math.random()-.5)*25,radius:2,color:ce.color,data:ce.data,nodeType:"memory"}),g.push(ce.data.id),M.set(ce.data.id,ce.data),c.push({source:he,target:Le,edgeType:"hierarchy"})}}}}}if(a.length>3e3){const w=new Map;let L=0;for(let k=0;k<a.length;k++)a[k].nodeType!=="memory"&&(w.set(k,L),a[L]=a[k],g[L]=g[k],L++);a.length=L,g.length=L;let le=0;for(const k of c){const N=w.get(k.source),D=w.get(k.target);N!==void 0&&D!==void 0&&(c[le]={...k,source:N,target:D},le++)}c.length=le,M.clear();for(const k of a)M.set(k.data.id,k.data)}for(const w of t.dependencies){const L=b.get(w.sourceEntityId),le=b.get(w.targetEntityId);L!==void 0&&le!==void 0&&c.push({source:L,target:le,edgeType:"dependency",dependencyType:w.dependencyType,strength:w.strength})}n(vt,a,!0),n(I,g,!0),n(i,c,!0),n(m,M,!0)}finally{n(H,!1)}}async function $a(t){if(!t){n(E,[],!0),n(oe,[],!0),n(Ge,[],!0),n(W,new Map,!0);return}const r=await la(t.id,10);n(E,r.map(a=>({id:a.id,score:a.score??0,kind:"similar"})),!0),n(oe,[],!0),n(Ge,e(E),!0),n(W,new Map(e(E).map(a=>[a.id,a.kind])),!0)}function eo(){n(v,null),n(_,null),n(C,null),n(Et,[],!0),n(jt,"")}function $r(t){const r=e(m).get(t)??null;r&&(n(C,null),n(v,r,!0))}function to(t){if(e(ge)==="2d"){e(pt)?.focusNode(t);return}e(ir)?.focusNode(t)}async function ro(){if(!e(v)||e(Xt))return;n(Xt,!0),n(jt,"");const t=e(v).id,r=!(e(v).pinned??!1),a=await Ao(t,r);if(!a.success){n(jt,a.error??"Failed to update pin state",!0),n(Xt,!1);return}Ra(t,c=>({...c,pinned:r})),e(ge)==="3d"&&e(ir)?.refreshAppearance(),n(Xt,!1)}async function no(){if(e(v)){n(Kt,!0);try{n(Et,await la(e(v).id,10,Ro.filterType||void 0),!0)}finally{n(Kt,!1)}}}async function en(){n(ae,!1),n(U,""),n(K,""),n(ie,[],!0),n(v,null),n(_,null),n(C,null),n(Et,[],!0),n(Kt,!1),n(m,new Map,!0),n(W,new Map,!0),n(E,[],!0),n(oe,[],!0),n(Ge,[],!0),n(V,[],!0),n(ve,0),n(ot,!1),n(vt,[],!0),n(i,[],!0),n(I,[],!0),n(jt,""),e(pt)?.stopSimulation(),e(pt)?.stopRendering(),e(pt)?.resetCamera(),e(ir)?.destroy(),n(ge,"2d"),await un(),Hn()}ne(()=>{const t=e(V),r=new Set,a=new Map,c=new Map,g=new Map,M=new Map;for(const b of t){b.pinned&&r.add(b.id);const T=b.who??"unknown";a.set(T,(a.get(T)??0)+1),typeof b.type=="string"&&b.type.length>0&&c.set(b.type,(c.get(b.type)??0)+1);const w=b.sourceType??"memory";g.set(w,(g.get(w)??0)+1),M.set(b.id,[b.content,b.text??"",b.who??"",b.type??"",b.sourceType??"",b.sourceId??"",...b.tags??[]].join(" ").toLowerCase())}if(n(bt,r,!0),n(q,M,!0),n(Qt,[...a.entries()].sort((b,T)=>T[1]-b[1]||b[0].localeCompare(T[0])).map(([b,T])=>({who:b,count:T})),!0),n(Dt,[...c.entries()].sort((b,T)=>T[1]-b[1]||b[0].localeCompare(T[0])).map(([b,T])=>({value:b,count:T})),!0),n(lt,[...g.entries()].sort((b,T)=>T[1]-b[1]||b[0].localeCompare(T[0])).map(([b,T])=>({value:b,count:T})),!0),e(Te).size>0){const b=new Set([...e(Te)].filter(T=>a.has(T)));b.size!==e(Te).size&&n(Te,b,!0)}}),ne(()=>{let t=!1;return(async()=>{const r=await Co();t||n(He,r.filter(a=>a.trim().length>0),!0)})(),()=>{t=!0}}),ne(()=>{if(e(We).size===0||e(He).length===0)return;const t=new Set(e(He)),r=new Set([...e(We)].filter(a=>t.has(a)));r.size!==e(We).size&&n(We,r,!0)}),ne(()=>{const t=e(se);t==="all"||t==="custom"||n(Ee,Date.now(),!0)}),ne(()=>{const t=e(Ae);if(!t.trim()){clearTimeout(it),n(Re,""),n(It,null),n(Oe,[],!0);return}const r=window.setTimeout(()=>{n(Re,t,!0)},180);return it=r,()=>clearTimeout(r)}),ne(()=>{const t=e(Re).trim().toLowerCase(),r=e(V);if(!t){n(It,null),n(Oe,[],!0);return}const a=new Set,c=[];for(const g of r){const M=e(q).get(g.id);M&&M.includes(t)&&(a.add(g.id),c.push(g))}if(e(B))for(const[g,M]of e(m)){if(a.has(g))continue;[M.content,M.who??"",...M.tags??[]].join(" ").toLowerCase().includes(t)&&(a.add(g),c.push(M))}n(It,a,!0),n(Oe,c.slice(0,50),!0)}),ne(()=>{const t=e(Te);if(t.size===0){n(tr,null);return}n(tr,new Set(e(V).filter(r=>t.has(r.who??"unknown")).map(r=>r.id)),!0)}),ne(()=>{if(!(typeof window>"u"||e(ze))){try{const t=window.localStorage.getItem(Xn);if(t){const r=JSON.parse(t);if(Array.isArray(r)){const a=r.filter(c=>{if(typeof c!="object"||c===null)return!1;const g=c;return typeof g.id=="string"&&typeof g.name=="string"&&typeof g.search=="string"&&Array.isArray(g.sources)&&typeof g.pinnedOnly=="boolean"&&typeof g.neighborhoodOnly=="boolean"&&typeof g.clusterLensMode=="boolean"});n(ue,a.slice(0,8),!0)}}}catch{n(ue,[],!0)}n(ze,!0)}}),ne(()=>{typeof window>"u"||!e(ze)||window.localStorage.setItem(Xn,JSON.stringify(e(ue)))}),ne(()=>{if(!(typeof window>"u"||e(qe)))try{const t=window.localStorage.getItem(fa);if(t){const r=JSON.parse(t);if(typeof r=="object"&&r!==null){const a=r;n(P,xn({centerForce:typeof a.centerForce=="number"?a.centerForce:Ir.centerForce,repelForce:typeof a.repelForce=="number"?a.repelForce:Ir.repelForce,linkForce:typeof a.linkForce=="number"?a.linkForce:Ir.linkForce,linkDistance:typeof a.linkDistance=="number"?a.linkDistance:Ir.linkDistance}),!0)}}}finally{n(qe,!0)}}),ne(()=>{typeof window>"u"||!e(qe)||window.localStorage.setItem(fa,JSON.stringify(e(P)))}),ne(()=>{if(!(typeof window>"u"||e(ar))){try{const t=window.sessionStorage.getItem($e);(t==="source"||t==="newness"||t==="none")&&n($,t,!0),window.sessionStorage.getItem(ct)==="true"&&n(_t,!0)}catch{}try{const t=window.localStorage.getItem(Ue);if(t){const r=Number.parseInt(t,10);Number.isNaN(r)||n(rr,r,!0)}}catch{}try{window.localStorage.removeItem(Ct),window.localStorage.removeItem(be)}catch{}n(ar,!0)}}),ne(()=>{if(!(typeof window>"u"||!e(ar))){try{e($)==="source"?window.sessionStorage.removeItem($e):window.sessionStorage.setItem($e,e($))}catch{}try{e(_t)&&e($)!=="none"?window.sessionStorage.setItem(ct,"true"):window.sessionStorage.removeItem(ct)}catch{}try{e(nr)!==null&&window.localStorage.setItem(Ue,String(e(nr)))}catch{}}}),ne(()=>{if(!(typeof window>"u"))try{window.sessionStorage.getItem(_e)==="true"&&n(B,!0)}catch{}}),ne(()=>{if(!(typeof window>"u"))try{e(B)?window.sessionStorage.setItem(_e,"true"):window.sessionStorage.removeItem(_e)}catch{}}),ne(()=>{if(typeof window>"u")return;const t=window.setInterval(()=>{n(qt,Date.now(),!0)},6e4);return()=>window.clearInterval(t)}),ne(()=>{const t=new Set;if(e(ht)){const r=e(v)??e(Gt);if(r){t.add(r.id);const a=e(v)!==null?e(Ge):e(Gr);for(const c of a)t.add(c.id)}}n(G,t,!0)}),ne(()=>{e(ht),e(G),Xr()}),ne(()=>{e($),e(_t),e(qt),e(rr),e(ge)==="2d"&&e(pt)?.requestRedraw(),Xr()}),ne(()=>{!e(ae)||typeof window>"u"||e(nr)===null&&n(nr,Date.now(),!0)}),ne(()=>{e(P),e(ae)&&e(ge)==="2d"&&e(pt)?.updatePhysics(e(P))});const ao=Q(()=>Ln(Cn()));ne(()=>{const t=e(ao);if(!e(ae)||e(U).length>0||t===e(tt))return;clearTimeout(Ht);const r=window.setTimeout(()=>{en()},220);return Ht=r,()=>clearTimeout(r)}),ne(()=>{const t=e(xt)===!0?new Set(e(bt)):null,r=e(v)??e(Gt),a=e(v)?e(Ge):e(Gr),c=e(Wt)===!0&&r?new Set([r.id,...a.map(g=>g.id)]):null;n(Pt,Aa([e(It),e(tr),t,c]),!0),Xr()}),ne(()=>{$a(e(v))}),ne(()=>{const t=e($t),r=e(E),a=e(oe);n(Ge,t==="similar"?r:a,!0),n(W,new Map(e(Ge).map(c=>[c.id,c.kind])),!0),Xr()});const Gt=Q(()=>e(C)?e(m).get(e(C))??null:e(_)),Gn=Q(Qr),oo=Q(()=>{e(I);const t=e(i),r=new Map;for(const a of t){const c=Yn(a.source),g=Yn(a.target);if(!c||!g||c===g)continue;const M=r.get(c)??new Map;M.set(g,(M.get(g)??0)+1),r.set(c,M);const b=r.get(g)??new Map;b.set(c,(b.get(c)??0)+1),r.set(g,b)}return r}),Gr=Q(()=>{const t=e(Gt);if(!t)return[];const r=e(oo).get(t.id);if(!r||r.size===0)return[];const a=[...r.entries()].sort((g,M)=>M[1]-g[1]).slice(0,6),c=a[0]?.[1]??1;return a.map(([g,M])=>({id:g,score:M/c,kind:"similar"}))}),io=Q(()=>new Map(e(Gr).map(t=>[t.id,"similar"]))),zn=Q(()=>e(v)?e(W):e(io)),wr=Q(()=>{const t=e(v);return t?e(vt).find(r=>r.data.id===t.id)??null:null}),tn=Q(()=>e(v)?[]:e(Gr)),Bn=Q(()=>{const t=new Map(e(Qt).map(c=>[c.who,c])),r=Ze.map(c=>t.get(c)).filter(c=>!!c),a=e(Qt).filter(c=>!Xe.has(c.who));return[...r,...a].slice(0,8)});ne(()=>{e(v)&&e(C)&&n(C,null)}),ne(()=>{const t=e(C);t&&(e(m).has(t)||n(C,null))}),ne(()=>{const t=e(O);if(!t)return;Ut=t.getBoundingClientRect();const r=new ResizeObserver(()=>{Ut=t.getBoundingClientRect()});return r.observe(t),()=>r.disconnect()}),ne(()=>{e(X)&&An()}),ne(()=>{if(typeof window>"u")return;const t=r=>{if(r.key==="Shift"){qa();return}r.key==="Escape"&&On()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}}),ne(()=>{if(!e(O))return;const t=new IntersectionObserver(r=>{r[0].isIntersecting&&!e(ae)&&!e(Tn)&&(n(Tn,!0),Hn())},{threshold:.1});return t.observe(e(O)),()=>t.disconnect()}),ne(()=>{kr.embeddings.controlsOpen=e(me),kr.embeddings.presetsOpen=e(Ye),kr.embeddings.sourcesOpen=e(Be),Bo()});var rn=Ks();Ar("keydown",Fo,ka);var Wn=l(rn);{var so=t=>{Go(t,{title:"Constellation",children:(r,a)=>{zo(r,{group:"memory",get tabs(){return Yo},get activeTab(){return ia.activeTab},onselect:(c,g)=>Oo(g)})}})};j(Wn,t=>{f()||t(so)})}var Kn=d(Wn,2),Sr=l(Kn),qn=l(Sr);{var lo=t=>{var r=zi();Bt(r,"",{},{top:"52px"});var a=l(r),c=l(a);s(a),s(r),F(()=>h(c,`${gn.Unlock} preview`)),Y("click",a,On),u(t,r)};j(qn,t=>{e(C)&&t(lo)})}var Un=d(qn,2);{var co=t=>{var r=Qi(),a=l(r),c=l(a),g=l(c),M=d(g),b=d(M),T=l(b);s(b);var w=d(b,2);{var L=N=>{var D=Bi(),A=l(D);s(D),F(te=>h(A,`${te??""}%`),[()=>Math.round(e(At).percent)]),u(N,D)};j(w,N=>{e(_r)&&e(At)&&N(L)})}s(c);var le=d(c,2);{var k=N=>{var D=Ji(),A=l(D),te=d(l(A),2),Pe=l(te);s(te),s(A);var Ce=d(A,2);{var Se=z=>{var re=qi(),ee=l(re),Me=l(ee,!0);s(ee);var he=d(ee,2);{var ce=Ne=>{var ke=Wi(),Fe=l(ke,!0);s(ke),F(()=>h(Fe,e(lr))),u(Ne,ke)};j(he,Ne=>{e(lr)&&Ne(ce)})}var Le=d(he,2);{var Ve=Ne=>{var ke=Ki(),Fe=l(ke),rt=l(Fe),wt=l(rt);s(rt);var ft=d(rt,2),Qe=l(ft);s(ft),s(Fe);var De=d(Fe,2),St=l(De);s(De);var Zt=d(De,2),pr=l(Zt);s(Zt),s(ke),F((fr,mr,J,nt,Vt)=>{h(wt,`${fr??""} / ${mr??""}`),h(Qe,`${J??""}%`),Bt(St,nt),h(pr,`${Vt??""} remaining · ${e(At).coverage??""} coverage`)},[()=>e(At).completed.toLocaleString(),()=>e(At).baseline.toLocaleString(),()=>Math.round(e(At).percent),()=>`width:${Math.max(0,Math.min(100,e(At).percent))}%`,()=>e(At).remaining.toLocaleString()]),u(Ne,ke)};j(Le,Ne=>{e(At)&&Ne(Ve)})}s(re),F(()=>h(Me,e(sr))),u(z,re)};j(Ce,z=>{e(sr)&&z(Se)})}var R=d(Ce,2);Mt(R,21,()=>e(ur).checks,kt,(z,re)=>{var ee=Vi(),Me=l(ee),he=d(Me,2),ce=l(he),Le=l(ce),Ve=l(Le,!0);s(Le);var Ne=d(Le,2),ke=l(Ne,!0);s(Ne),s(ce);var Fe=d(ce,2),rt=l(Fe,!0);s(Fe);var wt=d(Fe,2);{var ft=Qe=>{var De=Ui(),St=l(De,!0);s(De),F(()=>{De.disabled=e(_r),h(St,e(_r)?"running...":e(re).fix)}),Y("click",De,()=>Na(e(re))),u(Qe,De)};j(wt,Qe=>{e(re).fix&&e(re).status!=="ok"&&Qe(ft)})}s(he),s(ee),F(Qe=>{Bt(Me,`background:${Qe??""}`),h(Ve,e(re).name),h(ke,e(re).status),h(rt,e(re).message)},[()=>Pa(e(re).status)]),u(z,ee)}),s(R),s(D),F(()=>h(Pe,`${e(ur).config.provider??""}/${e(ur).config.model??""}`)),u(N,D)};j(le,N=>{e(Ur)&&N(k)})}s(a),s(r),F((N,D)=>{Bt(g,`background:${N??""}`),h(M,` ${e(ur).status??""} `),h(T,`${D??""}%`)},[()=>Fa(e(ur).status),()=>Math.round(e(ur).score*100)]),Y("click",c,()=>n(Ur,!e(Ur))),u(t,r)};j(Un,t=>{e(ur)&&t(co)})}var nn=d(Un,2),uo=l(nn);Yt(uo,()=>Lr,(t,r)=>{r(t,{class:"pointer-events-auto flex min-w-[180px] max-h-full flex-col-reverse",get open(){return e(S)},set open(a){n(S,a,!0)},children:(a,c)=>{var g=ls(),M=xe(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center gap-2 px-3 py-1.5 min-w-[180px] border border-[var(--sig-border)] text-[10px] font-[family-name:var(--font-mono)] uppercase tracking-[0.06em] text-[var(--sig-text-muted)] bg-transparent",get"aria-expanded"(){return e(S)},children:(L,le)=>{var k=Zi(),N=d(xe(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(S)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var b=d(M,2);Yt(b,()=>Cr,(T,w)=>{w(T,{class:"min-h-0 max-h-[min(40vh,24rem)] overflow-y-auto border border-[var(--sig-border)] bg-[rgba(5,5,5,0.88)] px-3 py-2",children:(L,le)=>{var k=ss(),N=xe(k),D=d(l(N));s(N);var A=d(N,2);{var te=ee=>{var Me=es(),he=xe(Me),ce=l(he),Le=l(ce);gr(),s(ce);var Ve=d(ce,2),Ne=l(Ve);gr(),s(Ve);var ke=d(Ve,2),Fe=l(ke);gr(),s(ke);var rt=d(ke,2),wt=l(rt);gr(),s(rt),s(he);var ft=d(he,2);Mt(ft,21,()=>e(Bn),kt,(Qe,De)=>{var St=$i(),Zt=l(St);s(St),F(pr=>{mt(St,1,`h-5 inline-flex items-center gap-1 px-1.5 py-0 font-[family-name:var(--font-mono)] text-[10px] border border-[rgba(255,255,255,0.14)] ${pr??""}`),h(Zt,`${e(De).who??""} ${e(De).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(De).who)?"bg-[rgba(255,255,255,0.08)] text-[var(--sig-text-bright)]":"bg-transparent text-[var(--sig-text-muted)]"]),u(Qe,St)}),s(ft),F((Qe,De,St,Zt)=>{Bt(Le,Qe),Bt(Ne,De),Bt(Fe,St),Bt(wt,Zt)},[()=>`background:${jr(3e5,.95)}`,()=>`background:${jr(108e5,.9)}`,()=>`background:${jr(2592e5,.85)}`,()=>`background:${jr(2592e6,.85)}`]),u(ee,Me)},Pe=ee=>{var Me=rs();Mt(Me,21,()=>e(Bn),kt,(he,ce)=>{var Le=ts(),Ve=l(Le),Ne=d(Ve);s(Le),F((ke,Fe)=>{mt(Le,1,`h-5 inline-flex items-center gap-1 px-1.5 py-0 font-[family-name:var(--font-mono)] text-[10px] border border-[rgba(255,255,255,0.14)] ${ke??""}`),Bt(Ve,Fe),h(Ne,` ${e(ce).who??""} ${e(ce).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(ce).who)?"bg-[rgba(255,255,255,0.08)] text-[var(--sig-text-bright)]":"bg-transparent text-[var(--sig-text-muted)]",()=>`background:${ya(e(ce).who,1)}`]),u(he,Le)}),s(Me),u(ee,Me)},Ce=ee=>{var Me=ns();u(ee,Me)};j(A,ee=>{e($)==="newness"?ee(te):e($)==="source"?ee(Pe,1):ee(Ce,-1)})}var Se=d(A,6);{var R=ee=>{var Me=as();u(ee,Me)};j(Se,ee=>{e(_t)&&e($)!=="none"&&ee(R)})}var z=d(Se,4);{var re=ee=>{var Me=is(),he=d(l(Me),2);Mt(he,21,()=>Object.entries(qr),kt,(ce,Le)=>{var Ve=Q(()=>Po(e(Le),2));let Ne=()=>e(Ve)[0],ke=()=>e(Ve)[1];var Fe=vr(),rt=xe(Fe);{var wt=ft=>{var Qe=os(),De=l(Qe),St=d(De);s(Qe),F(()=>{Bt(De,`background:${ke()}; clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);`),h(St,` ${Ne()??""}`)}),u(ft,Qe)};j(rt,ft=>{Ne()!=="unknown"&&ft(wt)})}u(ce,Fe)}),s(he),gr(2),s(Me),u(ee,Me)};j(z,ee=>{e(B)&&ee(re)})}F(()=>h(D,` = ${e($)==="none"?"off":e($)==="newness"?"by recency":"by source"}`)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})}),s(nn);var Vn=d(nn,2);{var go=t=>{var r=ds(),a=l(r),c=l(a,!0);s(a),s(r),F(()=>h(c,e(U))),u(t,r)},vo=t=>{var r=cs(),a=l(r),c=l(a,!0);s(a),s(r),F(()=>h(c,e(K))),u(t,r)},po=t=>{var r=us();u(t,r)},fo=t=>{var r=gs();u(t,r)};j(Vn,t=>{e(U)?t(go):e(K)?t(vo,1):e(ae)&&e(V).length===0?t(po,2):e(ae)||t(fo,3)})}var Jn=d(Vn,2);Bt(Jn,"",{},{top:"20px"});var Qn=d(Jn,4);{var mo=t=>{var r=bs(),a=l(r),c=l(a),g=l(c,!0);s(c);var M=d(c,2);{var b=R=>{var z=vs(),re=l(z,!0);s(z),F(()=>h(re,e(Gt).type)),u(R,z)};j(M,R=>{e(Gt).type&&R(b)})}var T=d(M,2);{var w=R=>{var z=ps();u(R,z)};j(T,R=>{e(Gt).pinned&&R(w)})}var L=d(T,2);{var le=R=>{var z=fs();u(R,z)};j(L,R=>{e(C)&&R(le)})}s(a);var k=d(a,2),N=l(k);s(k);var D=d(k,2),A=l(D,!0);s(D);var te=d(D,2),Pe=l(te,!0);s(te);var Ce=d(te,2);{var Se=R=>{var z=xs(),re=d(l(z),2);Mt(re,21,()=>e(tn),kt,(ee,Me)=>{const he=Q(()=>e(m).get(e(Me).id));var ce=vr(),Le=xe(ce);{var Ve=Ne=>{var ke=ms(),Fe=l(ke),rt=l(Fe,!0);s(Fe);var wt=d(Fe,2),ft=l(wt);s(wt),s(ke),F((Qe,De)=>{h(rt,Qe),h(ft,`${De??""}%`)},[()=>yr(e(he)),()=>Math.round(e(Me).score*100)]),u(Ne,ke)};j(Le,Ne=>{e(he)&&Ne(Ve)})}u(ee,ce)}),s(re),s(z),u(R,z)};j(Ce,R=>{e(tn).length>0&&R(Se)})}s(r),hr(r,R=>n(X,R),()=>e(X)),F((R,z,re)=>{h(g,e(Gt).who??"unknown"),h(N,`importance ${R??""}% · ${z??""} · linked ${e(tn).length??""}`),h(A,re),h(Pe,e(C)?"ESC or Unlock Preview button":"Hold Shift to lock preview")},[()=>Math.round((e(Gt).importance??0)*100),()=>La(e(Gt).createdAt),()=>yr(e(Gt))]),u(t,r)};j(Qn,t=>{e(Gt)&&t(mo)})}var zr=d(Qn,2);let Zn;var xo=l(zr);{var bo=t=>{{let r=Q(()=>e(ht)&&e(G).size>0),a=Q(()=>e(Te).size>0?e(Te):null);hr(ui(t,{get nodes(){return e(vt)},get edges(){return e(i)},get graphPhysics(){return e(P)},get graphSelected(){return e(v)},get graphHovered(){return e(Gt)},get embeddingFilterIds(){return e(Pt)},get relationLookup(){return e(zn)},get pinnedIds(){return e(bt)},get lensIds(){return e(G)},get clusterLensMode(){return e(r)},get colorMode(){return e($)},get nowMs(){return e(qt)},get showNewSinceLastSeen(){return e(_t)},get lastSeenMs(){return e(rr)},get sourceFocusSources(){return e(a)},onselectnode:c=>{c?$r(c.id):n(v,null)},onhovernode:Rn}),c=>n(pt,c,!0),()=>e(pt))}},ho=t=>{var r=hs(),a=l(r),c=l(a,!0);s(a),s(r),F(()=>h(c,e(U))),u(t,r)},yo=t=>{var r=ys(),a=l(r),c=l(a,!0);s(a),s(r),F(()=>h(c,e(K))),u(t,r)};j(xo,t=>{e(ae)?t(bo):e(U)?t(ho,1):e(K)&&t(yo,2)})}s(zr);var an=d(zr,2);let $n;var _o=l(an);{var wo=t=>{var r=vr(),a=xe(r);{let c=Q(()=>e(ht)&&e(G).size>0),g=Q(()=>e(Te).size>0?e(Te):null);Yt(a,()=>e(Rr),(M,b)=>{hr(b(M,{get embeddings(){return e(V)},get projected3d(){return e(ie)},get graphSelected(){return e(v)},get embeddingFilterIds(){return e(Pt)},get relationLookup(){return e(zn)},get pinnedIds(){return e(bt)},get lensIds(){return e(G)},get clusterLensMode(){return e(c)},get embeddingById(){return e(m)},get colorMode(){return e($)},get nowMs(){return e(qt)},get showNewSinceLastSeen(){return e(_t)},get lastSeenMs(){return e(rr)},get sourceFocusSources(){return e(g)},onselectnode:T=>{T?$r(T.id):n(v,null)},onhovernode:Rn}),T=>n(ir,T,!0),()=>e(ir))})}u(t,r)},So=t=>{var r=_s(),a=l(r),c=l(a,!0);s(a),s(r),F(()=>h(c,e(U)||"Loading 3D...")),u(t,r)};j(_o,t=>{e(Rr)&&!e(Or)?t(wo):e(Or)&&t(So,1)})}s(an),s(Sr),hr(Sr,t=>n(O,t),()=>e(O));var ea=d(Sr,2),on=l(ea),ta=l(on);Yt(ta,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(me)},set open(a){n(me,a,!0)},children:(a,c)=>{var g=ks(),M=xe(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-[family-name:var(--font-mono)] text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=ws(),N=d(xe(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(me)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var b=d(M,2);Yt(b,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Ms(),N=l(k),D=l(N);Jt(D),hr(D,Ft=>Je=Ft,()=>Je);var A=d(D,2);{var te=Ft=>{var Fr=Ss(),cn=l(Fr,!0);s(Fr),F(()=>h(cn,e(Oe).length)),u(Ft,Fr)};j(A,Ft=>{e(Ae)&&Ft(te)})}s(N);var Pe=d(N,2),Ce=l(Pe);s(Pe);var Se=d(Pe,2),R=l(Se),z=d(R,2),re=d(z,2),ee=d(re,2),Me=l(ee,!0);s(ee),s(Se);var he=d(Se,2),ce=d(l(he),2),Le=l(ce),Ve=d(Le,2),Ne=d(Ve,2);s(ce),s(he);var ke=d(he,2),Fe=d(l(ke),2),rt=l(Fe),wt=d(rt,2),ft=l(wt,!0);s(wt),s(Fe),s(ke);var Qe=d(ke,2),De=d(l(Qe),2),St=l(De),Zt=d(l(St),2),pr=l(Zt,!0);s(Zt),s(St);var fr=d(St,2);Jt(fr),s(De);var mr=d(De,2),J=l(mr),nt=d(l(J),2),Vt=l(nt,!0);s(nt),s(J);var Rt=d(J,2);Jt(Rt),s(mr);var at=d(mr,2),zt=l(at),Ot=d(l(zt),2),xr=l(Ot,!0);s(Ot),s(zt);var er=d(zt,2);Jt(er),s(at);var sn=d(at,2),ln=l(sn),aa=d(l(ln),2),Io=l(aa,!0);s(aa),s(ln);var dn=d(ln,2);Jt(dn),s(sn);var To=d(sn,2);s(Qe),s(k),F((Ft,Fr,cn,Eo)=>{h(Ce,`Window ${e(Gn).offset+1}-${e(Gn).offset+e(V).length} / ${e(ve)??""}`),mt(R,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(xt)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),mt(z,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(Wt)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),mt(re,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(ht)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(Me,gn.Reset),mt(Le,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="newness"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),mt(Ve,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="source"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),mt(Ne,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e($)==="none"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),mt(rt,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(_t)&&e($)!=="none"?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"} ${e($)==="none"?"opacity-60 cursor-not-allowed":""}`),rt.disabled=e($)==="none",mt(wt,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(B)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(ft,e(H)?"Loading...":"Entities"),h(pr,Ft),Br(fr,e(P).centerForce),h(Vt,Fr),Br(Rt,e(P).repelForce),h(xr,cn),Br(er,e(P).linkForce),h(Io,Eo),Br(dn,e(P).linkDistance)},[()=>e(P).centerForce.toFixed(2),()=>Math.round(e(P).repelForce),()=>e(P).linkForce.toFixed(2),()=>Math.round(e(P).linkDistance)]),Y("input",D,()=>n(Z,"custom-live")),dr(D,()=>e(Ae),Ft=>n(Ae,Ft)),Y("click",R,Ga),Y("click",z,za),Y("click",re,Ba),Y("click",ee,Ha),Y("click",Le,()=>n($,"newness")),Y("click",Ve,()=>n($,"source")),Y("click",Ne,()=>{n($,"none"),n(_t,!1)}),Y("click",rt,()=>n(_t,!e(_t))),Y("click",wt,()=>{n(B,!e(B)),e(ae)&&en()}),Y("input",fr,Ft=>Nr({centerForce:Hr(Ft,e(P).centerForce)})),Y("input",Rt,Ft=>Nr({repelForce:Hr(Ft,e(P).repelForce)})),Y("input",er,Ft=>Nr({linkForce:Hr(Ft,e(P).linkForce)})),Y("input",dn,Ft=>Nr({linkDistance:Hr(Ft,e(P).linkDistance)})),Y("click",To,()=>Nr(Ir)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var ra=d(ta,2);Yt(ra,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(Ye)},set open(a){n(Ye,a,!0)},children:(a,c)=>{var g=Fs(),M=xe(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-[family-name:var(--font-mono)] text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Is(),N=d(xe(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(Ye)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var b=d(M,2);Yt(b,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Ns(),N=l(k);Mt(N,17,()=>Ua,kt,(Pe,Ce)=>{var Se=Ts(),R=l(Se,!0);s(Se),F(()=>{mt(Se,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] uppercase border border-[var(--sig-border-strong)] ${e(Z)===e(Ce).id?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(R,e(Ce).name)}),Y("click",Se,()=>jn(e(Ce))),u(Pe,Se)});var D=d(N,2);Mt(D,17,()=>e(ue),kt,(Pe,Ce)=>{var Se=Es(),R=l(Se),z=l(R,!0);s(R);var re=d(R,2);s(Se),F(()=>{mt(R,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] ${e(Z)===e(Ce).id?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"}`),h(z,e(Ce).name),fn(re,"aria-label",`Delete ${e(Ce).name} preset`)}),Y("click",R,()=>jn(e(Ce))),Y("click",re,()=>Qa(e(Ce).id)),u(Pe,Se)});var A=d(D,2),te=l(A,!0);s(A),s(k),F(()=>h(te,gn.Save)),Y("click",A,Ja),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var na=d(ra,2);Yt(na,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(Be)},set open(a){n(Be,a,!0)},children:(a,c)=>{var g=As(),M=xe(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-[family-name:var(--font-mono)] text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Ps(),N=d(xe(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(Be)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var b=d(M,2);Yt(b,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Ds(),N=l(k);{var D=te=>{var Pe=Cs();u(te,Pe)},A=te=>{var Pe=vr(),Ce=xe(Pe);Mt(Ce,17,()=>e(Qt),kt,(Se,R)=>{var z=Ls(),re=l(z);s(z),F(ee=>{mt(z,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] ${ee??""}`),h(re,`${e(R).who??""} ${e(R).count??""}`)},[()=>e(Te).size===0||e(Te).has(e(R).who)?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",z,()=>Wa(e(R).who)),u(Se,z)}),u(te,Pe)};j(N,te=>{e(Qt).length===0?te(D):te(A,-1)})}s(k),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})});var Mo=d(na,2);Yt(Mo,()=>Lr,(t,r)=>{r(t,{class:"border border-[var(--sig-border)]",get open(){return e(dt)},set open(a){n(dt,a,!0)},children:(a,c)=>{var g=Ws(),M=xe(g);Yt(M,()=>Pr,(T,w)=>{w(T,{class:"flex w-full items-center justify-between px-2 py-1.5 border-none text-[10px] uppercase tracking-[0.08em] font-[family-name:var(--font-mono)] text-[var(--sig-highlight)]",style:"background: color-mix(in srgb, var(--sig-highlight), var(--sig-bg) 94%);",children:(L,le)=>{var k=Rs(),N=d(xe(k),2);{let D=Q(()=>`size-3 text-[var(--sig-text-muted)] transition-transform ${e(dt)?"rotate-180":""}`);Dr(N,{get class(){return e(D)}})}u(L,k)},$$slots:{default:!0}})});var b=d(M,2);Yt(b,()=>Cr,(T,w)=>{w(T,{children:(L,le)=>{var k=Bs(),N=l(k),D=d(l(N),2);Jt(D);var A=d(D,4);Jt(A);var te=d(A,2),Pe=l(te);Pe.value=Pe.__value="all";var Ce=d(Pe);Ce.value=Ce.__value="24h";var Se=d(Ce);Se.value=Se.__value="7d";var R=d(Se);R.value=R.__value="30d";var z=d(R);z.value=z.__value="90d";var re=d(z);re.value=re.__value="custom",s(te),s(N);var ee=d(N,2);{var Me=J=>{var nt=Os(),Vt=l(nt);Jt(Vt);var Rt=d(Vt,2);Jt(Rt),s(nt),dr(Vt,()=>e(ye),at=>n(ye,at)),dr(Rt,()=>e(je),at=>n(je,at)),u(J,nt)};j(ee,J=>{e(se)==="custom"&&J(Me)})}var he=d(ee,2),ce=l(he),Le=l(ce);Le.value=Le.__value="all";var Ve=d(Le);Ve.value=Ve.__value="pinned";var Ne=d(Ve);Ne.value=Ne.__value="unpinned",s(ce);var ke=d(ce,2);Jt(ke);var Fe=d(ke,2);Jt(Fe);var rt=d(Fe,2);Jt(rt);var wt=d(rt,2);Jt(wt),s(he);var ft=d(he,2),Qe=d(l(ft),2);{var De=J=>{var nt=Ys();u(J,nt)},St=J=>{var nt=vr(),Vt=xe(nt);Mt(Vt,17,()=>e(He),kt,(Rt,at)=>{var zt=Xs(),Ot=l(zt,!0);s(zt),F(xr=>{mt(zt,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] ${xr??""}`),h(Ot,e(at))},[()=>e(We).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",zt,()=>Ya(e(at))),u(Rt,zt)}),u(J,nt)};j(Qe,J=>{e(He).length===0?J(De):J(St,-1)})}s(ft);var Zt=d(ft,2);{var pr=J=>{var nt=Hs(),Vt=d(l(nt),2);Mt(Vt,17,()=>[...new Set([...e(gt),...e(Dt).map(Rt=>Rt.value)])],kt,(Rt,at)=>{const zt=Q(()=>e(Dt).find(er=>er.value===e(at))?.count??0);var Ot=js(),xr=l(Ot);s(Ot),F(er=>{mt(Ot,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] ${er??""}`),h(xr,`${e(at)??""}${e(zt)>0?` ${e(zt)}`:""}`)},[()=>e(gt).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",Ot,()=>Xa(e(at))),u(Rt,Ot)}),s(nt),u(J,nt)};j(Zt,J=>{(e(Dt).length>0||e(gt).size>0)&&J(pr)})}var fr=d(Zt,2);{var mr=J=>{var nt=zs(),Vt=d(l(nt),2);Mt(Vt,17,()=>[...new Set([...e(et),...e(lt).map(Rt=>Rt.value)])],kt,(Rt,at)=>{const zt=Q(()=>e(lt).find(er=>er.value===e(at))?.count??0);var Ot=Gs(),xr=l(Ot);s(Ot),F(er=>{mt(Ot,1,`px-2 py-[2px] font-[family-name:var(--font-mono)] text-[10px] border border-[var(--sig-border-strong)] ${er??""}`),h(xr,`${e(at)??""}${e(zt)>0?` ${e(zt)}`:""}`)},[()=>e(et).has(e(at))?"text-[var(--sig-highlight)] bg-[color-mix(in_srgb,var(--sig-highlight),var(--sig-bg)_90%)]":"text-[var(--sig-text-muted)] bg-transparent"]),Y("click",Ot,()=>ja(e(at))),u(Rt,Ot)}),s(nt),u(J,nt)};j(fr,J=>{(e(lt).length>0||e(et).size>0)&&J(mr)})}s(k),Ar("blur",D,Zr),dr(D,()=>e(pe),J=>n(pe,J)),Ar("blur",A,Zr),dr(A,()=>e(ut),J=>n(ut,J)),oa(te,()=>e(se),J=>n(se,J)),oa(ce,()=>e(yt),J=>n(yt,J)),dr(ke,()=>e(st),J=>n(st,J)),dr(Fe,()=>e(Tt),J=>n(Tt,J)),dr(rt,()=>e(Lt),J=>n(Lt,J)),dr(wt,()=>e(fe),J=>n(fe,J)),u(L,k)},$$slots:{default:!0}})}),u(a,g)},$$slots:{default:!0}})}),s(on);var ko=d(on,2);{let t=Q(()=>e(wr)?.nodeType??void 0),r=Q(()=>e(wr)?.entityData??null),a=Q(()=>e(wr)?.aspectData??null),c=Q(()=>e(wr)?.attributeData??null),g=Q(()=>e(wr)?.parentEntityId??null),M=Q(()=>e(wr)?.parentAspectId??null);Gi(ko,{containerClass:"flex-1 min-h-0 w-full min-w-0 border-l-0 border-t-0 max-lg:max-h-none",get graphSelected(){return e(v)},get embeddings(){return e(V)},get embeddingById(){return e(m)},get activeNeighbors(){return e(Ge)},get relationMode(){return e($t)},get loadingGlobalSimilar(){return e(Kt)},get globalSimilar(){return e(Et)},get embeddingSearchMatches(){return e(Oe)},get embeddingSearch(){return e(Ae)},get pinBusy(){return e(Xt)},get pinError(){return e(jt)},get selectedNodeType(){return e(t)},get selectedEntityData(){return e(r)},get selectedAspectData(){return e(a)},get selectedAttributeData(){return e(c)},get parentEntityId(){return e(g)},get parentAspectId(){return e(M)},get constellationOverlay(){return e(de)},onselectembedding:$r,onclearselection:eo,onloadglobalsimilar:no,get onopenglobalsimilar(){return o.onopenglobalsimilar},onsetrelationmode:b=>n($t,b,!0),onfocusembedding:()=>e(v)&&to(e(v).id),onpintoggle:ro})}s(ea),s(Kn),s(rn),F(()=>{Zn=Bt(zr,"",Zn,{display:e(ge)==="2d"?"contents":"none"}),$n=Bt(an,"",$n,{display:e(ge)==="3d"?"contents":"none"})}),Y("mousemove",Sr,Ka),Ar("mouseleave",Sr,()=>{e(C)||n(_,null)}),u(y,rn),Sn()}Mn(["mousemove","click","input"]);export{tl as default};