@cyber-harbour/ui 2.2.12 → 2.2.13

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 as Pa$1,Ya,ma,ra,pb,Cb,y,kb,G,ib,H,lb}from'./chunk-2JO77E5F.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-2JO77E5F.mjs';import xo,{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 No from'lodash.clonedeep';import {scaleOrdinal,schemeCategory10,forceSimulation,forceLink,forceManyBody,forceX,forceY,forceCenter,forceCollide}from'd3';import wo from'react-content-loader';import {renderAsync}from'docx-preview';import tn from'lodash.throttle';import nn from'@uiw/react-codemirror';import {vscodeDark,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 mn from'react-markdown';import bn from'remark-gfm';import {TableVirtuoso}from'react-virtuoso';import Bt from'papaparse';import oa 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 Ks=a(({children:r,className:o})=>jsx(oo,{className:o,children:r}),"PageLayout"),oo=styled.div`
1
+ import {a,w,x,u,c,l,z,Pa as Pa$1,Ya,ma,ra,pb,Cb,y,kb,G,ib,H,lb}from'./chunk-M52OIWPI.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-M52OIWPI.mjs';import xo,{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 No from'lodash.clonedeep';import {scaleOrdinal,schemeCategory10,forceSimulation,forceLink,forceManyBody,forceX,forceY,forceCenter,forceCollide}from'd3';import wo from'react-content-loader';import {renderAsync}from'docx-preview';import tn from'lodash.throttle';import nn from'@uiw/react-codemirror';import {vscodeDark,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 mn from'react-markdown';import bn from'remark-gfm';import {TableVirtuoso}from'react-virtuoso';import Bt from'papaparse';import oa 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 Ks=a(({children:r,className:o})=>jsx(oo,{className:o,children:r}),"PageLayout"),oo=styled.div`
2
2
  display: grid;
3
3
  min-height: 100dvh;
4
4
  position: relative;
@@ -63,7 +63,7 @@ ${r?`
63
63
  `:""}
64
64
 
65
65
  min-width: 0;
66
- `);var Go=[.1,.25,.5,.75,1,1.5,2,3,4,5],Ko=5,Jo=.1,Qo=140;function mt(r,o,n,a){return {x:r<n?(n-r)/2:0,y:o<a?(a-o)/2:0}}a(mt,"computePadding");var br=a(({url:r,alt:o="image",naturalWidth:n,naturalHeight:a$1,zoomSteps:d=Go,maxZoom:s=Ko,minZoom:h=Jo,showMinimap:x=true,minimapWidth:k=Qo,className:N,onZoomChange:M})=>{let[f,L]=useState("adaptive"),[B,t]=useState(1),[I,S]=useState(false),p=useRef(false),[F,P]=useState(false),[T,$]=useState(false),[Y,ne]=useState({left:0,top:0}),re=useRef(0),[se,ye]=useState({width:0,height:0}),le=useRef({width:0,height:0}),we=useRef(null),ve=useRef(null),q=useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),H=useRef(f),V=useRef(B),W=useRef(M);H.current=f,V.current=B,W.current=M;let Z=n||le.current.width,oe=a$1||le.current.height,ae=useMemo(()=>[...d].sort((y,C)=>y-C),[d]),X=useCallback(()=>se.width===0||Z===0?1:Math.min(se.width/Z,se.height/oe,1),[se,Z,oe]),Q=useCallback((y,C)=>{if(C==="in"){let z=ae.find(j=>j>y+.001);return z!==void 0?Math.min(z,s):y}let A=ae.findLast(z=>z<y-.001);return A!==void 0?Math.max(A,h):y},[ae,s,h]),de=useCallback(()=>H.current==="adaptive"?X():V.current,[X]),ce=useCallback(y=>{L("manual"),t(y),W.current?.(y,"manual");},[]),ue=useCallback(()=>{L("adaptive"),W.current?.(X(),"adaptive");},[X]),Se=useCallback(y=>{requestAnimationFrame(()=>{let C=ve.current;if(!C)return;let A=C.getBoundingClientRect(),z=Z*y,j=oe*y,v=mt(z,j,A.width,A.height);C.scrollLeft=z/2+v.x-A.width/2,C.scrollTop=j/2+v.y-A.height/2;});},[Z,oe]);useEffect(()=>{L("adaptive"),t(1),P(false),$(false),le.current={width:0,height:0};},[r]),useEffect(()=>{let y=ve.current;if(!y)return;let C=new ResizeObserver(A=>{let z=A[0];if(!z)return;let{width:j,height:v}=z.contentRect;ye(O=>O.width===j&&O.height===v?O:{width:j,height:v});});return C.observe(y),()=>C.disconnect()},[]),useEffect(()=>{let y=ve.current;if(!y)return;let C=a(()=>{cancelAnimationFrame(re.current),re.current=requestAnimationFrame(()=>{let A=y.scrollLeft,z=y.scrollTop;ne(j=>j.left===A&&j.top===z?j:{left:A,top:z});});},"handleScroll");return y.addEventListener("scroll",C,{passive:true}),()=>{y.removeEventListener("scroll",C),cancelAnimationFrame(re.current);}},[]),useEffect(()=>{let y=ve.current;if(!y||!F)return;let C=a(A=>{if(!(A.ctrlKey||A.metaKey))return;A.preventDefault();let z=de(),j=A.deltaY>0?"out":"in",v=Q(z,j),O=X();if(j==="out"&&v<=O){ue();return}let R=y.getBoundingClientRect(),G,K,ee=le.current.width||1,me=le.current.height||1;if(H.current==="adaptive"){let pe=we.current;if(!pe)return;let he=pe.getBoundingClientRect();G=(A.clientX-he.left)/(he.width/ee),K=(A.clientY-he.top)/(he.height/me);}else {let pe=ee*z,he=me*z,He=mt(pe,he,R.width,R.height);G=(y.scrollLeft+A.clientX-R.left-He.x)/z,K=(y.scrollTop+A.clientY-R.top-He.y)/z;}ce(v),requestAnimationFrame(()=>{let pe=y.getBoundingClientRect(),he=mt(ee*v,me*v,pe.width,pe.height);y.scrollLeft=G*v+he.x-(A.clientX-pe.left),y.scrollTop=K*v+he.y-(A.clientY-pe.top);});},"handleWheel");return y.addEventListener("wheel",C,{passive:false}),()=>y.removeEventListener("wheel",C)},[F,de,Q,X,ce,ue]),useEffect(()=>{if(f!=="manual")return;let y=ve.current;if(!y)return;let C=a(j=>{j.button===0&&(j.preventDefault(),p.current=true,S(true),q.current={x:j.clientX,y:j.clientY,scrollLeft:y.scrollLeft,scrollTop:y.scrollTop});},"handleMouseDown"),A=a(j=>{if(!p.current)return;let{x:v,y:O,scrollLeft:R,scrollTop:G}=q.current;y.scrollLeft=R-(j.clientX-v),y.scrollTop=G-(j.clientY-O);},"handleMouseMove"),z=a(()=>{p.current=false,S(false);},"handleMouseUp");return y.addEventListener("mousedown",C),window.addEventListener("mousemove",A),window.addEventListener("mouseup",z),()=>{y.removeEventListener("mousedown",C),window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",z);}},[f]);let _e=useCallback(()=>{f==="manual"&&ue();},[f,ue]),qe=useCallback(()=>{let y=de(),C=Q(y,"in");C!==y&&(ce(C),Se(C));},[de,Q,ce,Se]),Ee=useCallback(()=>{let y=de(),C=Q(y,"out");if(C<=X()){ue();return}ce(C),Se(C);},[de,Q,X,ue,ce,Se]),Fe=useCallback(()=>{ce(1),Se(1);},[ce,Se]),Ce=useCallback(()=>{let y=we.current;y&&(le.current={width:y.naturalWidth,height:y.naturalHeight},P(true),$(false));},[]),Me=f==="adaptive"?X():B,Ne=Z*Me,Ue=oe*Me,Be=se.width,et=se.height,Oe=f==="manual"?mt(Ne,Ue,Be,et):{x:0,y:0},Lt=x&&f==="manual"&&(Ne>Be||Ue>et),e=Z>0?k/Z:0,l=oe*e,c=Be>0?Be/B*e:0,u=et>0?et/B*e:0,g=Math.max(0,Y.left-Oe.x)/B*e,w=Math.max(0,Y.top-Oe.y)/B*e,m=f==="adaptive"?"Fit":`${Math.round(B*100)}%`,b=Q(Me,"in")!==Me,D=f==="manual"||Me>h,E=f==="adaptive"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{width:Ne,height:Ue,maxWidth:"none",maxHeight:"none",marginLeft:Oe.x,marginTop:Oe.y,flexShrink:0},_={cursor:f==="manual"?I?"grabbing":"grab":"default"};return jsxs("div",{className:`h-full w-full flex flex-col min-h-0 min-w-0 overflow-hidden ${N??""}`,children:[jsxs("div",{className:"flex w-full items-center px-8.5 py-3 gap-1 shrink-0",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa$1,{style:{width:20,height:20}}),onClick:Ee,disabled:!D,p:7,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700! h-[38px]!"}),jsx("button",{type:"button",onClick:f==="manual"?ue:void 0,className:"flex items-center justify-center bg-white dark:bg-neutral-800 h-[38px] min-w-16 px-3 select-none border border-gray-300 dark:border-neutral-600 rounded-md","aria-label":m,children:jsx(Ya,{style:{fontSize:12,fontWeight:500},children:m})}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma,{style:{width:14,height:14}}),onClick:qe,disabled:!b,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700! h-[38px]!",p:10}),jsx(z,{variant:"outlined","aria-label":"fit-to-container",size:"small",color:f==="adaptive"?"primary":"default",icon:jsx(ra,{style:{width:14,height:14}}),onClick:ue,className:`${f==="adaptive"?"bg-blue-50!":"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!"} ml-auto h-[38px]!`,p:10}),jsx(z,{variant:"outlined","aria-label":"original-size",size:"small",color:f==="manual"&&B===1?"primary":"default",onClick:Fe,className:`${f==="manual"&&B===1?"bg-blue-50!":"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!"} h-[38px]!`,py:10,px:11,children:jsx(Ya,{style:{fontSize:12,fontWeight:500,lineHeight:1},children:"1:1"})})]}),jsxs("div",{className:"flex-1 min-h-0 min-w-0 relative",children:[jsx("div",{ref:ve,className:`h-full w-full ${f==="adaptive"?"flex items-center justify-center overflow-hidden":"overflow-auto"}`,style:_,onDoubleClick:_e,children:T?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx(Ya,{color:"text.lighter",children:"Failed to load image"})}):jsx("img",{ref:we,src:r,alt:o,draggable:false,className:"block select-none",style:E,onLoad:Ce,onError:()=>$(true)})}),Lt&&jsxs("div",{className:"absolute bottom-3 right-3 rounded-lg overflow-hidden shadow-lg pointer-events-none",style:{width:k,height:l,backdropFilter:"blur(8px)",background:"rgba(255,255,255,0.75)"},children:[jsx("img",{src:r,alt:"",draggable:false,className:"block w-full h-full object-contain"}),jsx("div",{className:"absolute border-2 border-blue-500 rounded-sm",style:{width:Math.min(c,k),height:Math.min(u,l),left:Math.max(0,Math.min(g,k-c)),top:Math.max(0,Math.min(w,l-u)),background:"rgba(59,130,246,0.1)"}})]})]})]})},"ImageDriver");var yr=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 zt=a(({url:r})=>{let[o,n]=useState(null),[a$1,d]=useState(false),[s,h]=useState(true),[x,k]=useState(null);return useEffect(()=>{d(true);},[]),useEffect(()=>{if(!a$1)return;a(async()=>{try{let M=await import('./PdfDriver-JSG62TPD.mjs');n(()=>M.PdfDriver),h(!1);}catch(M){console.error("Failed to load PDF driver:",M),k("Failed to load PDF viewer"),h(false);}},"loadPdfDriver")();},[a$1]),a$1?s?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500 dark:text-gray-400",children:"Loading PDF viewer..."})}):x||!o?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-red-500 text-center",children:jsx("p",{children:x||"PDF viewer unavailable"})})}):jsx(o,{url:r}):jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500 dark:text-gray-400",children:"Loading PDF viewer..."})})},"PdfDriverWrapper");var kr=50,rn=1e4,Sr=a(({url:r,blob:o})=>{let n=useRef(null),a$1=useRef(null),[d,s]=useState(null),[h,x]=useState(true),[k,N]=useState(1),M=useRef(false),[f,L]=useState({width:0,height:0}),B=useRef(0),t=a(()=>{M.current=true,N(S=>Math.min(S+.25,4));},"handleZoomIn"),I=a(()=>{M.current=true,N(S=>Math.max(S-.25,.25));},"handleZoomOut");return useEffect(()=>{a(async()=>{if(a$1.current)try{x(!0),s(null);let p=o;if(!p&&r&&(p=await(await fetch(r)).blob()),!p){s("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(p.size/(1024*1024)>kr){s(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${kr} \u041C\u0411)`);return}a$1.current.innerHTML="";let P=renderAsync(p,a$1.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0,breakPages:!0,ignoreLastRenderedPageBreak:!1}),T=new Promise((Y,ne)=>setTimeout(()=>ne(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")),rn));await Promise.race([P,T]),await new Promise(Y=>requestAnimationFrame(Y));let $=a$1.current.querySelector(".docx-wrapper");if($&&(B.current=$.offsetWidth,L({width:$.offsetWidth,height:$.offsetHeight})),n.current&&B.current>0){let Y=n.current.clientWidth,ne=Math.min(Y/B.current,1);N(ne);}x(!1);}catch(p){s(p?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),x(false);}},"renderDocument")();},[r,o]),useEffect(()=>{if(!n.current)return;let S=tn(F=>{if(!(M.current||B.current===0))for(let P of F){let T=P.contentRect.width,$=Math.min(T/B.current,1);N($);}},150),p=new ResizeObserver(S);return p.observe(n.current),()=>{p.disconnect(),S.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 dark:border-neutral-700",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa$1,{style:{width:20,height:20}}),onClick:I,disabled:k<=.25,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!",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(k*100),"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma,{style:{width:14,height:14}}),onClick:t,disabled:k>=4,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!",p:10})]}),!!d&&!h&&jsx("div",{className:"text-red-500 p-8",children:d}),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 bg-gray-400 dark:bg-neutral-700 [&::-webkit-scrollbar-thumb]:bg-gray-100 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-600 [&::-webkit-scrollbar-track]:bg-gray-400 dark:[&::-webkit-scrollbar-track]:bg-neutral-700",style:{scrollbarGutter:"stable both-edges"},children:jsx("div",{style:{width:f.width>0?f.width*k:void 0,height:f.height>0?f.height*k:void 0,overflow:"hidden",margin:"0 auto"},children:jsx("div",{ref:a$1,className:`[&>div.docx-wrapper_table_*]:wrap-break-word!
66
+ `);var Go=[.1,.25,.5,.75,1,1.5,2,3,4,5],Ko=5,Jo=.1,Qo=140;function mt(r,o,n,a){return {x:r<n?(n-r)/2:0,y:o<a?(a-o)/2:0}}a(mt,"computePadding");var br=a(({url:r,alt:o="image",naturalWidth:n,naturalHeight:a$1,zoomSteps:d=Go,maxZoom:s=Ko,minZoom:h=Jo,showMinimap:x=true,minimapWidth:k=Qo,className:N,onZoomChange:M})=>{let[f,L]=useState("adaptive"),[B,t]=useState(1),[I,S]=useState(false),p=useRef(false),[F,P]=useState(false),[T,$]=useState(false),[Y,ne]=useState({left:0,top:0}),re=useRef(0),[se,ye]=useState({width:0,height:0}),le=useRef({width:0,height:0}),we=useRef(null),ve=useRef(null),q=useRef({x:0,y:0,scrollLeft:0,scrollTop:0}),H=useRef(f),V=useRef(B),W=useRef(M);H.current=f,V.current=B,W.current=M;let Z=n||le.current.width,oe=a$1||le.current.height,ae=useMemo(()=>[...d].sort((y,C)=>y-C),[d]),X=useCallback(()=>se.width===0||Z===0?1:Math.min(se.width/Z,se.height/oe,1),[se,Z,oe]),Q=useCallback((y,C)=>{if(C==="in"){let z=ae.find(j=>j>y+.001);return z!==void 0?Math.min(z,s):y}let A=ae.findLast(z=>z<y-.001);return A!==void 0?Math.max(A,h):y},[ae,s,h]),de=useCallback(()=>H.current==="adaptive"?X():V.current,[X]),ce=useCallback(y=>{L("manual"),t(y),W.current?.(y,"manual");},[]),ue=useCallback(()=>{L("adaptive"),W.current?.(X(),"adaptive");},[X]),Se=useCallback(y=>{requestAnimationFrame(()=>{let C=ve.current;if(!C)return;let A=C.getBoundingClientRect(),z=Z*y,j=oe*y,v=mt(z,j,A.width,A.height);C.scrollLeft=z/2+v.x-A.width/2,C.scrollTop=j/2+v.y-A.height/2;});},[Z,oe]);useEffect(()=>{L("adaptive"),t(1),P(false),$(false),le.current={width:0,height:0};},[r]),useEffect(()=>{let y=ve.current;if(!y)return;let C=new ResizeObserver(A=>{let z=A[0];if(!z)return;let{width:j,height:v}=z.contentRect;ye(O=>O.width===j&&O.height===v?O:{width:j,height:v});});return C.observe(y),()=>C.disconnect()},[]),useEffect(()=>{let y=ve.current;if(!y)return;let C=a(()=>{cancelAnimationFrame(re.current),re.current=requestAnimationFrame(()=>{let A=y.scrollLeft,z=y.scrollTop;ne(j=>j.left===A&&j.top===z?j:{left:A,top:z});});},"handleScroll");return y.addEventListener("scroll",C,{passive:true}),()=>{y.removeEventListener("scroll",C),cancelAnimationFrame(re.current);}},[]),useEffect(()=>{let y=ve.current;if(!y||!F)return;let C=a(A=>{if(!(A.ctrlKey||A.metaKey))return;A.preventDefault();let z=de(),j=A.deltaY>0?"out":"in",v=Q(z,j),O=X();if(j==="out"&&v<=O){ue();return}let R=y.getBoundingClientRect(),G,K,ee=le.current.width||1,me=le.current.height||1;if(H.current==="adaptive"){let pe=we.current;if(!pe)return;let he=pe.getBoundingClientRect();G=(A.clientX-he.left)/(he.width/ee),K=(A.clientY-he.top)/(he.height/me);}else {let pe=ee*z,he=me*z,He=mt(pe,he,R.width,R.height);G=(y.scrollLeft+A.clientX-R.left-He.x)/z,K=(y.scrollTop+A.clientY-R.top-He.y)/z;}ce(v),requestAnimationFrame(()=>{let pe=y.getBoundingClientRect(),he=mt(ee*v,me*v,pe.width,pe.height);y.scrollLeft=G*v+he.x-(A.clientX-pe.left),y.scrollTop=K*v+he.y-(A.clientY-pe.top);});},"handleWheel");return y.addEventListener("wheel",C,{passive:false}),()=>y.removeEventListener("wheel",C)},[F,de,Q,X,ce,ue]),useEffect(()=>{if(f!=="manual")return;let y=ve.current;if(!y)return;let C=a(j=>{j.button===0&&(j.preventDefault(),p.current=true,S(true),q.current={x:j.clientX,y:j.clientY,scrollLeft:y.scrollLeft,scrollTop:y.scrollTop});},"handleMouseDown"),A=a(j=>{if(!p.current)return;let{x:v,y:O,scrollLeft:R,scrollTop:G}=q.current;y.scrollLeft=R-(j.clientX-v),y.scrollTop=G-(j.clientY-O);},"handleMouseMove"),z=a(()=>{p.current=false,S(false);},"handleMouseUp");return y.addEventListener("mousedown",C),window.addEventListener("mousemove",A),window.addEventListener("mouseup",z),()=>{y.removeEventListener("mousedown",C),window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",z);}},[f]);let _e=useCallback(()=>{f==="manual"&&ue();},[f,ue]),qe=useCallback(()=>{let y=de(),C=Q(y,"in");C!==y&&(ce(C),Se(C));},[de,Q,ce,Se]),Ee=useCallback(()=>{let y=de(),C=Q(y,"out");if(C<=X()){ue();return}ce(C),Se(C);},[de,Q,X,ue,ce,Se]),Fe=useCallback(()=>{ce(1),Se(1);},[ce,Se]),Ce=useCallback(()=>{let y=we.current;y&&(le.current={width:y.naturalWidth,height:y.naturalHeight},P(true),$(false));},[]),Me=f==="adaptive"?X():B,Ne=Z*Me,Ue=oe*Me,Be=se.width,et=se.height,Oe=f==="manual"?mt(Ne,Ue,Be,et):{x:0,y:0},Lt=x&&f==="manual"&&(Ne>Be||Ue>et),e=Z>0?k/Z:0,l=oe*e,c=Be>0?Be/B*e:0,u=et>0?et/B*e:0,g=Math.max(0,Y.left-Oe.x)/B*e,w=Math.max(0,Y.top-Oe.y)/B*e,m=f==="adaptive"?"Fit":`${Math.round(B*100)}%`,b=Q(Me,"in")!==Me,D=f==="manual"||Me>h,E=f==="adaptive"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{width:Ne,height:Ue,maxWidth:"none",maxHeight:"none",marginLeft:Oe.x,marginTop:Oe.y,flexShrink:0},_={cursor:f==="manual"?I?"grabbing":"grab":"default"};return jsxs("div",{className:`h-full w-full flex flex-col min-h-0 min-w-0 overflow-hidden ${N??""}`,children:[jsxs("div",{className:"flex w-full items-center px-8.5 py-3 gap-1 shrink-0",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa$1,{style:{width:20,height:20}}),onClick:Ee,disabled:!D,p:7,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700! h-[38px]!"}),jsx("button",{type:"button",onClick:f==="manual"?ue:void 0,className:"flex items-center justify-center bg-white dark:bg-neutral-800 h-[38px] min-w-16 px-3 select-none border border-gray-300 dark:border-neutral-600 rounded-md","aria-label":m,children:jsx(Ya,{style:{fontSize:12,fontWeight:500},children:m})}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma,{style:{width:14,height:14}}),onClick:qe,disabled:!b,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700! h-[38px]!",p:10}),jsx(z,{variant:"outlined","aria-label":"fit-to-container",size:"small",color:f==="adaptive"?"primary":"default",icon:jsx(ra,{style:{width:14,height:14}}),onClick:ue,className:`${f==="adaptive"?"bg-blue-50!":"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!"} ml-auto h-[38px]!`,p:10}),jsx(z,{variant:"outlined","aria-label":"original-size",size:"small",color:f==="manual"&&B===1?"primary":"default",onClick:Fe,className:`${f==="manual"&&B===1?"bg-blue-50!":"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!"} h-[38px]!`,py:10,px:11,children:jsx(Ya,{style:{fontSize:12,fontWeight:500,lineHeight:1},children:"1:1"})})]}),jsxs("div",{className:"flex-1 min-h-0 min-w-0 relative",children:[jsx("div",{ref:ve,className:`h-full w-full ${f==="adaptive"?"flex items-center justify-center overflow-hidden":"overflow-auto"}`,style:_,onDoubleClick:_e,children:T?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx(Ya,{color:"text.lighter",children:"Failed to load image"})}):jsx("img",{ref:we,src:r,alt:o,draggable:false,className:"block select-none",style:E,onLoad:Ce,onError:()=>$(true)})}),Lt&&jsxs("div",{className:"absolute bottom-3 right-3 rounded-lg overflow-hidden shadow-lg pointer-events-none",style:{width:k,height:l,backdropFilter:"blur(8px)",background:"rgba(255,255,255,0.75)"},children:[jsx("img",{src:r,alt:"",draggable:false,className:"block w-full h-full object-contain"}),jsx("div",{className:"absolute border-2 border-blue-500 rounded-sm",style:{width:Math.min(c,k),height:Math.min(u,l),left:Math.max(0,Math.min(g,k-c)),top:Math.max(0,Math.min(w,l-u)),background:"rgba(59,130,246,0.1)"}})]})]})]})},"ImageDriver");var yr=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 zt=a(({url:r})=>{let[o,n]=useState(null),[a$1,d]=useState(false),[s,h]=useState(true),[x,k]=useState(null);return useEffect(()=>{d(true);},[]),useEffect(()=>{if(!a$1)return;a(async()=>{try{let M=await import('./PdfDriver-DTZKADSW.mjs');n(()=>M.PdfDriver),h(!1);}catch(M){console.error("Failed to load PDF driver:",M),k("Failed to load PDF viewer"),h(false);}},"loadPdfDriver")();},[a$1]),a$1?s?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500 dark:text-gray-400",children:"Loading PDF viewer..."})}):x||!o?jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-red-500 text-center",children:jsx("p",{children:x||"PDF viewer unavailable"})})}):jsx(o,{url:r}):jsx("div",{className:"flex items-center justify-center h-full w-full",children:jsx("div",{className:"text-gray-500 dark:text-gray-400",children:"Loading PDF viewer..."})})},"PdfDriverWrapper");var kr=50,rn=1e4,Sr=a(({url:r,blob:o})=>{let n=useRef(null),a$1=useRef(null),[d,s]=useState(null),[h,x]=useState(true),[k,N]=useState(1),M=useRef(false),[f,L]=useState({width:0,height:0}),B=useRef(0),t=a(()=>{M.current=true,N(S=>Math.min(S+.25,4));},"handleZoomIn"),I=a(()=>{M.current=true,N(S=>Math.max(S-.25,.25));},"handleZoomOut");return useEffect(()=>{a(async()=>{if(a$1.current)try{x(!0),s(null);let p=o;if(!p&&r&&(p=await(await fetch(r)).blob()),!p){s("\u041D\u0435 \u043D\u0430\u0434\u0430\u043D\u043E \u0434\u043B\u044F DOCX \u0444\u0430\u0439\u043B\u0443");return}if(p.size/(1024*1024)>kr){s(`\u0424\u0430\u0439\u043B \u0437\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0438\u0439 (> ${kr} \u041C\u0411)`);return}a$1.current.innerHTML="";let P=renderAsync(p,a$1.current,void 0,{debug:!0,experimental:!0,hideWrapperOnPrint:!0,breakPages:!0,ignoreLastRenderedPageBreak:!1}),T=new Promise((Y,ne)=>setTimeout(()=>ne(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")),rn));await Promise.race([P,T]),await new Promise(Y=>requestAnimationFrame(Y));let $=a$1.current.querySelector(".docx-wrapper");if($&&(B.current=$.offsetWidth,L({width:$.offsetWidth,height:$.offsetHeight})),n.current&&B.current>0){let Y=n.current.clientWidth,ne=Math.min(Y/B.current,1);N(ne);}x(!1);}catch(p){s(p?.message||"\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 DOCX \u0444\u0430\u0439\u043B"),x(false);}},"renderDocument")();},[r,o]),useEffect(()=>{if(!n.current)return;let S=tn(F=>{if(!(M.current||B.current===0))for(let P of F){let T=P.contentRect.width,$=Math.min(T/B.current,1);N($);}},150),p=new ResizeObserver(S);return p.observe(n.current),()=>{p.disconnect(),S.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 dark:border-neutral-700",children:[jsx(z,{variant:"outlined","aria-label":"zoom-out",color:"default",size:"small",icon:jsx(Pa$1,{style:{width:20,height:20}}),onClick:I,disabled:k<=.25,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!",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(k*100),"%"]})]}),jsx(z,{variant:"outlined","aria-label":"zoom-in",size:"small",color:"default",icon:jsx(ma,{style:{width:14,height:14}}),onClick:t,disabled:k>=4,className:"bg-white! dark:bg-neutral-800! hover:bg-blue-50! dark:hover:bg-neutral-700!",p:10})]}),!!d&&!h&&jsx("div",{className:"text-red-500 p-8",children:d}),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 bg-gray-400 dark:bg-neutral-700 [&::-webkit-scrollbar-thumb]:bg-gray-100 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-600 [&::-webkit-scrollbar-track]:bg-gray-400 dark:[&::-webkit-scrollbar-track]:bg-neutral-700",style:{scrollbarGutter:"stable both-edges"},children:jsx("div",{style:{width:f.width>0?f.width*k:void 0,height:f.height>0?f.height*k: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!
@@ -273,7 +273,7 @@ self.onmessage = async (e) => {
273
273
  border-top-color: ${r.colors.text?.light};
274
274
  border-radius: 50%;
275
275
  animation: ${Gn} 0.6s linear infinite;
276
- `);var Wr=memo(a(function({extension:o,blob:n,path:a,buffer:d,stream:s,csvLabels:h,onCsvRetry:x,not_supported_message:k=" Sorry, this file type isn\u2019t supported yet."}){let N=o.toLocaleLowerCase().trim(),M;if(a?M=a:n&&(M=URL.createObjectURL(n)),["csv","tsv"].includes(N))return jsx($t,{url:M,blob:n,stream:s,labels:h,onRetry:x});if(M){if(["jpeg","jpg","png","gif","bmp","webp"].includes(N))return jsx(br,{url:M});if(["mp3","wav","ogg","flac"].includes(N))return jsx(yr,{url:M});if(["mp4","webm"].includes(N))return jsx(Er,{url:M});if(o==="pdf")return jsx(zt,{url:M});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(N))return jsx(Pr,{url:M,extension:N})}return N==="docx"?jsx(Sr,{url:M,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:k})})})},"Driver"));var Xd=a(r=>jsx("div",{className:"h-full w-full",children:jsx(Wr,{...r})}),"FileViewer");var Yr=250,ru=a(({text:r,speed:o=50,onDone:n,markdown:a$1=false,markdownComponents:d={},className:s,...h})=>{let[x,k]=useState(""),N=useRef(null),M=useRef(null);return useEffect(()=>{let f=false;if(o>0){k(""),N.current=performance.now();let L=a(B=>{if(f||!N.current)return;let t=B-N.current,I=t/o>Yr?o/2:o,S=t/o>Yr?1.5:1,p=Math.floor(t/I*S);if(p>=r.length){k(r),f=true,n?.();return}k(r.slice(0,p)),M.current=requestAnimationFrame(L);},"tick");M.current=requestAnimationFrame(L);}else k(r),n?.();return ()=>{M.current&&cancelAnimationFrame(M.current);}},[r,o,n]),a$1?jsx("div",{className:s,children:jsx(mn,{remarkPlugins:[bn],components:d,...h,children:x})}):jsx(Ya,{className:s,...h,children:x})},"Typewriter");var ca={timeout:2e3,message:"Copied!"},gu=a(({text:r,children:o,format:n="text/plain",tooltip:a$1,positions:d=["top"],className:s})=>{let[h,x]=useState(false),k=useRef(null),N={...ca,...a$1},M=Array.isArray(d)?d[0]:d,f=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):oa(r,{format:n}),x(true),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>x(false),N.timeout);},"handleCopy");return useEffect(()=>()=>{k.current&&clearTimeout(k.current);},[]),jsx(Popover,{padding:6,positions:d,isOpen:h,align:"center",onClickOutside:()=>x(false),content:!!a$1?.message&&jsx(Cb,{className:s,$position:M,$offset:6,children:a$1.message}),containerStyle:{zIndex:"9999"},children:jsx("div",{className:"inline-block",onMouseLeave:()=>x(false),children:o({copy:f})})})},"CopyToClipboard");var Ur=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),Rt=a((r,o)=>{let n;if(o){let d=parse(r||"",o,new Date);if(isValid(d)&&getYear(d)>=1970)return d}let a=new Date(r||"");return isNaN(a.getTime())?n:a},"parseDate"),ba=a((r,o)=>{let n=r?Rt(r,o):void 0;return n&&o?format(n,o):r},"renderDate"),Pu=a(({value:r,range:o,inline:n=false,minDate:a=new Date(getYear(new Date)-5,0,1),maxDate:d=new Date(getYear(new Date)+5,11,31),format:s="dd.MM.yyyy",onChange:h,...x})=>{let[k,N]=useState(getMonth(Ur(r))),[M,f]=useState(getYear(Ur(r))),L=useMemo(()=>{if(r){if(Array.isArray(r)){let t=Rt(r[0],s),I=Rt(r[1],s);return [t,I]}return Rt(r,s)}},[r]),B=useCallback(t=>{if(o){let I=!!(L&&Array.isArray(L)&&L[0]),S=!!(L&&Array.isArray(L)&&L[1]);!I||I&&S?h?.([t.toString(),""]):I&&!S&&(t<L[0]?h?.([t.toString(),L[0].toString()]):h?.([L[0].toString(),t.toString()]));}else h?.(t.toString());},[o,L,h]);return n?jsx(Zr,{month:k,year:M,minDate:a,maxDate:d,selectedDate:L,onSelectDate:B,onChangeMonth:N,onChangeYear:f}):o?jsx(va,{range:true,value:r,onChange:h,...x}):jsx(ya,{value:r,onChange:h,minDate:a,maxDate:d,month:k,year:M,selectedDate:L,onChangeMonth:N,onChangeYear:f,onSelectDate:B,formatStr:s,...x})},"DatePicker"),va=a(({minDate:r,maxDate:o,value:n,onChange:a})=>null,"DatePickerGroupInput"),ya=a(({placeholder:r,value:o,onChange:n,inputProps:a,...d})=>{let[s,h]=useState(false),x=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:s,onClickOutside:()=>h(false),content:jsx(pb,{children:jsx(Zr,{...d})}),containerStyle:{zIndex:`${x.zIndex.popover}`},children:jsx("div",{onClick:()=>h(true),children:jsx(kb,{...a,placeholder:r,value:ba(o,d.formatStr),onChange:k=>n?.(k.target.value)})})})},"DatePickerInput"),Zr=a(({month:r,year:o,selectedDate:n,minDate:a,maxDate:d,onSelectDate:s,onChangeMonth:h,onChangeYear:x})=>{let k=useMemo(()=>new Array(12).fill(null).map((p,F)=>{let P=new Date(0,F);return {value:F+1,inputDisplay:format(P,"MMMM")}}),[]),N=useMemo(()=>{let p=getYear(a),P=getYear(d)-p+1;return new Array(P).fill(null).map((T,$)=>{let Y=p+$;return {value:Y,inputDisplay:Y.toString()}})},[a,d]),M=useMemo(()=>new Array(7).fill(null).map((p,F)=>{let P=startOfWeek(new Date,{weekStartsOn:F});return format(P,"EEE")}),[]),f=useMemo(()=>{let p=startOfMonth(new Date(o,r)),F=endOfMonth(new Date(o,r)),P=getDay(p)===0?p:previousSunday(p),T=getDay(F)===6?F:nextSaturday(F),$=differenceInDays(T,P),Y=differenceInDays(p,P);return new Array($+1).fill(null).map((ne,re)=>new Date(o,r,re-Y+1))},[r,o]),L=useCallback(()=>{r===0?(x(o-1),h(11)):h(r-1);},[r,o]),B=useCallback(()=>{r===11?(x(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(()=>d?!(o>getYear(d)||o===getYear(d)&&r>=getMonth(d)):true,[r,o,d]),S=useCallback(p=>{p.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:S,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:L}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(ib,{placeholder:"",hasBorder:false,selected:r+1,options:k,onSelect:p=>h(p-1),maxWidth:150,maxHeight:300}),jsx(ib,{placeholder:"",hasBorder:false,selected:o,options:N,onSelect:p=>x(p),maxWidth:100,maxHeight:300})]}),I&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:B})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:M.map(p=>jsx("div",{className:"text-center",children:p},p))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:f.map(p=>{let F=getMonth(p)===r,P=format(p,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),T=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")),$=n&&Array.isArray(n)&&n[0]&&n[1]&&p>n[0]&&p<n[1],Y=a&&differenceInDays(p,a)<0||d&&differenceInDays(p,d)>0||!F;return jsx(wa,{date:p,isCurrentMonth:F,isCurrentDay:P,isSelected:!!T,isInRange:!!$,isDisabled:!!Y,onSelectDate:s},p.toISOString())})})]})},"DatePickerCalendar"),wa=a(({date:r,isCurrentMonth:o,isCurrentDay:n,isSelected:a$1,isInRange:d,isDisabled:s,onSelectDate:h})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${s?"text-gray-400 dark:text-neutral-600 cursor-not-allowed":a$1?"bg-blue-500 text-white":d?"bg-blue-100 dark:bg-blue-900/30":n?"text-blue-500":o?"text-black dark:text-white":"text-gray-400 dark:text-neutral-600"} ${s?"":a$1?"hover:bg-blue-600":"hover:bg-gray-100 dark:hover:bg-neutral-700"}`,onClick:a(k=>{s||h(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var Sa=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"),Da=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"),Ca=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),Jr=a(({id:r,color:o="default",message:n,duration:a,transitionDirection:d,cancelable:s=true,onClose:h})=>{let[x,k]=useState(false),[N,M]=useState(false),f=useRef(null),L=useCallback(()=>{k(true),f.current=setTimeout(()=>{h(r);},300);},[r,h]);return useEffect(()=>{if(M(true),a&&a<1/0){let B=setTimeout(()=>{L();},a);return ()=>clearTimeout(B)}},[a,L]),useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx("div",{className:`max-w-xs
276
+ `);var Wr=memo(a(function({extension:o,blob:n,path:a,buffer:d,stream:s,csvLabels:h,onCsvRetry:x,not_supported_message:k=" Sorry, this file type isn\u2019t supported yet."}){let N=o.toLocaleLowerCase().trim(),M;if(a?M=a:n&&(M=URL.createObjectURL(n)),["csv","tsv"].includes(N))return jsx($t,{url:M,blob:n,stream:s,labels:h,onRetry:x});if(M){if(["jpeg","jpg","png","gif","bmp","ico","svg","tiff","webp"].includes(N))return jsx(br,{url:M});if(["aac","ac3","aiff","amr","dts","flac","m4a","mp3","ogg","opus","wav","wma"].includes(N))return jsx(yr,{url:M});if(["3gp","avi","dv","flv","m2ts","m4v","mkv","mov","mp4","mpeg","mpg","mts","ogv","vob","webm"].includes(N))return jsx(Er,{url:M});if(o==="pdf")return jsx(zt,{url:M});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","cfg","conf","env","htm","ini","log","markdown","ndjson","properties","rst","toml"].includes(N))return jsx(Pr,{url:M,extension:N})}return N==="docx"?jsx(Sr,{url:M,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:k})})})},"Driver"));var Xd=a(r=>jsx("div",{className:"h-full w-full",children:jsx(Wr,{...r})}),"FileViewer");var Yr=250,ru=a(({text:r,speed:o=50,onDone:n,markdown:a$1=false,markdownComponents:d={},className:s,...h})=>{let[x,k]=useState(""),N=useRef(null),M=useRef(null);return useEffect(()=>{let f=false;if(o>0){k(""),N.current=performance.now();let L=a(B=>{if(f||!N.current)return;let t=B-N.current,I=t/o>Yr?o/2:o,S=t/o>Yr?1.5:1,p=Math.floor(t/I*S);if(p>=r.length){k(r),f=true,n?.();return}k(r.slice(0,p)),M.current=requestAnimationFrame(L);},"tick");M.current=requestAnimationFrame(L);}else k(r),n?.();return ()=>{M.current&&cancelAnimationFrame(M.current);}},[r,o,n]),a$1?jsx("div",{className:s,children:jsx(mn,{remarkPlugins:[bn],components:d,...h,children:x})}):jsx(Ya,{className:s,...h,children:x})},"Typewriter");var ca={timeout:2e3,message:"Copied!"},gu=a(({text:r,children:o,format:n="text/plain",tooltip:a$1,positions:d=["top"],className:s})=>{let[h,x]=useState(false),k=useRef(null),N={...ca,...a$1},M=Array.isArray(d)?d[0]:d,f=a(async()=>{"clipboard"in navigator?await navigator.clipboard.writeText(r):oa(r,{format:n}),x(true),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>x(false),N.timeout);},"handleCopy");return useEffect(()=>()=>{k.current&&clearTimeout(k.current);},[]),jsx(Popover,{padding:6,positions:d,isOpen:h,align:"center",onClickOutside:()=>x(false),content:!!a$1?.message&&jsx(Cb,{className:s,$position:M,$offset:6,children:a$1.message}),containerStyle:{zIndex:"9999"},children:jsx("div",{className:"inline-block",onMouseLeave:()=>x(false),children:o({copy:f})})})},"CopyToClipboard");var Ur=a(r=>new Date(r?Array.isArray(r)?r[1]||r[0]||new Date:r:new Date),"getInitValue"),Rt=a((r,o)=>{let n;if(o){let d=parse(r||"",o,new Date);if(isValid(d)&&getYear(d)>=1970)return d}let a=new Date(r||"");return isNaN(a.getTime())?n:a},"parseDate"),ba=a((r,o)=>{let n=r?Rt(r,o):void 0;return n&&o?format(n,o):r},"renderDate"),Pu=a(({value:r,range:o,inline:n=false,minDate:a=new Date(getYear(new Date)-5,0,1),maxDate:d=new Date(getYear(new Date)+5,11,31),format:s="dd.MM.yyyy",onChange:h,...x})=>{let[k,N]=useState(getMonth(Ur(r))),[M,f]=useState(getYear(Ur(r))),L=useMemo(()=>{if(r){if(Array.isArray(r)){let t=Rt(r[0],s),I=Rt(r[1],s);return [t,I]}return Rt(r,s)}},[r]),B=useCallback(t=>{if(o){let I=!!(L&&Array.isArray(L)&&L[0]),S=!!(L&&Array.isArray(L)&&L[1]);!I||I&&S?h?.([t.toString(),""]):I&&!S&&(t<L[0]?h?.([t.toString(),L[0].toString()]):h?.([L[0].toString(),t.toString()]));}else h?.(t.toString());},[o,L,h]);return n?jsx(Zr,{month:k,year:M,minDate:a,maxDate:d,selectedDate:L,onSelectDate:B,onChangeMonth:N,onChangeYear:f}):o?jsx(va,{range:true,value:r,onChange:h,...x}):jsx(ya,{value:r,onChange:h,minDate:a,maxDate:d,month:k,year:M,selectedDate:L,onChangeMonth:N,onChangeYear:f,onSelectDate:B,formatStr:s,...x})},"DatePicker"),va=a(({minDate:r,maxDate:o,value:n,onChange:a})=>null,"DatePickerGroupInput"),ya=a(({placeholder:r,value:o,onChange:n,inputProps:a,...d})=>{let[s,h]=useState(false),x=y();return jsx(Popover,{positions:["bottom","top","right","left"],align:"start",isOpen:s,onClickOutside:()=>h(false),content:jsx(pb,{children:jsx(Zr,{...d})}),containerStyle:{zIndex:`${x.zIndex.popover}`},children:jsx("div",{onClick:()=>h(true),children:jsx(kb,{...a,placeholder:r,value:ba(o,d.formatStr),onChange:k=>n?.(k.target.value)})})})},"DatePickerInput"),Zr=a(({month:r,year:o,selectedDate:n,minDate:a,maxDate:d,onSelectDate:s,onChangeMonth:h,onChangeYear:x})=>{let k=useMemo(()=>new Array(12).fill(null).map((p,F)=>{let P=new Date(0,F);return {value:F+1,inputDisplay:format(P,"MMMM")}}),[]),N=useMemo(()=>{let p=getYear(a),P=getYear(d)-p+1;return new Array(P).fill(null).map((T,$)=>{let Y=p+$;return {value:Y,inputDisplay:Y.toString()}})},[a,d]),M=useMemo(()=>new Array(7).fill(null).map((p,F)=>{let P=startOfWeek(new Date,{weekStartsOn:F});return format(P,"EEE")}),[]),f=useMemo(()=>{let p=startOfMonth(new Date(o,r)),F=endOfMonth(new Date(o,r)),P=getDay(p)===0?p:previousSunday(p),T=getDay(F)===6?F:nextSaturday(F),$=differenceInDays(T,P),Y=differenceInDays(p,P);return new Array($+1).fill(null).map((ne,re)=>new Date(o,r,re-Y+1))},[r,o]),L=useCallback(()=>{r===0?(x(o-1),h(11)):h(r-1);},[r,o]),B=useCallback(()=>{r===11?(x(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(()=>d?!(o>getYear(d)||o===getYear(d)&&r>=getMonth(d)):true,[r,o,d]),S=useCallback(p=>{p.stopPropagation();},[]);return jsxs("div",{className:"flex flex-col date-picker-calendar",onClick:S,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:L}),jsxs("div",{className:"flex-1 flex justify-center gap-1",children:[jsx(ib,{placeholder:"",hasBorder:false,selected:r+1,options:k,onSelect:p=>h(p-1),maxWidth:150,maxHeight:300}),jsx(ib,{placeholder:"",hasBorder:false,selected:o,options:N,onSelect:p=>x(p),maxWidth:100,maxHeight:300})]}),I&&jsx(z,{size:"small",variant:"empty",icon:jsx(H,{}),onClick:B})]}),jsx("div",{className:"grid grid-cols-7 gap-2",children:M.map(p=>jsx("div",{className:"text-center",children:p},p))}),jsx("div",{className:"grid grid-cols-7 gap-2 mt-2",children:f.map(p=>{let F=getMonth(p)===r,P=format(p,"yyyy-MM-dd")===format(new Date,"yyyy-MM-dd"),T=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")),$=n&&Array.isArray(n)&&n[0]&&n[1]&&p>n[0]&&p<n[1],Y=a&&differenceInDays(p,a)<0||d&&differenceInDays(p,d)>0||!F;return jsx(wa,{date:p,isCurrentMonth:F,isCurrentDay:P,isSelected:!!T,isInRange:!!$,isDisabled:!!Y,onSelectDate:s},p.toISOString())})})]})},"DatePickerCalendar"),wa=a(({date:r,isCurrentMonth:o,isCurrentDay:n,isSelected:a$1,isInRange:d,isDisabled:s,onSelectDate:h})=>jsx("div",{className:`text-center p-2 cursor-pointer rounded ${s?"text-gray-400 dark:text-neutral-600 cursor-not-allowed":a$1?"bg-blue-500 text-white":d?"bg-blue-100 dark:bg-blue-900/30":n?"text-blue-500":o?"text-black dark:text-white":"text-gray-400 dark:text-neutral-600"} ${s?"":a$1?"hover:bg-blue-600":"hover:bg-gray-100 dark:hover:bg-neutral-700"}`,onClick:a(k=>{s||h(r);},"handleClick"),children:format(r,"d")}),"CalendarDay");var Sa=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"),Da=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"),Ca=a(r=>{switch(r){case "bottom":return "translate-y-4";case "top":default:return "-translate-y-4"}},"getTransitionStarting"),Jr=a(({id:r,color:o="default",message:n,duration:a,transitionDirection:d,cancelable:s=true,onClose:h})=>{let[x,k]=useState(false),[N,M]=useState(false),f=useRef(null),L=useCallback(()=>{k(true),f.current=setTimeout(()=>{h(r);},300);},[r,h]);return useEffect(()=>{if(M(true),a&&a<1/0){let B=setTimeout(()=>{L();},a);return ()=>clearTimeout(B)}},[a,L]),useEffect(()=>()=>{f.current&&clearTimeout(f.current);},[]),jsx("div",{className:`max-w-xs
277
277
  border
278
278
  w-full
279
279
  text-sm