@j3m-quantum/ui 2.1.8 → 2.1.10

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as React30 from 'react';
1
+ import * as React36 from 'react';
2
2
  import { createContext, memo, useContext, useMemo, useId, useCallback, useState, useEffect, useRef } from 'react';
3
3
  import { Slot } from '@radix-ui/react-slot';
4
4
  import { cva } from 'class-variance-authority';
@@ -7,7 +7,7 @@ import { twMerge } from 'tailwind-merge';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
9
9
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
10
- import { SearchIcon, TrashIcon, Truck, Flag, MessageSquare, AlertTriangle, ChevronRight, Users, CheckIcon, CircleIcon, ChevronDownIcon, ChevronUpIcon, TrendingUp, Check, Factory, TrendingDown, Minus, X, ChevronRightIcon, ChevronLeftIcon, ArrowLeft, ArrowRight, Loader2Icon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, MoreHorizontal, MoreHorizontalIcon, XIcon, GripVerticalIcon, PanelLeftIcon, ArrowDown, ArrowUp, ChevronsUpDown, EyeOff, ChevronsLeft, ChevronLeft, ChevronsRight, Settings2, FolderIcon, ShareIcon, ChevronsUpDownIcon, SparklesIcon, BadgeCheckIcon, CreditCardIcon, BellIcon, LogOutIcon, ChevronDown, Plus, Send, MessageSquarePlus, CheckCircle, Calendar as Calendar$1, MapPin, Package, ChevronUp, PlusIcon, PencilIcon, CopyIcon, Weight, Layers, User, Clock, CalendarX2, List, Columns, Grid2x2, Grid3x3, CalendarRange, Settings, Info, Moon, ArrowUpDown, CheckCircle2, XCircle, Search, GripVertical, FileText } from 'lucide-react';
10
+ import { SearchIcon, TrashIcon, Truck, Flag, MessageSquare, AlertTriangle, ChevronRight, Users, CheckIcon, CircleIcon, ChevronDownIcon, ChevronUpIcon, TrendingUp, Check, Factory, TrendingDown, Minus, X, ChevronRightIcon, ChevronLeftIcon, ArrowLeft, ArrowRight, Loader2Icon, OctagonXIcon, TriangleAlertIcon, InfoIcon, CircleCheckIcon, MoreHorizontal, MoreHorizontalIcon, XIcon, GripVerticalIcon, PanelLeftIcon, ArrowDown, ArrowUp, ChevronsUpDown, EyeOff, ChevronsLeft, ChevronLeft, ChevronsRight, Settings2, FolderIcon, ShareIcon, ChevronsUpDownIcon, SparklesIcon, BadgeCheckIcon, CreditCardIcon, BellIcon, LogOutIcon, ChevronDown, Plus, Send, MessageSquarePlus, CheckCircle, Calendar as Calendar$1, MapPin, Package, ChevronUp, PlusIcon, PencilIcon, CopyIcon, Weight, Layers, Lock, Clock, CalendarDays, AlertCircle, ExternalLink, Kanban, List, User, CalendarX2, Columns, Grid2x2, Grid3x3, CalendarRange, Settings, Info, Moon, ArrowUpDown, CheckCircle2, XCircle, Search, GripVertical, Circle, FileText, UserCheck, Upload, FileCheck, Calculator, Loader2 } from 'lucide-react';
11
11
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
12
12
  import * as SwitchPrimitive from '@radix-ui/react-switch';
13
13
  import * as SliderPrimitive from '@radix-ui/react-slider';
@@ -39,12 +39,11 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
39
39
  import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
40
40
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
41
41
  import * as ResizablePrimitive from 'react-resizable-panels';
42
- import { MapContainer, TileLayer, Marker, Popup, Tooltip, ZoomControl } from 'react-leaflet';
43
42
  import { useReactTable, getPaginationRowModel, getFilteredRowModel, getSortedRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
44
43
  export { flexRender, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
45
44
  import { formatDate as formatDate$1, differenceInDays, format, addDays, getDaysInMonth, isSameDay, getDate, getISOWeek as getISOWeek$1, startOfWeek, addWeeks, differenceInWeeks, differenceInMonths, startOfMonth, endOfWeek, endOfMonth, addMonths, isToday, formatDistance, subMonths, subYears, subWeeks, subDays, addYears, startOfYear, endOfYear, isSameMonth, isSameWeek, isSameYear, isWithinInterval, parseISO, differenceInMinutes, eachDayOfInterval, startOfDay, setMinutes, setHours, eachHourOfInterval, endOfDay, getHours, getMinutes, addMinutes, areIntervalsOverlapping } from 'date-fns';
46
45
  export { areIntervalsOverlapping, format, getDay, isSameDay, isSameMonth, isToday, parseISO } from 'date-fns';
47
- import { useSensor, MouseSensor, useDraggable, DndContext, useDroppable as useDroppable$1, useSensors, TouchSensor, KeyboardSensor, closestCenter, DragOverlay } from '@dnd-kit/core';
46
+ import { useSensor, MouseSensor, useDraggable, DndContext, useSensors, TouchSensor, closestCenter, DragOverlay, useDroppable as useDroppable$1, KeyboardSensor } from '@dnd-kit/core';
48
47
  import { restrictToHorizontalAxis } from '@dnd-kit/modifiers';
49
48
  import { useMouse, useWindowScroll, useThrottle } from '@uidotdev/usehooks';
50
49
  import { atom, useAtom } from 'jotai';
@@ -57,8 +56,8 @@ import tunnel from 'tunnel-rat';
57
56
  // src/hooks/use-mobile.ts
58
57
  var MOBILE_BREAKPOINT = 1024;
59
58
  function useIsMobile() {
60
- const [isMobile, setIsMobile] = React30.useState(void 0);
61
- React30.useEffect(() => {
59
+ const [isMobile, setIsMobile] = React36.useState(void 0);
60
+ React36.useEffect(() => {
62
61
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
63
62
  const onChange = () => {
64
63
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -146,7 +145,7 @@ var buttonVariants = cva(
146
145
  }
147
146
  }
148
147
  );
149
- var Button = React30.forwardRef(
148
+ var Button = React36.forwardRef(
150
149
  ({ className, variant, size, asChild = false, ...props }, ref) => {
151
150
  const Comp = asChild ? Slot : "button";
152
151
  return /* @__PURE__ */ jsx(
@@ -510,7 +509,7 @@ function Slider({
510
509
  max = 100,
511
510
  ...props
512
511
  }) {
513
- const _values = React30.useMemo(
512
+ const _values = React36.useMemo(
514
513
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
515
514
  [value, defaultValue, min, max]
516
515
  );
@@ -796,7 +795,7 @@ function Toggle({
796
795
  }
797
796
  );
798
797
  }
799
- var ToggleGroupContext = React30.createContext({
798
+ var ToggleGroupContext = React36.createContext({
800
799
  size: "default",
801
800
  variant: "default",
802
801
  spacing: 0
@@ -833,7 +832,7 @@ function ToggleGroupItem({
833
832
  size,
834
833
  ...props
835
834
  }) {
836
- const context = React30.useContext(ToggleGroupContext);
835
+ const context = React36.useContext(ToggleGroupContext);
837
836
  return /* @__PURE__ */ jsx(
838
837
  ToggleGroupPrimitive.Item,
839
838
  {
@@ -863,7 +862,7 @@ function ThemeSwitch({
863
862
  className,
864
863
  size = "default"
865
864
  }) {
866
- const [isChecked, setIsChecked] = React30.useState(defaultChecked);
865
+ const [isChecked, setIsChecked] = React36.useState(defaultChecked);
867
866
  const isControlled = checked !== void 0;
868
867
  const currentChecked = isControlled ? checked : isChecked;
869
868
  const handleClick = () => {
@@ -1283,7 +1282,7 @@ function Label2({
1283
1282
  );
1284
1283
  }
1285
1284
  var Form = FormProvider;
1286
- var FormFieldContext = React30.createContext(
1285
+ var FormFieldContext = React36.createContext(
1287
1286
  {}
1288
1287
  );
1289
1288
  var FormField = ({
@@ -1292,8 +1291,8 @@ var FormField = ({
1292
1291
  return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
1293
1292
  };
1294
1293
  var useFormField = () => {
1295
- const fieldContext = React30.useContext(FormFieldContext);
1296
- const itemContext = React30.useContext(FormItemContext);
1294
+ const fieldContext = React36.useContext(FormFieldContext);
1295
+ const itemContext = React36.useContext(FormItemContext);
1297
1296
  const { getFieldState } = useFormContext();
1298
1297
  const formState = useFormState({ name: fieldContext.name });
1299
1298
  const fieldState = getFieldState(fieldContext.name, formState);
@@ -1310,11 +1309,11 @@ var useFormField = () => {
1310
1309
  ...fieldState
1311
1310
  };
1312
1311
  };
1313
- var FormItemContext = React30.createContext(
1312
+ var FormItemContext = React36.createContext(
1314
1313
  {}
1315
1314
  );
1316
1315
  function FormItem({ className, ...props }) {
1317
- const id = React30.useId();
1316
+ const id = React36.useId();
1318
1317
  return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx(
1319
1318
  "div",
1320
1319
  {
@@ -1758,7 +1757,7 @@ var cardVariants = cva(
1758
1757
  {
1759
1758
  variants: {
1760
1759
  variant: {
1761
- default: "bg-card border shadow-sm",
1760
+ default: "bg-card border border-[var(--color-border-subtle)] shadow-[var(--j3m-shadow-default)]",
1762
1761
  glass: [
1763
1762
  "glass-context",
1764
1763
  // Enables glass semantic token overrides for children
@@ -2712,8 +2711,8 @@ function CalendarDayButton({
2712
2711
  modifiers,
2713
2712
  ...props
2714
2713
  }) {
2715
- const ref = React30.useRef(null);
2716
- React30.useEffect(() => {
2714
+ const ref = React36.useRef(null);
2715
+ React36.useEffect(() => {
2717
2716
  if (modifiers.focused) ref.current?.focus();
2718
2717
  }, [modifiers.focused]);
2719
2718
  return /* @__PURE__ */ jsx(
@@ -2734,9 +2733,9 @@ function CalendarDayButton({
2734
2733
  }
2735
2734
  );
2736
2735
  }
2737
- var CarouselContext = React30.createContext(null);
2736
+ var CarouselContext = React36.createContext(null);
2738
2737
  function useCarousel() {
2739
- const context = React30.useContext(CarouselContext);
2738
+ const context = React36.useContext(CarouselContext);
2740
2739
  if (!context) {
2741
2740
  throw new Error("useCarousel must be used within a <Carousel />");
2742
2741
  }
@@ -2758,20 +2757,20 @@ function Carousel({
2758
2757
  },
2759
2758
  plugins
2760
2759
  );
2761
- const [canScrollPrev, setCanScrollPrev] = React30.useState(false);
2762
- const [canScrollNext, setCanScrollNext] = React30.useState(false);
2763
- const onSelect = React30.useCallback((api2) => {
2760
+ const [canScrollPrev, setCanScrollPrev] = React36.useState(false);
2761
+ const [canScrollNext, setCanScrollNext] = React36.useState(false);
2762
+ const onSelect = React36.useCallback((api2) => {
2764
2763
  if (!api2) return;
2765
2764
  setCanScrollPrev(api2.canScrollPrev());
2766
2765
  setCanScrollNext(api2.canScrollNext());
2767
2766
  }, []);
2768
- const scrollPrev = React30.useCallback(() => {
2767
+ const scrollPrev = React36.useCallback(() => {
2769
2768
  api?.scrollPrev();
2770
2769
  }, [api]);
2771
- const scrollNext = React30.useCallback(() => {
2770
+ const scrollNext = React36.useCallback(() => {
2772
2771
  api?.scrollNext();
2773
2772
  }, [api]);
2774
- const handleKeyDown = React30.useCallback(
2773
+ const handleKeyDown = React36.useCallback(
2775
2774
  (event) => {
2776
2775
  if (event.key === "ArrowLeft") {
2777
2776
  event.preventDefault();
@@ -2783,11 +2782,11 @@ function Carousel({
2783
2782
  },
2784
2783
  [scrollPrev, scrollNext]
2785
2784
  );
2786
- React30.useEffect(() => {
2785
+ React36.useEffect(() => {
2787
2786
  if (!api || !setApi) return;
2788
2787
  setApi(api);
2789
2788
  }, [api, setApi]);
2790
- React30.useEffect(() => {
2789
+ React36.useEffect(() => {
2791
2790
  if (!api) return;
2792
2791
  onSelect(api);
2793
2792
  api.on("reInit", onSelect);
@@ -2920,9 +2919,9 @@ function CarouselNext({
2920
2919
  );
2921
2920
  }
2922
2921
  var THEMES = { light: "", dark: ".dark" };
2923
- var ChartContext = React30.createContext(null);
2922
+ var ChartContext = React36.createContext(null);
2924
2923
  function useChart() {
2925
- const context = React30.useContext(ChartContext);
2924
+ const context = React36.useContext(ChartContext);
2926
2925
  if (!context) {
2927
2926
  throw new Error("useChart must be used within a <ChartContainer />");
2928
2927
  }
@@ -2935,7 +2934,7 @@ function ChartContainer({
2935
2934
  config,
2936
2935
  ...props
2937
2936
  }) {
2938
- const uniqueId = React30.useId();
2937
+ const uniqueId = React36.useId();
2939
2938
  const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
2940
2939
  return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
2941
2940
  "div",
@@ -2996,7 +2995,7 @@ function ChartTooltipContent({
2996
2995
  labelKey
2997
2996
  }) {
2998
2997
  const { config } = useChart();
2999
- const tooltipLabel = React30.useMemo(() => {
2998
+ const tooltipLabel = React36.useMemo(() => {
3000
2999
  if (hideLabel || !payload?.length) {
3001
3000
  return null;
3002
3001
  }
@@ -3831,7 +3830,7 @@ function StatusProgress({
3831
3830
  const resolvedVariant = variant ?? getVariantFromProgress(clampedValue);
3832
3831
  const colors = getStatusColors(resolvedVariant);
3833
3832
  const sizes = getSizeClasses(size);
3834
- const labelText = React30.useMemo(() => {
3833
+ const labelText = React36.useMemo(() => {
3835
3834
  if (currentCount !== void 0 && totalCount !== void 0) {
3836
3835
  return `${currentCount} / ${totalCount} ${unitLabel}`;
3837
3836
  }
@@ -3936,8 +3935,8 @@ function TooltipContent({
3936
3935
  ) });
3937
3936
  }
3938
3937
  function useDetectTheme() {
3939
- const [theme, setTheme] = React30.useState("light");
3940
- React30.useEffect(() => {
3938
+ const [theme, setTheme] = React36.useState("light");
3939
+ React36.useEffect(() => {
3941
3940
  const isDark = document.documentElement.classList.contains("dark");
3942
3941
  setTheme(isDark ? "dark" : "light");
3943
3942
  const observer = new MutationObserver((mutations) => {
@@ -4586,7 +4585,7 @@ function CommandShortcut({
4586
4585
  }
4587
4586
  );
4588
4587
  }
4589
- var SearchTrigger = React30.forwardRef(
4588
+ var SearchTrigger = React36.forwardRef(
4590
4589
  ({
4591
4590
  className,
4592
4591
  placeholder = "Search...",
@@ -4622,7 +4621,7 @@ var SearchTrigger = React30.forwardRef(
4622
4621
  );
4623
4622
  SearchTrigger.displayName = "SearchTrigger";
4624
4623
  function useSearchShortcut(onOpen, key = "k") {
4625
- React30.useEffect(() => {
4624
+ React36.useEffect(() => {
4626
4625
  const down = (e) => {
4627
4626
  if (e.key.toLowerCase() === key.toLowerCase() && (e.metaKey || e.ctrlKey)) {
4628
4627
  e.preventDefault();
@@ -5597,9 +5596,9 @@ var SIDEBAR_WIDTH = "16rem";
5597
5596
  var SIDEBAR_WIDTH_MOBILE = "18rem";
5598
5597
  var SIDEBAR_WIDTH_ICON = "3rem";
5599
5598
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
5600
- var SidebarContext = React30.createContext(null);
5599
+ var SidebarContext = React36.createContext(null);
5601
5600
  function useSidebar() {
5602
- const context = React30.useContext(SidebarContext);
5601
+ const context = React36.useContext(SidebarContext);
5603
5602
  if (!context) {
5604
5603
  throw new Error("useSidebar must be used within a SidebarProvider.");
5605
5604
  }
@@ -5615,10 +5614,10 @@ function SidebarProvider({
5615
5614
  ...props
5616
5615
  }) {
5617
5616
  const isMobile = useIsMobile();
5618
- const [openMobile, setOpenMobile] = React30.useState(false);
5619
- const [_open, _setOpen] = React30.useState(defaultOpen);
5617
+ const [openMobile, setOpenMobile] = React36.useState(false);
5618
+ const [_open, _setOpen] = React36.useState(defaultOpen);
5620
5619
  const open = openProp ?? _open;
5621
- const setOpen = React30.useCallback(
5620
+ const setOpen = React36.useCallback(
5622
5621
  (value) => {
5623
5622
  const openState = typeof value === "function" ? value(open) : value;
5624
5623
  if (setOpenProp) {
@@ -5630,10 +5629,10 @@ function SidebarProvider({
5630
5629
  },
5631
5630
  [setOpenProp, open]
5632
5631
  );
5633
- const toggleSidebar = React30.useCallback(() => {
5632
+ const toggleSidebar = React36.useCallback(() => {
5634
5633
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
5635
5634
  }, [isMobile, setOpen, setOpenMobile]);
5636
- React30.useEffect(() => {
5635
+ React36.useEffect(() => {
5637
5636
  const handleKeyDown = (event) => {
5638
5637
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
5639
5638
  event.preventDefault();
@@ -5644,7 +5643,7 @@ function SidebarProvider({
5644
5643
  return () => window.removeEventListener("keydown", handleKeyDown);
5645
5644
  }, [toggleSidebar]);
5646
5645
  const state = open ? "expanded" : "collapsed";
5647
- const contextValue = React30.useMemo(
5646
+ const contextValue = React36.useMemo(
5648
5647
  () => ({
5649
5648
  state,
5650
5649
  open,
@@ -6102,7 +6101,7 @@ function SidebarMenuSkeleton({
6102
6101
  showIcon = false,
6103
6102
  ...props
6104
6103
  }) {
6105
- const width = React30.useMemo(() => {
6104
+ const width = React36.useMemo(() => {
6106
6105
  return `${Math.floor(Math.random() * 40) + 50}%`;
6107
6106
  }, []);
6108
6107
  return /* @__PURE__ */ jsxs(
@@ -6200,7 +6199,8 @@ var sectionVariants = cva(
6200
6199
  default: [
6201
6200
  "bg-[var(--color-bg-surface)]",
6202
6201
  "border border-[var(--color-border-subtle)]",
6203
- "text-[var(--color-text-main)]"
6202
+ "text-[var(--color-text-main)]",
6203
+ "shadow-[var(--j3m-shadow-default)]"
6204
6204
  ].join(" "),
6205
6205
  // Glass Light - frosted glass for dark or image backgrounds
6206
6206
  "glass-light": [
@@ -6245,7 +6245,7 @@ var sectionVariants = cva(
6245
6245
  }
6246
6246
  );
6247
6247
  var isGlassVariant = (variant) => variant?.startsWith("glass-") ?? false;
6248
- var Section = React30.forwardRef(
6248
+ var Section = React36.forwardRef(
6249
6249
  ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
6250
6250
  "section",
6251
6251
  {
@@ -6257,7 +6257,7 @@ var Section = React30.forwardRef(
6257
6257
  )
6258
6258
  );
6259
6259
  Section.displayName = "Section";
6260
- var SectionHeader = React30.forwardRef(
6260
+ var SectionHeader = React36.forwardRef(
6261
6261
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6262
6262
  "div",
6263
6263
  {
@@ -6272,7 +6272,7 @@ var SectionHeader = React30.forwardRef(
6272
6272
  )
6273
6273
  );
6274
6274
  SectionHeader.displayName = "SectionHeader";
6275
- var SectionTitle = React30.forwardRef(
6275
+ var SectionTitle = React36.forwardRef(
6276
6276
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6277
6277
  "h2",
6278
6278
  {
@@ -6286,7 +6286,7 @@ var SectionTitle = React30.forwardRef(
6286
6286
  )
6287
6287
  );
6288
6288
  SectionTitle.displayName = "SectionTitle";
6289
- var SectionDescription = React30.forwardRef(
6289
+ var SectionDescription = React36.forwardRef(
6290
6290
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6291
6291
  "p",
6292
6292
  {
@@ -6300,7 +6300,7 @@ var SectionDescription = React30.forwardRef(
6300
6300
  )
6301
6301
  );
6302
6302
  SectionDescription.displayName = "SectionDescription";
6303
- var SectionContent = React30.forwardRef(
6303
+ var SectionContent = React36.forwardRef(
6304
6304
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6305
6305
  "div",
6306
6306
  {
@@ -6314,7 +6314,7 @@ var SectionContent = React30.forwardRef(
6314
6314
  )
6315
6315
  );
6316
6316
  SectionContent.displayName = "SectionContent";
6317
- var SectionFooter = React30.forwardRef(
6317
+ var SectionFooter = React36.forwardRef(
6318
6318
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6319
6319
  "div",
6320
6320
  {
@@ -6330,89 +6330,6 @@ var SectionFooter = React30.forwardRef(
6330
6330
  )
6331
6331
  );
6332
6332
  SectionFooter.displayName = "SectionFooter";
6333
- function Map2({
6334
- center,
6335
- zoom = 13,
6336
- className,
6337
- children,
6338
- ...props
6339
- }) {
6340
- return /* @__PURE__ */ jsx(
6341
- MapContainer,
6342
- {
6343
- center,
6344
- zoom,
6345
- className: cn(
6346
- "w-full rounded-lg border border-border overflow-hidden",
6347
- "[&_.leaflet-control-zoom]:border-border",
6348
- "[&_.leaflet-control-zoom]:rounded-md",
6349
- "[&_.leaflet-control-zoom]:shadow-sm",
6350
- "[&_.leaflet-control-zoom-in]:rounded-t-md",
6351
- "[&_.leaflet-control-zoom-in]:border-b",
6352
- "[&_.leaflet-control-zoom-in]:border-border",
6353
- "[&_.leaflet-control-zoom-out]:rounded-b-md",
6354
- "[&_.leaflet-popup-content-wrapper]:rounded-lg",
6355
- "[&_.leaflet-popup-content-wrapper]:shadow-lg",
6356
- "[&_.leaflet-popup-content-wrapper]:border",
6357
- "[&_.leaflet-popup-content-wrapper]:border-border",
6358
- className
6359
- ),
6360
- scrollWheelZoom: true,
6361
- ...props,
6362
- children
6363
- }
6364
- );
6365
- }
6366
- var TILE_LAYERS = {
6367
- default: {
6368
- url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
6369
- attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
6370
- },
6371
- dark: {
6372
- url: "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",
6373
- attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>'
6374
- },
6375
- satellite: {
6376
- url: "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",
6377
- attribution: "&copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
6378
- }
6379
- };
6380
- function MapTileLayer({
6381
- variant = "default",
6382
- ...props
6383
- }) {
6384
- const layer = TILE_LAYERS[variant];
6385
- return /* @__PURE__ */ jsx(
6386
- TileLayer,
6387
- {
6388
- url: layer.url,
6389
- attribution: layer.attribution,
6390
- ...props
6391
- }
6392
- );
6393
- }
6394
- function MapMarker({
6395
- position,
6396
- children,
6397
- ...props
6398
- }) {
6399
- return /* @__PURE__ */ jsx(Marker, { position, ...props, children });
6400
- }
6401
- function MapPopup({
6402
- children,
6403
- ...props
6404
- }) {
6405
- return /* @__PURE__ */ jsx(Popup, { ...props, children: /* @__PURE__ */ jsx("div", { className: "text-sm", children }) });
6406
- }
6407
- function MapTooltip({
6408
- children,
6409
- ...props
6410
- }) {
6411
- return /* @__PURE__ */ jsx(Tooltip, { ...props, children });
6412
- }
6413
- function MapZoomControl(props) {
6414
- return /* @__PURE__ */ jsx(ZoomControl, { ...props });
6415
- }
6416
6333
  function DataTableColumnHeader({
6417
6334
  column,
6418
6335
  title,
@@ -6622,7 +6539,7 @@ function SiteHeader({
6622
6539
  children: /* @__PURE__ */ jsxs("div", { className: "flex h-[var(--header-height,3.5rem)] w-full items-center gap-[var(--j3m-spacing-s)] px-[var(--j3m-spacing-m)]", children: [
6623
6540
  trigger,
6624
6541
  trigger && /* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "mr-[var(--j3m-spacing-s)] h-4" }),
6625
- /* @__PURE__ */ jsx(Breadcrumb, { className: "hidden sm:block", children: /* @__PURE__ */ jsx(BreadcrumbList, { children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxs(React30.Fragment, { children: [
6542
+ /* @__PURE__ */ jsx(Breadcrumb, { className: "hidden sm:block", children: /* @__PURE__ */ jsx(BreadcrumbList, { children: breadcrumbs.map((item, index) => /* @__PURE__ */ jsxs(React36.Fragment, { children: [
6626
6543
  index > 0 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
6627
6544
  /* @__PURE__ */ jsx(BreadcrumbItem, { children: item.href ? /* @__PURE__ */ jsx(BreadcrumbLink, { href: item.href, children: item.label }) : /* @__PURE__ */ jsx(BreadcrumbPage, { children: item.label }) })
6628
6545
  ] }, index)) }) }),
@@ -7243,11 +7160,11 @@ function PlanningWeekCommentPopover({
7243
7160
  open,
7244
7161
  onOpenChange
7245
7162
  }) {
7246
- const [newCommentText, setNewCommentText] = React30.useState("");
7247
- const [selectedLocationId, setSelectedLocationId] = React30.useState("");
7248
- const [viewCommentsOpen, setViewCommentsOpen] = React30.useState(true);
7249
- const [showAddForm, setShowAddForm] = React30.useState(false);
7250
- const selectedLocation = React30.useMemo(() => {
7163
+ const [newCommentText, setNewCommentText] = React36.useState("");
7164
+ const [selectedLocationId, setSelectedLocationId] = React36.useState("");
7165
+ const [viewCommentsOpen, setViewCommentsOpen] = React36.useState(true);
7166
+ const [showAddForm, setShowAddForm] = React36.useState(false);
7167
+ const selectedLocation = React36.useMemo(() => {
7251
7168
  return locationOptions.find((opt) => opt.id === selectedLocationId);
7252
7169
  }, [locationOptions, selectedLocationId]);
7253
7170
  const handleSubmit = () => {
@@ -7283,7 +7200,7 @@ function PlanningWeekCommentPopover({
7283
7200
  onCommentClick(comment);
7284
7201
  }
7285
7202
  };
7286
- const formatDate3 = (date) => {
7203
+ const formatDate6 = (date) => {
7287
7204
  return new Intl.DateTimeFormat("en-US", {
7288
7205
  month: "short",
7289
7206
  day: "numeric",
@@ -7291,8 +7208,8 @@ function PlanningWeekCommentPopover({
7291
7208
  minute: "2-digit"
7292
7209
  }).format(date);
7293
7210
  };
7294
- const prevOpenRef = React30.useRef(open);
7295
- React30.useEffect(() => {
7211
+ const prevOpenRef = React36.useRef(open);
7212
+ React36.useEffect(() => {
7296
7213
  const wasOpen = prevOpenRef.current;
7297
7214
  prevOpenRef.current = open;
7298
7215
  if (wasOpen && !open) {
@@ -7363,7 +7280,7 @@ function PlanningWeekCommentPopover({
7363
7280
  ] }),
7364
7281
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
7365
7282
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
7366
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
7283
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
7367
7284
  ] }),
7368
7285
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
7369
7286
  ]
@@ -7671,15 +7588,15 @@ function PlanningTable({
7671
7588
  stickySupplierColumn = true,
7672
7589
  maxHeight = "600px"
7673
7590
  } = config;
7674
- const weeks = React30.useMemo(
7591
+ const weeks = React36.useMemo(
7675
7592
  () => generateWeeks(startDate, weekCount),
7676
7593
  [startDate, weekCount]
7677
7594
  );
7678
- const currentWeekKey = React30.useMemo(() => {
7595
+ const currentWeekKey = React36.useMemo(() => {
7679
7596
  const currentWeek = weeks.find((w) => w.isCurrentWeek);
7680
7597
  return currentWeek ? getWeekKey(currentWeek.startDate) : null;
7681
7598
  }, [weeks]);
7682
- const columnSummaryData = React30.useMemo(() => {
7599
+ const columnSummaryData = React36.useMemo(() => {
7683
7600
  const summaryMap = /* @__PURE__ */ new Map();
7684
7601
  for (const week of weeks) {
7685
7602
  const weekKey = getWeekKey(week.startDate);
@@ -7721,14 +7638,14 @@ function PlanningTable({
7721
7638
  }
7722
7639
  return summaryMap;
7723
7640
  }, [weeks, suppliers]);
7724
- const columns = React30.useMemo(
7641
+ const columns = React36.useMemo(
7725
7642
  () => generateColumns(weeks, config, suppliers, columnSummaryData),
7726
7643
  [weeks, config, suppliers, columnSummaryData]
7727
7644
  );
7728
- const [sorting, setSorting] = React30.useState([]);
7729
- const [columnFilters, setColumnFilters] = React30.useState([]);
7730
- const [columnVisibility, setColumnVisibility] = React30.useState({});
7731
- const [rowSelection, setRowSelection] = React30.useState({});
7645
+ const [sorting, setSorting] = React36.useState([]);
7646
+ const [columnFilters, setColumnFilters] = React36.useState([]);
7647
+ const [columnVisibility, setColumnVisibility] = React36.useState({});
7648
+ const [rowSelection, setRowSelection] = React36.useState({});
7732
7649
  const table = useReactTable({
7733
7650
  data: suppliers,
7734
7651
  columns,
@@ -7752,7 +7669,7 @@ function PlanningTable({
7752
7669
  }
7753
7670
  }
7754
7671
  });
7755
- const insightMetrics = React30.useMemo(() => {
7672
+ const insightMetrics = React36.useMemo(() => {
7756
7673
  let totalProduced = 0;
7757
7674
  let totalRequired = 0;
7758
7675
  let totalDeliveries = 0;
@@ -7986,10 +7903,10 @@ function DeliveryCommentPopover({
7986
7903
  onAddComment,
7987
7904
  deliveryLabel
7988
7905
  }) {
7989
- const [open, setOpen] = React30.useState(false);
7990
- const [newCommentText, setNewCommentText] = React30.useState("");
7991
- const [viewCommentsOpen, setViewCommentsOpen] = React30.useState(true);
7992
- const [showAddForm, setShowAddForm] = React30.useState(false);
7906
+ const [open, setOpen] = React36.useState(false);
7907
+ const [newCommentText, setNewCommentText] = React36.useState("");
7908
+ const [viewCommentsOpen, setViewCommentsOpen] = React36.useState(true);
7909
+ const [showAddForm, setShowAddForm] = React36.useState(false);
7993
7910
  const handleSubmit = () => {
7994
7911
  if (newCommentText.trim() && onAddComment) {
7995
7912
  onAddComment(newCommentText.trim());
@@ -8008,7 +7925,7 @@ function DeliveryCommentPopover({
8008
7925
  setNewCommentText("");
8009
7926
  }
8010
7927
  };
8011
- const formatDate3 = (date) => {
7928
+ const formatDate6 = (date) => {
8012
7929
  return new Intl.DateTimeFormat("en-US", {
8013
7930
  month: "short",
8014
7931
  day: "numeric",
@@ -8016,8 +7933,8 @@ function DeliveryCommentPopover({
8016
7933
  minute: "2-digit"
8017
7934
  }).format(date);
8018
7935
  };
8019
- const prevOpenRef = React30.useRef(open);
8020
- React30.useEffect(() => {
7936
+ const prevOpenRef = React36.useRef(open);
7937
+ React36.useEffect(() => {
8021
7938
  const wasOpen = prevOpenRef.current;
8022
7939
  prevOpenRef.current = open;
8023
7940
  if (wasOpen && !open) {
@@ -8054,7 +7971,7 @@ function DeliveryCommentPopover({
8054
7971
  /* @__PURE__ */ jsx(CollapsibleContent2, { className: "space-y-2 pt-2", children: comments.length > 0 ? comments.map((comment) => /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-muted/50 p-3 space-y-2", children: [
8055
7972
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
8056
7973
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
8057
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
7974
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
8058
7975
  ] }),
8059
7976
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
8060
7977
  ] }, comment.id)) : /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center py-2", children: "No comments yet" }) })
@@ -8129,8 +8046,8 @@ function ProductionCommentSection({
8129
8046
  comments = [],
8130
8047
  onAddComment
8131
8048
  }) {
8132
- const [showAddForm, setShowAddForm] = React30.useState(false);
8133
- const [newComment, setNewComment] = React30.useState("");
8049
+ const [showAddForm, setShowAddForm] = React36.useState(false);
8050
+ const [newComment, setNewComment] = React36.useState("");
8134
8051
  const handleSubmit = () => {
8135
8052
  if (newComment.trim() && onAddComment) {
8136
8053
  onAddComment(newComment.trim());
@@ -8148,7 +8065,7 @@ function ProductionCommentSection({
8148
8065
  setNewComment("");
8149
8066
  }
8150
8067
  };
8151
- const formatDate3 = (date) => {
8068
+ const formatDate6 = (date) => {
8152
8069
  return new Intl.DateTimeFormat("en-US", {
8153
8070
  month: "short",
8154
8071
  day: "numeric",
@@ -8160,7 +8077,7 @@ function ProductionCommentSection({
8160
8077
  comments.length > 0 && /* @__PURE__ */ jsx("div", { className: "space-y-2", children: comments.map((comment) => /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-muted/50 p-2.5 space-y-1", children: [
8161
8078
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
8162
8079
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
8163
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
8080
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
8164
8081
  ] }),
8165
8082
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
8166
8083
  ] }, comment.id)) }),
@@ -8315,7 +8232,7 @@ function DeliveryDetailsView({
8315
8232
  onAddComment
8316
8233
  }) {
8317
8234
  const elements = delivery.elements ?? [];
8318
- const categorizedElements = React30.useMemo(() => {
8235
+ const categorizedElements = React36.useMemo(() => {
8319
8236
  const sent = [];
8320
8237
  const notSent = [];
8321
8238
  const moved = [];
@@ -8683,15 +8600,15 @@ function WeekDetailDialog({
8683
8600
  }) {
8684
8601
  const production = data?.production;
8685
8602
  const initialProduced = production?.produced ?? 0;
8686
- const [producedValue, setProducedValue] = React30.useState(initialProduced.toString());
8687
- const [hasChanges, setHasChanges] = React30.useState(false);
8688
- const [selectedDelivery, setSelectedDelivery] = React30.useState(null);
8689
- React30.useEffect(() => {
8603
+ const [producedValue, setProducedValue] = React36.useState(initialProduced.toString());
8604
+ const [hasChanges, setHasChanges] = React36.useState(false);
8605
+ const [selectedDelivery, setSelectedDelivery] = React36.useState(null);
8606
+ React36.useEffect(() => {
8690
8607
  const newProduced = data?.production?.produced ?? 0;
8691
8608
  setProducedValue(newProduced.toString());
8692
8609
  setHasChanges(false);
8693
8610
  }, [data]);
8694
- React30.useEffect(() => {
8611
+ React36.useEffect(() => {
8695
8612
  if (!open) {
8696
8613
  setSelectedDelivery(null);
8697
8614
  }
@@ -8822,24 +8739,24 @@ function ElementProductionDialog({
8822
8739
  elements,
8823
8740
  onSave
8824
8741
  }) {
8825
- const [searchQuery, setSearchQuery] = React30.useState("");
8826
- const [selectedIds, setSelectedIds] = React30.useState(
8742
+ const [searchQuery, setSearchQuery] = React36.useState("");
8743
+ const [selectedIds, setSelectedIds] = React36.useState(
8827
8744
  new Set(elements.filter((e) => e.isProduced).map((e) => e.id))
8828
8745
  );
8829
- React30.useEffect(() => {
8746
+ React36.useEffect(() => {
8830
8747
  if (open) {
8831
8748
  setSelectedIds(new Set(elements.filter((e) => e.isProduced).map((e) => e.id)));
8832
8749
  setSearchQuery("");
8833
8750
  }
8834
8751
  }, [open, elements]);
8835
- const filteredElements = React30.useMemo(() => {
8752
+ const filteredElements = React36.useMemo(() => {
8836
8753
  if (!searchQuery.trim()) return elements;
8837
8754
  const query = searchQuery.toLowerCase();
8838
8755
  return elements.filter(
8839
8756
  (e) => e.name.toLowerCase().includes(query) || e.prefix?.toLowerCase().includes(query) || e.type?.toLowerCase().includes(query)
8840
8757
  );
8841
8758
  }, [elements, searchQuery]);
8842
- React30.useMemo(() => {
8759
+ React36.useMemo(() => {
8843
8760
  const prefixes = /* @__PURE__ */ new Set();
8844
8761
  elements.forEach((e) => {
8845
8762
  if (e.prefix) prefixes.add(e.prefix);
@@ -9025,10 +8942,10 @@ function DeliveryCommentPopover2({
9025
8942
  onAddComment,
9026
8943
  deliveryLabel
9027
8944
  }) {
9028
- const [open, setOpen] = React30.useState(false);
9029
- const [newCommentText, setNewCommentText] = React30.useState("");
9030
- const [viewCommentsOpen, setViewCommentsOpen] = React30.useState(true);
9031
- const [showAddForm, setShowAddForm] = React30.useState(false);
8945
+ const [open, setOpen] = React36.useState(false);
8946
+ const [newCommentText, setNewCommentText] = React36.useState("");
8947
+ const [viewCommentsOpen, setViewCommentsOpen] = React36.useState(true);
8948
+ const [showAddForm, setShowAddForm] = React36.useState(false);
9032
8949
  const handleSubmit = () => {
9033
8950
  if (newCommentText.trim() && onAddComment) {
9034
8951
  onAddComment(newCommentText.trim());
@@ -9047,7 +8964,7 @@ function DeliveryCommentPopover2({
9047
8964
  setNewCommentText("");
9048
8965
  }
9049
8966
  };
9050
- const formatDate3 = (date) => {
8967
+ const formatDate6 = (date) => {
9051
8968
  return new Intl.DateTimeFormat("en-US", {
9052
8969
  month: "short",
9053
8970
  day: "numeric",
@@ -9055,7 +8972,7 @@ function DeliveryCommentPopover2({
9055
8972
  minute: "2-digit"
9056
8973
  }).format(date);
9057
8974
  };
9058
- React30.useEffect(() => {
8975
+ React36.useEffect(() => {
9059
8976
  if (!open) {
9060
8977
  setShowAddForm(false);
9061
8978
  setNewCommentText("");
@@ -9090,7 +9007,7 @@ function DeliveryCommentPopover2({
9090
9007
  /* @__PURE__ */ jsx(CollapsibleContent2, { className: "space-y-2 pt-2", children: comments.length > 0 ? comments.map((comment) => /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-muted/50 p-3 space-y-2", children: [
9091
9008
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
9092
9009
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
9093
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
9010
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
9094
9011
  ] }),
9095
9012
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
9096
9013
  ] }, comment.id)) : /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center py-2", children: "No comments yet" }) })
@@ -9165,8 +9082,8 @@ function ProductionCommentSection2({
9165
9082
  comments = [],
9166
9083
  onAddComment
9167
9084
  }) {
9168
- const [showAddForm, setShowAddForm] = React30.useState(false);
9169
- const [newComment, setNewComment] = React30.useState("");
9085
+ const [showAddForm, setShowAddForm] = React36.useState(false);
9086
+ const [newComment, setNewComment] = React36.useState("");
9170
9087
  const handleSubmit = () => {
9171
9088
  if (newComment.trim() && onAddComment) {
9172
9089
  onAddComment(newComment.trim());
@@ -9184,7 +9101,7 @@ function ProductionCommentSection2({
9184
9101
  setNewComment("");
9185
9102
  }
9186
9103
  };
9187
- const formatDate3 = (date) => {
9104
+ const formatDate6 = (date) => {
9188
9105
  return new Intl.DateTimeFormat("en-US", {
9189
9106
  month: "short",
9190
9107
  day: "numeric",
@@ -9196,7 +9113,7 @@ function ProductionCommentSection2({
9196
9113
  comments.length > 0 && /* @__PURE__ */ jsx("div", { className: "space-y-2", children: comments.map((comment) => /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-muted/50 p-2.5 space-y-1", children: [
9197
9114
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
9198
9115
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
9199
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
9116
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
9200
9117
  ] }),
9201
9118
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
9202
9119
  ] }, comment.id)) }),
@@ -9351,7 +9268,7 @@ function DeliveryDetailsView2({
9351
9268
  onAddComment
9352
9269
  }) {
9353
9270
  const elements = delivery.elements ?? [];
9354
- const categorizedElements = React30.useMemo(() => {
9271
+ const categorizedElements = React36.useMemo(() => {
9355
9272
  const sent = [];
9356
9273
  const notSent = [];
9357
9274
  const moved = [];
@@ -9685,10 +9602,10 @@ function WeekDetailSheet({
9685
9602
  onAddProductionComment,
9686
9603
  onAddDeliveryComment
9687
9604
  }) {
9688
- const [selectedDelivery, setSelectedDelivery] = React30.useState(null);
9689
- const [productionDialogOpen, setProductionDialogOpen] = React30.useState(false);
9690
- const [previousProducedCount, setPreviousProducedCount] = React30.useState(void 0);
9691
- const productionElements = React30.useMemo(() => {
9605
+ const [selectedDelivery, setSelectedDelivery] = React36.useState(null);
9606
+ const [productionDialogOpen, setProductionDialogOpen] = React36.useState(false);
9607
+ const [previousProducedCount, setPreviousProducedCount] = React36.useState(void 0);
9608
+ const productionElements = React36.useMemo(() => {
9692
9609
  if (!data?.deliveries) return [];
9693
9610
  const elements = [];
9694
9611
  const seenIds = /* @__PURE__ */ new Set();
@@ -9712,12 +9629,12 @@ function WeekDetailSheet({
9712
9629
  return elements;
9713
9630
  }, [data?.deliveries]);
9714
9631
  const currentProducedCount = productionElements.filter((e) => e.isProduced).length;
9715
- React30.useEffect(() => {
9632
+ React36.useEffect(() => {
9716
9633
  if (open && data?.deliveries) {
9717
9634
  setPreviousProducedCount(currentProducedCount);
9718
9635
  }
9719
9636
  }, [open]);
9720
- React30.useEffect(() => {
9637
+ React36.useEffect(() => {
9721
9638
  if (!open) {
9722
9639
  setSelectedDelivery(null);
9723
9640
  setProductionDialogOpen(false);
@@ -9950,13 +9867,13 @@ function CalibrationWeekCell({
9950
9867
  onAddClick,
9951
9868
  ...props
9952
9869
  }) {
9953
- const inputRef = React30.useRef(null);
9954
- const [localValue, setLocalValue] = React30.useState(
9870
+ const inputRef = React36.useRef(null);
9871
+ const [localValue, setLocalValue] = React36.useState(
9955
9872
  data.entered !== null ? String(data.entered) : ""
9956
9873
  );
9957
- const [isHovered, setIsHovered] = React30.useState(false);
9958
- const [isEditing, setIsEditing] = React30.useState(false);
9959
- React30.useEffect(() => {
9874
+ const [isHovered, setIsHovered] = React36.useState(false);
9875
+ const [isEditing, setIsEditing] = React36.useState(false);
9876
+ React36.useEffect(() => {
9960
9877
  setLocalValue(data.entered !== null ? String(data.entered) : "");
9961
9878
  }, [data.entered]);
9962
9879
  const unitLabel = formatCalibrationUnit(unit);
@@ -10142,11 +10059,11 @@ function CommentPopover({
10142
10059
  open,
10143
10060
  onOpenChange
10144
10061
  }) {
10145
- const [newCommentText, setNewCommentText] = React30.useState("");
10146
- const [selectedPrefixId, setSelectedPrefixId] = React30.useState("");
10147
- const [viewCommentsOpen, setViewCommentsOpen] = React30.useState(true);
10148
- const [showAddForm, setShowAddForm] = React30.useState(false);
10149
- const selectedPrefixName = React30.useMemo(() => {
10062
+ const [newCommentText, setNewCommentText] = React36.useState("");
10063
+ const [selectedPrefixId, setSelectedPrefixId] = React36.useState("");
10064
+ const [viewCommentsOpen, setViewCommentsOpen] = React36.useState(true);
10065
+ const [showAddForm, setShowAddForm] = React36.useState(false);
10066
+ const selectedPrefixName = React36.useMemo(() => {
10150
10067
  const prefix = availablePrefixes.find((p) => p.id === selectedPrefixId);
10151
10068
  return prefix?.name ?? "";
10152
10069
  }, [availablePrefixes, selectedPrefixId]);
@@ -10170,7 +10087,7 @@ function CommentPopover({
10170
10087
  setNewCommentText("");
10171
10088
  }
10172
10089
  };
10173
- const formatDate3 = (date) => {
10090
+ const formatDate6 = (date) => {
10174
10091
  return new Intl.DateTimeFormat("en-US", {
10175
10092
  month: "short",
10176
10093
  day: "numeric",
@@ -10178,8 +10095,8 @@ function CommentPopover({
10178
10095
  minute: "2-digit"
10179
10096
  }).format(date);
10180
10097
  };
10181
- const prevOpenRef = React30.useRef(open);
10182
- React30.useEffect(() => {
10098
+ const prevOpenRef = React36.useRef(open);
10099
+ React36.useEffect(() => {
10183
10100
  const wasOpen = prevOpenRef.current;
10184
10101
  prevOpenRef.current = open;
10185
10102
  if (wasOpen && !open) {
@@ -10238,7 +10155,7 @@ function CommentPopover({
10238
10155
  ),
10239
10156
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
10240
10157
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
10241
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
10158
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
10242
10159
  ] }),
10243
10160
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
10244
10161
  ]
@@ -10424,7 +10341,7 @@ function CalibrationTable({
10424
10341
  onAddComment,
10425
10342
  onAddEarlierWeek
10426
10343
  } = config;
10427
- const calculatedStartDate = React30.useMemo(() => {
10344
+ const calculatedStartDate = React36.useMemo(() => {
10428
10345
  if (startDate) return startDate;
10429
10346
  let earliest = null;
10430
10347
  for (const prefix of prefixes) {
@@ -10445,31 +10362,31 @@ function CalibrationTable({
10445
10362
  }
10446
10363
  return earliest ?? /* @__PURE__ */ new Date();
10447
10364
  }, [startDate, prefixes]);
10448
- const [additionalWeeks, setAdditionalWeeks] = React30.useState(0);
10449
- const weeks = React30.useMemo(() => {
10365
+ const [additionalWeeks, setAdditionalWeeks] = React36.useState(0);
10366
+ const weeks = React36.useMemo(() => {
10450
10367
  const start = new Date(calculatedStartDate);
10451
10368
  start.setDate(start.getDate() - additionalWeeks * 7);
10452
10369
  return generateWeeks(start, weekCount + additionalWeeks);
10453
10370
  }, [calculatedStartDate, weekCount, additionalWeeks]);
10454
- React30.useMemo(() => {
10371
+ React36.useMemo(() => {
10455
10372
  const currentWeek = weeks.find((w) => w.isCurrentWeek);
10456
10373
  return currentWeek ? getWeekKey(currentWeek.startDate) : null;
10457
10374
  }, [weeks]);
10458
- const [currentPage, setCurrentPage] = React30.useState(0);
10459
- const [pageSize, setPageSize] = React30.useState(defaultPageSize);
10460
- const [searchQuery, setSearchQuery] = React30.useState("");
10461
- const filteredPrefixes = React30.useMemo(() => {
10375
+ const [currentPage, setCurrentPage] = React36.useState(0);
10376
+ const [pageSize, setPageSize] = React36.useState(defaultPageSize);
10377
+ const [searchQuery, setSearchQuery] = React36.useState("");
10378
+ const filteredPrefixes = React36.useMemo(() => {
10462
10379
  if (!searchQuery) return prefixes;
10463
10380
  const query = searchQuery.toLowerCase();
10464
10381
  return prefixes.filter(
10465
10382
  (p) => p.name.toLowerCase().includes(query) || p.typeCode.toLowerCase().includes(query)
10466
10383
  );
10467
10384
  }, [prefixes, searchQuery]);
10468
- const paginatedPrefixes = React30.useMemo(() => {
10385
+ const paginatedPrefixes = React36.useMemo(() => {
10469
10386
  const start = currentPage * pageSize;
10470
10387
  return filteredPrefixes.slice(start, start + pageSize);
10471
10388
  }, [filteredPrefixes, currentPage, pageSize]);
10472
- React30.useMemo(
10389
+ React36.useMemo(
10473
10390
  () => canSubmitCalibration(prefixes),
10474
10391
  [prefixes]
10475
10392
  );
@@ -10493,11 +10410,11 @@ function CalibrationTable({
10493
10410
  }
10494
10411
  return allComments;
10495
10412
  };
10496
- const availablePrefixes = React30.useMemo(
10413
+ const availablePrefixes = React36.useMemo(
10497
10414
  () => prefixes.map((p) => ({ id: p.id, name: p.name })),
10498
10415
  [prefixes]
10499
10416
  );
10500
- const insightMetrics = React30.useMemo(() => {
10417
+ const insightMetrics = React36.useMemo(() => {
10501
10418
  let totalCalibrated = 0;
10502
10419
  let totalRequired = 0;
10503
10420
  for (const prefix of prefixes) {
@@ -10538,7 +10455,7 @@ function CalibrationTable({
10538
10455
  }
10539
10456
  ];
10540
10457
  }, [prefixes]);
10541
- const columnSummaryData = React30.useMemo(() => {
10458
+ const columnSummaryData = React36.useMemo(() => {
10542
10459
  const summaryMap = /* @__PURE__ */ new Map();
10543
10460
  for (const week of weeks) {
10544
10461
  const weekKey = getWeekKey(week.startDate);
@@ -10805,14 +10722,14 @@ function CommentDialog({
10805
10722
  open,
10806
10723
  onOpenChange
10807
10724
  }) {
10808
- const [selectedPrefixId, setSelectedPrefixId] = React30.useState("");
10809
- const [selectedWeekKey, setSelectedWeekKey] = React30.useState("");
10810
- const [commentText, setCommentText] = React30.useState("");
10811
- const currentWeek = React30.useMemo(
10725
+ const [selectedPrefixId, setSelectedPrefixId] = React36.useState("");
10726
+ const [selectedWeekKey, setSelectedWeekKey] = React36.useState("");
10727
+ const [commentText, setCommentText] = React36.useState("");
10728
+ const currentWeek = React36.useMemo(
10812
10729
  () => weeks.find((w) => w.isCurrentWeek),
10813
10730
  [weeks]
10814
10731
  );
10815
- React30.useEffect(() => {
10732
+ React36.useEffect(() => {
10816
10733
  if (open) {
10817
10734
  setSelectedPrefixId(prefixes[0]?.id ?? "");
10818
10735
  setSelectedWeekKey(currentWeek ? getWeekKey(currentWeek.startDate) : weeks[0] ? getWeekKey(weeks[0].startDate) : "");
@@ -11048,7 +10965,7 @@ function generateLoadingWeek(date) {
11048
10965
  const today = /* @__PURE__ */ new Date();
11049
10966
  today.setHours(0, 0, 0, 0);
11050
10967
  const isCurrentWeek = monday <= today && today <= friday;
11051
- const formatDate3 = (d) => {
10968
+ const formatDate6 = (d) => {
11052
10969
  return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
11053
10970
  };
11054
10971
  return {
@@ -11056,7 +10973,7 @@ function generateLoadingWeek(date) {
11056
10973
  label: `W${getLoadingISOWeek(monday).toString().padStart(2, "0")}`,
11057
10974
  startDate: monday,
11058
10975
  endDate: friday,
11059
- dateRange: `${formatDate3(monday)} - ${formatDate3(friday)}`,
10976
+ dateRange: `${formatDate6(monday)} - ${formatDate6(friday)}`,
11060
10977
  isCurrentWeek
11061
10978
  };
11062
10979
  }
@@ -11359,7 +11276,7 @@ function WeeklyLoadingView({
11359
11276
  showNavigation = true,
11360
11277
  className
11361
11278
  }) {
11362
- const [shippedOpenState, setShippedOpenState] = React30.useState({
11279
+ const [shippedOpenState, setShippedOpenState] = React36.useState({
11363
11280
  1: false,
11364
11281
  // Monday
11365
11282
  2: false,
@@ -11377,7 +11294,7 @@ function WeeklyLoadingView({
11377
11294
  [dayOfWeek]: !prev[dayOfWeek]
11378
11295
  }));
11379
11296
  };
11380
- const weekDays = React30.useMemo(() => {
11297
+ const weekDays = React36.useMemo(() => {
11381
11298
  const days = [];
11382
11299
  for (let i = 0; i < 5; i++) {
11383
11300
  const date = addDays(week.startDate, i);
@@ -11389,7 +11306,7 @@ function WeeklyLoadingView({
11389
11306
  }
11390
11307
  return days;
11391
11308
  }, [week.startDate]);
11392
- const deliveriesByDay = React30.useMemo(() => {
11309
+ const deliveriesByDay = React36.useMemo(() => {
11393
11310
  const grouped = /* @__PURE__ */ new Map();
11394
11311
  for (let i = 1; i <= 5; i++) {
11395
11312
  grouped.set(i, { pending: [], shipped: [] });
@@ -11409,7 +11326,7 @@ function WeeklyLoadingView({
11409
11326
  }, [deliveries]);
11410
11327
  const totalPendingDeliveries = deliveries.filter((d) => !isShippedDelivery(d)).length;
11411
11328
  const totalShippedDeliveries = deliveries.filter((d) => isShippedDelivery(d)).length;
11412
- const daySummaryData = React30.useMemo(() => {
11329
+ const daySummaryData = React36.useMemo(() => {
11413
11330
  const summaries = /* @__PURE__ */ new Map();
11414
11331
  for (let i = 1; i <= 5; i++) {
11415
11332
  const dayData = deliveriesByDay.get(i) ?? { pending: [], shipped: [] };
@@ -11763,7 +11680,7 @@ function DeliveryTimeline({ timelineState }) {
11763
11680
  const state = getStateForStep(step.id);
11764
11681
  const styles = getStepStyles(state);
11765
11682
  const isLast = index === TIMELINE_STEPS.length - 1;
11766
- return /* @__PURE__ */ jsxs(React30.Fragment, { children: [
11683
+ return /* @__PURE__ */ jsxs(React36.Fragment, { children: [
11767
11684
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
11768
11685
  /* @__PURE__ */ jsx(
11769
11686
  "div",
@@ -11898,7 +11815,7 @@ function AddCommentDialog({
11898
11815
  weekId,
11899
11816
  onAddComment
11900
11817
  }) {
11901
- const [commentText, setCommentText] = React30.useState("");
11818
+ const [commentText, setCommentText] = React36.useState("");
11902
11819
  const handleSubmit = () => {
11903
11820
  if (commentText.trim() && onAddComment) {
11904
11821
  onAddComment({
@@ -11923,7 +11840,7 @@ function AddCommentDialog({
11923
11840
  handleSubmit();
11924
11841
  }
11925
11842
  };
11926
- React30.useEffect(() => {
11843
+ React36.useEffect(() => {
11927
11844
  if (!open) {
11928
11845
  setCommentText("");
11929
11846
  }
@@ -11986,9 +11903,9 @@ function CommentsSection({
11986
11903
  weekId,
11987
11904
  onAddComment
11988
11905
  }) {
11989
- const [viewCommentsOpen, setViewCommentsOpen] = React30.useState(true);
11990
- const [addDialogOpen, setAddDialogOpen] = React30.useState(false);
11991
- const formatDate3 = (date) => {
11906
+ const [viewCommentsOpen, setViewCommentsOpen] = React36.useState(true);
11907
+ const [addDialogOpen, setAddDialogOpen] = React36.useState(false);
11908
+ const formatDate6 = (date) => {
11992
11909
  return new Intl.DateTimeFormat("en-US", {
11993
11910
  month: "short",
11994
11911
  day: "numeric",
@@ -12032,7 +11949,7 @@ function CommentsSection({
12032
11949
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
12033
11950
  comment.supplierName && /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[9px] px-1.5 py-0 h-4", children: comment.prefixName ? `${comment.supplierName} - ${comment.prefixName}` : comment.supplierName })
12034
11951
  ] }),
12035
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate3(comment.createdAt) })
11952
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-muted-foreground", children: formatDate6(comment.createdAt) })
12036
11953
  ] }),
12037
11954
  /* @__PURE__ */ jsx("p", { className: "text-sm", children: comment.text })
12038
11955
  ] }, comment.id)) })
@@ -12061,7 +11978,7 @@ function DeliveryDetailPage({
12061
11978
  onConfirmLoad
12062
11979
  }) {
12063
11980
  const timelineState = getTimelineState(delivery);
12064
- const elementsByStatus = React30.useMemo(() => {
11981
+ const elementsByStatus = React36.useMemo(() => {
12065
11982
  const loaded = delivery.elements.filter((e) => e.status === "loaded");
12066
11983
  const missing = delivery.elements.filter((e) => e.status === "missing");
12067
11984
  const moved = delivery.elements.filter((e) => e.status === "moved");
@@ -12248,11 +12165,11 @@ function SupplierWeeklyLoading({
12248
12165
  bordered = true,
12249
12166
  className
12250
12167
  }) {
12251
- const [selectedDelivery, setSelectedDelivery] = React30.useState(null);
12252
- const [sheetOpen, setSheetOpen] = React30.useState(false);
12253
- const [commentDelivery, setCommentDelivery] = React30.useState(null);
12254
- const [commentDialogOpen, setCommentDialogOpen] = React30.useState(false);
12255
- const [commentText, setCommentText] = React30.useState("");
12168
+ const [selectedDelivery, setSelectedDelivery] = React36.useState(null);
12169
+ const [sheetOpen, setSheetOpen] = React36.useState(false);
12170
+ const [commentDelivery, setCommentDelivery] = React36.useState(null);
12171
+ const [commentDialogOpen, setCommentDialogOpen] = React36.useState(false);
12172
+ const [commentText, setCommentText] = React36.useState("");
12256
12173
  const handleDeliveryClick = (delivery) => {
12257
12174
  setSelectedDelivery(delivery);
12258
12175
  setSheetOpen(true);
@@ -12295,7 +12212,7 @@ function SupplierWeeklyLoading({
12295
12212
  handleCommentSubmit();
12296
12213
  }
12297
12214
  };
12298
- const insightMetrics = React30.useMemo(() => {
12215
+ const insightMetrics = React36.useMemo(() => {
12299
12216
  const totalDeliveries = deliveries.length;
12300
12217
  const readyDeliveries = deliveries.filter((d) => d.isReadyToUnload).length;
12301
12218
  deliveries.filter(
@@ -12714,11 +12631,11 @@ function CapacityPlanningChart({
12714
12631
  allowDragDrop = true,
12715
12632
  className
12716
12633
  }) {
12717
- const containerRef = React30.useRef(null);
12718
- const [draggedPackage, setDraggedPackage] = React30.useState(null);
12719
- const [showUnassigned, setShowUnassigned] = React30.useState(true);
12720
- const [containerWidth, setContainerWidth] = React30.useState(0);
12721
- React30.useEffect(() => {
12634
+ const containerRef = React36.useRef(null);
12635
+ const [draggedPackage, setDraggedPackage] = React36.useState(null);
12636
+ const [showUnassigned, setShowUnassigned] = React36.useState(true);
12637
+ const [containerWidth, setContainerWidth] = React36.useState(0);
12638
+ React36.useEffect(() => {
12722
12639
  const updateWidth = () => {
12723
12640
  if (containerRef.current) {
12724
12641
  setContainerWidth(containerRef.current.offsetWidth);
@@ -12731,15 +12648,15 @@ function CapacityPlanningChart({
12731
12648
  }
12732
12649
  return () => observer.disconnect();
12733
12650
  }, []);
12734
- const cumulativeNeed = React30.useMemo(
12651
+ const cumulativeNeed = React36.useMemo(
12735
12652
  () => calculateCumulativeNeed(weeks, deliveries),
12736
12653
  [weeks, deliveries]
12737
12654
  );
12738
- const packagePositions = React30.useMemo(
12655
+ const packagePositions = React36.useMemo(
12739
12656
  () => calculatePackagePositions(packages, weeks),
12740
12657
  [packages, weeks]
12741
12658
  );
12742
- const deliveriesByWeek = React30.useMemo(() => {
12659
+ const deliveriesByWeek = React36.useMemo(() => {
12743
12660
  const map = /* @__PURE__ */ new Map();
12744
12661
  for (const d of deliveries) {
12745
12662
  const existing = map.get(d.weekKey) || [];
@@ -14573,7 +14490,7 @@ var getWeekStartDate2 = (year, weekNumber) => {
14573
14490
  };
14574
14491
  var EnhancedGridLines = memo(({ rowCount }) => {
14575
14492
  const gantt = useGanttContext();
14576
- const id = React30.useId();
14493
+ const id = React36.useId();
14577
14494
  const columnWidth = gantt.columnWidth * gantt.zoom / 100;
14578
14495
  const { verticalLines, totalColumns } = useMemo(() => {
14579
14496
  const lines = [];
@@ -15168,7 +15085,7 @@ function getPhaseColor(phaseId, customColor) {
15168
15085
  }
15169
15086
  var LightweightGridLines = memo(() => {
15170
15087
  const gantt = useGanttContext();
15171
- const id = React30.useId();
15088
+ const id = React36.useId();
15172
15089
  const columnWidth = gantt.columnWidth * gantt.zoom / 100;
15173
15090
  const { lines, totalWidth } = useMemo(() => {
15174
15091
  const linePositions = [];
@@ -15765,6 +15682,1366 @@ function PhaseGantt({
15765
15682
  }
15766
15683
  );
15767
15684
  }
15685
+ function getSubtaskTypeIcon(type) {
15686
+ switch (type) {
15687
+ case "calculation":
15688
+ return Calculator;
15689
+ case "review":
15690
+ return FileCheck;
15691
+ case "upload":
15692
+ return Upload;
15693
+ case "approval":
15694
+ return UserCheck;
15695
+ case "documentation":
15696
+ return FileText;
15697
+ default:
15698
+ return Circle;
15699
+ }
15700
+ }
15701
+ function getSubtaskTypeLabel(type) {
15702
+ switch (type) {
15703
+ case "calculation":
15704
+ return "Calculation";
15705
+ case "review":
15706
+ return "Review";
15707
+ case "upload":
15708
+ return "Upload";
15709
+ case "approval":
15710
+ return "Approval";
15711
+ case "documentation":
15712
+ return "Documentation";
15713
+ default:
15714
+ return "Task";
15715
+ }
15716
+ }
15717
+ function getStatusIcon(status) {
15718
+ switch (status) {
15719
+ case "done":
15720
+ return CheckCircle2;
15721
+ case "in_progress":
15722
+ return Loader2;
15723
+ case "blocked":
15724
+ return Lock;
15725
+ default:
15726
+ return Circle;
15727
+ }
15728
+ }
15729
+ function getStatusLabel3(status) {
15730
+ switch (status) {
15731
+ case "todo":
15732
+ return "To Do";
15733
+ case "in_progress":
15734
+ return "In Progress";
15735
+ case "done":
15736
+ return "Done";
15737
+ case "blocked":
15738
+ return "Blocked";
15739
+ default:
15740
+ return status;
15741
+ }
15742
+ }
15743
+ function getActionLabel(status, type) {
15744
+ if (status === "in_progress") {
15745
+ return "Mark Complete";
15746
+ }
15747
+ switch (type) {
15748
+ case "calculation":
15749
+ return "Start Calculation";
15750
+ case "review":
15751
+ return "Start Review";
15752
+ case "upload":
15753
+ return "Upload";
15754
+ case "approval":
15755
+ return "Request Approval";
15756
+ case "documentation":
15757
+ return "Start Documentation";
15758
+ default:
15759
+ return "Start";
15760
+ }
15761
+ }
15762
+ function SubtaskItem({
15763
+ subtaskState,
15764
+ onAction,
15765
+ compact = false,
15766
+ className
15767
+ }) {
15768
+ const { subtask, isLocked, lockReason, isNextAction, isActionable } = subtaskState;
15769
+ const TypeIcon = getSubtaskTypeIcon(subtask.type);
15770
+ const StatusIcon = getStatusIcon(subtask.status);
15771
+ const handleAction = React36.useCallback(() => {
15772
+ if (isActionable && onAction) {
15773
+ onAction(subtask);
15774
+ }
15775
+ }, [isActionable, onAction, subtask]);
15776
+ if (compact) {
15777
+ return /* @__PURE__ */ jsxs(
15778
+ "div",
15779
+ {
15780
+ className: cn(
15781
+ "flex items-center gap-2 py-1.5 px-2 rounded-md text-sm",
15782
+ isLocked && "opacity-60",
15783
+ subtask.status === "done" && "opacity-60",
15784
+ className
15785
+ ),
15786
+ children: [
15787
+ /* @__PURE__ */ jsx(
15788
+ StatusIcon,
15789
+ {
15790
+ className: cn(
15791
+ "h-4 w-4 shrink-0",
15792
+ subtask.status === "done" && "text-green-600 dark:text-green-400",
15793
+ subtask.status === "in_progress" && "text-primary animate-spin",
15794
+ isLocked && "text-muted-foreground"
15795
+ )
15796
+ }
15797
+ ),
15798
+ /* @__PURE__ */ jsx("span", { className: cn(
15799
+ "truncate flex-1",
15800
+ subtask.status === "done" && "line-through text-muted-foreground"
15801
+ ), children: subtask.title }),
15802
+ isLocked && /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip2, { children: [
15803
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Lock, { className: "h-3 w-3 text-muted-foreground shrink-0" }) }),
15804
+ /* @__PURE__ */ jsx(TooltipContent, { side: "left", className: "max-w-xs", children: /* @__PURE__ */ jsx("p", { className: "text-xs", children: lockReason }) })
15805
+ ] }) })
15806
+ ]
15807
+ }
15808
+ );
15809
+ }
15810
+ return /* @__PURE__ */ jsxs(
15811
+ "div",
15812
+ {
15813
+ className: cn(
15814
+ "flex items-start gap-3 py-3 px-3 rounded-lg border bg-card transition-colors",
15815
+ isNextAction && "ring-2 ring-primary/20 border-primary/30",
15816
+ isLocked && "opacity-70 bg-muted/30",
15817
+ subtask.status === "done" && "bg-muted/20",
15818
+ className
15819
+ ),
15820
+ children: [
15821
+ /* @__PURE__ */ jsx("div", { className: "pt-0.5", children: /* @__PURE__ */ jsx(
15822
+ StatusIcon,
15823
+ {
15824
+ className: cn(
15825
+ "h-5 w-5",
15826
+ subtask.status === "done" && "text-green-600 dark:text-green-400",
15827
+ subtask.status === "in_progress" && "text-primary animate-spin",
15828
+ subtask.status === "blocked" && "text-destructive",
15829
+ subtask.status === "todo" && !isLocked && "text-muted-foreground",
15830
+ isLocked && "text-muted-foreground"
15831
+ )
15832
+ }
15833
+ ) }),
15834
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 space-y-1.5", children: [
15835
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
15836
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 min-w-0", children: /* @__PURE__ */ jsx(
15837
+ "span",
15838
+ {
15839
+ className: cn(
15840
+ "font-medium text-sm",
15841
+ subtask.status === "done" && "line-through text-muted-foreground"
15842
+ ),
15843
+ children: subtask.title
15844
+ }
15845
+ ) }),
15846
+ /* @__PURE__ */ jsxs(
15847
+ Badge,
15848
+ {
15849
+ variant: "secondary",
15850
+ className: "shrink-0 text-[10px] px-1.5 py-0 gap-1",
15851
+ children: [
15852
+ /* @__PURE__ */ jsx(TypeIcon, { className: "h-3 w-3" }),
15853
+ getSubtaskTypeLabel(subtask.type)
15854
+ ]
15855
+ }
15856
+ )
15857
+ ] }),
15858
+ subtask.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground line-clamp-2", children: subtask.description }),
15859
+ isLocked && lockReason && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
15860
+ /* @__PURE__ */ jsx(Lock, { className: "h-3 w-3" }),
15861
+ /* @__PURE__ */ jsx("span", { children: lockReason })
15862
+ ] }),
15863
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 pt-1", children: [
15864
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-xs text-muted-foreground", children: [
15865
+ /* @__PURE__ */ jsx(
15866
+ Badge,
15867
+ {
15868
+ variant: "outline",
15869
+ className: cn(
15870
+ "text-[10px] px-1.5 py-0",
15871
+ subtask.status === "done" && "bg-green-500/10 text-green-600 dark:text-green-400 border-green-500/20",
15872
+ subtask.status === "in_progress" && "bg-primary/10 text-primary border-primary/20",
15873
+ subtask.status === "blocked" && "bg-destructive/10 text-destructive border-destructive/20"
15874
+ ),
15875
+ children: getStatusLabel3(subtask.status)
15876
+ }
15877
+ ),
15878
+ subtask.estimatedMinutes && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
15879
+ /* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }),
15880
+ /* @__PURE__ */ jsxs("span", { children: [
15881
+ subtask.estimatedMinutes,
15882
+ "m"
15883
+ ] })
15884
+ ] }),
15885
+ subtask.assignee && /* @__PURE__ */ jsx("span", { className: "truncate max-w-[100px]", children: subtask.assignee.name })
15886
+ ] }),
15887
+ isActionable && onAction && /* @__PURE__ */ jsx(
15888
+ Button,
15889
+ {
15890
+ size: "sm",
15891
+ variant: isNextAction ? "default" : "outline",
15892
+ className: "h-7 text-xs px-2",
15893
+ onClick: handleAction,
15894
+ children: getActionLabel(subtask.status, subtask.type)
15895
+ }
15896
+ )
15897
+ ] })
15898
+ ] })
15899
+ ]
15900
+ }
15901
+ );
15902
+ }
15903
+ function getPriorityConfig(priority) {
15904
+ switch (priority) {
15905
+ case "urgent":
15906
+ return {
15907
+ label: "Urgent",
15908
+ className: "bg-red-500/15 text-red-700 dark:bg-red-500/20 dark:text-red-400"
15909
+ };
15910
+ case "high":
15911
+ return {
15912
+ label: "High",
15913
+ className: "bg-orange-500/15 text-orange-700 dark:bg-orange-500/20 dark:text-orange-400"
15914
+ };
15915
+ case "medium":
15916
+ return {
15917
+ label: "Medium",
15918
+ className: "bg-amber-500/15 text-amber-700 dark:bg-amber-500/20 dark:text-amber-400"
15919
+ };
15920
+ case "low":
15921
+ return {
15922
+ label: "Low",
15923
+ className: "bg-blue-500/15 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400"
15924
+ };
15925
+ default:
15926
+ return { label: priority, className: "" };
15927
+ }
15928
+ }
15929
+ function getStatusConfig(status) {
15930
+ switch (status) {
15931
+ case "done":
15932
+ return {
15933
+ label: "Done",
15934
+ className: "bg-green-500/15 text-green-700 dark:bg-green-500/20 dark:text-green-400"
15935
+ };
15936
+ case "in_progress":
15937
+ return {
15938
+ label: "In Progress",
15939
+ className: "bg-primary/15 text-primary"
15940
+ };
15941
+ case "waiting":
15942
+ return {
15943
+ label: "Waiting",
15944
+ className: "bg-amber-500/15 text-amber-700 dark:bg-amber-500/20 dark:text-amber-400"
15945
+ };
15946
+ case "ready":
15947
+ return {
15948
+ label: "Ready",
15949
+ className: "bg-green-500/15 text-green-700 dark:bg-green-500/20 dark:text-green-400"
15950
+ };
15951
+ case "not_started":
15952
+ return {
15953
+ label: "Not Started",
15954
+ className: "bg-muted text-muted-foreground"
15955
+ };
15956
+ default:
15957
+ return { label: status, className: "" };
15958
+ }
15959
+ }
15960
+ function formatDate3(date) {
15961
+ return new Intl.DateTimeFormat("en-US", {
15962
+ month: "short",
15963
+ day: "numeric"
15964
+ }).format(date);
15965
+ }
15966
+ function PackageCard({
15967
+ packageState,
15968
+ onSubtaskAction,
15969
+ onPackageClick,
15970
+ className
15971
+ }) {
15972
+ const [isExpanded, setIsExpanded] = React36.useState(false);
15973
+ const {
15974
+ package: pkg,
15975
+ status,
15976
+ progress,
15977
+ completedCount,
15978
+ totalCount,
15979
+ nextAction,
15980
+ nextActionLabel,
15981
+ subtaskStates,
15982
+ isComplete,
15983
+ isWaiting
15984
+ } = packageState;
15985
+ const priorityConfig = getPriorityConfig(pkg.priority);
15986
+ const statusConfig = getStatusConfig(status);
15987
+ const handleCardClick = React36.useCallback((e) => {
15988
+ if (e.target.closest('button, [role="button"]')) {
15989
+ return;
15990
+ }
15991
+ onPackageClick?.(pkg);
15992
+ }, [onPackageClick, pkg]);
15993
+ const handleNextAction = React36.useCallback(() => {
15994
+ if (nextAction && onSubtaskAction) {
15995
+ onSubtaskAction(nextAction.subtask);
15996
+ }
15997
+ }, [nextAction, onSubtaskAction]);
15998
+ return /* @__PURE__ */ jsxs(
15999
+ Card,
16000
+ {
16001
+ className: cn(
16002
+ "p-3 space-y-3 cursor-pointer transition-all hover:shadow-md",
16003
+ isComplete && "opacity-80",
16004
+ className
16005
+ ),
16006
+ onClick: handleCardClick,
16007
+ children: [
16008
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
16009
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 min-w-0 flex-1", children: [
16010
+ /* @__PURE__ */ jsx(Package, { className: "h-4 w-4 mt-0.5 shrink-0 text-muted-foreground" }),
16011
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
16012
+ /* @__PURE__ */ jsx("h4", { className: "font-medium text-sm leading-tight truncate", children: pkg.name }),
16013
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground truncate", children: pkg.project })
16014
+ ] })
16015
+ ] }),
16016
+ /* @__PURE__ */ jsx(
16017
+ Badge,
16018
+ {
16019
+ variant: "secondary",
16020
+ className: cn("text-[10px] px-1.5 py-0 shrink-0", priorityConfig.className),
16021
+ children: priorityConfig.label
16022
+ }
16023
+ )
16024
+ ] }),
16025
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1.5", children: [
16026
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs", children: [
16027
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Progress" }),
16028
+ /* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
16029
+ completedCount,
16030
+ "/",
16031
+ totalCount
16032
+ ] })
16033
+ ] }),
16034
+ /* @__PURE__ */ jsx(Progress, { value: progress * 100, className: "h-1.5" })
16035
+ ] }),
16036
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
16037
+ /* @__PURE__ */ jsx(
16038
+ Badge,
16039
+ {
16040
+ variant: "secondary",
16041
+ className: cn("text-[10px] px-1.5 py-0", statusConfig.className),
16042
+ children: statusConfig.label
16043
+ }
16044
+ ),
16045
+ isWaiting ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
16046
+ /* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }),
16047
+ /* @__PURE__ */ jsx("span", { children: "Waiting" })
16048
+ ] }) : nextAction ? /* @__PURE__ */ jsx(
16049
+ Button,
16050
+ {
16051
+ size: "sm",
16052
+ variant: "default",
16053
+ className: "h-6 text-[10px] px-2",
16054
+ onClick: (e) => {
16055
+ e.stopPropagation();
16056
+ handleNextAction();
16057
+ },
16058
+ children: nextActionLabel
16059
+ }
16060
+ ) : isComplete ? /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[10px] px-1.5 py-0 bg-green-500/10 text-green-600 border-green-500/20", children: "Complete" }) : null
16061
+ ] }),
16062
+ (pkg.dueDate || pkg.tags && pkg.tags.length > 0) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 pt-1 border-t border-border/50", children: [
16063
+ pkg.dueDate && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
16064
+ /* @__PURE__ */ jsx(CalendarDays, { className: "h-3 w-3" }),
16065
+ /* @__PURE__ */ jsx("span", { children: formatDate3(pkg.dueDate) })
16066
+ ] }),
16067
+ pkg.tags && pkg.tags.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 flex-wrap justify-end", children: [
16068
+ pkg.tags.slice(0, 2).map((tag) => /* @__PURE__ */ jsx(
16069
+ Badge,
16070
+ {
16071
+ variant: "outline",
16072
+ className: "text-[9px] px-1 py-0 h-4",
16073
+ children: tag
16074
+ },
16075
+ tag
16076
+ )),
16077
+ pkg.tags.length > 2 && /* @__PURE__ */ jsxs("span", { className: "text-[9px] text-muted-foreground", children: [
16078
+ "+",
16079
+ pkg.tags.length - 2
16080
+ ] })
16081
+ ] })
16082
+ ] }),
16083
+ /* @__PURE__ */ jsxs(Collapsible, { open: isExpanded, onOpenChange: setIsExpanded, children: [
16084
+ /* @__PURE__ */ jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs(
16085
+ Button,
16086
+ {
16087
+ variant: "ghost",
16088
+ size: "sm",
16089
+ className: "w-full h-7 text-xs text-muted-foreground hover:text-foreground justify-between",
16090
+ onClick: (e) => e.stopPropagation(),
16091
+ children: [
16092
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
16093
+ isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-3 w-3" }),
16094
+ subtaskStates.length,
16095
+ " subtasks"
16096
+ ] }),
16097
+ subtaskStates.some((s) => s.isLocked) && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1 text-amber-600 dark:text-amber-400", children: [
16098
+ /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3" }),
16099
+ subtaskStates.filter((s) => s.isLocked).length,
16100
+ " locked"
16101
+ ] })
16102
+ ]
16103
+ }
16104
+ ) }),
16105
+ /* @__PURE__ */ jsx(CollapsibleContent2, { className: "pt-2 space-y-1.5", children: subtaskStates.map((subtaskState) => /* @__PURE__ */ jsx(
16106
+ SubtaskItem,
16107
+ {
16108
+ subtaskState,
16109
+ onAction: onSubtaskAction,
16110
+ compact: true
16111
+ },
16112
+ subtaskState.subtask.id
16113
+ )) })
16114
+ ] }),
16115
+ isWaiting && !isComplete && /* @__PURE__ */ jsxs(
16116
+ Button,
16117
+ {
16118
+ variant: "ghost",
16119
+ size: "sm",
16120
+ className: "w-full h-7 text-xs text-muted-foreground",
16121
+ onClick: (e) => {
16122
+ e.stopPropagation();
16123
+ onPackageClick?.(pkg);
16124
+ },
16125
+ children: [
16126
+ /* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3 mr-1" }),
16127
+ "View context"
16128
+ ]
16129
+ }
16130
+ )
16131
+ ]
16132
+ }
16133
+ );
16134
+ }
16135
+
16136
+ // src/blocks/todo-board/rules.ts
16137
+ function areDependenciesSatisfied(subtask, allSubtasks) {
16138
+ if (subtask.dependsOn.length === 0) return true;
16139
+ return subtask.dependsOn.every((depId) => {
16140
+ const dep = allSubtasks.find((s) => s.id === depId);
16141
+ return dep?.status === "done";
16142
+ });
16143
+ }
16144
+ function getBlockingSubtasks(subtask, allSubtasks) {
16145
+ return subtask.dependsOn.map((depId) => allSubtasks.find((s) => s.id === depId)).filter((dep) => dep !== void 0 && dep.status !== "done");
16146
+ }
16147
+ function generateLockReason(blockingSubtasks) {
16148
+ if (blockingSubtasks.length === 0) return "";
16149
+ if (blockingSubtasks.length === 1) {
16150
+ return `Waiting for "${blockingSubtasks[0].title}" to complete`;
16151
+ }
16152
+ const typeGroups = blockingSubtasks.reduce((acc, subtask) => {
16153
+ acc[subtask.type] = (acc[subtask.type] || 0) + 1;
16154
+ return acc;
16155
+ }, {});
16156
+ const parts = Object.entries(typeGroups).map(
16157
+ ([type, count]) => count === 1 ? `1 ${type}` : `${count} ${type}s`
16158
+ );
16159
+ return `Waiting for ${parts.join(", ")} to complete`;
16160
+ }
16161
+ function computeSubtaskState(subtask, allSubtasks, isNextAction) {
16162
+ const blockingSubtasks = getBlockingSubtasks(subtask, allSubtasks);
16163
+ const isLocked = blockingSubtasks.length > 0;
16164
+ const lockReason = isLocked ? generateLockReason(blockingSubtasks) : void 0;
16165
+ const isActionable = !isLocked && subtask.status !== "done" && subtask.status !== "blocked";
16166
+ return {
16167
+ subtask,
16168
+ isLocked,
16169
+ lockReason,
16170
+ blockedBy: blockingSubtasks.map((s) => s.id),
16171
+ isNextAction,
16172
+ isActionable
16173
+ };
16174
+ }
16175
+ function allRequiredSubtasksDone(pkg, config) {
16176
+ if (!config?.requirements) {
16177
+ return pkg.subtasks.every((s) => s.status === "done");
16178
+ }
16179
+ for (const req of config.requirements) {
16180
+ const subtasksOfType = pkg.subtasks.filter((s) => s.type === req.type);
16181
+ const doneCount = subtasksOfType.filter((s) => s.status === "done").length;
16182
+ if (doneCount < req.minCount) return false;
16183
+ }
16184
+ return pkg.subtasks.every((s) => s.status === "done");
16185
+ }
16186
+ function anySubtaskStartedOrDone(pkg) {
16187
+ return pkg.subtasks.some(
16188
+ (s) => s.status === "in_progress" || s.status === "done"
16189
+ );
16190
+ }
16191
+ function derivePackageBucket(pkg, config) {
16192
+ if (allRequiredSubtasksDone(pkg, config)) {
16193
+ return "completed";
16194
+ }
16195
+ if (anySubtaskStartedOrDone(pkg)) {
16196
+ return "in_progress";
16197
+ }
16198
+ return "next";
16199
+ }
16200
+ function derivePackageStatus(pkg, bucket, hasNextAction) {
16201
+ if (bucket === "completed") {
16202
+ return "done";
16203
+ }
16204
+ if (bucket === "next" && !anySubtaskStartedOrDone(pkg)) {
16205
+ return "not_started";
16206
+ }
16207
+ if (!hasNextAction) {
16208
+ return "waiting";
16209
+ }
16210
+ return "in_progress";
16211
+ }
16212
+ function findNextActionableSubtask(subtaskStates) {
16213
+ const sorted = [...subtaskStates].sort(
16214
+ (a, b) => a.subtask.order - b.subtask.order
16215
+ );
16216
+ const inProgress = sorted.find(
16217
+ (s) => s.isActionable && s.subtask.status === "in_progress"
16218
+ );
16219
+ if (inProgress) return inProgress;
16220
+ const todo = sorted.find(
16221
+ (s) => s.isActionable && s.subtask.status === "todo"
16222
+ );
16223
+ return todo;
16224
+ }
16225
+ function generateNextActionLabel(nextAction) {
16226
+ if (!nextAction) return void 0;
16227
+ const { subtask } = nextAction;
16228
+ if (subtask.status === "in_progress") {
16229
+ switch (subtask.type) {
16230
+ case "calculation":
16231
+ return "Continue Calculation";
16232
+ case "review":
16233
+ return "Continue Review";
16234
+ case "upload":
16235
+ return "Resume Upload";
16236
+ case "approval":
16237
+ return "Continue Approval";
16238
+ case "documentation":
16239
+ return "Continue Documentation";
16240
+ default:
16241
+ return "Continue Task";
16242
+ }
16243
+ }
16244
+ switch (subtask.type) {
16245
+ case "calculation":
16246
+ return "Start Calculation";
16247
+ case "review":
16248
+ return "Start Review";
16249
+ case "upload":
16250
+ return "Upload Files";
16251
+ case "approval":
16252
+ return "Request Approval";
16253
+ case "documentation":
16254
+ return "Add Documentation";
16255
+ default:
16256
+ return "Start Task";
16257
+ }
16258
+ }
16259
+ function calculateProgress(pkg) {
16260
+ const totalCount = pkg.subtasks.length;
16261
+ if (totalCount === 0) {
16262
+ return { progress: 1, completedCount: 0, totalCount: 0 };
16263
+ }
16264
+ const completedCount = pkg.subtasks.filter((s) => s.status === "done").length;
16265
+ const progress = completedCount / totalCount;
16266
+ return { progress, completedCount, totalCount };
16267
+ }
16268
+ function computePackageDerivedState(pkg, config) {
16269
+ const subtaskStatesWithoutNextAction = pkg.subtasks.map(
16270
+ (subtask) => computeSubtaskState(subtask, pkg.subtasks, false)
16271
+ );
16272
+ const nextActionCandidate = findNextActionableSubtask(subtaskStatesWithoutNextAction);
16273
+ const subtaskStates = subtaskStatesWithoutNextAction.map((state) => ({
16274
+ ...state,
16275
+ isNextAction: state.subtask.id === nextActionCandidate?.subtask.id
16276
+ }));
16277
+ const nextAction = nextActionCandidate ? subtaskStates.find((s) => s.isNextAction) : void 0;
16278
+ const bucket = derivePackageBucket(pkg, config);
16279
+ const hasNextAction = nextAction !== void 0;
16280
+ const status = derivePackageStatus(pkg, bucket, hasNextAction);
16281
+ const { progress, completedCount, totalCount } = calculateProgress(pkg);
16282
+ const nextActionLabel = generateNextActionLabel(nextAction);
16283
+ return {
16284
+ package: pkg,
16285
+ bucket,
16286
+ status,
16287
+ progress,
16288
+ completedCount,
16289
+ totalCount,
16290
+ nextAction,
16291
+ nextActionLabel,
16292
+ subtaskStates,
16293
+ isComplete: bucket === "completed",
16294
+ isWaiting: status === "waiting"
16295
+ };
16296
+ }
16297
+ function computeAllPackageStates(packages, config) {
16298
+ return packages.map((pkg) => computePackageDerivedState(pkg, config));
16299
+ }
16300
+ function groupPackagesByBucket(packageStates) {
16301
+ return {
16302
+ next: packageStates.filter((p) => p.bucket === "next"),
16303
+ in_progress: packageStates.filter((p) => p.bucket === "in_progress"),
16304
+ completed: packageStates.filter((p) => p.bucket === "completed")
16305
+ };
16306
+ }
16307
+ function updateSubtaskStatus(pkg, subtaskId, newStatus, config) {
16308
+ const updatedSubtasks = pkg.subtasks.map((subtask) => {
16309
+ if (subtask.id !== subtaskId) return subtask;
16310
+ return {
16311
+ ...subtask,
16312
+ status: newStatus,
16313
+ completedAt: newStatus === "done" ? /* @__PURE__ */ new Date() : void 0
16314
+ };
16315
+ });
16316
+ const updatedPackage = {
16317
+ ...pkg,
16318
+ subtasks: updatedSubtasks,
16319
+ updatedAt: /* @__PURE__ */ new Date()
16320
+ };
16321
+ const derivedState = computePackageDerivedState(updatedPackage, config);
16322
+ return { updatedPackage, derivedState };
16323
+ }
16324
+ function startSubtask(pkg, subtaskId, config) {
16325
+ return updateSubtaskStatus(pkg, subtaskId, "in_progress", config);
16326
+ }
16327
+ function completeSubtask(pkg, subtaskId, config) {
16328
+ return updateSubtaskStatus(pkg, subtaskId, "done", config);
16329
+ }
16330
+ var DEFAULT_BUCKETS = [
16331
+ { id: "next", name: "Next" },
16332
+ { id: "in_progress", name: "In Progress" },
16333
+ { id: "completed", name: "Completed" }
16334
+ ];
16335
+ function getBucketConfig(config) {
16336
+ return config?.buckets ?? DEFAULT_BUCKETS;
16337
+ }
16338
+ function SortablePackageCard({
16339
+ packageState,
16340
+ onSubtaskAction,
16341
+ onPackageClick
16342
+ }) {
16343
+ const {
16344
+ attributes,
16345
+ listeners,
16346
+ setNodeRef,
16347
+ transform,
16348
+ transition,
16349
+ isDragging
16350
+ } = useSortable({
16351
+ id: packageState.package.id,
16352
+ data: {
16353
+ type: "package",
16354
+ packageState
16355
+ }
16356
+ });
16357
+ const style = {
16358
+ transform: CSS.Transform.toString(transform),
16359
+ transition
16360
+ };
16361
+ return /* @__PURE__ */ jsx(
16362
+ "div",
16363
+ {
16364
+ ref: setNodeRef,
16365
+ style,
16366
+ ...attributes,
16367
+ ...listeners,
16368
+ className: cn(
16369
+ "cursor-grab active:cursor-grabbing",
16370
+ isDragging && "opacity-30"
16371
+ ),
16372
+ children: /* @__PURE__ */ jsx(
16373
+ PackageCard,
16374
+ {
16375
+ packageState,
16376
+ onSubtaskAction,
16377
+ onPackageClick
16378
+ }
16379
+ )
16380
+ }
16381
+ );
16382
+ }
16383
+ function KanbanColumn({
16384
+ id,
16385
+ name,
16386
+ packageStates,
16387
+ onSubtaskAction,
16388
+ onPackageClick
16389
+ }) {
16390
+ const packageIds = packageStates.map((p) => p.package.id);
16391
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col min-w-[280px] max-w-[320px] flex-1 h-full bg-muted/20 rounded-lg border", children: [
16392
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-3 border-b bg-muted/30 shrink-0", children: [
16393
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-sm", children: name }),
16394
+ /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "text-xs", children: packageStates.length })
16395
+ ] }),
16396
+ /* @__PURE__ */ jsxs(ScrollArea, { className: "flex-1 min-h-0", children: [
16397
+ /* @__PURE__ */ jsx(SortableContext, { items: packageIds, children: /* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2", children: [
16398
+ packageStates.map((packageState) => /* @__PURE__ */ jsx(
16399
+ SortablePackageCard,
16400
+ {
16401
+ packageState,
16402
+ onSubtaskAction,
16403
+ onPackageClick
16404
+ },
16405
+ packageState.package.id
16406
+ )),
16407
+ packageStates.length === 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[100px] text-sm text-muted-foreground", children: "No packages" })
16408
+ ] }) }),
16409
+ /* @__PURE__ */ jsx(ScrollBar, { orientation: "vertical" })
16410
+ ] })
16411
+ ] });
16412
+ }
16413
+ function TodoBoard({
16414
+ packages,
16415
+ workflowConfig,
16416
+ onSubtaskAction,
16417
+ onPackageClick,
16418
+ onPackagesChange,
16419
+ height = 600,
16420
+ className
16421
+ }) {
16422
+ const [activeId, setActiveId] = React36.useState(null);
16423
+ const sensors = useSensors(
16424
+ useSensor(MouseSensor, {
16425
+ activationConstraint: { distance: 8 }
16426
+ }),
16427
+ useSensor(TouchSensor, {
16428
+ activationConstraint: { delay: 200, tolerance: 5 }
16429
+ })
16430
+ );
16431
+ const packageStates = React36.useMemo(
16432
+ () => computeAllPackageStates(packages, workflowConfig),
16433
+ [packages, workflowConfig]
16434
+ );
16435
+ const groupedPackages = React36.useMemo(
16436
+ () => groupPackagesByBucket(packageStates),
16437
+ [packageStates]
16438
+ );
16439
+ const buckets = getBucketConfig(workflowConfig);
16440
+ const activePackageState = React36.useMemo(
16441
+ () => packageStates.find((p) => p.package.id === activeId),
16442
+ [packageStates, activeId]
16443
+ );
16444
+ const handleDragStart = React36.useCallback((event) => {
16445
+ setActiveId(event.active.id);
16446
+ }, []);
16447
+ const handleDragEnd = React36.useCallback((event) => {
16448
+ setActiveId(null);
16449
+ }, []);
16450
+ const heightStyle = typeof height === "number" ? `${height}px` : height;
16451
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), children: [
16452
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "text-sm", children: [
16453
+ packages.length,
16454
+ " packages"
16455
+ ] }) }),
16456
+ /* @__PURE__ */ jsxs(
16457
+ DndContext,
16458
+ {
16459
+ sensors,
16460
+ collisionDetection: closestCenter,
16461
+ onDragStart: handleDragStart,
16462
+ onDragEnd: handleDragEnd,
16463
+ children: [
16464
+ /* @__PURE__ */ jsx(
16465
+ "div",
16466
+ {
16467
+ className: "flex gap-4 overflow-x-auto pb-2",
16468
+ style: { height: heightStyle },
16469
+ children: buckets.map((bucket) => /* @__PURE__ */ jsx(
16470
+ KanbanColumn,
16471
+ {
16472
+ id: bucket.id,
16473
+ name: bucket.name,
16474
+ packageStates: groupedPackages[bucket.id] || [],
16475
+ onSubtaskAction,
16476
+ onPackageClick
16477
+ },
16478
+ bucket.id
16479
+ ))
16480
+ }
16481
+ ),
16482
+ typeof window !== "undefined" && createPortal(
16483
+ /* @__PURE__ */ jsx(DragOverlay, { children: activePackageState && /* @__PURE__ */ jsx(
16484
+ PackageCard,
16485
+ {
16486
+ packageState: activePackageState,
16487
+ className: "rotate-3 shadow-xl ring-2 ring-primary"
16488
+ }
16489
+ ) }),
16490
+ document.body
16491
+ )
16492
+ ]
16493
+ }
16494
+ )
16495
+ ] });
16496
+ }
16497
+ var DEFAULT_BUCKETS2 = [
16498
+ { id: "in_progress", name: "In progress", color: "bg-orange-500" },
16499
+ { id: "next", name: "To-do", color: "bg-cyan-500" },
16500
+ { id: "completed", name: "Completed", color: "bg-green-500" }
16501
+ ];
16502
+ var PRIORITY_ORDER = {
16503
+ urgent: 0,
16504
+ high: 1,
16505
+ medium: 2,
16506
+ low: 3
16507
+ };
16508
+ function getBucketConfig2(config) {
16509
+ if (!config?.buckets) return DEFAULT_BUCKETS2;
16510
+ return config.buckets.map((b) => {
16511
+ const defaultBucket = DEFAULT_BUCKETS2.find((d) => d.id === b.id);
16512
+ return {
16513
+ ...b,
16514
+ color: defaultBucket?.color ?? "bg-muted"
16515
+ };
16516
+ });
16517
+ }
16518
+ function getPriorityBadge(priority) {
16519
+ const config = {
16520
+ urgent: { label: "Urgent", className: "bg-red-500/15 text-red-600 dark:text-red-400" },
16521
+ high: { label: "High", className: "bg-orange-500/15 text-orange-600 dark:text-orange-400" },
16522
+ medium: { label: "Normal", className: "bg-muted text-muted-foreground" },
16523
+ low: { label: "Low", className: "bg-blue-500/15 text-blue-600 dark:text-blue-400" }
16524
+ };
16525
+ return config[priority] ?? config.medium;
16526
+ }
16527
+ function getStatusBadge2(status, isLocked) {
16528
+ if (isLocked) {
16529
+ return { label: "Locked", className: "bg-muted text-muted-foreground" };
16530
+ }
16531
+ const config = {
16532
+ done: { label: "Completed", className: "bg-green-500/15 text-green-600 dark:text-green-400" },
16533
+ in_progress: { label: "Started", className: "bg-amber-500/15 text-amber-600 dark:text-amber-400" },
16534
+ todo: { label: "To do", className: "bg-muted text-muted-foreground" },
16535
+ blocked: { label: "Blocked", className: "bg-red-500/15 text-red-600 dark:text-red-400" }
16536
+ };
16537
+ return config[status] ?? config.todo;
16538
+ }
16539
+ function formatDate4(date) {
16540
+ const now = /* @__PURE__ */ new Date();
16541
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
16542
+ const dateOnly = new Date(date.getFullYear(), date.getMonth(), date.getDate());
16543
+ if (dateOnly.getTime() === today.getTime()) {
16544
+ return `Today, ${date.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit", hour12: true }).toLowerCase()}`;
16545
+ }
16546
+ const days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
16547
+ const dayName = days[date.getDay()];
16548
+ const time = date.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit", hour12: true }).toLowerCase();
16549
+ return `${dayName}, ${time}`;
16550
+ }
16551
+ function sortPackages(packages, field, direction) {
16552
+ if (!direction) return packages;
16553
+ return [...packages].sort((a, b) => {
16554
+ let comparison = 0;
16555
+ switch (field) {
16556
+ case "status":
16557
+ comparison = a.progress - b.progress;
16558
+ break;
16559
+ case "dueDate":
16560
+ const dateA = a.package.dueDate?.getTime() ?? Infinity;
16561
+ const dateB = b.package.dueDate?.getTime() ?? Infinity;
16562
+ comparison = dateA - dateB;
16563
+ break;
16564
+ case "priority":
16565
+ comparison = PRIORITY_ORDER[a.package.priority] - PRIORITY_ORDER[b.package.priority];
16566
+ break;
16567
+ }
16568
+ return direction === "asc" ? comparison : -comparison;
16569
+ });
16570
+ }
16571
+ function SortableHeader({ label, field, currentSort, onSort }) {
16572
+ const isActive = currentSort.field === field && currentSort.direction !== null;
16573
+ return /* @__PURE__ */ jsxs(
16574
+ Button,
16575
+ {
16576
+ variant: "ghost",
16577
+ size: "sm",
16578
+ className: cn(
16579
+ "h-auto p-0 font-medium hover:bg-transparent",
16580
+ isActive && "text-foreground"
16581
+ ),
16582
+ onClick: () => onSort(field),
16583
+ children: [
16584
+ label,
16585
+ /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-1 h-3 w-3" })
16586
+ ]
16587
+ }
16588
+ );
16589
+ }
16590
+ function BucketHeaderRow({ name, color, currentSort, onSort }) {
16591
+ return /* @__PURE__ */ jsxs(TableRow, { className: "bg-background hover:bg-background border-t-2", children: [
16592
+ /* @__PURE__ */ jsx(TableCell, { colSpan: 2, className: "py-3", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
16593
+ /* @__PURE__ */ jsx("div", { className: cn("w-2.5 h-2.5 rounded-full", color) }),
16594
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-sm", children: name })
16595
+ ] }) }),
16596
+ /* @__PURE__ */ jsx(TableCell, { className: "py-3", children: /* @__PURE__ */ jsx(SortableHeader, { label: "Status", field: "status", currentSort, onSort }) }),
16597
+ /* @__PURE__ */ jsx(TableCell, { className: "py-3", children: /* @__PURE__ */ jsx(SortableHeader, { label: "Due Date", field: "dueDate", currentSort, onSort }) }),
16598
+ /* @__PURE__ */ jsx(TableCell, { className: "py-3", children: /* @__PURE__ */ jsx(SortableHeader, { label: "Priority", field: "priority", currentSort, onSort }) })
16599
+ ] });
16600
+ }
16601
+ function PackageRow({ packageState, isExpanded, onToggleExpand, onPackageClick }) {
16602
+ const { package: pkg, completedCount, totalCount } = packageState;
16603
+ const priorityBadge = getPriorityBadge(pkg.priority);
16604
+ return /* @__PURE__ */ jsxs(
16605
+ TableRow,
16606
+ {
16607
+ className: "cursor-pointer hover:bg-muted/50 transition-colors",
16608
+ onClick: () => onPackageClick?.(pkg),
16609
+ children: [
16610
+ /* @__PURE__ */ jsx(TableCell, { className: "w-10", children: /* @__PURE__ */ jsx(
16611
+ Button,
16612
+ {
16613
+ variant: "ghost",
16614
+ size: "icon",
16615
+ className: "h-6 w-6",
16616
+ onClick: (e) => {
16617
+ e.stopPropagation();
16618
+ onToggleExpand();
16619
+ },
16620
+ children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
16621
+ }
16622
+ ) }),
16623
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
16624
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[10px] px-1.5 py-0 shrink-0 bg-muted/50", children: "Main task" }),
16625
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-sm", children: pkg.name }),
16626
+ /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
16627
+ completedCount,
16628
+ "/",
16629
+ totalCount,
16630
+ " Completed"
16631
+ ] })
16632
+ ] }) }),
16633
+ /* @__PURE__ */ jsx(TableCell, {}),
16634
+ /* @__PURE__ */ jsx(TableCell, { className: "text-sm text-muted-foreground", children: pkg.dueDate ? formatDate4(pkg.dueDate) : "\u2014" }),
16635
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: cn("text-[10px] px-1.5 py-0", priorityBadge.className), children: priorityBadge.label }) })
16636
+ ]
16637
+ }
16638
+ );
16639
+ }
16640
+ function SubtaskRow({ subtaskState, onSubtaskAction }) {
16641
+ const { subtask, isLocked } = subtaskState;
16642
+ const statusBadge = getStatusBadge2(subtask.status, isLocked);
16643
+ subtask.assignee ? getPriorityBadge("medium") : getPriorityBadge("medium");
16644
+ return /* @__PURE__ */ jsxs(
16645
+ TableRow,
16646
+ {
16647
+ className: cn(
16648
+ "hover:bg-muted/30 transition-colors",
16649
+ isLocked && "opacity-60"
16650
+ ),
16651
+ onClick: () => !isLocked && onSubtaskAction?.(subtask),
16652
+ children: [
16653
+ /* @__PURE__ */ jsx(TableCell, { className: "w-10" }),
16654
+ /* @__PURE__ */ jsx(TableCell, { className: "pl-10", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
16655
+ /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[10px] px-1.5 py-0 shrink-0 bg-muted/30", children: "Subtask" }),
16656
+ /* @__PURE__ */ jsx("span", { className: cn(
16657
+ "text-sm",
16658
+ subtask.status === "done" && "text-muted-foreground",
16659
+ isLocked && "text-muted-foreground"
16660
+ ), children: subtask.title })
16661
+ ] }) }),
16662
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: cn("text-[10px] px-1.5 py-0", statusBadge.className), children: statusBadge.label }) }),
16663
+ /* @__PURE__ */ jsx(TableCell, { className: "text-sm text-muted-foreground", children: subtask.completedAt ? formatDate4(subtask.completedAt) : "\u2014" }),
16664
+ /* @__PURE__ */ jsx(TableCell, { children: subtask.estimatedMinutes && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
16665
+ "~",
16666
+ subtask.estimatedMinutes,
16667
+ "m"
16668
+ ] }) })
16669
+ ]
16670
+ }
16671
+ );
16672
+ }
16673
+ function TodoList({
16674
+ packages,
16675
+ workflowConfig,
16676
+ onSubtaskAction,
16677
+ onPackageClick,
16678
+ className
16679
+ }) {
16680
+ const [expandedIds, setExpandedIds] = React36.useState(/* @__PURE__ */ new Set());
16681
+ const [sort, setSort] = React36.useState({
16682
+ field: "priority",
16683
+ direction: null
16684
+ });
16685
+ const packageStates = React36.useMemo(
16686
+ () => computeAllPackageStates(packages, workflowConfig),
16687
+ [packages, workflowConfig]
16688
+ );
16689
+ const groupedPackages = React36.useMemo(
16690
+ () => groupPackagesByBucket(packageStates),
16691
+ [packageStates]
16692
+ );
16693
+ const buckets = getBucketConfig2(workflowConfig);
16694
+ const toggleExpand = React36.useCallback((id) => {
16695
+ setExpandedIds((prev) => {
16696
+ const next = new Set(prev);
16697
+ if (next.has(id)) {
16698
+ next.delete(id);
16699
+ } else {
16700
+ next.add(id);
16701
+ }
16702
+ return next;
16703
+ });
16704
+ }, []);
16705
+ const handleSort = React36.useCallback((field) => {
16706
+ setSort((prev) => {
16707
+ if (prev.field !== field) {
16708
+ return { field, direction: "asc" };
16709
+ }
16710
+ if (prev.direction === "asc") {
16711
+ return { field, direction: "desc" };
16712
+ }
16713
+ if (prev.direction === "desc") {
16714
+ return { field, direction: null };
16715
+ }
16716
+ return { field, direction: "asc" };
16717
+ });
16718
+ }, []);
16719
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), children: [
16720
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxs(Badge, { variant: "outline", className: "text-sm", children: [
16721
+ packages.length,
16722
+ " packages"
16723
+ ] }) }),
16724
+ /* @__PURE__ */ jsx(Card, { className: "overflow-hidden", children: /* @__PURE__ */ jsxs(ScrollArea, { className: "w-full", children: [
16725
+ /* @__PURE__ */ jsxs(Table, { children: [
16726
+ /* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { className: "bg-muted/30", children: [
16727
+ /* @__PURE__ */ jsx(TableHead, { className: "w-10" }),
16728
+ /* @__PURE__ */ jsx(TableHead, { className: "min-w-[300px]", children: "Task" }),
16729
+ /* @__PURE__ */ jsx(TableHead, { className: "w-[120px]", children: "Status" }),
16730
+ /* @__PURE__ */ jsx(TableHead, { className: "w-[140px]", children: "Due Date" }),
16731
+ /* @__PURE__ */ jsx(TableHead, { className: "w-[100px]", children: "Priority" })
16732
+ ] }) }),
16733
+ /* @__PURE__ */ jsxs(TableBody, { children: [
16734
+ buckets.map((bucket) => {
16735
+ const bucketPackages = groupedPackages[bucket.id] || [];
16736
+ if (bucketPackages.length === 0) return null;
16737
+ const sortedPackages = sortPackages(bucketPackages, sort.field, sort.direction);
16738
+ return /* @__PURE__ */ jsxs(React36.Fragment, { children: [
16739
+ /* @__PURE__ */ jsx(
16740
+ BucketHeaderRow,
16741
+ {
16742
+ name: bucket.name,
16743
+ color: bucket.color,
16744
+ currentSort: sort,
16745
+ onSort: handleSort
16746
+ }
16747
+ ),
16748
+ sortedPackages.map((packageState) => {
16749
+ const isExpanded = expandedIds.has(packageState.package.id);
16750
+ return /* @__PURE__ */ jsxs(React36.Fragment, { children: [
16751
+ /* @__PURE__ */ jsx(
16752
+ PackageRow,
16753
+ {
16754
+ packageState,
16755
+ isExpanded,
16756
+ onToggleExpand: () => toggleExpand(packageState.package.id),
16757
+ onPackageClick
16758
+ }
16759
+ ),
16760
+ isExpanded && packageState.subtaskStates.map((subtaskState) => /* @__PURE__ */ jsx(
16761
+ SubtaskRow,
16762
+ {
16763
+ subtaskState,
16764
+ onSubtaskAction
16765
+ },
16766
+ subtaskState.subtask.id
16767
+ ))
16768
+ ] }, packageState.package.id);
16769
+ })
16770
+ ] }, bucket.id);
16771
+ }),
16772
+ packages.length === 0 && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: 5, className: "h-32 text-center text-muted-foreground", children: "No packages found" }) })
16773
+ ] })
16774
+ ] }),
16775
+ /* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" })
16776
+ ] }) })
16777
+ ] });
16778
+ }
16779
+ function getPriorityConfig2(priority) {
16780
+ switch (priority) {
16781
+ case "urgent":
16782
+ return {
16783
+ label: "Urgent",
16784
+ className: "bg-red-500/15 text-red-700 dark:bg-red-500/20 dark:text-red-400"
16785
+ };
16786
+ case "high":
16787
+ return {
16788
+ label: "High",
16789
+ className: "bg-orange-500/15 text-orange-700 dark:bg-orange-500/20 dark:text-orange-400"
16790
+ };
16791
+ case "medium":
16792
+ return {
16793
+ label: "Medium",
16794
+ className: "bg-amber-500/15 text-amber-700 dark:bg-amber-500/20 dark:text-amber-400"
16795
+ };
16796
+ case "low":
16797
+ return {
16798
+ label: "Low",
16799
+ className: "bg-blue-500/15 text-blue-700 dark:bg-blue-500/20 dark:text-blue-400"
16800
+ };
16801
+ default:
16802
+ return { label: priority, className: "" };
16803
+ }
16804
+ }
16805
+ function getStatusConfig2(status) {
16806
+ switch (status) {
16807
+ case "done":
16808
+ return {
16809
+ label: "Done",
16810
+ className: "bg-green-500/15 text-green-700 dark:bg-green-500/20 dark:text-green-400"
16811
+ };
16812
+ case "in_progress":
16813
+ return {
16814
+ label: "In Progress",
16815
+ className: "bg-primary/15 text-primary"
16816
+ };
16817
+ case "waiting":
16818
+ return {
16819
+ label: "Waiting",
16820
+ className: "bg-amber-500/15 text-amber-700 dark:bg-amber-500/20 dark:text-amber-400"
16821
+ };
16822
+ case "ready":
16823
+ return {
16824
+ label: "Ready",
16825
+ className: "bg-green-500/15 text-green-700 dark:bg-green-500/20 dark:text-green-400"
16826
+ };
16827
+ case "not_started":
16828
+ return {
16829
+ label: "Not Started",
16830
+ className: "bg-muted text-muted-foreground"
16831
+ };
16832
+ default:
16833
+ return { label: status, className: "" };
16834
+ }
16835
+ }
16836
+ function formatDate5(date) {
16837
+ return new Intl.DateTimeFormat("en-US", {
16838
+ month: "short",
16839
+ day: "numeric"
16840
+ }).format(date);
16841
+ }
16842
+ function PackageRow2({
16843
+ packageState,
16844
+ onSubtaskAction,
16845
+ onPackageClick,
16846
+ isExpanded = false,
16847
+ onExpandToggle,
16848
+ className
16849
+ }) {
16850
+ const {
16851
+ package: pkg,
16852
+ status,
16853
+ progress,
16854
+ completedCount,
16855
+ totalCount,
16856
+ nextAction,
16857
+ nextActionLabel,
16858
+ subtaskStates,
16859
+ isComplete,
16860
+ isWaiting
16861
+ } = packageState;
16862
+ const priorityConfig = getPriorityConfig2(pkg.priority);
16863
+ const statusConfig = getStatusConfig2(status);
16864
+ const lockedCount = subtaskStates.filter((s) => s.isLocked).length;
16865
+ const handleRowClick = React36.useCallback(() => {
16866
+ onPackageClick?.(pkg);
16867
+ }, [onPackageClick, pkg]);
16868
+ const handleNextAction = React36.useCallback(() => {
16869
+ if (nextAction && onSubtaskAction) {
16870
+ onSubtaskAction(nextAction.subtask);
16871
+ }
16872
+ }, [nextAction, onSubtaskAction]);
16873
+ return /* @__PURE__ */ jsxs(Collapsible, { open: isExpanded, onOpenChange: onExpandToggle, children: [
16874
+ /* @__PURE__ */ jsxs(
16875
+ TableRow,
16876
+ {
16877
+ className: cn(
16878
+ "group cursor-pointer hover:bg-muted/50",
16879
+ isComplete && "opacity-70",
16880
+ isExpanded && "bg-muted/30",
16881
+ className
16882
+ ),
16883
+ onClick: handleRowClick,
16884
+ children: [
16885
+ /* @__PURE__ */ jsx(TableCell, { className: "w-10", children: /* @__PURE__ */ jsx(CollapsibleTrigger2, { asChild: true, children: /* @__PURE__ */ jsx(
16886
+ Button,
16887
+ {
16888
+ variant: "ghost",
16889
+ size: "icon",
16890
+ className: "h-6 w-6",
16891
+ onClick: (e) => e.stopPropagation(),
16892
+ children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
16893
+ }
16894
+ ) }) }),
16895
+ /* @__PURE__ */ jsx(TableCell, { className: "min-w-[200px]", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
16896
+ /* @__PURE__ */ jsx(Package, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
16897
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
16898
+ /* @__PURE__ */ jsx("p", { className: "font-medium text-sm truncate", children: pkg.name }),
16899
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground truncate", children: pkg.project })
16900
+ ] })
16901
+ ] }) }),
16902
+ /* @__PURE__ */ jsx(TableCell, { className: "w-[120px]", children: /* @__PURE__ */ jsx(
16903
+ Badge,
16904
+ {
16905
+ variant: "secondary",
16906
+ className: cn("text-[10px] px-1.5 py-0", statusConfig.className),
16907
+ children: statusConfig.label
16908
+ }
16909
+ ) }),
16910
+ /* @__PURE__ */ jsx(TableCell, { className: "w-[100px]", children: /* @__PURE__ */ jsx(
16911
+ Badge,
16912
+ {
16913
+ variant: "secondary",
16914
+ className: cn("text-[10px] px-1.5 py-0", priorityConfig.className),
16915
+ children: priorityConfig.label
16916
+ }
16917
+ ) }),
16918
+ /* @__PURE__ */ jsx(TableCell, { className: "w-[150px]", children: /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
16919
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs", children: [
16920
+ /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
16921
+ completedCount,
16922
+ "/",
16923
+ totalCount
16924
+ ] }),
16925
+ lockedCount > 0 && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-0.5 text-amber-600 dark:text-amber-400", children: [
16926
+ /* @__PURE__ */ jsx(AlertCircle, { className: "h-3 w-3" }),
16927
+ /* @__PURE__ */ jsx("span", { children: lockedCount })
16928
+ ] })
16929
+ ] }),
16930
+ /* @__PURE__ */ jsx(Progress, { value: progress * 100, className: "h-1.5" })
16931
+ ] }) }),
16932
+ /* @__PURE__ */ jsx(TableCell, { className: "w-[100px]", children: pkg.dueDate && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
16933
+ /* @__PURE__ */ jsx(CalendarDays, { className: "h-3 w-3" }),
16934
+ /* @__PURE__ */ jsx("span", { children: formatDate5(pkg.dueDate) })
16935
+ ] }) }),
16936
+ /* @__PURE__ */ jsx(TableCell, { className: "w-[150px]", children: isWaiting ? /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
16937
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
16938
+ /* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }),
16939
+ /* @__PURE__ */ jsx("span", { children: "Waiting" })
16940
+ ] }),
16941
+ /* @__PURE__ */ jsxs(
16942
+ Button,
16943
+ {
16944
+ variant: "ghost",
16945
+ size: "sm",
16946
+ className: "h-6 text-[10px] px-2",
16947
+ onClick: (e) => {
16948
+ e.stopPropagation();
16949
+ onPackageClick?.(pkg);
16950
+ },
16951
+ children: [
16952
+ /* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3 mr-1" }),
16953
+ "View"
16954
+ ]
16955
+ }
16956
+ )
16957
+ ] }) : nextAction ? /* @__PURE__ */ jsx(
16958
+ Button,
16959
+ {
16960
+ size: "sm",
16961
+ variant: "default",
16962
+ className: "h-6 text-[10px] px-2",
16963
+ onClick: (e) => {
16964
+ e.stopPropagation();
16965
+ handleNextAction();
16966
+ },
16967
+ children: nextActionLabel
16968
+ }
16969
+ ) : isComplete ? /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[10px] px-1.5 py-0 bg-green-500/10 text-green-600 border-green-500/20", children: "Complete" }) : null })
16970
+ ]
16971
+ }
16972
+ ),
16973
+ /* @__PURE__ */ jsx(CollapsibleContent2, { asChild: true, children: /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 7, className: "p-0", children: /* @__PURE__ */ jsx("div", { className: "bg-muted/20 border-t border-b", children: /* @__PURE__ */ jsxs("div", { className: "p-4 space-y-2 max-w-3xl ml-10", children: [
16974
+ /* @__PURE__ */ jsxs("p", { className: "text-xs font-medium text-muted-foreground mb-3", children: [
16975
+ "Subtasks (",
16976
+ subtaskStates.length,
16977
+ ")"
16978
+ ] }),
16979
+ subtaskStates.map((subtaskState) => /* @__PURE__ */ jsx(
16980
+ SubtaskItem,
16981
+ {
16982
+ subtaskState,
16983
+ onAction: onSubtaskAction
16984
+ },
16985
+ subtaskState.subtask.id
16986
+ ))
16987
+ ] }) }) }) }) })
16988
+ ] });
16989
+ }
16990
+ function WorkflowViewToggle({
16991
+ value,
16992
+ onValueChange,
16993
+ className
16994
+ }) {
16995
+ const handleValueChange = React36.useCallback(
16996
+ (newValue) => {
16997
+ if (newValue === "kanban" || newValue === "list") {
16998
+ onValueChange(newValue);
16999
+ }
17000
+ },
17001
+ [onValueChange]
17002
+ );
17003
+ return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(
17004
+ ToggleGroup,
17005
+ {
17006
+ type: "single",
17007
+ value,
17008
+ onValueChange: handleValueChange,
17009
+ className: cn("border rounded-lg p-0.5 bg-muted/50", className),
17010
+ children: [
17011
+ /* @__PURE__ */ jsxs(Tooltip2, { children: [
17012
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
17013
+ ToggleGroupItem,
17014
+ {
17015
+ value: "kanban",
17016
+ "aria-label": "Kanban view",
17017
+ className: cn(
17018
+ "h-8 w-8 p-0 data-[state=on]:bg-background data-[state=on]:shadow-sm",
17019
+ "rounded-md"
17020
+ ),
17021
+ children: /* @__PURE__ */ jsx(Kanban, { className: "h-4 w-4" })
17022
+ }
17023
+ ) }),
17024
+ /* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: /* @__PURE__ */ jsx("p", { className: "text-xs", children: "Kanban View" }) })
17025
+ ] }),
17026
+ /* @__PURE__ */ jsxs(Tooltip2, { children: [
17027
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
17028
+ ToggleGroupItem,
17029
+ {
17030
+ value: "list",
17031
+ "aria-label": "List view",
17032
+ className: cn(
17033
+ "h-8 w-8 p-0 data-[state=on]:bg-background data-[state=on]:shadow-sm",
17034
+ "rounded-md"
17035
+ ),
17036
+ children: /* @__PURE__ */ jsx(List, { className: "h-4 w-4" })
17037
+ }
17038
+ ) }),
17039
+ /* @__PURE__ */ jsx(TooltipContent, { side: "bottom", children: /* @__PURE__ */ jsx("p", { className: "text-xs", children: "List View" }) })
17040
+ ] })
17041
+ ]
17042
+ }
17043
+ ) });
17044
+ }
15768
17045
 
15769
17046
  // src/components/event-calendar/types.ts
15770
17047
  var DEFAULT_WORKING_HOURS = {
@@ -15828,7 +17105,7 @@ var BADGE_VARIANT_LABELS = {
15828
17105
  colored: "Colored",
15829
17106
  mixed: "Mixed"
15830
17107
  };
15831
- var CalendarContext = React30.createContext(null);
17108
+ var CalendarContext = React36.createContext(null);
15832
17109
  function EventCalendarProvider({
15833
17110
  children,
15834
17111
  events: initialEvents = [],
@@ -15843,38 +17120,38 @@ function EventCalendarProvider({
15843
17120
  onEventUpdate,
15844
17121
  onEventDelete
15845
17122
  }) {
15846
- const [selectedDate, setSelectedDate] = React30.useState(defaultDate);
15847
- const [selectedUserId, setSelectedUserId] = React30.useState(defaultUserId);
15848
- const [events, setEventsState] = React30.useState(initialEvents);
15849
- const [users] = React30.useState(initialUsers);
15850
- const [badgeVariant, setBadgeVariant] = React30.useState(defaultBadgeVariant);
15851
- const [view, setView] = React30.useState(defaultView);
15852
- const [workingHours, setWorkingHours] = React30.useState(defaultWorkingHours);
15853
- const [visibleHours, setVisibleHours] = React30.useState(defaultVisibleHours);
15854
- React30.useEffect(() => {
17123
+ const [selectedDate, setSelectedDate] = React36.useState(defaultDate);
17124
+ const [selectedUserId, setSelectedUserId] = React36.useState(defaultUserId);
17125
+ const [events, setEventsState] = React36.useState(initialEvents);
17126
+ const [users] = React36.useState(initialUsers);
17127
+ const [badgeVariant, setBadgeVariant] = React36.useState(defaultBadgeVariant);
17128
+ const [view, setView] = React36.useState(defaultView);
17129
+ const [workingHours, setWorkingHours] = React36.useState(defaultWorkingHours);
17130
+ const [visibleHours, setVisibleHours] = React36.useState(defaultVisibleHours);
17131
+ React36.useEffect(() => {
15855
17132
  setEventsState(initialEvents);
15856
17133
  }, [initialEvents]);
15857
- const setEvents = React30.useCallback((newEvents) => {
17134
+ const setEvents = React36.useCallback((newEvents) => {
15858
17135
  setEventsState(newEvents);
15859
17136
  }, []);
15860
- const addEvent = React30.useCallback((event) => {
17137
+ const addEvent = React36.useCallback((event) => {
15861
17138
  setEventsState((prev) => [...prev, event]);
15862
17139
  onEventAdd?.(event);
15863
17140
  }, [onEventAdd]);
15864
- const updateEvent = React30.useCallback((event) => {
17141
+ const updateEvent = React36.useCallback((event) => {
15865
17142
  setEventsState(
15866
17143
  (prev) => prev.map((e) => e.id === event.id ? event : e)
15867
17144
  );
15868
17145
  onEventUpdate?.(event);
15869
17146
  }, [onEventUpdate]);
15870
- const deleteEvent = React30.useCallback((eventId) => {
17147
+ const deleteEvent = React36.useCallback((eventId) => {
15871
17148
  setEventsState((prev) => prev.filter((e) => e.id !== eventId));
15872
17149
  onEventDelete?.(eventId);
15873
17150
  }, [onEventDelete]);
15874
- const goToToday = React30.useCallback(() => {
17151
+ const goToToday = React36.useCallback(() => {
15875
17152
  setSelectedDate(/* @__PURE__ */ new Date());
15876
17153
  }, []);
15877
- const goToPrevious = React30.useCallback(() => {
17154
+ const goToPrevious = React36.useCallback(() => {
15878
17155
  setSelectedDate((current) => {
15879
17156
  switch (view) {
15880
17157
  case "day":
@@ -15892,7 +17169,7 @@ function EventCalendarProvider({
15892
17169
  }
15893
17170
  });
15894
17171
  }, [view]);
15895
- const goToNext = React30.useCallback(() => {
17172
+ const goToNext = React36.useCallback(() => {
15896
17173
  setSelectedDate((current) => {
15897
17174
  switch (view) {
15898
17175
  case "day":
@@ -15910,7 +17187,7 @@ function EventCalendarProvider({
15910
17187
  }
15911
17188
  });
15912
17189
  }, [view]);
15913
- const contextValue = React30.useMemo(
17190
+ const contextValue = React36.useMemo(
15914
17191
  () => ({
15915
17192
  // State
15916
17193
  selectedDate,
@@ -15957,7 +17234,7 @@ function EventCalendarProvider({
15957
17234
  return /* @__PURE__ */ jsx(CalendarContext.Provider, { value: contextValue, children });
15958
17235
  }
15959
17236
  function useEventCalendar() {
15960
- const context = React30.useContext(CalendarContext);
17237
+ const context = React36.useContext(CalendarContext);
15961
17238
  if (!context) {
15962
17239
  throw new Error("useEventCalendar must be used within an EventCalendarProvider");
15963
17240
  }
@@ -15965,14 +17242,14 @@ function useEventCalendar() {
15965
17242
  }
15966
17243
  function useFilteredEvents() {
15967
17244
  const { events, selectedUserId } = useEventCalendar();
15968
- return React30.useMemo(() => {
17245
+ return React36.useMemo(() => {
15969
17246
  if (!selectedUserId) return events;
15970
17247
  return events.filter((event) => event.user.id === selectedUserId);
15971
17248
  }, [events, selectedUserId]);
15972
17249
  }
15973
17250
  function useEventsInRange(startDate, endDate) {
15974
17251
  const filteredEvents = useFilteredEvents();
15975
- return React30.useMemo(() => {
17252
+ return React36.useMemo(() => {
15976
17253
  return filteredEvents.filter((event) => {
15977
17254
  const eventStart = new Date(event.startDate);
15978
17255
  const eventEnd = new Date(event.endDate);
@@ -16530,8 +17807,8 @@ function MoreEvents({ count, onClick, className }) {
16530
17807
  );
16531
17808
  }
16532
17809
  function TimeIndicator({ className }) {
16533
- const [now, setNow] = React30.useState(/* @__PURE__ */ new Date());
16534
- React30.useEffect(() => {
17810
+ const [now, setNow] = React36.useState(/* @__PURE__ */ new Date());
17811
+ React36.useEffect(() => {
16535
17812
  const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
16536
17813
  return () => clearInterval(interval);
16537
17814
  }, []);
@@ -16568,24 +17845,24 @@ function DateBadge({ date, className }) {
16568
17845
  }
16569
17846
  );
16570
17847
  }
16571
- var DragContext = React30.createContext(null);
17848
+ var DragContext = React36.createContext(null);
16572
17849
  function DragProvider({
16573
17850
  children,
16574
17851
  snapMinutes = 15,
16575
17852
  onDragStart,
16576
17853
  onDragEnd
16577
17854
  }) {
16578
- const [draggedEvent, setDraggedEventState] = React30.useState(null);
16579
- const [isDragging, setIsDragging] = React30.useState(false);
17855
+ const [draggedEvent, setDraggedEventState] = React36.useState(null);
17856
+ const [isDragging, setIsDragging] = React36.useState(false);
16580
17857
  const { updateEvent } = useEventCalendar();
16581
- const setDraggedEvent = React30.useCallback((event) => {
17858
+ const setDraggedEvent = React36.useCallback((event) => {
16582
17859
  setDraggedEventState(event);
16583
17860
  setIsDragging(!!event);
16584
17861
  if (event) {
16585
17862
  onDragStart?.(event);
16586
17863
  }
16587
17864
  }, [onDragStart]);
16588
- const handleDrop = React30.useCallback((newStartDate) => {
17865
+ const handleDrop = React36.useCallback((newStartDate) => {
16589
17866
  if (!draggedEvent) return;
16590
17867
  const snappedDate = snapToInterval(newStartDate, snapMinutes);
16591
17868
  const { startDate, endDate } = calculateDropDates(draggedEvent, snappedDate);
@@ -16598,7 +17875,7 @@ function DragProvider({
16598
17875
  onDragEnd?.(updatedEvent, new Date(startDate), new Date(endDate));
16599
17876
  setDraggedEvent(null);
16600
17877
  }, [draggedEvent, snapMinutes, updateEvent, onDragEnd, setDraggedEvent]);
16601
- const contextValue = React30.useMemo(
17878
+ const contextValue = React36.useMemo(
16602
17879
  () => ({
16603
17880
  draggedEvent,
16604
17881
  setDraggedEvent,
@@ -16609,7 +17886,7 @@ function DragProvider({
16609
17886
  return /* @__PURE__ */ jsx(DragContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(DragDropHandler, { onDrop: handleDrop, children }) });
16610
17887
  }
16611
17888
  function useDrag() {
16612
- const context = React30.useContext(DragContext);
17889
+ const context = React36.useContext(DragContext);
16613
17890
  if (!context) {
16614
17891
  throw new Error("useDrag must be used within a DragProvider");
16615
17892
  }
@@ -16654,7 +17931,7 @@ function DroppableZone({
16654
17931
  }) {
16655
17932
  const { draggedEvent, setDraggedEvent } = useDrag();
16656
17933
  const { updateEvent } = useEventCalendar();
16657
- const [isOver, setIsOver] = React30.useState(false);
17934
+ const [isOver, setIsOver] = React36.useState(false);
16658
17935
  const handleDragOver = (e) => {
16659
17936
  e.preventDefault();
16660
17937
  e.dataTransfer.dropEffect = "move";
@@ -16692,23 +17969,23 @@ function DroppableZone({
16692
17969
  function useDroppable({ date, hour, minute = 0, onDrop }) {
16693
17970
  const { draggedEvent, setDraggedEvent } = useDrag();
16694
17971
  const { updateEvent } = useEventCalendar();
16695
- const [isOver, setIsOver] = React30.useState(false);
16696
- const dropTargetDate = React30.useMemo(() => {
17972
+ const [isOver, setIsOver] = React36.useState(false);
17973
+ const dropTargetDate = React36.useMemo(() => {
16697
17974
  const targetDate = new Date(date);
16698
17975
  if (hour !== void 0) {
16699
17976
  targetDate.setHours(hour, minute, 0, 0);
16700
17977
  }
16701
17978
  return targetDate;
16702
17979
  }, [date, hour, minute]);
16703
- const handleDragOver = React30.useCallback((e) => {
17980
+ const handleDragOver = React36.useCallback((e) => {
16704
17981
  e.preventDefault();
16705
17982
  e.dataTransfer.dropEffect = "move";
16706
17983
  if (!isOver) setIsOver(true);
16707
17984
  }, [isOver]);
16708
- const handleDragLeave = React30.useCallback(() => {
17985
+ const handleDragLeave = React36.useCallback(() => {
16709
17986
  setIsOver(false);
16710
17987
  }, []);
16711
- const handleDrop = React30.useCallback((e) => {
17988
+ const handleDrop = React36.useCallback((e) => {
16712
17989
  e.preventDefault();
16713
17990
  setIsOver(false);
16714
17991
  if (!draggedEvent) return;
@@ -16735,13 +18012,13 @@ function useDroppable({ date, hour, minute = 0, onDrop }) {
16735
18012
  function useDraggable3(event, disabled = false) {
16736
18013
  const { setDraggedEvent, draggedEvent } = useDrag();
16737
18014
  const isDragged = draggedEvent?.id === event.id;
16738
- const handleDragStart = React30.useCallback((e) => {
18015
+ const handleDragStart = React36.useCallback((e) => {
16739
18016
  if (disabled) return;
16740
18017
  e.dataTransfer.effectAllowed = "move";
16741
18018
  e.dataTransfer.setData("text/plain", event.id);
16742
18019
  setDraggedEvent(event);
16743
18020
  }, [disabled, event, setDraggedEvent]);
16744
- const handleDragEnd = React30.useCallback(() => {
18021
+ const handleDragEnd = React36.useCallback(() => {
16745
18022
  setDraggedEvent(null);
16746
18023
  }, [setDraggedEvent]);
16747
18024
  return {
@@ -16782,15 +18059,15 @@ function MonthView({
16782
18059
  }) {
16783
18060
  const { selectedDate, badgeVariant, setSelectedDate, setView } = useEventCalendar();
16784
18061
  const filteredEvents = useFilteredEvents();
16785
- const { singleDayEvents, multiDayEvents } = React30.useMemo(
18062
+ const { singleDayEvents, multiDayEvents } = React36.useMemo(
16786
18063
  () => splitEventsByDuration(filteredEvents),
16787
18064
  [filteredEvents]
16788
18065
  );
16789
- const cells = React30.useMemo(
18066
+ const cells = React36.useMemo(
16790
18067
  () => getCalendarCells(selectedDate),
16791
18068
  [selectedDate]
16792
18069
  );
16793
- const eventPositions = React30.useMemo(
18070
+ const eventPositions = React36.useMemo(
16794
18071
  () => calculateMonthEventPositions(multiDayEvents, singleDayEvents, selectedDate),
16795
18072
  [multiDayEvents, singleDayEvents, selectedDate]
16796
18073
  );
@@ -16972,7 +18249,7 @@ function WeekView({
16972
18249
  visibleHours
16973
18250
  } = useEventCalendar();
16974
18251
  const filteredEvents = useFilteredEvents();
16975
- const { singleDayEvents, multiDayEvents } = React30.useMemo(
18252
+ const { singleDayEvents, multiDayEvents } = React36.useMemo(
16976
18253
  () => splitEventsByDuration(filteredEvents),
16977
18254
  [filteredEvents]
16978
18255
  );
@@ -17178,8 +18455,8 @@ function CalendarTimeline({
17178
18455
  firstVisibleHour,
17179
18456
  lastVisibleHour
17180
18457
  }) {
17181
- const [currentTime, setCurrentTime] = React30.useState(/* @__PURE__ */ new Date());
17182
- React30.useEffect(() => {
18458
+ const [currentTime, setCurrentTime] = React36.useState(/* @__PURE__ */ new Date());
18459
+ React36.useEffect(() => {
17183
18460
  const interval = setInterval(() => {
17184
18461
  setCurrentTime(/* @__PURE__ */ new Date());
17185
18462
  }, 6e4);
@@ -17262,7 +18539,7 @@ function DayView({
17262
18539
  visibleHours
17263
18540
  } = useEventCalendar();
17264
18541
  const filteredEvents = useFilteredEvents();
17265
- const { singleDayEvents, multiDayEvents } = React30.useMemo(
18542
+ const { singleDayEvents, multiDayEvents } = React36.useMemo(
17266
18543
  () => splitEventsByDuration(filteredEvents),
17267
18544
  [filteredEvents]
17268
18545
  );
@@ -17270,7 +18547,7 @@ function DayView({
17270
18547
  visibleHours,
17271
18548
  singleDayEvents
17272
18549
  );
17273
- const currentEvents = React30.useMemo(() => {
18550
+ const currentEvents = React36.useMemo(() => {
17274
18551
  if (!isToday(selectedDate)) return [];
17275
18552
  return getCurrentEvents(singleDayEvents);
17276
18553
  }, [singleDayEvents, selectedDate]);
@@ -17494,8 +18771,8 @@ function CalendarTimeline2({
17494
18771
  firstVisibleHour,
17495
18772
  lastVisibleHour
17496
18773
  }) {
17497
- const [currentTime, setCurrentTime] = React30.useState(/* @__PURE__ */ new Date());
17498
- React30.useEffect(() => {
18774
+ const [currentTime, setCurrentTime] = React36.useState(/* @__PURE__ */ new Date());
18775
+ React36.useEffect(() => {
17499
18776
  const interval = setInterval(() => {
17500
18777
  setCurrentTime(/* @__PURE__ */ new Date());
17501
18778
  }, 6e4);
@@ -17529,7 +18806,7 @@ function YearView({
17529
18806
  }) {
17530
18807
  const { selectedDate, setSelectedDate, setView } = useEventCalendar();
17531
18808
  const filteredEvents = useFilteredEvents();
17532
- const months = React30.useMemo(() => {
18809
+ const months = React36.useMemo(() => {
17533
18810
  const yearStart = startOfYear(selectedDate);
17534
18811
  return Array.from({ length: 12 }, (_, i) => addMonths(yearStart, i));
17535
18812
  }, [selectedDate]);
@@ -17652,11 +18929,11 @@ function AgendaView({
17652
18929
  }) {
17653
18930
  const { selectedDate, setSelectedDate, setView } = useEventCalendar();
17654
18931
  const filteredEvents = useFilteredEvents();
17655
- const { singleDayEvents, multiDayEvents } = React30.useMemo(
18932
+ const { singleDayEvents, multiDayEvents } = React36.useMemo(
17656
18933
  () => splitEventsByDuration(filteredEvents),
17657
18934
  [filteredEvents]
17658
18935
  );
17659
- const eventsByDay = React30.useMemo(() => {
18936
+ const eventsByDay = React36.useMemo(() => {
17660
18937
  const allDates = /* @__PURE__ */ new Map();
17661
18938
  singleDayEvents.forEach((event) => {
17662
18939
  const eventDate = parseISO(event.startDate);
@@ -18121,16 +19398,16 @@ function EventDialog({
18121
19398
  defaultUserId
18122
19399
  }) {
18123
19400
  const { addEvent, updateEvent, deleteEvent, users } = useEventCalendar();
18124
- const [title, setTitle] = React30.useState("");
18125
- const [description, setDescription] = React30.useState("");
18126
- const [startDate, setStartDate] = React30.useState("");
18127
- const [startTime, setStartTime] = React30.useState("");
18128
- const [endDate, setEndDate] = React30.useState("");
18129
- const [endTime, setEndTime] = React30.useState("");
18130
- const [color, setColor] = React30.useState("blue");
18131
- const [userId, setUserId] = React30.useState("");
18132
- const [isSubmitting, setIsSubmitting] = React30.useState(false);
18133
- React30.useEffect(() => {
19401
+ const [title, setTitle] = React36.useState("");
19402
+ const [description, setDescription] = React36.useState("");
19403
+ const [startDate, setStartDate] = React36.useState("");
19404
+ const [startTime, setStartTime] = React36.useState("");
19405
+ const [endDate, setEndDate] = React36.useState("");
19406
+ const [endTime, setEndTime] = React36.useState("");
19407
+ const [color, setColor] = React36.useState("blue");
19408
+ const [userId, setUserId] = React36.useState("");
19409
+ const [isSubmitting, setIsSubmitting] = React36.useState(false);
19410
+ React36.useEffect(() => {
18134
19411
  if (open) {
18135
19412
  if (mode === "edit" && event) {
18136
19413
  const start = parseISO(event.startDate);
@@ -18353,7 +19630,7 @@ function QuickAddEvent({
18353
19630
  onOpenDialog,
18354
19631
  onClose
18355
19632
  }) {
18356
- const [title, setTitle] = React30.useState("");
19633
+ const [title, setTitle] = React36.useState("");
18357
19634
  const { users } = useEventCalendar();
18358
19635
  const handleSubmit = (e) => {
18359
19636
  e.preventDefault();
@@ -18420,8 +19697,8 @@ var HOUR_OPTIONS = Array.from({ length: 25 }, (_, i) => {
18420
19697
  });
18421
19698
  function ChangeVisibleHoursInput() {
18422
19699
  const { visibleHours, setVisibleHours } = useEventCalendar();
18423
- const [from, setFrom] = React30.useState(visibleHours.from);
18424
- const [to, setTo] = React30.useState(visibleHours.to);
19700
+ const [from, setFrom] = React36.useState(visibleHours.from);
19701
+ const [to, setTo] = React36.useState(visibleHours.to);
18425
19702
  const handleApply = () => {
18426
19703
  const toHour = to === 0 ? 24 : to;
18427
19704
  setVisibleHours({ from, to: toHour });
@@ -18467,7 +19744,7 @@ var HOUR_OPTIONS2 = Array.from({ length: 25 }, (_, i) => {
18467
19744
  });
18468
19745
  function ChangeWorkingHoursInput() {
18469
19746
  const { workingHours, setWorkingHours } = useEventCalendar();
18470
- const [localWorkingHours, setLocalWorkingHours] = React30.useState({
19747
+ const [localWorkingHours, setLocalWorkingHours] = React36.useState({
18471
19748
  ...workingHours
18472
19749
  });
18473
19750
  const handleToggleDay = (dayId) => {
@@ -18616,8 +19893,8 @@ function CalendarSettingsButton({
18616
19893
  );
18617
19894
  }
18618
19895
  function useMediaQuery(query) {
18619
- const [matches, setMatches] = React30.useState(false);
18620
- React30.useEffect(() => {
19896
+ const [matches, setMatches] = React36.useState(false);
19897
+ React36.useEffect(() => {
18621
19898
  const media = window.matchMedia(query);
18622
19899
  setMatches(media.matches);
18623
19900
  const listener = (event) => {
@@ -18669,11 +19946,11 @@ function BigCalendarInner({
18669
19946
  maxEventsPerDay
18670
19947
  }) {
18671
19948
  const { view, setView } = useEventCalendar();
18672
- const [dialogOpen, setDialogOpen] = React30.useState(false);
18673
- const [settingsDialogOpen, setSettingsDialogOpen] = React30.useState(false);
18674
- const [selectedEvent, setSelectedEvent] = React30.useState(null);
18675
- const [dialogMode, setDialogMode] = React30.useState("add");
18676
- const [defaultDate, setDefaultDate] = React30.useState(/* @__PURE__ */ new Date());
19949
+ const [dialogOpen, setDialogOpen] = React36.useState(false);
19950
+ const [settingsDialogOpen, setSettingsDialogOpen] = React36.useState(false);
19951
+ const [selectedEvent, setSelectedEvent] = React36.useState(null);
19952
+ const [dialogMode, setDialogMode] = React36.useState("add");
19953
+ const [defaultDate, setDefaultDate] = React36.useState(/* @__PURE__ */ new Date());
18677
19954
  const isMobile = useMediaQuery("(max-width: 768px)");
18678
19955
  const isCompact = compact === "auto" ? isMobile : compact;
18679
19956
  const handleAddClick = () => {
@@ -19030,6 +20307,6 @@ var KanbanProvider = ({
19030
20307
  ) });
19031
20308
  };
19032
20309
 
19033
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgendaView, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, BADGE_VARIANT_LABELS, Badge, BigCalendar, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarContext, CalendarDayButton, CalendarHeader, CalendarHeaderCompact, CalendarSettingsButton, CalendarSettingsContent, CalendarSettingsDialog, CalibrationTable, CalibrationWeekCell, CalibrationWeekHeader, CapacityPlanningChart, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChangeBadgeVariantInput, ChangeVisibleHoursInput, ChangeWorkingHoursInput, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CircularProgress, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColumnSummaryCell, ColumnSummaryStrip, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommentButton, CommentDialog, CommentPopover, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DEFAULT_VISIBLE_HOURS, DEFAULT_WORKING_HOURS, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, DateBadge, DayView, DeliveryBadge, DeliveryCard, DeliveryDetailPage, DeliveryIndicator, DeliveryIndicators, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DragContext, DragProvider, DraggableEvent, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DroppableZone, EVENT_COLORS, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventBadge, EventCalendarProvider, EventDialog, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GanttAddFeatureHelper, GanttCollapsibleSidebarGroup, GanttCollapsibleTimelineGroup, GanttColumn, GanttColumns, GanttContentHeader, GanttContext, GanttCreateMarkerTrigger, GanttFeatureDragHelper, GanttFeatureItem, GanttFeatureItemCard, GanttFeatureList, GanttFeatureListGroup, GanttFeatureRow, GanttGridLines, GanttGroupSummaryBar, GanttHeader, GanttMarker, GanttProvider, GanttSidebar, GanttSidebarGroup, GanttSidebarHeader, GanttSidebarItem, GanttTimeline, GanttToday, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InsightBar, Item6 as Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, KanbanBoard, KanbanCard, KanbanCards, KanbanHeader, KanbanProvider, Kbd, KbdGroup, Label2 as Label, Map2 as Map, MapMarker, MapPopup, MapTileLayer, MapTooltip, MapZoomControl, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MonthView, MoreEvents, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavMain, NavProjects, NavSecondary, NavUser, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NetBadge, PHASE_COLORS, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PhaseGantt, Pill, PillAvatar, PillAvatarGroup, PillClose, PillDelta, PillIcon, PillStatus, PlanningTable, PlanningTableToolbar, PlanningWeekCommentPopover, PlayerCanvas, PlayerCanvasActionButton, PlayerCanvasControls, PlayerCanvasDivider, PlayerCanvasInfo, PlayerCanvasLabel, PlayerCanvasPlayButton, PlayerCanvasProgress, PlayerCanvasSkipButton, PlayerCanvasTitle, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProductionPackageGantt, Progress, QuickAddEvent, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RowHeaderCell, ScrollArea, ScrollBar, SearchForm, SearchTrigger, Section, SectionContent, SectionDescription, SectionFooter, SectionHeader, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteHeader, Skeleton, Slider, Spinner, StatusProgress, SubmitCalibrationBar, SupplierCell, SupplierWeeklyLoading, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeSwitch, TimeIndicator, Toaster, Toggle, ToggleGroup, ToggleGroupItem, ToolBarCanvas, ToolBarCanvasButton, ToolBarCanvasDivider, ToolBarCanvasGroup, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserAvatarsDropdown, VIEW_LABELS, WeekCell, WeekDetailDialog, WeekDetailSheet, WeekHeader, WeekView, WeeklyLoadingView, YearView, badgeVariants, buttonGroupVariants, buttonVariants, calculateCalibrationCells, calculateCumulativeNeed, calculateCumulativePlanned, calculateDropDates, calculateFeasibility, calculateMonthEventPositions, calculatePackagePositions, canSubmitCalibration, cardVariants, createDefaultEvent, deliveryIndicatorVariants, extractPrefixes, formatCalibrationUnit, formatDateRange2 as formatDateRange, formatDisplayDate, formatProductionUnit, formatTime, getDateByMousePosition as ganttGetDateByMousePosition, getOffset as ganttGetOffset, getWidth as ganttGetWidth, generateColumns, generateEventId, generateLoadingWeek, generateLocationOptions, generateWeekColumns, generateWeeks, getCalendarCells, getCommentLocationLabel, getCurrentEvents, getDayHours, getDayLabel, getDeliveryVisualState, getElementShipmentStatus, getEventBlockStyle, getEventDuration, getEventDurationMinutes, getEventsCount, getEventsForDate, getEventsInRange, getFeasibilityColor, getFeasibilityLabel, getHeaderLabel, getISOWeek, getLoadingDeliveryStatusLabel, getLoadingElementStatusLabel, getLoadingISOWeek, getLoadingWeekKey, getMonthCellEvents, getMonthDays, getPackageWeekRange, getPhaseColor, getShipmentStatusLabel, getShortDayLabel, getSupplierColumn, getTimeHeight, getTimePosition, getViewDateRange, getVisibleHours, getWeekDayNames, getWeekDays, getWeekKey, getYearMonths, groupDeliveriesByDay, groupDeliveriesByPrefixAndDay, groupEvents, isMultiDayEvent, isWorkingHour, navigateDate, navigationMenuTriggerStyle, pillVariants, playerCanvasPlayButtonVariants, playerCanvasSkipButtonVariants, rangeText, sectionVariants, snapToInterval, sortEvents, splitEventsByDuration, toggleVariants, toolBarCanvasButtonVariants, useDrag, useDraggable3 as useDraggable, useDroppable, useEventCalendar, useEventsInRange, useFilteredEvents, useFormField, useGanttContext, useGanttDragging, useGanttScrollX, useIsMobile, useSearchShortcut, useSidebar };
20310
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AgendaView, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarImage, BADGE_VARIANT_LABELS, Badge, BigCalendar, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarContext, CalendarDayButton, CalendarHeader, CalendarHeaderCompact, CalendarSettingsButton, CalendarSettingsContent, CalendarSettingsDialog, CalibrationTable, CalibrationWeekCell, CalibrationWeekHeader, CapacityPlanningChart, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChangeBadgeVariantInput, ChangeVisibleHoursInput, ChangeWorkingHoursInput, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CircularProgress, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColumnSummaryCell, ColumnSummaryStrip, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CommentButton, CommentDialog, CommentPopover, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DEFAULT_VISIBLE_HOURS, DEFAULT_WORKING_HOURS, DataTableColumnHeader, DataTablePagination, DataTableViewOptions, DateBadge, DayView, DeliveryBadge, DeliveryCard, DeliveryDetailPage, DeliveryIndicator, DeliveryIndicators, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DragContext, DragProvider, DraggableEvent, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DroppableZone, EVENT_COLORS, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, EventBadge, EventCalendarProvider, EventDialog, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GanttAddFeatureHelper, GanttCollapsibleSidebarGroup, GanttCollapsibleTimelineGroup, GanttColumn, GanttColumns, GanttContentHeader, GanttContext, GanttCreateMarkerTrigger, GanttFeatureDragHelper, GanttFeatureItem, GanttFeatureItemCard, GanttFeatureList, GanttFeatureListGroup, GanttFeatureRow, GanttGridLines, GanttGroupSummaryBar, GanttHeader, GanttMarker, GanttProvider, GanttSidebar, GanttSidebarGroup, GanttSidebarHeader, GanttSidebarItem, GanttTimeline, GanttToday, HoverCard, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InsightBar, Item6 as Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, KanbanBoard, KanbanCard, KanbanCards, KanbanHeader, KanbanProvider, Kbd, KbdGroup, Label2 as Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MonthView, MoreEvents, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavMain, NavProjects, NavSecondary, NavUser, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NetBadge, PHASE_COLORS, PackageCard, PackageRow2 as PackageRow, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PhaseGantt, Pill, PillAvatar, PillAvatarGroup, PillClose, PillDelta, PillIcon, PillStatus, PlanningTable, PlanningTableToolbar, PlanningWeekCommentPopover, PlayerCanvas, PlayerCanvasActionButton, PlayerCanvasControls, PlayerCanvasDivider, PlayerCanvasInfo, PlayerCanvasLabel, PlayerCanvasPlayButton, PlayerCanvasProgress, PlayerCanvasSkipButton, PlayerCanvasTitle, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProductionPackageGantt, Progress, QuickAddEvent, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RowHeaderCell, ScrollArea, ScrollBar, SearchForm, SearchTrigger, Section, SectionContent, SectionDescription, SectionFooter, SectionHeader, SectionTitle, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteHeader, Skeleton, Slider, Spinner, StatusProgress, SubmitCalibrationBar, SubtaskItem, SupplierCell, SupplierWeeklyLoading, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeSwitch, TimeIndicator, Toaster, TodoBoard, TodoList, Toggle, ToggleGroup, ToggleGroupItem, ToolBarCanvas, ToolBarCanvasButton, ToolBarCanvasDivider, ToolBarCanvasGroup, Tooltip2 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UserAvatarsDropdown, VIEW_LABELS, WeekCell, WeekDetailDialog, WeekDetailSheet, WeekHeader, WeekView, WeeklyLoadingView, WorkflowViewToggle, YearView, allRequiredSubtasksDone, anySubtaskStartedOrDone, areDependenciesSatisfied, badgeVariants, buttonGroupVariants, buttonVariants, calculateCalibrationCells, calculateCumulativeNeed, calculateCumulativePlanned, calculateDropDates, calculateFeasibility, calculateMonthEventPositions, calculatePackagePositions, calculateProgress, canSubmitCalibration, cardVariants, completeSubtask, computeAllPackageStates, computePackageDerivedState, computeSubtaskState, createDefaultEvent, deliveryIndicatorVariants, derivePackageBucket, derivePackageStatus, extractPrefixes, findNextActionableSubtask, formatCalibrationUnit, formatDateRange2 as formatDateRange, formatDisplayDate, formatProductionUnit, formatTime, getDateByMousePosition as ganttGetDateByMousePosition, getOffset as ganttGetOffset, getWidth as ganttGetWidth, generateColumns, generateEventId, generateLoadingWeek, generateLocationOptions, generateLockReason, generateNextActionLabel, generateWeekColumns, generateWeeks, getBlockingSubtasks, getCalendarCells, getCommentLocationLabel, getCurrentEvents, getDayHours, getDayLabel, getDeliveryVisualState, getElementShipmentStatus, getEventBlockStyle, getEventDuration, getEventDurationMinutes, getEventsCount, getEventsForDate, getEventsInRange, getFeasibilityColor, getFeasibilityLabel, getHeaderLabel, getISOWeek, getLoadingDeliveryStatusLabel, getLoadingElementStatusLabel, getLoadingISOWeek, getLoadingWeekKey, getMonthCellEvents, getMonthDays, getPackageWeekRange, getPhaseColor, getShipmentStatusLabel, getShortDayLabel, getSupplierColumn, getTimeHeight, getTimePosition, getViewDateRange, getVisibleHours, getWeekDayNames, getWeekDays, getWeekKey, getYearMonths, groupDeliveriesByDay, groupDeliveriesByPrefixAndDay, groupEvents, groupPackagesByBucket, isMultiDayEvent, isWorkingHour, navigateDate, navigationMenuTriggerStyle, pillVariants, playerCanvasPlayButtonVariants, playerCanvasSkipButtonVariants, rangeText, sectionVariants, snapToInterval, sortEvents, splitEventsByDuration, startSubtask, toggleVariants, toolBarCanvasButtonVariants, updateSubtaskStatus, useDrag, useDraggable3 as useDraggable, useDroppable, useEventCalendar, useEventsInRange, useFilteredEvents, useFormField, useGanttContext, useGanttDragging, useGanttScrollX, useIsMobile, useSearchShortcut, useSidebar };
19034
20311
  //# sourceMappingURL=index.js.map
19035
20312
  //# sourceMappingURL=index.js.map