iris-gantt 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +183 -215
  2. package/USAGE.md +838 -0
  3. package/dist/Gantt/Chart.d.ts +22 -0
  4. package/dist/Gantt/Chart.d.ts.map +1 -0
  5. package/dist/Gantt/ContextMenu.d.ts +19 -0
  6. package/dist/Gantt/ContextMenu.d.ts.map +1 -0
  7. package/dist/Gantt/DependencyEditor.d.ts +13 -0
  8. package/dist/Gantt/DependencyEditor.d.ts.map +1 -0
  9. package/dist/Gantt/DependencyPopover.d.ts +12 -0
  10. package/dist/Gantt/DependencyPopover.d.ts.map +1 -0
  11. package/dist/Gantt/DragDrop.d.ts +18 -0
  12. package/dist/Gantt/DragDrop.d.ts.map +1 -0
  13. package/dist/Gantt/Gantt.d.ts +35 -0
  14. package/dist/Gantt/Gantt.d.ts.map +1 -0
  15. package/dist/Gantt/GanttPro.d.ts +16 -0
  16. package/dist/Gantt/GanttPro.d.ts.map +1 -0
  17. package/dist/Gantt/Grid.d.ts +29 -0
  18. package/dist/Gantt/Grid.d.ts.map +1 -0
  19. package/dist/Gantt/LinkRenderer.d.ts +15 -0
  20. package/dist/Gantt/LinkRenderer.d.ts.map +1 -0
  21. package/dist/Gantt/TaskBar.d.ts +19 -0
  22. package/dist/Gantt/TaskBar.d.ts.map +1 -0
  23. package/dist/Gantt/TaskCreator.d.ts +8 -0
  24. package/dist/Gantt/TaskCreator.d.ts.map +1 -0
  25. package/dist/Gantt/TaskEditor.d.ts +10 -0
  26. package/dist/Gantt/TaskEditor.d.ts.map +1 -0
  27. package/dist/Gantt/Timeline.d.ts +23 -0
  28. package/dist/Gantt/Timeline.d.ts.map +1 -0
  29. package/dist/Gantt/Toolbar.d.ts +15 -0
  30. package/dist/Gantt/Toolbar.d.ts.map +1 -0
  31. package/dist/Gantt/UndoRedo.d.ts +27 -0
  32. package/dist/Gantt/UndoRedo.d.ts.map +1 -0
  33. package/dist/Gantt/exports.d.ts +21 -0
  34. package/dist/Gantt/exports.d.ts.map +1 -0
  35. package/dist/Gantt/features/AutoScheduler.d.ts +10 -0
  36. package/dist/Gantt/features/AutoScheduler.d.ts.map +1 -0
  37. package/dist/Gantt/features/Baselines.d.ts +27 -0
  38. package/dist/Gantt/features/Baselines.d.ts.map +1 -0
  39. package/dist/Gantt/features/CriticalPath.d.ts +10 -0
  40. package/dist/Gantt/features/CriticalPath.d.ts.map +1 -0
  41. package/dist/Gantt/features/ExportUtils.d.ts +11 -0
  42. package/dist/Gantt/features/ExportUtils.d.ts.map +1 -0
  43. package/dist/Gantt/features/FilterSearch.d.ts +20 -0
  44. package/dist/Gantt/features/FilterSearch.d.ts.map +1 -0
  45. package/dist/Gantt/types.d.ts +80 -0
  46. package/dist/Gantt/types.d.ts.map +1 -0
  47. package/dist/Gantt/utils/dateUtils.d.ts +11 -0
  48. package/dist/Gantt/utils/dateUtils.d.ts.map +1 -0
  49. package/dist/Gantt/utils/dependencyParser.d.ts +26 -0
  50. package/dist/Gantt/utils/dependencyParser.d.ts.map +1 -0
  51. package/dist/gantt.css +1 -0
  52. package/dist/index.d.ts +3 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/iris-gantt.js +1232 -1500
  55. package/dist/iris-gantt.umd.cjs +8 -8
  56. package/dist/types.d.ts +2 -0
  57. package/dist/types.d.ts.map +1 -0
  58. package/package.json +42 -7
  59. package/dist/iris-gantt.css +0 -1
  60. package/src/components/Gantt/gantt.css +0 -2167
@@ -1,23 +1,23 @@
1
- (function(W,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("react"),require("antd"),require("@fortawesome/react-fontawesome"),require("@fortawesome/free-solid-svg-icons")):typeof define=="function"&&define.amd?define(["exports","react","antd","@fortawesome/react-fontawesome","@fortawesome/free-solid-svg-icons"],F):(W=typeof globalThis<"u"?globalThis:W||self,F(W.IrisGantt={},W.React,W.antd,W.ReactFontawesome,W.FontAwesomeSolid))})(this,(function(W,F,o,U,z){"use strict";function ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Me={exports:{}},Se={};var Re;function pt(){if(Re)return Se;Re=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(a,s,m){var c=null;if(m!==void 0&&(c=""+m),s.key!==void 0&&(c=""+s.key),"key"in s){m={};for(var l in s)l!=="key"&&(m[l]=s[l])}else m=s;return s=m.ref,{$$typeof:t,type:a,key:c,ref:s!==void 0?s:null,props:m}}return Se.Fragment=r,Se.jsx=i,Se.jsxs=i,Se}var ve={};var ze;function mt(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&(function(){function t(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===I?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case O:return"Fragment";case T:return"Profiler";case x:return"StrictMode";case H:return"Suspense";case Z:return"SuspenseList";case L:return"Activity"}if(typeof n=="object")switch(typeof n.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case $:return"Portal";case B:return n.displayName||"Context";case _:return(n._context.displayName||"Context")+".Consumer";case Y:var w=n.render;return n=n.displayName,n||(n=w.displayName||w.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case se:return w=n.displayName||null,w!==null?w:t(n.type)||"Memo";case y:w=n._payload,n=n._init;try{return t(n(w))}catch{}}return null}function r(n){return""+n}function i(n){try{r(n);var w=!1}catch{w=!0}if(w){w=console;var E=w.error,A=typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return E.call(w,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",A),r(n)}}function a(n){if(n===O)return"<>";if(typeof n=="object"&&n!==null&&n.$$typeof===y)return"<...>";try{var w=t(n);return w?"<"+w+">":"<...>"}catch{return"<...>"}}function s(){var n=q.A;return n===null?null:n.getOwner()}function m(){return Error("react-stack-top-frame")}function c(n){if(G.call(n,"key")){var w=Object.getOwnPropertyDescriptor(n,"key").get;if(w&&w.isReactWarning)return!1}return n.key!==void 0}function l(n,w){function E(){g||(g=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",w))}E.isReactWarning=!0,Object.defineProperty(n,"key",{get:E,configurable:!0})}function d(){var n=t(this.type);return k[n]||(k[n]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),n=this.props.ref,n!==void 0?n:null}function S(n,w,E,A,J,ee){var R=E.ref;return n={$$typeof:h,type:n,key:w,props:E,_owner:A},(R!==void 0?R:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:d}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(n,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(n,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function v(n,w,E,A,J,ee){var R=w.children;if(R!==void 0)if(A)if(N(R)){for(A=0;A<R.length;A++)b(R[A]);Object.freeze&&Object.freeze(R)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else b(R);if(G.call(w,"key")){R=t(n);var ne=Object.keys(w).filter(function(K){return K!=="key"});A=0<ne.length?"{key: someKey, "+ne.join(": ..., ")+": ...}":"{key: someKey}",p[R+A]||(ne=0<ne.length?"{"+ne.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(N,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react"),require("antd"),require("@fortawesome/react-fontawesome"),require("@fortawesome/free-solid-svg-icons"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","react","antd","@fortawesome/react-fontawesome","@fortawesome/free-solid-svg-icons","dayjs"],S):(N=typeof globalThis<"u"?globalThis:N||self,S(N.IrisGantt={},N.React,N.antd,N.ReactFontawesome,N.FontAwesomeSolid,N.dayjs))})(this,(function(N,S,o,I,A,_e){"use strict";var Te={exports:{}},we={};var Re;function ht(){if(Re)return we;Re=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(a,s,p){var c=null;if(p!==void 0&&(c=""+p),s.key!==void 0&&(c=""+s.key),"key"in s){p={};for(var l in s)l!=="key"&&(p[l]=s[l])}else p=s;return s=p.ref,{$$typeof:t,type:a,key:c,ref:s!==void 0?s:null,props:p}}return we.Fragment=n,we.jsx=i,we.jsxs=i,we}var je={};var ze;function pt(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&(function(){function t(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===W?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case F:return"Fragment";case b:return"Profiler";case f:return"StrictMode";case B:return"Suspense";case X:return"SuspenseList";case O:return"Activity"}if(typeof r=="object")switch(typeof r.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),r.$$typeof){case j:return"Portal";case $:return r.displayName||"Context";case E:return(r._context.displayName||"Context")+".Consumer";case L:var y=r.render;return r=r.displayName,r||(r=y.displayName||y.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case ee:return y=r.displayName||null,y!==null?y:t(r.type)||"Memo";case m:y=r._payload,r=r._init;try{return t(r(y))}catch{}}return null}function n(r){return""+r}function i(r){try{n(r);var y=!1}catch{y=!0}if(y){y=console;var k=y.error,P=typeof Symbol=="function"&&Symbol.toStringTag&&r[Symbol.toStringTag]||r.constructor.name||"Object";return k.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",P),n(r)}}function a(r){if(r===F)return"<>";if(typeof r=="object"&&r!==null&&r.$$typeof===m)return"<...>";try{var y=t(r);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var r=U.A;return r===null?null:r.getOwner()}function p(){return Error("react-stack-top-frame")}function c(r){if(_.call(r,"key")){var y=Object.getOwnPropertyDescriptor(r,"key").get;if(y&&y.isReactWarning)return!1}return r.key!==void 0}function l(r,y){function k(){se||(se=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}k.isReactWarning=!0,Object.defineProperty(r,"key",{get:k,configurable:!0})}function x(){var r=t(this.type);return Z[r]||(Z[r]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),r=this.props.ref,r!==void 0?r:null}function T(r,y,k,P,V,de){var R=k.ref;return r={$$typeof:h,type:r,key:y,props:k,_owner:P},(R!==void 0?R:null)!==null?Object.defineProperty(r,"ref",{enumerable:!1,get:x}):Object.defineProperty(r,"ref",{enumerable:!1,value:null}),r._store={},Object.defineProperty(r._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(r,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.defineProperty(r,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:de}),Object.freeze&&(Object.freeze(r.props),Object.freeze(r)),r}function d(r,y,k,P,V,de){var R=y.children;if(R!==void 0)if(P)if(oe(R)){for(P=0;P<R.length;P++)g(R[P]);Object.freeze&&Object.freeze(R)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(R);if(_.call(y,"key")){R=t(r);var K=Object.keys(y).filter(function(me){return me!=="key"});P=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",C[R+P]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,A,R,ne,R),p[R+A]=!0)}if(R=null,E!==void 0&&(i(E),R=""+E),c(w)&&(i(w.key),R=""+w.key),"key"in w){E={};for(var re in w)re!=="key"&&(E[re]=w[re])}else E=w;return R&&l(E,typeof n=="function"?n.displayName||n.name||"Unknown":n),S(n,R,E,s(),J,ee)}function b(n){C(n)?n._store&&(n._store.validated=1):typeof n=="object"&&n!==null&&n.$$typeof===y&&(n._payload.status==="fulfilled"?C(n._payload.value)&&n._payload.value._store&&(n._payload.value._store.validated=1):n._store&&(n._store.validated=1))}function C(n){return typeof n=="object"&&n!==null&&n.$$typeof===h}var u=F,h=Symbol.for("react.transitional.element"),$=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),B=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),se=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),q=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,N=Array.isArray,D=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(n){return n()}};var g,k={},j=u.react_stack_bottom_frame.bind(u,m)(),f=D(a(m)),p={};ve.Fragment=O,ve.jsx=function(n,w,E){var A=1e4>q.recentlyCreatedOwnerStacks++;return v(n,w,E,!1,A?Error("react-stack-top-frame"):j,A?D(a(n)):f)},ve.jsxs=function(n,w,E){var A=1e4>q.recentlyCreatedOwnerStacks++;return v(n,w,E,!0,A?Error("react-stack-top-frame"):j,A?D(a(n)):f)}})()),ve}var He;function gt(){return He||(He=1,process.env.NODE_ENV==="production"?Me.exports=pt():Me.exports=mt()),Me.exports}var e=gt();const ie=(t,r,i)=>{const a=new Date(t);switch(i){case"hour":a.setHours(a.getHours()+r);break;case"day":a.setDate(a.getDate()+r);break;case"week":a.setDate(a.getDate()+r*7);break;case"month":a.setMonth(a.getMonth()+r);break;case"quarter":a.setMonth(a.getMonth()+r*3);break;case"year":a.setFullYear(a.getFullYear()+r);break}return a},De=(t,r)=>{const i=r.getTime()-t.getTime();return Math.ceil(i/(1e3*60*60*24))},We=(t,r)=>{const i=r.getTime()-t.getTime();return Math.ceil(i/(1e3*60*60))},ae=(t,r)=>{const i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],m={YYYY:t.getFullYear().toString(),YY:t.getFullYear().toString().slice(-2),MMMM:a[t.getMonth()],MMM:i[t.getMonth()],MM:String(t.getMonth()+1).padStart(2,"0"),M:String(t.getMonth()+1),DD:String(t.getDate()).padStart(2,"0"),D:String(t.getDate()),dddd:s[t.getDay()],HH:String(t.getHours()).padStart(2,"0"),H:String(t.getHours()),mm:String(t.getMinutes()).padStart(2,"0"),m:String(t.getMinutes())};return r.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g,c=>m[c])},Ne=t=>{const r=t.getDay();return r===0||r===6},Pe=(t,r)=>r.some(i=>i.getFullYear()===t.getFullYear()&&i.getMonth()===t.getMonth()&&i.getDate()===t.getDate()),Te=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},xt=t=>{const r=new Date(t);return r.setHours(23,59,59,999),r},yt=(t,r,i="day")=>{switch(i){case"hour":return We(t,r);case"day":return De(t,r);case"week":return Math.ceil(De(t,r)/7);case"month":return(r.getFullYear()-t.getFullYear())*12+(r.getMonth()-t.getMonth());default:return De(t,r)}};function wt(t){if(!t||typeof t!="string")return null;const r=t.trim(),i=/^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i,a=r.match(i);if(!a)return null;const s=parseInt(a[1],10),m=a[2].toUpperCase();let c=0,l="day";if(a[3]){const d=a[4]==="-"?-1:1;switch(c=parseInt(a[5],10)*d,a[6].toLowerCase()){case"d":l="day";break;case"h":l="hour";break;case"w":l="week";break;case"m":l="month";break}}return{taskNumber:s,type:m,lag:c,lagUnit:l}}function Ae(t,r){switch(r){case"hour":return t/24;case"day":return t;case"week":return t*7;case"month":return t*30;default:return t}}function jt(t,r){const a={e2s:"FS",s2s:"SS",e2e:"FF",s2e:"SF"}[t.type];let s=`${r}${a}`;if(t.lag&&t.lag!==0){const m=t.lag>0?"+":"",l=(t.lagUnit||"day").charAt(0);let d=t.lag;if(t.lagUnit&&t.lagUnit!=="day")switch(t.lagUnit){case"hour":d=t.lag*24;break;case"week":d=t.lag/7;break;case"month":d=t.lag/30;break}s+=`${m}${Math.round(d)}${l}`}return s}function bt(t){return{FS:"e2s",SS:"s2s",FF:"e2e",SF:"s2e"}[t]}const{Text:ge,Paragraph:St,Link:vt}=o.Typography,{Option:Ue}=o.Select,Dt=({task:t,allTasks:r,onAddDependency:i,children:a})=>{const[s,m]=F.useState(!1),[c,l]=F.useState(""),[d,S]=F.useState(null),[v,b]=F.useState("e2s"),[C,u]=F.useState("lag"),[h,$]=F.useState(0),[O,x]=F.useState(!0),T="day",_=F.useMemo(()=>{if(!c)return r.filter(L=>L.id!==t.id);const y=c.toLowerCase();return r.filter(L=>L.id!==t.id&&(L.text.toLowerCase().includes(y)||(r.indexOf(L)+1).toString().includes(y)))},[r,c,t.id]),B=()=>{if(d){const y=C==="lag"?h:-h,L=Ae(y,T);i(d,t.id,v,L),m(!1),Y()}},Y=()=>{l(""),S(null),b("e2s"),u("lag"),$(0)},H=()=>{if(!O)return null;const y=v==="e2s",L=v==="s2s",I=v==="e2e",q=v==="s2e";let G=0,N=0,D="",g=0,k=-1;return y?(G=20,N=160,g=140,k=160,D="M 140 40 L 150 40 C 160 40, 160 90, 150 90 L 160 90"):I?(G=60,N=60,g=180,k=-1,D="M 180 40 L 200 40 L 200 90 L 180 90"):L?(G=100,N=100,g=100,k=-1,D="M 100 40 L 80 40 L 80 90 L 100 90"):q&&(G=160,N=20,g=160,k=140,D="M 160 40 L 150 40 C 140 40, 140 90, 150 90 L 140 90"),e.jsx("div",{style:{width:"100%",height:120,backgroundColor:"#fff",borderRadius:4,marginBottom:10,border:"1px solid #e9ecef",position:"relative",overflow:"hidden"},children:e.jsxs("svg",{viewBox:"0 0 300 120",style:{width:"100%",height:"100%"},children:[e.jsx("line",{x1:g,x2:g,y1:"0",y2:"120",stroke:"#f0f0f0",strokeDasharray:"3,3"}),k!==-1&&e.jsx("line",{x1:k,x2:k,y1:"0",y2:"120",stroke:"#f0f0f0",strokeDasharray:"3,3"}),e.jsx("rect",{x:G,y:"28",width:"120",height:"24",rx:"4",fill:"#bae7ff",stroke:"#69c0ff"}),e.jsx("text",{x:G+60,y:"44",fontSize:"11",textAnchor:"middle",fill:"#0050b3",children:"Task 2"}),e.jsx("rect",{x:N,y:"78",width:"120",height:"24",rx:"4",fill:"#bae7ff",stroke:"#69c0ff"}),e.jsx("text",{x:N+60,y:"94",fontSize:"11",textAnchor:"middle",fill:"#0050b3",children:"Task 3"}),e.jsx("path",{d:D,fill:"none",stroke:"#8c8c8c",strokeWidth:"1.5",markerEnd:"url(#arrowhead)"}),e.jsx("defs",{children:e.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"9",refY:"3.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#8c8c8c"})})})]})})},Z=()=>{const y=r.find(G=>G.id===d);if(!y)return"Select a task from the list to see how it will relate to the current task.";const L=r.indexOf(t)+1,I=r.indexOf(y)+1;let q="";switch(v){case"e2s":q=`Task ${L} starts after Task ${I} finishes`;break;case"s2s":q=`Task ${L} starts when Task ${I} starts`;break;case"e2e":q=`Task ${L} finishes when Task ${I} finishes`;break;case"s2e":q=`Task ${L} finishes when Task ${I} starts`;break}if(h>0){const G=`${h} ${T}${h>1?"s":""}`;C==="lag"?q+=` + ${G} delay`:q+=` - ${G} overlap`}return q+"."},se=e.jsxs("div",{style:{display:"flex",width:620,height:480,backgroundColor:"#fff",borderRadius:"8px",overflow:"hidden"},children:[e.jsxs("div",{style:{flex:1,borderRight:"1px solid #f0f0f0",display:"flex",flexDirection:"column",padding:0},children:[e.jsx("div",{style:{padding:"12px"},children:e.jsx(o.Input,{placeholder:"Search task...",value:c,onChange:y=>l(y.target.value),style:{marginBottom:8},autoFocus:!0,size:"large"})}),e.jsx("div",{style:{flex:1,overflowY:"auto"},children:e.jsx(o.List,{size:"small",dataSource:_,renderItem:y=>e.jsxs(o.List.Item,{className:`task-list-item ${d===y.id?"selected":""}`,onClick:()=>S(y.id),style:{cursor:"pointer",padding:"8px 16px",backgroundColor:d===y.id?"#f0f7ff":"transparent",display:"flex",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",gap:12},children:[e.jsx(ge,{type:"secondary",style:{width:20},children:r.indexOf(y)+1}),e.jsx(ge,{children:y.text})]}),e.jsx(U.FontAwesomeIcon,{icon:z.faChevronRight,style:{fontSize:10,color:"#bfbfbf"}})]})})})]}),e.jsxs("div",{style:{width:340,padding:"24px",display:"flex",flexDirection:"column",borderLeft:"1px solid #f0f0f0"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:15},children:[e.jsx(ge,{strong:!0,children:"Dependency type"}),e.jsx(vt,{style:{fontSize:"12px"},onClick:()=>x(!O),children:O?"Hide preview":"Show preview"})]}),H(),e.jsx(St,{style:{fontSize:"13px",color:"#262626",marginBottom:20,minHeight:48,lineHeight:"1.6"},children:Z()}),e.jsx(o.Radio.Group,{value:v,onChange:y=>b(y.target.value),style:{width:"100%",marginBottom:20},children:e.jsxs(o.Space,{direction:"vertical",style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"e2s",children:"Finish to Start"}),e.jsx(ge,{type:"secondary",children:"FS"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"e2e",children:"Finish to Finish"}),e.jsx(ge,{type:"secondary",children:"FF"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"s2s",children:"Start to Start"}),e.jsx(ge,{type:"secondary",children:"SS"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"s2e",children:"Start to Finish"}),e.jsx(ge,{type:"secondary",children:"SF"})]})]})}),e.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:20},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(ge,{type:"secondary",style:{fontSize:"11px",display:"block",marginBottom:4},children:"Delay type"}),e.jsxs(o.Select,{value:C,onChange:y=>u(y),style:{width:"100%"},size:"large",children:[e.jsx(Ue,{value:"lag",children:"Lag by"}),e.jsx(Ue,{value:"lead",children:"Lead by"})]})]}),e.jsxs("div",{style:{width:100},children:[e.jsx(ge,{type:"secondary",style:{fontSize:"11px",display:"block",marginBottom:4},children:"Days"}),e.jsx(o.Space.Compact,{style:{width:"100%"},children:e.jsx(o.InputNumber,{min:0,value:h,onChange:y=>$(y||0),style:{width:"100%"},placeholder:"0",size:"large"})})]})]}),e.jsx(o.Button,{type:"primary",block:!0,onClick:B,disabled:!d,style:{marginTop:"auto",backgroundColor:"#5c67f2",height:44,borderRadius:"6px"},children:"Add"})]})]});return e.jsx(o.Popover,{content:se,trigger:"click",open:s,onOpenChange:m,placement:"bottomLeft",overlayClassName:"dependency-popover",overlayInnerStyle:{padding:0},children:a})},Ie=F.forwardRef(({tasks:t,allTasks:r=[],columns:i,selectedTask:a,onTaskClick:s,onTaskContextMenu:m,onTaskUpdate:c,onTaskDragStart:l,onAddTask:d,onAddDependency:S,links:v=[],dropIndicator:b,reorderTask:C},u)=>{const h=F.useRef(null);F.useImperativeHandle(u,()=>h.current);const $=(x,T=0)=>{if(!x.parent)return T;const _=t.find(B=>B.id===x.parent);return _?$(_,T+1):T},O=(x,T)=>{if(T.template)return T.template(x);switch(T.name){case"text":const _=$(x);return e.jsxs("div",{className:"gantt-grid-cell-text",style:{paddingLeft:_*14},children:[e.jsx("div",{className:"gantt-row-drag-handle",onMouseDown:Y=>{Y.preventDefault(),l?.(x.id,Y.clientX,Y.clientY,"reorder")},children:e.jsx(U.FontAwesomeIcon,{icon:z.faGripVertical})}),x.type==="project"?e.jsx("span",{className:"gantt-tree-icon",onClick:Y=>{Y.stopPropagation(),c?.({...x,open:!x.open})},children:e.jsx(U.FontAwesomeIcon,{icon:x.open?z.faChevronDown:z.faChevronRight})}):e.jsx("span",{style:{width:16,display:"inline-block"}}),e.jsx("span",{className:"gantt-task-name-text",children:x.text})]});case"start":return ae(x.start,"DD-MM-YYYY");case"end":return ae(x.end,"DD-MM-YYYY");case"duration":return e.jsxs("div",{style:{backgroundColor:"#f6e7db",padding:"4px 12px",borderRadius:"4px",fontWeight:600,color:"#434343",display:"inline-block",minWidth:"70px",textAlign:"center"},children:[x.duration," day",x.duration!==1?"s":""]});case"predecessors":const B=v.filter(Y=>Y.target===x.id);return e.jsx(Dt,{task:x,allTasks:r,links:v,onAddDependency:(Y,H,Z,se)=>S?.(Y,H,Z,se),children:e.jsx("div",{style:{cursor:"pointer",minHeight:"24px",width:"100%",display:"flex",alignItems:"center",gap:"4px"},children:B.map(Y=>{const H=r.find(se=>se.id===Y.source),Z=H?r.indexOf(H)+1:0;return e.jsx("span",{style:{fontSize:"11px",backgroundColor:"#e6f7ff",border:"1px solid #91d5ff",color:"#0050b3",padding:"1px 6px",borderRadius:"4px",whiteSpace:"nowrap"},children:jt(Y,Z)},Y.id)})})});case"add":return e.jsx(o.Button,{type:"text",size:"small",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faPlus,style:{fontSize:12,color:"#adb5bd"}}),onClick:Y=>{Y.stopPropagation(),d?.(x.id)}});case"progress":return e.jsxs("div",{className:"gantt-progress-cell",children:[e.jsx("div",{className:"gantt-progress-bar-bg",children:e.jsx("div",{className:"gantt-progress-bar-fill",style:{width:`${x.progress}%`}})}),e.jsxs("span",{className:"gantt-progress-text",children:[x.progress,"%"]})]});case"index":return e.jsx("span",{style:{color:"#8c8c8c"},children:r.indexOf(x)+1});default:return x[T.name]||""}};return e.jsxs("div",{className:"gantt-grid",ref:h,children:[e.jsx("div",{className:"gantt-grid-header",children:i.map(x=>e.jsx("div",{className:"gantt-grid-header-cell",style:{width:x.width,justifyContent:x.align==="center"?"center":"flex-start"},children:x.name==="add"?e.jsx(U.FontAwesomeIcon,{icon:z.faPlus,style:{fontSize:12,color:"#64748b",cursor:"pointer"},onClick:()=>d?.()}):e.jsxs(e.Fragment,{children:[x.label,x.name==="start"&&e.jsx(U.FontAwesomeIcon,{icon:z.faChevronDown,style:{marginLeft:8,fontSize:10,color:"#64748b"}})]})},x.name))}),e.jsx("div",{className:"gantt-grid-body",children:t.map(x=>{const T=C?.id===x.id,_=C?.descendantIds.includes(x.id);return e.jsxs("div",{className:`gantt-grid-row ${a===x.id?"selected":""} ${T?"dragging-row":""} ${_?"descendant-dragging-row":""} ${b?.taskId===x.id?`drop-target-${b.position}`:""}`,onClick:()=>s(x.id),onContextMenu:B=>m?.(B,x.id),children:[i.map(B=>e.jsx("div",{className:"gantt-grid-cell",style:{width:B.width,textAlign:B.align||"left"},children:O(x,B)},`${x.id}-${B.name}`)),b?.taskId===x.id&&e.jsx("div",{className:`gantt-drop-indicator ${b.position}`})]},x.id)})})]})});Ie.displayName="Grid";const Je=({task:t,position:r,selected:i,dragging:a,onClick:s,onDragStart:m,dragDeltaX:c=0,dragType:l=null,readonly:d=!1})=>{const S=(h,$)=>{d||(h.preventDefault(),h.stopPropagation(),m(h.clientX,h.clientY,$))},v=()=>{const h=["gantt-task-bar"];return t.type==="milestone"&&h.push("milestone"),t.type==="project"&&h.push("project"),i&&h.push("selected"),a&&h.push("dragging"),h.join(" ")},b=()=>{let h=r.left,$=r.width;return a&&l&&(l==="move"?h+=c:l==="resize-left"?(h+=c,$-=c):l==="resize-right"&&($+=c)),{left:`${h}px`,width:`${Math.max($,0)}px`,backgroundColor:t.color||void 0}},C=(h=!1)=>e.jsxs(e.Fragment,{children:[!d&&t.type!=="milestone"&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-left",onMouseDown:$=>S($,"resize-left")}),!h&&t.type!=="milestone"&&e.jsx("div",{className:"gantt-task-progress",style:{width:`${t.progress}%`}}),e.jsx("div",{className:"gantt-task-content",children:!h&&t.type!=="milestone"&&e.jsx("span",{className:"gantt-task-text",children:t.text})}),t.type==="milestone"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-milestone-diamond"}),e.jsx("span",{className:"gantt-milestone-text",children:t.text})]}),!d&&t.type!=="milestone"&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-right",onMouseDown:$=>S($,"resize-right")})]}),u=e.jsxs("div",{className:"gantt-tooltip",children:[e.jsx("div",{className:"gantt-tooltip-title",children:t.text}),e.jsxs("div",{className:"gantt-tooltip-dates",children:[ae(t.start,"MMM D")," - ",ae(t.end,"MMM D")]}),e.jsxs("div",{className:"gantt-tooltip-progress",children:["Progress: ",t.progress,"%"]}),t.owner&&e.jsxs("div",{className:"gantt-tooltip-owner",children:["Owner: ",t.owner]})]});return t.segments&&t.segments.length>0?e.jsx("div",{className:"gantt-task-group",children:t.segments.map((h,$)=>e.jsx(o.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:v()+" segment",style:{left:`${r.left+(h.start.getTime()-t.start.getTime())/(t.end.getTime()-t.start.getTime())*r.width}px`,width:`${(h.end.getTime()-h.start.getTime())/(t.end.getTime()-t.start.getTime())*r.width}px`,backgroundColor:t.color||"#ADCFFE"},onClick:s,onMouseDown:O=>S(O,"move"),children:C(!0)})},$))}):e.jsx(o.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:v(),style:b(),onClick:s,onMouseDown:h=>S(h,"move"),children:C()})})},Tt=({links:t,tasks:r,getTaskPosition:i})=>{const a=c=>r.find(l=>l.id===c),s=c=>{const l=a(c.source),d=a(c.target);if(!l||!d)return"";const S=i(l),v=i(d),b=S.top+S.height/2,C=v.top+v.height/2;let u=0,h=0;switch(c.type){case"e2s":u=S.left+S.width,h=v.left;break;case"s2s":u=S.left,h=v.left;break;case"e2e":u=S.left+S.width,h=v.left+v.width;break;case"s2e":u=S.left,h=v.left+v.width;break}const $=h-u,O=C-b,x=20;if(c.type==="e2s")if($>=x){const T=u+$/2;return`M ${u},${b} L ${T},${b} L ${T},${C} L ${h},${C}`}else{const T=x/2,_=b+O/2;return`M ${u},${b} L ${u+T},${b} L ${u+T},${_} L ${h-T},${_} L ${h-T},${C} L ${h},${C}`}else if(c.type==="s2s"){const T=Math.min(u,h)-x/2;return`M ${u},${b} L ${T},${b} L ${T},${C} L ${h},${C}`}else if(c.type==="e2e"){const T=Math.max(u,h)+x/2;return`M ${u},${b} L ${T},${b} L ${T},${C} L ${h},${C}`}else if(c.type==="s2e")if($<=-x){const T=u+$/2;return`M ${u},${b} L ${T},${b} L ${T},${C} L ${h},${C}`}else{const T=x/2,_=b+O/2;return`M ${u},${b} L ${u-T},${b} L ${u-T},${_} L ${h+T},${_} L ${h+T},${C} L ${h},${C}`}return""},m=c=>{const l=a(c.target);if(!l)return"";const d=i(l),S=d.top+d.height/2,v=8,b=6;let C=0,u=!0;return c.type==="e2s"||c.type==="s2s"?(C=d.left,u=!0):(C=d.left+d.width,u=!1),u?`M ${C},${S} L ${C-v},${S-b/2} L ${C-v},${S+b/2} Z`:`M ${C},${S} L ${C+v},${S-b/2} L ${C+v},${S+b/2} Z`};return e.jsx("svg",{className:"gantt-links-layer",style:{overflow:"visible"},children:t.map(c=>{const l=a(c.source),d=a(c.target);if(!l||!d)return null;const S=s(c),v=m(c);return e.jsxs("g",{className:"gantt-link",children:[e.jsx("path",{d:S,fill:"none",strokeWidth:"1.5",className:"gantt-link-line"}),e.jsx("path",{d:v,className:"gantt-link-arrow"})]},c.id)})})},Mt=(t,r,i=60,a="day",s=1)=>{const[m,c]=F.useState({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0}),l=F.useCallback((v,b,C,u)=>{const h=t.find($=>$.id===v);h&&c({taskId:v,initialX:b,initialY:C,initialStart:new Date(h.start),initialEnd:new Date(h.end),type:u,dragDeltaX:0,dragDeltaY:0})},[t]),d=F.useCallback((v,b)=>{if(!m.taskId||!m.type)return null;const C=v-m.initialX,u=b-m.initialY;if(c(_=>({..._,dragDeltaX:C,dragDeltaY:u})),m.type==="reorder")return null;const h=t.find(_=>_.id===m.taskId);if(!h)return null;const $=Math.round(C/i);let O=new Date(m.initialStart),x=new Date(m.initialEnd);switch(m.type){case"move":O=ie(m.initialStart,$*s,a),x=ie(m.initialEnd,$*s,a);break;case"resize-left":O=ie(m.initialStart,$*s,a),O>=x&&(O=ie(x,-s,a));break;case"resize-right":x=ie(m.initialEnd,$*s,a),x<=O&&(x=ie(O,s,a));break}const T=De(O,x);return{...h,start:O,end:x,duration:T}},[m,t,i]),S=F.useCallback(v=>{if(v&&r){const{id:b,...C}=v;r(b,C)}c({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0})},[r]);return{dragState:m,handleDragStart:l,handleDrag:d,handleDragEnd:S}},Le=F.forwardRef(({tasks:t,links:r,range:i,scales:a,config:s,selectedTask:m,onTaskClick:c,onTaskDragStart:l,onTaskDragEnd:d,onTaskUpdate:S,zoomLevel:v,baselines:b},C)=>{const[u,h]=F.useState(t),$=(s.columnWidth||60)*v,O=s.baselines&&b&&b.size>0,{dragState:x,handleDragStart:T,handleDrag:_,handleDragEnd:B}=Mt(u,S,$,a[1].unit,a[1].step);F.useEffect(()=>{h(t)},[t]);const Y=f=>{const p=[];let n=new Date(i.start);for(;n<=i.end;)p.push({date:new Date(n),label:ae(n,f.format||"D")}),n=ie(n,f.step,f.unit);return p},H=f=>{const p=a[1],n=i.start.getTime(),E=f.getTime()-n,J={hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6}[p.unit]||864e5;return E/(J*p.step)*$},Z=f=>{const p=H(f.start),n=H(f.end);return{left:p,width:Math.max(n-p,0)}},se=f=>{const p=H(f.start),n=H(f.end);return{left:p,width:Math.max(n-p,0)}},y=f=>{const p=Z(f),n=u.findIndex(J=>J.id===f.id),w=s.rowHeight||48,E=32,A=(w-E)/2;return{left:p.left,width:p.width,top:n*w+A,height:E}},L=F.useCallback(f=>{if(x.taskId&&x.type){const p=_(f.clientX,f.clientY);p&&h(n=>n.map(w=>w.id===p.id?p:w))}},[x,_]),I=F.useCallback(()=>{if(x.taskId){const f=u.find(p=>p.id===x.taskId);B(f||null),d()}},[x,u,B,d]),q=a[1],G=Y(q),N=()=>{const f=[];let p=-1,n=-1,w=0,E="";return G.forEach(A=>{const J=A.date.getMonth(),ee=A.date.getFullYear(),R=ae(A.date,"MMM YYYY");J!==p||ee!==n?(p!==-1&&f.push({label:E,width:w}),p=J,n=ee,w=$,E=R):w+=$}),p!==-1&&f.push({label:E,width:w}),f},D=()=>{const f=[];let p=-1,n=0,w=-1,E=-1,A="";return G.forEach(J=>{const R=J.date.getDate()<=15?0:1,ne=J.date.getMonth(),re=J.date.getFullYear(),K=ae(J.date,"MMM"),he=new Date(re,ne+1,0).getDate(),fe=R===0?`${K} 1 - 15`:`${K} 16 - ${he}`;R!==p||ne!==w||re!==E?(p!==-1&&f.push({label:A,width:n}),p=R,w=ne,E=re,n=$,A=fe):n+=$}),p!==-1&&f.push({label:A,width:n}),f},g=N(),k=D(),j=G.length*$;return e.jsxs("div",{className:"gantt-timeline-container",ref:C,onMouseMove:L,onMouseUp:I,style:{width:j},children:[e.jsxs("div",{className:"gantt-timeline-header",style:{width:j,minWidth:j},children:[e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-month",style:{width:j},children:g.map((f,p)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:f.width,minWidth:f.width,maxWidth:f.width,borderRight:p===g.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`top-${p}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-range",style:{width:j},children:k.map((f,p)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:f.width,minWidth:f.width,maxWidth:f.width,borderRight:p===k.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`mid-${p}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-day",style:{width:j},children:G.map((f,p)=>{const n=s.weekends&&Ne(f.date),w=s.holidays&&Pe(f.date,s.holidays);return e.jsx("div",{className:`gantt-timeline-cell ${n?"weekend":""} ${w?"holiday":""}`,style:{width:$,minWidth:$,maxWidth:$,borderRight:p===G.length-1?"none":"var(--wx-gantt-border)"},children:f.label},`day-${p}`)})})]}),e.jsxs("div",{className:"gantt-timeline-body",style:{width:j},children:[e.jsx("div",{className:"gantt-timeline-grid",children:G.map((f,p)=>{const n=s.weekends&&Ne(f.date),w=s.holidays&&Pe(f.date,s.holidays);return e.jsx("div",{className:`gantt-timeline-grid-column ${n?"weekend":""} ${w?"holiday":""}`,style:{width:$,minWidth:$}},p)})}),r.length>0&&e.jsx(Tt,{links:r,tasks:u,getTaskPosition:y}),e.jsx("div",{className:"gantt-timeline-tasks",style:{width:j},children:u.map(f=>{const p=Z(f),n=O?b?.get(f.id):void 0,w=n?se(n):void 0;return e.jsxs("div",{className:"gantt-timeline-row",children:[n&&w&&f.type!=="milestone"&&e.jsx("div",{className:"gantt-baseline-bar",style:{left:`${w.left}px`,width:`${w.width}px`},title:`Baseline: ${n.start.toLocaleDateString()} - ${n.end.toLocaleDateString()}`}),e.jsx(Je,{task:f,position:p,selected:m===f.id,dragging:x.taskId===f.id,dragDeltaX:x.dragDeltaX,dragType:x.type,onClick:()=>c(f.id),onDragStart:(E,A,J)=>{T(f.id,E,A,J),l(f.id,E,A)},readonly:s.readonly})]},f.id)})})]})]})});Le.displayName="Timeline";const Oe=F.forwardRef((t,r)=>e.jsx("div",{className:"gantt-chart-wrapper",style:{flex:1,minWidth:0},children:e.jsx(Le,{...t,ref:r})}));Oe.displayName="Chart";const{Search:$t}=o.Input,Ve=({onFilterChange:t,owners:r})=>{const[i,a]=F.useState({searchText:"",status:"all",priority:"all",owner:""}),s=l=>{const d={...i,...l};a(d),t(d)},m=()=>{const l={searchText:"",status:"all",priority:"all",owner:""};a(l),t(l)},c=i.searchText!==""||i.status!=="all"||i.priority!=="all"||i.owner!=="";return e.jsx("div",{className:"gantt-filter-container",children:e.jsxs("div",{className:"gantt-filter-bar",children:[e.jsx("div",{className:"gantt-filter-left",children:e.jsx($t,{placeholder:"Search tasks...",value:i.searchText,onChange:l=>s({searchText:l.target.value}),allowClear:!0,className:"gantt-search-antd",style:{width:250}})}),e.jsxs("div",{className:"gantt-filter-right",children:[e.jsx(o.Select,{value:i.status,onChange:l=>s({status:l}),className:"gantt-filter-select-antd",style:{width:140},options:[{value:"all",label:"All Status"},{value:"not-started",label:"Not Started"},{value:"in-progress",label:"In Progress"},{value:"completed",label:"Completed"}]}),e.jsx(o.Select,{value:i.priority,onChange:l=>s({priority:l}),className:"gantt-filter-select-antd",style:{width:130},options:[{value:"all",label:"All Priority"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}]}),e.jsx(o.Select,{value:i.owner||void 0,onChange:l=>s({owner:l||""}),className:"gantt-filter-select-antd",style:{width:130},placeholder:"All Owners",allowClear:!0,options:[{value:"",label:"All Owners"},...r.map(l=>({value:l,label:l}))]}),c&&e.jsx(o.Button,{type:"default",danger:!0,icon:e.jsx(U.FontAwesomeIcon,{icon:z.faTimesCircle}),onClick:m,className:"gantt-filter-clear-antd",children:"Clear"})]})]})})},Ge=(t,r)=>t.filter(i=>{if(r.searchText){const a=r.searchText.toLowerCase(),s=i.text.toLowerCase().includes(a),m=i.owner?.toLowerCase().includes(a),c=i.details?.toLowerCase().includes(a);if(!s&&!m&&!c)return!1}if(r.status!=="all"&&(i.progress===0?"not-started":i.progress===100?"completed":"in-progress")!==r.status||r.priority!=="all"&&i.priority!==r.priority||r.owner&&i.owner!==r.owner)return!1;if(r.dateRange){const a=i.start.getTime(),s=r.dateRange.start.getTime(),m=r.dateRange.end.getTime();if(a<s||a>m)return!1}return!0}),qe=({zoomLevel:t,setZoomLevel:r,onBaselineToggle:i,showBaselines:a,onExport:s,onFilterChange:m,owners:c,onAddTask:l})=>e.jsxs("div",{className:"gantt-toolbar-wrapper",children:[e.jsxs("div",{className:"gantt-toolbar",children:[e.jsx("div",{className:"gantt-toolbar-left",children:e.jsxs(o.Space,{size:8,children:[e.jsx(o.Button,{type:"primary",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faPlus}),onClick:l,children:"New Task"}),e.jsx(o.Tooltip,{title:a?"Hide Baselines":"Show Baselines",children:e.jsx(o.Button,{type:a?"primary":"default",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faCalendarCheck}),onClick:i,children:a?"Baselines":"Set Baseline"})})]})}),e.jsx("div",{className:"gantt-toolbar-right",children:e.jsxs(o.Space,{size:4,children:[e.jsx(o.Tooltip,{title:"Zoom Out",children:e.jsx(o.Button,{icon:e.jsx(U.FontAwesomeIcon,{icon:z.faSearchMinus}),onClick:()=>r(Math.max(.5,t-.25))})}),e.jsx(o.Tooltip,{title:"Zoom In",children:e.jsx(o.Button,{icon:e.jsx(U.FontAwesomeIcon,{icon:z.faSearchPlus}),onClick:()=>r(Math.min(2,t+.25))})}),e.jsx(o.Tooltip,{title:"Reset Zoom",children:e.jsx(o.Button,{icon:e.jsx(U.FontAwesomeIcon,{icon:z.faRotateLeft}),onClick:()=>r(1)})}),e.jsx(o.Divider,{type:"vertical",style:{height:24,margin:"0 4px"}}),e.jsx(o.Tooltip,{title:"Export to CSV",children:e.jsx(o.Button,{icon:e.jsx(U.FontAwesomeIcon,{icon:z.faFileCsv}),onClick:()=>s("csv")})}),e.jsx(o.Tooltip,{title:"Export to Excel",children:e.jsx(o.Button,{icon:e.jsx(U.FontAwesomeIcon,{icon:z.faFileExcel}),onClick:()=>s("excel")})}),e.jsx(o.Tooltip,{title:"Export to JSON",children:e.jsx(o.Button,{icon:e.jsx(U.FontAwesomeIcon,{icon:z.faFileCode}),onClick:()=>s("json")})}),e.jsx(o.Tooltip,{title:"Export to PDF",children:e.jsx(o.Button,{icon:e.jsx(U.FontAwesomeIcon,{icon:z.faFilePdf}),onClick:()=>s("pdf")})})]})})]}),e.jsx(Ve,{onFilterChange:m,owners:c})]});var $e={exports:{}},kt=$e.exports,Xe;function Ct(){return Xe||(Xe=1,(function(t,r){(function(i,a){t.exports=a()})(kt,(function(){var i=1e3,a=6e4,s=36e5,m="millisecond",c="second",l="minute",d="hour",S="day",v="week",b="month",C="quarter",u="year",h="date",$="Invalid Date",O=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|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,T={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(N){var D=["th","st","nd","rd"],g=N%100;return"["+N+(D[(g-20)%10]||D[g]||D[0])+"]"}},_=function(N,D,g){var k=String(N);return!k||k.length>=D?N:""+Array(D+1-k.length).join(g)+N},B={s:_,z:function(N){var D=-N.utcOffset(),g=Math.abs(D),k=Math.floor(g/60),j=g%60;return(D<=0?"+":"-")+_(k,2,"0")+":"+_(j,2,"0")},m:function N(D,g){if(D.date()<g.date())return-N(g,D);var k=12*(g.year()-D.year())+(g.month()-D.month()),j=D.clone().add(k,b),f=g-j<0,p=D.clone().add(k+(f?-1:1),b);return+(-(k+(g-j)/(f?j-p:p-j))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:b,y:u,w:v,d:S,D:h,h:d,m:l,s:c,ms:m,Q:C}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},Y="en",H={};H[Y]=T;var Z="$isDayjsObject",se=function(N){return N instanceof q||!(!N||!N[Z])},y=function N(D,g,k){var j;if(!D)return Y;if(typeof D=="string"){var f=D.toLowerCase();H[f]&&(j=f),g&&(H[f]=g,j=f);var p=D.split("-");if(!j&&p.length>1)return N(p[0])}else{var n=D.name;H[n]=D,j=n}return!k&&j&&(Y=j),j||!k&&Y},L=function(N,D){if(se(N))return N.clone();var g=typeof D=="object"?D:{};return g.date=N,g.args=arguments,new q(g)},I=B;I.l=y,I.i=se,I.w=function(N,D){return L(N,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var q=(function(){function N(g){this.$L=y(g.locale,null,!0),this.parse(g),this.$x=this.$x||g.x||{},this[Z]=!0}var D=N.prototype;return D.parse=function(g){this.$d=(function(k){var j=k.date,f=k.utc;if(j===null)return new Date(NaN);if(I.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var p=j.match(O);if(p){var n=p[2]-1||0,w=(p[7]||"0").substring(0,3);return f?new Date(Date.UTC(p[1],n,p[3]||1,p[4]||0,p[5]||0,p[6]||0,w)):new Date(p[1],n,p[3]||1,p[4]||0,p[5]||0,p[6]||0,w)}}return new Date(j)})(g),this.init()},D.init=function(){var g=this.$d;this.$y=g.getFullYear(),this.$M=g.getMonth(),this.$D=g.getDate(),this.$W=g.getDay(),this.$H=g.getHours(),this.$m=g.getMinutes(),this.$s=g.getSeconds(),this.$ms=g.getMilliseconds()},D.$utils=function(){return I},D.isValid=function(){return this.$d.toString()!==$},D.isSame=function(g,k){var j=L(g);return this.startOf(k)<=j&&j<=this.endOf(k)},D.isAfter=function(g,k){return L(g)<this.startOf(k)},D.isBefore=function(g,k){return this.endOf(k)<L(g)},D.$g=function(g,k,j){return I.u(g)?this[k]:this.set(j,g)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(g,k){var j=this,f=!!I.u(k)||k,p=I.p(g),n=function(re,K){var he=I.w(j.$u?Date.UTC(j.$y,K,re):new Date(j.$y,K,re),j);return f?he:he.endOf(S)},w=function(re,K){return I.w(j.toDate()[re].apply(j.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(K)),j)},E=this.$W,A=this.$M,J=this.$D,ee="set"+(this.$u?"UTC":"");switch(p){case u:return f?n(1,0):n(31,11);case b:return f?n(1,A):n(0,A+1);case v:var R=this.$locale().weekStart||0,ne=(E<R?E+7:E)-R;return n(f?J-ne:J+(6-ne),A);case S:case h:return w(ee+"Hours",0);case d:return w(ee+"Minutes",1);case l:return w(ee+"Seconds",2);case c:return w(ee+"Milliseconds",3);default:return this.clone()}},D.endOf=function(g){return this.startOf(g,!1)},D.$set=function(g,k){var j,f=I.p(g),p="set"+(this.$u?"UTC":""),n=(j={},j[S]=p+"Date",j[h]=p+"Date",j[b]=p+"Month",j[u]=p+"FullYear",j[d]=p+"Hours",j[l]=p+"Minutes",j[c]=p+"Seconds",j[m]=p+"Milliseconds",j)[f],w=f===S?this.$D+(k-this.$W):k;if(f===b||f===u){var E=this.clone().set(h,1);E.$d[n](w),E.init(),this.$d=E.set(h,Math.min(this.$D,E.daysInMonth())).$d}else n&&this.$d[n](w);return this.init(),this},D.set=function(g,k){return this.clone().$set(g,k)},D.get=function(g){return this[I.p(g)]()},D.add=function(g,k){var j,f=this;g=Number(g);var p=I.p(k),n=function(A){var J=L(f);return I.w(J.date(J.date()+Math.round(A*g)),f)};if(p===b)return this.set(b,this.$M+g);if(p===u)return this.set(u,this.$y+g);if(p===S)return n(1);if(p===v)return n(7);var w=(j={},j[l]=a,j[d]=s,j[c]=i,j)[p]||1,E=this.$d.getTime()+g*w;return I.w(E,this)},D.subtract=function(g,k){return this.add(-1*g,k)},D.format=function(g){var k=this,j=this.$locale();if(!this.isValid())return j.invalidDate||$;var f=g||"YYYY-MM-DDTHH:mm:ssZ",p=I.z(this),n=this.$H,w=this.$m,E=this.$M,A=j.weekdays,J=j.months,ee=j.meridiem,R=function(K,he,fe,je){return K&&(K[he]||K(k,f))||fe[he].slice(0,je)},ne=function(K){return I.s(n%12||12,K,"0")},re=ee||function(K,he,fe){var je=K<12?"AM":"PM";return fe?je.toLowerCase():je};return f.replace(x,(function(K,he){return he||(function(fe){switch(fe){case"YY":return String(k.$y).slice(-2);case"YYYY":return I.s(k.$y,4,"0");case"M":return E+1;case"MM":return I.s(E+1,2,"0");case"MMM":return R(j.monthsShort,E,J,3);case"MMMM":return R(J,E);case"D":return k.$D;case"DD":return I.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return R(j.weekdaysMin,k.$W,A,2);case"ddd":return R(j.weekdaysShort,k.$W,A,3);case"dddd":return A[k.$W];case"H":return String(n);case"HH":return I.s(n,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return re(n,w,!0);case"A":return re(n,w,!1);case"m":return String(w);case"mm":return I.s(w,2,"0");case"s":return String(k.$s);case"ss":return I.s(k.$s,2,"0");case"SSS":return I.s(k.$ms,3,"0");case"Z":return p}return null})(K)||p.replace(":","")}))},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(g,k,j){var f,p=this,n=I.p(k),w=L(g),E=(w.utcOffset()-this.utcOffset())*a,A=this-w,J=function(){return I.m(p,w)};switch(n){case u:f=J()/12;break;case b:f=J();break;case C:f=J()/3;break;case v:f=(A-E)/6048e5;break;case S:f=(A-E)/864e5;break;case d:f=A/s;break;case l:f=A/a;break;case c:f=A/i;break;default:f=A}return j?f:I.a(f)},D.daysInMonth=function(){return this.endOf(b).$D},D.$locale=function(){return H[this.$L]},D.locale=function(g,k){if(!g)return this.$L;var j=this.clone(),f=y(g,k,!0);return f&&(j.$L=f),j},D.clone=function(){return I.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},N})(),G=q.prototype;return L.prototype=G,[["$ms",m],["$s",c],["$m",l],["$H",d],["$W",S],["$M",b],["$y",u],["$D",h]].forEach((function(N){G[N[1]]=function(D){return this.$g(D,N[0],N[1])}})),L.extend=function(N,D){return N.$i||(N(D,q,L),N.$i=!0),L},L.locale=y,L.isDayjs=se,L.unix=function(N){return L(1e3*N)},L.en=H[Y],L.Ls=H,L.p={},L}))})($e)),$e.exports}var Ft=Ct();const Ze=ft(Ft),{Option:ye}=o.Select,{TextArea:Et}=o.Input,Ke=({onCreateTask:t,onClose:r})=>{const[i]=o.Form.useForm(),a=s=>{const m=s.start.toDate(),c=new Date(m);c.setDate(c.getDate()+(s.duration||1)),t({text:s.text,start:m,end:c,duration:s.duration||1,progress:s.progress||0,type:s.type,color:typeof s.color=="string"?s.color:s.color?.toHexString?.()||"#4A90E2",owner:s.owner||"",priority:s.priority||"medium",details:s.details||""}),r()};return e.jsx(o.Modal,{title:"Create New Task",open:!0,onCancel:r,onOk:()=>i.submit(),okText:"Create Task",cancelText:"Cancel",width:600,className:"gantt-modal-antd",children:e.jsxs(o.Form,{form:i,layout:"vertical",onFinish:a,initialValues:{type:"task",priority:"medium",start:Ze(),duration:1,progress:0,color:"#4A90E2"},children:[e.jsx(o.Form.Item,{name:"text",label:"Task Name",rules:[{required:!0,message:"Please enter task name"}],children:e.jsx(o.Input,{placeholder:"Enter task name",autoFocus:!0})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"type",label:"Type",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(ye,{value:"task",children:"Task"}),e.jsx(ye,{value:"milestone",children:"Milestone"}),e.jsx(ye,{value:"project",children:"Project"})]})}),e.jsx(o.Form.Item,{name:"priority",label:"Priority",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(ye,{value:"low",children:"Low"}),e.jsx(ye,{value:"medium",children:"Medium"}),e.jsx(ye,{value:"high",children:"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"start",label:"Start Date",style:{flex:1},children:e.jsx(o.DatePicker,{style:{width:"100%"}})}),e.jsx(o.Form.Item,{name:"duration",label:"Duration (days)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,style:{width:"100%"}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"color",label:"Color",style:{flex:1},children:e.jsx(o.ColorPicker,{showText:!0})}),e.jsx(o.Form.Item,{name:"progress",label:"Progress (%)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,max:100,style:{width:"100%"}})})]}),e.jsx(o.Form.Item,{name:"owner",label:"Owner",children:e.jsx(o.Input,{placeholder:"Assign to..."})}),e.jsx(o.Form.Item,{name:"details",label:"Details",children:e.jsx(Et,{placeholder:"Add task description...",rows:3})})]})})},{Option:we}=o.Select,{TextArea:Nt}=o.Input,{confirm:Pt}=o.Modal,Qe=({task:t,onUpdate:r,onDelete:i,onClose:a})=>{const[s]=o.Form.useForm(),m=l=>{const d=l.start.toDate(),S=new Date(d);S.setDate(S.getDate()+(l.duration||1)),r({...t,text:l.text,start:d,end:S,duration:l.duration||1,progress:l.progress||0,type:l.type,color:typeof l.color=="string"?l.color:l.color?.toHexString?.()||"#4A90E2",owner:l.owner||"",priority:l.priority||"medium",details:l.details||""}),a()},c=()=>{Pt({title:`Are you sure you want to delete "${t.text}"?`,icon:e.jsx(U.FontAwesomeIcon,{icon:z.faExclamationTriangle,style:{color:"#faad14",marginRight:8}}),content:"This action cannot be undone.",okText:"Yes, Delete",okType:"danger",cancelText:"No",onOk(){i(t.id),a()}})};return e.jsx(o.Modal,{title:"Edit Task",open:!0,onCancel:a,footer:[e.jsx(o.Button,{danger:!0,onClick:c,style:{float:"left"},children:"Delete"},"delete"),e.jsx(o.Button,{onClick:a,children:"Cancel"},"cancel"),e.jsx(o.Button,{type:"primary",onClick:()=>s.submit(),children:"Save Changes"},"submit")],width:600,className:"gantt-modal-antd",children:e.jsxs(o.Form,{form:s,layout:"vertical",onFinish:m,initialValues:{text:t.text,type:t.type||"task",priority:t.priority||"medium",start:Ze(t.start),duration:t.duration,progress:t.progress,color:t.color||"#4A90E2",owner:t.owner||"",details:t.details||""},children:[e.jsx(o.Form.Item,{name:"text",label:"Task Name",rules:[{required:!0,message:"Please enter task name"}],children:e.jsx(o.Input,{placeholder:"Enter task name"})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"type",label:"Type",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(we,{value:"task",children:"Task"}),e.jsx(we,{value:"milestone",children:"Milestone"}),e.jsx(we,{value:"project",children:"Project"})]})}),e.jsx(o.Form.Item,{name:"priority",label:"Priority",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(we,{value:"low",children:"Low"}),e.jsx(we,{value:"medium",children:"Medium"}),e.jsx(we,{value:"high",children:"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"start",label:"Start Date",style:{flex:1},children:e.jsx(o.DatePicker,{style:{width:"100%"}})}),e.jsx(o.Form.Item,{name:"duration",label:"Duration (days)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,style:{width:"100%"}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"color",label:"Color",style:{flex:1},children:e.jsx(o.ColorPicker,{showText:!0})}),e.jsx(o.Form.Item,{name:"progress",label:"Progress (%)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,max:100,style:{width:"100%"}})})]}),e.jsx(o.Form.Item,{name:"owner",label:"Owner",children:e.jsx(o.Input,{placeholder:"Assign to..."})}),e.jsx(o.Form.Item,{name:"details",label:"Details",children:e.jsx(Nt,{placeholder:"Add task description...",rows:3})})]})})},{Title:ke,Text:ue,Paragraph:et}=o.Typography,{Option:xe}=o.Select,tt=({task:t,allTasks:r,links:i,onAddDependency:a,onRemoveDependency:s,onClose:m})=>{const[c,l]=F.useState(""),[d,S]=F.useState("e2s"),[v,b]=F.useState(0),[C,u]=F.useState("day"),[h,$]=F.useState(""),O=i.filter(y=>y.target===t.id),x=i.filter(y=>y.source===t.id),T=r.filter(y=>y.id!==t.id&&y.id!==t.parent),_=()=>{if(c){const y=Ae(v,C);a(c,t.id,d,y),l(""),b(0),u("day")}},B=()=>{if(!h.trim())return;const y=wt(h.trim());if(!y){alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
7
- Example: 3FS+10d`);return}const L=y.taskNumber-1,I=r[L];if(!I){alert(`Task ${y.taskNumber} not found`);return}const q=bt(y.type),G=Ae(y.lag,y.lagUnit);a(I.id,t.id,q,G),$("")},Y=y=>{switch(y){case"e2s":return"Finish-to-Start (FS)";case"s2s":return"Start-to-Start (SS)";case"e2e":return"Finish-to-Finish (FF)";case"s2e":return"Start-to-Finish (SF)"}},H=y=>{switch(y){case"e2s":return"blue";case"s2s":return"green";case"e2e":return"purple";case"s2e":return"orange"}},Z=y=>!y||y===0?null:y>0?e.jsxs(o.Tag,{color:"warning",children:["+",y,"d lag"]}):e.jsxs(o.Tag,{color:"processing",children:[y,"d lead"]}),se=(y,L)=>{const I=r.find(q=>q.id===(L==="source"?y.source:y.target));return e.jsx(o.List.Item,{actions:[e.jsx(o.Button,{type:"text",danger:!0,icon:e.jsx(U.FontAwesomeIcon,{icon:z.faTrash}),onClick:()=>s(y.id),children:"Remove"})],children:e.jsx(o.List.Item.Meta,{title:e.jsxs(o.Space,{children:[e.jsx(ue,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:I?.text||(L==="source"?y.source:y.target)}),e.jsx(o.Tag,{color:H(y.type),children:Y(y.type)}),Z(y.lag)]}),description:e.jsxs(ue,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px"},children:[I?.owner&&`Owner: ${I.owner}`,I?.priority&&` • Priority: ${I.priority}`]})})})};return e.jsxs(o.Modal,{title:e.jsxs(o.Space,{children:[e.jsx(U.FontAwesomeIcon,{icon:z.faLink,style:{fontSize:"20px"}}),e.jsx(ke,{level:4,style:{margin:0,fontFamily:"IBM Plex Mono, monospace"},children:"Task Dependencies"})]}),open:!0,onCancel:m,width:900,footer:null,className:"gantt-dependency-modal",styles:{body:{maxHeight:"70vh",overflowY:"auto",fontFamily:"IBM Plex Sans, sans-serif"}},children:[e.jsx(o.Card,{size:"small",style:{marginBottom:24,backgroundColor:"#f5f5f5",borderColor:"#d9d9d9"},children:e.jsxs(o.Space,{direction:"vertical",size:4,children:[e.jsx(ue,{strong:!0,style:{fontFamily:"IBM Plex Mono, monospace",fontSize:"16px"},children:t.text}),e.jsxs(ue,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"13px"},children:[t.start.toLocaleDateString()," → ",t.end.toLocaleDateString(),t.owner&&` • Owner: ${t.owner}`,t.priority&&` • Priority: ${t.priority}`]})]})}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsxs(ke,{level:5,style:{fontFamily:"IBM Plex Mono, monospace",textTransform:"uppercase",letterSpacing:"0.5px",fontSize:"13px",color:"#595959"},children:[e.jsx(U.FontAwesomeIcon,{icon:z.faArrowDown,style:{marginRight:"8px"}}),"Depends On (Predecessors)"]}),O.length===0?e.jsx(o.Alert,{message:"No dependencies",description:"This task doesn't depend on any other tasks.",type:"info",showIcon:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}}):e.jsx(o.List,{dataSource:O,renderItem:y=>se(y,"source"),bordered:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}})]}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsxs(ke,{level:5,style:{fontFamily:"IBM Plex Mono, monospace",textTransform:"uppercase",letterSpacing:"0.5px",fontSize:"13px",color:"#595959"},children:[e.jsx(U.FontAwesomeIcon,{icon:z.faArrowUp,style:{marginRight:"8px"}}),"Dependents (Successors)"]}),x.length===0?e.jsx(o.Alert,{message:"No dependent tasks",description:"No other tasks depend on this task.",type:"info",showIcon:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}}):e.jsx(o.List,{dataSource:x,renderItem:y=>se(y,"target"),bordered:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}})]}),e.jsx(o.Divider,{}),e.jsx(o.Card,{title:e.jsxs(ke,{level:5,style:{margin:0,fontFamily:"IBM Plex Mono, monospace",fontSize:"14px"},children:[e.jsx(U.FontAwesomeIcon,{icon:z.faPlus,style:{marginRight:"8px"}}),"Add New Dependency"]}),style:{marginBottom:24},children:e.jsxs(o.Space,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsxs("div",{children:[e.jsx(ue,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Quick Add (Keyboard Shortcut):"}),e.jsx(ue,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px",display:"block",marginBottom:8},children:"Format: [TaskNumber][Type][+/-][Lag][Unit] • Example: 3FS+10d, 5SS-2w"}),e.jsxs(o.Space.Compact,{style:{width:"100%"},children:[e.jsx(o.Input,{placeholder:"e.g., 3FS+10d",value:h,onChange:y=>$(y.target.value),onPressEnter:B,size:"large",style:{fontFamily:"IBM Plex Mono, monospace"}}),e.jsx(o.Button,{type:"primary",size:"large",onClick:B,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:"Add"})]})]}),e.jsx(o.Divider,{style:{margin:"8px 0"},children:"OR"}),e.jsxs("div",{children:[e.jsx(ue,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Select Task:"}),e.jsx(o.Select,{placeholder:"Choose a task...",value:c||void 0,onChange:l,style:{width:"100%",fontFamily:"IBM Plex Sans, sans-serif"},size:"large",showSearch:!0,filterOption:(y,L)=>String(L?.children||"").toLowerCase().includes(y.toLowerCase()),children:T.map(y=>e.jsx(xe,{value:y.id,children:y.text},y.id))})]}),e.jsxs("div",{children:[e.jsx(ue,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Dependency Type:"}),e.jsxs(o.Select,{value:d,onChange:S,style:{width:"100%",fontFamily:"IBM Plex Sans, sans-serif"},size:"large",children:[e.jsxs(xe,{value:"e2s",children:[e.jsx(o.Tag,{color:"blue",children:"FS"})," Finish-to-Start"]}),e.jsxs(xe,{value:"s2s",children:[e.jsx(o.Tag,{color:"green",children:"SS"})," Start-to-Start"]}),e.jsxs(xe,{value:"e2e",children:[e.jsx(o.Tag,{color:"purple",children:"FF"})," Finish-to-Finish"]}),e.jsxs(xe,{value:"s2e",children:[e.jsx(o.Tag,{color:"orange",children:"SF"})," Start-to-Finish"]})]})]}),e.jsx("div",{children:e.jsxs(o.Space,{direction:"vertical",size:4,style:{width:"100%"},children:[e.jsx(ue,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:"Lead/Lag Time:"}),e.jsx(ue,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px"},children:"Negative = lead time (overlap), Positive = lag time (delay)"}),e.jsxs(o.Space.Compact,{style:{width:"100%"},children:[e.jsx(o.InputNumber,{value:v,onChange:y=>b(y||0),style:{flex:1,fontFamily:"IBM Plex Sans, sans-serif"},size:"large",placeholder:"0",min:-365,max:365}),e.jsxs(o.Select,{value:C,onChange:u,style:{width:120,fontFamily:"IBM Plex Sans, sans-serif"},size:"large",children:[e.jsx(xe,{value:"day",children:"Days"}),e.jsx(xe,{value:"hour",children:"Hours"}),e.jsx(xe,{value:"week",children:"Weeks"}),e.jsx(xe,{value:"month",children:"Months"})]})]})]})}),e.jsx(o.Button,{type:"primary",size:"large",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faPlus}),onClick:_,disabled:!c,block:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",fontWeight:600},children:"Add Dependency"})]})}),e.jsx(o.Alert,{message:e.jsxs(ue,{strong:!0,style:{fontFamily:"IBM Plex Mono, monospace"},children:[e.jsx(U.FontAwesomeIcon,{icon:z.faInfoCircle,style:{marginRight:"8px"}}),"Dependency Types Explained"]}),description:e.jsxs("div",{style:{fontFamily:"IBM Plex Sans, sans-serif"},children:[e.jsxs("ul",{style:{marginBottom:12,paddingLeft:20},children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Finish-to-Start (FS):"})," Successor starts after predecessor finishes"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Start-to-Start (SS):"})," Both tasks start at the same time"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Finish-to-Finish (FF):"})," Both tasks finish at the same time"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Start-to-Finish (SF):"})," Successor finishes when predecessor starts"]})]}),e.jsx(o.Divider,{style:{margin:"12px 0"}}),e.jsx(ue,{strong:!0,style:{display:"block",marginBottom:4},children:"Keyboard Shortcuts:"}),e.jsx(et,{style:{margin:0,fontSize:"12px"},code:!0,children:"[TaskID][Type]+/-[Days]d"}),e.jsxs(et,{style:{margin:0,fontSize:"12px"},children:["Example: ",e.jsx("code",{children:"3FS+10d"})," = Task 3, Finish-to-Start, 10 days lag"]})]}),type:"info",showIcon:!0,icon:e.jsx(U.FontAwesomeIcon,{icon:z.faInfoCircle}),style:{marginTop:16}})]})},At=({x:t,y:r,task:i,onEdit:a,onDelete:s,onCopy:m,onDependencies:c,onConvertToMilestone:l,onConvertToTask:d,onConvertToProject:S,onAutoSchedule:v,onClose:b})=>{if(!i)return null;const C=[{key:"edit",label:"Edit",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faEdit}),onClick:()=>{a(),b()}},{key:"copy",label:"Copy",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faCopy}),onClick:()=>{m(),b()}},{key:"dependencies",label:"Dependencies",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faLink}),onClick:()=>{c(),b()}},{type:"divider"},{key:"convert",label:"Convert to",type:"submenu",children:[{key:"milestone",label:"Milestone",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faFlag}),disabled:i.type==="milestone",onClick:()=>{l(),b()}},{key:"task",label:"Task",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faTasks}),disabled:i.type==="task",onClick:()=>{d(),b()}},{key:"project",label:"Project",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faFolder}),disabled:i.type==="project",onClick:()=>{S(),b()}}]},{key:"auto-schedule",label:"Auto Schedule",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faRotateLeft}),onClick:()=>{v?.(),b()}},{type:"divider"},{key:"delete",label:"Delete",icon:e.jsx(U.FontAwesomeIcon,{icon:z.faTrash}),danger:!0,onClick:()=>{s(),b()}}];return e.jsx("div",{className:"gantt-context-menu",style:{position:"fixed",left:`${t}px`,top:`${r}px`,zIndex:1e4},onClick:u=>u.stopPropagation(),children:e.jsx(o.Menu,{items:C,style:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"6px",border:"1px solid #e0e0e0"}})})},nt=(t,r=[])=>{const[i,a]=F.useState([]),[s,m]=F.useState(-1),[c,l]=F.useState(t),[d,S]=F.useState(r),v=F.useCallback((T,_,B)=>{const Y={type:T,before:_,after:B,timestamp:Date.now()},H=i.slice(0,s+1);H.push(Y),H.length>50?H.shift():m(s+1),a(H)},[i,s]),b=F.useCallback(()=>{if(s<0)return;const T=i[s];l(T.before.tasks),S(T.before.links),m(s-1)},[i,s]),C=F.useCallback(()=>{if(s>=i.length-1)return;const T=i[s+1];l(T.after.tasks),S(T.after.links),m(s+1)},[i,s]),u=s>=0,h=s<i.length-1,$=F.useCallback(T=>{const _={tasks:c,links:d},B=c.map(H=>H.id===T.id?T:H);v("task_update",_,{tasks:B,links:d}),l(B)},[c,d,v]),O=F.useCallback(T=>{const _={tasks:c,links:d},B=[...c,T];v("task_create",_,{tasks:B,links:d}),l(B)},[c,d,v]),x=F.useCallback(T=>{const _={tasks:c,links:d},B=c.filter(Z=>Z.id!==T),Y=d.filter(Z=>Z.source!==T&&Z.target!==T);v("task_delete",_,{tasks:B,links:Y}),l(B),S(Y)},[c,d,v]);return{tasks:c,links:d,setTasks:l,setLinks:S,undo:b,redo:C,canUndo:u,canRedo:h,updateTask:$,createTask:O,deleteTask:x,saveState:v,history:i}},st=(t,r,i={mode:"forward"})=>{const a=new Map,s=new Map;return t.forEach(m=>{a.set(m.id,[]),s.set(m.id,[])}),r.forEach(m=>{m.type==="e2s"&&(a.get(m.target)?.push(m.source),s.get(m.source)?.push(m.target))}),i.mode==="forward"?It(t,a,i):Lt(t,s,i)},It=(t,r,i)=>{const a=new Map,s=new Set,m=i.projectStart||new Date,c=l=>{if(s.has(l))return;const d=t.find(h=>h.id===l);if(!d)return;const S=r.get(l)||[];S.forEach(h=>c(h));let v=m;S.forEach(h=>{const $=a.get(h);$&&$.end>v&&(v=new Date($.end))});const b=new Date(v),C=ie(b,d.duration,"day"),u={...d,start:b,end:C};a.set(l,u),s.add(l)};return t.forEach(l=>c(l.id)),t.map(l=>a.get(l.id)||l)},Lt=(t,r,i)=>{const a=new Map,s=new Set,m=i.projectEnd||new Date(Math.max(...t.map(l=>l.end.getTime()))),c=l=>{if(s.has(l))return;const d=t.find(h=>h.id===l);if(!d)return;const S=r.get(l)||[];S.forEach(h=>c(h));let v=m;S.forEach(h=>{const $=a.get(h);$&&$.start<v&&(v=new Date($.start))});const b=new Date(v),C=ie(b,-d.duration,"day"),u={...d,start:C,end:b};a.set(l,u),s.add(l)};return t.forEach(l=>c(l.id)),t.map(l=>a.get(l.id)||l)},Ot=Object.freeze(Object.defineProperty({__proto__:null,autoSchedule:st,levelResources:t=>{const r=new Map;t.forEach(a=>{a.owner&&(r.has(a.owner)||r.set(a.owner,[]),r.get(a.owner).push(a))});const i=[...t];return r.forEach((a,s)=>{const m=a.sort((c,l)=>c.start.getTime()-l.start.getTime());for(let c=1;c<m.length;c++){const l=m[c],d=m[c-1];if(l.start<d.end){const S=i.findIndex(v=>v.id===l.id);if(S>=0){const v=new Date(d.end),b=ie(v,l.duration,"day");i[S]={...l,start:v,end:b}}}}}),i}},Symbol.toStringTag,{value:"Module"})),rt=t=>{const r=new Map;return t.forEach(i=>{r.set(i.id,{taskId:i.id,start:new Date(i.start),end:new Date(i.end)})}),r},it=t=>{const r=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority"],i=t.map(s=>[s.id,s.text,ae(s.start,"YYYY-MM-DD"),ae(s.end,"YYYY-MM-DD"),s.duration.toString(),`${s.progress}%`,s.type||"task",s.owner||"",s.priority||"medium"]),a=[r.join(","),...i.map(s=>s.map(m=>`"${m}"`).join(","))].join(`
8
- `);Ce(a,"gantt-tasks.csv","text/csv")},at=t=>{const r=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority","Details"],i=t.map(s=>[s.id,s.text,ae(s.start,"MM/DD/YYYY"),ae(s.end,"MM/DD/YYYY"),s.duration.toString(),s.progress.toString(),s.type||"task",s.owner||"",s.priority||"medium",s.details||""]),a="\uFEFF"+[r.join(" "),...i.map(s=>s.map(m=>m.replace(/\t/g," ")).join(" "))].join(`
9
- `);Ce(a,"gantt-tasks.xls","application/vnd.ms-excel")},ot=(t,r)=>{const i={tasks:t,links:r,exported:new Date().toISOString(),version:"1.0"},a=JSON.stringify(i,null,2);Ce(a,"gantt-project.json","application/json")},lt=t=>{const r=`
6
+ <%s key={someKey} {...props} />`,P,R,K,R),C[R+P]=!0)}if(R=null,k!==void 0&&(i(k),R=""+k),c(y)&&(i(y.key),R=""+y.key),"key"in y){k={};for(var ue in y)ue!=="key"&&(k[ue]=y[ue])}else k=y;return R&&l(k,typeof r=="function"?r.displayName||r.name||"Unknown":r),T(r,R,k,s(),V,de)}function g(r){D(r)?r._store&&(r._store.validated=1):typeof r=="object"&&r!==null&&r.$$typeof===m&&(r._payload.status==="fulfilled"?D(r._payload.value)&&r._payload.value._store&&(r._payload.value._store.validated=1):r._store&&(r._store.validated=1))}function D(r){return typeof r=="object"&&r!==null&&r.$$typeof===h}var u=S,h=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),$=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),W=Symbol.for("react.client.reference"),U=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_=Object.prototype.hasOwnProperty,oe=Array.isArray,te=console.createTask?console.createTask:function(){return null};u={react_stack_bottom_frame:function(r){return r()}};var se,Z={},z=u.react_stack_bottom_frame.bind(u,p)(),v=te(a(p)),C={};je.Fragment=F,je.jsx=function(r,y,k){var P=1e4>U.recentlyCreatedOwnerStacks++;return d(r,y,k,!1,P?Error("react-stack-top-frame"):z,P?te(a(r)):v)},je.jsxs=function(r,y,k){var P=1e4>U.recentlyCreatedOwnerStacks++;return d(r,y,k,!0,P?Error("react-stack-top-frame"):z,P?te(a(r)):v)}})()),je}var He;function ft(){return He||(He=1,process.env.NODE_ENV==="production"?Te.exports=ht():Te.exports=pt()),Te.exports}var e=ft();const q=(t,n,i)=>{const a=new Date(t);switch(i){case"hour":a.setHours(a.getHours()+n);break;case"day":a.setDate(a.getDate()+n);break;case"week":a.setDate(a.getDate()+n*7);break;case"month":a.setMonth(a.getMonth()+n);break;case"quarter":a.setMonth(a.getMonth()+n*3);break;case"year":a.setFullYear(a.getFullYear()+n);break}return a},be=(t,n)=>{const i=n.getTime()-t.getTime();return Math.ceil(i/(1e3*60*60*24))},We=(t,n)=>{const i=n.getTime()-t.getTime();return Math.ceil(i/(1e3*60*60))},Q=(t,n)=>{const i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],p={YYYY:t.getFullYear().toString(),YY:t.getFullYear().toString().slice(-2),MMMM:a[t.getMonth()],MMM:i[t.getMonth()],MM:String(t.getMonth()+1).padStart(2,"0"),M:String(t.getMonth()+1),DD:String(t.getDate()).padStart(2,"0"),D:String(t.getDate()),dddd:s[t.getDay()],HH:String(t.getHours()).padStart(2,"0"),H:String(t.getHours()),mm:String(t.getMinutes()).padStart(2,"0"),m:String(t.getMinutes())};return n.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g,c=>p[c])},Ee=t=>{const n=t.getDay();return n===0||n===6},$e=(t,n)=>n.some(i=>i.getFullYear()===t.getFullYear()&&i.getMonth()===t.getMonth()&&i.getDate()===t.getDate()),Se=t=>{const n=new Date(t);return n.setHours(0,0,0,0),n},mt=t=>{const n=new Date(t);return n.setHours(23,59,59,999),n},xt=(t,n,i="day")=>{switch(i){case"hour":return We(t,n);case"day":return be(t,n);case"week":return Math.ceil(be(t,n)/7);case"month":return(n.getFullYear()-t.getFullYear())*12+(n.getMonth()-t.getMonth());default:return be(t,n)}};function gt(t){if(!t||typeof t!="string")return null;const n=t.trim(),i=/^(\d+)(FS|SS|FF|SF)(([+-])(\d+)([dhwm]))?$/i,a=n.match(i);if(!a)return null;const s=parseInt(a[1],10),p=a[2].toUpperCase();let c=0,l="day";if(a[3]){const x=a[4]==="-"?-1:1;switch(c=parseInt(a[5],10)*x,a[6].toLowerCase()){case"d":l="day";break;case"h":l="hour";break;case"w":l="week";break;case"m":l="month";break}}return{taskNumber:s,type:p,lag:c,lagUnit:l}}function Ne(t,n){switch(n){case"hour":return t/24;case"day":return t;case"week":return t*7;case"month":return t*30;default:return t}}function yt(t,n){const a={e2s:"FS",s2s:"SS",e2e:"FF",s2e:"SF"}[t.type];let s=`${n}${a}`;if(t.lag&&t.lag!==0){const p=t.lag>0?"+":"",l=(t.lagUnit||"day").charAt(0);let x=t.lag;if(t.lagUnit&&t.lagUnit!=="day")switch(t.lagUnit){case"hour":x=t.lag*24;break;case"week":x=t.lag/7;break;case"month":x=t.lag/30;break}s+=`${p}${Math.round(x)}${l}`}return s}function wt(t){return{FS:"e2s",SS:"s2s",FF:"e2e",SF:"s2e"}[t]}const{Text:pe,Paragraph:jt,Link:bt}=o.Typography,{Option:Ue}=o.Select,St=({task:t,allTasks:n,onAddDependency:i,children:a})=>{const[s,p]=S.useState(!1),[c,l]=S.useState(""),[x,T]=S.useState(null),[d,g]=S.useState("e2s"),[D,u]=S.useState("lag"),[h,j]=S.useState(0),[F,f]=S.useState(!0),b="day",E=S.useMemo(()=>{if(!c)return n.filter(O=>O.id!==t.id);const m=c.toLowerCase();return n.filter(O=>O.id!==t.id&&(O.text.toLowerCase().includes(m)||(n.indexOf(O)+1).toString().includes(m)))},[n,c,t.id]),$=()=>{if(x){const m=D==="lag"?h:-h,O=Ne(m,b);i(x,t.id,d,O),p(!1),L()}},L=()=>{l(""),T(null),g("e2s"),u("lag"),j(0)},B=()=>{if(!F)return null;const m=d==="e2s",O=d==="s2s",W=d==="e2e",U=d==="s2e";let _=0,oe=0,te="",se=0,Z=-1;return m?(_=20,oe=160,se=140,Z=160,te="M 140 40 L 150 40 C 160 40, 160 90, 150 90 L 160 90"):W?(_=60,oe=60,se=180,Z=-1,te="M 180 40 L 200 40 L 200 90 L 180 90"):O?(_=100,oe=100,se=100,Z=-1,te="M 100 40 L 80 40 L 80 90 L 100 90"):U&&(_=160,oe=20,se=160,Z=140,te="M 160 40 L 150 40 C 140 40, 140 90, 150 90 L 140 90"),e.jsx("div",{style:{width:"100%",height:120,backgroundColor:"#fff",borderRadius:4,marginBottom:10,border:"1px solid #e9ecef",position:"relative",overflow:"hidden"},children:e.jsxs("svg",{viewBox:"0 0 300 120",style:{width:"100%",height:"100%"},children:[e.jsx("line",{x1:se,x2:se,y1:"0",y2:"120",stroke:"#f0f0f0",strokeDasharray:"3,3"}),Z!==-1&&e.jsx("line",{x1:Z,x2:Z,y1:"0",y2:"120",stroke:"#f0f0f0",strokeDasharray:"3,3"}),e.jsx("rect",{x:_,y:"28",width:"120",height:"24",rx:"4",fill:"#bae7ff",stroke:"#69c0ff"}),e.jsx("text",{x:_+60,y:"44",fontSize:"11",textAnchor:"middle",fill:"#0050b3",children:"Task 2"}),e.jsx("rect",{x:oe,y:"78",width:"120",height:"24",rx:"4",fill:"#bae7ff",stroke:"#69c0ff"}),e.jsx("text",{x:oe+60,y:"94",fontSize:"11",textAnchor:"middle",fill:"#0050b3",children:"Task 3"}),e.jsx("path",{d:te,fill:"none",stroke:"#8c8c8c",strokeWidth:"1.5",markerEnd:"url(#arrowhead)"}),e.jsx("defs",{children:e.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:"9",refY:"3.5",orient:"auto",children:e.jsx("polygon",{points:"0 0, 10 3.5, 0 7",fill:"#8c8c8c"})})})]})})},X=()=>{const m=n.find(_=>_.id===x);if(!m)return"Select a task from the list to see how it will relate to the current task.";const O=n.indexOf(t)+1,W=n.indexOf(m)+1;let U="";switch(d){case"e2s":U=`Task ${O} starts after Task ${W} finishes`;break;case"s2s":U=`Task ${O} starts when Task ${W} starts`;break;case"e2e":U=`Task ${O} finishes when Task ${W} finishes`;break;case"s2e":U=`Task ${O} finishes when Task ${W} starts`;break}if(h>0){const _=`${h} ${b}${h>1?"s":""}`;D==="lag"?U+=` + ${_} delay`:U+=` - ${_} overlap`}return U+"."},ee=e.jsxs("div",{style:{display:"flex",width:620,height:480,backgroundColor:"#fff",borderRadius:"8px",overflow:"hidden"},children:[e.jsxs("div",{style:{flex:1,borderRight:"1px solid #f0f0f0",display:"flex",flexDirection:"column",padding:0},children:[e.jsx("div",{style:{padding:"12px"},children:e.jsx(o.Input,{placeholder:"Search task...",value:c,onChange:m=>l(m.target.value),style:{marginBottom:8},autoFocus:!0,size:"large"})}),e.jsx("div",{style:{flex:1,overflowY:"auto"},children:e.jsx(o.List,{size:"small",dataSource:E,renderItem:m=>e.jsxs(o.List.Item,{className:`task-list-item ${x===m.id?"selected":""}`,onClick:()=>T(m.id),style:{cursor:"pointer",padding:"8px 16px",backgroundColor:x===m.id?"#f0f7ff":"transparent",display:"flex",justifyContent:"space-between"},children:[e.jsxs("div",{style:{display:"flex",gap:12},children:[e.jsx(pe,{type:"secondary",style:{width:20},children:n.indexOf(m)+1}),e.jsx(pe,{children:m.text})]}),e.jsx(I.FontAwesomeIcon,{icon:A.faChevronRight,style:{fontSize:10,color:"#bfbfbf"}})]})})})]}),e.jsxs("div",{style:{width:340,padding:"24px",display:"flex",flexDirection:"column",borderLeft:"1px solid #f0f0f0"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:15},children:[e.jsx(pe,{strong:!0,children:"Dependency type"}),e.jsx(bt,{style:{fontSize:"12px"},onClick:()=>f(!F),children:F?"Hide preview":"Show preview"})]}),B(),e.jsx(jt,{style:{fontSize:"13px",color:"#262626",marginBottom:20,minHeight:48,lineHeight:"1.6"},children:X()}),e.jsx(o.Radio.Group,{value:d,onChange:m=>g(m.target.value),style:{width:"100%",marginBottom:20},children:e.jsxs(o.Space,{direction:"vertical",style:{width:"100%"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"e2s",children:"Finish to Start"}),e.jsx(pe,{type:"secondary",children:"FS"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"e2e",children:"Finish to Finish"}),e.jsx(pe,{type:"secondary",children:"FF"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"s2s",children:"Start to Start"}),e.jsx(pe,{type:"secondary",children:"SS"})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[e.jsx(o.Radio,{value:"s2e",children:"Start to Finish"}),e.jsx(pe,{type:"secondary",children:"SF"})]})]})}),e.jsxs("div",{style:{display:"flex",gap:"10px",marginBottom:20},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(pe,{type:"secondary",style:{fontSize:"11px",display:"block",marginBottom:4},children:"Delay type"}),e.jsxs(o.Select,{value:D,onChange:m=>u(m),style:{width:"100%"},size:"large",children:[e.jsx(Ue,{value:"lag",children:"Lag by"}),e.jsx(Ue,{value:"lead",children:"Lead by"})]})]}),e.jsxs("div",{style:{width:100},children:[e.jsx(pe,{type:"secondary",style:{fontSize:"11px",display:"block",marginBottom:4},children:"Days"}),e.jsx(o.Space.Compact,{style:{width:"100%"},children:e.jsx(o.InputNumber,{min:0,value:h,onChange:m=>j(m||0),style:{width:"100%"},placeholder:"0",size:"large"})})]})]}),e.jsx(o.Button,{type:"primary",block:!0,onClick:$,disabled:!x,style:{marginTop:"auto",backgroundColor:"#5c67f2",height:44,borderRadius:"6px"},children:"Add"})]})]});return e.jsx(o.Popover,{content:ee,trigger:"click",open:s,onOpenChange:p,placement:"bottomLeft",overlayClassName:"dependency-popover",overlayInnerStyle:{padding:0},children:a})},Pe=S.forwardRef(({tasks:t,allTasks:n=[],columns:i,selectedTask:a,onTaskClick:s,onTaskContextMenu:p,onTaskUpdate:c,onTaskDragStart:l,onAddTask:x,onAddDependency:T,links:d=[],dropIndicator:g,reorderTask:D},u)=>{const h=S.useRef(null);S.useImperativeHandle(u,()=>h.current);const j=(f,b=0)=>{if(!f.parent)return b;const E=t.find($=>$.id===f.parent);return E?j(E,b+1):b},F=(f,b)=>{if(b.template)return b.template(f);switch(b.name){case"text":const E=j(f);return e.jsxs("div",{className:"gantt-grid-cell-text",style:{paddingLeft:E*14},children:[e.jsx("div",{className:"gantt-row-drag-handle",onMouseDown:L=>{L.preventDefault(),l?.(f.id,L.clientX,L.clientY,"reorder")},children:e.jsx(I.FontAwesomeIcon,{icon:A.faGripVertical})}),f.type==="project"?e.jsx("span",{className:"gantt-tree-icon",onClick:L=>{L.stopPropagation(),c?.({...f,open:!f.open})},children:e.jsx(I.FontAwesomeIcon,{icon:f.open?A.faChevronDown:A.faChevronRight})}):e.jsx("span",{style:{width:16,display:"inline-block"}}),e.jsx("span",{className:"gantt-task-name-text",children:f.text})]});case"start":return Q(f.start,"DD-MM-YYYY");case"end":return Q(f.end,"DD-MM-YYYY");case"duration":return e.jsxs("div",{style:{backgroundColor:"#f6e7db",padding:"4px 12px",borderRadius:"4px",fontWeight:600,color:"#434343",display:"inline-block",minWidth:"70px",textAlign:"center"},children:[f.duration," day",f.duration!==1?"s":""]});case"predecessors":const $=d.filter(L=>L.target===f.id);return e.jsx(St,{task:f,allTasks:n,links:d,onAddDependency:(L,B,X,ee)=>T?.(L,B,X,ee),children:e.jsx("div",{style:{cursor:"pointer",minHeight:"24px",width:"100%",display:"flex",alignItems:"center",gap:"4px"},children:$.map(L=>{const B=n.find(ee=>ee.id===L.source),X=B?n.indexOf(B)+1:0;return e.jsx("span",{style:{fontSize:"11px",backgroundColor:"#e6f7ff",border:"1px solid #91d5ff",color:"#0050b3",padding:"1px 6px",borderRadius:"4px",whiteSpace:"nowrap"},children:yt(L,X)},L.id)})})});case"add":return e.jsx(o.Button,{type:"text",size:"small",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faPlus,style:{fontSize:12,color:"#adb5bd"}}),onClick:L=>{L.stopPropagation(),x?.(f.id)}});case"progress":return e.jsxs("div",{className:"gantt-progress-cell",children:[e.jsx("div",{className:"gantt-progress-bar-bg",children:e.jsx("div",{className:"gantt-progress-bar-fill",style:{width:`${f.progress}%`}})}),e.jsxs("span",{className:"gantt-progress-text",children:[f.progress,"%"]})]});case"index":return e.jsx("span",{style:{color:"#8c8c8c"},children:n.indexOf(f)+1});default:return f[b.name]||""}};return e.jsxs("div",{className:"gantt-grid",ref:h,children:[e.jsx("div",{className:"gantt-grid-header",children:i.map(f=>e.jsx("div",{className:"gantt-grid-header-cell",style:{width:f.width,justifyContent:f.align==="center"?"center":"flex-start"},children:f.name==="add"?e.jsx(I.FontAwesomeIcon,{icon:A.faPlus,style:{fontSize:12,color:"#64748b",cursor:"pointer"},onClick:()=>x?.()}):e.jsxs(e.Fragment,{children:[f.label,f.name==="start"&&e.jsx(I.FontAwesomeIcon,{icon:A.faChevronDown,style:{marginLeft:8,fontSize:10,color:"#64748b"}})]})},f.name))}),e.jsx("div",{className:"gantt-grid-body",children:t.map(f=>{const b=D?.id===f.id,E=D?.descendantIds.includes(f.id);return e.jsxs("div",{className:`gantt-grid-row ${a===f.id?"selected":""} ${b?"dragging-row":""} ${E?"descendant-dragging-row":""} ${g?.taskId===f.id?`drop-target-${g.position}`:""}`,onClick:()=>s(f.id),onContextMenu:$=>p?.($,f.id),children:[i.map($=>e.jsx("div",{className:"gantt-grid-cell",style:{width:$.width,textAlign:$.align||"left"},children:F(f,$)},`${f.id}-${$.name}`)),g?.taskId===f.id&&e.jsx("div",{className:`gantt-drop-indicator ${g.position}`})]},f.id)})})]})});Pe.displayName="Grid";const Ge=({task:t,position:n,selected:i,dragging:a,onClick:s,onDragStart:p,dragDeltaX:c=0,dragType:l=null,readonly:x=!1})=>{const T=(h,j)=>{x||(h.preventDefault(),h.stopPropagation(),p(h.clientX,h.clientY,j))},d=()=>{const h=["gantt-task-bar"];return t.type==="milestone"&&h.push("milestone"),t.type==="project"&&h.push("project"),i&&h.push("selected"),a&&h.push("dragging"),h.join(" ")},g=()=>{let h=n.left,j=n.width;return a&&l&&(l==="move"?h+=c:l==="resize-left"?(h+=c,j-=c):l==="resize-right"&&(j+=c)),{left:`${h}px`,width:`${Math.max(j,0)}px`,backgroundColor:t.color||void 0}},D=(h=!1)=>e.jsxs(e.Fragment,{children:[!x&&t.type!=="milestone"&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-left",onMouseDown:j=>T(j,"resize-left")}),!h&&t.type!=="milestone"&&e.jsx("div",{className:"gantt-task-progress",style:{width:`${t.progress}%`}}),e.jsx("div",{className:"gantt-task-content",children:!h&&t.type!=="milestone"&&e.jsx("span",{className:"gantt-task-text",children:t.text})}),t.type==="milestone"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-milestone-diamond"}),e.jsx("span",{className:"gantt-milestone-text",children:t.text})]}),!x&&t.type!=="milestone"&&!h&&e.jsx("div",{className:"gantt-task-resize-handle gantt-task-resize-right",onMouseDown:j=>T(j,"resize-right")})]}),u=e.jsxs("div",{className:"gantt-tooltip",children:[e.jsx("div",{className:"gantt-tooltip-title",children:t.text}),e.jsxs("div",{className:"gantt-tooltip-dates",children:[Q(t.start,"MMM D")," - ",Q(t.end,"MMM D")]}),e.jsxs("div",{className:"gantt-tooltip-progress",children:["Progress: ",t.progress,"%"]}),t.owner&&e.jsxs("div",{className:"gantt-tooltip-owner",children:["Owner: ",t.owner]})]});return t.segments&&t.segments.length>0?e.jsx("div",{className:"gantt-task-group",children:t.segments.map((h,j)=>e.jsx(o.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:d()+" segment",style:{left:`${n.left+(h.start.getTime()-t.start.getTime())/(t.end.getTime()-t.start.getTime())*n.width}px`,width:`${(h.end.getTime()-h.start.getTime())/(t.end.getTime()-t.start.getTime())*n.width}px`,backgroundColor:t.color||"#ADCFFE"},onClick:s,onMouseDown:F=>T(F,"move"),children:D(!0)})},j))}):e.jsx(o.Tooltip,{title:u,mouseEnterDelay:.5,children:e.jsx("div",{className:d(),style:g(),onClick:s,onMouseDown:h=>T(h,"move"),children:D()})})},Tt=({links:t,tasks:n,getTaskPosition:i})=>{const a=c=>n.find(l=>l.id===c),s=c=>{const l=a(c.source),x=a(c.target);if(!l||!x)return"";const T=i(l),d=i(x),g=T.top+T.height/2,D=d.top+d.height/2;let u=0,h=0;switch(c.type){case"e2s":u=T.left+T.width,h=d.left;break;case"s2s":u=T.left,h=d.left;break;case"e2e":u=T.left+T.width,h=d.left+d.width;break;case"s2e":u=T.left,h=d.left+d.width;break}const j=h-u,F=D-g,f=20;if(c.type==="e2s")if(j>=f){const b=u+j/2;return`M ${u},${g} L ${b},${g} L ${b},${D} L ${h},${D}`}else{const b=f/2,E=g+F/2;return`M ${u},${g} L ${u+b},${g} L ${u+b},${E} L ${h-b},${E} L ${h-b},${D} L ${h},${D}`}else if(c.type==="s2s"){const b=Math.min(u,h)-f/2;return`M ${u},${g} L ${b},${g} L ${b},${D} L ${h},${D}`}else if(c.type==="e2e"){const b=Math.max(u,h)+f/2;return`M ${u},${g} L ${b},${g} L ${b},${D} L ${h},${D}`}else if(c.type==="s2e")if(j<=-f){const b=u+j/2;return`M ${u},${g} L ${b},${g} L ${b},${D} L ${h},${D}`}else{const b=f/2,E=g+F/2;return`M ${u},${g} L ${u-b},${g} L ${u-b},${E} L ${h+b},${E} L ${h+b},${D} L ${h},${D}`}return""},p=c=>{const l=a(c.target);if(!l)return"";const x=i(l),T=x.top+x.height/2,d=8,g=6;let D=0,u=!0;return c.type==="e2s"||c.type==="s2s"?(D=x.left,u=!0):(D=x.left+x.width,u=!1),u?`M ${D},${T} L ${D-d},${T-g/2} L ${D-d},${T+g/2} Z`:`M ${D},${T} L ${D+d},${T-g/2} L ${D+d},${T+g/2} Z`};return e.jsx("svg",{className:"gantt-links-layer",style:{overflow:"visible"},children:t.map(c=>{const l=a(c.source),x=a(c.target);if(!l||!x)return null;const T=s(c),d=p(c);return e.jsxs("g",{className:"gantt-link",children:[e.jsx("path",{d:T,fill:"none",strokeWidth:"1.5",className:"gantt-link-line"}),e.jsx("path",{d,className:"gantt-link-arrow"})]},c.id)})})},vt=(t,n,i=60,a="day",s=1)=>{const[p,c]=S.useState({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0}),l=S.useCallback((d,g,D,u)=>{const h=t.find(j=>j.id===d);h&&c({taskId:d,initialX:g,initialY:D,initialStart:new Date(h.start),initialEnd:new Date(h.end),type:u,dragDeltaX:0,dragDeltaY:0})},[t]),x=S.useCallback((d,g)=>{if(!p.taskId||!p.type)return null;const D=d-p.initialX,u=g-p.initialY;if(c(E=>({...E,dragDeltaX:D,dragDeltaY:u})),p.type==="reorder")return null;const h=t.find(E=>E.id===p.taskId);if(!h)return null;const j=Math.round(D/i);let F=new Date(p.initialStart),f=new Date(p.initialEnd);switch(p.type){case"move":F=q(p.initialStart,j*s,a),f=q(p.initialEnd,j*s,a);break;case"resize-left":F=q(p.initialStart,j*s,a),F>=f&&(F=q(f,-s,a));break;case"resize-right":f=q(p.initialEnd,j*s,a),f<=F&&(f=q(F,s,a));break}const b=be(F,f);return{...h,start:F,end:f,duration:b}},[p,t,i]),T=S.useCallback(d=>{if(d&&n){const{id:g,...D}=d;n(g,D)}c({taskId:null,initialX:0,initialY:0,initialStart:new Date,initialEnd:new Date,type:null,dragDeltaX:0,dragDeltaY:0})},[n]);return{dragState:p,handleDragStart:l,handleDrag:x,handleDragEnd:T}},Ae=S.forwardRef(({tasks:t,links:n,range:i,scales:a,config:s,selectedTask:p,onTaskClick:c,onTaskDragStart:l,onTaskDragEnd:x,onTaskUpdate:T,zoomLevel:d,baselines:g},D)=>{const[u,h]=S.useState(t),j=(s.columnWidth||60)*d,F=s.baselines&&g&&g.size>0,{dragState:f,handleDragStart:b,handleDrag:E,handleDragEnd:$}=vt(u,T,j,a[1].unit,a[1].step);S.useEffect(()=>{h(t)},[t]);const L=v=>{const C=[];let r=new Date(i.start);for(;r<=i.end;)C.push({date:new Date(r),label:Q(r,v.format||"D")}),r=q(r,v.step,v.unit);return C},B=v=>{const C=a[1],r=i.start.getTime(),k=v.getTime()-r,V={hour:36e5,day:864e5,week:6048e5,month:2592e6,quarter:7776e6,year:31536e6}[C.unit]||864e5;return k/(V*C.step)*j},X=v=>{const C=B(v.start),r=B(v.end);return{left:C,width:Math.max(r-C,0)}},ee=v=>{const C=B(v.start),r=B(v.end);return{left:C,width:Math.max(r-C,0)}},m=v=>{const C=X(v),r=u.findIndex(V=>V.id===v.id),y=s.rowHeight||48,k=32,P=(y-k)/2;return{left:C.left,width:C.width,top:r*y+P,height:k}},O=S.useCallback(v=>{if(f.taskId&&f.type){const C=E(v.clientX,v.clientY);C&&h(r=>r.map(y=>y.id===C.id?C:y))}},[f,E]),W=S.useCallback(()=>{if(f.taskId){const v=u.find(C=>C.id===f.taskId);$(v||null),x()}},[f,u,$,x]),U=a[1],_=L(U),oe=()=>{const v=[];let C=-1,r=-1,y=0,k="";return _.forEach(P=>{const V=P.date.getMonth(),de=P.date.getFullYear(),R=Q(P.date,"MMM YYYY");V!==C||de!==r?(C!==-1&&v.push({label:k,width:y}),C=V,r=de,y=j,k=R):y+=j}),C!==-1&&v.push({label:k,width:y}),v},te=()=>{const v=[];let C=-1,r=0,y=-1,k=-1,P="";return _.forEach(V=>{const R=V.date.getDate()<=15?0:1,K=V.date.getMonth(),ue=V.date.getFullYear(),me=Q(V.date,"MMM"),Me=new Date(ue,K+1,0).getDate(),Le=R===0?`${me} 1 - 15`:`${me} 16 - ${Me}`;R!==C||K!==y||ue!==k?(C!==-1&&v.push({label:P,width:r}),C=R,y=K,k=ue,r=j,P=Le):r+=j}),C!==-1&&v.push({label:P,width:r}),v},se=oe(),Z=te(),z=_.length*j;return e.jsxs("div",{className:"gantt-timeline-container",ref:D,onMouseMove:O,onMouseUp:W,style:{width:z},children:[e.jsxs("div",{className:"gantt-timeline-header",style:{width:z,minWidth:z},children:[e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-month",style:{width:z},children:se.map((v,C)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:v.width,minWidth:v.width,maxWidth:v.width,borderRight:C===se.length-1?"none":"var(--wx-gantt-border)"},children:v.label},`top-${C}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-range",style:{width:z},children:Z.map((v,C)=>e.jsx("div",{className:"gantt-timeline-cell",style:{width:v.width,minWidth:v.width,maxWidth:v.width,borderRight:C===Z.length-1?"none":"var(--wx-gantt-border)"},children:v.label},`mid-${C}`))}),e.jsx("div",{className:"gantt-timeline-scale gantt-timeline-scale-day",style:{width:z},children:_.map((v,C)=>{const r=s.weekends&&Ee(v.date),y=s.holidays&&$e(v.date,s.holidays);return e.jsx("div",{className:`gantt-timeline-cell ${r?"weekend":""} ${y?"holiday":""}`,style:{width:j,minWidth:j,maxWidth:j,borderRight:C===_.length-1?"none":"var(--wx-gantt-border)"},children:v.label},`day-${C}`)})})]}),e.jsxs("div",{className:"gantt-timeline-body",style:{width:z},children:[e.jsx("div",{className:"gantt-timeline-grid",children:_.map((v,C)=>{const r=s.weekends&&Ee(v.date),y=s.holidays&&$e(v.date,s.holidays);return e.jsx("div",{className:`gantt-timeline-grid-column ${r?"weekend":""} ${y?"holiday":""}`,style:{width:j,minWidth:j}},C)})}),n.length>0&&e.jsx(Tt,{links:n,tasks:u,getTaskPosition:m}),e.jsx("div",{className:"gantt-timeline-tasks",style:{width:z},children:u.map(v=>{const C=X(v),r=F?g?.get(v.id):void 0,y=r?ee(r):void 0;return e.jsxs("div",{className:"gantt-timeline-row",children:[r&&y&&v.type!=="milestone"&&e.jsx("div",{className:"gantt-baseline-bar",style:{left:`${y.left}px`,width:`${y.width}px`},title:`Baseline: ${r.start.toLocaleDateString()} - ${r.end.toLocaleDateString()}`}),e.jsx(Ge,{task:v,position:C,selected:p===v.id,dragging:f.taskId===v.id,dragDeltaX:f.dragDeltaX,dragType:f.type,onClick:()=>c(v.id),onDragStart:(k,P,V)=>{b(v.id,k,P,V),l(v.id,k,P)},readonly:s.readonly})]},v.id)})})]})]})});Ae.displayName="Timeline";const Ie=S.forwardRef((t,n)=>e.jsx("div",{className:"gantt-chart-wrapper",style:{flex:1,minWidth:0},children:e.jsx(Ae,{...t,ref:n})}));Ie.displayName="Chart";const{Search:Dt}=o.Input,Ve=({onFilterChange:t,owners:n=[]})=>{const[i,a]=S.useState({searchText:"",status:"all",priority:"all",owner:""}),s=l=>{const x={...i,...l};a(x),t(x)},p=()=>{const l={searchText:"",status:"all",priority:"all",owner:""};a(l),t(l)},c=i.searchText!==""||i.status!=="all"||i.priority!=="all"||i.owner!=="";return e.jsx("div",{className:"gantt-filter-container",children:e.jsxs("div",{className:"gantt-filter-bar",children:[e.jsx("div",{className:"gantt-filter-left",children:e.jsx(Dt,{placeholder:"Search tasks...",value:i.searchText,onChange:l=>s({searchText:l.target.value}),allowClear:!0,className:"gantt-search-antd",style:{width:250}})}),e.jsxs("div",{className:"gantt-filter-right",children:[e.jsx(o.Select,{value:i.status,onChange:l=>s({status:l}),className:"gantt-filter-select-antd",style:{width:140},options:[{value:"all",label:"All Status"},{value:"not-started",label:"Not Started"},{value:"in-progress",label:"In Progress"},{value:"completed",label:"Completed"}]}),e.jsx(o.Select,{value:i.priority,onChange:l=>s({priority:l}),className:"gantt-filter-select-antd",style:{width:130},options:[{value:"all",label:"All Priority"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}]}),e.jsx(o.Select,{value:i.owner||void 0,onChange:l=>s({owner:l||""}),className:"gantt-filter-select-antd",style:{width:130},placeholder:"All Owners",allowClear:!0,options:[{value:"",label:"All Owners"},...(n||[]).map(l=>({value:l,label:l}))]}),c&&e.jsx(o.Button,{type:"default",danger:!0,icon:e.jsx(I.FontAwesomeIcon,{icon:A.faTimesCircle}),onClick:p,className:"gantt-filter-clear-antd",children:"Clear"})]})]})})},Je=(t,n)=>t.filter(i=>{if(n.searchText){const a=n.searchText.toLowerCase(),s=i.text.toLowerCase().includes(a),p=i.owner?.toLowerCase().includes(a),c=i.details?.toLowerCase().includes(a);if(!s&&!p&&!c)return!1}if(n.status!=="all"&&(i.progress===0?"not-started":i.progress===100?"completed":"in-progress")!==n.status||n.priority!=="all"&&i.priority!==n.priority||n.owner&&i.owner!==n.owner)return!1;if(n.dateRange){const a=i.start.getTime(),s=n.dateRange.start.getTime(),p=n.dateRange.end.getTime();if(a<s||a>p)return!1}return!0}),Xe=({zoomLevel:t,setZoomLevel:n,onBaselineToggle:i,showBaselines:a,onExport:s,onFilterChange:p,owners:c,onAddTask:l})=>e.jsxs("div",{className:"gantt-toolbar-wrapper",children:[e.jsxs("div",{className:"gantt-toolbar",children:[e.jsx("div",{className:"gantt-toolbar-left",children:e.jsxs(o.Space,{size:8,children:[e.jsx(o.Button,{type:"primary",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faPlus}),onClick:l,children:"New Task"}),e.jsx(o.Tooltip,{title:a?"Hide Baselines":"Show Baselines",children:e.jsx(o.Button,{type:a?"primary":"default",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faCalendarCheck}),onClick:i,children:a?"Baselines":"Set Baseline"})})]})}),e.jsx("div",{className:"gantt-toolbar-right",children:e.jsxs(o.Space,{size:4,children:[e.jsx(o.Tooltip,{title:"Zoom Out",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faSearchMinus}),onClick:()=>n(Math.max(.5,t-.25))})}),e.jsx(o.Tooltip,{title:"Zoom In",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faSearchPlus}),onClick:()=>n(Math.min(2,t+.25))})}),e.jsx(o.Tooltip,{title:"Reset Zoom",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faRotateLeft}),onClick:()=>n(1)})}),e.jsx(o.Divider,{type:"vertical",style:{height:24,margin:"0 4px"}}),e.jsx(o.Tooltip,{title:"Export to CSV",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFileCsv}),onClick:()=>s("csv")})}),e.jsx(o.Tooltip,{title:"Export to Excel",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFileExcel}),onClick:()=>s("excel")})}),e.jsx(o.Tooltip,{title:"Export to JSON",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFileCode}),onClick:()=>s("json")})}),e.jsx(o.Tooltip,{title:"Export to PDF",children:e.jsx(o.Button,{icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFilePdf}),onClick:()=>s("pdf")})})]})})]}),e.jsx(Ve,{onFilterChange:p,owners:c})]}),{Option:xe}=o.Select,{TextArea:Mt}=o.Input,qe=({onCreateTask:t,onClose:n})=>{const[i]=o.Form.useForm(),a=s=>{const p=s.start.toDate(),c=new Date(p);c.setDate(c.getDate()+(s.duration||1)),t({text:s.text,start:p,end:c,duration:s.duration||1,progress:s.progress||0,type:s.type,color:typeof s.color=="string"?s.color:s.color?.toHexString?.()||"#4A90E2",owner:s.owner||"",priority:s.priority||"medium",details:s.details||""}),n()};return e.jsx(o.Modal,{title:"Create New Task",open:!0,onCancel:n,onOk:()=>i.submit(),okText:"Create Task",cancelText:"Cancel",width:600,className:"gantt-modal-antd",children:e.jsxs(o.Form,{form:i,layout:"vertical",onFinish:a,initialValues:{type:"task",priority:"medium",start:_e(),duration:1,progress:0,color:"#4A90E2"},children:[e.jsx(o.Form.Item,{name:"text",label:"Task Name",rules:[{required:!0,message:"Please enter task name"}],children:e.jsx(o.Input,{placeholder:"Enter task name",autoFocus:!0})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"type",label:"Type",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(xe,{value:"task",children:"Task"}),e.jsx(xe,{value:"milestone",children:"Milestone"}),e.jsx(xe,{value:"project",children:"Project"})]})}),e.jsx(o.Form.Item,{name:"priority",label:"Priority",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(xe,{value:"low",children:"Low"}),e.jsx(xe,{value:"medium",children:"Medium"}),e.jsx(xe,{value:"high",children:"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"start",label:"Start Date",style:{flex:1},children:e.jsx(o.DatePicker,{style:{width:"100%"}})}),e.jsx(o.Form.Item,{name:"duration",label:"Duration (days)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,style:{width:"100%"}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"color",label:"Color",style:{flex:1},children:e.jsx(o.ColorPicker,{showText:!0})}),e.jsx(o.Form.Item,{name:"progress",label:"Progress (%)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,max:100,style:{width:"100%"}})})]}),e.jsx(o.Form.Item,{name:"owner",label:"Owner",children:e.jsx(o.Input,{placeholder:"Assign to..."})}),e.jsx(o.Form.Item,{name:"details",label:"Details",children:e.jsx(Mt,{placeholder:"Add task description...",rows:3})})]})})},{Option:ge}=o.Select,{TextArea:Ct}=o.Input,{confirm:kt}=o.Modal,Ze=({task:t,onUpdate:n,onDelete:i,onClose:a})=>{const[s]=o.Form.useForm(),p=l=>{const x=l.start.toDate(),T=new Date(x);T.setDate(T.getDate()+(l.duration||1)),n({...t,text:l.text,start:x,end:T,duration:l.duration||1,progress:l.progress||0,type:l.type,color:typeof l.color=="string"?l.color:l.color?.toHexString?.()||"#4A90E2",owner:l.owner||"",priority:l.priority||"medium",details:l.details||""}),a()},c=()=>{kt({title:`Are you sure you want to delete "${t.text}"?`,icon:e.jsx(I.FontAwesomeIcon,{icon:A.faExclamationTriangle,style:{color:"#faad14",marginRight:8}}),content:"This action cannot be undone.",okText:"Yes, Delete",okType:"danger",cancelText:"No",onOk(){i(t.id),a()}})};return e.jsx(o.Modal,{title:"Edit Task",open:!0,onCancel:a,footer:[e.jsx(o.Button,{danger:!0,onClick:c,style:{float:"left"},children:"Delete"},"delete"),e.jsx(o.Button,{onClick:a,children:"Cancel"},"cancel"),e.jsx(o.Button,{type:"primary",onClick:()=>s.submit(),children:"Save Changes"},"submit")],width:600,className:"gantt-modal-antd",children:e.jsxs(o.Form,{form:s,layout:"vertical",onFinish:p,initialValues:{text:t.text,type:t.type||"task",priority:t.priority||"medium",start:_e(t.start),duration:t.duration,progress:t.progress,color:t.color||"#4A90E2",owner:t.owner||"",details:t.details||""},children:[e.jsx(o.Form.Item,{name:"text",label:"Task Name",rules:[{required:!0,message:"Please enter task name"}],children:e.jsx(o.Input,{placeholder:"Enter task name"})}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"type",label:"Type",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(ge,{value:"task",children:"Task"}),e.jsx(ge,{value:"milestone",children:"Milestone"}),e.jsx(ge,{value:"project",children:"Project"})]})}),e.jsx(o.Form.Item,{name:"priority",label:"Priority",style:{flex:1},children:e.jsxs(o.Select,{children:[e.jsx(ge,{value:"low",children:"Low"}),e.jsx(ge,{value:"medium",children:"Medium"}),e.jsx(ge,{value:"high",children:"High"})]})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"start",label:"Start Date",style:{flex:1},children:e.jsx(o.DatePicker,{style:{width:"100%"}})}),e.jsx(o.Form.Item,{name:"duration",label:"Duration (days)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,style:{width:"100%"}})})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsx(o.Form.Item,{name:"color",label:"Color",style:{flex:1},children:e.jsx(o.ColorPicker,{showText:!0})}),e.jsx(o.Form.Item,{name:"progress",label:"Progress (%)",style:{flex:1},children:e.jsx(o.InputNumber,{min:0,max:100,style:{width:"100%"}})})]}),e.jsx(o.Form.Item,{name:"owner",label:"Owner",children:e.jsx(o.Input,{placeholder:"Assign to..."})}),e.jsx(o.Form.Item,{name:"details",label:"Details",children:e.jsx(Ct,{placeholder:"Add task description...",rows:3})})]})})},{Title:ve,Text:le,Paragraph:Ke}=o.Typography,{Option:fe}=o.Select,Qe=({task:t,allTasks:n,links:i,onAddDependency:a,onRemoveDependency:s,onClose:p})=>{const[c,l]=S.useState(""),[x,T]=S.useState("e2s"),[d,g]=S.useState(0),[D,u]=S.useState("day"),[h,j]=S.useState(""),F=i.filter(m=>m.target===t.id),f=i.filter(m=>m.source===t.id),b=n.filter(m=>m.id!==t.id&&m.id!==t.parent),E=()=>{if(c){const m=Ne(d,D);a(c,t.id,x,m),l(""),g(0),u("day")}},$=()=>{if(!h.trim())return;const m=gt(h.trim());if(!m){alert(`Invalid format. Use: [TaskNumber][Type][+/-][Lag][Unit]
7
+ Example: 3FS+10d`);return}const O=m.taskNumber-1,W=n[O];if(!W){alert(`Task ${m.taskNumber} not found`);return}const U=wt(m.type),_=Ne(m.lag,m.lagUnit);a(W.id,t.id,U,_),j("")},L=m=>{switch(m){case"e2s":return"Finish-to-Start (FS)";case"s2s":return"Start-to-Start (SS)";case"e2e":return"Finish-to-Finish (FF)";case"s2e":return"Start-to-Finish (SF)"}},B=m=>{switch(m){case"e2s":return"blue";case"s2s":return"green";case"e2e":return"purple";case"s2e":return"orange"}},X=m=>!m||m===0?null:m>0?e.jsxs(o.Tag,{color:"warning",children:["+",m,"d lag"]}):e.jsxs(o.Tag,{color:"processing",children:[m,"d lead"]}),ee=(m,O)=>{const W=n.find(U=>U.id===(O==="source"?m.source:m.target));return e.jsx(o.List.Item,{actions:[e.jsx(o.Button,{type:"text",danger:!0,icon:e.jsx(I.FontAwesomeIcon,{icon:A.faTrash}),onClick:()=>s(m.id),children:"Remove"})],children:e.jsx(o.List.Item.Meta,{title:e.jsxs(o.Space,{children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:W?.text||(O==="source"?m.source:m.target)}),e.jsx(o.Tag,{color:B(m.type),children:L(m.type)}),X(m.lag)]}),description:e.jsxs(le,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px"},children:[W?.owner&&`Owner: ${W.owner}`,W?.priority&&` • Priority: ${W.priority}`]})})})};return e.jsxs(o.Modal,{title:e.jsxs(o.Space,{children:[e.jsx(I.FontAwesomeIcon,{icon:A.faLink,style:{fontSize:"20px"}}),e.jsx(ve,{level:4,style:{margin:0,fontFamily:"IBM Plex Mono, monospace"},children:"Task Dependencies"})]}),open:!0,onCancel:p,width:900,footer:null,className:"gantt-dependency-modal",styles:{body:{maxHeight:"70vh",overflowY:"auto",fontFamily:"IBM Plex Sans, sans-serif"}},children:[e.jsx(o.Card,{size:"small",style:{marginBottom:24,backgroundColor:"#f5f5f5",borderColor:"#d9d9d9"},children:e.jsxs(o.Space,{direction:"vertical",size:4,children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Mono, monospace",fontSize:"16px"},children:t.text}),e.jsxs(le,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"13px"},children:[t.start.toLocaleDateString()," → ",t.end.toLocaleDateString(),t.owner&&` • Owner: ${t.owner}`,t.priority&&` • Priority: ${t.priority}`]})]})}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsxs(ve,{level:5,style:{fontFamily:"IBM Plex Mono, monospace",textTransform:"uppercase",letterSpacing:"0.5px",fontSize:"13px",color:"#595959"},children:[e.jsx(I.FontAwesomeIcon,{icon:A.faArrowDown,style:{marginRight:"8px"}}),"Depends On (Predecessors)"]}),F.length===0?e.jsx(o.Alert,{message:"No dependencies",description:"This task doesn't depend on any other tasks.",type:"info",showIcon:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}}):e.jsx(o.List,{dataSource:F,renderItem:m=>ee(m,"source"),bordered:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}})]}),e.jsxs("div",{style:{marginBottom:32},children:[e.jsxs(ve,{level:5,style:{fontFamily:"IBM Plex Mono, monospace",textTransform:"uppercase",letterSpacing:"0.5px",fontSize:"13px",color:"#595959"},children:[e.jsx(I.FontAwesomeIcon,{icon:A.faArrowUp,style:{marginRight:"8px"}}),"Dependents (Successors)"]}),f.length===0?e.jsx(o.Alert,{message:"No dependent tasks",description:"No other tasks depend on this task.",type:"info",showIcon:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}}):e.jsx(o.List,{dataSource:f,renderItem:m=>ee(m,"target"),bordered:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"}})]}),e.jsx(o.Divider,{}),e.jsx(o.Card,{title:e.jsxs(ve,{level:5,style:{margin:0,fontFamily:"IBM Plex Mono, monospace",fontSize:"14px"},children:[e.jsx(I.FontAwesomeIcon,{icon:A.faPlus,style:{marginRight:"8px"}}),"Add New Dependency"]}),style:{marginBottom:24},children:e.jsxs(o.Space,{direction:"vertical",size:"large",style:{width:"100%"},children:[e.jsxs("div",{children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Quick Add (Keyboard Shortcut):"}),e.jsx(le,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px",display:"block",marginBottom:8},children:"Format: [TaskNumber][Type][+/-][Lag][Unit] • Example: 3FS+10d, 5SS-2w"}),e.jsxs(o.Space.Compact,{style:{width:"100%"},children:[e.jsx(o.Input,{placeholder:"e.g., 3FS+10d",value:h,onChange:m=>j(m.target.value),onPressEnter:$,size:"large",style:{fontFamily:"IBM Plex Mono, monospace"}}),e.jsx(o.Button,{type:"primary",size:"large",onClick:$,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:"Add"})]})]}),e.jsx(o.Divider,{style:{margin:"8px 0"},children:"OR"}),e.jsxs("div",{children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Select Task:"}),e.jsx(o.Select,{placeholder:"Choose a task...",value:c||void 0,onChange:l,style:{width:"100%",fontFamily:"IBM Plex Sans, sans-serif"},size:"large",showSearch:!0,filterOption:(m,O)=>String(O?.children||"").toLowerCase().includes(m.toLowerCase()),children:b.map(m=>e.jsx(fe,{value:m.id,children:m.text},m.id))})]}),e.jsxs("div",{children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",display:"block",marginBottom:8},children:"Dependency Type:"}),e.jsxs(o.Select,{value:x,onChange:T,style:{width:"100%",fontFamily:"IBM Plex Sans, sans-serif"},size:"large",children:[e.jsxs(fe,{value:"e2s",children:[e.jsx(o.Tag,{color:"blue",children:"FS"})," Finish-to-Start"]}),e.jsxs(fe,{value:"s2s",children:[e.jsx(o.Tag,{color:"green",children:"SS"})," Start-to-Start"]}),e.jsxs(fe,{value:"e2e",children:[e.jsx(o.Tag,{color:"purple",children:"FF"})," Finish-to-Finish"]}),e.jsxs(fe,{value:"s2e",children:[e.jsx(o.Tag,{color:"orange",children:"SF"})," Start-to-Finish"]})]})]}),e.jsx("div",{children:e.jsxs(o.Space,{direction:"vertical",size:4,style:{width:"100%"},children:[e.jsx(le,{strong:!0,style:{fontFamily:"IBM Plex Sans, sans-serif"},children:"Lead/Lag Time:"}),e.jsx(le,{type:"secondary",style:{fontFamily:"IBM Plex Sans, sans-serif",fontSize:"12px"},children:"Negative = lead time (overlap), Positive = lag time (delay)"}),e.jsxs(o.Space.Compact,{style:{width:"100%"},children:[e.jsx(o.InputNumber,{value:d,onChange:m=>g(m||0),style:{flex:1,fontFamily:"IBM Plex Sans, sans-serif"},size:"large",placeholder:"0",min:-365,max:365}),e.jsxs(o.Select,{value:D,onChange:u,style:{width:120,fontFamily:"IBM Plex Sans, sans-serif"},size:"large",children:[e.jsx(fe,{value:"day",children:"Days"}),e.jsx(fe,{value:"hour",children:"Hours"}),e.jsx(fe,{value:"week",children:"Weeks"}),e.jsx(fe,{value:"month",children:"Months"})]})]})]})}),e.jsx(o.Button,{type:"primary",size:"large",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faPlus}),onClick:E,disabled:!c,block:!0,style:{fontFamily:"IBM Plex Sans, sans-serif",fontWeight:600},children:"Add Dependency"})]})}),e.jsx(o.Alert,{message:e.jsxs(le,{strong:!0,style:{fontFamily:"IBM Plex Mono, monospace"},children:[e.jsx(I.FontAwesomeIcon,{icon:A.faInfoCircle,style:{marginRight:"8px"}}),"Dependency Types Explained"]}),description:e.jsxs("div",{style:{fontFamily:"IBM Plex Sans, sans-serif"},children:[e.jsxs("ul",{style:{marginBottom:12,paddingLeft:20},children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Finish-to-Start (FS):"})," Successor starts after predecessor finishes"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Start-to-Start (SS):"})," Both tasks start at the same time"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Finish-to-Finish (FF):"})," Both tasks finish at the same time"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Start-to-Finish (SF):"})," Successor finishes when predecessor starts"]})]}),e.jsx(o.Divider,{style:{margin:"12px 0"}}),e.jsx(le,{strong:!0,style:{display:"block",marginBottom:4},children:"Keyboard Shortcuts:"}),e.jsx(Ke,{style:{margin:0,fontSize:"12px"},code:!0,children:"[TaskID][Type]+/-[Days]d"}),e.jsxs(Ke,{style:{margin:0,fontSize:"12px"},children:["Example: ",e.jsx("code",{children:"3FS+10d"})," = Task 3, Finish-to-Start, 10 days lag"]})]}),type:"info",showIcon:!0,icon:e.jsx(I.FontAwesomeIcon,{icon:A.faInfoCircle}),style:{marginTop:16}})]})},Ft=({x:t,y:n,task:i,onEdit:a,onDelete:s,onCopy:p,onDependencies:c,onConvertToMilestone:l,onConvertToTask:x,onConvertToProject:T,onAutoSchedule:d,onClose:g})=>{if(!i)return null;const D=[{key:"edit",label:"Edit",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faEdit}),onClick:()=>{a(),g()}},{key:"copy",label:"Copy",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faCopy}),onClick:()=>{p(),g()}},{key:"dependencies",label:"Dependencies",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faLink}),onClick:()=>{c(),g()}},{type:"divider"},{key:"convert",label:"Convert to",type:"submenu",children:[{key:"milestone",label:"Milestone",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFlag}),disabled:i.type==="milestone",onClick:()=>{l(),g()}},{key:"task",label:"Task",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faTasks}),disabled:i.type==="task",onClick:()=>{x(),g()}},{key:"project",label:"Project",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faFolder}),disabled:i.type==="project",onClick:()=>{T(),g()}}]},{key:"auto-schedule",label:"Auto Schedule",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faRotateLeft}),onClick:()=>{d?.(),g()}},{type:"divider"},{key:"delete",label:"Delete",icon:e.jsx(I.FontAwesomeIcon,{icon:A.faTrash}),danger:!0,onClick:()=>{s(),g()}}];return e.jsx("div",{className:"gantt-context-menu",style:{position:"fixed",left:`${t}px`,top:`${n}px`,zIndex:1e4},onClick:u=>u.stopPropagation(),children:e.jsx(o.Menu,{items:D,style:{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",borderRadius:"6px",border:"1px solid #e0e0e0"}})})},et=(t,n=[])=>{const[i,a]=S.useState([]),[s,p]=S.useState(-1),[c,l]=S.useState(t),[x,T]=S.useState(n);S.useEffect(()=>{l(t)},[t]),S.useEffect(()=>{T(n)},[n]);const d=S.useCallback((b,E,$)=>{const L={type:b,before:E,after:$,timestamp:Date.now()},B=i.slice(0,s+1);B.push(L),B.length>50?B.shift():p(s+1),a(B)},[i,s]),g=S.useCallback(()=>{if(s<0)return;const b=i[s];l(b.before.tasks),T(b.before.links),p(s-1)},[i,s]),D=S.useCallback(()=>{if(s>=i.length-1)return;const b=i[s+1];l(b.after.tasks),T(b.after.links),p(s+1)},[i,s]),u=s>=0,h=s<i.length-1,j=S.useCallback(b=>{const E={tasks:c,links:x},$=c.map(B=>B.id===b.id?b:B);d("task_update",E,{tasks:$,links:x}),l($)},[c,x,d]),F=S.useCallback(b=>{const E={tasks:c,links:x},$=[...c,b];d("task_create",E,{tasks:$,links:x}),l($)},[c,x,d]),f=S.useCallback(b=>{const E={tasks:c,links:x},$=c.filter(X=>X.id!==b),L=x.filter(X=>X.source!==b&&X.target!==b);d("task_delete",E,{tasks:$,links:L}),l($),T(L)},[c,x,d]);return{tasks:c,links:x,setTasks:l,setLinks:T,undo:g,redo:D,canUndo:u,canRedo:h,updateTask:j,createTask:F,deleteTask:f,saveState:d,history:i}},tt=(t,n,i={mode:"forward"})=>{const a=new Map,s=new Map;return t.forEach(p=>{a.set(p.id,[]),s.set(p.id,[])}),n.forEach(p=>{p.type==="e2s"&&(a.get(p.target)?.push(p.source),s.get(p.source)?.push(p.target))}),i.mode==="forward"?Et(t,a,i):$t(t,s,i)},Et=(t,n,i)=>{const a=new Map,s=new Set,p=i.projectStart||new Date,c=l=>{if(s.has(l))return;const x=t.find(h=>h.id===l);if(!x)return;const T=n.get(l)||[];T.forEach(h=>c(h));let d=p;T.forEach(h=>{const j=a.get(h);j&&j.end>d&&(d=new Date(j.end))});const g=new Date(d),D=q(g,x.duration,"day"),u={...x,start:g,end:D};a.set(l,u),s.add(l)};return t.forEach(l=>c(l.id)),t.map(l=>a.get(l.id)||l)},$t=(t,n,i)=>{const a=new Map,s=new Set,p=i.projectEnd||new Date(Math.max(...t.map(l=>l.end.getTime()))),c=l=>{if(s.has(l))return;const x=t.find(h=>h.id===l);if(!x)return;const T=n.get(l)||[];T.forEach(h=>c(h));let d=p;T.forEach(h=>{const j=a.get(h);j&&j.start<d&&(d=new Date(j.start))});const g=new Date(d),D=q(g,-x.duration,"day"),u={...x,start:D,end:g};a.set(l,u),s.add(l)};return t.forEach(l=>c(l.id)),t.map(l=>a.get(l.id)||l)},Nt=Object.freeze(Object.defineProperty({__proto__:null,autoSchedule:tt,levelResources:t=>{const n=new Map;t.forEach(a=>{a.owner&&(n.has(a.owner)||n.set(a.owner,[]),n.get(a.owner).push(a))});const i=[...t];return n.forEach((a,s)=>{const p=a.sort((c,l)=>c.start.getTime()-l.start.getTime());for(let c=1;c<p.length;c++){const l=p[c],x=p[c-1];if(l.start<x.end){const T=i.findIndex(d=>d.id===l.id);if(T>=0){const d=new Date(x.end),g=q(d,l.duration,"day");i[T]={...l,start:d,end:g}}}}}),i}},Symbol.toStringTag,{value:"Module"})),nt=t=>{const n=new Map;return t.forEach(i=>{n.set(i.id,{taskId:i.id,start:new Date(i.start),end:new Date(i.end)})}),n},st=t=>{const n=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority"],i=t.map(s=>[s.id,s.text,Q(s.start,"YYYY-MM-DD"),Q(s.end,"YYYY-MM-DD"),s.duration.toString(),`${s.progress}%`,s.type||"task",s.owner||"",s.priority||"medium"]),a=[n.join(","),...i.map(s=>s.map(p=>`"${p}"`).join(","))].join(`
8
+ `);De(a,"gantt-tasks.csv","text/csv")},rt=t=>{const n=["ID","Task Name","Start Date","End Date","Duration","Progress","Type","Owner","Priority","Details"],i=t.map(s=>[s.id,s.text,Q(s.start,"MM/DD/YYYY"),Q(s.end,"MM/DD/YYYY"),s.duration.toString(),s.progress.toString(),s.type||"task",s.owner||"",s.priority||"medium",s.details||""]),a="\uFEFF"+[n.join(" "),...i.map(s=>s.map(p=>p.replace(/\t/g," ")).join(" "))].join(`
9
+ `);De(a,"gantt-tasks.xls","application/vnd.ms-excel")},it=(t,n)=>{const i={tasks:t,links:n,exported:new Date().toISOString(),version:"1.0"},a=JSON.stringify(i,null,2);De(a,"gantt-project.json","application/json")},ot=t=>{const n=`
10
10
  GANTT CHART PROJECT
11
11
  Generated: ${new Date().toLocaleString()}
12
12
 
13
13
  Tasks:
14
14
  ${t.map((i,a)=>`
15
15
  ${a+1}. ${i.text}
16
- Start: ${ae(i.start,"MM/DD/YYYY")}
17
- End: ${ae(i.end,"MM/DD/YYYY")}
16
+ Start: ${Q(i.start,"MM/DD/YYYY")}
17
+ End: ${Q(i.end,"MM/DD/YYYY")}
18
18
  Duration: ${i.duration} days
19
19
  Progress: ${i.progress}%
20
20
  ${i.owner?`Owner: ${i.owner}`:""}
21
21
  `).join(`
22
22
  `)}
23
- `.trim();Ce(r,"gantt-report.txt","text/plain"),alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.")},_t=(t,r,i="png")=>{if(!document.getElementById(t)){alert("Could not find Gantt chart element to export");return}if(i==="svg"){alert("SVG export requires additional library. Use PNG or implement with dom-to-svg.");return}alert("Image export requires html2canvas library. Install with: npm install html2canvas")},Ce=(t,r,i)=>{const a=new Blob([t],{type:i}),s=URL.createObjectURL(a);Yt(s,r),URL.revokeObjectURL(s)},Yt=(t,r)=>{const i=document.createElement("a");i.href=t,i.download=r,document.body.appendChild(i),i.click(),document.body.removeChild(i)},Bt=Object.freeze(Object.defineProperty({__proto__:null,exportToCSV:it,exportToExcel:at,exportToImage:_t,exportToJSON:ot,exportToPDF:lt,importFromJSON:t=>new Promise((r,i)=>{const a=new FileReader;a.onload=s=>{try{const m=s.target?.result,c=JSON.parse(m),l=c.tasks.map(d=>({...d,start:new Date(d.start),end:new Date(d.end)}));r({tasks:l,links:c.links||[]})}catch{i(new Error("Invalid JSON file"))}},a.onerror=()=>i(new Error("Failed to read file")),a.readAsText(t)})},Symbol.toStringTag,{value:"Module"})),Rt=[{name:"index",label:"",width:40,align:"center"},{name:"text",label:"Name",width:300,align:"left",resize:!0},{name:"predecessors",label:"Depends on",width:120,align:"left"},{name:"duration",label:"Duration",width:100,align:"left"},{name:"start",label:"Start",width:120,align:"left"},{name:"add",label:"",width:40,align:"center"}],zt=[{unit:"month",step:1,format:"MMM"},{unit:"day",step:1,format:"D"}],Ht=({tasks:t,links:r=[],config:i={},onTaskUpdate:a,onTaskCreate:s,onTaskDelete:m,onLinkCreate:c,onLinkDelete:l})=>{const{tasks:d,links:S,setTasks:v,setLinks:b,undo:C,redo:u,updateTask:h,createTask:$,deleteTask:O,saveState:x}=nt(t,r),[T,_]=F.useState(d),[B,Y]=F.useState(null),[H,Z]=F.useState(null),[se,y]=F.useState(!1),[L,I]=F.useState(!1),[q,G]=F.useState(null),[N,D]=F.useState(null),[g,k]=F.useState(null),[j,f]=F.useState(null),[p,n]=F.useState(null),[w,E]=F.useState(1),[A,J]=F.useState(new Map),[ee,R]=F.useState(!1),[ne]=F.useState(i.theme||"light"),[re,K]=F.useState({searchText:"",status:"all",priority:"all",owner:""}),he=F.useRef(null),fe=F.useRef(null),je=F.useRef(null),me={columns:Rt,scales:zt,readonly:!1,editable:!0,taskHeight:28,rowHeight:44,scaleHeight:28,columnWidth:80,minColumnWidth:60,autoSchedule:!1,criticalPath:!1,baselines:ee,weekends:!0,holidays:[],theme:ne,locale:"en",...i};F.useEffect(()=>{const M=Ge(d,re);_((V=>{const te=[],le=X=>{if(!X)return!1;const de=V.find(Q=>Q.id===X);return de&&!de.open&&de.type==="project"?!0:le(de?.parent)};return V.forEach(X=>{le(X.parent)||te.push(X)}),te})(M))},[d,re]);const Ut=Array.from(new Set(d.map(M=>M.owner).filter(Boolean))),Jt=(()=>{const M=T.length>0?T:d;if(M.length===0){const X=new Date;return{start:Te(ie(X,-30,"day")),end:Te(ie(X,60,"day"))}}const P=M.map(X=>X.start.getTime()),V=M.map(X=>X.end.getTime()),te=new Date(Math.min(...P)),le=new Date(Math.max(...V));return{start:Te(ie(te,-7,"day")),end:Te(le)}})(),Vt=M=>{Y(M)},Gt=(M,P)=>{if(me.readonly)return;M.preventDefault();const V=d.find(te=>te.id===P);V&&n({x:M.clientX,y:M.clientY,task:V})},qt=()=>{if(!p?.task)return;const M=p.task,P={...M,id:`task-${Date.now()}`,text:`${M.text} (Copy)`,start:ie(M.start,7,"day"),end:ie(M.end,7,"day")};$(P),s&&s(P)},_e=M=>{if(!p?.task)return;const P={...p.task,type:M};h(P),a&&a(P)},Xt=(M,P,V,te)=>{if(!me.readonly)if(te==="reorder"){const le=T.findIndex(Q=>Q.id===M),X=(Q,ce)=>{let be=[];return ce.filter(pe=>pe.parent===Q).forEach(pe=>{be.push(pe.id),be=[...be,...X(pe.id,ce)]}),be},de=X(M,d);k({id:M,initialIndex:le,currentY:V,descendantIds:de}),document.body.classList.add("gantt-dragging")}else D(M)},Zt=()=>{if(g&&j){const M=d.find(V=>V.id===g.id),P=d.find(V=>V.id===j.taskId);if(M&&P&&M.id!==P.id){const V=[M.id,...g.descendantIds];if(!V.includes(P.id)){const te=[...d];let le=j.position==="inside"?P.id:P.parent;const X=te.findIndex(oe=>oe.id===M.id);X!==-1&&(te[X]={...te[X],parent:le});const de=te.filter(oe=>V.includes(oe.id)),Q=te.filter(oe=>!V.includes(oe.id));let ce=Q.findIndex(oe=>oe.id===P.id);if(j.position==="inside"){const oe=Q.filter(pe=>pe.parent===P.id);oe.length>0?ce=Q.findIndex(pe=>pe.id===oe[oe.length-1].id)+1:ce++}else if(j.position==="below"){const oe=(Be,ht)=>{let Fe=[];return ht.filter(Ee=>Ee.parent===Be).forEach(Ee=>{Fe.push(Ee.id),Fe=[...Fe,...oe(Ee.id,ht)]}),Fe},pe=oe(P.id,Q);pe.length>0?ce=Q.findIndex(Be=>Be.id===pe[pe.length-1])+1:ce++}const be={tasks:[...d],links:[...S]};Q.splice(ce,0,...de),v(Q),x("task_update",be,{tasks:Q,links:S})}}}D(null),k(null),f(null),document.body.classList.remove("gantt-dragging")},Kt=M=>{if(g){const P=me.rowHeight||44,V=fe.current?.querySelector(".gantt-grid-body");if(!V)return;const te=V.getBoundingClientRect(),le=M.clientY-te.top;let X=Math.floor(le/P);X=Math.max(0,Math.min(X,T.length-1));const de=T[X];if(de){const Q=le-X*P;let ce="above";de.type==="project"?Q<P*.3?ce="above":Q>P*.7?ce="below":ce="inside":ce=Q<P/2?"above":"below",de.id!==g.id?f({taskId:de.id,position:ce}):f(null)}k(Q=>Q?{...Q,currentY:M.clientY}:null)}},ct=()=>{g&&Zt()},Qt=M=>{const P={...M,id:`task-${Date.now()}`};$(P),s&&s(P)},Ye=M=>{h(M),a&&a(M)},dt=M=>{O(M),m&&m(M)},ut=(M,P,V,te)=>{const le={id:`link-${Date.now()}`,source:M,target:P,type:V,lag:te};b([...S,le]),c&&c(le)},en=M=>{const P=S.filter(V=>V.id!==M);b(P),l&&l(M)},tn=()=>{if(!ee&&A.size===0){const M=rt(d);J(M),R(!0)}else R(!ee)};return F.useEffect(()=>{const M=P=>{(P.ctrlKey||P.metaKey)&&(P.key==="z"&&!P.shiftKey?(P.preventDefault(),C()):(P.key==="y"||P.key==="z"&&P.shiftKey)&&(P.preventDefault(),u()))};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[C,u]),e.jsxs("div",{className:`gantt-page-wrapper theme-${ne}`,children:[e.jsx("div",{className:"gantt-page-header",children:e.jsx("div",{className:"gantt-page-header-left",children:e.jsx("h1",{className:"gantt-page-title",children:"Iris Gantt"})})}),e.jsxs("div",{className:`gantt-container theme-${me.theme}`,children:[e.jsx(qe,{zoomLevel:w,setZoomLevel:E,onBaselineToggle:tn,showBaselines:ee,onExport:M=>{M==="csv"&&it(d),M==="excel"&&at(d),M==="json"&&ot(d,S),M==="pdf"&&lt(d)},onFilterChange:M=>K(M),owners:Ut,onAddTask:()=>y(!0)}),e.jsxs("div",{className:"gantt-layout",ref:je,onMouseMove:Kt,onMouseUp:ct,onMouseLeave:ct,children:[e.jsx(Ie,{ref:fe,tasks:T,columns:me.columns||[],selectedTask:B,onTaskClick:Vt,onTaskContextMenu:Gt,onTaskUpdate:Ye,onTaskDragStart:Xt,onAddTask:()=>y(!0),onAddDependency:ut,onDependencyClick:M=>{const P=d.find(V=>V.id===M);P&&(G(P),I(!0))},links:S,allTasks:d,dropIndicator:j,reorderTask:g}),e.jsx(Oe,{ref:he,tasks:T,links:S,range:Jt,scales:me.scales,config:me,selectedTask:B,draggedTask:N,onTaskClick:()=>{},onTaskDragStart:()=>{},onTaskDragEnd:()=>{},onTaskUpdate:(M,P)=>{const V=d.find(te=>te.id===M);V&&Ye({...V,...P})},zoomLevel:w,baselines:ee?A:new Map})]}),se&&e.jsx(Ke,{onCreateTask:Qt,onClose:()=>y(!1)}),H&&e.jsx(Qe,{task:H,onUpdate:Ye,onDelete:dt,onClose:()=>Z(null)}),L&&q&&e.jsx(tt,{task:q,allTasks:d,links:S,onAddDependency:ut,onRemoveDependency:en,onClose:()=>{I(!1),G(null)}}),p&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-context-menu-overlay",onClick:()=>n(null),onContextMenu:M=>{M.preventDefault(),n(null)}}),e.jsx(At,{x:p.x,y:p.y,task:p.task,onEdit:()=>{p.task&&Z(p.task)},onDelete:()=>{p.task&&dt(p.task.id)},onCopy:qt,onDependencies:()=>{p.task&&(G(p.task),I(!0))},onConvertToMilestone:()=>_e("milestone"),onConvertToTask:()=>_e("task"),onConvertToProject:()=>_e("project"),onClose:()=>n(null),onAutoSchedule:()=>{const M=st(d,S,{mode:"forward"});v(M),n(null)}})]}),g&&e.jsx("div",{className:"gantt-grid-row ghost-row",style:{height:me.rowHeight,top:g.currentY-(me.rowHeight||48)/2,left:fe.current?.getBoundingClientRect().left,position:"fixed",pointerEvents:"none",opacity:.8,zIndex:9999,width:fe.current?.offsetWidth,backgroundColor:"#ffffff",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #2196F3",display:"flex"},children:me.columns?.map(M=>e.jsx("div",{className:"gantt-grid-cell",style:{width:M.width,textAlign:M.align||"left"},children:(()=>{const P=d.find(V=>V.id===g.id);if(!P)return null;if(M.template)return M.template(P);switch(M.name){case"text":return e.jsxs("div",{className:"gantt-grid-cell-text",children:[e.jsx(U.FontAwesomeIcon,{icon:z.faGripVertical,style:{marginRight:8,color:"#adb5bd"}}),e.jsxs("span",{className:"gantt-task-name-text",children:[P.text,g.descendantIds.length>0&&e.jsxs("span",{children:[" +",g.descendantIds.length," subtasks"]})]})]});case"start":return ae(P.start,"DD MMM YYYY");case"duration":return`${P.duration}`;default:return P[M.name]||""}})()},`ghost-${M.name}`))})]})]})},Wt=Object.freeze(Object.defineProperty({__proto__:null,calculateCriticalPath:(t,r)=>{const i=new Set,a=new Map,s=new Map,m=new Map;t.forEach(u=>{s.set(u.id,[]),m.set(u.id,[])}),r.forEach(u=>{u.type==="e2s"&&(s.get(u.source)?.push(u.target),m.get(u.target)?.push(u.source))});const c=new Map,l=new Map,d=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const $=t.find(x=>x.id===u);if(!$)return;const O=m.get(u)||[];if(O.length===0)c.set(u,0),l.set(u,$.duration);else{let x=0;O.forEach(T=>{d(T,h);const _=l.get(T)||0;x=Math.max(x,_)}),c.set(u,x),l.set(u,x+$.duration)}};t.forEach(u=>d(u.id));const S=new Map,v=new Map,b=Math.max(...Array.from(l.values())),C=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const $=t.find(x=>x.id===u);if(!$)return;const O=s.get(u)||[];if(O.length===0)v.set(u,b),S.set(u,b-$.duration);else{let x=1/0;O.forEach(T=>{C(T,h);const _=S.get(T)||0;x=Math.min(x,_)}),v.set(u,x),S.set(u,x-$.duration)}};return t.forEach(u=>C(u.id)),t.forEach(u=>{const h=c.get(u.id)||0,O=(S.get(u.id)||0)-h;a.set(u.id,O),Math.abs(O)<.01&&i.add(u.id)}),{criticalTasks:i,taskFloats:a,projectDuration:b}},getTaskFloat:(t,r)=>r.taskFloats.get(t)||0,isCriticalTask:(t,r)=>r.criticalTasks.has(t)},Symbol.toStringTag,{value:"Module"}));W.AutoScheduler=Ot,W.Chart=Oe,W.CriticalPath=Wt,W.DependencyEditor=tt,W.ExportUtils=Bt,W.FilterSearch=Ve,W.Gantt=Ht,W.Grid=Ie,W.TaskBar=Je,W.TaskCreator=Ke,W.TaskEditor=Qe,W.Timeline=Le,W.Toolbar=qe,W.addToDate=ie,W.applyFilters=Ge,W.calculateDuration=yt,W.createBaseline=rt,W.formatDate=ae,W.getDaysBetween=De,W.getEndOfDay=xt,W.getHoursBetween=We,W.getStartOfDay=Te,W.isHoliday=Pe,W.isWeekend=Ne,W.useUndoRedo=nt,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
23
+ `.trim();De(n,"gantt-report.txt","text/plain"),alert("PDF export is a simplified text version. For full PDF with charts, a PDF library would be needed.")},Pt=(t,n,i="png")=>{if(!document.getElementById(t)){alert("Could not find Gantt chart element to export");return}if(i==="svg"){alert("SVG export requires additional library. Use PNG or implement with dom-to-svg.");return}alert("Image export requires html2canvas library. Install with: npm install html2canvas")},De=(t,n,i)=>{const a=new Blob([t],{type:i}),s=URL.createObjectURL(a);At(s,n),URL.revokeObjectURL(s)},At=(t,n)=>{const i=document.createElement("a");i.href=t,i.download=n,document.body.appendChild(i),i.click(),document.body.removeChild(i)},It=Object.freeze(Object.defineProperty({__proto__:null,exportToCSV:st,exportToExcel:rt,exportToImage:Pt,exportToJSON:it,exportToPDF:ot,importFromJSON:t=>new Promise((n,i)=>{const a=new FileReader;a.onload=s=>{try{const p=s.target?.result,c=JSON.parse(p),l=c.tasks.map(x=>({...x,start:new Date(x.start),end:new Date(x.end)}));n({tasks:l,links:c.links||[]})}catch{i(new Error("Invalid JSON file"))}},a.onerror=()=>i(new Error("Failed to read file")),a.readAsText(t)})},Symbol.toStringTag,{value:"Module"})),Lt=[{name:"index",label:"",width:40,align:"center"},{name:"text",label:"Name",width:300,align:"left",resize:!0},{name:"predecessors",label:"Depends on",width:120,align:"left"},{name:"duration",label:"Duration",width:100,align:"left"},{name:"start",label:"Start",width:120,align:"left"},{name:"add",label:"",width:40,align:"center"}],Yt=[{unit:"month",step:1,format:"MMM"},{unit:"day",step:1,format:"D"}],at=({tasks:t=[],links:n=[],config:i={},onTaskUpdate:a,onTaskCreate:s,onTaskDelete:p,onLinkCreate:c,onLinkDelete:l})=>{const x=Array.isArray(t)?t:[],T=Array.isArray(n)?n:[],{tasks:d,links:g,setTasks:D,setLinks:u,undo:h,redo:j,updateTask:F,createTask:f,deleteTask:b,saveState:E}=et(x,T),[$,L]=S.useState(d),[B,X]=S.useState(null),[ee,m]=S.useState(null),[O,W]=S.useState(!1),[U,_]=S.useState(!1),[oe,te]=S.useState(null),[se,Z]=S.useState(null),[z,v]=S.useState(null),[C,r]=S.useState(null),[y,k]=S.useState(null),[P,V]=S.useState(1),[de,R]=S.useState(new Map),[K,ue]=S.useState(!1),[me]=S.useState(i.theme||"light"),[Me,Le]=S.useState({searchText:"",status:"all",priority:"all",owner:""}),Ot=S.useRef(null),Ce=S.useRef(null),_t=S.useRef(null),he={columns:Lt,scales:Yt,readonly:!1,editable:!0,taskHeight:28,rowHeight:44,scaleHeight:28,columnWidth:80,minColumnWidth:60,autoSchedule:!1,criticalPath:!1,baselines:K,weekends:!0,holidays:[],theme:me,locale:"en",...i};S.useEffect(()=>{const w=Je(d,Me);L((Y=>{const J=[],re=H=>{if(!H)return!1;const ae=Y.find(G=>G.id===H);return ae&&!ae.open&&ae.type==="project"?!0:re(ae?.parent)};return Y.forEach(H=>{re(H.parent)||J.push(H)}),J})(w))},[d,Me]);const Rt=S.useMemo(()=>{if(!d||!Array.isArray(d))return[];try{return Array.from(new Set(d.map(w=>w?.owner).filter(Boolean)))}catch(w){return console.warn("Error extracting owners:",w),[]}},[d]),zt=(()=>{const w=$.length>0?$:d;if(w.length===0){const H=new Date;return{start:Se(q(H,-30,"day")),end:Se(q(H,60,"day"))}}const M=w.map(H=>H.start.getTime()),Y=w.map(H=>H.end.getTime()),J=new Date(Math.min(...M)),re=new Date(Math.max(...Y));return{start:Se(q(J,-7,"day")),end:Se(re)}})(),Ht=w=>{X(w)},Wt=(w,M)=>{if(he.readonly)return;w.preventDefault();const Y=d.find(J=>J.id===M);Y&&k({x:w.clientX,y:w.clientY,task:Y})},Ut=()=>{if(!y?.task)return;const w=y.task,M={...w,id:`task-${Date.now()}`,text:`${w.text} (Copy)`,start:q(w.start,7,"day"),end:q(w.end,7,"day")};f(M),s&&s(M)},Ye=w=>{if(!y?.task)return;const M={...y.task,type:w};F(M),a&&a(M)},Gt=(w,M,Y,J)=>{if(!he.readonly)if(J==="reorder"){const re=$.findIndex(G=>G.id===w),H=(G,ie)=>{let ye=[];return ie.filter(ce=>ce.parent===G).forEach(ce=>{ye.push(ce.id),ye=[...ye,...H(ce.id,ie)]}),ye},ae=H(w,d);v({id:w,initialIndex:re,currentY:Y,descendantIds:ae}),document.body.classList.add("gantt-dragging")}else Z(w)},Vt=()=>{if(z&&C){const w=d.find(Y=>Y.id===z.id),M=d.find(Y=>Y.id===C.taskId);if(w&&M&&w.id!==M.id){const Y=[w.id,...z.descendantIds];if(!Y.includes(M.id)){const J=[...d];let re=C.position==="inside"?M.id:M.parent;const H=J.findIndex(ne=>ne.id===w.id);H!==-1&&(J[H]={...J[H],parent:re});const ae=J.filter(ne=>Y.includes(ne.id)),G=J.filter(ne=>!Y.includes(ne.id));let ie=G.findIndex(ne=>ne.id===M.id);if(C.position==="inside"){const ne=G.filter(ce=>ce.parent===M.id);ne.length>0?ie=G.findIndex(ce=>ce.id===ne[ne.length-1].id)+1:ie++}else if(C.position==="below"){const ne=(Oe,ut)=>{let ke=[];return ut.filter(Fe=>Fe.parent===Oe).forEach(Fe=>{ke.push(Fe.id),ke=[...ke,...ne(Fe.id,ut)]}),ke},ce=ne(M.id,G);ce.length>0?ie=G.findIndex(Oe=>Oe.id===ce[ce.length-1])+1:ie++}const ye={tasks:[...d],links:[...g]};G.splice(ie,0,...ae),D(G),E("task_update",ye,{tasks:G,links:g})}}}Z(null),v(null),r(null),document.body.classList.remove("gantt-dragging")},Jt=w=>{if(z){const M=he.rowHeight||44,Y=Ce.current?.querySelector(".gantt-grid-body");if(!Y)return;const J=Y.getBoundingClientRect(),re=w.clientY-J.top;let H=Math.floor(re/M);H=Math.max(0,Math.min(H,$.length-1));const ae=$[H];if(ae){const G=re-H*M;let ie="above";ae.type==="project"?G<M*.3?ie="above":G>M*.7?ie="below":ie="inside":ie=G<M/2?"above":"below",ae.id!==z.id?r({taskId:ae.id,position:ie}):r(null)}v(G=>G?{...G,currentY:w.clientY}:null)}},lt=()=>{z&&Vt()},Xt=w=>{const M={...w,id:`task-${Date.now()}`};f(M),s&&s(M)},Be=w=>{F(w),a&&a(w)},ct=w=>{b(w),p&&p(w)},dt=(w,M,Y,J)=>{const re={id:`link-${Date.now()}`,source:w,target:M,type:Y,lag:J};u([...g,re]),c&&c(re)},qt=w=>{const M=g.filter(Y=>Y.id!==w);u(M),l&&l(w)},Zt=()=>{if(!K&&de.size===0){const w=nt(d);R(w),ue(!0)}else ue(!K)};return S.useEffect(()=>{const w=M=>{(M.ctrlKey||M.metaKey)&&(M.key==="z"&&!M.shiftKey?(M.preventDefault(),h()):(M.key==="y"||M.key==="z"&&M.shiftKey)&&(M.preventDefault(),j()))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[h,j]),e.jsxs("div",{className:`gantt-page-wrapper theme-${me}`,children:[e.jsx("div",{className:"gantt-page-header",children:e.jsx("div",{className:"gantt-page-header-left",children:e.jsx("h1",{className:"gantt-page-title",children:"Iris Gantt"})})}),e.jsxs("div",{className:`gantt-container theme-${he.theme}`,children:[e.jsx(Xe,{zoomLevel:P,setZoomLevel:V,onBaselineToggle:Zt,showBaselines:K,onExport:w=>{w==="csv"&&st(d),w==="excel"&&rt(d),w==="json"&&it(d,g),w==="pdf"&&ot(d)},onFilterChange:w=>Le(w),owners:Rt||[],onAddTask:()=>W(!0)}),e.jsxs("div",{className:"gantt-layout",ref:_t,onMouseMove:Jt,onMouseUp:lt,onMouseLeave:lt,children:[e.jsx(Pe,{ref:Ce,tasks:$,columns:he.columns||[],selectedTask:B,onTaskClick:Ht,onTaskContextMenu:Wt,onTaskUpdate:Be,onTaskDragStart:Gt,onAddTask:()=>W(!0),onAddDependency:dt,onDependencyClick:w=>{const M=d.find(Y=>Y.id===w);M&&(te(M),_(!0))},links:g,allTasks:d,dropIndicator:C,reorderTask:z}),e.jsx(Ie,{ref:Ot,tasks:$,links:g,range:zt,scales:he.scales,config:he,selectedTask:B,draggedTask:se,onTaskClick:()=>{},onTaskDragStart:()=>{},onTaskDragEnd:()=>{},onTaskUpdate:(w,M)=>{const Y=d.find(J=>J.id===w);Y&&Be({...Y,...M})},zoomLevel:P,baselines:K?de:new Map})]}),O&&e.jsx(qe,{onCreateTask:Xt,onClose:()=>W(!1)}),ee&&e.jsx(Ze,{task:ee,onUpdate:Be,onDelete:ct,onClose:()=>m(null)}),U&&oe&&e.jsx(Qe,{task:oe,allTasks:d,links:g,onAddDependency:dt,onRemoveDependency:qt,onClose:()=>{_(!1),te(null)}}),y&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"gantt-context-menu-overlay",onClick:()=>k(null),onContextMenu:w=>{w.preventDefault(),k(null)}}),e.jsx(Ft,{x:y.x,y:y.y,task:y.task,onEdit:()=>{y.task&&m(y.task)},onDelete:()=>{y.task&&ct(y.task.id)},onCopy:Ut,onDependencies:()=>{y.task&&(te(y.task),_(!0))},onConvertToMilestone:()=>Ye("milestone"),onConvertToTask:()=>Ye("task"),onConvertToProject:()=>Ye("project"),onClose:()=>k(null),onAutoSchedule:()=>{const w=tt(d,g,{mode:"forward"});D(w),k(null)}})]}),z&&e.jsx("div",{className:"gantt-grid-row ghost-row",style:{height:he.rowHeight,top:z.currentY-(he.rowHeight||48)/2,left:Ce.current?.getBoundingClientRect().left,position:"fixed",pointerEvents:"none",opacity:.8,zIndex:9999,width:Ce.current?.offsetWidth,backgroundColor:"#ffffff",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #2196F3",display:"flex"},children:he.columns?.map(w=>e.jsx("div",{className:"gantt-grid-cell",style:{width:w.width,textAlign:w.align||"left"},children:(()=>{const M=d.find(Y=>Y.id===z.id);if(!M)return null;if(w.template)return w.template(M);switch(w.name){case"text":return e.jsxs("div",{className:"gantt-grid-cell-text",children:[e.jsx(I.FontAwesomeIcon,{icon:A.faGripVertical,style:{marginRight:8,color:"#adb5bd"}}),e.jsxs("span",{className:"gantt-task-name-text",children:[M.text,z.descendantIds.length>0&&e.jsxs("span",{children:[" +",z.descendantIds.length," subtasks"]})]})]});case"start":return Q(M.start,"DD MMM YYYY");case"duration":return`${M.duration}`;default:return M[w.name]||""}})()},`ghost-${w.name}`))})]})]})},Bt=Object.freeze(Object.defineProperty({__proto__:null,calculateCriticalPath:(t,n)=>{const i=new Set,a=new Map,s=new Map,p=new Map;t.forEach(u=>{s.set(u.id,[]),p.set(u.id,[])}),n.forEach(u=>{u.type==="e2s"&&(s.get(u.source)?.push(u.target),p.get(u.target)?.push(u.source))});const c=new Map,l=new Map,x=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const j=t.find(f=>f.id===u);if(!j)return;const F=p.get(u)||[];if(F.length===0)c.set(u,0),l.set(u,j.duration);else{let f=0;F.forEach(b=>{x(b,h);const E=l.get(b)||0;f=Math.max(f,E)}),c.set(u,f),l.set(u,f+j.duration)}};t.forEach(u=>x(u.id));const T=new Map,d=new Map,g=Math.max(...Array.from(l.values())),D=(u,h=new Set)=>{if(h.has(u))return;h.add(u);const j=t.find(f=>f.id===u);if(!j)return;const F=s.get(u)||[];if(F.length===0)d.set(u,g),T.set(u,g-j.duration);else{let f=1/0;F.forEach(b=>{D(b,h);const E=T.get(b)||0;f=Math.min(f,E)}),d.set(u,f),T.set(u,f-j.duration)}};return t.forEach(u=>D(u.id)),t.forEach(u=>{const h=c.get(u.id)||0,F=(T.get(u.id)||0)-h;a.set(u.id,F),Math.abs(F)<.01&&i.add(u.id)}),{criticalTasks:i,taskFloats:a,projectDuration:g}},getTaskFloat:(t,n)=>n.taskFloats.get(t)||0,isCriticalTask:(t,n)=>n.criticalTasks.has(t)},Symbol.toStringTag,{value:"Module"}));N.AutoScheduler=Nt,N.Chart=Ie,N.CriticalPath=Bt,N.DependencyEditor=Qe,N.ExportUtils=It,N.FilterSearch=Ve,N.Gantt=at,N.Grid=Pe,N.TaskBar=Ge,N.TaskCreator=qe,N.TaskEditor=Ze,N.Timeline=Ae,N.Toolbar=Xe,N.addToDate=q,N.applyFilters=Je,N.calculateDuration=xt,N.createBaseline=nt,N.default=at,N.formatDate=Q,N.getDaysBetween=be,N.getEndOfDay=mt,N.getHoursBetween=We,N.getStartOfDay=Se,N.isHoliday=$e,N.isWeekend=Ee,N.useUndoRedo=et,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -0,0 +1,2 @@
1
+ export * from './Gantt/types';
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/components/types.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,18 +1,52 @@
1
1
  {
2
2
  "name": "iris-gantt",
3
- "private": false,
4
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
+ "description": "A comprehensive, production-ready Gantt chart component built with React and TypeScript. Easy to install, simple to use.",
5
+ "keywords": [
6
+ "gantt",
7
+ "gantt-chart",
8
+ "react",
9
+ "typescript",
10
+ "project-management",
11
+ "timeline",
12
+ "scheduling",
13
+ "task-management"
14
+ ],
15
+ "author": "",
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/TimJerry725/ganttchart.git"
20
+ },
5
21
  "type": "module",
6
- "main": "dist/iris-gantt.umd.cjs",
7
- "module": "dist/iris-gantt.es.js",
8
- "types": "dist/index.d.ts",
22
+ "main": "./dist/iris-gantt.umd.cjs",
23
+ "module": "./dist/iris-gantt.js",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "import": {
28
+ "types": "./dist/index.d.ts",
29
+ "default": "./dist/iris-gantt.js"
30
+ },
31
+ "require": {
32
+ "types": "./dist/index.d.ts",
33
+ "default": "./dist/iris-gantt.umd.cjs"
34
+ }
35
+ },
36
+ "./gantt.css": {
37
+ "default": "./dist/gantt.css"
38
+ }
39
+ },
9
40
  "files": [
10
41
  "dist",
11
- "src/components/Gantt/gantt.css"
42
+ "README.md",
43
+ "USAGE.md"
12
44
  ],
13
45
  "scripts": {
14
46
  "dev": "vite",
15
- "build": "vite build",
47
+ "build": "vite build && npm run build:types",
48
+ "build:types": "tsc -p tsconfig.build.json",
49
+ "prepublishOnly": "npm run build",
16
50
  "lint": "eslint .",
17
51
  "preview": "vite preview",
18
52
  "storybook": "storybook dev -p 6006",
@@ -22,6 +56,7 @@
22
56
  "react": "^18.0.0 || ^19.0.0",
23
57
  "react-dom": "^18.0.0 || ^19.0.0",
24
58
  "antd": "^6.0.0",
59
+ "dayjs": "^1.11.0",
25
60
  "@fortawesome/react-fontawesome": "^3.1.0",
26
61
  "@fortawesome/fontawesome-svg-core": "^7.1.0",
27
62
  "@fortawesome/free-solid-svg-icons": "^7.1.0"
@@ -1 +0,0 @@
1
- :root{--wx-gantt-primary: #37a9ef;--wx-gantt-primary-selected: #d5eaf7;--wx-gantt-success: #77d257;--wx-gantt-warning: #fcba2e;--wx-gantt-danger: #fe6158;--wx-gantt-font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;--gantt-header-height: 84px;--gantt-row-height: 44px;--gantt-scale-height: 28px;--wx-gantt-border: 1px solid #e6e6e6;--wx-gantt-border-color: #e6e6e6;--wx-gantt-background: #ffffff;--wx-gantt-background-alt: #f2f3f7;--wx-gantt-background-hover: #eaedf5;--wx-gantt-select-color: #eaedf5;--wx-gantt-task-color: #37a9ef;--wx-gantt-task-fill-color: rgba(0, 0, 0, .15);--wx-gantt-project-color: #81C784;--wx-gantt-milestone-color: #9c27b0;--wx-gantt-milestone-border-radius: 2px;--wx-gantt-bar-border-radius: 3px;--wx-gantt-bar-shadow: 0 1px 2px rgba(44, 47, 60, .06), 0 3px 10px rgba(44, 47, 60, .12);--wx-gantt-font-color: #2c2f3c;--wx-gantt-font-color-alt: #9fa1ae;--wx-gantt-icon-color: #9fa1ae;--font-body: var(--wx-gantt-font-family);--color-primary: var(--wx-gantt-task-color);--color-text-main: var(--wx-gantt-font-color)}.gantt-page-wrapper{display:flex;flex-direction:column;height:calc(100vh - 40px);width:100%}.gantt-container{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;max-width:100%;overflow:hidden;background-color:var(--wx-gantt-background);border:var(--wx-gantt-border);margin:0;border-radius:var(--wx-gantt-bar-border-radius)}.gantt-container.theme-dark{background-color:#1e1e1e;border-color:#333;color:#e0e0e0;box-shadow:0 4px 12px #0003}.gantt-layout{display:flex;flex:1;overflow-x:auto;overflow-y:auto;position:relative;background-color:#fafafa;scroll-behavior:smooth;min-height:0;min-width:0;width:100%}.theme-dark .gantt-layout{background-color:#1a1a1a}.gantt-grid{display:flex;flex-direction:column;width:720px;min-width:720px;max-width:720px;border-right:var(--wx-gantt-border);background-color:#fff;flex-shrink:0;position:sticky;left:0;z-index:100!important;box-shadow:2px 0 5px #0000000d;height:100%;align-self:flex-start}.theme-dark .gantt-grid{background-color:#252525;border-right-color:#333;box-shadow:2px 0 5px #0000001a}.gantt-grid-header{position:sticky;top:0;z-index:110!important;height:var(--gantt-header-height);display:flex;border-bottom:var(--wx-gantt-border);background-color:#fff;box-shadow:none}.theme-dark .gantt-grid-header{background-color:#2d2d2d;border-bottom-color:#444}.gantt-grid-header-cell{height:100%;padding:0 16px;font-weight:600;font-size:14px;font-family:var(--font-body);border-right:var(--wx-gantt-border);background-color:var(--wx-gantt-background);color:var(--wx-gantt-font-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;justify-content:flex-start;flex-shrink:0;text-transform:none;letter-spacing:0}.gantt-grid-header-cell:last-child{border-right:none}.theme-dark .gantt-grid-header-cell{border-right-color:#333;background-color:#2d2d2d;color:#a0a0a0}.gantt-grid-body{flex:1}.gantt-grid-row{display:flex;border-bottom:var(--wx-gantt-border);cursor:pointer;transition:background-color .2s cubic-bezier(.4,0,.2,1);background-color:var(--wx-gantt-background);height:var(--gantt-row-height);min-height:var(--gantt-row-height);max-height:var(--gantt-row-height)}.gantt-grid-row:hover{background-color:#f8fafc;border-left:2px solid var(--color-primary)}.theme-dark .gantt-grid-row{background-color:#252525;border-bottom-color:#333}.theme-dark .gantt-grid-row:hover{background-color:#2d2d2d}.gantt-grid-row.dragging-row,.gantt-grid-row.descendant-dragging-row{opacity:.3;background-color:#f8f9fa;pointer-events:none}.gantt-ghost-descendant-count{margin-left:8px;background:#2196f3;color:#fff;padding:2px 6px;border-radius:10px;font-size:11px;font-weight:400}.gantt-grid-row.ghost-row{transition:none!important}body.gantt-dragging{-webkit-user-select:none!important;user-select:none!important;cursor:grabbing!important}.gantt-drop-indicator{position:absolute;left:0;right:0;height:2px;background-color:#2196f3;z-index:10;pointer-events:none}.gantt-drop-indicator.above{top:-1px}.gantt-drop-indicator.below{bottom:-1px}.gantt-drop-indicator.inside{top:0;bottom:0;height:auto;background-color:#2196f31a;border:2px solid #2196F3}.gantt-grid-body{position:relative}.gantt-grid-row.selected{background-color:#eff6ff;border-left:3px solid var(--color-primary)}.theme-dark .gantt-grid-row.selected{background-color:#2b3a4a}.gantt-grid-cell{padding:0 12px;font-size:14px;border-right:var(--wx-gantt-border);display:flex;align-items:center;overflow:hidden;font-family:var(--font-body);color:var(--wx-gantt-font-color);white-space:nowrap;text-overflow:ellipsis;flex-shrink:0}.gantt-grid-cell:last-child{border-right:none}.theme-dark .gantt-grid-cell{border-right-color:#2d2d2d;color:#dee2e6}.gantt-grid-cell-text{display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;width:100%;color:#1a1f23;font-weight:400}.gantt-row-drag-handle{cursor:grab;color:#adb5bd;font-size:14px;line-height:1;padding:0 4px;-webkit-user-select:none;user-select:none;opacity:0;transition:opacity .2s}.gantt-grid-row:hover .gantt-row-drag-handle{opacity:1}.gantt-dragging .gantt-row-drag-handle{cursor:grabbing!important;z-index:100}.gantt-tree-icon{width:16px;height:16px;display:flex;align-items:center;justify-content:center;font-size:10px;color:#666;cursor:pointer;-webkit-user-select:none;user-select:none;background-color:transparent;border:none}.gantt-tree-icon:hover{background-color:#efefef}.gantt-progress-cell{display:flex;align-items:center;gap:8px;width:100%}.gantt-progress-bar-bg{flex:1;height:16px;background-color:#e0e0e0;border-radius:8px;overflow:hidden;position:relative}.gantt-progress-bar-fill{height:100%;background:linear-gradient(90deg,#81c784,#a5d6a7);transition:width .3s}.gantt-progress-text{font-size:11px;color:#666;min-width:35px;text-align:right}.gantt-timeline-container{display:flex;flex-direction:column;background-color:#fff;flex-shrink:0;min-width:0;overflow:visible}.theme-dark .gantt-timeline-container{background-color:#1e1e1e}.gantt-timeline-header{position:sticky;top:0;z-index:30;background-color:var(--wx-gantt-background);border-bottom:var(--wx-gantt-border);height:var(--gantt-header-height);box-shadow:none;overflow:visible}.gantt-timeline-scale{display:flex;border-bottom:var(--wx-gantt-border);align-items:center;min-height:var(--gantt-scale-height);width:100%}.theme-dark .gantt-timeline-header{background-color:#1e1e1e;border-bottom-color:#444}.gantt-timeline-scale-month{height:var(--gantt-scale-height);background-color:var(--wx-gantt-background);font-weight:600;display:flex;align-items:center;justify-content:center;border-bottom:var(--wx-gantt-border);font-size:13px;color:var(--wx-gantt-font-color);text-transform:none;font-family:var(--font-body)}.theme-dark .gantt-timeline-scale-month{background-color:#2a2a2a;color:#adb5bd;border-bottom-color:#333}.gantt-timeline-scale-range{height:var(--gantt-scale-height);background-color:var(--wx-gantt-background);font-size:13px;font-weight:600;color:var(--wx-gantt-font-color);display:flex;align-items:center;justify-content:center;border-bottom:var(--wx-gantt-border);text-transform:none;letter-spacing:0;font-family:var(--font-body)}.theme-dark .gantt-timeline-scale-range{background-color:#1e1e1e;color:#888;border-bottom-color:#333}.gantt-timeline-scale-day{height:var(--gantt-scale-height);background-color:var(--wx-gantt-background);border-bottom:none;display:flex;align-items:center;justify-content:center;font-size:13px;color:var(--wx-gantt-font-color);font-weight:400;font-family:var(--font-body)}.theme-dark .gantt-timeline-scale-day{background-color:#1e1e1e;color:#dee2e6}.gantt-timeline-cell{flex-shrink:0;height:100%;display:flex;align-items:center;justify-content:center;border-right:var(--wx-gantt-border);font-size:13px;white-space:nowrap;padding:0 4px;color:var(--wx-gantt-font-color);font-family:var(--font-body);min-width:0;overflow:hidden;text-overflow:ellipsis}.theme-dark .gantt-timeline-cell{border-right-color:#444}.gantt-timeline-cell.weekend{background-color:#f8fafc}.theme-dark .gantt-timeline-cell.weekend{background-color:#2a2a2a}.gantt-timeline-cell.holiday{background-color:#fff8f0}.theme-dark .gantt-timeline-cell.holiday{background-color:#3a2a1a}.gantt-timeline-body{position:relative;min-height:0}.gantt-timeline-grid{display:flex;position:absolute;top:0;left:0;bottom:0;pointer-events:none;z-index:0}.gantt-timeline-grid-column{flex-shrink:0;border-right:1px solid #e5e7eb}.theme-dark .gantt-timeline-grid-column{border-right-color:#2d2d2d}.gantt-timeline-grid-column.weekend{background-color:#f8fafc}.theme-dark .gantt-timeline-grid-column.weekend{background-color:#252525}.gantt-timeline-grid-column.holiday{background-color:#fff8f0}.theme-dark .gantt-timeline-grid-column.holiday{background-color:#332a1a}.gantt-timeline-tasks{position:relative;z-index:1;display:flex;flex-direction:column}.gantt-links-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1;overflow:visible}.gantt-link{pointer-events:all;cursor:pointer;transition:all .2s ease}.gantt-link-line{transition:all .2s ease;stroke:#cbd5e0;stroke-width:1.5}.theme-dark .gantt-link-line{stroke:#4a5568}.gantt-link:hover .gantt-link-line{stroke-width:2;stroke:#a0aec0}.theme-dark .gantt-link:hover .gantt-link-line{stroke:#90caf9}.gantt-link-arrow{transition:all .2s ease;fill:#cbd5e0}.theme-dark .gantt-link-arrow{fill:#64b5f6}.gantt-link:hover .gantt-link-arrow{fill:#2196f3;filter:drop-shadow(0 2px 4px rgba(33,150,243,.4))}.theme-dark .gantt-link:hover .gantt-link-arrow{fill:#90caf9}.gantt-timeline-row{position:relative;width:100%;border-bottom:1px solid #e5e7eb;height:var(--gantt-row-height);min-height:var(--gantt-row-height);max-height:var(--gantt-row-height);flex-shrink:0}.theme-dark .gantt-timeline-row{border-bottom-color:#333}.gantt-task-bar{position:absolute;height:28px;top:50%;transform:translateY(-50%);border-radius:var(--wx-gantt-bar-border-radius);cursor:move;transition:box-shadow .2s,transform .1s;display:flex;align-items:center;overflow:visible;border:none;box-shadow:0 1px 3px #0000001a}.gantt-task-bar:hover{box-shadow:0 4px 12px #00000026;transform:translateY(-50%) scale(1.02);z-index:100!important;filter:brightness(1.05)}.gantt-task-bar.selected{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--color-primary);z-index:10;border:2px solid var(--color-primary)}.gantt-task-bar.dragging{opacity:.85;cursor:grabbing;box-shadow:0 10px 20px #00000030,0 6px 6px #0000003b;transition:none}.gantt-task-bar.project{height:28px;border-radius:var(--wx-gantt-bar-border-radius);font-weight:600;background-color:var(--wx-gantt-project-color)!important}.gantt-task-bar.milestone{width:0!important;height:0!important;overflow:visible;border:none;background:none!important;box-shadow:none}.gantt-milestone-diamond{position:absolute;top:50%;left:50%;width:14px;height:14px;background-color:var(--wx-gantt-milestone-color);transform:translate(-50%,-50%) rotate(45deg);border-radius:var(--wx-gantt-milestone-border-radius);box-shadow:var(--wx-gantt-bar-shadow);z-index:2;cursor:pointer}.gantt-milestone-text{position:absolute;left:20px;top:50%;transform:translateY(-50%);white-space:nowrap;color:var(--wx-gantt-font-color);font-size:13px;font-weight:400;pointer-events:none;font-family:var(--font-body)}.gantt-task-progress{position:absolute;left:0;top:0;height:100%;background-color:var(--wx-gantt-task-fill-color);pointer-events:none;z-index:1;border-radius:inherit}.gantt-task-content{position:relative;z-index:2;padding:0 12px;color:#fff;font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;text-shadow:0 1px 2px rgba(0,0,0,.25);font-family:var(--font-body);height:100%;display:flex;align-items:center}.milestone .gantt-task-content{overflow:visible}.gantt-task-text{display:block;overflow:hidden;text-overflow:ellipsis}.gantt-task-resize-handle{position:absolute;top:0;width:8px;height:100%;cursor:ew-resize;z-index:3}.gantt-task-resize-left{left:0}.gantt-task-resize-right{right:0}.gantt-task-resize-handle:hover{background-color:#ffffff4d}.gantt-toolbar-wrapper{background-color:#f8f9fa;border-bottom:1px solid #dfe3e6;padding:4px 0}.gantt-toolbar{padding:8px 20px;background-color:transparent;display:flex;justify-content:space-between;align-items:center;z-index:100}.theme-dark .gantt-toolbar{background-color:#252525;border-bottom-color:#333}.gantt-toolbar-left,.gantt-toolbar-right{display:flex;align-items:center}.gantt-tooltip{padding:8px 12px;max-width:250px}.gantt-tooltip-title{font-weight:600;font-size:14px;margin-bottom:4px;color:#fff}.gantt-tooltip-dates{font-size:12px;color:#ced4da;margin-bottom:4px}.gantt-tooltip-progress,.gantt-tooltip-owner{font-size:12px;color:#fff}.gantt-task-group{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.gantt-task-bar.segment{pointer-events:all;background:repeating-linear-gradient(45deg,transparent,transparent 10px,rgba(255,255,255,.1) 10px,rgba(255,255,255,.1) 20px);border:1px dashed rgba(255,255,255,.4)}.gantt-task-bar.segment:hover{transform:translateY(-50%) scale(1.05);box-shadow:0 4px 8px #0000004d}.gantt-layout::-webkit-scrollbar{width:8px;height:8px}.gantt-layout::-webkit-scrollbar-track{background:transparent}.gantt-layout::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:10px;border:2px solid #ffffff}.gantt-layout::-webkit-scrollbar-thumb:hover{background:#94a3b8}.theme-dark .gantt-layout::-webkit-scrollbar-track{background:transparent;border-color:transparent}.theme-dark .gantt-layout::-webkit-scrollbar-thumb{background:#4a5568;border-color:#1a1a1a}.theme-dark .gantt-layout::-webkit-scrollbar-thumb:hover{background:#718096}.gantt-modal-overlay{position:fixed;inset:0;background-color:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000}.gantt-modal{background-color:#fff;border-radius:8px;box-shadow:0 4px 20px #0000004d;max-width:600px;width:90%;max-height:90vh;overflow:hidden;display:flex;flex-direction:column}.theme-dark .gantt-modal{background-color:#2d2d2d;color:#fff}.gantt-modal-header{padding:20px;border-bottom:1px solid #e0e0e0;display:flex;justify-content:space-between;align-items:center}.theme-dark .gantt-modal-header{border-bottom-color:#444}.gantt-modal-header h3{margin:0;font-size:20px;font-weight:600}.gantt-modal-close{background:none;border:none;font-size:24px;cursor:pointer;color:#666;padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all .2s}.gantt-modal-close:hover{background-color:#f0f0f0;color:#333}.theme-dark .gantt-modal-close:hover{background-color:#3a3a3a;color:#fff}.gantt-modal-body{padding:20px;overflow-y:auto;flex:1}.gantt-form-row{margin-bottom:16px}.gantt-form-row label{display:block;margin-bottom:6px;font-weight:500;font-size:14px;color:#333}.theme-dark .gantt-form-row label{color:#ddd}.gantt-form-row input[type=text],.gantt-form-row input[type=date],.gantt-form-row input[type=number],.gantt-form-row select,.gantt-form-row textarea{width:100%;padding:10px 12px;border:1px solid #d1d5da;border-radius:6px;font-size:14px;font-family:inherit;transition:border-color .2s}.theme-dark .gantt-form-row input,.theme-dark .gantt-form-row select,.theme-dark .gantt-form-row textarea{background-color:#3a3a3a;border-color:#555;color:#fff}.gantt-form-row input:focus,.gantt-form-row select:focus,.gantt-form-row textarea:focus{outline:none;border-color:#2196f3}.gantt-form-row textarea{resize:vertical;min-height:80px}.gantt-form-row-group{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}.gantt-progress-value{margin-left:10px;font-weight:600;color:#2196f3}.gantt-modal-footer{padding:16px 20px;border-top:1px solid #e0e0e0;display:flex;justify-content:space-between;align-items:center}.theme-dark .gantt-modal-footer{border-top-color:#444}.gantt-modal-footer-right{display:flex;gap:10px}.gantt-btn{padding:10px 20px;border:none;border-radius:6px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s}.gantt-btn-primary{background-color:#2196f3;color:#fff}.gantt-btn-primary:hover{background-color:#1976d2;box-shadow:0 2px 8px #2196f34d}.gantt-btn-secondary{background-color:#f0f0f0;color:#333}.theme-dark .gantt-btn-secondary{background-color:#3a3a3a;color:#fff}.gantt-btn-secondary:hover{background-color:#e0e0e0}.theme-dark .gantt-btn-secondary:hover{background-color:#4a4a4a}.gantt-btn-danger{background-color:#f44336;color:#fff}.gantt-btn-danger:hover{background-color:#d32f2f}.gantt-filter-container{background-color:#f8f9fa;border-bottom:1px solid #e0e0e0}.theme-dark .gantt-filter-container{background-color:#2a2a2a;border-bottom-color:#444}.gantt-filter-bar{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;gap:16px}.gantt-filter-left{display:flex;align-items:center;gap:10px}.gantt-filter-right{display:flex;align-items:center;gap:10px;margin-left:auto}.gantt-search-antd .ant-input-affix-wrapper{border-radius:6px;font-family:var(--font-body)}.gantt-filter-select-antd .ant-select-selector{border-radius:6px!important;font-family:var(--font-body)}.gantt-filter-clear-antd{border-radius:6px;font-family:var(--font-body);font-weight:500}.theme-dark .gantt-search-antd .ant-input-affix-wrapper,.theme-dark .gantt-filter-select-antd .ant-select-selector{background-color:#3a3a3a;border-color:#555;color:#fff}.theme-dark .gantt-search-antd .ant-input,.theme-dark .gantt-filter-select-antd .ant-select-selection-item{color:#fff}.theme-dark .gantt-search-antd .ant-input-prefix,.theme-dark .gantt-filter-select-antd .ant-select-arrow{color:#aaa}.gantt-task-bar.critical{background-color:#f44336!important;box-shadow:0 0 0 2px #f443364d}.gantt-task-bar.critical .gantt-task-progress{background-color:#fff6}.gantt-baseline-container{position:relative;width:100%;height:100%}.gantt-baseline-bar{position:absolute;height:8px;background-color:#bdbdbd;top:50%;transform:translateY(calc(-50% + 20px));border-radius:4px;z-index:0;pointer-events:none}.gantt-variance-indicator{position:absolute;height:2px;bottom:0;opacity:.5}.gantt-variance-indicator.delayed{background-color:#f44336}.gantt-variance-indicator.ahead{background-color:#4caf50}.gantt-variance-label{position:absolute;top:-18px;right:0;font-size:11px;font-weight:600;padding:2px 6px;border-radius:3px;background-color:#ffffffe6}.gantt-toolbar{display:flex;justify-content:space-between;align-items:center}.gantt-toolbar-left,.gantt-toolbar-right{display:flex;gap:8px;align-items:center}.gantt-toolbar button.active{background-color:#1976d2}.gantt-milestone-marker{width:14px;height:14px;background-color:#9c27b0;transform:rotate(45deg);margin:0 auto}.gantt-milestone-text{position:absolute;left:100%;top:50%;transform:translateY(-50%);margin-left:10px;white-space:nowrap;font-size:11px;color:#555;font-family:var(--font-body);pointer-events:none}.theme-dark .gantt-milestone-text{color:#ccc}.gantt-toolbar-separator{width:1px;height:24px;background-color:#ddd;margin:0 4px}.theme-dark .gantt-toolbar-separator{background-color:#555}.gantt-dependency-editor-overlay{position:fixed;inset:0;background-color:#00000080;display:flex;align-items:center;justify-content:center;z-index:10000;animation:fadeIn .2s ease-out}.gantt-dependency-editor{background:#fff;border-radius:8px;box-shadow:0 4px 20px #00000026;width:700px;max-width:90vw;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;animation:slideUp .3s ease-out}.gantt-dependency-editor-header{display:flex;justify-content:space-between;align-items:center;padding:20px 24px;border-bottom:1px solid #e0e0e0;background-color:#f8f9fa}.gantt-dependency-editor-header h3{margin:0;font-size:18px;font-weight:600;color:#333}.gantt-dependency-editor-body{padding:24px;overflow-y:auto;flex:1}.gantt-dependency-section{margin-bottom:32px}.gantt-dependency-section h4{margin:0 0 12px;font-size:14px;font-weight:600;color:#555;text-transform:uppercase;letter-spacing:.5px}.gantt-dependency-section h5{margin:0 0 8px;font-size:13px;font-weight:600;color:#666}.gantt-empty-message{color:#999;font-style:italic;padding:12px;background-color:#f8f9fa;border-radius:4px;text-align:center}.gantt-dependency-list{list-style:none;padding:0;margin:0}.gantt-dependency-item{display:flex;justify-content:space-between;align-items:center;padding:12px;margin-bottom:8px;background-color:#f8f9fa;border-radius:6px;border:1px solid #e0e0e0;transition:all .2s}.gantt-dependency-item:hover{background-color:#e9ecef;border-color:#007bff}.gantt-dependency-info{display:flex;flex-direction:column;gap:4px;flex:1}.gantt-dependency-task-name{font-weight:500;color:#333;font-size:14px}.gantt-dependency-type{font-size:12px;color:#666;padding:2px 8px;background-color:#e3f2fd;border-radius:12px;display:inline-block;width:fit-content}.gantt-dependency-lag{font-size:11px;color:#ff9800;font-weight:600;padding:2px 6px;background-color:#fff3e0;border-radius:10px;display:inline-block;width:fit-content}.gantt-dependency-remove{background-color:transparent;border:none;font-size:16px;cursor:pointer;padding:4px 8px;border-radius:4px;transition:all .2s}.gantt-dependency-remove:hover{background-color:#ffebee}.gantt-add-dependency{border-top:2px dashed #dee2e6;padding-top:24px}.gantt-dependency-form{display:flex;flex-direction:column;gap:16px}.gantt-form-row{display:flex;flex-direction:column;gap:6px}.gantt-form-row label{font-size:13px;font-weight:500;color:#555;display:flex;flex-direction:column;gap:2px}.gantt-help-text{font-size:11px;color:#999;font-weight:400}.gantt-select,.gantt-input{padding:10px 12px;border:1px solid #ced4da;border-radius:6px;font-size:14px;font-family:inherit;transition:all .2s;background-color:#fff}.gantt-select:focus,.gantt-input:focus{outline:none;border-color:#007bff;box-shadow:0 0 0 3px #007bff1a}.gantt-form-actions{display:flex;gap:12px;margin-top:8px}.gantt-btn{padding:10px 20px;border:none;border-radius:6px;font-size:14px;font-weight:500;cursor:pointer;transition:all .2s;font-family:inherit}.gantt-btn-primary{background-color:#007bff;color:#fff}.gantt-btn-primary:hover:not(:disabled){background-color:#0056b3;transform:translateY(-1px);box-shadow:0 2px 8px #007bff4d}.gantt-btn-primary:disabled{background-color:#ccc;cursor:not-allowed;opacity:.6}.gantt-dependency-help{background-color:#f8f9fa;border:1px solid #dee2e6;border-radius:8px;padding:16px;margin-top:24px}.gantt-dependency-help ul{margin:8px 0;padding-left:20px}.gantt-dependency-help li{margin-bottom:6px;font-size:13px;line-height:1.5;color:#555}.gantt-dependency-help strong{color:#333}.gantt-dependency-help code{background-color:#e9ecef;padding:2px 6px;border-radius:3px;font-family:var(--font-heading);font-size:12px;color:#d63384}.gantt-dependency-help p{margin:4px 0;font-size:13px;color:#666}.theme-dark .gantt-dependency-editor{background-color:#2d2d2d}.theme-dark .gantt-dependency-editor-header{background-color:#252525;border-bottom-color:#444}.theme-dark .gantt-dependency-editor-header h3{color:#e0e0e0}.theme-dark .gantt-empty-message{background-color:#252525;color:#888}.theme-dark .gantt-dependency-item{background-color:#252525;border-color:#444}.theme-dark .gantt-dependency-item:hover{background-color:#333;border-color:#007bff}.theme-dark .gantt-dependency-task-name{color:#e0e0e0}.theme-dark .gantt-dependency-type{background-color:#1a2332;color:#64b5f6}.theme-dark .gantt-dependency-help{background-color:#252525;border-color:#444}.theme-dark .gantt-dependency-help code{background-color:#333;color:#ff79c6}.theme-dark .gantt-select,.theme-dark .gantt-input{background-color:#333;border-color:#555;color:#e0e0e0}.theme-dark .gantt-dependency-section h4,.theme-dark .gantt-dependency-section h5,.theme-dark .gantt-form-row label{color:#b0b0b0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}h1,h2,h3,h4,h5,h6,.gantt-toolbar button,.gantt-filter-label,.gantt-dependency-section h4,.gantt-dependency-section h5{font-family:var(--font-heading)}.gantt-grid-cell,.gantt-task-text,.gantt-dependency-task-name,.gantt-form-row label,.gantt-dependency-help p,.gantt-dependency-help li{font-family:var(--font-body)}.gantt-dependency-modal .ant-modal-header{font-family:var(--font-heading)}.gantt-dependency-modal .ant-modal-body,.gantt-dependency-modal .ant-list-item-meta-title{font-family:var(--font-body)}.gantt-dependency-modal .ant-typography{font-family:inherit}.gantt-dependency-modal code{font-family:var(--font-heading)}.gantt-dependency-modal .ant-btn,.gantt-dependency-modal .ant-select,.gantt-dependency-modal .ant-input-number{font-family:var(--font-body)}.gantt-context-menu-overlay{position:fixed;inset:0;z-index:9999;background:transparent}.gantt-context-menu{font-family:var(--font-body)}.gantt-context-menu .ant-menu{font-family:var(--font-body);min-width:180px}.gantt-context-menu .ant-menu-item{font-family:var(--font-body);font-size:13px;padding:8px 16px;height:auto;line-height:1.5}.gantt-context-menu .ant-menu-item-icon{margin-right:8px;font-size:14px}.theme-dark .gantt-context-menu .ant-menu{background-color:#2d2d2d;border-color:#444}.theme-dark .gantt-context-menu .ant-menu-item{color:#e0e0e0}.theme-dark .gantt-context-menu .ant-menu-item:hover{background-color:#3a3a3a;color:#fff}@media(max-width:1024px){.gantt-grid{min-width:250px;width:300px;max-width:40%}.gantt-toolbar,.gantt-toolbar-left,.gantt-toolbar-right{flex-wrap:wrap;gap:8px}.gantt-toolbar button{font-size:12px;padding:6px 12px}.gantt-toolbar button svg{margin-right:4px}}@media(max-width:768px){.gantt-page-wrapper{height:100vh;overflow:auto}.gantt-container{min-height:auto}.gantt-layout{flex-direction:column;height:auto;min-height:600px}.gantt-grid{min-width:100%;width:100%;max-width:100%;max-height:300px;border-right:none;border-bottom:2px solid #ddd}.gantt-timeline-container{flex:1;min-height:400px;overflow-x:auto;overflow-y:auto}.gantt-toolbar{padding:8px;flex-direction:column;align-items:stretch}.gantt-toolbar-left,.gantt-toolbar-right{width:100%;justify-content:flex-start;flex-wrap:wrap;gap:6px}.gantt-toolbar button{flex:1 1 auto;min-width:80px;font-size:11px;padding:8px 10px}.gantt-toolbar button svg{margin-right:4px;font-size:12px}.gantt-toolbar button{position:relative}.gantt-toolbar button svg{margin-right:0!important}.gantt-toolbar button:after{content:""}.gantt-filter-bar{flex-direction:column;gap:8px;padding:8px}.gantt-filter-left,.gantt-filter-right{width:100%;flex-direction:column;gap:8px}.gantt-search-antd,.gantt-filter-select-antd{width:100%!important}}@media(max-width:480px){.gantt-page-wrapper{height:100vh;overflow:auto}.gantt-toolbar{padding:6px}.gantt-toolbar button{font-size:10px;padding:6px 8px;min-width:60px}.gantt-toolbar button svg{font-size:11px;margin-right:2px}.gantt-toolbar button{display:inline-flex;align-items:center;justify-content:center;padding:8px!important;min-width:44px;position:relative}.gantt-toolbar button svg{margin-right:0!important;flex-shrink:0}.gantt-toolbar button{text-indent:-9999px;overflow:hidden;white-space:nowrap}.gantt-toolbar button svg{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);text-indent:0}.gantt-grid{max-height:250px}.gantt-grid-header-cell{padding:6px 8px;font-size:11px}.gantt-grid-cell{padding:6px 8px;font-size:12px}.gantt-timeline-container{min-height:350px}.gantt-timeline-cell{padding:6px 4px;font-size:11px;min-width:40px}.gantt-timeline-scale{font-size:10px}.gantt-dependency-modal .ant-modal{max-width:95vw!important;margin:10px auto!important}.gantt-dependency-editor{width:95vw!important;max-width:95vw!important}}@media(hover:none)and (pointer:coarse){.gantt-toolbar button{min-height:44px;min-width:44px;padding:10px 12px}.gantt-grid-row{min-height:48px}.gantt-grid-cell{padding:10px 12px}.gantt-timeline-cell{min-width:50px;padding:10px}}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.gantt-grid,.gantt-timeline-container{border-width:.5px}}@media(max-width:768px)and (orientation:landscape){.gantt-layout{flex-direction:row}.gantt-grid{max-height:none;height:100%;width:500px;min-width:500px;max-width:500px}.gantt-timeline-container{min-height:auto;height:100%}}@media print{.gantt-toolbar,.gantt-filter-container{display:none}.gantt-layout{flex-direction:row}.gantt-grid{width:500px;max-width:500px;min-width:500px}.gantt-container,.gantt-grid,.gantt-timeline-container{overflow:visible}}@media(prefers-reduced-motion:reduce){.gantt-grid,.gantt-toolbar button,.gantt-grid-row,.gantt-progress-bar-fill{transition:none}}@media(max-width:768px){.gantt-timeline-header{overflow-x:auto;-webkit-overflow-scrolling:touch}.gantt-timeline-scale{min-width:max-content}.gantt-timeline-body{overflow-x:auto;-webkit-overflow-scrolling:touch}}.gantt-page-wrapper{position:relative;width:100%;max-width:100vw;overflow-x:hidden}.gantt-container{max-width:100%;overflow:hidden}.gantt-layout{max-width:100%;overflow-x:auto;overflow-y:auto}.dependency-popover .task-list-item{transition:background-color .2s ease,border-left .2s ease;border-left:3px solid transparent}.dependency-popover .task-list-item:hover{background-color:#f0f7ff!important;border-left-color:#1890ff}.dependency-popover .task-list-item.selected{background-color:#e6f4ff!important;border-left-color:#1890ff;font-weight:500}.dependency-popover .ant-list-item{border-bottom:1px solid #f0f0f0}.dependency-popover .ant-list-item:last-child{border-bottom:none}.gantt-dependency-modal .ant-modal-body{padding:24px}.gantt-dependency-modal .ant-card{box-shadow:0 1px 2px #00000008;border:1px solid #f0f0f0}.gantt-dependency-modal .ant-list-item{padding:12px 16px;transition:background-color .2s ease}.gantt-dependency-modal .ant-list-item:hover{background-color:#fafafa}.dependency-popover .ant-input:focus,.dependency-popover .ant-select-focused .ant-select-selector,.dependency-popover .ant-input-number-focused{border-color:#1890ff;box-shadow:0 0 0 2px #1890ff1a}.dependency-popover .ant-btn-primary{background-color:#5c67f2;border-color:#5c67f2;font-weight:500;transition:all .3s ease}.dependency-popover .ant-btn-primary:hover{background-color:#4854e0;border-color:#4854e0;transform:translateY(-1px);box-shadow:0 4px 12px #5c67f24d}.dependency-popover .ant-btn-primary:disabled{background-color:#f5f5f5;border-color:#d9d9d9;color:#00000040;transform:none;box-shadow:none}