@jaeungkim/gantt-chart 0.2.3 β†’ 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,172 +1,160 @@
1
1
  # @jaeungkim/gantt-chart
2
2
 
3
- <!-- ![React Gantt Chart](https://raw.githubusercontent.com/jaeungkim/@jaeungkim/gantt-chart/main/public/readmeImg.png) -->
3
+ <!-- ![React Gantt Chart](https://raw.githubusercontent.com/jaeungkim/gantt-chart/main/public/readmeImg.png) -->
4
4
 
5
- Lightweight, high-performance Gantt chart component for React applications, for fast rendering and state management. It is designed to be highly customizable and easy to integrate into modern React projects.
5
+ Lightweight, high-performance Gantt chart component for React applications. Designed for fast rendering with virtualization and clean, minimal aesthetics.
6
6
 
7
- 🎯 Motivation
7
+ ## 🎯 Motivation
8
8
 
9
- I originally wanted to use Microsoft Project's Gantt Chart for personal project management, but it required subscription πŸ˜”. Thus, I decided to build my own Gantt chart, referencing various open-source projects and examples, including MS Project, DHTMLX, Frappe Gantt Chart, and etc.
9
+ I originally wanted to use Microsoft Project's Gantt Chart for personal project management, but it required a subscription πŸ˜”. Thus, I decided to build my own Gantt chart, referencing various open-source projects and examples, including MS Project, DHTMLX, Frappe Gantt Chart, and etc.
10
10
 
11
- Since there aren’t many open-source Gantt chart solutions available, I hope this project will be useful for others as well. I am very open to feedback, feature requests, and contributions to make this Gantt chart as robust and versatile as possible.
11
+ Since there aren't many open-source Gantt chart solutions available, I hope this project will be useful for others as well. I am very open to feedback, feature requests, and contributions to make this Gantt chart as robust and versatile as possible.
12
12
 
13
13
  Currently, this project is built specifically for React due to my development background, but in the future, I may explore making it available for other frameworks as well. Since this is my first open-source project, I look forward to learning and improving it with the community!
14
14
 
15
- ## πŸš€ Features
16
- - πŸ“Š **Lightweight & Fast** – Optimized with Vite for lightning-fast performance.
17
- - πŸ— **Modern State Management** – Uses Zustand for efficient and minimal state handling.
18
- - πŸ”„ **Drag & Drop Support** – Easily move and resize tasks.
19
- <!-- - 🎨 **Customizable Themes** – Style your Gantt chart with Tailwind CSS or custom styles. -->
20
- - πŸ”— **Dependencies Between Tasks** – Visualize relationships between tasks.
21
- - πŸ“† **Zoom & Pan** – Navigate large project timelines with ease.
22
- <!-- - πŸ”§ **API & Data Fetching** – Optional integration with React Query for backend connectivity. -->
23
- <!-- - 🌍 **Internationalization (i18n)** – Multi-language support for global usage. -->
15
+ ## ✨ Features
24
16
 
25
- ---
26
- <!--
27
- ## πŸ“¦ Installation
17
+ - πŸ“† Multiple timeline scales: Day, Week, Month, Year
18
+ - πŸ”„ Drag-and-drop support:
19
+ - Move entire task bars
20
+ - Resize from left/right edges
21
+ - Snap to configured intervals
22
+ - 🧲 Smart dependency arrows (FS, SS, FF, SF)
23
+ - ⚑ Virtualized rendering for performance
24
+ - πŸŒ™ Light/Dark/System theme support
25
+ - πŸ“ Today marker indicator
26
+ - πŸ’¬ Drag tooltip showing date changes
27
+ - πŸ“¦ Lightweight with minimal dependencies
28
28
 
29
- Install via npm:
29
+ ## πŸ“Ί [Demo](https://jaeungkim.com/gantt-chart)
30
30
 
31
- ```sh
32
- npm install @jaeungkim/gantt-chart
33
- ```
31
+ ## πŸš€ Getting Started
34
32
 
35
- Or with yarn:
33
+ ### Installation
36
34
 
37
- ```sh
35
+ ```bash
36
+ npm install @jaeungkim/gantt-chart
37
+ # or
38
38
  yarn add @jaeungkim/gantt-chart
39
39
  ```
40
40
 
41
- ---
42
-
43
- ## πŸ›  Usage
44
-
45
- Basic example to integrate **React Gantt Chart** into your project:
41
+ ### Basic Usage
46
42
 
47
43
  ```tsx
48
- import React from "react";
49
- import GanttChart from "@jaeungkim/gantt-chart";
50
-
51
- const tasks = [
52
- { id: 1, name: "Task 1", start: "2024-03-01", end: "2024-03-05", progress: 50 },
53
- { id: 2, name: "Task 2", start: "2024-03-06", end: "2024-03-10", progress: 30 }
44
+ import { ReactGanttChart } from '@jaeungkim/gantt-chart';
45
+ import type { Task } from '@jaeungkim/gantt-chart';
46
+
47
+ const tasks: Task[] = [
48
+ {
49
+ id: '1',
50
+ name: 'Project Kickoff',
51
+ startDate: '2024-06-01T09:00:00Z',
52
+ endDate: '2024-06-03T17:00:00Z',
53
+ parentId: null,
54
+ sequence: '1',
55
+ dependencies: [],
56
+ },
57
+ {
58
+ id: '2',
59
+ name: 'Requirements Gathering',
60
+ startDate: '2024-06-04T09:00:00Z',
61
+ endDate: '2024-06-10T17:00:00Z',
62
+ parentId: null,
63
+ sequence: '2',
64
+ dependencies: [{ targetId: '1', type: 'FS' }],
65
+ },
54
66
  ];
55
67
 
56
68
  export default function App() {
57
69
  return (
58
- <div style={{ width: "100%", height: "500px" }}>
59
- <GanttChart tasks={tasks} />
60
- </div>
70
+ <ReactGanttChart
71
+ tasks={tasks}
72
+ height="100vh"
73
+ width="100%"
74
+ theme="system"
75
+ defaultScale="month"
76
+ onTasksChange={(updated) => console.log('Tasks updated:', updated)}
77
+ />
61
78
  );
62
79
  }
63
80
  ```
64
81
 
65
- ---
66
-
67
- ## 🎨 Customization
68
-
69
- ### **Theming with TailwindCSS**
70
-
71
- You can apply custom styles using TailwindCSS or standard CSS:
72
-
73
- ```css
74
- .gantt-container {
75
- background-color: #f8f9fa;
76
- }
77
- ```
78
-
79
- ### **Custom Task Styling**
80
-
81
- You can pass a `taskRenderer` function to customize task appearance:
82
-
83
- ```tsx
84
- <GanttChart
85
- tasks={tasks}
86
- taskRenderer={(task) => (
87
- <div style={{ background: task.progress > 50 ? "#4caf50" : "#ff9800" }}>
88
- {task.name}
89
- </div>
90
- )}
91
- />
92
- ```
93
-
94
- ---
82
+ ## Props
95
83
 
96
- ## πŸ“‘ API & Props
84
+ | Prop | Type | Default | Description |
85
+ |------|------|---------|-------------|
86
+ | `tasks` | `Task[]` | `[]` | Array of task objects to render |
87
+ | `onTasksChange` | `(tasks: Task[]) => void` | - | Callback when tasks are moved or resized |
88
+ | `height` | `number \| string` | `600` | Chart height (px or CSS value) |
89
+ | `width` | `number \| string` | `"100%"` | Chart width (px or CSS value) |
90
+ | `theme` | `"light" \| "dark" \| "system"` | - | Theme mode |
91
+ | `defaultScale` | `"day" \| "week" \| "month" \| "year"` | `"month"` | Initial timeline scale |
92
+ | `className` | `string` | - | Additional CSS class for the container |
97
93
 
98
- | Prop | Type | Description |
99
- |-------------|-----------|--------------------------------------|
100
- | `tasks` | `Task[]` | Array of tasks for the Gantt chart |
101
- | `onTaskClick` | `function` | Callback when a task is clicked |
102
- | `zoomLevel` | `number` | Adjust the zoom level (1-5) |
103
- | `taskRenderer` | `function` | Custom render function for tasks |
94
+ ## Task Format
104
95
 
105
- ### **Task Object Structure**
96
+ All dates must be in **UTC ISO string format**: `"2024-06-01T09:00:00Z"`
106
97
 
107
98
  ```ts
108
99
  interface Task {
109
- id: number;
100
+ id: string;
110
101
  name: string;
111
- start: string;
112
- end: string;
113
- progress: number;
114
- dependencies?: number[];
102
+ startDate: string; // UTC ISO string
103
+ endDate: string; // UTC ISO string
104
+ parentId: string | null;
105
+ sequence: string;
106
+ dependencies?: TaskDependency[];
115
107
  }
116
- ```
117
-
118
- ---
119
108
 
120
- ## ⚑ Performance Optimizations
121
- - **Virtualized Rendering** – Uses `react-window` for handling large datasets efficiently.
122
- - **Zustand for State Management** – Avoids unnecessary re-renders.
123
- - **Code Splitting** – Load components lazily with `React.lazy()` and `Suspense`.
109
+ interface TaskDependency {
110
+ targetId: string;
111
+ type: DependencyType;
112
+ }
124
113
 
125
- ---
114
+ type DependencyType = 'FS' | 'SS' | 'FF' | 'SF';
115
+ // FS = Finish-to-Start
116
+ // SS = Start-to-Start
117
+ // FF = Finish-to-Finish
118
+ // SF = Start-to-Finish
119
+ ```
126
120
 
127
- ## πŸ›  Contributing
128
- We welcome contributions! To get started:
121
+ ## Timeline Scales
129
122
 
130
- 1. **Fork the repo** and clone it locally:
131
- ```sh
132
- git clone https://github.com/your-username/@jaeungkim/gantt-chart.git
133
- ```
134
- 2. **Install dependencies:**
135
- ```sh
136
- npm install
137
- ```
138
- 3. **Run the dev server:**
139
- ```sh
140
- npm run dev
141
- ```
142
- 4. **Submit a pull request!** πŸŽ‰
123
+ | Scale | Header Label | Tick Unit | Drag Step |
124
+ |-------|-------------|-----------|-----------|
125
+ | `day` | Day | Hour | 1 hour |
126
+ | `week` | Week | Day | 6 hours |
127
+ | `month` | Month | Day | 1 day |
128
+ | `year` | Year | Month | 7 days |
143
129
 
144
- ---
130
+ Switch scales using the dropdown at the top-right of the chart.
145
131
 
146
- ## ❓ FAQ
147
- ### **1. How do I handle large datasets?**
148
- Use the `react-window` library for virtualization.
132
+ ## Theming
149
133
 
150
- ### **2. Can I add task dependencies?**
151
- Yes! Provide an array of `dependencies` for each task.
134
+ The chart supports three theme modes:
152
135
 
153
- ### **3. Does this support dark mode?**
154
- Yes, you can customize it with CSS or Tailwind.
136
+ - **`light`** - Light background with dark text
137
+ - **`dark`** - Dark background with light text
138
+ - **`system`** - Follows system preference (uses `prefers-color-scheme`)
155
139
 
156
- ---
140
+ ```tsx
141
+ <ReactGanttChart theme="dark" ... />
142
+ ```
157
143
 
158
- ## πŸ“œ License
159
- This project is licensed under the **MIT License** – feel free to use and modify it as needed.
144
+ ## Roadmap
160
145
 
161
- ---
146
+ - [ ] Left sidebar for task names
147
+ - [ ] Right sidebar for task details
148
+ - [ ] Collapsible parent-child rows
149
+ - [ ] Inline editing for task names
150
+ - [ ] Export to PNG/SVG
151
+ - [ ] Custom bar colors
162
152
 
163
- ## 🌟 Support & Community
164
- - **GitHub Issues** – Report bugs or request features [here](https://github.com/your-username/@jaeungkim/gantt-chart/issues).
165
- - **Discussions** – Join the community and share ideas.
153
+ ## 🀝 Contributing
166
154
 
167
- If you find this project useful, please ⭐ star the repo and contribute!
155
+ Pull requests are welcome!
156
+ If you find bugs or have suggestions, feel free to open an issue or contribute directly.
168
157
 
169
- ---
158
+ ## πŸ“„ License
170
159
 
171
- **πŸš€ Build better project timelines with React Gantt Chart!**
172
- -->
160
+ MIT Β© [jaeungkim](https://github.com/jaeungkim)
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap";:root{--background: #ffffff;--foreground: #333333;--muted: #f5f5f5;--muted-foreground: #999999;--border: #f0f0f0;--bar-bg: #f0f0f0;--bar-text: #333333;--today: #999999;--arrow: #c0c0c0}.dark,[data-theme=dark]{--background: #1a1a1a;--foreground: #e5e5e5;--muted: #252525;--muted-foreground: #888888;--border: #2a2a2a;--bar-bg: #333333;--bar-text: #e5e5e5;--today: #e5e5e5;--arrow: #555555}.gantt-container{position:relative;overflow:auto;background:var(--background);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:14px;line-height:1.5;color:var(--foreground);-webkit-font-smoothing:antialiased}.gantt-inner{width:100%;height:100%;overflow:hidden;background:var(--background)}.gantt-section{position:relative;display:flex;flex-direction:column;width:100%;height:100%}.gantt-scale-selector{position:absolute;top:10px;right:16px;z-index:50}.gantt-scale-select{height:28px;padding:0 28px 0 12px;font-family:inherit;font-size:13px;font-weight:500;border:1px solid var(--border);border-radius:6px;background-color:var(--background);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center;color:var(--foreground);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gantt-scale-select:hover{border-color:var(--muted-foreground)}.gantt-scale-select:focus{outline:none;border-color:var(--foreground)}.gantt-list{width:100%;height:100%;overflow:auto}.gantt-list::-webkit-scrollbar{width:8px;height:8px}.gantt-list::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px}.gantt-content{position:relative}.gantt-task-row{position:absolute;top:0;left:0;display:flex;width:100%;align-items:center;border-bottom:1px solid var(--border)}.gantt-header{position:sticky;top:0;z-index:30;background:var(--background);border-bottom:1px solid var(--border)}.gantt-header-content{display:flex;flex-direction:column}.gantt-top-header{position:relative;display:flex;height:40px}.gantt-top-groups{display:flex}.gantt-top-group{display:flex;align-items:center;padding:0 16px;font-size:14px;font-weight:600;background:var(--background);color:var(--foreground);z-index:40}.gantt-top-group.sticky{position:sticky;left:0}.gantt-top-group-label{margin:0;padding:0;white-space:nowrap}.gantt-bottom-row{display:flex;height:32px}.gantt-bottom-cell{display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:500;color:var(--muted-foreground)}.gantt-task-bar{position:relative;display:flex;align-items:center;background:var(--bar-bg);border-radius:6px;-webkit-user-select:none;user-select:none;cursor:grab;transition:opacity .15s ease}.gantt-task-bar:hover{opacity:.85}.gantt-task-bar:active,.gantt-task-bar.dragging{cursor:grabbing;opacity:.7}.gantt-task-name{flex:1;padding:0 10px;font-family:inherit;font-size:12px;font-weight:500;color:var(--bar-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.gantt-today-marker{position:absolute;top:0;width:1px;background:var(--today);z-index:15;pointer-events:none}.gantt-today-marker:before{content:"";position:absolute;top:-4px;left:-3px;width:7px;height:7px;background:var(--today);border-radius:50%}.gantt-today-label{display:none}.gantt-dependency-arrows{position:absolute;top:0;left:0;width:100%;pointer-events:none;z-index:5}.gantt-dependency-arrow{stroke:var(--arrow);stroke-width:1;fill:none}.gantt-dependency-arrow-head{fill:var(--arrow);stroke:none}.gantt-bar-tooltip{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);z-index:100;padding:6px 10px;background:var(--foreground);color:var(--background);border-radius:4px;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:11px;font-weight:500;white-space:nowrap;box-shadow:0 2px 8px #0000001f;pointer-events:none}.gantt-bar-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:4px solid transparent;border-top-color:var(--foreground)}@media (max-width: 768px){.gantt-scale-select{height:26px;font-size:12px}.gantt-top-group{font-size:12px}.gantt-bottom-cell,.gantt-task-name{font-size:11px}}
package/dist/index.cjs.js CHANGED
@@ -1,31 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react");function it(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(s,r,o.get?o:{enumerable:!0,get:()=>n[r]})}}return s.default=n,Object.freeze(s)}const Ae=it(C);function ne(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var De={exports:{}},$e={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var qe;function ut(){if(qe)return $e;qe=1;var n=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function r(o,i,e){var l=null;if(e!==void 0&&(l=""+e),i.key!==void 0&&(l=""+i.key),"key"in i){e={};for(var u in i)u!=="key"&&(e[u]=i[u])}else e=i;return i=e.ref,{$$typeof:n,type:o,key:l,ref:i!==void 0?i:null,props:e}}return $e.Fragment=s,$e.jsx=r,$e.jsxs=r,$e}var ge={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var We;function ct(){return We||(We=1,process.env.NODE_ENV!=="production"&&function(){function n(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===x?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case L:return"Portal";case N:return"Profiler";case _:return"StrictMode";case G:return"Suspense";case ee:return"SuspenseList"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case d:return(t.displayName||"Context")+".Provider";case $:return(t._context.displayName||"Context")+".Consumer";case I:var b=t.render;return t=t.displayName,t||(t=b.displayName||b.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return b=t.displayName||null,b!==null?b:n(t.type)||"Memo";case D:b=t._payload,t=t._init;try{return n(t(b))}catch{}}return null}function s(t){return""+t}function r(t){try{s(t);var b=!1}catch{b=!0}if(b){b=console;var w=b.error,W=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return w.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",W),s(t)}}function o(){}function i(){if(B===0){J=console.log,se=console.info,re=console.warn,ce=console.error,ae=console.group,X=console.groupCollapsed,te=console.groupEnd;var t={configurable:!0,enumerable:!0,value:o,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}B++}function e(){if(B--,B===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:A({},t,{value:J}),info:A({},t,{value:se}),warn:A({},t,{value:re}),error:A({},t,{value:ce}),group:A({},t,{value:ae}),groupCollapsed:A({},t,{value:X}),groupEnd:A({},t,{value:te})})}0>B&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function l(t){if(oe===void 0)try{throw Error()}catch(w){var b=w.stack.trim().match(/\n( *(at )?)/);oe=b&&b[1]||"",le=-1<w.stack.indexOf(`
18
- at`)?" (<anonymous>)":-1<w.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+oe+t+le}function u(t,b){if(!t||Le)return"";var w=je.get(t);if(w!==void 0)return w;Le=!0,w=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var W=null;W=R.H,R.H=null,i();try{var V={DetermineComponentFrameRoot:function(){try{if(b){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ue){var ye=ue}Reflect.construct(t,[],de)}else{try{de.call()}catch(ue){ye=ue}t.call(de.prototype)}}else{try{throw Error()}catch(ue){ye=ue}(de=t())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ue){if(ue&&ye&&typeof ue.stack=="string")return[ue.stack,ye.stack]}return[null,null]}};V.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var z=Object.getOwnPropertyDescriptor(V.DetermineComponentFrameRoot,"name");z&&z.configurable&&Object.defineProperty(V.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var P=V.DetermineComponentFrameRoot(),ie=P[0],pe=P[1];if(ie&&pe){var Q=ie.split(`
20
- `),fe=pe.split(`
21
- `);for(P=z=0;z<Q.length&&!Q[z].includes("DetermineComponentFrameRoot");)z++;for(;P<fe.length&&!fe[P].includes("DetermineComponentFrameRoot");)P++;if(z===Q.length||P===fe.length)for(z=Q.length-1,P=fe.length-1;1<=z&&0<=P&&Q[z]!==fe[P];)P--;for(;1<=z&&0<=P;z--,P--)if(Q[z]!==fe[P]){if(z!==1||P!==1)do if(z--,P--,0>P||Q[z]!==fe[P]){var me=`
22
- `+Q[z].replace(" at new "," at ");return t.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",t.displayName)),typeof t=="function"&&je.set(t,me),me}while(1<=z&&0<=P);break}}}finally{Le=!1,R.H=W,e(),Error.prepareStackTrace=w}return Q=(Q=t?t.displayName||t.name:"")?l(Q):"",typeof t=="function"&&je.set(t,Q),Q}function p(t){if(t==null)return"";if(typeof t=="function"){var b=t.prototype;return u(t,!(!b||!b.isReactComponent))}if(typeof t=="string")return l(t);switch(t){case G:return l("Suspense");case ee:return l("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case I:return t=u(t.render,!1),t;case O:return p(t.type);case D:b=t._payload,t=t._init;try{return p(t(b))}catch{}}return""}function m(){var t=R.A;return t===null?null:t.getOwner()}function g(t){if(F.call(t,"key")){var b=Object.getOwnPropertyDescriptor(t,"key").get;if(b&&b.isReactWarning)return!1}return t.key!==void 0}function a(t,b){function w(){Ze||(Ze=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",b))}w.isReactWarning=!0,Object.defineProperty(t,"key",{get:w,configurable:!0})}function c(){var t=n(this.type);return Pe[t]||(Pe[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function y(t,b,w,W,V,z){return w=z.ref,t={$$typeof:Z,type:t,key:b,props:z,_owner:V},(w!==void 0?w:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:c}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function h(t,b,w,W,V,z){if(typeof t=="string"||typeof t=="function"||t===E||t===N||t===_||t===G||t===ee||t===v||typeof t=="object"&&t!==null&&(t.$$typeof===D||t.$$typeof===O||t.$$typeof===d||t.$$typeof===$||t.$$typeof===I||t.$$typeof===H||t.getModuleId!==void 0)){var P=b.children;if(P!==void 0)if(W)if(Y(P)){for(W=0;W<P.length;W++)f(P[W],t);Object.freeze&&Object.freeze(P)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(P,t)}else P="",(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(P+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),t===null?W="null":Y(t)?W="array":t!==void 0&&t.$$typeof===Z?(W="<"+(n(t.type)||"Unknown")+" />",P=" Did you accidentally export a JSX literal instead of a component?"):W=typeof t,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",W,P);if(F.call(b,"key")){P=n(t);var ie=Object.keys(b).filter(function(Q){return Q!=="key"});W=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",_e[P+W]||(ie=0<ie.length?"{"+ie.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
23
- let props = %s;
24
- <%s {...props} />
25
- React keys must be passed directly to JSX without using spread:
26
- let props = %s;
27
- <%s key={someKey} {...props} />`,W,P,ie,P),_e[P+W]=!0)}if(P=null,w!==void 0&&(r(w),P=""+w),g(b)&&(r(b.key),P=""+b.key),"key"in b){w={};for(var pe in b)pe!=="key"&&(w[pe]=b[pe])}else w=b;return P&&a(w,typeof t=="function"?t.displayName||t.name||"Unknown":t),y(t,P,z,V,m(),w)}function f(t,b){if(typeof t=="object"&&t&&t.$$typeof!==ot){if(Y(t))for(var w=0;w<t.length;w++){var W=t[w];S(W)&&k(W,b)}else if(S(t))t._store&&(t._store.validated=1);else if(t===null||typeof t!="object"?w=null:(w=T&&t[T]||t["@@iterator"],w=typeof w=="function"?w:null),typeof w=="function"&&w!==t.entries&&(w=w.call(t),w!==t))for(;!(t=w.next()).done;)S(t.value)&&k(t.value,b)}}function S(t){return typeof t=="object"&&t!==null&&t.$$typeof===Z}function k(t,b){if(t._store&&!t._store.validated&&t.key==null&&(t._store.validated=1,b=j(b),!Ce[b])){Ce[b]=!0;var w="";t&&t._owner!=null&&t._owner!==m()&&(w=null,typeof t._owner.tag=="number"?w=n(t._owner.type):typeof t._owner.name=="string"&&(w=t._owner.name),w=" It was passed a child from "+w+".");var W=R.getCurrentStack;R.getCurrentStack=function(){var V=p(t.type);return W&&(V+=W()||""),V},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',b,w),R.getCurrentStack=W}}function j(t){var b="",w=m();return w&&(w=n(w.type))&&(b=`
28
-
29
- Check the render method of \``+w+"`."),b||(t=n(t))&&(b=`
30
-
31
- Check the top-level render call using <`+t+">."),b}var M=C,Z=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),d=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),T=Symbol.iterator,x=Symbol.for("react.client.reference"),R=M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,A=Object.assign,H=Symbol.for("react.client.reference"),Y=Array.isArray,B=0,J,se,re,ce,ae,X,te;o.__reactDisabledLog=!0;var oe,le,Le=!1,je=new(typeof WeakMap=="function"?WeakMap:Map),ot=Symbol.for("react.client.reference"),Ze,Pe={},_e={},Ce={};ge.Fragment=E,ge.jsx=function(t,b,w,W,V){return h(t,b,w,!1,W,V)},ge.jsxs=function(t,b,w,W,V){return h(t,b,w,!0,W,V)}}()),ge}var Ne;function dt(){return Ne||(Ne=1,process.env.NODE_ENV==="production"?De.exports=ut():De.exports=ct()),De.exports}var q=dt();const at=2.375*16,Ue=3,K={day:{labelUnit:"day",tickUnit:"hour",unitPerTick:1,dragStepUnit:"minute",dragStepAmount:15,basePxPerDragStep:16,formatTickLabel:n=>n.format("h A"),formatHeaderLabel:n=>n.format("MMM D")},week:{labelUnit:"week",tickUnit:"day",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:6,basePxPerDragStep:32,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("MMM")},month:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:64,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("MMM YYYY")},year:{labelUnit:"year",tickUnit:"day",unitPerTick:7,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:16,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("YYYY")}};var Se={exports:{}},lt=Se.exports,He;function ft(){return He||(He=1,function(n,s){(function(r,o){n.exports=o()})(lt,function(){var r=1e3,o=6e4,i=36e5,e="millisecond",l="second",u="minute",p="hour",m="day",g="week",a="month",c="quarter",y="year",h="date",f="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,j={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var D=["th","st","nd","rd"],v=O%100;return"["+O+(D[(v-20)%10]||D[v]||D[0])+"]"}},M=function(O,D,v){var T=String(O);return!T||T.length>=D?O:""+Array(D+1-T.length).join(v)+O},Z={s:M,z:function(O){var D=-O.utcOffset(),v=Math.abs(D),T=Math.floor(v/60),x=v%60;return(D<=0?"+":"-")+M(T,2,"0")+":"+M(x,2,"0")},m:function O(D,v){if(D.date()<v.date())return-O(v,D);var T=12*(v.year()-D.year())+(v.month()-D.month()),x=D.clone().add(T,a),R=v-x<0,F=D.clone().add(T+(R?-1:1),a);return+(-(T+(v-x)/(R?x-F:F-x))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:a,y,w:g,d:m,D:h,h:p,m:u,s:l,ms:e,Q:c}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},L="en",E={};E[L]=j;var _="$isDayjsObject",N=function(O){return O instanceof G||!(!O||!O[_])},$=function O(D,v,T){var x;if(!D)return L;if(typeof D=="string"){var R=D.toLowerCase();E[R]&&(x=R),v&&(E[R]=v,x=R);var F=D.split("-");if(!x&&F.length>1)return O(F[0])}else{var A=D.name;E[A]=D,x=A}return!T&&x&&(L=x),x||!T&&L},d=function(O,D){if(N(O))return O.clone();var v=typeof D=="object"?D:{};return v.date=O,v.args=arguments,new G(v)},I=Z;I.l=$,I.i=N,I.w=function(O,D){return d(O,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var G=function(){function O(v){this.$L=$(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[_]=!0}var D=O.prototype;return D.parse=function(v){this.$d=function(T){var x=T.date,R=T.utc;if(x===null)return new Date(NaN);if(I.u(x))return new Date;if(x instanceof Date)return new Date(x);if(typeof x=="string"&&!/Z$/i.test(x)){var F=x.match(S);if(F){var A=F[2]-1||0,H=(F[7]||"0").substring(0,3);return R?new Date(Date.UTC(F[1],A,F[3]||1,F[4]||0,F[5]||0,F[6]||0,H)):new Date(F[1],A,F[3]||1,F[4]||0,F[5]||0,F[6]||0,H)}}return new Date(x)}(v),this.init()},D.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},D.$utils=function(){return I},D.isValid=function(){return this.$d.toString()!==f},D.isSame=function(v,T){var x=d(v);return this.startOf(T)<=x&&x<=this.endOf(T)},D.isAfter=function(v,T){return d(v)<this.startOf(T)},D.isBefore=function(v,T){return this.endOf(T)<d(v)},D.$g=function(v,T,x){return I.u(v)?this[T]:this.set(x,v)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(v,T){var x=this,R=!!I.u(T)||T,F=I.p(v),A=function(ae,X){var te=I.w(x.$u?Date.UTC(x.$y,X,ae):new Date(x.$y,X,ae),x);return R?te:te.endOf(m)},H=function(ae,X){return I.w(x.toDate()[ae].apply(x.toDate("s"),(R?[0,0,0,0]:[23,59,59,999]).slice(X)),x)},Y=this.$W,B=this.$M,J=this.$D,se="set"+(this.$u?"UTC":"");switch(F){case y:return R?A(1,0):A(31,11);case a:return R?A(1,B):A(0,B+1);case g:var re=this.$locale().weekStart||0,ce=(Y<re?Y+7:Y)-re;return A(R?J-ce:J+(6-ce),B);case m:case h:return H(se+"Hours",0);case p:return H(se+"Minutes",1);case u:return H(se+"Seconds",2);case l:return H(se+"Milliseconds",3);default:return this.clone()}},D.endOf=function(v){return this.startOf(v,!1)},D.$set=function(v,T){var x,R=I.p(v),F="set"+(this.$u?"UTC":""),A=(x={},x[m]=F+"Date",x[h]=F+"Date",x[a]=F+"Month",x[y]=F+"FullYear",x[p]=F+"Hours",x[u]=F+"Minutes",x[l]=F+"Seconds",x[e]=F+"Milliseconds",x)[R],H=R===m?this.$D+(T-this.$W):T;if(R===a||R===y){var Y=this.clone().set(h,1);Y.$d[A](H),Y.init(),this.$d=Y.set(h,Math.min(this.$D,Y.daysInMonth())).$d}else A&&this.$d[A](H);return this.init(),this},D.set=function(v,T){return this.clone().$set(v,T)},D.get=function(v){return this[I.p(v)]()},D.add=function(v,T){var x,R=this;v=Number(v);var F=I.p(T),A=function(B){var J=d(R);return I.w(J.date(J.date()+Math.round(B*v)),R)};if(F===a)return this.set(a,this.$M+v);if(F===y)return this.set(y,this.$y+v);if(F===m)return A(1);if(F===g)return A(7);var H=(x={},x[u]=o,x[p]=i,x[l]=r,x)[F]||1,Y=this.$d.getTime()+v*H;return I.w(Y,this)},D.subtract=function(v,T){return this.add(-1*v,T)},D.format=function(v){var T=this,x=this.$locale();if(!this.isValid())return x.invalidDate||f;var R=v||"YYYY-MM-DDTHH:mm:ssZ",F=I.z(this),A=this.$H,H=this.$m,Y=this.$M,B=x.weekdays,J=x.months,se=x.meridiem,re=function(X,te,oe,le){return X&&(X[te]||X(T,R))||oe[te].slice(0,le)},ce=function(X){return I.s(A%12||12,X,"0")},ae=se||function(X,te,oe){var le=X<12?"AM":"PM";return oe?le.toLowerCase():le};return R.replace(k,function(X,te){return te||function(oe){switch(oe){case"YY":return String(T.$y).slice(-2);case"YYYY":return I.s(T.$y,4,"0");case"M":return Y+1;case"MM":return I.s(Y+1,2,"0");case"MMM":return re(x.monthsShort,Y,J,3);case"MMMM":return re(J,Y);case"D":return T.$D;case"DD":return I.s(T.$D,2,"0");case"d":return String(T.$W);case"dd":return re(x.weekdaysMin,T.$W,B,2);case"ddd":return re(x.weekdaysShort,T.$W,B,3);case"dddd":return B[T.$W];case"H":return String(A);case"HH":return I.s(A,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return ae(A,H,!0);case"A":return ae(A,H,!1);case"m":return String(H);case"mm":return I.s(H,2,"0");case"s":return String(T.$s);case"ss":return I.s(T.$s,2,"0");case"SSS":return I.s(T.$ms,3,"0");case"Z":return F}return null}(X)||F.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(v,T,x){var R,F=this,A=I.p(T),H=d(v),Y=(H.utcOffset()-this.utcOffset())*o,B=this-H,J=function(){return I.m(F,H)};switch(A){case y:R=J()/12;break;case a:R=J();break;case c:R=J()/3;break;case g:R=(B-Y)/6048e5;break;case m:R=(B-Y)/864e5;break;case p:R=B/i;break;case u:R=B/o;break;case l:R=B/r;break;default:R=B}return x?R:I.a(R)},D.daysInMonth=function(){return this.endOf(a).$D},D.$locale=function(){return E[this.$L]},D.locale=function(v,T){if(!v)return this.$L;var x=this.clone(),R=$(v,T,!0);return R&&(x.$L=R),x},D.clone=function(){return I.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},O}(),ee=G.prototype;return d.prototype=ee,[["$ms",e],["$s",l],["$m",u],["$H",p],["$W",m],["$M",a],["$y",y],["$D",h]].forEach(function(O){ee[O[1]]=function(D){return this.$g(D,O[0],O[1])}}),d.extend=function(O,D){return O.$i||(O(D,G,d),O.$i=!0),d},d.locale=$,d.isDayjs=N,d.unix=function(O){return d(1e3*O)},d.en=E[L],d.Ls=E,d.p={},d})}(Se)),Se.exports}var pt=ft();const U=ne(pt);function ht(n,s,r,o){if(!r.length)return{barMarginLeftAmount:0,barWidthSize:0};const{tickUnit:i,unitPerTick:e}=K[o],l=r.reduce((f,S)=>f+S.widthPx,0),u=r[0].startDate,p=r[r.length-1].startDate,m=U(p).add(e,i).diff(u),g=l/m,a=n.diff(u),c=s.diff(u),y=a*g,h=Math.max(c-a,1)*g;return{barMarginLeftAmount:y,barWidthSize:h}}function mt(n){let s=1/0,r=-1/0;for(const{startDate:o,endDate:i}of Object.values(n)){const e=U(o).valueOf(),l=U(i).valueOf();Number.isNaN(e)||(s=Math.min(s,e)),Number.isNaN(l)||(r=Math.max(r,l))}return{minDate:U(s),maxDate:U(r)}}function $t(n,s,r){const{tickUnit:o,unitPerTick:i}=K[r];return{paddedMinDate:n.subtract(Ue*i,o),paddedMaxDate:s.add(Ue*i,o)}}function gt(n,s,r){const{tickUnit:o,unitPerTick:i,basePxPerDragStep:e,dragStepUnit:l,dragStepAmount:u}=K[r],p=[];let m=n.startOf(o);for(;m.isBefore(s);){const g=U(m).add(i,o).diff(m,l)/u;p.push({startDate:m,widthPx:g*e}),m=m.add(i,o)}return p}function st(n,s){const{labelUnit:r,formatHeaderLabel:o}=K[s],i=[];let e=null,l="",u=0,p=null;return n.forEach((m,g)=>{const a=m.startDate.startOf(r),c=a.valueOf(),y=(o==null?void 0:o(a))??a.format();c===e?u+=m.widthPx:(e!==null&&i.push({label:l,widthPx:u,startDate:p}),e=c,l=y,u=m.widthPx,p=a),g===n.length-1&&i.push({label:l,widthPx:u,startDate:p})}),i}function vt(n,s,r,o,i,e){const{minDate:l,maxDate:u}=mt(n);r(l),o(u);const{paddedMinDate:p,paddedMaxDate:m}=$t(l,u,s),g=gt(p,m,s),a=st(g,s);i(g),e(a)}const yt=({bottomRowCells:n,selectedScale:s,scrollRef:r})=>{var g;const o=K[s],[i,e]=C.useState(0),l=C.useMemo(()=>st(n,s),[n,s]),u=C.useMemo(()=>{const a=[];for(const c of l){const y=a[a.length-1];y&&y.label===c.label?y.widthPx+=c.widthPx:a.push({...c})}return a},[l]),p=C.useMemo(()=>{let a=0;return u.map(c=>{const y={...c,left:a};return a+=c.widthPx,y})},[u]);C.useEffect(()=>{const a=r.current;if(!a)return;const c=()=>{const y=a.scrollLeft;for(let h=p.length-1;h>=0;h--)if(y>=p[h].left){e(h);break}};return a.addEventListener("scroll",c),c(),()=>a.removeEventListener("scroll",c)},[p]);const m=((g=p[i])==null?void 0:g.label)??"";return q.jsx("div",{style:{position:"sticky",top:0,zIndex:30,backgroundColor:"#F0F1F2"},children:q.jsxs("div",{style:{display:"flex",minWidth:"max-content",flexDirection:"column"},children:[q.jsxs("div",{style:{position:"relative",display:"flex",height:"32px"},children:[q.jsx("div",{style:{position:"sticky",left:0,zIndex:40,display:"flex",width:"96px",flexShrink:0,alignItems:"center",justifyContent:"center",backgroundColor:"#F0F1F2",fontSize:"0.875rem",fontWeight:"bold"},children:m}),q.jsx("div",{style:{display:"flex"},children:p.map((a,c)=>q.jsx("div",{style:{padding:"8px 16px",fontSize:"0.875rem",fontWeight:"bold",textAlign:"left",width:`${a.widthPx}px`,backgroundColor:"#F0F1F2"},children:q.jsx("p",{style:{margin:0,padding:"0 16px"},children:c===0?"":a.label})},c))})]}),q.jsx("div",{style:{borderTop:"1px solid #D6D6D8",display:"flex"},children:n.map((a,c)=>{var h;const y=((h=o.formatTickLabel)==null?void 0:h.call(o,a.startDate))||"";return q.jsx("div",{style:{position:"relative",padding:"4px",textAlign:"center",fontSize:"0.75rem",width:`${a.widthPx}px`},children:y},c)})})]})})};var xe={exports:{}},Dt=xe.exports,ze;function St(){return ze||(ze=1,function(n,s){(function(r,o){n.exports=o()})(Dt,function(){return function(r,o,i){o.prototype.isBetween=function(e,l,u,p){var m=i(e),g=i(l),a=(p=p||"()")[0]==="(",c=p[1]===")";return(a?this.isAfter(m,u):!this.isBefore(m,u))&&(c?this.isBefore(g,u):!this.isAfter(g,u))||(a?this.isBefore(m,u):!this.isAfter(m,u))&&(c?this.isAfter(g,u):!this.isBefore(g,u))}}})}(xe)),xe.exports}var xt=St();const bt=ne(xt);var be={exports:{}},wt=be.exports,Ye;function Tt(){return Ye||(Ye=1,function(n,s){(function(r,o){n.exports=o()})(wt,function(){var r="day";return function(o,i,e){var l=function(m){return m.add(4-m.isoWeekday(),r)},u=i.prototype;u.isoWeekYear=function(){return l(this).year()},u.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),r);var g,a,c,y,h=l(this),f=(g=this.isoWeekYear(),a=this.$u,c=(a?e.utc:e)().year(g).startOf("year"),y=4-c.isoWeekday(),c.isoWeekday()>4&&(y+=7),c.add(y,r));return h.diff(f,"week")+1},u.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var p=u.startOf;u.startOf=function(m,g){var a=this.$utils(),c=!!a.u(g)||g;return a.p(m)==="isoweek"?c?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):p.bind(this)(m,g)}}})}(be)),be.exports}var Et=Tt();const kt=ne(Et);var we={exports:{}},Mt=we.exports,Be;function Ot(){return Be||(Be=1,function(n,s){(function(r,o){n.exports=o()})(Mt,function(){return function(r,o){o.prototype.isSameOrAfter=function(i,e){return this.isSame(i,e)||this.isAfter(i,e)}}})}(we)),we.exports}var It=Ot();const Rt=ne(It);var Te={exports:{}},Lt=Te.exports,Ge;function jt(){return Ge||(Ge=1,function(n,s){(function(r,o){n.exports=o()})(Lt,function(){return function(r,o){o.prototype.isSameOrBefore=function(i,e){return this.isSame(i,e)||this.isBefore(i,e)}}})}(Te)),Te.exports}var Ft=jt();const Zt=ne(Ft);var Ee={exports:{}},Pt=Ee.exports,Xe;function _t(){return Xe||(Xe=1,function(n,s){(function(r,o){n.exports=o()})(Pt,function(){return function(r,o,i){o.prototype.isToday=function(){var e="YYYY-MM-DD",l=i();return this.format(e)===l.format(e)}}})}(Ee)),Ee.exports}var Ct=_t();const At=ne(Ct);var ke={exports:{}},qt=ke.exports,Ve;function Wt(){return Ve||(Ve=1,function(n,s){(function(r,o){n.exports=o()})(qt,function(){return function(r,o,i){var e=o.prototype,l=function(a){return a&&(a.indexOf?a:a.s)},u=function(a,c,y,h,f){var S=a.name?a:a.$locale(),k=l(S[c]),j=l(S[y]),M=k||j.map(function(L){return L.slice(0,h)});if(!f)return M;var Z=S.weekStart;return M.map(function(L,E){return M[(E+(Z||0))%7]})},p=function(){return i.Ls[i.locale()]},m=function(a,c){return a.formats[c]||function(y){return y.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(h,f,S){return f||S.slice(1)})}(a.formats[c.toUpperCase()])},g=function(){var a=this;return{months:function(c){return c?c.format("MMMM"):u(a,"months")},monthsShort:function(c){return c?c.format("MMM"):u(a,"monthsShort","months",3)},firstDayOfWeek:function(){return a.$locale().weekStart||0},weekdays:function(c){return c?c.format("dddd"):u(a,"weekdays")},weekdaysMin:function(c){return c?c.format("dd"):u(a,"weekdaysMin","weekdays",2)},weekdaysShort:function(c){return c?c.format("ddd"):u(a,"weekdaysShort","weekdays",3)},longDateFormat:function(c){return m(a.$locale(),c)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};e.localeData=function(){return g.bind(this)()},i.localeData=function(){var a=p();return{firstDayOfWeek:function(){return a.weekStart||0},weekdays:function(){return i.weekdays()},weekdaysShort:function(){return i.weekdaysShort()},weekdaysMin:function(){return i.weekdaysMin()},months:function(){return i.months()},monthsShort:function(){return i.monthsShort()},longDateFormat:function(c){return m(a,c)},meridiem:a.meridiem,ordinal:a.ordinal}},i.months=function(){return u(p(),"months")},i.monthsShort=function(){return u(p(),"monthsShort","months",3)},i.weekdays=function(a){return u(p(),"weekdays",null,null,a)},i.weekdaysShort=function(a){return u(p(),"weekdaysShort","weekdays",3,a)},i.weekdaysMin=function(a){return u(p(),"weekdaysMin","weekdays",2,a)}}})}(ke)),ke.exports}var Nt=Wt();const Ut=ne(Nt);var Me={exports:{}},Ht=Me.exports,Je;function zt(){return Je||(Je=1,function(n,s){(function(r,o){n.exports=o()})(Ht,function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},o={};return function(i,e,l){var u,p=function(c,y,h){h===void 0&&(h={});var f=new Date(c),S=function(k,j){j===void 0&&(j={});var M=j.timeZoneName||"short",Z=k+"|"+M,L=o[Z];return L||(L=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:k,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:M}),o[Z]=L),L}(y,h);return S.formatToParts(f)},m=function(c,y){for(var h=p(c,y),f=[],S=0;S<h.length;S+=1){var k=h[S],j=k.type,M=k.value,Z=r[j];Z>=0&&(f[Z]=parseInt(M,10))}var L=f[3],E=L===24?0:L,_=f[0]+"-"+f[1]+"-"+f[2]+" "+E+":"+f[4]+":"+f[5]+":000",N=+c;return(l.utc(_).valueOf()-(N-=N%1e3))/6e4},g=e.prototype;g.tz=function(c,y){c===void 0&&(c=u);var h,f=this.utcOffset(),S=this.toDate(),k=S.toLocaleString("en-US",{timeZone:c}),j=Math.round((S-new Date(k))/1e3/60),M=15*-Math.round(S.getTimezoneOffset()/15)-j;if(!Number(M))h=this.utcOffset(0,y);else if(h=l(k,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(M,!0),y){var Z=h.utcOffset();h=h.add(f-Z,"minute")}return h.$x.$timezone=c,h},g.offsetName=function(c){var y=this.$x.$timezone||l.tz.guess(),h=p(this.valueOf(),y,{timeZoneName:c}).find(function(f){return f.type.toLowerCase()==="timezonename"});return h&&h.value};var a=g.startOf;g.startOf=function(c,y){if(!this.$x||!this.$x.$timezone)return a.call(this,c,y);var h=l(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return a.call(h,c,y).tz(this.$x.$timezone,!0)},l.tz=function(c,y,h){var f=h&&y,S=h||y||u,k=m(+l(),S);if(typeof c!="string")return l(c).tz(S);var j=function(E,_,N){var $=E-60*_*1e3,d=m($,N);if(_===d)return[$,_];var I=m($-=60*(d-_)*1e3,N);return d===I?[$,d]:[E-60*Math.min(d,I)*1e3,Math.max(d,I)]}(l.utc(c,f).valueOf(),k,S),M=j[0],Z=j[1],L=l(M).utcOffset(Z);return L.$x.$timezone=S,L},l.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},l.tz.setDefault=function(c){u=c}}})}(Me)),Me.exports}var Yt=zt();const Bt=ne(Yt);var Oe={exports:{}},Gt=Oe.exports,Qe;function Xt(){return Qe||(Qe=1,function(n,s){(function(r,o){n.exports=o()})(Gt,function(){return function(r,o,i){i.updateLocale=function(e,l){var u=i.Ls[e];if(u)return(l?Object.keys(l):[]).forEach(function(p){u[p]=l[p]}),u}}})}(Oe)),Oe.exports}var Vt=Xt();const Jt=ne(Vt);var Ie={exports:{}},Qt=Ie.exports,Ke;function Kt(){return Ke||(Ke=1,function(n,s){(function(r,o){n.exports=o()})(Qt,function(){var r="minute",o=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(e,l,u){var p=l.prototype;u.utc=function(f){var S={date:f,utc:!0,args:arguments};return new l(S)},p.utc=function(f){var S=u(this.toDate(),{locale:this.$L,utc:!0});return f?S.add(this.utcOffset(),r):S},p.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var m=p.parse;p.parse=function(f){f.utc&&(this.$u=!0),this.$utils().u(f.$offset)||(this.$offset=f.$offset),m.call(this,f)};var g=p.init;p.init=function(){if(this.$u){var f=this.$d;this.$y=f.getUTCFullYear(),this.$M=f.getUTCMonth(),this.$D=f.getUTCDate(),this.$W=f.getUTCDay(),this.$H=f.getUTCHours(),this.$m=f.getUTCMinutes(),this.$s=f.getUTCSeconds(),this.$ms=f.getUTCMilliseconds()}else g.call(this)};var a=p.utcOffset;p.utcOffset=function(f,S){var k=this.$utils().u;if(k(f))return this.$u?0:k(this.$offset)?a.call(this):this.$offset;if(typeof f=="string"&&(f=function(L){L===void 0&&(L="");var E=L.match(o);if(!E)return null;var _=(""+E[0]).match(i)||["-",0,0],N=_[0],$=60*+_[1]+ +_[2];return $===0?0:N==="+"?$:-$}(f),f===null))return this;var j=Math.abs(f)<=16?60*f:f,M=this;if(S)return M.$offset=j,M.$u=f===0,M;if(f!==0){var Z=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(M=this.local().add(j+Z,r)).$offset=j,M.$x.$localOffset=Z}else M=this.utc();return M};var c=p.format;p.format=function(f){var S=f||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,S)},p.valueOf=function(){var f=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*f},p.isUTC=function(){return!!this.$u},p.toISOString=function(){return this.toDate().toISOString()},p.toString=function(){return this.toDate().toUTCString()};var y=p.toDate;p.toDate=function(f){return f==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():y.call(this)};var h=p.diff;p.diff=function(f,S,k){if(f&&this.$u===f.$u)return h.call(this,f,S,k);var j=this.local(),M=u(f).local();return h.call(j,M,S,k)}}})}(Ie)),Ie.exports}var en=Kt();const tn=ne(en);var Re={exports:{}},nn=Re.exports,et;function rn(){return et||(et=1,function(n,s){(function(r,o){n.exports=o()})(nn,function(){return function(r,o){o.prototype.weekday=function(i){var e=this.$locale().weekStart||0,l=this.$W,u=(l<e?l+7:l)-e;return this.$utils().u(i)?u:this.subtract(u,"day").add(i,"day")}}})}(Re)),Re.exports}var an=rn();const sn=ne(an);U.extend(sn);U.extend(At);U.extend(tn);U.extend(Bt);U.extend(Rt);U.extend(Zt);U.extend(bt);U.extend(Ut);U.extend(Jt);U.extend(kt);function on(n){return[...n].sort((s,r)=>{const o=s.sequence.split(".").map(Number),i=r.sequence.split(".").map(Number);for(let e=0;e<Math.max(o.length,i.length);e++){const l=o[e]||0,u=i[e]||0;if(l!==u)return l-u}return 0})}function un(n){return n.split(".").length-1}function Fe(n,s,r){const o=on(n);let i=0;return o.map(e=>{i++;const l=un(e.sequence),{barMarginLeftAmount:u,barWidthSize:p}=ht(U(e.startDate),U(e.endDate),s,r);return{...e,barLeft:u,barWidth:p,depth:l,order:i,originalOrder:i}})}const tt=n=>{let s;const r=new Set,o=(m,g)=>{const a=typeof m=="function"?m(s):m;if(!Object.is(a,s)){const c=s;s=g??(typeof a!="object"||a===null)?a:Object.assign({},s,a),r.forEach(y=>y(s,c))}},i=()=>s,u={setState:o,getState:i,getInitialState:()=>p,subscribe:m=>(r.add(m),()=>r.delete(m))},p=s=n(o,i,u);return u},cn=n=>n?tt(n):tt,dn=n=>n;function ln(n,s=dn){const r=C.useSyncExternalStore(n.subscribe,()=>s(n.getState()),()=>s(n.getInitialState()));return C.useDebugValue(r),r}const nt=n=>{const s=cn(n),r=o=>ln(s,o);return Object.assign(r,s),r},fn=n=>n?nt(n):nt,ve=fn((n,s)=>({rawTasks:[],transformedTasks:[],bottomRowCells:[],topHeaderGroups:[],selectedScale:"month",minDate:U(),maxDate:U(),draggingTaskMeta:null,setSelectedScale:r=>{const{rawTasks:o,bottomRowCells:i}=s(),e=Fe(o,i,r);n({selectedScale:r,transformedTasks:e})},setRawTasks:r=>{const{bottomRowCells:o,selectedScale:i}=s(),e=Fe(r,o,i);n({rawTasks:r,transformedTasks:e})},setBottomRowCells:r=>{const{rawTasks:o,selectedScale:i}=s(),e=Fe(o,r,i);n({bottomRowCells:r,transformedTasks:e})},setTopHeaderGroups:r=>n({topHeaderGroups:r}),setMinDate:r=>n({minDate:r}),setMaxDate:r=>n({maxDate:r}),setDraggingTaskMeta:r=>n({draggingTaskMeta:r}),clearDraggingTaskMeta:()=>n({draggingTaskMeta:null})})),pn=[{id:"1",name:"Project Kickoff",startDate:"2024-06-01T09:00:00Z",endDate:"2024-06-01T11:00:00Z",parentId:null,sequence:"1",dependencies:[]},{id:"2",name:"Requirement Gathering",startDate:"2024-06-02T09:00:00Z",endDate:"2024-06-05T17:00:00Z",parentId:null,sequence:"2",dependencies:[{targetId:"1",type:"FS"}]},{id:"3",name:"Stakeholder Interviews",startDate:"2024-06-02T10:00:00Z",endDate:"2024-06-03T17:00:00Z",parentId:"2",sequence:"2.1",dependencies:[{targetId:"1",type:"SF"}]},{id:"4",name:"Market Analysis",startDate:"2024-06-06T09:00:00Z",endDate:"2024-06-07T17:00:00Z",parentId:null,sequence:"3",dependencies:[{targetId:"2",type:"FS"}]},{id:"5",name:"Design System Creation",startDate:"2024-06-08T09:00:00Z",endDate:"2024-06-12T17:00:00Z",parentId:null,sequence:"4",dependencies:[{targetId:"2",type:"FS"},{targetId:"3",type:"SS"}]},{id:"6",name:"UI/UX Design",startDate:"2024-06-13T09:00:00Z",endDate:"2024-06-16T17:00:00Z",parentId:"5",sequence:"4.1",dependencies:[{targetId:"5",type:"FS"}]},{id:"7",name:"Prototyping",startDate:"2024-06-17T09:00:00Z",endDate:"2024-06-20T17:00:00Z",parentId:"6",sequence:"4.1.1",dependencies:[{targetId:"6",type:"FS"}]},{id:"8",name:"Frontend Development",startDate:"2024-06-21T09:00:00Z",endDate:"2024-06-30T17:00:00Z",parentId:null,sequence:"5",dependencies:[{targetId:"7",type:"FS"}]},{id:"9",name:"Backend Development",startDate:"2024-07-01T09:00:00Z",endDate:"2024-07-10T17:00:00Z",parentId:null,sequence:"6",dependencies:[{targetId:"7",type:"FS"}]},{id:"10",name:"API Integration",startDate:"2024-07-11T09:00:00Z",endDate:"2024-07-15T17:00:00Z",parentId:"9",sequence:"6.1",dependencies:[{targetId:"9",type:"FS"}]},{id:"11",name:"Module Development",startDate:"2024-07-16T09:00:00Z",endDate:"2024-07-20T17:00:00Z",parentId:"8",sequence:"5.1",dependencies:[{targetId:"8",type:"FS"}]},{id:"12",name:"Unit Testing",startDate:"2024-07-21T09:00:00Z",endDate:"2024-07-25T17:00:00Z",parentId:"8",sequence:"5.2",dependencies:[{targetId:"8",type:"FS"}]},{id:"13",name:"Integration Testing",startDate:"2024-07-26T09:00:00Z",endDate:"2024-07-30T17:00:00Z",parentId:"10",sequence:"6.1.1",dependencies:[{targetId:"10",type:"FS"}]},{id:"14",name:"Code Review",startDate:"2024-07-31T09:00:00Z",endDate:"2024-08-04T17:00:00Z",parentId:"10",sequence:"6.1.2",dependencies:[{targetId:"13",type:"FS"}]},{id:"15",name:"Community Feedback",startDate:"2024-08-05T09:00:00Z",endDate:"2024-08-08T17:00:00Z",parentId:null,sequence:"7",dependencies:[{targetId:"14",type:"FS"}]},{id:"16",name:"Documentation Drafting",startDate:"2024-08-09T09:00:00Z",endDate:"2024-08-12T17:00:00Z",parentId:null,sequence:"8",dependencies:[{targetId:"14",type:"FS"}]},{id:"17",name:"Documentation Finalization",startDate:"2024-08-13T09:00:00Z",endDate:"2024-08-16T17:00:00Z",parentId:"16",sequence:"8.1",dependencies:[{targetId:"16",type:"FS"}]},{id:"18",name:"Pre-release Demo",startDate:"2024-08-17T09:00:00Z",endDate:"2024-08-20T17:00:00Z",parentId:null,sequence:"9",dependencies:[{targetId:"15",type:"FS"}]},{id:"19",name:"Bug Fixing",startDate:"2024-08-21T09:00:00Z",endDate:"2024-08-25T17:00:00Z",parentId:null,sequence:"10",dependencies:[{targetId:"15",type:"FS"}]},{id:"20",name:"Release Candidate",startDate:"2024-08-26T09:00:00Z",endDate:"2024-08-30T17:00:00Z",parentId:null,sequence:"11",dependencies:[{targetId:"18",type:"FS"}]},{id:"21",name:"Final Release",startDate:"2024-08-31T09:00:00Z",endDate:"2024-09-02T17:00:00Z",parentId:null,sequence:"12",dependencies:[{targetId:"20",type:"FS"}]},{id:"22",name:"Post-release Monitoring",startDate:"2024-09-03T09:00:00Z",endDate:"2024-09-04T17:00:00Z",parentId:null,sequence:"13",dependencies:[{targetId:"21",type:"FS"}]},{id:"23",name:"Community Engagement",startDate:"2024-09-05T09:00:00Z",endDate:"2024-09-06T17:00:00Z",parentId:null,sequence:"14",dependencies:[{targetId:"21",type:"FS"}]},{id:"24",name:"Feature Iteration Planning",startDate:"2024-09-07T09:00:00Z",endDate:"2024-09-08T17:00:00Z",parentId:null,sequence:"15",dependencies:[{targetId:"22",type:"FS"}]},{id:"25",name:"Additional Module Development",startDate:"2024-09-09T09:00:00Z",endDate:"2024-09-10T17:00:00Z",parentId:"24",sequence:"15.1",dependencies:[{targetId:"24",type:"FS"}]},{id:"26",name:"Additional Testing",startDate:"2024-09-11T09:00:00Z",endDate:"2024-09-12T17:00:00Z",parentId:"25",sequence:"15.1.1",dependencies:[{targetId:"25",type:"FS"}]},{id:"27",name:"Code Refactoring",startDate:"2024-09-13T09:00:00Z",endDate:"2024-09-14T17:00:00Z",parentId:null,sequence:"16",dependencies:[{targetId:"26",type:"FS"}]},{id:"28",name:"Performance Optimization",startDate:"2024-09-15T09:00:00Z",endDate:"2024-09-16T17:00:00Z",parentId:"27",sequence:"16.1",dependencies:[{targetId:"27",type:"FS"}]},{id:"29",name:"Security Audit",startDate:"2024-09-17T09:00:00Z",endDate:"2024-09-18T17:00:00Z",parentId:null,sequence:"17",dependencies:[{targetId:"28",type:"FS"}]},{id:"30",name:"Final QA",startDate:"2024-09-19T09:00:00Z",endDate:"2024-09-20T17:00:00Z",parentId:null,sequence:"18",dependencies:[{targetId:"29",type:"FS"}]},{id:"31",name:"Launch Webinar",startDate:"2024-09-21T09:00:00Z",endDate:"2024-09-22T17:00:00Z",parentId:null,sequence:"19",dependencies:[{targetId:"21",type:"SS"}]},{id:"32",name:"Marketing Campaign",startDate:"2024-09-23T09:00:00Z",endDate:"2024-09-24T17:00:00Z",parentId:null,sequence:"20",dependencies:[{targetId:"21",type:"SF"}]},{id:"33",name:"Post-release Bug Fixing",startDate:"2024-09-25T09:00:00Z",endDate:"2024-09-26T17:00:00Z",parentId:null,sequence:"21",dependencies:[{targetId:"22",type:"SS"}]},{id:"34",name:"Version 1.1 Planning",startDate:"2024-09-27T09:00:00Z",endDate:"2024-09-28T17:00:00Z",parentId:null,sequence:"22",dependencies:[{targetId:"24",type:"FS"}]},{id:"35",name:"Feature Implementation",startDate:"2024-09-29T09:00:00Z",endDate:"2024-09-30T17:00:00Z",parentId:"34",sequence:"22.1",dependencies:[{targetId:"34",type:"FS"}]},{id:"36",name:"Beta Testing",startDate:"2024-10-01T09:00:00Z",endDate:"2024-10-02T17:00:00Z",parentId:"35",sequence:"22.1.1",dependencies:[{targetId:"35",type:"FS"}]},{id:"37",name:"Community Beta Feedback",startDate:"2024-10-03T09:00:00Z",endDate:"2024-10-04T17:00:00Z",parentId:"36",sequence:"22.1.2",dependencies:[{targetId:"36",type:"FS"}]},{id:"38",name:"Final Beta Fixes",startDate:"2024-10-05T09:00:00Z",endDate:"2024-10-06T17:00:00Z",parentId:"37",sequence:"22.1.3",dependencies:[{targetId:"37",type:"FS"}]},{id:"39",name:"Documentation Update",startDate:"2024-10-07T09:00:00Z",endDate:"2024-10-08T17:00:00Z",parentId:"17",sequence:"8.1.1",dependencies:[{targetId:"17",type:"FS"}]},{id:"40",name:"Final Release Version 1.1",startDate:"2024-10-09T09:00:00Z",endDate:"2024-10-10T17:00:00Z",parentId:null,sequence:"23",dependencies:[{targetId:"38",type:"FS"}]},{id:"41",name:"Project Retrospective",startDate:"2024-10-11T09:00:00Z",endDate:"2024-10-12T17:00:00Z",parentId:null,sequence:"24",dependencies:[{targetId:"40",type:"FS"}]}],rt=n=>Ae.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...n},Ae.createElement("path",{d:"M10.2 4L10.2 20L7.8 20L7.8 4L10.2 4ZM15 4L15 20L12.6 20L12.6 4L15 4ZM5.4 15.0999L5.4 7.8999L1.8 11.4999L5.4 15.0999ZM17.4 7.8999L17.4 15.0999L21 11.4999L17.4 7.8999Z"}));function he(n,s){const{basePxPerDragStep:r}=K[s];return Math.round(n/r)}function hn(n,s,r){const{rawTasks:o,selectedScale:i,setRawTasks:e,setDraggingTaskMeta:l,clearDraggingTaskMeta:u}=ve(),[p,m]=C.useState(s),g=C.useRef(s),a=C.useRef(null),c=C.useRef(s),y=C.useRef(n.startDate),h=C.useRef(n.endDate),f=j=>{a.current=j.clientX,c.current=s,y.current=n.startDate,h.current=n.endDate,m(s),g.current=s,l({taskId:n.id,type:"bar"}),document.addEventListener("mousemove",S),document.addEventListener("mouseup",k)},S=j=>{if(a.current===null)return;const M=j.clientX-a.current,L=he(M,i)*K[i].basePxPerDragStep,E=c.current+L;m(E),g.current=E},k=()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",k);const j=g.current-c.current,M=he(j,i),{dragStepUnit:Z,dragStepAmount:L}=K[i],E=o.map(_=>_.id===n.id?{..._,startDate:U(y.current).add(M*L,Z).toISOString(),endDate:U(h.current).add(M*L,Z).toISOString()}:_);e(E),r==null||r(E),u(),a.current=null};return{onDragStart:f,tempLeft:p}}function mn(n,s,r,o){const{rawTasks:i,selectedScale:e,setRawTasks:l,setDraggingTaskMeta:u,clearDraggingTaskMeta:p}=ve(),[m,g]=C.useState(s),[a,c]=C.useState(r),y=C.useRef(s),h=C.useRef(r),f=C.useRef(null),S=C.useRef(s),k=C.useRef(r),j=C.useRef(n.startDate),M=E=>{E.stopPropagation(),f.current=E.clientX,S.current=s,k.current=r,j.current=n.startDate,g(s),c(r),y.current=s,h.current=r,u({taskId:n.id,type:"left"}),document.addEventListener("mousemove",Z),document.addEventListener("mouseup",L)},Z=E=>{if(f.current==null)return;const _=E.clientX-f.current,$=he(_,e)*K[e].basePxPerDragStep,d=S.current+$,I=k.current-$;I<1||(g(d),c(I),y.current=d,h.current=I)},L=()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",L);const E=y.current-S.current,_=he(E,e),{dragStepUnit:N,dragStepAmount:$}=K[e],d=i.map(I=>{if(I.id!==n.id)return I;const G=U(j.current).add(_*$,N);return G.isAfter(U(I.endDate))?I:{...I,startDate:G.toISOString()}});l(d),o==null||o(d),p(),f.current=null};return{onDragStart:M,tempLeft:m,tempWidth:a}}function $n(n,s,r){const{rawTasks:o,selectedScale:i,setRawTasks:e,setDraggingTaskMeta:l,clearDraggingTaskMeta:u}=ve(),[p,m]=C.useState(s),g=C.useRef(s),a=C.useRef(null),c=C.useRef(s),y=C.useRef(n.endDate),h=k=>{k.stopPropagation(),a.current=k.clientX,c.current=s,y.current=n.endDate,m(s),g.current=s,l({taskId:n.id,type:"right"}),document.addEventListener("mousemove",f),document.addEventListener("mouseup",S)},f=k=>{if(a.current===null)return;const j=k.clientX-a.current,Z=he(j,i)*K[i].basePxPerDragStep,L=c.current+Z;L<1||(m(L),g.current=L)},S=()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",S);const k=g.current-c.current,j=he(k,i),{dragStepUnit:M,dragStepAmount:Z}=K[i],L=o.map(E=>{if(E.id!==n.id)return E;const _=U(y.current).add(j*Z,M);return _.isBefore(U(E.startDate))?E:{...E,endDate:_.toISOString()}});e(L),r==null||r(L),u(),a.current=null};return{onDragStart:h,tempWidth:p}}function gn(n,s,r,o,i){if(r<0||i<0)return`M ${s} ${r} h ${(o-s)/2}`;const e=7,l=11,u=25,p=20,m=`M ${s} ${r}`,g=o-s,a=i-r,c=Math.abs(g),y=Math.abs(a),h=i<=r,f=i>=r,S=o>=s,k=o<=s,j=c>p,M=Math.abs(g/2),Z=Math.abs(a/2);function L(){function $(){return(S||k)&&f&&!j?"downSmallHorizontal":(S||k)&&h&&!j?"upSmallHorizontal":f&&k?"downLeft":f&&S?"downRight":h&&k?"upLeft":h&&S?"upRight":""}let d=m;switch($()){case"downRight":{d+=` h ${M-e}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${a-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${M-e}`;break}case"upRight":{d+=` h ${M-e}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v -${y-e*2}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${M-e}`;break}case"downLeft":case"downSmallHorizontal":{const G=r+a/2;d+=` h ${l}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${G-r-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=` h ${g-2*l}`,d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${G-r-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${l}`;break}case"upLeft":case"upSmallHorizontal":{const G=r+a/2;d+=` h ${l}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v -${r-G-e*2}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=` h ${g-2*l}`,d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v -${r-G-e*2}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${l}`;break}default:return d}return d}function E(){let $=m;return f&&k?($+=` h ${u-l}`,$+=` a ${e} ${e} 0 0 1 ${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 1 -${e} ${e}`,$+=` h ${g-e*2}`):f&&S?($+=` h ${g+u-l}`,$+=` a ${e} ${e} 0 0 1 ${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 1 -${e} ${e}`,$+=` h -${u-l}`):h&&k?($+=` h ${u-l}`,$+=` a ${e} ${e} 0 0 0 ${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 0 -${e} -${e}`,$+=` h ${g-u+l}`):h&&S&&($+=` h ${g+u-l}`,$+=` a ${e} ${e} 0 0 0 ${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 0 -${e} -${e}`,$+=` h -${u-l}`),$}function _(){function $(){return(S||k)&&f&&!j?"downSmallHorizontal":(S||k)&&h&&!j?"upSmallHorizontal":f&&k?"downLeft":f&&S?"downRight":h&&k?"upLeft":h&&S?"upRight":""}let d=m;switch($()){case"downRight":case"downSmallHorizontal":{d+=" h -11",d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${Z-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${l*2+g}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${Z-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=" h -11";break}case"upRight":case"upSmallHorizontal":{d+=" h -11",d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v ${-(Z-e*2)}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${l*2+g}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v ${-(Z-e*2)}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=" h -11";break}case"downLeft":{d+=` h ${-M+e}`,d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${y-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=` h ${-M+e}`;break}case"upLeft":{d+=` h ${-(M-e)}`,d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v ${-(y-e*2)}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=` h ${-M+e}`;break}default:return d}return d}function N(){let $=m;return f&&k?($+=` h ${g-u}`,$+=` a ${e} ${e} 0 0 0 -${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 0 ${e} ${e}`,$+=` h ${u}`):f&&S?($+=" h -25",$+=` a ${e} ${e} 0 0 0 -${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 0 ${e} ${e}`,$+=` h ${g+u}`):h&&k?($+=` h ${g-u}`,$+=` a ${e} ${e} 0 0 1 -${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 1 ${e} -${e}`,$+=` h ${u}`):h&&S&&($+=" h -25",$+=` a ${e} ${e} 0 0 1 -${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 1 ${e} -${e}`,$+=` h ${g+u}`),$}switch(n){case"FS":return L();case"FF":return E();case"SF":return _();case"SS":return N();default:return`${m} L ${o} ${i}`}}function vn({allTasks:n,currentTask:s,onTasksChange:r}){const[o,i]=C.useState(!1),[e,l]=C.useState(!1),{onDragStart:u,tempLeft:p}=hn(s,s.barLeft,r),{onDragStart:m,tempLeft:g,tempWidth:a}=mn(s,s.barLeft,s.barWidth,r),{onDragStart:c,tempWidth:y}=$n(s,s.barWidth,r),{draggingTaskMeta:h}=ve(),f=(h==null?void 0:h.taskId)===s.id;let S=!1,k=!1,j=!1;f&&((h==null?void 0:h.type)==="left"?S=!0:(h==null?void 0:h.type)==="right"?k=!0:(h==null?void 0:h.type)==="bar"&&(j=!0));let M=s.barLeft,Z=s.barWidth;S?(M=g,Z=a):k?Z=y:j&&(M=p);const L=()=>q.jsx("button",{type:"button",onMouseDown:m,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{position:"absolute",top:0,left:"-1.15rem",width:"2rem",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"w-resize",background:"transparent",border:"none",padding:0},children:q.jsx(rt,{style:{height:"1.5rem",width:"1.5rem",fill:"#919294",opacity:o?1:0}})}),E=()=>q.jsx("button",{type:"button",onMouseDown:c,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{position:"absolute",top:0,right:"-1.15rem",width:"2rem",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"w-resize",background:"transparent",border:"none",padding:0},children:q.jsx(rt,{style:{height:"1.5rem",width:"1.5rem",fill:"#919294",opacity:e?1:0}})}),_=(s.dependencies||[]).map(N=>{const $=n.find(D=>D.id===N.targetId);if(!$)return null;const d=at,I=($.order-1)*d+d/2,G=(s.order-1)*d+d/2;let ee,O;switch(N.type){case"FS":ee=$.barLeft+$.barWidth,O=s.barLeft;break;case"SS":ee=$.barLeft,O=s.barLeft;break;case"FF":ee=$.barLeft+$.barWidth,O=s.barLeft+s.barWidth;break;case"SF":ee=$.barLeft,O=s.barLeft+s.barWidth;break;default:return console.warn(`Unknown dependency type: ${N.type}`),null}return{...N,fromX:ee,fromY:I,toX:O,toY:G}}).filter(Boolean);return q.jsxs(q.Fragment,{children:[q.jsxs("div",{role:"button",tabIndex:0,onMouseDown:u,style:{position:"relative",display:"flex",alignItems:"center",backgroundColor:"#D6D6D8",marginLeft:`${M}px`,width:`${Z}px`,height:"1rem"},children:[L(),E()]}),q.jsxs("svg",{style:{position:"absolute",top:0,left:0,zIndex:10,width:"100%",height:"100%",pointerEvents:"none"},children:[q.jsx("defs",{children:q.jsx("marker",{id:"arrowhead",markerWidth:"6",markerHeight:"6",refX:"5.25",refY:"3",orient:"auto",children:q.jsx("polygon",{points:"0 0, 6 3, 0 6",fill:"#000"})})}),_.map((N,$)=>q.jsx("path",{d:gn(N.type,N.fromX,N.fromY,N.toX,N.toY),fill:"none",markerEnd:"url(#arrowhead)",style:{stroke:"#000",strokeWidth:.75}},$))]})]})}function yn({tasks:n,onTasksChange:s,ganttHeight:r,columnWidth:o}){const[i,e]=C.useState(r||500),[l,u]=C.useState(o||1e3),[p,m]=C.useState(n||[]),g=C.useRef(null),{rawTasks:a,transformedTasks:c,selectedScale:y,setSelectedScale:h,bottomRowCells:f,topHeaderGroups:S,setRawTasks:k,setBottomRowCells:j,setTopHeaderGroups:M,setMinDate:Z,setMaxDate:L}=ve();return C.useEffect(()=>{n.length===0?m(pn):m(n)},[n]),C.useEffect(()=>{if(!p.length)return;const E=Object.fromEntries(p.map(_=>[_.id,{startDate:_.startDate,endDate:_.endDate}]));vt(E,y,Z,L,j,M)},[p,y]),C.useEffect(()=>{!f.length||!p.length||a.length===0&&k(p)},[f,p]),q.jsx("section",{style:{position:"relative",overflow:"auto",height:typeof r=="number"?`${r}px`:r,width:typeof o=="number"?`${o}px`:o,backgroundColor:"#FFF",fontFamily:"Noto Sans, sans-serif"},children:q.jsx("div",{style:{width:"100%",height:"100%",overflow:"hidden",backgroundColor:"#FFF"},children:q.jsxs("section",{style:{position:"relative",display:"flex",height:"100%",width:"100%",flexDirection:"column"},children:[q.jsx("div",{style:{position:"absolute",top:"3px",right:"16px",zIndex:50,display:"flex",justifyContent:"flex-end",alignItems:"center"},children:q.jsx("select",{style:{padding:"4px 8px",fontSize:"0.875rem",borderRadius:"6px",border:"1px solid #E6E7E9"},value:y,onChange:E=>{const _=E.target.value;h(_)},children:Object.keys(K).map(E=>q.jsx("option",{value:E,children:K[E].labelUnit},E))})}),q.jsx("div",{ref:g,style:{flexGrow:1,overflowX:"auto"},children:q.jsxs("div",{style:{display:"flex",minWidth:"max-content",flexDirection:"column"},children:[q.jsx(yt,{topHeaderGroups:S,bottomRowCells:f,selectedScale:y,scrollRef:g}),q.jsx("div",{style:{position:"relative",display:"flex"},children:q.jsx("div",{style:{display:"flex",flexGrow:1,flexDirection:"column"},children:c.map(E=>q.jsx("div",{style:{display:"flex",width:"100%",alignItems:"center",borderBottom:"1px solid #E6E7E9",height:`${at}px`,backgroundColor:"#FFF"},children:q.jsx(vn,{allTasks:c,currentTask:E,onTasksChange:s})},E.id))})})]})})]})})})}exports.ReactGanttChart=yn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),N=require("react"),Gt=require("react-dom");function Xt(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(a,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return a.default=r,Object.freeze(a)}const gt=Xt(N),pt=38,Zt=5,Z={day:{labelUnit:"day",tickUnit:"hour",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:1,basePxPerDragStep:32,formatTickLabel:r=>r.format("hh"),formatHeaderLabel:r=>r.format("MMM D")},week:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:6,basePxPerDragStep:54,formatTickLabel:r=>r.format("D"),formatHeaderLabel:r=>r.format("MMM")},month:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:32,formatTickLabel:r=>r.format("D"),formatHeaderLabel:r=>r.format("MMM YYYY")},year:{labelUnit:"month",tickUnit:"month",unitPerTick:1,dragStepUnit:"day",dragStepAmount:7,basePxPerDragStep:28,formatTickLabel:r=>r.format("D"),formatHeaderLabel:r=>r.format("MMM YYYY")}},yt=r=>Symbol.iterator in r,St=r=>"entries"in r,xt=(r,a)=>{const e=r instanceof Map?r:new Map(r.entries()),n=a instanceof Map?a:new Map(a.entries());if(e.size!==n.size)return!1;for(const[s,t]of e)if(!n.has(s)||!Object.is(t,n.get(s)))return!1;return!0},Jt=(r,a)=>{const e=r[Symbol.iterator](),n=a[Symbol.iterator]();let s=e.next(),t=n.next();for(;!s.done&&!t.done;){if(!Object.is(s.value,t.value))return!1;s=e.next(),t=n.next()}return!!s.done&&!!t.done};function Kt(r,a){return Object.is(r,a)?!0:typeof r!="object"||r===null||typeof a!="object"||a===null||Object.getPrototypeOf(r)!==Object.getPrototypeOf(a)?!1:yt(r)&&yt(a)?St(r)&&St(a)?xt(r,a):Jt(r,a):xt({entries:()=>Object.entries(r)},{entries:()=>Object.entries(a)})}function Qt(r){const a=N.useRef(void 0);return e=>{const n=r(e);return Kt(a.current,n)?a.current:a.current=n}}const bt=r=>{let a;const e=new Set,n=(c,d)=>{const l=typeof c=="function"?c(a):c;if(!Object.is(l,a)){const h=a;a=d??(typeof l!="object"||l===null)?l:Object.assign({},a,l),e.forEach(x=>x(a,h))}},s=()=>a,i={setState:n,getState:s,getInitialState:()=>u,subscribe:c=>(e.add(c),()=>e.delete(c))},u=a=r(n,s,i);return i},te=(r=>r?bt(r):bt),ee=r=>r;function ne(r,a=ee){const e=N.useSyncExternalStore(r.subscribe,N.useCallback(()=>a(r.getState()),[r,a]),N.useCallback(()=>a(r.getInitialState()),[r,a]));return N.useDebugValue(e),e}const re=r=>{const a=te(r),e=n=>ne(a,n);return Object.assign(e,a),e},se=(r=>re);function qt(r,a){let e;try{e=r()}catch{return}return{getItem:s=>{var t;const o=u=>u===null?null:JSON.parse(u,void 0),i=(t=e.getItem(s))!=null?t:null;return i instanceof Promise?i.then(o):o(i)},setItem:(s,t)=>e.setItem(s,JSON.stringify(t,void 0)),removeItem:s=>e.removeItem(s)}}const vt=r=>a=>{try{const e=r(a);return e instanceof Promise?e:{then(n){return vt(n)(e)},catch(n){return this}}}catch(e){return{then(n){return this},catch(n){return vt(n)(e)}}}},ie=(r,a)=>(e,n,s)=>{let t={storage:qt(()=>localStorage),partialize:f=>f,version:0,merge:(f,S)=>({...S,...f}),...a},o=!1;const i=new Set,u=new Set;let c=t.storage;if(!c)return r((...f)=>{console.warn(`[zustand persist middleware] Unable to update item '${t.name}', the given storage is currently unavailable.`),e(...f)},n,s);const d=()=>{const f=t.partialize({...n()});return c.setItem(t.name,{state:f,version:t.version})},l=s.setState;s.setState=(f,S)=>(l(f,S),d());const h=r((...f)=>(e(...f),d()),n,s);s.getInitialState=()=>h;let x;const y=()=>{var f,S;if(!c)return;o=!1,i.forEach(b=>{var g;return b((g=n())!=null?g:h)});const D=((S=t.onRehydrateStorage)==null?void 0:S.call(t,(f=n())!=null?f:h))||void 0;return vt(c.getItem.bind(c))(t.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==t.version){if(t.migrate){const g=t.migrate(b.state,b.version);return g instanceof Promise?g.then(z=>[!0,z]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,b.state];return[!1,void 0]}).then(b=>{var g;const[z,R]=b;if(x=t.merge(R,(g=n())!=null?g:h),e(x,!0),z)return d()}).then(()=>{D==null||D(x,void 0),x=n(),o=!0,u.forEach(b=>b(x))}).catch(b=>{D==null||D(void 0,b)})};return s.persist={setOptions:f=>{t={...t,...f},f.storage&&(c=f.storage)},clearStorage:()=>{c==null||c.removeItem(t.name)},getOptions:()=>t,rehydrate:()=>y(),hasHydrated:()=>o,onHydrate:f=>(i.add(f),()=>{i.delete(f)}),onFinishHydration:f=>(u.add(f),()=>{u.delete(f)})},t.skipHydration||y(),x||h},oe=ie,et=se()(oe((r,a)=>({rawTasks:[],transformedTasks:[],bottomRowCells:[],selectedScale:"month",currentTask:null,dragOffsets:{},setCurrentTask:e=>r({currentTask:e}),setSelectedScale:e=>r({selectedScale:e}),setRawTasks:e=>r({rawTasks:e}),setBottomRowCells:e=>r({bottomRowCells:e}),setTransformedTasks:e=>r({transformedTasks:e}),setDragOffset:(e,n)=>r(s=>({dragOffsets:{...s.dragOffsets,[e]:n}})),clearDragOffset:e=>r(n=>{const{[e]:s,...t}=n.dragOffsets;return{dragOffsets:t}}),getCurrentDragOffset:e=>a().dragOffsets[e]||null,getTotalWidth:()=>a().bottomRowCells.reduce((n,s)=>n+s.widthPx,0)}),{name:"gantt-storage",storage:qt(()=>sessionStorage),partialize:r=>({selectedScale:r.selectedScale})}));function Bt(){return et(Qt(r=>({rawTasks:r.rawTasks,transformedTasks:r.transformedTasks,bottomRowCells:r.bottomRowCells,selectedScale:r.selectedScale,currentTask:r.currentTask,dragOffsets:r.dragOffsets,setRawTasks:r.setRawTasks,setTransformedTasks:r.setTransformedTasks,setBottomRowCells:r.setBottomRowCells,setSelectedScale:r.setSelectedScale,setCurrentTask:r.setCurrentTask,setDragOffset:r.setDragOffset,clearDragOffset:r.clearDragOffset,getTotalWidth:r.getTotalWidth,getCurrentDragOffset:r.getCurrentDragOffset})))}function q(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var rt={exports:{}},ae=rt.exports,Mt;function ue(){return Mt||(Mt=1,(function(r,a){(function(e,n){r.exports=n()})(ae,(function(){var e=1e3,n=6e4,s=36e5,t="millisecond",o="second",i="minute",u="hour",c="day",d="week",l="month",h="quarter",x="year",y="date",f="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var O=["th","st","nd","rd"],M=E%100;return"["+E+(O[(M-20)%10]||O[M]||O[0])+"]"}},g=function(E,O,M){var I=String(E);return!I||I.length>=O?E:""+Array(O+1-I.length).join(M)+E},z={s:g,z:function(E){var O=-E.utcOffset(),M=Math.abs(O),I=Math.floor(M/60),w=M%60;return(O<=0?"+":"-")+g(I,2,"0")+":"+g(w,2,"0")},m:function E(O,M){if(O.date()<M.date())return-E(M,O);var I=12*(M.year()-O.year())+(M.month()-O.month()),w=O.clone().add(I,l),C=M-w<0,L=O.clone().add(I+(C?-1:1),l);return+(-(I+(M-w)/(C?w-L:L-w))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:l,y:x,w:d,d:c,D:y,h:u,m:i,s:o,ms:t,Q:h}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},R="en",T={};T[R]=b;var v="$isDayjsObject",p=function(E){return E instanceof P||!(!E||!E[v])},$=function E(O,M,I){var w;if(!O)return R;if(typeof O=="string"){var C=O.toLowerCase();T[C]&&(w=C),M&&(T[C]=M,w=C);var L=O.split("-");if(!w&&L.length>1)return E(L[0])}else{var j=O.name;T[j]=O,w=j}return!I&&w&&(R=w),w||!I&&R},m=function(E,O){if(p(E))return E.clone();var M=typeof O=="object"?O:{};return M.date=E,M.args=arguments,new P(M)},k=z;k.l=$,k.i=p,k.w=function(E,O){return m(E,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var P=(function(){function E(M){this.$L=$(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[v]=!0}var O=E.prototype;return O.parse=function(M){this.$d=(function(I){var w=I.date,C=I.utc;if(w===null)return new Date(NaN);if(k.u(w))return new Date;if(w instanceof Date)return new Date(w);if(typeof w=="string"&&!/Z$/i.test(w)){var L=w.match(S);if(L){var j=L[2]-1||0,F=(L[7]||"0").substring(0,3);return C?new Date(Date.UTC(L[1],j,L[3]||1,L[4]||0,L[5]||0,L[6]||0,F)):new Date(L[1],j,L[3]||1,L[4]||0,L[5]||0,L[6]||0,F)}}return new Date(w)})(M),this.init()},O.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},O.$utils=function(){return k},O.isValid=function(){return this.$d.toString()!==f},O.isSame=function(M,I){var w=m(M);return this.startOf(I)<=w&&w<=this.endOf(I)},O.isAfter=function(M,I){return m(M)<this.startOf(I)},O.isBefore=function(M,I){return this.endOf(I)<m(M)},O.$g=function(M,I,w){return k.u(M)?this[I]:this.set(w,M)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(M,I){var w=this,C=!!k.u(I)||I,L=k.p(M),j=function(X,U){var V=k.w(w.$u?Date.UTC(w.$y,U,X):new Date(w.$y,U,X),w);return C?V:V.endOf(c)},F=function(X,U){return k.w(w.toDate()[X].apply(w.toDate("s"),(C?[0,0,0,0]:[23,59,59,999]).slice(U)),w)},H=this.$W,Y=this.$M,B=this.$D,J="set"+(this.$u?"UTC":"");switch(L){case x:return C?j(1,0):j(31,11);case l:return C?j(1,Y):j(0,Y+1);case d:var G=this.$locale().weekStart||0,Q=(H<G?H+7:H)-G;return j(C?B-Q:B+(6-Q),Y);case c:case y:return F(J+"Hours",0);case u:return F(J+"Minutes",1);case i:return F(J+"Seconds",2);case o:return F(J+"Milliseconds",3);default:return this.clone()}},O.endOf=function(M){return this.startOf(M,!1)},O.$set=function(M,I){var w,C=k.p(M),L="set"+(this.$u?"UTC":""),j=(w={},w[c]=L+"Date",w[y]=L+"Date",w[l]=L+"Month",w[x]=L+"FullYear",w[u]=L+"Hours",w[i]=L+"Minutes",w[o]=L+"Seconds",w[t]=L+"Milliseconds",w)[C],F=C===c?this.$D+(I-this.$W):I;if(C===l||C===x){var H=this.clone().set(y,1);H.$d[j](F),H.init(),this.$d=H.set(y,Math.min(this.$D,H.daysInMonth())).$d}else j&&this.$d[j](F);return this.init(),this},O.set=function(M,I){return this.clone().$set(M,I)},O.get=function(M){return this[k.p(M)]()},O.add=function(M,I){var w,C=this;M=Number(M);var L=k.p(I),j=function(Y){var B=m(C);return k.w(B.date(B.date()+Math.round(Y*M)),C)};if(L===l)return this.set(l,this.$M+M);if(L===x)return this.set(x,this.$y+M);if(L===c)return j(1);if(L===d)return j(7);var F=(w={},w[i]=n,w[u]=s,w[o]=e,w)[L]||1,H=this.$d.getTime()+M*F;return k.w(H,this)},O.subtract=function(M,I){return this.add(-1*M,I)},O.format=function(M){var I=this,w=this.$locale();if(!this.isValid())return w.invalidDate||f;var C=M||"YYYY-MM-DDTHH:mm:ssZ",L=k.z(this),j=this.$H,F=this.$m,H=this.$M,Y=w.weekdays,B=w.months,J=w.meridiem,G=function(U,V,tt,nt){return U&&(U[V]||U(I,C))||tt[V].slice(0,nt)},Q=function(U){return k.s(j%12||12,U,"0")},X=J||function(U,V,tt){var nt=U<12?"AM":"PM";return tt?nt.toLowerCase():nt};return C.replace(D,(function(U,V){return V||(function(tt){switch(tt){case"YY":return String(I.$y).slice(-2);case"YYYY":return k.s(I.$y,4,"0");case"M":return H+1;case"MM":return k.s(H+1,2,"0");case"MMM":return G(w.monthsShort,H,B,3);case"MMMM":return G(B,H);case"D":return I.$D;case"DD":return k.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return G(w.weekdaysMin,I.$W,Y,2);case"ddd":return G(w.weekdaysShort,I.$W,Y,3);case"dddd":return Y[I.$W];case"H":return String(j);case"HH":return k.s(j,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return X(j,F,!0);case"A":return X(j,F,!1);case"m":return String(F);case"mm":return k.s(F,2,"0");case"s":return String(I.$s);case"ss":return k.s(I.$s,2,"0");case"SSS":return k.s(I.$ms,3,"0");case"Z":return L}return null})(U)||L.replace(":","")}))},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(M,I,w){var C,L=this,j=k.p(I),F=m(M),H=(F.utcOffset()-this.utcOffset())*n,Y=this-F,B=function(){return k.m(L,F)};switch(j){case x:C=B()/12;break;case l:C=B();break;case h:C=B()/3;break;case d:C=(Y-H)/6048e5;break;case c:C=(Y-H)/864e5;break;case u:C=Y/s;break;case i:C=Y/n;break;case o:C=Y/e;break;default:C=Y}return w?C:k.a(C)},O.daysInMonth=function(){return this.endOf(l).$D},O.$locale=function(){return T[this.$L]},O.locale=function(M,I){if(!M)return this.$L;var w=this.clone(),C=$(M,I,!0);return C&&(w.$L=C),w},O.clone=function(){return k.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},E})(),A=P.prototype;return m.prototype=A,[["$ms",t],["$s",o],["$m",i],["$H",u],["$W",c],["$M",l],["$y",x],["$D",y]].forEach((function(E){A[E[1]]=function(O){return this.$g(O,E[0],E[1])}})),m.extend=function(E,O){return E.$i||(E(O,P,m),E.$i=!0),m},m.locale=$,m.isDayjs=p,m.unix=function(E){return m(1e3*E)},m.en=T[R],m.Ls=T,m.p={},m}))})(rt)),rt.exports}var ce=ue();const W=q(ce);var st={exports:{}},le=st.exports,wt;function fe(){return wt||(wt=1,(function(r,a){(function(e,n){r.exports=n()})(le,(function(){var e,n,s=1e3,t=6e4,o=36e5,i=864e5,u=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=31536e6,d=2628e6,l=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:c,months:d,days:i,hours:o,minutes:t,seconds:s,milliseconds:1,weeks:6048e5},x=function(T){return T instanceof z},y=function(T,v,p){return new z(T,p,v.$l)},f=function(T){return n.p(T)+"s"},S=function(T){return T<0},D=function(T){return S(T)?Math.ceil(T):Math.floor(T)},b=function(T){return Math.abs(T)},g=function(T,v){return T?S(T)?{negative:!0,format:""+b(T)+v}:{negative:!1,format:""+T+v}:{negative:!1,format:""}},z=(function(){function T(p,$,m){var k=this;if(this.$d={},this.$l=m,p===void 0&&(this.$ms=0,this.parseFromMilliseconds()),$)return y(p*h[f($)],this);if(typeof p=="number")return this.$ms=p,this.parseFromMilliseconds(),this;if(typeof p=="object")return Object.keys(p).forEach((function(E){k.$d[f(E)]=p[E]})),this.calMilliseconds(),this;if(typeof p=="string"){var P=p.match(l);if(P){var A=P.slice(2).map((function(E){return E!=null?Number(E):0}));return this.$d.years=A[0],this.$d.months=A[1],this.$d.weeks=A[2],this.$d.days=A[3],this.$d.hours=A[4],this.$d.minutes=A[5],this.$d.seconds=A[6],this.calMilliseconds(),this}}return this}var v=T.prototype;return v.calMilliseconds=function(){var p=this;this.$ms=Object.keys(this.$d).reduce((function($,m){return $+(p.$d[m]||0)*h[m]}),0)},v.parseFromMilliseconds=function(){var p=this.$ms;this.$d.years=D(p/c),p%=c,this.$d.months=D(p/d),p%=d,this.$d.days=D(p/i),p%=i,this.$d.hours=D(p/o),p%=o,this.$d.minutes=D(p/t),p%=t,this.$d.seconds=D(p/s),p%=s,this.$d.milliseconds=p},v.toISOString=function(){var p=g(this.$d.years,"Y"),$=g(this.$d.months,"M"),m=+this.$d.days||0;this.$d.weeks&&(m+=7*this.$d.weeks);var k=g(m,"D"),P=g(this.$d.hours,"H"),A=g(this.$d.minutes,"M"),E=this.$d.seconds||0;this.$d.milliseconds&&(E+=this.$d.milliseconds/1e3,E=Math.round(1e3*E)/1e3);var O=g(E,"S"),M=p.negative||$.negative||k.negative||P.negative||A.negative||O.negative,I=P.format||A.format||O.format?"T":"",w=(M?"-":"")+"P"+p.format+$.format+k.format+I+P.format+A.format+O.format;return w==="P"||w==="-P"?"P0D":w},v.toJSON=function(){return this.toISOString()},v.format=function(p){var $=p||"YYYY-MM-DDTHH:mm:ss",m={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return $.replace(u,(function(k,P){return P||String(m[k])}))},v.as=function(p){return this.$ms/h[f(p)]},v.get=function(p){var $=this.$ms,m=f(p);return m==="milliseconds"?$%=1e3:$=m==="weeks"?D($/h[m]):this.$d[m],$||0},v.add=function(p,$,m){var k;return k=$?p*h[f($)]:x(p)?p.$ms:y(p,this).$ms,y(this.$ms+k*(m?-1:1),this)},v.subtract=function(p,$){return this.add(p,$,!0)},v.locale=function(p){var $=this.clone();return $.$l=p,$},v.clone=function(){return y(this.$ms,this)},v.humanize=function(p){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!p)},v.valueOf=function(){return this.asMilliseconds()},v.milliseconds=function(){return this.get("milliseconds")},v.asMilliseconds=function(){return this.as("milliseconds")},v.seconds=function(){return this.get("seconds")},v.asSeconds=function(){return this.as("seconds")},v.minutes=function(){return this.get("minutes")},v.asMinutes=function(){return this.as("minutes")},v.hours=function(){return this.get("hours")},v.asHours=function(){return this.as("hours")},v.days=function(){return this.get("days")},v.asDays=function(){return this.as("days")},v.weeks=function(){return this.get("weeks")},v.asWeeks=function(){return this.as("weeks")},v.months=function(){return this.get("months")},v.asMonths=function(){return this.as("months")},v.years=function(){return this.get("years")},v.asYears=function(){return this.as("years")},T})(),R=function(T,v,p){return T.add(v.years()*p,"y").add(v.months()*p,"M").add(v.days()*p,"d").add(v.hours()*p,"h").add(v.minutes()*p,"m").add(v.seconds()*p,"s").add(v.milliseconds()*p,"ms")};return function(T,v,p){e=p,n=p().$utils(),p.duration=function(k,P){var A=p.locale();return y(k,{$l:A},P)},p.isDuration=x;var $=v.prototype.add,m=v.prototype.subtract;v.prototype.add=function(k,P){return x(k)?R(this,k,1):$.bind(this)(k,P)},v.prototype.subtract=function(k,P){return x(k)?R(this,k,-1):m.bind(this)(k,P)}}}))})(st)),st.exports}var de=fe();const he=q(de);var it={exports:{}},me=it.exports,Dt;function $e(){return Dt||(Dt=1,(function(r,a){(function(e,n){r.exports=n()})(me,(function(){return function(e,n,s){n.prototype.isBetween=function(t,o,i,u){var c=s(t),d=s(o),l=(u=u||"()")[0]==="(",h=u[1]===")";return(l?this.isAfter(c,i):!this.isBefore(c,i))&&(h?this.isBefore(d,i):!this.isAfter(d,i))||(l?this.isBefore(c,i):!this.isAfter(c,i))&&(h?this.isAfter(d,i):!this.isBefore(d,i))}}}))})(it)),it.exports}var ge=$e();const pe=q(ge);var ot={exports:{}},ve=ot.exports,Ot;function ye(){return Ot||(Ot=1,(function(r,a){(function(e,n){r.exports=n()})(ve,(function(){var e="day";return function(n,s,t){var o=function(c){return c.add(4-c.isoWeekday(),e)},i=s.prototype;i.isoWeekYear=function(){return o(this).year()},i.isoWeek=function(c){if(!this.$utils().u(c))return this.add(7*(c-this.isoWeek()),e);var d,l,h,x,y=o(this),f=(d=this.isoWeekYear(),l=this.$u,h=(l?t.utc:t)().year(d).startOf("year"),x=4-h.isoWeekday(),h.isoWeekday()>4&&(x+=7),h.add(x,e));return y.diff(f,"week")+1},i.isoWeekday=function(c){return this.$utils().u(c)?this.day()||7:this.day(this.day()%7?c:c-7)};var u=i.startOf;i.startOf=function(c,d){var l=this.$utils(),h=!!l.u(d)||d;return l.p(c)==="isoweek"?h?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):u.bind(this)(c,d)}}}))})(ot)),ot.exports}var Se=ye();const xe=q(Se);var at={exports:{}},be=at.exports,kt;function Me(){return kt||(kt=1,(function(r,a){(function(e,n){r.exports=n()})(be,(function(){return function(e,n){n.prototype.isSameOrAfter=function(s,t){return this.isSame(s,t)||this.isAfter(s,t)}}}))})(at)),at.exports}var we=Me();const De=q(we);var ut={exports:{}},Oe=ut.exports,Tt;function ke(){return Tt||(Tt=1,(function(r,a){(function(e,n){r.exports=n()})(Oe,(function(){return function(e,n){n.prototype.isSameOrBefore=function(s,t){return this.isSame(s,t)||this.isBefore(s,t)}}}))})(ut)),ut.exports}var Te=ke();const Ee=q(Te);var ct={exports:{}},Ie=ct.exports,Et;function ze(){return Et||(Et=1,(function(r,a){(function(e,n){r.exports=n()})(Ie,(function(){return function(e,n,s){n.prototype.isToday=function(){var t="YYYY-MM-DD",o=s();return this.format(t)===o.format(t)}}}))})(ct)),ct.exports}var Ce=ze();const Le=q(Ce);var lt={exports:{}},Re=lt.exports,It;function _e(){return It||(It=1,(function(r,a){(function(e,n){r.exports=n()})(Re,(function(){return function(e,n,s){var t=n.prototype,o=function(l){return l&&(l.indexOf?l:l.s)},i=function(l,h,x,y,f){var S=l.name?l:l.$locale(),D=o(S[h]),b=o(S[x]),g=D||b.map((function(R){return R.slice(0,y)}));if(!f)return g;var z=S.weekStart;return g.map((function(R,T){return g[(T+(z||0))%7]}))},u=function(){return s.Ls[s.locale()]},c=function(l,h){return l.formats[h]||(function(x){return x.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(y,f,S){return f||S.slice(1)}))})(l.formats[h.toUpperCase()])},d=function(){var l=this;return{months:function(h){return h?h.format("MMMM"):i(l,"months")},monthsShort:function(h){return h?h.format("MMM"):i(l,"monthsShort","months",3)},firstDayOfWeek:function(){return l.$locale().weekStart||0},weekdays:function(h){return h?h.format("dddd"):i(l,"weekdays")},weekdaysMin:function(h){return h?h.format("dd"):i(l,"weekdaysMin","weekdays",2)},weekdaysShort:function(h){return h?h.format("ddd"):i(l,"weekdaysShort","weekdays",3)},longDateFormat:function(h){return c(l.$locale(),h)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};t.localeData=function(){return d.bind(this)()},s.localeData=function(){var l=u();return{firstDayOfWeek:function(){return l.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(h){return c(l,h)},meridiem:l.meridiem,ordinal:l.ordinal}},s.months=function(){return i(u(),"months")},s.monthsShort=function(){return i(u(),"monthsShort","months",3)},s.weekdays=function(l){return i(u(),"weekdays",null,null,l)},s.weekdaysShort=function(l){return i(u(),"weekdaysShort","weekdays",3,l)},s.weekdaysMin=function(l){return i(u(),"weekdaysMin","weekdays",2,l)}}}))})(lt)),lt.exports}var je=_e();const Pe=q(je);var ft={exports:{}},We=ft.exports,zt;function Ne(){return zt||(zt=1,(function(r,a){(function(e,n){r.exports=n()})(We,(function(){return function(e,n,s){var t=function(o,i){if(!i||!i.length||i.length===1&&!i[0]||i.length===1&&Array.isArray(i[0])&&!i[0].length)return null;var u;i.length===1&&i[0].length>0&&(i=i[0]),u=(i=i.filter((function(d){return d})))[0];for(var c=1;c<i.length;c+=1)i[c].isValid()&&!i[c][o](u)||(u=i[c]);return u};s.max=function(){var o=[].slice.call(arguments,0);return t("isAfter",o)},s.min=function(){var o=[].slice.call(arguments,0);return t("isBefore",o)}}}))})(ft)),ft.exports}var Fe=Ne();const He=q(Fe);var dt={exports:{}},Ae=dt.exports,Ct;function Ye(){return Ct||(Ct=1,(function(r,a){(function(e,n){r.exports=n()})(Ae,(function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(s,t,o){var i,u=function(h,x,y){y===void 0&&(y={});var f=new Date(h),S=(function(D,b){b===void 0&&(b={});var g=b.timeZoneName||"short",z=D+"|"+g,R=n[z];return R||(R=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:D,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),n[z]=R),R})(x,y);return S.formatToParts(f)},c=function(h,x){for(var y=u(h,x),f=[],S=0;S<y.length;S+=1){var D=y[S],b=D.type,g=D.value,z=e[b];z>=0&&(f[z]=parseInt(g,10))}var R=f[3],T=R===24?0:R,v=f[0]+"-"+f[1]+"-"+f[2]+" "+T+":"+f[4]+":"+f[5]+":000",p=+h;return(o.utc(v).valueOf()-(p-=p%1e3))/6e4},d=t.prototype;d.tz=function(h,x){h===void 0&&(h=i);var y,f=this.utcOffset(),S=this.toDate(),D=S.toLocaleString("en-US",{timeZone:h}),b=Math.round((S-new Date(D))/1e3/60),g=15*-Math.round(S.getTimezoneOffset()/15)-b;if(!Number(g))y=this.utcOffset(0,x);else if(y=o(D,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),x){var z=y.utcOffset();y=y.add(f-z,"minute")}return y.$x.$timezone=h,y},d.offsetName=function(h){var x=this.$x.$timezone||o.tz.guess(),y=u(this.valueOf(),x,{timeZoneName:h}).find((function(f){return f.type.toLowerCase()==="timezonename"}));return y&&y.value};var l=d.startOf;d.startOf=function(h,x){if(!this.$x||!this.$x.$timezone)return l.call(this,h,x);var y=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return l.call(y,h,x).tz(this.$x.$timezone,!0)},o.tz=function(h,x,y){var f=y&&x,S=y||x||i,D=c(+o(),S);if(typeof h!="string")return o(h).tz(S);var b=(function(T,v,p){var $=T-60*v*1e3,m=c($,p);if(v===m)return[$,v];var k=c($-=60*(m-v)*1e3,p);return m===k?[$,m]:[T-60*Math.min(m,k)*1e3,Math.max(m,k)]})(o.utc(h,f).valueOf(),D,S),g=b[0],z=b[1],R=o(g).utcOffset(z);return R.$x.$timezone=S,R},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){i=h}}}))})(dt)),dt.exports}var Ue=Ye();const qe=q(Ue);var ht={exports:{}},Be=ht.exports,Lt;function Ve(){return Lt||(Lt=1,(function(r,a){(function(e,n){r.exports=n()})(Be,(function(){return function(e,n,s){s.updateLocale=function(t,o){var i=s.Ls[t];if(i)return(o?Object.keys(o):[]).forEach((function(u){i[u]=o[u]})),i}}}))})(ht)),ht.exports}var Ge=Ve();const Xe=q(Ge);var mt={exports:{}},Ze=mt.exports,Rt;function Je(){return Rt||(Rt=1,(function(r,a){(function(e,n){r.exports=n()})(Ze,(function(){var e="minute",n=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(t,o,i){var u=o.prototype;i.utc=function(f){var S={date:f,utc:!0,args:arguments};return new o(S)},u.utc=function(f){var S=i(this.toDate(),{locale:this.$L,utc:!0});return f?S.add(this.utcOffset(),e):S},u.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var c=u.parse;u.parse=function(f){f.utc&&(this.$u=!0),this.$utils().u(f.$offset)||(this.$offset=f.$offset),c.call(this,f)};var d=u.init;u.init=function(){if(this.$u){var f=this.$d;this.$y=f.getUTCFullYear(),this.$M=f.getUTCMonth(),this.$D=f.getUTCDate(),this.$W=f.getUTCDay(),this.$H=f.getUTCHours(),this.$m=f.getUTCMinutes(),this.$s=f.getUTCSeconds(),this.$ms=f.getUTCMilliseconds()}else d.call(this)};var l=u.utcOffset;u.utcOffset=function(f,S){var D=this.$utils().u;if(D(f))return this.$u?0:D(this.$offset)?l.call(this):this.$offset;if(typeof f=="string"&&(f=(function(R){R===void 0&&(R="");var T=R.match(n);if(!T)return null;var v=(""+T[0]).match(s)||["-",0,0],p=v[0],$=60*+v[1]+ +v[2];return $===0?0:p==="+"?$:-$})(f),f===null))return this;var b=Math.abs(f)<=16?60*f:f;if(b===0)return this.utc(S);var g=this.clone();if(S)return g.$offset=b,g.$u=!1,g;var z=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(g=this.local().add(b+z,e)).$offset=b,g.$x.$localOffset=z,g};var h=u.format;u.format=function(f){var S=f||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,S)},u.valueOf=function(){var f=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*f},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var x=u.toDate;u.toDate=function(f){return f==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():x.call(this)};var y=u.diff;u.diff=function(f,S,D){if(f&&this.$u===f.$u)return y.call(this,f,S,D);var b=this.local(),g=i(f).local();return y.call(b,g,S,D)}}}))})(mt)),mt.exports}var Ke=Je();const Qe=q(Ke);var $t={exports:{}},tn=$t.exports,_t;function en(){return _t||(_t=1,(function(r,a){(function(e,n){r.exports=n()})(tn,(function(){return function(e,n){n.prototype.weekday=function(s){var t=this.$locale().weekStart||0,o=this.$W,i=(o<t?o+7:o)-t;return this.$utils().u(s)?i:this.subtract(i,"day").add(s,"day")}}}))})($t)),$t.exports}var nn=en();const rn=q(nn);W.extend(He);W.extend(he);W.extend(rn);W.extend(Le);W.extend(Qe);W.extend(qe);W.extend(De);W.extend(Ee);W.extend(pe);W.extend(Pe);W.extend(Xe);W.extend(xe);const sn={minute:1,hour:60,day:1440,week:1440*7,month:1440*30},on=(r,a,e,n)=>a==="left"?Math.min(r,e-n):a==="right"?Math.max(r,-e+n):r,an=(r,a,e)=>a==="left"&&r<0?Math.floor(r/e)*e:a==="right"&&r>0?Math.ceil(r/e)*e:r,un=(r,a,e,n)=>{const s={offsetStartDate:e,offsetEndDate:n};switch(r){case"bar":return{...s,offsetX:a,offsetWidth:0};case"left":return{...s,offsetX:a,offsetWidth:-a};case"right":return{...s,offsetX:0,offsetWidth:a};default:return{...s,offsetX:0,offsetWidth:0}}},jt=8,cn=r=>{const e=r.currentTarget.getBoundingClientRect(),n=r.clientX-e.left;return n<=jt?"left":n>=e.width-jt?"right":"bar"};function ln(r,a){const{rawTasks:e,selectedScale:n,setCurrentTask:s,setDragOffset:t,clearDragOffset:o,setRawTasks:i}=Bt(),u=N.useRef(null),c=N.useRef(null),d=Z[n],{basePxPerDragStep:l,dragStepAmount:h,dragStepUnit:x}=d,y=h*sn[x]/l,f=b=>{const g=u.current;if(!g)return;let z=b.clientX-g.initialClientX;z=on(z,g.mode,r.barWidth,l),z=an(z,g.mode,l);const R=Math.round(z/g.basePxPerDragStep);if(R===g.dragSteps)return;g.dragSteps=R;const T=R*g.basePxPerDragStep,v=T*g.minutesPerPixel,p=g.mode==="right"?g.initialStartDate:g.initialStartDate.add(v,"minute"),$=g.mode==="left"?g.initialEndDate:g.initialEndDate.add(v,"minute");t(r.id,un(g.mode,T,p,$))},S=()=>{var T;document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",S),document.removeEventListener("pointercancel",S);const b=u.current;if(!b)return;const g=v=>v.add(b.dragSteps*h,x).toISOString(),z=e.map(v=>{if(v.id!==r.id)return v;switch(b.mode){case"bar":return{...v,startDate:g(W(v.startDate)),endDate:g(W(v.endDate))};case"left":return{...v,startDate:g(W(v.startDate))};case"right":return{...v,endDate:g(W(v.endDate))};default:return v}});i(z),a==null||a(z);const R=c.current;R!==null&&((T=document.getElementById(`task-${r.id}`))==null||T.releasePointerCapture(R)),c.current=null,u.current=null,s(null),o(r.id)};return{onPointerDown:b=>{const g=cn(b);u.current={mode:g,initialClientX:b.clientX,initialStartDate:W(r.startDate),initialEndDate:W(r.endDate),dragSteps:0,basePxPerDragStep:l,minutesPerPixel:y},s(r),b.currentTarget.setPointerCapture(b.pointerId),c.current=b.pointerId,document.addEventListener("pointermove",f),document.addEventListener("pointerup",S),document.addEventListener("pointercancel",S)}}}const Pt=8,fn={day:"MMM D, h A",week:"MMM D",month:"MMM D",year:"MMM YYYY"};function dn({currentTask:r,onTasksChange:a}){const e=N.useRef(null),{onPointerDown:n}=ln(r,a),[s,t]=N.useState("grab"),o=et(D=>D.dragOffsets[r.id]),i=et(D=>{var b;return((b=D.currentTask)==null?void 0:b.id)===r.id}),u=et(D=>D.selectedScale),c=(o==null?void 0:o.offsetX)??0,d=(o==null?void 0:o.offsetWidth)??0,l=r.barLeft+c,h=r.barWidth+d,x=N.useCallback(D=>{const b=e.current;if(!b)return;const g=b.getBoundingClientRect(),z=D.clientX-g.left;z<=Pt||z>=g.width-Pt?t("ew-resize"):t("grab")},[]),y=fn[u],f=o==null?void 0:o.offsetStartDate.format(y),S=o==null?void 0:o.offsetEndDate.format(y);return _.jsxs("div",{ref:e,id:`task-${r.id}`,className:`gantt-task-bar ${i?"dragging":""}`,onPointerDown:n,onMouseMove:x,onMouseLeave:()=>t("grab"),style:{transform:`translateX(${l}px)`,width:h,height:pt/2,cursor:i?"grabbing":s},role:"button",tabIndex:0,"aria-label":`Task: ${r.name}`,children:[_.jsx("span",{className:"gantt-task-name",children:r.name}),i&&o&&_.jsxs("div",{className:"gantt-bar-tooltip",role:"status","aria-live":"polite",children:[f," β†’ ",S]})]})}function hn(r){const a=[];for(const e of r){const n=a[a.length-1];n&&n.label===e.label?n.widthPx+=e.widthPx:a.push({...e})}return a}function mn(r){let a=0;return r.map(e=>{const n={...e,left:a};return a+=e.widthPx,n})}function $n(r){const a=hn(r);return mn(a)}function Wt(r){return r.split(".").map(Number)}function gn(r){return[...r].sort((a,e)=>{const n=Wt(a.sequence),s=Wt(e.sequence),t=Math.max(n.length,s.length);for(let o=0;o<t;o++){const i=n[o]||0,u=s[o]||0;if(i!==u)return i-u}return 0})}function pn(r){return r.split(".").length-1}function vn(r,a,e){return gn(r).map((s,t)=>{const o=pn(s.sequence),i=t+1,{barMarginLeftAmount:u,barWidthSize:c}=yn(W(s.startDate),W(s.endDate),a,e);return{...s,barLeft:u,barWidth:c,depth:o,order:i,originalOrder:i}})}function yn(r,a,e,n){if(!e.length)return{barMarginLeftAmount:0,barWidthSize:0};const s=Z[n],{tickUnit:t,unitPerTick:o}=s;let i=0,u=0,c=!1;const d=r.valueOf(),l=a.valueOf();for(const h of e){const x=h.startDate,y=x.add(o,t),f=h.widthPx,S=x.valueOf(),D=y.valueOf();if(D<=d){i+=f;continue}if(S>=l)break;const b=d>S?r:x,g=l<D?a:y,z=D-S,T=(g.valueOf()-b.valueOf())/z;if(!c&&b.valueOf()>S){const v=(b.valueOf()-S)/z;i+=v*f}u+=T*f,c=!0}return{barMarginLeftAmount:i,barWidthSize:Math.max(u,1)}}function Sn(r){let a=1/0,e=-1/0;for(const n of r){const s=W(n.startDate).valueOf(),t=W(n.endDate).valueOf();Number.isNaN(s)||(a=Math.min(a,s)),Number.isNaN(t)||(e=Math.max(e,t))}return{minDate:W(a),maxDate:W(e)}}function xn(r,a,e){const n=Z[e],{tickUnit:s,unitPerTick:t}=n,o=Zt*t;return{paddedMinDate:r.subtract(o,s),paddedMaxDate:a.add(o,s)}}function bn(r,a,e){const n=Z[e],{tickUnit:s,unitPerTick:t,basePxPerDragStep:o,dragStepUnit:i,dragStepAmount:u}=n,c=[];let d=r.startOf(s);const l=a.valueOf(),h=o/u;for(;d.valueOf()<l;){const x=d.add(t,s),f=x.diff(d,i)*h;c.push({startDate:d,widthPx:f}),d=x}return c}function Mn(r,a){const e=Z[a],{labelUnit:n,formatHeaderLabel:s}=e;if(r.length===0)return[];const t=[];let o=null;for(const i of r){const u=i.startDate.startOf(n),c=u.valueOf(),d=(s==null?void 0:s(u))??u.format();o&&o.startDate.valueOf()===c?o.widthPx+=i.widthPx:(o&&t.push(o),o={label:d,widthPx:i.widthPx,startDate:u})}return o&&t.push(o),t}function wn(r,a){if(!r.length)return{bottomCells:[],transformedTasks:[]};const{minDate:e,maxDate:n}=Sn(r),{paddedMinDate:s,paddedMaxDate:t}=xn(e,n,a),o=bn(s,t,a),i=vn(r,o,a);return{bottomCells:o,transformedTasks:i}}function Dn({bottomRowCells:r,selectedScale:a,width:e,scrollRef:n}){const s=Z[a],[t,o]=N.useState(0),i=N.useMemo(()=>{const u=Mn(r,a);return $n(u)},[r,a]);return N.useEffect(()=>{const u=n.current;if(!u)return;const c=()=>{const d=u.scrollLeft;for(let l=i.length-1;l>=0;l--)if(d>=i[l].left){o(l);break}};return u.addEventListener("scroll",c),c(),()=>u.removeEventListener("scroll",c)},[i,n]),_.jsx("header",{className:"gantt-header",style:{width:`${e}px`},children:_.jsxs("div",{className:"gantt-header-content",children:[_.jsx("div",{className:"gantt-top-header",children:_.jsx("div",{className:"gantt-top-groups",children:i.map((u,c)=>{const d=c===t;return _.jsx("div",{className:`gantt-top-group ${d?"sticky":""}`,style:{width:`${u.widthPx}px`,...d&&{left:0}},children:_.jsx("p",{className:"gantt-top-group-label",children:u.label})},`${u.label}-${c}`)})})}),_.jsx("div",{className:"gantt-bottom-row",children:r.map((u,c)=>{var l;const d=((l=s.formatTickLabel)==null?void 0:l.call(s,u.startDate))||"";return _.jsx("div",{className:"gantt-bottom-cell",style:{width:`${u.widthPx}px`},children:d},`bottom-${c}`)})})]})})}function On(r,a,e,n,s){if(e<0||s<0)return`M ${a} ${e} h ${(n-a)/2}`;const t=7,o=11,i=25,u=20,c=`M ${a} ${e}`,d=n-a,l=s-e,h=Math.abs(d),x=Math.abs(l),y=s<=e,f=s>=e,S=n>=a,D=n<=a,b=h>u,g=Math.abs(d/2),z=Math.abs(l/2);function R(){function $(){return(S||D)&&f&&!b?"downSmallHorizontal":(S||D)&&y&&!b?"upSmallHorizontal":f&&D?"downLeft":f&&S?"downRight":y&&D?"upLeft":y&&S?"upRight":""}let m=c;switch($()){case"downRight":{m+=` h ${g-t}`,m+=` a ${t} ${t} 0 0 1 ${t} ${t}`,m+=` v ${l-t*2}`,m+=` a ${t} ${t} 0 0 0 ${t} ${t}`,m+=` h ${g-t}`;break}case"upRight":{m+=` h ${g-t}`,m+=` a ${t} ${t} 0 0 0 ${t} -${t}`,m+=` v -${x-t*2}`,m+=` a ${t} ${t} 0 0 1 ${t} -${t}`,m+=` h ${g-t}`;break}case"downLeft":case"downSmallHorizontal":{const P=e+l/2;m+=` h ${o}`,m+=` a ${t} ${t} 0 0 1 ${t} ${t}`,m+=` v ${P-e-t*2}`,m+=` a ${t} ${t} 0 0 1 -${t} ${t}`,m+=` h ${d-2*o}`,m+=` a ${t} ${t} 0 0 0 -${t} ${t}`,m+=` v ${P-e-t*2}`,m+=` a ${t} ${t} 0 0 0 ${t} ${t}`,m+=` h ${o}`;break}case"upLeft":case"upSmallHorizontal":{const P=e+l/2;m+=` h ${o}`,m+=` a ${t} ${t} 0 0 0 ${t} -${t}`,m+=` v -${e-P-t*2}`,m+=` a ${t} ${t} 0 0 0 -${t} -${t}`,m+=` h ${d-2*o}`,m+=` a ${t} ${t} 0 0 1 -${t} -${t}`,m+=` v -${e-P-t*2}`,m+=` a ${t} ${t} 0 0 1 ${t} -${t}`,m+=` h ${o}`;break}default:return m}return m}function T(){let $=c;return f&&D?($+=` h ${i-o}`,$+=` a ${t} ${t} 0 0 1 ${t} ${t}`,$+=` v ${l-t*2}`,$+=` a ${t} ${t} 0 0 1 -${t} ${t}`,$+=` h ${d-t*2}`):f&&S?($+=` h ${d+i-o}`,$+=` a ${t} ${t} 0 0 1 ${t} ${t}`,$+=` v ${l-t*2}`,$+=` a ${t} ${t} 0 0 1 -${t} ${t}`,$+=` h -${i-o}`):y&&D?($+=` h ${i-o}`,$+=` a ${t} ${t} 0 0 0 ${t} -${t}`,$+=` v ${l+t*2}`,$+=` a ${t} ${t} 0 0 0 -${t} -${t}`,$+=` h ${d-i+o}`):y&&S&&($+=` h ${d+i-o}`,$+=` a ${t} ${t} 0 0 0 ${t} -${t}`,$+=` v ${l+t*2}`,$+=` a ${t} ${t} 0 0 0 -${t} -${t}`,$+=` h -${i-o}`),$}function v(){function $(){return(S||D)&&f&&!b?"downSmallHorizontal":(S||D)&&y&&!b?"upSmallHorizontal":f&&D?"downLeft":f&&S?"downRight":y&&D?"upLeft":y&&S?"upRight":""}let m=c;switch($()){case"downRight":case"downSmallHorizontal":{m+=` h ${-o}`,m+=` a ${t} ${t} 0 0 0 -${t} ${t}`,m+=` v ${z-t*2}`,m+=` a ${t} ${t} 0 0 0 ${t} ${t}`,m+=` h ${o*2+d}`,m+=` a ${t} ${t} 0 0 1 ${t} ${t}`,m+=` v ${z-t*2}`,m+=` a ${t} ${t} 0 0 1 -${t} ${t}`,m+=` h ${-o}`;break}case"upRight":case"upSmallHorizontal":{m+=` h ${-o}`,m+=` a ${t} ${t} 0 0 1 -${t} -${t}`,m+=` v ${-(z-t*2)}`,m+=` a ${t} ${t} 0 0 1 ${t} -${t}`,m+=` h ${o*2+d}`,m+=` a ${t} ${t} 0 0 0 ${t} -${t}`,m+=` v ${-(z-t*2)}`,m+=` a ${t} ${t} 0 0 0 -${t} -${t}`,m+=` h ${-o}`;break}case"downLeft":{m+=` h ${-g+t}`,m+=` a ${t} ${t} 0 0 0 -${t} ${t}`,m+=` v ${x-t*2}`,m+=` a ${t} ${t} 0 0 1 -${t} ${t}`,m+=` h ${-g+t}`;break}case"upLeft":{m+=` h ${-(g-t)}`,m+=` a ${t} ${t} 0 0 1 -${t} -${t}`,m+=` v ${-(x-t*2)}`,m+=` a ${t} ${t} 0 0 0 -${t} -${t}`,m+=` h ${-g+t}`;break}default:return m}return m}function p(){let $=c;return f&&D?($+=` h ${d-i}`,$+=` a ${t} ${t} 0 0 0 -${t} ${t}`,$+=` v ${l-t*2}`,$+=` a ${t} ${t} 0 0 0 ${t} ${t}`,$+=` h ${i}`):f&&S?($+=` h ${-i}`,$+=` a ${t} ${t} 0 0 0 -${t} ${t}`,$+=` v ${l-t*2}`,$+=` a ${t} ${t} 0 0 0 ${t} ${t}`,$+=` h ${d+i}`):y&&D?($+=` h ${d-i}`,$+=` a ${t} ${t} 0 0 1 -${t} -${t}`,$+=` v ${l+t*2}`,$+=` a ${t} ${t} 0 0 1 ${t} -${t}`,$+=` h ${i}`):y&&S&&($+=` h ${-i}`,$+=` a ${t} ${t} 0 0 1 -${t} -${t}`,$+=` v ${l+t*2}`,$+=` a ${t} ${t} 0 0 1 ${t} -${t}`,$+=` h ${d+i}`),$}switch(r){case"FS":return R();case"FF":return T();case"SF":return v();case"SS":return p();default:return`${c} L ${n} ${s}`}}function kn(r,a,e,n){const s=pt,t=r.order-1,i=(a.order-1)*s+s/2-4,u=t*s+s/2+4,c=a.barLeft,d=a.barLeft+a.barWidth,l=r.barLeft+e.offsetX,h=l+r.barWidth+e.offsetWidth,x={FS:[d,l],SS:[c,l],FF:[d,h],SF:[c,h]},[y,f]=x[n];return{fromX:y,fromY:i,toX:f,toY:u}}function Tn(r,a){const e=[];for(const n of r){const s=a[n.id]??{offsetX:0,offsetWidth:0};for(const t of n.dependencies??[]){const o=r.find(l=>l.id===t.targetId);if(!o)continue;const{fromX:i,fromY:u,toX:c,toY:d}=kn(n,o,s,t.type);e.push({...t,fromX:i,fromY:u,toX:c,toY:d})}}return e}function En({transformedTasks:r}){const a=et(n=>n.dragOffsets),e=Tn(r,a);return _.jsxs("svg",{className:"gantt-dependency-arrows",style:{height:`${r.length*pt}px`},children:[_.jsx("defs",{children:_.jsx("marker",{id:"arrowhead",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",children:_.jsx("polygon",{className:"gantt-dependency-arrow-head",points:"0 0, 8 4, 0 8"})})}),e.map((n,s)=>_.jsx("path",{className:"gantt-dependency-arrow",d:On(n.type,n.fromX,n.fromY,n.toX,n.toY),markerEnd:"url(#arrowhead)",fill:"none"},`arrow-${s}`))]})}function In({selectedScale:r,onScaleChange:a}){const e=n=>{a(n.target.value)};return _.jsx("div",{className:"gantt-scale-selector",children:_.jsx("select",{className:"gantt-scale-select",value:r,onChange:e,"aria-label":"νƒ€μž„λΌμΈ μŠ€μΌ€μΌ 선택",children:Object.keys(Z).map(n=>_.jsx("option",{value:n,children:n},n))})})}function zn({bottomRowCells:r,height:a}){const e=N.useMemo(()=>{if(r.length===0)return null;const n=W();let s=0;for(let t=0;t<r.length;t++){const o=r[t],i=o.startDate,u=r[t+1],c=(u==null?void 0:u.startDate)??i.add(1,"day");if(n.isSameOrAfter(i)&&n.isBefore(c)){const d=c.diff(i),h=n.diff(i)/d;return s+h*o.widthPx}s+=o.widthPx}return null},[r]);return e===null?null:_.jsx("div",{className:"gantt-today-marker",style:{left:`${e}px`,height:`${a}px`},role:"presentation","aria-label":"Today",children:_.jsx("span",{className:"gantt-today-label",children:"Today"})})}function K(r,a,e){let n=e.initialDeps??[],s;function t(){var o,i,u,c;let d;e.key&&((o=e.debug)!=null&&o.call(e))&&(d=Date.now());const l=r();if(!(l.length!==n.length||l.some((y,f)=>n[f]!==y)))return s;n=l;let x;if(e.key&&((i=e.debug)!=null&&i.call(e))&&(x=Date.now()),s=a(...l),e.key&&((u=e.debug)!=null&&u.call(e))){const y=Math.round((Date.now()-d)*100)/100,f=Math.round((Date.now()-x)*100)/100,S=f/16,D=(b,g)=>{for(b=String(b);b.length<g;)b=" "+b;return b};console.info(`%c⏱ ${D(f,5)} /${D(y,5)} ms`,`
2
+ font-size: .6rem;
3
+ font-weight: bold;
4
+ color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,e==null?void 0:e.key)}return(c=e==null?void 0:e.onChange)==null||c.call(e,s),s}return t.updateDeps=o=>{n=o},t}function Nt(r,a){if(r===void 0)throw new Error("Unexpected undefined");return r}const Cn=(r,a)=>Math.abs(r-a)<1.01,Ln=(r,a,e)=>{let n;return function(...s){r.clearTimeout(n),n=r.setTimeout(()=>a.apply(this,s),e)}},Ft=r=>{const{offsetWidth:a,offsetHeight:e}=r;return{width:a,height:e}},Rn=r=>r,_n=r=>{const a=Math.max(r.startIndex-r.overscan,0),e=Math.min(r.endIndex+r.overscan,r.count-1),n=[];for(let s=a;s<=e;s++)n.push(s);return n},jn=(r,a)=>{const e=r.scrollElement;if(!e)return;const n=r.targetWindow;if(!n)return;const s=o=>{const{width:i,height:u}=o;a({width:Math.round(i),height:Math.round(u)})};if(s(Ft(e)),!n.ResizeObserver)return()=>{};const t=new n.ResizeObserver(o=>{const i=()=>{const u=o[0];if(u!=null&&u.borderBoxSize){const c=u.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(Ft(e))};r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return t.observe(e,{box:"border-box"}),()=>{t.unobserve(e)}},Ht={passive:!0},At=typeof window>"u"?!0:"onscrollend"in window,Pn=(r,a)=>{const e=r.scrollElement;if(!e)return;const n=r.targetWindow;if(!n)return;let s=0;const t=r.options.useScrollendEvent&&At?()=>{}:Ln(n,()=>{a(s,!1)},r.options.isScrollingResetDelay),o=d=>()=>{const{horizontal:l,isRtl:h}=r.options;s=l?e.scrollLeft*(h&&-1||1):e.scrollTop,t(),a(s,d)},i=o(!0),u=o(!1);u(),e.addEventListener("scroll",i,Ht);const c=r.options.useScrollendEvent&&At;return c&&e.addEventListener("scrollend",u,Ht),()=>{e.removeEventListener("scroll",i),c&&e.removeEventListener("scrollend",u)}},Wn=(r,a,e)=>{if(a!=null&&a.borderBoxSize){const n=a.borderBoxSize[0];if(n)return Math.round(n[e.options.horizontal?"inlineSize":"blockSize"])}return r[e.options.horizontal?"offsetWidth":"offsetHeight"]},Nn=(r,{adjustments:a=0,behavior:e},n)=>{var s,t;const o=r+a;(t=(s=n.scrollElement)==null?void 0:s.scrollTo)==null||t.call(s,{[n.options.horizontal?"left":"top"]:o,behavior:e})};class Fn{constructor(a){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const n=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(s=>{s.forEach(t=>{const o=()=>{this._measureElement(t.target,t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=n())==null||s.disconnect(),e=null},observe:s=>{var t;return(t=n())==null?void 0:t.observe(s,{box:"border-box"})},unobserve:s=>{var t;return(t=n())==null?void 0:t.unobserve(s)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([n,s])=>{typeof s>"u"&&delete e[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Rn,rangeExtractor:_n,onChange:()=>{},measureElement:Wn,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var n,s;(s=(n=this.options).onChange)==null||s.call(n,this,e)},this.maybeNotify=K(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=t,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,n)=>{const s=new Map,t=new Map;for(let o=n-1;o>=0;o--){const i=e[o];if(s.has(i.lane))continue;const u=t.get(i.lane);if(u==null||i.end>u.end?t.set(i.lane,i):i.end<u.end&&s.set(i.lane,!0),s.size===this.options.lanes)break}return t.size===this.options.lanes?Array.from(t.values()).sort((o,i)=>o.end===i.end?o.index-i.index:o.end-i.end)[0]:void 0},this.getMeasurementOptions=K(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,n,s,t,o)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:s,getItemKey:t,enabled:o}),{key:!1}),this.getMeasurements=K(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:n,scrollMargin:s,getItemKey:t,enabled:o},i)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const u=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,u);for(let d=u;d<e;d++){const l=t(d),h=this.options.lanes===1?c[d-1]:this.getFurthestMeasurement(c,d),x=h?h.end+this.options.gap:n+s,y=i.get(l),f=typeof y=="number"?y:this.options.estimateSize(d),S=x+f,D=h?h.lane:d%this.options.lanes;c[d]={index:d,start:x,size:f,end:S,key:l,lane:D}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=K(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,n,s,t)=>this.range=e.length>0&&n>0?Hn({measurements:e,outerSize:n,scrollOffset:s,lanes:t}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=K(()=>{let e=null,n=null;const s=this.calculateRange();return s&&(e=s.startIndex,n=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,n]},(e,n,s,t,o)=>t===null||o===null?[]:e({startIndex:t,endIndex:o,overscan:n,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const n=this.options.indexAttribute,s=e.getAttribute(n);return s?parseInt(s,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(e,n)=>{const s=this.indexFromElement(e),t=this.measurementsCache[s];if(!t)return;const o=t.key,i=this.elementsCache.get(o);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(s,this.options.measureElement(e,n,this))},this.resizeItem=(e,n)=>{const s=this.measurementsCache[e];if(!s)return;const t=this.itemSizeCache.get(s.key)??s.size,o=n-t;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,o,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",o),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,n)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((n,s)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(s))});return}this._measureElement(e,void 0)},this.getVirtualItems=K(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,n)=>{const s=[];for(let t=0,o=e.length;t<o;t++){const i=e[t],u=n[i];s.push(u)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const n=this.getMeasurements();if(n.length!==0)return Nt(n[Vt(0,n.length-1,s=>Nt(n[s]).start,e)])},this.getOffsetForAlignment=(e,n,s=0)=>{const t=this.getSize(),o=this.getScrollOffset();n==="auto"&&(n=e>=o+t?"end":"start"),n==="center"?e+=(s-t)/2:n==="end"&&(e-=t);const i=this.getTotalSize()+this.options.scrollMargin-t;return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,n="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const s=this.measurementsCache[e];if(!s)return;const t=this.getSize(),o=this.getScrollOffset();if(n==="auto")if(s.end>=o+t-this.options.scrollPaddingEnd)n="end";else if(s.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];const i=n==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,n,s.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:n="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,n),{adjustments:void 0,behavior:s})},this.scrollToIndex=(e,{align:n="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let t=0;const o=10,i=c=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(e,c);if(!d){console.warn("Failed to get offset for index:",e);return}const[l,h]=d;this._scrollToOffset(l,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const x=this.getScrollOffset(),y=this.getOffsetForIndex(e,h);if(!y){console.warn("Failed to get offset for index:",e);return}Cn(y[0],x)||u(h)})},u=c=>{this.targetWindow&&(t++,t<o?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",t,o),this.targetWindow.requestAnimationFrame(()=>i(c))):console.warn(`Failed to scroll to index ${e} after ${o} attempts.`))};i(n)},this.scrollBy=(e,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var e;const n=this.getMeasurements();let s;if(n.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((e=n[n.length-1])==null?void 0:e.end)??0;else{const t=Array(this.options.lanes).fill(null);let o=n.length-1;for(;o>=0&&t.some(i=>i===null);){const i=n[o];t[i.lane]===null&&(t[i.lane]=i.end),o--}s=Math.max(...t.filter(i=>i!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:n,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(a)}}const Vt=(r,a,e,n)=>{for(;r<=a;){const s=(r+a)/2|0,t=e(s);if(t<n)r=s+1;else if(t>n)a=s-1;else return s}return r>0?r-1:0};function Hn({measurements:r,outerSize:a,scrollOffset:e,lanes:n}){const s=r.length-1,t=u=>r[u].start;if(r.length<=n)return{startIndex:0,endIndex:s};let o=Vt(0,s,t,e),i=o;if(n===1)for(;i<s&&r[i].end<e+a;)i++;else if(n>1){const u=Array(n).fill(0);for(;i<s&&u.some(d=>d<e+a);){const d=r[i];u[d.lane]=d.end,i++}const c=Array(n).fill(e+a);for(;o>=0&&c.some(d=>d>=e);){const d=r[o];c[d.lane]=d.start,o--}o=Math.max(0,o-o%n),i=Math.min(s,i+(n-1-i%n))}return{startIndex:o,endIndex:i}}const Yt=typeof document<"u"?gt.useLayoutEffect:gt.useEffect;function An(r){const a=gt.useReducer(()=>({}),{})[1],e={...r,onChange:(s,t)=>{var o;t?Gt.flushSync(a):a(),(o=r.onChange)==null||o.call(r,s,t)}},[n]=gt.useState(()=>new Fn(e));return n.setOptions(e),Yt(()=>n._didMount(),[]),Yt(()=>n._willUpdate()),n}function Ut(r){return An({observeElementRect:jn,observeElementOffset:Pn,scrollToFn:Nn,...r})}function Yn({transformedTasks:r,bottomRowCells:a,scrollRef:e}){var d;const n=Ut({count:r.length,getScrollElement:()=>e.current,estimateSize:()=>pt,overscan:5}),s=Ut({horizontal:!0,count:a.length,getScrollElement:()=>e.current,estimateSize:l=>{var h;return((h=a[l])==null?void 0:h.widthPx)??32},overscan:5}),t=s.getVirtualItems(),o=((d=t[0])==null?void 0:d.start)??0,i=t[t.length-1],u=i?i.start+i.size:0,c=N.useMemo(()=>(l,h)=>l+h>=o&&l<=u,[o,u]);return N.useEffect(()=>{if(!a.length)return;const l=requestAnimationFrame(()=>{s.measure()});return()=>cancelAnimationFrame(l)},[a,s]),{rowVirtualizer:n,columnVirtualizer:s,isBarVisible:c}}function Un(r,a="gantt-container"){const[e,n]=N.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");N.useEffect(()=>{if(typeof window>"u")return;const i=window.matchMedia("(prefers-color-scheme: dark)"),u=c=>{n(c.matches?"dark":"light")};return i.addEventListener("change",u),()=>i.removeEventListener("change",u)},[]);const s=N.useMemo(()=>!r||r==="system"?e:r,[r,e]),t=N.useMemo(()=>{const i=[a];return r&&i.push(s),i.join(" ")},[a,r,s]);return{resolvedTheme:s,containerClassName:t,dataTheme:r?s:void 0}}const qn=600,Bn="100%",Vn="month";function Gn({tasks:r=[],onTasksChange:a,height:e=qn,width:n=Bn,theme:s,defaultScale:t=Vn,className:o}){const{rawTasks:i,transformedTasks:u,bottomRowCells:c,selectedScale:d,setRawTasks:l,setTransformedTasks:h,setBottomRowCells:x,setSelectedScale:y,getTotalWidth:f}=Bt(),S=N.useRef(null),{rowVirtualizer:D,isBarVisible:b}=Yn({transformedTasks:u,bottomRowCells:c,scrollRef:S}),{containerClassName:g,dataTheme:z}=Un(s,o?`gantt-container ${o}`:"gantt-container");N.useEffect(()=>{t&&t!==d&&y(t)},[]),N.useEffect(()=>{r.length>0&&l(r)},[r,l]),N.useEffect(()=>{if(!i.length)return;const{bottomCells:p,transformedTasks:$}=wn(i,d);x(p),h($)},[i,d,x,h]);const R=p=>{y(p)},T=f(),v={height:typeof e=="number"?`${e}px`:e,width:typeof n=="number"?`${n}px`:n};return _.jsx("section",{className:g,"data-theme":z,style:v,children:_.jsx("div",{className:"gantt-inner",children:_.jsxs("section",{className:"gantt-section",children:[_.jsx(In,{selectedScale:d,onScaleChange:R}),_.jsxs("div",{ref:S,className:"gantt-list",children:[_.jsx(Dn,{bottomRowCells:c,selectedScale:d,width:T,scrollRef:S}),_.jsxs("div",{className:"gantt-content",style:{height:`${D.getTotalSize()}px`,width:`${T}px`},children:[_.jsx(zn,{bottomRowCells:c,height:D.getTotalSize()}),_.jsx(En,{transformedTasks:u}),D.getVirtualItems().map(p=>{const $=u[p.index],m=$.barLeft??0,k=$.barWidth??0;return _.jsx("div",{className:"gantt-task-row",style:{height:`${p.size-1}px`,transform:`translateY(${p.start}px)`},children:b(m,k)&&_.jsx(dn,{currentTask:$,onTasksChange:a})},$.id)})]})]})]})})})}exports.ReactGanttChart=Gn;