From 256ce2c5c0617d3f59817a4c6308161ce22c7ba2 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Mon, 11 Oct 2021 02:02:33 +0200 Subject: chore: merge and build preview --- out/_next/static/chunks/pages/index-235b28e3e05bd0bcfdd5.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 out/_next/static/chunks/pages/index-235b28e3e05bd0bcfdd5.js (limited to 'out/_next/static/chunks/pages/index-235b28e3e05bd0bcfdd5.js') diff --git a/out/_next/static/chunks/pages/index-235b28e3e05bd0bcfdd5.js b/out/_next/static/chunks/pages/index-235b28e3e05bd0bcfdd5.js new file mode 100644 index 0000000..fa54b88 --- /dev/null +++ b/out/_next/static/chunks/pages/index-235b28e3e05bd0bcfdd5.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{65058:function(e,n,t){"use strict";t.d(n,{U:function(){return k}});var r=t(70885),i=t(45987),o=t(4942),l=t(80658),s=t(38554),c=t.n(s),a=t(84461),u=t(73808),d=t(53869),h=t(39629),g=t(67294);function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function p(e){for(var n=1;n0?1:0)}),{},(t={overflow:"hidden"},(0,o.Z)(t,u,l),(0,o.Z)(t,"transitionEnd",null===c||void 0===c?void 0:c.exit),(0,o.Z)(t,"transition",null!==(n=null===s||void 0===s?void 0:s.exit)&&void 0!==n?n:v(w.exit,a)),t))},enter:function(e){var n,t,r=e.animateOpacity,i=e.endingSize,l=e.transition,s=e.transitionEnd,c=e.delay,a=e.dimension;return C(C({},r&&{opacity:1}),{},(t={},(0,o.Z)(t,a,i),(0,o.Z)(t,"transitionEnd",null===s||void 0===s?void 0:s.enter),(0,o.Z)(t,"transition",null!==(n=null===l||void 0===l?void 0:l.enter)&&void 0!==n?n:j(w.enter,c)),t))}},k=g.forwardRef((function(e,n){var t=e.in,o=e.unmountOnExit,s=e.animateOpacity,u=void 0===s||s,f=e.startingSize,p=void 0===f?0:f,x=e.endingSize,j=void 0===x?"auto":x,v=e.dimension,y=void 0===v?"height":v,w=e.style,k=e.className,S=e.transition,P=e.transitionEnd,N=(0,i.Z)(e,m),I=g.useState(!1),L=(0,r.Z)(I,2),D=L[0],z=L[1];g.useEffect((function(){var e=setTimeout((function(){z(!0)}));return function(){return clearTimeout(e)}}),[]),(0,l.ZK)({condition:Boolean(p>0&&o),message:"startingSize and unmountOnExit are mutually exclusive. You can't use them together"});var E=parseFloat(p.toString())>0,Z={startingSize:p,endingSize:j,animateOpacity:u,dimension:y,transition:D?S:{enter:{duration:0}},transitionEnd:c()(P,{enter:{overflow:"initial"},exit:o?void 0:{display:E?"block":"none"}})},R=!o||t,T=t||o?"enter":"exit";return(0,b.jsx)(d.M,{initial:!1,custom:Z,children:R&&(0,b.jsx)(h.E.div,C(C({ref:n},N),{},{className:(0,a.cx)("chakra-collapse",k),style:C({overflow:"hidden",display:"block"},w),custom:Z,variants:O,initial:!!o&&"exit",animate:T,exit:"exit"}))})}));u.Ts&&(k.displayName="Collapse")},6972:function(e,n,t){"use strict";t.r(n),t.d(n,{Graph:function(){return at},GraphPage:function(){return ct},default:function(){return st},getThemeColor:function(){return ht},hexToRGBA:function(){return gt},normalizeLinkEnds:function(){return dt}});var r=t(15861),i=t(42982),o=t(4942),l=t(70885),s=t(87757),c=t.n(s),a=t(40980),u=t(74860),d=t(95869),h=t(48017),g=t(94096),f=t(96699),p=t(48420),x=t(57775),j=t(54309),v=t(52596),b=t(9008),m=t(67294),y=t(47516),C=t(63750),w=t(22003),O=t(31122),k=t(7520),S=t(22663),P=t.n(S),N=t(36194),I=[],L={};for(var D in N.oY)for(var z in N.oY[D]){var E=D+z;"LinearNone"===E&&(E="Linear"),I.push(E),L[E]=N.oY[D][z]}var Z=L,R={enabled:!0,charge:-700,collision:!0,collisionStrength:20,centering:!0,centeringStrength:.2,linkStrength:.3,linkIts:1,alphaDecay:.05,alphaTarget:0,alphaMin:0,velocityDecay:.25,gravity:.3,gravityOn:!0,gravityLocal:!1},T={orphans:!1,dailies:!1,parent:"heading",filelessCites:!1,tagsBlacklist:[],tagsWhitelist:[],bad:!0,nodes:[],links:[],date:[]},B={particles:!1,particlesNumber:0,particlesWidth:4,arrows:!1,arrowsLength:1,arrowsPos:.5,arrowsColor:"",linkOpacity:.8,linkWidth:1,nodeRel:4,nodeOpacity:1,nodeResolution:12,labels:2,labelScale:1,labelFontSize:13,labelLength:40,labelWordWrap:25,labelLineSpace:1,highlight:!0,highlightNodeSize:1.2,highlightLinkSize:2,highlightFade:.8,highlightAnim:!0,animationSpeed:420,algorithmOptions:I,algorithmName:"SinusoidalOut",linkColorScheme:"gray.500",nodeColorScheme:["red.500","gray.600","yellow.500","green.500","cyan.500","blue.500","pink.500","purple.500","orange.500"],nodeHighlight:"purple.500",linkHighlight:"purple.500",backgroundColor:"white",emacsNodeColor:"gray.800",labelTextColor:"gray.900",labelBackgroundColor:"",labelBackgroundOpacity:.7,citeDashes:!0,citeDashLength:35,citeGapLength:15,citeLinkColor:"gray.700",citeLinkHighlightColor:"",citeNodeColor:"black",refDashes:!0,refDashLength:35,refGapLength:15,refLinkColor:"gray.700",refLinkHighlightColor:"",refNodeColor:"black",nodeSizeLinks:.5,nodeZoomSize:1.3},F={follow:"zoom",localSame:"add",zoomPadding:200,zoomSpeed:2e3},H={highlight:"hover",local:"double",follow:"never",context:"right",preview:"click",backgroundExitsLocal:!1},M=["red.500","orange.500","yellow.500","green.500","cyan.500","blue.500","pink.500","purple.500","white","gray.100","gray.200","gray.300","gray.400","gray.500","gray.600","gray.700","gray.800","gray.900","black"],A=t(11252),W=t(336),V=t(85675),X=t(72026),U=t(64115),_=t(49364),q=t(94030),G=t(46617),Q=t(50862),J=t(68928),K=t(55830),Y=t(2827);function $(e,n,t){t.send(JSON.stringify({command:e,data:n}))}function ee(e,n){$("open",{id:e.id},n)}var ne=t(85893),te=function(e){e.background;var n,t,r=e.target,i=(e.nodeType,e.coordinates),o=e.handleLocal,l=e.menuClose,s=e.scope,c=e.webSocket,a=e.setPreviewNode,d=(0,u.q)(),h=d.isOpen,g=d.onOpen,f=d.onClose;(0,m.useRef)();return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(A.v2,{defaultIsOpen:!0,closeOnBlur:!1,onClose:function(){return l()},children:(0,ne.jsxs)(A.qy,{zIndex:"overlay",bgColor:"white",color:"black",borderColor:"gray.500",maxWidth:"xs",position:"absolute",left:i.left,top:i.top,right:i.right,bottom:i.bottom,fontSize:"xs",children:[r&&(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(W.X,{size:"xs",isTruncated:!0,px:3,py:1,children:r.title}),(0,ne.jsx)(A.R,{borderColor:"gray.500"})]}),0!==s.nodeIds.length&&(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(A.sN,{onClick:function(){return o(r,"add")},icon:(0,ne.jsx)(q.I,{}),children:"Expand local graph at node"}),(0,ne.jsx)(A.sN,{onClick:function(){return o(r,"replace")},icon:(0,ne.jsx)(y.DvO,{}),children:"Open local graph for this node"})]}),null!==r&&void 0!==r&&null!==(n=r.properties)&&void 0!==n&&n.FILELESS?(0,ne.jsx)(A.sN,{icon:(0,ne.jsx)(Q.d,{}),onClick:function(){return function(e,n){$("create",{id:e.id,title:e.title,ref:e.properties.ROAM_REFS},n)}(r,c)},children:"Create node"}):(0,ne.jsx)(A.sN,{icon:(0,ne.jsx)(G.d,{}),onClick:function(){return ee(r,c)},children:"Open in Emacs"}),(null===r||void 0===r||null===(t=r.properties)||void 0===t?void 0:t.ROAM_REFS)&&(0,ne.jsx)(A.sN,{icon:(0,ne.jsx)(J.h,{}),children:"Open in Zotero"}),0===s.nodeIds.length&&(0,ne.jsx)(A.sN,{icon:(0,ne.jsx)(y.DvO,{}),onClick:function(){return o(r,"replace")},children:"Open local graph"}),(0,ne.jsx)(A.sN,{icon:(0,ne.jsx)(K.O,{}),onClick:function(){a(r)},children:"Preview"}),0===(null===r||void 0===r?void 0:r.level)&&(0,ne.jsx)(A.sN,{closeOnSelect:!1,icon:(0,ne.jsx)(Y.p,{color:"red.500"}),color:"red.500",onClick:g,children:"Permenantly delete note"})]})}),(0,ne.jsxs)(V.u_,{isCentered:!0,isOpen:h,onClose:f,children:[(0,ne.jsx)(V.ZA,{}),(0,ne.jsxs)(V.hz,{zIndex:"popover",children:[(0,ne.jsx)(V.xB,{children:"Delete node?"}),(0,ne.jsx)(V.ol,{}),(0,ne.jsx)(V.fe,{children:(0,ne.jsxs)(X.gC,{spacing:4,display:"flex",alignItems:"flex-start",children:[(0,ne.jsx)(U.x,{children:"This will permanently delete your note:"}),(0,ne.jsx)(U.x,{fontWeight:"bold",children:null===r||void 0===r?void 0:r.title}),0!==(null===r||void 0===r?void 0:r.level)&&(0,ne.jsx)(U.x,{children:"This will only delete the from this heading until but not including the next node. Your parent file and all other nodes will not be deleted."}),(0,ne.jsx)(U.x,{children:"Are you sure you want to do continue?"})]})}),(0,ne.jsxs)(V.mz,{children:[(0,ne.jsx)(_.z,{mr:3,onClick:function(){console.log("closing"),f(),l()},children:"Cancel"}),(0,ne.jsx)(_.z,{variant:"link",colorScheme:"red",ml:3,onClick:function(){console.log("aaaaa"),function(e,n){0===e.level&&$("delete",{id:e.id,file:e.file},n)}(r,c),f(),l()},children:"Delete node"})]})]})]})]})},re=t(45987),ie=t(67101),oe=t(35255),le=t(56884),se=function(e){var n=e.setJustification,t=(e.setIndent,e.setFont,e.justification),r=(e.setPreviewNode,e.canUndo),i=e.canRedo,o=(e.resetPreviewNode,e.previousPreviewNode),l=e.nextPreviewNode;return(0,ne.jsxs)(g.k,{pb:3,alignItems:"center",justifyContent:"space-between",pl:1,pr:1,children:[(0,ne.jsx)(g.k,{children:(0,ne.jsxs)(ie.h,{isAttached:!0,children:[(0,ne.jsx)(f.u,{label:"Go backward",children:(0,ne.jsx)(p.h,{variant:"subtle",icon:(0,ne.jsx)(oe.w,{}),"aria-label":"Previous node",disabled:!r,onClick:function(){return o()}})}),(0,ne.jsx)(f.u,{label:"Go forward",children:(0,ne.jsx)(p.h,{variant:"subtle",icon:(0,ne.jsx)(le.X,{}),"aria-label":"Next node",disabled:!i,onClick:function(){return l()}})})]})}),(0,ne.jsx)(g.k,{children:(0,ne.jsx)(f.u,{label:"Justify content",children:(0,ne.jsx)(p.h,{variant:"subtle","aria-label":"Justify content",icon:[(0,ne.jsx)(y.v9V,{},"justify"),(0,ne.jsx)(y.YSr,{},"left"),(0,ne.jsx)(y.RXA,{},"right"),(0,ne.jsx)(y.tr_,{},"center")][t],onClick:function(){return n((function(e){return(e+1)%4}))}})})})]})},ce=t(18835),ae=t.n(ce),ue=t(13816),de=t.n(ue),he=t(42728),ge=t.n(he),fe=t(77890),pe=t.n(fe),xe=t(94986),je=t.n(xe),ve=t(88541),be=t.n(ve),me=t(71167),ye=t.n(me),Ce=(t(85062),t(27431)),we=t.n(Ce),Oe=t(45170),ke=t(67273),Se=t(29356),Pe={".katex":{overflowX:"scroll"},h1:{color:"black",lineHeight:"1.2",fontSize:"20",fontWeight:"bold",marginBottom:3},h2:{fontSize:"18",marginBottom:2,color:"black"},h3:{fontSize:"16",fontWeight:"600 !important",marginBottom:".5em",color:"black"},h4:{fontSize:"14",fontWeight:"500 !important",marginBottom:".25em",fontStyle:"italic",color:"black"},ol:{paddingLeft:"5"},ul:{paddingLeft:"5"},p:{fontSize:"14",fontWeight:"500 !important",paddingBottom:".5em"},div:{hyphens:"auto !important"},".title":{textAlign:"center",marginBottom:".2em"},".subtitle":{textAlign:"center",fontSize:"medium",fontWeight:"bold",marginTop:0},".TODO":{color:"red.500"},".equationContainer":{display:"table",textAlign:"center",width:"100%"},".equation":{verticalAlign:"middle"},".equation-label":{display:"tableCell",textAlign:"right",verticalAlign:"middle"},".inlinetask":{padding:"10px",border:"2px solid gray",margin:"10px",background:"#ffffcc"},"#org-div-home-and-up":{textAlign:"right",fontSize:"70 % ",whiteSpace:"nowrap"},textarea:{overflowX:"auto"},".linenr":{fontSize:"smaller"},".org-info-js_info-navigation":{borderStyle:"none"},"#org-info-js_console-label":{fontSize:"10px",fontWeight:"bold",whiteSpace:"nowrap"},".org-info-js_search-highlight":{backgroundColor:"#ffff00",color:"#000000",fontWeight:"bold"},".org-svg":{width:"90%"},".DONE":{color:"green"},".priority":{fontFamily:"monospace",color:"orange"},".tag":{backgroundColor:"white",fontFamily:"monospace",padding:"2px",fontSize:"80%",fontWeight:"normal"},".timestamp":{color:"#bebebe"},".timestamp-kwd":{color:"#5f9ea0"},".org-right":{marginLeft:"auto",marginRight:"0px",textAlign:"right"},".org-left":{marginLeft:"0px",marginRight:"auto",textAlign:"left"},".org-center":{marginLeft:"auto",marginRight:"auto",textAlign:"center"},".underline":{textDecoration:"underline"},"#postamble p":{fontSize:"90%",margin:".2em"},"#preamble p":{fontSize:"90%",margin:".2em"},"p.verse":{marginLeft:"3%"},pre:{borderRadius:"3px",backgroundColor:"white",padding:"8pt",fontFamily:"monospace",overflow:"auto",margin:"1.2em"},"pre.src":{position:"relative",overflow:"auto"},"pre.src:before":{display:"none",position:"absolute",top:"-8px",right:"12px",padding:"3px",backgroundColor:"white"},"caption.t-above":{captionSide:"top"},"caption.t-bottom":{captionSide:"bottom"},"th.org-right":{textAlign:"center"},"th.org-left":{textAlign:"center"},"th.org-center":{textAlign:"center"},"td.org-right":{textAlign:"right"},"td.org-left":{textAlign:"left"},"td.org-center":{textAlign:"center"},".footpara":{display:"inline"},".footdef":{marginBottom:"1em"},".figure":{padding:"1em"},".figure p":{textAlign:"center"}},Ne=Pe,Ie=t(25675),Le=t(62520),De=t.n(Le),ze=function(e){var n=e.src,t=e.file,r=(0,m.useState)(null),i=(r[0],r[1],De().dirname(t)),o=encodeURIComponent(encodeURIComponent(De().join(i,n)));return(0,ne.jsx)(Ie.default,{layout:"responsive",loader:function(e){var n=e.src;e.width,e.quality;return"http://localhost:35901/img/".concat(n)},src:o,alt:"",width:"100%",height:"100%"})},Ee=function(e){var n=e.setSidebarHighlightedNode,t=e.setPreviewNode,r=e.nodeById,o=e.openContextMenu,s=e.href,c=e.children,u=(0,m.useContext)(Se.N).highlightColor,d=ht(u,(0,a.useTheme)()),h=(0,l.Z)((0,i.Z)(s.matchAll(/(.*?)\:(.*)/g))[0],3),g=(h[0],h[1],h[2]);return(0,ne.jsx)(U.x,{onMouseEnter:function(){return n(r[g])},onMouseLeave:function(){return n({})},tabIndex:0,display:"inline",overflow:"hidden",fontWeight:500,color:u,textDecoration:"underline",onContextMenu:function(e){e.preventDefault(),o(r[g],e)},onClick:function(){return t(r[g])},_hover:{textDecoration:"none",cursor:"pointer",bgColor:d+"22"},_focus:{outlineColor:u},children:c})},Ze=function e(n){var t,r,o,s,c,a=n.href,u=n.children,d=n.nodeById,g=n.setSidebarHighlightedNode,f=(n.previewNode,n.setPreviewNode),p=n.nodeByCite,x=n.openContextMenu,j=(0,m.useState)(null),v=j[0],b=j[1],y=(0,l.Z)((0,i.Z)(a.matchAll(/(.*?)\:(.*)/g))[0],3),C=(y[0],y[1]),w=y[2],O=(0,m.useState)(!1),k=O[0],S=O[1],P=function(e,n){if("id"===e)return n;if(e.includes("cite")){var t,r=null!==(t=p[n])&&void 0!==t&&t;return r?null!==r&&void 0!==r&&r.properties.FILELESS?"":null===r||void 0===r?void 0:r.id:""}return""}(C,w),N=encodeURIComponent(encodeURIComponent(null===(t=d[P])||void 0===t?void 0:t.file)),I=ae()().use(de()).use(ge()).use(ye()).use(we(),{createElement:m.createElement,components:{a:function(n){var t=n.children,r=n.href;return(0,ne.jsx)(e,{nodeByCite:p,setSidebarHighlightedNode:g,href:r,nodeById:d,setPreviewNode:f,openContextMenu:x,children:t})},img:function(e){var n,t=e.src;return(0,ne.jsx)(ze,{src:t,file:null===(n=d[P])||void 0===n?void 0:n.file})}}});return(0,m.useEffect)((function(){v||k&&fetch("http://localhost:35901/file/".concat(N)).then((function(e){return e.text()})).then((function(e){if("error"===e);else{var n=I.processSync(e).result;b(n)}})).catch((function(e){return console.log(e),"Could not fetch the text for some reason, sorry!\n\n This can happen because you have an id with forward slashes (/) in it."}))}),[k,v]),P?(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsxs)(Oe.J2,{gutter:12,trigger:"hover",placement:"top-start",children:[(0,ne.jsx)(Oe.xo,{children:(0,ne.jsx)(h.xu,{display:"inline",onMouseEnter:function(){return S(!0)},onMouseLeave:function(){return S(!1)},children:(0,ne.jsx)(Ee,{setSidebarHighlightedNode:g,setPreviewNode:f,nodeById:d,href:a,children:u,nodeByCite:p,openContextMenu:x},null!==(r=null===(o=d[P])||void 0===o?void 0:o.title)&&void 0!==r?r:P)})}),(0,ne.jsx)(ke.h,{children:(0,ne.jsxs)(Oe.yk,{boxShadow:"xl",position:"relative",zIndex:"tooltip",onMouseEnter:function(){var e;g(null!==(e=d[P])&&void 0!==e?e:{})},onMouseLeave:function(){g({})},children:[(0,ne.jsx)(Oe.QH,{}),(0,ne.jsx)(Oe.b,{pb:5,fontSize:"xs",px:5,position:"relative",zIndex:"tooltip",maxHeight:300,overflow:"scroll",children:(0,ne.jsx)(h.xu,{color:"black",sx:Ne,children:v})})]},null!==(s=null===(c=d[P])||void 0===c?void 0:c.title)&&void 0!==s?s:P)})]})}):(0,ne.jsx)(U.x,{display:"inline",color:"base.700",cursor:"not-allowed",children:u})},Re=function(e){var n=e.nodeById,t=e.setSidebarHighlightedNode,r=e.setPreviewNode,i=e.previewText,o=e.nodeByCite,l=e.previewNode,s=e.openContextMenu,c=ae()().use(de()).use(je()).use(be()).use(pe()).use(ge()).use(ye()).use(we(),{createElement:m.createElement,components:{a:function(e){var i=e.children,l=e.href;return(0,ne.jsx)(Ze,{nodeByCite:o,setSidebarHighlightedNode:t,href:"".concat(l),nodeById:n,setPreviewNode:r,openContextMenu:s,children:i})},img:function(e){var n=e.src;return(0,ne.jsx)(ze,{src:n,file:l.file})}}}),a=(0,m.useMemo)((function(){return c.processSync(i).result}),[i]);return(0,ne.jsx)(ne.Fragment,{children:a})},Te=function(e){var n=e.openContextMenu,t=e.setSidebarHighlightedNode,r=e.nodeById,i=e.nodeByCite,o=e.previewNode,l=e.setPreviewNode,s=(0,m.useState)(""),c=s[0],a=s[1],u=encodeURIComponent(encodeURIComponent(o.file));return(0,m.useEffect)((function(){fetch("http://localhost:35901/file/".concat(u)).then((function(e){return e.text()})).then((function(e){"error"!==e&&a(e)})).catch((function(e){return console.log(e),"Could not fetch the text for some reason, sorry!\n\n This can happen because you have an id with forward slashes (/) in it."}))}),[o.id]),(0,ne.jsx)(ne.Fragment,{children:(null===o||void 0===o?void 0:o.id)&&(0,ne.jsx)(Re,{nodeById:r,previewNode:o,setPreviewNode:l,previewText:c,nodeByCite:i,setSidebarHighlightedNode:t,openContextMenu:n})})},Be=function(e){var n,t=e.previewNode,r=e.setPreviewNode,i=e.setSidebarHighlightedNode,o=e.nodeById,s=e.linksByNodeId,c=e.nodeByCite,a=e.openContextMenu,u=(null!==(n=s[null===t||void 0===t?void 0:t.id])&&void 0!==n?n:[]).filter((function(e){var n=dt(e),r=(0,l.Z)(n,2),i=r[0];r[1];return i!==(null===t||void 0===t?void 0:t.id)})).map((function(e){return e.source}));return(0,ne.jsxs)(h.xu,{children:[(0,ne.jsx)(W.X,{pt:4,children:"Backlinks (".concat(u.length,")")}),(0,ne.jsx)(X.gC,{pt:2,spacing:3,alignItems:"start",divider:(0,ne.jsx)(X.cX,{borderColor:"gray.500"}),align:"stretch",color:"gray.800",children:(null===t||void 0===t?void 0:t.id)&&u.map((function(e){var n,t,l;n=null===(t=o[e])||void 0===t?void 0:t.title;return(0,ne.jsx)(h.xu,{overflow:"hidden",p:3,bg:"gray.300",width:"100%",children:(0,ne.jsx)(Ze,{nodeByCite:c,setSidebarHighlightedNode:i,href:"id:".concat(e),nodeById:o,setPreviewNode:r,openContextMenu:a,children:null===(l=o[e])||void 0===l?void 0:l.title})},e)}))})]})};function Fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function He(e){for(var n=1;n2&&void 0!==arguments[2]?arguments[2]:{},i=qe(e,null!==(t=r.storage)&&void 0!==t?t:localStorage),o=i.get(),l=void 0!==o?o:n,s=null!=o&&"object"===typeof o&&!1===Array.isArray(o)?Ue(Ue({},n),o):l;s!==o&&i.update(s);var c=(0,m.useState)(s),a=c[0],u=c[1];(0,m.useEffect)((function(){a!==s&&u(s)}),[e]);var d=function(e){e instanceof Function?u((function(n){var t=e(n);return i.update(t),t})):(u(e),i.update(e))};return[a,d]}function qe(e,n){return{get:function(){var t=n.getItem(e);if(t&&"undefined"!==t)return JSON.parse(t)},update:function(t){n.setItem(e,JSON.stringify(t))},remove:function(){n.removeItem(e)}}}var Ge=["style"];function Qe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Je(e){for(var n=1;n1,animateOpacity:!0,children:(0,ne.jsx)(h.xu,{paddingTop:2,children:(0,ne.jsx)(yn,{label:"Label Appearance Scale",value:5*n.labelScale,onChange:function(e){return t(An(An({},n),{},{labelScale:e/5}))}})})})]})]})})};function Vn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Xn(e){for(var n=1;n2&&void 0!==arguments[2]?arguments[2]:2e3,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:200;if("color"!==e){var l=Ne.current,s=ze.current,c=Ee.current,a=null!==(t=Oe.current[n])&&void 0!==t?t:[],u=Object.fromEntries([n].concat((0,i.Z)(a.flatMap((function(e){return[e.source,e.target]})))).map((function(e){return[e,{}]})));if("zoom"===e)return s.nodeIds.length&&O({nodeIds:[]}),void setTimeout((function(){return l.zoomToFit(r,o,(function(e){return u[e.id]}))}),50);if(!s.nodeIds.length)return O({nodeIds:[n]}),void setTimeout((function(){l.centerAt(0,0,10),l.zoomToFit(1,o)}),50);if("add"!==c.localSame)return O({nodeIds:[n]}),void setTimeout((function(){l.centerAt(0,0,10),l.zoomToFit(1,o)}),50);if(!s.nodeIds.includes(n)||!s.nodeIds.some((function(e){return u[e]})))return O({nodeIds:[n]}),void setTimeout((function(){l.centerAt(0,0,10),l.zoomToFit(1,o)}),50);O((function(e){return rt(rt({},e),{},{nodeIds:[].concat((0,i.Z)(e.nodeIds),[n])})})),setTimeout((function(){l.centerAt(0,0,10),l.zoomToFit(1,o)}),50)}};(0,m.useEffect)((function(){Ze.current=new w.Z("ws://localhost:35903"),Ze.current.addEventListener("open",(function(){console.log("Connection with Emacs established")})),Ze.current.addEventListener("message",(function(e){var n=Ee.current,t=JSON.parse(e.data);switch(t.type){case"graphdata":return function(e){var n,t,r,s=we.current;Pe.current=null!==(n=e.tags)&&void 0!==n?n:[];var c=null!==(t=e.nodes)&&void 0!==t?t:[],a=null!==(r=e.links)&&void 0!==r?r:[],u=c.reduce((function(e,n){var t;return rt(rt({},e),{},(0,o.Z)({},n.file,[].concat((0,i.Z)(null!==(t=e[n.file])&&void 0!==t?t:[]),[n])))}),{}),d=Object.keys(u).flatMap((function(e){var n,t=null!==(n=u[e])&&void 0!==n?n:[],r=t.find((function(e){return 0===e.level})),i=t.filter((function(e){return 0!==e.level}));return r?i.map((function(e){var n=t.filter((function(n){var t;return!(n.level>=e.level||n.pos>=e.pos||null===(t=e.olp)||void 0===t||!t.includes(n.title))})).reduce((function(e,n){return n.level>e.level&&(e=n),e}),r);return{source:e.id,target:(null===n||void 0===n?void 0:n.id)||r.id,type:"heading"}})):[]})),h=Object.keys(u).flatMap((function(e){var n,t=null!==(n=u[e])&&void 0!==n?n:[],r=t.find((function(e){return 0===e.level})),i=t.filter((function(e){return 0!==e.level}));return r?i.map((function(e){return{source:e.id,target:r.id,type:"parent"}})):[]}));we.current=Object.fromEntries(c.map((function(e){return[e.id,e]})));var g=[].concat((0,i.Z)(a),(0,i.Z)(d),(0,i.Z)(h)),f=[],p=g.map((function(e){var n=e.source,t=e.target;return we.current[n]?we.current[t]?e:(f.push({id:t,tags:["bad"],properties:{FILELESS:"yes",bad:"yes"},file:"",title:t,level:0,pos:0,olp:null}),rt(rt({},e),{},{type:"bad"})):(f.push({id:n,tags:["bad"],properties:{FILELESS:"yes",bad:"yes"},file:"",title:n,level:0,pos:0,olp:null}),rt(rt({},e),{},{type:"bad"}))}));we.current=rt(rt({},we.current),Object.fromEntries(f.map((function(e){return[e.id,e]})))),Oe.current=p.reduce((function(e,n){var t,r,l;return rt(rt({},e),{},(l={},(0,o.Z)(l,n.source,[].concat((0,i.Z)(null!==(t=e[n.source])&&void 0!==t?t:[]),[n])),(0,o.Z)(l,n.target,[].concat((0,i.Z)(null!==(r=e[n.target])&&void 0!==r?r:[]),[n])),l))}),{});var x=[].concat((0,i.Z)(c),f);ke.current=x.reduce((function(e,n){var t,r=null===(t=n.properties)||void 0===t?void 0:t.ROAM_REFS;if(null===r||void 0===r||!r.includes("cite"))return e;var i=r.replaceAll(/cite:(.*)/g,"$1");return i?rt(rt({},e),{},(0,o.Z)({},i,n)):e}),{});var j={nodes:x,links:p},v=Le.current;if(0===v.nodes.length){var b=JSON.parse(JSON.stringify(j));return Le.current=b,void U(b)}var m=[].concat((0,i.Z)(v.nodes.flatMap((function(e){var n,t=null!==(n=we.current[null===e||void 0===e?void 0:e.id])&&void 0!==n&&n;return t?[rt(rt({},e),t)]:[]}))),(0,i.Z)(Object.keys(we.current).filter((function(e){return!s[e]})).map((function(e){return we.current[e]})))),y=m.reduce((function(e,n,t){var r=null===n||void 0===n?void 0:n.id;return rt(rt({},e),{},(0,o.Z)({},r,t))}),{}),C=p.map((function(e){var n=dt(e),t=(0,l.Z)(n,2),r=t[0],i=t[1];return rt(rt({},e),{},{source:m[y[r]],target:m[y[i]]})}));U({nodes:m,links:C})}(t.data);case"variables":return void(Ie.current=t.data);case"theme":return De(["custom",t.data]);case"command":switch(t.data.commandName){case"local":var r=K.zoomSpeed,s=K.zoomPadding;Re("local",t.data.id,r,s),G(t.data.id);break;case"zoom":var c,a,u=(null===t||void 0===t||null===(c=t.data)||void 0===c?void 0:c.speed)||n.zoomSpeed,d=(null===t||void 0===t||null===(a=t.data)||void 0===a?void 0:a.padding)||n.zoomPadding;Re("zoom",t.data.id,u,d),G(t.data.id);break;case"follow":Re(n.follow,t.data.id,n.zoomSpeed,n.zoomPadding),G(t.data.id);break;default:return console.error("unknown message type",t.type)}}}))}),[]),(0,m.useEffect)((function(){var e=Ne.current;!e||b.nodeIds.length>1||(b.nodeIds.length||!N.gravityOn?setTimeout((function(){e.zoomToFit(5,200)}),50):e.zoomToFit())}),[b.nodeIds]);var Te=(0,j.iP)(),Be=(0,l.Z)(Te,2),Fe=Be[0],He=Be[1],Me=(0,m.useRef)(),Ae=(0,m.useState)(null),We=Ae[0],Ve=Ae[1],Xe=(0,m.useState)({left:0,top:0,right:void 0,bottom:void 0}),Ue=Xe[0],qe=Xe[1],Ge=(0,u.q)();(0,d.O)({ref:Me,handler:function(){console.log("click"),Ge.onClose()}});var Qe=function(e,n,t){qe(t||{left:n.pageX,top:n.pageY,right:void 0,bottom:void 0}),Ve(e),Ge.onOpen()},Je=function(e,n){"replace"!==n?b.nodeIds.includes(e.id)||O((function(n){return rt(rt({},n),{},{nodeIds:[].concat((0,i.Z)(n.nodeIds),[e.id])})})):O({nodeIds:[e.id]})},Ye=(0,m.useState)({type:"Graph",title:"Graph",icon:(0,ne.jsx)(y.DvO,{})}),$e=(Ye[0],Ye[1],_e("mainWindowWidth",Fe)),en=(0,l.Z)($e,2),nn=en[0],tn=en[1];return X?(0,ne.jsxs)(h.xu,{display:"flex",alignItems:"flex-start",flexDirection:"row",height:"100vh",overflow:"hidden",children:[(0,ne.jsx)(nt,{physics:N,setPhysics:I,threeDim:t,setThreeDim:r,filter:z,setFilter:E,visuals:A,setVisuals:W,mouse:re,setMouse:ie,behavior:K,setBehavior:Y,tagColors:a,setTagColors:x,tags:Pe.current}),(0,ne.jsx)(h.xu,{position:"absolute",children:(0,ne.jsx)(at,{ref:Ne,nodeById:we.current,linksByNodeId:Oe.current,webSocket:Ze.current,variables:Ie.current,physics:N,graphData:X,threeDim:t,emacsNodeId:q,filter:z,visuals:A,behavior:K,mouse:re,scope:b,setScope:O,tagColors:a,setPreviewNode:ae,sidebarHighlightedNode:je,windowWidth:Fe,windowHeight:He,openContextMenu:Qe,contextMenu:Ge,handleLocal:Je,mainWindowWidth:nn,setMainWindowWidth:tn,setContextMenuTarget:Ve})}),(0,ne.jsx)(h.xu,{position:"relative",zIndex:4,width:"100%",children:(0,ne.jsx)(g.k,{className:"headerBar",h:10,flexDir:"column",children:(0,ne.jsx)(g.k,{alignItems:"center",h:10,justifyContent:"flex-end",children:(0,ne.jsxs)(g.k,{height:"100%",flexDirection:"row",children:[b.nodeIds.length>0&&(0,ne.jsx)(f.u,{label:"Return to main graph",children:(0,ne.jsx)(p.h,{m:1,icon:(0,ne.jsx)(y.DvO,{}),"aria-label":"Exit local mode",onClick:function(){return O((function(e){return rt(rt({},e),{},{nodeIds:[]})}))},variant:"subtle"})}),(0,ne.jsx)(f.u,{label:me?"Close sidebar":"Open sidebar",children:(0,ne.jsx)(p.h,{m:1,icon:(0,ne.jsx)(C.iBV,{}),"aria-label":"Close file-viewer",variant:"subtle",onClick:me?Ce:ye})})]})})})}),(0,ne.jsx)(h.xu,{position:"relative",zIndex:4,children:(0,ne.jsx)(Ke,{isOpen:me,onOpen:ye,onClose:Ce,previewNode:pe,setPreviewNode:ae,canUndo:ge,canRedo:fe,previousPreviewNode:de,nextPreviewNode:he,resetPreviewNode:ue,setSidebarHighlightedNode:ve,openContextMenu:Qe,scope:b,setScope:O,windowWidth:Fe,nodeById:we.current,linksByNodeId:Oe.current,nodeByCite:ke.current})}),Ge.isOpen&&(0,ne.jsx)("div",{ref:Me,children:(0,ne.jsx)(te,{scope:b,target:We,background:!1,coordinates:Ue,handleLocal:Je,menuClose:Ge.onClose.bind(Ge),webSocket:Ze.current,setPreviewNode:ae})})]}):null}var at=(0,m.forwardRef)((function(e,n){var t=e.physics,s=e.graphData,u=e.threeDim,d=e.linksByNodeId,g=e.filter,f=e.emacsNodeId,p=e.nodeById,j=e.visuals,b=e.behavior,y=e.mouse,C=e.scope,w=(e.setScope,e.webSocket),k=e.tagColors,S=e.setPreviewNode,N=e.sidebarHighlightedNode,I=(e.windowWidth,e.windowHeight),L=(e.setContextMenuTarget,e.openContextMenu),D=e.contextMenu,z=e.handleLocal,E=e.variables,R=E.dailyDir,T=(E.roamDir,(0,m.useState)(null)),B=T[0],F=T[1],H=(0,a.useTheme)(),A=(0,m.useContext)(Se.N).emacsTheme,W=function(e,n,t){switch(e){case y.preview:S(n);break;case y.local:z(n,b.localSame);break;case y.follow:ee(n,w);break;case y.context:L(n,t)}},V=(0,m.useRef)(null);(0,m.useEffect)((function(){f&&F(p[f])}),[f]);var X=(0,m.useRef)({}),U=(0,m.useRef)({}),_=(0,m.useMemo)((function(){var e;U.current={};var n=null===s||void 0===s||null===(e=s.nodes)||void 0===e?void 0:e.filter((function(e){var n,t,r=e;return g.tagsBlacklist.length&&g.tagsBlacklist.some((function(e){var n;return(null===r||void 0===r||null===(n=r.tags)||void 0===n?void 0:n.indexOf(e))>-1}))||g.tagsWhitelist.length>0&&!g.tagsWhitelist.some((function(e){var n;return(null===r||void 0===r||null===(n=r.tags)||void 0===n?void 0:n.indexOf(e))>-1}))||g.filelessCites&&null!==r&&void 0!==r&&null!==(n=r.properties)&&void 0!==n&&n.FILELESS||g.bad&&r.properties.bad?(U.current=rt(rt({},U.current),{},(0,o.Z)({},r.id,r)),!1):!(g.dailies&&R&&null!==(t=r.file)&&void 0!==t&&t.includes(R))||(U.current=rt(rt({},U.current),{},(0,o.Z)({},r.id,r)),!1)})).filter((function(e){var n,t=(null!==(n=d[null===e||void 0===e?void 0:e.id])&&void 0!==n?n:[]).filter((function(e){return!U.current[e.source]&&!U.current[e.target]}));return!g.orphans||(g.parent?0!==t.length:0!==t.length&&t.some((function(e){return!["parent","heading"].includes(e.type)})))})),t=n.map((function(e){return e.id})),r=s.links.filter((function(e){var n=dt(e),r=(0,l.Z)(n,2),i=r[0],o=r[1];if(!t.includes(i)||!t.includes(o))return!1;var s=e;return g.parent?"heading"===g.parent?"parent"!==s.type:"heading"!==s.type:!["parent","heading"].includes(s.type)}));return X.current=r.reduce((function(e,n){var t,r,s,c=n,a=dt(c),u=(0,l.Z)(a,2),d=u[0],h=u[1];return rt(rt({},e),{},(s={},(0,o.Z)(s,d,[].concat((0,i.Z)(null!==(t=e[d])&&void 0!==t?t:[]),[c])),(0,o.Z)(s,h,[].concat((0,i.Z)(null!==(r=e[h])&&void 0!==r?r:[]),[c])),s))}),{}),{nodes:n,links:r}}),[g,s]),q=(0,m.useState)({nodes:[],links:[]}),G=q[0],Q=q[1];(0,m.useEffect)((function(){if(C.nodeIds.length){var e=C.nodeIds.length>1?G.nodes:[],n=e.map((function(e){return e.id})),t=function(e,n){var t=[e[0]],r=[],i=[e[0]];return Array.from({length:n},(function(){t.forEach((function(e){var n;(null!==(n=X.current[e])&&void 0!==n?n:[]).forEach((function(e){var n=dt(e),t=(0,l.Z)(n,2),o=t[0],s=t[1];i.includes(o)?i.includes(s)||r.push(s):r.push(o)}))})),t=r,r.forEach((function(e){return e&&i.push(e)})),r=[]})),i}(C.nodeIds,1),r=_.nodes.filter((function(r){var i;return e.length?!n.includes(r.id)&&(null!==(i=X.current[r.id])&&void 0!==i?i:[]).some((function(e){var n=dt(e),t=(0,l.Z)(n,2),r=t[0],i=t[1];return C.nodeIds.includes(r)||C.nodeIds.includes(i)})):t.includes(r.id)})).map((function(e){return rt(rt({},e),{},{x:0,y:0,vy:0,vx:0})})),o=[].concat((0,i.Z)(e),(0,i.Z)(r)),s=o.map((function(e){return e.id})),c=C.nodeIds.length>1?G.links:[],a=_.links.filter((function(e){var t=dt(e),r=(0,l.Z)(t,2),i=r[0],o=r[1];return!(c.length&&n.includes(o)&&n.includes(i))&&(s.includes(i)&&s.includes(o))})).map((function(e){var n=dt(e),t=(0,l.Z)(n,2);return{source:t[0],target:t[1]}})),u=[].concat((0,i.Z)(c),(0,i.Z)(a));Q({nodes:o,links:u})}}),[g,C,JSON.stringify(s),_.links,_.nodes]),(0,m.useEffect)((function(){(0,r.Z)(c().mark((function e(){var r,i;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.current,e.next=3,it;case 3:i=e.sent,!t.gravityOn||C.nodeIds.length&&!t.gravityLocal?(r.d3Force("x",null),r.d3Force("y",null),u&&r.d3Force("z",null)):(r.d3Force("x",i.forceX().strength(t.gravity)),r.d3Force("y",i.forceY().strength(t.gravity)),u&&r.d3Force("z",i.forceZ().strength(t.gravity))),t.centering?r.d3Force("center",i.forceCenter().strength(t.centeringStrength)):r.d3Force("center",null),t.linkStrength&&r.d3Force("link").strength(t.linkStrength),t.linkIts&&r.d3Force("link").iterations(t.linkIts),t.charge&&r.d3Force("charge").strength(t.charge),r.d3Force("collide",t.collision?i.forceCollide().radius(t.collisionStrength):null);case 10:case"end":return e.stop()}}),e)})))()}),[t,u,C]),(0,m.useEffect)((function(){var e;null===(e=n.current)||void 0===e||e.d3ReheatSimulation()}),[t,C.nodeIds.length]);var J=(0,m.useRef)(0),K=(0,m.useState)(1),Y=K[0],$=K[1],te=(0,x._7)((function(e){return $(e)}),{duration:j.animationSpeed,algorithm:Z[j.algorithmName]}),re=(0,l.Z)(te,2),ie=re[0],oe=re[1],le=(0,x._7)((function(e){return $(Math.min(Y,-1*(e-1)))}),{duration:j.animationSpeed,algorithm:Z[j.algorithmName]}),se=(0,l.Z)(le,2),ce=se[0],ae=se[1],ue=(0,m.useMemo)((function(){var e;if(!V.current)return{};var n=X.current[V.current.id];return n?Object.fromEntries([null===(e=V.current)||void 0===e?void 0:e.id].concat((0,i.Z)(n.flatMap((function(e){return[e.source,e.target]})))).map((function(e){return[e,{}]}))):{}}),[JSON.stringify(V.current),JSON.stringify(X.current)]);(0,m.useEffect)((function(){null!==N&&void 0!==N&&N.id?F(N):F(null)}),[N]);var de=(0,m.useRef)(null);(0,m.useEffect)((function(){if(V.current=B,B&&(de.current=B),!j.highlightAnim)return $(B?1:0);B?ie():(oe(),Y>.5?ce():$(0))}),[B]);var he=(0,m.useMemo)((function(){return Object.fromEntries(M.map((function(e){var n=ht(e,H),t=M.map((function(e){return[e,v.Z(n,ht(e,H))]}));return[e,Object.fromEntries(t)]})))}),[A]),ge=(0,m.useMemo)((function(){var e,n,t,r=null!==(e=X.current[null===(n=de.current)||void 0===n?void 0:n.id])&&void 0!==e?e:[];return Object.fromEntries([null===(t=de.current)||void 0===t?void 0:t.id].concat((0,i.Z)(r.flatMap((function(e){return dt(e)})))).map((function(e){return[e,{}]})))}),[JSON.stringify(B),de.current,X.current]),fe=function(e){var n,t,r,i,o,l=null!==(n=null===(t=X.current[e])||void 0===t?void 0:t.length)&&void 0!==n?n:0;return j.nodeColorScheme[(r=l,i=0,o=j.nodeColorScheme.length-1,Math.min(Math.max(r,i),o))]},pe=function(e,n){return X.current[e].length>X.current[n].length?fe(e):fe(n)},xe=(0,m.useMemo)((function(){return ht(j.labelTextColor,H)}),[j.labelTextColor,A]),je=(0,m.useMemo)((function(){return ht(j.labelBackgroundColor,H)}),[j.labelBackgroundColor,A]),ve=function(e){var n,t=null!==(n=X.current[e.id])&&void 0!==n?n:[],r=t.length?t.filter((function(e){return"parent"===e.type})).length:0,i=3+t.length*j.nodeSizeLinks-(g.parent?0:r);return 1===j.highlightNodeSize?i:i*(ue[e.id]||ge[e.id]?1+Y*(j.highlightNodeSize-1):1)},be=(0,m.useState)(!1),me=be[0],ye=be[1],Ce=(0,m.useState)(1),we=Ce[0],Oe=Ce[1],ke={graphData:C.nodeIds.length?G:_,height:I,backgroundColor:H.colors.gray[j.backgroundColor],warmupTicks:1===C.nodeIds.length?100:C.nodeIds.length>1?20:0,onZoom:function(e){var n=e.k;e.x,e.y;return Oe(n)},nodeColor:function(e){return function(e,n){var t=ue[e.id]||ge[e.id];if(j.emacsNodeColor&&e.id===f)return ht(j.emacsNodeColor,n);if(k&&e.tags.some((function(e){return k[e]}))){var r=k[e.tags.filter((function(e){return k[e]}))[0]];return he[r][j.backgroundColor](j.highlightFade*Y)}return j.citeNodeColor&&e.properties.ROAM_REFS&&e.properties.FILELESS?t?ht(j.citeNodeColor,n):he[j.citeNodeColor][j.backgroundColor](j.highlightFade*Y):j.refNodeColor&&e.properties.ROAM_REFS?t?ht(j.refNodeColor,n):he[j.refNodeColor][j.backgroundColor](j.highlightFade*Y):t?j.nodeHighlight?he[fe(e.id)][j.nodeHighlight](Y):ht(fe(e.id),n):he[fe(e.id)][j.backgroundColor](j.highlightFade*Y)}(e,H)},nodeRelSize:j.nodeRel,nodeVal:function(e){return ve(e)/Math.pow(we,j.nodeZoomSize)},nodeCanvasObject:function(e,n,t){if(e&&!me&&j.labels){var r=ge[e.id];if(!(t<=j.labelScale||1===j.labels)||ue[e.id]||r){var o=e.title,l=o.substring(0,j.labelLength),s=j.labelFontSize/(.75*Math.min(Math.max(.5,t),3)),c=[1.1*n.measureText(l).width,s].map((function(e){return e+.5*s})),a=Math.min(3*(t-j.labelScale)/j.labelScale,1),u=function(){return 1===j.labels||t<=j.labelScale?Y:ue[e.id]||ge[e.id]?Math.max(a,Y):1*a*(-1*(j.highlightFade*Y-1))},d=8*Math.cbrt(ve(e)*j.nodeRel);if(j.labelBackgroundColor&&j.labelBackgroundOpacity){var h=u()*j.labelBackgroundOpacity,g=gt(je,h);n.fillStyle=g,n.fillRect.apply(n,[e.x-c[0]/2,e.y-c[1]/2+d].concat((0,i.Z)(c)))}var f=u();n.textAlign="center",n.textBaseline="middle";var p=gt(xe,f);n.fillStyle=p,n.font="".concat(s,"px Sans-Serif");var x=P()(l,{width:j.labelWordWrap}).split("\n");(o.length>j.labelLength?[].concat((0,i.Z)(x.slice(0,-1)),["".concat(x.slice(-1),"...")]):x).forEach((function(t,r){n.fillText(t,e.x,e.y+d+j.labelLineSpace*s*r)}))}}},nodeCanvasObjectMode:function(){return"after"},linkDirectionalParticles:j.particles?j.particlesNumber:void 0,linkDirectionalArrowLength:j.arrows?j.arrowsLength:void 0,linkDirectionalArrowRelPos:j.arrowsPos,linkDirectionalArrowColor:j.arrowsColor?function(){return ht(j.arrowsColor,H)}:void 0,linkColor:function(e){var n,t="object"===typeof e.source?e.source.id:e.source,r="object"===typeof e.target?e.target.id:e.target,i=ut(e,V.current),o=ut(e,de.current),l=i||o,s=e;return j.refLinkColor&&"ref"===s.type?l&&(j.refLinkHighlightColor||j.linkHighlight)?he[j.refLinkColor][j.refLinkHighlightColor||j.linkHighlight](Y):he[j.refLinkColor][j.backgroundColor](j.highlightFade*Y):j.citeLinkColor&&null!==(n=s.type)&&void 0!==n&&n.includes("cite")?l&&(j.citeLinkHighlightColor||j.linkHighlight)?he[j.citeLinkColor][j.citeLinkHighlightColor||j.linkHighlight](Y):he[j.citeLinkColor][j.backgroundColor](j.highlightFade*Y):function(e,n,t,r){if(!j.linkHighlight&&!j.linkColorScheme&&!t)return ht(pe(e,n),r);if(!t&&!j.linkColorScheme){var i=pe(e,n);return he[i][j.backgroundColor](j.highlightFade*Y)}return t?j.linkHighlight||j.linkColorScheme?j.linkHighlight?j.linkColorScheme?he[j.linkColorScheme][j.linkHighlight](Y):he[pe(e,n)][j.linkHighlight](Y):ht(j.linkColorScheme,r):ht(pe(e,n),r):he[j.linkColorScheme][j.backgroundColor](j.highlightFade*Y)}(t,r,l,H)},linkWidth:function(e){if(1===j.highlightLinkSize)return j.linkWidth;var n=ut(e,V.current),t=ut(e,de.current);return n||t?j.linkWidth*(1+Y*(j.highlightLinkSize-1)):j.linkWidth},linkDirectionalParticleWidth:j.particlesWidth,d3AlphaDecay:t.alphaDecay,d3AlphaMin:t.alphaMin,d3VelocityDecay:t.velocityDecay,onNodeClick:function(e,n){var t=e,r=n.timeStamp-J.current<200;if(J.current=n.timeStamp,r)return W("double",t,n);var i=J.current;return setTimeout((function(){if(J.current===i)return W("click",t,n)}),200)},onNodeHover:function(e){j.highlight&&(B||(ae(),$(0)),F(e))},onNodeRightClick:function(e,n){W("right",e,n)},onNodeDrag:function(e){F(e),ye(!0)},onNodeDragEnd:function(){F(null),ye(!1)}};return(0,ne.jsx)(h.xu,{overflow:"hidden",onClick:D.onClose,children:u?(0,ne.jsx)(lt,rt(rt({ref:n},ke),{},{nodeThreeObjectExtend:!0,backgroundColor:H.colors.white,nodeOpacity:j.nodeOpacity,nodeResolution:j.nodeResolution,linkOpacity:j.linkOpacity,nodeThreeObject:function(e){if(j.labels&&(!(j.labels<3)||ue[e.id])){var n=new O.Z(e.title.substring(0,40));return n.color=ht(j.labelTextColor,H),n.backgroundColor=ht(j.labelBackgroundColor,H),n.padding=2,n.textHeight=8,n}}})):(0,ne.jsx)(ot,rt(rt({ref:n},ke),{},{linkLineDash:function(e){var n,t=e;return j.citeDashes&&null!==(n=t.type)&&void 0!==n&&n.includes("cite")?[j.citeDashLength,j.citeGapLength]:j.refDashes&&"ref"==t.type?[j.refDashLength,j.refGapLength]:null}}))})}));function ut(e,n){var t,r;return(null===(t=e.source)||void 0===t?void 0:t.id)===(null===n||void 0===n?void 0:n.id)||(null===(r=e.target)||void 0===r?void 0:r.id)===(null===n||void 0===n?void 0:n.id)}function dt(e){return["object"===typeof e.source?e.source.id:e.source,"object"===typeof e.target?e.target.id:e.target]}function ht(e,n){return e.split(".").reduce((function(e,n){return e[n]}),n.colors)}function gt(e,n){return"rgba("+(e=e.replace("#","")).match(new RegExp("(.{"+e.length/3+"})","g")).map((function(n){return parseInt(e.length%2?n+n:n,16)})).concat(isFinite(n)?n:1).join(",")+")"}},45301:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(6972)}])}},function(e){e.O(0,[774,737,13,874,573,446,827,196,888,179],(function(){return n=45301,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file -- cgit v1.2.3