@j3m-quantum/ui 2.1.9 → 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';
@@ -43,7 +43,7 @@ import { useReactTable, getPaginationRowModel, getFilteredRowModel, getSortedRow
43
43
  export { flexRender, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
44
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';
45
45
  export { areIntervalsOverlapping, format, getDay, isSameDay, isSameMonth, isToday, parseISO } from 'date-fns';
46
- 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';
47
47
  import { restrictToHorizontalAxis } from '@dnd-kit/modifiers';
48
48
  import { useMouse, useWindowScroll, useThrottle } from '@uidotdev/usehooks';
49
49
  import { atom, useAtom } from 'jotai';
@@ -56,8 +56,8 @@ import tunnel from 'tunnel-rat';
56
56
  // src/hooks/use-mobile.ts
57
57
  var MOBILE_BREAKPOINT = 1024;
58
58
  function useIsMobile() {
59
- const [isMobile, setIsMobile] = React30.useState(void 0);
60
- React30.useEffect(() => {
59
+ const [isMobile, setIsMobile] = React36.useState(void 0);
60
+ React36.useEffect(() => {
61
61
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
62
62
  const onChange = () => {
63
63
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
@@ -145,7 +145,7 @@ var buttonVariants = cva(
145
145
  }
146
146
  }
147
147
  );
148
- var Button = React30.forwardRef(
148
+ var Button = React36.forwardRef(
149
149
  ({ className, variant, size, asChild = false, ...props }, ref) => {
150
150
  const Comp = asChild ? Slot : "button";
151
151
  return /* @__PURE__ */ jsx(
@@ -509,7 +509,7 @@ function Slider({
509
509
  max = 100,
510
510
  ...props
511
511
  }) {
512
- const _values = React30.useMemo(
512
+ const _values = React36.useMemo(
513
513
  () => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
514
514
  [value, defaultValue, min, max]
515
515
  );
@@ -795,7 +795,7 @@ function Toggle({
795
795
  }
796
796
  );
797
797
  }
798
- var ToggleGroupContext = React30.createContext({
798
+ var ToggleGroupContext = React36.createContext({
799
799
  size: "default",
800
800
  variant: "default",
801
801
  spacing: 0
@@ -832,7 +832,7 @@ function ToggleGroupItem({
832
832
  size,
833
833
  ...props
834
834
  }) {
835
- const context = React30.useContext(ToggleGroupContext);
835
+ const context = React36.useContext(ToggleGroupContext);
836
836
  return /* @__PURE__ */ jsx(
837
837
  ToggleGroupPrimitive.Item,
838
838
  {
@@ -862,7 +862,7 @@ function ThemeSwitch({
862
862
  className,
863
863
  size = "default"
864
864
  }) {
865
- const [isChecked, setIsChecked] = React30.useState(defaultChecked);
865
+ const [isChecked, setIsChecked] = React36.useState(defaultChecked);
866
866
  const isControlled = checked !== void 0;
867
867
  const currentChecked = isControlled ? checked : isChecked;
868
868
  const handleClick = () => {
@@ -1282,7 +1282,7 @@ function Label2({
1282
1282
  );
1283
1283
  }
1284
1284
  var Form = FormProvider;
1285
- var FormFieldContext = React30.createContext(
1285
+ var FormFieldContext = React36.createContext(
1286
1286
  {}
1287
1287
  );
1288
1288
  var FormField = ({
@@ -1291,8 +1291,8 @@ var FormField = ({
1291
1291
  return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
1292
1292
  };
1293
1293
  var useFormField = () => {
1294
- const fieldContext = React30.useContext(FormFieldContext);
1295
- const itemContext = React30.useContext(FormItemContext);
1294
+ const fieldContext = React36.useContext(FormFieldContext);
1295
+ const itemContext = React36.useContext(FormItemContext);
1296
1296
  const { getFieldState } = useFormContext();
1297
1297
  const formState = useFormState({ name: fieldContext.name });
1298
1298
  const fieldState = getFieldState(fieldContext.name, formState);
@@ -1309,11 +1309,11 @@ var useFormField = () => {
1309
1309
  ...fieldState
1310
1310
  };
1311
1311
  };
1312
- var FormItemContext = React30.createContext(
1312
+ var FormItemContext = React36.createContext(
1313
1313
  {}
1314
1314
  );
1315
1315
  function FormItem({ className, ...props }) {
1316
- const id = React30.useId();
1316
+ const id = React36.useId();
1317
1317
  return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx(
1318
1318
  "div",
1319
1319
  {
@@ -1757,7 +1757,7 @@ var cardVariants = cva(
1757
1757
  {
1758
1758
  variants: {
1759
1759
  variant: {
1760
- default: "bg-card border shadow-sm",
1760
+ default: "bg-card border border-[var(--color-border-subtle)] shadow-[var(--j3m-shadow-default)]",
1761
1761
  glass: [
1762
1762
  "glass-context",
1763
1763
  // Enables glass semantic token overrides for children
@@ -2711,8 +2711,8 @@ function CalendarDayButton({
2711
2711
  modifiers,
2712
2712
  ...props
2713
2713
  }) {
2714
- const ref = React30.useRef(null);
2715
- React30.useEffect(() => {
2714
+ const ref = React36.useRef(null);
2715
+ React36.useEffect(() => {
2716
2716
  if (modifiers.focused) ref.current?.focus();
2717
2717
  }, [modifiers.focused]);
2718
2718
  return /* @__PURE__ */ jsx(
@@ -2733,9 +2733,9 @@ function CalendarDayButton({
2733
2733
  }
2734
2734
  );
2735
2735
  }
2736
- var CarouselContext = React30.createContext(null);
2736
+ var CarouselContext = React36.createContext(null);
2737
2737
  function useCarousel() {
2738
- const context = React30.useContext(CarouselContext);
2738
+ const context = React36.useContext(CarouselContext);
2739
2739
  if (!context) {
2740
2740
  throw new Error("useCarousel must be used within a <Carousel />");
2741
2741
  }
@@ -2757,20 +2757,20 @@ function Carousel({
2757
2757
  },
2758
2758
  plugins
2759
2759
  );
2760
- const [canScrollPrev, setCanScrollPrev] = React30.useState(false);
2761
- const [canScrollNext, setCanScrollNext] = React30.useState(false);
2762
- 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) => {
2763
2763
  if (!api2) return;
2764
2764
  setCanScrollPrev(api2.canScrollPrev());
2765
2765
  setCanScrollNext(api2.canScrollNext());
2766
2766
  }, []);
2767
- const scrollPrev = React30.useCallback(() => {
2767
+ const scrollPrev = React36.useCallback(() => {
2768
2768
  api?.scrollPrev();
2769
2769
  }, [api]);
2770
- const scrollNext = React30.useCallback(() => {
2770
+ const scrollNext = React36.useCallback(() => {
2771
2771
  api?.scrollNext();
2772
2772
  }, [api]);
2773
- const handleKeyDown = React30.useCallback(
2773
+ const handleKeyDown = React36.useCallback(
2774
2774
  (event) => {
2775
2775
  if (event.key === "ArrowLeft") {
2776
2776
  event.preventDefault();
@@ -2782,11 +2782,11 @@ function Carousel({
2782
2782
  },
2783
2783
  [scrollPrev, scrollNext]
2784
2784
  );
2785
- React30.useEffect(() => {
2785
+ React36.useEffect(() => {
2786
2786
  if (!api || !setApi) return;
2787
2787
  setApi(api);
2788
2788
  }, [api, setApi]);
2789
- React30.useEffect(() => {
2789
+ React36.useEffect(() => {
2790
2790
  if (!api) return;
2791
2791
  onSelect(api);
2792
2792
  api.on("reInit", onSelect);
@@ -2919,9 +2919,9 @@ function CarouselNext({
2919
2919
  );
2920
2920
  }
2921
2921
  var THEMES = { light: "", dark: ".dark" };
2922
- var ChartContext = React30.createContext(null);
2922
+ var ChartContext = React36.createContext(null);
2923
2923
  function useChart() {
2924
- const context = React30.useContext(ChartContext);
2924
+ const context = React36.useContext(ChartContext);
2925
2925
  if (!context) {
2926
2926
  throw new Error("useChart must be used within a <ChartContainer />");
2927
2927
  }
@@ -2934,7 +2934,7 @@ function ChartContainer({
2934
2934
  config,
2935
2935
  ...props
2936
2936
  }) {
2937
- const uniqueId = React30.useId();
2937
+ const uniqueId = React36.useId();
2938
2938
  const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
2939
2939
  return /* @__PURE__ */ jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxs(
2940
2940
  "div",
@@ -2995,7 +2995,7 @@ function ChartTooltipContent({
2995
2995
  labelKey
2996
2996
  }) {
2997
2997
  const { config } = useChart();
2998
- const tooltipLabel = React30.useMemo(() => {
2998
+ const tooltipLabel = React36.useMemo(() => {
2999
2999
  if (hideLabel || !payload?.length) {
3000
3000
  return null;
3001
3001
  }
@@ -3830,7 +3830,7 @@ function StatusProgress({
3830
3830
  const resolvedVariant = variant ?? getVariantFromProgress(clampedValue);
3831
3831
  const colors = getStatusColors(resolvedVariant);
3832
3832
  const sizes = getSizeClasses(size);
3833
- const labelText = React30.useMemo(() => {
3833
+ const labelText = React36.useMemo(() => {
3834
3834
  if (currentCount !== void 0 && totalCount !== void 0) {
3835
3835
  return `${currentCount} / ${totalCount} ${unitLabel}`;
3836
3836
  }
@@ -3935,8 +3935,8 @@ function TooltipContent({
3935
3935
  ) });
3936
3936
  }
3937
3937
  function useDetectTheme() {
3938
- const [theme, setTheme] = React30.useState("light");
3939
- React30.useEffect(() => {
3938
+ const [theme, setTheme] = React36.useState("light");
3939
+ React36.useEffect(() => {
3940
3940
  const isDark = document.documentElement.classList.contains("dark");
3941
3941
  setTheme(isDark ? "dark" : "light");
3942
3942
  const observer = new MutationObserver((mutations) => {
@@ -4585,7 +4585,7 @@ function CommandShortcut({
4585
4585
  }
4586
4586
  );
4587
4587
  }
4588
- var SearchTrigger = React30.forwardRef(
4588
+ var SearchTrigger = React36.forwardRef(
4589
4589
  ({
4590
4590
  className,
4591
4591
  placeholder = "Search...",
@@ -4621,7 +4621,7 @@ var SearchTrigger = React30.forwardRef(
4621
4621
  );
4622
4622
  SearchTrigger.displayName = "SearchTrigger";
4623
4623
  function useSearchShortcut(onOpen, key = "k") {
4624
- React30.useEffect(() => {
4624
+ React36.useEffect(() => {
4625
4625
  const down = (e) => {
4626
4626
  if (e.key.toLowerCase() === key.toLowerCase() && (e.metaKey || e.ctrlKey)) {
4627
4627
  e.preventDefault();
@@ -5596,9 +5596,9 @@ var SIDEBAR_WIDTH = "16rem";
5596
5596
  var SIDEBAR_WIDTH_MOBILE = "18rem";
5597
5597
  var SIDEBAR_WIDTH_ICON = "3rem";
5598
5598
  var SIDEBAR_KEYBOARD_SHORTCUT = "b";
5599
- var SidebarContext = React30.createContext(null);
5599
+ var SidebarContext = React36.createContext(null);
5600
5600
  function useSidebar() {
5601
- const context = React30.useContext(SidebarContext);
5601
+ const context = React36.useContext(SidebarContext);
5602
5602
  if (!context) {
5603
5603
  throw new Error("useSidebar must be used within a SidebarProvider.");
5604
5604
  }
@@ -5614,10 +5614,10 @@ function SidebarProvider({
5614
5614
  ...props
5615
5615
  }) {
5616
5616
  const isMobile = useIsMobile();
5617
- const [openMobile, setOpenMobile] = React30.useState(false);
5618
- const [_open, _setOpen] = React30.useState(defaultOpen);
5617
+ const [openMobile, setOpenMobile] = React36.useState(false);
5618
+ const [_open, _setOpen] = React36.useState(defaultOpen);
5619
5619
  const open = openProp ?? _open;
5620
- const setOpen = React30.useCallback(
5620
+ const setOpen = React36.useCallback(
5621
5621
  (value) => {
5622
5622
  const openState = typeof value === "function" ? value(open) : value;
5623
5623
  if (setOpenProp) {
@@ -5629,10 +5629,10 @@ function SidebarProvider({
5629
5629
  },
5630
5630
  [setOpenProp, open]
5631
5631
  );
5632
- const toggleSidebar = React30.useCallback(() => {
5632
+ const toggleSidebar = React36.useCallback(() => {
5633
5633
  return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
5634
5634
  }, [isMobile, setOpen, setOpenMobile]);
5635
- React30.useEffect(() => {
5635
+ React36.useEffect(() => {
5636
5636
  const handleKeyDown = (event) => {
5637
5637
  if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
5638
5638
  event.preventDefault();
@@ -5643,7 +5643,7 @@ function SidebarProvider({
5643
5643
  return () => window.removeEventListener("keydown", handleKeyDown);
5644
5644
  }, [toggleSidebar]);
5645
5645
  const state = open ? "expanded" : "collapsed";
5646
- const contextValue = React30.useMemo(
5646
+ const contextValue = React36.useMemo(
5647
5647
  () => ({
5648
5648
  state,
5649
5649
  open,
@@ -6101,7 +6101,7 @@ function SidebarMenuSkeleton({
6101
6101
  showIcon = false,
6102
6102
  ...props
6103
6103
  }) {
6104
- const width = React30.useMemo(() => {
6104
+ const width = React36.useMemo(() => {
6105
6105
  return `${Math.floor(Math.random() * 40) + 50}%`;
6106
6106
  }, []);
6107
6107
  return /* @__PURE__ */ jsxs(
@@ -6199,7 +6199,8 @@ var sectionVariants = cva(
6199
6199
  default: [
6200
6200
  "bg-[var(--color-bg-surface)]",
6201
6201
  "border border-[var(--color-border-subtle)]",
6202
- "text-[var(--color-text-main)]"
6202
+ "text-[var(--color-text-main)]",
6203
+ "shadow-[var(--j3m-shadow-default)]"
6203
6204
  ].join(" "),
6204
6205
  // Glass Light - frosted glass for dark or image backgrounds
6205
6206
  "glass-light": [
@@ -6244,7 +6245,7 @@ var sectionVariants = cva(
6244
6245
  }
6245
6246
  );
6246
6247
  var isGlassVariant = (variant) => variant?.startsWith("glass-") ?? false;
6247
- var Section = React30.forwardRef(
6248
+ var Section = React36.forwardRef(
6248
6249
  ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
6249
6250
  "section",
6250
6251
  {
@@ -6256,7 +6257,7 @@ var Section = React30.forwardRef(
6256
6257
  )
6257
6258
  );
6258
6259
  Section.displayName = "Section";
6259
- var SectionHeader = React30.forwardRef(
6260
+ var SectionHeader = React36.forwardRef(
6260
6261
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6261
6262
  "div",
6262
6263
  {
@@ -6271,7 +6272,7 @@ var SectionHeader = React30.forwardRef(
6271
6272
  )
6272
6273
  );
6273
6274
  SectionHeader.displayName = "SectionHeader";
6274
- var SectionTitle = React30.forwardRef(
6275
+ var SectionTitle = React36.forwardRef(
6275
6276
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6276
6277
  "h2",
6277
6278
  {
@@ -6285,7 +6286,7 @@ var SectionTitle = React30.forwardRef(
6285
6286
  )
6286
6287
  );
6287
6288
  SectionTitle.displayName = "SectionTitle";
6288
- var SectionDescription = React30.forwardRef(
6289
+ var SectionDescription = React36.forwardRef(
6289
6290
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6290
6291
  "p",
6291
6292
  {
@@ -6299,7 +6300,7 @@ var SectionDescription = React30.forwardRef(
6299
6300
  )
6300
6301
  );
6301
6302
  SectionDescription.displayName = "SectionDescription";
6302
- var SectionContent = React30.forwardRef(
6303
+ var SectionContent = React36.forwardRef(
6303
6304
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6304
6305
  "div",
6305
6306
  {
@@ -6313,7 +6314,7 @@ var SectionContent = React30.forwardRef(
6313
6314
  )
6314
6315
  );
6315
6316
  SectionContent.displayName = "SectionContent";
6316
- var SectionFooter = React30.forwardRef(
6317
+ var SectionFooter = React36.forwardRef(
6317
6318
  ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
6318
6319
  "div",
6319
6320
  {
@@ -6538,7 +6539,7 @@ function SiteHeader({
6538
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: [
6539
6540
  trigger,
6540
6541
  trigger && /* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "mr-[var(--j3m-spacing-s)] h-4" }),
6541
- /* @__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: [
6542
6543
  index > 0 && /* @__PURE__ */ jsx(BreadcrumbSeparator, {}),
6543
6544
  /* @__PURE__ */ jsx(BreadcrumbItem, { children: item.href ? /* @__PURE__ */ jsx(BreadcrumbLink, { href: item.href, children: item.label }) : /* @__PURE__ */ jsx(BreadcrumbPage, { children: item.label }) })
6544
6545
  ] }, index)) }) }),
@@ -7159,11 +7160,11 @@ function PlanningWeekCommentPopover({
7159
7160
  open,
7160
7161
  onOpenChange
7161
7162
  }) {
7162
- const [newCommentText, setNewCommentText] = React30.useState("");
7163
- const [selectedLocationId, setSelectedLocationId] = React30.useState("");
7164
- const [viewCommentsOpen, setViewCommentsOpen] = React30.useState(true);
7165
- const [showAddForm, setShowAddForm] = React30.useState(false);
7166
- 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(() => {
7167
7168
  return locationOptions.find((opt) => opt.id === selectedLocationId);
7168
7169
  }, [locationOptions, selectedLocationId]);
7169
7170
  const handleSubmit = () => {
@@ -7199,7 +7200,7 @@ function PlanningWeekCommentPopover({
7199
7200
  onCommentClick(comment);
7200
7201
  }
7201
7202
  };
7202
- const formatDate3 = (date) => {
7203
+ const formatDate6 = (date) => {
7203
7204
  return new Intl.DateTimeFormat("en-US", {
7204
7205
  month: "short",
7205
7206
  day: "numeric",
@@ -7207,8 +7208,8 @@ function PlanningWeekCommentPopover({
7207
7208
  minute: "2-digit"
7208
7209
  }).format(date);
7209
7210
  };
7210
- const prevOpenRef = React30.useRef(open);
7211
- React30.useEffect(() => {
7211
+ const prevOpenRef = React36.useRef(open);
7212
+ React36.useEffect(() => {
7212
7213
  const wasOpen = prevOpenRef.current;
7213
7214
  prevOpenRef.current = open;
7214
7215
  if (wasOpen && !open) {
@@ -7279,7 +7280,7 @@ function PlanningWeekCommentPopover({
7279
7280
  ] }),
7280
7281
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
7281
7282
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
7282
- /* @__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) })
7283
7284
  ] }),
7284
7285
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
7285
7286
  ]
@@ -7587,15 +7588,15 @@ function PlanningTable({
7587
7588
  stickySupplierColumn = true,
7588
7589
  maxHeight = "600px"
7589
7590
  } = config;
7590
- const weeks = React30.useMemo(
7591
+ const weeks = React36.useMemo(
7591
7592
  () => generateWeeks(startDate, weekCount),
7592
7593
  [startDate, weekCount]
7593
7594
  );
7594
- const currentWeekKey = React30.useMemo(() => {
7595
+ const currentWeekKey = React36.useMemo(() => {
7595
7596
  const currentWeek = weeks.find((w) => w.isCurrentWeek);
7596
7597
  return currentWeek ? getWeekKey(currentWeek.startDate) : null;
7597
7598
  }, [weeks]);
7598
- const columnSummaryData = React30.useMemo(() => {
7599
+ const columnSummaryData = React36.useMemo(() => {
7599
7600
  const summaryMap = /* @__PURE__ */ new Map();
7600
7601
  for (const week of weeks) {
7601
7602
  const weekKey = getWeekKey(week.startDate);
@@ -7637,14 +7638,14 @@ function PlanningTable({
7637
7638
  }
7638
7639
  return summaryMap;
7639
7640
  }, [weeks, suppliers]);
7640
- const columns = React30.useMemo(
7641
+ const columns = React36.useMemo(
7641
7642
  () => generateColumns(weeks, config, suppliers, columnSummaryData),
7642
7643
  [weeks, config, suppliers, columnSummaryData]
7643
7644
  );
7644
- const [sorting, setSorting] = React30.useState([]);
7645
- const [columnFilters, setColumnFilters] = React30.useState([]);
7646
- const [columnVisibility, setColumnVisibility] = React30.useState({});
7647
- 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({});
7648
7649
  const table = useReactTable({
7649
7650
  data: suppliers,
7650
7651
  columns,
@@ -7668,7 +7669,7 @@ function PlanningTable({
7668
7669
  }
7669
7670
  }
7670
7671
  });
7671
- const insightMetrics = React30.useMemo(() => {
7672
+ const insightMetrics = React36.useMemo(() => {
7672
7673
  let totalProduced = 0;
7673
7674
  let totalRequired = 0;
7674
7675
  let totalDeliveries = 0;
@@ -7902,10 +7903,10 @@ function DeliveryCommentPopover({
7902
7903
  onAddComment,
7903
7904
  deliveryLabel
7904
7905
  }) {
7905
- const [open, setOpen] = React30.useState(false);
7906
- const [newCommentText, setNewCommentText] = React30.useState("");
7907
- const [viewCommentsOpen, setViewCommentsOpen] = React30.useState(true);
7908
- 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);
7909
7910
  const handleSubmit = () => {
7910
7911
  if (newCommentText.trim() && onAddComment) {
7911
7912
  onAddComment(newCommentText.trim());
@@ -7924,7 +7925,7 @@ function DeliveryCommentPopover({
7924
7925
  setNewCommentText("");
7925
7926
  }
7926
7927
  };
7927
- const formatDate3 = (date) => {
7928
+ const formatDate6 = (date) => {
7928
7929
  return new Intl.DateTimeFormat("en-US", {
7929
7930
  month: "short",
7930
7931
  day: "numeric",
@@ -7932,8 +7933,8 @@ function DeliveryCommentPopover({
7932
7933
  minute: "2-digit"
7933
7934
  }).format(date);
7934
7935
  };
7935
- const prevOpenRef = React30.useRef(open);
7936
- React30.useEffect(() => {
7936
+ const prevOpenRef = React36.useRef(open);
7937
+ React36.useEffect(() => {
7937
7938
  const wasOpen = prevOpenRef.current;
7938
7939
  prevOpenRef.current = open;
7939
7940
  if (wasOpen && !open) {
@@ -7970,7 +7971,7 @@ function DeliveryCommentPopover({
7970
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: [
7971
7972
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
7972
7973
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
7973
- /* @__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) })
7974
7975
  ] }),
7975
7976
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
7976
7977
  ] }, comment.id)) : /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center py-2", children: "No comments yet" }) })
@@ -8045,8 +8046,8 @@ function ProductionCommentSection({
8045
8046
  comments = [],
8046
8047
  onAddComment
8047
8048
  }) {
8048
- const [showAddForm, setShowAddForm] = React30.useState(false);
8049
- const [newComment, setNewComment] = React30.useState("");
8049
+ const [showAddForm, setShowAddForm] = React36.useState(false);
8050
+ const [newComment, setNewComment] = React36.useState("");
8050
8051
  const handleSubmit = () => {
8051
8052
  if (newComment.trim() && onAddComment) {
8052
8053
  onAddComment(newComment.trim());
@@ -8064,7 +8065,7 @@ function ProductionCommentSection({
8064
8065
  setNewComment("");
8065
8066
  }
8066
8067
  };
8067
- const formatDate3 = (date) => {
8068
+ const formatDate6 = (date) => {
8068
8069
  return new Intl.DateTimeFormat("en-US", {
8069
8070
  month: "short",
8070
8071
  day: "numeric",
@@ -8076,7 +8077,7 @@ function ProductionCommentSection({
8076
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: [
8077
8078
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
8078
8079
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
8079
- /* @__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) })
8080
8081
  ] }),
8081
8082
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
8082
8083
  ] }, comment.id)) }),
@@ -8231,7 +8232,7 @@ function DeliveryDetailsView({
8231
8232
  onAddComment
8232
8233
  }) {
8233
8234
  const elements = delivery.elements ?? [];
8234
- const categorizedElements = React30.useMemo(() => {
8235
+ const categorizedElements = React36.useMemo(() => {
8235
8236
  const sent = [];
8236
8237
  const notSent = [];
8237
8238
  const moved = [];
@@ -8599,15 +8600,15 @@ function WeekDetailDialog({
8599
8600
  }) {
8600
8601
  const production = data?.production;
8601
8602
  const initialProduced = production?.produced ?? 0;
8602
- const [producedValue, setProducedValue] = React30.useState(initialProduced.toString());
8603
- const [hasChanges, setHasChanges] = React30.useState(false);
8604
- const [selectedDelivery, setSelectedDelivery] = React30.useState(null);
8605
- 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(() => {
8606
8607
  const newProduced = data?.production?.produced ?? 0;
8607
8608
  setProducedValue(newProduced.toString());
8608
8609
  setHasChanges(false);
8609
8610
  }, [data]);
8610
- React30.useEffect(() => {
8611
+ React36.useEffect(() => {
8611
8612
  if (!open) {
8612
8613
  setSelectedDelivery(null);
8613
8614
  }
@@ -8738,24 +8739,24 @@ function ElementProductionDialog({
8738
8739
  elements,
8739
8740
  onSave
8740
8741
  }) {
8741
- const [searchQuery, setSearchQuery] = React30.useState("");
8742
- const [selectedIds, setSelectedIds] = React30.useState(
8742
+ const [searchQuery, setSearchQuery] = React36.useState("");
8743
+ const [selectedIds, setSelectedIds] = React36.useState(
8743
8744
  new Set(elements.filter((e) => e.isProduced).map((e) => e.id))
8744
8745
  );
8745
- React30.useEffect(() => {
8746
+ React36.useEffect(() => {
8746
8747
  if (open) {
8747
8748
  setSelectedIds(new Set(elements.filter((e) => e.isProduced).map((e) => e.id)));
8748
8749
  setSearchQuery("");
8749
8750
  }
8750
8751
  }, [open, elements]);
8751
- const filteredElements = React30.useMemo(() => {
8752
+ const filteredElements = React36.useMemo(() => {
8752
8753
  if (!searchQuery.trim()) return elements;
8753
8754
  const query = searchQuery.toLowerCase();
8754
8755
  return elements.filter(
8755
8756
  (e) => e.name.toLowerCase().includes(query) || e.prefix?.toLowerCase().includes(query) || e.type?.toLowerCase().includes(query)
8756
8757
  );
8757
8758
  }, [elements, searchQuery]);
8758
- React30.useMemo(() => {
8759
+ React36.useMemo(() => {
8759
8760
  const prefixes = /* @__PURE__ */ new Set();
8760
8761
  elements.forEach((e) => {
8761
8762
  if (e.prefix) prefixes.add(e.prefix);
@@ -8941,10 +8942,10 @@ function DeliveryCommentPopover2({
8941
8942
  onAddComment,
8942
8943
  deliveryLabel
8943
8944
  }) {
8944
- const [open, setOpen] = React30.useState(false);
8945
- const [newCommentText, setNewCommentText] = React30.useState("");
8946
- const [viewCommentsOpen, setViewCommentsOpen] = React30.useState(true);
8947
- 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);
8948
8949
  const handleSubmit = () => {
8949
8950
  if (newCommentText.trim() && onAddComment) {
8950
8951
  onAddComment(newCommentText.trim());
@@ -8963,7 +8964,7 @@ function DeliveryCommentPopover2({
8963
8964
  setNewCommentText("");
8964
8965
  }
8965
8966
  };
8966
- const formatDate3 = (date) => {
8967
+ const formatDate6 = (date) => {
8967
8968
  return new Intl.DateTimeFormat("en-US", {
8968
8969
  month: "short",
8969
8970
  day: "numeric",
@@ -8971,7 +8972,7 @@ function DeliveryCommentPopover2({
8971
8972
  minute: "2-digit"
8972
8973
  }).format(date);
8973
8974
  };
8974
- React30.useEffect(() => {
8975
+ React36.useEffect(() => {
8975
8976
  if (!open) {
8976
8977
  setShowAddForm(false);
8977
8978
  setNewCommentText("");
@@ -9006,7 +9007,7 @@ function DeliveryCommentPopover2({
9006
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: [
9007
9008
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
9008
9009
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
9009
- /* @__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) })
9010
9011
  ] }),
9011
9012
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
9012
9013
  ] }, comment.id)) : /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center py-2", children: "No comments yet" }) })
@@ -9081,8 +9082,8 @@ function ProductionCommentSection2({
9081
9082
  comments = [],
9082
9083
  onAddComment
9083
9084
  }) {
9084
- const [showAddForm, setShowAddForm] = React30.useState(false);
9085
- const [newComment, setNewComment] = React30.useState("");
9085
+ const [showAddForm, setShowAddForm] = React36.useState(false);
9086
+ const [newComment, setNewComment] = React36.useState("");
9086
9087
  const handleSubmit = () => {
9087
9088
  if (newComment.trim() && onAddComment) {
9088
9089
  onAddComment(newComment.trim());
@@ -9100,7 +9101,7 @@ function ProductionCommentSection2({
9100
9101
  setNewComment("");
9101
9102
  }
9102
9103
  };
9103
- const formatDate3 = (date) => {
9104
+ const formatDate6 = (date) => {
9104
9105
  return new Intl.DateTimeFormat("en-US", {
9105
9106
  month: "short",
9106
9107
  day: "numeric",
@@ -9112,7 +9113,7 @@ function ProductionCommentSection2({
9112
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: [
9113
9114
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
9114
9115
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
9115
- /* @__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) })
9116
9117
  ] }),
9117
9118
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
9118
9119
  ] }, comment.id)) }),
@@ -9267,7 +9268,7 @@ function DeliveryDetailsView2({
9267
9268
  onAddComment
9268
9269
  }) {
9269
9270
  const elements = delivery.elements ?? [];
9270
- const categorizedElements = React30.useMemo(() => {
9271
+ const categorizedElements = React36.useMemo(() => {
9271
9272
  const sent = [];
9272
9273
  const notSent = [];
9273
9274
  const moved = [];
@@ -9601,10 +9602,10 @@ function WeekDetailSheet({
9601
9602
  onAddProductionComment,
9602
9603
  onAddDeliveryComment
9603
9604
  }) {
9604
- const [selectedDelivery, setSelectedDelivery] = React30.useState(null);
9605
- const [productionDialogOpen, setProductionDialogOpen] = React30.useState(false);
9606
- const [previousProducedCount, setPreviousProducedCount] = React30.useState(void 0);
9607
- 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(() => {
9608
9609
  if (!data?.deliveries) return [];
9609
9610
  const elements = [];
9610
9611
  const seenIds = /* @__PURE__ */ new Set();
@@ -9628,12 +9629,12 @@ function WeekDetailSheet({
9628
9629
  return elements;
9629
9630
  }, [data?.deliveries]);
9630
9631
  const currentProducedCount = productionElements.filter((e) => e.isProduced).length;
9631
- React30.useEffect(() => {
9632
+ React36.useEffect(() => {
9632
9633
  if (open && data?.deliveries) {
9633
9634
  setPreviousProducedCount(currentProducedCount);
9634
9635
  }
9635
9636
  }, [open]);
9636
- React30.useEffect(() => {
9637
+ React36.useEffect(() => {
9637
9638
  if (!open) {
9638
9639
  setSelectedDelivery(null);
9639
9640
  setProductionDialogOpen(false);
@@ -9866,13 +9867,13 @@ function CalibrationWeekCell({
9866
9867
  onAddClick,
9867
9868
  ...props
9868
9869
  }) {
9869
- const inputRef = React30.useRef(null);
9870
- const [localValue, setLocalValue] = React30.useState(
9870
+ const inputRef = React36.useRef(null);
9871
+ const [localValue, setLocalValue] = React36.useState(
9871
9872
  data.entered !== null ? String(data.entered) : ""
9872
9873
  );
9873
- const [isHovered, setIsHovered] = React30.useState(false);
9874
- const [isEditing, setIsEditing] = React30.useState(false);
9875
- React30.useEffect(() => {
9874
+ const [isHovered, setIsHovered] = React36.useState(false);
9875
+ const [isEditing, setIsEditing] = React36.useState(false);
9876
+ React36.useEffect(() => {
9876
9877
  setLocalValue(data.entered !== null ? String(data.entered) : "");
9877
9878
  }, [data.entered]);
9878
9879
  const unitLabel = formatCalibrationUnit(unit);
@@ -10058,11 +10059,11 @@ function CommentPopover({
10058
10059
  open,
10059
10060
  onOpenChange
10060
10061
  }) {
10061
- const [newCommentText, setNewCommentText] = React30.useState("");
10062
- const [selectedPrefixId, setSelectedPrefixId] = React30.useState("");
10063
- const [viewCommentsOpen, setViewCommentsOpen] = React30.useState(true);
10064
- const [showAddForm, setShowAddForm] = React30.useState(false);
10065
- 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(() => {
10066
10067
  const prefix = availablePrefixes.find((p) => p.id === selectedPrefixId);
10067
10068
  return prefix?.name ?? "";
10068
10069
  }, [availablePrefixes, selectedPrefixId]);
@@ -10086,7 +10087,7 @@ function CommentPopover({
10086
10087
  setNewCommentText("");
10087
10088
  }
10088
10089
  };
10089
- const formatDate3 = (date) => {
10090
+ const formatDate6 = (date) => {
10090
10091
  return new Intl.DateTimeFormat("en-US", {
10091
10092
  month: "short",
10092
10093
  day: "numeric",
@@ -10094,8 +10095,8 @@ function CommentPopover({
10094
10095
  minute: "2-digit"
10095
10096
  }).format(date);
10096
10097
  };
10097
- const prevOpenRef = React30.useRef(open);
10098
- React30.useEffect(() => {
10098
+ const prevOpenRef = React36.useRef(open);
10099
+ React36.useEffect(() => {
10099
10100
  const wasOpen = prevOpenRef.current;
10100
10101
  prevOpenRef.current = open;
10101
10102
  if (wasOpen && !open) {
@@ -10154,7 +10155,7 @@ function CommentPopover({
10154
10155
  ),
10155
10156
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
10156
10157
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
10157
- /* @__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) })
10158
10159
  ] }),
10159
10160
  /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground", children: comment.text })
10160
10161
  ]
@@ -10340,7 +10341,7 @@ function CalibrationTable({
10340
10341
  onAddComment,
10341
10342
  onAddEarlierWeek
10342
10343
  } = config;
10343
- const calculatedStartDate = React30.useMemo(() => {
10344
+ const calculatedStartDate = React36.useMemo(() => {
10344
10345
  if (startDate) return startDate;
10345
10346
  let earliest = null;
10346
10347
  for (const prefix of prefixes) {
@@ -10361,31 +10362,31 @@ function CalibrationTable({
10361
10362
  }
10362
10363
  return earliest ?? /* @__PURE__ */ new Date();
10363
10364
  }, [startDate, prefixes]);
10364
- const [additionalWeeks, setAdditionalWeeks] = React30.useState(0);
10365
- const weeks = React30.useMemo(() => {
10365
+ const [additionalWeeks, setAdditionalWeeks] = React36.useState(0);
10366
+ const weeks = React36.useMemo(() => {
10366
10367
  const start = new Date(calculatedStartDate);
10367
10368
  start.setDate(start.getDate() - additionalWeeks * 7);
10368
10369
  return generateWeeks(start, weekCount + additionalWeeks);
10369
10370
  }, [calculatedStartDate, weekCount, additionalWeeks]);
10370
- React30.useMemo(() => {
10371
+ React36.useMemo(() => {
10371
10372
  const currentWeek = weeks.find((w) => w.isCurrentWeek);
10372
10373
  return currentWeek ? getWeekKey(currentWeek.startDate) : null;
10373
10374
  }, [weeks]);
10374
- const [currentPage, setCurrentPage] = React30.useState(0);
10375
- const [pageSize, setPageSize] = React30.useState(defaultPageSize);
10376
- const [searchQuery, setSearchQuery] = React30.useState("");
10377
- 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(() => {
10378
10379
  if (!searchQuery) return prefixes;
10379
10380
  const query = searchQuery.toLowerCase();
10380
10381
  return prefixes.filter(
10381
10382
  (p) => p.name.toLowerCase().includes(query) || p.typeCode.toLowerCase().includes(query)
10382
10383
  );
10383
10384
  }, [prefixes, searchQuery]);
10384
- const paginatedPrefixes = React30.useMemo(() => {
10385
+ const paginatedPrefixes = React36.useMemo(() => {
10385
10386
  const start = currentPage * pageSize;
10386
10387
  return filteredPrefixes.slice(start, start + pageSize);
10387
10388
  }, [filteredPrefixes, currentPage, pageSize]);
10388
- React30.useMemo(
10389
+ React36.useMemo(
10389
10390
  () => canSubmitCalibration(prefixes),
10390
10391
  [prefixes]
10391
10392
  );
@@ -10409,11 +10410,11 @@ function CalibrationTable({
10409
10410
  }
10410
10411
  return allComments;
10411
10412
  };
10412
- const availablePrefixes = React30.useMemo(
10413
+ const availablePrefixes = React36.useMemo(
10413
10414
  () => prefixes.map((p) => ({ id: p.id, name: p.name })),
10414
10415
  [prefixes]
10415
10416
  );
10416
- const insightMetrics = React30.useMemo(() => {
10417
+ const insightMetrics = React36.useMemo(() => {
10417
10418
  let totalCalibrated = 0;
10418
10419
  let totalRequired = 0;
10419
10420
  for (const prefix of prefixes) {
@@ -10454,7 +10455,7 @@ function CalibrationTable({
10454
10455
  }
10455
10456
  ];
10456
10457
  }, [prefixes]);
10457
- const columnSummaryData = React30.useMemo(() => {
10458
+ const columnSummaryData = React36.useMemo(() => {
10458
10459
  const summaryMap = /* @__PURE__ */ new Map();
10459
10460
  for (const week of weeks) {
10460
10461
  const weekKey = getWeekKey(week.startDate);
@@ -10721,14 +10722,14 @@ function CommentDialog({
10721
10722
  open,
10722
10723
  onOpenChange
10723
10724
  }) {
10724
- const [selectedPrefixId, setSelectedPrefixId] = React30.useState("");
10725
- const [selectedWeekKey, setSelectedWeekKey] = React30.useState("");
10726
- const [commentText, setCommentText] = React30.useState("");
10727
- 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(
10728
10729
  () => weeks.find((w) => w.isCurrentWeek),
10729
10730
  [weeks]
10730
10731
  );
10731
- React30.useEffect(() => {
10732
+ React36.useEffect(() => {
10732
10733
  if (open) {
10733
10734
  setSelectedPrefixId(prefixes[0]?.id ?? "");
10734
10735
  setSelectedWeekKey(currentWeek ? getWeekKey(currentWeek.startDate) : weeks[0] ? getWeekKey(weeks[0].startDate) : "");
@@ -10964,7 +10965,7 @@ function generateLoadingWeek(date) {
10964
10965
  const today = /* @__PURE__ */ new Date();
10965
10966
  today.setHours(0, 0, 0, 0);
10966
10967
  const isCurrentWeek = monday <= today && today <= friday;
10967
- const formatDate3 = (d) => {
10968
+ const formatDate6 = (d) => {
10968
10969
  return d.toLocaleDateString("en-US", { month: "short", day: "numeric" });
10969
10970
  };
10970
10971
  return {
@@ -10972,7 +10973,7 @@ function generateLoadingWeek(date) {
10972
10973
  label: `W${getLoadingISOWeek(monday).toString().padStart(2, "0")}`,
10973
10974
  startDate: monday,
10974
10975
  endDate: friday,
10975
- dateRange: `${formatDate3(monday)} - ${formatDate3(friday)}`,
10976
+ dateRange: `${formatDate6(monday)} - ${formatDate6(friday)}`,
10976
10977
  isCurrentWeek
10977
10978
  };
10978
10979
  }
@@ -11275,7 +11276,7 @@ function WeeklyLoadingView({
11275
11276
  showNavigation = true,
11276
11277
  className
11277
11278
  }) {
11278
- const [shippedOpenState, setShippedOpenState] = React30.useState({
11279
+ const [shippedOpenState, setShippedOpenState] = React36.useState({
11279
11280
  1: false,
11280
11281
  // Monday
11281
11282
  2: false,
@@ -11293,7 +11294,7 @@ function WeeklyLoadingView({
11293
11294
  [dayOfWeek]: !prev[dayOfWeek]
11294
11295
  }));
11295
11296
  };
11296
- const weekDays = React30.useMemo(() => {
11297
+ const weekDays = React36.useMemo(() => {
11297
11298
  const days = [];
11298
11299
  for (let i = 0; i < 5; i++) {
11299
11300
  const date = addDays(week.startDate, i);
@@ -11305,7 +11306,7 @@ function WeeklyLoadingView({
11305
11306
  }
11306
11307
  return days;
11307
11308
  }, [week.startDate]);
11308
- const deliveriesByDay = React30.useMemo(() => {
11309
+ const deliveriesByDay = React36.useMemo(() => {
11309
11310
  const grouped = /* @__PURE__ */ new Map();
11310
11311
  for (let i = 1; i <= 5; i++) {
11311
11312
  grouped.set(i, { pending: [], shipped: [] });
@@ -11325,7 +11326,7 @@ function WeeklyLoadingView({
11325
11326
  }, [deliveries]);
11326
11327
  const totalPendingDeliveries = deliveries.filter((d) => !isShippedDelivery(d)).length;
11327
11328
  const totalShippedDeliveries = deliveries.filter((d) => isShippedDelivery(d)).length;
11328
- const daySummaryData = React30.useMemo(() => {
11329
+ const daySummaryData = React36.useMemo(() => {
11329
11330
  const summaries = /* @__PURE__ */ new Map();
11330
11331
  for (let i = 1; i <= 5; i++) {
11331
11332
  const dayData = deliveriesByDay.get(i) ?? { pending: [], shipped: [] };
@@ -11679,7 +11680,7 @@ function DeliveryTimeline({ timelineState }) {
11679
11680
  const state = getStateForStep(step.id);
11680
11681
  const styles = getStepStyles(state);
11681
11682
  const isLast = index === TIMELINE_STEPS.length - 1;
11682
- return /* @__PURE__ */ jsxs(React30.Fragment, { children: [
11683
+ return /* @__PURE__ */ jsxs(React36.Fragment, { children: [
11683
11684
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
11684
11685
  /* @__PURE__ */ jsx(
11685
11686
  "div",
@@ -11814,7 +11815,7 @@ function AddCommentDialog({
11814
11815
  weekId,
11815
11816
  onAddComment
11816
11817
  }) {
11817
- const [commentText, setCommentText] = React30.useState("");
11818
+ const [commentText, setCommentText] = React36.useState("");
11818
11819
  const handleSubmit = () => {
11819
11820
  if (commentText.trim() && onAddComment) {
11820
11821
  onAddComment({
@@ -11839,7 +11840,7 @@ function AddCommentDialog({
11839
11840
  handleSubmit();
11840
11841
  }
11841
11842
  };
11842
- React30.useEffect(() => {
11843
+ React36.useEffect(() => {
11843
11844
  if (!open) {
11844
11845
  setCommentText("");
11845
11846
  }
@@ -11902,9 +11903,9 @@ function CommentsSection({
11902
11903
  weekId,
11903
11904
  onAddComment
11904
11905
  }) {
11905
- const [viewCommentsOpen, setViewCommentsOpen] = React30.useState(true);
11906
- const [addDialogOpen, setAddDialogOpen] = React30.useState(false);
11907
- const formatDate3 = (date) => {
11906
+ const [viewCommentsOpen, setViewCommentsOpen] = React36.useState(true);
11907
+ const [addDialogOpen, setAddDialogOpen] = React36.useState(false);
11908
+ const formatDate6 = (date) => {
11908
11909
  return new Intl.DateTimeFormat("en-US", {
11909
11910
  month: "short",
11910
11911
  day: "numeric",
@@ -11948,7 +11949,7 @@ function CommentsSection({
11948
11949
  /* @__PURE__ */ jsx("span", { className: "text-xs font-medium", children: comment.author }),
11949
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 })
11950
11951
  ] }),
11951
- /* @__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) })
11952
11953
  ] }),
11953
11954
  /* @__PURE__ */ jsx("p", { className: "text-sm", children: comment.text })
11954
11955
  ] }, comment.id)) })
@@ -11977,7 +11978,7 @@ function DeliveryDetailPage({
11977
11978
  onConfirmLoad
11978
11979
  }) {
11979
11980
  const timelineState = getTimelineState(delivery);
11980
- const elementsByStatus = React30.useMemo(() => {
11981
+ const elementsByStatus = React36.useMemo(() => {
11981
11982
  const loaded = delivery.elements.filter((e) => e.status === "loaded");
11982
11983
  const missing = delivery.elements.filter((e) => e.status === "missing");
11983
11984
  const moved = delivery.elements.filter((e) => e.status === "moved");
@@ -12164,11 +12165,11 @@ function SupplierWeeklyLoading({
12164
12165
  bordered = true,
12165
12166
  className
12166
12167
  }) {
12167
- const [selectedDelivery, setSelectedDelivery] = React30.useState(null);
12168
- const [sheetOpen, setSheetOpen] = React30.useState(false);
12169
- const [commentDelivery, setCommentDelivery] = React30.useState(null);
12170
- const [commentDialogOpen, setCommentDialogOpen] = React30.useState(false);
12171
- 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("");
12172
12173
  const handleDeliveryClick = (delivery) => {
12173
12174
  setSelectedDelivery(delivery);
12174
12175
  setSheetOpen(true);
@@ -12211,7 +12212,7 @@ function SupplierWeeklyLoading({
12211
12212
  handleCommentSubmit();
12212
12213
  }
12213
12214
  };
12214
- const insightMetrics = React30.useMemo(() => {
12215
+ const insightMetrics = React36.useMemo(() => {
12215
12216
  const totalDeliveries = deliveries.length;
12216
12217
  const readyDeliveries = deliveries.filter((d) => d.isReadyToUnload).length;
12217
12218
  deliveries.filter(
@@ -12630,11 +12631,11 @@ function CapacityPlanningChart({
12630
12631
  allowDragDrop = true,
12631
12632
  className
12632
12633
  }) {
12633
- const containerRef = React30.useRef(null);
12634
- const [draggedPackage, setDraggedPackage] = React30.useState(null);
12635
- const [showUnassigned, setShowUnassigned] = React30.useState(true);
12636
- const [containerWidth, setContainerWidth] = React30.useState(0);
12637
- 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(() => {
12638
12639
  const updateWidth = () => {
12639
12640
  if (containerRef.current) {
12640
12641
  setContainerWidth(containerRef.current.offsetWidth);
@@ -12647,15 +12648,15 @@ function CapacityPlanningChart({
12647
12648
  }
12648
12649
  return () => observer.disconnect();
12649
12650
  }, []);
12650
- const cumulativeNeed = React30.useMemo(
12651
+ const cumulativeNeed = React36.useMemo(
12651
12652
  () => calculateCumulativeNeed(weeks, deliveries),
12652
12653
  [weeks, deliveries]
12653
12654
  );
12654
- const packagePositions = React30.useMemo(
12655
+ const packagePositions = React36.useMemo(
12655
12656
  () => calculatePackagePositions(packages, weeks),
12656
12657
  [packages, weeks]
12657
12658
  );
12658
- const deliveriesByWeek = React30.useMemo(() => {
12659
+ const deliveriesByWeek = React36.useMemo(() => {
12659
12660
  const map = /* @__PURE__ */ new Map();
12660
12661
  for (const d of deliveries) {
12661
12662
  const existing = map.get(d.weekKey) || [];
@@ -14489,7 +14490,7 @@ var getWeekStartDate2 = (year, weekNumber) => {
14489
14490
  };
14490
14491
  var EnhancedGridLines = memo(({ rowCount }) => {
14491
14492
  const gantt = useGanttContext();
14492
- const id = React30.useId();
14493
+ const id = React36.useId();
14493
14494
  const columnWidth = gantt.columnWidth * gantt.zoom / 100;
14494
14495
  const { verticalLines, totalColumns } = useMemo(() => {
14495
14496
  const lines = [];
@@ -15084,7 +15085,7 @@ function getPhaseColor(phaseId, customColor) {
15084
15085
  }
15085
15086
  var LightweightGridLines = memo(() => {
15086
15087
  const gantt = useGanttContext();
15087
- const id = React30.useId();
15088
+ const id = React36.useId();
15088
15089
  const columnWidth = gantt.columnWidth * gantt.zoom / 100;
15089
15090
  const { lines, totalWidth } = useMemo(() => {
15090
15091
  const linePositions = [];
@@ -15681,6 +15682,1366 @@ function PhaseGantt({
15681
15682
  }
15682
15683
  );
15683
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
+ }
15684
17045
 
15685
17046
  // src/components/event-calendar/types.ts
15686
17047
  var DEFAULT_WORKING_HOURS = {
@@ -15744,7 +17105,7 @@ var BADGE_VARIANT_LABELS = {
15744
17105
  colored: "Colored",
15745
17106
  mixed: "Mixed"
15746
17107
  };
15747
- var CalendarContext = React30.createContext(null);
17108
+ var CalendarContext = React36.createContext(null);
15748
17109
  function EventCalendarProvider({
15749
17110
  children,
15750
17111
  events: initialEvents = [],
@@ -15759,38 +17120,38 @@ function EventCalendarProvider({
15759
17120
  onEventUpdate,
15760
17121
  onEventDelete
15761
17122
  }) {
15762
- const [selectedDate, setSelectedDate] = React30.useState(defaultDate);
15763
- const [selectedUserId, setSelectedUserId] = React30.useState(defaultUserId);
15764
- const [events, setEventsState] = React30.useState(initialEvents);
15765
- const [users] = React30.useState(initialUsers);
15766
- const [badgeVariant, setBadgeVariant] = React30.useState(defaultBadgeVariant);
15767
- const [view, setView] = React30.useState(defaultView);
15768
- const [workingHours, setWorkingHours] = React30.useState(defaultWorkingHours);
15769
- const [visibleHours, setVisibleHours] = React30.useState(defaultVisibleHours);
15770
- 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(() => {
15771
17132
  setEventsState(initialEvents);
15772
17133
  }, [initialEvents]);
15773
- const setEvents = React30.useCallback((newEvents) => {
17134
+ const setEvents = React36.useCallback((newEvents) => {
15774
17135
  setEventsState(newEvents);
15775
17136
  }, []);
15776
- const addEvent = React30.useCallback((event) => {
17137
+ const addEvent = React36.useCallback((event) => {
15777
17138
  setEventsState((prev) => [...prev, event]);
15778
17139
  onEventAdd?.(event);
15779
17140
  }, [onEventAdd]);
15780
- const updateEvent = React30.useCallback((event) => {
17141
+ const updateEvent = React36.useCallback((event) => {
15781
17142
  setEventsState(
15782
17143
  (prev) => prev.map((e) => e.id === event.id ? event : e)
15783
17144
  );
15784
17145
  onEventUpdate?.(event);
15785
17146
  }, [onEventUpdate]);
15786
- const deleteEvent = React30.useCallback((eventId) => {
17147
+ const deleteEvent = React36.useCallback((eventId) => {
15787
17148
  setEventsState((prev) => prev.filter((e) => e.id !== eventId));
15788
17149
  onEventDelete?.(eventId);
15789
17150
  }, [onEventDelete]);
15790
- const goToToday = React30.useCallback(() => {
17151
+ const goToToday = React36.useCallback(() => {
15791
17152
  setSelectedDate(/* @__PURE__ */ new Date());
15792
17153
  }, []);
15793
- const goToPrevious = React30.useCallback(() => {
17154
+ const goToPrevious = React36.useCallback(() => {
15794
17155
  setSelectedDate((current) => {
15795
17156
  switch (view) {
15796
17157
  case "day":
@@ -15808,7 +17169,7 @@ function EventCalendarProvider({
15808
17169
  }
15809
17170
  });
15810
17171
  }, [view]);
15811
- const goToNext = React30.useCallback(() => {
17172
+ const goToNext = React36.useCallback(() => {
15812
17173
  setSelectedDate((current) => {
15813
17174
  switch (view) {
15814
17175
  case "day":
@@ -15826,7 +17187,7 @@ function EventCalendarProvider({
15826
17187
  }
15827
17188
  });
15828
17189
  }, [view]);
15829
- const contextValue = React30.useMemo(
17190
+ const contextValue = React36.useMemo(
15830
17191
  () => ({
15831
17192
  // State
15832
17193
  selectedDate,
@@ -15873,7 +17234,7 @@ function EventCalendarProvider({
15873
17234
  return /* @__PURE__ */ jsx(CalendarContext.Provider, { value: contextValue, children });
15874
17235
  }
15875
17236
  function useEventCalendar() {
15876
- const context = React30.useContext(CalendarContext);
17237
+ const context = React36.useContext(CalendarContext);
15877
17238
  if (!context) {
15878
17239
  throw new Error("useEventCalendar must be used within an EventCalendarProvider");
15879
17240
  }
@@ -15881,14 +17242,14 @@ function useEventCalendar() {
15881
17242
  }
15882
17243
  function useFilteredEvents() {
15883
17244
  const { events, selectedUserId } = useEventCalendar();
15884
- return React30.useMemo(() => {
17245
+ return React36.useMemo(() => {
15885
17246
  if (!selectedUserId) return events;
15886
17247
  return events.filter((event) => event.user.id === selectedUserId);
15887
17248
  }, [events, selectedUserId]);
15888
17249
  }
15889
17250
  function useEventsInRange(startDate, endDate) {
15890
17251
  const filteredEvents = useFilteredEvents();
15891
- return React30.useMemo(() => {
17252
+ return React36.useMemo(() => {
15892
17253
  return filteredEvents.filter((event) => {
15893
17254
  const eventStart = new Date(event.startDate);
15894
17255
  const eventEnd = new Date(event.endDate);
@@ -16446,8 +17807,8 @@ function MoreEvents({ count, onClick, className }) {
16446
17807
  );
16447
17808
  }
16448
17809
  function TimeIndicator({ className }) {
16449
- const [now, setNow] = React30.useState(/* @__PURE__ */ new Date());
16450
- React30.useEffect(() => {
17810
+ const [now, setNow] = React36.useState(/* @__PURE__ */ new Date());
17811
+ React36.useEffect(() => {
16451
17812
  const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
16452
17813
  return () => clearInterval(interval);
16453
17814
  }, []);
@@ -16484,24 +17845,24 @@ function DateBadge({ date, className }) {
16484
17845
  }
16485
17846
  );
16486
17847
  }
16487
- var DragContext = React30.createContext(null);
17848
+ var DragContext = React36.createContext(null);
16488
17849
  function DragProvider({
16489
17850
  children,
16490
17851
  snapMinutes = 15,
16491
17852
  onDragStart,
16492
17853
  onDragEnd
16493
17854
  }) {
16494
- const [draggedEvent, setDraggedEventState] = React30.useState(null);
16495
- const [isDragging, setIsDragging] = React30.useState(false);
17855
+ const [draggedEvent, setDraggedEventState] = React36.useState(null);
17856
+ const [isDragging, setIsDragging] = React36.useState(false);
16496
17857
  const { updateEvent } = useEventCalendar();
16497
- const setDraggedEvent = React30.useCallback((event) => {
17858
+ const setDraggedEvent = React36.useCallback((event) => {
16498
17859
  setDraggedEventState(event);
16499
17860
  setIsDragging(!!event);
16500
17861
  if (event) {
16501
17862
  onDragStart?.(event);
16502
17863
  }
16503
17864
  }, [onDragStart]);
16504
- const handleDrop = React30.useCallback((newStartDate) => {
17865
+ const handleDrop = React36.useCallback((newStartDate) => {
16505
17866
  if (!draggedEvent) return;
16506
17867
  const snappedDate = snapToInterval(newStartDate, snapMinutes);
16507
17868
  const { startDate, endDate } = calculateDropDates(draggedEvent, snappedDate);
@@ -16514,7 +17875,7 @@ function DragProvider({
16514
17875
  onDragEnd?.(updatedEvent, new Date(startDate), new Date(endDate));
16515
17876
  setDraggedEvent(null);
16516
17877
  }, [draggedEvent, snapMinutes, updateEvent, onDragEnd, setDraggedEvent]);
16517
- const contextValue = React30.useMemo(
17878
+ const contextValue = React36.useMemo(
16518
17879
  () => ({
16519
17880
  draggedEvent,
16520
17881
  setDraggedEvent,
@@ -16525,7 +17886,7 @@ function DragProvider({
16525
17886
  return /* @__PURE__ */ jsx(DragContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(DragDropHandler, { onDrop: handleDrop, children }) });
16526
17887
  }
16527
17888
  function useDrag() {
16528
- const context = React30.useContext(DragContext);
17889
+ const context = React36.useContext(DragContext);
16529
17890
  if (!context) {
16530
17891
  throw new Error("useDrag must be used within a DragProvider");
16531
17892
  }
@@ -16570,7 +17931,7 @@ function DroppableZone({
16570
17931
  }) {
16571
17932
  const { draggedEvent, setDraggedEvent } = useDrag();
16572
17933
  const { updateEvent } = useEventCalendar();
16573
- const [isOver, setIsOver] = React30.useState(false);
17934
+ const [isOver, setIsOver] = React36.useState(false);
16574
17935
  const handleDragOver = (e) => {
16575
17936
  e.preventDefault();
16576
17937
  e.dataTransfer.dropEffect = "move";
@@ -16608,23 +17969,23 @@ function DroppableZone({
16608
17969
  function useDroppable({ date, hour, minute = 0, onDrop }) {
16609
17970
  const { draggedEvent, setDraggedEvent } = useDrag();
16610
17971
  const { updateEvent } = useEventCalendar();
16611
- const [isOver, setIsOver] = React30.useState(false);
16612
- const dropTargetDate = React30.useMemo(() => {
17972
+ const [isOver, setIsOver] = React36.useState(false);
17973
+ const dropTargetDate = React36.useMemo(() => {
16613
17974
  const targetDate = new Date(date);
16614
17975
  if (hour !== void 0) {
16615
17976
  targetDate.setHours(hour, minute, 0, 0);
16616
17977
  }
16617
17978
  return targetDate;
16618
17979
  }, [date, hour, minute]);
16619
- const handleDragOver = React30.useCallback((e) => {
17980
+ const handleDragOver = React36.useCallback((e) => {
16620
17981
  e.preventDefault();
16621
17982
  e.dataTransfer.dropEffect = "move";
16622
17983
  if (!isOver) setIsOver(true);
16623
17984
  }, [isOver]);
16624
- const handleDragLeave = React30.useCallback(() => {
17985
+ const handleDragLeave = React36.useCallback(() => {
16625
17986
  setIsOver(false);
16626
17987
  }, []);
16627
- const handleDrop = React30.useCallback((e) => {
17988
+ const handleDrop = React36.useCallback((e) => {
16628
17989
  e.preventDefault();
16629
17990
  setIsOver(false);
16630
17991
  if (!draggedEvent) return;
@@ -16651,13 +18012,13 @@ function useDroppable({ date, hour, minute = 0, onDrop }) {
16651
18012
  function useDraggable3(event, disabled = false) {
16652
18013
  const { setDraggedEvent, draggedEvent } = useDrag();
16653
18014
  const isDragged = draggedEvent?.id === event.id;
16654
- const handleDragStart = React30.useCallback((e) => {
18015
+ const handleDragStart = React36.useCallback((e) => {
16655
18016
  if (disabled) return;
16656
18017
  e.dataTransfer.effectAllowed = "move";
16657
18018
  e.dataTransfer.setData("text/plain", event.id);
16658
18019
  setDraggedEvent(event);
16659
18020
  }, [disabled, event, setDraggedEvent]);
16660
- const handleDragEnd = React30.useCallback(() => {
18021
+ const handleDragEnd = React36.useCallback(() => {
16661
18022
  setDraggedEvent(null);
16662
18023
  }, [setDraggedEvent]);
16663
18024
  return {
@@ -16698,15 +18059,15 @@ function MonthView({
16698
18059
  }) {
16699
18060
  const { selectedDate, badgeVariant, setSelectedDate, setView } = useEventCalendar();
16700
18061
  const filteredEvents = useFilteredEvents();
16701
- const { singleDayEvents, multiDayEvents } = React30.useMemo(
18062
+ const { singleDayEvents, multiDayEvents } = React36.useMemo(
16702
18063
  () => splitEventsByDuration(filteredEvents),
16703
18064
  [filteredEvents]
16704
18065
  );
16705
- const cells = React30.useMemo(
18066
+ const cells = React36.useMemo(
16706
18067
  () => getCalendarCells(selectedDate),
16707
18068
  [selectedDate]
16708
18069
  );
16709
- const eventPositions = React30.useMemo(
18070
+ const eventPositions = React36.useMemo(
16710
18071
  () => calculateMonthEventPositions(multiDayEvents, singleDayEvents, selectedDate),
16711
18072
  [multiDayEvents, singleDayEvents, selectedDate]
16712
18073
  );
@@ -16888,7 +18249,7 @@ function WeekView({
16888
18249
  visibleHours
16889
18250
  } = useEventCalendar();
16890
18251
  const filteredEvents = useFilteredEvents();
16891
- const { singleDayEvents, multiDayEvents } = React30.useMemo(
18252
+ const { singleDayEvents, multiDayEvents } = React36.useMemo(
16892
18253
  () => splitEventsByDuration(filteredEvents),
16893
18254
  [filteredEvents]
16894
18255
  );
@@ -17094,8 +18455,8 @@ function CalendarTimeline({
17094
18455
  firstVisibleHour,
17095
18456
  lastVisibleHour
17096
18457
  }) {
17097
- const [currentTime, setCurrentTime] = React30.useState(/* @__PURE__ */ new Date());
17098
- React30.useEffect(() => {
18458
+ const [currentTime, setCurrentTime] = React36.useState(/* @__PURE__ */ new Date());
18459
+ React36.useEffect(() => {
17099
18460
  const interval = setInterval(() => {
17100
18461
  setCurrentTime(/* @__PURE__ */ new Date());
17101
18462
  }, 6e4);
@@ -17178,7 +18539,7 @@ function DayView({
17178
18539
  visibleHours
17179
18540
  } = useEventCalendar();
17180
18541
  const filteredEvents = useFilteredEvents();
17181
- const { singleDayEvents, multiDayEvents } = React30.useMemo(
18542
+ const { singleDayEvents, multiDayEvents } = React36.useMemo(
17182
18543
  () => splitEventsByDuration(filteredEvents),
17183
18544
  [filteredEvents]
17184
18545
  );
@@ -17186,7 +18547,7 @@ function DayView({
17186
18547
  visibleHours,
17187
18548
  singleDayEvents
17188
18549
  );
17189
- const currentEvents = React30.useMemo(() => {
18550
+ const currentEvents = React36.useMemo(() => {
17190
18551
  if (!isToday(selectedDate)) return [];
17191
18552
  return getCurrentEvents(singleDayEvents);
17192
18553
  }, [singleDayEvents, selectedDate]);
@@ -17410,8 +18771,8 @@ function CalendarTimeline2({
17410
18771
  firstVisibleHour,
17411
18772
  lastVisibleHour
17412
18773
  }) {
17413
- const [currentTime, setCurrentTime] = React30.useState(/* @__PURE__ */ new Date());
17414
- React30.useEffect(() => {
18774
+ const [currentTime, setCurrentTime] = React36.useState(/* @__PURE__ */ new Date());
18775
+ React36.useEffect(() => {
17415
18776
  const interval = setInterval(() => {
17416
18777
  setCurrentTime(/* @__PURE__ */ new Date());
17417
18778
  }, 6e4);
@@ -17445,7 +18806,7 @@ function YearView({
17445
18806
  }) {
17446
18807
  const { selectedDate, setSelectedDate, setView } = useEventCalendar();
17447
18808
  const filteredEvents = useFilteredEvents();
17448
- const months = React30.useMemo(() => {
18809
+ const months = React36.useMemo(() => {
17449
18810
  const yearStart = startOfYear(selectedDate);
17450
18811
  return Array.from({ length: 12 }, (_, i) => addMonths(yearStart, i));
17451
18812
  }, [selectedDate]);
@@ -17568,11 +18929,11 @@ function AgendaView({
17568
18929
  }) {
17569
18930
  const { selectedDate, setSelectedDate, setView } = useEventCalendar();
17570
18931
  const filteredEvents = useFilteredEvents();
17571
- const { singleDayEvents, multiDayEvents } = React30.useMemo(
18932
+ const { singleDayEvents, multiDayEvents } = React36.useMemo(
17572
18933
  () => splitEventsByDuration(filteredEvents),
17573
18934
  [filteredEvents]
17574
18935
  );
17575
- const eventsByDay = React30.useMemo(() => {
18936
+ const eventsByDay = React36.useMemo(() => {
17576
18937
  const allDates = /* @__PURE__ */ new Map();
17577
18938
  singleDayEvents.forEach((event) => {
17578
18939
  const eventDate = parseISO(event.startDate);
@@ -18037,16 +19398,16 @@ function EventDialog({
18037
19398
  defaultUserId
18038
19399
  }) {
18039
19400
  const { addEvent, updateEvent, deleteEvent, users } = useEventCalendar();
18040
- const [title, setTitle] = React30.useState("");
18041
- const [description, setDescription] = React30.useState("");
18042
- const [startDate, setStartDate] = React30.useState("");
18043
- const [startTime, setStartTime] = React30.useState("");
18044
- const [endDate, setEndDate] = React30.useState("");
18045
- const [endTime, setEndTime] = React30.useState("");
18046
- const [color, setColor] = React30.useState("blue");
18047
- const [userId, setUserId] = React30.useState("");
18048
- const [isSubmitting, setIsSubmitting] = React30.useState(false);
18049
- 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(() => {
18050
19411
  if (open) {
18051
19412
  if (mode === "edit" && event) {
18052
19413
  const start = parseISO(event.startDate);
@@ -18269,7 +19630,7 @@ function QuickAddEvent({
18269
19630
  onOpenDialog,
18270
19631
  onClose
18271
19632
  }) {
18272
- const [title, setTitle] = React30.useState("");
19633
+ const [title, setTitle] = React36.useState("");
18273
19634
  const { users } = useEventCalendar();
18274
19635
  const handleSubmit = (e) => {
18275
19636
  e.preventDefault();
@@ -18336,8 +19697,8 @@ var HOUR_OPTIONS = Array.from({ length: 25 }, (_, i) => {
18336
19697
  });
18337
19698
  function ChangeVisibleHoursInput() {
18338
19699
  const { visibleHours, setVisibleHours } = useEventCalendar();
18339
- const [from, setFrom] = React30.useState(visibleHours.from);
18340
- const [to, setTo] = React30.useState(visibleHours.to);
19700
+ const [from, setFrom] = React36.useState(visibleHours.from);
19701
+ const [to, setTo] = React36.useState(visibleHours.to);
18341
19702
  const handleApply = () => {
18342
19703
  const toHour = to === 0 ? 24 : to;
18343
19704
  setVisibleHours({ from, to: toHour });
@@ -18383,7 +19744,7 @@ var HOUR_OPTIONS2 = Array.from({ length: 25 }, (_, i) => {
18383
19744
  });
18384
19745
  function ChangeWorkingHoursInput() {
18385
19746
  const { workingHours, setWorkingHours } = useEventCalendar();
18386
- const [localWorkingHours, setLocalWorkingHours] = React30.useState({
19747
+ const [localWorkingHours, setLocalWorkingHours] = React36.useState({
18387
19748
  ...workingHours
18388
19749
  });
18389
19750
  const handleToggleDay = (dayId) => {
@@ -18532,8 +19893,8 @@ function CalendarSettingsButton({
18532
19893
  );
18533
19894
  }
18534
19895
  function useMediaQuery(query) {
18535
- const [matches, setMatches] = React30.useState(false);
18536
- React30.useEffect(() => {
19896
+ const [matches, setMatches] = React36.useState(false);
19897
+ React36.useEffect(() => {
18537
19898
  const media = window.matchMedia(query);
18538
19899
  setMatches(media.matches);
18539
19900
  const listener = (event) => {
@@ -18585,11 +19946,11 @@ function BigCalendarInner({
18585
19946
  maxEventsPerDay
18586
19947
  }) {
18587
19948
  const { view, setView } = useEventCalendar();
18588
- const [dialogOpen, setDialogOpen] = React30.useState(false);
18589
- const [settingsDialogOpen, setSettingsDialogOpen] = React30.useState(false);
18590
- const [selectedEvent, setSelectedEvent] = React30.useState(null);
18591
- const [dialogMode, setDialogMode] = React30.useState("add");
18592
- 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());
18593
19954
  const isMobile = useMediaQuery("(max-width: 768px)");
18594
19955
  const isCompact = compact === "auto" ? isMobile : compact;
18595
19956
  const handleAddClick = () => {
@@ -18946,6 +20307,6 @@ var KanbanProvider = ({
18946
20307
  ) });
18947
20308
  };
18948
20309
 
18949
- 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, 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 };
18950
20311
  //# sourceMappingURL=index.js.map
18951
20312
  //# sourceMappingURL=index.js.map