@jaeungkim/gantt-chart 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -28,4 +28,4 @@ React keys must be passed directly to JSX without using spread:
28
28
 
29
29
  Check the render method of \``+w+"`."),b||(t=n(t))&&(b=`
30
30
 
31
- Check the top-level render call using <`+t+">."),b}var M=C,Z=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),d=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),T=Symbol.iterator,x=Symbol.for("react.client.reference"),R=M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,A=Object.assign,U=Symbol.for("react.client.reference"),Y=Array.isArray,B=0,J,se,re,ce,ae,X,te;o.__reactDisabledLog=!0;var oe,le,Le=!1,je=new(typeof WeakMap=="function"?WeakMap:Map),ot=Symbol.for("react.client.reference"),Ze,Pe={},_e={},Ce={};ge.Fragment=E,ge.jsx=function(t,b,w,W,V){return h(t,b,w,!1,W,V)},ge.jsxs=function(t,b,w,W,V){return h(t,b,w,!0,W,V)}}()),ge}var He;function dt(){return He||(He=1,process.env.NODE_ENV==="production"?De.exports=ut():De.exports=ct()),De.exports}var q=dt();const at=2.375*16,Ne=3,K={day:{labelUnit:"day",tickUnit:"hour",unitPerTick:1,dragStepUnit:"minute",dragStepAmount:15,basePxPerDragStep:16,formatTickLabel:n=>n.format("h A"),formatHeaderLabel:n=>n.format("MMM D")},week:{labelUnit:"week",tickUnit:"day",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:6,basePxPerDragStep:32,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("MMM")},month:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:64,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("MMM YYYY")},year:{labelUnit:"year",tickUnit:"day",unitPerTick:7,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:16,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("YYYY")}};var Se={exports:{}},lt=Se.exports,Ue;function ft(){return Ue||(Ue=1,function(n,s){(function(r,o){n.exports=o()})(lt,function(){var r=1e3,o=6e4,i=36e5,e="millisecond",l="second",u="minute",p="hour",m="day",g="week",a="month",c="quarter",y="year",h="date",f="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,j={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var D=["th","st","nd","rd"],v=O%100;return"["+O+(D[(v-20)%10]||D[v]||D[0])+"]"}},M=function(O,D,v){var T=String(O);return!T||T.length>=D?O:""+Array(D+1-T.length).join(v)+O},Z={s:M,z:function(O){var D=-O.utcOffset(),v=Math.abs(D),T=Math.floor(v/60),x=v%60;return(D<=0?"+":"-")+M(T,2,"0")+":"+M(x,2,"0")},m:function O(D,v){if(D.date()<v.date())return-O(v,D);var T=12*(v.year()-D.year())+(v.month()-D.month()),x=D.clone().add(T,a),R=v-x<0,F=D.clone().add(T+(R?-1:1),a);return+(-(T+(v-x)/(R?x-F:F-x))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:a,y,w:g,d:m,D:h,h:p,m:u,s:l,ms:e,Q:c}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},L="en",E={};E[L]=j;var _="$isDayjsObject",H=function(O){return O instanceof G||!(!O||!O[_])},$=function O(D,v,T){var x;if(!D)return L;if(typeof D=="string"){var R=D.toLowerCase();E[R]&&(x=R),v&&(E[R]=v,x=R);var F=D.split("-");if(!x&&F.length>1)return O(F[0])}else{var A=D.name;E[A]=D,x=A}return!T&&x&&(L=x),x||!T&&L},d=function(O,D){if(H(O))return O.clone();var v=typeof D=="object"?D:{};return v.date=O,v.args=arguments,new G(v)},I=Z;I.l=$,I.i=H,I.w=function(O,D){return d(O,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var G=function(){function O(v){this.$L=$(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[_]=!0}var D=O.prototype;return D.parse=function(v){this.$d=function(T){var x=T.date,R=T.utc;if(x===null)return new Date(NaN);if(I.u(x))return new Date;if(x instanceof Date)return new Date(x);if(typeof x=="string"&&!/Z$/i.test(x)){var F=x.match(S);if(F){var A=F[2]-1||0,U=(F[7]||"0").substring(0,3);return R?new Date(Date.UTC(F[1],A,F[3]||1,F[4]||0,F[5]||0,F[6]||0,U)):new Date(F[1],A,F[3]||1,F[4]||0,F[5]||0,F[6]||0,U)}}return new Date(x)}(v),this.init()},D.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},D.$utils=function(){return I},D.isValid=function(){return this.$d.toString()!==f},D.isSame=function(v,T){var x=d(v);return this.startOf(T)<=x&&x<=this.endOf(T)},D.isAfter=function(v,T){return d(v)<this.startOf(T)},D.isBefore=function(v,T){return this.endOf(T)<d(v)},D.$g=function(v,T,x){return I.u(v)?this[T]:this.set(x,v)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(v,T){var x=this,R=!!I.u(T)||T,F=I.p(v),A=function(ae,X){var te=I.w(x.$u?Date.UTC(x.$y,X,ae):new Date(x.$y,X,ae),x);return R?te:te.endOf(m)},U=function(ae,X){return I.w(x.toDate()[ae].apply(x.toDate("s"),(R?[0,0,0,0]:[23,59,59,999]).slice(X)),x)},Y=this.$W,B=this.$M,J=this.$D,se="set"+(this.$u?"UTC":"");switch(F){case y:return R?A(1,0):A(31,11);case a:return R?A(1,B):A(0,B+1);case g:var re=this.$locale().weekStart||0,ce=(Y<re?Y+7:Y)-re;return A(R?J-ce:J+(6-ce),B);case m:case h:return U(se+"Hours",0);case p:return U(se+"Minutes",1);case u:return U(se+"Seconds",2);case l:return U(se+"Milliseconds",3);default:return this.clone()}},D.endOf=function(v){return this.startOf(v,!1)},D.$set=function(v,T){var x,R=I.p(v),F="set"+(this.$u?"UTC":""),A=(x={},x[m]=F+"Date",x[h]=F+"Date",x[a]=F+"Month",x[y]=F+"FullYear",x[p]=F+"Hours",x[u]=F+"Minutes",x[l]=F+"Seconds",x[e]=F+"Milliseconds",x)[R],U=R===m?this.$D+(T-this.$W):T;if(R===a||R===y){var Y=this.clone().set(h,1);Y.$d[A](U),Y.init(),this.$d=Y.set(h,Math.min(this.$D,Y.daysInMonth())).$d}else A&&this.$d[A](U);return this.init(),this},D.set=function(v,T){return this.clone().$set(v,T)},D.get=function(v){return this[I.p(v)]()},D.add=function(v,T){var x,R=this;v=Number(v);var F=I.p(T),A=function(B){var J=d(R);return I.w(J.date(J.date()+Math.round(B*v)),R)};if(F===a)return this.set(a,this.$M+v);if(F===y)return this.set(y,this.$y+v);if(F===m)return A(1);if(F===g)return A(7);var U=(x={},x[u]=o,x[p]=i,x[l]=r,x)[F]||1,Y=this.$d.getTime()+v*U;return I.w(Y,this)},D.subtract=function(v,T){return this.add(-1*v,T)},D.format=function(v){var T=this,x=this.$locale();if(!this.isValid())return x.invalidDate||f;var R=v||"YYYY-MM-DDTHH:mm:ssZ",F=I.z(this),A=this.$H,U=this.$m,Y=this.$M,B=x.weekdays,J=x.months,se=x.meridiem,re=function(X,te,oe,le){return X&&(X[te]||X(T,R))||oe[te].slice(0,le)},ce=function(X){return I.s(A%12||12,X,"0")},ae=se||function(X,te,oe){var le=X<12?"AM":"PM";return oe?le.toLowerCase():le};return R.replace(k,function(X,te){return te||function(oe){switch(oe){case"YY":return String(T.$y).slice(-2);case"YYYY":return I.s(T.$y,4,"0");case"M":return Y+1;case"MM":return I.s(Y+1,2,"0");case"MMM":return re(x.monthsShort,Y,J,3);case"MMMM":return re(J,Y);case"D":return T.$D;case"DD":return I.s(T.$D,2,"0");case"d":return String(T.$W);case"dd":return re(x.weekdaysMin,T.$W,B,2);case"ddd":return re(x.weekdaysShort,T.$W,B,3);case"dddd":return B[T.$W];case"H":return String(A);case"HH":return I.s(A,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return ae(A,U,!0);case"A":return ae(A,U,!1);case"m":return String(U);case"mm":return I.s(U,2,"0");case"s":return String(T.$s);case"ss":return I.s(T.$s,2,"0");case"SSS":return I.s(T.$ms,3,"0");case"Z":return F}return null}(X)||F.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(v,T,x){var R,F=this,A=I.p(T),U=d(v),Y=(U.utcOffset()-this.utcOffset())*o,B=this-U,J=function(){return I.m(F,U)};switch(A){case y:R=J()/12;break;case a:R=J();break;case c:R=J()/3;break;case g:R=(B-Y)/6048e5;break;case m:R=(B-Y)/864e5;break;case p:R=B/i;break;case u:R=B/o;break;case l:R=B/r;break;default:R=B}return x?R:I.a(R)},D.daysInMonth=function(){return this.endOf(a).$D},D.$locale=function(){return E[this.$L]},D.locale=function(v,T){if(!v)return this.$L;var x=this.clone(),R=$(v,T,!0);return R&&(x.$L=R),x},D.clone=function(){return I.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},O}(),ee=G.prototype;return d.prototype=ee,[["$ms",e],["$s",l],["$m",u],["$H",p],["$W",m],["$M",a],["$y",y],["$D",h]].forEach(function(O){ee[O[1]]=function(D){return this.$g(D,O[0],O[1])}}),d.extend=function(O,D){return O.$i||(O(D,G,d),O.$i=!0),d},d.locale=$,d.isDayjs=H,d.unix=function(O){return d(1e3*O)},d.en=E[L],d.Ls=E,d.p={},d})}(Se)),Se.exports}var pt=ft();const N=ne(pt);function ht(n,s,r,o){if(!r.length)return{barMarginLeftAmount:0,barWidthSize:0};const{tickUnit:i,unitPerTick:e}=K[o],l=r.reduce((f,S)=>f+S.widthPx,0),u=r[0].startDate,p=r[r.length-1].startDate,m=N(p).add(e,i).diff(u),g=l/m,a=n.diff(u),c=s.diff(u),y=a*g,h=Math.max(c-a,1)*g;return{barMarginLeftAmount:y,barWidthSize:h}}function mt(n){let s=1/0,r=-1/0;for(const{startDate:o,endDate:i}of Object.values(n)){const e=N(o).valueOf(),l=N(i).valueOf();Number.isNaN(e)||(s=Math.min(s,e)),Number.isNaN(l)||(r=Math.max(r,l))}return{minDate:N(s),maxDate:N(r)}}function $t(n,s,r){const{tickUnit:o,unitPerTick:i}=K[r];return{paddedMinDate:n.subtract(Ne*i,o),paddedMaxDate:s.add(Ne*i,o)}}function gt(n,s,r){const{tickUnit:o,unitPerTick:i,basePxPerDragStep:e,dragStepUnit:l,dragStepAmount:u}=K[r],p=[];let m=n.startOf(o);for(;m.isBefore(s);){const g=N(m).add(i,o).diff(m,l)/u;p.push({startDate:m,widthPx:g*e}),m=m.add(i,o)}return p}function st(n,s){const{labelUnit:r,formatHeaderLabel:o}=K[s],i=[];let e=null,l="",u=0,p=null;return n.forEach((m,g)=>{const a=m.startDate.startOf(r),c=a.valueOf(),y=(o==null?void 0:o(a))??a.format();c===e?u+=m.widthPx:(e!==null&&i.push({label:l,widthPx:u,startDate:p}),e=c,l=y,u=m.widthPx,p=a),g===n.length-1&&i.push({label:l,widthPx:u,startDate:p})}),i}function vt(n,s,r,o,i,e){const{minDate:l,maxDate:u}=mt(n);r(l),o(u);const{paddedMinDate:p,paddedMaxDate:m}=$t(l,u,s),g=gt(p,m,s),a=st(g,s);i(g),e(a)}const yt=({bottomRowCells:n,selectedScale:s,scrollRef:r})=>{var g;const o=K[s],[i,e]=C.useState(0),l=C.useMemo(()=>st(n,s),[n,s]),u=C.useMemo(()=>{const a=[];for(const c of l){const y=a[a.length-1];y&&y.label===c.label?y.widthPx+=c.widthPx:a.push({...c})}return a},[l]),p=C.useMemo(()=>{let a=0;return u.map(c=>{const y={...c,left:a};return a+=c.widthPx,y})},[u]);C.useEffect(()=>{const a=r.current;if(!a)return;const c=()=>{const y=a.scrollLeft;for(let h=p.length-1;h>=0;h--)if(y>=p[h].left){e(h);break}};return a.addEventListener("scroll",c),c(),()=>a.removeEventListener("scroll",c)},[p]);const m=((g=p[i])==null?void 0:g.label)??"";return q.jsx("div",{style:{position:"sticky",top:0,zIndex:30,backgroundColor:"#F0F1F2"},children:q.jsxs("div",{style:{display:"flex",minWidth:"max-content",flexDirection:"column"},children:[q.jsxs("div",{style:{position:"relative",display:"flex",height:"32px"},children:[q.jsx("div",{style:{position:"sticky",left:0,zIndex:40,display:"flex",width:"96px",flexShrink:0,alignItems:"center",justifyContent:"center",backgroundColor:"#F0F1F2",fontSize:"0.875rem",fontWeight:"bold"},children:m}),q.jsx("div",{style:{display:"flex"},children:p.map((a,c)=>q.jsx("div",{style:{padding:"8px 16px",fontSize:"0.875rem",fontWeight:"bold",textAlign:"left",width:`${a.widthPx}px`,backgroundColor:"#F0F1F2"},children:q.jsx("p",{style:{margin:0,padding:"0 16px"},children:c===0?"":a.label})},c))})]}),q.jsx("div",{style:{borderTop:"1px solid #D6D6D8",display:"flex"},children:n.map((a,c)=>{var h;const y=((h=o.formatTickLabel)==null?void 0:h.call(o,a.startDate))||"";return q.jsx("div",{style:{position:"relative",padding:"4px",textAlign:"center",fontSize:"0.75rem",width:`${a.widthPx}px`},children:y},c)})})]})})};var xe={exports:{}},Dt=xe.exports,ze;function St(){return ze||(ze=1,function(n,s){(function(r,o){n.exports=o()})(Dt,function(){return function(r,o,i){o.prototype.isBetween=function(e,l,u,p){var m=i(e),g=i(l),a=(p=p||"()")[0]==="(",c=p[1]===")";return(a?this.isAfter(m,u):!this.isBefore(m,u))&&(c?this.isBefore(g,u):!this.isAfter(g,u))||(a?this.isBefore(m,u):!this.isAfter(m,u))&&(c?this.isAfter(g,u):!this.isBefore(g,u))}}})}(xe)),xe.exports}var xt=St();const bt=ne(xt);var be={exports:{}},wt=be.exports,Ye;function Tt(){return Ye||(Ye=1,function(n,s){(function(r,o){n.exports=o()})(wt,function(){var r="day";return function(o,i,e){var l=function(m){return m.add(4-m.isoWeekday(),r)},u=i.prototype;u.isoWeekYear=function(){return l(this).year()},u.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),r);var g,a,c,y,h=l(this),f=(g=this.isoWeekYear(),a=this.$u,c=(a?e.utc:e)().year(g).startOf("year"),y=4-c.isoWeekday(),c.isoWeekday()>4&&(y+=7),c.add(y,r));return h.diff(f,"week")+1},u.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var p=u.startOf;u.startOf=function(m,g){var a=this.$utils(),c=!!a.u(g)||g;return a.p(m)==="isoweek"?c?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):p.bind(this)(m,g)}}})}(be)),be.exports}var Et=Tt();const kt=ne(Et);var we={exports:{}},Mt=we.exports,Be;function Ot(){return Be||(Be=1,function(n,s){(function(r,o){n.exports=o()})(Mt,function(){return function(r,o){o.prototype.isSameOrAfter=function(i,e){return this.isSame(i,e)||this.isAfter(i,e)}}})}(we)),we.exports}var It=Ot();const Rt=ne(It);var Te={exports:{}},Lt=Te.exports,Ge;function jt(){return Ge||(Ge=1,function(n,s){(function(r,o){n.exports=o()})(Lt,function(){return function(r,o){o.prototype.isSameOrBefore=function(i,e){return this.isSame(i,e)||this.isBefore(i,e)}}})}(Te)),Te.exports}var Ft=jt();const Zt=ne(Ft);var Ee={exports:{}},Pt=Ee.exports,Xe;function _t(){return Xe||(Xe=1,function(n,s){(function(r,o){n.exports=o()})(Pt,function(){return function(r,o,i){o.prototype.isToday=function(){var e="YYYY-MM-DD",l=i();return this.format(e)===l.format(e)}}})}(Ee)),Ee.exports}var Ct=_t();const At=ne(Ct);var ke={exports:{}},qt=ke.exports,Ve;function Wt(){return Ve||(Ve=1,function(n,s){(function(r,o){n.exports=o()})(qt,function(){return function(r,o,i){var e=o.prototype,l=function(a){return a&&(a.indexOf?a:a.s)},u=function(a,c,y,h,f){var S=a.name?a:a.$locale(),k=l(S[c]),j=l(S[y]),M=k||j.map(function(L){return L.slice(0,h)});if(!f)return M;var Z=S.weekStart;return M.map(function(L,E){return M[(E+(Z||0))%7]})},p=function(){return i.Ls[i.locale()]},m=function(a,c){return a.formats[c]||function(y){return y.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(h,f,S){return f||S.slice(1)})}(a.formats[c.toUpperCase()])},g=function(){var a=this;return{months:function(c){return c?c.format("MMMM"):u(a,"months")},monthsShort:function(c){return c?c.format("MMM"):u(a,"monthsShort","months",3)},firstDayOfWeek:function(){return a.$locale().weekStart||0},weekdays:function(c){return c?c.format("dddd"):u(a,"weekdays")},weekdaysMin:function(c){return c?c.format("dd"):u(a,"weekdaysMin","weekdays",2)},weekdaysShort:function(c){return c?c.format("ddd"):u(a,"weekdaysShort","weekdays",3)},longDateFormat:function(c){return m(a.$locale(),c)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};e.localeData=function(){return g.bind(this)()},i.localeData=function(){var a=p();return{firstDayOfWeek:function(){return a.weekStart||0},weekdays:function(){return i.weekdays()},weekdaysShort:function(){return i.weekdaysShort()},weekdaysMin:function(){return i.weekdaysMin()},months:function(){return i.months()},monthsShort:function(){return i.monthsShort()},longDateFormat:function(c){return m(a,c)},meridiem:a.meridiem,ordinal:a.ordinal}},i.months=function(){return u(p(),"months")},i.monthsShort=function(){return u(p(),"monthsShort","months",3)},i.weekdays=function(a){return u(p(),"weekdays",null,null,a)},i.weekdaysShort=function(a){return u(p(),"weekdaysShort","weekdays",3,a)},i.weekdaysMin=function(a){return u(p(),"weekdaysMin","weekdays",2,a)}}})}(ke)),ke.exports}var Ht=Wt();const Nt=ne(Ht);var Me={exports:{}},Ut=Me.exports,Je;function zt(){return Je||(Je=1,function(n,s){(function(r,o){n.exports=o()})(Ut,function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},o={};return function(i,e,l){var u,p=function(c,y,h){h===void 0&&(h={});var f=new Date(c),S=function(k,j){j===void 0&&(j={});var M=j.timeZoneName||"short",Z=k+"|"+M,L=o[Z];return L||(L=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:k,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:M}),o[Z]=L),L}(y,h);return S.formatToParts(f)},m=function(c,y){for(var h=p(c,y),f=[],S=0;S<h.length;S+=1){var k=h[S],j=k.type,M=k.value,Z=r[j];Z>=0&&(f[Z]=parseInt(M,10))}var L=f[3],E=L===24?0:L,_=f[0]+"-"+f[1]+"-"+f[2]+" "+E+":"+f[4]+":"+f[5]+":000",H=+c;return(l.utc(_).valueOf()-(H-=H%1e3))/6e4},g=e.prototype;g.tz=function(c,y){c===void 0&&(c=u);var h,f=this.utcOffset(),S=this.toDate(),k=S.toLocaleString("en-US",{timeZone:c}),j=Math.round((S-new Date(k))/1e3/60),M=15*-Math.round(S.getTimezoneOffset()/15)-j;if(!Number(M))h=this.utcOffset(0,y);else if(h=l(k,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(M,!0),y){var Z=h.utcOffset();h=h.add(f-Z,"minute")}return h.$x.$timezone=c,h},g.offsetName=function(c){var y=this.$x.$timezone||l.tz.guess(),h=p(this.valueOf(),y,{timeZoneName:c}).find(function(f){return f.type.toLowerCase()==="timezonename"});return h&&h.value};var a=g.startOf;g.startOf=function(c,y){if(!this.$x||!this.$x.$timezone)return a.call(this,c,y);var h=l(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return a.call(h,c,y).tz(this.$x.$timezone,!0)},l.tz=function(c,y,h){var f=h&&y,S=h||y||u,k=m(+l(),S);if(typeof c!="string")return l(c).tz(S);var j=function(E,_,H){var $=E-60*_*1e3,d=m($,H);if(_===d)return[$,_];var I=m($-=60*(d-_)*1e3,H);return d===I?[$,d]:[E-60*Math.min(d,I)*1e3,Math.max(d,I)]}(l.utc(c,f).valueOf(),k,S),M=j[0],Z=j[1],L=l(M).utcOffset(Z);return L.$x.$timezone=S,L},l.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},l.tz.setDefault=function(c){u=c}}})}(Me)),Me.exports}var Yt=zt();const Bt=ne(Yt);var Oe={exports:{}},Gt=Oe.exports,Qe;function Xt(){return Qe||(Qe=1,function(n,s){(function(r,o){n.exports=o()})(Gt,function(){return function(r,o,i){i.updateLocale=function(e,l){var u=i.Ls[e];if(u)return(l?Object.keys(l):[]).forEach(function(p){u[p]=l[p]}),u}}})}(Oe)),Oe.exports}var Vt=Xt();const Jt=ne(Vt);var Ie={exports:{}},Qt=Ie.exports,Ke;function Kt(){return Ke||(Ke=1,function(n,s){(function(r,o){n.exports=o()})(Qt,function(){var r="minute",o=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(e,l,u){var p=l.prototype;u.utc=function(f){var S={date:f,utc:!0,args:arguments};return new l(S)},p.utc=function(f){var S=u(this.toDate(),{locale:this.$L,utc:!0});return f?S.add(this.utcOffset(),r):S},p.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var m=p.parse;p.parse=function(f){f.utc&&(this.$u=!0),this.$utils().u(f.$offset)||(this.$offset=f.$offset),m.call(this,f)};var g=p.init;p.init=function(){if(this.$u){var f=this.$d;this.$y=f.getUTCFullYear(),this.$M=f.getUTCMonth(),this.$D=f.getUTCDate(),this.$W=f.getUTCDay(),this.$H=f.getUTCHours(),this.$m=f.getUTCMinutes(),this.$s=f.getUTCSeconds(),this.$ms=f.getUTCMilliseconds()}else g.call(this)};var a=p.utcOffset;p.utcOffset=function(f,S){var k=this.$utils().u;if(k(f))return this.$u?0:k(this.$offset)?a.call(this):this.$offset;if(typeof f=="string"&&(f=function(L){L===void 0&&(L="");var E=L.match(o);if(!E)return null;var _=(""+E[0]).match(i)||["-",0,0],H=_[0],$=60*+_[1]+ +_[2];return $===0?0:H==="+"?$:-$}(f),f===null))return this;var j=Math.abs(f)<=16?60*f:f,M=this;if(S)return M.$offset=j,M.$u=f===0,M;if(f!==0){var Z=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(M=this.local().add(j+Z,r)).$offset=j,M.$x.$localOffset=Z}else M=this.utc();return M};var c=p.format;p.format=function(f){var S=f||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,S)},p.valueOf=function(){var f=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*f},p.isUTC=function(){return!!this.$u},p.toISOString=function(){return this.toDate().toISOString()},p.toString=function(){return this.toDate().toUTCString()};var y=p.toDate;p.toDate=function(f){return f==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():y.call(this)};var h=p.diff;p.diff=function(f,S,k){if(f&&this.$u===f.$u)return h.call(this,f,S,k);var j=this.local(),M=u(f).local();return h.call(j,M,S,k)}}})}(Ie)),Ie.exports}var en=Kt();const tn=ne(en);var Re={exports:{}},nn=Re.exports,et;function rn(){return et||(et=1,function(n,s){(function(r,o){n.exports=o()})(nn,function(){return function(r,o){o.prototype.weekday=function(i){var e=this.$locale().weekStart||0,l=this.$W,u=(l<e?l+7:l)-e;return this.$utils().u(i)?u:this.subtract(u,"day").add(i,"day")}}})}(Re)),Re.exports}var an=rn();const sn=ne(an);N.extend(sn);N.extend(At);N.extend(tn);N.extend(Bt);N.extend(Rt);N.extend(Zt);N.extend(bt);N.extend(Nt);N.extend(Jt);N.extend(kt);function on(n){return[...n].sort((s,r)=>{const o=s.sequence.split(".").map(Number),i=r.sequence.split(".").map(Number);for(let e=0;e<Math.max(o.length,i.length);e++){const l=o[e]||0,u=i[e]||0;if(l!==u)return l-u}return 0})}function un(n){return n.split(".").length-1}function Fe(n,s,r){const o=on(n);let i=0;return o.map(e=>{i++;const l=un(e.sequence),{barMarginLeftAmount:u,barWidthSize:p}=ht(N(e.startDate),N(e.endDate),s,r);return{...e,barLeft:u,barWidth:p,depth:l,order:i,originalOrder:i}})}const tt=n=>{let s;const r=new Set,o=(m,g)=>{const a=typeof m=="function"?m(s):m;if(!Object.is(a,s)){const c=s;s=g??(typeof a!="object"||a===null)?a:Object.assign({},s,a),r.forEach(y=>y(s,c))}},i=()=>s,u={setState:o,getState:i,getInitialState:()=>p,subscribe:m=>(r.add(m),()=>r.delete(m))},p=s=n(o,i,u);return u},cn=n=>n?tt(n):tt,dn=n=>n;function ln(n,s=dn){const r=C.useSyncExternalStore(n.subscribe,()=>s(n.getState()),()=>s(n.getInitialState()));return C.useDebugValue(r),r}const nt=n=>{const s=cn(n),r=o=>ln(s,o);return Object.assign(r,s),r},fn=n=>n?nt(n):nt,ve=fn((n,s)=>({rawTasks:[],transformedTasks:[],bottomRowCells:[],topHeaderGroups:[],selectedScale:"month",minDate:N(),maxDate:N(),draggingTaskMeta:null,setSelectedScale:r=>{const{rawTasks:o,bottomRowCells:i}=s(),e=Fe(o,i,r);n({selectedScale:r,transformedTasks:e})},setRawTasks:r=>{const{bottomRowCells:o,selectedScale:i}=s(),e=Fe(r,o,i);n({rawTasks:r,transformedTasks:e})},setBottomRowCells:r=>{const{rawTasks:o,selectedScale:i}=s(),e=Fe(o,r,i);n({bottomRowCells:r,transformedTasks:e})},setTopHeaderGroups:r=>n({topHeaderGroups:r}),setMinDate:r=>n({minDate:r}),setMaxDate:r=>n({maxDate:r}),setDraggingTaskMeta:r=>n({draggingTaskMeta:r}),clearDraggingTaskMeta:()=>n({draggingTaskMeta:null})})),pn=[{id:"1",name:"Project Kickoff",startDate:"2024-06-01T09:00:00Z",endDate:"2024-06-01T11:00:00Z",parentId:null,sequence:"1",dependencies:[]},{id:"2",name:"Requirement Gathering",startDate:"2024-06-02T09:00:00Z",endDate:"2024-06-05T17:00:00Z",parentId:null,sequence:"2",dependencies:[{targetId:"1",type:"FS"}]},{id:"3",name:"Stakeholder Interviews",startDate:"2024-06-02T10:00:00Z",endDate:"2024-06-03T17:00:00Z",parentId:"2",sequence:"2.1",dependencies:[{targetId:"1",type:"SF"}]},{id:"4",name:"Market Analysis",startDate:"2024-06-06T09:00:00Z",endDate:"2024-06-07T17:00:00Z",parentId:null,sequence:"3",dependencies:[{targetId:"2",type:"FS"}]},{id:"5",name:"Design System Creation",startDate:"2024-06-08T09:00:00Z",endDate:"2024-06-12T17:00:00Z",parentId:null,sequence:"4",dependencies:[{targetId:"2",type:"FS"},{targetId:"3",type:"SS"}]},{id:"6",name:"UI/UX Design",startDate:"2024-06-13T09:00:00Z",endDate:"2024-06-16T17:00:00Z",parentId:"5",sequence:"4.1",dependencies:[{targetId:"5",type:"FS"}]},{id:"7",name:"Prototyping",startDate:"2024-06-17T09:00:00Z",endDate:"2024-06-20T17:00:00Z",parentId:"6",sequence:"4.1.1",dependencies:[{targetId:"6",type:"FS"}]},{id:"8",name:"Frontend Development",startDate:"2024-06-21T09:00:00Z",endDate:"2024-06-30T17:00:00Z",parentId:null,sequence:"5",dependencies:[{targetId:"7",type:"FS"}]},{id:"9",name:"Backend Development",startDate:"2024-07-01T09:00:00Z",endDate:"2024-07-10T17:00:00Z",parentId:null,sequence:"6",dependencies:[{targetId:"7",type:"FS"}]},{id:"10",name:"API Integration",startDate:"2024-07-11T09:00:00Z",endDate:"2024-07-15T17:00:00Z",parentId:"9",sequence:"6.1",dependencies:[{targetId:"9",type:"FS"}]},{id:"11",name:"Module Development",startDate:"2024-07-16T09:00:00Z",endDate:"2024-07-20T17:00:00Z",parentId:"8",sequence:"5.1",dependencies:[{targetId:"8",type:"FS"}]},{id:"12",name:"Unit Testing",startDate:"2024-07-21T09:00:00Z",endDate:"2024-07-25T17:00:00Z",parentId:"8",sequence:"5.2",dependencies:[{targetId:"8",type:"FS"}]},{id:"13",name:"Integration Testing",startDate:"2024-07-26T09:00:00Z",endDate:"2024-07-30T17:00:00Z",parentId:"10",sequence:"6.1.1",dependencies:[{targetId:"10",type:"FS"}]},{id:"14",name:"Code Review",startDate:"2024-07-31T09:00:00Z",endDate:"2024-08-04T17:00:00Z",parentId:"10",sequence:"6.1.2",dependencies:[{targetId:"13",type:"FS"}]},{id:"15",name:"Community Feedback",startDate:"2024-08-05T09:00:00Z",endDate:"2024-08-08T17:00:00Z",parentId:null,sequence:"7",dependencies:[{targetId:"14",type:"FS"}]},{id:"16",name:"Documentation Drafting",startDate:"2024-08-09T09:00:00Z",endDate:"2024-08-12T17:00:00Z",parentId:null,sequence:"8",dependencies:[{targetId:"14",type:"FS"}]},{id:"17",name:"Documentation Finalization",startDate:"2024-08-13T09:00:00Z",endDate:"2024-08-16T17:00:00Z",parentId:"16",sequence:"8.1",dependencies:[{targetId:"16",type:"FS"}]},{id:"18",name:"Pre-release Demo",startDate:"2024-08-17T09:00:00Z",endDate:"2024-08-20T17:00:00Z",parentId:null,sequence:"9",dependencies:[{targetId:"15",type:"FS"}]},{id:"19",name:"Bug Fixing",startDate:"2024-08-21T09:00:00Z",endDate:"2024-08-25T17:00:00Z",parentId:null,sequence:"10",dependencies:[{targetId:"15",type:"FS"}]},{id:"20",name:"Release Candidate",startDate:"2024-08-26T09:00:00Z",endDate:"2024-08-30T17:00:00Z",parentId:null,sequence:"11",dependencies:[{targetId:"18",type:"FS"}]},{id:"21",name:"Final Release",startDate:"2024-08-31T09:00:00Z",endDate:"2024-09-02T17:00:00Z",parentId:null,sequence:"12",dependencies:[{targetId:"20",type:"FS"}]},{id:"22",name:"Post-release Monitoring",startDate:"2024-09-03T09:00:00Z",endDate:"2024-09-04T17:00:00Z",parentId:null,sequence:"13",dependencies:[{targetId:"21",type:"FS"}]},{id:"23",name:"Community Engagement",startDate:"2024-09-05T09:00:00Z",endDate:"2024-09-06T17:00:00Z",parentId:null,sequence:"14",dependencies:[{targetId:"21",type:"FS"}]},{id:"24",name:"Feature Iteration Planning",startDate:"2024-09-07T09:00:00Z",endDate:"2024-09-08T17:00:00Z",parentId:null,sequence:"15",dependencies:[{targetId:"22",type:"FS"}]},{id:"25",name:"Additional Module Development",startDate:"2024-09-09T09:00:00Z",endDate:"2024-09-10T17:00:00Z",parentId:"24",sequence:"15.1",dependencies:[{targetId:"24",type:"FS"}]},{id:"26",name:"Additional Testing",startDate:"2024-09-11T09:00:00Z",endDate:"2024-09-12T17:00:00Z",parentId:"25",sequence:"15.1.1",dependencies:[{targetId:"25",type:"FS"}]},{id:"27",name:"Code Refactoring",startDate:"2024-09-13T09:00:00Z",endDate:"2024-09-14T17:00:00Z",parentId:null,sequence:"16",dependencies:[{targetId:"26",type:"FS"}]},{id:"28",name:"Performance Optimization",startDate:"2024-09-15T09:00:00Z",endDate:"2024-09-16T17:00:00Z",parentId:"27",sequence:"16.1",dependencies:[{targetId:"27",type:"FS"}]},{id:"29",name:"Security Audit",startDate:"2024-09-17T09:00:00Z",endDate:"2024-09-18T17:00:00Z",parentId:null,sequence:"17",dependencies:[{targetId:"28",type:"FS"}]},{id:"30",name:"Final QA",startDate:"2024-09-19T09:00:00Z",endDate:"2024-09-20T17:00:00Z",parentId:null,sequence:"18",dependencies:[{targetId:"29",type:"FS"}]},{id:"31",name:"Launch Webinar",startDate:"2024-09-21T09:00:00Z",endDate:"2024-09-22T17:00:00Z",parentId:null,sequence:"19",dependencies:[{targetId:"21",type:"SS"}]},{id:"32",name:"Marketing Campaign",startDate:"2024-09-23T09:00:00Z",endDate:"2024-09-24T17:00:00Z",parentId:null,sequence:"20",dependencies:[{targetId:"21",type:"SF"}]},{id:"33",name:"Post-release Bug Fixing",startDate:"2024-09-25T09:00:00Z",endDate:"2024-09-26T17:00:00Z",parentId:null,sequence:"21",dependencies:[{targetId:"22",type:"SS"}]},{id:"34",name:"Version 1.1 Planning",startDate:"2024-09-27T09:00:00Z",endDate:"2024-09-28T17:00:00Z",parentId:null,sequence:"22",dependencies:[{targetId:"24",type:"FS"}]},{id:"35",name:"Feature Implementation",startDate:"2024-09-29T09:00:00Z",endDate:"2024-09-30T17:00:00Z",parentId:"34",sequence:"22.1",dependencies:[{targetId:"34",type:"FS"}]},{id:"36",name:"Beta Testing",startDate:"2024-10-01T09:00:00Z",endDate:"2024-10-02T17:00:00Z",parentId:"35",sequence:"22.1.1",dependencies:[{targetId:"35",type:"FS"}]},{id:"37",name:"Community Beta Feedback",startDate:"2024-10-03T09:00:00Z",endDate:"2024-10-04T17:00:00Z",parentId:"36",sequence:"22.1.2",dependencies:[{targetId:"36",type:"FS"}]},{id:"38",name:"Final Beta Fixes",startDate:"2024-10-05T09:00:00Z",endDate:"2024-10-06T17:00:00Z",parentId:"37",sequence:"22.1.3",dependencies:[{targetId:"37",type:"FS"}]},{id:"39",name:"Documentation Update",startDate:"2024-10-07T09:00:00Z",endDate:"2024-10-08T17:00:00Z",parentId:"17",sequence:"8.1.1",dependencies:[{targetId:"17",type:"FS"}]},{id:"40",name:"Final Release Version 1.1",startDate:"2024-10-09T09:00:00Z",endDate:"2024-10-10T17:00:00Z",parentId:null,sequence:"23",dependencies:[{targetId:"38",type:"FS"}]},{id:"41",name:"Project Retrospective",startDate:"2024-10-11T09:00:00Z",endDate:"2024-10-12T17:00:00Z",parentId:null,sequence:"24",dependencies:[{targetId:"40",type:"FS"}]}],rt=n=>Ae.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...n},Ae.createElement("path",{d:"M10.2 4L10.2 20L7.8 20L7.8 4L10.2 4ZM15 4L15 20L12.6 20L12.6 4L15 4ZM5.4 15.0999L5.4 7.8999L1.8 11.4999L5.4 15.0999ZM17.4 7.8999L17.4 15.0999L21 11.4999L17.4 7.8999Z"}));function he(n,s){const{basePxPerDragStep:r}=K[s];return Math.round(n/r)}function hn(n,s,r){const{rawTasks:o,selectedScale:i,setRawTasks:e,setDraggingTaskMeta:l,clearDraggingTaskMeta:u}=ve(),[p,m]=C.useState(s),g=C.useRef(s),a=C.useRef(null),c=C.useRef(s),y=C.useRef(n.startDate),h=C.useRef(n.endDate),f=j=>{a.current=j.clientX,c.current=s,y.current=n.startDate,h.current=n.endDate,m(s),g.current=s,l({taskId:n.id,type:"bar"}),document.addEventListener("mousemove",S),document.addEventListener("mouseup",k)},S=j=>{if(a.current===null)return;const M=j.clientX-a.current,L=he(M,i)*K[i].basePxPerDragStep,E=c.current+L;m(E),g.current=E},k=()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",k);const j=g.current-c.current,M=he(j,i),{dragStepUnit:Z,dragStepAmount:L}=K[i],E=o.map(_=>_.id===n.id?{..._,startDate:N(y.current).add(M*L,Z).toISOString(),endDate:N(h.current).add(M*L,Z).toISOString()}:_);e(E),r==null||r(E),u(),a.current=null};return{onDragStart:f,tempLeft:p}}function mn(n,s,r,o){const{rawTasks:i,selectedScale:e,setRawTasks:l,setDraggingTaskMeta:u,clearDraggingTaskMeta:p}=ve(),[m,g]=C.useState(s),[a,c]=C.useState(r),y=C.useRef(s),h=C.useRef(r),f=C.useRef(null),S=C.useRef(s),k=C.useRef(r),j=C.useRef(n.startDate),M=E=>{E.stopPropagation(),f.current=E.clientX,S.current=s,k.current=r,j.current=n.startDate,g(s),c(r),y.current=s,h.current=r,u({taskId:n.id,type:"left"}),document.addEventListener("mousemove",Z),document.addEventListener("mouseup",L)},Z=E=>{if(f.current==null)return;const _=E.clientX-f.current,$=he(_,e)*K[e].basePxPerDragStep,d=S.current+$,I=k.current-$;I<1||(g(d),c(I),y.current=d,h.current=I)},L=()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",L);const E=y.current-S.current,_=he(E,e),{dragStepUnit:H,dragStepAmount:$}=K[e],d=i.map(I=>{if(I.id!==n.id)return I;const G=N(j.current).add(_*$,H);return G.isAfter(N(I.endDate))?I:{...I,startDate:G.toISOString()}});l(d),o==null||o(d),p(),f.current=null};return{onDragStart:M,tempLeft:m,tempWidth:a}}function $n(n,s,r){const{rawTasks:o,selectedScale:i,setRawTasks:e,setDraggingTaskMeta:l,clearDraggingTaskMeta:u}=ve(),[p,m]=C.useState(s),g=C.useRef(s),a=C.useRef(null),c=C.useRef(s),y=C.useRef(n.endDate),h=k=>{k.stopPropagation(),a.current=k.clientX,c.current=s,y.current=n.endDate,m(s),g.current=s,l({taskId:n.id,type:"right"}),document.addEventListener("mousemove",f),document.addEventListener("mouseup",S)},f=k=>{if(a.current===null)return;const j=k.clientX-a.current,Z=he(j,i)*K[i].basePxPerDragStep,L=c.current+Z;L<1||(m(L),g.current=L)},S=()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",S);const k=g.current-c.current,j=he(k,i),{dragStepUnit:M,dragStepAmount:Z}=K[i],L=o.map(E=>{if(E.id!==n.id)return E;const _=N(y.current).add(j*Z,M);return _.isBefore(N(E.startDate))?E:{...E,endDate:_.toISOString()}});e(L),r==null||r(L),u(),a.current=null};return{onDragStart:h,tempWidth:p}}function gn(n,s,r,o,i){if(r<0||i<0)return`M ${s} ${r} h ${(o-s)/2}`;const e=7,l=11,u=25,p=20,m=`M ${s} ${r}`,g=o-s,a=i-r,c=Math.abs(g),y=Math.abs(a),h=i<=r,f=i>=r,S=o>=s,k=o<=s,j=c>p,M=Math.abs(g/2),Z=Math.abs(a/2);function L(){function $(){return(S||k)&&f&&!j?"downSmallHorizontal":(S||k)&&h&&!j?"upSmallHorizontal":f&&k?"downLeft":f&&S?"downRight":h&&k?"upLeft":h&&S?"upRight":""}let d=m;switch($()){case"downRight":{d+=` h ${M-e}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${a-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${M-e}`;break}case"upRight":{d+=` h ${M-e}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v -${y-e*2}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${M-e}`;break}case"downLeft":case"downSmallHorizontal":{const G=r+a/2;d+=` h ${l}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${G-r-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=` h ${g-2*l}`,d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${G-r-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${l}`;break}case"upLeft":case"upSmallHorizontal":{const G=r+a/2;d+=` h ${l}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v -${r-G-e*2}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=` h ${g-2*l}`,d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v -${r-G-e*2}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${l}`;break}default:return d}return d}function E(){let $=m;return f&&k?($+=` h ${u-l}`,$+=` a ${e} ${e} 0 0 1 ${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 1 -${e} ${e}`,$+=` h ${g-e*2}`):f&&S?($+=` h ${g+u-l}`,$+=` a ${e} ${e} 0 0 1 ${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 1 -${e} ${e}`,$+=` h -${u-l}`):h&&k?($+=` h ${u-l}`,$+=` a ${e} ${e} 0 0 0 ${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 0 -${e} -${e}`,$+=` h ${g-u+l}`):h&&S&&($+=` h ${g+u-l}`,$+=` a ${e} ${e} 0 0 0 ${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 0 -${e} -${e}`,$+=` h -${u-l}`),$}function _(){function $(){return(S||k)&&f&&!j?"downSmallHorizontal":(S||k)&&h&&!j?"upSmallHorizontal":f&&k?"downLeft":f&&S?"downRight":h&&k?"upLeft":h&&S?"upRight":""}let d=m;switch($()){case"downRight":case"downSmallHorizontal":{d+=" h -11",d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${Z-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${l*2+g}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${Z-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=" h -11";break}case"upRight":case"upSmallHorizontal":{d+=" h -11",d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v ${-(Z-e*2)}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${l*2+g}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v ${-(Z-e*2)}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=" h -11";break}case"downLeft":{d+=` h ${-M+e}`,d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${y-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=` h ${-M+e}`;break}case"upLeft":{d+=` h ${-(M-e)}`,d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v ${-(y-e*2)}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=` h ${-M+e}`;break}default:return d}return d}function H(){let $=m;return f&&k?($+=` h ${g-u}`,$+=` a ${e} ${e} 0 0 0 -${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 0 ${e} ${e}`,$+=` h ${u}`):f&&S?($+=" h -25",$+=` a ${e} ${e} 0 0 0 -${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 0 ${e} ${e}`,$+=` h ${g+u}`):h&&k?($+=` h ${g-u}`,$+=` a ${e} ${e} 0 0 1 -${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 1 ${e} -${e}`,$+=` h ${u}`):h&&S&&($+=" h -25",$+=` a ${e} ${e} 0 0 1 -${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 1 ${e} -${e}`,$+=` h ${g+u}`),$}switch(n){case"FS":return L();case"FF":return E();case"SF":return _();case"SS":return H();default:return`${m} L ${o} ${i}`}}function vn({allTasks:n,currentTask:s,onTasksChange:r}){const[o,i]=C.useState(!1),[e,l]=C.useState(!1),{onDragStart:u,tempLeft:p}=hn(s,s.barLeft,r),{onDragStart:m,tempLeft:g,tempWidth:a}=mn(s,s.barLeft,s.barWidth,r),{onDragStart:c,tempWidth:y}=$n(s,s.barWidth,r),{draggingTaskMeta:h}=ve(),f=(h==null?void 0:h.taskId)===s.id;let S=!1,k=!1,j=!1;f&&((h==null?void 0:h.type)==="left"?S=!0:(h==null?void 0:h.type)==="right"?k=!0:(h==null?void 0:h.type)==="bar"&&(j=!0));let M=s.barLeft,Z=s.barWidth;S?(M=g,Z=a):k?Z=y:j&&(M=p);const L=()=>q.jsx("button",{type:"button",onMouseDown:m,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{position:"absolute",top:0,left:"-1.15rem",width:"2rem",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"w-resize",background:"transparent",border:"none",padding:0},children:q.jsx(rt,{style:{height:"1.5rem",width:"1.5rem",fill:"#919294",opacity:o?1:0}})}),E=()=>q.jsx("button",{type:"button",onMouseDown:c,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{position:"absolute",top:0,right:"-1.15rem",width:"2rem",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"w-resize",background:"transparent",border:"none",padding:0},children:q.jsx(rt,{style:{height:"1.5rem",width:"1.5rem",fill:"#919294",opacity:e?1:0}})}),_=(s.dependencies||[]).map(H=>{const $=n.find(D=>D.id===H.targetId);if(!$)return null;const d=at,I=($.order-1)*d+d/2,G=(s.order-1)*d+d/2;let ee,O;switch(H.type){case"FS":ee=$.barLeft+$.barWidth,O=s.barLeft;break;case"SS":ee=$.barLeft,O=s.barLeft;break;case"FF":ee=$.barLeft+$.barWidth,O=s.barLeft+s.barWidth;break;case"SF":ee=$.barLeft,O=s.barLeft+s.barWidth;break;default:return console.warn(`Unknown dependency type: ${H.type}`),null}return{...H,fromX:ee,fromY:I,toX:O,toY:G}}).filter(Boolean);return q.jsxs(q.Fragment,{children:[q.jsxs("div",{role:"button",tabIndex:0,onMouseDown:u,style:{position:"relative",display:"flex",alignItems:"center",backgroundColor:"#D6D6D8",marginLeft:`${M}px`,width:`${Z}px`,height:"1rem"},children:[L(),E()]}),q.jsxs("svg",{style:{position:"absolute",top:0,left:0,zIndex:10,width:"100%",height:"100%",pointerEvents:"none"},children:[q.jsx("defs",{children:q.jsx("marker",{id:"arrowhead",markerWidth:"6",markerHeight:"6",refX:"5.25",refY:"3",orient:"auto",children:q.jsx("polygon",{points:"0 0, 6 3, 0 6",fill:"#000"})})}),_.map((H,$)=>q.jsx("path",{d:gn(H.type,H.fromX,H.fromY,H.toX,H.toY),fill:"none",markerEnd:"url(#arrowhead)",style:{stroke:"#000",strokeWidth:.75}},$))]})]})}function yn({tasks:n,onTasksChange:s,ganttHeight:r,columnWidth:o}){const[i,e]=C.useState(r||500),[l,u]=C.useState(o||1e3),[p,m]=C.useState(n||[]),g=C.useRef(null),{rawTasks:a,transformedTasks:c,selectedScale:y,setSelectedScale:h,bottomRowCells:f,topHeaderGroups:S,setRawTasks:k,setBottomRowCells:j,setTopHeaderGroups:M,setMinDate:Z,setMaxDate:L}=ve();return C.useEffect(()=>{n.length===0?m(pn):m(n)},[n]),C.useEffect(()=>{if(!p.length)return;const E=Object.fromEntries(p.map(_=>[_.id,{startDate:_.startDate,endDate:_.endDate}]));vt(E,y,Z,L,j,M)},[p,y]),C.useEffect(()=>{!f.length||!p.length||a.length===0&&k(p)},[f,p]),q.jsx("section",{style:{position:"relative",overflow:"auto",height:`${i}px`,width:"100%",backgroundColor:"#FFF",fontFamily:"Noto Sans, sans-serif"},children:q.jsx("div",{style:{width:"100%",height:"100%",overflow:"hidden",backgroundColor:"#FFF"},children:q.jsxs("section",{style:{position:"relative",display:"flex",height:"100%",width:"100%",flexDirection:"column"},children:[q.jsx("div",{style:{position:"fixed",top:"10px",right:"16px",zIndex:50,display:"flex",justifyContent:"flex-end",alignItems:"center"},children:q.jsx("select",{style:{padding:"4px 8px",fontSize:"0.875rem",borderRadius:"6px",border:"1px solid #E6E7E9"},value:y,onChange:E=>{const _=E.target.value;h(_)},children:Object.keys(K).map(E=>q.jsx("option",{value:E,children:K[E].labelUnit},E))})}),q.jsx("div",{ref:g,style:{flexGrow:1,overflowX:"auto"},children:q.jsxs("div",{style:{display:"flex",minWidth:"max-content",flexDirection:"column"},children:[q.jsx(yt,{topHeaderGroups:S,bottomRowCells:f,selectedScale:y,scrollRef:g}),q.jsx("div",{style:{position:"relative",display:"flex"},children:q.jsx("div",{style:{display:"flex",flexGrow:1,flexDirection:"column"},children:c.map(E=>q.jsx("div",{style:{display:"flex",width:"100%",alignItems:"center",borderBottom:"1px solid #E6E7E9",height:`${at}px`,backgroundColor:"#FFF"},children:q.jsx(vn,{allTasks:c,currentTask:E,onTasksChange:s})},E.id))})})]})})]})})})}exports.ReactGanttChart=yn;
31
+ Check the top-level render call using <`+t+">."),b}var M=C,Z=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),$=Symbol.for("react.consumer"),d=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),T=Symbol.iterator,x=Symbol.for("react.client.reference"),R=M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,A=Object.assign,U=Symbol.for("react.client.reference"),Y=Array.isArray,B=0,J,se,re,ce,ae,X,te;o.__reactDisabledLog=!0;var oe,le,Le=!1,je=new(typeof WeakMap=="function"?WeakMap:Map),ot=Symbol.for("react.client.reference"),Ze,Pe={},_e={},Ce={};ge.Fragment=E,ge.jsx=function(t,b,w,W,V){return h(t,b,w,!1,W,V)},ge.jsxs=function(t,b,w,W,V){return h(t,b,w,!0,W,V)}}()),ge}var He;function dt(){return He||(He=1,process.env.NODE_ENV==="production"?De.exports=ut():De.exports=ct()),De.exports}var q=dt();const at=2.375*16,Ne=3,K={day:{labelUnit:"day",tickUnit:"hour",unitPerTick:1,dragStepUnit:"minute",dragStepAmount:15,basePxPerDragStep:16,formatTickLabel:n=>n.format("h A"),formatHeaderLabel:n=>n.format("MMM D")},week:{labelUnit:"week",tickUnit:"day",unitPerTick:1,dragStepUnit:"hour",dragStepAmount:6,basePxPerDragStep:32,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("MMM")},month:{labelUnit:"month",tickUnit:"day",unitPerTick:1,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:64,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("MMM YYYY")},year:{labelUnit:"year",tickUnit:"day",unitPerTick:7,dragStepUnit:"day",dragStepAmount:1,basePxPerDragStep:16,formatTickLabel:n=>n.format("D"),formatHeaderLabel:n=>n.format("YYYY")}};var Se={exports:{}},lt=Se.exports,Ue;function ft(){return Ue||(Ue=1,function(n,s){(function(r,o){n.exports=o()})(lt,function(){var r=1e3,o=6e4,i=36e5,e="millisecond",l="second",u="minute",p="hour",m="day",g="week",a="month",c="quarter",y="year",h="date",f="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,j={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var D=["th","st","nd","rd"],v=O%100;return"["+O+(D[(v-20)%10]||D[v]||D[0])+"]"}},M=function(O,D,v){var T=String(O);return!T||T.length>=D?O:""+Array(D+1-T.length).join(v)+O},Z={s:M,z:function(O){var D=-O.utcOffset(),v=Math.abs(D),T=Math.floor(v/60),x=v%60;return(D<=0?"+":"-")+M(T,2,"0")+":"+M(x,2,"0")},m:function O(D,v){if(D.date()<v.date())return-O(v,D);var T=12*(v.year()-D.year())+(v.month()-D.month()),x=D.clone().add(T,a),R=v-x<0,F=D.clone().add(T+(R?-1:1),a);return+(-(T+(v-x)/(R?x-F:F-x))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:a,y,w:g,d:m,D:h,h:p,m:u,s:l,ms:e,Q:c}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},L="en",E={};E[L]=j;var _="$isDayjsObject",H=function(O){return O instanceof G||!(!O||!O[_])},$=function O(D,v,T){var x;if(!D)return L;if(typeof D=="string"){var R=D.toLowerCase();E[R]&&(x=R),v&&(E[R]=v,x=R);var F=D.split("-");if(!x&&F.length>1)return O(F[0])}else{var A=D.name;E[A]=D,x=A}return!T&&x&&(L=x),x||!T&&L},d=function(O,D){if(H(O))return O.clone();var v=typeof D=="object"?D:{};return v.date=O,v.args=arguments,new G(v)},I=Z;I.l=$,I.i=H,I.w=function(O,D){return d(O,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var G=function(){function O(v){this.$L=$(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[_]=!0}var D=O.prototype;return D.parse=function(v){this.$d=function(T){var x=T.date,R=T.utc;if(x===null)return new Date(NaN);if(I.u(x))return new Date;if(x instanceof Date)return new Date(x);if(typeof x=="string"&&!/Z$/i.test(x)){var F=x.match(S);if(F){var A=F[2]-1||0,U=(F[7]||"0").substring(0,3);return R?new Date(Date.UTC(F[1],A,F[3]||1,F[4]||0,F[5]||0,F[6]||0,U)):new Date(F[1],A,F[3]||1,F[4]||0,F[5]||0,F[6]||0,U)}}return new Date(x)}(v),this.init()},D.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},D.$utils=function(){return I},D.isValid=function(){return this.$d.toString()!==f},D.isSame=function(v,T){var x=d(v);return this.startOf(T)<=x&&x<=this.endOf(T)},D.isAfter=function(v,T){return d(v)<this.startOf(T)},D.isBefore=function(v,T){return this.endOf(T)<d(v)},D.$g=function(v,T,x){return I.u(v)?this[T]:this.set(x,v)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(v,T){var x=this,R=!!I.u(T)||T,F=I.p(v),A=function(ae,X){var te=I.w(x.$u?Date.UTC(x.$y,X,ae):new Date(x.$y,X,ae),x);return R?te:te.endOf(m)},U=function(ae,X){return I.w(x.toDate()[ae].apply(x.toDate("s"),(R?[0,0,0,0]:[23,59,59,999]).slice(X)),x)},Y=this.$W,B=this.$M,J=this.$D,se="set"+(this.$u?"UTC":"");switch(F){case y:return R?A(1,0):A(31,11);case a:return R?A(1,B):A(0,B+1);case g:var re=this.$locale().weekStart||0,ce=(Y<re?Y+7:Y)-re;return A(R?J-ce:J+(6-ce),B);case m:case h:return U(se+"Hours",0);case p:return U(se+"Minutes",1);case u:return U(se+"Seconds",2);case l:return U(se+"Milliseconds",3);default:return this.clone()}},D.endOf=function(v){return this.startOf(v,!1)},D.$set=function(v,T){var x,R=I.p(v),F="set"+(this.$u?"UTC":""),A=(x={},x[m]=F+"Date",x[h]=F+"Date",x[a]=F+"Month",x[y]=F+"FullYear",x[p]=F+"Hours",x[u]=F+"Minutes",x[l]=F+"Seconds",x[e]=F+"Milliseconds",x)[R],U=R===m?this.$D+(T-this.$W):T;if(R===a||R===y){var Y=this.clone().set(h,1);Y.$d[A](U),Y.init(),this.$d=Y.set(h,Math.min(this.$D,Y.daysInMonth())).$d}else A&&this.$d[A](U);return this.init(),this},D.set=function(v,T){return this.clone().$set(v,T)},D.get=function(v){return this[I.p(v)]()},D.add=function(v,T){var x,R=this;v=Number(v);var F=I.p(T),A=function(B){var J=d(R);return I.w(J.date(J.date()+Math.round(B*v)),R)};if(F===a)return this.set(a,this.$M+v);if(F===y)return this.set(y,this.$y+v);if(F===m)return A(1);if(F===g)return A(7);var U=(x={},x[u]=o,x[p]=i,x[l]=r,x)[F]||1,Y=this.$d.getTime()+v*U;return I.w(Y,this)},D.subtract=function(v,T){return this.add(-1*v,T)},D.format=function(v){var T=this,x=this.$locale();if(!this.isValid())return x.invalidDate||f;var R=v||"YYYY-MM-DDTHH:mm:ssZ",F=I.z(this),A=this.$H,U=this.$m,Y=this.$M,B=x.weekdays,J=x.months,se=x.meridiem,re=function(X,te,oe,le){return X&&(X[te]||X(T,R))||oe[te].slice(0,le)},ce=function(X){return I.s(A%12||12,X,"0")},ae=se||function(X,te,oe){var le=X<12?"AM":"PM";return oe?le.toLowerCase():le};return R.replace(k,function(X,te){return te||function(oe){switch(oe){case"YY":return String(T.$y).slice(-2);case"YYYY":return I.s(T.$y,4,"0");case"M":return Y+1;case"MM":return I.s(Y+1,2,"0");case"MMM":return re(x.monthsShort,Y,J,3);case"MMMM":return re(J,Y);case"D":return T.$D;case"DD":return I.s(T.$D,2,"0");case"d":return String(T.$W);case"dd":return re(x.weekdaysMin,T.$W,B,2);case"ddd":return re(x.weekdaysShort,T.$W,B,3);case"dddd":return B[T.$W];case"H":return String(A);case"HH":return I.s(A,2,"0");case"h":return ce(1);case"hh":return ce(2);case"a":return ae(A,U,!0);case"A":return ae(A,U,!1);case"m":return String(U);case"mm":return I.s(U,2,"0");case"s":return String(T.$s);case"ss":return I.s(T.$s,2,"0");case"SSS":return I.s(T.$ms,3,"0");case"Z":return F}return null}(X)||F.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(v,T,x){var R,F=this,A=I.p(T),U=d(v),Y=(U.utcOffset()-this.utcOffset())*o,B=this-U,J=function(){return I.m(F,U)};switch(A){case y:R=J()/12;break;case a:R=J();break;case c:R=J()/3;break;case g:R=(B-Y)/6048e5;break;case m:R=(B-Y)/864e5;break;case p:R=B/i;break;case u:R=B/o;break;case l:R=B/r;break;default:R=B}return x?R:I.a(R)},D.daysInMonth=function(){return this.endOf(a).$D},D.$locale=function(){return E[this.$L]},D.locale=function(v,T){if(!v)return this.$L;var x=this.clone(),R=$(v,T,!0);return R&&(x.$L=R),x},D.clone=function(){return I.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},O}(),ee=G.prototype;return d.prototype=ee,[["$ms",e],["$s",l],["$m",u],["$H",p],["$W",m],["$M",a],["$y",y],["$D",h]].forEach(function(O){ee[O[1]]=function(D){return this.$g(D,O[0],O[1])}}),d.extend=function(O,D){return O.$i||(O(D,G,d),O.$i=!0),d},d.locale=$,d.isDayjs=H,d.unix=function(O){return d(1e3*O)},d.en=E[L],d.Ls=E,d.p={},d})}(Se)),Se.exports}var pt=ft();const N=ne(pt);function ht(n,s,r,o){if(!r.length)return{barMarginLeftAmount:0,barWidthSize:0};const{tickUnit:i,unitPerTick:e}=K[o],l=r.reduce((f,S)=>f+S.widthPx,0),u=r[0].startDate,p=r[r.length-1].startDate,m=N(p).add(e,i).diff(u),g=l/m,a=n.diff(u),c=s.diff(u),y=a*g,h=Math.max(c-a,1)*g;return{barMarginLeftAmount:y,barWidthSize:h}}function mt(n){let s=1/0,r=-1/0;for(const{startDate:o,endDate:i}of Object.values(n)){const e=N(o).valueOf(),l=N(i).valueOf();Number.isNaN(e)||(s=Math.min(s,e)),Number.isNaN(l)||(r=Math.max(r,l))}return{minDate:N(s),maxDate:N(r)}}function $t(n,s,r){const{tickUnit:o,unitPerTick:i}=K[r];return{paddedMinDate:n.subtract(Ne*i,o),paddedMaxDate:s.add(Ne*i,o)}}function gt(n,s,r){const{tickUnit:o,unitPerTick:i,basePxPerDragStep:e,dragStepUnit:l,dragStepAmount:u}=K[r],p=[];let m=n.startOf(o);for(;m.isBefore(s);){const g=N(m).add(i,o).diff(m,l)/u;p.push({startDate:m,widthPx:g*e}),m=m.add(i,o)}return p}function st(n,s){const{labelUnit:r,formatHeaderLabel:o}=K[s],i=[];let e=null,l="",u=0,p=null;return n.forEach((m,g)=>{const a=m.startDate.startOf(r),c=a.valueOf(),y=(o==null?void 0:o(a))??a.format();c===e?u+=m.widthPx:(e!==null&&i.push({label:l,widthPx:u,startDate:p}),e=c,l=y,u=m.widthPx,p=a),g===n.length-1&&i.push({label:l,widthPx:u,startDate:p})}),i}function vt(n,s,r,o,i,e){const{minDate:l,maxDate:u}=mt(n);r(l),o(u);const{paddedMinDate:p,paddedMaxDate:m}=$t(l,u,s),g=gt(p,m,s),a=st(g,s);i(g),e(a)}const yt=({bottomRowCells:n,selectedScale:s,scrollRef:r})=>{var g;const o=K[s],[i,e]=C.useState(0),l=C.useMemo(()=>st(n,s),[n,s]),u=C.useMemo(()=>{const a=[];for(const c of l){const y=a[a.length-1];y&&y.label===c.label?y.widthPx+=c.widthPx:a.push({...c})}return a},[l]),p=C.useMemo(()=>{let a=0;return u.map(c=>{const y={...c,left:a};return a+=c.widthPx,y})},[u]);C.useEffect(()=>{const a=r.current;if(!a)return;const c=()=>{const y=a.scrollLeft;for(let h=p.length-1;h>=0;h--)if(y>=p[h].left){e(h);break}};return a.addEventListener("scroll",c),c(),()=>a.removeEventListener("scroll",c)},[p]);const m=((g=p[i])==null?void 0:g.label)??"";return q.jsx("div",{style:{position:"sticky",top:0,zIndex:30,backgroundColor:"#F0F1F2"},children:q.jsxs("div",{style:{display:"flex",minWidth:"max-content",flexDirection:"column"},children:[q.jsxs("div",{style:{position:"relative",display:"flex",height:"32px"},children:[q.jsx("div",{style:{position:"sticky",left:0,zIndex:40,display:"flex",width:"96px",flexShrink:0,alignItems:"center",justifyContent:"center",backgroundColor:"#F0F1F2",fontSize:"0.875rem",fontWeight:"bold"},children:m}),q.jsx("div",{style:{display:"flex"},children:p.map((a,c)=>q.jsx("div",{style:{padding:"8px 16px",fontSize:"0.875rem",fontWeight:"bold",textAlign:"left",width:`${a.widthPx}px`,backgroundColor:"#F0F1F2"},children:q.jsx("p",{style:{margin:0,padding:"0 16px"},children:c===0?"":a.label})},c))})]}),q.jsx("div",{style:{borderTop:"1px solid #D6D6D8",display:"flex"},children:n.map((a,c)=>{var h;const y=((h=o.formatTickLabel)==null?void 0:h.call(o,a.startDate))||"";return q.jsx("div",{style:{position:"relative",padding:"4px",textAlign:"center",fontSize:"0.75rem",width:`${a.widthPx}px`},children:y},c)})})]})})};var xe={exports:{}},Dt=xe.exports,ze;function St(){return ze||(ze=1,function(n,s){(function(r,o){n.exports=o()})(Dt,function(){return function(r,o,i){o.prototype.isBetween=function(e,l,u,p){var m=i(e),g=i(l),a=(p=p||"()")[0]==="(",c=p[1]===")";return(a?this.isAfter(m,u):!this.isBefore(m,u))&&(c?this.isBefore(g,u):!this.isAfter(g,u))||(a?this.isBefore(m,u):!this.isAfter(m,u))&&(c?this.isAfter(g,u):!this.isBefore(g,u))}}})}(xe)),xe.exports}var xt=St();const bt=ne(xt);var be={exports:{}},wt=be.exports,Ye;function Tt(){return Ye||(Ye=1,function(n,s){(function(r,o){n.exports=o()})(wt,function(){var r="day";return function(o,i,e){var l=function(m){return m.add(4-m.isoWeekday(),r)},u=i.prototype;u.isoWeekYear=function(){return l(this).year()},u.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),r);var g,a,c,y,h=l(this),f=(g=this.isoWeekYear(),a=this.$u,c=(a?e.utc:e)().year(g).startOf("year"),y=4-c.isoWeekday(),c.isoWeekday()>4&&(y+=7),c.add(y,r));return h.diff(f,"week")+1},u.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var p=u.startOf;u.startOf=function(m,g){var a=this.$utils(),c=!!a.u(g)||g;return a.p(m)==="isoweek"?c?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):p.bind(this)(m,g)}}})}(be)),be.exports}var Et=Tt();const kt=ne(Et);var we={exports:{}},Mt=we.exports,Be;function Ot(){return Be||(Be=1,function(n,s){(function(r,o){n.exports=o()})(Mt,function(){return function(r,o){o.prototype.isSameOrAfter=function(i,e){return this.isSame(i,e)||this.isAfter(i,e)}}})}(we)),we.exports}var It=Ot();const Rt=ne(It);var Te={exports:{}},Lt=Te.exports,Ge;function jt(){return Ge||(Ge=1,function(n,s){(function(r,o){n.exports=o()})(Lt,function(){return function(r,o){o.prototype.isSameOrBefore=function(i,e){return this.isSame(i,e)||this.isBefore(i,e)}}})}(Te)),Te.exports}var Ft=jt();const Zt=ne(Ft);var Ee={exports:{}},Pt=Ee.exports,Xe;function _t(){return Xe||(Xe=1,function(n,s){(function(r,o){n.exports=o()})(Pt,function(){return function(r,o,i){o.prototype.isToday=function(){var e="YYYY-MM-DD",l=i();return this.format(e)===l.format(e)}}})}(Ee)),Ee.exports}var Ct=_t();const At=ne(Ct);var ke={exports:{}},qt=ke.exports,Ve;function Wt(){return Ve||(Ve=1,function(n,s){(function(r,o){n.exports=o()})(qt,function(){return function(r,o,i){var e=o.prototype,l=function(a){return a&&(a.indexOf?a:a.s)},u=function(a,c,y,h,f){var S=a.name?a:a.$locale(),k=l(S[c]),j=l(S[y]),M=k||j.map(function(L){return L.slice(0,h)});if(!f)return M;var Z=S.weekStart;return M.map(function(L,E){return M[(E+(Z||0))%7]})},p=function(){return i.Ls[i.locale()]},m=function(a,c){return a.formats[c]||function(y){return y.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(h,f,S){return f||S.slice(1)})}(a.formats[c.toUpperCase()])},g=function(){var a=this;return{months:function(c){return c?c.format("MMMM"):u(a,"months")},monthsShort:function(c){return c?c.format("MMM"):u(a,"monthsShort","months",3)},firstDayOfWeek:function(){return a.$locale().weekStart||0},weekdays:function(c){return c?c.format("dddd"):u(a,"weekdays")},weekdaysMin:function(c){return c?c.format("dd"):u(a,"weekdaysMin","weekdays",2)},weekdaysShort:function(c){return c?c.format("ddd"):u(a,"weekdaysShort","weekdays",3)},longDateFormat:function(c){return m(a.$locale(),c)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};e.localeData=function(){return g.bind(this)()},i.localeData=function(){var a=p();return{firstDayOfWeek:function(){return a.weekStart||0},weekdays:function(){return i.weekdays()},weekdaysShort:function(){return i.weekdaysShort()},weekdaysMin:function(){return i.weekdaysMin()},months:function(){return i.months()},monthsShort:function(){return i.monthsShort()},longDateFormat:function(c){return m(a,c)},meridiem:a.meridiem,ordinal:a.ordinal}},i.months=function(){return u(p(),"months")},i.monthsShort=function(){return u(p(),"monthsShort","months",3)},i.weekdays=function(a){return u(p(),"weekdays",null,null,a)},i.weekdaysShort=function(a){return u(p(),"weekdaysShort","weekdays",3,a)},i.weekdaysMin=function(a){return u(p(),"weekdaysMin","weekdays",2,a)}}})}(ke)),ke.exports}var Ht=Wt();const Nt=ne(Ht);var Me={exports:{}},Ut=Me.exports,Je;function zt(){return Je||(Je=1,function(n,s){(function(r,o){n.exports=o()})(Ut,function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},o={};return function(i,e,l){var u,p=function(c,y,h){h===void 0&&(h={});var f=new Date(c),S=function(k,j){j===void 0&&(j={});var M=j.timeZoneName||"short",Z=k+"|"+M,L=o[Z];return L||(L=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:k,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:M}),o[Z]=L),L}(y,h);return S.formatToParts(f)},m=function(c,y){for(var h=p(c,y),f=[],S=0;S<h.length;S+=1){var k=h[S],j=k.type,M=k.value,Z=r[j];Z>=0&&(f[Z]=parseInt(M,10))}var L=f[3],E=L===24?0:L,_=f[0]+"-"+f[1]+"-"+f[2]+" "+E+":"+f[4]+":"+f[5]+":000",H=+c;return(l.utc(_).valueOf()-(H-=H%1e3))/6e4},g=e.prototype;g.tz=function(c,y){c===void 0&&(c=u);var h,f=this.utcOffset(),S=this.toDate(),k=S.toLocaleString("en-US",{timeZone:c}),j=Math.round((S-new Date(k))/1e3/60),M=15*-Math.round(S.getTimezoneOffset()/15)-j;if(!Number(M))h=this.utcOffset(0,y);else if(h=l(k,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(M,!0),y){var Z=h.utcOffset();h=h.add(f-Z,"minute")}return h.$x.$timezone=c,h},g.offsetName=function(c){var y=this.$x.$timezone||l.tz.guess(),h=p(this.valueOf(),y,{timeZoneName:c}).find(function(f){return f.type.toLowerCase()==="timezonename"});return h&&h.value};var a=g.startOf;g.startOf=function(c,y){if(!this.$x||!this.$x.$timezone)return a.call(this,c,y);var h=l(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return a.call(h,c,y).tz(this.$x.$timezone,!0)},l.tz=function(c,y,h){var f=h&&y,S=h||y||u,k=m(+l(),S);if(typeof c!="string")return l(c).tz(S);var j=function(E,_,H){var $=E-60*_*1e3,d=m($,H);if(_===d)return[$,_];var I=m($-=60*(d-_)*1e3,H);return d===I?[$,d]:[E-60*Math.min(d,I)*1e3,Math.max(d,I)]}(l.utc(c,f).valueOf(),k,S),M=j[0],Z=j[1],L=l(M).utcOffset(Z);return L.$x.$timezone=S,L},l.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},l.tz.setDefault=function(c){u=c}}})}(Me)),Me.exports}var Yt=zt();const Bt=ne(Yt);var Oe={exports:{}},Gt=Oe.exports,Qe;function Xt(){return Qe||(Qe=1,function(n,s){(function(r,o){n.exports=o()})(Gt,function(){return function(r,o,i){i.updateLocale=function(e,l){var u=i.Ls[e];if(u)return(l?Object.keys(l):[]).forEach(function(p){u[p]=l[p]}),u}}})}(Oe)),Oe.exports}var Vt=Xt();const Jt=ne(Vt);var Ie={exports:{}},Qt=Ie.exports,Ke;function Kt(){return Ke||(Ke=1,function(n,s){(function(r,o){n.exports=o()})(Qt,function(){var r="minute",o=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(e,l,u){var p=l.prototype;u.utc=function(f){var S={date:f,utc:!0,args:arguments};return new l(S)},p.utc=function(f){var S=u(this.toDate(),{locale:this.$L,utc:!0});return f?S.add(this.utcOffset(),r):S},p.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var m=p.parse;p.parse=function(f){f.utc&&(this.$u=!0),this.$utils().u(f.$offset)||(this.$offset=f.$offset),m.call(this,f)};var g=p.init;p.init=function(){if(this.$u){var f=this.$d;this.$y=f.getUTCFullYear(),this.$M=f.getUTCMonth(),this.$D=f.getUTCDate(),this.$W=f.getUTCDay(),this.$H=f.getUTCHours(),this.$m=f.getUTCMinutes(),this.$s=f.getUTCSeconds(),this.$ms=f.getUTCMilliseconds()}else g.call(this)};var a=p.utcOffset;p.utcOffset=function(f,S){var k=this.$utils().u;if(k(f))return this.$u?0:k(this.$offset)?a.call(this):this.$offset;if(typeof f=="string"&&(f=function(L){L===void 0&&(L="");var E=L.match(o);if(!E)return null;var _=(""+E[0]).match(i)||["-",0,0],H=_[0],$=60*+_[1]+ +_[2];return $===0?0:H==="+"?$:-$}(f),f===null))return this;var j=Math.abs(f)<=16?60*f:f,M=this;if(S)return M.$offset=j,M.$u=f===0,M;if(f!==0){var Z=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(M=this.local().add(j+Z,r)).$offset=j,M.$x.$localOffset=Z}else M=this.utc();return M};var c=p.format;p.format=function(f){var S=f||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,S)},p.valueOf=function(){var f=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*f},p.isUTC=function(){return!!this.$u},p.toISOString=function(){return this.toDate().toISOString()},p.toString=function(){return this.toDate().toUTCString()};var y=p.toDate;p.toDate=function(f){return f==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():y.call(this)};var h=p.diff;p.diff=function(f,S,k){if(f&&this.$u===f.$u)return h.call(this,f,S,k);var j=this.local(),M=u(f).local();return h.call(j,M,S,k)}}})}(Ie)),Ie.exports}var en=Kt();const tn=ne(en);var Re={exports:{}},nn=Re.exports,et;function rn(){return et||(et=1,function(n,s){(function(r,o){n.exports=o()})(nn,function(){return function(r,o){o.prototype.weekday=function(i){var e=this.$locale().weekStart||0,l=this.$W,u=(l<e?l+7:l)-e;return this.$utils().u(i)?u:this.subtract(u,"day").add(i,"day")}}})}(Re)),Re.exports}var an=rn();const sn=ne(an);N.extend(sn);N.extend(At);N.extend(tn);N.extend(Bt);N.extend(Rt);N.extend(Zt);N.extend(bt);N.extend(Nt);N.extend(Jt);N.extend(kt);function on(n){return[...n].sort((s,r)=>{const o=s.sequence.split(".").map(Number),i=r.sequence.split(".").map(Number);for(let e=0;e<Math.max(o.length,i.length);e++){const l=o[e]||0,u=i[e]||0;if(l!==u)return l-u}return 0})}function un(n){return n.split(".").length-1}function Fe(n,s,r){const o=on(n);let i=0;return o.map(e=>{i++;const l=un(e.sequence),{barMarginLeftAmount:u,barWidthSize:p}=ht(N(e.startDate),N(e.endDate),s,r);return{...e,barLeft:u,barWidth:p,depth:l,order:i,originalOrder:i}})}const tt=n=>{let s;const r=new Set,o=(m,g)=>{const a=typeof m=="function"?m(s):m;if(!Object.is(a,s)){const c=s;s=g??(typeof a!="object"||a===null)?a:Object.assign({},s,a),r.forEach(y=>y(s,c))}},i=()=>s,u={setState:o,getState:i,getInitialState:()=>p,subscribe:m=>(r.add(m),()=>r.delete(m))},p=s=n(o,i,u);return u},cn=n=>n?tt(n):tt,dn=n=>n;function ln(n,s=dn){const r=C.useSyncExternalStore(n.subscribe,()=>s(n.getState()),()=>s(n.getInitialState()));return C.useDebugValue(r),r}const nt=n=>{const s=cn(n),r=o=>ln(s,o);return Object.assign(r,s),r},fn=n=>n?nt(n):nt,ve=fn((n,s)=>({rawTasks:[],transformedTasks:[],bottomRowCells:[],topHeaderGroups:[],selectedScale:"month",minDate:N(),maxDate:N(),draggingTaskMeta:null,setSelectedScale:r=>{const{rawTasks:o,bottomRowCells:i}=s(),e=Fe(o,i,r);n({selectedScale:r,transformedTasks:e})},setRawTasks:r=>{const{bottomRowCells:o,selectedScale:i}=s(),e=Fe(r,o,i);n({rawTasks:r,transformedTasks:e})},setBottomRowCells:r=>{const{rawTasks:o,selectedScale:i}=s(),e=Fe(o,r,i);n({bottomRowCells:r,transformedTasks:e})},setTopHeaderGroups:r=>n({topHeaderGroups:r}),setMinDate:r=>n({minDate:r}),setMaxDate:r=>n({maxDate:r}),setDraggingTaskMeta:r=>n({draggingTaskMeta:r}),clearDraggingTaskMeta:()=>n({draggingTaskMeta:null})})),pn=[{id:"1",name:"Project Kickoff",startDate:"2024-06-01T09:00:00Z",endDate:"2024-06-01T11:00:00Z",parentId:null,sequence:"1",dependencies:[]},{id:"2",name:"Requirement Gathering",startDate:"2024-06-02T09:00:00Z",endDate:"2024-06-05T17:00:00Z",parentId:null,sequence:"2",dependencies:[{targetId:"1",type:"FS"}]},{id:"3",name:"Stakeholder Interviews",startDate:"2024-06-02T10:00:00Z",endDate:"2024-06-03T17:00:00Z",parentId:"2",sequence:"2.1",dependencies:[{targetId:"1",type:"SF"}]},{id:"4",name:"Market Analysis",startDate:"2024-06-06T09:00:00Z",endDate:"2024-06-07T17:00:00Z",parentId:null,sequence:"3",dependencies:[{targetId:"2",type:"FS"}]},{id:"5",name:"Design System Creation",startDate:"2024-06-08T09:00:00Z",endDate:"2024-06-12T17:00:00Z",parentId:null,sequence:"4",dependencies:[{targetId:"2",type:"FS"},{targetId:"3",type:"SS"}]},{id:"6",name:"UI/UX Design",startDate:"2024-06-13T09:00:00Z",endDate:"2024-06-16T17:00:00Z",parentId:"5",sequence:"4.1",dependencies:[{targetId:"5",type:"FS"}]},{id:"7",name:"Prototyping",startDate:"2024-06-17T09:00:00Z",endDate:"2024-06-20T17:00:00Z",parentId:"6",sequence:"4.1.1",dependencies:[{targetId:"6",type:"FS"}]},{id:"8",name:"Frontend Development",startDate:"2024-06-21T09:00:00Z",endDate:"2024-06-30T17:00:00Z",parentId:null,sequence:"5",dependencies:[{targetId:"7",type:"FS"}]},{id:"9",name:"Backend Development",startDate:"2024-07-01T09:00:00Z",endDate:"2024-07-10T17:00:00Z",parentId:null,sequence:"6",dependencies:[{targetId:"7",type:"FS"}]},{id:"10",name:"API Integration",startDate:"2024-07-11T09:00:00Z",endDate:"2024-07-15T17:00:00Z",parentId:"9",sequence:"6.1",dependencies:[{targetId:"9",type:"FS"}]},{id:"11",name:"Module Development",startDate:"2024-07-16T09:00:00Z",endDate:"2024-07-20T17:00:00Z",parentId:"8",sequence:"5.1",dependencies:[{targetId:"8",type:"FS"}]},{id:"12",name:"Unit Testing",startDate:"2024-07-21T09:00:00Z",endDate:"2024-07-25T17:00:00Z",parentId:"8",sequence:"5.2",dependencies:[{targetId:"8",type:"FS"}]},{id:"13",name:"Integration Testing",startDate:"2024-07-26T09:00:00Z",endDate:"2024-07-30T17:00:00Z",parentId:"10",sequence:"6.1.1",dependencies:[{targetId:"10",type:"FS"}]},{id:"14",name:"Code Review",startDate:"2024-07-31T09:00:00Z",endDate:"2024-08-04T17:00:00Z",parentId:"10",sequence:"6.1.2",dependencies:[{targetId:"13",type:"FS"}]},{id:"15",name:"Community Feedback",startDate:"2024-08-05T09:00:00Z",endDate:"2024-08-08T17:00:00Z",parentId:null,sequence:"7",dependencies:[{targetId:"14",type:"FS"}]},{id:"16",name:"Documentation Drafting",startDate:"2024-08-09T09:00:00Z",endDate:"2024-08-12T17:00:00Z",parentId:null,sequence:"8",dependencies:[{targetId:"14",type:"FS"}]},{id:"17",name:"Documentation Finalization",startDate:"2024-08-13T09:00:00Z",endDate:"2024-08-16T17:00:00Z",parentId:"16",sequence:"8.1",dependencies:[{targetId:"16",type:"FS"}]},{id:"18",name:"Pre-release Demo",startDate:"2024-08-17T09:00:00Z",endDate:"2024-08-20T17:00:00Z",parentId:null,sequence:"9",dependencies:[{targetId:"15",type:"FS"}]},{id:"19",name:"Bug Fixing",startDate:"2024-08-21T09:00:00Z",endDate:"2024-08-25T17:00:00Z",parentId:null,sequence:"10",dependencies:[{targetId:"15",type:"FS"}]},{id:"20",name:"Release Candidate",startDate:"2024-08-26T09:00:00Z",endDate:"2024-08-30T17:00:00Z",parentId:null,sequence:"11",dependencies:[{targetId:"18",type:"FS"}]},{id:"21",name:"Final Release",startDate:"2024-08-31T09:00:00Z",endDate:"2024-09-02T17:00:00Z",parentId:null,sequence:"12",dependencies:[{targetId:"20",type:"FS"}]},{id:"22",name:"Post-release Monitoring",startDate:"2024-09-03T09:00:00Z",endDate:"2024-09-04T17:00:00Z",parentId:null,sequence:"13",dependencies:[{targetId:"21",type:"FS"}]},{id:"23",name:"Community Engagement",startDate:"2024-09-05T09:00:00Z",endDate:"2024-09-06T17:00:00Z",parentId:null,sequence:"14",dependencies:[{targetId:"21",type:"FS"}]},{id:"24",name:"Feature Iteration Planning",startDate:"2024-09-07T09:00:00Z",endDate:"2024-09-08T17:00:00Z",parentId:null,sequence:"15",dependencies:[{targetId:"22",type:"FS"}]},{id:"25",name:"Additional Module Development",startDate:"2024-09-09T09:00:00Z",endDate:"2024-09-10T17:00:00Z",parentId:"24",sequence:"15.1",dependencies:[{targetId:"24",type:"FS"}]},{id:"26",name:"Additional Testing",startDate:"2024-09-11T09:00:00Z",endDate:"2024-09-12T17:00:00Z",parentId:"25",sequence:"15.1.1",dependencies:[{targetId:"25",type:"FS"}]},{id:"27",name:"Code Refactoring",startDate:"2024-09-13T09:00:00Z",endDate:"2024-09-14T17:00:00Z",parentId:null,sequence:"16",dependencies:[{targetId:"26",type:"FS"}]},{id:"28",name:"Performance Optimization",startDate:"2024-09-15T09:00:00Z",endDate:"2024-09-16T17:00:00Z",parentId:"27",sequence:"16.1",dependencies:[{targetId:"27",type:"FS"}]},{id:"29",name:"Security Audit",startDate:"2024-09-17T09:00:00Z",endDate:"2024-09-18T17:00:00Z",parentId:null,sequence:"17",dependencies:[{targetId:"28",type:"FS"}]},{id:"30",name:"Final QA",startDate:"2024-09-19T09:00:00Z",endDate:"2024-09-20T17:00:00Z",parentId:null,sequence:"18",dependencies:[{targetId:"29",type:"FS"}]},{id:"31",name:"Launch Webinar",startDate:"2024-09-21T09:00:00Z",endDate:"2024-09-22T17:00:00Z",parentId:null,sequence:"19",dependencies:[{targetId:"21",type:"SS"}]},{id:"32",name:"Marketing Campaign",startDate:"2024-09-23T09:00:00Z",endDate:"2024-09-24T17:00:00Z",parentId:null,sequence:"20",dependencies:[{targetId:"21",type:"SF"}]},{id:"33",name:"Post-release Bug Fixing",startDate:"2024-09-25T09:00:00Z",endDate:"2024-09-26T17:00:00Z",parentId:null,sequence:"21",dependencies:[{targetId:"22",type:"SS"}]},{id:"34",name:"Version 1.1 Planning",startDate:"2024-09-27T09:00:00Z",endDate:"2024-09-28T17:00:00Z",parentId:null,sequence:"22",dependencies:[{targetId:"24",type:"FS"}]},{id:"35",name:"Feature Implementation",startDate:"2024-09-29T09:00:00Z",endDate:"2024-09-30T17:00:00Z",parentId:"34",sequence:"22.1",dependencies:[{targetId:"34",type:"FS"}]},{id:"36",name:"Beta Testing",startDate:"2024-10-01T09:00:00Z",endDate:"2024-10-02T17:00:00Z",parentId:"35",sequence:"22.1.1",dependencies:[{targetId:"35",type:"FS"}]},{id:"37",name:"Community Beta Feedback",startDate:"2024-10-03T09:00:00Z",endDate:"2024-10-04T17:00:00Z",parentId:"36",sequence:"22.1.2",dependencies:[{targetId:"36",type:"FS"}]},{id:"38",name:"Final Beta Fixes",startDate:"2024-10-05T09:00:00Z",endDate:"2024-10-06T17:00:00Z",parentId:"37",sequence:"22.1.3",dependencies:[{targetId:"37",type:"FS"}]},{id:"39",name:"Documentation Update",startDate:"2024-10-07T09:00:00Z",endDate:"2024-10-08T17:00:00Z",parentId:"17",sequence:"8.1.1",dependencies:[{targetId:"17",type:"FS"}]},{id:"40",name:"Final Release Version 1.1",startDate:"2024-10-09T09:00:00Z",endDate:"2024-10-10T17:00:00Z",parentId:null,sequence:"23",dependencies:[{targetId:"38",type:"FS"}]},{id:"41",name:"Project Retrospective",startDate:"2024-10-11T09:00:00Z",endDate:"2024-10-12T17:00:00Z",parentId:null,sequence:"24",dependencies:[{targetId:"40",type:"FS"}]}],rt=n=>Ae.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...n},Ae.createElement("path",{d:"M10.2 4L10.2 20L7.8 20L7.8 4L10.2 4ZM15 4L15 20L12.6 20L12.6 4L15 4ZM5.4 15.0999L5.4 7.8999L1.8 11.4999L5.4 15.0999ZM17.4 7.8999L17.4 15.0999L21 11.4999L17.4 7.8999Z"}));function he(n,s){const{basePxPerDragStep:r}=K[s];return Math.round(n/r)}function hn(n,s,r){const{rawTasks:o,selectedScale:i,setRawTasks:e,setDraggingTaskMeta:l,clearDraggingTaskMeta:u}=ve(),[p,m]=C.useState(s),g=C.useRef(s),a=C.useRef(null),c=C.useRef(s),y=C.useRef(n.startDate),h=C.useRef(n.endDate),f=j=>{a.current=j.clientX,c.current=s,y.current=n.startDate,h.current=n.endDate,m(s),g.current=s,l({taskId:n.id,type:"bar"}),document.addEventListener("mousemove",S),document.addEventListener("mouseup",k)},S=j=>{if(a.current===null)return;const M=j.clientX-a.current,L=he(M,i)*K[i].basePxPerDragStep,E=c.current+L;m(E),g.current=E},k=()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",k);const j=g.current-c.current,M=he(j,i),{dragStepUnit:Z,dragStepAmount:L}=K[i],E=o.map(_=>_.id===n.id?{..._,startDate:N(y.current).add(M*L,Z).toISOString(),endDate:N(h.current).add(M*L,Z).toISOString()}:_);e(E),r==null||r(E),u(),a.current=null};return{onDragStart:f,tempLeft:p}}function mn(n,s,r,o){const{rawTasks:i,selectedScale:e,setRawTasks:l,setDraggingTaskMeta:u,clearDraggingTaskMeta:p}=ve(),[m,g]=C.useState(s),[a,c]=C.useState(r),y=C.useRef(s),h=C.useRef(r),f=C.useRef(null),S=C.useRef(s),k=C.useRef(r),j=C.useRef(n.startDate),M=E=>{E.stopPropagation(),f.current=E.clientX,S.current=s,k.current=r,j.current=n.startDate,g(s),c(r),y.current=s,h.current=r,u({taskId:n.id,type:"left"}),document.addEventListener("mousemove",Z),document.addEventListener("mouseup",L)},Z=E=>{if(f.current==null)return;const _=E.clientX-f.current,$=he(_,e)*K[e].basePxPerDragStep,d=S.current+$,I=k.current-$;I<1||(g(d),c(I),y.current=d,h.current=I)},L=()=>{document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",L);const E=y.current-S.current,_=he(E,e),{dragStepUnit:H,dragStepAmount:$}=K[e],d=i.map(I=>{if(I.id!==n.id)return I;const G=N(j.current).add(_*$,H);return G.isAfter(N(I.endDate))?I:{...I,startDate:G.toISOString()}});l(d),o==null||o(d),p(),f.current=null};return{onDragStart:M,tempLeft:m,tempWidth:a}}function $n(n,s,r){const{rawTasks:o,selectedScale:i,setRawTasks:e,setDraggingTaskMeta:l,clearDraggingTaskMeta:u}=ve(),[p,m]=C.useState(s),g=C.useRef(s),a=C.useRef(null),c=C.useRef(s),y=C.useRef(n.endDate),h=k=>{k.stopPropagation(),a.current=k.clientX,c.current=s,y.current=n.endDate,m(s),g.current=s,l({taskId:n.id,type:"right"}),document.addEventListener("mousemove",f),document.addEventListener("mouseup",S)},f=k=>{if(a.current===null)return;const j=k.clientX-a.current,Z=he(j,i)*K[i].basePxPerDragStep,L=c.current+Z;L<1||(m(L),g.current=L)},S=()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",S);const k=g.current-c.current,j=he(k,i),{dragStepUnit:M,dragStepAmount:Z}=K[i],L=o.map(E=>{if(E.id!==n.id)return E;const _=N(y.current).add(j*Z,M);return _.isBefore(N(E.startDate))?E:{...E,endDate:_.toISOString()}});e(L),r==null||r(L),u(),a.current=null};return{onDragStart:h,tempWidth:p}}function gn(n,s,r,o,i){if(r<0||i<0)return`M ${s} ${r} h ${(o-s)/2}`;const e=7,l=11,u=25,p=20,m=`M ${s} ${r}`,g=o-s,a=i-r,c=Math.abs(g),y=Math.abs(a),h=i<=r,f=i>=r,S=o>=s,k=o<=s,j=c>p,M=Math.abs(g/2),Z=Math.abs(a/2);function L(){function $(){return(S||k)&&f&&!j?"downSmallHorizontal":(S||k)&&h&&!j?"upSmallHorizontal":f&&k?"downLeft":f&&S?"downRight":h&&k?"upLeft":h&&S?"upRight":""}let d=m;switch($()){case"downRight":{d+=` h ${M-e}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${a-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${M-e}`;break}case"upRight":{d+=` h ${M-e}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v -${y-e*2}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${M-e}`;break}case"downLeft":case"downSmallHorizontal":{const G=r+a/2;d+=` h ${l}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${G-r-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=` h ${g-2*l}`,d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${G-r-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${l}`;break}case"upLeft":case"upSmallHorizontal":{const G=r+a/2;d+=` h ${l}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v -${r-G-e*2}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=` h ${g-2*l}`,d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v -${r-G-e*2}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${l}`;break}default:return d}return d}function E(){let $=m;return f&&k?($+=` h ${u-l}`,$+=` a ${e} ${e} 0 0 1 ${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 1 -${e} ${e}`,$+=` h ${g-e*2}`):f&&S?($+=` h ${g+u-l}`,$+=` a ${e} ${e} 0 0 1 ${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 1 -${e} ${e}`,$+=` h -${u-l}`):h&&k?($+=` h ${u-l}`,$+=` a ${e} ${e} 0 0 0 ${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 0 -${e} -${e}`,$+=` h ${g-u+l}`):h&&S&&($+=` h ${g+u-l}`,$+=` a ${e} ${e} 0 0 0 ${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 0 -${e} -${e}`,$+=` h -${u-l}`),$}function _(){function $(){return(S||k)&&f&&!j?"downSmallHorizontal":(S||k)&&h&&!j?"upSmallHorizontal":f&&k?"downLeft":f&&S?"downRight":h&&k?"upLeft":h&&S?"upRight":""}let d=m;switch($()){case"downRight":case"downSmallHorizontal":{d+=" h -11",d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${Z-e*2}`,d+=` a ${e} ${e} 0 0 0 ${e} ${e}`,d+=` h ${l*2+g}`,d+=` a ${e} ${e} 0 0 1 ${e} ${e}`,d+=` v ${Z-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=" h -11";break}case"upRight":case"upSmallHorizontal":{d+=" h -11",d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v ${-(Z-e*2)}`,d+=` a ${e} ${e} 0 0 1 ${e} -${e}`,d+=` h ${l*2+g}`,d+=` a ${e} ${e} 0 0 0 ${e} -${e}`,d+=` v ${-(Z-e*2)}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=" h -11";break}case"downLeft":{d+=` h ${-M+e}`,d+=` a ${e} ${e} 0 0 0 -${e} ${e}`,d+=` v ${y-e*2}`,d+=` a ${e} ${e} 0 0 1 -${e} ${e}`,d+=` h ${-M+e}`;break}case"upLeft":{d+=` h ${-(M-e)}`,d+=` a ${e} ${e} 0 0 1 -${e} -${e}`,d+=` v ${-(y-e*2)}`,d+=` a ${e} ${e} 0 0 0 -${e} -${e}`,d+=` h ${-M+e}`;break}default:return d}return d}function H(){let $=m;return f&&k?($+=` h ${g-u}`,$+=` a ${e} ${e} 0 0 0 -${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 0 ${e} ${e}`,$+=` h ${u}`):f&&S?($+=" h -25",$+=` a ${e} ${e} 0 0 0 -${e} ${e}`,$+=` v ${a-e*2}`,$+=` a ${e} ${e} 0 0 0 ${e} ${e}`,$+=` h ${g+u}`):h&&k?($+=` h ${g-u}`,$+=` a ${e} ${e} 0 0 1 -${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 1 ${e} -${e}`,$+=` h ${u}`):h&&S&&($+=" h -25",$+=` a ${e} ${e} 0 0 1 -${e} -${e}`,$+=` v ${a+e*2}`,$+=` a ${e} ${e} 0 0 1 ${e} -${e}`,$+=` h ${g+u}`),$}switch(n){case"FS":return L();case"FF":return E();case"SF":return _();case"SS":return H();default:return`${m} L ${o} ${i}`}}function vn({allTasks:n,currentTask:s,onTasksChange:r}){const[o,i]=C.useState(!1),[e,l]=C.useState(!1),{onDragStart:u,tempLeft:p}=hn(s,s.barLeft,r),{onDragStart:m,tempLeft:g,tempWidth:a}=mn(s,s.barLeft,s.barWidth,r),{onDragStart:c,tempWidth:y}=$n(s,s.barWidth,r),{draggingTaskMeta:h}=ve(),f=(h==null?void 0:h.taskId)===s.id;let S=!1,k=!1,j=!1;f&&((h==null?void 0:h.type)==="left"?S=!0:(h==null?void 0:h.type)==="right"?k=!0:(h==null?void 0:h.type)==="bar"&&(j=!0));let M=s.barLeft,Z=s.barWidth;S?(M=g,Z=a):k?Z=y:j&&(M=p);const L=()=>q.jsx("button",{type:"button",onMouseDown:m,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{position:"absolute",top:0,left:"-1.15rem",width:"2rem",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"w-resize",background:"transparent",border:"none",padding:0},children:q.jsx(rt,{style:{height:"1.5rem",width:"1.5rem",fill:"#919294",opacity:o?1:0}})}),E=()=>q.jsx("button",{type:"button",onMouseDown:c,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{position:"absolute",top:0,right:"-1.15rem",width:"2rem",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"w-resize",background:"transparent",border:"none",padding:0},children:q.jsx(rt,{style:{height:"1.5rem",width:"1.5rem",fill:"#919294",opacity:e?1:0}})}),_=(s.dependencies||[]).map(H=>{const $=n.find(D=>D.id===H.targetId);if(!$)return null;const d=at,I=($.order-1)*d+d/2,G=(s.order-1)*d+d/2;let ee,O;switch(H.type){case"FS":ee=$.barLeft+$.barWidth,O=s.barLeft;break;case"SS":ee=$.barLeft,O=s.barLeft;break;case"FF":ee=$.barLeft+$.barWidth,O=s.barLeft+s.barWidth;break;case"SF":ee=$.barLeft,O=s.barLeft+s.barWidth;break;default:return console.warn(`Unknown dependency type: ${H.type}`),null}return{...H,fromX:ee,fromY:I,toX:O,toY:G}}).filter(Boolean);return q.jsxs(q.Fragment,{children:[q.jsxs("div",{role:"button",tabIndex:0,onMouseDown:u,style:{position:"relative",display:"flex",alignItems:"center",backgroundColor:"#D6D6D8",marginLeft:`${M}px`,width:`${Z}px`,height:"1rem"},children:[L(),E()]}),q.jsxs("svg",{style:{position:"absolute",top:0,left:0,zIndex:10,width:"100%",height:"100%",pointerEvents:"none"},children:[q.jsx("defs",{children:q.jsx("marker",{id:"arrowhead",markerWidth:"6",markerHeight:"6",refX:"5.25",refY:"3",orient:"auto",children:q.jsx("polygon",{points:"0 0, 6 3, 0 6",fill:"#000"})})}),_.map((H,$)=>q.jsx("path",{d:gn(H.type,H.fromX,H.fromY,H.toX,H.toY),fill:"none",markerEnd:"url(#arrowhead)",style:{stroke:"#000",strokeWidth:.75}},$))]})]})}function yn({tasks:n,onTasksChange:s,ganttHeight:r,columnWidth:o}){const[i,e]=C.useState(r||500),[l,u]=C.useState(o||1e3),[p,m]=C.useState(n||[]),g=C.useRef(null),{rawTasks:a,transformedTasks:c,selectedScale:y,setSelectedScale:h,bottomRowCells:f,topHeaderGroups:S,setRawTasks:k,setBottomRowCells:j,setTopHeaderGroups:M,setMinDate:Z,setMaxDate:L}=ve();return C.useEffect(()=>{n.length===0?m(pn):m(n)},[n]),C.useEffect(()=>{if(!p.length)return;const E=Object.fromEntries(p.map(_=>[_.id,{startDate:_.startDate,endDate:_.endDate}]));vt(E,y,Z,L,j,M)},[p,y]),C.useEffect(()=>{!f.length||!p.length||a.length===0&&k(p)},[f,p]),q.jsx("section",{style:{position:"relative",overflow:"auto",height:`${i}px`,width:`${l}px`,backgroundColor:"#FFF",fontFamily:"Noto Sans, sans-serif"},children:q.jsx("div",{style:{width:"100%",height:"100%",overflow:"hidden",backgroundColor:"#FFF"},children:q.jsxs("section",{style:{position:"relative",display:"flex",height:"100%",width:"100%",flexDirection:"column"},children:[q.jsx("div",{style:{position:"absolute",top:"3px",right:"16px",zIndex:50,display:"flex",justifyContent:"flex-end",alignItems:"center"},children:q.jsx("select",{style:{padding:"4px 8px",fontSize:"0.875rem",borderRadius:"6px",border:"1px solid #E6E7E9"},value:y,onChange:E=>{const _=E.target.value;h(_)},children:Object.keys(K).map(E=>q.jsx("option",{value:E,children:K[E].labelUnit},E))})}),q.jsx("div",{ref:g,style:{flexGrow:1,overflowX:"auto"},children:q.jsxs("div",{style:{display:"flex",minWidth:"max-content",flexDirection:"column"},children:[q.jsx(yt,{topHeaderGroups:S,bottomRowCells:f,selectedScale:y,scrollRef:g}),q.jsx("div",{style:{position:"relative",display:"flex"},children:q.jsx("div",{style:{display:"flex",flexGrow:1,flexDirection:"column"},children:c.map(E=>q.jsx("div",{style:{display:"flex",width:"100%",alignItems:"center",borderBottom:"1px solid #E6E7E9",height:`${at}px`,backgroundColor:"#FFF"},children:q.jsx(vn,{allTasks:c,currentTask:E,onTasksChange:s})},E.id))})})]})})]})})})}exports.ReactGanttChart=yn;
package/dist/index.es.js CHANGED
@@ -1838,8 +1838,7 @@ function bn({ tasks: n, onTasksChange: o, ganttHeight: a, columnWidth: i }) {
1838
1838
  position: "relative",
1839
1839
  overflow: "auto",
1840
1840
  height: `${s}px`,
1841
- width: "100%",
1842
- // let parent control width
1841
+ width: `${l}px`,
1843
1842
  backgroundColor: "#FFF",
1844
1843
  fontFamily: "Noto Sans, sans-serif"
1845
1844
  },
@@ -1867,8 +1866,8 @@ function bn({ tasks: n, onTasksChange: o, ganttHeight: a, columnWidth: i }) {
1867
1866
  "div",
1868
1867
  {
1869
1868
  style: {
1870
- position: "fixed",
1871
- top: "10px",
1869
+ position: "absolute",
1870
+ top: "3px",
1872
1871
  right: "16px",
1873
1872
  zIndex: 50,
1874
1873
  display: "flex",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaeungkim/gantt-chart",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",