@zendir/ui 0.1.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.
Files changed (359) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +21 -0
  3. package/README.md +589 -0
  4. package/dist/index.d.ts +8 -0
  5. package/dist/index.js +421 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/react/3d/EarthViewer.d.ts +46 -0
  8. package/dist/react/3d/EarthViewer.js +836 -0
  9. package/dist/react/3d/EarthViewer.js.map +1 -0
  10. package/dist/react/3d/SolarSystemViewer.d.ts +43 -0
  11. package/dist/react/3d/SolarSystemViewer.js +372 -0
  12. package/dist/react/3d/SolarSystemViewer.js.map +1 -0
  13. package/dist/react/3d/ZenSpace3D.d.ts +16 -0
  14. package/dist/react/3d/ZenSpace3D.js +1253 -0
  15. package/dist/react/3d/ZenSpace3D.js.map +1 -0
  16. package/dist/react/3d/ZenSpace3DCesium.d.ts +9 -0
  17. package/dist/react/3d/ZenSpace3DCesium.js +186 -0
  18. package/dist/react/3d/ZenSpace3DCesium.js.map +1 -0
  19. package/dist/react/3d/ZenSpace3DShaders.d.ts +78 -0
  20. package/dist/react/3d/ZenSpace3DShaders.js +94 -0
  21. package/dist/react/3d/ZenSpace3DShaders.js.map +1 -0
  22. package/dist/react/3d/ZenSpace3DTypes.d.ts +614 -0
  23. package/dist/react/3d/ZenSpace3DUtils.d.ts +183 -0
  24. package/dist/react/3d/ZenSpace3DUtils.js +213 -0
  25. package/dist/react/3d/ZenSpace3DUtils.js.map +1 -0
  26. package/dist/react/3d/index.d.ts +23 -0
  27. package/dist/react/3d/threeLoader.d.ts +22 -0
  28. package/dist/react/3d/threeLoader.js +18 -0
  29. package/dist/react/3d/threeLoader.js.map +1 -0
  30. package/dist/react/astro/ClassificationBanner.d.ts +25 -0
  31. package/dist/react/astro/ClassificationBanner.js +83 -0
  32. package/dist/react/astro/ClassificationBanner.js.map +1 -0
  33. package/dist/react/astro/GlobalStatusBar.d.ts +42 -0
  34. package/dist/react/astro/GlobalStatusBar.js +165 -0
  35. package/dist/react/astro/GlobalStatusBar.js.map +1 -0
  36. package/dist/react/astro/MissionClock.d.ts +169 -0
  37. package/dist/react/astro/MissionClock.js +411 -0
  38. package/dist/react/astro/MissionClock.js.map +1 -0
  39. package/dist/react/astro/MonitoringIcon.d.ts +60 -0
  40. package/dist/react/astro/MonitoringIcon.js +369 -0
  41. package/dist/react/astro/MonitoringIcon.js.map +1 -0
  42. package/dist/react/astro/Notification.d.ts +42 -0
  43. package/dist/react/astro/Notification.js +156 -0
  44. package/dist/react/astro/Notification.js.map +1 -0
  45. package/dist/react/astro/Progress.d.ts +39 -0
  46. package/dist/react/astro/Progress.js +149 -0
  47. package/dist/react/astro/Progress.js.map +1 -0
  48. package/dist/react/astro/SimulationControls.d.ts +136 -0
  49. package/dist/react/astro/SimulationControls.js +668 -0
  50. package/dist/react/astro/SimulationControls.js.map +1 -0
  51. package/dist/react/astro/StatusIndicator.d.ts +34 -0
  52. package/dist/react/astro/StatusIndicator.js +189 -0
  53. package/dist/react/astro/StatusIndicator.js.map +1 -0
  54. package/dist/react/astro/UnifiedTimeline.d.ts +106 -0
  55. package/dist/react/astro/UnifiedTimeline.js +1768 -0
  56. package/dist/react/astro/UnifiedTimeline.js.map +1 -0
  57. package/dist/react/astro/index.d.ts +63 -0
  58. package/dist/react/cards/AccessCard.d.ts +37 -0
  59. package/dist/react/cards/AccessCard.js +410 -0
  60. package/dist/react/cards/AccessCard.js.map +1 -0
  61. package/dist/react/cards/OrbitCard.d.ts +31 -0
  62. package/dist/react/cards/OrbitCard.js +372 -0
  63. package/dist/react/cards/OrbitCard.js.map +1 -0
  64. package/dist/react/cards/SpacecraftCard.d.ts +54 -0
  65. package/dist/react/cards/SpacecraftCard.js +941 -0
  66. package/dist/react/cards/SpacecraftCard.js.map +1 -0
  67. package/dist/react/cards/TelemetryCard.d.ts +40 -0
  68. package/dist/react/cards/TelemetryCard.js +742 -0
  69. package/dist/react/cards/TelemetryCard.js.map +1 -0
  70. package/dist/react/cards/TelemetryStreamCard.d.ts +59 -0
  71. package/dist/react/cards/TelemetryStreamCard.js +309 -0
  72. package/dist/react/cards/TelemetryStreamCard.js.map +1 -0
  73. package/dist/react/cards/index.d.ts +13 -0
  74. package/dist/react/charts/GroundTrackMap.d.ts +112 -0
  75. package/dist/react/charts/GroundTrackMap.js +1123 -0
  76. package/dist/react/charts/GroundTrackMap.js.map +1 -0
  77. package/dist/react/charts/GroundTrackMapLeaflet.d.ts +26 -0
  78. package/dist/react/charts/GroundTrackMapLeaflet.js +571 -0
  79. package/dist/react/charts/GroundTrackMapLeaflet.js.map +1 -0
  80. package/dist/react/charts/groundTrackMapLeafletTiles.d.ts +22 -0
  81. package/dist/react/charts/groundTrackMapLeafletTiles.js +11 -0
  82. package/dist/react/charts/groundTrackMapLeafletTiles.js.map +1 -0
  83. package/dist/react/charts/groundTrackMapLeafletUtils.d.ts +24 -0
  84. package/dist/react/charts/groundTrackMapLeafletUtils.js +109 -0
  85. package/dist/react/charts/groundTrackMapLeafletUtils.js.map +1 -0
  86. package/dist/react/charts/index.d.ts +10 -0
  87. package/dist/react/charts/unified/AstroChart.d.ts +24 -0
  88. package/dist/react/charts/unified/AstroChart.js +1405 -0
  89. package/dist/react/charts/unified/AstroChart.js.map +1 -0
  90. package/dist/react/charts/unified/PowerOverviewChart.d.ts +73 -0
  91. package/dist/react/charts/unified/PowerOverviewChart.js +488 -0
  92. package/dist/react/charts/unified/PowerOverviewChart.js.map +1 -0
  93. package/dist/react/charts/unified/domain.d.ts +845 -0
  94. package/dist/react/charts/unified/domain.js +3168 -0
  95. package/dist/react/charts/unified/domain.js.map +1 -0
  96. package/dist/react/charts/unified/generators.d.ts +276 -0
  97. package/dist/react/charts/unified/generators.js +518 -0
  98. package/dist/react/charts/unified/generators.js.map +1 -0
  99. package/dist/react/charts/unified/index.d.ts +55 -0
  100. package/dist/react/charts/unified/presets.d.ts +290 -0
  101. package/dist/react/charts/unified/presets.js +999 -0
  102. package/dist/react/charts/unified/presets.js.map +1 -0
  103. package/dist/react/charts/unified/sync.d.ts +69 -0
  104. package/dist/react/charts/unified/sync.js +219 -0
  105. package/dist/react/charts/unified/sync.js.map +1 -0
  106. package/dist/react/charts/unified/theme.d.ts +447 -0
  107. package/dist/react/charts/unified/theme.js +562 -0
  108. package/dist/react/charts/unified/theme.js.map +1 -0
  109. package/dist/react/charts/unified/types.d.ts +826 -0
  110. package/dist/react/charts/unified/useChartStream.d.ts +58 -0
  111. package/dist/react/charts/unified/useChartStream.js +226 -0
  112. package/dist/react/charts/unified/useChartStream.js.map +1 -0
  113. package/dist/react/chatgpt/AppCard.d.ts +59 -0
  114. package/dist/react/chatgpt/AppCard.js +306 -0
  115. package/dist/react/chatgpt/AppCard.js.map +1 -0
  116. package/dist/react/chatgpt/ChatGPTCard.d.ts +6 -0
  117. package/dist/react/chatgpt/index.d.ts +167 -0
  118. package/dist/react/chatgpt/index.js +166 -0
  119. package/dist/react/chatgpt/index.js.map +1 -0
  120. package/dist/react/context/DisplaySettingsContext.d.ts +107 -0
  121. package/dist/react/context/DisplaySettingsContext.js +169 -0
  122. package/dist/react/context/DisplaySettingsContext.js.map +1 -0
  123. package/dist/react/context/index.d.ts +5 -0
  124. package/dist/react/core/ActivityPlanner.d.ts +45 -0
  125. package/dist/react/core/ActivityPlanner.js +532 -0
  126. package/dist/react/core/ActivityPlanner.js.map +1 -0
  127. package/dist/react/core/AppBar.d.ts +71 -0
  128. package/dist/react/core/AppBar.js +817 -0
  129. package/dist/react/core/AppBar.js.map +1 -0
  130. package/dist/react/core/AstroIcon.d.ts +84 -0
  131. package/dist/react/core/AstroIcon.js +1243 -0
  132. package/dist/react/core/AstroIcon.js.map +1 -0
  133. package/dist/react/core/Badge.d.ts +27 -0
  134. package/dist/react/core/Badge.js +134 -0
  135. package/dist/react/core/Badge.js.map +1 -0
  136. package/dist/react/core/Button.d.ts +26 -0
  137. package/dist/react/core/Button.js +306 -0
  138. package/dist/react/core/Button.js.map +1 -0
  139. package/dist/react/core/CardHeader.d.ts +34 -0
  140. package/dist/react/core/CardHeader.js +316 -0
  141. package/dist/react/core/CardHeader.js.map +1 -0
  142. package/dist/react/core/ChatPanel.d.ts +627 -0
  143. package/dist/react/core/ChatPanel.js +1144 -0
  144. package/dist/react/core/ChatPanel.js.map +1 -0
  145. package/dist/react/core/Checkbox.d.ts +26 -0
  146. package/dist/react/core/Checkbox.js +130 -0
  147. package/dist/react/core/Checkbox.js.map +1 -0
  148. package/dist/react/core/ColorPickerPanel.d.ts +25 -0
  149. package/dist/react/core/ColorPickerPanel.js +293 -0
  150. package/dist/react/core/ColorPickerPanel.js.map +1 -0
  151. package/dist/react/core/CommandBuilder.d.ts +74 -0
  152. package/dist/react/core/CommandBuilder.js +518 -0
  153. package/dist/react/core/CommandBuilder.js.map +1 -0
  154. package/dist/react/core/ConfirmDialog.d.ts +45 -0
  155. package/dist/react/core/ConfirmDialog.js +315 -0
  156. package/dist/react/core/ConfirmDialog.js.map +1 -0
  157. package/dist/react/core/ConnectionForm.d.ts +57 -0
  158. package/dist/react/core/ConnectionForm.js +496 -0
  159. package/dist/react/core/ConnectionForm.js.map +1 -0
  160. package/dist/react/core/Container.d.ts +51 -0
  161. package/dist/react/core/Container.js +670 -0
  162. package/dist/react/core/Container.js.map +1 -0
  163. package/dist/react/core/CopyButton.d.ts +39 -0
  164. package/dist/react/core/CopyButton.js +105 -0
  165. package/dist/react/core/CopyButton.js.map +1 -0
  166. package/dist/react/core/DataTable.d.ts +113 -0
  167. package/dist/react/core/DataTable.js +446 -0
  168. package/dist/react/core/DataTable.js.map +1 -0
  169. package/dist/react/core/DataValue.d.ts +64 -0
  170. package/dist/react/core/DataValue.js +545 -0
  171. package/dist/react/core/DataValue.js.map +1 -0
  172. package/dist/react/core/Dialog.d.ts +32 -0
  173. package/dist/react/core/Dialog.js +201 -0
  174. package/dist/react/core/Dialog.js.map +1 -0
  175. package/dist/react/core/FileExplorer.d.ts +65 -0
  176. package/dist/react/core/FileExplorer.js +520 -0
  177. package/dist/react/core/FileExplorer.js.map +1 -0
  178. package/dist/react/core/GlassCard.d.ts +129 -0
  179. package/dist/react/core/GlassCard.js +375 -0
  180. package/dist/react/core/GlassCard.js.map +1 -0
  181. package/dist/react/core/HeaderIconWithStatus.d.ts +39 -0
  182. package/dist/react/core/HeaderIconWithStatus.js +157 -0
  183. package/dist/react/core/HeaderIconWithStatus.js.map +1 -0
  184. package/dist/react/core/HexViewer.d.ts +143 -0
  185. package/dist/react/core/HexViewer.js +1106 -0
  186. package/dist/react/core/HexViewer.js.map +1 -0
  187. package/dist/react/core/Icon.d.ts +32 -0
  188. package/dist/react/core/Icon.js +142 -0
  189. package/dist/react/core/Icon.js.map +1 -0
  190. package/dist/react/core/ImageGallery.d.ts +41 -0
  191. package/dist/react/core/ImageGallery.js +320 -0
  192. package/dist/react/core/ImageGallery.js.map +1 -0
  193. package/dist/react/core/Input.d.ts +38 -0
  194. package/dist/react/core/Input.js +288 -0
  195. package/dist/react/core/Input.js.map +1 -0
  196. package/dist/react/core/LimitsBar.d.ts +51 -0
  197. package/dist/react/core/LimitsBar.js +200 -0
  198. package/dist/react/core/LimitsBar.js.map +1 -0
  199. package/dist/react/core/LogViewer.d.ts +61 -0
  200. package/dist/react/core/LogViewer.js +599 -0
  201. package/dist/react/core/LogViewer.js.map +1 -0
  202. package/dist/react/core/MessageStream.d.ts +58 -0
  203. package/dist/react/core/MessageStream.js +455 -0
  204. package/dist/react/core/MessageStream.js.map +1 -0
  205. package/dist/react/core/MissionCalendar.d.ts +81 -0
  206. package/dist/react/core/MissionCalendar.js +1049 -0
  207. package/dist/react/core/MissionCalendar.js.map +1 -0
  208. package/dist/react/core/NumberInput.d.ts +85 -0
  209. package/dist/react/core/NumberInput.js +507 -0
  210. package/dist/react/core/NumberInput.js.map +1 -0
  211. package/dist/react/core/PacketViewer.d.ts +73 -0
  212. package/dist/react/core/PacketViewer.js +431 -0
  213. package/dist/react/core/PacketViewer.js.map +1 -0
  214. package/dist/react/core/Pagination.d.ts +30 -0
  215. package/dist/react/core/Pagination.js +190 -0
  216. package/dist/react/core/Pagination.js.map +1 -0
  217. package/dist/react/core/PinInput.d.ts +41 -0
  218. package/dist/react/core/PinInput.js +210 -0
  219. package/dist/react/core/PinInput.js.map +1 -0
  220. package/dist/react/core/Popover.d.ts +55 -0
  221. package/dist/react/core/Popover.js +288 -0
  222. package/dist/react/core/Popover.js.map +1 -0
  223. package/dist/react/core/Select.d.ts +42 -0
  224. package/dist/react/core/Select.js +303 -0
  225. package/dist/react/core/Select.js.map +1 -0
  226. package/dist/react/core/SideNav.d.ts +103 -0
  227. package/dist/react/core/SideNav.js +551 -0
  228. package/dist/react/core/SideNav.js.map +1 -0
  229. package/dist/react/core/SidePanel.d.ts +33 -0
  230. package/dist/react/core/SidePanel.js +199 -0
  231. package/dist/react/core/SidePanel.js.map +1 -0
  232. package/dist/react/core/Tabs.d.ts +47 -0
  233. package/dist/react/core/Tabs.js +129 -0
  234. package/dist/react/core/Tabs.js.map +1 -0
  235. package/dist/react/core/Toast.d.ts +56 -0
  236. package/dist/react/core/Toast.js +229 -0
  237. package/dist/react/core/Toast.js.map +1 -0
  238. package/dist/react/core/Toggle.d.ts +22 -0
  239. package/dist/react/core/Toggle.js +151 -0
  240. package/dist/react/core/Toggle.js.map +1 -0
  241. package/dist/react/core/Tooltip.d.ts +19 -0
  242. package/dist/react/core/Tooltip.js +179 -0
  243. package/dist/react/core/Tooltip.js.map +1 -0
  244. package/dist/react/core/Typography.d.ts +127 -0
  245. package/dist/react/core/Typography.js +187 -0
  246. package/dist/react/core/Typography.js.map +1 -0
  247. package/dist/react/core/index.d.ts +108 -0
  248. package/dist/react/core/layout/Box.d.ts +77 -0
  249. package/dist/react/core/layout/Box.js +126 -0
  250. package/dist/react/core/layout/Box.js.map +1 -0
  251. package/dist/react/core/layout/Center.d.ts +20 -0
  252. package/dist/react/core/layout/Center.js +34 -0
  253. package/dist/react/core/layout/Center.js.map +1 -0
  254. package/dist/react/core/layout/Divider.d.ts +16 -0
  255. package/dist/react/core/layout/Divider.js +108 -0
  256. package/dist/react/core/layout/Divider.js.map +1 -0
  257. package/dist/react/core/layout/Flex.d.ts +30 -0
  258. package/dist/react/core/layout/Flex.js +128 -0
  259. package/dist/react/core/layout/Flex.js.map +1 -0
  260. package/dist/react/core/layout/Grid.d.ts +36 -0
  261. package/dist/react/core/layout/Grid.js +142 -0
  262. package/dist/react/core/layout/Grid.js.map +1 -0
  263. package/dist/react/core/layout/Spacer.d.ts +8 -0
  264. package/dist/react/core/layout/Spacer.js +31 -0
  265. package/dist/react/core/layout/Spacer.js.map +1 -0
  266. package/dist/react/core/layout/Stack.d.ts +54 -0
  267. package/dist/react/core/layout/Stack.js +74 -0
  268. package/dist/react/core/layout/Stack.js.map +1 -0
  269. package/dist/react/core/layout/index.d.ts +38 -0
  270. package/dist/react/core/layout/responsive.d.ts +23 -0
  271. package/dist/react/core/layout/responsive.js +26 -0
  272. package/dist/react/core/layout/responsive.js.map +1 -0
  273. package/dist/react/core/layout/useBreakpoint.d.ts +77 -0
  274. package/dist/react/core/layout/useBreakpoint.js +73 -0
  275. package/dist/react/core/layout/useBreakpoint.js.map +1 -0
  276. package/dist/react/core/propertyConfig.d.ts +443 -0
  277. package/dist/react/core/propertyConfig.js +399 -0
  278. package/dist/react/core/propertyConfig.js.map +1 -0
  279. package/dist/react/hooks/index.d.ts +21 -0
  280. package/dist/react/hooks/useAccessWindows.d.ts +66 -0
  281. package/dist/react/hooks/useCompactMode.d.ts +82 -0
  282. package/dist/react/hooks/useCompactMode.js +62 -0
  283. package/dist/react/hooks/useCompactMode.js.map +1 -0
  284. package/dist/react/hooks/useLiveSelection.d.ts +57 -0
  285. package/dist/react/hooks/useSimulationPlayback.d.ts +97 -0
  286. package/dist/react/hooks/useSimulationTime.d.ts +61 -0
  287. package/dist/react/hooks/useSpacecraftPosition.d.ts +50 -0
  288. package/dist/react/hooks/useSpacecraftPosition.js +89 -0
  289. package/dist/react/hooks/useSpacecraftPosition.js.map +1 -0
  290. package/dist/react/hooks/useTelemetry.d.ts +55 -0
  291. package/dist/react/hooks/useTelemetry.js +73 -0
  292. package/dist/react/hooks/useTelemetry.js.map +1 -0
  293. package/dist/react/hooks/useZendirSession.d.ts +109 -0
  294. package/dist/react/hooks/useZendirSession.js +148 -0
  295. package/dist/react/hooks/useZendirSession.js.map +1 -0
  296. package/dist/react/index.d.ts +74 -0
  297. package/dist/react/shared/ErrorBoundary.d.ts +63 -0
  298. package/dist/react/shared/ErrorBoundary.js +142 -0
  299. package/dist/react/shared/ErrorBoundary.js.map +1 -0
  300. package/dist/react/shared/Skeleton.d.ts +110 -0
  301. package/dist/react/shared/Skeleton.js +324 -0
  302. package/dist/react/shared/Skeleton.js.map +1 -0
  303. package/dist/react/shared/index.d.ts +12 -0
  304. package/dist/react/theme/ThemeProvider.d.ts +385 -0
  305. package/dist/react/theme/ThemeProvider.js +1096 -0
  306. package/dist/react/theme/ThemeProvider.js.map +1 -0
  307. package/dist/react/theme/astro-tokens.d.ts +153 -0
  308. package/dist/react/theme/cardAccent.d.ts +75 -0
  309. package/dist/react/theme/cardAccent.js +137 -0
  310. package/dist/react/theme/cardAccent.js.map +1 -0
  311. package/dist/react/theme/config.d.ts +39 -0
  312. package/dist/react/theme/index.d.ts +9 -0
  313. package/dist/react/types.d.ts +360 -0
  314. package/dist/react/types.js +58 -0
  315. package/dist/react/types.js.map +1 -0
  316. package/dist/react/utils/index.d.ts +247 -0
  317. package/dist/react/utils/index.js +423 -0
  318. package/dist/react/utils/index.js.map +1 -0
  319. package/dist/react/visualizations/EclipseTimerCard.d.ts +17 -0
  320. package/dist/react/visualizations/EclipseTimerCard.js +250 -0
  321. package/dist/react/visualizations/EclipseTimerCard.js.map +1 -0
  322. package/dist/react/visualizations/LinkBudgetCard.d.ts +50 -0
  323. package/dist/react/visualizations/LinkBudgetCard.js +444 -0
  324. package/dist/react/visualizations/LinkBudgetCard.js.map +1 -0
  325. package/dist/react/visualizations/NavBallCard.d.ts +17 -0
  326. package/dist/react/visualizations/NavBallCard.js +243 -0
  327. package/dist/react/visualizations/NavBallCard.js.map +1 -0
  328. package/dist/react/visualizations/PropulsionCard.d.ts +37 -0
  329. package/dist/react/visualizations/PropulsionCard.js +298 -0
  330. package/dist/react/visualizations/PropulsionCard.js.map +1 -0
  331. package/dist/react/visualizations/SensorFootprintCard.d.ts +33 -0
  332. package/dist/react/visualizations/SensorFootprintCard.js +326 -0
  333. package/dist/react/visualizations/SensorFootprintCard.js.map +1 -0
  334. package/dist/react/visualizations/ThermalHeatmapCard.d.ts +38 -0
  335. package/dist/react/visualizations/ThermalHeatmapCard.js +372 -0
  336. package/dist/react/visualizations/ThermalHeatmapCard.js.map +1 -0
  337. package/dist/react/visualizations/index.d.ts +17 -0
  338. package/dist/react.d.ts +1 -0
  339. package/dist/react.js +421 -0
  340. package/dist/react.js.map +1 -0
  341. package/dist/shaders/atmosphere.frag.js +5 -0
  342. package/dist/shaders/atmosphere.frag.js.map +1 -0
  343. package/dist/shaders/atmosphere.vert.js +5 -0
  344. package/dist/shaders/atmosphere.vert.js.map +1 -0
  345. package/dist/shaders/stars.frag.js +5 -0
  346. package/dist/shaders/stars.frag.js.map +1 -0
  347. package/dist/shaders/stars.vert.js +5 -0
  348. package/dist/shaders/stars.vert.js.map +1 -0
  349. package/dist/style.css +143 -0
  350. package/dist/tokens/index.d.ts +296 -0
  351. package/dist/tokens/index.js +263 -0
  352. package/dist/tokens/index.js.map +1 -0
  353. package/dist/tokens/tokens.css +155 -0
  354. package/dist/types/index.d.ts +23 -0
  355. package/dist/types.d.ts +1 -0
  356. package/dist/types.js +2 -0
  357. package/dist/types.js.map +1 -0
  358. package/package.json +220 -0
  359. package/sdk-stub.js +22 -0
@@ -0,0 +1,1049 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { memo, useState, useRef, useMemo, useCallback } from "react";
3
+ import { AstroIcon } from "./AstroIcon.js";
4
+ import { useTheme } from "../theme/ThemeProvider.js";
5
+ function getStatusColor(status, tokens) {
6
+ if (!status) return tokens.colors.text.muted ?? tokens.colors.text.secondary;
7
+ switch (status) {
8
+ case "created":
9
+ case "scheduled":
10
+ return tokens.colors.status.standby;
11
+ case "started":
12
+ return tokens.colors.status.normal;
13
+ case "completed":
14
+ return tokens.colors.status.normal;
15
+ case "paused":
16
+ case "stopped":
17
+ case "disabled":
18
+ return tokens.colors.status.caution;
19
+ case "error":
20
+ case "failed":
21
+ case "crashed":
22
+ return tokens.colors.status.critical;
23
+ }
24
+ }
25
+ function getStatusShape(status) {
26
+ if (!status) return "●";
27
+ switch (status) {
28
+ case "created":
29
+ case "scheduled":
30
+ return "◯";
31
+ case "started":
32
+ case "completed":
33
+ return "●";
34
+ case "paused":
35
+ case "stopped":
36
+ case "disabled":
37
+ return "■";
38
+ case "error":
39
+ case "failed":
40
+ case "crashed":
41
+ return "▼";
42
+ }
43
+ }
44
+ const TYPE_ICON_ASTRO = ["contact", "eclipse", "pass"];
45
+ function getTypeIcon(type) {
46
+ switch (type) {
47
+ case "command":
48
+ return "⌘";
49
+ case "script":
50
+ return "▶";
51
+ case "reserve":
52
+ return "▒";
53
+ case "metadata":
54
+ return "◆";
55
+ case "note":
56
+ return "✎";
57
+ case "contact":
58
+ return "antenna";
59
+ case "eclipse":
60
+ return "brightness-2";
61
+ case "pass":
62
+ return "satellite";
63
+ }
64
+ }
65
+ function getDaysInMonth(year, month) {
66
+ return new Date(year, month + 1, 0).getDate();
67
+ }
68
+ function getFirstDayOfMonth(year, month, mondayStart) {
69
+ const day = new Date(year, month, 1).getDay();
70
+ if (mondayStart) return day === 0 ? 6 : day - 1;
71
+ return day;
72
+ }
73
+ function isSameDay(a, b) {
74
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
75
+ }
76
+ function formatTime(d) {
77
+ return d.toLocaleTimeString("en-US", { hour12: false, hour: "2-digit", minute: "2-digit" });
78
+ }
79
+ function getWeekDates(date, mondayStart) {
80
+ const d = new Date(date);
81
+ const day = d.getDay();
82
+ const diff = mondayStart ? day === 0 ? -6 : 1 - day : -day;
83
+ const start = new Date(d);
84
+ start.setDate(start.getDate() + diff);
85
+ return Array.from({ length: 7 }, (_, i) => {
86
+ const dt = new Date(start);
87
+ dt.setDate(dt.getDate() + i);
88
+ return dt;
89
+ });
90
+ }
91
+ function getWeekNumber(d) {
92
+ const date = new Date(d.getTime());
93
+ date.setHours(0, 0, 0, 0);
94
+ date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7);
95
+ const week1 = new Date(date.getFullYear(), 0, 4);
96
+ return 1 + Math.round(((date.getTime() - week1.getTime()) / 864e5 - 3 + (week1.getDay() + 6) % 7) / 7);
97
+ }
98
+ function getDayOfYear(d) {
99
+ const start = new Date(d.getFullYear(), 0, 0);
100
+ const diff = d.getTime() - start.getTime();
101
+ return Math.floor(diff / 864e5);
102
+ }
103
+ const TIME_SLOTS = [];
104
+ for (let h = 0; h < 24; h++) {
105
+ TIME_SLOTS.push(`${String(h).padStart(2, "0")}:00`);
106
+ TIME_SLOTS.push(`${String(h).padStart(2, "0")}:30`);
107
+ }
108
+ const SLOT_HEIGHT = 28;
109
+ const CalendarEventChip = memo(function CalendarEventChip2({
110
+ event,
111
+ tokens,
112
+ compact,
113
+ onClick
114
+ }) {
115
+ const color = event.color || getStatusColor(event.status, tokens);
116
+ return /* @__PURE__ */ jsxs(
117
+ "div",
118
+ {
119
+ onClick: (e) => {
120
+ e.stopPropagation();
121
+ onClick == null ? void 0 : onClick();
122
+ },
123
+ title: `${event.title}
124
+ ${formatTime(event.start)}${event.end ? " – " + formatTime(event.end) : ""}
125
+ ${event.description || ""}`,
126
+ style: {
127
+ background: `${color}22`,
128
+ color: tokens.colors.text.primary,
129
+ padding: compact ? "1px 4px" : "2px 6px",
130
+ borderRadius: tokens.borderRadius.sm,
131
+ fontSize: compact ? tokens.typography.fontSize.micro : tokens.typography.fontSize.xxs,
132
+ lineHeight: compact ? "14px" : "16px",
133
+ cursor: "pointer",
134
+ overflow: "hidden",
135
+ textOverflow: "ellipsis",
136
+ whiteSpace: "nowrap",
137
+ display: "flex",
138
+ alignItems: "center",
139
+ gap: 3,
140
+ transition: "background 150ms ease",
141
+ marginBottom: 1
142
+ },
143
+ children: [
144
+ /* @__PURE__ */ jsx("span", { style: { fontSize: tokens.typography.fontSize.micro, opacity: 0.7 }, children: TYPE_ICON_ASTRO.includes(event.type) ? /* @__PURE__ */ jsx(AstroIcon, { name: getTypeIcon(event.type), size: "extra-small", label: "" }) : getTypeIcon(event.type) }),
145
+ !compact && /* @__PURE__ */ jsx("span", { style: { color, fontSize: tokens.typography.fontSize.micro }, children: getStatusShape(event.status) }),
146
+ /* @__PURE__ */ jsx("span", { style: { overflow: "hidden", textOverflow: "ellipsis" }, children: event.title })
147
+ ]
148
+ }
149
+ );
150
+ });
151
+ const MiniCalendar = memo(function MiniCalendar2({
152
+ currentDate,
153
+ tokens,
154
+ weekStartsMonday,
155
+ onDateSelect,
156
+ getEventsForDay
157
+ }) {
158
+ const [miniDate, setMiniDate] = useState(new Date(currentDate));
159
+ const year = miniDate.getFullYear();
160
+ const month = miniDate.getMonth();
161
+ const today = /* @__PURE__ */ new Date();
162
+ const dayLabels = weekStartsMonday ? ["M", "T", "W", "T", "F", "S", "S"] : ["S", "M", "T", "W", "T", "F", "S"];
163
+ const grid = useMemo(() => {
164
+ const firstDay = getFirstDayOfMonth(year, month, weekStartsMonday);
165
+ const daysInMonth = getDaysInMonth(year, month);
166
+ const daysInPrevMonth = getDaysInMonth(year, month === 0 ? 11 : month - 1);
167
+ const cells = [];
168
+ for (let i = firstDay - 1; i >= 0; i--) {
169
+ cells.push({ date: new Date(year, month - 1, daysInPrevMonth - i), isCurrentMonth: false });
170
+ }
171
+ for (let i = 1; i <= daysInMonth; i++) {
172
+ cells.push({ date: new Date(year, month, i), isCurrentMonth: true });
173
+ }
174
+ while (cells.length < 42) {
175
+ cells.push({ date: new Date(year, month + 1, cells.length - firstDay - daysInMonth + 1), isCurrentMonth: false });
176
+ }
177
+ return cells;
178
+ }, [year, month, weekStartsMonday]);
179
+ return /* @__PURE__ */ jsxs("div", { children: [
180
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 6 }, children: [
181
+ /* @__PURE__ */ jsx("button", { onClick: () => setMiniDate(new Date(year, month - 1)), style: { background: "none", border: "none", color: tokens.colors.text.muted, cursor: "pointer", fontSize: 12, padding: "2px 6px" }, children: "◀" }),
182
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: 500, fontSize: 11 }, children: miniDate.toLocaleDateString("en-US", { month: "short", year: "numeric" }) }),
183
+ /* @__PURE__ */ jsx("button", { onClick: () => setMiniDate(new Date(year, month + 1)), style: { background: "none", border: "none", color: tokens.colors.text.muted, cursor: "pointer", fontSize: 12, padding: "2px 6px" }, children: "▶" })
184
+ ] }),
185
+ /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: 0 }, children: [
186
+ dayLabels.map((d, i) => /* @__PURE__ */ jsx("div", { style: { textAlign: "center", fontSize: 9, color: tokens.colors.text.muted, fontWeight: 500, padding: "2px 0" }, children: d }, i)),
187
+ grid.map(({ date, isCurrentMonth }, idx) => {
188
+ const isToday = isSameDay(date, today);
189
+ const isSelected = isSameDay(date, currentDate);
190
+ const hasEvents = getEventsForDay(date).length > 0;
191
+ return /* @__PURE__ */ jsxs(
192
+ "div",
193
+ {
194
+ onClick: () => onDateSelect(date),
195
+ style: {
196
+ textAlign: "center",
197
+ fontSize: 10,
198
+ padding: "3px 0",
199
+ cursor: "pointer",
200
+ color: isSelected ? tokens.colors.text.inverse : isCurrentMonth ? tokens.colors.text.primary : tokens.colors.text.muted + "55",
201
+ fontWeight: isToday || isSelected ? 700 : 400,
202
+ background: isSelected ? tokens.colors.interactive.default : isToday ? `${tokens.colors.interactive.default}20` : "transparent",
203
+ borderRadius: isSelected || isToday ? tokens.borderRadius.full : 0,
204
+ position: "relative"
205
+ },
206
+ children: [
207
+ date.getDate(),
208
+ hasEvents && !isSelected && /* @__PURE__ */ jsx("span", { style: {
209
+ position: "absolute",
210
+ bottom: 0,
211
+ left: "50%",
212
+ transform: "translateX(-50%)",
213
+ width: 3,
214
+ height: 3,
215
+ borderRadius: "50%",
216
+ background: tokens.colors.interactive.default
217
+ } })
218
+ ]
219
+ },
220
+ idx
221
+ );
222
+ })
223
+ ] })
224
+ ] });
225
+ });
226
+ const MissionCalendar = memo(function MissionCalendar2({
227
+ events,
228
+ timelines = [],
229
+ defaultView = "month",
230
+ initialDate,
231
+ height = 600,
232
+ title,
233
+ showSidebar = true,
234
+ showTimelines = true,
235
+ showFilters = true,
236
+ showCreate = true,
237
+ weekStartsMonday = true,
238
+ onEventClick,
239
+ onEventCreate,
240
+ onDayDrillDown,
241
+ className = ""
242
+ }) {
243
+ const { tokens, theme } = useTheme();
244
+ const isTransparentTheme = theme === "transparent" || theme === "transparent-bold" || theme === "transparent-minimal";
245
+ const [viewMode, setViewMode] = useState(defaultView);
246
+ const [currentDate, setCurrentDate] = useState(initialDate || /* @__PURE__ */ new Date());
247
+ const [selectedTimelines, setSelectedTimelines] = useState(
248
+ new Set(timelines.map((t) => t.id))
249
+ );
250
+ const [typeFilter, setTypeFilter] = useState(
251
+ /* @__PURE__ */ new Set(["command", "script", "reserve", "metadata", "note", "contact", "eclipse", "pass"])
252
+ );
253
+ const [contextMenu, setContextMenu] = useState(null);
254
+ const bodyRef = useRef(null);
255
+ const year = currentDate.getFullYear();
256
+ const month = currentDate.getMonth();
257
+ const filteredEvents = useMemo(
258
+ () => events.filter(
259
+ (e) => typeFilter.has(e.type) && (selectedTimelines.size === 0 || !e.timeline || selectedTimelines.has(e.timeline))
260
+ ),
261
+ [events, typeFilter, selectedTimelines]
262
+ );
263
+ const eventsByDay = useMemo(() => {
264
+ const map = /* @__PURE__ */ new Map();
265
+ filteredEvents.forEach((e) => {
266
+ const key = `${e.start.getFullYear()}-${e.start.getMonth()}-${e.start.getDate()}`;
267
+ if (!map.has(key)) map.set(key, []);
268
+ map.get(key).push(e);
269
+ if (e.end) {
270
+ const days = Math.ceil((e.end.getTime() - e.start.getTime()) / 864e5);
271
+ for (let d = 1; d <= days && d < 30; d++) {
272
+ const next = new Date(e.start);
273
+ next.setDate(next.getDate() + d);
274
+ const nk = `${next.getFullYear()}-${next.getMonth()}-${next.getDate()}`;
275
+ if (!map.has(nk)) map.set(nk, []);
276
+ map.get(nk).push(e);
277
+ }
278
+ }
279
+ });
280
+ return map;
281
+ }, [filteredEvents]);
282
+ const getEventsForDay = useCallback((d) => {
283
+ const key = `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
284
+ return eventsByDay.get(key) || [];
285
+ }, [eventsByDay]);
286
+ const navigate = useCallback((dir) => {
287
+ if (dir === 0) {
288
+ setCurrentDate(/* @__PURE__ */ new Date());
289
+ return;
290
+ }
291
+ const d = new Date(currentDate);
292
+ if (viewMode === "month") d.setMonth(d.getMonth() + dir);
293
+ else if (viewMode === "week" || viewMode === "gantt") d.setDate(d.getDate() + dir * 7);
294
+ else d.setDate(d.getDate() + dir);
295
+ setCurrentDate(d);
296
+ }, [currentDate, viewMode]);
297
+ const toggleTimeline = useCallback((id) => {
298
+ setSelectedTimelines((prev) => {
299
+ const next = new Set(prev);
300
+ if (next.has(id)) next.delete(id);
301
+ else next.add(id);
302
+ return next;
303
+ });
304
+ }, []);
305
+ const toggleType = useCallback((type) => {
306
+ setTypeFilter((prev) => {
307
+ const next = new Set(prev);
308
+ if (next.has(type)) next.delete(type);
309
+ else next.add(type);
310
+ return next;
311
+ });
312
+ }, []);
313
+ const dayNames = weekStartsMonday ? ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] : ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
314
+ const monthLabel = currentDate.toLocaleDateString("en-US", { month: "long", year: "numeric" });
315
+ const today = /* @__PURE__ */ new Date();
316
+ const weekNum = getWeekNumber(currentDate);
317
+ const doy = getDayOfYear(currentDate);
318
+ const monthGrid = useMemo(() => {
319
+ const firstDay = getFirstDayOfMonth(year, month, weekStartsMonday);
320
+ const daysInMonth = getDaysInMonth(year, month);
321
+ const daysInPrevMonth = getDaysInMonth(year, month === 0 ? 11 : month - 1);
322
+ const cells = [];
323
+ for (let i = firstDay - 1; i >= 0; i--) {
324
+ cells.push({ date: new Date(year, month - 1, daysInPrevMonth - i), isCurrentMonth: false });
325
+ }
326
+ for (let i = 1; i <= daysInMonth; i++) {
327
+ cells.push({ date: new Date(year, month, i), isCurrentMonth: true });
328
+ }
329
+ while (cells.length < 42) {
330
+ cells.push({ date: new Date(year, month + 1, cells.length - firstDay - daysInMonth + 1), isCurrentMonth: false });
331
+ }
332
+ return cells;
333
+ }, [year, month, weekStartsMonday]);
334
+ const weekDates = useMemo(() => getWeekDates(currentDate, weekStartsMonday), [currentDate, weekStartsMonday]);
335
+ const dayEvents = useMemo(() => {
336
+ const evts = getEventsForDay(currentDate);
337
+ return [...evts].sort((a, b) => a.start.getTime() - b.start.getTime());
338
+ }, [currentDate, getEventsForDay]);
339
+ const listEvents = useMemo(() => {
340
+ const now = /* @__PURE__ */ new Date();
341
+ const end = new Date(now);
342
+ end.setDate(end.getDate() + 7);
343
+ return filteredEvents.filter((e) => e.start >= now && e.start <= end).sort((a, b) => a.start.getTime() - b.start.getTime());
344
+ }, [filteredEvents]);
345
+ const ganttData = useMemo(() => {
346
+ const weekStart = new Date(weekDates[0]);
347
+ weekStart.setHours(0, 0, 0, 0);
348
+ const weekEnd = new Date(weekDates[6]);
349
+ weekEnd.setHours(23, 59, 59, 999);
350
+ const weekEvents = filteredEvents.filter(
351
+ (e) => e.start <= weekEnd && (e.end || e.start) >= weekStart
352
+ );
353
+ const tlMap = /* @__PURE__ */ new Map();
354
+ const noTl = [];
355
+ weekEvents.forEach((e) => {
356
+ const tlId = e.timeline || "";
357
+ if (!tlId) {
358
+ noTl.push(e);
359
+ return;
360
+ }
361
+ if (!tlMap.has(tlId)) tlMap.set(tlId, []);
362
+ tlMap.get(tlId).push(e);
363
+ });
364
+ const rows = [];
365
+ timelines.forEach((tl) => {
366
+ if (tlMap.has(tl.id)) {
367
+ rows.push({ label: tl.name, color: tl.color || tokens.colors.interactive.default, events: tlMap.get(tl.id) });
368
+ }
369
+ });
370
+ if (noTl.length > 0) rows.push({ label: "Unassigned", color: tokens.colors.text.muted ?? tokens.colors.text.secondary, events: noTl });
371
+ return { rows, weekStart, weekEnd };
372
+ }, [filteredEvents, weekDates, timelines, tokens]);
373
+ const handleContextMenu = useCallback((e, date, slotTime) => {
374
+ e.preventDefault();
375
+ if (!onEventCreate) return;
376
+ const d = new Date(date);
377
+ if (slotTime) {
378
+ const [h, m] = slotTime.split(":").map(Number);
379
+ d.setHours(h, m, 0, 0);
380
+ }
381
+ setContextMenu({ x: e.clientX, y: e.clientY, date: d });
382
+ }, [onEventCreate]);
383
+ const headerLabel = useMemo(() => {
384
+ if (viewMode === "month") return monthLabel;
385
+ if (viewMode === "week" || viewMode === "gantt") {
386
+ return `${weekDates[0].toLocaleDateString("en-US", { month: "short", day: "numeric" })} – ${weekDates[6].toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })} Week ${weekNum}`;
387
+ }
388
+ return currentDate.toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric", year: "numeric" });
389
+ }, [viewMode, monthLabel, weekDates, weekNum, currentDate]);
390
+ const renderSidebar = () => /* @__PURE__ */ jsxs("div", { style: {
391
+ width: 190,
392
+ minWidth: 190,
393
+ borderRight: `1px solid ${tokens.colors.border.muted}`,
394
+ background: tokens.colors.background.surface,
395
+ padding: "8px 10px",
396
+ display: "flex",
397
+ flexDirection: "column",
398
+ gap: 12,
399
+ overflow: "auto"
400
+ }, children: [
401
+ /* @__PURE__ */ jsx(
402
+ MiniCalendar,
403
+ {
404
+ currentDate,
405
+ tokens,
406
+ weekStartsMonday,
407
+ onDateSelect: (d) => {
408
+ setCurrentDate(d);
409
+ if (viewMode === "month") setViewMode("day");
410
+ },
411
+ getEventsForDay
412
+ }
413
+ ),
414
+ showFilters && /* @__PURE__ */ jsxs("div", { children: [
415
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 10, fontWeight: 500, color: tokens.colors.text.muted, textTransform: "uppercase", letterSpacing: 0.5, marginBottom: 4 }, children: "Event Types" }),
416
+ ["command", "script", "reserve", "metadata", "note", "contact"].map((type) => /* @__PURE__ */ jsxs("label", { style: {
417
+ display: "flex",
418
+ alignItems: "center",
419
+ gap: 6,
420
+ padding: "2px 0",
421
+ cursor: "pointer",
422
+ fontSize: 11,
423
+ color: typeFilter.has(type) ? tokens.colors.text.primary : tokens.colors.text.muted + "66"
424
+ }, children: [
425
+ /* @__PURE__ */ jsx(
426
+ "input",
427
+ {
428
+ type: "checkbox",
429
+ checked: typeFilter.has(type),
430
+ onChange: () => toggleType(type),
431
+ style: { accentColor: tokens.colors.interactive.default, width: 12, height: 12 }
432
+ }
433
+ ),
434
+ TYPE_ICON_ASTRO.includes(type) ? /* @__PURE__ */ jsx(AstroIcon, { name: getTypeIcon(type), size: "extra-small", label: "", style: { opacity: 0.7 } }) : /* @__PURE__ */ jsx("span", { style: { opacity: 0.7, fontSize: 10 }, children: getTypeIcon(type) }),
435
+ /* @__PURE__ */ jsx("span", { style: { textTransform: "capitalize" }, children: type })
436
+ ] }, type))
437
+ ] }),
438
+ showTimelines && timelines.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
439
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 10, fontWeight: 500, color: tokens.colors.text.muted, textTransform: "uppercase", letterSpacing: 0.5, marginBottom: 4 }, children: "Timelines" }),
440
+ timelines.map((tl) => /* @__PURE__ */ jsxs("label", { style: {
441
+ display: "flex",
442
+ alignItems: "center",
443
+ gap: 6,
444
+ padding: "3px 0",
445
+ cursor: "pointer",
446
+ fontSize: 11,
447
+ color: selectedTimelines.has(tl.id) ? tokens.colors.text.primary : tokens.colors.text.muted + "66"
448
+ }, children: [
449
+ /* @__PURE__ */ jsx(
450
+ "input",
451
+ {
452
+ type: "checkbox",
453
+ checked: selectedTimelines.has(tl.id),
454
+ onChange: () => toggleTimeline(tl.id),
455
+ style: { accentColor: tl.color || tokens.colors.interactive.default, width: 12, height: 12 }
456
+ }
457
+ ),
458
+ /* @__PURE__ */ jsx("span", { style: { width: 8, height: 8, borderRadius: "50%", background: tl.color || tokens.colors.interactive.default, flexShrink: 0 } }),
459
+ /* @__PURE__ */ jsx("span", { children: tl.name })
460
+ ] }, tl.id))
461
+ ] }),
462
+ /* @__PURE__ */ jsxs("div", { style: {
463
+ marginTop: "auto",
464
+ fontSize: 10,
465
+ color: tokens.colors.text.muted,
466
+ borderTop: `1px solid ${tokens.colors.border.muted}`,
467
+ paddingTop: 8
468
+ }, children: [
469
+ /* @__PURE__ */ jsxs("div", { children: [
470
+ "DOY: ",
471
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: tokens.typography.fontFamily.mono, color: tokens.colors.text.secondary }, children: doy })
472
+ ] }),
473
+ /* @__PURE__ */ jsxs("div", { children: [
474
+ "Week: ",
475
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: tokens.typography.fontFamily.mono, color: tokens.colors.text.secondary }, children: weekNum })
476
+ ] }),
477
+ /* @__PURE__ */ jsxs("div", { children: [
478
+ "UTC: ",
479
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: tokens.typography.fontFamily.mono, color: tokens.colors.text.secondary }, children: today.toISOString().slice(11, 19) })
480
+ ] })
481
+ ] })
482
+ ] });
483
+ return /* @__PURE__ */ jsxs(
484
+ "div",
485
+ {
486
+ className: `mission-calendar ${className}`,
487
+ onClick: () => setContextMenu(null),
488
+ style: {
489
+ height: typeof height === "number" ? height : void 0,
490
+ background: tokens.colors.background.base,
491
+ ...tokens.colors.border.cardStyle ?? { border: `1px solid ${tokens.colors.border.muted}` },
492
+ borderRadius: tokens.borderRadius.lg,
493
+ overflow: "hidden",
494
+ display: "flex",
495
+ flexDirection: "column",
496
+ fontFamily: tokens.typography.fontFamily.primary,
497
+ color: tokens.colors.text.primary,
498
+ backdropFilter: isTransparentTheme ? "blur(10px)" : void 0,
499
+ WebkitBackdropFilter: isTransparentTheme ? "blur(10px)" : void 0
500
+ },
501
+ children: [
502
+ /* @__PURE__ */ jsxs("div", { style: {
503
+ padding: "8px 14px",
504
+ borderBottom: `1px solid ${tokens.colors.border.muted}`,
505
+ background: tokens.colors.background.surface,
506
+ backdropFilter: "blur(8px)",
507
+ display: "flex",
508
+ alignItems: "center",
509
+ justifyContent: "space-between",
510
+ flexWrap: "wrap",
511
+ gap: 8
512
+ }, children: [
513
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [
514
+ title && /* @__PURE__ */ jsx("span", { style: { fontWeight: 500, fontSize: tokens.typography.fontSize.sm }, children: title }),
515
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 2 }, children: [
516
+ /* @__PURE__ */ jsx("button", { onClick: () => navigate(-1), style: navBtnStyle(tokens), children: "◀" }),
517
+ /* @__PURE__ */ jsx("button", { onClick: () => navigate(0), style: { ...navBtnStyle(tokens), padding: "3px 10px", fontSize: tokens.typography.fontSize.xs }, children: "Today" }),
518
+ /* @__PURE__ */ jsx("button", { onClick: () => navigate(1), style: navBtnStyle(tokens), children: "▶" })
519
+ ] }),
520
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: 500, fontSize: tokens.typography.fontSize.sm }, children: headerLabel }),
521
+ /* @__PURE__ */ jsxs("span", { style: {
522
+ fontSize: 9,
523
+ fontFamily: tokens.typography.fontFamily.mono,
524
+ color: tokens.colors.text.muted,
525
+ background: `${tokens.colors.text.muted}15`,
526
+ padding: "1px 6px",
527
+ borderRadius: tokens.borderRadius.sm
528
+ }, children: [
529
+ "DOY ",
530
+ doy
531
+ ] })
532
+ ] }),
533
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
534
+ showCreate && /* @__PURE__ */ jsx(
535
+ "button",
536
+ {
537
+ onClick: () => onEventCreate == null ? void 0 : onEventCreate({ start: currentDate, type: "reserve" }),
538
+ style: {
539
+ background: tokens.colors.interactive.default,
540
+ color: tokens.colors.text.inverse,
541
+ border: "none",
542
+ borderRadius: tokens.borderRadius.md,
543
+ padding: "4px 12px",
544
+ fontSize: tokens.typography.fontSize.xs,
545
+ fontWeight: 500,
546
+ cursor: "pointer"
547
+ },
548
+ children: "+ Activity"
549
+ }
550
+ ),
551
+ /* @__PURE__ */ jsx("div", { style: {
552
+ display: "flex",
553
+ borderRadius: tokens.borderRadius.md,
554
+ overflow: "hidden",
555
+ border: `1px solid ${tokens.colors.border.muted}`
556
+ }, children: ["month", "week", "day", "gantt", "list"].map((v) => /* @__PURE__ */ jsx(
557
+ "button",
558
+ {
559
+ onClick: () => setViewMode(v),
560
+ style: {
561
+ background: viewMode === v ? tokens.colors.interactive.default : tokens.colors.background.base,
562
+ color: viewMode === v ? tokens.colors.text.inverse : tokens.colors.text.secondary,
563
+ border: "none",
564
+ padding: "3px 10px",
565
+ fontSize: tokens.typography.fontSize.xxs,
566
+ fontWeight: 500,
567
+ cursor: "pointer",
568
+ textTransform: "capitalize"
569
+ },
570
+ children: v
571
+ },
572
+ v
573
+ )) })
574
+ ] })
575
+ ] }),
576
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", overflow: "hidden" }, children: [
577
+ showSidebar && renderSidebar(),
578
+ /* @__PURE__ */ jsxs("div", { ref: bodyRef, style: { flex: 1, overflow: "auto" }, children: [
579
+ viewMode === "month" && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
580
+ /* @__PURE__ */ jsx("div", { style: {
581
+ display: "grid",
582
+ gridTemplateColumns: "repeat(7, 1fr)",
583
+ borderBottom: `1px solid ${tokens.colors.border.muted}`,
584
+ background: tokens.colors.background.surface
585
+ }, children: dayNames.map((d) => /* @__PURE__ */ jsx("div", { style: {
586
+ padding: "4px 6px",
587
+ textAlign: "center",
588
+ fontSize: tokens.typography.fontSize.xxs,
589
+ fontWeight: 500,
590
+ color: tokens.colors.text.muted,
591
+ textTransform: "uppercase"
592
+ }, children: d }, d)) }),
593
+ /* @__PURE__ */ jsx("div", { style: {
594
+ display: "grid",
595
+ gridTemplateColumns: "repeat(7, 1fr)",
596
+ gridTemplateRows: "repeat(6, 1fr)",
597
+ flex: 1
598
+ }, children: monthGrid.map(({ date, isCurrentMonth }, idx) => {
599
+ const dayEvts = getEventsForDay(date);
600
+ const isToday = isSameDay(date, today);
601
+ return /* @__PURE__ */ jsxs(
602
+ "div",
603
+ {
604
+ onClick: () => {
605
+ setCurrentDate(date);
606
+ if (onDayDrillDown) onDayDrillDown(date, dayEvts);
607
+ else setViewMode("day");
608
+ },
609
+ onContextMenu: (e) => handleContextMenu(e, date),
610
+ style: {
611
+ borderRight: `1px solid ${tokens.colors.border.muted}11`,
612
+ borderBottom: `1px solid ${tokens.colors.border.muted}11`,
613
+ padding: 3,
614
+ cursor: "pointer",
615
+ background: isToday ? `${tokens.colors.interactive.default}08` : "transparent",
616
+ opacity: isCurrentMonth ? 1 : 0.35,
617
+ overflow: "hidden",
618
+ minHeight: 70
619
+ },
620
+ children: [
621
+ /* @__PURE__ */ jsx("div", { style: {
622
+ fontSize: tokens.typography.fontSize.xs,
623
+ fontWeight: isToday ? 700 : 400,
624
+ color: isToday ? tokens.colors.interactive.default : tokens.colors.text.primary,
625
+ marginBottom: 2,
626
+ textAlign: "right",
627
+ paddingRight: 2
628
+ }, children: isToday ? /* @__PURE__ */ jsx("span", { style: {
629
+ background: tokens.colors.interactive.default,
630
+ color: tokens.colors.text.inverse,
631
+ borderRadius: tokens.borderRadius.full,
632
+ width: 20,
633
+ height: 20,
634
+ display: "inline-flex",
635
+ alignItems: "center",
636
+ justifyContent: "center",
637
+ fontSize: tokens.typography.fontSize.xxs
638
+ }, children: date.getDate() }) : date.getDate() }),
639
+ dayEvts.slice(0, 3).map((e) => /* @__PURE__ */ jsx(CalendarEventChip, { event: e, tokens, compact: true, onClick: () => onEventClick == null ? void 0 : onEventClick(e) }, e.id)),
640
+ dayEvts.length > 3 && /* @__PURE__ */ jsxs("div", { style: { fontSize: tokens.typography.fontSize.micro, color: tokens.colors.text.muted, textAlign: "center" }, children: [
641
+ "+",
642
+ dayEvts.length - 3,
643
+ " more"
644
+ ] })
645
+ ]
646
+ },
647
+ idx
648
+ );
649
+ }) })
650
+ ] }),
651
+ viewMode === "week" && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
652
+ /* @__PURE__ */ jsxs("div", { style: {
653
+ display: "grid",
654
+ gridTemplateColumns: `50px repeat(7, 1fr)`,
655
+ borderBottom: `1px solid ${tokens.colors.border.muted}`,
656
+ background: tokens.colors.background.surface,
657
+ position: "sticky",
658
+ top: 0,
659
+ zIndex: 2
660
+ }, children: [
661
+ /* @__PURE__ */ jsx("div", { style: { borderRight: `1px solid ${tokens.colors.border.muted}22` } }),
662
+ weekDates.map((d, i) => {
663
+ const isToday = isSameDay(d, today);
664
+ return /* @__PURE__ */ jsxs("div", { style: {
665
+ padding: "4px 4px",
666
+ textAlign: "center",
667
+ background: isToday ? `${tokens.colors.interactive.default}10` : "transparent",
668
+ borderRight: `1px solid ${tokens.colors.border.muted}11`
669
+ }, children: [
670
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 9, color: tokens.colors.text.muted, textTransform: "uppercase" }, children: dayNames[i] }),
671
+ /* @__PURE__ */ jsx("div", { style: {
672
+ fontSize: 16,
673
+ fontWeight: isToday ? 700 : 400,
674
+ color: isToday ? tokens.colors.interactive.default : tokens.colors.text.primary
675
+ }, children: isToday ? /* @__PURE__ */ jsx("span", { style: {
676
+ background: tokens.colors.interactive.default,
677
+ color: tokens.colors.text.inverse,
678
+ borderRadius: tokens.borderRadius.full,
679
+ width: 24,
680
+ height: 24,
681
+ display: "inline-flex",
682
+ alignItems: "center",
683
+ justifyContent: "center",
684
+ fontSize: 13
685
+ }, children: d.getDate() }) : d.getDate() })
686
+ ] }, i);
687
+ })
688
+ ] }),
689
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: TIME_SLOTS.map((slot, _si) => {
690
+ const isHour = slot.endsWith(":00");
691
+ return /* @__PURE__ */ jsxs("div", { style: {
692
+ display: "grid",
693
+ gridTemplateColumns: `50px repeat(7, 1fr)`,
694
+ height: SLOT_HEIGHT,
695
+ borderBottom: `1px solid ${tokens.colors.border.muted}${isHour ? "22" : "0A"}`
696
+ }, children: [
697
+ /* @__PURE__ */ jsx("div", { style: {
698
+ fontSize: 9,
699
+ color: tokens.colors.text.muted,
700
+ textAlign: "right",
701
+ paddingRight: 6,
702
+ fontFamily: tokens.typography.fontFamily.mono,
703
+ borderRight: `1px solid ${tokens.colors.border.muted}22`,
704
+ lineHeight: `${SLOT_HEIGHT}px`,
705
+ visibility: isHour ? "visible" : "hidden"
706
+ }, children: slot }),
707
+ weekDates.map((d, di) => {
708
+ const slotStart = new Date(d);
709
+ slotStart.setHours(parseInt(slot), slot.endsWith(":30") ? 30 : 0, 0, 0);
710
+ const slotEvents = getEventsForDay(d).filter((e) => {
711
+ const eStart = e.start.getHours() * 60 + e.start.getMinutes();
712
+ const sStart = parseInt(slot) * 60 + (slot.endsWith(":30") ? 30 : 0);
713
+ return eStart >= sStart && eStart < sStart + 30;
714
+ });
715
+ return /* @__PURE__ */ jsx(
716
+ "div",
717
+ {
718
+ onClick: () => {
719
+ setCurrentDate(d);
720
+ setViewMode("day");
721
+ },
722
+ onContextMenu: (e) => handleContextMenu(e, d, slot),
723
+ style: {
724
+ borderRight: `1px solid ${tokens.colors.border.muted}0A`,
725
+ padding: "0 2px",
726
+ cursor: "pointer",
727
+ overflow: "hidden",
728
+ background: isSameDay(d, today) ? `${tokens.colors.interactive.default}04` : "transparent"
729
+ },
730
+ children: slotEvents.map((e) => /* @__PURE__ */ jsx(CalendarEventChip, { event: e, tokens, compact: true, onClick: () => onEventClick == null ? void 0 : onEventClick(e) }, e.id))
731
+ },
732
+ di
733
+ );
734
+ })
735
+ ] }, slot);
736
+ }) })
737
+ ] }),
738
+ viewMode === "day" && /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: TIME_SLOTS.map((slot) => {
739
+ const isHour = slot.endsWith(":00");
740
+ const slotEvents = dayEvents.filter((e) => {
741
+ const eStart = e.start.getHours() * 60 + e.start.getMinutes();
742
+ const sStart = parseInt(slot) * 60 + (slot.endsWith(":30") ? 30 : 0);
743
+ return eStart >= sStart && eStart < sStart + 30;
744
+ });
745
+ return /* @__PURE__ */ jsxs(
746
+ "div",
747
+ {
748
+ onContextMenu: (e) => handleContextMenu(e, currentDate, slot),
749
+ style: {
750
+ display: "grid",
751
+ gridTemplateColumns: "50px 1fr",
752
+ minHeight: slotEvents.length > 0 ? Math.max(SLOT_HEIGHT, slotEvents.length * 24 + 4) : SLOT_HEIGHT,
753
+ borderBottom: `1px solid ${tokens.colors.border.muted}${isHour ? "22" : "0A"}`
754
+ },
755
+ children: [
756
+ /* @__PURE__ */ jsx("div", { style: {
757
+ fontSize: 10,
758
+ color: tokens.colors.text.muted,
759
+ textAlign: "right",
760
+ paddingRight: 8,
761
+ fontFamily: tokens.typography.fontFamily.mono,
762
+ borderRight: `1px solid ${tokens.colors.border.muted}22`,
763
+ lineHeight: `${SLOT_HEIGHT}px`,
764
+ visibility: isHour ? "visible" : "hidden"
765
+ }, children: slot }),
766
+ /* @__PURE__ */ jsx("div", { style: { padding: "1px 6px", cursor: "pointer" }, children: slotEvents.map((e) => {
767
+ const color = e.color || getStatusColor(e.status, tokens);
768
+ return /* @__PURE__ */ jsxs(
769
+ "div",
770
+ {
771
+ onClick: () => onEventClick == null ? void 0 : onEventClick(e),
772
+ style: {
773
+ background: `${color}18`,
774
+ borderRadius: tokens.borderRadius.sm,
775
+ padding: "3px 8px",
776
+ marginBottom: 2,
777
+ cursor: "pointer",
778
+ display: "flex",
779
+ alignItems: "center",
780
+ gap: 6,
781
+ fontSize: tokens.typography.fontSize.xxs
782
+ },
783
+ children: [
784
+ TYPE_ICON_ASTRO.includes(e.type) ? /* @__PURE__ */ jsx(AstroIcon, { name: getTypeIcon(e.type), size: "extra-small", label: "", style: { opacity: 0.7 } }) : /* @__PURE__ */ jsx("span", { style: { opacity: 0.7 }, children: getTypeIcon(e.type) }),
785
+ /* @__PURE__ */ jsx("span", { style: { color, fontSize: tokens.typography.fontSize.micro }, children: getStatusShape(e.status) }),
786
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: 500 }, children: e.title }),
787
+ /* @__PURE__ */ jsxs("span", { style: { color: tokens.colors.text.muted, fontFamily: tokens.typography.fontFamily.mono, fontSize: tokens.typography.fontSize.micro, marginLeft: "auto" }, children: [
788
+ formatTime(e.start),
789
+ e.end ? `–${formatTime(e.end)}` : ""
790
+ ] }),
791
+ e.status && /* @__PURE__ */ jsx("span", { style: { fontSize: tokens.typography.fontSize.micro, color, fontWeight: 500, textTransform: "uppercase" }, children: e.status })
792
+ ]
793
+ },
794
+ e.id
795
+ );
796
+ }) })
797
+ ]
798
+ },
799
+ slot
800
+ );
801
+ }) }) }),
802
+ viewMode === "gantt" && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
803
+ /* @__PURE__ */ jsxs("div", { style: {
804
+ display: "grid",
805
+ gridTemplateColumns: `120px repeat(7, 1fr)`,
806
+ borderBottom: `1px solid ${tokens.colors.border.muted}`,
807
+ background: tokens.colors.background.surface,
808
+ position: "sticky",
809
+ top: 0,
810
+ zIndex: 2
811
+ }, children: [
812
+ /* @__PURE__ */ jsx("div", { style: { padding: "6px 8px", fontSize: 10, fontWeight: 500, color: tokens.colors.text.muted, borderRight: `1px solid ${tokens.colors.border.muted}22` }, children: "Timeline" }),
813
+ weekDates.map((d, i) => {
814
+ const isToday = isSameDay(d, today);
815
+ return /* @__PURE__ */ jsxs("div", { style: {
816
+ padding: "4px 4px",
817
+ textAlign: "center",
818
+ background: isToday ? `${tokens.colors.interactive.default}10` : "transparent",
819
+ borderRight: `1px solid ${tokens.colors.border.muted}11`,
820
+ fontSize: 10
821
+ }, children: [
822
+ /* @__PURE__ */ jsxs("span", { style: { color: tokens.colors.text.muted }, children: [
823
+ dayNames[i],
824
+ " "
825
+ ] }),
826
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: isToday ? 700 : 400, color: isToday ? tokens.colors.interactive.default : tokens.colors.text.primary }, children: d.getDate() })
827
+ ] }, i);
828
+ })
829
+ ] }),
830
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: ganttData.rows.length === 0 ? /* @__PURE__ */ jsx("div", { style: { textAlign: "center", color: tokens.colors.text.muted, padding: 40, fontSize: 12 }, children: "No activities this week" }) : ganttData.rows.map((row, ri) => /* @__PURE__ */ jsxs("div", { style: {
831
+ display: "grid",
832
+ gridTemplateColumns: `120px repeat(7, 1fr)`,
833
+ borderBottom: `1px solid ${tokens.colors.border.muted}15`,
834
+ minHeight: 36
835
+ }, children: [
836
+ /* @__PURE__ */ jsxs("div", { style: {
837
+ padding: "6px 8px",
838
+ fontSize: 11,
839
+ fontWeight: 500,
840
+ borderRight: `1px solid ${tokens.colors.border.muted}22`,
841
+ display: "flex",
842
+ alignItems: "center",
843
+ gap: 6,
844
+ color: tokens.colors.text.primary
845
+ }, children: [
846
+ /* @__PURE__ */ jsx("span", { style: { width: 6, height: 6, borderRadius: "50%", background: row.color, flexShrink: 0 } }),
847
+ row.label
848
+ ] }),
849
+ weekDates.map((d, di) => {
850
+ const cellEvents = row.events.filter((e) => {
851
+ const eDay = new Date(e.start);
852
+ eDay.setHours(0, 0, 0, 0);
853
+ const cellDay = new Date(d);
854
+ cellDay.setHours(0, 0, 0, 0);
855
+ if (e.end) {
856
+ const eEnd = new Date(e.end);
857
+ eEnd.setHours(23, 59, 59, 999);
858
+ return cellDay >= eDay && cellDay <= eEnd;
859
+ }
860
+ return eDay.getTime() === cellDay.getTime();
861
+ });
862
+ return /* @__PURE__ */ jsx(
863
+ "div",
864
+ {
865
+ onContextMenu: (e) => handleContextMenu(e, d),
866
+ style: {
867
+ borderRight: `1px solid ${tokens.colors.border.muted}0A`,
868
+ padding: "2px 2px",
869
+ display: "flex",
870
+ flexDirection: "column",
871
+ gap: 2,
872
+ background: isSameDay(d, today) ? `${tokens.colors.interactive.default}04` : "transparent"
873
+ },
874
+ children: cellEvents.map((e) => {
875
+ const color = e.color || getStatusColor(e.status, tokens);
876
+ return /* @__PURE__ */ jsxs(
877
+ "div",
878
+ {
879
+ onClick: () => onEventClick == null ? void 0 : onEventClick(e),
880
+ style: {
881
+ background: `${color}33`,
882
+ borderRadius: 3,
883
+ padding: "2px 4px",
884
+ fontSize: 9,
885
+ fontWeight: 500,
886
+ color: tokens.colors.text.primary,
887
+ cursor: "pointer",
888
+ whiteSpace: "nowrap",
889
+ overflow: "hidden",
890
+ textOverflow: "ellipsis"
891
+ },
892
+ title: `${e.title}
893
+ ${formatTime(e.start)}${e.end ? " – " + formatTime(e.end) : ""}`,
894
+ children: [
895
+ /* @__PURE__ */ jsx("span", { style: { opacity: 0.7, marginRight: 3 }, children: getStatusShape(e.status) }),
896
+ e.title
897
+ ]
898
+ },
899
+ e.id
900
+ );
901
+ })
902
+ },
903
+ di
904
+ );
905
+ })
906
+ ] }, ri)) })
907
+ ] }),
908
+ viewMode === "list" && /* @__PURE__ */ jsxs("div", { style: { padding: 12 }, children: [
909
+ /* @__PURE__ */ jsxs("div", { style: { fontSize: tokens.typography.fontSize.xs, color: tokens.colors.text.muted, marginBottom: 8 }, children: [
910
+ "Upcoming 7 days — ",
911
+ listEvents.length,
912
+ " activities"
913
+ ] }),
914
+ listEvents.length === 0 ? /* @__PURE__ */ jsx("div", { style: { textAlign: "center", color: tokens.colors.text.muted, padding: 40, fontSize: tokens.typography.fontSize.sm }, children: "No upcoming activities" }) : /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: listEvents.map((e) => {
915
+ const color = e.color || getStatusColor(e.status, tokens);
916
+ return /* @__PURE__ */ jsxs(
917
+ "div",
918
+ {
919
+ onClick: () => onEventClick == null ? void 0 : onEventClick(e),
920
+ style: {
921
+ display: "grid",
922
+ gridTemplateColumns: "100px 1fr auto",
923
+ padding: "6px 10px",
924
+ borderRadius: tokens.borderRadius.md,
925
+ background: `${color}08`,
926
+ cursor: "pointer",
927
+ alignItems: "center",
928
+ gap: 10,
929
+ fontSize: tokens.typography.fontSize.xs
930
+ },
931
+ children: [
932
+ /* @__PURE__ */ jsxs("span", { style: { fontFamily: tokens.typography.fontFamily.mono, fontSize: tokens.typography.fontSize.xxs, color: tokens.colors.text.muted }, children: [
933
+ e.start.toLocaleDateString("en-US", { month: "short", day: "numeric" }),
934
+ " ",
935
+ formatTime(e.start)
936
+ ] }),
937
+ /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
938
+ TYPE_ICON_ASTRO.includes(e.type) ? /* @__PURE__ */ jsx(AstroIcon, { name: getTypeIcon(e.type), size: "extra-small", label: "" }) : /* @__PURE__ */ jsx("span", { children: getTypeIcon(e.type) }),
939
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: 500 }, children: e.title })
940
+ ] }),
941
+ e.status && /* @__PURE__ */ jsxs("span", { style: { fontSize: tokens.typography.fontSize.micro, color, fontWeight: 500 }, children: [
942
+ getStatusShape(e.status),
943
+ " ",
944
+ e.status
945
+ ] })
946
+ ]
947
+ },
948
+ e.id
949
+ );
950
+ }) })
951
+ ] })
952
+ ] })
953
+ ] }),
954
+ /* @__PURE__ */ jsxs("div", { style: {
955
+ padding: "4px 14px",
956
+ borderTop: `1px solid ${tokens.colors.border.muted}`,
957
+ background: tokens.colors.background.surface,
958
+ fontSize: tokens.typography.fontSize.xxs,
959
+ color: tokens.colors.text.muted,
960
+ display: "flex",
961
+ justifyContent: "space-between"
962
+ }, children: [
963
+ /* @__PURE__ */ jsxs("span", { children: [
964
+ filteredEvents.length,
965
+ " activities | DOY ",
966
+ doy,
967
+ " | Week ",
968
+ weekNum
969
+ ] }),
970
+ /* @__PURE__ */ jsx("span", { children: events.filter((e) => e.status === "error" || e.status === "failed" || e.status === "crashed").length > 0 ? `⚠ ${events.filter((e) => e.status === "error" || e.status === "failed" || e.status === "crashed").length} errors` : "✓ All nominal" })
971
+ ] }),
972
+ contextMenu && /* @__PURE__ */ jsxs(
973
+ "div",
974
+ {
975
+ style: {
976
+ position: "fixed",
977
+ left: contextMenu.x,
978
+ top: contextMenu.y,
979
+ zIndex: 1e3,
980
+ background: tokens.colors.background.surface,
981
+ backdropFilter: "blur(8px)",
982
+ border: `1px solid ${tokens.colors.border.muted}`,
983
+ borderRadius: tokens.borderRadius.md,
984
+ boxShadow: "0 4px 16px rgba(0,0,0,0.4)",
985
+ padding: 4,
986
+ minWidth: 160
987
+ },
988
+ children: [
989
+ /* @__PURE__ */ jsxs("div", { style: { fontSize: 9, color: tokens.colors.text.muted, padding: "4px 8px", fontFamily: tokens.typography.fontFamily.mono }, children: [
990
+ contextMenu.date.toLocaleDateString("en-US", { month: "short", day: "numeric" }),
991
+ " ",
992
+ formatTime(contextMenu.date)
993
+ ] }),
994
+ ["command", "script", "reserve", "metadata", "note"].map((type) => /* @__PURE__ */ jsxs(
995
+ "button",
996
+ {
997
+ onClick: () => {
998
+ onEventCreate == null ? void 0 : onEventCreate({ start: contextMenu.date, type });
999
+ setContextMenu(null);
1000
+ },
1001
+ style: {
1002
+ display: "block",
1003
+ width: "100%",
1004
+ textAlign: "left",
1005
+ background: "none",
1006
+ border: "none",
1007
+ color: tokens.colors.text.primary,
1008
+ padding: "5px 8px",
1009
+ fontSize: 11,
1010
+ cursor: "pointer",
1011
+ borderRadius: tokens.borderRadius.sm
1012
+ },
1013
+ onMouseEnter: (e) => {
1014
+ e.currentTarget.style.background = `${tokens.colors.interactive.default}22`;
1015
+ },
1016
+ onMouseLeave: (e) => {
1017
+ e.currentTarget.style.background = "none";
1018
+ },
1019
+ children: [
1020
+ getTypeIcon(type),
1021
+ " Create ",
1022
+ type.charAt(0).toUpperCase() + type.slice(1)
1023
+ ]
1024
+ },
1025
+ type
1026
+ ))
1027
+ ]
1028
+ }
1029
+ )
1030
+ ]
1031
+ }
1032
+ );
1033
+ });
1034
+ function navBtnStyle(tokens) {
1035
+ return {
1036
+ background: tokens.colors.background.base,
1037
+ color: tokens.colors.text.secondary,
1038
+ border: `1px solid ${tokens.colors.border.muted}`,
1039
+ borderRadius: tokens.borderRadius.sm,
1040
+ padding: "3px 8px",
1041
+ fontSize: tokens.typography.fontSize.xs,
1042
+ cursor: "pointer",
1043
+ lineHeight: 1
1044
+ };
1045
+ }
1046
+ export {
1047
+ MissionCalendar
1048
+ };
1049
+ //# sourceMappingURL=MissionCalendar.js.map