@cyber-harbour/ui 2.2.6 → 2.2.7-beta.0

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,Ya,ma as ma$1,Cb,y,kb,G,ib,H,lb}from'./chunk-FRUL75XR.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,Kb 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,Db 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,Fb as Modal,Hb as ModalBody,Ib as ModalFooter,Gb as ModalHeader,W as MoonIcon,X as OpenLockIcon,Y as OrganizationIcon,Eb 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,Lb 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,Cb as StyledTooltipContent,fa as SunIcon,xb as Switch,db as Table,sb as Tag,Jb 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-FRUL75XR.mjs';import wo,{styled,useTheme,keyframes,css as css$1}from'styled-components';export{ServerStyleSheet,StyleSheetManager}from'styled-components';import {jsx,jsxs}from'react/jsx-runtime';import ur,{useState,useRef,useCallback,useEffect,Fragment,forwardRef,useMemo,useImperativeHandle,useLayoutEffect,memo}from'react';import No from'lodash.clonedeep';import {scaleOrdinal,schemeCategory10,forceSimulation,forceLink,forceManyBody,forceX,forceY,forceCenter,forceCollide}from'd3';import vo from'react-content-loader';import {renderAsync}from'docx-preview';import Go from'lodash.throttle';import Jo 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 ln from'react-markdown';import dn from'remark-gfm';import {TableVirtuoso}from'react-virtuoso';import zt from'papaparse';import Gn from'copy-to-clipboard';import {Popover}from'react-tiny-popover';import {parse,isValid,getYear,format,getMonth,startOfWeek,startOfMonth,endOfMonth,getDay,previousSunday,nextSaturday,differenceInDays}from'date-fns';import {createPortal}from'react-dom';var Xs=a(({children:r,className:o})=>jsx(ro,{className:o,children:r}),"PageLayout"),ro=styled.div`
1
+ import {a,w,x,u,c,l,z,Pa,pb,Ya,ma as ma$1,Cb,y,kb,G,ib,H,lb}from'./chunk-FRUL75XR.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,Kb 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,Db 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,Fb as Modal,Hb as ModalBody,Ib as ModalFooter,Gb as ModalHeader,W as MoonIcon,X as OpenLockIcon,Y as OrganizationIcon,Eb 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,Lb 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,Cb as StyledTooltipContent,fa as SunIcon,xb as Switch,db as Table,sb as Tag,Jb 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-FRUL75XR.mjs';import vo,{styled,useTheme,keyframes,css as css$1}from'styled-components';export{ServerStyleSheet,StyleSheetManager}from'styled-components';import {jsx,jsxs}from'react/jsx-runtime';import {useState,useRef,useCallback,useEffect,Fragment,forwardRef,useMemo,useImperativeHandle,useLayoutEffect,memo}from'react';import To from'lodash.clonedeep';import {scaleOrdinal,schemeCategory10,forceSimulation,forceLink,forceManyBody,forceX,forceY,forceCenter,forceCollide}from'd3';import yo from'react-content-loader';import Vo from'lodash.throttle';import {renderAsync}from'docx-preview';import Qo 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 dn from'react-markdown';import un from'remark-gfm';import {TableVirtuoso}from'react-virtuoso';import Lt from'papaparse';import Zn from'copy-to-clipboard';import {Popover}from'react-tiny-popover';import {parse,isValid,getYear,format,getMonth,startOfWeek,startOfMonth,endOfMonth,getDay,previousSunday,nextSaturday,differenceInDays}from'date-fns';import {createPortal}from'react-dom';var qs=a(({children:r,className:o})=>jsx(to,{className:o,children:r}),"PageLayout"),to=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,Ya,ma as ma$1,Cb,y,kb,G,ib,H,lb}from'./chunk-FRUL75X
9
9
  & > header {
10
10
  grid-area: header;
11
11
  }
12
- `;var Gs=a(({children:r,className:o})=>jsx(ao,{className:o,children:r}),"PageContent"),ao=styled.main`
12
+ `;var Zs=a(({children:r,className:o})=>jsx(no,{className:o,children:r}),"PageContent"),no=styled.main`
13
13
  grid-area: content;
14
14
  min-width: 0;
15
15
  background: ${({theme:r})=>r.colors.backgroundBase};
16
- `;var ec=a(({children:r,className:o,top:n=0})=>jsx(co,{className:o,$top:n,onClick:a=>a.stopPropagation(),children:r}),"SubNav"),co=styled.div(({theme:r,$top:o})=>`
16
+ `;var tc=a(({children:r,className:o,top:n=0})=>jsx(so,{className:o,$top:n,onClick:a=>a.stopPropagation(),children:r}),"SubNav"),so=styled.div(({theme:r,$top:o})=>`
17
17
  display: flex;
18
18
  flex-direction: column;
19
19
  justify-content: space-between;
@@ -33,37 +33,37 @@ import {a,w,x,u,c,l,z,Pa,pb,Ya,ma as ma$1,Cb,y,kb,G,ib,H,lb}from'./chunk-FRUL75X
33
33
  position: sticky;
34
34
  border-right: 1px solid ${r.colors.stroke.light};
35
35
  }
36
- `);var uc=w(({maxWidth:r,...o})=>jsx(po,{...o,$maxWidth:r})),po=x(styled.div(({theme:r,$maxWidth:o,px:n=20})=>`
36
+ `);var pc=w(({maxWidth:r,...o})=>jsx(uo,{...o,$maxWidth:r})),uo=x(styled.div(({theme:r,$maxWidth:o,px:n=20})=>`
37
37
  ${u(r,"padding-inline",n)}
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 bo=20,yo="splitter_columns_widths",ar=a((r,o,n)=>{let a=localStorage.getItem(r);if(a)try{let c=JSON.parse(a);if(Array.isArray(c)&&c.length===o)return c}catch{}else if(n.length===o)return n;return Array(o).fill(100/o)},"getSavedWidths"),bc=a(({columns:r,initialWidths:o,layoutClassname:n="",splitterClassname:a="",minWidth:c=bo,storageKey:i=yo})=>{let[h,y]=useState(()=>ar(i,r.length,o)),w=useRef(null),P=useRef(null),S=useRef(c),v=useRef(h),N=useCallback(L=>{if(P.current===null||!w.current)return;let C=w.current.getBoundingClientRect(),M=C.width,F=L-C.left,$=[...v.current],te=P.current,re=te+1,pe=$.slice(0,te).reduce((Se,Me)=>Se+Me,0),he=F/M*100-pe,me=$[te]+$[re]-he;he>=S.current&&me>=S.current&&($[te]=he,$[re]=me,y($),v.current=$);},[]),_=useCallback(L=>N(L.clientX),[N]),t=useCallback(L=>{L.preventDefault(),N(L.touches[0].clientX);},[N]),I=useCallback(()=>{P.current=null,localStorage.setItem(i,JSON.stringify(v.current)),document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",I),document.removeEventListener("touchmove",t),document.removeEventListener("touchend",I);},[_,t,i]),D=useCallback(L=>C=>{C.preventDefault(),P.current=L,document.addEventListener("mousemove",_,{passive:false}),document.addEventListener("mouseup",I);},[_,I]),p=useCallback(L=>C=>{C.preventDefault(),P.current=L,document.addEventListener("touchmove",t,{passive:false}),document.addEventListener("touchend",I);},[t,I]);return useEffect(()=>{let L=ar(i,r.length,o);v.current=L,y(L);},[r.length,o,i]),jsx("div",{ref:w,className:`flex select-none ${n}`,children:r.map(({content:L,className:C},M)=>jsxs(Fragment,{children:[jsx("div",{className:C,style:{flex:`${h[M]} 1 0%`},children:L}),M<r.length-1&&jsx("div",{onMouseDown:D(M),onTouchStart:p(M),className:`hidden lg:flex! lg:sticky lg:top-0 border-s border-gray-200 ${a}`,children:jsx("span",{className:"absolute top-1/2 start-1/2 -translate-x-1/2 -translate-y-1/2 block w-5 h-8 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-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"})]})})})]},`${M}`))})},"SplitterLayout");var ko=wo.div`
41
+ `),{ignoreStyles:["padding-inline"]});var mo=20,bo="splitter_columns_widths",nr=a((r,o,n)=>{let a=localStorage.getItem(r);if(a)try{let s=JSON.parse(a);if(Array.isArray(s)&&s.length===o)return s}catch{}else if(n.length===o)return n;return Array(o).fill(100/o)},"getSavedWidths"),yc=a(({columns:r,initialWidths:o,layoutClassname:n="",splitterClassname:a="",minWidth:s=mo,storageKey:i=bo})=>{let[h,b]=useState(()=>nr(i,r.length,o)),v=useRef(null),P=useRef(null),D=useRef(s),x=useRef(h),N=useCallback(E=>{if(P.current===null||!v.current)return;let C=v.current.getBoundingClientRect(),M=C.width,F=E-C.left,H=[...x.current],te=P.current,re=te+1,pe=H.slice(0,te).reduce((Se,Me)=>Se+Me,0),he=F/M*100-pe,me=H[te]+H[re]-he;he>=D.current&&me>=D.current&&(H[te]=he,H[re]=me,b(H),x.current=H);},[]),z=useCallback(E=>N(E.clientX),[N]),t=useCallback(E=>{E.preventDefault(),N(E.touches[0].clientX);},[N]),I=useCallback(()=>{P.current=null,localStorage.setItem(i,JSON.stringify(x.current)),document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",I),document.removeEventListener("touchmove",t),document.removeEventListener("touchend",I);},[z,t,i]),w=useCallback(E=>C=>{C.preventDefault(),P.current=E,document.addEventListener("mousemove",z,{passive:false}),document.addEventListener("mouseup",I);},[z,I]),d=useCallback(E=>C=>{C.preventDefault(),P.current=E,document.addEventListener("touchmove",t,{passive:false}),document.addEventListener("touchend",I);},[t,I]);return useEffect(()=>{let E=nr(i,r.length,o);x.current=E,b(E);},[r.length,o,i]),jsx("div",{ref:v,className:`flex select-none ${n}`,children:r.map(({content:E,className:C},M)=>jsxs(Fragment,{children:[jsx("div",{className:C,style:{flex:`${h[M]} 1 0%`},children:E}),M<r.length-1&&jsx("div",{onMouseDown:w(M),onTouchStart:d(M),className:`hidden lg:flex! lg:sticky lg:top-0 border-s border-gray-200 ${a}`,children:jsx("span",{className:"absolute top-1/2 start-1/2 -translate-x-1/2 -translate-y-1/2 block w-5 h-8 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-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"})]})})})]},`${M}`))})},"SplitterLayout");var xo=vo.div`
42
42
  width: 100%;
43
43
  height: 100%;
44
44
  display: flex;
45
45
  align-items: center;
46
46
  justify-content: center;
47
- `,So=a(({width:r=280,height:o=280})=>{let n=useTheme();return jsx(ko,{children:jsxs(vo,{foregroundColor:n.contentLoader.foreground,backgroundColor:n.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"),sr=So;var it=typeof window<"u"&&window.devicePixelRatio||1;function Fo(r){return !r||r.length===0?[]:r.map(o=>{let n=new Image;n.src=o.img;let a=new Image;return a.src=o.hoverImg,{...o,normalImg:n,hoverImg:a}})}a(Fo,"prepareButtonImages");var U={fontSize:3,nodeSizeBase:30,nodeAreaFactor:2,textPaddingFactor:.9,gridSpacing:20,dotSize:1,maxZoom:4},$o=forwardRef(({loading:r,width:o,height:n,graphData:a$1,buttons:c=[],onNodeClick:i,onBackgroundClick:h,onNodeHover:y,onLinkHover:w,onLinkClick:P},S)=>{let v=useTheme(),[N,_]=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*it,height:n*it,animation:{id:null,buttonIndex:null},spinnerAngle:0}),{nodes:I,links:D}=useMemo(()=>No(a$1),[a$1]),[p,L]=useState([]),C=useRef(null),M=useRef(null),F=useRef(null),$=scaleOrdinal(schemeCategory10),te=useCallback(()=>{if(!C.current)return false;try{let e=C.current.getContext("2d");return e?(F.current=e,!0):(console.error("Failed to get 2D context"),!1)}catch(e){return console.error("Error initializing Canvas 2D context:",e),false}},[]),re=useCallback(()=>M.current?M.current.nodes():null,[]),pe=useCallback(()=>{if(!M.current)return null;let e=M.current.force("link");return e?e.links():null},[]),he=useCallback(e=>{e.save(),e.setTransform(1,0,0,1,0,0);let{width:d,height:l}=t.current,u=U.gridSpacing,f=U.dotSize;e.fillStyle=v.graph2D.grid.dotColor;for(let b=u/2;b<=d;b+=u)for(let g=u/2;g<=l;g+=u)e.beginPath(),e.arc(b,g,f,0,2*Math.PI),e.fill();e.restore();},[v.graph2D.grid.dotColor,U.gridSpacing,U.dotSize]),me=useCallback((e,d,l)=>{if(!e)return "";if(l.measureText(e).width<=d)return e;let f=e,b="...";for(;l.measureText(f+b).width>d&&f.length>0;)f=f.slice(0,-1);return f+b},[]),Se=a(e=>{let l=Math.min(e,U.maxZoom)/U.maxZoom;return Math.max(U.fontSize*l,U.fontSize)},"calculateFontSize"),Me=useCallback(e=>{let d=pe(),l=re();!d||d.length===0||!l||l.length===0||(e.lineWidth=.5,e.globalAlpha=1,d.forEach(u=>{let f=typeof u.source=="object"?u.source:l.find(Re=>Re.id===u.source),b=typeof u.target=="object"?u.target:l.find(Re=>Re.id===u.target);if(!f||!b)return;let g={x:f.x||0,y:f.y||0},m={x:b.x||0,y:b.y||0},k=m.x-g.x,T=m.y-g.y,R=Math.sqrt(k*k+T*T),W=k/R,B=T/R,J=U.nodeSizeBase/2,q=U.nodeSizeBase/2,V=4,x={x:g.x+W*J,y:g.y+B*J},A={x:m.x-W*(q+V),y:m.y-B*(q+V)},E={x:m.x-W*(q+1),y:m.y-B*(q+1)},Q=t.current.highlightLinks.has(u),G=Q?v.graph2D.link.highlighted:v.graph2D.link.normal,ee=Q?1.5:.5,de=g.x+(m.x-g.x)/2,ze=g.y+(m.y-g.y)/2,_e=Math.atan2(T,k);if(u.label){let Re=t.current.transform.k,Ae=Se(Re);e.font=`${Ae}px Sans-Serif`;let Xt=e.measureText(u.label).width,qt=10;e.beginPath(),e.moveTo(x.x,x.y);let Yt=R/2-(Xt+qt)/2,Ut={x:g.x+W*Yt,y:g.y+B*Yt};e.lineTo(Ut.x,Ut.y),e.strokeStyle=G,e.lineWidth=ee,e.stroke(),e.beginPath();let Vt=R/2+(Xt+qt)/2,Gt={x:g.x+W*Vt,y:g.y+B*Vt};e.moveTo(Gt.x,Gt.y),e.lineTo(A.x,A.y),e.strokeStyle=G,e.lineWidth=ee,e.stroke();}else e.beginPath(),e.moveTo(x.x,x.y),e.lineTo(A.x,A.y),e.strokeStyle=G,e.lineWidth=ee,e.stroke();let Ge=2;if(e.save(),e.translate(E.x,E.y),e.rotate(_e),e.beginPath(),e.moveTo(0,0),e.lineTo(-4,Ge),e.lineTo(-4,0),e.lineTo(-4,-2),e.closePath(),e.fillStyle=G,e.fill(),e.restore(),u.label){let Re=t.current.transform.k,Ae=Se(Re);e.font=`${Ae}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(de,ze),Math.abs(_e)>Math.PI/2?e.rotate(_e+Math.PI):e.rotate(_e),e.fillStyle=Q?v.graph2D.link.highlightedTextColor:v.graph2D.link.textColor,e.fillText(u.label,0,0),e.restore();}}));},[U,v.graph2D.link]),H=a((e,d,l,u,f,b,g)=>{try{if(b!=null){let m=f*.8;e.font=`${m}px sans-serif`,e.textBaseline="middle",e.textAlign="left";let k=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:0,compactDisplay:"short"}).format(b),T=e.measureText(k).width,R=f*.3,B=(f+R+T)/2;e.drawImage(d,l-B,u-f/2,f,f),e.fillStyle=g||"#99989C",e.fillText(k,l-B+f+R,u);}else e.drawImage(d,l-f/2,u-f/2,f,f);}catch(m){console.warn("Error rendering icon:",m);}},"drawIconWithOptionalCounter"),z=useCallback((e,d)=>{if(!p||p.length===0||!e||!e.x||!e.y)return;let{x:l$1,y:u}=e,f=U.nodeSizeBase*U.nodeAreaFactor/2;d.save();let b=Math.min(p.length,8),g=Math.min(Math.PI*2/b,Math.PI);for(let m=0;m<b;m++){let k=m*g,T=(m+1)*g,R=t.current.hoveredButtonIndex===m;d.beginPath(),d.arc(l$1,u,f,k,T,false),d.lineTo(l$1,u),d.closePath(),d.lineWidth=1,d.strokeStyle=v.graph2D?.button?.stroke||"#FFFFFF",d.stroke(),d.fillStyle=R?v.graph2D?.button?.hoverFill||"rgba(255, 255, 255, 0.3)":v.graph2D?.button?.normalFill||"rgba(255, 255, 255, 0.1)",d.fill();let W=f*.2,B=(k+T)/2,J=f-U.nodeSizeBase/2+W,q=l$1+Math.cos(B)*J,V=u+Math.sin(B)*J,x=p[m];if(x.loading){let A=W/2,E=W/12;d.save(),d.translate(q,V),d.rotate(t.current.spinnerAngle);for(let Q=0;Q<12;Q++){let G=Math.PI*2*Q/12,ee=Q/12,de=Math.cos(G)*A,ze=Math.sin(G)*A;d.beginPath(),d.fillStyle=l(v.graph2D?.button?.spinnerColor,ee),d.arc(de,ze,E,0,Math.PI*2),d.fill();}d.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(j),t.current.animation.buttonIndex=m;}else {t.current.animation.id&&t.current.animation.buttonIndex===m&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null);let A=R?x.hoverImg:x.normalImg,E=x.getCount?x.getCount(e):null;A.complete?H(d,A,q,V,W,E,v.graph2D?.button?.textColor):A.onload=()=>{F.current&&H(d,A,q,V,W,E,v.graph2D?.button?.textColor);};}}d.restore();},[p,v.graph2D?.button]),Y=useCallback(e=>{let d=re();!d||d.length===0||(e.globalAlpha=1,d.forEach(l=>{let{x:u,y:f,color:b,fontColor:g,label:m}=l,k=t.current.highlightNodes.has(l)||l===t.current.hoveredNode||l===t.current.draggedNode,T=l===t.current.selectedNode,R=U.nodeSizeBase,W=U.nodeSizeBase/2;if(k&&!T){let B=U.nodeSizeBase*U.nodeAreaFactor*.75/2;e.beginPath(),e.arc(u,f,B,0,2*Math.PI,false),e.fillStyle=v.graph2D.ring.highlightFill,e.fill();}if(T)if(c&&c.length>0)z(l,e);else {let B=U.nodeSizeBase*U.nodeAreaFactor/2;e.beginPath(),e.arc(u,f,B,0,2*Math.PI,false),e.fillStyle=v.graph2D.ring.selectionFill||v.graph2D.ring.highlightFill,e.fill();}if(e.beginPath(),e.arc(u,f,W,0,2*Math.PI),e.fillStyle=b||$(l.group||"0"),e.fill(),m){e.save(),e.translate(u,f);let B=t.current.transform.k,J=Se(B),q=R*U.textPaddingFactor;e.font=`${J}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=g||"#000";let V=me(m,q,e);e.fillText(V,0,0),e.restore();}}));},[v.graph2D.ring,c,z]),j=useCallback(()=>{let e=F.current;e&&(e.clearRect(0,0,t.current.width,t.current.height),he(e),e.save(),e.setTransform(t.current.transform.k,0,0,t.current.transform.k,t.current.transform.x,t.current.transform.y),Me(e),Y(e),e.restore());},[Me,Y,he]),K=useCallback((e,d=[],l)=>{let u=pe()||[],f=re()||[];if(!M.current||!e.length)return;let{width:b,height:g}=t.current,m=l?.smoothAppearance??false,k=l?.transitionDuration??1e3,T=new Set(f.map(x=>x.id)),R=e.filter(x=>!T.has(x.id)),W=new Set(u.map(x=>`${typeof x.source=="object"?x.source.id:x.source}-${typeof x.target=="object"?x.target.id:x.target}`)),B=d.filter(x=>{let A=`${typeof x.source=="object"?x.source.id:x.source}-${typeof x.target=="object"?x.target.id:x.target}`;return !W.has(A)});if(R.length===0&&B.length===0)return;let J=[...f,...R],q=[...u,...B];m&&(R.forEach(x=>{let A=B.filter(E=>{let Q=typeof E.source=="object"?E.source.id:E.source,G=typeof E.target=="object"?E.target.id:E.target;return Q===x.id&&T.has(G)||G===x.id&&T.has(Q)});if(A.length>0){let E=A[0],Q=typeof E.source=="object"?E.source.id===x.id?E.target:E.source.id:E.source===x.id?E.target:E.source,G=J.find(ee=>ee.id===Q);if(G&&G.x!==void 0&&G.y!==void 0){let ee=30+Math.random()*20,de=Math.random()*Math.PI*2;x.x=G.x+Math.cos(de)*ee,x.y=G.y+Math.sin(de)*ee,x.vx=0,x.vy=0;}}else {let E=b/2,Q=g/2,G=Math.min(b,g)/4,ee=Math.random()*Math.PI*2;x.x=E+Math.cos(ee)*(G*Math.random()),x.y=Q+Math.sin(ee)*(G*Math.random()),x.vx=0,x.vy=0;}}),f.forEach(x=>{x.fx=x.x,x.fy=x.y;})),M.current.nodes(J);let V=M.current.force("link");V&&V.links(q),B.forEach(x=>{let A=typeof x.source=="object"?x.source:J.find(Q=>Q.id===x.source),E=typeof x.target=="object"?x.target:J.find(Q=>Q.id===x.target);!A||!E||(!A.neighbors&&(A.neighbors=[]),!E.neighbors&&(E.neighbors=[]),A.neighbors.push(E),E.neighbors.push(A),!A.links&&(A.links=[]),!E.links&&(E.links=[]),A.links.push(x),E.links.push(x));}),m?(M.current.alphaTarget(.3),M.current.alpha(.3),M.current.velocityDecay(.7),M.current.restart(),setTimeout(()=>{f.forEach(x=>{x.fx=void 0,x.fy=void 0;}),M.current?.alphaTarget(0),M.current?.alpha(.1),M.current?.velocityDecay(.6);},k)):M.current.alpha(.1).restart(),j();},[I,j]),se=useCallback(e=>{let d=re(),l=pe();if(!M.current||!e.length||!d||d.length===0||!l||l.length===0)return;let u=new Set(e);if(t.current.selectedNode&&t.current.selectedNode.id!==void 0&&u.has(t.current.selectedNode.id)&&(t.current.selectedNode=null),t.current.hoveredNode&&t.current.hoveredNode.id!==void 0&&u.has(t.current.hoveredNode.id)&&(t.current.hoveredNode=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set),t.current.hoveredLink){let m=typeof t.current.hoveredLink.source=="object"?t.current.hoveredLink.source.id:t.current.hoveredLink.source,k=typeof t.current.hoveredLink.target=="object"?t.current.hoveredLink.target.id:t.current.hoveredLink.target;(m!==void 0&&u.has(m)||k!==void 0&&u.has(k))&&(t.current.hoveredLink=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set);}t.current.draggedNode&&t.current.draggedNode.id!==void 0&&u.has(t.current.draggedNode.id)&&(t.current.draggedNode=null);let f=d.filter(m=>m.id!==void 0&&!u.has(m.id)),b=l.filter(m=>{let k=typeof m.source=="object"?m.source.id:m.source,T=typeof m.target=="object"?m.target.id:m.target;return k!==void 0&&!u.has(k)&&T!==void 0&&!u.has(T)});f.forEach(m=>{m.neighbors=[],m.links=[];}),b.forEach(m=>{let k=typeof m.source=="object"?m.source:f.find(R=>R.id===m.source),T=typeof m.target=="object"?m.target:f.find(R=>R.id===m.target);!k||!T||(k.neighbors=k.neighbors||[],T.neighbors=T.neighbors||[],k.neighbors.push(T),T.neighbors.push(k),k.links=k.links||[],T.links=T.links||[],k.links.push(m),T.links.push(m));}),M.current.nodes(f);let g=M.current.force("link");g&&g.links(b),j();},[j]),ae=useCallback((e=0,d=20)=>{let l=re();if(!F.current||!C.current||!l||!l.length)return;let f=1/0,b=1/0,g=-1/0,m=-1/0;if(l.forEach(k=>{if(k.x===void 0||k.y===void 0)return;let T=k.x,R=k.y;f=Math.min(f,T),b=Math.min(b,R),g=Math.max(g,T),m=Math.max(m,R);}),isFinite(f)&&isFinite(g)&&isFinite(b)&&isFinite(m)){let{width:k,height:T}=t.current;f-=d,b-=d,g+=d,m+=d;let R=g-f,W=m-b,B=R>0?k/R:1,J=W>0?T/W:1,q=Math.min(B,J,10),V=f+R/2,x=b+W/2,A={k:q,x:k/2-V*q,y:T/2-x*q};if(e>0){let E={...t.current.transform},Q=Date.now(),G=a(()=>{let ee=Math.min(1,(Date.now()-Q)/e),de=ee===1?1:1-Math.pow(1-ee,3),ze={k:E.k+(A.k-E.k)*de,x:E.x+(A.x-E.x)*de,y:E.y+(A.y-E.y)*de};t.current.transform=ze,j(),ee<1&&requestAnimationFrame(G);},"animateZoom");requestAnimationFrame(G);}else t.current.transform=A,j();}},[]),Z=useCallback((e,d)=>{let l=re();if(!l||l.length===0)return null;let u=U.nodeSizeBase/2,f=typeof window<"u"&&window.devicePixelRatio||1,b=(e*f-t.current.transform.x)/t.current.transform.k,g=(d*f-t.current.transform.y)/t.current.transform.k;return l.find(m=>{let k=(m.x||0)-b,T=(m.y||0)-g;return Math.sqrt(k*k+T*T)<=u})||null},[]),oe=useCallback((e,d)=>{let l=pe(),u=re();if(!l||l.length===0||!u||u.length===0)return null;let f=typeof window<"u"&&window.devicePixelRatio||1,b=(e*f-t.current.transform.x)/t.current.transform.k,g=(d*f-t.current.transform.y)/t.current.transform.k,m=5;return l.find(k=>{let T=typeof k.source=="object"?k.source:u.find(Ae=>Ae.id===k.source),R=typeof k.target=="object"?k.target:u.find(Ae=>Ae.id===k.target);if(!T||!R)return false;let W=T.x||0,B=T.y||0,J=R.x||0,q=R.y||0,V=b-W,x=g-B,A=J-W,E=q-B,Q=V*A+x*E,G=A*A+E*E;if(G===0)return false;let ee=Q/G;ee=Math.max(0,Math.min(1,ee));let de=W+ee*A,ze=B+ee*E,_e=b-de,Ge=g-ze;return Math.sqrt(_e*_e+Ge*Ge)<=m})||null},[]),be=useCallback((e,d,l,u,f,b,g)=>{let m=e-l,k=d-u,T=Math.sqrt(m*m+k*k),R=Math.atan2(k,m);R<0&&(R+=2*Math.PI);let J=T>=f*.5&&T<=f*1,q=false;return b===Math.PI&&g===Math.PI*2?q=R>=Math.PI&&R<=Math.PI*2:b===0&&g===Math.PI?q=R>=0&&R<=Math.PI:q=b<=g&&R>=b&&R<=g||b>g&&(R>=b||R<=g),J&&q},[]),De=useCallback(e=>{if(e===t.current.hoveredNode)return;let d=new Set,l=new Set;e&&(d.add(e),e.neighbors&&e.neighbors.forEach(u=>d.add(u)),e.links&&e.links.forEach(u=>l.add(u))),t.current.hoveredNode=e,y&&y(e),t.current.highlightNodes=d,t.current.highlightLinks=l;},[y]),Te=useCallback(e=>{if(e===t.current.hoveredLink)return;let d=new Set,l=new Set;if(e){l.add(e);let u=re();if(u){let f=typeof e.source=="object"?e.source:u.find(g=>g.id===e.source),b=typeof e.target=="object"?e.target:u.find(g=>g.id===e.target);f&&d.add(f),b&&d.add(b);}}t.current.hoveredLink=e,w&&w(e),t.current.highlightNodes=d,t.current.highlightLinks=l;},[w,re]),Ye=useCallback(e=>{P&&P(e);},[P]),Le=useCallback(e=>{t.current.selectedNode=e,i&&i(e);},[i]),Ue=useCallback(()=>{t.current.selectedNode=null,h&&h();},[h]),Ne=useCallback(e=>{if(!C.current||!M.current)return;let d=C.current.getBoundingClientRect(),l=e.clientX-d.left,u=e.clientY-d.top;t.current.mouseStartPos={x:l,y:u},t.current.isDragging=false;let f=Z(l,u);f?(t.current.draggedNode=f,f.fx=f.x,f.fy=f.y):(t.current.isPanning=true,t.current.lastMousePos={x:l,y:u});},[Z]),He=useCallback((e,d)=>{let l=null;if(C.current&&t.current&&p.length>0){let u=U.nodeSizeBase*U.nodeAreaFactor/2,f=C.current.getBoundingClientRect(),b=C.current.width/f.width,g=C.current.height/f.height,m=e*b,k=d*g,T=(m-t.current.transform.x)/t.current.transform.k,R=(k-t.current.transform.y)/t.current.transform.k,W=t.current.selectedNode?.x||0,B=t.current.selectedNode?.y||0,J=Math.min(p.length,8),q=Math.min(Math.PI*2/J,Math.PI);for(let V=0;V<J;V++){let x=V*q,A=(V+1)*q;if(be(T,R,W,B,u,x,A)){l=V;break}}}return l},[p]),Ce=useCallback(e=>{if(!C.current)return;let d=C.current.getBoundingClientRect(),l=e.clientX-d.left,u=e.clientY-d.top;if(t.current.draggedNode&&t.current.mouseStartPos&&M.current){let g=t.current.mouseStartPos.x,m=t.current.mouseStartPos.y,k=l-g,T=u-m;Math.sqrt(k*k+T*T)>3&&(t.current.isDragging=true,M.current.alphaTarget()===0&&M.current.alphaTarget(0).restart());let B=typeof window<"u"&&window.devicePixelRatio||1,J=(l*B-t.current.transform.x)/t.current.transform.k,q=(u*B-t.current.transform.y)/t.current.transform.k;t.current.draggedNode.fx=J,t.current.draggedNode.fy=q;return}if(t.current.isPanning&&t.current.mouseStartPos){let g=l-t.current.lastMousePos.x,m=u-t.current.lastMousePos.y,k=t.current.mouseStartPos.x,T=t.current.mouseStartPos.y;Math.sqrt(Math.pow(l-k,2)+Math.pow(u-T,2))>3&&(t.current.isDragging=true),t.current.transform={...t.current.transform,x:t.current.transform.x+g,y:t.current.transform.y+m},t.current.lastMousePos={x:l,y:u},j();return}let f,b;if(t.current.selectedNode&&C.current&&p.length>0){let g=He(l,u);g!==null&&(b=t.current.selectedNode),g!==t.current.hoveredButtonIndex&&(f=true),t.current.hoveredButtonIndex=g;}else t.current.hoveredButtonIndex!==null&&(t.current.hoveredButtonIndex=null);if(!b&&(b=Z(l,u),!b)){let g=oe(l,u),m=g!==t.current.hoveredLink;if(g&&t.current.hoveredNode&&De(null),Te(g),C.current&&(C.current.style.cursor=g?"pointer":"default"),m){j();return}}b&&t.current.hoveredLink&&Te(null),b!==t.current.hoveredNode&&(f=true),De(b),C.current&&(C.current.style.cursor=b?"pointer":"default"),f&&j();},[p,Z,oe,De,Te,j,be,He]),Ve=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.stopPropagation(),e.preventDefault()),t.current.mustBeStoppedPropagation=false;},[]),We=useCallback(e=>{let d=t.current.isDragging;if(d&&(t.current.mustBeStoppedPropagation=true),!d&&t.current.mouseStartPos){let l=C.current?.getBoundingClientRect();if(l){let u=e.clientX-l.left,f=e.clientY-l.top;p.length>0&&t.current.hoveredButtonIndex===null&&(t.current.hoveredButtonIndex=He(u,f));let b=false;if(t.current.selectedNode&&t.current.hoveredButtonIndex!==null&&c[t.current.hoveredButtonIndex]){let g=c[t.current.hoveredButtonIndex];g&&g.onClick&&(g.onClick(t.current.selectedNode),b=true,t.current.hoveredButtonIndex=null);}if(!b&&t.current.draggedNode)Le(t.current.draggedNode);else if(!b&&!t.current.draggedNode){let g=oe(u,f);g?Ye(g):Ue();}}}if(t.current.draggedNode&&M.current){if(d){M.current.alphaTarget(0);let l=.05,u=.04,f=.6;M.current.alpha(l).alphaDecay(u),M.current.velocityDecay(f);}else M.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),j();},[c,j,Le,Ue,oe,Ye,He,p]),St=useCallback(e=>{if(e.stopPropagation(),e.preventDefault(),!C.current)return;let d=C.current.getBoundingClientRect(),l=e.clientX-d.left,u=e.clientY-d.top,b=-e.deltaY>0?1.1:1/1.1,g=t.current.transform,m=g.k*b;if(m<.01||m>10)return;let k=g.k*b,T=l-(l-g.x)*b,R=u-(u-g.y)*b;t.current.transform={k,x:T,y:R},j();},[j]),Dt=a((e,d)=>{let l=e.touches[0];if(l){let u={clientX:l.clientX,clientY:l.clientY};d(u);}},"convertTouchToMouseEvent"),Qr=useCallback(e=>{Dt(e,Ne);},[Ne]),Ct=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.preventDefault(),e.stopPropagation()),t.current.mustBeStoppedPropagation=false,Dt(e,We);},[We]),eo=useCallback(e=>{Dt(e,Ce);},[Ce]);return useImperativeHandle(S,()=>({zoomToFit:ae,addNodes:K,removeNodes:se}),[ae,K,se]),useEffect(()=>{let e=C.current,{width:d,height:l}=t.current;if(!e)return;te(),_(true);let u=d/2,f=l/2,b=U.nodeSizeBase,g=b/2,m=b*2.5;M.current&&M.current.stop();let k=M.current=forceSimulation(I).force("link",forceLink(D).id(T=>T.id).distance(m).strength(.9)).force("charge",forceManyBody().strength(-b/10*200).theta(.5).distanceMin(b*2)).force("x",forceX().strength(.03)).force("y",forceY().strength(.03)).force("center",forceCenter(u,f).strength(.05)).force("collide",forceCollide().radius(g*2).iterations(2).strength(1)).velocityDecay(.6);return ()=>{k.stop();}},[I,D]),useLayoutEffect(()=>{let e=C.current;e&&(t.current.width=o*it,t.current.height=n*it,e.width=t.current.width,e.height=t.current.height);},[o,n]),useEffect(()=>{if(M.current){let e=M.current;e.on("tick",()=>{j();}),e.on("end",()=>{N&&(ae(0,20),setTimeout(()=>{_(false);},200));});}N||j();},[I,D,N,j,ae]),useEffect(()=>{!I||!D||D.forEach(e=>{let d=typeof e.source=="object"?e.source:I.find(u=>u.id===e.source),l=typeof e.target=="object"?e.target:I.find(u=>u.id===e.target);!d||!l||(!d.neighbors&&(d.neighbors=[]),!l.neighbors&&(l.neighbors=[]),d.neighbors.push(l),l.neighbors.push(d),!d.links&&(d.links=[]),!l.links&&(l.links=[]),d.links.push(e),l.links.push(e));});},[I,D]),useEffect(()=>{c&&c.length>0&&L(Fo(c));},[c]),useEffect(()=>{let e=C.current;if(!(!e||typeof window>"u"))return e.addEventListener("wheel",St,{passive:false}),e.addEventListener("touchend",Ct,{passive:false}),()=>{e.removeEventListener("wheel",St),e.removeEventListener("touchend",Ct);}},[St,Ct]),jsxs(Ho,{children:[(r||N)&&jsx(sr,{width:o,height:n}),jsx(Wo,{ref:C,style:{width:o,height:n,display:r||N?"none":"block"},onMouseDown:Ne,onMouseMove:Ce,onMouseUp:We,onMouseLeave:We,onClick:Ve,onTouchStart:Qr,onTouchMove:eo})]})}),Ho=styled.div`
47
+ `,ko=a(({width:r=280,height:o=280})=>{let n=useTheme();return jsx(xo,{children:jsxs(yo,{foregroundColor:n.contentLoader.foreground,backgroundColor:n.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"),ir=ko;var it=typeof window<"u"&&window.devicePixelRatio||1;function Oo(r){return !r||r.length===0?[]:r.map(o=>{let n=new Image;n.src=o.img;let a=new Image;return a.src=o.hoverImg,{...o,normalImg:n,hoverImg:a}})}a(Oo,"prepareButtonImages");var U={fontSize:3,nodeSizeBase:30,nodeAreaFactor:2,textPaddingFactor:.9,gridSpacing:20,dotSize:1,maxZoom:4},Fo=forwardRef(({loading:r,width:o,height:n,graphData:a$1,buttons:s=[],onNodeClick:i,onBackgroundClick:h,onNodeHover:b,onLinkHover:v,onLinkClick:P},D)=>{let x=useTheme(),[N,z]=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*it,height:n*it,animation:{id:null,buttonIndex:null},spinnerAngle:0}),{nodes:I,links:w}=useMemo(()=>To(a$1),[a$1]),[d,E]=useState([]),C=useRef(null),M=useRef(null),F=useRef(null),H=scaleOrdinal(schemeCategory10),te=useCallback(()=>{if(!C.current)return false;try{let e=C.current.getContext("2d");return e?(F.current=e,!0):(console.error("Failed to get 2D context"),!1)}catch(e){return console.error("Error initializing Canvas 2D context:",e),false}},[]),re=useCallback(()=>M.current?M.current.nodes():null,[]),pe=useCallback(()=>{if(!M.current)return null;let e=M.current.force("link");return e?e.links():null},[]),he=useCallback(e=>{e.save(),e.setTransform(1,0,0,1,0,0);let{width:u,height:l}=t.current,p=U.gridSpacing,f=U.dotSize;e.fillStyle=x.graph2D.grid.dotColor;for(let y=p/2;y<=u;y+=p)for(let g=p/2;g<=l;g+=p)e.beginPath(),e.arc(y,g,f,0,2*Math.PI),e.fill();e.restore();},[x.graph2D.grid.dotColor,U.gridSpacing,U.dotSize]),me=useCallback((e,u,l)=>{if(!e)return "";if(l.measureText(e).width<=u)return e;let f=e,y="...";for(;l.measureText(f+y).width>u&&f.length>0;)f=f.slice(0,-1);return f+y},[]),Se=a(e=>{let l=Math.min(e,U.maxZoom)/U.maxZoom;return Math.max(U.fontSize*l,U.fontSize)},"calculateFontSize"),Me=useCallback(e=>{let u=pe(),l=re();!u||u.length===0||!l||l.length===0||(e.lineWidth=.5,e.globalAlpha=1,u.forEach(p=>{let f=typeof p.source=="object"?p.source:l.find(Re=>Re.id===p.source),y=typeof p.target=="object"?p.target:l.find(Re=>Re.id===p.target);if(!f||!y)return;let g={x:f.x||0,y:f.y||0},m={x:y.x||0,y:y.y||0},S=m.x-g.x,T=m.y-g.y,R=Math.sqrt(S*S+T*T),W=S/R,B=T/R,J=U.nodeSizeBase/2,q=U.nodeSizeBase/2,V=4,k={x:g.x+W*J,y:g.y+B*J},A={x:m.x-W*(q+V),y:m.y-B*(q+V)},L={x:m.x-W*(q+1),y:m.y-B*(q+1)},Q=t.current.highlightLinks.has(p),G=Q?x.graph2D.link.highlighted:x.graph2D.link.normal,ee=Q?1.5:.5,de=g.x+(m.x-g.x)/2,ze=g.y+(m.y-g.y)/2,_e=Math.atan2(T,S);if(p.label){let Re=t.current.transform.k,Ae=Se(Re);e.font=`${Ae}px Sans-Serif`;let Wt=e.measureText(p.label).width,Xt=10;e.beginPath(),e.moveTo(k.x,k.y);let qt=R/2-(Wt+Xt)/2,Yt={x:g.x+W*qt,y:g.y+B*qt};e.lineTo(Yt.x,Yt.y),e.strokeStyle=G,e.lineWidth=ee,e.stroke(),e.beginPath();let Ut=R/2+(Wt+Xt)/2,Vt={x:g.x+W*Ut,y:g.y+B*Ut};e.moveTo(Vt.x,Vt.y),e.lineTo(A.x,A.y),e.strokeStyle=G,e.lineWidth=ee,e.stroke();}else e.beginPath(),e.moveTo(k.x,k.y),e.lineTo(A.x,A.y),e.strokeStyle=G,e.lineWidth=ee,e.stroke();let Ge=2;if(e.save(),e.translate(L.x,L.y),e.rotate(_e),e.beginPath(),e.moveTo(0,0),e.lineTo(-V,Ge),e.lineTo(-V,0),e.lineTo(-V,-Ge),e.closePath(),e.fillStyle=G,e.fill(),e.restore(),p.label){let Re=t.current.transform.k,Ae=Se(Re);e.font=`${Ae}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.save(),e.translate(de,ze),Math.abs(_e)>Math.PI/2?e.rotate(_e+Math.PI):e.rotate(_e),e.fillStyle=Q?x.graph2D.link.highlightedTextColor:x.graph2D.link.textColor,e.fillText(p.label,0,0),e.restore();}}));},[U,x.graph2D.link]),$=a((e,u,l,p,f,y,g)=>{try{if(y!=null){let m=f*.8;e.font=`${m}px sans-serif`,e.textBaseline="middle",e.textAlign="left";let S=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:0,compactDisplay:"short"}).format(y),T=e.measureText(S).width,R=f*.3,B=(f+R+T)/2;e.drawImage(u,l-B,p-f/2,f,f),e.fillStyle=g||"#99989C",e.fillText(S,l-B+f+R,p);}else e.drawImage(u,l-f/2,p-f/2,f,f);}catch(m){console.warn("Error rendering icon:",m);}},"drawIconWithOptionalCounter"),_=useCallback((e,u)=>{if(!d||d.length===0||!e||!e.x||!e.y)return;let{x:l$1,y:p}=e,f=U.nodeSizeBase*U.nodeAreaFactor/2;u.save();let y=Math.min(d.length,8),g=Math.min(Math.PI*2/y,Math.PI);for(let m=0;m<y;m++){let S=m*g,T=(m+1)*g,R=t.current.hoveredButtonIndex===m;u.beginPath(),u.arc(l$1,p,f,S,T,false),u.lineTo(l$1,p),u.closePath(),u.lineWidth=1,u.strokeStyle=x.graph2D?.button?.stroke||"#FFFFFF",u.stroke(),u.fillStyle=R?x.graph2D?.button?.hoverFill||"rgba(255, 255, 255, 0.3)":x.graph2D?.button?.normalFill||"rgba(255, 255, 255, 0.1)",u.fill();let W=f*.2,B=(S+T)/2,J=f-U.nodeSizeBase/2+W,q=l$1+Math.cos(B)*J,V=p+Math.sin(B)*J,k=d[m];if(k.loading){let A=W/2,L=W/12;u.save(),u.translate(q,V),u.rotate(t.current.spinnerAngle);for(let Q=0;Q<12;Q++){let G=Math.PI*2*Q/12,ee=Q/12,de=Math.cos(G)*A,ze=Math.sin(G)*A;u.beginPath(),u.fillStyle=l(x.graph2D?.button?.spinnerColor,ee),u.arc(de,ze,L,0,Math.PI*2),u.fill();}u.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(j),t.current.animation.buttonIndex=m;}else {t.current.animation.id&&t.current.animation.buttonIndex===m&&(cancelAnimationFrame(t.current.animation.id),t.current.animation.id=null,t.current.animation.buttonIndex=null);let A=R?k.hoverImg:k.normalImg,L=k.getCount?k.getCount(e):null;A.complete?$(u,A,q,V,W,L,x.graph2D?.button?.textColor):A.onload=()=>{F.current&&$(u,A,q,V,W,L,x.graph2D?.button?.textColor);};}}u.restore();},[d,x.graph2D?.button]),Y=useCallback(e=>{let u=re();!u||u.length===0||(e.globalAlpha=1,u.forEach(l=>{let{x:p,y:f,color:y,fontColor:g,label:m}=l,S=t.current.highlightNodes.has(l)||l===t.current.hoveredNode||l===t.current.draggedNode,T=l===t.current.selectedNode,R=U.nodeSizeBase,W=U.nodeSizeBase/2;if(S&&!T){let B=U.nodeSizeBase*U.nodeAreaFactor*.75/2;e.beginPath(),e.arc(p,f,B,0,2*Math.PI,false),e.fillStyle=x.graph2D.ring.highlightFill,e.fill();}if(T)if(s&&s.length>0)_(l,e);else {let B=U.nodeSizeBase*U.nodeAreaFactor/2;e.beginPath(),e.arc(p,f,B,0,2*Math.PI,false),e.fillStyle=x.graph2D.ring.selectionFill||x.graph2D.ring.highlightFill,e.fill();}if(e.beginPath(),e.arc(p,f,W,0,2*Math.PI),e.fillStyle=y||H(l.group||"0"),e.fill(),m){e.save(),e.translate(p,f);let B=t.current.transform.k,J=Se(B),q=R*U.textPaddingFactor;e.font=`${J}px Sans-Serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=g||"#000";let V=me(m,q,e);e.fillText(V,0,0),e.restore();}}));},[x.graph2D.ring,s,_]),j=useCallback(()=>{let e=F.current;e&&(e.clearRect(0,0,t.current.width,t.current.height),he(e),e.save(),e.setTransform(t.current.transform.k,0,0,t.current.transform.k,t.current.transform.x,t.current.transform.y),Me(e),Y(e),e.restore());},[Me,Y,he]),K=useCallback((e,u=[],l)=>{let p=pe()||[],f=re()||[];if(!M.current||!e.length)return;let{width:y,height:g}=t.current,m=l?.smoothAppearance??false,S=l?.transitionDuration??1e3,T=new Set(f.map(k=>k.id)),R=e.filter(k=>!T.has(k.id)),W=new Set(p.map(k=>`${typeof k.source=="object"?k.source.id:k.source}-${typeof k.target=="object"?k.target.id:k.target}`)),B=u.filter(k=>{let A=`${typeof k.source=="object"?k.source.id:k.source}-${typeof k.target=="object"?k.target.id:k.target}`;return !W.has(A)});if(R.length===0&&B.length===0)return;let J=[...f,...R],q=[...p,...B];m&&(R.forEach(k=>{let A=B.filter(L=>{let Q=typeof L.source=="object"?L.source.id:L.source,G=typeof L.target=="object"?L.target.id:L.target;return Q===k.id&&T.has(G)||G===k.id&&T.has(Q)});if(A.length>0){let L=A[0],Q=typeof L.source=="object"?L.source.id===k.id?L.target:L.source.id:L.source===k.id?L.target:L.source,G=J.find(ee=>ee.id===Q);if(G&&G.x!==void 0&&G.y!==void 0){let ee=30+Math.random()*20,de=Math.random()*Math.PI*2;k.x=G.x+Math.cos(de)*ee,k.y=G.y+Math.sin(de)*ee,k.vx=0,k.vy=0;}}else {let L=y/2,Q=g/2,G=Math.min(y,g)/4,ee=Math.random()*Math.PI*2;k.x=L+Math.cos(ee)*(G*Math.random()),k.y=Q+Math.sin(ee)*(G*Math.random()),k.vx=0,k.vy=0;}}),f.forEach(k=>{k.fx=k.x,k.fy=k.y;})),M.current.nodes(J);let V=M.current.force("link");V&&V.links(q),B.forEach(k=>{let A=typeof k.source=="object"?k.source:J.find(Q=>Q.id===k.source),L=typeof k.target=="object"?k.target:J.find(Q=>Q.id===k.target);!A||!L||(!A.neighbors&&(A.neighbors=[]),!L.neighbors&&(L.neighbors=[]),A.neighbors.push(L),L.neighbors.push(A),!A.links&&(A.links=[]),!L.links&&(L.links=[]),A.links.push(k),L.links.push(k));}),m?(M.current.alphaTarget(.3),M.current.alpha(.3),M.current.velocityDecay(.7),M.current.restart(),setTimeout(()=>{f.forEach(k=>{k.fx=void 0,k.fy=void 0;}),M.current?.alphaTarget(0),M.current?.alpha(.1),M.current?.velocityDecay(.6);},S)):M.current.alpha(.1).restart(),j();},[I,j]),se=useCallback(e=>{let u=re(),l=pe();if(!M.current||!e.length||!u||u.length===0||!l||l.length===0)return;let p=new Set(e);if(t.current.selectedNode&&t.current.selectedNode.id!==void 0&&p.has(t.current.selectedNode.id)&&(t.current.selectedNode=null),t.current.hoveredNode&&t.current.hoveredNode.id!==void 0&&p.has(t.current.hoveredNode.id)&&(t.current.hoveredNode=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set),t.current.hoveredLink){let m=typeof t.current.hoveredLink.source=="object"?t.current.hoveredLink.source.id:t.current.hoveredLink.source,S=typeof t.current.hoveredLink.target=="object"?t.current.hoveredLink.target.id:t.current.hoveredLink.target;(m!==void 0&&p.has(m)||S!==void 0&&p.has(S))&&(t.current.hoveredLink=null,t.current.highlightNodes=new Set,t.current.highlightLinks=new Set);}t.current.draggedNode&&t.current.draggedNode.id!==void 0&&p.has(t.current.draggedNode.id)&&(t.current.draggedNode=null);let f=u.filter(m=>m.id!==void 0&&!p.has(m.id)),y=l.filter(m=>{let S=typeof m.source=="object"?m.source.id:m.source,T=typeof m.target=="object"?m.target.id:m.target;return S!==void 0&&!p.has(S)&&T!==void 0&&!p.has(T)});f.forEach(m=>{m.neighbors=[],m.links=[];}),y.forEach(m=>{let S=typeof m.source=="object"?m.source:f.find(R=>R.id===m.source),T=typeof m.target=="object"?m.target:f.find(R=>R.id===m.target);!S||!T||(S.neighbors=S.neighbors||[],T.neighbors=T.neighbors||[],S.neighbors.push(T),T.neighbors.push(S),S.links=S.links||[],T.links=T.links||[],S.links.push(m),T.links.push(m));}),M.current.nodes(f);let g=M.current.force("link");g&&g.links(y),j();},[j]),ae=useCallback((e=0,u=20)=>{let l=re();if(!F.current||!C.current||!l||!l.length)return;let f=1/0,y=1/0,g=-1/0,m=-1/0;if(l.forEach(S=>{if(S.x===void 0||S.y===void 0)return;let T=S.x,R=S.y;f=Math.min(f,T),y=Math.min(y,R),g=Math.max(g,T),m=Math.max(m,R);}),isFinite(f)&&isFinite(g)&&isFinite(y)&&isFinite(m)){let{width:S,height:T}=t.current;f-=u,y-=u,g+=u,m+=u;let R=g-f,W=m-y,B=R>0?S/R:1,J=W>0?T/W:1,q=Math.min(B,J,10),V=f+R/2,k=y+W/2,A={k:q,x:S/2-V*q,y:T/2-k*q};if(e>0){let L={...t.current.transform},Q=Date.now(),G=a(()=>{let ee=Math.min(1,(Date.now()-Q)/e),de=ee===1?1:1-Math.pow(1-ee,3),ze={k:L.k+(A.k-L.k)*de,x:L.x+(A.x-L.x)*de,y:L.y+(A.y-L.y)*de};t.current.transform=ze,j(),ee<1&&requestAnimationFrame(G);},"animateZoom");requestAnimationFrame(G);}else t.current.transform=A,j();}},[]),Z=useCallback((e,u)=>{let l=re();if(!l||l.length===0)return null;let p=U.nodeSizeBase/2,f=typeof window<"u"&&window.devicePixelRatio||1,y=(e*f-t.current.transform.x)/t.current.transform.k,g=(u*f-t.current.transform.y)/t.current.transform.k;return l.find(m=>{let S=(m.x||0)-y,T=(m.y||0)-g;return Math.sqrt(S*S+T*T)<=p})||null},[]),oe=useCallback((e,u)=>{let l=pe(),p=re();if(!l||l.length===0||!p||p.length===0)return null;let f=typeof window<"u"&&window.devicePixelRatio||1,y=(e*f-t.current.transform.x)/t.current.transform.k,g=(u*f-t.current.transform.y)/t.current.transform.k,m=5;return l.find(S=>{let T=typeof S.source=="object"?S.source:p.find(Ae=>Ae.id===S.source),R=typeof S.target=="object"?S.target:p.find(Ae=>Ae.id===S.target);if(!T||!R)return false;let W=T.x||0,B=T.y||0,J=R.x||0,q=R.y||0,V=y-W,k=g-B,A=J-W,L=q-B,Q=V*A+k*L,G=A*A+L*L;if(G===0)return false;let ee=Q/G;ee=Math.max(0,Math.min(1,ee));let de=W+ee*A,ze=B+ee*L,_e=y-de,Ge=g-ze;return Math.sqrt(_e*_e+Ge*Ge)<=m})||null},[]),be=useCallback((e,u,l,p,f,y,g)=>{let m=e-l,S=u-p,T=Math.sqrt(m*m+S*S),R=Math.atan2(S,m);R<0&&(R+=2*Math.PI);let J=T>=f*.5&&T<=f*1,q=false;return y===Math.PI&&g===Math.PI*2?q=R>=Math.PI&&R<=Math.PI*2:y===0&&g===Math.PI?q=R>=0&&R<=Math.PI:q=y<=g&&R>=y&&R<=g||y>g&&(R>=y||R<=g),J&&q},[]),De=useCallback(e=>{if(e===t.current.hoveredNode)return;let u=new Set,l=new Set;e&&(u.add(e),e.neighbors&&e.neighbors.forEach(p=>u.add(p)),e.links&&e.links.forEach(p=>l.add(p))),t.current.hoveredNode=e,b&&b(e),t.current.highlightNodes=u,t.current.highlightLinks=l;},[b]),Te=useCallback(e=>{if(e===t.current.hoveredLink)return;let u=new Set,l=new Set;if(e){l.add(e);let p=re();if(p){let f=typeof e.source=="object"?e.source:p.find(g=>g.id===e.source),y=typeof e.target=="object"?e.target:p.find(g=>g.id===e.target);f&&u.add(f),y&&u.add(y);}}t.current.hoveredLink=e,v&&v(e),t.current.highlightNodes=u,t.current.highlightLinks=l;},[v,re]),Ye=useCallback(e=>{P&&P(e);},[P]),Le=useCallback(e=>{t.current.selectedNode=e,i&&i(e);},[i]),Ue=useCallback(()=>{t.current.selectedNode=null,h&&h();},[h]),Ne=useCallback(e=>{if(!C.current||!M.current)return;let u=C.current.getBoundingClientRect(),l=e.clientX-u.left,p=e.clientY-u.top;t.current.mouseStartPos={x:l,y:p},t.current.isDragging=false;let f=Z(l,p);f?(t.current.draggedNode=f,f.fx=f.x,f.fy=f.y):(t.current.isPanning=true,t.current.lastMousePos={x:l,y:p});},[Z]),$e=useCallback((e,u)=>{let l=null;if(C.current&&t.current&&d.length>0){let p=U.nodeSizeBase*U.nodeAreaFactor/2,f=C.current.getBoundingClientRect(),y=C.current.width/f.width,g=C.current.height/f.height,m=e*y,S=u*g,T=(m-t.current.transform.x)/t.current.transform.k,R=(S-t.current.transform.y)/t.current.transform.k,W=t.current.selectedNode?.x||0,B=t.current.selectedNode?.y||0,J=Math.min(d.length,8),q=Math.min(Math.PI*2/J,Math.PI);for(let V=0;V<J;V++){let k=V*q,A=(V+1)*q;if(be(T,R,W,B,p,k,A)){l=V;break}}}return l},[d]),Ce=useCallback(e=>{if(!C.current)return;let u=C.current.getBoundingClientRect(),l=e.clientX-u.left,p=e.clientY-u.top;if(t.current.draggedNode&&t.current.mouseStartPos&&M.current){let g=t.current.mouseStartPos.x,m=t.current.mouseStartPos.y,S=l-g,T=p-m;Math.sqrt(S*S+T*T)>3&&(t.current.isDragging=true,M.current.alphaTarget()===0&&M.current.alphaTarget(0).restart());let B=typeof window<"u"&&window.devicePixelRatio||1,J=(l*B-t.current.transform.x)/t.current.transform.k,q=(p*B-t.current.transform.y)/t.current.transform.k;t.current.draggedNode.fx=J,t.current.draggedNode.fy=q;return}if(t.current.isPanning&&t.current.mouseStartPos){let g=l-t.current.lastMousePos.x,m=p-t.current.lastMousePos.y,S=t.current.mouseStartPos.x,T=t.current.mouseStartPos.y;Math.sqrt(Math.pow(l-S,2)+Math.pow(p-T,2))>3&&(t.current.isDragging=true),t.current.transform={...t.current.transform,x:t.current.transform.x+g,y:t.current.transform.y+m},t.current.lastMousePos={x:l,y:p},j();return}let f,y;if(t.current.selectedNode&&C.current&&d.length>0){let g=$e(l,p);g!==null&&(y=t.current.selectedNode),g!==t.current.hoveredButtonIndex&&(f=true),t.current.hoveredButtonIndex=g;}else t.current.hoveredButtonIndex!==null&&(t.current.hoveredButtonIndex=null);if(!y&&(y=Z(l,p),!y)){let g=oe(l,p),m=g!==t.current.hoveredLink;if(g&&t.current.hoveredNode&&De(null),Te(g),C.current&&(C.current.style.cursor=g?"pointer":"default"),m){j();return}}y&&t.current.hoveredLink&&Te(null),y!==t.current.hoveredNode&&(f=true),De(y),C.current&&(C.current.style.cursor=y?"pointer":"default"),f&&j();},[d,Z,oe,De,Te,j,be,$e]),Ve=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.stopPropagation(),e.preventDefault()),t.current.mustBeStoppedPropagation=false;},[]),We=useCallback(e=>{let u=t.current.isDragging;if(u&&(t.current.mustBeStoppedPropagation=true),!u&&t.current.mouseStartPos){let l=C.current?.getBoundingClientRect();if(l){let p=e.clientX-l.left,f=e.clientY-l.top;d.length>0&&t.current.hoveredButtonIndex===null&&(t.current.hoveredButtonIndex=$e(p,f));let y=false;if(t.current.selectedNode&&t.current.hoveredButtonIndex!==null&&s[t.current.hoveredButtonIndex]){let g=s[t.current.hoveredButtonIndex];g&&g.onClick&&(g.onClick(t.current.selectedNode),y=true,t.current.hoveredButtonIndex=null);}if(!y&&t.current.draggedNode)Le(t.current.draggedNode);else if(!y&&!t.current.draggedNode){let g=oe(p,f);g?Ye(g):Ue();}}}if(t.current.draggedNode&&M.current){if(u){M.current.alphaTarget(0);let l=.05,p=.04,f=.6;M.current.alpha(l).alphaDecay(p),M.current.velocityDecay(f);}else M.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),j();},[s,j,Le,Ue,oe,Ye,$e,d]),Dt=useCallback(e=>{if(e.stopPropagation(),e.preventDefault(),!C.current)return;let u=C.current.getBoundingClientRect(),l=e.clientX-u.left,p=e.clientY-u.top,y=-e.deltaY>0?1.1:1/1.1,g=t.current.transform,m=g.k*y;if(m<.01||m>10)return;let S=g.k*y,T=l-(l-g.x)*y,R=p-(p-g.y)*y;t.current.transform={k:S,x:T,y:R},j();},[j]),Ct=a((e,u)=>{let l=e.touches[0];if(l){let p={clientX:l.clientX,clientY:l.clientY};u(p);}},"convertTouchToMouseEvent"),Jr=useCallback(e=>{Ct(e,Ne);},[Ne]),Pt=useCallback(e=>{t.current.mustBeStoppedPropagation&&(e.preventDefault(),e.stopPropagation()),t.current.mustBeStoppedPropagation=false,Ct(e,We);},[We]),Qr=useCallback(e=>{Ct(e,Ce);},[Ce]);return useImperativeHandle(D,()=>({zoomToFit:ae,addNodes:K,removeNodes:se}),[ae,K,se]),useEffect(()=>{let e=C.current,{width:u,height:l}=t.current;if(!e)return;te(),z(true);let p=u/2,f=l/2,y=U.nodeSizeBase,g=y/2,m=y*2.5;M.current&&M.current.stop();let S=M.current=forceSimulation(I).force("link",forceLink(w).id(T=>T.id).distance(m).strength(.9)).force("charge",forceManyBody().strength(-y/10*200).theta(.5).distanceMin(y*2)).force("x",forceX().strength(.03)).force("y",forceY().strength(.03)).force("center",forceCenter(p,f).strength(.05)).force("collide",forceCollide().radius(g*2).iterations(2).strength(1)).velocityDecay(.6);return ()=>{S.stop();}},[I,w]),useLayoutEffect(()=>{let e=C.current;e&&(t.current.width=o*it,t.current.height=n*it,e.width=t.current.width,e.height=t.current.height);},[o,n]),useEffect(()=>{if(M.current){let e=M.current;e.on("tick",()=>{j();}),e.on("end",()=>{N&&(ae(0,20),setTimeout(()=>{z(false);},200));});}N||j();},[I,w,N,j,ae]),useEffect(()=>{!I||!w||w.forEach(e=>{let u=typeof e.source=="object"?e.source:I.find(p=>p.id===e.source),l=typeof e.target=="object"?e.target:I.find(p=>p.id===e.target);!u||!l||(!u.neighbors&&(u.neighbors=[]),!l.neighbors&&(l.neighbors=[]),u.neighbors.push(l),l.neighbors.push(u),!u.links&&(u.links=[]),!l.links&&(l.links=[]),u.links.push(e),l.links.push(e));});},[I,w]),useEffect(()=>{s&&s.length>0&&E(Oo(s));},[s]),useEffect(()=>{let e=C.current;if(!(!e||typeof window>"u"))return e.addEventListener("wheel",Dt,{passive:false}),e.addEventListener("touchend",Pt,{passive:false}),()=>{e.removeEventListener("wheel",Dt),e.removeEventListener("touchend",Pt);}},[Dt,Pt]),jsxs(Ho,{children:[(r||N)&&jsx(ir,{width:o,height:n}),jsx($o,{ref:C,style:{width:o,height:n,display:r||N?"none":"block"},onMouseDown:Ne,onMouseMove:Ce,onMouseUp:We,onMouseLeave:We,onClick:Ve,onTouchStart:Jr,onTouchMove:Qr})]})}),Ho=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
- `,Wo=styled.canvas``;$o.displayName="Graph2D";var Vc=w(({isActive:r,position:o,top:n=0,left:a=0,right:c,bottom:i,...h})=>jsx(Yo,{$isActive:r,$position:o,$top:n,$left:a,$right:c,$bottom:i,...h})),Yo=wo.div(({$isActive:r,$top:o,$left:n,$right:a,$bottom:c$1,$position:i,theme:h})=>`
54
+ `,$o=styled.canvas``;Fo.displayName="Graph2D";var Gc=w(({isActive:r,position:o,top:n=0,left:a=0,right:s,bottom:i,...h})=>jsx(qo,{$isActive:r,$position:o,$top:n,$left:a,$right:s,$bottom:i,...h})),qo=vo.div(({$isActive:r,$top:o,$left:n,$right:a,$bottom:s,$position:i,theme:h})=>`
55
55
  ${r?`
56
56
  position: ${i};
57
57
  z-index: 1000;
58
58
  ${typeof o=="number"?`top: ${c(o,h.baseSize)};`:""}
59
59
  ${typeof n=="number"?`left: ${c(n,h.baseSize)};`:""}
60
60
  ${typeof a=="number"?`right: ${c(a,h.baseSize)};`:""}
61
- ${typeof c$1=="number"?`bottom: ${c(c$1,h.baseSize)};`:""}
61
+ ${typeof s=="number"?`bottom: ${c(s,h.baseSize)};`:""}
62
62
 
63
63
  `:""}
64
64
 
65
65
  min-width: 0;
66
- `);var hr=a(({url:r})=>{let[o,n]=useState(1),[a$1,c]=useState(),i=ur.useRef(null),h=ur.useRef(null),y=a(()=>{n(P=>Math.min(P+.25,4));},"handleZoomIn");return jsxs("div",{ref:h,className:"h-full w-full flex flex-col px-6",children:[jsxs("div",{className:"flex justify-center items-stretch py-3 gap-1 border-b border-gray-200 relative mx-2.5",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:a(()=>{n(P=>Math.max(P-.25,.25));},"handleZoomOut"),disabled:o<=.25,className:"bg-white! hover:bg-blue-50!",p:7}),jsxs(pb,{py:8,px:8,className:"flex items-center justify-between gap-1.5 min-w-21 rounded-[5px]!",children:[jsx(Ya,{color:"text.lighter",style:{fontSize:10},children:"Scale:"}),jsxs(Ya,{children:[o*100,"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma$1,{style:{width:14,height:14}}),onClick:y,disabled:o>=4,className:"bg-white! hover:bg-blue-50!",p:10})]}),jsx("div",{className:"h-full w-full overflow-auto",children:jsx("img",{src:r,ref:i,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,...a$1==="width"&&{width:`calc(${o*100}% - 20px)`},...a$1==="height"&&{height:`calc(${o*100}% - 20px)`}},onLoad:()=>{if(i.current&&h.current){let P=i.current.width,S=i.current.height,v=P<S?"height":"width";c(v);}}})})]})},"ImageDriver");var gr=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full py-5.5 px-8.5",children:jsx("audio",{controls:true,src:r,className:"w-full"})}),"AudioDriver");var Mt=a(({url:r})=>{let[o,n]=useState(null),[a$1,c]=useState(false),[i,h]=useState(true),[y,w]=useState(null);return useEffect(()=>{c(true);},[]),useEffect(()=>{if(!a$1)return;a(async()=>{try{let S=await import('./PdfDriver-ZHGUHQV2.mjs');n(()=>S.PdfDriver),h(!1);}catch(S){console.error("Failed to load PDF driver:",S),w("Failed to load PDF viewer"),h(false);}},"loadPdfDriver")();},[a$1]),a$1?i?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})}):y||!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:y||"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 yr=50,Zo=1e4,vr=a(({url:r,blob:o})=>{let n=useRef(null),a$1=useRef(null),[c,i]=useState(null),[h,y]=useState(true),[w,P]=useState(1),S=useRef(false),[v,N]=useState({width:0,height:0}),_=useRef(0),t=a(()=>{S.current=true,P(D=>Math.min(D+.25,4));},"handleZoomIn"),I=a(()=>{S.current=true,P(D=>Math.max(D-.25,.25));},"handleZoomOut");return useEffect(()=>{a(async()=>{if(a$1.current)try{y(!0),i(null);let p=o;if(!p&&r&&(p=await(await fetch(r)).blob()),!p){i("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(p.size/(1024*1024)>yr){i(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${yr} \u041C\u0411)`);return}a$1.current.innerHTML="";let C=renderAsync(p,a$1.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0,breakPages:!0,ignoreLastRenderedPageBreak:!1}),M=new Promise(($,te)=>setTimeout(()=>te(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")),Zo));await Promise.race([C,M]),await new Promise($=>requestAnimationFrame($));let F=a$1.current.querySelector(".docx-wrapper");if(F&&(_.current=F.offsetWidth,N({width:F.offsetWidth,height:F.offsetHeight})),n.current&&_.current>0){let $=n.current.clientWidth,te=Math.min($/_.current,1);P(te);}y(!1);}catch(p){i(p?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),y(false);}},"renderDocument")();},[r,o]),useEffect(()=>{if(!n.current)return;let D=Go(L=>{if(!(S.current||_.current===0))for(let C of L){let M=C.contentRect.width,F=Math.min(M/_.current,1);P(F);}},150),p=new ResizeObserver(D);return p.observe(n.current),()=>{p.disconnect(),D.cancel();}},[]),jsxs("div",{className:"h-full w-full flex flex-col px-0.5",children:[jsxs("div",{className:"flex justify-center items-stretch px-8 py-3 gap-1 border-b border-gray-200",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:I,disabled:w<=.25,className:"bg-white! hover:bg-blue-50!",p:7}),jsxs(pb,{py:8,px:8,className:"flex items-center justify-between gap-1.5 min-w-21 rounded-[5px]!",children:[jsx(Ya,{color:"text.lighter",style:{fontSize:10},children:"Scale:"}),jsxs(Ya,{children:[Math.round(w*100),"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma$1,{style:{width:14,height:14}}),onClick:t,disabled:w>=4,className:"bg-white! hover:bg-blue-50!",p:10})]}),!!c&&!h&&jsx("div",{className:"text-red-500 p-8",children:c}),h&&jsx("div",{className:"flex items-center justify-center p-8",children:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."}),jsx("div",{ref:n,className:"w-full h-full overflow-auto [&::-webkit-scrollbar-thumb]:bg-gray-100 [&::-webkit-scrollbar-track]:bg-[gray]",style:{backgroundColor:"gray",scrollbarGutter:"stable both-edges",scrollbarColor:"#f1f1f1 gray"},children:jsx("div",{style:{width:v.width>0?v.width*w:void 0,height:v.height>0?v.height*w:void 0,overflow:"hidden",margin:"0 auto"},children:jsx("div",{ref:a$1,className:`[&>div.docx-wrapper_table_*]:wrap-break-word!
66
+ `);var Tt=20,pr=a(({url:r})=>{let[o,n]=useState(1),[a$1,s]=useState(1),i=useRef(false),h=useRef({width:0,height:0}),b=useRef(null),v=useRef(null),P=useCallback(()=>{if(!v.current||h.current.width===0)return 1;let w=v.current.clientWidth-Tt,d=v.current.clientHeight-Tt,{width:E,height:C}=h.current;return Math.min(w/E,d/C,1)},[]);useEffect(()=>{i.current=false,h.current={width:0,height:0},n(1),s(1);},[r]),useEffect(()=>{if(!v.current)return;let w=Vo(()=>{i.current||h.current.width===0||s(P());},150),d=new ResizeObserver(w);return d.observe(v.current),()=>{d.disconnect(),w.cancel();}},[P]);let D=a(()=>{i.current=true,n(w=>Math.min(w+.25,4));},"handleZoomIn"),x=a(()=>{i.current=true,n(w=>Math.max(w-.25,.25));},"handleZoomOut"),N=a(()=>{i.current=false,n(1),s(P());},"handleResetZoom"),z$1=h.current.width>0,t=h.current.width*a$1*o,I=h.current.height*a$1*o;return jsxs("div",{className:"h-full w-full flex flex-col px-6",children:[jsxs("div",{className:"flex justify-center items-stretch py-3 gap-1 border-b border-gray-200 relative mx-2.5",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:x,disabled:o<=.25,className:"bg-white! hover:bg-blue-50!",p:7}),jsxs(pb,{py:8,px:8,className:"flex items-center justify-between gap-1.5 min-w-21 rounded-[5px]! cursor-pointer select-none",onClick:N,children:[jsx(Ya,{color:"text.lighter",style:{fontSize:10},children:"Scale:"}),jsxs(Ya,{children:[Math.round(o*100),"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma$1,{style:{width:14,height:14}}),onClick:D,disabled:o>=4,className:"bg-white! hover:bg-blue-50!",p:10})]}),jsx("div",{ref:v,className:"h-full w-full overflow-auto",children:jsx("img",{src:r,ref:b,alt:"image",className:"block object-contain",style:{transition:"width 0.15s ease-in-out, height 0.15s ease-in-out",marginInline:"auto",marginBlock:Tt/2,...z$1&&{width:t,height:I}},onLoad:()=>{b.current&&(h.current={width:b.current.naturalWidth,height:b.current.naturalHeight},s(P()));}})})]})},"ImageDriver");var fr=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full py-5.5 px-8.5",children:jsx("audio",{controls:true,src:r,className:"w-full"})}),"AudioDriver");var Nt=a(({url:r})=>{let[o,n]=useState(null),[a$1,s]=useState(false),[i,h]=useState(true),[b,v]=useState(null);return useEffect(()=>{s(true);},[]),useEffect(()=>{if(!a$1)return;a(async()=>{try{let D=await import('./PdfDriver-ZHGUHQV2.mjs');n(()=>D.PdfDriver),h(!1);}catch(D){console.error("Failed to load PDF driver:",D),v("Failed to load PDF viewer"),h(false);}},"loadPdfDriver")();},[a$1]),a$1?i?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500",children:"Loading PDF viewer..."})}):b||!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:b||"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 br=50,Ko=1e4,yr=a(({url:r,blob:o})=>{let n=useRef(null),a$1=useRef(null),[s,i]=useState(null),[h,b]=useState(true),[v,P]=useState(1),D=useRef(false),[x,N]=useState({width:0,height:0}),z$1=useRef(0),t=a(()=>{D.current=true,P(w=>Math.min(w+.25,4));},"handleZoomIn"),I=a(()=>{D.current=true,P(w=>Math.max(w-.25,.25));},"handleZoomOut");return useEffect(()=>{a(async()=>{if(a$1.current)try{b(!0),i(null);let d=o;if(!d&&r&&(d=await(await fetch(r)).blob()),!d){i("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(d.size/(1024*1024)>br){i(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${br} \u041C\u0411)`);return}a$1.current.innerHTML="";let C=renderAsync(d,a$1.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0,breakPages:!0,ignoreLastRenderedPageBreak:!1}),M=new Promise((H,te)=>setTimeout(()=>te(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")),Ko));await Promise.race([C,M]),await new Promise(H=>requestAnimationFrame(H));let F=a$1.current.querySelector(".docx-wrapper");if(F&&(z$1.current=F.offsetWidth,N({width:F.offsetWidth,height:F.offsetHeight})),n.current&&z$1.current>0){let H=n.current.clientWidth,te=Math.min(H/z$1.current,1);P(te);}b(!1);}catch(d){i(d?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),b(false);}},"renderDocument")();},[r,o]),useEffect(()=>{if(!n.current)return;let w=Vo(E=>{if(!(D.current||z$1.current===0))for(let C of E){let M=C.contentRect.width,F=Math.min(M/z$1.current,1);P(F);}},150),d=new ResizeObserver(w);return d.observe(n.current),()=>{d.disconnect(),w.cancel();}},[]),jsxs("div",{className:"h-full w-full flex flex-col px-0.5",children:[jsxs("div",{className:"flex justify-center items-stretch px-8 py-3 gap-1 border-b border-gray-200",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa,{style:{width:20,height:20}}),onClick:I,disabled:v<=.25,className:"bg-white! hover:bg-blue-50!",p:7}),jsxs(pb,{py:8,px:8,className:"flex items-center justify-between gap-1.5 min-w-21 rounded-[5px]!",children:[jsx(Ya,{color:"text.lighter",style:{fontSize:10},children:"Scale:"}),jsxs(Ya,{children:[Math.round(v*100),"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma$1,{style:{width:14,height:14}}),onClick:t,disabled:v>=4,className:"bg-white! hover:bg-blue-50!",p:10})]}),!!s&&!h&&jsx("div",{className:"text-red-500 p-8",children:s}),h&&jsx("div",{className:"flex items-center justify-center p-8",children:"\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F..."}),jsx("div",{ref:n,className:"w-full h-full overflow-auto [&::-webkit-scrollbar-thumb]:bg-gray-100 [&::-webkit-scrollbar-track]:bg-[gray]",style:{backgroundColor:"gray",scrollbarGutter:"stable both-edges",scrollbarColor:"#f1f1f1 gray"},children:jsx("div",{style:{width:x.width>0?x.width*v:void 0,height:x.height>0?x.height*v:void 0,overflow:"hidden",margin:"0 auto"},children:jsx("div",{ref:a$1,className:`[&>div.docx-wrapper_table_*]:wrap-break-word!
67
67
  [&>div.docx-wrapper_table]:table-fixed!
68
68
  [&>div.docx-wrapper_table_td]:w-fit!
69
69
  [&>div.docx-wrapper_table_col]:w-fit!
@@ -79,11 +79,11 @@ ${r?`
79
79
  [&>div.docx-wrapper]:box-border
80
80
  [&>div.docx-wrapper]:min-w-fit!
81
81
  [&>div.docx-wrapper]:w-full!
82
- [&>div.docx-wrapper]:min-h-full`,style:{boxSizing:"border-box",wordBreak:"break-word",overflowWrap:"break-word",transform:`scale(${w})`,transformOrigin:"top left"}})})})]})},"DocxDriver");var un=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"),Dr=a(({url:r,extension:o})=>{let[n,a$1]=useState(""),[c,i]=useState(true),[h,y]=useState(null),[w,P]=useState(0),S=useRef(null);if(useEffect(()=>{a(async()=>{try{i(!0),y(null);let t=await fetch(r);if(!t.ok)throw new Error(`Failed to load file: ${t.statusText}`);let I=await t.text();if(o==="json")try{I=JSON.stringify(JSON.parse(I),null,2);}catch{}a$1(I);}catch(t){y(t instanceof Error?t.message:"Failed to load text content");}finally{i(false);}},"loadTextContent")();},[r]),useEffect(()=>{let _=a(()=>{if(S.current){let t=S.current.clientHeight;P(t);}},"updateHeight");return _(),window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_);}},[c]),c)return jsx("div",{className:"flex items-center justify-center p-8.5",children:jsx("div",{className:"text-gray-500",children:"Loading text content..."})});if(h)return jsx("div",{className:"flex items-center justify-center p-8.5",children:jsxs("div",{className:"text-red-500",children:["Error: ",h]})});if(o==="md")return jsx("div",{ref:S,className:"h-full w-full overflow-auto p-5 prose max-w-[100%] select-text prose-table px-8.5",style:{wordBreak:"break-word"},children:jsx(ln,{remarkPlugins:[dn],children:n})});let N=un(o);return jsx("div",{ref:S,className:"h-full w-full",children:w>0&&jsx(Jo,{value:n,theme:vscodeLight,extensions:N,editable:false,height:`${w}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 Pr=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full px-8.5",children:jsx("video",{controls:true,src:r,className:"w-full max-h-full"})}),"VideoDriver");var Nt=class Nt{constructor(o=8){this.cache=new Map;this.pinned=new Set;this.maxSize=o;}get(o){let n=this.cache.get(o);return n!==void 0&&(this.cache.delete(o),this.cache.set(o,n)),n}set(o,n){if(this.cache.delete(o),this.cache.size>=this.maxSize){for(let a of this.cache.keys())if(!this.pinned.has(a)){this.cache.delete(a);break}}this.cache.set(o,n);}pin(o){this.pinned.clear();for(let n of o)this.pinned.add(n);this.pinned.size>this.maxSize&&(this.maxSize=this.pinned.size+4);}clear(){this.cache.clear(),this.pinned.clear();}};a(Nt,"LruChunkCache");var ft=Nt;var Ie="chunks",It=class It{constructor(o,n,a){this.db=o,this.sessionId=n,this.dbName=a;}async set(o,n){return new Promise((a,c)=>{let i=this.db.transaction(Ie,"readwrite");i.objectStore(Ie).put(n,o),i.oncomplete=()=>a(),i.onerror=()=>c(i.error);})}async get(o){return new Promise((n,a)=>{let i=this.db.transaction(Ie,"readonly").objectStore(Ie).get(o);i.onsuccess=()=>n(i.result??void 0),i.onerror=()=>a(i.error);})}async clear(){return new Promise((o,n)=>{let a=this.db.transaction(Ie,"readwrite");a.objectStore(Ie).clear(),a.oncomplete=()=>o(),a.onerror=()=>n(a.error);})}async destroy(){return this.db.close(),new Promise((o,n)=>{let a=indexedDB.deleteDatabase(this.dbName);a.onsuccess=()=>o(),a.onerror=()=>n(a.error),a.onblocked=()=>o();})}};a(It,"IndexedDBStore");var Rt=It,Lt=class Lt{constructor(){this.sessionId=null;this.chunks=new Map;}async set(o,n){this.chunks.set(o,n);}async get(o){return this.chunks.get(o)}async clear(){this.chunks.clear();}async destroy(){this.chunks.clear();}};a(Lt,"MemoryStore");var Et=Lt;async function Mr(){let r=`${Date.now()}_${Math.random().toString(36).slice(2)}`,o=`csv-chunks-${r}`;try{let n=await new Promise((a,c)=>{let i=indexedDB.open(o,1);i.onupgradeneeded=()=>{let h=i.result;h.objectStoreNames.contains(Ie)||h.createObjectStore(Ie);},i.onsuccess=()=>a(i.result),i.onerror=()=>c(i.error);});return new Rt(n,r,o)}catch{return console.warn("IndexedDB unavailable, falling back to in-memory storage"),new Et}}a(Mr,"createChunkStore");function mn(r){let o=[],n=false,a=0,c=0;for(let i=0;i<r.length;i++){let h=r[i];if(h==='"')n=!n;else if(!n&&(h===`
82
+ [&>div.docx-wrapper]:min-h-full`,style:{boxSizing:"border-box",wordBreak:"break-word",overflowWrap:"break-word",transform:`scale(${v})`,transformOrigin:"top left"}})})})]})},"DocxDriver");var pn=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"),Sr=a(({url:r,extension:o})=>{let[n,a$1]=useState(""),[s,i]=useState(true),[h,b]=useState(null),[v,P]=useState(0),D=useRef(null);if(useEffect(()=>{a(async()=>{try{i(!0),b(null);let t=await fetch(r);if(!t.ok)throw new Error(`Failed to load file: ${t.statusText}`);let I=await t.text();if(o==="json")try{I=JSON.stringify(JSON.parse(I),null,2);}catch{}a$1(I);}catch(t){b(t instanceof Error?t.message:"Failed to load text content");}finally{i(false);}},"loadTextContent")();},[r]),useEffect(()=>{let z=a(()=>{if(D.current){let t=D.current.clientHeight;P(t);}},"updateHeight");return z(),window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z);}},[s]),s)return jsx("div",{className:"flex items-center justify-center p-8.5",children:jsx("div",{className:"text-gray-500",children:"Loading text content..."})});if(h)return jsx("div",{className:"flex items-center justify-center p-8.5",children:jsxs("div",{className:"text-red-500",children:["Error: ",h]})});if(o==="md")return jsx("div",{ref:D,className:"h-full w-full overflow-auto p-5 prose max-w-[100%] select-text prose-table px-8.5",style:{wordBreak:"break-word"},children:jsx(dn,{remarkPlugins:[un],children:n})});let N=pn(o);return jsx("div",{ref:D,className:"h-full w-full",children:v>0&&jsx(Qo,{value:n,theme:vscodeLight,extensions:N,editable:false,height:`${v}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 Cr=a(({url:r})=>jsx("div",{className:"flex flex-col justify-center items-center w-full h-full px-8.5",children:jsx("video",{controls:true,src:r,className:"w-full max-h-full"})}),"VideoDriver");var gt=class{static{a(this,"LruChunkCache");}cache=new Map;pinned=new Set;maxSize;constructor(o=8){this.maxSize=o;}get(o){let n=this.cache.get(o);return n!==void 0&&(this.cache.delete(o),this.cache.set(o,n)),n}set(o,n){if(this.cache.delete(o),this.cache.size>=this.maxSize){for(let a of this.cache.keys())if(!this.pinned.has(a)){this.cache.delete(a);break}}this.cache.set(o,n);}pin(o){this.pinned.clear();for(let n of o)this.pinned.add(n);this.pinned.size>this.maxSize&&(this.maxSize=this.pinned.size+4);}clear(){this.cache.clear(),this.pinned.clear();}};var Ee="chunks",It=class{static{a(this,"IndexedDBStore");}db;sessionId;dbName;constructor(o,n,a){this.db=o,this.sessionId=n,this.dbName=a;}async set(o,n){return new Promise((a,s)=>{let i=this.db.transaction(Ee,"readwrite");i.objectStore(Ee).put(n,o),i.oncomplete=()=>a(),i.onerror=()=>s(i.error);})}async get(o){return new Promise((n,a)=>{let i=this.db.transaction(Ee,"readonly").objectStore(Ee).get(o);i.onsuccess=()=>n(i.result??void 0),i.onerror=()=>a(i.error);})}async clear(){return new Promise((o,n)=>{let a=this.db.transaction(Ee,"readwrite");a.objectStore(Ee).clear(),a.oncomplete=()=>o(),a.onerror=()=>n(a.error);})}async destroy(){return this.db.close(),new Promise((o,n)=>{let a=indexedDB.deleteDatabase(this.dbName);a.onsuccess=()=>o(),a.onerror=()=>n(a.error),a.onblocked=()=>o();})}},Et=class{static{a(this,"MemoryStore");}sessionId=null;chunks=new Map;async set(o,n){this.chunks.set(o,n);}async get(o){return this.chunks.get(o)}async clear(){this.chunks.clear();}async destroy(){this.chunks.clear();}};async function Pr(){let r=`${Date.now()}_${Math.random().toString(36).slice(2)}`,o=`csv-chunks-${r}`;try{let n=await new Promise((a,s)=>{let i=indexedDB.open(o,1);i.onupgradeneeded=()=>{let h=i.result;h.objectStoreNames.contains(Ee)||h.createObjectStore(Ee);},i.onsuccess=()=>a(i.result),i.onerror=()=>s(i.error);});return new It(n,r,o)}catch{return console.warn("IndexedDB unavailable, falling back to in-memory storage"),new Et}}a(Pr,"createChunkStore");function bn(r){let o=[],n=false,a=0,s=0;for(let i=0;i<r.length;i++){let h=r[i];if(h==='"')n=!n;else if(!n&&(h===`
83
83
  `||h==="\r"&&r[i+1]!==`
84
- `)){let y=i,w=r.slice(a,y).replace(/\r$/,"");w&&o.push(w),a=i+1,c=i+1;}}return [o,r.slice(c)]}a(mn,"splitCsvRows");function bn(r,o){return r.stream?Promise.resolve(r.stream):r.blob?Promise.resolve(r.blob.stream()):r.url?fetch(r.url,{signal:o}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.body}):Promise.reject(new Error("No source provided"))}a(bn,"resolveStream");function Nr(r){let[o,n]=useState("idle"),[a,c]=useState(0),[i,h]=useState([]),[y,w]=useState(null),[P,S]=useState(0),[v,N]=useState(0),_=useRef(r),t=useRef(0),I=useRef(0),D=useRef(""),p=useRef(new ft(10)),L=useRef(null),C=useRef(null),M=useRef(new Set),F=useRef(null),$=useRef(false),te=useCallback((z,Y)=>{let j=z+`
84
+ `)){let b=i,v=r.slice(a,b).replace(/\r$/,"");v&&o.push(v),a=i+1,s=i+1;}}return [o,r.slice(s)]}a(bn,"splitCsvRows");function yn(r,o){return r.stream?Promise.resolve(r.stream):r.blob?Promise.resolve(r.blob.stream()):r.url?fetch(r.url,{signal:o}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.body}):Promise.reject(new Error("No source provided"))}a(yn,"resolveStream");function Tr(r){let[o,n]=useState("idle"),[a,s]=useState(0),[i,h]=useState([]),[b,v]=useState(null),[P,D]=useState(0),[x,N]=useState(0),z=useRef(r),t=useRef(0),I=useRef(0),w=useRef(""),d=useRef(new gt(10)),E=useRef(null),C=useRef(null),M=useRef(new Set),F=useRef(null),H=useRef(false),te=useCallback((_,Y)=>{let j=_+`
85
85
  `+Y.join(`
86
- `),{data:K}=zt.parse(j,{header:true,dynamicTyping:false,skipEmptyLines:true});return K},[]),re=useCallback(async(z,Y)=>{let j=L.current;if(!j)return;let K=Math.max(0,Math.floor(z/1e3)-2),se=Math.min(t.current-1,Math.floor(Y/1e3)+2),ae=false;for(let Z=K;Z<=se;Z++)if(p.current.get(Z)===void 0&&!M.current.has(Z)){M.current.add(Z);try{let oe=await j.get(Z);if(oe&&D.current){let be=te(D.current,oe);p.current.set(Z,be),ae=!0;}}finally{M.current.delete(Z);}}ae&&N(Z=>Z+1);},[te]),pe=useCallback(z=>{let Y=Math.floor(z/1e3),j=z%1e3;return p.current.get(Y)?.[j]},[v]),he=useCallback(async()=>{$.current=true;let z=new AbortController;C.current=z,await L.current?.destroy();let Y=await Mr();L.current=Y,t.current=0,I.current=0,D.current="",p.current.clear(),h([]),c(0),w(null),S(0),n("loading");let j=_.current;try{let K=await bn(j,z.signal);n("streaming");let se=K.getReader(),ae=new TextDecoder("utf-8"),Z="",oe=[],be=!0,De=0,Te=0,Ye=j.blob?.size||0;for(;;){if(z.signal.aborted)return;let{done:Le,value:Ue}=await se.read();if(Le)break;De+=Ue.byteLength,Ye&&S(De/Ye),Z+=ae.decode(Ue,{stream:!0});let[Ne,He]=mn(Z);if(Ne.length!==0){if(Z=He,be&&Ne.length>0){D.current=Ne.shift().replace(/^\uFEFF/,"");let{data:Ce}=zt.parse(D.current,{});Ce[0]&&h(Ce[0]),be=!1;}for(let Ce of Ne)if(Ce.trim()&&(oe.push(Ce),oe.length>=1e3)){let Ve=t.current;if(await Y.set(Ve,oe),Ve<3){let We=te(D.current,oe);p.current.set(Ve,We);}t.current+=1,Te+=oe.length,oe=[],I.current=Te,F.current||(F.current=requestAnimationFrame(()=>{c(I.current),F.current=null;}));}}}if(Z.trim())if(be){D.current=Z;let{data:Le}=zt.parse(D.current,{});Le[0]&&h(Le[0]);}else oe.push(Z);oe.length>0&&(await Y.set(t.current,oe),t.current+=1,Te+=oe.length),F.current&&(cancelAnimationFrame(F.current),F.current=null),c(Te),S(1),n("done");}catch(K){if(z.signal.aborted)return;let se=K instanceof Error?K.message:"Unknown error";w(se),n("partial_error");}finally{$.current=false;}},[te]),me=useRef(false);useEffect(()=>(me.current=true,$.current||he(),()=>{me.current=false,queueMicrotask(()=>{me.current||(C.current?.abort(),L.current?.destroy(),F.current&&cancelAnimationFrame(F.current));});}),[he]);let Se=L.current?.sessionId??null,Me=t.current,H=useCallback(z=>{p.current.pin(z);},[]);return {state:o,headers:i,totalRows:a,getRow:pe,error:y,progress:P,prefetchRange:re,sessionId:Se,chunkCount:Me,pinChunks:H}}a(Nr,"useCsvStream");var yn=`
86
+ `),{data:K}=Lt.parse(j,{header:true,dynamicTyping:false,skipEmptyLines:true});return K},[]),re=useCallback(async(_,Y)=>{let j=E.current;if(!j)return;let K=Math.max(0,Math.floor(_/1e3)-2),se=Math.min(t.current-1,Math.floor(Y/1e3)+2),ae=false;for(let Z=K;Z<=se;Z++)if(d.current.get(Z)===void 0&&!M.current.has(Z)){M.current.add(Z);try{let oe=await j.get(Z);if(oe&&w.current){let be=te(w.current,oe);d.current.set(Z,be),ae=!0;}}finally{M.current.delete(Z);}}ae&&N(Z=>Z+1);},[te]),pe=useCallback(_=>{let Y=Math.floor(_/1e3),j=_%1e3;return d.current.get(Y)?.[j]},[x]),he=useCallback(async()=>{H.current=true;let _=new AbortController;C.current=_,await E.current?.destroy();let Y=await Pr();E.current=Y,t.current=0,I.current=0,w.current="",d.current.clear(),h([]),s(0),v(null),D(0),n("loading");let j=z.current;try{let K=await yn(j,_.signal);n("streaming");let se=K.getReader(),ae=new TextDecoder("utf-8"),Z="",oe=[],be=!0,De=0,Te=0,Ye=j.blob?.size||0;for(;;){if(_.signal.aborted)return;let{done:Le,value:Ue}=await se.read();if(Le)break;De+=Ue.byteLength,Ye&&D(De/Ye),Z+=ae.decode(Ue,{stream:!0});let[Ne,$e]=bn(Z);if(Ne.length!==0){if(Z=$e,be&&Ne.length>0){w.current=Ne.shift().replace(/^\uFEFF/,"");let{data:Ce}=Lt.parse(w.current,{});Ce[0]&&h(Ce[0]),be=!1;}for(let Ce of Ne)if(Ce.trim()&&(oe.push(Ce),oe.length>=1e3)){let Ve=t.current;if(await Y.set(Ve,oe),Ve<3){let We=te(w.current,oe);d.current.set(Ve,We);}t.current+=1,Te+=oe.length,oe=[],I.current=Te,F.current||(F.current=requestAnimationFrame(()=>{s(I.current),F.current=null;}));}}}if(Z.trim())if(be){w.current=Z;let{data:Le}=Lt.parse(w.current,{});Le[0]&&h(Le[0]);}else oe.push(Z);oe.length>0&&(await Y.set(t.current,oe),t.current+=1,Te+=oe.length),F.current&&(cancelAnimationFrame(F.current),F.current=null),s(Te),D(1),n("done");}catch(K){if(_.signal.aborted)return;let se=K instanceof Error?K.message:"Unknown error";v(se),n("partial_error");}finally{H.current=false;}},[te]),me=useRef(false);useEffect(()=>(me.current=true,H.current||he(),()=>{me.current=false,queueMicrotask(()=>{me.current||(C.current?.abort(),E.current?.destroy(),F.current&&cancelAnimationFrame(F.current));});}),[he]);let Se=E.current?.sessionId??null,Me=t.current,$=useCallback(_=>{d.current.pin(_);},[]);return {state:o,headers:i,totalRows:a,getRow:pe,error:b,progress:P,prefetchRange:re,sessionId:Se,chunkCount:Me,pinChunks:$}}a(Tr,"useCsvStream");var vn=`
87
87
  const DB_VERSION = 1;
88
88
  const STORE_NAME = 'chunks';
89
89
 
@@ -169,7 +169,7 @@ self.onmessage = async (e) => {
169
169
  }
170
170
  }
171
171
  };
172
- `,Je=null,Qe=null;function _t(){if(!Je){let r=new Blob([yn],{type:"application/javascript"});Qe=URL.createObjectURL(r),Je=new Worker(Qe);}return Je}a(_t,"getSearchWorker");function Rr(){Je?.terminate(),Je=null,Qe&&(URL.revokeObjectURL(Qe),Qe=null);}a(Rr,"terminateSearchWorker");function Er(r,o){let[n,a]=useState(""),[c,i]=useState("idle"),[h,y]=useState(null),[w,P]=useState({searched:0,total:0,found:0}),S=useRef(null),v=useCallback(t=>{if(!r||o===0)return;if(!t.trim()){y(null),i("idle"),P({searched:0,total:0,found:0});return}i("searching"),P({searched:0,total:o,found:0});let I=_t();I.onmessage=D=>{let{type:p}=D.data;p==="progress"&&P({searched:D.data.searched,total:D.data.total,found:D.data.found}),p==="done"&&(y(D.data.matchedIndices),i("done")),p==="cancelled"&&i("idle"),p==="error"&&(i("idle"),console.error("Search worker error:",D.data.message));},I.postMessage({type:"cancel"}),I.postMessage({type:"search",sessionId:r,query:t,chunkCount:o,chunkSize:1e3});},[r,o]),N=useCallback(t=>{a(t),S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{v(t);},300);},[v]),_=useCallback(()=>{a(""),y(null),i("idle"),P({searched:0,total:0,found:0}),_t().postMessage({type:"cancel"});},[]);return useEffect(()=>()=>{S.current&&clearTimeout(S.current),Rr();},[]),{query:n,onQueryChange:N,clearSearch:_,searchState:c,matchedIndices:h,searchProgress:w}}a(Er,"useCsvSearch");var Mn={loading:"Loading...",rows:"rows",retry:"Retry",searchPlaceholder:"Search...",searchFound:"found",searching:"Searching..."};function Tn(r,o,n){let a=1/0,c=-1/0,i=Math.min(n,r.length-1);for(let h=o;h<=i;h++){let y=r[h];y<a&&(a=y),y>c&&(c=y);}return {min:a,max:c}}a(Tn,"getMinMax");function Nn(r,o,n){let a=Math.min(100,n),c=r.map(()=>[]);for(let i=0;i<a;i++){let h=o(i);if(h)for(let y=0;y<r.length;y++){let w=h[r[y]]??"";c[y].push(w.length);}}return r.map((i,h)=>{let y=i.length*9,w=c[h];if(w.length===0)return Math.min(Math.max(150,y+24),800);w.sort((_,t)=>_-t);let P=Math.floor(w.length*.9),v=w[P]*7.5+24,N=Math.max(y+24,v);return Math.min(Math.max(50,N),800)})}a(Nn,"estimateColumnWidths");var Bt=a(r=>{let{state:o,headers:n,totalRows:a$1,getRow:c,error:i,progress:h,prefetchRange:y,sessionId:w,chunkCount:P,pinChunks:S}=Nr(r),v={...Mn,...r.labels},{query:N,onQueryChange:_,clearSearch:t,searchState:I,matchedIndices:D}=Er(w,P),p=D!==null,L=p?D.length:a$1,[C,M]=useState([]),F=useRef(null),$=useRef(null),te=useRef(false),re=useRef(false);useEffect(()=>{re.current=false,te.current=false,M([]);},[w]),useEffect(()=>{if(n.length===0||te.current||re.current||a$1===0)return;let H=c(0);!H||!n.some(z=>H[z]!==void 0)||(re.current=true,M(Nn(n,c,a$1)));},[n,a$1,c]),useEffect(()=>()=>$.current?.(),[]);let pe=useCallback((H,z)=>{H.preventDefault(),te.current=true;let Y=H.clientX,j=C[z]??150;F.current={index:z,startX:Y,startWidth:j};let K=a(ae=>{if(!F.current)return;let Z=ae.clientX-Y,oe=Math.max(50,j+Z);M(be=>{let De=[...be];return De[z]=oe,De});},"onMouseMove"),se=a(()=>{F.current=null,$.current=null,document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",se);},"onMouseUp");$.current=se,document.addEventListener("mousemove",K),document.addEventListener("mouseup",se);},[C]),he=C.reduce((H,z)=>H+z,0),me=useCallback(()=>jsx(In,{children:n.map((H,z)=>jsxs(Ln,{style:{width:C[z]},children:[H,jsx(zn,{onMouseDown:Y=>pe(Y,z)})]},z))}),[n,C,pe]),Se=useCallback(H=>{if(p&&D){let z=1/0,Y=-1/0,j=new Set,K=Math.min(H.endIndex,D.length-1);for(let se=H.startIndex;se<=K;se++){let ae=D[se];ae<z&&(z=ae),ae>Y&&(Y=ae),j.add(Math.floor(ae/1e3));}S(Array.from(j)),z!==1/0&&y(z,Y);}else S([]),y(H.startIndex,H.endIndex);},[y,S,p,D]),Me=useCallback(H=>{let z=p&&D?D[H]:H,Y=c(z);return Y?n.map((j,K)=>jsx(zr,{style:{width:C[K]},children:Y[j]??""},K)):n.map((j,K)=>jsx(zr,{style:{width:C[K]},children:jsx(jn,{})},K))},[c,n,C,p,D]);return useEffect(()=>{if(L>0)if(p&&D){let{min:H,max:z}=Tn(D,0,50);H!==1/0&&y(H,z);}else y(0,50);},[L,p,D,y]),o==="idle"||o==="loading"||o==="streaming"?jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[jsx("div",{className:"h-10 w-10 rounded-full border-2 border-gray-200 animate-spin border-s-transparent"}),o==="streaming"&&a$1>0&&jsxs(Ya,{variant:"body",color:"text.lighter",style:{fontSize:12},children:[v.loading," ",a$1.toLocaleString()," ",v.rows,h>0?` (${Math.round(h*100)}%)`:""]})]}):jsxs("div",{className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex items-center justify-between px-4 py-2 gap-3",children:[jsx(Ya,{variant:"body",color:"text.lighter",style:{fontSize:12,whiteSpace:"nowrap"},children:`${L.toLocaleString()} ${p?v.searchFound:v.rows}${p?` / ${a$1.toLocaleString()}`:""}`}),jsxs(Bn,{children:[jsx(On,{type:"text",value:N,onChange:H=>_(H.target.value),placeholder:v.searchPlaceholder}),I==="searching"?jsx($n,{children:jsx(Wn,{})}):N?jsx(Fn,{onClick:t,type:"button",children:"\u2715"}):null]})]}),o==="partial_error"&&jsxs(pb,{className:"flex items-center justify-between mx-4 mb-2 px-3 py-2 rounded bg-red-50 border border-red-200",children:[jsx(Ya,{variant:"body",style:{fontSize:12,color:"#dc2626"},children:i}),r.onRetry&&jsx(z,{onClick:()=>r.onRetry(i??""),variant:"outlined",size:"small",children:v.retry})]}),jsx("div",{className:"flex-1 min-h-0",children:n.length>0&&jsx(TableVirtuoso,{totalCount:L,increaseViewportBy:300,fixedHeaderContent:me,itemContent:Me,rangeChanged:Se,style:{height:"100%"},components:{Table:a(({style:H,context:z,...Y})=>jsx(Rn,{style:{...H,minWidth:"100%",width:he},...Y}),"Table"),TableHead:En,TableRow:a(({context:H,...z})=>jsx(_n,{...z}),"TableRow")}},p?"filtered":"all")})]})},"CsvDriver"),Rn=styled.table(({theme:r})=>`
172
+ `,Je=null,Qe=null;function zt(){if(!Je){let r=new Blob([vn],{type:"application/javascript"});Qe=URL.createObjectURL(r),Je=new Worker(Qe);}return Je}a(zt,"getSearchWorker");function Nr(){Je?.terminate(),Je=null,Qe&&(URL.revokeObjectURL(Qe),Qe=null);}a(Nr,"terminateSearchWorker");function Rr(r,o){let[n,a]=useState(""),[s,i]=useState("idle"),[h,b]=useState(null),[v,P]=useState({searched:0,total:0,found:0}),D=useRef(null),x=useCallback(t=>{if(!r||o===0)return;if(!t.trim()){b(null),i("idle"),P({searched:0,total:0,found:0});return}i("searching"),P({searched:0,total:o,found:0});let I=zt();I.onmessage=w=>{let{type:d}=w.data;d==="progress"&&P({searched:w.data.searched,total:w.data.total,found:w.data.found}),d==="done"&&(b(w.data.matchedIndices),i("done")),d==="cancelled"&&i("idle"),d==="error"&&(i("idle"),console.error("Search worker error:",w.data.message));},I.postMessage({type:"cancel"}),I.postMessage({type:"search",sessionId:r,query:t,chunkCount:o,chunkSize:1e3});},[r,o]),N=useCallback(t=>{a(t),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{x(t);},300);},[x]),z=useCallback(()=>{a(""),b(null),i("idle"),P({searched:0,total:0,found:0}),zt().postMessage({type:"cancel"});},[]);return useEffect(()=>()=>{D.current&&clearTimeout(D.current),Nr();},[]),{query:n,onQueryChange:N,clearSearch:z,searchState:s,matchedIndices:h,searchProgress:v}}a(Rr,"useCsvSearch");var Tn={loading:"Loading...",rows:"rows",retry:"Retry",searchPlaceholder:"Search...",searchFound:"found",searching:"Searching..."};function Nn(r,o,n){let a=1/0,s=-1/0,i=Math.min(n,r.length-1);for(let h=o;h<=i;h++){let b=r[h];b<a&&(a=b),b>s&&(s=b);}return {min:a,max:s}}a(Nn,"getMinMax");function Rn(r,o,n){let a=Math.min(100,n),s=r.map(()=>[]);for(let i=0;i<a;i++){let h=o(i);if(h)for(let b=0;b<r.length;b++){let v=h[r[b]]??"";s[b].push(v.length);}}return r.map((i,h)=>{let b=i.length*9,v=s[h];if(v.length===0)return Math.min(Math.max(150,b+24),800);v.sort((z,t)=>z-t);let P=Math.floor(v.length*.9),x=v[P]*7.5+24,N=Math.max(b+24,x);return Math.min(Math.max(50,N),800)})}a(Rn,"estimateColumnWidths");var jt=a(r=>{let{state:o,headers:n,totalRows:a$1,getRow:s,error:i,progress:h,prefetchRange:b,sessionId:v,chunkCount:P,pinChunks:D}=Tr(r),x={...Tn,...r.labels},{query:N,onQueryChange:z$1,clearSearch:t,searchState:I,matchedIndices:w}=Rr(v,P),d=w!==null,E=d?w.length:a$1,[C,M]=useState([]),F=useRef(null),H=useRef(null),te=useRef(false),re=useRef(false);useEffect(()=>{re.current=false,te.current=false,M([]);},[v]),useEffect(()=>{if(n.length===0||te.current||re.current||a$1===0)return;let $=s(0);!$||!n.some(_=>$[_]!==void 0)||(re.current=true,M(Rn(n,s,a$1)));},[n,a$1,s]),useEffect(()=>()=>H.current?.(),[]);let pe=useCallback(($,_)=>{$.preventDefault(),te.current=true;let Y=$.clientX,j=C[_]??150;F.current={index:_,startX:Y,startWidth:j};let K=a(ae=>{if(!F.current)return;let Z=ae.clientX-Y,oe=Math.max(50,j+Z);M(be=>{let De=[...be];return De[_]=oe,De});},"onMouseMove"),se=a(()=>{F.current=null,H.current=null,document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",se);},"onMouseUp");H.current=se,document.addEventListener("mousemove",K),document.addEventListener("mouseup",se);},[C]),he=C.reduce(($,_)=>$+_,0),me=useCallback(()=>jsx(Ln,{children:n.map(($,_)=>jsxs(zn,{style:{width:C[_]},children:[$,jsx(_n,{onMouseDown:Y=>pe(Y,_)})]},_))}),[n,C,pe]),Se=useCallback($=>{if(d&&w){let _=1/0,Y=-1/0,j=new Set,K=Math.min($.endIndex,w.length-1);for(let se=$.startIndex;se<=K;se++){let ae=w[se];ae<_&&(_=ae),ae>Y&&(Y=ae),j.add(Math.floor(ae/1e3));}D(Array.from(j)),_!==1/0&&b(_,Y);}else D([]),b($.startIndex,$.endIndex);},[b,D,d,w]),Me=useCallback($=>{let _=d&&w?w[$]:$,Y=s(_);return Y?n.map((j,K)=>jsx(Lr,{style:{width:C[K]},children:Y[j]??""},K)):n.map((j,K)=>jsx(Lr,{style:{width:C[K]},children:jsx(Bn,{})},K))},[s,n,C,d,w]);return useEffect(()=>{if(E>0)if(d&&w){let{min:$,max:_}=Nn(w,0,50);$!==1/0&&b($,_);}else b(0,50);},[E,d,w,b]),o==="idle"||o==="loading"||o==="streaming"?jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[jsx("div",{className:"h-10 w-10 rounded-full border-2 border-gray-200 animate-spin border-s-transparent"}),o==="streaming"&&a$1>0&&jsxs(Ya,{variant:"body",color:"text.lighter",style:{fontSize:12},children:[x.loading," ",a$1.toLocaleString()," ",x.rows,h>0?` (${Math.round(h*100)}%)`:""]})]}):jsxs("div",{className:"h-full w-full flex flex-col",children:[jsxs("div",{className:"flex items-center justify-between px-4 py-2 gap-3",children:[jsx(Ya,{variant:"body",color:"text.lighter",style:{fontSize:12,whiteSpace:"nowrap"},children:`${E.toLocaleString()} ${d?x.searchFound:x.rows}${d?` / ${a$1.toLocaleString()}`:""}`}),jsxs(On,{children:[jsx(Fn,{type:"text",value:N,onChange:$=>z$1($.target.value),placeholder:x.searchPlaceholder}),I==="searching"?jsx($n,{children:jsx(Xn,{})}):N?jsx(Hn,{onClick:t,type:"button",children:"\u2715"}):null]})]}),o==="partial_error"&&jsxs(pb,{className:"flex items-center justify-between mx-4 mb-2 px-3 py-2 rounded bg-red-50 border border-red-200",children:[jsx(Ya,{variant:"body",style:{fontSize:12,color:"#dc2626"},children:i}),r.onRetry&&jsx(z,{onClick:()=>r.onRetry(i??""),variant:"outlined",size:"small",children:x.retry})]}),jsx("div",{className:"flex-1 min-h-0",children:n.length>0&&jsx(TableVirtuoso,{totalCount:E,increaseViewportBy:300,fixedHeaderContent:me,itemContent:Me,rangeChanged:Se,style:{height:"100%"},components:{Table:a(({style:$,context:_,...Y})=>jsx(In,{style:{...$,minWidth:"100%",width:he},...Y}),"Table"),TableHead:En,TableRow:a(({context:$,..._})=>jsx(An,{..._}),"TableRow")}},d?"filtered":"all")})]})},"CsvDriver"),In=styled.table(({theme:r})=>`
173
173
  border-collapse: separate;
174
174
  border-spacing: 0;
175
175
  table-layout: fixed;
@@ -178,7 +178,7 @@ self.onmessage = async (e) => {
178
178
  `),En=styled.thead(({theme:r})=>`
179
179
  background-color: ${r.colors.background};
180
180
  z-index: 1;
181
- `),In=styled.tr``,Ln=styled.th(({theme:r})=>`
181
+ `),Ln=styled.tr``,zn=styled.th(({theme:r})=>`
182
182
  position: relative;
183
183
  text-align: left;
184
184
  padding: 8px 12px;
@@ -193,7 +193,7 @@ self.onmessage = async (e) => {
193
193
  &:last-child {
194
194
  border-right: none;
195
195
  }
196
- `),zn=styled.div(({theme:r})=>`
196
+ `),_n=styled.div(({theme:r})=>`
197
197
  position: absolute;
198
198
  right: 0;
199
199
  top: 0;
@@ -205,11 +205,11 @@ self.onmessage = async (e) => {
205
205
  background-color: ${r.colors.primary?.light};
206
206
  opacity: 0.4;
207
207
  }
208
- `),_n=styled.tr(({theme:r})=>`
208
+ `),An=styled.tr(({theme:r})=>`
209
209
  &:hover {
210
210
  background-color: ${r.colors.backgroundBase};
211
211
  }
212
- `),zr=styled.td(({theme:r})=>`
212
+ `),Lr=styled.td(({theme:r})=>`
213
213
  padding: 6px 12px;
214
214
  word-wrap: break-word;
215
215
  overflow-wrap: break-word;
@@ -219,20 +219,20 @@ self.onmessage = async (e) => {
219
219
  &:last-child {
220
220
  border-right: none;
221
221
  }
222
- `),An=keyframes`
222
+ `),jn=keyframes`
223
223
  0%, 100% { opacity: 0.4; }
224
224
  50% { opacity: 1; }
225
- `,jn=styled.div(({theme:r})=>css$1`
225
+ `,Bn=styled.div(({theme:r})=>css$1`
226
226
  height: 12px;
227
227
  width: 60%;
228
228
  background: ${r.colors.stroke.light};
229
229
  border-radius: 4px;
230
- animation: ${An} 1.5s ease-in-out infinite;
231
- `),Bn=styled.div`
230
+ animation: ${jn} 1.5s ease-in-out infinite;
231
+ `),On=styled.div`
232
232
  position: relative;
233
233
  width: 200px;
234
234
  flex-shrink: 0;
235
- `,On=styled.input(({theme:r})=>`
235
+ `,Fn=styled.input(({theme:r})=>`
236
236
  padding: 4px 24px 4px 8px;
237
237
  font-size: 12px;
238
238
  border: 1px solid ${r.colors.stroke.light};
@@ -242,7 +242,7 @@ self.onmessage = async (e) => {
242
242
  &:focus {
243
243
  border-color: ${r.colors.primary?.main};
244
244
  }
245
- `),Fn=styled.button(({theme:r})=>`
245
+ `),Hn=styled.button(({theme:r})=>`
246
246
  position: absolute;
247
247
  right: 6px;
248
248
  top: 50%;
@@ -264,16 +264,16 @@ self.onmessage = async (e) => {
264
264
  transform: translateY(-50%);
265
265
  display: flex;
266
266
  align-items: center;
267
- `,Hn=keyframes`
267
+ `,Wn=keyframes`
268
268
  to { transform: rotate(360deg); }
269
- `,Wn=styled.div(({theme:r})=>css$1`
269
+ `,Xn=styled.div(({theme:r})=>css$1`
270
270
  width: 14px;
271
271
  height: 14px;
272
272
  border: 2px solid ${r.colors.stroke.light};
273
273
  border-top-color: ${r.colors.text?.light};
274
274
  border-radius: 50%;
275
- animation: ${Hn} 0.6s linear infinite;
276
- `);var Or=memo(a(function({extension:o,blob:n,path:a,buffer:c,stream:i,csvLabels:h,onCsvRetry:y,not_supported_message:w=" Sorry, this file type isn\u2019t supported yet."}){let P=o.toLocaleLowerCase().trim(),S;if(a?S=a:n&&(S=URL.createObjectURL(n)),["csv","tsv"].includes(P))return jsx(Bt,{url:S,blob:n,stream:i,labels:h,onRetry:y});if(S){if(["jpeg","jpg","png","gif","bmp","webp"].includes(P))return jsx(hr,{url:S});if(["mp3","wav","ogg","flac"].includes(P))return jsx(gr,{url:S});if(["mp4","webm"].includes(P))return jsx(Pr,{url:S});if(o==="pdf")return jsx(Mt,{url:S});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(P))return jsx(Dr,{url:S,extension:P})}return P==="docx"?jsx(vr,{url:S,blob:n}):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:w})})})},"Driver"));var Ad=a(r=>jsx("div",{className:"h-full w-full",children:jsx(Or,{...r})}),"FileViewer");var Hr=250,Vd=a(({text:r,speed:o=50,onDone:n,markdown:a$1=false,markdownComponents:c={},className:i,...h})=>{let[y,w]=useState(""),P=useRef(null),S=useRef(null);return useEffect(()=>{let v=false;if(o>0){w(""),P.current=performance.now();let N=a(_=>{if(v||!P.current)return;let t=_-P.current,I=t/o>Hr?o/2:o,D=t/o>Hr?1.5:1,p=Math.floor(t/I*D);if(p>=r.length){w(r),v=true,n?.();return}w(r.slice(0,p)),S.current=requestAnimationFrame(N);},"tick");S.current=requestAnimationFrame(N);}else w(r),n?.();return ()=>{S.current&&cancelAnimationFrame(S.current);}},[r,o,n]),a$1?jsx("div",{className:i,children:jsx(ln,{remarkPlugins:[dn],components:c,...h,children:y})}):jsx(Ya,{className:i,...h,children:y})},"Typewriter");var ea={timeout:2e3,message:"Copied!"},iu=a(({text:r,children:o,format:n="text/plain",tooltip:a$1,positions:c=["top"],className:i})=>{let[h,y]=useState(false),w=useRef(null),P={...ea,...a$1},S=Array.isArray(c)?c[0]:c,v=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):Gn(r,{format:n}),y(true),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>y(false),P.timeout);},"handleCopy");return useEffect(()=>()=>{w.current&&clearTimeout(w.current);},[]),jsx(Popover,{padding:6,positions:c,isOpen:h,align:"center",onClickOutside:()=>y(false),content:!!a$1?.message&&jsx(Cb,{className:i,$position:S,$offset:6,children:a$1.message}),containerStyle:{zIndex:"9999"},children:jsx("div",{className:"inline-block",onMouseLeave:()=>y(false),children:o({copy:v})})})},"CopyToClipboard");var Xr=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),kt=a((r,o)=>{let n;if(o){let c=parse(r||"",o,new Date);if(isValid(c)&&getYear(c)>=1970)return c}let a=new Date(r||"");return isNaN(a.getTime())?n:a},"parseDate"),la=a((r,o)=>{let n=r?kt(r,o):void 0;return n&&o?format(n,o):r},"renderDate"),vu=a(({value:r,range:o,inline:n=false,minDate:a=new Date(getYear(new Date)-5,0,1),maxDate:c=new Date(getYear(new Date)+5,11,31),format:i="dd.MM.yyyy",onChange:h,...y})=>{let[w,P]=useState(getMonth(Xr(r))),[S,v]=useState(getYear(Xr(r))),N=useMemo(()=>{if(r){if(Array.isArray(r)){let t=kt(r[0],i),I=kt(r[1],i);return [t,I]}return kt(r,i)}},[r]),_=useCallback(t=>{if(o){let I=!!(N&&Array.isArray(N)&&N[0]),D=!!(N&&Array.isArray(N)&&N[1]);!I||I&&D?h?.([t.toString(),""]):I&&!D&&(t<N[0]?h?.([t.toString(),N[0].toString()]):h?.([N[0].toString(),t.toString()]));}else h?.(t.toString());},[o,N,h]);return n?jsx(qr,{month:w,year:S,minDate:a,maxDate:c,selectedDate:N,onSelectDate:_,onChangeMonth:P,onChangeYear:v}):o?jsx(da,{range:true,value:r,onChange:h,...y}):jsx(ua,{value:r,onChange:h,minDate:a,maxDate:c,month:w,year:S,selectedDate:N,onChangeMonth:P,onChangeYear:v,onSelectDate:_,formatStr:i,...y})},"DatePicker"),da=a(({minDate:r,maxDate:o,value:n,onChange:a})=>null,"DatePickerGroupInput"),ua=a(({placeholder:r,value:o,onChange:n,inputProps:a,...c})=>{let[i,h]=useState(false),y$1=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:i,onClickOutside:()=>h(false),content:jsx(pb,{children:jsx(qr,{...c})}),containerStyle:{zIndex:`${y$1.zIndex.popover}`},children:jsx("div",{onClick:()=>h(true),children:jsx(kb,{...a,placeholder:r,value:la(o,c.formatStr),onChange:w=>n?.(w.target.value)})})})},"DatePickerInput"),qr=a(({month:r,year:o,selectedDate:n,minDate:a,maxDate:c,onSelectDate:i,onChangeMonth:h,onChangeYear:y})=>{let w=useMemo(()=>new Array(12).fill(null).map((p,L)=>{let C=new Date(0,L);return {value:L+1,inputDisplay:format(C,"MMMM")}}),[]),P=useMemo(()=>{let p=getYear(a),C=getYear(c)-p+1;return new Array(C).fill(null).map((M,F)=>{let $=p+F;return {value:$,inputDisplay:$.toString()}})},[a,c]),S=useMemo(()=>new Array(7).fill(null).map((p,L)=>{let C=startOfWeek(new Date,{weekStartsOn:L});return format(C,"EEE")}),[]),v=useMemo(()=>{let p=startOfMonth(new Date(o,r)),L=endOfMonth(new Date(o,r)),C=getDay(p)===0?p:previousSunday(p),M=getDay(L)===6?L:nextSaturday(L),F=differenceInDays(M,C),$=differenceInDays(p,C);return new Array(F+1).fill(null).map((te,re)=>new Date(o,r,re-$+1))},[r,o]),N=useCallback(()=>{r===0?(y(o-1),h(11)):h(r-1);},[r,o]),_=useCallback(()=>{r===11?(y(o+1),h(0)):h(r+1);},[r,o]),t=useMemo(()=>a?!(o<getYear(a)||o===getYear(a)&&r<=getMonth(a)):true,[r,o,a]),I=useMemo(()=>c?!(o>getYear(c)||o===getYear(c)&&r>=getMonth(c)):true,[r,o,c]),D=useCallback(p=>{p.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:D,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:N}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(ib,{placeholder:"",hasBorder:false,selected:r+1,options:w,onSelect:p=>h(p-1),maxWidth:150,maxHeight:300}),jsx(ib,{placeholder:"",hasBorder:false,selected:o,options:P,onSelect:p=>y(p),maxWidth:100,maxHeight:300})]}),I&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:_})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:S.map(p=>jsx("div",{className:"text-center",children:p},p))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:v.map(p=>{let L=getMonth(p)===r,C=format(p,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),M=n&&(Array.isArray(n)&&(n[0]&&format(p,"yyyy-MM-dd")===format(n[0],"yyyy-MM-dd")||n[1]&&format(p,"yyyy-MM-dd")===format(n[1],"yyyy-MM-dd"))||!Array.isArray(n)&&format(p,"yyyy-MM-dd")===format(n,"yyyy-MM-dd")),F=n&&Array.isArray(n)&&n[0]&&n[1]&&p>n[0]&&p<n[1],$=a&&differenceInDays(p,a)<0||c&&differenceInDays(p,c)>0||!L;return jsx(pa,{date:p,isCurrentMonth:L,isCurrentDay:C,isSelected:!!M,isInRange:!!F,isDisabled:!!$,onSelectDate:i},p.toISOString())})})]})},"DatePickerCalendar"),pa=a(({date:r,isCurrentMonth:o,isCurrentDay:n,isSelected:a$1,isInRange:c,isDisabled:i,onSelectDate:h})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${i?"text-gray-400 cursor-not-allowed":a$1?"bg-blue-500 text-white":c?"bg-blue-100":n?"text-blue-500":o?"text-black":"text-gray-400"} ${i?"":a$1?"hover:bg-blue-600":"hover:bg-gray-100"}`,onClick:a(w=>{i||h(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var ga=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"),ma=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"),ba=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),Gr=a(({id:r,color:o="default",message:n,duration:a,transitionDirection:c,cancelable:i=true,onClose:h})=>{let[y,w]=useState(false),[P,S]=useState(false),v=useRef(null),N=useCallback(()=>{w(true),v.current=setTimeout(()=>{h(r);},300);},[r,h]);return useEffect(()=>{if(S(true),a&&a<1/0){let _=setTimeout(()=>{N();},a);return ()=>clearTimeout(_)}},[a,N]),useEffect(()=>()=>{v.current&&clearTimeout(v.current);},[]),jsx("div",{className:`max-w-xs
275
+ animation: ${Wn} 0.6s linear infinite;
276
+ `);var Br=memo(a(function({extension:o,blob:n,path:a,buffer:s,stream:i,csvLabels:h,onCsvRetry:b,not_supported_message:v=" Sorry, this file type isn\u2019t supported yet."}){let P=o.toLocaleLowerCase().trim(),D;if(a?D=a:n&&(D=URL.createObjectURL(n)),["csv","tsv"].includes(P))return jsx(jt,{url:D,blob:n,stream:i,labels:h,onRetry:b});if(D){if(["jpeg","jpg","png","gif","bmp","webp"].includes(P))return jsx(pr,{url:D});if(["mp3","wav","ogg","flac"].includes(P))return jsx(fr,{url:D});if(["mp4","webm"].includes(P))return jsx(Cr,{url:D});if(o==="pdf")return jsx(Nt,{url:D});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(P))return jsx(Sr,{url:D,extension:P})}return P==="docx"?jsx(yr,{url:D,blob:n}):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:v})})})},"Driver"));var Bd=a(r=>jsx("div",{className:"h-full w-full",children:jsx(Br,{...r})}),"FileViewer");var Hr=250,Zd=a(({text:r,speed:o=50,onDone:n,markdown:a$1=false,markdownComponents:s={},className:i,...h})=>{let[b,v]=useState(""),P=useRef(null),D=useRef(null);return useEffect(()=>{let x=false;if(o>0){v(""),P.current=performance.now();let N=a(z=>{if(x||!P.current)return;let t=z-P.current,I=t/o>Hr?o/2:o,w=t/o>Hr?1.5:1,d=Math.floor(t/I*w);if(d>=r.length){v(r),x=true,n?.();return}v(r.slice(0,d)),D.current=requestAnimationFrame(N);},"tick");D.current=requestAnimationFrame(N);}else v(r),n?.();return ()=>{D.current&&cancelAnimationFrame(D.current);}},[r,o,n]),a$1?jsx("div",{className:i,children:jsx(dn,{remarkPlugins:[un],components:s,...h,children:b})}):jsx(Ya,{className:i,...h,children:b})},"Typewriter");var ta={timeout:2e3,message:"Copied!"},cu=a(({text:r,children:o,format:n="text/plain",tooltip:a$1,positions:s=["top"],className:i})=>{let[h,b]=useState(false),v=useRef(null),P={...ta,...a$1},D=Array.isArray(s)?s[0]:s,x=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):Zn(r,{format:n}),b(true),v.current&&clearTimeout(v.current),v.current=setTimeout(()=>b(false),P.timeout);},"handleCopy");return useEffect(()=>()=>{v.current&&clearTimeout(v.current);},[]),jsx(Popover,{padding:6,positions:s,isOpen:h,align:"center",onClickOutside:()=>b(false),content:!!a$1?.message&&jsx(Cb,{className:i,$position:D,$offset:6,children:a$1.message}),containerStyle:{zIndex:"9999"},children:jsx("div",{className:"inline-block",onMouseLeave:()=>b(false),children:o({copy:x})})})},"CopyToClipboard");var Wr=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),St=a((r,o)=>{let n;if(o){let s=parse(r||"",o,new Date);if(isValid(s)&&getYear(s)>=1970)return s}let a=new Date(r||"");return isNaN(a.getTime())?n:a},"parseDate"),da=a((r,o)=>{let n=r?St(r,o):void 0;return n&&o?format(n,o):r},"renderDate"),xu=a(({value:r,range:o,inline:n=false,minDate:a=new Date(getYear(new Date)-5,0,1),maxDate:s=new Date(getYear(new Date)+5,11,31),format:i="dd.MM.yyyy",onChange:h,...b})=>{let[v,P]=useState(getMonth(Wr(r))),[D,x]=useState(getYear(Wr(r))),N=useMemo(()=>{if(r){if(Array.isArray(r)){let t=St(r[0],i),I=St(r[1],i);return [t,I]}return St(r,i)}},[r]),z=useCallback(t=>{if(o){let I=!!(N&&Array.isArray(N)&&N[0]),w=!!(N&&Array.isArray(N)&&N[1]);!I||I&&w?h?.([t.toString(),""]):I&&!w&&(t<N[0]?h?.([t.toString(),N[0].toString()]):h?.([N[0].toString(),t.toString()]));}else h?.(t.toString());},[o,N,h]);return n?jsx(Xr,{month:v,year:D,minDate:a,maxDate:s,selectedDate:N,onSelectDate:z,onChangeMonth:P,onChangeYear:x}):o?jsx(ua,{range:true,value:r,onChange:h,...b}):jsx(pa,{value:r,onChange:h,minDate:a,maxDate:s,month:v,year:D,selectedDate:N,onChangeMonth:P,onChangeYear:x,onSelectDate:z,formatStr:i,...b})},"DatePicker"),ua=a(({minDate:r,maxDate:o,value:n,onChange:a})=>null,"DatePickerGroupInput"),pa=a(({placeholder:r,value:o,onChange:n,inputProps:a,...s})=>{let[i,h]=useState(false),b=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:i,onClickOutside:()=>h(false),content:jsx(pb,{children:jsx(Xr,{...s})}),containerStyle:{zIndex:`${b.zIndex.popover}`},children:jsx("div",{onClick:()=>h(true),children:jsx(kb,{...a,placeholder:r,value:da(o,s.formatStr),onChange:v=>n?.(v.target.value)})})})},"DatePickerInput"),Xr=a(({month:r,year:o,selectedDate:n,minDate:a,maxDate:s,onSelectDate:i,onChangeMonth:h,onChangeYear:b})=>{let v=useMemo(()=>new Array(12).fill(null).map((d,E)=>{let C=new Date(0,E);return {value:E+1,inputDisplay:format(C,"MMMM")}}),[]),P=useMemo(()=>{let d=getYear(a),C=getYear(s)-d+1;return new Array(C).fill(null).map((M,F)=>{let H=d+F;return {value:H,inputDisplay:H.toString()}})},[a,s]),D=useMemo(()=>new Array(7).fill(null).map((d,E)=>{let C=startOfWeek(new Date,{weekStartsOn:E});return format(C,"EEE")}),[]),x=useMemo(()=>{let d=startOfMonth(new Date(o,r)),E=endOfMonth(new Date(o,r)),C=getDay(d)===0?d:previousSunday(d),M=getDay(E)===6?E:nextSaturday(E),F=differenceInDays(M,C),H=differenceInDays(d,C);return new Array(F+1).fill(null).map((te,re)=>new Date(o,r,re-H+1))},[r,o]),N=useCallback(()=>{r===0?(b(o-1),h(11)):h(r-1);},[r,o]),z$1=useCallback(()=>{r===11?(b(o+1),h(0)):h(r+1);},[r,o]),t=useMemo(()=>a?!(o<getYear(a)||o===getYear(a)&&r<=getMonth(a)):true,[r,o,a]),I=useMemo(()=>s?!(o>getYear(s)||o===getYear(s)&&r>=getMonth(s)):true,[r,o,s]),w=useCallback(d=>{d.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:w,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:N}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(ib,{placeholder:"",hasBorder:false,selected:r+1,options:v,onSelect:d=>h(d-1),maxWidth:150,maxHeight:300}),jsx(ib,{placeholder:"",hasBorder:false,selected:o,options:P,onSelect:d=>b(d),maxWidth:100,maxHeight:300})]}),I&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:z$1})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:D.map(d=>jsx("div",{className:"text-center",children:d},d))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:x.map(d=>{let E=getMonth(d)===r,C=format(d,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),M=n&&(Array.isArray(n)&&(n[0]&&format(d,"yyyy-MM-dd")===format(n[0],"yyyy-MM-dd")||n[1]&&format(d,"yyyy-MM-dd")===format(n[1],"yyyy-MM-dd"))||!Array.isArray(n)&&format(d,"yyyy-MM-dd")===format(n,"yyyy-MM-dd")),F=n&&Array.isArray(n)&&n[0]&&n[1]&&d>n[0]&&d<n[1],H=a&&differenceInDays(d,a)<0||s&&differenceInDays(d,s)>0||!E;return jsx(ha,{date:d,isCurrentMonth:E,isCurrentDay:C,isSelected:!!M,isInRange:!!F,isDisabled:!!H,onSelectDate:i},d.toISOString())})})]})},"DatePickerCalendar"),ha=a(({date:r,isCurrentMonth:o,isCurrentDay:n,isSelected:a$1,isInRange:s,isDisabled:i,onSelectDate:h})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${i?"text-gray-400 cursor-not-allowed":a$1?"bg-blue-500 text-white":s?"bg-blue-100":n?"text-blue-500":o?"text-black":"text-gray-400"} ${i?"":a$1?"hover:bg-blue-600":"hover:bg-gray-100"}`,onClick:a(v=>{i||h(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var ma=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"),ba=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"),ya=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),Vr=a(({id:r,color:o="default",message:n,duration:a,transitionDirection:s,cancelable:i=true,onClose:h})=>{let[b,v]=useState(false),[P,D]=useState(false),x=useRef(null),N=useCallback(()=>{v(true),x.current=setTimeout(()=>{h(r);},300);},[r,h]);return useEffect(()=>{if(D(true),a&&a<1/0){let z=setTimeout(()=>{N();},a);return ()=>clearTimeout(z)}},[a,N]),useEffect(()=>()=>{x.current&&clearTimeout(x.current);},[]),jsx("div",{className:`max-w-xs
277
277
  border
278
278
  w-full
279
279
  text-sm
@@ -281,8 +281,8 @@ self.onmessage = async (e) => {
281
281
  transition-all
282
282
  ease-in-out
283
283
  duration-300
284
- ${y||!P?"opacity-0":"opacity-100"}
285
- ${P?"translate-y-0":ba(c)}
286
- ${ga(o)} ${ma(o)}`,children:jsxs("div",{className:"flex p-4",style:{wordBreak:"break-word"},children:[n,i&&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:N,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 va=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"),Iu=a(({items:r,onClose:o,position:n="top-right",offset:a=4})=>{let c=useMemo(()=>n.startsWith("top")?"top":"bottom",[n]);return jsx("div",{className:`fixed flex min-w-0 max-w-xs w-full flex-col z-50 gap-2 ${va(n,a)}`,children:r.map(i=>jsx(Gr,{transitionDirection:c,...i,onClose:o},i.id))})},"ToastsList");var Hu=a(({onChange:r,disabled:o,multiple:n,dragText:a$1="Drop file to upload",className:c})=>{let[i,h]=useState(false),[y,w]=useState(false),[P,S]=useState(false);return useEffect(()=>{if(o)return;let v=0,N=a(D=>{D.preventDefault(),v++,v===1&&h(true);},"handleDragEnter"),_=a(D=>{D.preventDefault(),v--,v===0&&h(false);},"handleDragLeave"),t=a(D=>{D.preventDefault();},"handleDragOver"),I=a(async D=>{if(D.preventDefault(),v=0,h(false),!y)try{w(!0);let p=await lb(D.dataTransfer.items);r(n?p:p.length>0?[p[0]]:[]);}catch(p){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:",p);}finally{w(false);}},"handleDrop");return document.addEventListener("dragenter",N),document.addEventListener("dragleave",_),document.addEventListener("dragover",t),document.addEventListener("drop",I),()=>{document.removeEventListener("dragenter",N),document.removeEventListener("dragleave",_),document.removeEventListener("dragover",t),document.removeEventListener("drop",I);}},[o,y,n,r]),useEffect(()=>{S(true);},[]),P&&i?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 ${c}`,children:jsx(Ya,{variant:"h3",className:"px-3 py-2 bg-white rounded-md border border-gray-200",children:a$1})}),document.body):null},"GlobalDropZone");
287
- export{uc as Container,iu as CopyToClipboard,vu as DatePicker,qr as DatePickerCalendar,Ad as FileViewer,Vc as FullscreenCard,Hu as GlobalDropZone,$o as Graph2D,Gs as PageContent,Xs as PageLayout,bc as SplitterLayout,co as Styled,ro as StyledContainer,ao as StyledMain,ec as SubNav,Iu as ToastsList,Vd as Typewriter};//# sourceMappingURL=index.mjs.map
284
+ ${b||!P?"opacity-0":"opacity-100"}
285
+ ${P?"translate-y-0":ya(s)}
286
+ ${ma(o)} ${ba(o)}`,children:jsxs("div",{className:"flex p-4",style:{wordBreak:"break-word"},children:[n,i&&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:N,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 wa=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"),zu=a(({items:r,onClose:o,position:n="top-right",offset:a=4})=>{let s=useMemo(()=>n.startsWith("top")?"top":"bottom",[n]);return jsx("div",{className:`fixed flex min-w-0 max-w-xs w-full flex-col z-50 gap-2 ${wa(n,a)}`,children:r.map(i=>jsx(Vr,{transitionDirection:s,...i,onClose:o},i.id))})},"ToastsList");var Xu=a(({onChange:r,disabled:o,multiple:n,dragText:a$1="Drop file to upload",className:s})=>{let[i,h]=useState(false),[b,v]=useState(false),[P,D]=useState(false);return useEffect(()=>{if(o)return;let x=0,N=a(w=>{w.preventDefault(),x++,x===1&&h(true);},"handleDragEnter"),z=a(w=>{w.preventDefault(),x--,x===0&&h(false);},"handleDragLeave"),t=a(w=>{w.preventDefault();},"handleDragOver"),I=a(async w=>{if(w.preventDefault(),x=0,h(false),!b)try{v(!0);let d=await lb(w.dataTransfer.items);r(n?d:d.length>0?[d[0]]:[]);}catch(d){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:",d);}finally{v(false);}},"handleDrop");return document.addEventListener("dragenter",N),document.addEventListener("dragleave",z),document.addEventListener("dragover",t),document.addEventListener("drop",I),()=>{document.removeEventListener("dragenter",N),document.removeEventListener("dragleave",z),document.removeEventListener("dragover",t),document.removeEventListener("drop",I);}},[o,b,n,r]),useEffect(()=>{D(true);},[]),P&&i?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 ${s}`,children:jsx(Ya,{variant:"h3",className:"px-3 py-2 bg-white rounded-md border border-gray-200",children:a$1})}),document.body):null},"GlobalDropZone");
287
+ export{pc as Container,cu as CopyToClipboard,xu as DatePicker,Xr as DatePickerCalendar,Bd as FileViewer,Gc as FullscreenCard,Xu as GlobalDropZone,Fo as Graph2D,Zs as PageContent,qs as PageLayout,yc as SplitterLayout,so as Styled,to as StyledContainer,no as StyledMain,tc as SubNav,zu as ToastsList,Zd as Typewriter};//# sourceMappingURL=index.mjs.map
288
288
  //# sourceMappingURL=index.mjs.map