@cyber-harbour/ui 2.1.13 → 2.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import {a,w,x,u,c,l,z,Pa,pb,ma,Ya,Bb,y,kb,G,ib,H,lb}from'./chunk-TTMXYQDC.mjs';export{tb as Alert,A as AlertIcon,za as AndroidIcon,B as ApiIcon,C as ArrowCircleTopRightIcon,D as ArrowRightIcon,ia as BallsMenu,pb as Box,q as BreakpointProvider,E as BugReportIcon,Na as BurgerMenuIcon,sa as BusIcon,z as Button,F as CalendarIcon,ta as CarIcon,Jb as ChatField,ja as CheckIcon,vb as Checkbox,ka as ChevronDownIcon,G as ChevronLeftIcon,H as ChevronRightIcon,la as ChevronUpIcon,Oa as ClockIcon,I as CloseCircleIcon,J as ClosedLockIcon,Cb as ContentLoader,fb as ContextMenu,gb as ContextMenuDelimiter,qa as CrossIcon,K as DataSetsIcon,L as DeepSearchIcon,M as DisabledVisibleIcon,N as DocsIcon,O as DownloadIcon,yb as Drawer,Ab as DrawerBody,zb as DrawerHeader,P as EditUserIcon,rb as EmptyData,Q as EnableVisibleIcon,R as EnterArrowLeftIcon,Ra as FaceSearchIcon,mb as FileField,xa as FileIcon,S as FiltersIcon,Ia as FlashIcon,nb as FlexContainer,ob as FlexItem,Ba as FolderAlertIcon,Ja as FolderInfoIcon,ab as Header,bb as HeaderDelimeter,cb as HeaderSection,T as HomepageIcon,Qa as ImageIcon,oa as InfoCircleFilledIcon,U as InfoCircleIcon,kb as Input,ya as IosIcon,ub as Label,qb as Line,wb as LinerProgress,Za as ListMenu,_a as ListMenuItem,$a as ListMenuSection,V as MapRadarIcon,ra as MaximizeIcon,Sa as MessageAsteriskIcon,Aa as MicrosoftIcon,Pa as MinusIcon,Eb as Modal,Gb as ModalBody,Hb as ModalFooter,Fb as ModalHeader,W as MoonIcon,X as OpenLockIcon,Y as OrganizationIcon,Db as Overlay,eb as Pagination,Ea as PassportIcon,Z as PasswordFinderIcon,Ga as PencilIcon,_ as PhonebookIcon,va as PlaneIcon,ma as PlusIcon,Fa as PointIcon,$ as PrintIcon,aa as Profiler2Icon,ba as ProfilerIcon,Kb as ProgressLoader,Ca as RelationIcon,Da as RelationPointsIcon,Ka as RotateLeftIcon,La as RotateRightIcon,jb as RowActionsMenu,ca as SandBoxIcon,da as SearchIcon,ib as Select,wa as ShipIcon,Ua as Sidebar,Ta as SidebarContext,Wa as SidebarDelimeter,Va as SidebarItem,Xa as SidebarSection,ea as StatisticIcon,fa as SunIcon,xb as Switch,db as Table,sb as Tag,Ib as TailwindExample,s as ThemeProvider,Bb as Tooltip,Ya as Typography,pa as UnfoldIcon,ga as UpRightArrowCircleIcon,Ma as UploadImageIcon,Ha as UserInCircleIcon,na as UsersIcon,ha as VectorIcon,ua as WayIcon,f as convertPaletteToRem,w as createComponent,x as createStyledComponent,p as darkTheme,o as darkThemePx,t as destructSpaceProps,u as generatePropertySpaceStyle,k as getBreakpoint,h as getButtonSizeStyles,g as getButtonStyles,i as getInputStyles,v as getResponsiveProps,j as getTypographyStyles,l as hexToRgba,n as lightTheme,m as lightThemePx,e as propToRem,c as pxToRem,d as remToPx,b as resolveThemeColor,r as useBreakpoint,hb as useContextMenuControl,y as useTheme}from'./chunk-TTMXYQDC.mjs';import zr,{styled,useTheme}from'styled-components';export{ServerStyleSheet,StyleSheetManager}from'styled-components';import {jsx,jsxs}from'react/jsx-runtime';import At,{useState,useRef,useCallback,useEffect,Fragment,forwardRef,useMemo,useImperativeHandle,useLayoutEffect,memo}from'react';import _r from'lodash.clonedeep';import {scaleOrdinal,schemeCategory10,forceSimulation,forceLink,forceManyBody,forceX,forceY,forceCenter,forceCollide}from'd3';import Rr from'react-content-loader';import {renderAsync}from'docx-preview';import lo from'lodash.throttle';import ho from'@uiw/react-codemirror';import {vscodeDark}from'@uiw/codemirror-theme-vscode';import {javascript}from'@codemirror/lang-javascript';import {json}from'@codemirror/lang-json';import {html}from'@codemirror/lang-html';import {css}from'@codemirror/lang-css';import {python}from'@codemirror/lang-python';import {java}from'@codemirror/lang-java';import {cpp}from'@codemirror/lang-cpp';import {php}from'@codemirror/lang-php';import {rust}from'@codemirror/lang-rust';import {xml}from'@codemirror/lang-xml';import {yaml}from'@codemirror/lang-yaml';import {markdown}from'@codemirror/lang-markdown';import {sql}from'@codemirror/lang-sql';import To from'react-markdown';import No from'remark-gfm';import Lo from'copy-to-clipboard';import {parse,isValid,getYear,format,getMonth,startOfWeek,getWeeksInMonth,startOfMonth,previousMonday,differenceInDays}from'date-fns';import {Popover}from'react-tiny-popover';import {createPortal}from'react-dom';var Pi=a(({children:r,className:o})=>jsx(yr,{className:o,children:r}),"PageLayout"),yr=styled.div`
1
+ import {a,w,x,u,c,l,z,Pa,pb,ma,Ya,Bb,y,kb,G,ib,H,lb}from'./chunk-TTMXYQDC.mjs';export{tb as Alert,A as AlertIcon,za as AndroidIcon,B as ApiIcon,C as ArrowCircleTopRightIcon,D as ArrowRightIcon,ia as BallsMenu,pb as Box,q as BreakpointProvider,E as BugReportIcon,Na as BurgerMenuIcon,sa as BusIcon,z as Button,F as CalendarIcon,ta as CarIcon,Jb as ChatField,ja as CheckIcon,vb as Checkbox,ka as ChevronDownIcon,G as ChevronLeftIcon,H as ChevronRightIcon,la as ChevronUpIcon,Oa as ClockIcon,I as CloseCircleIcon,J as ClosedLockIcon,Cb as ContentLoader,fb as ContextMenu,gb as ContextMenuDelimiter,qa as CrossIcon,K as DataSetsIcon,L as DeepSearchIcon,M as DisabledVisibleIcon,N as DocsIcon,O as DownloadIcon,yb as Drawer,Ab as DrawerBody,zb as DrawerHeader,P as EditUserIcon,rb as EmptyData,Q as EnableVisibleIcon,R as EnterArrowLeftIcon,Ra as FaceSearchIcon,mb as FileField,xa as FileIcon,S as FiltersIcon,Ia as FlashIcon,nb as FlexContainer,ob as FlexItem,Ba as FolderAlertIcon,Ja as FolderInfoIcon,ab as Header,bb as HeaderDelimeter,cb as HeaderSection,T as HomepageIcon,Qa as ImageIcon,oa as InfoCircleFilledIcon,U as InfoCircleIcon,kb as Input,ya as IosIcon,ub as Label,qb as Line,wb as LinerProgress,Za as ListMenu,_a as ListMenuItem,$a as ListMenuSection,V as MapRadarIcon,ra as MaximizeIcon,Sa as MessageAsteriskIcon,Aa as MicrosoftIcon,Pa as MinusIcon,Eb as Modal,Gb as ModalBody,Hb as ModalFooter,Fb as ModalHeader,W as MoonIcon,X as OpenLockIcon,Y as OrganizationIcon,Db as Overlay,eb as Pagination,Ea as PassportIcon,Z as PasswordFinderIcon,Ga as PencilIcon,_ as PhonebookIcon,va as PlaneIcon,ma as PlusIcon,Fa as PointIcon,$ as PrintIcon,aa as Profiler2Icon,ba as ProfilerIcon,Kb as ProgressLoader,Ca as RelationIcon,Da as RelationPointsIcon,Ka as RotateLeftIcon,La as RotateRightIcon,jb as RowActionsMenu,ca as SandBoxIcon,da as SearchIcon,ib as Select,wa as ShipIcon,Ua as Sidebar,Ta as SidebarContext,Wa as SidebarDelimeter,Va as SidebarItem,Xa as SidebarSection,ea as StatisticIcon,fa as SunIcon,xb as Switch,db as Table,sb as Tag,Ib as TailwindExample,s as ThemeProvider,Bb as Tooltip,Ya as Typography,pa as UnfoldIcon,ga as UpRightArrowCircleIcon,Ma as UploadImageIcon,Ha as UserInCircleIcon,na as UsersIcon,ha as VectorIcon,ua as WayIcon,f as convertPaletteToRem,w as createComponent,x as createStyledComponent,p as darkTheme,o as darkThemePx,t as destructSpaceProps,u as generatePropertySpaceStyle,k as getBreakpoint,h as getButtonSizeStyles,g as getButtonStyles,i as getInputStyles,v as getResponsiveProps,j as getTypographyStyles,l as hexToRgba,n as lightTheme,m as lightThemePx,e as propToRem,c as pxToRem,d as remToPx,b as resolveThemeColor,r as useBreakpoint,hb as useContextMenuControl,y as useTheme}from'./chunk-TTMXYQDC.mjs';import zr,{styled,useTheme}from'styled-components';export{ServerStyleSheet,StyleSheetManager}from'styled-components';import {jsx,jsxs}from'react/jsx-runtime';import At,{useState,useRef,useCallback,useEffect,Fragment,forwardRef,useMemo,useImperativeHandle,useLayoutEffect,memo}from'react';import _r from'lodash.clonedeep';import {scaleOrdinal,schemeCategory10,forceSimulation,forceLink,forceManyBody,forceX,forceY,forceCenter,forceCollide}from'd3';import Rr from'react-content-loader';import {renderAsync}from'docx-preview';import lo from'lodash.throttle';import ho from'@uiw/react-codemirror';import {vscodeLight}from'@uiw/codemirror-theme-vscode';import {javascript}from'@codemirror/lang-javascript';import {json}from'@codemirror/lang-json';import {html}from'@codemirror/lang-html';import {css}from'@codemirror/lang-css';import {python}from'@codemirror/lang-python';import {java}from'@codemirror/lang-java';import {cpp}from'@codemirror/lang-cpp';import {php}from'@codemirror/lang-php';import {rust}from'@codemirror/lang-rust';import {xml}from'@codemirror/lang-xml';import {yaml}from'@codemirror/lang-yaml';import {markdown}from'@codemirror/lang-markdown';import {sql}from'@codemirror/lang-sql';import Do from'react-markdown';import Mo from'remark-gfm';import Io from'copy-to-clipboard';import {parse,isValid,getYear,format,getMonth,startOfWeek,getWeeksInMonth,startOfMonth,previousMonday,differenceInDays}from'date-fns';import {Popover}from'react-tiny-popover';import {createPortal}from'react-dom';var Si=a(({children:r,className:o})=>jsx(yr,{className:o,children:r}),"PageLayout"),yr=styled.div`
2
2
  display: grid;
3
3
  min-height: 100dvh;
4
4
  position: relative;
@@ -9,11 +9,11 @@ import {a,w,x,u,c,l,z,Pa,pb,ma,Ya,Bb,y,kb,G,ib,H,lb}from'./chunk-TTMXYQDC.mjs';e
9
9
  & > header {
10
10
  grid-area: header;
11
11
  }
12
- `;var Ni=a(({children:r,className:o})=>jsx(wr,{className:o,children:r}),"PageContent"),wr=styled.main`
12
+ `;var Ei=a(({children:r,className:o})=>jsx(wr,{className:o,children:r}),"PageContent"),wr=styled.main`
13
13
  grid-area: content;
14
14
  min-width: 0;
15
15
  background: ${({theme:r})=>r.colors.backgroundBase};
16
- `;var zi=a(({children:r,className:o,top:s=0})=>jsx(Dr,{className:o,$top:s,onClick:h=>h.stopPropagation(),children:r}),"SubNav"),Dr=styled.div(({theme:r,$top:o})=>`
16
+ `;var ji=a(({children:r,className:o,top:s=0})=>jsx(Dr,{className:o,$top:s,onClick:h=>h.stopPropagation(),children:r}),"SubNav"),Dr=styled.div(({theme:r,$top:o})=>`
17
17
  display: flex;
18
18
  flex-direction: column;
19
19
  justify-content: space-between;
@@ -33,25 +33,25 @@ import {a,w,x,u,c,l,z,Pa,pb,ma,Ya,Bb,y,kb,G,ib,H,lb}from'./chunk-TTMXYQDC.mjs';e
33
33
  position: sticky;
34
34
  border-right: 1px solid ${r.colors.stroke.light};
35
35
  }
36
- `);var Yi=w(({maxWidth:r,...o})=>jsx(Mr,{...o,$maxWidth:r})),Mr=x(styled.div(({theme:r,$maxWidth:o,px:s=20})=>`
36
+ `);var qi=w(({maxWidth:r,...o})=>jsx(Sr,{...o,$maxWidth:r})),Sr=x(styled.div(({theme:r,$maxWidth:o,px:s=20})=>`
37
37
  ${u(r,"padding-inline",s)}
38
38
  width: 100%;
39
39
  min-width: 0;
40
40
  max-width: ${typeof o=="number"?c(o,r.baseSize):o||"100%"};
41
- `),{ignoreStyles:["padding-inline"]});var Er=20,Ir="splitter_columns_widths",It=a((r,o,s)=>{let h=localStorage.getItem(r);if(h)try{let g=JSON.parse(h);if(Array.isArray(g)&&g.length===o)return g}catch{}else if(s.length===o)return s;return Array(o).fill(100/o)},"getSavedWidths"),Ji=a(({columns:r,initialWidths:o,layoutClassname:s="",splitterClassname:h="",minWidth:g=Er,storageKey:b=Ir})=>{let[f,k]=useState(()=>It(b,r.length,o)),T=useRef(null),L=useRef(null),z=useRef(g),x=useRef(f),C=useCallback(B=>{if(L.current===null||!T.current)return;let S=T.current.getBoundingClientRect(),D=S.width,Z=B-S.left,G=[...x.current],ee=L.current,J=ee+1,fe=G.slice(0,ee).reduce((be,Se)=>be+Se,0),ge=Z/D*100-fe,Pe=G[ee]+G[J]-ge;ge>=z.current&&Pe>=z.current&&(G[ee]=ge,G[J]=Pe,k(G),x.current=G);},[]),E=useCallback(B=>C(B.clientX),[C]),t=useCallback(B=>{B.preventDefault(),C(B.touches[0].clientX);},[C]),F=useCallback(()=>{L.current=null,localStorage.setItem(b,JSON.stringify(x.current)),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",F),document.removeEventListener("touchmove",t),document.removeEventListener("touchend",F);},[E,t,b]),j=useCallback(B=>S=>{S.preventDefault(),L.current=B,document.addEventListener("mousemove",E,{passive:false}),document.addEventListener("mouseup",F);},[E,F]),y=useCallback(B=>S=>{S.preventDefault(),L.current=B,document.addEventListener("touchmove",t,{passive:false}),document.addEventListener("touchend",F);},[t,F]);return useEffect(()=>{let B=It(b,r.length,o);x.current=B,k(B);},[r.length,o,b]),jsx("div",{ref:T,className:`flex select-none ${s}`,children:r.map(({content:B,className:S},D)=>jsxs(Fragment,{children:[jsx("div",{className:S,style:{flex:`${f[D]} 1 0%`},children:B}),D<r.length-1&&jsx("div",{onMouseDown:j(D),onTouchStart:y(D),className:`hidden lg:flex! lg:sticky lg:top-0 border-s border-gray-200 ${h}`,children:jsx("span",{className:"absolute top-1/2 start-1/2 -translate-x-1/2 -translate-y-1/2 block w-4 h-6 flex justify-center items-center bg-white border border-gray-200 text-gray-400 rounded-md cursor-col-resize hover:bg-gray-100",children:jsxs("svg",{className:"shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"9",cy:"12",r:"1"}),jsx("circle",{cx:"9",cy:"5",r:"1"}),jsx("circle",{cx:"9",cy:"19",r:"1"}),jsx("circle",{cx:"15",cy:"12",r:"1"}),jsx("circle",{cx:"15",cy:"5",r:"1"}),jsx("circle",{cx:"15",cy:"19",r:"1"})]})})})]},`${D}`))})},"SplitterLayout");var Br=zr.div`
41
+ `),{ignoreStyles:["padding-inline"]});var Er=20,Ir="splitter_columns_widths",It=a((r,o,s)=>{let h=localStorage.getItem(r);if(h)try{let g=JSON.parse(h);if(Array.isArray(g)&&g.length===o)return g}catch{}else if(s.length===o)return s;return Array(o).fill(100/o)},"getSavedWidths"),Qi=a(({columns:r,initialWidths:o,layoutClassname:s="",splitterClassname:h="",minWidth:g=Er,storageKey:b=Ir})=>{let[f,x]=useState(()=>It(b,r.length,o)),C=useRef(null),L=useRef(null),I=useRef(g),k=useRef(f),T=useCallback(j=>{if(L.current===null||!C.current)return;let P=C.current.getBoundingClientRect(),D=P.width,Z=j-P.left,G=[...k.current],ee=L.current,J=ee+1,ge=G.slice(0,ee).reduce((we,Pe)=>we+Pe,0),me=Z/D*100-ge,Me=G[ee]+G[J]-me;me>=I.current&&Me>=I.current&&(G[ee]=me,G[J]=Me,x(G),k.current=G);},[]),F=useCallback(j=>T(j.clientX),[T]),t=useCallback(j=>{j.preventDefault(),T(j.touches[0].clientX);},[T]),z=useCallback(()=>{L.current=null,localStorage.setItem(b,JSON.stringify(k.current)),document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",z),document.removeEventListener("touchmove",t),document.removeEventListener("touchend",z);},[F,t,b]),B=useCallback(j=>P=>{P.preventDefault(),L.current=j,document.addEventListener("mousemove",F,{passive:false}),document.addEventListener("mouseup",z);},[F,z]),y=useCallback(j=>P=>{P.preventDefault(),L.current=j,document.addEventListener("touchmove",t,{passive:false}),document.addEventListener("touchend",z);},[t,z]);return useEffect(()=>{let j=It(b,r.length,o);k.current=j,x(j);},[r.length,o,b]),jsx("div",{ref:C,className:`flex select-none ${s}`,children:r.map(({content:j,className:P},D)=>jsxs(Fragment,{children:[jsx("div",{className:P,style:{flex:`${f[D]} 1 0%`},children:j}),D<r.length-1&&jsx("div",{onMouseDown:B(D),onTouchStart:y(D),className:`hidden lg:flex! lg:sticky lg:top-0 border-s border-gray-200 ${h}`,children:jsx("span",{className:"absolute top-1/2 start-1/2 -translate-x-1/2 -translate-y-1/2 block w-4 h-6 flex justify-center items-center bg-white border border-gray-200 text-gray-400 rounded-md cursor-col-resize hover:bg-gray-100",children:jsxs("svg",{className:"shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"9",cy:"12",r:"1"}),jsx("circle",{cx:"9",cy:"5",r:"1"}),jsx("circle",{cx:"9",cy:"19",r:"1"}),jsx("circle",{cx:"15",cy:"12",r:"1"}),jsx("circle",{cx:"15",cy:"5",r:"1"}),jsx("circle",{cx:"15",cy:"19",r:"1"})]})})})]},`${D}`))})},"SplitterLayout");var jr=zr.div`
42
42
  width: 100%;
43
43
  height: 100%;
44
44
  display: flex;
45
45
  align-items: center;
46
46
  justify-content: center;
47
- `,Fr=a(({width:r=280,height:o=280})=>{let s=useTheme();return jsx(Br,{children:jsxs(Rr,{foregroundColor:s.contentLoader.foreground,backgroundColor:s.contentLoader.background,width:r,height:o,viewBox:"0 0 280 280",children:[jsx("path",{d:"m55 38-0.97266 0.22852 7.0801 30.092-18.355-20.979-0.75195 0.6582 19.596 22.395 0.43164 1.834 0.97266-0.22852 0.75195-0.6582-0.37695-0.42969 9.625-27.912-0.94531-0.32617-9.4375 27.371-0.10547-0.12109zm8 34-0.78516 0.61914 0.0957 0.12305-12.311 13.258 0.73242 0.67969 12.205-13.145 14.277 18.084 0.78516-0.61914-14.373-18.207 0.10547-0.11328zm15 19-0.48438 0.875 46.992 25.996 8e-3 4e-3 20.506 11.592-28.182 4.5449 0.15998 0.98819 29.418-4.7441 0.25 0.14062-12.555 24.143 0.88672 0.46094 13-25 15 25 26 30v18l-11 18 0.85352 0.52148 9.8008-16.039-4.6543 33.518 0.99023 0.13867 4.7793-34.408 7.2305 16.27 0.91406-0.40625-7.9141-17.807v-17.104l18 12.316 0.56445-0.82617-18.896-12.928-25.855-29.836-14.633-24.387 0.01562-0.02344h23.805v-1h-23.152l13.848-21.234 55.201-28.791-0.45898-0.88476 0.77734 0.62305 11.402-14.25 16.668-11.842-0.58008-0.81641-16.785 11.928-11.486 14.355-55.434 28.912-14.277 21.893-7.7617-27.166-0.96094 0.27344 7.7227 27.031-1.1191 0.17969-21.604-12.211zm140.43-12.912-6.957-17.338-0.92773 0.37305 6.957 17.338zm-6.957-17.338 0.72266 0.69336 16.232-16.896-0.7207-0.69336zm-3.4766 137.25 5 15 0.94922-0.31641-5-15zm-91-63-0.48047-0.87695-31 17 0.48047 0.87695zm-31 17 5 18 0.96289-0.26758-5-18zm0 0-0.70703-0.70703-12.898 12.898-17.881 9.9336 0.48633 0.875 18-10zm5 18-0.64062-0.76758-18 15 0.64062 0.76758z"}),jsx("circle",{cx:"229.92",cy:"63.7318",r:"5",transform:"rotate(173.661 229.92 63.7318)"}),jsx("circle",{cx:"227.711",cy:"43.8541",r:"5",transform:"rotate(173.661 227.711 43.8541)"}),jsx("circle",{cx:"211.478",cy:"60.7499",r:"5",transform:"rotate(173.661 211.478 60.7499)"}),jsx("circle",{cx:"218.434",cy:"78.0877",r:"5",transform:"rotate(173.661 218.434 78.0877)"}),jsx("circle",{cx:"246.705",cy:"51.8054",r:"5",transform:"rotate(173.661 246.705 51.8054)"}),jsx("circle",{cx:"42",cy:"48",r:"5"}),jsx("circle",{cx:"55",cy:"38",r:"5"}),jsx("circle",{cx:"73",cy:"43",r:"5"}),jsx("circle",{cx:"63",cy:"72",r:"5"}),jsx("circle",{cx:"50",cy:"86",r:"5"}),jsx("circle",{cx:"78",cy:"91",r:"5"}),jsx("circle",{cx:"73",cy:"165",r:"5"}),jsx("circle",{cx:"73",cy:"185",r:"5"}),jsx("circle",{cx:"91",cy:"170",r:"5"}),jsx("circle",{cx:"86",cy:"152",r:"5"}),jsx("circle",{cx:"148",cy:"130",r:"5"}),jsx("circle",{cx:"189",cy:"185",r:"5"}),jsx("circle",{cx:"163",cy:"107",r:"5"}),jsx("circle",{cx:"140",cy:"102",r:"5"}),jsx("circle",{cx:"117",cy:"135",r:"5"}),jsx("circle",{cx:"125",cy:"117",r:"5"}),jsx("circle",{cx:"208",cy:"198",r:"5"}),jsx("circle",{cx:"189",cy:"203",r:"5"}),jsx("circle",{cx:"198",cy:"221",r:"5"}),jsx("circle",{cx:"178",cy:"221",r:"5"}),jsx("circle",{cx:"184",cy:"239",r:"5"}),jsx("circle",{cx:"213",cy:"213",r:"5"}),jsx("circle",{cx:"173",cy:"130",r:"5"}),jsx("circle",{cx:"163",cy:"155",r:"5"}),jsx("circle",{cx:"135",cy:"155",r:"5"}),jsx("circle",{cx:"55",cy:"175",r:"5"})]})})},"GraphLoader"),zt=Fr;var Be=typeof window<"u"&&window.devicePixelRatio||1;function eo(r){return !r||r.length===0?[]:r.map(o=>{let s=new Image;s.src=o.img;let h=new Image;return h.src=o.hoverImg,{...o,normalImg:s,hoverImg:h}})}a(eo,"prepareButtonImages");var W={fontSize:3,nodeSizeBase:30,nodeAreaFactor:2,textPaddingFactor:.9,gridSpacing:20,dotSize:1,maxZoom:4},to=forwardRef(({loading:r,width:o,height:s,graphData:h,buttons:g=[],onNodeClick:b,onBackgroundClick:f,onNodeHover:k,onLinkHover:T,onLinkClick:L},z)=>{let x=useTheme(),[C,E]=useState(true),t=useRef({transform:{x:0,y:0,k:1},isPanning:false,hoveredNode:null,hoveredLink:null,draggedNode:null,selectedNode:null,hoveredButtonIndex:null,highlightNodes:new Set,highlightLinks:new Set,lastMousePos:{x:0,y:0},mustBeStoppedPropagation:false,mouseStartPos:null,isDragging:false,width:o*Be,height:s*Be,animation:{id:null,buttonIndex:null},spinnerAngle:0}),{nodes:F,links:j}=useMemo(()=>_r(h),[h]),[y,B]=useState([]),S=useRef(null),D=useRef(null),Z=useRef(null),G=scaleOrdinal(schemeCategory10),ee=useCallback(()=>{if(!S.current)return false;try{let e=S.current.getContext("2d");return e?(Z.current=e,!0):(console.error("Failed to get 2D context"),!1)}catch(e){return console.error("Error initializing Canvas 2D context:",e),false}},[]),J=useCallback(()=>D.current?D.current.nodes():null,[]),fe=useCallback(()=>{if(!D.current)return null;let e=D.current.force("link");return e?e.links():null},[]),ge=useCallback(e=>{e.save(),e.setTransform(1,0,0,1,0,0);let{width:a,height:n}=t.current,i=W.gridSpacing,c=W.dotSize;e.fillStyle=x.graph2D.grid.dotColor;for(let u=i/2;u<=a;u+=i)for(let l=i/2;l<=n;l+=i)e.beginPath(),e.arc(u,l,c,0,2*Math.PI),e.fill();e.restore();},[x.graph2D.grid.dotColor,W.gridSpacing,W.dotSize]),Pe=useCallback((e,a,n)=>{if(!e)return "";if(n.measureText(e).width<=a)return e;let c=e,u="...";for(;n.measureText(c+u).width>a&&c.length>0;)c=c.slice(0,-1);return c+u},[]),be=a(e=>{let n=Math.min(e,W.maxZoom)/W.maxZoom;return Math.max(W.fontSize*n,W.fontSize)},"calculateFontSize"),Se=useCallback(e=>{let a=fe(),n=J();!a||a.length===0||!n||n.length===0||(e.lineWidth=.5,e.globalAlpha=1,a.forEach(i=>{let c=typeof i.source=="object"?i.source:n.find(ie=>ie.id===i.source),u=typeof i.target=="object"?i.target:n.find(ie=>ie.id===i.target);if(!c||!u)return;let l={x:c.x||0,y:c.y||0},d={x:u.x||0,y:u.y||0},v=d.x-l.x,w=d.y-l.y,P=Math.sqrt(v*v+w*w),A=v/P,I=w/P,X=W.nodeSizeBase/2,$=W.nodeSizeBase/2,H=4,m={x:l.x+A*X,y:l.y+I*X},N={x:d.x-A*($+H),y:d.y-I*($+H)},M={x:d.x-A*($+1),y:d.y-I*($+1)},Y=t.current.highlightLinks.has(i),_=Y?x.graph2D.link.highlighted:x.graph2D.link.normal,q=Y?1.5:.5,K=l.x+(d.x-l.x)/2,le=l.y+(d.y-l.y)/2,de=Math.atan2(w,v);if(i.label){let ie=t.current.transform.k,ue=be(ie);e.font=`${ue}px Sans-Serif`;let yt=e.measureText(i.label).width,vt=10;e.beginPath(),e.moveTo(m.x,m.y);let bt=P/2-(yt+vt)/2,wt={x:l.x+A*bt,y:l.y+I*bt};e.lineTo(wt.x,wt.y),e.strokeStyle=_,e.lineWidth=q,e.stroke(),e.beginPath();let xt=P/2+(yt+vt)/2,kt={x:l.x+A*xt,y:l.y+I*xt};e.moveTo(kt.x,kt.y),e.lineTo(N.x,N.y),e.strokeStyle=_,e.lineWidth=q,e.stroke();}else e.beginPath(),e.moveTo(m.x,m.y),e.lineTo(N.x,N.y),e.strokeStyle=_,e.lineWidth=q,e.stroke();let we=2;if(e.save(),e.translate(M.x,M.y),e.rotate(de),e.beginPath(),e.moveTo(0,0),e.lineTo(-4,we),e.lineTo(-4,0),e.lineTo(-4,-2),e.closePath(),e.fillStyle=_,e.fill(),e.restore(),i.label){let ie=t.current.transform.k,ue=be(ie);e.font=`${ue}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(K,le),Math.abs(de)>Math.PI/2?e.rotate(de+Math.PI):e.rotate(de),e.fillStyle=Y?x.graph2D.link.highlightedTextColor:x.graph2D.link.textColor,e.fillText(i.label,0,0),e.restore();}}));},[W,x.graph2D.link]),ct=a((e,a,n,i,c,u,l)=>{try{if(u!=null){let d=c*.8;e.font=`${d}px sans-serif`,e.textBaseline="middle",e.textAlign="left";let v=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:0,compactDisplay:"short"}).format(u),w=e.measureText(v).width,P=c*.3,I=(c+P+w)/2;e.drawImage(a,n-I,i-c/2,c,c),e.fillStyle=l||"#99989C",e.fillText(v,n-I+c+P,i);}else e.drawImage(a,n-c/2,i-c/2,c,c);}catch(d){console.warn("Error rendering icon:",d);}},"drawIconWithOptionalCounter"),lt=useCallback((e,a)=>{if(!y||y.length===0||!e||!e.x||!e.y)return;let{x:n,y:i}=e,c=W.nodeSizeBase*W.nodeAreaFactor/2;a.save();let u=Math.min(y.length,8),l$1=Math.min(Math.PI*2/u,Math.PI);for(let d=0;d<u;d++){let v=d*l$1,w=(d+1)*l$1,P=t.current.hoveredButtonIndex===d;a.beginPath(),a.arc(n,i,c,v,w,false),a.lineTo(n,i),a.closePath(),a.lineWidth=1,a.strokeStyle=x.graph2D?.button?.stroke||"#FFFFFF",a.stroke(),a.fillStyle=P?x.graph2D?.button?.hoverFill||"rgba(255, 255, 255, 0.3)":x.graph2D?.button?.normalFill||"rgba(255, 255, 255, 0.1)",a.fill();let A=c*.2,I=(v+w)/2,X=c-W.nodeSizeBase/2+A,$=n+Math.cos(I)*X,H=i+Math.sin(I)*X,m=y[d];if(m.loading){let N=A/2,M=A/12;a.save(),a.translate($,H),a.rotate(t.current.spinnerAngle);for(let Y=0;Y<12;Y++){let _=Math.PI*2*Y/12,q=Y/12,K=Math.cos(_)*N,le=Math.sin(_)*N;a.beginPath(),a.fillStyle=l(x.graph2D?.button?.spinnerColor,q),a.arc(K,le,M,0,Math.PI*2),a.fill();}a.restore(),t.current.spinnerAngle+=.1,t.current.spinnerAngle>Math.PI*2&&(t.current.spinnerAngle-=Math.PI*2),t.current.animation.id!==null&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null),t.current.animation.id=requestAnimationFrame(U),t.current.animation.buttonIndex=d;}else {t.current.animation.id&&t.current.animation.buttonIndex===d&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null);let N=P?m.hoverImg:m.normalImg,M=m.getCount?m.getCount(e):null;N.complete?ct(a,N,$,H,A,M,x.graph2D?.button?.textColor):N.onload=()=>{Z.current&&ct(a,N,$,H,A,M,x.graph2D?.button?.textColor);};}}a.restore();},[y,x.graph2D?.button]),dt=useCallback(e=>{let a=J();!a||a.length===0||(e.globalAlpha=1,a.forEach(n=>{let{x:i,y:c,color:u,fontColor:l,label:d}=n,v=t.current.highlightNodes.has(n)||n===t.current.hoveredNode||n===t.current.draggedNode,w=n===t.current.selectedNode,P=W.nodeSizeBase,A=W.nodeSizeBase/2;if(v&&!w){let I=W.nodeSizeBase*W.nodeAreaFactor*.75/2;e.beginPath(),e.arc(i,c,I,0,2*Math.PI,false),e.fillStyle=x.graph2D.ring.highlightFill,e.fill();}if(w)if(g&&g.length>0)lt(n,e);else {let I=W.nodeSizeBase*W.nodeAreaFactor/2;e.beginPath(),e.arc(i,c,I,0,2*Math.PI,false),e.fillStyle=x.graph2D.ring.selectionFill||x.graph2D.ring.highlightFill,e.fill();}if(e.beginPath(),e.arc(i,c,A,0,2*Math.PI),e.fillStyle=u||G(n.group||"0"),e.fill(),d){e.save(),e.translate(i,c);let I=t.current.transform.k,X=be(I),$=P*W.textPaddingFactor;e.font=`${X}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=l||"#000";let H=Pe(d,$,e);e.fillText(H,0,0),e.restore();}}));},[x.graph2D.ring,g,lt]),U=useCallback(()=>{let e=Z.current;e&&(e.clearRect(0,0,t.current.width,t.current.height),ge(e),e.save(),e.setTransform(t.current.transform.k,0,0,t.current.transform.k,t.current.transform.x,t.current.transform.y),Se(e),dt(e),e.restore());},[Se,dt,ge]),ut=useCallback((e,a=[],n)=>{let i=fe()||[],c=J()||[];if(!D.current||!e.length)return;let{width:u,height:l}=t.current,d=n?.smoothAppearance??false,v=n?.transitionDuration??1e3,w=new Set(c.map(m=>m.id)),P=e.filter(m=>!w.has(m.id)),A=new Set(i.map(m=>`${typeof m.source=="object"?m.source.id:m.source}-${typeof m.target=="object"?m.target.id:m.target}`)),I=a.filter(m=>{let N=`${typeof m.source=="object"?m.source.id:m.source}-${typeof m.target=="object"?m.target.id:m.target}`;return !A.has(N)});if(P.length===0&&I.length===0)return;let X=[...c,...P],$=[...i,...I];d&&(P.forEach(m=>{let N=I.filter(M=>{let Y=typeof M.source=="object"?M.source.id:M.source,_=typeof M.target=="object"?M.target.id:M.target;return Y===m.id&&w.has(_)||_===m.id&&w.has(Y)});if(N.length>0){let M=N[0],Y=typeof M.source=="object"?M.source.id===m.id?M.target:M.source.id:M.source===m.id?M.target:M.source,_=X.find(q=>q.id===Y);if(_&&_.x!==void 0&&_.y!==void 0){let q=30+Math.random()*20,K=Math.random()*Math.PI*2;m.x=_.x+Math.cos(K)*q,m.y=_.y+Math.sin(K)*q,m.vx=0,m.vy=0;}}else {let M=u/2,Y=l/2,_=Math.min(u,l)/4,q=Math.random()*Math.PI*2;m.x=M+Math.cos(q)*(_*Math.random()),m.y=Y+Math.sin(q)*(_*Math.random()),m.vx=0,m.vy=0;}}),c.forEach(m=>{m.fx=m.x,m.fy=m.y;})),D.current.nodes(X);let H=D.current.force("link");H&&H.links($),I.forEach(m=>{let N=typeof m.source=="object"?m.source:X.find(Y=>Y.id===m.source),M=typeof m.target=="object"?m.target:X.find(Y=>Y.id===m.target);!N||!M||(!N.neighbors&&(N.neighbors=[]),!M.neighbors&&(M.neighbors=[]),N.neighbors.push(M),M.neighbors.push(N),!N.links&&(N.links=[]),!M.links&&(M.links=[]),N.links.push(m),M.links.push(m));}),d?(D.current.alphaTarget(.3),D.current.alpha(.3),D.current.velocityDecay(.7),D.current.restart(),setTimeout(()=>{c.forEach(m=>{m.fx=void 0,m.fy=void 0;}),D.current?.alphaTarget(0),D.current?.alpha(.1),D.current?.velocityDecay(.6);},v)):D.current.alpha(.1).restart(),U();},[F,U]),pt=useCallback(e=>{let a=J(),n=fe();if(!D.current||!e.length||!a||a.length===0||!n||n.length===0)return;let i=new Set(e);if(t.current.selectedNode&&t.current.selectedNode.id!==void 0&&i.has(t.current.selectedNode.id)&&(t.current.selectedNode=null),t.current.hoveredNode&&t.current.hoveredNode.id!==void 0&&i.has(t.current.hoveredNode.id)&&(t.current.hoveredNode=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set),t.current.hoveredLink){let d=typeof t.current.hoveredLink.source=="object"?t.current.hoveredLink.source.id:t.current.hoveredLink.source,v=typeof t.current.hoveredLink.target=="object"?t.current.hoveredLink.target.id:t.current.hoveredLink.target;(d!==void 0&&i.has(d)||v!==void 0&&i.has(v))&&(t.current.hoveredLink=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set);}t.current.draggedNode&&t.current.draggedNode.id!==void 0&&i.has(t.current.draggedNode.id)&&(t.current.draggedNode=null);let c=a.filter(d=>d.id!==void 0&&!i.has(d.id)),u=n.filter(d=>{let v=typeof d.source=="object"?d.source.id:d.source,w=typeof d.target=="object"?d.target.id:d.target;return v!==void 0&&!i.has(v)&&w!==void 0&&!i.has(w)});c.forEach(d=>{d.neighbors=[],d.links=[];}),u.forEach(d=>{let v=typeof d.source=="object"?d.source:c.find(P=>P.id===d.source),w=typeof d.target=="object"?d.target:c.find(P=>P.id===d.target);!v||!w||(v.neighbors=v.neighbors||[],w.neighbors=w.neighbors||[],v.neighbors.push(w),w.neighbors.push(v),v.links=v.links||[],w.links=w.links||[],v.links.push(d),w.links.push(d));}),D.current.nodes(c);let l=D.current.force("link");l&&l.links(u),U();},[U]),Me=useCallback((e=0,a$1=20)=>{let n=J();if(!Z.current||!S.current||!n||!n.length)return;let c=1/0,u=1/0,l=-1/0,d=-1/0;if(n.forEach(v=>{if(v.x===void 0||v.y===void 0)return;let w=v.x,P=v.y;c=Math.min(c,w),u=Math.min(u,P),l=Math.max(l,w),d=Math.max(d,P);}),isFinite(c)&&isFinite(l)&&isFinite(u)&&isFinite(d)){let{width:v,height:w}=t.current;c-=a$1,u-=a$1,l+=a$1,d+=a$1;let P=l-c,A=d-u,I=P>0?v/P:1,X=A>0?w/A:1,$=Math.min(I,X,10),H=c+P/2,m=u+A/2,N={k:$,x:v/2-H*$,y:w/2-m*$};if(e>0){let M={...t.current.transform},Y=Date.now(),_=a(()=>{let q=Math.min(1,(Date.now()-Y)/e),K=q===1?1:1-Math.pow(1-q,3),le={k:M.k+(N.k-M.k)*K,x:M.x+(N.x-M.x)*K,y:M.y+(N.y-M.y)*K};t.current.transform=le,U(),q<1&&requestAnimationFrame(_);},"animateZoom");requestAnimationFrame(_);}else t.current.transform=N,U();}},[]),Ce=useCallback((e,a)=>{let n=J();if(!n||n.length===0)return null;let i=W.nodeSizeBase/2,c=typeof window<"u"&&window.devicePixelRatio||1,u=(e*c-t.current.transform.x)/t.current.transform.k,l=(a*c-t.current.transform.y)/t.current.transform.k;return n.find(d=>{let v=(d.x||0)-u,w=(d.y||0)-l;return Math.sqrt(v*v+w*w)<=i})||null},[]),Te=useCallback((e,a)=>{let n=fe(),i=J();if(!n||n.length===0||!i||i.length===0)return null;let c=typeof window<"u"&&window.devicePixelRatio||1,u=(e*c-t.current.transform.x)/t.current.transform.k,l=(a*c-t.current.transform.y)/t.current.transform.k,d=5;return n.find(v=>{let w=typeof v.source=="object"?v.source:i.find(ue=>ue.id===v.source),P=typeof v.target=="object"?v.target:i.find(ue=>ue.id===v.target);if(!w||!P)return false;let A=w.x||0,I=w.y||0,X=P.x||0,$=P.y||0,H=u-A,m=l-I,N=X-A,M=$-I,Y=H*N+m*M,_=N*N+M*M;if(_===0)return false;let q=Y/_;q=Math.max(0,Math.min(1,q));let K=A+q*N,le=I+q*M,de=u-K,we=l-le;return Math.sqrt(de*de+we*we)<=d})||null},[]),ht=useCallback((e,a,n,i,c,u,l)=>{let d=e-n,v=a-i,w=Math.sqrt(d*d+v*v),P=Math.atan2(v,d);P<0&&(P+=2*Math.PI);let X=w>=c*.5&&w<=c*1,$=false;return u===Math.PI&&l===Math.PI*2?$=P>=Math.PI&&P<=Math.PI*2:u===0&&l===Math.PI?$=P>=0&&P<=Math.PI:$=u<=l&&P>=u&&P<=l||u>l&&(P>=u||P<=l),X&&$},[]),Ye=useCallback(e=>{if(e===t.current.hoveredNode)return;let a=new Set,n=new Set;e&&(a.add(e),e.neighbors&&e.neighbors.forEach(i=>a.add(i)),e.links&&e.links.forEach(i=>n.add(i))),t.current.hoveredNode=e,k&&k(e),t.current.highlightNodes=a,t.current.highlightLinks=n;},[k]),Ge=useCallback(e=>{if(e===t.current.hoveredLink)return;let a=new Set,n=new Set;if(e){n.add(e);let i=J();if(i){let c=typeof e.source=="object"?e.source:i.find(l=>l.id===e.source),u=typeof e.target=="object"?e.target:i.find(l=>l.id===e.target);c&&a.add(c),u&&a.add(u);}}t.current.hoveredLink=e,T&&T(e),t.current.highlightNodes=a,t.current.highlightLinks=n;},[T,J]),ft=useCallback(e=>{L&&L(e);},[L]),gt=useCallback(e=>{t.current.selectedNode=e,b&&b(e);},[b]),mt=useCallback(()=>{t.current.selectedNode=null,f&&f();},[f]),qe=useCallback(e=>{if(!S.current||!D.current)return;let a=S.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top;t.current.mouseStartPos={x:n,y:i},t.current.isDragging=false;let c=Ce(n,i);c?(t.current.draggedNode=c,c.fx=c.x,c.fy=c.y):(t.current.isPanning=true,t.current.lastMousePos={x:n,y:i});},[Ce]),Ne=useCallback((e,a)=>{let n=null;if(S.current&&t.current&&y.length>0){let i=W.nodeSizeBase*W.nodeAreaFactor/2,c=S.current.getBoundingClientRect(),u=S.current.width/c.width,l=S.current.height/c.height,d=e*u,v=a*l,w=(d-t.current.transform.x)/t.current.transform.k,P=(v-t.current.transform.y)/t.current.transform.k,A=t.current.selectedNode?.x||0,I=t.current.selectedNode?.y||0,X=Math.min(y.length,8),$=Math.min(Math.PI*2/X,Math.PI);for(let H=0;H<X;H++){let m=H*$,N=(H+1)*$;if(ht(w,P,A,I,i,m,N)){n=H;break}}}return n},[y]),Ve=useCallback(e=>{if(!S.current)return;let a=S.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top;if(t.current.draggedNode&&t.current.mouseStartPos&&D.current){let l=t.current.mouseStartPos.x,d=t.current.mouseStartPos.y,v=n-l,w=i-d;Math.sqrt(v*v+w*w)>3&&(t.current.isDragging=true,D.current.alphaTarget()===0&&D.current.alphaTarget(0).restart());let I=typeof window<"u"&&window.devicePixelRatio||1,X=(n*I-t.current.transform.x)/t.current.transform.k,$=(i*I-t.current.transform.y)/t.current.transform.k;t.current.draggedNode.fx=X,t.current.draggedNode.fy=$;return}if(t.current.isPanning&&t.current.mouseStartPos){let l=n-t.current.lastMousePos.x,d=i-t.current.lastMousePos.y,v=t.current.mouseStartPos.x,w=t.current.mouseStartPos.y;Math.sqrt(Math.pow(n-v,2)+Math.pow(i-w,2))>3&&(t.current.isDragging=true),t.current.transform={...t.current.transform,x:t.current.transform.x+l,y:t.current.transform.y+d},t.current.lastMousePos={x:n,y:i},U();return}let c,u;if(t.current.selectedNode&&S.current&&y.length>0){let l=Ne(n,i);l!==null&&(u=t.current.selectedNode),l!==t.current.hoveredButtonIndex&&(c=true),t.current.hoveredButtonIndex=l;}else t.current.hoveredButtonIndex!==null&&(t.current.hoveredButtonIndex=null);if(!u&&(u=Ce(n,i),!u)){let l=Te(n,i),d=l!==t.current.hoveredLink;if(l&&t.current.hoveredNode&&Ye(null),Ge(l),S.current&&(S.current.style.cursor=l?"pointer":"default"),d){U();return}}u&&t.current.hoveredLink&&Ge(null),u!==t.current.hoveredNode&&(c=true),Ye(u),S.current&&(S.current.style.cursor=u?"pointer":"default"),c&&U();},[y,Ce,Te,Ye,Ge,U,ht,Ne]),hr=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.stopPropagation(),e.preventDefault()),t.current.mustBeStoppedPropagation=false;},[]),Le=useCallback(e=>{let a=t.current.isDragging;if(a&&(t.current.mustBeStoppedPropagation=true),!a&&t.current.mouseStartPos){let n=S.current?.getBoundingClientRect();if(n){let i=e.clientX-n.left,c=e.clientY-n.top;y.length>0&&t.current.hoveredButtonIndex===null&&(t.current.hoveredButtonIndex=Ne(i,c));let u=false;if(t.current.selectedNode&&t.current.hoveredButtonIndex!==null&&g[t.current.hoveredButtonIndex]){let l=g[t.current.hoveredButtonIndex];l&&l.onClick&&(l.onClick(t.current.selectedNode),u=true,t.current.hoveredButtonIndex=null);}if(!u&&t.current.draggedNode)gt(t.current.draggedNode);else if(!u&&!t.current.draggedNode){let l=Te(i,c);l?ft(l):mt();}}}if(t.current.draggedNode&&D.current){if(a){D.current.alphaTarget(0);let n=.05,i=.04,c=.6;D.current.alpha(n).alphaDecay(i),D.current.velocityDecay(c);}else D.current.alphaTarget(0);t.current.draggedNode.fx=void 0,t.current.draggedNode.fy=void 0,t.current.draggedNode=null;}t.current.isDragging=false,t.current.mouseStartPos=null,t.current.isPanning&&(t.current.isPanning=false),U();},[g,U,gt,mt,Te,ft,Ne,y]),Ze=useCallback(e=>{if(e.stopPropagation(),e.preventDefault(),!S.current)return;let a=S.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top,u=-e.deltaY>0?1.1:1/1.1,l=t.current.transform,d=l.k*u;if(d<.01||d>10)return;let v=l.k*u,w=n-(n-l.x)*u,P=i-(i-l.y)*u;t.current.transform={k:v,x:w,y:P},U();},[U]),Ue=a((e,a)=>{let n=e.touches[0];if(n){let i={clientX:n.clientX,clientY:n.clientY};a(i);}},"convertTouchToMouseEvent"),fr=useCallback(e=>{Ue(e,qe);},[qe]),Je=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.preventDefault(),e.stopPropagation()),t.current.mustBeStoppedPropagation=false,Ue(e,Le);},[Le]),gr=useCallback(e=>{Ue(e,Ve);},[Ve]);return useImperativeHandle(z,()=>({zoomToFit:Me,addNodes:ut,removeNodes:pt}),[Me,ut,pt]),useEffect(()=>{let e=S.current,{width:a,height:n}=t.current;if(!e)return;ee(),E(true);let i=a/2,c=n/2,u=W.nodeSizeBase,l=u/2,d=u*2.5;D.current&&D.current.stop();let v=D.current=forceSimulation(F).force("link",forceLink(j).id(w=>w.id).distance(d).strength(.9)).force("charge",forceManyBody().strength(-u/10*200).theta(.5).distanceMin(u*2)).force("x",forceX().strength(.03)).force("y",forceY().strength(.03)).force("center",forceCenter(i,c).strength(.05)).force("collide",forceCollide().radius(l*2).iterations(2).strength(1)).velocityDecay(.6);return ()=>{v.stop();}},[F,j]),useLayoutEffect(()=>{let e=S.current;e&&(t.current.width=o*Be,t.current.height=s*Be,e.width=t.current.width,e.height=t.current.height);},[o,s]),useEffect(()=>{if(D.current){let e=D.current;e.on("tick",()=>{U();}),e.on("end",()=>{C&&(Me(0,20),setTimeout(()=>{E(false);},200));});}C||U();},[F,j,C,U,Me]),useEffect(()=>{!F||!j||j.forEach(e=>{let a=typeof e.source=="object"?e.source:F.find(i=>i.id===e.source),n=typeof e.target=="object"?e.target:F.find(i=>i.id===e.target);!a||!n||(!a.neighbors&&(a.neighbors=[]),!n.neighbors&&(n.neighbors=[]),a.neighbors.push(n),n.neighbors.push(a),!a.links&&(a.links=[]),!n.links&&(n.links=[]),a.links.push(e),n.links.push(e));});},[F,j]),useEffect(()=>{g&&g.length>0&&B(eo(g));},[g]),useEffect(()=>{let e=S.current;if(!(!e||typeof window>"u"))return e.addEventListener("wheel",Ze,{passive:false}),e.addEventListener("touchend",Je,{passive:false}),()=>{e.removeEventListener("wheel",Ze),e.removeEventListener("touchend",Je);}},[Ze,Je]),jsxs(ro,{children:[(r||C)&&jsx(zt,{width:o,height:s}),jsx(oo,{ref:S,style:{width:o,height:s,display:r||C?"none":"block"},onMouseDown:qe,onMouseMove:Ve,onMouseUp:Le,onMouseLeave:Le,onClick:hr,onTouchStart:fr,onTouchMove:gr})]})}),ro=styled.div`
47
+ `,Fr=a(({width:r=280,height:o=280})=>{let s=useTheme();return jsx(jr,{children:jsxs(Rr,{foregroundColor:s.contentLoader.foreground,backgroundColor:s.contentLoader.background,width:r,height:o,viewBox:"0 0 280 280",children:[jsx("path",{d:"m55 38-0.97266 0.22852 7.0801 30.092-18.355-20.979-0.75195 0.6582 19.596 22.395 0.43164 1.834 0.97266-0.22852 0.75195-0.6582-0.37695-0.42969 9.625-27.912-0.94531-0.32617-9.4375 27.371-0.10547-0.12109zm8 34-0.78516 0.61914 0.0957 0.12305-12.311 13.258 0.73242 0.67969 12.205-13.145 14.277 18.084 0.78516-0.61914-14.373-18.207 0.10547-0.11328zm15 19-0.48438 0.875 46.992 25.996 8e-3 4e-3 20.506 11.592-28.182 4.5449 0.15998 0.98819 29.418-4.7441 0.25 0.14062-12.555 24.143 0.88672 0.46094 13-25 15 25 26 30v18l-11 18 0.85352 0.52148 9.8008-16.039-4.6543 33.518 0.99023 0.13867 4.7793-34.408 7.2305 16.27 0.91406-0.40625-7.9141-17.807v-17.104l18 12.316 0.56445-0.82617-18.896-12.928-25.855-29.836-14.633-24.387 0.01562-0.02344h23.805v-1h-23.152l13.848-21.234 55.201-28.791-0.45898-0.88476 0.77734 0.62305 11.402-14.25 16.668-11.842-0.58008-0.81641-16.785 11.928-11.486 14.355-55.434 28.912-14.277 21.893-7.7617-27.166-0.96094 0.27344 7.7227 27.031-1.1191 0.17969-21.604-12.211zm140.43-12.912-6.957-17.338-0.92773 0.37305 6.957 17.338zm-6.957-17.338 0.72266 0.69336 16.232-16.896-0.7207-0.69336zm-3.4766 137.25 5 15 0.94922-0.31641-5-15zm-91-63-0.48047-0.87695-31 17 0.48047 0.87695zm-31 17 5 18 0.96289-0.26758-5-18zm0 0-0.70703-0.70703-12.898 12.898-17.881 9.9336 0.48633 0.875 18-10zm5 18-0.64062-0.76758-18 15 0.64062 0.76758z"}),jsx("circle",{cx:"229.92",cy:"63.7318",r:"5",transform:"rotate(173.661 229.92 63.7318)"}),jsx("circle",{cx:"227.711",cy:"43.8541",r:"5",transform:"rotate(173.661 227.711 43.8541)"}),jsx("circle",{cx:"211.478",cy:"60.7499",r:"5",transform:"rotate(173.661 211.478 60.7499)"}),jsx("circle",{cx:"218.434",cy:"78.0877",r:"5",transform:"rotate(173.661 218.434 78.0877)"}),jsx("circle",{cx:"246.705",cy:"51.8054",r:"5",transform:"rotate(173.661 246.705 51.8054)"}),jsx("circle",{cx:"42",cy:"48",r:"5"}),jsx("circle",{cx:"55",cy:"38",r:"5"}),jsx("circle",{cx:"73",cy:"43",r:"5"}),jsx("circle",{cx:"63",cy:"72",r:"5"}),jsx("circle",{cx:"50",cy:"86",r:"5"}),jsx("circle",{cx:"78",cy:"91",r:"5"}),jsx("circle",{cx:"73",cy:"165",r:"5"}),jsx("circle",{cx:"73",cy:"185",r:"5"}),jsx("circle",{cx:"91",cy:"170",r:"5"}),jsx("circle",{cx:"86",cy:"152",r:"5"}),jsx("circle",{cx:"148",cy:"130",r:"5"}),jsx("circle",{cx:"189",cy:"185",r:"5"}),jsx("circle",{cx:"163",cy:"107",r:"5"}),jsx("circle",{cx:"140",cy:"102",r:"5"}),jsx("circle",{cx:"117",cy:"135",r:"5"}),jsx("circle",{cx:"125",cy:"117",r:"5"}),jsx("circle",{cx:"208",cy:"198",r:"5"}),jsx("circle",{cx:"189",cy:"203",r:"5"}),jsx("circle",{cx:"198",cy:"221",r:"5"}),jsx("circle",{cx:"178",cy:"221",r:"5"}),jsx("circle",{cx:"184",cy:"239",r:"5"}),jsx("circle",{cx:"213",cy:"213",r:"5"}),jsx("circle",{cx:"173",cy:"130",r:"5"}),jsx("circle",{cx:"163",cy:"155",r:"5"}),jsx("circle",{cx:"135",cy:"155",r:"5"}),jsx("circle",{cx:"55",cy:"175",r:"5"})]})})},"GraphLoader"),zt=Fr;var je=typeof window<"u"&&window.devicePixelRatio||1;function eo(r){return !r||r.length===0?[]:r.map(o=>{let s=new Image;s.src=o.img;let h=new Image;return h.src=o.hoverImg,{...o,normalImg:s,hoverImg:h}})}a(eo,"prepareButtonImages");var W={fontSize:3,nodeSizeBase:30,nodeAreaFactor:2,textPaddingFactor:.9,gridSpacing:20,dotSize:1,maxZoom:4},to=forwardRef(({loading:r,width:o,height:s,graphData:h,buttons:g=[],onNodeClick:b,onBackgroundClick:f,onNodeHover:x,onLinkHover:C,onLinkClick:L},I)=>{let k=useTheme(),[T,F]=useState(true),t=useRef({transform:{x:0,y:0,k:1},isPanning:false,hoveredNode:null,hoveredLink:null,draggedNode:null,selectedNode:null,hoveredButtonIndex:null,highlightNodes:new Set,highlightLinks:new Set,lastMousePos:{x:0,y:0},mustBeStoppedPropagation:false,mouseStartPos:null,isDragging:false,width:o*je,height:s*je,animation:{id:null,buttonIndex:null},spinnerAngle:0}),{nodes:z,links:B}=useMemo(()=>_r(h),[h]),[y,j]=useState([]),P=useRef(null),D=useRef(null),Z=useRef(null),G=scaleOrdinal(schemeCategory10),ee=useCallback(()=>{if(!P.current)return false;try{let e=P.current.getContext("2d");return e?(Z.current=e,!0):(console.error("Failed to get 2D context"),!1)}catch(e){return console.error("Error initializing Canvas 2D context:",e),false}},[]),J=useCallback(()=>D.current?D.current.nodes():null,[]),ge=useCallback(()=>{if(!D.current)return null;let e=D.current.force("link");return e?e.links():null},[]),me=useCallback(e=>{e.save(),e.setTransform(1,0,0,1,0,0);let{width:a,height:n}=t.current,i=W.gridSpacing,c=W.dotSize;e.fillStyle=k.graph2D.grid.dotColor;for(let u=i/2;u<=a;u+=i)for(let l=i/2;l<=n;l+=i)e.beginPath(),e.arc(u,l,c,0,2*Math.PI),e.fill();e.restore();},[k.graph2D.grid.dotColor,W.gridSpacing,W.dotSize]),Me=useCallback((e,a,n)=>{if(!e)return "";if(n.measureText(e).width<=a)return e;let c=e,u="...";for(;n.measureText(c+u).width>a&&c.length>0;)c=c.slice(0,-1);return c+u},[]),we=a(e=>{let n=Math.min(e,W.maxZoom)/W.maxZoom;return Math.max(W.fontSize*n,W.fontSize)},"calculateFontSize"),Pe=useCallback(e=>{let a=ge(),n=J();!a||a.length===0||!n||n.length===0||(e.lineWidth=.5,e.globalAlpha=1,a.forEach(i=>{let c=typeof i.source=="object"?i.source:n.find(ie=>ie.id===i.source),u=typeof i.target=="object"?i.target:n.find(ie=>ie.id===i.target);if(!c||!u)return;let l={x:c.x||0,y:c.y||0},d={x:u.x||0,y:u.y||0},v=d.x-l.x,w=d.y-l.y,M=Math.sqrt(v*v+w*w),A=v/M,E=w/M,X=W.nodeSizeBase/2,$=W.nodeSizeBase/2,H=4,m={x:l.x+A*X,y:l.y+E*X},N={x:d.x-A*($+H),y:d.y-E*($+H)},S={x:d.x-A*($+1),y:d.y-E*($+1)},Y=t.current.highlightLinks.has(i),_=Y?k.graph2D.link.highlighted:k.graph2D.link.normal,q=Y?1.5:.5,K=l.x+(d.x-l.x)/2,le=l.y+(d.y-l.y)/2,de=Math.atan2(w,v);if(i.label){let ie=t.current.transform.k,ue=we(ie);e.font=`${ue}px Sans-Serif`;let yt=e.measureText(i.label).width,vt=10;e.beginPath(),e.moveTo(m.x,m.y);let bt=M/2-(yt+vt)/2,wt={x:l.x+A*bt,y:l.y+E*bt};e.lineTo(wt.x,wt.y),e.strokeStyle=_,e.lineWidth=q,e.stroke(),e.beginPath();let xt=M/2+(yt+vt)/2,kt={x:l.x+A*xt,y:l.y+E*xt};e.moveTo(kt.x,kt.y),e.lineTo(N.x,N.y),e.strokeStyle=_,e.lineWidth=q,e.stroke();}else e.beginPath(),e.moveTo(m.x,m.y),e.lineTo(N.x,N.y),e.strokeStyle=_,e.lineWidth=q,e.stroke();let xe=2;if(e.save(),e.translate(S.x,S.y),e.rotate(de),e.beginPath(),e.moveTo(0,0),e.lineTo(-4,xe),e.lineTo(-4,0),e.lineTo(-4,-2),e.closePath(),e.fillStyle=_,e.fill(),e.restore(),i.label){let ie=t.current.transform.k,ue=we(ie);e.font=`${ue}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(K,le),Math.abs(de)>Math.PI/2?e.rotate(de+Math.PI):e.rotate(de),e.fillStyle=Y?k.graph2D.link.highlightedTextColor:k.graph2D.link.textColor,e.fillText(i.label,0,0),e.restore();}}));},[W,k.graph2D.link]),ct=a((e,a,n,i,c,u,l)=>{try{if(u!=null){let d=c*.8;e.font=`${d}px sans-serif`,e.textBaseline="middle",e.textAlign="left";let v=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:0,compactDisplay:"short"}).format(u),w=e.measureText(v).width,M=c*.3,E=(c+M+w)/2;e.drawImage(a,n-E,i-c/2,c,c),e.fillStyle=l||"#99989C",e.fillText(v,n-E+c+M,i);}else e.drawImage(a,n-c/2,i-c/2,c,c);}catch(d){console.warn("Error rendering icon:",d);}},"drawIconWithOptionalCounter"),lt=useCallback((e,a)=>{if(!y||y.length===0||!e||!e.x||!e.y)return;let{x:n,y:i}=e,c=W.nodeSizeBase*W.nodeAreaFactor/2;a.save();let u=Math.min(y.length,8),l$1=Math.min(Math.PI*2/u,Math.PI);for(let d=0;d<u;d++){let v=d*l$1,w=(d+1)*l$1,M=t.current.hoveredButtonIndex===d;a.beginPath(),a.arc(n,i,c,v,w,false),a.lineTo(n,i),a.closePath(),a.lineWidth=1,a.strokeStyle=k.graph2D?.button?.stroke||"#FFFFFF",a.stroke(),a.fillStyle=M?k.graph2D?.button?.hoverFill||"rgba(255, 255, 255, 0.3)":k.graph2D?.button?.normalFill||"rgba(255, 255, 255, 0.1)",a.fill();let A=c*.2,E=(v+w)/2,X=c-W.nodeSizeBase/2+A,$=n+Math.cos(E)*X,H=i+Math.sin(E)*X,m=y[d];if(m.loading){let N=A/2,S=A/12;a.save(),a.translate($,H),a.rotate(t.current.spinnerAngle);for(let Y=0;Y<12;Y++){let _=Math.PI*2*Y/12,q=Y/12,K=Math.cos(_)*N,le=Math.sin(_)*N;a.beginPath(),a.fillStyle=l(k.graph2D?.button?.spinnerColor,q),a.arc(K,le,S,0,Math.PI*2),a.fill();}a.restore(),t.current.spinnerAngle+=.1,t.current.spinnerAngle>Math.PI*2&&(t.current.spinnerAngle-=Math.PI*2),t.current.animation.id!==null&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null),t.current.animation.id=requestAnimationFrame(U),t.current.animation.buttonIndex=d;}else {t.current.animation.id&&t.current.animation.buttonIndex===d&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null);let N=M?m.hoverImg:m.normalImg,S=m.getCount?m.getCount(e):null;N.complete?ct(a,N,$,H,A,S,k.graph2D?.button?.textColor):N.onload=()=>{Z.current&&ct(a,N,$,H,A,S,k.graph2D?.button?.textColor);};}}a.restore();},[y,k.graph2D?.button]),dt=useCallback(e=>{let a=J();!a||a.length===0||(e.globalAlpha=1,a.forEach(n=>{let{x:i,y:c,color:u,fontColor:l,label:d}=n,v=t.current.highlightNodes.has(n)||n===t.current.hoveredNode||n===t.current.draggedNode,w=n===t.current.selectedNode,M=W.nodeSizeBase,A=W.nodeSizeBase/2;if(v&&!w){let E=W.nodeSizeBase*W.nodeAreaFactor*.75/2;e.beginPath(),e.arc(i,c,E,0,2*Math.PI,false),e.fillStyle=k.graph2D.ring.highlightFill,e.fill();}if(w)if(g&&g.length>0)lt(n,e);else {let E=W.nodeSizeBase*W.nodeAreaFactor/2;e.beginPath(),e.arc(i,c,E,0,2*Math.PI,false),e.fillStyle=k.graph2D.ring.selectionFill||k.graph2D.ring.highlightFill,e.fill();}if(e.beginPath(),e.arc(i,c,A,0,2*Math.PI),e.fillStyle=u||G(n.group||"0"),e.fill(),d){e.save(),e.translate(i,c);let E=t.current.transform.k,X=we(E),$=M*W.textPaddingFactor;e.font=`${X}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=l||"#000";let H=Me(d,$,e);e.fillText(H,0,0),e.restore();}}));},[k.graph2D.ring,g,lt]),U=useCallback(()=>{let e=Z.current;e&&(e.clearRect(0,0,t.current.width,t.current.height),me(e),e.save(),e.setTransform(t.current.transform.k,0,0,t.current.transform.k,t.current.transform.x,t.current.transform.y),Pe(e),dt(e),e.restore());},[Pe,dt,me]),ut=useCallback((e,a=[],n)=>{let i=ge()||[],c=J()||[];if(!D.current||!e.length)return;let{width:u,height:l}=t.current,d=n?.smoothAppearance??false,v=n?.transitionDuration??1e3,w=new Set(c.map(m=>m.id)),M=e.filter(m=>!w.has(m.id)),A=new Set(i.map(m=>`${typeof m.source=="object"?m.source.id:m.source}-${typeof m.target=="object"?m.target.id:m.target}`)),E=a.filter(m=>{let N=`${typeof m.source=="object"?m.source.id:m.source}-${typeof m.target=="object"?m.target.id:m.target}`;return !A.has(N)});if(M.length===0&&E.length===0)return;let X=[...c,...M],$=[...i,...E];d&&(M.forEach(m=>{let N=E.filter(S=>{let Y=typeof S.source=="object"?S.source.id:S.source,_=typeof S.target=="object"?S.target.id:S.target;return Y===m.id&&w.has(_)||_===m.id&&w.has(Y)});if(N.length>0){let S=N[0],Y=typeof S.source=="object"?S.source.id===m.id?S.target:S.source.id:S.source===m.id?S.target:S.source,_=X.find(q=>q.id===Y);if(_&&_.x!==void 0&&_.y!==void 0){let q=30+Math.random()*20,K=Math.random()*Math.PI*2;m.x=_.x+Math.cos(K)*q,m.y=_.y+Math.sin(K)*q,m.vx=0,m.vy=0;}}else {let S=u/2,Y=l/2,_=Math.min(u,l)/4,q=Math.random()*Math.PI*2;m.x=S+Math.cos(q)*(_*Math.random()),m.y=Y+Math.sin(q)*(_*Math.random()),m.vx=0,m.vy=0;}}),c.forEach(m=>{m.fx=m.x,m.fy=m.y;})),D.current.nodes(X);let H=D.current.force("link");H&&H.links($),E.forEach(m=>{let N=typeof m.source=="object"?m.source:X.find(Y=>Y.id===m.source),S=typeof m.target=="object"?m.target:X.find(Y=>Y.id===m.target);!N||!S||(!N.neighbors&&(N.neighbors=[]),!S.neighbors&&(S.neighbors=[]),N.neighbors.push(S),S.neighbors.push(N),!N.links&&(N.links=[]),!S.links&&(S.links=[]),N.links.push(m),S.links.push(m));}),d?(D.current.alphaTarget(.3),D.current.alpha(.3),D.current.velocityDecay(.7),D.current.restart(),setTimeout(()=>{c.forEach(m=>{m.fx=void 0,m.fy=void 0;}),D.current?.alphaTarget(0),D.current?.alpha(.1),D.current?.velocityDecay(.6);},v)):D.current.alpha(.1).restart(),U();},[z,U]),pt=useCallback(e=>{let a=J(),n=ge();if(!D.current||!e.length||!a||a.length===0||!n||n.length===0)return;let i=new Set(e);if(t.current.selectedNode&&t.current.selectedNode.id!==void 0&&i.has(t.current.selectedNode.id)&&(t.current.selectedNode=null),t.current.hoveredNode&&t.current.hoveredNode.id!==void 0&&i.has(t.current.hoveredNode.id)&&(t.current.hoveredNode=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set),t.current.hoveredLink){let d=typeof t.current.hoveredLink.source=="object"?t.current.hoveredLink.source.id:t.current.hoveredLink.source,v=typeof t.current.hoveredLink.target=="object"?t.current.hoveredLink.target.id:t.current.hoveredLink.target;(d!==void 0&&i.has(d)||v!==void 0&&i.has(v))&&(t.current.hoveredLink=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set);}t.current.draggedNode&&t.current.draggedNode.id!==void 0&&i.has(t.current.draggedNode.id)&&(t.current.draggedNode=null);let c=a.filter(d=>d.id!==void 0&&!i.has(d.id)),u=n.filter(d=>{let v=typeof d.source=="object"?d.source.id:d.source,w=typeof d.target=="object"?d.target.id:d.target;return v!==void 0&&!i.has(v)&&w!==void 0&&!i.has(w)});c.forEach(d=>{d.neighbors=[],d.links=[];}),u.forEach(d=>{let v=typeof d.source=="object"?d.source:c.find(M=>M.id===d.source),w=typeof d.target=="object"?d.target:c.find(M=>M.id===d.target);!v||!w||(v.neighbors=v.neighbors||[],w.neighbors=w.neighbors||[],v.neighbors.push(w),w.neighbors.push(v),v.links=v.links||[],w.links=w.links||[],v.links.push(d),w.links.push(d));}),D.current.nodes(c);let l=D.current.force("link");l&&l.links(u),U();},[U]),Se=useCallback((e=0,a$1=20)=>{let n=J();if(!Z.current||!P.current||!n||!n.length)return;let c=1/0,u=1/0,l=-1/0,d=-1/0;if(n.forEach(v=>{if(v.x===void 0||v.y===void 0)return;let w=v.x,M=v.y;c=Math.min(c,w),u=Math.min(u,M),l=Math.max(l,w),d=Math.max(d,M);}),isFinite(c)&&isFinite(l)&&isFinite(u)&&isFinite(d)){let{width:v,height:w}=t.current;c-=a$1,u-=a$1,l+=a$1,d+=a$1;let M=l-c,A=d-u,E=M>0?v/M:1,X=A>0?w/A:1,$=Math.min(E,X,10),H=c+M/2,m=u+A/2,N={k:$,x:v/2-H*$,y:w/2-m*$};if(e>0){let S={...t.current.transform},Y=Date.now(),_=a(()=>{let q=Math.min(1,(Date.now()-Y)/e),K=q===1?1:1-Math.pow(1-q,3),le={k:S.k+(N.k-S.k)*K,x:S.x+(N.x-S.x)*K,y:S.y+(N.y-S.y)*K};t.current.transform=le,U(),q<1&&requestAnimationFrame(_);},"animateZoom");requestAnimationFrame(_);}else t.current.transform=N,U();}},[]),Ce=useCallback((e,a)=>{let n=J();if(!n||n.length===0)return null;let i=W.nodeSizeBase/2,c=typeof window<"u"&&window.devicePixelRatio||1,u=(e*c-t.current.transform.x)/t.current.transform.k,l=(a*c-t.current.transform.y)/t.current.transform.k;return n.find(d=>{let v=(d.x||0)-u,w=(d.y||0)-l;return Math.sqrt(v*v+w*w)<=i})||null},[]),Te=useCallback((e,a)=>{let n=ge(),i=J();if(!n||n.length===0||!i||i.length===0)return null;let c=typeof window<"u"&&window.devicePixelRatio||1,u=(e*c-t.current.transform.x)/t.current.transform.k,l=(a*c-t.current.transform.y)/t.current.transform.k,d=5;return n.find(v=>{let w=typeof v.source=="object"?v.source:i.find(ue=>ue.id===v.source),M=typeof v.target=="object"?v.target:i.find(ue=>ue.id===v.target);if(!w||!M)return false;let A=w.x||0,E=w.y||0,X=M.x||0,$=M.y||0,H=u-A,m=l-E,N=X-A,S=$-E,Y=H*N+m*S,_=N*N+S*S;if(_===0)return false;let q=Y/_;q=Math.max(0,Math.min(1,q));let K=A+q*N,le=E+q*S,de=u-K,xe=l-le;return Math.sqrt(de*de+xe*xe)<=d})||null},[]),ht=useCallback((e,a,n,i,c,u,l)=>{let d=e-n,v=a-i,w=Math.sqrt(d*d+v*v),M=Math.atan2(v,d);M<0&&(M+=2*Math.PI);let X=w>=c*.5&&w<=c*1,$=false;return u===Math.PI&&l===Math.PI*2?$=M>=Math.PI&&M<=Math.PI*2:u===0&&l===Math.PI?$=M>=0&&M<=Math.PI:$=u<=l&&M>=u&&M<=l||u>l&&(M>=u||M<=l),X&&$},[]),Ye=useCallback(e=>{if(e===t.current.hoveredNode)return;let a=new Set,n=new Set;e&&(a.add(e),e.neighbors&&e.neighbors.forEach(i=>a.add(i)),e.links&&e.links.forEach(i=>n.add(i))),t.current.hoveredNode=e,x&&x(e),t.current.highlightNodes=a,t.current.highlightLinks=n;},[x]),Ge=useCallback(e=>{if(e===t.current.hoveredLink)return;let a=new Set,n=new Set;if(e){n.add(e);let i=J();if(i){let c=typeof e.source=="object"?e.source:i.find(l=>l.id===e.source),u=typeof e.target=="object"?e.target:i.find(l=>l.id===e.target);c&&a.add(c),u&&a.add(u);}}t.current.hoveredLink=e,C&&C(e),t.current.highlightNodes=a,t.current.highlightLinks=n;},[C,J]),ft=useCallback(e=>{L&&L(e);},[L]),gt=useCallback(e=>{t.current.selectedNode=e,b&&b(e);},[b]),mt=useCallback(()=>{t.current.selectedNode=null,f&&f();},[f]),qe=useCallback(e=>{if(!P.current||!D.current)return;let a=P.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top;t.current.mouseStartPos={x:n,y:i},t.current.isDragging=false;let c=Ce(n,i);c?(t.current.draggedNode=c,c.fx=c.x,c.fy=c.y):(t.current.isPanning=true,t.current.lastMousePos={x:n,y:i});},[Ce]),Ne=useCallback((e,a)=>{let n=null;if(P.current&&t.current&&y.length>0){let i=W.nodeSizeBase*W.nodeAreaFactor/2,c=P.current.getBoundingClientRect(),u=P.current.width/c.width,l=P.current.height/c.height,d=e*u,v=a*l,w=(d-t.current.transform.x)/t.current.transform.k,M=(v-t.current.transform.y)/t.current.transform.k,A=t.current.selectedNode?.x||0,E=t.current.selectedNode?.y||0,X=Math.min(y.length,8),$=Math.min(Math.PI*2/X,Math.PI);for(let H=0;H<X;H++){let m=H*$,N=(H+1)*$;if(ht(w,M,A,E,i,m,N)){n=H;break}}}return n},[y]),Ve=useCallback(e=>{if(!P.current)return;let a=P.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top;if(t.current.draggedNode&&t.current.mouseStartPos&&D.current){let l=t.current.mouseStartPos.x,d=t.current.mouseStartPos.y,v=n-l,w=i-d;Math.sqrt(v*v+w*w)>3&&(t.current.isDragging=true,D.current.alphaTarget()===0&&D.current.alphaTarget(0).restart());let E=typeof window<"u"&&window.devicePixelRatio||1,X=(n*E-t.current.transform.x)/t.current.transform.k,$=(i*E-t.current.transform.y)/t.current.transform.k;t.current.draggedNode.fx=X,t.current.draggedNode.fy=$;return}if(t.current.isPanning&&t.current.mouseStartPos){let l=n-t.current.lastMousePos.x,d=i-t.current.lastMousePos.y,v=t.current.mouseStartPos.x,w=t.current.mouseStartPos.y;Math.sqrt(Math.pow(n-v,2)+Math.pow(i-w,2))>3&&(t.current.isDragging=true),t.current.transform={...t.current.transform,x:t.current.transform.x+l,y:t.current.transform.y+d},t.current.lastMousePos={x:n,y:i},U();return}let c,u;if(t.current.selectedNode&&P.current&&y.length>0){let l=Ne(n,i);l!==null&&(u=t.current.selectedNode),l!==t.current.hoveredButtonIndex&&(c=true),t.current.hoveredButtonIndex=l;}else t.current.hoveredButtonIndex!==null&&(t.current.hoveredButtonIndex=null);if(!u&&(u=Ce(n,i),!u)){let l=Te(n,i),d=l!==t.current.hoveredLink;if(l&&t.current.hoveredNode&&Ye(null),Ge(l),P.current&&(P.current.style.cursor=l?"pointer":"default"),d){U();return}}u&&t.current.hoveredLink&&Ge(null),u!==t.current.hoveredNode&&(c=true),Ye(u),P.current&&(P.current.style.cursor=u?"pointer":"default"),c&&U();},[y,Ce,Te,Ye,Ge,U,ht,Ne]),hr=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.stopPropagation(),e.preventDefault()),t.current.mustBeStoppedPropagation=false;},[]),Le=useCallback(e=>{let a=t.current.isDragging;if(a&&(t.current.mustBeStoppedPropagation=true),!a&&t.current.mouseStartPos){let n=P.current?.getBoundingClientRect();if(n){let i=e.clientX-n.left,c=e.clientY-n.top;y.length>0&&t.current.hoveredButtonIndex===null&&(t.current.hoveredButtonIndex=Ne(i,c));let u=false;if(t.current.selectedNode&&t.current.hoveredButtonIndex!==null&&g[t.current.hoveredButtonIndex]){let l=g[t.current.hoveredButtonIndex];l&&l.onClick&&(l.onClick(t.current.selectedNode),u=true,t.current.hoveredButtonIndex=null);}if(!u&&t.current.draggedNode)gt(t.current.draggedNode);else if(!u&&!t.current.draggedNode){let l=Te(i,c);l?ft(l):mt();}}}if(t.current.draggedNode&&D.current){if(a){D.current.alphaTarget(0);let n=.05,i=.04,c=.6;D.current.alpha(n).alphaDecay(i),D.current.velocityDecay(c);}else D.current.alphaTarget(0);t.current.draggedNode.fx=void 0,t.current.draggedNode.fy=void 0,t.current.draggedNode=null;}t.current.isDragging=false,t.current.mouseStartPos=null,t.current.isPanning&&(t.current.isPanning=false),U();},[g,U,gt,mt,Te,ft,Ne,y]),Ze=useCallback(e=>{if(e.stopPropagation(),e.preventDefault(),!P.current)return;let a=P.current.getBoundingClientRect(),n=e.clientX-a.left,i=e.clientY-a.top,u=-e.deltaY>0?1.1:1/1.1,l=t.current.transform,d=l.k*u;if(d<.01||d>10)return;let v=l.k*u,w=n-(n-l.x)*u,M=i-(i-l.y)*u;t.current.transform={k:v,x:w,y:M},U();},[U]),Ue=a((e,a)=>{let n=e.touches[0];if(n){let i={clientX:n.clientX,clientY:n.clientY};a(i);}},"convertTouchToMouseEvent"),fr=useCallback(e=>{Ue(e,qe);},[qe]),Je=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.preventDefault(),e.stopPropagation()),t.current.mustBeStoppedPropagation=false,Ue(e,Le);},[Le]),gr=useCallback(e=>{Ue(e,Ve);},[Ve]);return useImperativeHandle(I,()=>({zoomToFit:Se,addNodes:ut,removeNodes:pt}),[Se,ut,pt]),useEffect(()=>{let e=P.current,{width:a,height:n}=t.current;if(!e)return;ee(),F(true);let i=a/2,c=n/2,u=W.nodeSizeBase,l=u/2,d=u*2.5;D.current&&D.current.stop();let v=D.current=forceSimulation(z).force("link",forceLink(B).id(w=>w.id).distance(d).strength(.9)).force("charge",forceManyBody().strength(-u/10*200).theta(.5).distanceMin(u*2)).force("x",forceX().strength(.03)).force("y",forceY().strength(.03)).force("center",forceCenter(i,c).strength(.05)).force("collide",forceCollide().radius(l*2).iterations(2).strength(1)).velocityDecay(.6);return ()=>{v.stop();}},[z,B]),useLayoutEffect(()=>{let e=P.current;e&&(t.current.width=o*je,t.current.height=s*je,e.width=t.current.width,e.height=t.current.height);},[o,s]),useEffect(()=>{if(D.current){let e=D.current;e.on("tick",()=>{U();}),e.on("end",()=>{T&&(Se(0,20),setTimeout(()=>{F(false);},200));});}T||U();},[z,B,T,U,Se]),useEffect(()=>{!z||!B||B.forEach(e=>{let a=typeof e.source=="object"?e.source:z.find(i=>i.id===e.source),n=typeof e.target=="object"?e.target:z.find(i=>i.id===e.target);!a||!n||(!a.neighbors&&(a.neighbors=[]),!n.neighbors&&(n.neighbors=[]),a.neighbors.push(n),n.neighbors.push(a),!a.links&&(a.links=[]),!n.links&&(n.links=[]),a.links.push(e),n.links.push(e));});},[z,B]),useEffect(()=>{g&&g.length>0&&j(eo(g));},[g]),useEffect(()=>{let e=P.current;if(!(!e||typeof window>"u"))return e.addEventListener("wheel",Ze,{passive:false}),e.addEventListener("touchend",Je,{passive:false}),()=>{e.removeEventListener("wheel",Ze),e.removeEventListener("touchend",Je);}},[Ze,Je]),jsxs(ro,{children:[(r||T)&&jsx(zt,{width:o,height:s}),jsx(oo,{ref:P,style:{width:o,height:s,display:r||T?"none":"block"},onMouseDown:qe,onMouseMove:Ve,onMouseUp:Le,onMouseLeave:Le,onClick:hr,onTouchStart:fr,onTouchMove:gr})]})}),ro=styled.div`
48
48
  display: flex;
49
49
  align-items: center;
50
50
  justify-content: center;
51
51
  width: 100%;
52
52
  min-width: 0;
53
53
  position: relative;
54
- `,oo=styled.canvas``;to.displayName="Graph2D";var Ts=w(({isActive:r,position:o,top:s=0,left:h=0,right:g,bottom:b,...f})=>jsx(io,{$isActive:r,$position:o,$top:s,$left:h,$right:g,$bottom:b,...f})),io=zr.div(({$isActive:r,$top:o,$left:s,$right:h,$bottom:g,$position:b,theme:f})=>`
54
+ `,oo=styled.canvas``;to.displayName="Graph2D";var Ls=w(({isActive:r,position:o,top:s=0,left:h=0,right:g,bottom:b,...f})=>jsx(io,{$isActive:r,$position:o,$top:s,$left:h,$right:g,$bottom:b,...f})),io=zr.div(({$isActive:r,$top:o,$left:s,$right:h,$bottom:g,$position:b,theme:f})=>`
55
55
  ${r?`
56
56
  position: ${b};
57
57
  z-index: 1000;
@@ -63,7 +63,7 @@ ${r?`
63
63
  `:""}
64
64
 
65
65
  min-width: 0;
66
- `);var $t=a(({url:r})=>{let[o,s]=useState(1),[h,g]=useState(),b=At.useRef(null),f=At.useRef(null),k=a(()=>{s(L=>Math.min(L+.25,4));},"handleZoomIn");return jsxs("div",{ref:f,className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex justify-center items-stretch p-5.5 gap-1 border-b border-gray-200 relative ",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"secondary",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:a(()=>{s(L=>Math.max(L-.25,.25));},"handleZoomOut"),disabled:o<=.25,p:5}),jsxs(pb,{py:5,px:8,children:[o*100,"%"]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"secondary",icon:jsx(ma,{style:{width:14,height:14}}),onClick:k,disabled:o>=4,p:8})]}),jsx("div",{className:"h-full w-full overflow-auto",children:jsx("img",{src:r,ref:b,alt:"image",className:"block w-auto max-w-none object-contain",style:{transition:"all 0.2s ease-in-out",marginInline:"auto",marginBlock:10,flexShrink:0,...h==="width"&&{width:`calc(${o*100}% - 20px)`},...h==="height"&&{height:`calc(${o*100}% - 20px)`}},onLoad:()=>{if(b.current&&f.current){let L=b.current.width,z=b.current.height,x=L<z?"height":"width";g(x);}}})})]})},"ImageDriver");var Ht=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full p-5.5",children:jsx("audio",{controls:true,src:r,className:"w-full"})}),"AudioDriver");var et=a(({url:r})=>{let[o,s]=useState(null),[h,g]=useState(false),[b,f]=useState(true),[k,T]=useState(null);return useEffect(()=>{g(true);},[]),useEffect(()=>{if(!h)return;a(async()=>{try{let z=await import('./PdfDriver-CRJ354FP.mjs');s(()=>z.PdfDriver),f(!1);}catch(z){console.error("Failed to load PDF driver:",z),T("Failed to load PDF viewer"),f(false);}},"loadPdfDriver")();},[h]),h?b?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})}):k||!o?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-red-500 text-center",children:jsx("p",{children:k||"PDF viewer unavailable"})})}):jsx(o,{url:r}):jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})})},"PdfDriverWrapper");var Yt=50,uo=1e4,Gt=a(({url:r,blob:o})=>{let s=useRef(null),h=useRef(null),[g,b]=useState(null),[f,k]=useState(true),[T,L]=useState(1),z$1=useRef(false),[x,C]=useState({width:0,height:0}),E=useRef(0),t=a(()=>{z$1.current=true,L(j=>Math.min(j+.25,4));},"handleZoomIn"),F=a(()=>{z$1.current=true,L(j=>Math.max(j-.25,.25));},"handleZoomOut");return useEffect(()=>{a(async()=>{if(h.current)try{k(!0),b(null);let y=o;if(!y&&r&&(y=await(await fetch(r)).blob()),!y){b("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(y.size/(1024*1024)>Yt){b(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${Yt} \u041C\u0411)`);return}h.current.innerHTML="";let S=renderAsync(y,h.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0}),D=new Promise((G,ee)=>setTimeout(()=>ee(new Error("\u0420\u0435\u043D\u0434\u0435\u0440\u0438\u043D\u0433 DOCX \u0437\u0430\u0439\u043D\u044F\u0432 \u043D\u0430\u0434\u0442\u043E \u0431\u0430\u0433\u0430\u0442\u043E \u0447\u0430\u0441\u0443")),uo));await Promise.race([S,D]),await new Promise(G=>requestAnimationFrame(G));let Z=h.current.querySelector(".docx-wrapper");if(Z&&(E.current=Z.offsetWidth,C({width:Z.offsetWidth,height:Z.offsetHeight})),s.current&&E.current>0){let G=s.current.clientWidth,ee=Math.min(G/E.current,1);L(ee);}k(!1);}catch(y){b(y?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),k(false);}},"renderDocument")();},[r,o]),useEffect(()=>{if(!s.current)return;let j=lo(B=>{if(!(z$1.current||E.current===0))for(let S of B){let D=S.contentRect.width,Z=Math.min(D/E.current,1);L(Z);}},150),y=new ResizeObserver(j);return y.observe(s.current),()=>{y.disconnect(),j.cancel();}},[]),jsxs("div",{className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex justify-center items-stretch p-5.5 gap-1 border-b border-gray-200",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"secondary",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:F,disabled:T<=.25,p:5}),jsxs(pb,{py:5,px:8,children:[Math.round(T*100),"%"]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"secondary",icon:jsx(ma,{style:{width:14,height:14}}),onClick:t,disabled:T>=4,p:8})]}),!!g&&!f&&jsx("div",{className:"text-red-500 p-5",children:g}),f&&jsx("div",{className:"flex items-center justify-center p-5",children:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."}),jsx("div",{ref:s,className:"w-full h-full overflow-auto",style:{backgroundColor:"gray"},children:jsx("div",{style:{width:x.width>0?x.width*T:void 0,height:x.height>0?x.height*T:void 0,overflow:"hidden",margin:"0 auto"},children:jsx("div",{ref:h,className:"[&>div.docx-wrapper_table_*]:wrap-break-word! [&>div.docx-wrapper_table]:table-fixed! [&>div.docx-wrapper_table]:max-w-full! [&>div.docx-wrapper_table]:w-full! [&>div.docx-wrapper_img]:max-w-full! [&>div.docx-wrapper_img]:h-auto! [&>div.docx-wrapper_table]:border-collapse! [&>div.docx-wrapper]:box-border [&>div.docx-wrapper]:min-w-fit [&>div.docx-wrapper>section]:min-w-fit [&>div.docx-wrapper]:min-h-full",style:{boxSizing:"border-box",wordBreak:"break-word",overflowWrap:"break-word",transform:`scale(${T})`,transformOrigin:"top left"}})})})]})},"DocxDriver");var Do=a(r=>({js:[javascript({jsx:false})],jsx:[javascript({jsx:true})],ts:[javascript({typescript:true,jsx:false})],tsx:[javascript({typescript:true,jsx:true})],json:[json()],html:[html()],css:[css()],scss:[css()],py:[python()],java:[java()],cpp:[cpp()],c:[cpp()],php:[php()],rs:[rust()],xml:[xml()],yaml:[yaml()],yml:[yaml()],md:[markdown()],sql:[sql()],sh:[markdown()],bash:[markdown()]})[r]||[],"getLanguageExtension"),Jt=a(({url:r,extension:o})=>{let[s,h]=useState(""),[g,b]=useState(true),[f,k]=useState(null),[T,L]=useState(0),z=useRef(null);if(useEffect(()=>{a(async()=>{try{b(!0),k(null);let E=await fetch(r);if(!E.ok)throw new Error(`Failed to load file: ${E.statusText}`);let t=await E.text();h(t);}catch(E){k(E instanceof Error?E.message:"Failed to load text content");}finally{b(false);}},"loadTextContent")();},[r]),useEffect(()=>{let C=a(()=>{if(z.current){let E=z.current.clientHeight;L(E);}},"updateHeight");return C(),window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C);}},[g]),g)return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("div",{className:"text-gray-500",children:"Loading text content..."})});if(f)return jsx("div",{className:"flex items-center justify-center p-8",children:jsxs("div",{className:"text-red-500",children:["Error: ",f]})});let x=Do(o);return jsx("div",{ref:z,className:"h-full w-full",children:T>0&&jsx(ho,{value:s,theme:vscodeDark,extensions:x,editable:false,height:`${T}px`,basicSetup:{lineNumbers:true,highlightActiveLineGutter:false,highlightActiveLine:false,foldGutter:true,dropCursor:false,indentOnInput:false,syntaxHighlighting:true,bracketMatching:true,closeBrackets:false,autocompletion:false,rectangularSelection:false,crosshairCursor:false,highlightSelectionMatches:false,closeBracketsKeymap:false,searchKeymap:false,foldKeymap:true,completionKeymap:false,lintKeymap:false}})})},"TextDriver");var Qt=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full",children:jsx("video",{controls:true,src:r,className:"w-full max-h-full"})}),"VideoDriver");var er=memo(a(function({extension:o,blob:s,path:h,buffer:g,not_supported_message:b=" Sorry, this file type isn\u2019t supported yet."}){console.log("Driver props:",{extension:o,blob:s,path:h,buffer:g});let f=o.toLocaleLowerCase().trim(),k;if(h?k=h:s&&(k=URL.createObjectURL(s)),k){if(["jpeg","jpg","png","gif","bmp","webp"].includes(f))return jsx($t,{url:k});if(["mp3","wav","ogg","flac"].includes(f))return jsx(Ht,{url:k});if(["mp4","webm"].includes(f))return jsx(Qt,{url:k});if(o==="pdf")return jsx(et,{url:k});if(["txt","js","jsx","ts","tsx","json","html","css","scss","py","java","cpp","c","cs","php","rb","go","rs","swift","kt","xml","yaml","yml","md","sql","sh","bash"].includes(f))return jsx(Jt,{url:k,extension:f})}return f==="docx"?jsx(Gt,{url:k,blob:s}):jsx("div",{className:"h-full flex flex-col justify-center items-center",children:jsx(pb,{className:"mx-5",children:jsx(Ya,{variant:"h2",color:"text.light",weight:500,className:"text-center",children:b})})})},"Driver"));var Bc=a(r=>jsx("div",{className:"h-full w-full",children:jsx(er,{...r})}),"FileViewer");var or=250,Vc=a(({text:r,speed:o=50,onDone:s,markdown:h=false,markdownComponents:g={},className:b,...f})=>{let[k,T]=useState(""),L=useRef(null),z=useRef(null);return useEffect(()=>{let x=false;if(o>0){T(""),L.current=performance.now();let C=a(E=>{if(x||!L.current)return;let t=E-L.current,F=t/o>or?o/2:o,j=t/o>or?1.5:1,y=Math.floor(t/F*j);if(y>=r.length){T(r),x=true,s?.();return}T(r.slice(0,y)),z.current=requestAnimationFrame(C);},"tick");z.current=requestAnimationFrame(C);}else T(r),s?.();return ()=>{z.current&&cancelAnimationFrame(z.current);}},[r,o,s]),h?jsx("div",{className:b,children:jsx(To,{remarkPlugins:[No],components:g,...f,children:k})}):jsx(Ya,{className:b,...f,children:k})},"Typewriter");var zo={timeout:2e3,message:"Copied!"},nl=a(({text:r,children:o,format:s="text/plain",tooltip:h})=>{let[g,b]=useState(false),f=useRef(null),k={...zo,...h},T=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):Lo(r,{format:s}),b(true),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>b(false),k.timeout);},"handleCopy");return useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(Bb,{onMouseLeave:()=>b(false),className:g?"visible":"hidden",content:k.message,children:o({copy:T})})},"CopyToClipboard");var nr=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),Xe=a((r,o)=>{let s;if(o){let g=parse(r||"",o,new Date);if(isValid(g)&&getYear(g)>=1970)return g}let h=new Date(r||"");return isNaN(h.getTime())?s:h},"parseDate"),_o=a((r,o)=>{let s=r?Xe(r,o):void 0;return s&&o?format(s,o):r},"renderDate"),yl=a(({value:r,range:o,inline:s=false,minDate:h=new Date(getYear(new Date)-5,0,1),maxDate:g=new Date(getYear(new Date)+5,11,31),format:b="dd.MM.yyyy",onChange:f,...k})=>{let[T,L]=useState(getMonth(nr(r))),[z,x]=useState(getYear(nr(r))),C=useMemo(()=>{if(r){if(Array.isArray(r)){let t=Xe(r[0],b),F=Xe(r[1],b);return [t,F]}return Xe(r,b)}},[r]),E=useCallback(t=>{if(o){let F=!!(C&&Array.isArray(C)&&C[0]),j=!!(C&&Array.isArray(C)&&C[1]);!F||F&&j?f?.([t.toString(),""]):F&&!j&&(t<C[0]?f?.([t.toString(),C[0].toString()]):f?.([C[0].toString(),t.toString()]));}else f?.(t.toString());},[o,C,f]);return s?jsx(ar,{month:T,year:z,minDate:h,maxDate:g,selectedDate:C,onSelectDate:E,onChangeMonth:L,onChangeYear:x}):o?jsx(Xo,{range:true,value:r,onChange:f,...k}):jsx(Yo,{value:r,onChange:f,minDate:h,maxDate:g,month:T,year:z,selectedDate:C,onChangeMonth:L,onChangeYear:x,onSelectDate:E,formatStr:b,...k})},"DatePicker"),Xo=a(({minDate:r,maxDate:o,value:s,onChange:h})=>null,"DatePickerGroupInput"),Yo=a(({placeholder:r,value:o,onChange:s,inputProps:h,...g})=>{let[b,f]=useState(false),k=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:b,onClickOutside:()=>f(false),content:jsx(pb,{children:jsx(ar,{...g})}),containerStyle:{zIndex:`${k.zIndex.popover}`},children:jsx("div",{onClick:()=>f(true),children:jsx(kb,{...h,placeholder:r,value:_o(o,g.formatStr),onChange:T=>s?.(T.target.value)})})})},"DatePickerInput"),ar=a(({month:r,year:o,selectedDate:s,minDate:h,maxDate:g,onSelectDate:b,onChangeMonth:f,onChangeYear:k})=>{let T=useMemo(()=>new Array(12).fill(null).map((y,B)=>{let S=new Date(0,B);return {value:B+1,inputDisplay:format(S,"MMMM")}}),[]),L=useMemo(()=>{let y=getYear(h),S=getYear(g)-y+1;return new Array(S).fill(null).map((D,Z)=>{let G=y+Z;return {value:G,inputDisplay:G.toString()}})},[h,g]),z$1=useMemo(()=>new Array(7).fill(null).map((y,B)=>{let S=startOfWeek(new Date,{weekStartsOn:B});return format(S,"EEE")}),[]),x=useMemo(()=>{let y=getWeeksInMonth(new Date(o,r)),B=startOfMonth(new Date(o,r)),S=previousMonday(B),D=differenceInDays(B,S);return new Array(y*7).fill(null).map((Z,G)=>new Date(o,r,G-D+1))},[r,o]),C=useCallback(()=>{r===0?(k(o-1),f(11)):f(r-1);},[r,o]),E=useCallback(()=>{r===11?(k(o+1),f(0)):f(r+1);},[r,o]),t=useMemo(()=>h?!(o<getYear(h)||o===getYear(h)&&r<=getMonth(h)):true,[r,o,h]),F=useMemo(()=>g?!(o>getYear(g)||o===getYear(g)&&r>=getMonth(g)):true,[r,o,g]),j=useCallback(y=>{y.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:j,children:[jsxs("div",{className:"flex justify-center items-center gap-2 pb-3",children:[t&&jsx(z,{size:"small",variant:"empty",icon:jsx(G,{}),onClick:C}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(ib,{placeholder:"",hasBorder:false,selected:r+1,options:T,onSelect:y=>f(y-1),maxWidth:150,maxHeight:300}),jsx(ib,{placeholder:"",hasBorder:false,selected:o,options:L,onSelect:y=>k(y),maxWidth:100,maxHeight:300})]}),F&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:E})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:z$1.map(y=>jsx("div",{className:"text-center",children:y},y))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:x.map(y=>{let B=getMonth(y)===r,S=format(y,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),D=s&&(Array.isArray(s)&&(s[0]&&format(y,"yyyy-MM-dd")===format(s[0],"yyyy-MM-dd")||s[1]&&format(y,"yyyy-MM-dd")===format(s[1],"yyyy-MM-dd"))||!Array.isArray(s)&&format(y,"yyyy-MM-dd")===format(s,"yyyy-MM-dd")),Z=s&&Array.isArray(s)&&s[0]&&s[1]&&y>s[0]&&y<s[1],G=h&&differenceInDays(y,h)<0||g&&differenceInDays(y,g)>0||!B;return jsx(Go,{date:y,isCurrentMonth:B,isCurrentDay:S,isSelected:!!D,isInRange:!!Z,isDisabled:!!G,onSelectDate:b},y.toISOString())})})]})},"DatePickerCalendar"),Go=a(({date:r,isCurrentMonth:o,isCurrentDay:s,isSelected:h,isInRange:g,isDisabled:b,onSelectDate:f})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${b?"text-gray-400 cursor-not-allowed":h?"bg-blue-500 text-white":g?"bg-blue-100":s?"text-blue-500":o?"text-black":"text-gray-400"} ${b?"":h?"hover:bg-blue-600":"hover:bg-gray-100"}`,onClick:a(T=>{b||f(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var Zo=a(r=>{switch(r){case "primary":return "bg-blue-100 border-blue-200 dark:bg-blue-800/10 dark:border-blue-900";case "error":return "bg-red-100 border-red-200 dark:bg-red-800/10 dark:border-red-900";case "warning":return "bg-yellow-100 border-yellow-200 dark:bg-yellow-800/10 dark:border-yellow-900";case "success":return "bg-teal-100 border-teal-200 dark:bg-teal-800/10 dark:border-teal-900";case "default":default:return "bg-white border border-gray-200 dark:bg-neutral-800 dark:border-neutral-700"}},"getColorStyle"),Uo=a(r=>{switch(r){case "primary":return "text-blue-800 dark:text-blue-500";case "error":return "text-red-800 dark:text-red-500";case "warning":return "text-yellow-800 dark:text-yellow-500";case "success":return "text-teal-800 dark:text-teal-500";case "default":default:return "text-gray-800 dark:text-white"}},"getTextColor"),Jo=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),lr=a(({id:r,color:o="default",message:s,duration:h,transitionDirection:g,cancelable:b=true,onClose:f})=>{let[k,T]=useState(false),[L,z]=useState(false),x=useRef(null),C=useCallback(()=>{T(true),x.current=setTimeout(()=>{f(r);},300);},[r,f]);return useEffect(()=>{if(z(true),h&&h<1/0){let E=setTimeout(()=>{C();},h);return ()=>clearTimeout(E)}},[h,C]),useEffect(()=>()=>{x.current&&clearTimeout(x.current);},[]),jsx("div",{className:`max-w-xs
66
+ `);var $t=a(({url:r})=>{let[o,s]=useState(1),[h,g]=useState(),b=At.useRef(null),f=At.useRef(null),x=a(()=>{s(L=>Math.min(L+.25,4));},"handleZoomIn");return jsxs("div",{ref:f,className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex justify-center items-stretch p-5.5 gap-1 border-b border-gray-200 relative ",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"secondary",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:a(()=>{s(L=>Math.max(L-.25,.25));},"handleZoomOut"),disabled:o<=.25,p:5}),jsxs(pb,{py:5,px:8,children:[o*100,"%"]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"secondary",icon:jsx(ma,{style:{width:14,height:14}}),onClick:x,disabled:o>=4,p:8})]}),jsx("div",{className:"h-full w-full overflow-auto",children:jsx("img",{src:r,ref:b,alt:"image",className:"block w-auto max-w-none object-contain",style:{transition:"all 0.2s ease-in-out",marginInline:"auto",marginBlock:10,flexShrink:0,...h==="width"&&{width:`calc(${o*100}% - 20px)`},...h==="height"&&{height:`calc(${o*100}% - 20px)`}},onLoad:()=>{if(b.current&&f.current){let L=b.current.width,I=b.current.height,k=L<I?"height":"width";g(k);}}})})]})},"ImageDriver");var Ht=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full p-5.5",children:jsx("audio",{controls:true,src:r,className:"w-full"})}),"AudioDriver");var et=a(({url:r})=>{let[o,s]=useState(null),[h,g]=useState(false),[b,f]=useState(true),[x,C]=useState(null);return useEffect(()=>{g(true);},[]),useEffect(()=>{if(!h)return;a(async()=>{try{let I=await import('./PdfDriver-CRJ354FP.mjs');s(()=>I.PdfDriver),f(!1);}catch(I){console.error("Failed to load PDF driver:",I),C("Failed to load PDF viewer"),f(false);}},"loadPdfDriver")();},[h]),h?b?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})}):x||!o?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-red-500 text-center",children:jsx("p",{children:x||"PDF viewer unavailable"})})}):jsx(o,{url:r}):jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})})},"PdfDriverWrapper");var Yt=50,uo=1e4,Gt=a(({url:r,blob:o})=>{let s=useRef(null),h=useRef(null),[g,b]=useState(null),[f,x]=useState(true),[C,L]=useState(1),I=useRef(false),[k,T]=useState({width:0,height:0}),F=useRef(0),t=a(()=>{I.current=true,L(B=>Math.min(B+.25,4));},"handleZoomIn"),z$1=a(()=>{I.current=true,L(B=>Math.max(B-.25,.25));},"handleZoomOut");return useEffect(()=>{a(async()=>{if(h.current)try{x(!0),b(null);let y=o;if(!y&&r&&(y=await(await fetch(r)).blob()),!y){b("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(y.size/(1024*1024)>Yt){b(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${Yt} \u041C\u0411)`);return}h.current.innerHTML="";let P=renderAsync(y,h.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0}),D=new Promise((G,ee)=>setTimeout(()=>ee(new Error("\u0420\u0435\u043D\u0434\u0435\u0440\u0438\u043D\u0433 DOCX \u0437\u0430\u0439\u043D\u044F\u0432 \u043D\u0430\u0434\u0442\u043E \u0431\u0430\u0433\u0430\u0442\u043E \u0447\u0430\u0441\u0443")),uo));await Promise.race([P,D]),await new Promise(G=>requestAnimationFrame(G));let Z=h.current.querySelector(".docx-wrapper");if(Z&&(F.current=Z.offsetWidth,T({width:Z.offsetWidth,height:Z.offsetHeight})),s.current&&F.current>0){let G=s.current.clientWidth,ee=Math.min(G/F.current,1);L(ee);}x(!1);}catch(y){b(y?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),x(false);}},"renderDocument")();},[r,o]),useEffect(()=>{if(!s.current)return;let B=lo(j=>{if(!(I.current||F.current===0))for(let P of j){let D=P.contentRect.width,Z=Math.min(D/F.current,1);L(Z);}},150),y=new ResizeObserver(B);return y.observe(s.current),()=>{y.disconnect(),B.cancel();}},[]),jsxs("div",{className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex justify-center items-stretch p-5.5 gap-1 border-b border-gray-200",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"secondary",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:z$1,disabled:C<=.25,p:5}),jsxs(pb,{py:5,px:8,children:[Math.round(C*100),"%"]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"secondary",icon:jsx(ma,{style:{width:14,height:14}}),onClick:t,disabled:C>=4,p:8})]}),!!g&&!f&&jsx("div",{className:"text-red-500 p-5",children:g}),f&&jsx("div",{className:"flex items-center justify-center p-5",children:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."}),jsx("div",{ref:s,className:"w-full h-full overflow-auto",style:{backgroundColor:"gray"},children:jsx("div",{style:{width:k.width>0?k.width*C:void 0,height:k.height>0?k.height*C:void 0,overflow:"hidden",margin:"0 auto"},children:jsx("div",{ref:h,className:"[&>div.docx-wrapper_table_*]:wrap-break-word! [&>div.docx-wrapper_table]:table-fixed! [&>div.docx-wrapper_table]:max-w-full! [&>div.docx-wrapper_table]:w-full! [&>div.docx-wrapper_img]:max-w-full! [&>div.docx-wrapper_img]:h-auto! [&>div.docx-wrapper_table]:border-collapse! [&>div.docx-wrapper]:box-border [&>div.docx-wrapper]:min-w-fit [&>div.docx-wrapper>section]:min-w-fit [&>div.docx-wrapper]:min-h-full",style:{boxSizing:"border-box",wordBreak:"break-word",overflowWrap:"break-word",transform:`scale(${C})`,transformOrigin:"top left"}})})})]})},"DocxDriver");var Po=a(r=>({js:[javascript({jsx:false})],jsx:[javascript({jsx:true})],ts:[javascript({typescript:true,jsx:false})],tsx:[javascript({typescript:true,jsx:true})],json:[json()],html:[html()],css:[css()],scss:[css()],py:[python()],java:[java()],cpp:[cpp()],c:[cpp()],php:[php()],rs:[rust()],xml:[xml()],yaml:[yaml()],yml:[yaml()],md:[markdown()],sql:[sql()],sh:[markdown()],bash:[markdown()]})[r]||[],"getLanguageExtension"),Jt=a(({url:r,extension:o})=>{let[s,h]=useState(""),[g,b]=useState(true),[f,x]=useState(null),[C,L]=useState(0),I=useRef(null);if(useEffect(()=>{a(async()=>{try{b(!0),x(null);let t=await fetch(r);if(!t.ok)throw new Error(`Failed to load file: ${t.statusText}`);let z=await t.text();h(z);}catch(t){x(t instanceof Error?t.message:"Failed to load text content");}finally{b(false);}},"loadTextContent")();},[r]),useEffect(()=>{let F=a(()=>{if(I.current){let t=I.current.clientHeight;L(t);}},"updateHeight");return F(),window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F);}},[g]),g)return jsx("div",{className:"flex items-center justify-center p-8",children:jsx("div",{className:"text-gray-500",children:"Loading text content..."})});if(f)return jsx("div",{className:"flex items-center justify-center p-8",children:jsxs("div",{className:"text-red-500",children:["Error: ",f]})});if(o==="md")return jsx("div",{ref:I,className:"h-full w-full overflow-auto p-5 prose max-w-[100%] select-text prose-table",style:{wordBreak:"break-word"},children:jsx(Do,{remarkPlugins:[Mo],children:s})});let T=Po(o);return jsx("div",{ref:I,className:"h-full w-full",children:C>0&&jsx(ho,{value:s,theme:vscodeLight,extensions:T,editable:false,height:`${C}px`,basicSetup:{lineNumbers:true,highlightActiveLineGutter:false,highlightActiveLine:false,foldGutter:true,dropCursor:false,indentOnInput:false,syntaxHighlighting:true,bracketMatching:true,closeBrackets:false,autocompletion:false,rectangularSelection:false,crosshairCursor:false,highlightSelectionMatches:false,closeBracketsKeymap:false,searchKeymap:false,foldKeymap:true,completionKeymap:false,lintKeymap:false}})})},"TextDriver");var Qt=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full",children:jsx("video",{controls:true,src:r,className:"w-full max-h-full"})}),"VideoDriver");var er=memo(a(function({extension:o,blob:s,path:h,buffer:g,not_supported_message:b=" Sorry, this file type isn\u2019t supported yet."}){console.log("Driver props:",{extension:o,blob:s,path:h,buffer:g});let f=o.toLocaleLowerCase().trim(),x;if(h?x=h:s&&(x=URL.createObjectURL(s)),x){if(["jpeg","jpg","png","gif","bmp","webp"].includes(f))return jsx($t,{url:x});if(["mp3","wav","ogg","flac"].includes(f))return jsx(Ht,{url:x});if(["mp4","webm"].includes(f))return jsx(Qt,{url:x});if(o==="pdf")return jsx(et,{url:x});if(["txt","js","jsx","ts","tsx","json","html","css","scss","py","java","cpp","c","cs","php","rb","go","rs","swift","kt","xml","yaml","yml","md","sql","sh","bash"].includes(f))return jsx(Jt,{url:x,extension:f})}return f==="docx"?jsx(Gt,{url:x,blob:s}):jsx("div",{className:"h-full flex flex-col justify-center items-center",children:jsx(pb,{className:"mx-5",children:jsx(Ya,{variant:"h2",color:"text.light",weight:500,className:"text-center",children:b})})})},"Driver"));var $c=a(r=>jsx("div",{className:"h-full w-full",children:jsx(er,{...r})}),"FileViewer");var or=250,Kc=a(({text:r,speed:o=50,onDone:s,markdown:h=false,markdownComponents:g={},className:b,...f})=>{let[x,C]=useState(""),L=useRef(null),I=useRef(null);return useEffect(()=>{let k=false;if(o>0){C(""),L.current=performance.now();let T=a(F=>{if(k||!L.current)return;let t=F-L.current,z=t/o>or?o/2:o,B=t/o>or?1.5:1,y=Math.floor(t/z*B);if(y>=r.length){C(r),k=true,s?.();return}C(r.slice(0,y)),I.current=requestAnimationFrame(T);},"tick");I.current=requestAnimationFrame(T);}else C(r),s?.();return ()=>{I.current&&cancelAnimationFrame(I.current);}},[r,o,s]),h?jsx("div",{className:b,children:jsx(Do,{remarkPlugins:[Mo],components:g,...f,children:x})}):jsx(Ya,{className:b,...f,children:x})},"Typewriter");var jo={timeout:2e3,message:"Copied!"},cl=a(({text:r,children:o,format:s="text/plain",tooltip:h})=>{let[g,b]=useState(false),f=useRef(null),x={...jo,...h},C=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):Io(r,{format:s}),b(true),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>b(false),x.timeout);},"handleCopy");return useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx(Bb,{onMouseLeave:()=>b(false),className:g?"visible":"hidden",content:x.message,children:o({copy:C})})},"CopyToClipboard");var nr=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),Xe=a((r,o)=>{let s;if(o){let g=parse(r||"",o,new Date);if(isValid(g)&&getYear(g)>=1970)return g}let h=new Date(r||"");return isNaN(h.getTime())?s:h},"parseDate"),Yo=a((r,o)=>{let s=r?Xe(r,o):void 0;return s&&o?format(s,o):r},"renderDate"),xl=a(({value:r,range:o,inline:s=false,minDate:h=new Date(getYear(new Date)-5,0,1),maxDate:g=new Date(getYear(new Date)+5,11,31),format:b="dd.MM.yyyy",onChange:f,...x})=>{let[C,L]=useState(getMonth(nr(r))),[I,k]=useState(getYear(nr(r))),T=useMemo(()=>{if(r){if(Array.isArray(r)){let t=Xe(r[0],b),z=Xe(r[1],b);return [t,z]}return Xe(r,b)}},[r]),F=useCallback(t=>{if(o){let z=!!(T&&Array.isArray(T)&&T[0]),B=!!(T&&Array.isArray(T)&&T[1]);!z||z&&B?f?.([t.toString(),""]):z&&!B&&(t<T[0]?f?.([t.toString(),T[0].toString()]):f?.([T[0].toString(),t.toString()]));}else f?.(t.toString());},[o,T,f]);return s?jsx(ar,{month:C,year:I,minDate:h,maxDate:g,selectedDate:T,onSelectDate:F,onChangeMonth:L,onChangeYear:k}):o?jsx(Go,{range:true,value:r,onChange:f,...x}):jsx(qo,{value:r,onChange:f,minDate:h,maxDate:g,month:C,year:I,selectedDate:T,onChangeMonth:L,onChangeYear:k,onSelectDate:F,formatStr:b,...x})},"DatePicker"),Go=a(({minDate:r,maxDate:o,value:s,onChange:h})=>null,"DatePickerGroupInput"),qo=a(({placeholder:r,value:o,onChange:s,inputProps:h,...g})=>{let[b,f]=useState(false),x=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:b,onClickOutside:()=>f(false),content:jsx(pb,{children:jsx(ar,{...g})}),containerStyle:{zIndex:`${x.zIndex.popover}`},children:jsx("div",{onClick:()=>f(true),children:jsx(kb,{...h,placeholder:r,value:Yo(o,g.formatStr),onChange:C=>s?.(C.target.value)})})})},"DatePickerInput"),ar=a(({month:r,year:o,selectedDate:s,minDate:h,maxDate:g,onSelectDate:b,onChangeMonth:f,onChangeYear:x})=>{let C=useMemo(()=>new Array(12).fill(null).map((y,j)=>{let P=new Date(0,j);return {value:j+1,inputDisplay:format(P,"MMMM")}}),[]),L=useMemo(()=>{let y=getYear(h),P=getYear(g)-y+1;return new Array(P).fill(null).map((D,Z)=>{let G=y+Z;return {value:G,inputDisplay:G.toString()}})},[h,g]),I=useMemo(()=>new Array(7).fill(null).map((y,j)=>{let P=startOfWeek(new Date,{weekStartsOn:j});return format(P,"EEE")}),[]),k=useMemo(()=>{let y=getWeeksInMonth(new Date(o,r),{weekStartsOn:1}),j=startOfMonth(new Date(o,r)),P=previousMonday(j),D=differenceInDays(j,P);return new Array(y*7).fill(null).map((Z,G)=>new Date(o,r,G-D+1))},[r,o]),T=useCallback(()=>{r===0?(x(o-1),f(11)):f(r-1);},[r,o]),F=useCallback(()=>{r===11?(x(o+1),f(0)):f(r+1);},[r,o]),t=useMemo(()=>h?!(o<getYear(h)||o===getYear(h)&&r<=getMonth(h)):true,[r,o,h]),z$1=useMemo(()=>g?!(o>getYear(g)||o===getYear(g)&&r>=getMonth(g)):true,[r,o,g]),B=useCallback(y=>{y.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:B,children:[jsxs("div",{className:"flex justify-center items-center gap-2 pb-3",children:[t&&jsx(z,{size:"small",variant:"empty",icon:jsx(G,{}),onClick:T}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(ib,{placeholder:"",hasBorder:false,selected:r+1,options:C,onSelect:y=>f(y-1),maxWidth:150,maxHeight:300}),jsx(ib,{placeholder:"",hasBorder:false,selected:o,options:L,onSelect:y=>x(y),maxWidth:100,maxHeight:300})]}),z$1&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:F})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:I.map(y=>jsx("div",{className:"text-center",children:y},y))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:k.map(y=>{let j=getMonth(y)===r,P=format(y,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),D=s&&(Array.isArray(s)&&(s[0]&&format(y,"yyyy-MM-dd")===format(s[0],"yyyy-MM-dd")||s[1]&&format(y,"yyyy-MM-dd")===format(s[1],"yyyy-MM-dd"))||!Array.isArray(s)&&format(y,"yyyy-MM-dd")===format(s,"yyyy-MM-dd")),Z=s&&Array.isArray(s)&&s[0]&&s[1]&&y>s[0]&&y<s[1],G=h&&differenceInDays(y,h)<0||g&&differenceInDays(y,g)>0||!j;return jsx(Vo,{date:y,isCurrentMonth:j,isCurrentDay:P,isSelected:!!D,isInRange:!!Z,isDisabled:!!G,onSelectDate:b},y.toISOString())})})]})},"DatePickerCalendar"),Vo=a(({date:r,isCurrentMonth:o,isCurrentDay:s,isSelected:h,isInRange:g,isDisabled:b,onSelectDate:f})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${b?"text-gray-400 cursor-not-allowed":h?"bg-blue-500 text-white":g?"bg-blue-100":s?"text-blue-500":o?"text-black":"text-gray-400"} ${b?"":h?"hover:bg-blue-600":"hover:bg-gray-100"}`,onClick:a(C=>{b||f(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var Jo=a(r=>{switch(r){case "primary":return "bg-blue-100 border-blue-200 dark:bg-blue-800/10 dark:border-blue-900";case "error":return "bg-red-100 border-red-200 dark:bg-red-800/10 dark:border-red-900";case "warning":return "bg-yellow-100 border-yellow-200 dark:bg-yellow-800/10 dark:border-yellow-900";case "success":return "bg-teal-100 border-teal-200 dark:bg-teal-800/10 dark:border-teal-900";case "default":default:return "bg-white border border-gray-200 dark:bg-neutral-800 dark:border-neutral-700"}},"getColorStyle"),Ko=a(r=>{switch(r){case "primary":return "text-blue-800 dark:text-blue-500";case "error":return "text-red-800 dark:text-red-500";case "warning":return "text-yellow-800 dark:text-yellow-500";case "success":return "text-teal-800 dark:text-teal-500";case "default":default:return "text-gray-800 dark:text-white"}},"getTextColor"),Qo=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),lr=a(({id:r,color:o="default",message:s,duration:h,transitionDirection:g,cancelable:b=true,onClose:f})=>{let[x,C]=useState(false),[L,I]=useState(false),k=useRef(null),T=useCallback(()=>{C(true),k.current=setTimeout(()=>{f(r);},300);},[r,f]);return useEffect(()=>{if(I(true),h&&h<1/0){let F=setTimeout(()=>{T();},h);return ()=>clearTimeout(F)}},[h,T]),useEffect(()=>()=>{k.current&&clearTimeout(k.current);},[]),jsx("div",{className:`max-w-xs
67
67
  border
68
68
  w-full
69
69
  text-sm
@@ -71,8 +71,8 @@ ${r?`
71
71
  transition-all
72
72
  ease-in-out
73
73
  duration-300
74
- ${k||!L?"opacity-0":"opacity-100"}
75
- ${L?"translate-y-0":Jo(g)}
76
- ${Zo(o)} ${Uo(o)}`,children:jsxs("div",{className:"flex p-4 ",children:[s,b&&jsx("div",{className:"ms-auto",children:jsx("button",{type:"button",className:"inline-flex shrink-0 justify-center items-center size-5 rounded-lg opacity-50 hover:opacity-100 focus:outline-hidden focus:opacity-100 cursor-pointer","aria-label":"Close",onClick:C,children:jsxs("svg",{className:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]})})})]})})},"Toast");var Qo=a((r,o)=>{switch(r){case "top-right":return `top-${o} right-${o}`;case "top-left":return `top-${o} left-${o}`;case "bottom-right":return `bottom-${o} right-${o}`;case "bottom-left":return `bottom-${o} left-${o}`;default:return `top-${o} right-${o}`}},"getPosition"),Ll=a(({items:r,onClose:o,position:s="top-right",offset:h=4})=>{let g=useMemo(()=>s.startsWith("top")?"top":"bottom",[s]);return jsx("div",{className:`fixed flex min-w-0 max-w-xs w-full flex-col z-50 gap-2 ${Qo(s,h)}`,children:r.map(b=>jsx(lr,{transitionDirection:g,...b,onClose:o},b.id))})},"ToastsList");var $l=a(({onChange:r,disabled:o,multiple:s,dragText:h="Drop file to upload",className:g})=>{let[b,f]=useState(false),[k,T]=useState(false),[L,z]=useState(false);return useEffect(()=>{if(o)return;let x=0,C=a(j=>{j.preventDefault(),x++,x===1&&f(true);},"handleDragEnter"),E=a(j=>{j.preventDefault(),x--,x===0&&f(false);},"handleDragLeave"),t=a(j=>{j.preventDefault();},"handleDragOver"),F=a(async j=>{if(j.preventDefault(),x=0,f(false),!k)try{T(!0);let y=await lb(j.dataTransfer.items);r(s?y:y.length>0?[y[0]]:[]);}catch(y){console.error("\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0447\u0438\u0442\u0430\u043D\u043D\u0456 \u0444\u0430\u0439\u043B\u0456\u0432:",y);}finally{T(false);}},"handleDrop");return document.addEventListener("dragenter",C),document.addEventListener("dragleave",E),document.addEventListener("dragover",t),document.addEventListener("drop",F),()=>{document.removeEventListener("dragenter",C),document.removeEventListener("dragleave",E),document.removeEventListener("dragover",t),document.removeEventListener("drop",F);}},[o,k,s,r]),useEffect(()=>{z(true);},[]),L&&b?createPortal(jsx("div",{className:`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-[rgba(251,250,250,0.9)] z-9999 ${g}`,children:jsx(Ya,{variant:"h3",className:"px-3 py-2 bg-white rounded-md border border-gray-200",children:h})}),document.body):null},"GlobalDropZone");
77
- export{Yi as Container,nl as CopyToClipboard,yl as DatePicker,ar as DatePickerCalendar,Bc as FileViewer,Ts as FullscreenCard,$l as GlobalDropZone,to as Graph2D,Ni as PageContent,Pi as PageLayout,Ji as SplitterLayout,Dr as Styled,yr as StyledContainer,wr as StyledMain,zi as SubNav,Ll as ToastsList,Vc as Typewriter};//# sourceMappingURL=index.mjs.map
74
+ ${x||!L?"opacity-0":"opacity-100"}
75
+ ${L?"translate-y-0":Qo(g)}
76
+ ${Jo(o)} ${Ko(o)}`,children:jsxs("div",{className:"flex p-4 ",children:[s,b&&jsx("div",{className:"ms-auto",children:jsx("button",{type:"button",className:"inline-flex shrink-0 justify-center items-center size-5 rounded-lg opacity-50 hover:opacity-100 focus:outline-hidden focus:opacity-100 cursor-pointer","aria-label":"Close",onClick:T,children:jsxs("svg",{className:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]})})})]})})},"Toast");var tn=a((r,o)=>{switch(r){case "top-right":return `top-${o} right-${o}`;case "top-left":return `top-${o} left-${o}`;case "bottom-right":return `bottom-${o} right-${o}`;case "bottom-left":return `bottom-${o} left-${o}`;default:return `top-${o} right-${o}`}},"getPosition"),zl=a(({items:r,onClose:o,position:s="top-right",offset:h=4})=>{let g=useMemo(()=>s.startsWith("top")?"top":"bottom",[s]);return jsx("div",{className:`fixed flex min-w-0 max-w-xs w-full flex-col z-50 gap-2 ${tn(s,h)}`,children:r.map(b=>jsx(lr,{transitionDirection:g,...b,onClose:o},b.id))})},"ToastsList");var Xl=a(({onChange:r,disabled:o,multiple:s,dragText:h="Drop file to upload",className:g})=>{let[b,f]=useState(false),[x,C]=useState(false),[L,I]=useState(false);return useEffect(()=>{if(o)return;let k=0,T=a(B=>{B.preventDefault(),k++,k===1&&f(true);},"handleDragEnter"),F=a(B=>{B.preventDefault(),k--,k===0&&f(false);},"handleDragLeave"),t=a(B=>{B.preventDefault();},"handleDragOver"),z=a(async B=>{if(B.preventDefault(),k=0,f(false),!x)try{C(!0);let y=await lb(B.dataTransfer.items);r(s?y:y.length>0?[y[0]]:[]);}catch(y){console.error("\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u043F\u0440\u0438 \u0447\u0438\u0442\u0430\u043D\u043D\u0456 \u0444\u0430\u0439\u043B\u0456\u0432:",y);}finally{C(false);}},"handleDrop");return document.addEventListener("dragenter",T),document.addEventListener("dragleave",F),document.addEventListener("dragover",t),document.addEventListener("drop",z),()=>{document.removeEventListener("dragenter",T),document.removeEventListener("dragleave",F),document.removeEventListener("dragover",t),document.removeEventListener("drop",z);}},[o,x,s,r]),useEffect(()=>{I(true);},[]),L&&b?createPortal(jsx("div",{className:`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-[rgba(251,250,250,0.9)] z-9999 ${g}`,children:jsx(Ya,{variant:"h3",className:"px-3 py-2 bg-white rounded-md border border-gray-200",children:h})}),document.body):null},"GlobalDropZone");
77
+ export{qi as Container,cl as CopyToClipboard,xl as DatePicker,ar as DatePickerCalendar,$c as FileViewer,Ls as FullscreenCard,Xl as GlobalDropZone,to as Graph2D,Ei as PageContent,Si as PageLayout,Qi as SplitterLayout,Dr as Styled,yr as StyledContainer,wr as StyledMain,ji as SubNav,zl as ToastsList,Kc as Typewriter};//# sourceMappingURL=index.mjs.map
78
78
  //# sourceMappingURL=index.mjs.map