From 057fd186529a99b82fe79ecfae618e9a623de495 Mon Sep 17 00:00:00 2001 From: Ming <2945594404@qq.com> Date: Wed, 11 Nov 2026 20:09:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E4=BC=98=E5=8C=96=E7=9F=A5?= =?UTF-8?q?=E8=AF=86=E5=9B=BE=E8=B0=B1=E5=B8=83=E5=B1=80=E4=B8=8E=E4=BA=A4?= =?UTF-8?q?=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 引入力导向布局、语义缩放和邻域视图,增强滚轮缩放与列表节点定位,改善连线摘要、标签切换及按压反馈。保留已合并的中文化,为新增控件补齐中英文翻译。 验证:web typecheck、75 项测试及生产构建通过;180 节点演示图谱的中英文切换、列表居中放大和连线摘要经浏览器实测。 --- web/dist/assets/GraphView-LqJspvLW.js | 26 - web/dist/assets/GraphView-xL41QcU9.js | 26 + web/dist/assets/index-BNogta7a.css | 1 + web/dist/assets/index-SOkyd8fG.css | 1 - .../{index-DZRLQ9ap.js => index-u4AHOuRF.js} | 46 +- web/dist/index.html | 4 +- web/package-lock.json | 50 ++ web/package.json | 2 + web/src/GraphView.test.tsx | 178 +++- web/src/GraphView.tsx | 815 ++++++++++++++--- web/src/GraphView.visual.test.tsx | 825 ++++++++++++++++++ web/src/graphPhysics.test.ts | 561 ++++++++++++ web/src/graphPhysics.ts | 582 ++++++++++++ web/src/i18n/en.ts | 14 + web/src/i18n/zh.ts | 14 + web/src/styles.css | 61 ++ web/src/test-setup.ts | 1 + 17 files changed, 3021 insertions(+), 186 deletions(-) delete mode 100644 web/dist/assets/GraphView-LqJspvLW.js create mode 100644 web/dist/assets/GraphView-xL41QcU9.js create mode 100644 web/dist/assets/index-BNogta7a.css delete mode 100644 web/dist/assets/index-SOkyd8fG.css rename web/dist/assets/{index-DZRLQ9ap.js => index-u4AHOuRF.js} (89%) create mode 100644 web/src/GraphView.visual.test.tsx create mode 100644 web/src/graphPhysics.test.ts create mode 100644 web/src/graphPhysics.ts diff --git a/web/dist/assets/GraphView-LqJspvLW.js b/web/dist/assets/GraphView-LqJspvLW.js deleted file mode 100644 index 6bf064247..000000000 --- a/web/dist/assets/GraphView-LqJspvLW.js +++ /dev/null @@ -1,26 +0,0 @@ -import{c as v,u as E,a as C,f as V,s as A,b as O,j as e,P as U,F as q,h as G,X as L,C as N,Q as T,L as $,t as M,d as k,r as b,E as H,e as Q,g as f,i as D,k as Z,A as B,N as X}from"./index-DZRLQ9ap.js";import{c as J}from"./cytoscape-G6xtpWZq.js";/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const K=v("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const W=v("Focus",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y=v("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ee=v("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.468.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const se=v("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);function _(){const s=getComputedStyle(document.documentElement),c=(o,p)=>s.getPropertyValue(o).trim()||p;return{label:c("--graph-label","#55555f"),edge:c("--graph-edge","#b8b8c2"),selected:c("--graph-selection","#202024"),outline:c("--graph-outline","#ffffff")}}function P(s){return[{selector:"node",style:{"background-color":"data(color)",label:"data(label)",width:"data(size)",height:"data(size)","font-size":10,"font-family":"Space Grotesk, sans-serif",color:s.label,"text-valign":"bottom","text-margin-y":8,"text-max-width":"120px","text-wrap":"ellipsis","border-width":4,"border-color":s.outline,"border-opacity":.9}},{selector:"node:selected",style:{"border-color":s.selected,"border-width":5,"text-outline-color":s.outline,"text-outline-width":3,color:s.selected}},{selector:"edge",style:{width:1.25,"line-color":s.edge,"target-arrow-color":s.edge,"target-arrow-shape":"triangle","curve-style":"bezier","arrow-scale":.7,opacity:.8}},{selector:'edge[supersedes = "yes"]',style:{"line-color":"#c19857","target-arrow-color":"#c19857","line-style":"dashed",color:s.label,label:"data(label)","font-size":9,"text-rotation":"autorotate","text-background-color":s.outline,"text-background-opacity":1,"text-background-padding":"3px"}}]}function te({data:s,selected:c,onSelect:o,focus:p}){const{resolved:a}=Q(),n=C(),h=f.useRef(n);h.current=n;const u=f.useRef(null),d=f.useRef(null),w=f.useRef(o);return w.current=o,f.useEffect(()=>{if(!u.current)return;const t=_(),g=new Set(s.nodes.map(i=>i.id)),x=J({container:u.current,elements:[...s.nodes.map(i=>({data:{id:i.id,label:M(i.content).slice(0,36)||h.current("state.untitled"),color:D(i.category),size:20+i.importance*5}})),...(s.edges||[]).filter(i=>g.has(i.source_id)&&g.has(i.target_id)).map((i,z)=>({data:{id:`edge-${z}`,source:i.source_id,target:i.target_id,label:i.edge_type,supersedes:i.edge_type==="supersedes"?"yes":"no"}}))],style:P(t),layout:{name:"cose",animate:!1,padding:55,nodeRepulsion:()=>7e3,idealEdgeLength:()=>95,randomize:!1},minZoom:.15,maxZoom:3,wheelSensitivity:.25});d.current=x,x.on("tap","node",i=>w.current(i.target.id()));const m=new ResizeObserver(()=>x.resize());return m.observe(u.current),()=>{m.disconnect(),x.destroy(),d.current=null}},[s]),f.useEffect(()=>{const t=d.current;if(!t)return;const g=_();t.style(P(g))},[a,s]),f.useEffect(()=>{const t=d.current;t&&(t.nodes().unselect(),c&&t.getElementById(c).select())},[c,s]),e.jsxs("div",{className:"graph-surface",children:[e.jsx("div",{className:"graph-canvas",ref:u,role:"img","aria-label":n("graph.canvasAria")}),e.jsxs("div",{className:"graph-instructions",children:[e.jsx("span",{className:"live-dot"}),n(p?"graph.focused":"graph.full"),e.jsx("span",{children:n("graph.dragHint")})]}),e.jsxs("div",{className:"graph-controls",children:[e.jsx("button",{"aria-label":n("graph.zoomIn"),title:n("graph.zoomIn"),onClick:()=>{const t=d.current;t&&t.zoom({level:t.zoom()*1.3,renderedPosition:{x:t.width()/2,y:t.height()/2}})},children:e.jsx(ee,{size:18})}),e.jsx("button",{"aria-label":n("graph.zoomOut"),title:n("graph.zoomOut"),onClick:()=>{const t=d.current;t&&t.zoom({level:t.zoom()/1.3,renderedPosition:{x:t.width()/2,y:t.height()/2}})},children:e.jsx(Y,{size:18})}),e.jsx("button",{"aria-label":n("graph.fit"),title:n("graph.fit"),onClick:()=>{var t;return(t=d.current)==null?void 0:t.fit(void 0,55)},children:e.jsx(K,{size:17})}),e.jsx("button",{"aria-label":n("graph.resetLayout"),title:n("graph.resetLayout"),onClick:()=>{var t;return(t=d.current)==null?void 0:t.layout({name:"cose",animate:!1,padding:55,randomize:!0}).run()},children:e.jsx(se,{size:16})})]})]})}function ie({meta:s,refresh:c}){var z;const{route:o,navigate:p}=E(),a=C(),n=V(o.search),h=new URLSearchParams(o.search),u=h.get("focus")||"",d=h.get("edge_type")||"";n.set("limit","200"),u&&n.set("focus",u),d&&n.set("edge_type",d);const w=A(o.store,"graph",n),t=O(w,c),g=h.has("selected")?h.get("selected"):u,x=r=>i("selected",r),m=(z=t.data)==null?void 0:z.nodes.find(r=>r.id===g);function i(r,y){const j=new URLSearchParams(o.search);y||r==="selected"?j.set(r,y):j.delete(r),r==="focus"&&j.delete("selected"),p(b(o.store,"graph",j.toString()))}return e.jsxs(e.Fragment,{children:[e.jsx(U,{eyebrow:a("graph.eyebrow"),title:a("graph.title"),description:a("graph.description")}),e.jsx(q,{meta:s,graph:!0}),e.jsxs("div",{className:"graph-toolbar",children:[e.jsxs("label",{children:[a("graph.relationship"),e.jsxs("select",{"aria-label":a("graph.relationshipAria"),value:d,onChange:r=>i("edge_type",r.target.value),children:[e.jsx("option",{value:"",children:a("graph.allRelationships")}),s.edge_types.map(r=>e.jsx("option",{value:r,children:G(r)},r))]})]}),u&&e.jsxs("button",{className:"button subtle",onClick:()=>i("focus",""),children:[e.jsx(L,{size:14}),a("graph.clearFocus")]}),e.jsx("div",{className:"graph-legend",children:s.categories.map(r=>e.jsx(N,{value:r},r))})]}),e.jsx(T,{query:t,children:r=>{var y,j,R;return e.jsx(e.Fragment,{children:(y=r.nodes)!=null&&y.length?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`graph-workspace ${m?"has-selection":""}`,children:[e.jsx(te,{data:r,selected:g,onSelect:x,focus:u}),m&&e.jsx(re,{memory:m,onClose:()=>x(""),onExpand:()=>i("focus",m.id)})]}),e.jsxs("div",{className:"results-line",children:[e.jsx("span",{children:a("graph.resultLine",{shown:r.nodes.length,total:r.total,edges:((j=r.edges)==null?void 0:j.length)||0})}),e.jsx($,{value:r.updated_at,loading:t.loading})]}),r.truncated&&e.jsx("p",{className:"notice",children:a("graph.bounded")}),e.jsxs("details",{className:"graph-list",open:!0,children:[e.jsxs("summary",{children:[a("graph.browseMemories")," ",e.jsx("span",{children:r.nodes.length})]}),e.jsx("div",{className:"graph-node-list",children:r.nodes.map(l=>e.jsxs("button",{className:g===l.id?"active":"",onClick:()=>x(l.id),"aria-pressed":g===l.id,children:[e.jsx(N,{value:l.category}),e.jsx("span",{children:M(l.content)||a("state.untitled")}),e.jsx(W,{size:14})]},l.id))})]}),!!((R=r.edges)!=null&&R.length)&&e.jsxs("details",{className:"graph-list",children:[e.jsxs("summary",{children:[a("graph.storedRelationships")," ",e.jsx("span",{children:r.edges.length})]}),e.jsx("div",{className:"relationship-list",children:r.edges.map((l,S)=>e.jsxs("div",{children:[e.jsx(k,{href:b(o.store,"memories","",l.source_id),children:l.source_id}),e.jsxs("span",{children:[" → ",l.edge_type," → "]}),e.jsx(k,{href:b(o.store,"memories","",l.target_id),children:l.target_id}),e.jsxs("small",{children:[a("graph.weight",{value:l.weight}),Object.entries(l.metadata||{}).map(([F,I])=>` · ${F}: ${I}`).join("")]})]},S))})]})]}):e.jsx(H,{title:a("graph.noConnections"),icon:"search",children:e.jsx("p",{children:a("graph.noConnectionsText")})})})}})]})}function re({memory:s,onClose:c,onExpand:o}){var n;const{route:p}=E(),a=C();return e.jsxs("aside",{className:"graph-preview",children:[e.jsxs("div",{className:"section-heading",children:[e.jsx("span",{className:"eyebrow",children:a("graph.selectedMemory")}),e.jsx("button",{className:"icon-button","aria-label":a("graph.closeSelected"),onClick:c,children:e.jsx(L,{size:17})})]}),e.jsx(N,{value:s.category}),e.jsx("h2",{children:M(s.content)||a("state.untitled")}),e.jsx("p",{children:Z(s.content)}),e.jsxs("dl",{children:[e.jsx("dt",{children:a("reader.source")}),e.jsx("dd",{children:s.source||a("state.notRecorded")})]}),e.jsxs(k,{className:"button primary",href:b(p.store,"memories",p.search,s.id),children:[a("graph.readFullMemory"),e.jsx(B,{size:15})]}),e.jsxs("button",{className:"button",onClick:o,children:[e.jsx(X,{size:15}),a("graph.expandNeighborhood")]}),!!((n=s.entities)!=null&&n.length)&&e.jsx("div",{className:"chip-list",children:s.entities.map(h=>e.jsx(k,{href:b(p.store,"library",new URLSearchParams({entity:h}).toString()),children:h},h))})]})}export{ie as GraphView,P as graphStyle}; diff --git a/web/dist/assets/GraphView-xL41QcU9.js b/web/dist/assets/GraphView-xL41QcU9.js new file mode 100644 index 000000000..6440bf8e3 --- /dev/null +++ b/web/dist/assets/GraphView-xL41QcU9.js @@ -0,0 +1,26 @@ +import{c as ue,u as He,a as je,r as F,f as Qe,s as qe,b as Ke,j as f,P as Je,F as et,h as Ge,X as Me,C as we,Q as tt,L as nt,t as ge,d as pe,e as le,E as rt,g as st,i as it,A as ot,N as at,k as lt}from"./index-u4AHOuRF.js";import{c as ct}from"./cytoscape-G6xtpWZq.js";/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ut=ue("Expand",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ht=ue("Focus",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ft=ue("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dt=ue("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.468.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gt=ue("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);function pt(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return Oe(this.cover(t,n),t,n,e)}function Oe(e,t,n,s){if(isNaN(t)||isNaN(n))return e;var r,a=e._root,u={data:s},o=e._x0,g=e._y0,l=e._x1,p=e._y1,_,w,i,b,h,c,y,v;if(!a)return e._root=u,e;for(;a.length;)if((h=t>=(_=(o+l)/2))?o=_:l=_,(c=n>=(w=(g+p)/2))?g=w:p=w,r=a,!(a=a[y=c<<1|h]))return r[y]=u,e;if(i=+e._x.call(null,a.data),b=+e._y.call(null,a.data),t===i&&n===b)return u.next=a,r?r[y]=u:e._root=u,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(h=t>=(_=(o+l)/2))?o=_:l=_,(c=n>=(w=(g+p)/2))?g=w:p=w;while((y=c<<1|h)===(v=(b>=w)<<1|i>=_));return r[v]=a,r[y]=u,e}function yt(e){Array.isArray(e)||(e=Array.from(e));const t=e.length,n=new Float64Array(t),s=new Float64Array(t);let r=1/0,a=r,u=-r,o=u;for(let g=0,l,p,_;gu&&(u=p),_o&&(o=_)}if(r>u||a>o)return this;this.cover(r,a).cover(u,o);for(let g=0;ge||e>=r||s>t||t>=a;)switch(l=(tp||(o=b.y0)>_||(g=b.x1)=y)<<1|e>=c)&&(b=w[w.length-1],w[w.length-1]=w[w.length-1-h],w[w.length-1-h]=b)}else{var v=e-+this._x.call(null,i.data),x=t-+this._y.call(null,i.data),d=v*v+x*x;if(d=(w=(u+g)/2))?u=w:g=w,(h=_>=(i=(o+l)/2))?o=i:l=i,t=n,!(n=n[c=h<<1|b]))return this;if(!n.length)break;(t[c+1&3]||t[c+2&3]||t[c+3&3])&&(s=t,y=c)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(a=n.next)&&delete n.next,r?(a?r.next=a:delete r.next,this):t?(a?t[c]=a:delete t[c],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(s?s[y]=n:this._root=n),this):(this._root=a,this)}function _t(e){for(var t=0,n=e.length;t{}};function Ve(){for(var e=0,t=arguments.length,n={},s;e=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}de.prototype=Ve.prototype={constructor:de,on:function(e,t){var n=this._,s=It(e+"",n),r,a=-1,u=s.length;if(arguments.length<2){for(;++a0)for(var n=new Array(r),s=0,r,a;s=0&&e._call.call(void 0,t),e=e._next;--ne}function Te(){ee=(xe=ce.now())+me,ne=oe=0;try{Dt()}finally{ne=0,Pt(),ee=0}}function Lt(){var e=ce.now(),t=e-xe;t>$e&&(me-=t,xe=e)}function Pt(){for(var e,t=ye,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ye=n);ae=e,_e(s)}function _e(e){if(!ne){oe&&(oe=clearTimeout(oe));var t=e-ee;t>24?(e<1/0&&(oe=setTimeout(Te,Math.ceil(e-ce.now()-me)+1)),ie&&(ie=clearInterval(ie))):(ie||(xe=ce.now(),ie=setInterval(Lt,$e)),ne=1,Ye(Te))}}function B(e){return function(){return e}}function K(e){return(e()-.5)*1e-6}function Ft(e){return e.x+e.vx}function Ht(e){return e.y+e.vy}function Gt(e){var t,n,s,r=1,a=1;typeof e!="function"&&(e=B(e==null?1:+e));function u(){for(var l,p=t.length,_,w,i,b,h,c,y=0;yw.index){var j=i-A.x-A.vx,S=b-A.y-A.vy,G=j*j+S*S;Gi+k||Cb+k||ml.r&&(l.r=l[p].r)}function g(){if(t){var l,p=t.length,_;for(n=new Array(p),l=0;l[t(E,C,u),E])),d;for(c=0,o=new Array(y);c(e=($t*e+Yt)%Se)/Se}function Wt(e){return e.x}function Xt(e){return e.y}var Ut=10,Zt=Math.PI*(3-Math.sqrt(5));function Qt(e){var t,n=1,s=.001,r=1-Math.pow(s,1/300),a=0,u=.6,o=new Map,g=We(_),l=Ve("tick","end"),p=Bt();e==null&&(e=[]);function _(){w(),l.call("tick",t),n1?(c==null?o.delete(h):o.set(h,b(c)),t):o.get(h)},find:function(h,c,y){var v=0,x=e.length,d,E,C,m,A;for(y==null?y=1/0:y*=y,v=0;v1?(l.on(h,c),t):l.on(h)}}}function qt(){var e,t,n,s,r=B(-30),a,u=1,o=1/0,g=.81;function l(i){var b,h=e.length,c=Ne(e,Wt,Xt).visitAfter(_);for(s=i,b=0;b=o)return;(i.data!==t||i.next)&&(y===0&&(y=K(n),d+=y*y),v===0&&(v=K(n),d+=v*v),d0?t:20}function De(e){var n;const t=Number((n=e.data)==null?void 0:n.weight);return Number.isFinite(t)&&t>0?t:cn}function un(e,t){const n=new Map;let s=0;const r=[];for(const u of e){if(t.has(u)){r.push(u);continue}const o=10*Math.sqrt(.5+s),g=s*2.399963229728653;n.set(u,{x:o*Math.cos(g),y:o*Math.sin(g)}),s+=1}const a=Xe+Ue*Math.sqrt(r.length);return r.forEach((u,o)=>{const g=o/Math.max(1,r.length)*Math.PI*2+Math.random()*.6,l=a*(.75+Math.random()*.5);n.set(u,{x:l*Math.cos(g),y:l*Math.sin(g)})}),n}function hn(e){const t=new Map,n=new Map,s=new Set;let r=!1,a=!1;const u=Vt([]).id(x=>x.id).distance(x=>(70+60/x.weight)*(a?.75:1)).strength(x=>{const d=Math.min(.6,.12+.3*x.weight);return a?Math.min(1,d*1.4):d}),o=Qt([]).force("charge",qt().strength(en).distanceMax(tn).theta(nn)).force("link",u).force("collide",Gt().radius(x=>x.size/2+rn).iterations(2)).force("centerX",Kt(0).strength(Ie)).force("centerY",Jt(0).strength(Ie)).velocityDecay(sn).alphaDecay(on).alphaMin(an).alpha(1).stop(),g=()=>{e.batch(()=>{for(const[x,d]of t){if(s.has(x)){const m=d.ele.position();d.sim.fx=m.x,d.sim.fy=m.y;continue}const{x:E,y:C}=d.sim;E!=null&&C!=null&&d.ele.position({x:E,y:C})}})};o.on("tick",g);let l=!1;o.on("end",()=>{l&&(l=!1,e.fit(void 0,55))});const p=()=>{l=!0},_=()=>{l=!1},w=x=>{var G,J,N,M,O,Q;const d=new Map;for(const I of x.nodes){const V=String(((G=I.data)==null?void 0:G.id)??"");V&&d.set(V,I)}const E=new Map;for(const I of x.edges){const V=String(((J=I.data)==null?void 0:J.id)??""),D=String(((N=I.data)==null?void 0:N.source)??""),H=String(((M=I.data)==null?void 0:M.target)??"");V&&d.has(D)&&d.has(H)&&E.set(V,I)}const C=new Map,m=new Map,A=(I,V)=>{C.set(I,(C.get(I)||0)+1);const D=m.get(I);D?D.push(V):m.set(I,[V])};for(const I of E.values()){const V=String((O=I.data)==null?void 0:O.source),D=String((Q=I.data)==null?void 0:Q.target);A(V,D),A(D,V)}let z={x:0,y:0},k=0;for(const I of t.values())I.sim.x!=null&&I.sim.y!=null&&(z.x+=I.sim.x,z.y+=I.sim.y,k+=1);k>0&&(z={x:z.x/k,y:z.y/k});const j=I=>{var H;if((C.get(I)||0)>0){for(const X of m.get(I)||[]){const R=(H=t.get(X))==null?void 0:H.sim;if(R&&R.x!=null&&R.y!=null)return{x:R.x+(Math.random()-.5)*40,y:R.y+(Math.random()-.5)*40}}const L=10*Math.sqrt(.5+t.size),$=Math.random()*Math.PI*2;return{x:z.x+L*Math.cos($),y:z.y+L*Math.sin($)}}const V=Xe+Math.random()*Ue*4,D=Math.random()*Math.PI*2;return{x:z.x+V*Math.cos(D),y:z.y+V*Math.sin(D)}};let S=!1;e.batch(()=>{var I,V;for(const[D,H]of t)d.has(D)||(H.ele.remove(),t.delete(D),s.delete(D),S=!0);for(const[D,H]of n)E.has(D)||(H.ele.remove(),n.delete(D),S=!0);for(const[D,H]of d){const L=H.data||{},$=t.get(D);if(!$){const R={id:D,size:Re(H)},T=j(D);R.x=T.x,R.y=T.y,t.set(D,{ele:e.add({...H,position:T}),sim:R}),S=!0;continue}const X={};for(const R of Object.keys(L))R!=="id"&&$.ele.data(R)!==L[R]&&(X[R]=L[R]);Object.keys(X).length>0&&($.ele.data(X),X.size!==void 0&&($.sim.size=Re(H)),S=!0)}for(const[D,H]of E){const L=H.data||{},$=n.get(D);if(!$){const R=(I=t.get(String(L.source)))==null?void 0:I.sim,T=(V=t.get(String(L.target)))==null?void 0:V.sim;R&&T&&(n.set(D,{ele:e.add(H),source:R,target:T,weight:De(H)}),S=!0);continue}const X={};for(const R of Object.keys(L))R!=="id"&&R!=="source"&&R!=="target"&&$.ele.data(R)!==L[R]&&(X[R]=L[R]);Object.keys(X).length>0&&($.ele.data(X),$.weight=De(H),S=!0)}}),S&&(i(),o.nodes([...t.values()].map(I=>I.sim)),o.alpha(r?ln:1).restart(),r=!0)},i=()=>{u.links([...n.values()].map(x=>({source:x.source,target:x.target,weight:x.weight})))};return{sync:w,reLayout:()=>{const x=new Map;for(const m of n.values())x.set(m.source.id,(x.get(m.source.id)||0)+1),x.set(m.target.id,(x.get(m.target.id)||0)+1);const d=[...t.keys()],E=new Set(d.filter(m=>!x.get(m))),C=un(d,E);for(const[m,A]of t){const z=C.get(m);z&&(A.sim.x=z.x,A.sim.y=z.y,A.sim.vx=0,A.sim.vy=0,A.sim.fx=null,A.sim.fy=null)}s.clear(),o.alphaTarget(0).alpha(1).restart(),g(),p()},setTightLinks:x=>{x!==a&&(a=x,i(),o.alpha(.4).restart())},settleFit:p,cancelSettleFit:_,onGrab:x=>{const d=t.get(x);if(!d)return;const E=d.ele.position();d.sim.fx=E.x,d.sim.fy=E.y,s.add(x),o.alphaTarget(ve).restart()},onDrag:x=>{const d=t.get(x);if(!d||!s.has(x))return;const E=d.ele.position();d.sim.fx=E.x,d.sim.fy=E.y,o.alphaTarget()!==ve&&o.alphaTarget(ve).restart()},onFree:x=>{t.get(x)&&(s.delete(x),!(s.size>0)&&(o.alphaTarget(0),o.alpha()o.stop()}}const Le=4,fn=4;function dn(e,t,n){let s=[],r=null,a=1e5,u;const o=()=>{var l;return(l=e.renderer)==null?void 0:l.call(e)},g=l=>{var d,E,C,m,A,z,k;let p=!1,_=l.deltaY;if(_==null){const j=l;j.wheelDeltaY!=null?_=j.wheelDeltaY/4:j.wheelDelta!=null&&(_=j.wheelDelta/4)}if(r===null)if(s.length>=fn){if(r=s.every(j=>j%5===0),!r){const j=Math.abs(s[0]);r=s.every(S=>Math.abs(S)===j)&&j>5}if(r)for(const j of s)a=Math.min(Math.abs(j),a)}else s.push(_),p=!0;else r&&(a=Math.min(Math.abs(_),a));if(!l.defaultPrevented)return;const w=(d=o())==null?void 0:d.hoverData;if(!(n.isDragging()||w!=null&&w.draggingEles||w!=null&&w.dragging)||!((E=e.panningEnabled)!=null&&E.call(e))||!((C=e.userPanningEnabled)!=null&&C.call(e))||!((m=e.zoomingEnabled)!=null&&m.call(e))||!((A=e.userZoomingEnabled)!=null&&A.call(e)))return;const i=o(),b=e.zoom();let h,c;const y=i&&i.projectIntoViewport?i.projectIntoViewport(l.clientX,l.clientY):void 0;if(y){const j=e.pan();h=y[0]*b+j.x,c=y[1]*b+j.y}else{const j=t.getBoundingClientRect();h=l.clientX-j.left,c=l.clientY-j.top}p&&Math.abs(_)>5&&(_=Math.sign(_)*5);let v=_/-250;r&&(v/=a,v*=3),v=v*n.wheelSensitivity,l.deltaMode===1&&(v*=33),e.zoom({level:b*Math.pow(10,v),renderedPosition:{x:h,y:c}}),e.emit("scrollzoom"),i!=null&&i.data&&(i.data.wheelZooming=!0,clearTimeout(u),u=setTimeout(()=>{i.data&&(i.data.wheelZooming=!1)},150));const x=i==null?void 0:i.selection;if(Array.isArray(x)&&(i!=null&&i.projectIntoViewport)){const j=i.projectIntoViewport(l.clientX,l.clientY);x[2]=j[0],x[3]=j[1];const S=(z=i.hoverData)==null?void 0:z.mdownPos;if(Array.isArray(S)){S[0]=j[0],S[1]=j[1];const G=(k=i.data)==null?void 0:k.bgActivePosistion;G&&(G.x=j[0],G.y=j[1])}}};return t.addEventListener("wheel",g,{capture:!0,passive:!0}),()=>{t.removeEventListener("wheel",g,{capture:!0}),clearTimeout(u)}}function Pe(){const e=getComputedStyle(document.documentElement),t=(n,s)=>e.getPropertyValue(n).trim()||s;return{label:t("--graph-label","#55555f"),edge:t("--graph-edge","#b8b8c2"),selected:t("--graph-selection","#202024"),outline:t("--graph-outline","#ffffff"),highlight:t("--graph-highlight","#9fc2f0")}}function Fe(e){return[{selector:"core",style:{"active-bg-color":e.highlight,"active-bg-size":6,"active-bg-opacity":.12}},{selector:"node",style:{"background-color":"data(color)",label:"data(label)",width:"data(size)",height:"data(size)","font-size":10,"font-family":"Space Grotesk, sans-serif",color:e.label,"text-valign":"bottom","text-margin-y":8,"text-max-width":"120px","text-wrap":"ellipsis","text-outline-color":e.outline,"text-outline-width":0,"underlay-color":e.highlight,"underlay-opacity":0,"underlay-padding":5,"text-opacity":0,"border-width":4,"border-color":e.outline,"border-opacity":.9,"transition-property":"text-opacity, opacity, underlay-opacity, underlay-padding, border-color, border-width, text-outline-width, color","transition-duration":200}},{selector:"node.labeled, node.hovered, node:selected, node.focus-set",style:{"text-opacity":1}},{selector:"node:selected",style:{"border-color":e.highlight,"border-width":5,"text-outline-color":e.outline,"text-outline-width":2,color:e.label}},{selector:"node.faded",style:{opacity:.35}},{selector:"node.highlight",style:{"underlay-color":e.highlight,"underlay-opacity":.45,"underlay-padding":5}},{selector:"node.hovered",style:{"border-color":e.highlight}},{selector:"edge.hover-link",style:{opacity:.8}},{selector:"edge",style:{width:"data(width)","line-color":e.edge,"target-arrow-color":e.edge,"target-arrow-shape":"triangle","curve-style":"bezier","arrow-scale":.7,opacity:"data(opacity)","transition-property":"opacity","transition-duration":200}},{selector:"edge:active",style:{"overlay-color":e.highlight,"overlay-padding":1,"overlay-opacity":.12}},{selector:"edge.faded",style:{opacity:.3}},{selector:"edge.zoom-dim",style:{opacity:.25}},{selector:"edge.selected-link",style:{opacity:.85}},{selector:"edge.inspected",style:{"line-color":e.highlight,"target-arrow-color":e.highlight,opacity:.9}},{selector:"edge.mode-hidden",style:{display:"none"}},{selector:'edge[supersedes = "yes"]',style:{"line-color":"#c19857","target-arrow-color":"#c19857","line-style":"dashed","arrow-scale":1.2,color:e.label,label:"data(label)","font-size":10,"text-opacity":0,"text-rotation":"autorotate","text-background-color":e.outline,"text-background-opacity":1,"text-background-padding":"3px"}},{selector:'edge[supersedes = "yes"].zoom-overview',style:{"arrow-scale":1.8}},{selector:'edge[supersedes = "yes"].labeled',style:{"text-opacity":1}}]}const Ze=.6;function gn(e){const t=Number.isFinite(e)&&e>0?Math.min(e,1):.2;return{width:t<.3?.8:t<.5?1.1:t<.7?1.5:t<.9?2.2:3,opacity:.35+.5*t,strong:t>=Ze?"yes":"no"}}function pn(e,t){const n=new Set(e.nodes.map(r=>r.id)),s=new Map;return{nodes:e.nodes.map(r=>({data:{id:r.id,label:ge(r.content).slice(0,36)||t,fullTitle:ge(r.content)||t,color:lt(r.category),size:20+r.importance*5,importance:r.importance}})),edges:(e.edges||[]).filter(r=>n.has(r.source_id)&&n.has(r.target_id)).map(r=>{const a=`${r.source_id}:${r.target_id}:${r.edge_type}`,u=(s.get(a)||0)+1;s.set(a,u);const o=gn(r.weight);return{selectable:!1,data:{id:u===1?a:`${a}#${u}`,source:r.source_id,target:r.target_id,label:r.edge_type,weight:r.weight,width:o.width,opacity:o.opacity,strong:o.strong,supersedes:r.edge_type==="supersedes"?"yes":"no"}}})}}function yn({data:e,selected:t,onSelect:n,focus:s,localFocus:r,localHops:a,viewMode:u,canFocus:o,onViewMode:g,locateRef:l,relationship:p,onInspectEdge:_}){const{resolved:w}=st(),i=je(),b=F.useRef(i);b.current=i;const h=F.useRef(null),c=F.useRef(null),y=F.useRef(null),v=F.useRef(n);v.current=n;const[x,d]=F.useState("auto"),[E,C]=F.useState("all"),m=()=>_(null),A=(p==null?void 0:p.id)||"",z=F.useRef(x),k=F.useRef(()=>{}),j=F.useRef(()=>{}),S=F.useRef({selected:"",focus:"",hops:2}),G=F.useRef("");F.useEffect(()=>{if(!h.current)return;const N=Pe(),M=ct({container:h.current,elements:[],layout:{name:"preset"},style:Fe(N),minZoom:.15,maxZoom:3,wheelSensitivity:Le});c.current=M;const O=hn(M);y.current=O,l.current=T=>{var q;const P=M.getElementById(T);if(!P.nonempty())return;m(),O.cancelSettleFit(),M.resize(),M.stop(!0,!1);const Z=Math.max(M.zoom(),1.4),U=P.position();M.animate({zoom:Z,pan:{x:M.width()/2-U.x*Z,y:M.height()/2-U.y*Z}},{duration:240,easing:"ease-in-out-cubic"}),(q=h.current)==null||q.scrollIntoView({behavior:"smooth",block:"center"})},M.on("tap","node",T=>{m(),v.current(T.target.id())}),M.on("tap","edge",T=>{const P=T.target;_({id:P.id(),source:String(P.source().data("fullTitle")),target:String(P.target().data("fullTitle")),type:String(P.data("label")),weight:Number(P.data("weight"))})}),M.on("tap",T=>{T.target===M&&m()});let Q=!1;M.on("grab","node",T=>O.onGrab(T.target.id())),M.on("drag","node",T=>{Q=!0,O.onDrag(T.target.id())}),M.on("free","node",T=>{Q=!1,O.onFree(T.target.id())});const I=dn(M,h.current,{wheelSensitivity:Le,isDragging:()=>Q}),V=()=>M.edges().filter(T=>T.data("supersedes")!=="yes"&&Number(T.data("weight")){const T=z.current,P=M.zoom(),Z=!!S.current.focus,U=T!=="auto"?Number.POSITIVE_INFINITY:Z?0:P<.45?5:P<.9?4:P<1.4?3:0,q=T==="auto"&&P<.8&&!Z;M.batch(()=>{for(const te of M.nodes()){const he=T==="all"||T==="auto"&&(Number(te.data("importance"))||0)>=U;te.toggleClass("labeled",he)}V().toggleClass("zoom-dim",q);const re=M.edges('[supersedes = "yes"]');re.toggleClass("zoom-overview",P<.9),re.toggleClass("labeled",T==="all"||T==="auto"&&(Z||P>=.9))})};k.current=D;let H;M.on("zoom",()=>{clearTimeout(H),H=setTimeout(D,100)}),j.current=()=>{const T=S.current,P=[],Z=fe=>{if(!fe)return null;const se=M.getElementById(fe);return se.nonempty()&&se.isNode()?se:null},U=Z(T.selected);U&&P.push(U.closedNeighborhood());const q=T.focus&&T.hops===2?Z(T.focus):null;q&&P.push(q.closedNeighborhood().closedNeighborhood());const re=M.elements(),te=P.length>0?P.reduce((fe,se)=>fe.union(se)):null,he=U??q;M.batch(()=>{re.removeClass(["faded","highlight","focus-set","selected-link"]),U==null||U.connectedEdges().addClass("selected-link"),te&&(he&&he.addClass("highlight"),te.nodes().addClass("focus-set"),re.not(te).addClass("faded"))})};let L=null;const $=()=>{if(!L||L.removed()){L=null;return}M.batch(()=>{L==null||L.removeClass("hovered"),L==null||L.connectedEdges().removeClass("hover-link")}),L=null};M.on("mouseover","node",T=>{const P=T.target;L&&L.id()!==P.id()&&$(),L=P,M.batch(()=>{P.addClass("hovered"),P.connectedEdges().addClass("hover-link")}),h.current&&(h.current.title=String(P.data("fullTitle")||""))}),M.on("mouseout","node",$);const X=()=>{O.cancelSettleFit(),M.stop(!0,!1)};M.on("scrollzoom",X),M.on("dragpan",X),M.on("drag","node",X);const R=new ResizeObserver(()=>M.resize());return R.observe(h.current),()=>{clearTimeout(H),I(),R.disconnect(),O.stop(),l.current=null,M.destroy(),c.current=null,y.current=null,k.current=()=>{},j.current=()=>{}}},[]);const J=F.useRef(!0);return F.useEffect(()=>{var N,M;(N=y.current)==null||N.sync(pn(e,b.current("state.untitled"))),m(),k.current(),J.current&&(J.current=!1,(M=y.current)==null||M.settleFit())},[e]),F.useEffect(()=>{z.current=x,k.current()},[x]),F.useEffect(()=>{const N=c.current;if(!N)return;const M=N.edges();N.batch(()=>{if(M.removeClass("mode-hidden"),E==="strong")M.filter(O=>O.data("strong")!=="yes").addClass("mode-hidden");else if(E==="selected"){const O=t?N.getElementById(t):null;O&&O.nonempty()&&O.isNode()&&M.not(O.connectedEdges()).addClass("mode-hidden")}})},[E,t,e]),F.useEffect(()=>{const N=c.current;N&&N.batch(()=>{N.edges(".inspected").removeClass("inspected"),A&&N.getElementById(A).addClass("inspected")})},[A,e]),F.useEffect(()=>{const N=c.current;if(!N)return;const M=Pe();N.style(Fe(M))},[w,e]),F.useEffect(()=>{const N=c.current;N&&(m(),N.nodes().unselect(),t&&N.getElementById(t).select(),S.current.selected=t,j.current())},[t,e]),F.useEffect(()=>{var Q,I;const N=c.current,M=!!r,O=!!G.current;G.current=r,S.current.focus=r,S.current.hops=a,(Q=y.current)==null||Q.setTightLinks(M),j.current(),k.current(),N&&M!==O&&((I=y.current)==null||I.settleFit())},[r,a,e]),f.jsxs("div",{className:"graph-frame",children:[f.jsxs("div",{className:"graph-surface",children:[f.jsx("div",{className:"graph-canvas",ref:h,role:"img","aria-label":i("graph.canvasAria")}),f.jsxs("div",{className:"graph-instructions",children:[f.jsx("span",{className:"live-dot"}),i(s?"graph.focused":"graph.full"),f.jsx("span",{children:i("graph.dragHint")})]}),f.jsxs("div",{className:"graph-controls",children:[f.jsx("button",{"aria-label":i("graph.zoomIn"),title:i("graph.zoomIn"),onClick:()=>{const N=c.current;N&&N.zoom({level:N.zoom()*1.3,renderedPosition:{x:N.width()/2,y:N.height()/2}})},children:f.jsx(dt,{size:18})}),f.jsx("button",{"aria-label":i("graph.zoomOut"),title:i("graph.zoomOut"),onClick:()=>{const N=c.current;N&&N.zoom({level:N.zoom()/1.3,renderedPosition:{x:N.width()/2,y:N.height()/2}})},children:f.jsx(ft,{size:18})}),f.jsx("button",{"aria-label":i("graph.fit"),title:i("graph.fit"),onClick:()=>{var N;return(N=c.current)==null?void 0:N.fit(void 0,55)},children:f.jsx(ut,{size:17})}),f.jsx("button",{"aria-label":i("graph.resetLayout"),title:i("graph.resetLayout"),onClick:()=>{var N;return(N=y.current)==null?void 0:N.reLayout()},children:f.jsx(gt,{size:16})})]}),f.jsxs("div",{className:"graph-modes",children:[f.jsxs("select",{"aria-label":i("graph.viewMode"),title:i("graph.viewMode"),value:u,onChange:N=>g(N.target.value),children:[f.jsx("option",{value:"global",children:i("graph.globalMode")}),f.jsx("option",{value:"focus",disabled:!o,children:i("graph.focusOneHop")}),f.jsx("option",{value:"focus2",disabled:!o,children:i("graph.focusTwoHops")})]}),f.jsxs("select",{"aria-label":i("graph.labelMode"),title:i("graph.labelMode"),value:x,onChange:N=>d(N.target.value),children:[f.jsx("option",{value:"auto",children:i("graph.labelsAuto")}),f.jsx("option",{value:"all",children:i("graph.labelsAll")}),f.jsx("option",{value:"hidden",children:i("graph.labelsHidden")})]}),f.jsxs("select",{"aria-label":i("graph.edgeMode"),title:i("graph.edgeMode"),value:E,onChange:N=>C(N.target.value),children:[f.jsx("option",{value:"all",children:i("graph.edgesAll")}),f.jsx("option",{value:"strong",children:i("graph.edgesStrong")}),f.jsx("option",{value:"selected",children:i("graph.edgesSelected")})]})]})]}),p&&f.jsxs("div",{className:"graph-relation-summary",role:"status","aria-label":i("graph.relationshipDetails"),children:[f.jsx("strong",{children:Ge(p.type)}),f.jsxs("span",{className:"graph-relation-names",title:`${p.source} → ${p.target}`,children:[p.source," → ",p.target]}),f.jsx("span",{children:i("graph.weight",{value:p.weight})}),f.jsx("button",{className:"icon-button","aria-label":i("graph.closeRelationship"),onClick:m,children:f.jsx(Me,{size:14})})]})]})}function wn({meta:e,refresh:t}){var C;const{route:n,navigate:s}=He(),r=je(),a=F.useRef(null),[u,o]=F.useState(null),g=Qe(n.search),l=new URLSearchParams(n.search),p=l.get("focus")||"",_=l.get("edge_type")||"";g.set("limit","200"),p&&g.set("focus",p),_&&g.set("edge_type",_);const w=qe(n.store,"graph",g),i=Ke(w,t),b=l.has("selected")?l.get("selected"):p,h=m=>d("selected",m),c=(C=i.data)==null?void 0:C.nodes.find(m=>m.id===b),[y,v]=F.useState(!1);F.useEffect(()=>{b||v(!1)},[b]);const x=p?"focus":y&&b?"focus2":"global";function d(m,A){const z=new URLSearchParams(n.search);A||m==="selected"?z.set(m,A):z.delete(m),m==="focus"&&z.delete("selected"),s(le(n.store,"graph",z.toString()))}const E=m=>{v(m==="focus2"),m==="focus"&&b?d("focus",b):p&&d("focus","")};return f.jsxs(f.Fragment,{children:[f.jsx(Je,{eyebrow:r("graph.eyebrow"),title:r("graph.title"),description:r("graph.description")}),f.jsx(et,{meta:e,graph:!0}),f.jsxs("div",{className:"graph-toolbar",children:[f.jsxs("label",{children:[r("graph.relationship"),f.jsxs("select",{"aria-label":r("graph.relationshipAria"),value:_,onChange:m=>d("edge_type",m.target.value),children:[f.jsx("option",{value:"",children:r("graph.allRelationships")}),e.edge_types.map(m=>f.jsx("option",{value:m,children:Ge(m)},m))]})]}),p&&f.jsxs("button",{className:"button subtle",onClick:()=>{v(!1),d("focus","")},children:[f.jsx(Me,{size:14}),r("graph.clearFocus")]}),f.jsx("div",{className:"graph-legend",children:e.categories.map(m=>f.jsx(we,{value:m},m))})]}),f.jsx(tt,{query:i,children:m=>{var A,z,k;return f.jsx(f.Fragment,{children:(A=m.nodes)!=null&&A.length?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:`graph-workspace ${c?"has-selection":""}`,children:[f.jsx(yn,{data:m,selected:b,onSelect:h,focus:p,localFocus:p||(y?b:""),localHops:p?1:2,viewMode:x,canFocus:!!b,onViewMode:E,locateRef:a,relationship:u,onInspectEdge:o}),c&&f.jsx(xn,{memory:c,onClose:()=>h(""),onExpand:()=>{v(!1),d("focus",c.id)}})]}),f.jsxs("div",{className:"results-line",children:[f.jsx("span",{children:r("graph.resultLine",{shown:m.nodes.length,total:m.total,edges:((z=m.edges)==null?void 0:z.length)||0})}),f.jsx(nt,{value:m.updated_at,loading:i.loading})]}),m.truncated&&f.jsx("p",{className:"notice",children:r("graph.bounded")}),f.jsxs("details",{className:"graph-list",open:!0,children:[f.jsxs("summary",{children:[r("graph.browseMemories")," ",f.jsx("span",{children:m.nodes.length})]}),f.jsx("div",{className:"graph-node-list",children:m.nodes.map(j=>f.jsxs("button",{className:b===j.id?"active":"",onClick:()=>{h(j.id),requestAnimationFrame(()=>{var S;return(S=a.current)==null?void 0:S.call(a,j.id)})},"aria-pressed":b===j.id,children:[f.jsx(we,{value:j.category}),f.jsx("span",{children:ge(j.content)||r("state.untitled")}),f.jsx(ht,{size:14})]},j.id))})]}),!!((k=m.edges)!=null&&k.length)&&f.jsxs("details",{className:"graph-list",children:[f.jsxs("summary",{children:[r("graph.storedRelationships")," ",f.jsx("span",{children:m.edges.length})]}),f.jsx("div",{className:"relationship-list",children:m.edges.map((j,S)=>f.jsxs("div",{children:[f.jsx(pe,{href:le(n.store,"memories","",j.source_id),children:j.source_id}),f.jsxs("span",{children:[" → ",j.edge_type," → "]}),f.jsx(pe,{href:le(n.store,"memories","",j.target_id),children:j.target_id}),f.jsxs("small",{children:[r("graph.weight",{value:j.weight}),Object.entries(j.metadata||{}).map(([G,J])=>` · ${G}: ${J}`).join("")]})]},S))})]})]}):f.jsx(rt,{title:r("graph.noConnections"),icon:"search",children:f.jsx("p",{children:r("graph.noConnectionsText")})})})}})]})}function xn({memory:e,onClose:t,onExpand:n}){var a;const{route:s}=He(),r=je();return f.jsxs("aside",{className:"graph-preview",children:[f.jsxs("div",{className:"section-heading",children:[f.jsx("span",{className:"eyebrow",children:r("graph.selectedMemory")}),f.jsx("button",{className:"icon-button","aria-label":r("graph.closeSelected"),onClick:t,children:f.jsx(Me,{size:17})})]}),f.jsx(we,{value:e.category}),f.jsx("h2",{children:ge(e.content)||r("state.untitled")}),f.jsx("p",{children:it(e.content)}),f.jsxs("dl",{children:[f.jsx("dt",{children:r("reader.source")}),f.jsx("dd",{children:e.source||r("state.notRecorded")})]}),f.jsxs(pe,{className:"button primary",href:le(s.store,"memories",s.search,e.id),children:[r("graph.readFullMemory"),f.jsx(ot,{size:15})]}),f.jsxs("button",{className:"button",onClick:n,children:[f.jsx(at,{size:15}),r("graph.expandNeighborhood")]}),!!((a=e.entities)!=null&&a.length)&&f.jsx("div",{className:"chip-list",children:e.entities.map(u=>f.jsx(pe,{href:le(s.store,"library",new URLSearchParams({entity:u}).toString()),children:u},u))})]})}export{wn as GraphView,Fe as graphStyle}; diff --git a/web/dist/assets/index-BNogta7a.css b/web/dist/assets/index-BNogta7a.css new file mode 100644 index 000000000..913abe7e4 --- /dev/null +++ b/web/dist/assets/index-BNogta7a.css @@ -0,0 +1 @@ +@font-face{font-family:Space Grotesk;font-style:normal;font-weight:300 700;font-display:swap;src:url(/fonts/space-grotesk-latin-variable.woff2) format("woff2")}:root{font-family:Space Grotesk,-apple-system,BlinkMacSystemFont,PingFang SC,Microsoft YaHei,sans-serif;color:var(--ink);background:var(--paper);color-scheme:light;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;--paper: #f7f7f8;--panel: #ffffff;--surface: #f0f0f2;--sidebar: #f0f0f2;--ink: #202024;--secondary: #505058;--muted: #686870;--line: #dcdce1;--line-strong: #a4a4ae;--hover: #e8e8ec;--accent: #26262b;--accent-hover: #414148;--accent-ink: #fafafa;--accent-soft: #e4e4e9;--focus: #585862;--focus-halo: #58586220;--shadow: #1a1a1a0a;--dialog-shadow: #1a1a1a26;--scrim: #16161866;--success: #608573;--warning-dot: #a28248;--warning-ink: #775b2c;--warning-surface: #f5f0e6;--warning-line: #ddd0b5;--graph-label: #505058;--graph-edge: #a8a8b2;--graph-selection: #26262b;--graph-outline: #f7f7f8;--graph-grid: #dcdce1;--graph-highlight: #9fc2f0}:root[data-theme=dark]{color-scheme:dark;--paper: #1a1a1a;--panel: #232325;--surface: #2b2b2f;--sidebar: #1e1e20;--ink: #eeeef0;--secondary: #cdcdd3;--muted: #a8a8b0;--line: #3a3a40;--line-strong: #73737e;--hover: #34343a;--accent: #d4d4d8;--accent-hover: #eeeef0;--accent-ink: #1a1a1a;--accent-soft: #343439;--focus: #d4d4d8;--focus-halo: #d4d4d820;--shadow: #00000026;--dialog-shadow: #00000066;--scrim: #00000099;--success: #8aaf9a;--warning-dot: #c0a16c;--warning-ink: #dfc08a;--warning-surface: #332e25;--warning-line: #62543d;--graph-label: #cdcdd3;--graph-edge: #65656f;--graph-selection: #d4d4d8;--graph-outline: #1a1a1a;--graph-grid: #353539;--graph-highlight: #5478c0}*{box-sizing:border-box}body{margin:0;min-width:320px}::selection{color:var(--accent-ink);background:var(--accent)}input::placeholder{color:var(--muted);opacity:1}select,input[type=date]{color-scheme:inherit}select option{color:var(--ink);background:var(--panel)}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer}a{color:inherit;text-decoration:none}button:disabled{cursor:wait;opacity:.55}button{color:inherit}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--focus);outline-offset:3px}input,select{min-width:0}button svg,a svg{flex-shrink:0}svg{vertical-align:middle}button{border:0;background:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);border:0;margin:-1px;white-space:nowrap}.skip-link{position:fixed;z-index:100;top:-100px;left:20px;background:var(--panel);padding:14px;border:2px solid var(--accent)}.skip-link:focus{top:10px}.app-shell{display:flex;min-height:100vh}.sidebar{width:242px;background:var(--sidebar);border-right:1px solid var(--line);position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;padding:31px 19px 19px;z-index:30}.brand{display:flex;align-items:center;font-size:27px;font-weight:650;letter-spacing:-1.2px;padding:0 12px}.brand-logo{display:block;width:38px;height:38px;flex-shrink:0;object-fit:contain;border-radius:8px;margin-right:11px}.workspace-selector{margin:36px 2px 29px}.workspace-selector>label,.nav-label{font-size:12px;font-weight:650;letter-spacing:.04em;color:var(--muted);display:block;margin:0 12px 10px}.workspace-selector>div{display:flex;gap:10px;align-items:center;border:1px solid var(--line);border-radius:7px;padding:9px 10px;background:var(--panel)}.workspace-avatar{background:var(--accent-soft);color:var(--accent);font-size:13px;font-weight:650;display:grid;place-items:center;border-radius:5px;width:27px;height:27px;flex-shrink:0}.workspace-selector select{border:0;background:transparent;flex:1;font-size:13px;font-weight:550;max-width:140px;color:var(--secondary)}.nav-label{margin-bottom:8px}.nav-link{display:flex;gap:12px;align-items:center;font-size:13px;color:var(--secondary);padding:11px 13px;margin:4px 0;border-radius:6px;transition:background .15s}.nav-link:hover{background:var(--hover)}.nav-link.active{background:var(--accent-soft);color:var(--accent);font-weight:550}.nav-active-dot{width:5px;height:5px;border-radius:50%;background:var(--accent);margin-left:auto}.sidebar-bottom{margin-top:auto;padding-top:45px}.sidebar-note{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:15px;margin:0 4px 16px}.sidebar-note>div{font-size:11px;font-weight:650;letter-spacing:1px;color:var(--muted);display:flex;align-items:center;gap:7px}.sidebar-note p{font-size:14px;line-height:1.6;color:var(--secondary);margin:11px 0}.sidebar-note>span{font-size:12px;color:var(--muted);display:flex;justify-content:space-between}.help-button{display:flex;gap:10px;align-items:center;font-size:12px;color:var(--muted);padding:10px 12px;width:100%;text-align:left}.sidebar-version{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin:15px 12px 0}.main-shell{margin-left:242px;flex:1;min-width:0;display:flex;flex-direction:column}.topbar{height:73px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 40px;gap:20px;background:var(--paper)}.breadcrumbs{display:flex;align-items:center;gap:12px;font-size:13px;min-width:0;color:var(--muted)}.breadcrumbs span{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.breadcrumbs span:last-child{color:var(--secondary)}.breadcrumbs svg{color:var(--muted)}.topbar-actions{display:flex;align-items:center;gap:17px}.theme-control{display:flex;align-items:center;flex-shrink:0}:is(label.theme-control,.theme-control>label){position:relative;display:flex;align-items:center;gap:7px;height:34px;padding-left:10px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--muted)}.theme-control select{-webkit-appearance:none;-moz-appearance:none;appearance:none;min-width:79px;height:32px;padding:0 28px 0 0;color:var(--secondary);background:transparent;border:0;border-radius:5px;font-size:12px;cursor:pointer}.select-field:after,:is(label.theme-control,.theme-control>label):after{content:"";position:absolute;right:14px;top:50%;width:6px;height:6px;border-right:1.5px solid var(--muted);border-bottom:1.5px solid var(--muted);transform:translateY(-75%) rotate(45deg);pointer-events:none}:is(label.theme-control,.theme-control>label):after{right:11px}:is(label.theme-control,.theme-control>label):focus-within{outline:2px solid var(--focus);outline-offset:3px}.theme-control select:focus-visible{outline:none}.global-search{display:flex;align-items:center;gap:8px;color:var(--muted)}.global-search input{width:125px;background:transparent;border:0;font-size:12px;padding:8px 0;color:var(--secondary)}.global-search button{color:var(--muted)}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:5px;color:var(--muted)}.icon-button:hover{background:var(--hover)}.topbar-divider{height:20px;width:1px;background:var(--line)}.local-status{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:7px;white-space:nowrap}.live-dot{width:6px;height:6px;border-radius:50%;background:var(--success);display:inline-block;flex-shrink:0}.live-dot.busy{background:var(--warning-dot);animation:pulse 1s infinite}.mobile-menu{display:none}.main-content{padding:43px 44px 35px;max-width:1510px;width:100%;margin:0 auto;flex:1}.eyebrow{font-size:11px;letter-spacing:.04em;font-weight:600;color:var(--muted);line-height:1.5}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:29px}.page-heading h1{font-weight:550;font-size:34px;letter-spacing:-1.1px;line-height:1.25;margin:11px 0 9px;color:var(--ink)}.page-heading p{font-size:13px;color:var(--muted);line-height:1.65;margin:0}.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 14px;min-height:36px;border:1px solid var(--line);border-radius:5px;background:var(--panel);font-size:12px;font-weight:500;white-space:nowrap;transition:background .15s}.button:hover{background:var(--hover)}.button.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.button.primary:hover{background:var(--accent-hover)}.button.subtle{background:transparent}.overview-banner{min-height:145px;position:relative;overflow:hidden;border:1px solid var(--line);background:var(--panel);border-radius:8px;display:flex;align-items:center;padding:26px 170px 26px 29px;gap:22px;margin-bottom:25px}.banner-mark{width:56px;height:56px;border:1px solid var(--line);border-radius:9px;display:grid;place-items:center;color:var(--muted);background:var(--surface);flex-shrink:0}.overview-banner h2{font-weight:550;font-size:23px;letter-spacing:-.5px;margin:8px 0 7px;color:var(--ink)}.overview-banner p{font-size:12px;color:var(--muted);margin:0;line-height:1.7}.overview-banner .eyebrow{color:var(--muted);font-size:10px}.banner-orbit{position:absolute;width:112px;height:112px;right:44px;top:50%;transform:translateY(-50%);color:var(--line-strong);pointer-events:none;opacity:.65}.banner-orbit:before,.banner-orbit:after{content:"";position:absolute;width:27px;height:27px;border:1px solid currentColor}.banner-orbit:before{inset:0 auto auto 0;border-right:0;border-bottom:0}.banner-orbit:after{inset:auto 0 0 auto;border-left:0;border-top:0}.banner-orbit span:first-child{position:absolute;top:38px;right:38px;bottom:38px;left:38px;border:2px solid currentColor;transform:rotate(45deg)}.banner-orbit span:not(:first-child),.banner-orbit i{display:none}.stats-row{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-bottom:31px}.stat-card{border:1px solid var(--line);background:var(--panel);border-radius:7px;padding:19px 22px}.stat-card>span{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}.stat-card svg{color:var(--muted)}.stat-card strong{display:block;font-size:31px;font-weight:500;letter-spacing:-1px;margin:12px 0 5px;color:var(--ink)}.stat-card small{font-size:12px;color:var(--muted)}.section-heading{display:flex;align-items:center;justify-content:space-between;margin:0 0 15px;gap:10px}.section-heading h2{font-size:14px;font-weight:550;letter-spacing:-.2px;margin:0;color:var(--ink)}.section-heading>a{font-size:12px;display:flex;gap:7px;align-items:center;color:var(--muted)}.section-heading>a:hover{color:var(--accent)}.category-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:32px}.category-tile{display:flex;align-items:center;gap:10px;border:1px solid var(--line);padding:14px 16px;border-radius:6px;background:var(--panel);transition:border-color .15s}.category-tile:hover{border-color:var(--line-strong)}.category-tile strong{margin-left:auto;font-size:15px;font-weight:500;color:var(--secondary)}.category-tile>svg{color:var(--muted);width:12px}.category{display:inline-flex;gap:7px;align-items:center;font-size:12px;white-space:nowrap;color:var(--secondary);line-height:1.6}.category-dot{width:6px;height:6px;display:inline-block;border-radius:50%;flex-shrink:0}.overview-columns{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(240px,1fr);gap:27px}.recent-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.memory-card{display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:7px;padding:19px 19px 15px;min-width:0;transition:box-shadow .15s,border-color .15s}.memory-card:hover{border-color:var(--line-strong);box-shadow:0 3px 12px var(--shadow)}.memory-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.importance{display:inline-flex;align-items:center;gap:2px;height:12px}.importance i{width:3px;height:7px;border-radius:1px;background:var(--surface)}.importance i.filled{background:var(--line-strong)}.memory-card h3{font-weight:550;line-height:1.55;font-size:17px;margin:14px 0 10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;color:var(--ink)}.memory-card>p{font-size:13px;line-height:1.85;color:var(--muted);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;margin:0 0 17px}.memory-card-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;color:var(--muted);margin-top:auto;padding-top:8px}.source{max-width:55%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.memory-card.compact{padding:14px 16px}.memory-card.compact h3{font-size:15px;margin:10px 0 8px;min-height:46px}.memory-card.compact .memory-card-bottom{font-size:10px}.card-entities{display:flex;gap:7px;margin-top:13px;padding-top:12px;border-top:1px solid var(--line);flex-wrap:wrap}.card-entities span{font-size:11px;color:var(--muted);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entity-panel{background:var(--panel);border:1px solid var(--line);border-radius:7px;padding:7px 16px 0}.entity-panel>a{display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--line);padding:12px 0;font-size:12px;color:var(--secondary)}.entity-panel>a>span:nth-child(2){min-width:0;overflow:hidden;text-overflow:ellipsis}.entity-panel>a:hover{color:var(--accent)}.entity-avatar{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--surface);color:var(--muted);border-radius:6px;flex-shrink:0}.entity-count{margin-left:auto;font-size:12px;color:var(--muted)}.entity-panel>a>svg{color:var(--muted)}.panel-note{display:flex;align-items:center;gap:13px;padding:17px 0;color:var(--muted)}.panel-note p{font-size:12px;line-height:1.85;color:var(--muted);margin:0}.panel-note a{font-size:12px}.view-footer{margin-top:30px;padding-top:18px;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:10px;color:var(--muted);font-size:11px}.last-updated{display:inline-flex;align-items:center;gap:7px;font-size:11px;color:var(--muted);line-height:1.6}.last-updated .live-dot{width:4px;height:4px}.app-footer{display:flex;justify-content:space-between;gap:15px;padding:18px 44px 23px;border-top:1px solid var(--line);font-size:11px;letter-spacing:.1px;color:var(--muted)}.filters{margin-bottom:20px}.select-field select,.filter-expanded input,.filter-expanded select,.graph-toolbar select{border:1px solid var(--line);background:var(--panel);border-radius:5px;padding:10px;font-size:12px;color:var(--secondary);min-height:40px;max-width:100%}.filter-main{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.select-field{display:flex;position:relative;flex:0 1 auto;height:40px;min-width:145px}.select-field select{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:40px;padding:0 34px 0 12px}.search-field{display:flex;align-items:center;gap:10px;flex:1 1 220px;height:40px;border:1px solid var(--line);border-radius:6px;background:var(--panel);padding:0 12px;min-height:40px;min-width:0;color:var(--muted)}.search-field input{flex:1;min-width:0;border:0;background:transparent;padding:0;height:38px;font-size:13px;color:var(--secondary);outline:none}.search-field:focus-within{border-color:var(--focus);box-shadow:0 0 0 2px var(--focus-halo)}.search-submit{font-size:12px;color:var(--muted);padding:6px;border-radius:3px}.search-submit:hover{background:var(--surface)}.filter-toggle{min-height:40px}.filter-toggle.selected{background:var(--accent-soft);border-color:var(--line-strong);color:var(--accent)}.count-badge{font-size:11px;background:var(--accent-soft);border-radius:4px;padding:2px 4px}.filter-expanded{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:17px;margin-top:12px}.filter-expanded label{display:flex;flex-direction:column;gap:7px;font-size:12px;color:var(--muted)}.active-filters{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:12px}.active-filters button{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--accent);border:1px solid var(--line);background:var(--accent-soft);border-radius:4px;padding:5px 8px;max-width:100%;overflow-wrap:anywhere}.active-filters .clear-filters{background:none;border:0;color:var(--muted);font-size:12px}.results-line{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:20px 0 17px;font-size:12px;color:var(--muted)}.results-line strong{color:var(--secondary);font-weight:550}.memory-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px}.pagination{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;margin:30px 0 10px}.pagination>span{font-size:12px;color:var(--muted)}.empty-state{min-height:250px;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:50px 20px;text-align:center;color:var(--muted)}.empty-icon{height:50px;width:50px;display:grid;place-items:center;background:var(--surface);color:var(--muted);border-radius:14px;margin-bottom:9px}.empty-state h2{font-size:23px;font-weight:550;color:var(--ink);margin:16px 0 3px}.empty-state p{font-size:13px;line-height:1.8;max-width:460px;margin:10px auto 18px}.empty-state a{color:var(--accent);text-decoration:underline}.loading-state{display:flex;align-items:center;flex-direction:column;gap:16px;min-height:320px;padding:70px 25px;color:var(--muted);font-size:13px}.skeleton{height:16px;background:linear-gradient(90deg,var(--surface),var(--hover),var(--surface));background-size:200%;border-radius:4px;width:min(400px,90%);animation:shimmer 1.5s infinite}.skeleton.short{width:min(280px,70%)}.spin{animation:spin 1s linear infinite}.notice{display:flex;align-items:center;gap:10px;padding:13px 16px;border-radius:6px;background:var(--surface);color:var(--muted);font-size:12px;line-height:1.8;margin:16px 0}.notice.warning{background:var(--warning-surface);color:var(--warning-ink);border:1px solid var(--warning-line)}.notice button{margin-left:auto;text-decoration:underline;font-size:12px;flex-shrink:0}.notice p{margin:5px 0}.notice .inline-link{display:flex;margin:6px 0;overflow-wrap:anywhere}.muted{color:var(--muted);font-size:13px;line-height:1.8}.small{font-size:12px}.back-link{font-size:12px;color:var(--muted);display:inline-flex;align-items:center;gap:8px;margin-bottom:34px}.back-link:hover{color:var(--accent)}.reader-layout{display:grid;grid-template-columns:minmax(0,1fr) 225px;gap:43px}.reader{min-width:0}.reader-kicker{display:flex;align-items:center;gap:14px}.reader-kicker>span:last-child{font-size:10px;letter-spacing:.04em;color:var(--muted)}.reader h1{font-size:33px;font-weight:550;line-height:1.4;letter-spacing:-.8px;color:var(--ink);overflow-wrap:anywhere;margin:18px 0}.reader-meta{display:flex;gap:17px;align-items:center;flex-wrap:wrap;font-size:12px;color:var(--muted);padding-bottom:24px;border-bottom:1px solid var(--line)}.reader-meta>span{display:flex;align-items:center;gap:6px;overflow-wrap:anywhere}.markdown{font-size:15px;line-height:1.85;color:var(--secondary);padding:24px 0;overflow-wrap:anywhere;min-width:0}.markdown p{max-width:76ch;margin:0 0 1.2em}.markdown h1,.markdown h2,.markdown h3,.markdown h4{font-weight:500;line-height:1.45;color:var(--ink);margin:1.4em 0 .6em}.markdown h1{font-size:28px}.markdown h2{font-size:24px}.markdown h3{font-size:20px}.markdown a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}.markdown blockquote{border-left:3px solid var(--line-strong);margin:20px 0;padding:8px 20px;background:var(--surface);color:var(--muted)}.markdown blockquote p:last-child{margin:0}.markdown pre{background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:18px;overflow:auto;line-height:1.7;font-size:13px}.markdown code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.8em;background:var(--surface);border-radius:3px;padding:2px 4px}.markdown pre code{padding:0;background:none;font-size:inherit}.markdown ul,.markdown ol{padding-left:25px}.markdown hr{border:0;border-top:1px solid var(--line);margin:28px 0}.markdown table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;font-size:13px}.markdown th,.markdown td{border:1px solid var(--line);padding:9px 12px;text-align:left}.markdown th{background:var(--surface)}.markdown input[type=checkbox]{accent-color:var(--accent)}.image-blocked{font-family:inherit;display:inline-block;border:1px dashed var(--line);padding:8px 12px;border-radius:4px;color:var(--muted);font-size:12px}.reader-actions{display:flex;gap:10px;padding:20px 0 30px;border-top:1px solid var(--line)}.related-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.reader-sidebar{border-left:1px solid var(--line);padding-left:24px;min-width:0}.reader-sidebar h2{font-size:12px;letter-spacing:.5px;font-weight:550;color:var(--muted);margin:0 0 17px}.reader-sidebar h2:not(:first-child){margin-top:28px}.reader-sidebar dl,.graph-preview dl{margin:0}.reader-sidebar dt,.graph-preview dt{font-size:11px;color:var(--muted);margin-bottom:6px}.reader-sidebar dd,.graph-preview dd{font-size:12px;color:var(--secondary);margin:0 0 17px;line-height:1.7;overflow-wrap:anywhere}.reader-sidebar dd .importance{margin-right:5px}.mono{font-family:ui-monospace,SFMono-Regular,monospace;font-size:10px!important;overflow-wrap:anywhere}.chip-list{display:flex;gap:6px;flex-wrap:wrap}.chip-list a{display:inline-flex;gap:4px;align-items:center;border:1px solid var(--line);background:var(--surface);border-radius:4px;padding:4px 7px;font-size:12px;color:var(--muted);max-width:100%;overflow-wrap:anywhere}.chip-list a:hover{border-color:var(--line-strong);color:var(--accent)}.reader-sidebar>.button{margin-top:27px;font-size:12px;width:100%;padding:10px 7px}.lineage{display:flex;flex-direction:column;gap:10px;overflow-wrap:anywhere}.inline-link{display:inline-flex;gap:6px;align-items:center;font-size:12px;color:var(--accent);max-width:100%;overflow-wrap:anywhere}.inline-link:hover{text-decoration:underline}.edge-details>div{font-size:12px;color:var(--muted);padding:10px 0;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:6px;overflow-wrap:anywhere}.entity-search{max-width:550px;margin-bottom:25px}.entities-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.entity-card{border:1px solid var(--line);border-radius:7px;background:var(--panel);padding:22px;min-width:0}.entity-card>.entity-avatar{width:39px;height:39px;border-radius:9px;background:var(--accent-soft);color:var(--accent)}.entity-card h2{font-size:16px;font-weight:500;color:var(--ink);overflow-wrap:anywhere;margin:15px 0 7px}.entity-card p{font-size:12px;color:var(--muted)}.entity-card>div:last-child{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);padding-top:15px;margin-top:20px}.entity-card a{font-size:12px;color:var(--accent);display:inline-flex;gap:6px;align-items:center}.activity-list{background:var(--panel);border:1px solid var(--line);border-radius:7px;padding:0 22px}.activity-item{display:flex;align-items:center;gap:17px;padding:22px 0;border-bottom:1px solid var(--line);min-width:0}.activity-item:last-child{border:0}.activity-icon{background:var(--accent-soft);color:var(--accent);width:34px;height:34px;display:grid;place-items:center;border-radius:50%;flex-shrink:0}.activity-item>div:nth-child(2){display:flex;flex-direction:column;gap:8px;min-width:0}.activity-item strong{font-weight:500;font-size:13px;color:var(--secondary);overflow-wrap:anywhere}.activity-item time{font-size:12px;color:var(--muted);margin-left:auto;text-align:right;flex-shrink:0}.unavailable{font-size:12px;color:var(--muted);overflow-wrap:anywhere}.unavailable code{font-size:11px;margin-left:7px}.graph-toolbar{display:flex;align-items:center;gap:15px;margin:12px 0 20px;flex-wrap:wrap}.graph-toolbar>label{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted)}.graph-toolbar select{min-height:34px;padding:7px}.graph-legend{display:flex;flex-wrap:wrap;gap:11px;margin-left:auto}.graph-legend .category{font-size:11px}.graph-workspace{display:grid;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--paper)}.graph-workspace.has-selection{grid-template-columns:minmax(0,1fr) 270px}.graph-surface{height:510px;position:relative;min-width:0;background-image:radial-gradient(var(--graph-grid) .7px,transparent .7px);background-size:19px 19px}.graph-canvas{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0}.graph-instructions{position:absolute;pointer-events:none;top:20px;left:20px;font-size:12px;color:var(--muted);display:flex;align-items:center;gap:7px}.graph-instructions>span:last-child{color:var(--muted);font-size:11px;margin-left:7px}.graph-frame{min-width:0}.graph-relation-summary{display:flex;flex:1;min-width:0;align-items:center;gap:8px;padding:4px 12px;border-top:1px solid var(--line);color:var(--secondary);font-size:12px}.graph-relation-names{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.graph-relation-summary>strong,.graph-relation-summary>span:last-of-type,.graph-relation-summary>button{flex-shrink:0}.graph-relation-summary>strong{font-weight:500}.graph-relation-summary>button{width:24px;height:24px}.graph-controls{position:absolute;bottom:18px;left:18px;display:flex;background:var(--panel);border:1px solid var(--line);border-radius:6px;box-shadow:0 2px 8px var(--shadow);padding:4px;gap:2px}.graph-controls button{display:grid;place-items:center;height:31px;width:33px;border-radius:4px;color:var(--muted)}.graph-modes{position:absolute;bottom:18px;right:18px;display:flex;gap:2px;background:var(--panel);border:1px solid var(--line);border-radius:6px;box-shadow:0 2px 8px var(--shadow);padding:4px}.graph-modes select{border:none;background:transparent;color:var(--secondary);font:inherit;font-size:12px;height:31px;border-radius:4px;padding:0 2px;cursor:pointer}.graph-modes select:hover{background:var(--hover);color:var(--ink)}.graph-controls button:hover{background:var(--hover)}.graph-preview{background:var(--panel);padding:20px;border-left:1px solid var(--line);min-width:0}.graph-preview h2{font-weight:550;font-size:22px;line-height:1.5;color:var(--ink);overflow-wrap:anywhere}.graph-preview>p{font-size:13px;color:var(--secondary);line-height:1.9;overflow-wrap:anywhere}.graph-preview .button{width:100%;margin:5px 0;font-size:12px}.graph-preview .chip-list{margin-top:20px}.graph-list{border:1px solid var(--line);background:var(--panel);border-radius:6px;margin:18px 0}.graph-list summary{font-size:12px;cursor:pointer;color:var(--muted);padding:15px 18px}.graph-list summary>span{font-size:11px;margin-left:8px;color:var(--muted)}.graph-node-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-top:1px solid var(--line);padding:8px;max-height:330px;overflow-y:auto}.graph-node-list button{display:flex;align-items:center;gap:10px;padding:12px;text-align:left;border-radius:4px;min-width:0;color:var(--muted)}.graph-node-list button>span:nth-child(2){font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.graph-node-list button>svg{margin-left:auto;color:var(--muted)}.graph-node-list button:hover,.graph-node-list button.active{background:var(--accent-soft)}.relationship-list{padding:0 18px 18px;font-size:12px;color:var(--muted);line-height:1.8;max-height:300px;overflow:auto}.relationship-list>div{padding:10px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}.relationship-list a{color:var(--accent)}.relationship-list small{display:block;color:var(--muted)}.dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:var(--scrim);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:100;display:grid;place-items:center;padding:20px}.about-dialog{position:relative;max-width:450px;background:var(--paper);padding:35px;border:1px solid var(--line);border-radius:12px;box-shadow:0 20px 100px var(--dialog-shadow)}.about-dialog h2{font-size:27px;font-weight:600;letter-spacing:-.7px;color:var(--ink)}.about-dialog p{font-size:13px;line-height:1.9;color:var(--muted)}.about-dialog .brand-logo{width:48px;height:48px;margin:0 0 22px}.dialog-close{position:absolute;right:15px;top:15px}.sidebar-scrim{display:none}.overview-activity{margin-top:30px}.overview-activity .activity-item{padding:15px 0}.overview-activity .activity-icon{width:29px;height:29px}.overview-activity .activity-item strong{font-size:12px}.overview-activity .activity-item time{font-size:11px}@keyframes spin{to{transform:rotate(360deg)}}@keyframes shimmer{to{background-position:-200%}}@keyframes pulse{50%{opacity:.35}}@media(min-width:1500px){.main-content{padding-top:50px}.overview-banner{min-height:165px}.overview-columns{gap:32px}.memory-card.compact{padding:18px 20px}.recent-list{gap:15px}}@media(max-width:1180px){.sidebar{width:215px;padding-left:14px;padding-right:14px}.main-shell{margin-left:215px}.main-content{padding:34px 29px}.topbar{padding:0 29px}.page-heading h1{font-size:32px}.page-heading>.button{font-size:12px}.overview-columns{grid-template-columns:minmax(0,1.4fr) minmax(220px,1fr);gap:19px}.memory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.banner-orbit{right:22px;opacity:.4}.overview-banner{padding:24px 145px 24px 24px;gap:16px}.overview-banner h2{font-size:21px}.overview-banner p{max-width:310px}.reader-layout{gap:25px;grid-template-columns:minmax(0,1fr) 195px}.reader-sidebar{padding-left:18px}.filter-main .search-field{min-width:min(260px,100%)}.graph-legend{margin-left:0}.graph-workspace.has-selection{grid-template-columns:minmax(0,1fr) 230px}.graph-instructions>span:last-child{display:none}}@media(max-width:940px){.global-search{display:none}.overview-columns{grid-template-columns:1fr}.entity-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 25px}.panel-note{grid-column:1/-1}.page-heading{align-items:flex-start}.page-heading>.button{margin-top:20px}.stats-row{gap:10px}.stat-card{padding:17px 15px}.stat-card small{font-size:11px}.reader-layout{grid-template-columns:1fr}.reader-sidebar{border-left:0;border-top:1px solid var(--line);padding:24px 0}.reader-sidebar dl{display:grid;grid-template-columns:100px 1fr;gap:7px 18px}.reader-sidebar dd{margin:0 0 5px}.reader-sidebar dt{padding-top:3px}.reader-sidebar>.button{max-width:240px}.entities-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.graph-workspace.has-selection{grid-template-columns:1fr}.graph-preview{border-left:0;border-top:1px solid var(--line)}.graph-preview h2{font-size:20px}.graph-preview .button{width:auto;margin-right:8px}.graph-node-list{grid-template-columns:1fr}.graph-surface{height:460px}.graph-preview .chip-list{margin-top:12px}.reader h1{font-size:30px}}@media(max-width:720px){.sidebar{display:none;transform:translate(-100%);width:242px;transition:transform .2s}.sidebar.open{display:flex;transform:translate(0)}.sidebar-scrim{display:block;position:fixed;top:0;right:0;bottom:0;left:0;background:var(--scrim);z-index:25}.main-shell{margin-left:0}.mobile-menu{display:inline-flex;flex-shrink:0}.topbar{height:61px;padding:0 18px;gap:10px}.breadcrumbs{gap:7px;font-size:12px;flex:1}.breadcrumbs span{max-width:105px}.topbar-actions{gap:5px}:is(label.theme-control,.theme-control>label){gap:5px;padding-left:8px}.theme-control select{min-width:72px}.topbar-divider,.local-status{display:none}.main-content{padding:30px 21px}.page-heading{gap:15px;flex-direction:column;margin-bottom:24px}.page-heading h1{font-size:32px;margin:9px 0}.page-heading p{font-size:12px}.page-heading>.button{margin-top:0;min-height:36px}.overview-banner{padding:21px 18px;gap:14px;min-height:145px}.banner-mark{width:42px;height:42px;border-radius:10px}.banner-mark svg{width:23px}.overview-banner h2{font-size:19px;max-width:220px;line-height:1.4}.overview-banner p{font-size:12px;max-width:240px}.banner-orbit{display:none}.overview-banner .eyebrow{font-size:10px}.stats-row{gap:8px;margin-bottom:27px}.stat-card{padding:14px 11px}.stat-card>span{font-size:11px;gap:5px}.stat-card>span svg{width:13px}.stat-card strong{font-size:27px;margin:10px 0 0}.stat-card small{font-size:10px;line-height:1.6;display:block;margin-top:4px}.category-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:28px}.category-tile{padding:12px}.category-tile .category{font-size:12px}.category-tile strong{font-size:13px}.category-tile>svg{display:none}.recent-list{gap:9px}.memory-card.compact{padding:12px}.memory-card.compact h3{font-size:14px}.memory-card.compact .memory-card-bottom{font-size:10px;flex-wrap:wrap}.memory-card.compact .source{max-width:100%}.memory-card.compact .importance{display:none}.entity-panel{padding:5px 13px 0;gap:0 15px}.entity-panel>a{font-size:12px;gap:7px}.entity-panel>a>svg{display:none}.section-heading h2{font-size:13px}.section-heading>a{font-size:11px}.view-footer{flex-direction:column;gap:10px}.app-footer{padding:18px 21px;font-size:10px;flex-wrap:wrap}.memory-grid{gap:12px}.memory-card{padding:15px}.memory-card h3{font-size:16px}.memory-card p{font-size:12px}.memory-card-bottom{font-size:10px}.memory-card .source{max-width:50%}.card-entities{font-size:10px}.filter-main{gap:8px}.filter-main .search-field{flex-basis:100%;min-width:0}.filter-main .select-field{flex:1 1 130px;min-width:0}.filter-toggle{font-size:12px;padding:8px 10px;min-height:40px}.filter-expanded{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:12px}.filter-expanded input,.filter-expanded select{width:100%;font-size:12px;padding:9px 7px}.results-line{align-items:flex-start;font-size:12px}.results-line .last-updated{font-size:10px;max-width:150px;text-align:right;justify-content:flex-end}.reader h1{font-size:29px}.reader-page{padding-top:23px}.back-link{margin-bottom:24px}.reader-meta{font-size:11px;gap:12px}.markdown{font-size:16px;line-height:1.95}.reader-sidebar{margin-top:15px}.related-grid{gap:9px}.reader-actions .button{font-size:12px}.activity-list{padding:0 14px}.activity-item{gap:12px;align-items:flex-start;padding:19px 0;flex-wrap:wrap}.activity-item>div:nth-child(2){flex:1;min-width:0}.activity-item time{font-size:10px;margin-left:46px;flex-basis:100%}.activity-icon{width:30px;height:30px}.entities-grid{gap:11px}.entity-card{padding:16px}.entity-card h2{font-size:14px}.entity-card a{font-size:11px}.graph-toolbar{gap:10px}.graph-toolbar>label{font-size:11px}.graph-toolbar select{font-size:12px}.graph-legend{gap:9px}.graph-legend .category{font-size:10px}.graph-surface{height:400px}.graph-instructions{font-size:11px;left:15px;top:15px}.graph-controls{left:12px;bottom:12px}.graph-preview{padding:17px}.graph-list summary{font-size:12px}.empty-state{padding:40px 10px;min-height:250px}.notice{padding:12px;font-size:12px}.about-dialog{padding:28px;max-height:90vh;overflow:auto}}@media(max-width:380px){.main-content{padding-left:15px;padding-right:15px}.memory-grid,.recent-list{grid-template-columns:1fr}.stats-row{gap:6px}.stat-card{padding:12px 8px}.stat-card>span{font-size:10px}.stat-card small{font-size:10px}.entity-panel,.entities-grid{grid-template-columns:1fr}.topbar{padding:0 12px}.breadcrumbs span{max-width:80px}.reader h1{font-size:26px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}} diff --git a/web/dist/assets/index-SOkyd8fG.css b/web/dist/assets/index-SOkyd8fG.css deleted file mode 100644 index 6777e6b76..000000000 --- a/web/dist/assets/index-SOkyd8fG.css +++ /dev/null @@ -1 +0,0 @@ -@font-face{font-family:Space Grotesk;font-style:normal;font-weight:300 700;font-display:swap;src:url(/fonts/space-grotesk-latin-variable.woff2) format("woff2")}:root{font-family:Space Grotesk,-apple-system,BlinkMacSystemFont,PingFang SC,Microsoft YaHei,sans-serif;color:var(--ink);background:var(--paper);color-scheme:light;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;--paper: #f7f7f8;--panel: #ffffff;--surface: #f0f0f2;--sidebar: #f0f0f2;--ink: #202024;--secondary: #505058;--muted: #686870;--line: #dcdce1;--line-strong: #a4a4ae;--hover: #e8e8ec;--accent: #26262b;--accent-hover: #414148;--accent-ink: #fafafa;--accent-soft: #e4e4e9;--focus: #585862;--focus-halo: #58586220;--shadow: #1a1a1a0a;--dialog-shadow: #1a1a1a26;--scrim: #16161866;--success: #608573;--warning-dot: #a28248;--warning-ink: #775b2c;--warning-surface: #f5f0e6;--warning-line: #ddd0b5;--graph-label: #505058;--graph-edge: #a8a8b2;--graph-selection: #26262b;--graph-outline: #f7f7f8;--graph-grid: #dcdce1}:root[data-theme=dark]{color-scheme:dark;--paper: #1a1a1a;--panel: #232325;--surface: #2b2b2f;--sidebar: #1e1e20;--ink: #eeeef0;--secondary: #cdcdd3;--muted: #a8a8b0;--line: #3a3a40;--line-strong: #73737e;--hover: #34343a;--accent: #d4d4d8;--accent-hover: #eeeef0;--accent-ink: #1a1a1a;--accent-soft: #343439;--focus: #d4d4d8;--focus-halo: #d4d4d820;--shadow: #00000026;--dialog-shadow: #00000066;--scrim: #00000099;--success: #8aaf9a;--warning-dot: #c0a16c;--warning-ink: #dfc08a;--warning-surface: #332e25;--warning-line: #62543d;--graph-label: #cdcdd3;--graph-edge: #65656f;--graph-selection: #d4d4d8;--graph-outline: #1a1a1a;--graph-grid: #353539}*{box-sizing:border-box}body{margin:0;min-width:320px}::selection{color:var(--accent-ink);background:var(--accent)}input::placeholder{color:var(--muted);opacity:1}select,input[type=date]{color-scheme:inherit}select option{color:var(--ink);background:var(--panel)}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer}a{color:inherit;text-decoration:none}button:disabled{cursor:wait;opacity:.55}button{color:inherit}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--focus);outline-offset:3px}input,select{min-width:0}button svg,a svg{flex-shrink:0}svg{vertical-align:middle}button{border:0;background:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);border:0;margin:-1px;white-space:nowrap}.skip-link{position:fixed;z-index:100;top:-100px;left:20px;background:var(--panel);padding:14px;border:2px solid var(--accent)}.skip-link:focus{top:10px}.app-shell{display:flex;min-height:100vh}.sidebar{width:242px;background:var(--sidebar);border-right:1px solid var(--line);position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;padding:31px 19px 19px;z-index:30}.brand{display:flex;align-items:center;font-size:27px;font-weight:650;letter-spacing:-1.2px;padding:0 12px}.brand-logo{display:block;width:38px;height:38px;flex-shrink:0;object-fit:contain;border-radius:8px;margin-right:11px}.workspace-selector{margin:36px 2px 29px}.workspace-selector>label,.nav-label{font-size:12px;font-weight:650;letter-spacing:.04em;color:var(--muted);display:block;margin:0 12px 10px}.workspace-selector>div{display:flex;gap:10px;align-items:center;border:1px solid var(--line);border-radius:7px;padding:9px 10px;background:var(--panel)}.workspace-avatar{background:var(--accent-soft);color:var(--accent);font-size:13px;font-weight:650;display:grid;place-items:center;border-radius:5px;width:27px;height:27px;flex-shrink:0}.workspace-selector select{border:0;background:transparent;flex:1;font-size:13px;font-weight:550;max-width:140px;color:var(--secondary)}.nav-label{margin-bottom:8px}.nav-link{display:flex;gap:12px;align-items:center;font-size:13px;color:var(--secondary);padding:11px 13px;margin:4px 0;border-radius:6px;transition:background .15s}.nav-link:hover{background:var(--hover)}.nav-link.active{background:var(--accent-soft);color:var(--accent);font-weight:550}.nav-active-dot{width:5px;height:5px;border-radius:50%;background:var(--accent);margin-left:auto}.sidebar-bottom{margin-top:auto;padding-top:45px}.sidebar-note{background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:15px;margin:0 4px 16px}.sidebar-note>div{font-size:11px;font-weight:650;letter-spacing:1px;color:var(--muted);display:flex;align-items:center;gap:7px}.sidebar-note p{font-size:14px;line-height:1.6;color:var(--secondary);margin:11px 0}.sidebar-note>span{font-size:12px;color:var(--muted);display:flex;justify-content:space-between}.help-button{display:flex;gap:10px;align-items:center;font-size:12px;color:var(--muted);padding:10px 12px;width:100%;text-align:left}.sidebar-version{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);margin:15px 12px 0}.main-shell{margin-left:242px;flex:1;min-width:0;display:flex;flex-direction:column}.topbar{height:73px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 40px;gap:20px;background:var(--paper)}.breadcrumbs{display:flex;align-items:center;gap:12px;font-size:13px;min-width:0;color:var(--muted)}.breadcrumbs span{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.breadcrumbs span:last-child{color:var(--secondary)}.breadcrumbs svg{color:var(--muted)}.topbar-actions{display:flex;align-items:center;gap:17px}.theme-control{display:flex;align-items:center;flex-shrink:0}:is(label.theme-control,.theme-control>label){position:relative;display:flex;align-items:center;gap:7px;height:34px;padding-left:10px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--muted)}.theme-control select{-webkit-appearance:none;-moz-appearance:none;appearance:none;min-width:79px;height:32px;padding:0 28px 0 0;color:var(--secondary);background:transparent;border:0;border-radius:5px;font-size:12px;cursor:pointer}.select-field:after,:is(label.theme-control,.theme-control>label):after{content:"";position:absolute;right:14px;top:50%;width:6px;height:6px;border-right:1.5px solid var(--muted);border-bottom:1.5px solid var(--muted);transform:translateY(-75%) rotate(45deg);pointer-events:none}:is(label.theme-control,.theme-control>label):after{right:11px}:is(label.theme-control,.theme-control>label):focus-within{outline:2px solid var(--focus);outline-offset:3px}.theme-control select:focus-visible{outline:none}.global-search{display:flex;align-items:center;gap:8px;color:var(--muted)}.global-search input{width:125px;background:transparent;border:0;font-size:12px;padding:8px 0;color:var(--secondary)}.global-search button{color:var(--muted)}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:5px;color:var(--muted)}.icon-button:hover{background:var(--hover)}.topbar-divider{height:20px;width:1px;background:var(--line)}.local-status{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:7px;white-space:nowrap}.live-dot{width:6px;height:6px;border-radius:50%;background:var(--success);display:inline-block;flex-shrink:0}.live-dot.busy{background:var(--warning-dot);animation:pulse 1s infinite}.mobile-menu{display:none}.main-content{padding:43px 44px 35px;max-width:1510px;width:100%;margin:0 auto;flex:1}.eyebrow{font-size:11px;letter-spacing:.04em;font-weight:600;color:var(--muted);line-height:1.5}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:29px}.page-heading h1{font-weight:550;font-size:34px;letter-spacing:-1.1px;line-height:1.25;margin:11px 0 9px;color:var(--ink)}.page-heading p{font-size:13px;color:var(--muted);line-height:1.65;margin:0}.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 14px;min-height:36px;border:1px solid var(--line);border-radius:5px;background:var(--panel);font-size:12px;font-weight:500;white-space:nowrap;transition:background .15s}.button:hover{background:var(--hover)}.button.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.button.primary:hover{background:var(--accent-hover)}.button.subtle{background:transparent}.overview-banner{min-height:145px;position:relative;overflow:hidden;border:1px solid var(--line);background:var(--panel);border-radius:8px;display:flex;align-items:center;padding:26px 170px 26px 29px;gap:22px;margin-bottom:25px}.banner-mark{width:56px;height:56px;border:1px solid var(--line);border-radius:9px;display:grid;place-items:center;color:var(--muted);background:var(--surface);flex-shrink:0}.overview-banner h2{font-weight:550;font-size:23px;letter-spacing:-.5px;margin:8px 0 7px;color:var(--ink)}.overview-banner p{font-size:12px;color:var(--muted);margin:0;line-height:1.7}.overview-banner .eyebrow{color:var(--muted);font-size:10px}.banner-orbit{position:absolute;width:112px;height:112px;right:44px;top:50%;transform:translateY(-50%);color:var(--line-strong);pointer-events:none;opacity:.65}.banner-orbit:before,.banner-orbit:after{content:"";position:absolute;width:27px;height:27px;border:1px solid currentColor}.banner-orbit:before{inset:0 auto auto 0;border-right:0;border-bottom:0}.banner-orbit:after{inset:auto 0 0 auto;border-left:0;border-top:0}.banner-orbit span:first-child{position:absolute;top:38px;right:38px;bottom:38px;left:38px;border:2px solid currentColor;transform:rotate(45deg)}.banner-orbit span:not(:first-child),.banner-orbit i{display:none}.stats-row{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-bottom:31px}.stat-card{border:1px solid var(--line);background:var(--panel);border-radius:7px;padding:19px 22px}.stat-card>span{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}.stat-card svg{color:var(--muted)}.stat-card strong{display:block;font-size:31px;font-weight:500;letter-spacing:-1px;margin:12px 0 5px;color:var(--ink)}.stat-card small{font-size:12px;color:var(--muted)}.section-heading{display:flex;align-items:center;justify-content:space-between;margin:0 0 15px;gap:10px}.section-heading h2{font-size:14px;font-weight:550;letter-spacing:-.2px;margin:0;color:var(--ink)}.section-heading>a{font-size:12px;display:flex;gap:7px;align-items:center;color:var(--muted)}.section-heading>a:hover{color:var(--accent)}.category-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:32px}.category-tile{display:flex;align-items:center;gap:10px;border:1px solid var(--line);padding:14px 16px;border-radius:6px;background:var(--panel);transition:border-color .15s}.category-tile:hover{border-color:var(--line-strong)}.category-tile strong{margin-left:auto;font-size:15px;font-weight:500;color:var(--secondary)}.category-tile>svg{color:var(--muted);width:12px}.category{display:inline-flex;gap:7px;align-items:center;font-size:12px;white-space:nowrap;color:var(--secondary);line-height:1.6}.category-dot{width:6px;height:6px;display:inline-block;border-radius:50%;flex-shrink:0}.overview-columns{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(240px,1fr);gap:27px}.recent-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.memory-card{display:flex;flex-direction:column;background:var(--panel);border:1px solid var(--line);border-radius:7px;padding:19px 19px 15px;min-width:0;transition:box-shadow .15s,border-color .15s}.memory-card:hover{border-color:var(--line-strong);box-shadow:0 3px 12px var(--shadow)}.memory-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.importance{display:inline-flex;align-items:center;gap:2px;height:12px}.importance i{width:3px;height:7px;border-radius:1px;background:var(--surface)}.importance i.filled{background:var(--line-strong)}.memory-card h3{font-weight:550;line-height:1.55;font-size:17px;margin:14px 0 10px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;color:var(--ink)}.memory-card>p{font-size:13px;line-height:1.85;color:var(--muted);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;margin:0 0 17px}.memory-card-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;color:var(--muted);margin-top:auto;padding-top:8px}.source{max-width:55%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.memory-card.compact{padding:14px 16px}.memory-card.compact h3{font-size:15px;margin:10px 0 8px;min-height:46px}.memory-card.compact .memory-card-bottom{font-size:10px}.card-entities{display:flex;gap:7px;margin-top:13px;padding-top:12px;border-top:1px solid var(--line);flex-wrap:wrap}.card-entities span{font-size:11px;color:var(--muted);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entity-panel{background:var(--panel);border:1px solid var(--line);border-radius:7px;padding:7px 16px 0}.entity-panel>a{display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--line);padding:12px 0;font-size:12px;color:var(--secondary)}.entity-panel>a>span:nth-child(2){min-width:0;overflow:hidden;text-overflow:ellipsis}.entity-panel>a:hover{color:var(--accent)}.entity-avatar{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:var(--surface);color:var(--muted);border-radius:6px;flex-shrink:0}.entity-count{margin-left:auto;font-size:12px;color:var(--muted)}.entity-panel>a>svg{color:var(--muted)}.panel-note{display:flex;align-items:center;gap:13px;padding:17px 0;color:var(--muted)}.panel-note p{font-size:12px;line-height:1.85;color:var(--muted);margin:0}.panel-note a{font-size:12px}.view-footer{margin-top:30px;padding-top:18px;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:10px;color:var(--muted);font-size:11px}.last-updated{display:inline-flex;align-items:center;gap:7px;font-size:11px;color:var(--muted);line-height:1.6}.last-updated .live-dot{width:4px;height:4px}.app-footer{display:flex;justify-content:space-between;gap:15px;padding:18px 44px 23px;border-top:1px solid var(--line);font-size:11px;letter-spacing:.1px;color:var(--muted)}.filters{margin-bottom:20px}.select-field select,.filter-expanded input,.filter-expanded select,.graph-toolbar select{border:1px solid var(--line);background:var(--panel);border-radius:5px;padding:10px;font-size:12px;color:var(--secondary);min-height:40px;max-width:100%}.filter-main{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.select-field{display:flex;position:relative;flex:0 1 auto;height:40px;min-width:145px}.select-field select{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:40px;padding:0 34px 0 12px}.search-field{display:flex;align-items:center;gap:10px;flex:1 1 220px;height:40px;border:1px solid var(--line);border-radius:6px;background:var(--panel);padding:0 12px;min-height:40px;min-width:0;color:var(--muted)}.search-field input{flex:1;min-width:0;border:0;background:transparent;padding:0;height:38px;font-size:13px;color:var(--secondary);outline:none}.search-field:focus-within{border-color:var(--focus);box-shadow:0 0 0 2px var(--focus-halo)}.search-submit{font-size:12px;color:var(--muted);padding:6px;border-radius:3px}.search-submit:hover{background:var(--surface)}.filter-toggle{min-height:40px}.filter-toggle.selected{background:var(--accent-soft);border-color:var(--line-strong);color:var(--accent)}.count-badge{font-size:11px;background:var(--accent-soft);border-radius:4px;padding:2px 4px}.filter-expanded{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:17px;margin-top:12px}.filter-expanded label{display:flex;flex-direction:column;gap:7px;font-size:12px;color:var(--muted)}.active-filters{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:12px}.active-filters button{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--accent);border:1px solid var(--line);background:var(--accent-soft);border-radius:4px;padding:5px 8px;max-width:100%;overflow-wrap:anywhere}.active-filters .clear-filters{background:none;border:0;color:var(--muted);font-size:12px}.results-line{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:20px 0 17px;font-size:12px;color:var(--muted)}.results-line strong{color:var(--secondary);font-weight:550}.memory-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px}.pagination{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;margin:30px 0 10px}.pagination>span{font-size:12px;color:var(--muted)}.empty-state{min-height:250px;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:50px 20px;text-align:center;color:var(--muted)}.empty-icon{height:50px;width:50px;display:grid;place-items:center;background:var(--surface);color:var(--muted);border-radius:14px;margin-bottom:9px}.empty-state h2{font-size:23px;font-weight:550;color:var(--ink);margin:16px 0 3px}.empty-state p{font-size:13px;line-height:1.8;max-width:460px;margin:10px auto 18px}.empty-state a{color:var(--accent);text-decoration:underline}.loading-state{display:flex;align-items:center;flex-direction:column;gap:16px;min-height:320px;padding:70px 25px;color:var(--muted);font-size:13px}.skeleton{height:16px;background:linear-gradient(90deg,var(--surface),var(--hover),var(--surface));background-size:200%;border-radius:4px;width:min(400px,90%);animation:shimmer 1.5s infinite}.skeleton.short{width:min(280px,70%)}.spin{animation:spin 1s linear infinite}.notice{display:flex;align-items:center;gap:10px;padding:13px 16px;border-radius:6px;background:var(--surface);color:var(--muted);font-size:12px;line-height:1.8;margin:16px 0}.notice.warning{background:var(--warning-surface);color:var(--warning-ink);border:1px solid var(--warning-line)}.notice button{margin-left:auto;text-decoration:underline;font-size:12px;flex-shrink:0}.notice p{margin:5px 0}.notice .inline-link{display:flex;margin:6px 0;overflow-wrap:anywhere}.muted{color:var(--muted);font-size:13px;line-height:1.8}.small{font-size:12px}.back-link{font-size:12px;color:var(--muted);display:inline-flex;align-items:center;gap:8px;margin-bottom:34px}.back-link:hover{color:var(--accent)}.reader-layout{display:grid;grid-template-columns:minmax(0,1fr) 225px;gap:43px}.reader{min-width:0}.reader-kicker{display:flex;align-items:center;gap:14px}.reader-kicker>span:last-child{font-size:10px;letter-spacing:.04em;color:var(--muted)}.reader h1{font-size:33px;font-weight:550;line-height:1.4;letter-spacing:-.8px;color:var(--ink);overflow-wrap:anywhere;margin:18px 0}.reader-meta{display:flex;gap:17px;align-items:center;flex-wrap:wrap;font-size:12px;color:var(--muted);padding-bottom:24px;border-bottom:1px solid var(--line)}.reader-meta>span{display:flex;align-items:center;gap:6px;overflow-wrap:anywhere}.markdown{font-size:15px;line-height:1.85;color:var(--secondary);padding:24px 0;overflow-wrap:anywhere;min-width:0}.markdown p{max-width:76ch;margin:0 0 1.2em}.markdown h1,.markdown h2,.markdown h3,.markdown h4{font-weight:500;line-height:1.45;color:var(--ink);margin:1.4em 0 .6em}.markdown h1{font-size:28px}.markdown h2{font-size:24px}.markdown h3{font-size:20px}.markdown a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}.markdown blockquote{border-left:3px solid var(--line-strong);margin:20px 0;padding:8px 20px;background:var(--surface);color:var(--muted)}.markdown blockquote p:last-child{margin:0}.markdown pre{background:var(--surface);border:1px solid var(--line);border-radius:5px;padding:18px;overflow:auto;line-height:1.7;font-size:13px}.markdown code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.8em;background:var(--surface);border-radius:3px;padding:2px 4px}.markdown pre code{padding:0;background:none;font-size:inherit}.markdown ul,.markdown ol{padding-left:25px}.markdown hr{border:0;border-top:1px solid var(--line);margin:28px 0}.markdown table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;font-size:13px}.markdown th,.markdown td{border:1px solid var(--line);padding:9px 12px;text-align:left}.markdown th{background:var(--surface)}.markdown input[type=checkbox]{accent-color:var(--accent)}.image-blocked{font-family:inherit;display:inline-block;border:1px dashed var(--line);padding:8px 12px;border-radius:4px;color:var(--muted);font-size:12px}.reader-actions{display:flex;gap:10px;padding:20px 0 30px;border-top:1px solid var(--line)}.related-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.reader-sidebar{border-left:1px solid var(--line);padding-left:24px;min-width:0}.reader-sidebar h2{font-size:12px;letter-spacing:.5px;font-weight:550;color:var(--muted);margin:0 0 17px}.reader-sidebar h2:not(:first-child){margin-top:28px}.reader-sidebar dl,.graph-preview dl{margin:0}.reader-sidebar dt,.graph-preview dt{font-size:11px;color:var(--muted);margin-bottom:6px}.reader-sidebar dd,.graph-preview dd{font-size:12px;color:var(--secondary);margin:0 0 17px;line-height:1.7;overflow-wrap:anywhere}.reader-sidebar dd .importance{margin-right:5px}.mono{font-family:ui-monospace,SFMono-Regular,monospace;font-size:10px!important;overflow-wrap:anywhere}.chip-list{display:flex;gap:6px;flex-wrap:wrap}.chip-list a{display:inline-flex;gap:4px;align-items:center;border:1px solid var(--line);background:var(--surface);border-radius:4px;padding:4px 7px;font-size:12px;color:var(--muted);max-width:100%;overflow-wrap:anywhere}.chip-list a:hover{border-color:var(--line-strong);color:var(--accent)}.reader-sidebar>.button{margin-top:27px;font-size:12px;width:100%;padding:10px 7px}.lineage{display:flex;flex-direction:column;gap:10px;overflow-wrap:anywhere}.inline-link{display:inline-flex;gap:6px;align-items:center;font-size:12px;color:var(--accent);max-width:100%;overflow-wrap:anywhere}.inline-link:hover{text-decoration:underline}.edge-details>div{font-size:12px;color:var(--muted);padding:10px 0;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:6px;overflow-wrap:anywhere}.entity-search{max-width:550px;margin-bottom:25px}.entities-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.entity-card{border:1px solid var(--line);border-radius:7px;background:var(--panel);padding:22px;min-width:0}.entity-card>.entity-avatar{width:39px;height:39px;border-radius:9px;background:var(--accent-soft);color:var(--accent)}.entity-card h2{font-size:16px;font-weight:500;color:var(--ink);overflow-wrap:anywhere;margin:15px 0 7px}.entity-card p{font-size:12px;color:var(--muted)}.entity-card>div:last-child{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);padding-top:15px;margin-top:20px}.entity-card a{font-size:12px;color:var(--accent);display:inline-flex;gap:6px;align-items:center}.activity-list{background:var(--panel);border:1px solid var(--line);border-radius:7px;padding:0 22px}.activity-item{display:flex;align-items:center;gap:17px;padding:22px 0;border-bottom:1px solid var(--line);min-width:0}.activity-item:last-child{border:0}.activity-icon{background:var(--accent-soft);color:var(--accent);width:34px;height:34px;display:grid;place-items:center;border-radius:50%;flex-shrink:0}.activity-item>div:nth-child(2){display:flex;flex-direction:column;gap:8px;min-width:0}.activity-item strong{font-weight:500;font-size:13px;color:var(--secondary);overflow-wrap:anywhere}.activity-item time{font-size:12px;color:var(--muted);margin-left:auto;text-align:right;flex-shrink:0}.unavailable{font-size:12px;color:var(--muted);overflow-wrap:anywhere}.unavailable code{font-size:11px;margin-left:7px}.graph-toolbar{display:flex;align-items:center;gap:15px;margin:12px 0 20px;flex-wrap:wrap}.graph-toolbar>label{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted)}.graph-toolbar select{min-height:34px;padding:7px}.graph-legend{display:flex;flex-wrap:wrap;gap:11px;margin-left:auto}.graph-legend .category{font-size:11px}.graph-workspace{display:grid;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--paper)}.graph-workspace.has-selection{grid-template-columns:minmax(0,1fr) 270px}.graph-surface{height:510px;position:relative;min-width:0;background-image:radial-gradient(var(--graph-grid) .7px,transparent .7px);background-size:19px 19px}.graph-canvas{width:100%;height:100%;position:absolute;top:0;right:0;bottom:0;left:0}.graph-instructions{position:absolute;pointer-events:none;top:20px;left:20px;font-size:12px;color:var(--muted);display:flex;align-items:center;gap:7px}.graph-instructions>span:last-child{color:var(--muted);font-size:11px;margin-left:7px}.graph-controls{position:absolute;bottom:18px;left:18px;display:flex;background:var(--panel);border:1px solid var(--line);border-radius:6px;box-shadow:0 2px 8px var(--shadow);padding:4px;gap:2px}.graph-controls button{display:grid;place-items:center;height:31px;width:33px;border-radius:4px;color:var(--muted)}.graph-controls button:hover{background:var(--hover)}.graph-preview{background:var(--panel);padding:20px;border-left:1px solid var(--line);min-width:0}.graph-preview h2{font-weight:550;font-size:22px;line-height:1.5;color:var(--ink);overflow-wrap:anywhere}.graph-preview>p{font-size:13px;color:var(--secondary);line-height:1.9;overflow-wrap:anywhere}.graph-preview .button{width:100%;margin:5px 0;font-size:12px}.graph-preview .chip-list{margin-top:20px}.graph-list{border:1px solid var(--line);background:var(--panel);border-radius:6px;margin:18px 0}.graph-list summary{font-size:12px;cursor:pointer;color:var(--muted);padding:15px 18px}.graph-list summary>span{font-size:11px;margin-left:8px;color:var(--muted)}.graph-node-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-top:1px solid var(--line);padding:8px;max-height:330px;overflow-y:auto}.graph-node-list button{display:flex;align-items:center;gap:10px;padding:12px;text-align:left;border-radius:4px;min-width:0;color:var(--muted)}.graph-node-list button>span:nth-child(2){font-size:12px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.graph-node-list button>svg{margin-left:auto;color:var(--muted)}.graph-node-list button:hover,.graph-node-list button.active{background:var(--accent-soft)}.relationship-list{padding:0 18px 18px;font-size:12px;color:var(--muted);line-height:1.8;max-height:300px;overflow:auto}.relationship-list>div{padding:10px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}.relationship-list a{color:var(--accent)}.relationship-list small{display:block;color:var(--muted)}.dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:var(--scrim);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:100;display:grid;place-items:center;padding:20px}.about-dialog{position:relative;max-width:450px;background:var(--paper);padding:35px;border:1px solid var(--line);border-radius:12px;box-shadow:0 20px 100px var(--dialog-shadow)}.about-dialog h2{font-size:27px;font-weight:600;letter-spacing:-.7px;color:var(--ink)}.about-dialog p{font-size:13px;line-height:1.9;color:var(--muted)}.about-dialog .brand-logo{width:48px;height:48px;margin:0 0 22px}.dialog-close{position:absolute;right:15px;top:15px}.sidebar-scrim{display:none}.overview-activity{margin-top:30px}.overview-activity .activity-item{padding:15px 0}.overview-activity .activity-icon{width:29px;height:29px}.overview-activity .activity-item strong{font-size:12px}.overview-activity .activity-item time{font-size:11px}@keyframes spin{to{transform:rotate(360deg)}}@keyframes shimmer{to{background-position:-200%}}@keyframes pulse{50%{opacity:.35}}@media(min-width:1500px){.main-content{padding-top:50px}.overview-banner{min-height:165px}.overview-columns{gap:32px}.memory-card.compact{padding:18px 20px}.recent-list{gap:15px}}@media(max-width:1180px){.sidebar{width:215px;padding-left:14px;padding-right:14px}.main-shell{margin-left:215px}.main-content{padding:34px 29px}.topbar{padding:0 29px}.page-heading h1{font-size:32px}.page-heading>.button{font-size:12px}.overview-columns{grid-template-columns:minmax(0,1.4fr) minmax(220px,1fr);gap:19px}.memory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.banner-orbit{right:22px;opacity:.4}.overview-banner{padding:24px 145px 24px 24px;gap:16px}.overview-banner h2{font-size:21px}.overview-banner p{max-width:310px}.reader-layout{gap:25px;grid-template-columns:minmax(0,1fr) 195px}.reader-sidebar{padding-left:18px}.filter-main .search-field{min-width:min(260px,100%)}.graph-legend{margin-left:0}.graph-workspace.has-selection{grid-template-columns:minmax(0,1fr) 230px}.graph-instructions>span:last-child{display:none}}@media(max-width:940px){.global-search{display:none}.overview-columns{grid-template-columns:1fr}.entity-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 25px}.panel-note{grid-column:1/-1}.page-heading{align-items:flex-start}.page-heading>.button{margin-top:20px}.stats-row{gap:10px}.stat-card{padding:17px 15px}.stat-card small{font-size:11px}.reader-layout{grid-template-columns:1fr}.reader-sidebar{border-left:0;border-top:1px solid var(--line);padding:24px 0}.reader-sidebar dl{display:grid;grid-template-columns:100px 1fr;gap:7px 18px}.reader-sidebar dd{margin:0 0 5px}.reader-sidebar dt{padding-top:3px}.reader-sidebar>.button{max-width:240px}.entities-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.graph-workspace.has-selection{grid-template-columns:1fr}.graph-preview{border-left:0;border-top:1px solid var(--line)}.graph-preview h2{font-size:20px}.graph-preview .button{width:auto;margin-right:8px}.graph-node-list{grid-template-columns:1fr}.graph-surface{height:460px}.graph-preview .chip-list{margin-top:12px}.reader h1{font-size:30px}}@media(max-width:720px){.sidebar{display:none;transform:translate(-100%);width:242px;transition:transform .2s}.sidebar.open{display:flex;transform:translate(0)}.sidebar-scrim{display:block;position:fixed;top:0;right:0;bottom:0;left:0;background:var(--scrim);z-index:25}.main-shell{margin-left:0}.mobile-menu{display:inline-flex;flex-shrink:0}.topbar{height:61px;padding:0 18px;gap:10px}.breadcrumbs{gap:7px;font-size:12px;flex:1}.breadcrumbs span{max-width:105px}.topbar-actions{gap:5px}:is(label.theme-control,.theme-control>label){gap:5px;padding-left:8px}.theme-control select{min-width:72px}.topbar-divider,.local-status{display:none}.main-content{padding:30px 21px}.page-heading{gap:15px;flex-direction:column;margin-bottom:24px}.page-heading h1{font-size:32px;margin:9px 0}.page-heading p{font-size:12px}.page-heading>.button{margin-top:0;min-height:36px}.overview-banner{padding:21px 18px;gap:14px;min-height:145px}.banner-mark{width:42px;height:42px;border-radius:10px}.banner-mark svg{width:23px}.overview-banner h2{font-size:19px;max-width:220px;line-height:1.4}.overview-banner p{font-size:12px;max-width:240px}.banner-orbit{display:none}.overview-banner .eyebrow{font-size:10px}.stats-row{gap:8px;margin-bottom:27px}.stat-card{padding:14px 11px}.stat-card>span{font-size:11px;gap:5px}.stat-card>span svg{width:13px}.stat-card strong{font-size:27px;margin:10px 0 0}.stat-card small{font-size:10px;line-height:1.6;display:block;margin-top:4px}.category-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:28px}.category-tile{padding:12px}.category-tile .category{font-size:12px}.category-tile strong{font-size:13px}.category-tile>svg{display:none}.recent-list{gap:9px}.memory-card.compact{padding:12px}.memory-card.compact h3{font-size:14px}.memory-card.compact .memory-card-bottom{font-size:10px;flex-wrap:wrap}.memory-card.compact .source{max-width:100%}.memory-card.compact .importance{display:none}.entity-panel{padding:5px 13px 0;gap:0 15px}.entity-panel>a{font-size:12px;gap:7px}.entity-panel>a>svg{display:none}.section-heading h2{font-size:13px}.section-heading>a{font-size:11px}.view-footer{flex-direction:column;gap:10px}.app-footer{padding:18px 21px;font-size:10px;flex-wrap:wrap}.memory-grid{gap:12px}.memory-card{padding:15px}.memory-card h3{font-size:16px}.memory-card p{font-size:12px}.memory-card-bottom{font-size:10px}.memory-card .source{max-width:50%}.card-entities{font-size:10px}.filter-main{gap:8px}.filter-main .search-field{flex-basis:100%;min-width:0}.filter-main .select-field{flex:1 1 130px;min-width:0}.filter-toggle{font-size:12px;padding:8px 10px;min-height:40px}.filter-expanded{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:12px}.filter-expanded input,.filter-expanded select{width:100%;font-size:12px;padding:9px 7px}.results-line{align-items:flex-start;font-size:12px}.results-line .last-updated{font-size:10px;max-width:150px;text-align:right;justify-content:flex-end}.reader h1{font-size:29px}.reader-page{padding-top:23px}.back-link{margin-bottom:24px}.reader-meta{font-size:11px;gap:12px}.markdown{font-size:16px;line-height:1.95}.reader-sidebar{margin-top:15px}.related-grid{gap:9px}.reader-actions .button{font-size:12px}.activity-list{padding:0 14px}.activity-item{gap:12px;align-items:flex-start;padding:19px 0;flex-wrap:wrap}.activity-item>div:nth-child(2){flex:1;min-width:0}.activity-item time{font-size:10px;margin-left:46px;flex-basis:100%}.activity-icon{width:30px;height:30px}.entities-grid{gap:11px}.entity-card{padding:16px}.entity-card h2{font-size:14px}.entity-card a{font-size:11px}.graph-toolbar{gap:10px}.graph-toolbar>label{font-size:11px}.graph-toolbar select{font-size:12px}.graph-legend{gap:9px}.graph-legend .category{font-size:10px}.graph-surface{height:400px}.graph-instructions{font-size:11px;left:15px;top:15px}.graph-controls{left:12px;bottom:12px}.graph-preview{padding:17px}.graph-list summary{font-size:12px}.empty-state{padding:40px 10px;min-height:250px}.notice{padding:12px;font-size:12px}.about-dialog{padding:28px;max-height:90vh;overflow:auto}}@media(max-width:380px){.main-content{padding-left:15px;padding-right:15px}.memory-grid,.recent-list{grid-template-columns:1fr}.stats-row{gap:6px}.stat-card{padding:12px 8px}.stat-card>span{font-size:10px}.stat-card small{font-size:10px}.entity-panel,.entities-grid{grid-template-columns:1fr}.topbar{padding:0 12px}.breadcrumbs span{max-width:80px}.reader h1{font-size:26px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}} diff --git a/web/dist/assets/index-DZRLQ9ap.js b/web/dist/assets/index-u4AHOuRF.js similarity index 89% rename from web/dist/assets/index-DZRLQ9ap.js rename to web/dist/assets/index-u4AHOuRF.js index f25ff16fa..ac183a930 100644 --- a/web/dist/assets/index-DZRLQ9ap.js +++ b/web/dist/assets/index-u4AHOuRF.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphView-LqJspvLW.js","assets/cytoscape-G6xtpWZq.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphView-xL41QcU9.js","assets/cytoscape-G6xtpWZq.js"])))=>i.map(i=>d[i]); (function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))u(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&u(f)}).observe(document,{childList:!0,subtree:!0});function a(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function u(s){if(s.ep)return;s.ep=!0;const c=a(s);fetch(s.href,c)}})();function qm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Os={exports:{}},ka={};/** * @license React * react-jsx-runtime.production.js @@ -15,7 +15,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphView-LqJsp * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Bp;function dv(){if(Bp)return ye;Bp=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.iterator;function w(x){return x===null||typeof x!="object"?null:(x=y&&x[y]||x["@@iterator"],typeof x=="function"?x:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,q={};function j(x,X,P){this.props=x,this.context=X,this.refs=q,this.updater=P||k}j.prototype.isReactComponent={},j.prototype.setState=function(x,X){if(typeof x!="object"&&typeof x!="function"&&x!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,x,X,"setState")},j.prototype.forceUpdate=function(x){this.updater.enqueueForceUpdate(this,x,"forceUpdate")};function D(){}D.prototype=j.prototype;function B(x,X,P){this.props=x,this.context=X,this.refs=q,this.updater=P||k}var V=B.prototype=new D;V.constructor=B,z(V,j.prototype),V.isPureReactComponent=!0;var ue=Array.isArray,Z={H:null,A:null,T:null,S:null,V:null},H=Object.prototype.hasOwnProperty;function ee(x,X,P,E,ne,ve){return P=ve.ref,{$$typeof:n,type:x,key:X,ref:P!==void 0?P:null,props:ve}}function se(x,X){return ee(x.type,X,void 0,void 0,void 0,x.props)}function Ae(x){return typeof x=="object"&&x!==null&&x.$$typeof===n}function U(x){var X={"=":"=0",":":"=2"};return"$"+x.replace(/[=:]/g,function(P){return X[P]})}var $=/\/+/g;function W(x,X){return typeof x=="object"&&x!==null&&x.key!=null?U(""+x.key):X.toString(36)}function Se(){}function ae(x){switch(x.status){case"fulfilled":return x.value;case"rejected":throw x.reason;default:switch(typeof x.status=="string"?x.then(Se,Se):(x.status="pending",x.then(function(X){x.status==="pending"&&(x.status="fulfilled",x.value=X)},function(X){x.status==="pending"&&(x.status="rejected",x.reason=X)})),x.status){case"fulfilled":return x.value;case"rejected":throw x.reason}}throw x}function I(x,X,P,E,ne){var ve=typeof x;(ve==="undefined"||ve==="boolean")&&(x=null);var le=!1;if(x===null)le=!0;else switch(ve){case"bigint":case"string":case"number":le=!0;break;case"object":switch(x.$$typeof){case n:case r:le=!0;break;case g:return le=x._init,I(le(x._payload),X,P,E,ne)}}if(le)return ne=ne(x),le=E===""?"."+W(x,0):E,ue(ne)?(P="",le!=null&&(P=le.replace($,"$&/")+"/"),I(ne,X,P,"",function(bt){return bt})):ne!=null&&(Ae(ne)&&(ne=se(ne,P+(ne.key==null||x&&x.key===ne.key?"":(""+ne.key).replace($,"$&/")+"/")+le)),X.push(ne)),1;le=0;var We=E===""?".":E+":";if(ue(x))for(var Ce=0;Ce>>1,x=O[we];if(0>>1;wes(E,ie))nes(ve,E)?(O[we]=ve,O[ne]=ie,we=ne):(O[we]=E,O[P]=ie,we=P);else if(nes(ve,ie))O[we]=ve,O[ne]=ie,we=ne;else break e}}return J}function s(O,J){var ie=O.sortIndex-J.sortIndex;return ie!==0?ie:O.id-J.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var m=[],d=[],g=1,y=null,w=3,k=!1,z=!1,q=!1,j=!1,D=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function ue(O){for(var J=a(d);J!==null;){if(J.callback===null)u(d);else if(J.startTime<=O)u(d),J.sortIndex=J.expirationTime,r(m,J);else break;J=a(d)}}function Z(O){if(q=!1,ue(O),!z)if(a(m)!==null)z=!0,H||(H=!0,W());else{var J=a(d);J!==null&&I(Z,J.startTime-O)}}var H=!1,ee=-1,se=5,Ae=-1;function U(){return j?!0:!(n.unstable_now()-AeO&&U());){var we=y.callback;if(typeof we=="function"){y.callback=null,w=y.priorityLevel;var x=we(y.expirationTime<=O);if(O=n.unstable_now(),typeof x=="function"){y.callback=x,ue(O),J=!0;break t}y===a(m)&&u(m),ue(O)}else u(m);y=a(m)}if(y!==null)J=!0;else{var X=a(d);X!==null&&I(Z,X.startTime-O),J=!1}}break e}finally{y=null,w=ie,k=!1}J=void 0}}finally{J?W():H=!1}}}var W;if(typeof V=="function")W=function(){V($)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,ae=Se.port2;Se.port1.onmessage=$,W=function(){ae.postMessage(null)}}else W=function(){D($,0)};function I(O,J){ee=D(function(){O(n.unstable_now())},J)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125we?(O.sortIndex=ie,r(d,O),a(m)===null&&O===a(d)&&(q?(B(ee),ee=-1):q=!0,I(Z,ie-we))):(O.sortIndex=x,r(m,O),z||k||(z=!0,H||(H=!0,W()))),O},n.unstable_shouldYield=U,n.unstable_wrapCallback=function(O){var J=w;return function(){var ie=w;w=J;try{return O.apply(this,arguments)}finally{w=ie}}}})(Bs)),Bs}var Yp;function mv(){return Yp||(Yp=1,Us.exports=pv()),Us.exports}var Hs={exports:{}},mt={};/** + */var qp;function pv(){return qp||(qp=1,(function(n){function r(O,J){var ie=O.length;O.push(J);e:for(;0>>1,x=O[we];if(0>>1;wes(E,ie))nes(ve,E)?(O[we]=ve,O[ne]=ie,we=ne):(O[we]=E,O[P]=ie,we=P);else if(nes(ve,ie))O[we]=ve,O[ne]=ie,we=ne;else break e}}return J}function s(O,J){var ie=O.sortIndex-J.sortIndex;return ie!==0?ie:O.id-J.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var m=[],d=[],g=1,y=null,w=3,k=!1,z=!1,q=!1,j=!1,_=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function ue(O){for(var J=a(d);J!==null;){if(J.callback===null)u(d);else if(J.startTime<=O)u(d),J.sortIndex=J.expirationTime,r(m,J);else break;J=a(d)}}function Z(O){if(q=!1,ue(O),!z)if(a(m)!==null)z=!0,H||(H=!0,W());else{var J=a(d);J!==null&&I(Z,J.startTime-O)}}var H=!1,ee=-1,se=5,Ae=-1;function U(){return j?!0:!(n.unstable_now()-AeO&&U());){var we=y.callback;if(typeof we=="function"){y.callback=null,w=y.priorityLevel;var x=we(y.expirationTime<=O);if(O=n.unstable_now(),typeof x=="function"){y.callback=x,ue(O),J=!0;break t}y===a(m)&&u(m),ue(O)}else u(m);y=a(m)}if(y!==null)J=!0;else{var X=a(d);X!==null&&I(Z,X.startTime-O),J=!1}}break e}finally{y=null,w=ie,k=!1}J=void 0}}finally{J?W():H=!1}}}var W;if(typeof V=="function")W=function(){V($)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,ae=Se.port2;Se.port1.onmessage=$,W=function(){ae.postMessage(null)}}else W=function(){_($,0)};function I(O,J){ee=_(function(){O(n.unstable_now())},J)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(O){O.callback=null},n.unstable_forceFrameRate=function(O){0>O||125we?(O.sortIndex=ie,r(d,O),a(m)===null&&O===a(d)&&(q?(B(ee),ee=-1):q=!0,I(Z,ie-we))):(O.sortIndex=x,r(m,O),z||k||(z=!0,H||(H=!0,W()))),O},n.unstable_shouldYield=U,n.unstable_wrapCallback=function(O){var J=w;return function(){var ie=w;w=J;try{return O.apply(this,arguments)}finally{w=ie}}}})(Bs)),Bs}var Yp;function mv(){return Yp||(Yp=1,Us.exports=pv()),Us.exports}var Hs={exports:{}},mt={};/** * @license React * react-dom.production.js * @@ -39,15 +39,15 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GraphView-LqJsp * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Xp;function vv(){if(Xp)return wa;Xp=1;var n=mv(),r=wc(),a=yv();function u(e){var t="https://react.dev/errors/"+e;if(1x||(e.current=we[x],we[x]=null,x--)}function E(e,t){x++,we[x]=e.current,e.current=t}var ne=X(null),ve=X(null),le=X(null),We=X(null);function Ce(e,t){switch(E(le,t),E(ve,e),E(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cp(t),e=fp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(ne),E(ne,e)}function bt(){P(ne),P(ve),P(le)}function an(e){e.memoizedState!==null&&E(We,e);var t=ne.current,l=fp(t,e.type);t!==l&&(E(ve,e),E(ne,l))}function Rn(e){ve.current===e&&(P(ne),P(ve)),We.current===e&&(P(We),ya._currentValue=ie)}var Ol=Object.prototype.hasOwnProperty,Ti=n.unstable_scheduleCallback,Ai=n.unstable_cancelCallback,bu=n.unstable_shouldYield,Ba=n.unstable_requestPaint,_t=n.unstable_now,Ha=n.unstable_getCurrentPriorityLevel,qa=n.unstable_ImmediatePriority,zi=n.unstable_UserBlockingPriority,rl=n.unstable_NormalPriority,xu=n.unstable_LowPriority,Ya=n.unstable_IdlePriority,Su=n.log,ku=n.unstable_setDisableYieldValue,ul=null,L=null;function K(e){if(typeof Su=="function"&&ku(e),L&&typeof L.setStrictMode=="function")try{L.setStrictMode(ul,e)}catch{}}var re=Math.clz32?Math.clz32:Ue,ge=Math.log,ft=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(ge(e)/ft|0)|0}var et=256,xt=4194304;function Dt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rn(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var o=0,h=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var S=i&134217727;return S!==0?(i=S&~h,i!==0?o=Dt(i):(b&=S,b!==0?o=Dt(b):l||(l=S&~e,l!==0&&(o=Dt(l))))):(S=i&~h,S!==0?o=Dt(S):b!==0?o=Dt(b):l||(l=i&~e,l!==0&&(o=Dt(l)))),o===0?0:t!==0&&t!==o&&(t&h)===0&&(h=o&-o,l=t&-t,h>=l||h===32&&(l&4194048)!==0)?t:o}function $t(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Va(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Nl(){var e=et;return et<<=1,(et&4194048)===0&&(et=256),e}function ht(){var e=xt;return xt<<=1,(xt&62914560)===0&&(xt=4194304),e}function un(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function St(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Wg(e,t,l,i,o,h){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var S=e.entanglements,T=e.expirationTimes,_=e.hiddenUpdates;for(l=b&~l;0x||(e.current=we[x],we[x]=null,x--)}function E(e,t){x++,we[x]=e.current,e.current=t}var ne=X(null),ve=X(null),le=X(null),We=X(null);function Ce(e,t){switch(E(le,t),E(ve,e),E(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cp(t),e=fp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(ne),E(ne,e)}function bt(){P(ne),P(ve),P(le)}function an(e){e.memoizedState!==null&&E(We,e);var t=ne.current,l=fp(t,e.type);t!==l&&(E(ve,e),E(ne,l))}function Rn(e){ve.current===e&&(P(ne),P(ve)),We.current===e&&(P(We),ya._currentValue=ie)}var Ol=Object.prototype.hasOwnProperty,Ti=n.unstable_scheduleCallback,Ai=n.unstable_cancelCallback,bu=n.unstable_shouldYield,Ba=n.unstable_requestPaint,Dt=n.unstable_now,Ha=n.unstable_getCurrentPriorityLevel,qa=n.unstable_ImmediatePriority,zi=n.unstable_UserBlockingPriority,rl=n.unstable_NormalPriority,xu=n.unstable_LowPriority,Ya=n.unstable_IdlePriority,Su=n.log,ku=n.unstable_setDisableYieldValue,ul=null,L=null;function K(e){if(typeof Su=="function"&&ku(e),L&&typeof L.setStrictMode=="function")try{L.setStrictMode(ul,e)}catch{}}var re=Math.clz32?Math.clz32:Ue,ge=Math.log,ft=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(ge(e)/ft|0)|0}var et=256,xt=4194304;function _t(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function rn(e,t,l){var i=e.pendingLanes;if(i===0)return 0;var o=0,h=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var S=i&134217727;return S!==0?(i=S&~h,i!==0?o=_t(i):(b&=S,b!==0?o=_t(b):l||(l=S&~e,l!==0&&(o=_t(l))))):(S=i&~h,S!==0?o=_t(S):b!==0?o=_t(b):l||(l=i&~e,l!==0&&(o=_t(l)))),o===0?0:t!==0&&t!==o&&(t&h)===0&&(h=o&-o,l=t&-t,h>=l||h===32&&(l&4194048)!==0)?t:o}function $t(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Va(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Nl(){var e=et;return et<<=1,(et&4194048)===0&&(et=256),e}function ht(){var e=xt;return xt<<=1,(xt&62914560)===0&&(xt=4194304),e}function un(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function St(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Wg(e,t,l,i,o,h){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var S=e.entanglements,T=e.expirationTimes,D=e.hiddenUpdates;for(l=b&~l;0)":-1o||T[i]!==_[o]){var Y=` +`),D=S.split(` +`);for(o=i=0;io||T[i]!==D[o]){var Y=` `+T[i].replace(" at new "," at ");return e.displayName&&Y.includes("")&&(Y=Y.replace("",e.displayName)),Y}while(1<=i&&0<=o);break}}}finally{Cu=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Yl(l):""}function ay(e){switch(e.tag){case 26:case 27:case 5:return Yl(e.type);case 16:return Yl("Lazy");case 13:return Yl("Suspense");case 19:return Yl("SuspenseList");case 0:case 15:return ju(e.type,!1);case 11:return ju(e.type.render,!1);case 1:return ju(e.type,!0);case 31:return Yl("Activity");default:return""}}function lf(e){try{var t="";do t+=ay(e),e=e.return;while(e);return t}catch(l){return` Error generating stack: `+l.message+` -`+l.stack}}function Yt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function af(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ry(e){var t=af(e)?"checked":"value",l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var o=l.get,h=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(b){i=""+b,h.call(this,b)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(b){i=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qa(e){e._valueTracker||(e._valueTracker=ry(e))}function rf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),i="";return e&&(i=af(e)?e.checked?"true":"false":e.value),e=i,e!==l?(t.setValue(e),!0):!1}function Za(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var uy=/[\n"\\]/g;function Vt(e){return e.replace(uy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Mu(e,t,l,i,o,h,b,S){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Yt(t)):e.value!==""+Yt(t)&&(e.value=""+Yt(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?_u(e,b,Yt(t)):l!=null?_u(e,b,Yt(l)):i!=null&&e.removeAttribute("value"),o==null&&h!=null&&(e.defaultChecked=!!h),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+Yt(S):e.removeAttribute("name")}function uf(e,t,l,i,o,h,b,S){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||l!=null){if(!(h!=="submit"&&h!=="reset"||t!=null))return;l=l!=null?""+Yt(l):"",t=t!=null?""+Yt(t):l,S||t===e.value||(e.value=t),e.defaultValue=t}i=i??o,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=S?e.checked:!!i,e.defaultChecked=!!i,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b)}function _u(e,t,l){t==="number"&&Za(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function Vl(e,t,l,i){if(e=e.options,t){t={};for(var o=0;o"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lu=!1;if(gn)try{var _i={};Object.defineProperty(_i,"passive",{get:function(){Lu=!0}}),window.addEventListener("test",_i,_i),window.removeEventListener("test",_i,_i)}catch{Lu=!1}var Nn=null,Uu=null,Fa=null;function pf(){if(Fa)return Fa;var e,t=Uu,l=t.length,i,o="value"in Nn?Nn.value:Nn.textContent,h=o.length;for(e=0;e=Oi),xf=" ",Sf=!1;function kf(e,t){switch(e){case"keyup":return Ny.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zl=!1;function Uy(e,t){switch(e){case"compositionend":return wf(t);case"keypress":return t.which!==32?null:(Sf=!0,xf);case"textInput":return e=t.data,e===xf&&Sf?null:e;default:return null}}function By(e,t){if(Zl)return e==="compositionend"||!Vu&&kf(e,t)?(e=pf(),Fa=Uu=Nn=null,Zl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:l,offset:t-e};e=i}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=_f(l)}}function Rf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Of(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Za(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Za(e.document)}return t}function Qu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Zy=gn&&"documentMode"in document&&11>=document.documentMode,Kl=null,Zu=null,Bi=null,Ku=!1;function Nf(e,t,l){var i=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ku||Kl==null||Kl!==Za(i)||(i=Kl,"selectionStart"in i&&Qu(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Bi&&Ui(Bi,i)||(Bi=i,i=Br(Zu,"onSelect"),0>=b,o-=b,vn=1<<32-re(t)+o|l<h?h:8;var b=O.T,S={};O.T=S,Ro(e,!1,t,l);try{var T=o(),_=O.S;if(_!==null&&_(S,T),T!==null&&typeof T=="object"&&typeof T.then=="function"){var Y=t1(T,i);Wi(e,t,Y,Bt(e))}else Wi(e,t,i,Bt(e))}catch(Q){Wi(e,t,{then:function(){},status:"rejected",reason:Q},Bt())}finally{J.p=h,O.T=b}}function r1(){}function _o(e,t,l,i){if(e.tag!==5)throw Error(u(476));var o=Lh(e).queue;Nh(e,o,t,ie,l===null?r1:function(){return Uh(e),l(i)})}function Lh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:ie},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Uh(e){var t=Lh(e).next.queue;Wi(e,t,{},Bt())}function Do(){return pt(ya)}function Bh(){return $e().memoizedState}function Hh(){return $e().memoizedState}function u1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=Bt();e=Bn(l);var i=Hn(t,e,l);i!==null&&(Ht(i,t,l),Ki(i,t,l)),t={cache:uo()},e.payload=t;return}t=t.return}}function o1(e,t,l){var i=Bt();l={lane:i,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null},vr(e)?Yh(t,l):(l=$u(e,t,l,i),l!==null&&(Ht(l,e,i),Vh(l,t,i)))}function qh(e,t,l){var i=Bt();Wi(e,t,l,i)}function Wi(e,t,l,i){var o={lane:i,revertLane:0,action:l,hasEagerState:!1,eagerState:null,next:null};if(vr(e))Yh(t,o);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var b=t.lastRenderedState,S=h(b,l);if(o.hasEagerState=!0,o.eagerState=S,Rt(S,b))return tr(e,t,o,0),Ve===null&&er(),!1}catch{}finally{}if(l=$u(e,t,o,i),l!==null)return Ht(l,e,i),Vh(l,t,i),!0}return!1}function Ro(e,t,l,i){if(i={lane:2,revertLane:fs(),action:i,hasEagerState:!1,eagerState:null,next:null},vr(e)){if(t)throw Error(u(479))}else t=$u(e,l,i,2),t!==null&&Ht(t,e,2)}function vr(e){var t=e.alternate;return e===be||t!==null&&t===be}function Yh(e,t){li=hr=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Vh(e,t,l){if((l&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,l|=i,t.lanes=l,Jc(e,l)}}var br={readContext:pt,use:pr,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useLayoutEffect:Fe,useInsertionEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useSyncExternalStore:Fe,useId:Fe,useHostTransitionStatus:Fe,useFormState:Fe,useActionState:Fe,useOptimistic:Fe,useMemoCache:Fe,useCacheRefresh:Fe},Gh={readContext:pt,use:pr,useCallback:function(e,t){return At().memoizedState=[e,t===void 0?null:t],e},useContext:pt,useEffect:Ah,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,yr(4194308,4,Mh.bind(null,t,e),l)},useLayoutEffect:function(e,t){return yr(4194308,4,e,t)},useInsertionEffect:function(e,t){yr(4,2,e,t)},useMemo:function(e,t){var l=At();t=t===void 0?null:t;var i=e();if(xl){K(!0);try{e()}finally{K(!1)}}return l.memoizedState=[i,t],i},useReducer:function(e,t,l){var i=At();if(l!==void 0){var o=l(t);if(xl){K(!0);try{l(t)}finally{K(!1)}}}else o=t;return i.memoizedState=i.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},i.queue=e,e=e.dispatch=o1.bind(null,be,e),[i.memoizedState,e]},useRef:function(e){var t=At();return e={current:e},t.memoizedState=e},useState:function(e){e=zo(e);var t=e.queue,l=qh.bind(null,be,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:jo,useDeferredValue:function(e,t){var l=At();return Mo(l,e,t)},useTransition:function(){var e=zo(!1);return e=Nh.bind(null,be,e.queue,!0,!1),At().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var i=be,o=At();if(_e){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Ve===null)throw Error(u(349));(ze&124)!==0||ch(i,t,l)}o.memoizedState=l;var h={value:l,getSnapshot:t};return o.queue=h,Ah(hh.bind(null,i,h,e),[e]),i.flags|=2048,ai(9,gr(),fh.bind(null,i,h,l,t),null),l},useId:function(){var e=At(),t=Ve.identifierPrefix;if(_e){var l=bn,i=vn;l=(i&~(1<<32-re(i)-1)).toString(32)+l,t="«"+t+"R"+l,l=dr++,0he?(rt=oe,oe=null):rt=oe.sibling;var je=R(C,oe,M[he],G);if(je===null){oe===null&&(oe=rt);break}e&&oe&&je.alternate===null&&t(C,oe),A=h(je,A,he),ke===null?te=je:ke.sibling=je,ke=je,oe=rt}if(he===M.length)return l(C,oe),_e&&pl(C,he),te;if(oe===null){for(;hehe?(rt=oe,oe=null):rt=oe.sibling;var nl=R(C,oe,je.value,G);if(nl===null){oe===null&&(oe=rt);break}e&&oe&&nl.alternate===null&&t(C,oe),A=h(nl,A,he),ke===null?te=nl:ke.sibling=nl,ke=nl,oe=rt}if(je.done)return l(C,oe),_e&&pl(C,he),te;if(oe===null){for(;!je.done;he++,je=M.next())je=Q(C,je.value,G),je!==null&&(A=h(je,A,he),ke===null?te=je:ke.sibling=je,ke=je);return _e&&pl(C,he),te}for(oe=i(oe);!je.done;he++,je=M.next())je=N(oe,C,he,je.value,G),je!==null&&(e&&je.alternate!==null&&oe.delete(je.key===null?he:je.key),A=h(je,A,he),ke===null?te=je:ke.sibling=je,ke=je);return e&&oe.forEach(function(cv){return t(C,cv)}),_e&&pl(C,he),te}function Le(C,A,M,G){if(typeof M=="object"&&M!==null&&M.type===z&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case w:e:{for(var te=M.key;A!==null;){if(A.key===te){if(te=M.type,te===z){if(A.tag===7){l(C,A.sibling),G=o(A,M.props.children),G.return=C,C=G;break e}}else if(A.elementType===te||typeof te=="object"&&te!==null&&te.$$typeof===se&&Qh(te)===A.type){l(C,A.sibling),G=o(A,M.props),ta(G,M),G.return=C,C=G;break e}l(C,A);break}else t(C,A);A=A.sibling}M.type===z?(G=hl(M.props.children,C.mode,G,M.key),G.return=C,C=G):(G=lr(M.type,M.key,M.props,null,C.mode,G),ta(G,M),G.return=C,C=G)}return b(C);case k:e:{for(te=M.key;A!==null;){if(A.key===te)if(A.tag===4&&A.stateNode.containerInfo===M.containerInfo&&A.stateNode.implementation===M.implementation){l(C,A.sibling),G=o(A,M.children||[]),G.return=C,C=G;break e}else{l(C,A);break}else t(C,A);A=A.sibling}G=eo(M,C.mode,G),G.return=C,C=G}return b(C);case se:return te=M._init,M=te(M._payload),Le(C,A,M,G)}if(I(M))return de(C,A,M,G);if(W(M)){if(te=W(M),typeof te!="function")throw Error(u(150));return M=te.call(M),ce(C,A,M,G)}if(typeof M.then=="function")return Le(C,A,xr(M),G);if(M.$$typeof===V)return Le(C,A,ur(C,M),G);Sr(C,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,A!==null&&A.tag===6?(l(C,A.sibling),G=o(A,M),G.return=C,C=G):(l(C,A),G=Wu(M,C.mode,G),G.return=C,C=G),b(C)):l(C,A)}return function(C,A,M,G){try{ea=0;var te=Le(C,A,M,G);return ri=null,te}catch(oe){if(oe===Qi||oe===sr)throw oe;var ke=Ot(29,oe,null,C.mode);return ke.lanes=G,ke.return=C,ke}finally{}}}var ui=Zh(!0),Kh=Zh(!1),Kt=X(null),sn=null;function Yn(e){var t=e.alternate;E(nt,nt.current&1),E(Kt,e),sn===null&&(t===null||ni.current!==null||t.memoizedState!==null)&&(sn=e)}function Fh(e){if(e.tag===22){if(E(nt,nt.current),E(Kt,e),sn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(sn=e)}}else Vn()}function Vn(){E(nt,nt.current),E(Kt,Kt.current)}function wn(e){P(Kt),sn===e&&(sn=null),P(nt)}var nt=X(0);function kr(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||ws(l)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Oo(e,t,l,i){t=e.memoizedState,l=l(i,t),l=l==null?t:g({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var No={enqueueSetState:function(e,t,l){e=e._reactInternals;var i=Bt(),o=Bn(i);o.payload=t,l!=null&&(o.callback=l),t=Hn(e,o,i),t!==null&&(Ht(t,e,i),Ki(t,e,i))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var i=Bt(),o=Bn(i);o.tag=1,o.payload=t,l!=null&&(o.callback=l),t=Hn(e,o,i),t!==null&&(Ht(t,e,i),Ki(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=Bt(),i=Bn(l);i.tag=2,t!=null&&(i.callback=t),t=Hn(e,i,l),t!==null&&(Ht(t,e,l),Ki(t,e,l))}};function Jh(e,t,l,i,o,h,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,b):t.prototype&&t.prototype.isPureReactComponent?!Ui(l,i)||!Ui(o,h):!0}function Ih(e,t,l,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,i),t.state!==e&&No.enqueueReplaceState(t,t.state,null)}function Sl(e,t){var l=t;if("ref"in t){l={};for(var i in t)i!=="ref"&&(l[i]=t[i])}if(e=e.defaultProps){l===t&&(l=g({},l));for(var o in e)l[o]===void 0&&(l[o]=e[o])}return l}var wr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function $h(e){wr(e)}function Ph(e){console.error(e)}function Wh(e){wr(e)}function Er(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function ed(e,t,l){try{var i=e.onCaughtError;i(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function Lo(e,t,l){return l=Bn(l),l.tag=3,l.payload={element:null},l.callback=function(){Er(e,t)},l}function td(e){return e=Bn(e),e.tag=3,e}function nd(e,t,l,i){var o=l.type.getDerivedStateFromError;if(typeof o=="function"){var h=i.value;e.payload=function(){return o(h)},e.callback=function(){ed(t,l,i)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){ed(t,l,i),typeof o!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var S=i.stack;this.componentDidCatch(i.value,{componentStack:S!==null?S:""})})}function c1(e,t,l,i,o){if(l.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=l.alternate,t!==null&&Vi(t,l,o,!0),l=Kt.current,l!==null){switch(l.tag){case 13:return sn===null?rs():l.alternate===null&&Ke===0&&(Ke=3),l.flags&=-257,l.flags|=65536,l.lanes=o,i===co?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([i]):t.add(i),os(e,i,o)),!1;case 22:return l.flags|=65536,i===co?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([i]):l.add(i)),os(e,i,o)),!1}throw Error(u(435,l.tag))}return os(e,i,o),rs(),!1}if(_e)return t=Kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,i!==lo&&(e=Error(u(422),{cause:i}),Yi(Gt(e,l)))):(i!==lo&&(t=Error(u(423),{cause:i}),Yi(Gt(t,l))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,i=Gt(i,l),o=Lo(e.stateNode,i,o),po(e,o),Ke!==4&&(Ke=2)),!1;var h=Error(u(520),{cause:i});if(h=Gt(h,l),oa===null?oa=[h]:oa.push(h),Ke!==4&&(Ke=2),t===null)return!0;i=Gt(i,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=o&-o,l.lanes|=e,e=Lo(l.stateNode,i,e),po(l,e),!1;case 1:if(t=l.type,h=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Fn===null||!Fn.has(h))))return l.flags|=65536,o&=-o,l.lanes|=o,o=td(o),nd(o,e,l,i),po(l,o),!1}l=l.return}while(l!==null);return!1}var ld=Error(u(461)),it=!1;function ot(e,t,l,i){t.child=e===null?Kh(t,null,l,i):ui(t,e.child,l,i)}function id(e,t,l,i,o){l=l.render;var h=t.ref;if("ref"in i){var b={};for(var S in i)S!=="ref"&&(b[S]=i[S])}else b=i;return vl(t),i=bo(e,t,l,b,h,o),S=xo(),e!==null&&!it?(So(e,t,o),En(e,t,o)):(_e&&S&&to(t),t.flags|=1,ot(e,t,i,o),t.child)}function ad(e,t,l,i,o){if(e===null){var h=l.type;return typeof h=="function"&&!Pu(h)&&h.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=h,rd(e,t,h,i,o)):(e=lr(l.type,null,i,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!Xo(e,o)){var b=h.memoizedProps;if(l=l.compare,l=l!==null?l:Ui,l(b,i)&&e.ref===t.ref)return En(e,t,o)}return t.flags|=1,e=yn(h,i),e.ref=t.ref,e.return=t,t.child=e}function rd(e,t,l,i,o){if(e!==null){var h=e.memoizedProps;if(Ui(h,i)&&e.ref===t.ref)if(it=!1,t.pendingProps=i=h,Xo(e,o))(e.flags&131072)!==0&&(it=!0);else return t.lanes=e.lanes,En(e,t,o)}return Uo(e,t,l,i,o)}function ud(e,t,l){var i=t.pendingProps,o=i.children,h=e!==null?e.memoizedState:null;if(i.mode==="hidden"){if((t.flags&128)!==0){if(i=h!==null?h.baseLanes|l:l,e!==null){for(o=t.child=e.child,h=0;o!==null;)h=h|o.lanes|o.childLanes,o=o.sibling;t.childLanes=h&~i}else t.childLanes=0,t.child=null;return od(e,t,i,l)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&or(t,h!==null?h.cachePool:null),h!==null?rh(t,h):go(),Fh(t);else return t.lanes=t.childLanes=536870912,od(e,t,h!==null?h.baseLanes|l:l,l)}else h!==null?(or(t,h.cachePool),rh(t,h),Vn(),t.memoizedState=null):(e!==null&&or(t,null),go(),Vn());return ot(e,t,o,l),t.child}function od(e,t,l,i){var o=so();return o=o===null?null:{parent:tt._currentValue,pool:o},t.memoizedState={baseLanes:l,cachePool:o},e!==null&&or(t,null),go(),Fh(t),e!==null&&Vi(e,t,i,!0),null}function Tr(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(u(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function Uo(e,t,l,i,o){return vl(t),l=bo(e,t,l,i,void 0,o),i=xo(),e!==null&&!it?(So(e,t,o),En(e,t,o)):(_e&&i&&to(t),t.flags|=1,ot(e,t,l,o),t.child)}function sd(e,t,l,i,o,h){return vl(t),t.updateQueue=null,l=oh(t,i,l,o),uh(e),i=xo(),e!==null&&!it?(So(e,t,h),En(e,t,h)):(_e&&i&&to(t),t.flags|=1,ot(e,t,l,h),t.child)}function cd(e,t,l,i,o){if(vl(t),t.stateNode===null){var h=$l,b=l.contextType;typeof b=="object"&&b!==null&&(h=pt(b)),h=new l(i,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=No,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=i,h.state=t.memoizedState,h.refs={},fo(t),b=l.contextType,h.context=typeof b=="object"&&b!==null?pt(b):$l,h.state=t.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(Oo(t,l,b,i),h.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(b=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),b!==h.state&&No.enqueueReplaceState(h,h.state,null),Ji(t,i,h,o),Fi(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){h=t.stateNode;var S=t.memoizedProps,T=Sl(l,S);h.props=T;var _=h.context,Y=l.contextType;b=$l,typeof Y=="object"&&Y!==null&&(b=pt(Y));var Q=l.getDerivedStateFromProps;Y=typeof Q=="function"||typeof h.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,Y||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S||_!==b)&&Ih(t,h,i,b),Un=!1;var R=t.memoizedState;h.state=R,Ji(t,i,h,o),Fi(),_=t.memoizedState,S||R!==_||Un?(typeof Q=="function"&&(Oo(t,l,Q,i),_=t.memoizedState),(T=Un||Jh(t,l,T,i,R,_,b))?(Y||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=_),h.props=i,h.state=_,h.context=b,i=T):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{h=t.stateNode,ho(e,t),b=t.memoizedProps,Y=Sl(l,b),h.props=Y,Q=t.pendingProps,R=h.context,_=l.contextType,T=$l,typeof _=="object"&&_!==null&&(T=pt(_)),S=l.getDerivedStateFromProps,(_=typeof S=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(b!==Q||R!==T)&&Ih(t,h,i,T),Un=!1,R=t.memoizedState,h.state=R,Ji(t,i,h,o),Fi();var N=t.memoizedState;b!==Q||R!==N||Un||e!==null&&e.dependencies!==null&&rr(e.dependencies)?(typeof S=="function"&&(Oo(t,l,S,i),N=t.memoizedState),(Y=Un||Jh(t,l,Y,i,R,N,T)||e!==null&&e.dependencies!==null&&rr(e.dependencies))?(_||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(i,N,T),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(i,N,T)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=N),h.props=i,h.state=N,h.context=T,i=Y):(typeof h.componentDidUpdate!="function"||b===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),i=!1)}return h=i,Tr(e,t),i=(t.flags&128)!==0,h||i?(h=t.stateNode,l=i&&typeof l.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&i?(t.child=ui(t,e.child,null,o),t.child=ui(t,null,l,o)):ot(e,t,l,o),t.memoizedState=h.state,e=t.child):e=En(e,t,o),e}function fd(e,t,l,i){return qi(),t.flags|=256,ot(e,t,l,i),t.child}var Bo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ho(e){return{baseLanes:e,cachePool:Pf()}}function qo(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Ft),e}function hd(e,t,l){var i=t.pendingProps,o=!1,h=(t.flags&128)!==0,b;if((b=h)||(b=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),b&&(o=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(_e){if(o?Yn(t):Vn(),_e){var S=Ze,T;if(T=S){e:{for(T=S,S=on;T.nodeType!==8;){if(!S){S=null;break e}if(T=en(T.nextSibling),T===null){S=null;break e}}S=T}S!==null?(t.memoizedState={dehydrated:S,treeContext:dl!==null?{id:vn,overflow:bn}:null,retryLane:536870912,hydrationErrors:null},T=Ot(18,null,null,0),T.stateNode=S,T.return=t,t.child=T,kt=t,Ze=null,T=!0):T=!1}T||gl(t)}if(S=t.memoizedState,S!==null&&(S=S.dehydrated,S!==null))return ws(S)?t.lanes=32:t.lanes=536870912,null;wn(t)}return S=i.children,i=i.fallback,o?(Vn(),o=t.mode,S=Ar({mode:"hidden",children:S},o),i=hl(i,o,l,null),S.return=t,i.return=t,S.sibling=i,t.child=S,o=t.child,o.memoizedState=Ho(l),o.childLanes=qo(e,b,l),t.memoizedState=Bo,i):(Yn(t),Yo(t,S))}if(T=e.memoizedState,T!==null&&(S=T.dehydrated,S!==null)){if(h)t.flags&256?(Yn(t),t.flags&=-257,t=Vo(e,t,l)):t.memoizedState!==null?(Vn(),t.child=e.child,t.flags|=128,t=null):(Vn(),o=i.fallback,S=t.mode,i=Ar({mode:"visible",children:i.children},S),o=hl(o,S,l,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,ui(t,e.child,null,l),i=t.child,i.memoizedState=Ho(l),i.childLanes=qo(e,b,l),t.memoizedState=Bo,t=o);else if(Yn(t),ws(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var _=b.dgst;b=_,i=Error(u(419)),i.stack="",i.digest=b,Yi({value:i,source:null,stack:null}),t=Vo(e,t,l)}else if(it||Vi(e,t,l,!1),b=(l&e.childLanes)!==0,it||b){if(b=Ve,b!==null&&(i=l&-l,i=(i&42)!==0?1:wu(i),i=(i&(b.suspendedLanes|l))!==0?0:i,i!==0&&i!==T.retryLane))throw T.retryLane=i,Il(e,i),Ht(b,e,i),ld;S.data==="$?"||rs(),t=Vo(e,t,l)}else S.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=T.treeContext,Ze=en(S.nextSibling),kt=t,_e=!0,ml=null,on=!1,e!==null&&(Qt[Zt++]=vn,Qt[Zt++]=bn,Qt[Zt++]=dl,vn=e.id,bn=e.overflow,dl=t),t=Yo(t,i.children),t.flags|=4096);return t}return o?(Vn(),o=i.fallback,S=t.mode,T=e.child,_=T.sibling,i=yn(T,{mode:"hidden",children:i.children}),i.subtreeFlags=T.subtreeFlags&65011712,_!==null?o=yn(_,o):(o=hl(o,S,l,null),o.flags|=2),o.return=t,i.return=t,i.sibling=o,t.child=i,i=o,o=t.child,S=e.child.memoizedState,S===null?S=Ho(l):(T=S.cachePool,T!==null?(_=tt._currentValue,T=T.parent!==_?{parent:_,pool:_}:T):T=Pf(),S={baseLanes:S.baseLanes|l,cachePool:T}),o.memoizedState=S,o.childLanes=qo(e,b,l),t.memoizedState=Bo,i):(Yn(t),l=e.child,e=l.sibling,l=yn(l,{mode:"visible",children:i.children}),l.return=t,l.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=l,t.memoizedState=null,l)}function Yo(e,t){return t=Ar({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ar(e,t){return e=Ot(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Vo(e,t,l){return ui(t,e.child,null,l),e=Yo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dd(e,t,l){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),ao(e.return,t,l)}function Go(e,t,l,i,o){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:l,tailMode:o}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=l,h.tailMode=o)}function pd(e,t,l){var i=t.pendingProps,o=i.revealOrder,h=i.tail;if(ot(e,t,i.children,l),i=nt.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dd(e,l,t);else if(e.tag===19)dd(e,l,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}switch(E(nt,i),o){case"forwards":for(l=t.child,o=null;l!==null;)e=l.alternate,e!==null&&kr(e)===null&&(o=l),l=l.sibling;l=o,l===null?(o=t.child,t.child=null):(o=l.sibling,l.sibling=null),Go(t,!1,o,l,h);break;case"backwards":for(l=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&kr(e)===null){t.child=o;break}e=o.sibling,o.sibling=l,l=o,o=e}Go(t,!0,l,null,h);break;case"together":Go(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function En(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Kn|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Vi(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,l=yn(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=yn(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Xo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&rr(e)))}function f1(e,t,l){switch(t.tag){case 3:Ce(t,t.stateNode.containerInfo),Ln(t,tt,e.memoizedState.cache),qi();break;case 27:case 5:an(t);break;case 4:Ce(t,t.stateNode.containerInfo);break;case 10:Ln(t,t.type,t.memoizedProps.value);break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Yn(t),t.flags|=128,null):(l&t.child.childLanes)!==0?hd(e,t,l):(Yn(t),e=En(e,t,l),e!==null?e.sibling:null);Yn(t);break;case 19:var o=(e.flags&128)!==0;if(i=(l&t.childLanes)!==0,i||(Vi(e,t,l,!1),i=(l&t.childLanes)!==0),o){if(i)return pd(e,t,l);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),E(nt,nt.current),i)break;return null;case 22:case 23:return t.lanes=0,ud(e,t,l);case 24:Ln(t,tt,e.memoizedState.cache)}return En(e,t,l)}function md(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)it=!0;else{if(!Xo(e,l)&&(t.flags&128)===0)return it=!1,f1(e,t,l);it=(e.flags&131072)!==0}else it=!1,_e&&(t.flags&1048576)!==0&&Qf(t,ar,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var i=t.elementType,o=i._init;if(i=o(i._payload),t.type=i,typeof i=="function")Pu(i)?(e=Sl(i,e),t.tag=1,t=cd(null,t,i,e,l)):(t.tag=0,t=Uo(null,t,i,e,l));else{if(i!=null){if(o=i.$$typeof,o===ue){t.tag=11,t=id(null,t,i,e,l);break e}else if(o===ee){t.tag=14,t=ad(null,t,i,e,l);break e}}throw t=ae(i)||i,Error(u(306,t,""))}}return t;case 0:return Uo(e,t,t.type,t.pendingProps,l);case 1:return i=t.type,o=Sl(i,t.pendingProps),cd(e,t,i,o,l);case 3:e:{if(Ce(t,t.stateNode.containerInfo),e===null)throw Error(u(387));i=t.pendingProps;var h=t.memoizedState;o=h.element,ho(e,t),Ji(t,i,null,l);var b=t.memoizedState;if(i=b.cache,Ln(t,tt,i),i!==h.cache&&ro(t,[tt],l,!0),Fi(),i=b.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=fd(e,t,i,l);break e}else if(i!==o){o=Gt(Error(u(424)),t),Yi(o),t=fd(e,t,i,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ze=en(e.firstChild),kt=t,_e=!0,ml=null,on=!0,l=Kh(t,null,i,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(qi(),i===o){t=En(e,t,l);break e}ot(e,t,i,l)}t=t.child}return t;case 26:return Tr(e,t),e===null?(l=bp(t.type,null,t.pendingProps,null))?t.memoizedState=l:_e||(l=t.type,e=t.pendingProps,i=qr(le.current).createElement(l),i[dt]=t,i[Et]=e,ct(i,l,e),lt(i),t.stateNode=i):t.memoizedState=bp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return an(t),e===null&&_e&&(i=t.stateNode=gp(t.type,t.pendingProps,le.current),kt=t,on=!0,o=Ze,$n(t.type)?(Es=o,Ze=en(i.firstChild)):Ze=o),ot(e,t,t.pendingProps.children,l),Tr(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&_e&&((o=i=Ze)&&(i=H1(i,t.type,t.pendingProps,on),i!==null?(t.stateNode=i,kt=t,Ze=en(i.firstChild),on=!1,o=!0):o=!1),o||gl(t)),an(t),o=t.type,h=t.pendingProps,b=e!==null?e.memoizedProps:null,i=h.children,xs(o,h)?i=null:b!==null&&xs(o,b)&&(t.flags|=32),t.memoizedState!==null&&(o=bo(e,t,l1,null,null,l),ya._currentValue=o),Tr(e,t),ot(e,t,i,l),t.child;case 6:return e===null&&_e&&((e=l=Ze)&&(l=q1(l,t.pendingProps,on),l!==null?(t.stateNode=l,kt=t,Ze=null,e=!0):e=!1),e||gl(t)),null;case 13:return hd(e,t,l);case 4:return Ce(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ui(t,null,i,l):ot(e,t,i,l),t.child;case 11:return id(e,t,t.type,t.pendingProps,l);case 7:return ot(e,t,t.pendingProps,l),t.child;case 8:return ot(e,t,t.pendingProps.children,l),t.child;case 12:return ot(e,t,t.pendingProps.children,l),t.child;case 10:return i=t.pendingProps,Ln(t,t.type,i.value),ot(e,t,i.children,l),t.child;case 9:return o=t.type._context,i=t.pendingProps.children,vl(t),o=pt(o),i=i(o),t.flags|=1,ot(e,t,i,l),t.child;case 14:return ad(e,t,t.type,t.pendingProps,l);case 15:return rd(e,t,t.type,t.pendingProps,l);case 19:return pd(e,t,l);case 31:return i=t.pendingProps,l=t.mode,i={mode:i.mode,children:i.children},e===null?(l=Ar(i,l),l.ref=t.ref,t.child=l,l.return=t,t=l):(l=yn(e.child,i),l.ref=t.ref,t.child=l,l.return=t,t=l),t;case 22:return ud(e,t,l);case 24:return vl(t),i=pt(tt),e===null?(o=so(),o===null&&(o=Ve,h=uo(),o.pooledCache=h,h.refCount++,h!==null&&(o.pooledCacheLanes|=l),o=h),t.memoizedState={parent:i,cache:o},fo(t),Ln(t,tt,o)):((e.lanes&l)!==0&&(ho(e,t),Ji(t,null,null,l),Fi()),o=e.memoizedState,h=t.memoizedState,o.parent!==i?(o={parent:i,cache:i},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),Ln(t,tt,i)):(i=h.cache,Ln(t,tt,i),i!==o.cache&&ro(t,[tt],l,!0))),ot(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Tn(e){e.flags|=4}function gd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ep(t)){if(t=Kt.current,t!==null&&((ze&4194048)===ze?sn!==null:(ze&62914560)!==ze&&(ze&536870912)===0||t!==sn))throw Zi=co,Wf;e.flags|=8192}}function zr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ht():536870912,e.lanes|=t,fi|=t)}function na(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var i=null;l!==null;)l.alternate!==null&&(i=l),l=l.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,i=0;if(t)for(var o=e.child;o!==null;)l|=o.lanes|o.childLanes,i|=o.subtreeFlags&65011712,i|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)l|=o.lanes|o.childLanes,i|=o.subtreeFlags,i|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=i,e.childLanes=l,t}function h1(e,t,l){var i=t.pendingProps;switch(no(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return Xe(t),null;case 3:return l=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Sn(tt),bt(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Hi(t)?Tn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ff())),Xe(t),null;case 26:return l=t.memoizedState,e===null?(Tn(t),l!==null?(Xe(t),gd(t,l)):(Xe(t),t.flags&=-16777217)):l?l!==e.memoizedState?(Tn(t),Xe(t),gd(t,l)):(Xe(t),t.flags&=-16777217):(e.memoizedProps!==i&&Tn(t),Xe(t),t.flags&=-16777217),null;case 27:Rn(t),l=le.current;var o=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Tn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return Xe(t),null}e=ne.current,Hi(t)?Zf(t):(e=gp(o,i,l),t.stateNode=e,Tn(t))}return Xe(t),null;case 5:if(Rn(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Tn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return Xe(t),null}if(e=ne.current,Hi(t))Zf(t);else{switch(o=qr(le.current),e){case 1:e=o.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:e=o.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":e=o.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":e=o.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":e=o.createElement("div"),e.innerHTML=" - + +
diff --git a/web/package-lock.json b/web/package-lock.json index ae131a464..8f1181706 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "dependencies": { "cytoscape": "3.32.0", + "d3-force": "^3.0.1", "lucide-react": "0.468.0", "react": "19.1.1", "react-dom": "19.1.1", @@ -19,6 +20,7 @@ "@testing-library/jest-dom": "6.6.3", "@testing-library/react": "16.3.0", "@types/cytoscape": "3.21.9", + "@types/d3-force": "^3.0.10", "@types/react": "19.1.9", "@types/react-dom": "19.1.9", "@vitejs/plugin-react": "4.7.0", @@ -1520,6 +1522,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/d3-force": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.10.tgz", + "integrity": "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/debug": { "version": "4.1.13", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", @@ -2077,6 +2086,47 @@ "node": ">=0.10" } }, + "node_modules/d3-dispatch": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.2.tgz", + "integrity": "sha512-sAzH4Y4nsLo8eSqw5jKiZt+LU2wZmL/qS+OkxQGjhwazB/D7TY34R/QK1eshfGr7cZEKymKZ/Haem7m+lu98Sg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-force": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.1.tgz", + "integrity": "sha512-kAaaHLFebBYwgi5cYBXAI8vKrQFMCD2MEswj2QuPKKbdU1wYLc8WXtS7O8F/b6POCIe3gJjY6hkDstHi1yMETQ==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-quadtree": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.2.tgz", + "integrity": "sha512-9Lu9mqJKRbIk0d6mKDjpvPURaPdwHVK5CYbcdd0/4vBgz4ldz/7TIOse3kNERsByGNfld58KEco507AztJWyTQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-1Il1aliroVSErrv5aulRBxAY+7+DnaoLIWGd1C6SsBTWDeobWiP/V69vwb8vT6abR1kKwaNe1196pmaQ1fK90A==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/data-urls": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", diff --git a/web/package.json b/web/package.json index 3eb9c3171..a2427fce8 100644 --- a/web/package.json +++ b/web/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "cytoscape": "3.32.0", + "d3-force": "^3.0.1", "lucide-react": "0.468.0", "react": "19.1.1", "react-dom": "19.1.1", @@ -21,6 +22,7 @@ "@testing-library/jest-dom": "6.6.3", "@testing-library/react": "16.3.0", "@types/cytoscape": "3.21.9", + "@types/d3-force": "^3.0.10", "@types/react": "19.1.9", "@types/react-dom": "19.1.9", "@vitejs/plugin-react": "4.7.0", diff --git a/web/src/GraphView.test.tsx b/web/src/GraphView.test.tsx index f67b8c35d..8614f3877 100644 --- a/web/src/GraphView.test.tsx +++ b/web/src/GraphView.test.tsx @@ -6,26 +6,72 @@ import type { Insight, Meta } from "./types"; import { I18nProvider } from "./i18n"; import { ThemeProvider } from "./theme"; -vi.mock("cytoscape", () => ({ - default: () => ({ - on: vi.fn(), - style: () => { - const sheet = { selector: vi.fn(), style: vi.fn(), update: vi.fn() }; - sheet.selector.mockReturnValue(sheet); - sheet.style.mockReturnValue(sheet); - return sheet; - }, - resize: vi.fn(), - destroy: vi.fn(), - nodes: () => ({ unselect: vi.fn() }), - getElementById: () => ({ select: vi.fn() }), - fit: vi.fn(), - zoom: vi.fn(() => 1), - width: () => 500, - height: () => 500, - layout: () => ({ run: vi.fn() }), - }), -})); +vi.mock("cytoscape", () => { + // Minimal chainable collection stub for the visual-mode class handling. + const collection = () => { + const c = { + *[Symbol.iterator]() {}, + addClass: vi.fn(() => c), + removeClass: vi.fn(() => c), + toggleClass: vi.fn(() => c), + filter: vi.fn(() => c), + not: vi.fn(() => c), + union: vi.fn(() => c), + nonempty: vi.fn(() => false), + isNode: vi.fn(() => false), + connectedEdges: vi.fn(() => c), + closedNeighborhood: vi.fn(() => c), + unselect: vi.fn(), + select: vi.fn(), + position: vi.fn(), + remove: vi.fn(), + id: vi.fn(() => ""), + }; + return c; + }; + return { + default: () => ({ + on: vi.fn(), + style: () => { + const sheet = { selector: vi.fn(), style: vi.fn(), update: vi.fn() }; + sheet.selector.mockReturnValue(sheet); + sheet.style.mockReturnValue(sheet); + return sheet; + }, + resize: vi.fn(), + stop: vi.fn(), + animate: vi.fn(), + destroy: vi.fn(), + nodes: collection, + edges: collection, + elements: collection, + getElementById: collection, + fit: vi.fn(), + zoom: vi.fn(() => 1), + width: () => 500, + height: () => 500, + batch: (run: () => void) => run(), + add: vi.fn((def: { data: Record }) => { + const data = { ...def.data }; + return { + id: () => data.id, + data: (keyOrPatch: unknown, value?: unknown) => { + if (typeof keyOrPatch === "string") { + if (value === undefined) return data[keyOrPatch]; + data[keyOrPatch] = value; + return undefined; + } + if (keyOrPatch && typeof keyOrPatch === "object") + Object.assign(data, keyOrPatch); + return data; + }, + position: vi.fn(() => ({ x: 0, y: 0 })), + remove: vi.fn(), + }; + }), + }), + }; +}); it("preserves correction edge semantics when replacing the theme stylesheet", () => { for (const palette of [ { @@ -33,15 +79,21 @@ it("preserves correction edge semantics when replacing the theme stylesheet", () edge: "#a8a8b2", selected: "#26262b", outline: "#f7f7f8", + highlight: "#9fc2f0", }, { label: "#cdcdd3", edge: "#65656f", selected: "#d4d4d8", outline: "#1a1a1a", + highlight: "#5478c0", }, ]) { const styles = graphStyle(palette); + const styleOf = (selector: string) => { + const rule = styles.find((item) => item.selector === selector); + return rule && "style" in rule ? rule.style : undefined; + }; const correction = styles.find( (rule) => rule.selector === 'edge[supersedes = "yes"]', ); @@ -54,7 +106,85 @@ it("preserves correction edge semantics when replacing the theme stylesheet", () color: palette.label, "text-background-color": palette.outline, }); - expect(styles).toHaveLength(4); + expect(styles).toHaveLength(18); + expect(styleOf("core")).toMatchObject({ + "active-bg-color": palette.highlight, + "active-bg-size": 6, + "active-bg-opacity": 0.12, + }); + expect(styleOf("edge:active")).toMatchObject({ + "overlay-color": palette.highlight, + "overlay-padding": 1, + "overlay-opacity": 0.12, + }); + // Special relation rules stay after generic edge styling, including the + // selection contrast rule, so their gold dashed direction is preserved. + expect(styles.slice(-3).map((rule) => rule.selector)).toEqual([ + 'edge[supersedes = "yes"]', + 'edge[supersedes = "yes"].zoom-overview', + 'edge[supersedes = "yes"].labeled', + ]); + expect(styleOf('edge[supersedes = "yes"]')).toMatchObject({ + "arrow-scale": 1.2, + "text-opacity": 0, + }); + expect(styleOf('edge[supersedes = "yes"].zoom-overview')).toMatchObject({ + "arrow-scale": 1.8, + }); + expect(styleOf('edge[supersedes = "yes"].labeled')).toMatchObject({ + "text-opacity": 1, + }); + // Semantic zoom keeps labels hidden by default; classes reveal them. + expect(styleOf("node")).toMatchObject({ + "text-opacity": 0, + "text-outline-color": palette.outline, + "text-outline-width": 0, + "underlay-color": palette.highlight, + "underlay-opacity": 0, + "underlay-padding": 5, + }); + expect( + styleOf( + "node.labeled, node.hovered, node:selected, node.focus-set", + ), + ).toMatchObject({ + "text-opacity": 1, + }); + // Edge weight mapping drives width/opacity through element data. + expect(styleOf("edge")).toMatchObject({ + width: "data(width)", + opacity: "data(opacity)", + }); + // Hover feedback: soft underlay uses the theme-aware highlight colour. + expect(styleOf("node.highlight")).toMatchObject({ + "underlay-color": palette.highlight, + }); + // Element-local hover: a gentle accent stroke on the node and a mild + // lift on its direct edges — nothing else changes (§6). + expect(styleOf("node.hovered")).toMatchObject({ + "border-color": palette.highlight, + }); + expect(styleOf("edge.hover-link")).toMatchObject({ opacity: 0.8 }); + // §6 supplementary targets: ~200ms easing including the halo and the + // selection stroke, and fade floors that keep dimmed elements readable + // on light and dark canvases alike. + expect(styleOf("node")).toMatchObject({ + "transition-duration": 200, + "transition-property": + "text-opacity, opacity, underlay-opacity, underlay-padding, border-color, border-width, text-outline-width, color", + }); + expect(styleOf("edge")).toMatchObject({ "transition-duration": 200 }); + expect(styleOf("node.faded")).toMatchObject({ opacity: 0.35 }); + expect(styleOf("edge.faded")).toMatchObject({ opacity: 0.3 }); + expect(styleOf("edge.zoom-dim")).toMatchObject({ opacity: 0.25 }); + expect(styleOf("edge.selected-link")).toMatchObject({ opacity: 0.85 }); + // Selection uses the theme-adapted accent (never near-black/near-white) + // with a softened label knock-out. + expect(styleOf("node:selected")).toMatchObject({ + "border-color": palette.highlight, + "text-outline-width": 2, + color: palette.label, + }); } }); const memory: Insight = { @@ -141,6 +271,12 @@ it("supports keyboard-equivalent graph selection, reader links, URL focus, and B "Reset graph layout", ]) expect(screen.getByRole("button", { name: label })).toBeVisible(); + for (const label of [ + "View mode", + "Label display mode", + "Edge display mode", + ]) + expect(screen.getByLabelText(label)).toBeVisible(); fireEvent.click( screen.getByRole("button", { name: "Close selected memory" }), ); diff --git a/web/src/GraphView.tsx b/web/src/GraphView.tsx index 6b3142b7d..6f92fac66 100644 --- a/web/src/GraphView.tsx +++ b/web/src/GraphView.tsx @@ -1,5 +1,5 @@ -import { useEffect, useRef } from "react"; -import cytoscape, { type Core } from "cytoscape"; +import { useEffect, useRef, useState, type RefObject } from "react"; +import cytoscape, { type Core, type NodeSingular } from "cytoscape"; import { ArrowRight, Expand, @@ -11,6 +11,13 @@ import { X, } from "lucide-react"; import { storeAPI, useQuery } from "./api"; +import { + attachDragWheelZoom, + createGraphPhysics, + GRAPH_WHEEL_SENSITIVITY, + type GraphPhysics, + type PhysicsElements, +} from "./graphPhysics"; import { Category, categoryColor, @@ -28,6 +35,14 @@ import { filtersOnly, Link, routeURL, useRouter } from "./router"; import type { GraphData, Insight, Meta } from "./types"; import { useTheme } from "./theme"; +interface GraphRelationship { + id: string; + source: string; + target: string; + type: string; + weight: number; +} + function graphPalette() { const styles = getComputedStyle(document.documentElement); const value = (name: string, fallback: string) => @@ -37,6 +52,7 @@ function graphPalette() { edge: value("--graph-edge", "#b8b8c2"), selected: value("--graph-selection", "#202024"), outline: value("--graph-outline", "#ffffff"), + highlight: value("--graph-highlight", "#9fc2f0"), }; } @@ -44,6 +60,16 @@ export function graphStyle( palette: ReturnType, ): cytoscape.StylesheetJson { return [ + { + // Keep a small, theme-aware press cue on the background instead of the + // default 60px black disk, which resembles an extra graph node. + selector: "core", + style: { + "active-bg-color": palette.highlight, + "active-bg-size": 6, + "active-bg-opacity": 0.12, + } as cytoscape.Css.Core, // Core rules can be partial; the typings require all properties. + }, { selector: "node", style: { @@ -58,31 +84,142 @@ export function graphStyle( "text-margin-y": 8, "text-max-width": "120px", "text-wrap": "ellipsis", + // These colors must stay stable while their widths/opacities fade out; + // otherwise deselection briefly restores Cytoscape's black defaults. + "text-outline-color": palette.outline, + "text-outline-width": 0, + "underlay-color": palette.highlight, + "underlay-opacity": 0, + "underlay-padding": 5, + // Semantic zoom: labels stay hidden until the zoom tier (or the + // explicit mode/hover) grants the "labeled"/"hovered" class. + "text-opacity": 0, "border-width": 4, "border-color": palette.outline, "border-opacity": 0.9, + // ~200ms easing covers labels, fade levels, the soft halo and the + // selection stroke so every emphasis change eases instead of popping. + "transition-property": + "text-opacity, opacity, underlay-opacity, underlay-padding, border-color, border-width, text-outline-width, color", + "transition-duration": 200, + }, + }, + { + selector: "node.labeled, node.hovered, node:selected, node.focus-set", + style: { + "text-opacity": 1, }, }, { + // Selection emphasis stays subtractive: a theme-adapted accent stroke + // (never near-black/near-white) and a thin label knock-out, eased in + // over 200ms like every other emphasis change. selector: "node:selected", style: { - "border-color": palette.selected, + "border-color": palette.highlight, "border-width": 5, "text-outline-color": palette.outline, - "text-outline-width": 3, - color: palette.selected, + "text-outline-width": 2, + color: palette.label, + }, + }, + { + // Subtractive emphasis: unrelated nodes stay readable on light and + // dark backgrounds alike (top of the ~0.25-0.35 band). + selector: "node.faded", + style: { + opacity: 0.35, + }, + }, + { + // The soft halo marks the single anchor node (selected / focused) + // only — never the whole neighborhood. + selector: "node.highlight", + style: { + "underlay-color": palette.highlight, + "underlay-opacity": 0.45, + "underlay-padding": 5, + }, + }, + { + // Element-local hover: a gentle accent stroke plus the label. No + // whole-graph fading on hover (§6). + selector: "node.hovered", + style: { + "border-color": palette.highlight, + }, + }, + { + // At most the hovered node's direct edges lift slightly. + selector: "edge.hover-link", + style: { + opacity: 0.8, }, }, { + // Weight-mapped rendering: width and opacity come from element data so + // weak edges stay thin and faint while strong ones stand out. selector: "edge", style: { - width: 1.25, + width: "data(width)", "line-color": palette.edge, "target-arrow-color": palette.edge, "target-arrow-shape": "triangle", "curve-style": "bezier", "arrow-scale": 0.7, - opacity: 0.8, + // Data mappers are strings at runtime; the typings model plain values. + opacity: "data(opacity)" as unknown as number, + "transition-property": "opacity", + "transition-duration": 200, + }, + }, + { + // Preserve edge presses without the default 10px black overlay that + // turns thin connections into broad dark bands. + selector: "edge:active", + style: { + "overlay-color": palette.highlight, + "overlay-padding": 1, + "overlay-opacity": 0.12, + }, + }, + { + // Focus dimming keeps faded edges clearly visible on the light theme's + // near-white canvas; selected links get a separate, modest contrast lift. + selector: "edge.faded", + style: { + opacity: 0.3, + }, + }, + { + // Zoom-density dimming (low zoom decluttering) stays a notch lower. + selector: "edge.zoom-dim", + style: { + opacity: 0.25, + }, + }, + { + // Keep the selected node's direct connections easy to trace, including + // weak edges dimmed by semantic zoom. Reuse the 200ms opacity easing. + selector: "edge.selected-link", + style: { + opacity: 0.85, + }, + }, + { + selector: "edge.inspected", + style: { + "line-color": palette.highlight, + "target-arrow-color": palette.highlight, + opacity: 0.9, + }, + }, + { + // Display-only edge filtering: elements stay in the graph and keep the + // physics layout; only their rendering is suppressed. + selector: "edge.mode-hidden", + style: { + display: "none", }, }, { @@ -91,28 +228,125 @@ export function graphStyle( "line-color": "#c19857", "target-arrow-color": "#c19857", "line-style": "dashed", + "arrow-scale": 1.2, color: palette.label, label: "data(label)", - "font-size": 9, + "font-size": 10, + "text-opacity": 0, "text-rotation": "autorotate", "text-background-color": palette.outline, "text-background-opacity": 1, "text-background-padding": "3px", }, }, + { + selector: 'edge[supersedes = "yes"].zoom-overview', + style: { "arrow-scale": 1.8 }, + }, + { + selector: 'edge[supersedes = "yes"].labeled', + style: { "text-opacity": 1 }, + }, ]; } +// Edges at or above this weight count as "strong" for display filtering and +// zoom-density dimming. Display layer only — never affects stored relations. +const STRONG_EDGE_WEIGHT = 0.6; + +// Weight-tiered edge visuals: thin/faint by default, stronger edges stand out. +function edgeVisuals(weight: number) { + const clamped = + Number.isFinite(weight) && weight > 0 ? Math.min(weight, 1) : 0.2; + const width = + clamped < 0.3 + ? 0.8 + : clamped < 0.5 + ? 1.1 + : clamped < 0.7 + ? 1.5 + : clamped < 0.9 + ? 2.2 + : 3; + return { + width, + opacity: 0.35 + 0.5 * clamped, + strong: clamped >= STRONG_EDGE_WEIGHT ? "yes" : "no", + }; +} + +// Element definitions keyed by stable ids so polling refreshes can be applied +// as a diff instead of rebuilding the instance. Edge ids derive from their +// endpoints and type (with a counter for duplicates) so they survive reorders. +function graphElements(data: GraphData, untitled: string): PhysicsElements { + const nodeIDs = new Set(data.nodes.map((node) => node.id)); + const edgeIDCounts = new Map(); + return { + nodes: data.nodes.map((node) => ({ + data: { + id: node.id, + label: title(node.content).slice(0, 36) || untitled, + fullTitle: title(node.content) || untitled, + color: categoryColor(node.category), + size: 20 + node.importance * 5, + importance: node.importance, + }, + })), + edges: (data.edges || []) + .filter( + (edge) => nodeIDs.has(edge.source_id) && nodeIDs.has(edge.target_id), + ) + .map((edge) => { + const base = `${edge.source_id}:${edge.target_id}:${edge.edge_type}`; + const count = (edgeIDCounts.get(base) || 0) + 1; + edgeIDCounts.set(base, count); + const visuals = edgeVisuals(edge.weight); + return { + // Edges open relationship details; native selection must not clear + // the node selection that is owned by the URL. + selectable: false, + data: { + id: count === 1 ? base : `${base}#${count}`, + source: edge.source_id, + target: edge.target_id, + label: edge.edge_type, + weight: edge.weight, + width: visuals.width, + opacity: visuals.opacity, + strong: visuals.strong, + supersedes: edge.edge_type === "supersedes" ? "yes" : "no", + }, + }; + }), + }; +} + function GraphCanvas({ data, selected, onSelect, focus, + localFocus, + localHops, + viewMode, + canFocus, + onViewMode, + locateRef, + relationship, + onInspectEdge, }: { data: GraphData; selected: string; onSelect: (id: string) => void; focus: string; + localFocus: string; + localHops: 1 | 2; + viewMode: "global" | "focus" | "focus2"; + canFocus: boolean; + onViewMode: (mode: "global" | "focus" | "focus2") => void; + locateRef: RefObject<((id: string) => void) | null>; + relationship: GraphRelationship | null; + onInspectEdge: (edge: GraphRelationship | null) => void; }) { const { resolved } = useTheme(); const t = useT(); @@ -120,65 +354,295 @@ function GraphCanvas({ tRef.current = t; const container = useRef(null); const graph = useRef(null); + const physics = useRef(null); const selectCallback = useRef(onSelect); selectCallback.current = onSelect; + const [labelMode, setLabelMode] = useState<"auto" | "all" | "hidden">("auto"); + const [edgeMode, setEdgeMode] = useState<"all" | "strong" | "selected">( + "all", + ); + const closeEdgeDetails = () => onInspectEdge(null); + const inspectedEdge = relationship?.id || ""; + const labelModeRef = useRef(labelMode); + const applyVisuals = useRef(() => {}); + const applyEmphasis = useRef(() => {}); + // Emphasis inputs shared by hover, selection and local-focus highlighting. + const emphasisState = useRef({ + selected: "", + focus: "", + hops: 2 as 1 | 2, + }); + const prevLocalFocus = useRef(""); + // The Cytoscape instance is created once per mount; data refreshes are + // applied as element diffs by the sync effect below so positions, zoom and + // pan survive polling instead of triggering a full rebuild. useEffect(() => { if (!container.current) return; const palette = graphPalette(); - const nodeIDs = new Set(data.nodes.map((node) => node.id)); const instance = cytoscape({ container: container.current, - elements: [ - ...data.nodes.map((node) => ({ - data: { - id: node.id, - label: - title(node.content).slice(0, 36) || - tRef.current("state.untitled"), - color: categoryColor(node.category), - size: 20 + node.importance * 5, - }, - })), - ...(data.edges || []) - .filter( - (edge) => - nodeIDs.has(edge.source_id) && nodeIDs.has(edge.target_id), - ) - .map((edge, index) => ({ - data: { - id: `edge-${index}`, - source: edge.source_id, - target: edge.target_id, - label: edge.edge_type, - supersedes: edge.edge_type === "supersedes" ? "yes" : "no", - }, - })), - ], + elements: [], + // Positions come exclusively from the force simulation; keep the + // constructor from running a one-shot layout over the empty set. + layout: { name: "preset" }, style: graphStyle(palette), - layout: { - name: "cose", - animate: false, - padding: 55, - nodeRepulsion: () => 7000, - idealEdgeLength: () => 95, - randomize: false, - }, minZoom: 0.15, maxZoom: 3, - wheelSensitivity: 0.25, + wheelSensitivity: GRAPH_WHEEL_SENSITIVITY, }); graph.current = instance; - instance.on("tap", "node", (event) => - selectCallback.current(event.target.id()), - ); + const sim = createGraphPhysics(instance); + physics.current = sim; + locateRef.current = (id) => { + const node = instance.getElementById(id); + if (!node.nonempty()) return; + closeEdgeDetails(); + // List navigation owns the viewport, including while the initial layout + // is settling. Preserve closer user zooms and never queue camera moves. + sim.cancelSettleFit(); + instance.resize(); + instance.stop(true, false); + const zoom = Math.max(instance.zoom(), 1.4); + const position = node.position(); + instance.animate( + { + zoom, + pan: { + x: instance.width() / 2 - position.x * zoom, + y: instance.height() / 2 - position.y * zoom, + }, + }, + { duration: 240, easing: "ease-in-out-cubic" }, + ); + container.current?.scrollIntoView({ behavior: "smooth", block: "center" }); + }; + instance.on("tap", "node", (event) => { + closeEdgeDetails(); + selectCallback.current(event.target.id()); + }); + instance.on("tap", "edge", (event) => { + const edge = event.target; + onInspectEdge({ + id: edge.id(), + source: String(edge.source().data("fullTitle")), + target: String(edge.target().data("fullTitle")), + type: String(edge.data("label")), + weight: Number(edge.data("weight")), + }); + }); + instance.on("tap", (event) => { + if (event.target === instance) closeEdgeDetails(); + }); + // Drag gestures drive the simulation: the grabbed node is pinned, the + // forces stay hot while dragging, and the network rebounds on release. + let draggingNode = false; + instance.on("grab", "node", (event) => sim.onGrab(event.target.id())); + instance.on("drag", "node", (event) => { + draggingNode = true; + sim.onDrag(event.target.id()); + }); + instance.on("free", "node", (event) => { + draggingNode = false; + sim.onFree(event.target.id()); + }); + // Cytoscape blocks wheel zooming during drag gestures; the companion + // listener keeps zooming alive there, anchored at the cursor. + const detachWheel = attachDragWheelZoom(instance, container.current, { + wheelSensitivity: GRAPH_WHEEL_SENSITIVITY, + isDragging: () => draggingNode, + }); + // Semantic zoom: label tiers follow the zoom level, important nodes first. + // Throttled trailing-edge so continuous wheel zooming stays cheap and no + // React state is involved — only Cytoscape classes. + const weakEdges = () => + instance + .edges() + .filter( + (edge) => + edge.data("supersedes") !== "yes" && + Number(edge.data("weight")) < STRONG_EDGE_WEIGHT, + ); + const labelTiers = () => { + const mode = labelModeRef.current; + const zoom = instance.zoom(); + // Local focus mode keeps every neighborhood label visible (§3). + const focused = !!emphasisState.current.focus; + // Low zoom shows only the most important labels; zooming in reveals + // more, and past ~1.25 everything is labelled. + // Thresholds calibrated on real stores where most memories sit at + // importance 3+ (e.g. 200-node window: 9x2, 112x3, 72x4, 7x5), so the + // tiers must climb higher to keep low zoom readable. + const minImportance = + mode !== "auto" + ? Number.POSITIVE_INFINITY + : focused + ? 0 + : zoom < 0.45 + ? 5 + : zoom < 0.9 + ? 4 + : zoom < 1.4 + ? 3 + : 0; + const dimWeak = mode === "auto" && zoom < 0.8 && !focused; + instance.batch(() => { + for (const node of instance.nodes()) { + const show = + mode === "all" || + (mode === "auto" && + (Number(node.data("importance")) || 0) >= minImportance); + node.toggleClass("labeled", show); + } + weakEdges().toggleClass("zoom-dim", dimWeak); + const corrections = instance.edges('[supersedes = "yes"]'); + corrections.toggleClass("zoom-overview", zoom < 0.9); + corrections.toggleClass( + "labeled", + mode === "all" || (mode === "auto" && (focused || zoom >= 0.9)), + ); + }); + }; + applyVisuals.current = labelTiers; + let zoomTimer: ReturnType | undefined; + instance.on("zoom", () => { + clearTimeout(zoomTimer); + zoomTimer = setTimeout(labelTiers, 100); + }); + // Click-level emphasis (selection / two-hop focus): the union of the + // relevant neighborhoods keeps full rendering while only the unrelated + // remainder fades. Runs on selection or mode changes — never per hover + // event — so the O(N) fade pass cannot fire while sweeping the cursor. + applyEmphasis.current = () => { + const state = emphasisState.current; + const keepParts = []; + const node = (id: string) => { + if (!id) return null; + const found = instance.getElementById(id); + return found.nonempty() && found.isNode() ? found : null; + }; + const selectedNode = node(state.selected); + if (selectedNode) keepParts.push(selectedNode.closedNeighborhood()); + const focusNode = + state.focus && state.hops === 2 ? node(state.focus) : null; + if (focusNode) { + // Two-hop expansion over the current dataset (display layer only). + keepParts.push(focusNode.closedNeighborhood().closedNeighborhood()); + } + const all = instance.elements(); + const keep = + keepParts.length > 0 + ? keepParts.reduce((acc, part) => acc.union(part)) + : null; + // Emphasis works by subtraction: one anchor carries the soft halo, + // its related subgraph keeps normal rendering and labels, and only the + // unrelated remainder fades — no glow stacked across the neighborhood. + const anchor = selectedNode ?? focusNode; + instance.batch(() => { + all.removeClass(["faded", "highlight", "focus-set", "selected-link"]); + selectedNode?.connectedEdges().addClass("selected-link"); + if (keep) { + if (anchor) anchor.addClass("highlight"); + keep.nodes().addClass("focus-set"); + all.not(keep).addClass("faded"); + } + }); + }; + // Hover stays element-local (§6): one node gets a gentle accent stroke + // plus its label, and at most its direct edges lift slightly. No + // whole-graph fade, no React state, no stylesheet reapplication — moving + // across the graph never rearranges the canvas brightness. + let hoveredNode: NodeSingular | null = null; + const clearHover = () => { + if (!hoveredNode || hoveredNode.removed()) { + hoveredNode = null; + return; + } + instance.batch(() => { + hoveredNode?.removeClass("hovered"); + hoveredNode?.connectedEdges().removeClass("hover-link"); + }); + hoveredNode = null; + }; + instance.on("mouseover", "node", (event) => { + const node = event.target; + if (hoveredNode && hoveredNode.id() !== node.id()) clearHover(); + hoveredNode = node; + instance.batch(() => { + node.addClass("hovered"); + node.connectedEdges().addClass("hover-link"); + }); + if (container.current) + container.current.title = String(node.data("fullTitle") || ""); + }); + instance.on("mouseout", "node", clearHover); + // The user owns the viewport after any gesture: drop pending auto-fit. + const dropSettleFit = () => { + sim.cancelSettleFit(); + instance.stop(true, false); + }; + instance.on("scrollzoom", dropSettleFit); + instance.on("dragpan", dropSettleFit); + instance.on("drag", "node", dropSettleFit); const resize = new ResizeObserver(() => instance.resize()); resize.observe(container.current); return () => { + clearTimeout(zoomTimer); + detachWheel(); resize.disconnect(); + sim.stop(); + locateRef.current = null; instance.destroy(); graph.current = null; + physics.current = null; + applyVisuals.current = () => {}; + applyEmphasis.current = () => {}; }; + }, []); + // New data (polling, filters, focus) arrives as fresh references; sync + // diffs elements by id and only reheats the layout on real changes. + const firstSync = useRef(true); + useEffect(() => { + physics.current?.sync(graphElements(data, tRef.current("state.untitled"))); + closeEdgeDetails(); + // Newcomers need the current label/zoom tier applied. + applyVisuals.current(); + // Frame the initial layout once it settles (the seeded cluster expands + // far past its initial extent); later refreshes never touch the viewport. + if (firstSync.current) { + firstSync.current = false; + physics.current?.settleFit(); + } }, [data]); + useEffect(() => { + labelModeRef.current = labelMode; + applyVisuals.current(); + }, [labelMode]); + // Edge display mode: all / strong-only / selected-neighborhood. Filtering is + // display-only (classes); elements and physics stay untouched. + useEffect(() => { + const instance = graph.current; + if (!instance) return; + const edges = instance.edges(); + instance.batch(() => { + edges.removeClass("mode-hidden"); + if (edgeMode === "strong") { + edges.filter((edge) => edge.data("strong") !== "yes").addClass("mode-hidden"); + } else if (edgeMode === "selected") { + const node = selected ? instance.getElementById(selected) : null; + if (node && node.nonempty() && node.isNode()) { + edges.not(node.connectedEdges()).addClass("mode-hidden"); + } + } + }); + }, [edgeMode, selected, data]); + useEffect(() => { + const instance = graph.current; + if (!instance) return; + instance.batch(() => { + instance.edges(".inspected").removeClass("inspected"); + if (inspectedEdge) instance.getElementById(inspectedEdge).addClass("inspected"); + }); + }, [inspectedEdge, data]); useEffect(() => { const instance = graph.current; if (!instance) return; @@ -189,81 +653,164 @@ function GraphCanvas({ useEffect(() => { const instance = graph.current; if (!instance) return; + closeEdgeDetails(); instance.nodes().unselect(); if (selected) instance.getElementById(selected).select(); + // Clicking a node highlights its one-hop neighborhood (§3 mode A). + emphasisState.current.selected = selected; + applyEmphasis.current(); }, [selected, data]); + // Local focus mode (§3 mode B): tighten springs, keep neighborhood labels + // on, and emphasize the display-layer two-hop set when expanded. Only + // classes and physics parameters change — the instance and viewport stay. + useEffect(() => { + const instance = graph.current; + const active = !!localFocus; + const wasActive = !!prevLocalFocus.current; + prevLocalFocus.current = localFocus; + emphasisState.current.focus = localFocus; + emphasisState.current.hops = localHops; + physics.current?.setTightLinks(active); + applyEmphasis.current(); + applyVisuals.current(); + // Entering or leaving the local view changes the visible scope; reframe + // once the adjusted layout settles (tight springs reshape the extent). + if (instance && active !== wasActive) { + physics.current?.settleFit(); + } + }, [localFocus, localHops, data]); return ( -
-
-
- - {focus ? t("graph.focused") : t("graph.full")} - {t("graph.dragHint")} +
+
+
+
+ + {focus ? t("graph.focused") : t("graph.full")} + {t("graph.dragHint")} +
+
+ + + + +
+
+ + + +
-
- - - - -
+ {humanize(relationship.type)} + + {relationship.source} → {relationship.target} + + {t("graph.weight", { value: relationship.weight })} + +
+ )}
); } export function GraphView({ meta, refresh }: { meta: Meta; refresh: number }) { const { route, navigate } = useRouter(); const t = useT(); + const locateRef = useRef<((id: string) => void) | null>(null); + const [relationship, setRelationship] = useState(null); const params = filtersOnly(route.search); const routeParams = new URLSearchParams(route.search); const focus = routeParams.get("focus") || ""; @@ -278,6 +825,19 @@ export function GraphView({ meta, refresh }: { meta: Meta; refresh: number }) { : focus; const select = (id: string) => update("selected", id); const selected = query.data?.nodes.find((node) => node.id === selectedID); + // §3 dual mode: the URL focus parameter drives the one-hop server focus; + // the two-hop view is a display-layer expansion over the current dataset. + const [twoHopFocus, setTwoHopFocus] = useState(false); + useEffect(() => { + // Back navigation and closing the preview both clear URL selection. Drop + // the local expansion too so a later selection starts in global mode. + if (!selectedID) setTwoHopFocus(false); + }, [selectedID]); + const viewMode: "global" | "focus" | "focus2" = focus + ? "focus" + : twoHopFocus && selectedID + ? "focus2" + : "global"; function update(key: string, value: string) { const next = new URLSearchParams(route.search); if (value || key === "selected") next.set(key, value); @@ -285,6 +845,11 @@ export function GraphView({ meta, refresh }: { meta: Meta; refresh: number }) { if (key === "focus") next.delete("selected"); navigate(routeURL(route.store, "graph", next.toString())); } + const onViewMode = (mode: "global" | "focus" | "focus2") => { + setTwoHopFocus(mode === "focus2"); + if (mode === "focus" && selectedID) update("focus", selectedID); + else if (focus) update("focus", ""); + }; return ( <> {focus && ( - @@ -334,12 +905,23 @@ export function GraphView({ meta, refresh }: { meta: Meta; refresh: number }) { selected={selectedID} onSelect={select} focus={focus} + localFocus={focus || (twoHopFocus ? selectedID : "")} + localHops={focus ? 1 : 2} + viewMode={viewMode} + canFocus={!!selectedID} + onViewMode={onViewMode} + locateRef={locateRef} + relationship={relationship} + onInspectEdge={setRelationship} /> {selected && ( select("")} - onExpand={() => update("focus", selected.id)} + onExpand={() => { + setTwoHopFocus(false); + update("focus", selected.id); + }} /> )}
@@ -368,7 +950,14 @@ export function GraphView({ meta, refresh }: { meta: Meta; refresh: number }) {