@jaeungkim/gantt-chart 0.3.0 → 0.3.1

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.
@@ -1 +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}}
1
+ @import"https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&display=swap";:root{--font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--background: #fafafa;--foreground: #18181b;--muted: #f4f4f5;--muted-foreground: #71717a;--border: #e4e4e7;--border-subtle: rgba(0, 0, 0, .04);--bar-bg: #e4e4e7;--bar-bg-hover: #d4d4d8;--bar-text: #18181b;--bar-shadow: 0 1px 2px rgba(0, 0, 0, .05);--bar-shadow-hover: 0 4px 12px rgba(0, 0, 0, .1);--bar-shadow-drag: 0 8px 24px rgba(0, 0, 0, .15);--arrow: #a1a1aa;--accent: #3b82f6;--transition-fast: .15s ease;--transition-normal: .2s ease}.dark,[data-theme=dark]{--background: #09090b;--foreground: #fafafa;--muted: #18181b;--muted-foreground: #a1a1aa;--border: #27272a;--border-subtle: rgba(255, 255, 255, .04);--bar-bg: #27272a;--bar-bg-hover: #3f3f46;--bar-text: #fafafa;--bar-shadow: 0 1px 2px rgba(0, 0, 0, .2);--bar-shadow-hover: 0 4px 12px rgba(0, 0, 0, .3);--bar-shadow-drag: 0 8px 24px rgba(0, 0, 0, .4);--arrow: #71717a}.gantt-container{display:flex;flex-direction:column;overflow:hidden;background:var(--background);font-family:var(--font-sans);font-size:13px;line-height:1.5;color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.gantt-toolbar{flex-shrink:0;display:flex;align-items:center;justify-content:flex-end;padding:12px 16px;background:var(--background);border-bottom:1px solid var(--border)}.gantt-scale-selector{display:inline-flex}.gantt-scale-control{display:flex;gap:2px;padding:3px;background:var(--muted);border-radius:8px;border:1px solid var(--border)}.gantt-scale-button{position:relative;padding:6px 14px;font-family:inherit;font-size:12px;font-weight:500;color:var(--muted-foreground);background:transparent;border:none;border-radius:6px;cursor:pointer;transition:all var(--transition-fast);text-transform:capitalize}.gantt-scale-button:hover{color:var(--foreground)}.gantt-scale-button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.gantt-scale-button[data-active=true]{color:var(--foreground);background:var(--background);box-shadow:0 1px 3px #00000014}.gantt-main{flex:1;min-height:0;overflow:hidden}.gantt-scroll-container{width:100%;height:100%;overflow:auto}.gantt-scroll-container::-webkit-scrollbar{width:10px;height:10px}.gantt-scroll-container::-webkit-scrollbar-track{background:transparent}.gantt-scroll-container::-webkit-scrollbar-thumb{background:var(--border);border-radius:5px;border:2px solid var(--background)}.gantt-scroll-container::-webkit-scrollbar-thumb:hover{background:var(--muted-foreground)}.gantt-scroll-container::-webkit-scrollbar-corner{background:transparent}.gantt-header-wrapper{position:sticky;top:0;z-index:30}.gantt-header{position:relative;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:44px;border-bottom:1px solid var(--border-subtle)}.gantt-top-groups{display:flex}.gantt-top-group{display:flex;align-items:center;padding:0 16px;font-size:13px;font-weight:600;letter-spacing:-.01em;background:var(--background);color:var(--foreground)}.gantt-top-group.sticky{position:sticky;left:0;z-index:1}.gantt-top-group-label{margin:0;padding:0;white-space:nowrap}.gantt-bottom-row{display:flex;height:28px;background:var(--muted)}.gantt-bottom-cell{display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:500;color:var(--muted-foreground);letter-spacing:.01em}.gantt-content{position:relative;background:var(--background)}.gantt-rows{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;pointer-events:none}.gantt-task-row{position:absolute;top:0;left:0;display:flex;width:100%;align-items:center;border-bottom:1px solid var(--border-subtle);pointer-events: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.5;fill:none}.gantt-dependency-arrow-head{fill:var(--arrow);stroke:none}.gantt-task-bar{position:relative;z-index:10;display:flex;align-items:center;background:var(--bar-bg);border-radius:6px;-webkit-user-select:none;user-select:none;cursor:grab;box-shadow:var(--bar-shadow);transition:background var(--transition-fast),box-shadow var(--transition-normal)}.gantt-task-bar:before,.gantt-task-bar:after{content:"";position:absolute;top:50%;width:3px;height:12px;background:var(--muted-foreground);border-radius:2px;opacity:0;transform:translateY(-50%);transition:opacity var(--transition-fast)}.gantt-task-bar:before{left:4px}.gantt-task-bar:after{right:4px}.gantt-task-bar:hover{background:var(--bar-bg-hover);box-shadow:var(--bar-shadow-hover)}.gantt-task-bar:hover:before,.gantt-task-bar:hover:after{opacity:.5}.gantt-task-bar:active,.gantt-task-bar.dragging{cursor:grabbing;box-shadow:var(--bar-shadow-drag);z-index:100}.gantt-task-bar.dragging:before,.gantt-task-bar.dragging:after{opacity:.7}.gantt-task-name{flex:1;padding:0 14px;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-bar-tooltip{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translate(-50%);z-index:200;padding:8px 12px;background:var(--foreground);color:var(--background);border-radius:6px;font-family:inherit;font-size:11px;font-weight:500;white-space:nowrap;box-shadow:0 4px 16px #00000026;pointer-events:none;animation:tooltipFadeIn var(--transition-fast) ease-out}@keyframes tooltipFadeIn{0%{opacity:0;transform:translate(-50%) translateY(4px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.gantt-bar-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%);border:5px solid transparent;border-top-color:var(--foreground)}@media (max-width: 768px){.gantt-toolbar{padding:8px 12px}.gantt-scale-button{padding:5px 10px;font-size:11px}.gantt-top-group{font-size:12px;padding:0 12px}.gantt-bottom-cell{font-size:10px}.gantt-task-name{font-size:11px;padding:0 10px}}
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
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`,`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),j=require("react"),Xt=require("react-dom");function Zt(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const n in s)if(n!=="default"){const e=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(a,n,e.get?e:{enumerable:!0,get:()=>s[n]})}}return a.default=s,Object.freeze(a)}const $t=Zt(j),vt=38,Jt=5,K={day:{labelUnit:"day",tickUnit:"hour",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:1,basePxPerDragStep:32,formatTickLabel:s=>s.format("hh"),formatHeaderLabel:s=>s.format("MMM D")},week:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:6,basePxPerDragStep:54,formatTickLabel:s=>s.format("D"),formatHeaderLabel:s=>s.format("MMM")},month:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:32,formatTickLabel:s=>s.format("D"),formatHeaderLabel:s=>s.format("MMM YYYY")},year:{labelUnit:"month",tickUnit:"month",unitPerTick:1,dragStepUnit:"day",dragStepAmount:7,basePxPerDragStep:28,formatTickLabel:s=>s.format("D"),formatHeaderLabel:s=>s.format("MMM YYYY")}},yt=s=>{let a;const n=new Set,e=(c,d)=>{const f=typeof c=="function"?c(a):c;if(!Object.is(f,a)){const h=a;a=d??(typeof f!="object"||f===null)?f:Object.assign({},a,f),n.forEach(y=>y(a,h))}},r=()=>a,i={setState:e,getState:r,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=a=s(e,r,i);return i},Kt=(s=>s?yt(s):yt),Qt=s=>s;function te(s,a=Qt){const n=j.useSyncExternalStore(s.subscribe,j.useCallback(()=>a(s.getState()),[s,a]),j.useCallback(()=>a(s.getInitialState()),[s,a]));return j.useDebugValue(n),n}const ee=s=>{const a=Kt(s),n=e=>te(a,e);return Object.assign(n,a),n},ne=(s=>ee);function Vt(s,a){let n;try{n=s()}catch{return}return{getItem:r=>{var t;const o=u=>u===null?null:JSON.parse(u,void 0),i=(t=n.getItem(r))!=null?t:null;return i instanceof Promise?i.then(o):o(i)},setItem:(r,t)=>n.setItem(r,JSON.stringify(t,void 0)),removeItem:r=>n.removeItem(r)}}const St=s=>a=>{try{const n=s(a);return n instanceof Promise?n:{then(e){return St(e)(n)},catch(e){return this}}}catch(n){return{then(e){return this},catch(e){return St(e)(n)}}}},re=(s,a)=>(n,e,r)=>{let t={storage:Vt(()=>localStorage),partialize:l=>l,version:0,merge:(l,v)=>({...v,...l}),...a},o=!1;const i=new Set,u=new Set;let c=t.storage;if(!c)return s((...l)=>{console.warn(`[zustand persist middleware] Unable to update item '${t.name}', the given storage is currently unavailable.`),n(...l)},e,r);const d=()=>{const l=t.partialize({...e()});return c.setItem(t.name,{state:l,version:t.version})},f=r.setState;r.setState=(l,v)=>(f(l,v),d());const h=s((...l)=>(n(...l),d()),e,r);r.getInitialState=()=>h;let y;const S=()=>{var l,v;if(!c)return;o=!1,i.forEach(D=>{var x;return D((x=e())!=null?x:h)});const p=((v=t.onRehydrateStorage)==null?void 0:v.call(t,(l=e())!=null?l:h))||void 0;return St(c.getItem.bind(c))(t.name).then(D=>{if(D)if(typeof D.version=="number"&&D.version!==t.version){if(t.migrate){const x=t.migrate(D.state,D.version);return x instanceof Promise?x.then(z=>[!0,z]):[!0,x]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,D.state];return[!1,void 0]}).then(D=>{var x;const[z,R]=D;if(y=t.merge(R,(x=e())!=null?x:h),n(y,!0),z)return d()}).then(()=>{p==null||p(y,void 0),y=e(),o=!0,u.forEach(D=>D(y))}).catch(D=>{p==null||p(void 0,D)})};return r.persist={setOptions:l=>{t={...t,...l},l.storage&&(c=l.storage)},clearStorage:()=>{c==null||c.removeItem(t.name)},getOptions:()=>t,rehydrate:()=>S(),hasHydrated:()=>o,onHydrate:l=>(i.add(l),()=>{i.delete(l)}),onFinishHydration:l=>(u.add(l),()=>{u.delete(l)})},t.skipHydration||S(),y||h},se=re,q=ne()(se((s,a)=>({rawTasks:[],transformedTasks:[],bottomRowCells:[],selectedScale:"month",currentTask:null,dragOffsets:{},setCurrentTask:n=>s({currentTask:n}),setSelectedScale:n=>s({selectedScale:n}),setRawTasks:n=>s({rawTasks:n}),setBottomRowCells:n=>s({bottomRowCells:n}),setTransformedTasks:n=>s({transformedTasks:n}),setDragOffset:(n,e)=>s(r=>({dragOffsets:{...r.dragOffsets,[n]:e}})),clearDragOffset:n=>s(e=>{const{[n]:r,...t}=e.dragOffsets;return{dragOffsets:t}}),getCurrentDragOffset:n=>a().dragOffsets[n]||null,getTotalWidth:()=>a().bottomRowCells.reduce((e,r)=>e+r.widthPx,0)}),{name:"gantt-storage",storage:Vt(()=>sessionStorage),partialize:s=>({selectedScale:s.selectedScale})}));function B(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var st={exports:{}},ie=st.exports,xt;function oe(){return xt||(xt=1,(function(s,a){(function(n,e){s.exports=e()})(ie,(function(){var n=1e3,e=6e4,r=36e5,t="millisecond",o="second",i="minute",u="hour",c="day",d="week",f="month",h="quarter",y="year",S="date",l="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|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,D={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"],b=E%100;return"["+E+(O[(b-20)%10]||O[b]||O[0])+"]"}},x=function(E,O,b){var I=String(E);return!I||I.length>=O?E:""+Array(O+1-I.length).join(b)+E},z={s:x,z:function(E){var O=-E.utcOffset(),b=Math.abs(O),I=Math.floor(b/60),M=b%60;return(O<=0?"+":"-")+x(I,2,"0")+":"+x(M,2,"0")},m:function E(O,b){if(O.date()<b.date())return-E(b,O);var I=12*(b.year()-O.year())+(b.month()-O.month()),M=O.clone().add(I,f),C=b-M<0,L=O.clone().add(I+(C?-1:1),f);return+(-(I+(b-M)/(C?M-L:L-M))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:f,y,w:d,d:c,D:S,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",k={};k[R]=D;var w="$isDayjsObject",$=function(E){return E instanceof W||!(!E||!E[w])},g=function E(O,b,I){var M;if(!O)return R;if(typeof O=="string"){var C=O.toLowerCase();k[C]&&(M=C),b&&(k[C]=b,M=C);var L=O.split("-");if(!M&&L.length>1)return E(L[0])}else{var _=O.name;k[_]=O,M=_}return!I&&M&&(R=M),M||!I&&R},m=function(E,O){if($(E))return E.clone();var b=typeof O=="object"?O:{};return b.date=E,b.args=arguments,new W(b)},T=z;T.l=g,T.i=$,T.w=function(E,O){return m(E,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var W=(function(){function E(b){this.$L=g(b.locale,null,!0),this.parse(b),this.$x=this.$x||b.x||{},this[w]=!0}var O=E.prototype;return O.parse=function(b){this.$d=(function(I){var M=I.date,C=I.utc;if(M===null)return new Date(NaN);if(T.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var L=M.match(v);if(L){var _=L[2]-1||0,A=(L[7]||"0").substring(0,3);return C?new Date(Date.UTC(L[1],_,L[3]||1,L[4]||0,L[5]||0,L[6]||0,A)):new Date(L[1],_,L[3]||1,L[4]||0,L[5]||0,L[6]||0,A)}}return new Date(M)})(b),this.init()},O.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},O.$utils=function(){return T},O.isValid=function(){return this.$d.toString()!==l},O.isSame=function(b,I){var M=m(b);return this.startOf(I)<=M&&M<=this.endOf(I)},O.isAfter=function(b,I){return m(b)<this.startOf(I)},O.isBefore=function(b,I){return this.endOf(I)<m(b)},O.$g=function(b,I,M){return T.u(b)?this[I]:this.set(M,b)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(b,I){var M=this,C=!!T.u(I)||I,L=T.p(b),_=function(Z,U){var G=T.w(M.$u?Date.UTC(M.$y,U,Z):new Date(M.$y,U,Z),M);return C?G:G.endOf(c)},A=function(Z,U){return T.w(M.toDate()[Z].apply(M.toDate("s"),(C?[0,0,0,0]:[23,59,59,999]).slice(U)),M)},F=this.$W,Y=this.$M,V=this.$D,Q="set"+(this.$u?"UTC":"");switch(L){case y:return C?_(1,0):_(31,11);case f:return C?_(1,Y):_(0,Y+1);case d:var X=this.$locale().weekStart||0,et=(F<X?F+7:F)-X;return _(C?V-et:V+(6-et),Y);case c:case S:return A(Q+"Hours",0);case u:return A(Q+"Minutes",1);case i:return A(Q+"Seconds",2);case o:return A(Q+"Milliseconds",3);default:return this.clone()}},O.endOf=function(b){return this.startOf(b,!1)},O.$set=function(b,I){var M,C=T.p(b),L="set"+(this.$u?"UTC":""),_=(M={},M[c]=L+"Date",M[S]=L+"Date",M[f]=L+"Month",M[y]=L+"FullYear",M[u]=L+"Hours",M[i]=L+"Minutes",M[o]=L+"Seconds",M[t]=L+"Milliseconds",M)[C],A=C===c?this.$D+(I-this.$W):I;if(C===f||C===y){var F=this.clone().set(S,1);F.$d[_](A),F.init(),this.$d=F.set(S,Math.min(this.$D,F.daysInMonth())).$d}else _&&this.$d[_](A);return this.init(),this},O.set=function(b,I){return this.clone().$set(b,I)},O.get=function(b){return this[T.p(b)]()},O.add=function(b,I){var M,C=this;b=Number(b);var L=T.p(I),_=function(Y){var V=m(C);return T.w(V.date(V.date()+Math.round(Y*b)),C)};if(L===f)return this.set(f,this.$M+b);if(L===y)return this.set(y,this.$y+b);if(L===c)return _(1);if(L===d)return _(7);var A=(M={},M[i]=e,M[u]=r,M[o]=n,M)[L]||1,F=this.$d.getTime()+b*A;return T.w(F,this)},O.subtract=function(b,I){return this.add(-1*b,I)},O.format=function(b){var I=this,M=this.$locale();if(!this.isValid())return M.invalidDate||l;var C=b||"YYYY-MM-DDTHH:mm:ssZ",L=T.z(this),_=this.$H,A=this.$m,F=this.$M,Y=M.weekdays,V=M.months,Q=M.meridiem,X=function(U,G,nt,rt){return U&&(U[G]||U(I,C))||nt[G].slice(0,rt)},et=function(U){return T.s(_%12||12,U,"0")},Z=Q||function(U,G,nt){var rt=U<12?"AM":"PM";return nt?rt.toLowerCase():rt};return C.replace(p,(function(U,G){return G||(function(nt){switch(nt){case"YY":return String(I.$y).slice(-2);case"YYYY":return T.s(I.$y,4,"0");case"M":return F+1;case"MM":return T.s(F+1,2,"0");case"MMM":return X(M.monthsShort,F,V,3);case"MMMM":return X(V,F);case"D":return I.$D;case"DD":return T.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return X(M.weekdaysMin,I.$W,Y,2);case"ddd":return X(M.weekdaysShort,I.$W,Y,3);case"dddd":return Y[I.$W];case"H":return String(_);case"HH":return T.s(_,2,"0");case"h":return et(1);case"hh":return et(2);case"a":return Z(_,A,!0);case"A":return Z(_,A,!1);case"m":return String(A);case"mm":return T.s(A,2,"0");case"s":return String(I.$s);case"ss":return T.s(I.$s,2,"0");case"SSS":return T.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(b,I,M){var C,L=this,_=T.p(I),A=m(b),F=(A.utcOffset()-this.utcOffset())*e,Y=this-A,V=function(){return T.m(L,A)};switch(_){case y:C=V()/12;break;case f:C=V();break;case h:C=V()/3;break;case d:C=(Y-F)/6048e5;break;case c:C=(Y-F)/864e5;break;case u:C=Y/r;break;case i:C=Y/e;break;case o:C=Y/n;break;default:C=Y}return M?C:T.a(C)},O.daysInMonth=function(){return this.endOf(f).$D},O.$locale=function(){return k[this.$L]},O.locale=function(b,I){if(!b)return this.$L;var M=this.clone(),C=g(b,I,!0);return C&&(M.$L=C),M},O.clone=function(){return T.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})(),H=W.prototype;return m.prototype=H,[["$ms",t],["$s",o],["$m",i],["$H",u],["$W",c],["$M",f],["$y",y],["$D",S]].forEach((function(E){H[E[1]]=function(O){return this.$g(O,E[0],E[1])}})),m.extend=function(E,O){return E.$i||(E(O,W,m),E.$i=!0),m},m.locale=g,m.isDayjs=$,m.unix=function(E){return m(1e3*E)},m.en=k[R],m.Ls=k,m.p={},m}))})(st)),st.exports}var ae=oe();const N=B(ae);var it={exports:{}},ue=it.exports,bt;function ce(){return bt||(bt=1,(function(s,a){(function(n,e){s.exports=e()})(ue,(function(){var n,e,r=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,f=/^(-|\+)?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:r,milliseconds:1,weeks:6048e5},y=function(k){return k instanceof z},S=function(k,w,$){return new z(k,$,w.$l)},l=function(k){return e.p(k)+"s"},v=function(k){return k<0},p=function(k){return v(k)?Math.ceil(k):Math.floor(k)},D=function(k){return Math.abs(k)},x=function(k,w){return k?v(k)?{negative:!0,format:""+D(k)+w}:{negative:!1,format:""+k+w}:{negative:!1,format:""}},z=(function(){function k($,g,m){var T=this;if(this.$d={},this.$l=m,$===void 0&&(this.$ms=0,this.parseFromMilliseconds()),g)return S($*h[l(g)],this);if(typeof $=="number")return this.$ms=$,this.parseFromMilliseconds(),this;if(typeof $=="object")return Object.keys($).forEach((function(E){T.$d[l(E)]=$[E]})),this.calMilliseconds(),this;if(typeof $=="string"){var W=$.match(f);if(W){var H=W.slice(2).map((function(E){return E!=null?Number(E):0}));return this.$d.years=H[0],this.$d.months=H[1],this.$d.weeks=H[2],this.$d.days=H[3],this.$d.hours=H[4],this.$d.minutes=H[5],this.$d.seconds=H[6],this.calMilliseconds(),this}}return this}var w=k.prototype;return w.calMilliseconds=function(){var $=this;this.$ms=Object.keys(this.$d).reduce((function(g,m){return g+($.$d[m]||0)*h[m]}),0)},w.parseFromMilliseconds=function(){var $=this.$ms;this.$d.years=p($/c),$%=c,this.$d.months=p($/d),$%=d,this.$d.days=p($/i),$%=i,this.$d.hours=p($/o),$%=o,this.$d.minutes=p($/t),$%=t,this.$d.seconds=p($/r),$%=r,this.$d.milliseconds=$},w.toISOString=function(){var $=x(this.$d.years,"Y"),g=x(this.$d.months,"M"),m=+this.$d.days||0;this.$d.weeks&&(m+=7*this.$d.weeks);var T=x(m,"D"),W=x(this.$d.hours,"H"),H=x(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=x(E,"S"),b=$.negative||g.negative||T.negative||W.negative||H.negative||O.negative,I=W.format||H.format||O.format?"T":"",M=(b?"-":"")+"P"+$.format+g.format+T.format+I+W.format+H.format+O.format;return M==="P"||M==="-P"?"P0D":M},w.toJSON=function(){return this.toISOString()},w.format=function($){var g=$||"YYYY-MM-DDTHH:mm:ss",m={Y:this.$d.years,YY:e.s(this.$d.years,2,"0"),YYYY:e.s(this.$d.years,4,"0"),M:this.$d.months,MM:e.s(this.$d.months,2,"0"),D:this.$d.days,DD:e.s(this.$d.days,2,"0"),H:this.$d.hours,HH:e.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:e.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:e.s(this.$d.seconds,2,"0"),SSS:e.s(this.$d.milliseconds,3,"0")};return g.replace(u,(function(T,W){return W||String(m[T])}))},w.as=function($){return this.$ms/h[l($)]},w.get=function($){var g=this.$ms,m=l($);return m==="milliseconds"?g%=1e3:g=m==="weeks"?p(g/h[m]):this.$d[m],g||0},w.add=function($,g,m){var T;return T=g?$*h[l(g)]:y($)?$.$ms:S($,this).$ms,S(this.$ms+T*(m?-1:1),this)},w.subtract=function($,g){return this.add($,g,!0)},w.locale=function($){var g=this.clone();return g.$l=$,g},w.clone=function(){return S(this.$ms,this)},w.humanize=function($){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!$)},w.valueOf=function(){return this.asMilliseconds()},w.milliseconds=function(){return this.get("milliseconds")},w.asMilliseconds=function(){return this.as("milliseconds")},w.seconds=function(){return this.get("seconds")},w.asSeconds=function(){return this.as("seconds")},w.minutes=function(){return this.get("minutes")},w.asMinutes=function(){return this.as("minutes")},w.hours=function(){return this.get("hours")},w.asHours=function(){return this.as("hours")},w.days=function(){return this.get("days")},w.asDays=function(){return this.as("days")},w.weeks=function(){return this.get("weeks")},w.asWeeks=function(){return this.as("weeks")},w.months=function(){return this.get("months")},w.asMonths=function(){return this.as("months")},w.years=function(){return this.get("years")},w.asYears=function(){return this.as("years")},k})(),R=function(k,w,$){return k.add(w.years()*$,"y").add(w.months()*$,"M").add(w.days()*$,"d").add(w.hours()*$,"h").add(w.minutes()*$,"m").add(w.seconds()*$,"s").add(w.milliseconds()*$,"ms")};return function(k,w,$){n=$,e=$().$utils(),$.duration=function(T,W){var H=$.locale();return S(T,{$l:H},W)},$.isDuration=y;var g=w.prototype.add,m=w.prototype.subtract;w.prototype.add=function(T,W){return y(T)?R(this,T,1):g.bind(this)(T,W)},w.prototype.subtract=function(T,W){return y(T)?R(this,T,-1):m.bind(this)(T,W)}}}))})(it)),it.exports}var le=ce();const fe=B(le);var ot={exports:{}},de=ot.exports,wt;function he(){return wt||(wt=1,(function(s,a){(function(n,e){s.exports=e()})(de,(function(){return function(n,e,r){e.prototype.isBetween=function(t,o,i,u){var c=r(t),d=r(o),f=(u=u||"()")[0]==="(",h=u[1]===")";return(f?this.isAfter(c,i):!this.isBefore(c,i))&&(h?this.isBefore(d,i):!this.isAfter(d,i))||(f?this.isBefore(c,i):!this.isAfter(c,i))&&(h?this.isAfter(d,i):!this.isBefore(d,i))}}}))})(ot)),ot.exports}var me=he();const ge=B(me);var at={exports:{}},pe=at.exports,Mt;function $e(){return Mt||(Mt=1,(function(s,a){(function(n,e){s.exports=e()})(pe,(function(){var n="day";return function(e,r,t){var o=function(c){return c.add(4-c.isoWeekday(),n)},i=r.prototype;i.isoWeekYear=function(){return o(this).year()},i.isoWeek=function(c){if(!this.$utils().u(c))return this.add(7*(c-this.isoWeek()),n);var d,f,h,y,S=o(this),l=(d=this.isoWeekYear(),f=this.$u,h=(f?t.utc:t)().year(d).startOf("year"),y=4-h.isoWeekday(),h.isoWeekday()>4&&(y+=7),h.add(y,n));return S.diff(l,"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 f=this.$utils(),h=!!f.u(d)||d;return f.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)}}}))})(at)),at.exports}var ve=$e();const Se=B(ve);var ut={exports:{}},ye=ut.exports,Dt;function xe(){return Dt||(Dt=1,(function(s,a){(function(n,e){s.exports=e()})(ye,(function(){return function(n,e){e.prototype.isSameOrAfter=function(r,t){return this.isSame(r,t)||this.isAfter(r,t)}}}))})(ut)),ut.exports}var be=xe();const we=B(be);var ct={exports:{}},Me=ct.exports,Ot;function De(){return Ot||(Ot=1,(function(s,a){(function(n,e){s.exports=e()})(Me,(function(){return function(n,e){e.prototype.isSameOrBefore=function(r,t){return this.isSame(r,t)||this.isBefore(r,t)}}}))})(ct)),ct.exports}var Oe=De();const ke=B(Oe);var lt={exports:{}},Te=lt.exports,kt;function Ee(){return kt||(kt=1,(function(s,a){(function(n,e){s.exports=e()})(Te,(function(){return function(n,e,r){e.prototype.isToday=function(){var t="YYYY-MM-DD",o=r();return this.format(t)===o.format(t)}}}))})(lt)),lt.exports}var Ie=Ee();const ze=B(Ie);var ft={exports:{}},Ce=ft.exports,Tt;function Le(){return Tt||(Tt=1,(function(s,a){(function(n,e){s.exports=e()})(Ce,(function(){return function(n,e,r){var t=e.prototype,o=function(f){return f&&(f.indexOf?f:f.s)},i=function(f,h,y,S,l){var v=f.name?f:f.$locale(),p=o(v[h]),D=o(v[y]),x=p||D.map((function(R){return R.slice(0,S)}));if(!l)return x;var z=v.weekStart;return x.map((function(R,k){return x[(k+(z||0))%7]}))},u=function(){return r.Ls[r.locale()]},c=function(f,h){return f.formats[h]||(function(y){return y.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,l,v){return l||v.slice(1)}))})(f.formats[h.toUpperCase()])},d=function(){var f=this;return{months:function(h){return h?h.format("MMMM"):i(f,"months")},monthsShort:function(h){return h?h.format("MMM"):i(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(h){return h?h.format("dddd"):i(f,"weekdays")},weekdaysMin:function(h){return h?h.format("dd"):i(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(h){return h?h.format("ddd"):i(f,"weekdaysShort","weekdays",3)},longDateFormat:function(h){return c(f.$locale(),h)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};t.localeData=function(){return d.bind(this)()},r.localeData=function(){var f=u();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return r.weekdays()},weekdaysShort:function(){return r.weekdaysShort()},weekdaysMin:function(){return r.weekdaysMin()},months:function(){return r.months()},monthsShort:function(){return r.monthsShort()},longDateFormat:function(h){return c(f,h)},meridiem:f.meridiem,ordinal:f.ordinal}},r.months=function(){return i(u(),"months")},r.monthsShort=function(){return i(u(),"monthsShort","months",3)},r.weekdays=function(f){return i(u(),"weekdays",null,null,f)},r.weekdaysShort=function(f){return i(u(),"weekdaysShort","weekdays",3,f)},r.weekdaysMin=function(f){return i(u(),"weekdaysMin","weekdays",2,f)}}}))})(ft)),ft.exports}var Re=Le();const Pe=B(Re);var dt={exports:{}},_e=dt.exports,Et;function je(){return Et||(Et=1,(function(s,a){(function(n,e){s.exports=e()})(_e,(function(){return function(n,e,r){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};r.max=function(){var o=[].slice.call(arguments,0);return t("isAfter",o)},r.min=function(){var o=[].slice.call(arguments,0);return t("isBefore",o)}}}))})(dt)),dt.exports}var We=je();const Ne=B(We);var ht={exports:{}},Ae=ht.exports,It;function Fe(){return It||(It=1,(function(s,a){(function(n,e){s.exports=e()})(Ae,(function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(r,t,o){var i,u=function(h,y,S){S===void 0&&(S={});var l=new Date(h),v=(function(p,D){D===void 0&&(D={});var x=D.timeZoneName||"short",z=p+"|"+x,R=e[z];return R||(R=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:p,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),e[z]=R),R})(y,S);return v.formatToParts(l)},c=function(h,y){for(var S=u(h,y),l=[],v=0;v<S.length;v+=1){var p=S[v],D=p.type,x=p.value,z=n[D];z>=0&&(l[z]=parseInt(x,10))}var R=l[3],k=R===24?0:R,w=l[0]+"-"+l[1]+"-"+l[2]+" "+k+":"+l[4]+":"+l[5]+":000",$=+h;return(o.utc(w).valueOf()-($-=$%1e3))/6e4},d=t.prototype;d.tz=function(h,y){h===void 0&&(h=i);var S,l=this.utcOffset(),v=this.toDate(),p=v.toLocaleString("en-US",{timeZone:h}),D=Math.round((v-new Date(p))/1e3/60),x=15*-Math.round(v.getTimezoneOffset()/15)-D;if(!Number(x))S=this.utcOffset(0,y);else if(S=o(p,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),y){var z=S.utcOffset();S=S.add(l-z,"minute")}return S.$x.$timezone=h,S},d.offsetName=function(h){var y=this.$x.$timezone||o.tz.guess(),S=u(this.valueOf(),y,{timeZoneName:h}).find((function(l){return l.type.toLowerCase()==="timezonename"}));return S&&S.value};var f=d.startOf;d.startOf=function(h,y){if(!this.$x||!this.$x.$timezone)return f.call(this,h,y);var S=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return f.call(S,h,y).tz(this.$x.$timezone,!0)},o.tz=function(h,y,S){var l=S&&y,v=S||y||i,p=c(+o(),v);if(typeof h!="string")return o(h).tz(v);var D=(function(k,w,$){var g=k-60*w*1e3,m=c(g,$);if(w===m)return[g,w];var T=c(g-=60*(m-w)*1e3,$);return m===T?[g,m]:[k-60*Math.min(m,T)*1e3,Math.max(m,T)]})(o.utc(h,l).valueOf(),p,v),x=D[0],z=D[1],R=o(x).utcOffset(z);return R.$x.$timezone=v,R},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function(h){i=h}}}))})(ht)),ht.exports}var He=Fe();const Ye=B(He);var mt={exports:{}},Ue=mt.exports,zt;function qe(){return zt||(zt=1,(function(s,a){(function(n,e){s.exports=e()})(Ue,(function(){return function(n,e,r){r.updateLocale=function(t,o){var i=r.Ls[t];if(i)return(o?Object.keys(o):[]).forEach((function(u){i[u]=o[u]})),i}}}))})(mt)),mt.exports}var Be=qe();const Ve=B(Be);var gt={exports:{}},Ge=gt.exports,Ct;function Xe(){return Ct||(Ct=1,(function(s,a){(function(n,e){s.exports=e()})(Ge,(function(){var n="minute",e=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(t,o,i){var u=o.prototype;i.utc=function(l){var v={date:l,utc:!0,args:arguments};return new o(v)},u.utc=function(l){var v=i(this.toDate(),{locale:this.$L,utc:!0});return l?v.add(this.utcOffset(),n):v},u.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var c=u.parse;u.parse=function(l){l.utc&&(this.$u=!0),this.$utils().u(l.$offset)||(this.$offset=l.$offset),c.call(this,l)};var d=u.init;u.init=function(){if(this.$u){var l=this.$d;this.$y=l.getUTCFullYear(),this.$M=l.getUTCMonth(),this.$D=l.getUTCDate(),this.$W=l.getUTCDay(),this.$H=l.getUTCHours(),this.$m=l.getUTCMinutes(),this.$s=l.getUTCSeconds(),this.$ms=l.getUTCMilliseconds()}else d.call(this)};var f=u.utcOffset;u.utcOffset=function(l,v){var p=this.$utils().u;if(p(l))return this.$u?0:p(this.$offset)?f.call(this):this.$offset;if(typeof l=="string"&&(l=(function(R){R===void 0&&(R="");var k=R.match(e);if(!k)return null;var w=(""+k[0]).match(r)||["-",0,0],$=w[0],g=60*+w[1]+ +w[2];return g===0?0:$==="+"?g:-g})(l),l===null))return this;var D=Math.abs(l)<=16?60*l:l;if(D===0)return this.utc(v);var x=this.clone();if(v)return x.$offset=D,x.$u=!1,x;var z=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(x=this.local().add(D+z,n)).$offset=D,x.$x.$localOffset=z,x};var h=u.format;u.format=function(l){var v=l||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,v)},u.valueOf=function(){var l=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*l},u.isUTC=function(){return!!this.$u},u.toISOString=function(){return this.toDate().toISOString()},u.toString=function(){return this.toDate().toUTCString()};var y=u.toDate;u.toDate=function(l){return l==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():y.call(this)};var S=u.diff;u.diff=function(l,v,p){if(l&&this.$u===l.$u)return S.call(this,l,v,p);var D=this.local(),x=i(l).local();return S.call(D,x,v,p)}}}))})(gt)),gt.exports}var Ze=Xe();const Je=B(Ze);var pt={exports:{}},Ke=pt.exports,Lt;function Qe(){return Lt||(Lt=1,(function(s,a){(function(n,e){s.exports=e()})(Ke,(function(){return function(n,e){e.prototype.weekday=function(r){var t=this.$locale().weekStart||0,o=this.$W,i=(o<t?o+7:o)-t;return this.$utils().u(r)?i:this.subtract(i,"day").add(r,"day")}}}))})(pt)),pt.exports}var tn=Qe();const en=B(tn);N.extend(Ne);N.extend(fe);N.extend(en);N.extend(ze);N.extend(Je);N.extend(Ye);N.extend(we);N.extend(ke);N.extend(ge);N.extend(Pe);N.extend(Ve);N.extend(Se);const Rt={minute:1,hour:60,day:1440,week:1440*7,month:1440*30},Pt=10;function nn(s,a){const n=j.useRef(null),e=j.useRef(null),r=j.useRef(a);r.current=a;const t=q(h=>h.selectedScale),o=K[t],{basePxPerDragStep:i,dragStepAmount:u,dragStepUnit:c}=o,d=h=>{const y=h.currentTarget.getBoundingClientRect(),S=h.clientX-y.left;return S<=Pt?"left":S>=y.width-Pt?"right":"bar"};return{onPointerDown:h=>{const y=d(h);e.current=y,n.current={mode:y,initialClientX:h.clientX,initialStartDate:N(s.startDate),initialEndDate:N(s.endDate),initialBarWidth:s.barWidth,dragSteps:0,basePxPerDragStep:i,dragStepAmount:u,dragStepUnit:c,taskId:s.id},q.getState().setCurrentTask(s),h.currentTarget.setPointerCapture(h.pointerId);const S=v=>{const p=n.current;if(!p)return;const D=v.clientX-p.initialClientX,x=Math.round(D/p.basePxPerDragStep);if(x===p.dragSteps)return;p.dragSteps=x;const z=x*p.basePxPerDragStep,R=p.dragStepAmount*Rt[p.dragStepUnit],k=x*R;let w,$,g=0,m=0;switch(p.mode){case"bar":w=p.initialStartDate.add(k,"minute"),$=p.initialEndDate.add(k,"minute"),g=z,m=0;break;case"left":if(w=p.initialStartDate.add(k,"minute"),$=p.initialEndDate,g=z,m=-z,p.initialBarWidth+m<p.basePxPerDragStep)return;break;case"right":if(w=p.initialStartDate,$=p.initialEndDate.add(k,"minute"),g=0,m=z,p.initialBarWidth+m<p.basePxPerDragStep)return;break;default:return}const T={offsetX:g,offsetWidth:m,offsetStartDate:w,offsetEndDate:$};q.getState().setDragOffset(p.taskId,T)},l=()=>{var R;document.removeEventListener("pointermove",S),document.removeEventListener("pointerup",l),document.removeEventListener("pointercancel",l);const v=n.current;if(!v)return;if(v.dragSteps===0){n.current=null,e.current=null,q.getState().setCurrentTask(null),q.getState().clearDragOffset(v.taskId);return}const p=q.getState().rawTasks,D=v.dragStepAmount*Rt[v.dragStepUnit],x=v.dragSteps*D,z=p.map(k=>{if(k.id!==v.taskId)return k;switch(v.mode){case"bar":return{...k,startDate:N(k.startDate).add(x,"minute").toISOString(),endDate:N(k.endDate).add(x,"minute").toISOString()};case"left":return{...k,startDate:N(k.startDate).add(x,"minute").toISOString()};case"right":return{...k,endDate:N(k.endDate).add(x,"minute").toISOString()};default:return k}});q.getState().setRawTasks(z),(R=r.current)==null||R.call(r,z),n.current=null,e.current=null,q.getState().setCurrentTask(null),q.getState().clearDragOffset(v.taskId)};document.addEventListener("pointermove",S),document.addEventListener("pointerup",l),document.addEventListener("pointercancel",l)},dragMode:e.current}}const _t=8,rn={day:"MMM D, h A",week:"MMM D",month:"MMM D",year:"MMM YYYY"};function sn({currentTask:s,onTasksChange:a}){const n=j.useRef(null),{onPointerDown:e,dragMode:r}=nn(s,a),[t,o]=j.useState("grab"),i=q(p=>p.dragOffsets[s.id]),u=q(p=>{var D;return((D=p.currentTask)==null?void 0:D.id)===s.id}),c=q(p=>p.selectedScale),d=(i==null?void 0:i.offsetX)??0,f=(i==null?void 0:i.offsetWidth)??0,h=s.barLeft+d,y=s.barWidth+f,S=j.useCallback(p=>{const D=n.current;if(!D)return;const x=D.getBoundingClientRect(),z=p.clientX-x.left;z<=_t||z>=x.width-_t?o("ew-resize"):o("grab")},[]),l=rn[c],v=p=>{if(!i)return"";const D=i.offsetStartDate.format(l),x=i.offsetEndDate.format(l);switch(p){case"left":return`Start: ${D}`;case"right":return`End: ${x}`;case"bar":default:return`${D} → ${x}`}};return P.jsxs("div",{ref:n,id:`task-${s.id}`,className:`gantt-task-bar${u?" dragging":""}`,onPointerDown:e,onMouseMove:S,onMouseLeave:()=>o("grab"),style:{transform:`translateX(${h}px)`,width:y,height:vt/2,cursor:u?"grabbing":t},role:"button",tabIndex:0,"aria-label":`태스크: ${s.name}`,children:[P.jsx("span",{className:"gantt-task-name",children:s.name}),u&&i&&P.jsx("div",{className:"gantt-bar-tooltip",role:"status","aria-live":"polite",children:v(r)})]})}function on(s){const a=[];for(const n of s){const e=a[a.length-1];e&&e.label===n.label?e.widthPx+=n.widthPx:a.push({...n})}return a}function an(s){let a=0;return s.map(n=>{const e={...n,left:a};return a+=n.widthPx,e})}function un(s){const a=on(s);return an(a)}function jt(s){return s.split(".").map(Number)}function cn(s){return[...s].sort((a,n)=>{const e=jt(a.sequence),r=jt(n.sequence),t=Math.max(e.length,r.length);for(let o=0;o<t;o++){const i=e[o]||0,u=r[o]||0;if(i!==u)return i-u}return 0})}function ln(s){return s.split(".").length-1}function fn(s,a,n){return cn(s).map((r,t)=>{const o=ln(r.sequence),i=t+1,{barMarginLeftAmount:u,barWidthSize:c}=dn(N(r.startDate),N(r.endDate),a,n);return{...r,barLeft:u,barWidth:c,depth:o,order:i,originalOrder:i}})}function dn(s,a,n,e){if(!n.length)return{barMarginLeftAmount:0,barWidthSize:0};const r=K[e],{tickUnit:t,unitPerTick:o}=r;let i=0,u=0,c=!1;const d=s.valueOf(),f=a.valueOf();for(const h of n){const y=h.startDate,S=y.add(o,t),l=h.widthPx,v=y.valueOf(),p=S.valueOf();if(p<=d){i+=l;continue}if(v>=f)break;const D=d>v?s:y,x=f<p?a:S,z=p-v,k=(x.valueOf()-D.valueOf())/z;if(!c&&D.valueOf()>v){const w=(D.valueOf()-v)/z;i+=w*l}u+=k*l,c=!0}return{barMarginLeftAmount:i,barWidthSize:Math.max(u,1)}}function hn(s){let a=1/0,n=-1/0;for(const e of s){const r=N(e.startDate).valueOf(),t=N(e.endDate).valueOf();Number.isNaN(r)||(a=Math.min(a,r)),Number.isNaN(t)||(n=Math.max(n,t))}return{minDate:N(a),maxDate:N(n)}}function mn(s,a,n){const e=K[n],{tickUnit:r,unitPerTick:t}=e,o=Jt*t;return{paddedMinDate:s.subtract(o,r),paddedMaxDate:a.add(o,r)}}function gn(s,a,n){const e=K[n],{tickUnit:r,unitPerTick:t,basePxPerDragStep:o,dragStepUnit:i,dragStepAmount:u}=e,c=[];let d=s.startOf(r);const f=a.valueOf(),h=o/u;for(;d.valueOf()<f;){const y=d.add(t,r),l=y.diff(d,i)*h;c.push({startDate:d,widthPx:l}),d=y}return c}function pn(s,a){const n=K[a],{labelUnit:e,formatHeaderLabel:r}=n;if(s.length===0)return[];const t=[];let o=null;for(const i of s){const u=i.startDate.startOf(e),c=u.valueOf(),d=(r==null?void 0:r(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 $n(s,a){if(!s.length)return{bottomCells:[],transformedTasks:[]};const{minDate:n,maxDate:e}=hn(s),{paddedMinDate:r,paddedMaxDate:t}=mn(n,e,a),o=gn(r,t,a),i=fn(s,o,a);return{bottomCells:o,transformedTasks:i}}function vn({bottomRowCells:s,selectedScale:a,width:n,scrollRef:e}){const r=K[a],[t,o]=j.useState(0),i=j.useMemo(()=>{const c=pn(s,a);return un(c)},[s,a]),u=j.useCallback(()=>{const c=e.current;if(!c)return;const d=c.scrollLeft;for(let f=i.length-1;f>=0;f--)if(d>=i[f].left){o(f);break}},[i,e]);return j.useEffect(()=>{const c=e.current;if(c)return c.addEventListener("scroll",u,{passive:!0}),u(),()=>c.removeEventListener("scroll",u)},[u,e]),P.jsx("header",{className:"gantt-header",style:{width:`${n}px`},children:P.jsxs("div",{className:"gantt-header-content",children:[P.jsx("div",{className:"gantt-top-header",children:P.jsx("div",{className:"gantt-top-groups",children:i.map((c,d)=>{const f=d===t;return P.jsx("div",{className:`gantt-top-group${f?" sticky":""}`,style:{width:`${c.widthPx}px`,...f&&{left:0}},children:P.jsx("p",{className:"gantt-top-group-label",children:c.label})},`${c.label}-${d}`)})})}),P.jsx("div",{className:"gantt-bottom-row",children:s.map((c,d)=>{var h;const f=((h=r.formatTickLabel)==null?void 0:h.call(r,c.startDate))||"";return P.jsx("div",{className:"gantt-bottom-cell",style:{width:`${c.widthPx}px`},children:f},`bottom-${d}`)})})]})})}function Sn(s,a,n,e,r){if(n<0||r<0)return`M ${a} ${n} h ${(e-a)/2}`;const t=7,o=11,i=25,u=20,c=`M ${a} ${n}`,d=e-a,f=r-n,h=Math.abs(d),y=Math.abs(f),S=r<=n,l=r>=n,v=e>=a,p=e<=a,D=h>u,x=Math.abs(d/2),z=Math.abs(f/2);function R(){function g(){return(v||p)&&l&&!D?"downSmallHorizontal":(v||p)&&S&&!D?"upSmallHorizontal":l&&p?"downLeft":l&&v?"downRight":S&&p?"upLeft":S&&v?"upRight":""}let m=c;switch(g()){case"downRight":{m+=` h ${x-t}`,m+=` a ${t} ${t} 0 0 1 ${t} ${t}`,m+=` v ${f-t*2}`,m+=` a ${t} ${t} 0 0 0 ${t} ${t}`,m+=` h ${x-t}`;break}case"upRight":{m+=` h ${x-t}`,m+=` a ${t} ${t} 0 0 0 ${t} -${t}`,m+=` v -${y-t*2}`,m+=` a ${t} ${t} 0 0 1 ${t} -${t}`,m+=` h ${x-t}`;break}case"downLeft":case"downSmallHorizontal":{const W=n+f/2;m+=` h ${o}`,m+=` a ${t} ${t} 0 0 1 ${t} ${t}`,m+=` v ${W-n-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 ${W-n-t*2}`,m+=` a ${t} ${t} 0 0 0 ${t} ${t}`,m+=` h ${o}`;break}case"upLeft":case"upSmallHorizontal":{const W=n+f/2;m+=` h ${o}`,m+=` a ${t} ${t} 0 0 0 ${t} -${t}`,m+=` v -${n-W-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 -${n-W-t*2}`,m+=` a ${t} ${t} 0 0 1 ${t} -${t}`,m+=` h ${o}`;break}default:return m}return m}function k(){let g=c;return l&&p?(g+=` h ${i-o}`,g+=` a ${t} ${t} 0 0 1 ${t} ${t}`,g+=` v ${f-t*2}`,g+=` a ${t} ${t} 0 0 1 -${t} ${t}`,g+=` h ${d-t*2}`):l&&v?(g+=` h ${d+i-o}`,g+=` a ${t} ${t} 0 0 1 ${t} ${t}`,g+=` v ${f-t*2}`,g+=` a ${t} ${t} 0 0 1 -${t} ${t}`,g+=` h -${i-o}`):S&&p?(g+=` h ${i-o}`,g+=` a ${t} ${t} 0 0 0 ${t} -${t}`,g+=` v ${f+t*2}`,g+=` a ${t} ${t} 0 0 0 -${t} -${t}`,g+=` h ${d-i+o}`):S&&v&&(g+=` h ${d+i-o}`,g+=` a ${t} ${t} 0 0 0 ${t} -${t}`,g+=` v ${f+t*2}`,g+=` a ${t} ${t} 0 0 0 -${t} -${t}`,g+=` h -${i-o}`),g}function w(){function g(){return(v||p)&&l&&!D?"downSmallHorizontal":(v||p)&&S&&!D?"upSmallHorizontal":l&&p?"downLeft":l&&v?"downRight":S&&p?"upLeft":S&&v?"upRight":""}let m=c;switch(g()){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 ${-x+t}`,m+=` a ${t} ${t} 0 0 0 -${t} ${t}`,m+=` v ${y-t*2}`,m+=` a ${t} ${t} 0 0 1 -${t} ${t}`,m+=` h ${-x+t}`;break}case"upLeft":{m+=` h ${-(x-t)}`,m+=` a ${t} ${t} 0 0 1 -${t} -${t}`,m+=` v ${-(y-t*2)}`,m+=` a ${t} ${t} 0 0 0 -${t} -${t}`,m+=` h ${-x+t}`;break}default:return m}return m}function $(){let g=c;return l&&p?(g+=` h ${d-i}`,g+=` a ${t} ${t} 0 0 0 -${t} ${t}`,g+=` v ${f-t*2}`,g+=` a ${t} ${t} 0 0 0 ${t} ${t}`,g+=` h ${i}`):l&&v?(g+=` h ${-i}`,g+=` a ${t} ${t} 0 0 0 -${t} ${t}`,g+=` v ${f-t*2}`,g+=` a ${t} ${t} 0 0 0 ${t} ${t}`,g+=` h ${d+i}`):S&&p?(g+=` h ${d-i}`,g+=` a ${t} ${t} 0 0 1 -${t} -${t}`,g+=` v ${f+t*2}`,g+=` a ${t} ${t} 0 0 1 ${t} -${t}`,g+=` h ${i}`):S&&v&&(g+=` h ${-i}`,g+=` a ${t} ${t} 0 0 1 -${t} -${t}`,g+=` v ${f+t*2}`,g+=` a ${t} ${t} 0 0 1 ${t} -${t}`,g+=` h ${d+i}`),g}switch(s){case"FS":return R();case"FF":return k();case"SF":return w();case"SS":return $();default:return`${c} L ${e} ${r}`}}function yn(s,a,n,e){const r=vt,t=s.order-1,o=a.order-1,i=r/2,u=o*r+i,c=t*r+i,d=a.barLeft,f=a.barLeft+a.barWidth,h=s.barLeft+n.offsetX,y=h+s.barWidth+n.offsetWidth,S={FS:[f,h],SS:[d,h],FF:[f,y],SF:[d,y]},[l,v]=S[e];return{fromX:l,fromY:u,toX:v,toY:c}}function xn(s,a){const n=[];for(const e of s){const r=a[e.id]??{offsetX:0,offsetWidth:0};for(const t of e.dependencies??[]){const o=s.find(f=>f.id===t.targetId);if(!o)continue;const{fromX:i,fromY:u,toX:c,toY:d}=yn(e,o,r,t.type);n.push({...t,fromX:i,fromY:u,toX:c,toY:d})}}return n}function bn({transformedTasks:s}){const a=q(e=>e.dragOffsets),n=xn(s,a);return P.jsxs("svg",{className:"gantt-dependency-arrows",style:{height:`${s.length*vt}px`},children:[P.jsx("defs",{children:P.jsx("marker",{id:"arrowhead",markerWidth:"5",markerHeight:"5",refX:"4.5",refY:"2.5",orient:"auto",children:P.jsx("polygon",{className:"gantt-dependency-arrow-head",points:"0 0, 5 2.5, 0 5"})})}),n.map((e,r)=>P.jsx("path",{className:"gantt-dependency-arrow",d:Sn(e.type,e.fromX,e.fromY,e.toX,e.toY),markerEnd:"url(#arrowhead)",fill:"none"},`arrow-${r}`))]})}const J=Object.keys(K);function wn({selectedScale:s,onScaleChange:a}){const n=(e,r)=>{const t=J.indexOf(r);if(e.key==="ArrowRight"||e.key==="ArrowDown"){e.preventDefault();const o=(t+1)%J.length;a(J[o])}else if(e.key==="ArrowLeft"||e.key==="ArrowUp"){e.preventDefault();const o=(t-1+J.length)%J.length;a(J[o])}};return P.jsx("div",{className:"gantt-scale-selector",role:"group","aria-label":"타임라인 스케일 선택",children:P.jsx("div",{className:"gantt-scale-control",children:J.map(e=>{const r=e===s;return P.jsx("button",{type:"button",className:"gantt-scale-button","data-active":r,onClick:()=>a(e),onKeyDown:t=>n(t,e),"aria-pressed":r,tabIndex:r?0:-1,children:e},e)})})})}const Wt=s=>Symbol.iterator in s,Nt=s=>"entries"in s,At=(s,a)=>{const n=s instanceof Map?s:new Map(s.entries()),e=a instanceof Map?a:new Map(a.entries());if(n.size!==e.size)return!1;for(const[r,t]of n)if(!e.has(r)||!Object.is(t,e.get(r)))return!1;return!0},Mn=(s,a)=>{const n=s[Symbol.iterator](),e=a[Symbol.iterator]();let r=n.next(),t=e.next();for(;!r.done&&!t.done;){if(!Object.is(r.value,t.value))return!1;r=n.next(),t=e.next()}return!!r.done&&!!t.done};function Dn(s,a){return Object.is(s,a)?!0:typeof s!="object"||s===null||typeof a!="object"||a===null||Object.getPrototypeOf(s)!==Object.getPrototypeOf(a)?!1:Wt(s)&&Wt(a)?Nt(s)&&Nt(a)?At(s,a):Mn(s,a):At({entries:()=>Object.entries(s)},{entries:()=>Object.entries(a)})}function On(s){const a=j.useRef(void 0);return n=>{const e=s(n);return Dn(a.current,e)?a.current:a.current=e}}function kn(){return q(On(s=>({rawTasks:s.rawTasks,transformedTasks:s.transformedTasks,bottomRowCells:s.bottomRowCells,selectedScale:s.selectedScale,currentTask:s.currentTask,dragOffsets:s.dragOffsets,setRawTasks:s.setRawTasks,setTransformedTasks:s.setTransformedTasks,setBottomRowCells:s.setBottomRowCells,setSelectedScale:s.setSelectedScale,setCurrentTask:s.setCurrentTask,setDragOffset:s.setDragOffset,clearDragOffset:s.clearDragOffset,getTotalWidth:s.getTotalWidth,getCurrentDragOffset:s.getCurrentDragOffset})))}function tt(s,a,n){let e=n.initialDeps??[],r;function t(){var o,i,u,c;let d;n.key&&((o=n.debug)!=null&&o.call(n))&&(d=Date.now());const f=s();if(!(f.length!==e.length||f.some((S,l)=>e[l]!==S)))return r;e=f;let y;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(y=Date.now()),r=a(...f),n.key&&((u=n.debug)!=null&&u.call(n))){const S=Math.round((Date.now()-d)*100)/100,l=Math.round((Date.now()-y)*100)/100,v=l/16,p=(D,x)=>{for(D=String(D);D.length<x;)D=" "+D;return D};console.info(`%c⏱ ${p(l,5)} /${p(S,5)} ms`,`
2
2
  font-size: .6rem;
3
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;
4
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(c=n==null?void 0:n.onChange)==null||c.call(n,r),r}return t.updateDeps=o=>{e=o},t}function Ft(s,a){if(s===void 0)throw new Error("Unexpected undefined");return s}const Tn=(s,a)=>Math.abs(s-a)<1.01,En=(s,a,n)=>{let e;return function(...r){s.clearTimeout(e),e=s.setTimeout(()=>a.apply(this,r),n)}},Ht=s=>{const{offsetWidth:a,offsetHeight:n}=s;return{width:a,height:n}},In=s=>s,zn=s=>{const a=Math.max(s.startIndex-s.overscan,0),n=Math.min(s.endIndex+s.overscan,s.count-1),e=[];for(let r=a;r<=n;r++)e.push(r);return e},Cn=(s,a)=>{const n=s.scrollElement;if(!n)return;const e=s.targetWindow;if(!e)return;const r=o=>{const{width:i,height:u}=o;a({width:Math.round(i),height:Math.round(u)})};if(r(Ht(n)),!e.ResizeObserver)return()=>{};const t=new e.ResizeObserver(o=>{const i=()=>{const u=o[0];if(u!=null&&u.borderBoxSize){const c=u.borderBoxSize[0];if(c){r({width:c.inlineSize,height:c.blockSize});return}}r(Ht(n))};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return t.observe(n,{box:"border-box"}),()=>{t.unobserve(n)}},Yt={passive:!0},Ut=typeof window>"u"?!0:"onscrollend"in window,Ln=(s,a)=>{const n=s.scrollElement;if(!n)return;const e=s.targetWindow;if(!e)return;let r=0;const t=s.options.useScrollendEvent&&Ut?()=>{}:En(e,()=>{a(r,!1)},s.options.isScrollingResetDelay),o=d=>()=>{const{horizontal:f,isRtl:h}=s.options;r=f?n.scrollLeft*(h&&-1||1):n.scrollTop,t(),a(r,d)},i=o(!0),u=o(!1);u(),n.addEventListener("scroll",i,Yt);const c=s.options.useScrollendEvent&&Ut;return c&&n.addEventListener("scrollend",u,Yt),()=>{n.removeEventListener("scroll",i),c&&n.removeEventListener("scrollend",u)}},Rn=(s,a,n)=>{if(a!=null&&a.borderBoxSize){const e=a.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}return s[n.options.horizontal?"offsetWidth":"offsetHeight"]},Pn=(s,{adjustments:a=0,behavior:n},e)=>{var r,t;const o=s+a;(t=(r=e.scrollElement)==null?void 0:r.scrollTo)==null||t.call(r,{[e.options.horizontal?"left":"top"]:o,behavior:n})};class _n{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 n=null;const e=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(t=>{const o=()=>{this._measureElement(t.target,t)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var r;(r=e())==null||r.disconnect(),n=null},observe:r=>{var t;return(t=e())==null?void 0:t.observe(r,{box:"border-box"})},unobserve:r=>{var t;return(t=e())==null?void 0:t.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([e,r])=>{typeof r>"u"&&delete n[e]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:In,rangeExtractor:zn,onChange:()=>{},measureElement:Rn,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,...n}},this.notify=n=>{var e,r;(r=(e=this.options).onChange)==null||r.call(e,this,n)},this.maybeNotify=tt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{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(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,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=(n,e)=>{const r=new Map,t=new Map;for(let o=e-1;o>=0;o--){const i=n[o];if(r.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&&r.set(i.lane,!0),r.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=tt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,e,r,t,o)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:e,scrollMargin:r,getItemKey:t,enabled:o}),{key:!1}),this.getMeasurements=tt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:e,scrollMargin:r,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<n;d++){const f=t(d),h=this.options.lanes===1?c[d-1]:this.getFurthestMeasurement(c,d),y=h?h.end+this.options.gap:e+r,S=i.get(f),l=typeof S=="number"?S:this.options.estimateSize(d),v=y+l,p=h?h.lane:d%this.options.lanes;c[d]={index:d,start:y,size:l,end:v,key:f,lane:p}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=tt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,e,r,t)=>this.range=n.length>0&&e>0?jn({measurements:n,outerSize:e,scrollOffset:r,lanes:t}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=tt(()=>{let n=null,e=null;const r=this.calculateRange();return r&&(n=r.startIndex,e=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,e]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,e]},(n,e,r,t,o)=>t===null||o===null?[]:n({startIndex:t,endIndex:o,overscan:e,count:r}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const e=this.options.indexAttribute,r=n.getAttribute(e);return r?parseInt(r,10):(console.warn(`Missing attribute name '${e}={index}' on measured element.`),-1)},this._measureElement=(n,e)=>{const r=this.indexFromElement(n),t=this.measurementsCache[r];if(!t)return;const o=t.key,i=this.elementsCache.get(o);i!==n&&(i&&this.observer.unobserve(i),this.observer.observe(n),this.elementsCache.set(o,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,e,this))},this.resizeItem=(n,e)=>{const r=this.measurementsCache[n];if(!r)return;const t=this.itemSizeCache.get(r.key)??r.size,o=e-t;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.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(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,e)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((e,r)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=tt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,e)=>{const r=[];for(let t=0,o=n.length;t<o;t++){const i=n[t],u=e[i];r.push(u)}return r},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const e=this.getMeasurements();if(e.length!==0)return Ft(e[Gt(0,e.length-1,r=>Ft(e[r]).start,n)])},this.getOffsetForAlignment=(n,e,r=0)=>{const t=this.getSize(),o=this.getScrollOffset();e==="auto"&&(e=n>=o+t?"end":"start"),e==="center"?n+=(r-t)/2:e==="end"&&(n-=t);const i=this.getTotalSize()+this.options.scrollMargin-t;return Math.max(Math.min(i,n),0)},this.getOffsetForIndex=(n,e="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const t=this.getSize(),o=this.getScrollOffset();if(e==="auto")if(r.end>=o+t-this.options.scrollPaddingEnd)e="end";else if(r.start<=o+this.options.scrollPaddingStart)e="start";else return[o,e];const i=e==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,e,r.size),e]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:e="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,e),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:e="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let t=0;const o=10,i=c=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(n,c);if(!d){console.warn("Failed to get offset for index:",n);return}const[f,h]=d;this._scrollToOffset(f,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const y=this.getScrollOffset(),S=this.getOffsetForIndex(n,h);if(!S){console.warn("Failed to get offset for index:",n);return}Tn(S[0],y)||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 ${n} after ${o} attempts.`))};i(e)},this.scrollBy=(n,{behavior:e}={})=>{e==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:e})},this.getTotalSize=()=>{var n;const e=this.getMeasurements();let r;if(e.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=e[e.length-1])==null?void 0:n.end)??0;else{const t=Array(this.options.lanes).fill(null);let o=e.length-1;for(;o>=0&&t.some(i=>i===null);){const i=e[o];t[i.lane]===null&&(t[i.lane]=i.end),o--}r=Math.max(...t.filter(i=>i!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:e,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:e},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(a)}}const Gt=(s,a,n,e)=>{for(;s<=a;){const r=(s+a)/2|0,t=n(r);if(t<e)s=r+1;else if(t>e)a=r-1;else return r}return s>0?s-1:0};function jn({measurements:s,outerSize:a,scrollOffset:n,lanes:e}){const r=s.length-1,t=u=>s[u].start;if(s.length<=e)return{startIndex:0,endIndex:r};let o=Gt(0,r,t,n),i=o;if(e===1)for(;i<r&&s[i].end<n+a;)i++;else if(e>1){const u=Array(e).fill(0);for(;i<r&&u.some(d=>d<n+a);){const d=s[i];u[d.lane]=d.end,i++}const c=Array(e).fill(n+a);for(;o>=0&&c.some(d=>d>=n);){const d=s[o];c[d.lane]=d.start,o--}o=Math.max(0,o-o%e),i=Math.min(r,i+(e-1-i%e))}return{startIndex:o,endIndex:i}}const qt=typeof document<"u"?$t.useLayoutEffect:$t.useEffect;function Wn(s){const a=$t.useReducer(()=>({}),{})[1],n={...s,onChange:(r,t)=>{var o;t?Xt.flushSync(a):a(),(o=s.onChange)==null||o.call(s,r,t)}},[e]=$t.useState(()=>new _n(n));return e.setOptions(n),qt(()=>e._didMount(),[]),qt(()=>e._willUpdate()),e}function Bt(s){return Wn({observeElementRect:Cn,observeElementOffset:Ln,scrollToFn:Pn,...s})}function Nn({transformedTasks:s,bottomRowCells:a,scrollRef:n}){var d;const e=Bt({count:s.length,getScrollElement:()=>n.current,estimateSize:()=>vt,overscan:5}),r=Bt({horizontal:!0,count:a.length,getScrollElement:()=>n.current,estimateSize:f=>{var h;return((h=a[f])==null?void 0:h.widthPx)??32},overscan:5}),t=r.getVirtualItems(),o=((d=t[0])==null?void 0:d.start)??0,i=t[t.length-1],u=i?i.start+i.size:0,c=j.useMemo(()=>(f,h)=>f+h>=o&&f<=u,[o,u]);return j.useEffect(()=>{if(!a.length)return;const f=requestAnimationFrame(()=>{r.measure()});return()=>cancelAnimationFrame(f)},[a,r]),{rowVirtualizer:e,columnVirtualizer:r,isBarVisible:c}}function An(s,a="gantt-container"){const[n,e]=j.useState(()=>typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");j.useEffect(()=>{if(typeof window>"u")return;const i=window.matchMedia("(prefers-color-scheme: dark)"),u=c=>{e(c.matches?"dark":"light")};return i.addEventListener("change",u),()=>i.removeEventListener("change",u)},[]);const r=j.useMemo(()=>!s||s==="system"?n:s,[s,n]),t=j.useMemo(()=>{const i=[a];return s&&i.push(r),i.join(" ")},[a,s,r]);return{resolvedTheme:r,containerClassName:t,dataTheme:s?r:void 0}}const Fn=600,Hn="100%",Yn="month";function Un({tasks:s=[],onTasksChange:a,height:n=Fn,width:e=Hn,theme:r,defaultScale:t=Yn,className:o}){const{rawTasks:i,transformedTasks:u,bottomRowCells:c,selectedScale:d,setRawTasks:f,setTransformedTasks:h,setBottomRowCells:y,setSelectedScale:S,getTotalWidth:l}=kn(),v=j.useRef(null),{rowVirtualizer:p,isBarVisible:D}=Nn({transformedTasks:u,bottomRowCells:c,scrollRef:v}),{containerClassName:x,dataTheme:z}=An(r,o?`gantt-container ${o}`:"gantt-container");j.useEffect(()=>{t&&t!==d&&S(t)},[]),j.useEffect(()=>{s.length>0&&f(s)},[s,f]),j.useEffect(()=>{if(!i.length)return;const{bottomCells:$,transformedTasks:g}=$n(i,d);y($),h(g)},[i,d,y,h]);const R=$=>{S($)},k=l(),w={height:typeof n=="number"?`${n}px`:n,width:typeof e=="number"?`${e}px`:e};return P.jsxs("section",{className:x,"data-theme":z,style:w,children:[P.jsx("div",{className:"gantt-toolbar",children:P.jsx(wn,{selectedScale:d,onScaleChange:R})}),P.jsx("div",{className:"gantt-main",children:P.jsxs("div",{ref:v,className:"gantt-scroll-container",children:[P.jsx("div",{className:"gantt-header-wrapper",style:{width:`${k}px`},children:P.jsx(vn,{bottomRowCells:c,selectedScale:d,width:k,scrollRef:v})}),P.jsxs("div",{className:"gantt-content",style:{height:`${p.getTotalSize()}px`,width:`${k}px`},children:[P.jsx("div",{className:"gantt-rows",children:p.getVirtualItems().map($=>{const g=u[$.index];return P.jsx("div",{className:"gantt-task-row",style:{height:`${$.size-1}px`,transform:`translateY(${$.start}px)`}},`row-${g.id}`)})}),P.jsx(bn,{transformedTasks:u}),p.getVirtualItems().map($=>{const g=u[$.index],m=g.barLeft??0,T=g.barWidth??0;return D(m,T)?P.jsx("div",{style:{position:"absolute",top:0,left:0,height:`${$.size-1}px`,transform:`translateY(${$.start}px)`,display:"flex",alignItems:"center"},children:P.jsx(sn,{currentTask:g,onTasksChange:a})},g.id):null})]})]})})]})}exports.ReactGanttChart=Un;