@progress/kendo-react-gantt 7.0.0-develop.8 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,7 @@ export interface GanttTreeListProps extends TreeListProps {
19
19
  dataItemKey: string;
20
20
  navigatable?: boolean;
21
21
  idPrefix: string;
22
+ treelistId: string;
22
23
  }
23
24
  /**
24
25
  * @hidden
@@ -70,6 +71,7 @@ export declare class GanttTreeList extends React.Component<GanttTreeListProps, {
70
71
  afterContent: PropTypes.Requireable<any>;
71
72
  navigatable: PropTypes.Requireable<boolean>;
72
73
  idPrefix: PropTypes.Requireable<string>;
74
+ treelistId: PropTypes.Requireable<string>;
73
75
  };
74
76
  /** @hidden */
75
77
  static contextType: React.Context<TableKeyboardNavigationContextType | undefined>;
@@ -85,7 +87,6 @@ export declare class GanttTreeList extends React.Component<GanttTreeListProps, {
85
87
  private columnResize;
86
88
  private element;
87
89
  protected dragLogic: CommonDragLogic<GanttCellProps, GanttHeaderCellProps, GanttFilterCellProps>;
88
- private _treeListId;
89
90
  private get document();
90
91
  private contextStateRef;
91
92
  private navigationStateRef;
@@ -2,4 +2,4 @@
2
2
  * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the package root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- (function(D,De){typeof exports=="object"&&typeof module<"u"?De(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-date-math"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-treelist"),require("@progress/kendo-react-intl"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("react-dom"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dateinputs")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-data-tools","@progress/kendo-react-treelist","@progress/kendo-react-intl","@progress/kendo-svg-icons","@progress/kendo-react-buttons","react-dom","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-dateinputs"],De):(D=typeof globalThis<"u"?globalThis:D||self,De(D.KendoReactGantt={},D.React,D.PropTypes,D.KendoReactCommon,D.KendoDateMath,D.KendoReactDataTools,D.KendoReactTreelist,D.KendoReactIntl,D.KendoSvgIcons,D.KendoReactButtons,D.ReactDOM,D.KendoReactForm,D.KendoReactDialogs,D.KendoReactLabels,D.KendoReactInputs,D.KendoReactDateinputs))})(this,function(D,De,na,h,E,b,ie,B,Xe,ne,aa,oe,Me,se,At,ra){"use strict";function Je(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return a.default=e,Object.freeze(a)}const t=Je(De),i=Je(na),Vt=Je(aa),oa=b.TABLE_ROW_INDEX_ATTRIBUTE,sa=b.TABLE_COL_INDEX_ATTRIBUTE,la=b.TABLE_PREVENT_SELECTION_ELEMENT,Ot=new Date().getTime(),Gt=7,ia="hh:mm a",Qe={skeleton:"MEd"},ca="MMM",da="yyyy",be=100,ua=6,Ae="data-dependency-drag-handle",ga="start",fa="finish",Wt={[Ae]:ga},Pt={[Ae]:fa},Ve="data-task-id",_t={id:"id",start:"start",end:"end",title:"title",percentComplete:"percentComplete",isRollup:"isRollup",isExpanded:"isExpanded",isInEdit:"isInEdit",children:"children",isSelected:"isSelected"},Kt={id:"id",fromId:"fromId",toId:"toId",type:"type"},ha=b.orderBy,ma=b.filterBy,Oe=h.mapTree,pa=h.extendDataItem,Ca=ie.createDataTree,Ea=e=>({fields:{..._t,...e}}),wa=e=>({fields:{...Kt,...e}}),Bt=e=>E.getDate(e),et=(e,a)=>E.getDate(E.addDays(e,a||1)),ya=(e,a,n,r)=>n<a&&e<=r;function le(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const ae=4,tt=10,va=(e,a,n,r)=>{const s=[];let l=0,o=0;const c=tt,g=Math.floor(n/2),f=e.top<a.top,d=()=>s.push({left:o,top:l});if(r===0||r===3){const u=r===3?"start":"end";l=e.top,o=e[u],d(),o=Math[u==="start"?"min":"max"](e[u],a[u]),o=u==="start"?o-c:o+c,d(),l=a.top,d(),o=u==="start"?a[u]-ae:a[u]+ae,d(),Ut(l,o,s,u!=="start")}else{const u=r===2?"start":"end",m=r===2?"end":"start",C=r===2?e[u]-tt*2>=a[m]:e[u]+tt*2<=a[m];l=e.top,o=e[u],d(),o=u==="start"?o-c:o+c,d(),C||(l=f?l+g:l-g,d(),o=u==="start"?a[m]+c:a[m]-c,d()),l=a.top,d(),o=m==="start"?a[m]-ae:a[m]+ae,d(),Ut(l,o,s,m!=="start")}return s},Ut=(e,a,n,r)=>r?Da(e,a,n):ba(e,a,n),Da=(e,a,n)=>{n.push({top:e-ae/2,left:a}),n.push({top:e,left:a-ae+1}),n.push({top:e+ae/2,left:a}),n.push({top:e,left:a})},ba=(e,a,n)=>{n.push({top:e+ae/2,left:a}),n.push({top:e,left:a+ae-1}),n.push({top:e-ae/2,left:a}),n.push({top:e,left:a})},qt=e=>{if(e.workWeekStart===void 0||e.workWeekEnd===void 0)return[];const a=[];let n=e.workWeekStart;for(a.push(n);e.workWeekEnd!==n;)n>6?n-=7:n++,a.push(n);return a},Ta=(e,a)=>{const n=e.getDay();return a.indexOf(n)>-1},$t=(e,{step:a,timezone:n})=>{const r=[],s=E.ZonedDate.fromLocalDate(e.start,n),l=E.ZonedDate.fromLocalDate(e.end,n);let o=s.clone();for(;o.getTime()<l.getTime();){const c=o.clone(),g=c.clone().addTime(a),f=new Date(c.getTime()),u={end:new Date(g.getTime()),start:f,zonedStart:c,zonedEnd:g};r.push(u),o=o.addTime(a)}return r},Sa=(e,{timezone:a},n)=>{const r=[],s=E.ZonedDate.fromLocalDate(e.start,a),l=E.ZonedDate.fromLocalDate(e.end,a);for(let o=s.clone(),c=0;o.getTime()<l.getTime();c++){const g=o.clone(),f=et(E.firstDayInWeek(E.getDate(g),n.firstDay()),Gt),d=E.ZonedDate.fromUTCDate(le(f),a),u=d.getTime()>l.getTime()?l.clone():d;o=u.clone();const m=new Date(g.getTime()),w={end:new Date(u.getTime()),start:m,zonedStart:g,zonedEnd:u};r.push(w)}return r},ka=(e,{timezone:a})=>{const n=[],r=E.ZonedDate.fromLocalDate(e.start,a),s=E.ZonedDate.fromLocalDate(e.end,a);for(let l=r.clone(),o=0;l.getTime()<s.getTime();o++){const c=l.clone(),g=E.ZonedDate.fromLocalDate(E.addMonths(new Date(c.getTime()),1),a);l=g.clone();const f=new Date(c.getTime()),u={end:new Date(g.getTime()),start:f,zonedStart:c,zonedEnd:g};n.push(u)}return n},Ia=(e,{timezone:a})=>{const n=[],r=E.ZonedDate.fromLocalDate(e.start,a),s=E.ZonedDate.fromLocalDate(e.end,a);for(let l=r.clone(),o=0;l.getTime()<s.getTime();o++){const c=l.clone(),g=E.ZonedDate.fromLocalDate(E.addMonths(new Date(c.getTime()),12),a);l=g.clone();const f=new Date(c.getTime()),u={end:new Date(g.getTime()),start:f,zonedStart:c,zonedEnd:g};n.push(u)}return n},xa=(e,a,n)=>{const r=n.parseDate(a.workDayStart).getHours(),s=n.parseDate(a.workDayEnd).getHours();return $t(e,{step:E.MS_PER_MINUTE*a.slotDuration,timezone:a.timezone}).map(o=>{const c=o.zonedStart.getHours();return{range:o,isWork:c>=r&&c<s,span:1,text:n.formatDate(o.zonedStart,ia),type:"time"}})},Yt=(e,a,n)=>$t(e,{step:E.MS_PER_DAY,timezone:a.timezone}).map(s=>({range:s,isWork:Ta(s.start,a.workDays),span:1,text:n.formatDate(s.zonedStart,Qe),type:"day"})),Zt=(e,a,n)=>Sa(e,{timezone:a.timezone},n).map(s=>{const l=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/E.MS_PER_DAY);return{range:s,isWork:!1,span:l,text:`${n.formatDate(s.zonedStart,Qe)} - ${n.formatDate(s.zonedEnd,Qe)}`,type:"week"}}),jt=(e,a,n)=>ka(e,{timezone:a.timezone}).map(s=>{const l=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/E.MS_PER_DAY);return{range:s,isWork:!1,span:l,text:n.formatDate(s.zonedStart,ca),type:"month"}}),Ra=(e,a,n)=>Ia(e,{timezone:a.timezone}).map(s=>{const l=Math.round((s.zonedEnd.getTime()-s.zonedStart.getTime())/E.MS_PER_DAY);return{range:s,isWork:!1,span:l,text:n.formatDate(s.zonedStart,da),type:"year"}}),Na=(e,a,n)=>{const r=n;return t.createElement("table",{className:"k-table k-table-md",ref:a,"aria-hidden":!0},t.createElement("tbody",{className:"k-table-tbody"},e.map((s,l)=>t.createElement("tr",{className:"k-table-row",key:l},s.map((o,c)=>t.createElement("td",{key:o.range.start.getTime(),colSpan:o.span,className:h.classNames("k-table-th",{"k-header":!0,"k-nonwork-hour":!o.isWork})},r?t.createElement(r,{rowIndex:l,index:c,range:o.range,text:o.text,isWork:o.isWork,type:o.type}):o.text))))))},Fa=(e,a)=>{const n=e[e.length-1];return t.createElement("table",{className:"k-table k-table-md k-gantt-columns",ref:a,"aria-hidden":!0},t.createElement("tbody",{className:"k-table-tbody"},t.createElement("tr",{className:"k-table-row"},n.map(r=>t.createElement("td",{key:r.range.start.getTime(),colSpan:r.span,className:h.classNames("k-table-td",{"k-nonwork-hour":!r.isWork})})))))},La=(e,a)=>{const n=e[e.length-1];let r=0,s=0;return n.forEach(l=>{const o=l.span;s+=o,o>r&&(r=o)}),Math.round(s*a/r)},nt=(e,a)=>!!h.getter(a)(e),Xt=(e,a)=>!!h.getter(a)(e),za=(e,a)=>n=>nt(n,e)&&Xt(n,a)?[...h.getter(a)(n)]:[],at=t.createContext([]),Ha=()=>t.useContext(at);at.displayName="KendoReactGanttTaskDataContext";const rt=t.createContext([]),Ma=()=>t.useContext(rt);rt.displayName="KendoReactGanttDependencyDataContext";const ot=t.createContext(_t),st=()=>t.useContext(ot);ot.displayName="KendoReactGanttTaskModelFieldsContext";const lt=t.createContext(Kt),Jt=()=>t.useContext(lt);lt.displayName="KendoReactGanttDependencyModelFieldsContext";const it=t.createContext({}),Te=()=>t.useContext(it);it.displayName="KendoReactGanttPropsContext";const ct=t.createContext({start:new Date,end:new Date,zonedStart:E.ZonedDate.fromLocalDate(new Date),zonedEnd:E.ZonedDate.fromLocalDate(new Date)}),Se=()=>t.useContext(ct);ct.displayName="KendoReactGanttDateRangeContext";const dt=t.createContext([]),Aa=()=>t.useContext(dt);dt.displayName="KendoReactGanttViewsContext";const ut=t.createContext(["week",h.noop]),Qt=()=>t.useContext(ut);ut.displayName="KendoReactGanttActiveViewContext";const gt=t.createContext(0),en=()=>t.useContext(gt);gt.displayName="KendoReactGanttRowHeightContext";const ft=t.createContext(0),Va=()=>t.useContext(ft);ft.displayName="KendoReactGanttToolbarHeightContext";const ht=t.createContext({onDataStateChange:h.noop,onSortChange:h.noop,onFilterChange:h.noop,onColumnMenuFilterChange:h.noop,onExpandChange:h.noop,onRowClick:h.noop,onRowDoubleClick:h.noop,onRowContextMenu:h.noop,onColumnResize:h.noop,onColumnReorder:h.noop,onDependencyCreate:h.noop,onKeyDown:h.noop,onSelectionChange:h.noop,onHeaderSelectionChange:h.noop}),Oa=()=>t.useContext(ht);ht.displayName="KendoReactGanttEventsContext";const mt=t.createContext({onTaskClick:h.noop,onTaskDoubleClick:h.noop,onTaskContextMenu:h.noop}),Ga=()=>t.useContext(mt);mt.displayName="KendoReactGanttTaskEventsContext";const tn=({children:e,taskData:a,dependencyData:n,taskModelFields:r,dependencyModelFields:s,props:l,dateRange:o,views:c,activeView:g,rowHeight:f,toolbarHeight:d,events:u,taskEvents:m})=>t.createElement(it.Provider,{value:l},t.createElement(at.Provider,{value:a},t.createElement(rt.Provider,{value:n},t.createElement(ot.Provider,{value:r},t.createElement(lt.Provider,{value:s},t.createElement(ct.Provider,{value:o},t.createElement(dt.Provider,{value:c},t.createElement(ut.Provider,{value:g},t.createElement(gt.Provider,{value:f},t.createElement(ft.Provider,{value:d},t.createElement(ht.Provider,{value:u},t.createElement(mt.Provider,{value:m},e))))))))))));tn.displayName="KendoReactGanttContext";const pt=t.createContext([{current:{}},h.noop]),nn=()=>t.useContext(pt);pt.displayName="KendoReactGanttViewContext";const Ct=t.createContext(0),Wa=()=>t.useContext(Ct);Ct.displayName="KendoReactGanttViewTimelineWidthContext";const Et=t.createContext({onDependencyHandlePress:h.noop,onDependencyHandleDrag:h.noop,onDependencyHandleRelease:h.noop,isEnabled:!1,draggedId:null}),Pa=()=>t.useContext(Et);Et.displayName="KendoReactGanttViewDependencyDragContext";const an=({children:e,tasksStore:a,timelineWidth:n,dependencyDrag:r})=>t.createElement(pt.Provider,{value:a},t.createElement(Ct.Provider,{value:n},t.createElement(Et.Provider,{value:r},e)));an.displayName="KendoReactGanttViewContext";var wt=(e=>(e[e.add=0]="add",e[e.remove=1]="remove",e))(wt||{});const _a=()=>{const e=t.useRef({}),a=t.useCallback(n=>{switch(n.type){case 0:e.current[n.id]=n.itemRef;break;case 1:delete e.current[n.id];break}},[]);return[e,a]},Ka=(e,a,n,r)=>{const s=t.useRef(null),[,l]=nn();t.useImperativeHandle(s,()=>({element:r.current,dataItem:e})),t.useImperativeHandle(n,()=>s.current),t.useLayoutEffect(()=>{const o=s.current;if(o)return l({type:wt.add,itemRef:o,id:a}),()=>{l({type:wt.remove,itemRef:o,id:a})}})},rn=t.forwardRef((e,a)=>{const n=Se(),r=st(),s=Wa(),l=Pa(),o=Ga(),c=t.useRef(null),g=t.useRef(null);Ka(e.dataItem,h.getter(r.id)(e.dataItem),a,c);const f=t.useRef(null),d=h.getter(r.id)(e.dataItem),u=h.getter(r.start)(e.dataItem),m=h.getter(r.end)(e.dataItem),C=h.getter(r.title)(e.dataItem),w=h.getter(r.percentComplete)(e.dataItem),p=h.getter(r.children)(e.dataItem),k=h.getter(r.isSelected)(e.dataItem),H=u&&u.getTime(),V=m&&m.getTime(),z=p&&p.length,N=!z&&H===V,O=H&&V&&ya(n.start,n.end,u,m),[ee,R]=t.useState(!1),X=t.useRef(null),A=t.useRef(null);h.useDraggable(X,{onPress:l.onDependencyHandlePress,onDrag:l.onDependencyHandleDrag,onRelease:l.onDependencyHandleRelease}),h.useDraggable(A,{onPress:l.onDependencyHandlePress,onDrag:l.onDependencyHandleDrag,onRelease:l.onDependencyHandleRelease});const J=t.useCallback(T=>{o.onTaskClick&&o.onTaskClick({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),G=t.useCallback(T=>{o.onTaskDoubleClick&&o.onTaskDoubleClick({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),q=t.useCallback(T=>{o.onTaskContextMenu&&o.onTaskContextMenu({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),v=t.useCallback(T=>{o.onTaskRemoveClick&&o.onTaskRemoveClick({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),M=t.useCallback(()=>{const T=n.start,Q=n.end,I=f.current,L=c.current,U=g.current;if(!O||I===null||L===null)return;const Z=I.clientWidth/(Q.getTime()-T.getTime()),W=(u.getTime()-T.getTime())*Z,P=(m.getTime()-u.getTime())*Z,me=(I.offsetHeight-L.offsetHeight)/2;L.style.left=`${Math.round(N?W-ua:W)}px`,L.style.top=`${Math.round(me)}px`,N||(L.style.width=`${Math.round(P)}px`,U!==null&&(U.style.width=`${Math.round(P*(w||0))}px`)),R(!0)},[n.start.getTime(),n.end.getTime(),H,V,O,w,s]);t.useEffect(M,[M]);const te={visibility:ee?void 0:"hidden",display:O?void 0:"none"},K={userSelect:"none",display:l.draggedId===String(d)?"block":void 0};return t.createElement("td",{ref:f,key:d,role:"presentation"},N?t.createElement("div",{"aria-hidden":!0,className:h.classNames({"k-task":!0,"k-task-milestone":!0,"k-selected":k&&!Array.isArray(k)}),style:te,ref:c,[Ve]:d,onClick:J,onDoubleClick:G,onContextMenu:q},t.createElement("div",{className:"k-task-milestone-content"}),l.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-start",ref:X,style:K,...Wt}),l.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-end",ref:A,style:K,...Pt})):t.createElement("div",{"aria-hidden":!0,className:h.classNames({"k-task":!0,"k-task-summary":z,"k-task-single":!z,"k-selected":k&&!Array.isArray(k)}),ref:c,style:te,[Ve]:d,onClick:J,onDoubleClick:G,onContextMenu:q},z?t.createElement("div",{className:"k-task-summary-progress",ref:g},t.createElement("div",{className:"k-task-summary-complete"})):t.createElement("div",{className:"k-task-complete",ref:g}),!z&&t.createElement(t.Fragment,null,t.createElement("div",{className:"k-task-content"},C),o.onTaskRemoveClick?t.createElement("span",{className:"k-task-actions"},t.createElement("span",{onClick:v,className:"k-link k-task-delete","aria-label":"Delete"},t.createElement(h.IconWrap,{name:"x",icon:Xe.xIcon}))):null),l.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-start",ref:X,style:K,...Wt}),l.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-end",ref:A,style:K,...Pt})))});rn.displayName="KendoReactGanttTask";const on=e=>{const{dependency:a}=e,[n]=nn(),r=t.useRef(null),s=Jt(),l=en(),[o,c]=t.useState(!1),g=()=>{if(r.current===null||n.current===null){c(!1);return}const f=n.current[h.getter(s.fromId)(a)],d=n.current[h.getter(s.toId)(a)];if(!f||!d){c(!1);return}const u=f.element,m=d.element;if(!u||!m){c(!1);return}if(o===!1){c(!0);return}const C={top:u.offsetTop+u.offsetHeight/2,start:u.offsetLeft,end:u.offsetLeft+u.offsetWidth},w={top:m.offsetTop+m.offsetHeight/2,start:m.offsetLeft,end:m.offsetLeft+m.offsetWidth},p=h.getter(s.type)(a),k=va(C,w,l,p);k&&k.length&&r.current.setAttribute("points",k.map(H=>`${H.left},${H.top}`).join(" "))};return t.useEffect(g),t.createElement("polyline",{ref:r,style:{display:o?void 0:"none"}})};on.displayName="KendoReactGanttDependency";class yt extends t.Component{constructor(a){super(a),this.state={activeId:void 0,level:0},this.tableElement=null,this.tbodyElement=null,this.wrapperScrollLeft=0,this.wrapperScrollTop=0,this.updateOnScroll=!1,this.tbodyOffsetTop=0,this.prevData=[],this.flattedData=[],this.element=null,this._treeListId=h.guid(),this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this.scrollIntoView=n=>{if(!this.element)return;const{rowIndex:r=0}=n,{rowHeight:s=0}=this.props;this.element.scroll(0,(r-1)*s)},this.getColumns=n=>{const r=n.filter(l=>l.declarationIndex>=0&&l.parentIndex===-1),s=l=>(l.sort((o,c)=>o.declarationIndex-c.declarationIndex),l.map(o=>{const{declarationIndex:c,parentIndex:g,depth:f,colSpan:d,rowSpan:u,index:m,kFirst:C,groupable:w,children:p,...k}=o;return p.length?{children:s(p),...k}:k}));return s(r)},this.onKeyDown=n=>{if(b.tableKeyboardNavigation.onKeyDown(n,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.props.onKeyDown){const{mode:r,cell:s}=b.getSelectionOptions(this.props.selectable),l={dataItems:this.getLeafDataItems(),mode:r,cell:s,componentId:this._treeListId,selectedField:this.props.selectedField,...this.getEventArguments(n)};this.props.onKeyDown.call(void 0,l)}},this.onFocus=n=>{b.tableKeyboardNavigation.onFocus(n,{contextStateRef:this.contextStateRef})},this.onRowDrag=n=>{if(this.props.onRowDrag){const r={...n,target:this};this.props.onRowDrag.call(void 0,r)}},this.onRowDrop=n=>{if(this.props.onRowDrop){const r={...n,target:this};this.props.onRowDrop.call(void 0,r)}},this.onColumnReorder=(n,r,s)=>{const{extendedColumns:l}=this.props,o=l[n].depth,c=d=>{do d++;while(d<l.length&&l[d].depth>o);return d},g=[...l],f=g.splice(n,c(n)-n);if(g.splice(n<r?c(r-f.length):r,0,...f),g.filter(d=>d.declarationIndex>=0).forEach((d,u)=>d.orderIndex=u),this.props.onColumnReorder){const d={target:this,columns:this.getColumns(g),nativeEvent:s};this.props.onColumnReorder.call(void 0,d)}},this.onColumnResize=(n,r,s,l,o)=>{if(this.props.onColumnResize){const c=this.props.extendedColumns.filter(f=>f.children.length===0).reduce((f,d)=>f+=parseFloat(String(d.width)),0);this.tableElement&&(this.tableElement.style.width=c+"px");const g={columns:this.getColumns(this.props.extendedColumns),totalWidth:c,index:n,nativeEvent:l,newWidth:r,oldWidth:s,end:o,target:this};this.props.onColumnResize.call(void 0,g)}},this.onScroll=n=>{const r=n.currentTarget.scrollLeft,s=n.currentTarget.scrollTop,{columnVirtualization:l,scrollable:o,rowHeight:c=0}=this.props,g=c,f=0;let d=!1;l&&Math.abs(this.wrapperScrollLeft-r)>f&&(this.wrapperScrollLeft=r,d=!0),o==="virtual"&&Math.abs(this.wrapperScrollTop-s)>g&&(this.wrapperScrollTop=s,d=!0),d&&(this.updateOnScroll=!0,this.forceUpdate())},this.calculateSizes=n=>{if(!n||this.props.scrollable==="none")return;const r=Array.from(n.childNodes),s=r.find(c=>c.nodeName==="TABLE"),l=this.props.toolbar&&r.find(c=>c.nodeType===1&&c.classList.contains("k-grid-toolbar"));let o=0;if(l){const c=l.style.boxSizing;l.style.boxSizing="border-box",o=parseFloat(String(window.getComputedStyle(l).height))||l.offsetHeight,l.style.boxSizing=c,l.getAttribute("style")||l.removeAttribute("style")}this.tbodyOffsetTop=s.tBodies[0].offsetTop,ie.setHeaderRowsTop(s,o)},this.onItemChange=n=>{if(n.field===this.props.expandField){const r=this.props.onExpandChange;if(r){const s={...this.getEventArguments(n.syntheticEvent),dataItem:n.dataItem,level:n.level,value:n.value};r.call(void 0,s)}return}if(this.props.onItemChange){const r={...this.getEventArguments(n.syntheticEvent),dataItem:n.dataItem,level:n.level,field:n.field,value:n.value};this.props.onItemChange.call(void 0,r)}},this.onHeaderSelectionChange=n=>{if(this.props.onHeaderSelectionChange){const r={field:n.field,nativeEvent:n.syntheticEvent&&n.syntheticEvent.nativeEvent,syntheticEvent:n.syntheticEvent,target:this,dataItems:this.getLeafDataItems()};this.props.onHeaderSelectionChange.call(void 0,r)}},this.selectionRelease=n=>{if(this.props.onSelectionChange){const r={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this._treeListId,dataItems:this.getLeafDataItems(),dataItem:null,level:[],...n};this.props.onSelectionChange.call(void 0,r)}},this.onSortChange=(n,r,s)=>{this.onDataStateChange(this.props.onSortChange,{sort:r,field:s},n)},this.onFilterChange=n=>{const{filter:r,field:s}=n;this.onDataStateChange(this.props.onFilterChange,{filter:r,field:s},n.syntheticEvent)},this.onColumnMenuFilterChange=(n,r,s)=>{if(!s)return;const{onColumnMenuFilterChange:l}=this.props;if(!l)return;const o={syntheticEvent:n,filter:r,field:s,target:this,nativeEvent:n.nativeEvent};l.call(void 0,o)},this.onExpandChange=(n,r,s)=>{const{expandField:l,onExpandChange:o}=this.props;if(l&&o){const c={...this.getEventArguments(n),dataItem:r,level:s,value:nt(r,this.props.expandField)};o.call(void 0,c)}},this.onRowClick=(n,r)=>{if(this.props.onRowClick&&n.target.nodeName==="TD"){const s={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowClick.call(void 0,s)}},this.rowDoubleClick=(n,r)=>{if(this.props.onRowDoubleClick&&n.target.nodeName==="TD"){const s={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowDoubleClick.call(void 0,s)}},this.rowContextMenu=(n,r)=>{if(this.props.onRowContextMenu&&n.target.nodeName==="TD"){const s={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowContextMenu.call(void 0,s)}},this.onPageChange=n=>{if(this.props.onPageChange){const r={...this.getEventArguments(n.syntheticEvent),skip:n.skip,take:n.take};this.props.onPageChange.call(void 0,r)}},this.onDataStateChange=(n,r,s)=>{if(n&&n.call(void 0,{...this.getEventArguments(s),...r}),this.props.onDataStateChange){const l={...this.getEventArguments(s),dataState:{...this.getDataState(),...r}};this.props.onDataStateChange.call(void 0,l)}},this.getDataState=()=>({filter:this.props.filter,sort:this.props.sort}),this.getEventArguments=n=>({nativeEvent:n&&n.nativeEvent,syntheticEvent:n,target:this}),this.getLeafDataItems=()=>this.flatData.map(n=>n.dataItem),this.dragLogic=new b.CommonDragLogic(this.onColumnReorder,h.noop,h.noop),this.columnResize=new b.ColumnResize(this.onColumnResize),b.tableKeyboardNavigation.onConstructor({navigatable:!!a.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:a.idPrefix})}get document(){if(h.canUseDOM)return this.element&&this.element.ownerDocument||document}componentDidMount(){this.calculateSizes(this.element),b.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}getSnapshotBeforeUpdate(){return b.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(a){a.columns!==this.props.columns&&this.calculateSizes(this.element),b.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){this.columnResize.columns=[],this.dragLogic.columns=[],this.prevData=[],this.flattedData=[],this.updateOnScroll=!1}render(){const{filterRow:a,scrollable:n="scrollable",resizable:r=!1,reorderable:s=!1,skip:l,take:o,afterContent:c,extendedColumns:g=[],columnsMap:f}=this.props,d=g.some(v=>!!v.filter)||a!==void 0,u=a||b.FilterRow,m=b.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this.columnResize.columns=g,this.columnResize.resizable=r,this.dragLogic.columns=g,this.dragLogic.reorderable=s,this.dragLogic.groupable=!1;const C=g.filter(v=>v.children.length===0),w=t.createElement(b.Header,{headerRow:t.createElement(b.HeaderRow,{sort:this.props.sort,sortable:this.props.sortable,sortChange:this.onSortChange,selectionChange:this.onHeaderSelectionChange,columns:g,columnsMap:f,cellRender:this.props.headerCellRender,columnResize:this.columnResize,columnMenu:this.props.columnMenu,columnMenuFilter:this.props.columnMenuFilter,columnMenuFilterChange:this.onColumnMenuFilterChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler}),filterRow:d&&t.createElement(u,{columns:C,filter:this.props.filter,filterChange:this.onFilterChange,sort:this.props.sort,ariaRowIndex:f.length+1})||void 0,columnResize:this.columnResize}),p=this.props.style||{},{colSpans:k,hiddenColumns:H}=b.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:C,scrollLeft:this.wrapperScrollLeft,tableViewPortWidth:parseFloat((p.width||"").toString())}),V=(v,M,te,K,T,Q)=>C.map((I,L)=>{if(H[L])return null;const U=I.id?I.id:L,Z=`k-table-td ${I.className?I.className+" ":""}${I.locked?"k-grid-content-sticky":""}`,W={id:b.tableKeyboardNavigationTools.generateNavigatableId(`${te}-${String(L)}`,m),colSpan:k[L],dataItem:v.dataItem,field:I.field,format:I.format,className:Z||void 0,render:this.props.cellRender,onChange:this.onItemChange,selectionChange:this.props.onSelectionChange?P=>{this.onSelectionChange({event:P,item:v,columnIndex:L,dataIndex:T})}:void 0,level:v.level,expandable:I.expandable,expanded:K,hasChildren:Xt(v.dataItem,this.props.subItemsField),colIndex:L,ariaColumnIndex:I.ariaColumnIndex,onExpandChange:this.onExpandChange,style:I.left!==void 0&&{left:I.left,right:I.right,borderRightWidth:I.rightBorder?"1px":""}||{},isSelected:Array.isArray(Q)&&Q.indexOf(L)>-1};return M&&I.editCell?t.createElement(I.editCell,{...W,onChange:this.onItemChange,key:U}):I.cell?t.createElement(I.cell,{key:U,...W}):t.createElement(ie.TreeListCell,{key:U,...W})});let z=this.flatData;const N=z.length;l!==void 0&&o!==void 0&&(z=z.slice(l,l+o)),n==="virtual"&&(z=ie.tableRowsVirtualization({rows:z,tableViewPortHeight:parseFloat((p.height||p.maxHeight||"").toString()),scrollTop:this.wrapperScrollTop}),this.updateOnScroll=!1);const O=z.map(v=>v.level),ee=f.length+(d?1:0)+1,R=z.length>0&&z.map((v,M)=>{const te=h.getter(this.props.editField||"")(v.dataItem),K=h.getter(this.props.dataItemKey)(v.dataItem),T=String(K||v.level.join(".")),Q=nt(v.dataItem,this.props.expandField),I=this.props.selectedField?h.getter(this.props.selectedField)(v.dataItem):void 0,L={key:T,level:v.level,levels:O,dataItem:v.dataItem,selectedField:this.props.selectedField,rowHeight:v.height,render:this.props.rowRender,onDrop:this.onRowDrop,onDrag:this.onRowDrag,onClick:P=>this.onRowClick(P,v),onDoubleClick:P=>this.rowDoubleClick(P,v),onContextMenu:P=>this.rowContextMenu(P,v),isAltRow:M%2!==0,expanded:Q,rowIndex:M,ariaRowIndex:ee+M,ariaSetSize:v.levelCount,ariaPosInSet:v.level[v.level.length-1]+1,isSelected:typeof I=="boolean"&&I},U=this.props.editRow,Z=this.props.row||ie.TreeListRow,W=V(v,te,T,Q,M,I);return te&&U?t.createElement(U,{...L},W):t.createElement(Z,{...L},W)})||t.createElement("tr",{className:"k-table-row k-grid-norecords"},t.createElement("td",{className:"k-table-td",colSpan:C.length},this.props.noRecords||t.createElement(ie.TreeListNoRecords,null))),X=v=>this.props.sort&&this.props.sort.some(M=>M.field===v),A=t.createElement("colgroup",{ref:v=>{this.columnResize.colGroupMain=v}},C.map((v,M)=>t.createElement("col",{key:M.toString(),className:X(v.field)?"k-sorted":void 0,style:v.width!==void 0?{width:v.width}:void 0}))),J=this.props.columnVirtualization||this.props.scrollable==="virtual",G=this.props.selectable&&this.props.selectable.drag?"none":void 0,q=this.props.tableProps||{};return t.createElement(b.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},t.createElement("div",{style:this.props.style,className:h.classNames("k-grid k-grid-md",this.props.className,{"k-treelist-scrollable":n!=="none"}),ref:v=>this.element=v,onScroll:J?this.onScroll:void 0,onKeyDown:this.onKeyDown,onFocus:this.onFocus,"aria-rowcount":N,"aria-colcount":C.length,role:"treegrid",...b.tableKeyboardNavigationScopeAttributes},this.props.toolbar,t.createElement(b.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:v=>{this.tableElement=v}},t.createElement("table",{className:"k-table k-table-md",...this.props.tableProps||{},style:{...q.style||{},userSelect:G},role:"presentation"},A,w,t.createElement("tbody",{className:"k-table-tbody",...b.tableKeyboardNavigationBodyAttributes,ref:v=>this.tbodyElement=v,role:"presentation"},R))),this.props.pager&&t.createElement(this.props.pager,{className:"k-grid-pager",total:N,skip:l,take:o,onPageChange:this.onPageChange}),s&&t.createElement(t.Fragment,null,t.createElement(b.DropClue,{ref:this.dragLogic.refDropElementClue}),t.createElement(b.DragClue,{ref:this.dragLogic.refDragElementClue})),c))}get flatData(){const{data:a=[],rowHeight:n=0}=this.props;let r=0;const s=()=>{const o={height:n,offsetTop:r};return r+=o.height,o},l=this.updateOnScroll&&this.prevData===a&&this.tbodyOffsetTop>0&&this.flattedData.length?this.flattedData:a.map(o=>({...o,...s()}));return this.prevData=a,this.flattedData=l,l}onSelectionChange(a){if(this.props.onSelectionChange){const{event:n,item:r,dataIndex:s,columnIndex:l}=a,{mode:o,cell:c}=b.getSelectionOptions(this.props.selectable),g={...this.getEventArguments(n.syntheticEvent),dataItem:r.dataItem,level:r.level,startColIndex:l,endColIndex:l,startRowIndex:s,endRowIndex:s,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:o,cell:c,isDrag:!1,componentId:this._treeListId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,g)}}}yt.propTypes={data:i.array,resizable:i.bool,reorderable:i.bool,sortable:i.oneOfType([i.bool,i.shape({mode:i.oneOf(["single","multiple"]),allowUnsort:i.bool})]),onSortChange:i.func,sort:i.array,columns:i.arrayOf(i.object),columnVirtualization:i.bool,filter:i.array,onFilterChange:i.func,filterRow:i.any,toolbar:i.any,noRecords:i.any,onExpandChange:i.func,expandField:i.string,subItemsField:i.string,selectedField:i.string,onSelectionChange:i.func,onHeaderSelectionChange:i.func,onRowClick:i.func,onItemChange:i.func,editField:i.string,scrollable:i.oneOf(["none","scrollable","virtual"]),rowHeight:i.number,style:i.object,tableProps:i.object,pager:i.any,skip:i.number,take:i.number,onPageChange:i.func,onDataStateChange:i.func,onColumnResize:i.func,onColumnReorder:i.func,extendedColumns:i.arrayOf(i.object),columnsMap:i.arrayOf(i.array),dataItemKey:i.string.isRequired,afterContent:i.any,navigatable:i.bool,idPrefix:i.string},yt.contextType=b.TableKeyboardNavigationContext;const ke=t.forwardRef((e,a)=>{const{slotLevels:n,slotWidth:r,timelineHeaderCell:s}=e,{columns:l,noRecords:o,resizable:c,reorderable:g,sortable:f,sort:d,filter:u,columnMenuFilter:m,columnMenu:C,navigatable:w,row:p,selectable:k}=Te(),{onDataStateChange:H,onSortChange:V,onFilterChange:z,onColumnMenuFilterChange:N,onExpandChange:O,onRowClick:ee,onRowDoubleClick:R,onRowContextMenu:X,onColumnResize:A,onColumnReorder:J,onDependencyCreate:G,onKeyDown:q,onSelectionChange:v,onHeaderSelectionChange:M}=Oa(),te=en(),K=Va(),T=st(),Q=Jt(),I=Ha(),L=Ma(),U=t.useRef(null),Z=t.useRef(null),W=t.useRef(null),P=t.useRef(null),me=t.useRef(0),Re=t.useRef(h.guid()),x=t.useRef(null),je=t.useRef(null),It=t.useCallback(S=>{W.current&&W.current.scrollIntoView(S)},[]);t.useImperativeHandle(je,()=>({scrollIntoView:It})),t.useImperativeHandle(a,()=>je.current);const pe=t.useRef(0),Ce=t.useRef(0),Ee=t.useRef(0),we=t.useRef(0),fe=t.useRef(null),Ne=t.useRef(null),[he,Fe]=t.useState(null),xt=Na(n,U,s),Rt=Fa(n,Z),ye=La(n,r),{extendedColumns:Nt,columnsWidth:Ft,columnsMap:Lt}=t.useMemo(()=>{const S=b.readColumns([...l,{title:"",sortable:!1,resizable:!1,reorderable:!1,width:ye,headerCell:()=>xt,cell:rn,orderIndex:Number.MAX_SAFE_INTEGER,navigatable:!1}],{prevId:0,idPrefix:Re.current});let _=0;return S.forEach((F,$,j)=>{const Y=$+1===j.length,ue=F.children.length===0;Y?F.isAccessible=!1:(F.locked=!0,ue&&(F.width=F.width||be)),ue&&(_+=parseFloat(String(F.width)))}),{extendedColumns:S,columnsWidth:_,columnsMap:b.mapColumns(S)}},[l,ye]),[zt,Ht]=_a(),Le=t.useCallback(()=>U.current&&U.current.parentElement,[]),y=()=>{const S=Le(),_=Z.current,F=W.current&&W.current.tbodyElement;if(!S||!_||!F)return;const $=F.offsetTop,j=S.offsetLeft,Y=ye;_.style.top=$+"px",_.style.left=j+"px",_.style.width=Y+"px",_.style.height=F.offsetHeight+"px"},ce=()=>{const S=Le();S&&(me.current=S.offsetLeft)};t.useEffect(y),t.useEffect(ce);const de=t.useCallback(S=>{if(!P.current)return;const _=S.columns.slice(0,S.columns.length-1);if(S.end)P.current.style.left="0px";else{const F=Le();if(!F)return;P.current.style.left=F.offsetLeft-me.current+"px",y()}A({...S,columns:_})},[A]),ze=t.useCallback(S=>{const _=S.columns.slice(0,S.columns.length-1);J({...S,columns:_})},[A]),He=t.useCallback(S=>{const F=(x.current&&x.current.ownerDocument?x.current.ownerDocument:document).elementFromPoint(S.clientX,S.clientY),$=x.current;if(!F||!F.parentElement||!$)return;const j=$.parentElement,Y=$.firstElementChild;if(!j||!Y)return;const ue=F.getAttribute(Ae);if(ue){const lr=$.offsetTop,ir=$.offsetLeft,cr=j.offsetTop,dr=j.offsetLeft,ur=Y.scrollTop,gr=Y.scrollLeft;Ee.current=ir+dr,we.current=lr+cr,pe.current=S.clientX-Ee.current+gr,Ce.current=S.clientY-we.current+ur,fe.current=F.parentElement.getAttribute(Ve),Ne.current=ue}},[]),Mt=t.useCallback(S=>{const _=x.current;if(!_)return;const F=_.firstElementChild;if(!F)return;const $=F.scrollTop,j=F.scrollLeft,Y=S.clientX-Ee.current+j,ue=S.clientY-we.current+$;Math.abs(pe.current-Y)<10&&Math.abs(Ce.current-ue)<10||Fe({startX:pe.current,startY:Ce.current,endX:Y,endY:ue})},[]),ve=t.useCallback(S=>{const F=(x.current&&x.current.ownerDocument?x.current.ownerDocument:document).elementFromPoint(S.clientX,S.clientY);if(!F||!F.parentElement)return;const $=F.parentElement.getAttribute(Ve),j=F.getAttribute(Ae);if(j&&$!==fe.current&&G){let Y;Ne.current==="start"?Y=j==="start"?3:2:Y=j==="start"?1:0,G({fromId:fe.current,toId:$,type:Y})}pe.current=0,Ce.current=0,Ee.current=0,we.current=0,fe.current=null,Ne.current=null,Fe(null)},[G,Fe]);return t.createElement(an,{tasksStore:[zt,Ht],timelineWidth:ye,dependencyDrag:{isEnabled:!!G,draggedId:fe.current,onDependencyHandlePress:He,onDependencyHandleDrag:Mt,onDependencyHandleRelease:ve}},t.createElement("div",{className:"k-gantt-content",ref:x,style:{height:`calc(100% - ${K}px)`}},t.createElement(yt,{ref:W,extendedColumns:Nt,columnsMap:Lt,dataItemKey:T.id,data:I,idPrefix:Re.current,navigatable:w,expandField:T.isExpanded,subItemsField:T.children,editField:T.isInEdit,selectedField:T.isSelected,onDataStateChange:H,onSortChange:V,onFilterChange:z,onExpandChange:O,onRowClick:ee,onRowDoubleClick:R,onRowContextMenu:X,onColumnResize:de,onColumnReorder:ze,onColumnMenuFilterChange:N,onKeyDown:q,onSelectionChange:v,onHeaderSelectionChange:M,tableProps:{style:{width:Ft},className:"k-table k-table-md k-table-layout-fixed"},noRecords:o,rowHeight:te,resizable:c,reorderable:g,sortable:f,sort:d,filter:u,columnMenuFilter:m,columnMenu:C,row:p,selectable:k,afterContent:t.createElement(t.Fragment,null,t.createElement("svg",{className:"k-gantt-dependencies-svg",ref:P,style:{left:0,top:0}},L.map(S=>t.createElement(on,{key:h.getter(Q.id)(S),dependency:S}))),t.createElement("svg",{className:"k-gantt-dependencies-svg",style:{left:0,top:0,zIndex:3}},he&&t.createElement("polyline",{points:`${he.startX},${he.startY} ${he.endX},${he.endY}`})),I&&I.length?Rt:null)})))});ke.displayName="KendoReactGanttBaseView";const vt="gantt.weekViewTitle",Dt="gantt.dayViewTitle",bt="gantt.monthViewTitle",Tt="gantt.yearViewTitle",St="gantt.filterClearButton",Ge="gantt.filterEqOperator",We="gantt.filterNotEqOperator",Pe="gantt.filterIsNullOperator",_e="gantt.filterIsNotNullOperator",sn="gantt.filterIsEmptyOperator",ln="gantt.filterIsNotEmptyOperator",cn="gantt.filterStartsWithOperator",dn="gantt.filterContainsOperator",un="gantt.filterNotContainsOperator",gn="gantt.filterEndsWithOperator",fn="gantt.filterGteOperator",hn="gantt.filterGtOperator",mn="gantt.filterLteOperator",pn="gantt.filterLtOperator",Cn="gantt.filterIsTrue",En="gantt.filterIsFalse",wn="gantt.filterBooleanAll",yn="gantt.filterAfterOrEqualOperator",vn="gantt.filterAfterOperator",Dn="gantt.filterBeforeOperator",bn="gantt.filterBeforeOrEqualOperator",Ba="gantt.noRecords",Tn="gantt.editSave",kt="gantt.editCancel",Sn="gantt.editorTitle",kn="gantt.editorTaskTitle",In="gantt.editorTaskStart",xn="gantt.editorTaskEnd",Rn="gantt.editorTaskComplete",Nn="gantt.editorValidationRequired",Fn="gantt.editorValidationStart",Ln="gantt.editorValidationEnd",zn="gantt.addTask",Hn="gantt.addChild",Mn="gantt.addAbove",An="gantt.addBelow",Vn="gantt.editorDelete",On="gantt.deleteConfirmation",Gn="gantt.deleteDialogTitle",re={[vt]:"Week",[Dt]:"Day",[bt]:"Month",[Tt]:"Year",[St]:"Clear",[Ge]:"Is equal to",[We]:"Is not equal to",[Pe]:"Is null",[_e]:"Is not null",[sn]:"Is empty",[ln]:"Is not empty",[cn]:"Starts with",[dn]:"Contains",[un]:"Does not contain",[gn]:"Ends with",[fn]:"Is greater than or equal to",[hn]:"Is greater than",[mn]:"Is less than or equal to",[pn]:"Is less than",[Cn]:"Is true",[En]:"Is false",[wn]:"(All)",[yn]:"Is after or equal to",[vn]:"Is after",[Dn]:"Is before",[bn]:"Is before or equal to",[Ba]:"No records available",[Tn]:"Save",[kt]:"Cancel",[Sn]:"Task",[kn]:"Title",[In]:"Start",[xn]:"End",[Rn]:"Complete",[Nn]:"Field is required.",[Fn]:"Start time must be be before End time.",[Ln]:"End time must be after Start time.",[zn]:"Add Task",[Hn]:"Add Child",[Mn]:"Add Above",[An]:"Add Below",[Vn]:"Delete",[On]:"Are you sure you want to delete this event?",[Gn]:"Delete Event"},Ie=t.forwardRef((e,a)=>{const{slotWidth:n=Ke.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:s}=e,{timezone:l}=Te(),o=B.useInternationalization(),c=t.useRef(null),g=t.useRef(null),f=t.useCallback(w=>{g.current&&g.current.scrollIntoView(w)},[]);t.useImperativeHandle(c,()=>({scrollIntoView:f})),t.useImperativeHandle(a,()=>c.current);const d=Se(),u=e.workWeekStart||Ke.workWeekStart,m=e.workWeekEnd||Ke.workWeekEnd,C=t.useMemo(()=>{const w=qt({workWeekStart:u,workWeekEnd:m}),p=[],k=Zt(d,{timezone:l},o);return k.forEach(H=>{const V=Yt(H.range,{workDays:w,timezone:l},o);p.push.apply(p,V)}),r&&p[0]&&(r.current=p[0].range),[k,p]},[l,d.start.getTime(),d.end.getTime(),o,u,m]);return t.createElement(ke,{ref:g,slotWidth:n,slotLevels:C,timelineHeaderCell:s})}),Ke={name:"week",dateRange:({intl:e,tasksStart:a,tasksEnd:n,timezone:r})=>{const s=E.ZonedDate.fromLocalDate(a,r),l=E.ZonedDate.fromLocalDate(n,r),o=Bt(E.firstDayInWeek(E.getDate(s),e.firstDay())),c=et(E.firstDayInWeek(E.getDate(l),e.firstDay()),Gt),g=E.ZonedDate.fromUTCDate(le(o),r),f=E.ZonedDate.fromUTCDate(le(c),r);return{start:new Date(g.getTime()),end:new Date(f.getTime()),zonedStart:g,zonedEnd:f}},title:e=>e.toLanguageString(vt,re[vt]),slotWidth:be,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};Ie.defaultProps=Ke,Ie.propTypes={name:i.string,dateRange:i.oneOfType([i.func,i.object]),title:i.oneOfType([i.string,i.func]),slotWidth:i.number,workWeekStart:i.number,workWeekEnd:i.number,workDayStart:i.string,workDayEnd:i.string},Ie.displayName="KendoReactGanttWeekView";const Ua=(e,a,n)=>{const[r,s]=t.useState(a||e),l=t.useCallback((o,c)=>{s(o),n&&n.call(void 0,{...c,value:o})},[n,s]);return[a!==void 0?a:r,l]},Wn=e=>{const[a,n]=Qt(),r=B.useLocalization(),s=t.useMemo(()=>typeof e.view.title=="function"?e.view.title.call(void 0,r):e.view.title,[e.view.title,r]),l=t.useCallback(()=>{e.view.name&&n(e.view.name)},[n,e.view.name]);return t.createElement(ne.Button,{role:"button",type:"button",tabIndex:-1,togglable:!0,selected:e.view.name===a,onClick:l},s)};Wn.displayName="KendoReactGanttViewSelectorItem";const Pn=t.forwardRef(()=>{const e=Aa(),[a,n]=Qt(),r=e.find(o=>o.props.name===a),s=B.useLocalization(),l=t.useCallback(o=>{n&&(o.syntheticEvent.preventDefault(),n(o.item.name))},[n]);return t.createElement("div",{className:"k-gantt-views-wrapper"},t.createElement(ne.ButtonGroup,{className:"k-gantt-views"},e.map(o=>t.createElement(Wn,{key:o.props.name,view:o.props}))),r&&t.createElement(ne.DropDownButton,{className:"k-views-dropdown",onItemClick:l,popupSettings:{popupClass:"k-gantt-toolbar"},textField:"title",items:e.map(o=>({...o.props,selected:o.props.name===a,title:typeof o.props.title=="function"?o.props.title.call(void 0,s):o.props.title})),text:t.createElement(t.Fragment,null,typeof r.props.title=="function"?r.props.title.call(void 0,s):r.props.title,t.createElement(h.IconWrap,{name:"caret-alt-down",icon:Xe.caretAltDownIcon}))}))});Pn.displayName="KendoReactGanttViewSelectorList";const _n=t.forwardRef((e,a)=>{const{className:n,...r}=e,s=t.useRef(null);return t.useImperativeHandle(a,()=>({element:s.current,props:e})),t.createElement(ne.ToolbarItem,{ref:l=>{l&&(s.current=l.element)},className:h.classNames("k-gantt-views",n),...r},e.children)});_n.displayName="KendoReactGanttViewSelector";const Kn=t.forwardRef((e,a)=>{const{className:n,...r}=e,s=t.useRef(null),l=t.useRef(null);t.useImperativeHandle(l,()=>({element:s.current,props:e})),t.useImperativeHandle(a,()=>l.current);const o=t.useMemo(()=>h.classNames("k-gantt-toolbar k-gantt-header",n),[n]);return t.createElement(ne.Toolbar,{ref:c=>{c&&(s.current=c.element)},className:o,...r},e.children)});Kn.displayName="KendoReactGanttToolbar";const Bn={name:"@progress/kendo-react-gantt",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},Un=t.forwardRef((e,a)=>{const n=B.useLocalization(),r=u=>n.toLanguageString(u,re[u]),s=r(zn),l=r(Hn),o=r(Mn),c=r(An),g=t.useCallback(u=>{u.syntheticEvent.preventDefault();const m=u.item&&u.item.direction?u.item.direction:"none";e.onClick&&e.onClick({nativeEvent:u.nativeEvent,syntheticEvent:u.syntheticEvent,direction:m})},[e.onClick]),f=t.useCallback(u=>{u.preventDefault(),e.onClick&&e.onClick({nativeEvent:u&&u.nativeEvent,syntheticEvent:u,direction:"none"})},[e.onClick]),d=t.createElement(t.Fragment,null,t.createElement(h.IconWrap,{name:"plus",icon:Xe.plusIcon}),s);return e.selectedTask?t.createElement(ne.DropDownButton,{className:"k-views-dropdown",onItemClick:g,popupSettings:{popupClass:"k-gantt-toolbar"},textField:"title",items:[{title:l,direction:"child"},{title:o,direction:"above"},{title:c,direction:"below"}],text:d}):t.createElement(ne.Button,{onClick:f},d)});Un.displayName="KendoReactGanttAddButton";const Be=t.forwardRef((e,a)=>{h.validatePackage(Bn);const n=h.shouldShowValidationUI(Bn),{columns:r=xe.columns,taskData:s=xe.taskData,dependencyData:l=xe.dependencyData,style:o,className:c,noRecords:g,timezone:f,rowHeight:d=xe.rowHeight,resizable:u,reorderable:m,sortable:C,sort:w,filter:p,columnMenuFilter:k,columnMenu:H,navigatable:V,toolbar:z,row:N,selectable:O}=e,ee=B.useInternationalization(),{fields:R}=t.useMemo(()=>Ea(e.taskModelFields),[e.taskModelFields]),{fields:X}=t.useMemo(()=>wa(e.dependencyModelFields),[e.dependencyModelFields]),A=t.useCallback(za(R.isExpanded,R.children),[R.isExpanded,R.children]),J=t.useRef(null),G=t.useRef(null),q=t.useRef(null),v=t.useRef(null),M=t.useRef(null),te=t.useCallback(y=>{const ce=h.getter(R.start)(y),de=h.getter(R.end)(y),ze=h.getter(R.isSelected)(y);(!G.current||ce<G.current)&&(G.current=ce),(!q.current||de>q.current)&&(q.current=de),ze&&(v.current=y)},[R.start,R.end]),K=t.useMemo(()=>(G.current=null,q.current=null,v.current=null,ie.flatData(s,A,te)),[s,A]);(!G.current||!q.current)&&(G.current=new Date(Ot),q.current=new Date(Ot));const T=t.Children.toArray(e.children||[t.createElement(Ie,{key:"week",firstSlotRangeRef:M})]),[Q,I]=Ua(e.defaultView||T[0].props.name,e.view,e.onViewChange),L=T.find(y=>y.props.name===Q)||T[0],U=typeof L.props.dateRange=="function"?L.props.dateRange.call(void 0,{intl:ee,tasksStart:G.current,tasksEnd:q.current,timezone:f}):L.props.dateRange,Z=t.useRef(null),[W,P]=t.useState(0);t.useLayoutEffect(()=>{Z.current&&P(Z.current.element.offsetHeight)},[]);const me=t.useCallback(y=>{J.current&&J.current.scrollIntoView(y)},[]),Re=t.useRef(null),x=t.useRef(null);t.useImperativeHandle(x,()=>({props:e,element:Re.current,scrollIntoView:me})),t.useImperativeHandle(a,()=>x.current);const je=t.useCallback(y=>{e.onDataStateChange&&e.onDataStateChange.call(void 0,{...y,target:x.current})},[e.onDataStateChange]),It=t.useCallback(y=>{e.onSortChange&&e.onSortChange.call(void 0,{...y,target:x.current})},[e.onSortChange]),pe=t.useCallback(y=>{e.onKeyDown&&e.onKeyDown.call(void 0,{...y,target:x.current})},[e.onKeyDown]),Ce=t.useCallback(y=>{e.onSelectionChange&&e.onSelectionChange.call(void 0,{...y,target:x.current})},[e.onSelectionChange]),Ee=t.useCallback(y=>{e.onHeaderSelectionChange&&e.onHeaderSelectionChange.call(void 0,{...y,target:x.current})},[e.onHeaderSelectionChange]),we=t.useCallback(y=>{e.onFilterChange&&e.onFilterChange.call(void 0,{...y,target:x.current})},[e.onFilterChange]),fe=t.useCallback(y=>{e.onColumnMenuFilterChange&&e.onColumnMenuFilterChange.call(void 0,{...y,target:x.current})},[e.onColumnMenuFilterChange]),Ne=t.useCallback(y=>{e.onExpandChange&&e.onExpandChange.call(void 0,{...y,target:x.current})},[e.onExpandChange]),he=t.useCallback(y=>{e.onAddClick&&e.onAddClick.call(void 0,{...y,target:x.current,selectedDataItem:v.current,slotStart:M.current&&new Date(M.current.start.getTime()),slotEnd:M.current&&new Date(M.current.end.getTime())})},[e.onAddClick]),Fe=t.useCallback(y=>{e.onColumnResize&&e.onColumnResize.call(void 0,{...y,target:x.current})},[e.onColumnResize]),xt=t.useCallback(y=>{e.onColumnReorder&&e.onColumnReorder.call(void 0,{...y,target:x.current})},[e.onColumnReorder]),Rt=t.useCallback(y=>{e.onRowClick&&e.onRowClick.call(void 0,{...y,target:x.current})},[e.onRowClick]),ye=t.useCallback(y=>{e.onRowDoubleClick&&e.onRowDoubleClick.call(void 0,{...y,target:x.current})},[e.onRowClick]),Nt=t.useCallback(y=>{e.onRowContextMenu&&e.onRowContextMenu.call(void 0,{...y,target:x.current})},[e.onRowClick]),Ft=t.useCallback(y=>{e.onTaskClick&&e.onTaskClick.call(void 0,{...y,target:x.current})},[e.onTaskClick]),Lt=t.useCallback(y=>{e.onTaskDoubleClick&&e.onTaskDoubleClick.call(void 0,{...y,target:x.current})},[e.onTaskDoubleClick]),zt=t.useCallback(y=>{e.onTaskContextMenu&&e.onTaskContextMenu.call(void 0,{...y,target:x.current})},[e.onTaskContextMenu]),Ht=t.useCallback(y=>{e.onTaskRemoveClick&&e.onTaskRemoveClick.call(void 0,{...y,target:x.current})},[e.onTaskRemoveClick]),Le=t.useCallback(y=>{if(e.onDependencyCreate){let ce,de;const ze=h.getter(R.id);for(let He=0;He<K.length;He++){const Mt=K[He],ve=ze(Mt.dataItem);if(String(ve)===y.fromId&&(ce=ve),String(ve)===y.toId&&(de=ve),ce&&de)break}e.onDependencyCreate.call(void 0,{fromId:ce,toId:de,target:x.current,type:y.type})}},[e.onDependencyCreate,R,K]);return t.createElement(tn,{dateRange:U,taskData:K,dependencyData:l,taskModelFields:R,dependencyModelFields:X,views:T,activeView:[Q,I],rowHeight:d,toolbarHeight:W,props:{columns:r,noRecords:g,timezone:f,resizable:u,reorderable:m,sortable:C,sort:w,filter:p,columnMenuFilter:k,columnMenu:H,navigatable:V,row:N,selectable:O},events:{onDataStateChange:je,onSortChange:It,onFilterChange:we,onColumnMenuFilterChange:fe,onExpandChange:Ne,onRowClick:Rt,onRowDoubleClick:ye,onRowContextMenu:Nt,onColumnResize:Fe,onColumnReorder:xt,onDependencyCreate:e.onDependencyCreate&&Le,onKeyDown:pe,onSelectionChange:Ce,onHeaderSelectionChange:Ee},taskEvents:{onTaskClick:Ft,onTaskDoubleClick:Lt,onTaskContextMenu:zt,onTaskRemoveClick:e.onTaskRemoveClick&&Ht}},t.createElement("div",{ref:Re,role:"application",style:o,className:h.classNames("k-gantt",c)},t.createElement(Kn,{ref:Z},z&&z.addTaskButton?t.createElement(Un,{selectedTask:v.current,onClick:he}):null,t.createElement(ne.ToolbarSpacer,null),t.createElement(_n,null,t.createElement(Pn,null))),L&&t.createElement(L.type,{key:L.props.name,ref:J,...L.props,firstSlotRangeRef:M}),n&&t.createElement(h.WatermarkOverlay,null)))}),xe={taskData:[],dependencyData:[],columns:[],rowHeight:40};Be.propTypes={taskData:i.array,taskModelFields:i.shape({id:i.string,start:i.string,end:i.string,title:i.string,percentComplete:i.string,isRollup:i.string,isExpanded:i.string,children:i.string,isInEdit:i.string}),dependencyData:i.array,dependencyModelFields:i.shape({id:i.string,fromId:i.string,toId:i.string,type:i.string}),columns:i.arrayOf(i.shape({width:i.number,cell:i.any,editCell:i.any,headerCell:i.any,filter:i.any,children:i.any,field:i.string,title:i.string,sortable:i.any,expandable:i.bool,headerSelectionValue:i.bool,format:i.string,headerClassName:i.string,className:i.string,resizable:i.bool,reorderable:i.bool,minResizableWidth:i.number,orderIndex:i.number,columnMenu:i.any})),sort:i.array,filter:i.array,columnMenuFilter:i.array,columnMenu:i.any,style:i.object,className:i.string,children:i.any,timezone:i.string,defaultView:i.string,view:i.string,rowHeight:i.number,navigatable:i.bool,onViewChange:i.func,onDataStateChange:i.func,onSortChange:i.func,onFilterChange:i.func,onExpandChange:i.func,onRowClick:i.func,onColumnResize:i.func,onColumnReorder:i.func},Be.defaultProps=xe,Be.displayName="KendoReactGantt";const Ue=t.forwardRef((e,a)=>{const{slotWidth:n=ge.slotWidth,slotDuration:r=ge.slotDuration,firstSlotRangeRef:s,timelineHeaderCell:l}=e,{timezone:o}=Te(),c=B.useInternationalization(),g=t.useRef(null),f=t.useRef(null),d=t.useCallback(H=>{f.current&&f.current.scrollIntoView(H)},[]);t.useImperativeHandle(g,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>g.current);const u=Se(),m=e.workWeekStart||ge.workWeekStart,C=e.workWeekEnd||ge.workWeekEnd,w=e.workDayStart||ge.workDayStart,p=e.workDayEnd||ge.workDayEnd,k=t.useMemo(()=>{const H=qt({workWeekStart:m,workWeekEnd:C}),V=[],z=Yt(u,{workDays:H,timezone:o},c);return z.forEach(N=>{const O=xa(N.range,{workDayStart:w,workDayEnd:p,timezone:o,slotDuration:r},c);N.span=O.length,V.push.apply(V,O)}),s&&V[0]&&(s.current=V[0].range),[z,V]},[o,u.start.getTime(),u.end.getTime(),c,m,C,w,p]);return t.createElement(ke,{ref:f,slotWidth:n,slotLevels:k,timelineHeaderCell:l})}),ge={name:"day",dateRange:({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=E.ZonedDate.fromLocalDate(e,n),s=E.ZonedDate.fromLocalDate(a,n),l=Bt(r),o=et(s),c=E.ZonedDate.fromUTCDate(le(l),n),g=E.ZonedDate.fromUTCDate(le(o),n);return{start:new Date(c.getTime()),end:new Date(g.getTime()),zonedStart:c,zonedEnd:g}},title:e=>e.toLanguageString(Dt,re[Dt]),slotWidth:be,slotDuration:60,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};Ue.defaultProps=ge,Ue.propTypes={name:i.string,dateRange:i.oneOfType([i.func,i.object]),title:i.oneOfType([i.string,i.func]),slotWidth:i.number,slotDuration:i.number,workWeekStart:i.number,workWeekEnd:i.number,workDayStart:i.string,workDayEnd:i.string},Ue.displayName="KendoReactGanttDayView";const qe=t.forwardRef((e,a)=>{const{slotWidth:n=qn.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:s}=e,{timezone:l}=Te(),o=B.useInternationalization(),c=t.useRef(null),g=t.useRef(null),f=t.useCallback(m=>{g.current&&g.current.scrollIntoView(m)},[]);t.useImperativeHandle(c,()=>({scrollIntoView:f})),t.useImperativeHandle(a,()=>c.current);const d=Se(),u=t.useMemo(()=>{const m=[],C=jt(d,{timezone:l},o);return C.forEach(w=>{const p=Zt(w.range,{timezone:l},o);m.push.apply(m,p)}),r&&m[0]&&(r.current=m[0].range),[C,m]},[l,d.start.getTime(),d.end.getTime(),o]);return t.createElement(ke,{ref:g,slotWidth:n,slotLevels:u,timelineHeaderCell:s})}),qn={name:"month",dateRange:({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=E.ZonedDate.fromLocalDate(e,n),s=E.ZonedDate.fromLocalDate(a,n),l=E.firstDayOfMonth(E.getDate(r)),o=E.addDays(E.lastDayOfMonth(E.getDate(s)),1),c=E.ZonedDate.fromUTCDate(le(l),n),g=E.ZonedDate.fromUTCDate(le(o),n);return{start:new Date(c.getTime()),end:new Date(g.getTime()),zonedStart:c,zonedEnd:g}},title:e=>e.toLanguageString(bt,re[bt]),slotWidth:be,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};qe.defaultProps=qn,qe.propTypes={name:i.string,dateRange:i.oneOfType([i.func,i.object]),title:i.oneOfType([i.string,i.func]),slotWidth:i.number,workWeekStart:i.number,workWeekEnd:i.number,workDayStart:i.string,workDayEnd:i.string},qe.displayName="GanttMonthView";const $e=t.forwardRef((e,a)=>{const{slotWidth:n=$n.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:s}=e,{timezone:l}=Te(),o=B.useInternationalization(),c=t.useRef(null),g=t.useRef(null),f=t.useCallback(m=>{g.current&&g.current.scrollIntoView(m)},[]);t.useImperativeHandle(c,()=>({scrollIntoView:f})),t.useImperativeHandle(a,()=>c.current);const d=Se(),u=t.useMemo(()=>{const m=Ra(d,{timezone:l},o),C=[];return m.forEach(w=>{const p=jt(w.range,{timezone:l},o);C.push.apply(C,p)}),r&&C[0]&&(r.current=C[0].range),[m,C]},[l,d.start.getTime(),d.end.getTime(),o]);return t.createElement(ke,{slotWidth:n,slotLevels:u,timelineHeaderCell:s})}),$n={name:"year",dateRange:({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=E.ZonedDate.fromLocalDate(e,n),s=E.ZonedDate.fromLocalDate(a,n),l=E.firstDayOfMonth(E.firstMonthOfYear(E.getDate(r))),o=E.addDays(E.lastDayOfMonth(E.lastMonthOfYear(E.getDate(s))),1),c=E.ZonedDate.fromUTCDate(le(l),n),g=E.ZonedDate.fromUTCDate(le(o),n);return{start:new Date(c.getTime()),end:new Date(g.getTime()),zonedStart:c,zonedEnd:g}},title:e=>e.toLanguageString(Tt,re[Tt]),slotWidth:be};$e.defaultProps=$n,$e.propTypes={name:i.string,dateRange:i.oneOfType([i.func,i.object]),title:i.oneOfType([i.string,i.func]),slotWidth:i.number},$e.displayName="GanttYearView";const qa=[{text:dn,operator:"contains"},{text:un,operator:"doesnotcontain"},{text:Ge,operator:"eq"},{text:We,operator:"neq"},{text:cn,operator:"startswith"},{text:gn,operator:"endswith"},{text:Pe,operator:"isnull"},{text:_e,operator:"isnotnull"},{text:sn,operator:"isempty"},{text:ln,operator:"isnotempty"}],$a=[{text:Ge,operator:"eq"},{text:We,operator:"neq"},{text:fn,operator:"gte"},{text:hn,operator:"gt"},{text:mn,operator:"lte"},{text:pn,operator:"lt"},{text:Pe,operator:"isnull"},{text:_e,operator:"isnotnull"}],Ya=[{text:Ge,operator:"eq"},{text:We,operator:"neq"},{text:yn,operator:"gte"},{text:vn,operator:"gt"},{text:Dn,operator:"lt"},{text:bn,operator:"lte"},{text:Pe,operator:"isnull"},{text:_e,operator:"isnotnull"}],Za=[{text:wn,operator:""},{text:Cn,operator:!0},{text:En,operator:!1}];function Ye(e,a){return{clearButtonTitle:e.toLanguageString(St,re[St]),operators:a.map(n=>({text:e.toLanguageString(n.text,re[n.text]),operator:n.operator}))}}const Yn=e=>{const{operators:a,...n}=e;return t.createElement(b.TextFilterCell,{ariaLabel:"text filter",...Ye(B.useLocalization(),a||qa),...n})};Yn.displayName="KendoReactGanttTextFilter";const Zn=e=>{const{operators:a,...n}=e;return t.createElement(b.NumericFilterCell,{ariaLabel:"numeric filter",...Ye(B.useLocalization(),a||$a),...n})};Zn.displayName="KendoReactGanttNumericFilter";const jn=e=>{const{operators:a,...n}=e;return t.createElement(b.BooleanFilterCell,{ariaLabel:"boolean filter",...Ye(B.useLocalization(),a||Za),...n})};jn.displayName="KendoReactGanttBooleanFilter";const Xn=e=>{const{operators:a,...n}=e;return t.createElement(b.DateFilterCell,{ariaLabel:"date filter",...Ye(B.useLocalization(),a||Ya),...n})};Xn.displayName="KendoReactGanttDateFilter";const ja=e=>{const{dependencyData:a,dependencyModelFields:n,defaultDataItem:r,fromId:s,toId:l,type:o}=e,c=a.map(m=>({...m})),g=h.setter(n.fromId),f=h.setter(n.toId),d=h.setter(n.type),u=r?{...r}:{};return g(u,s),f(u,l),d(u,o),c.push(u),c},Xa=e=>{const{defaultDataItem:a,selectedDataItem:n,direction:r,taskModelFields:s,dataTree:l,slotStart:o,slotEnd:c}=e,g=Oe(l,s.children,p=>({...p})),f=h.setter(s.start),d=h.setter(s.end),u=h.getter(s.start),m=h.getter(s.end),C=a?{...a}:{},w=u(C)&&m(C);if(!n||r==="none")w||(f(C,o),d(C,c)),g.unshift(C);else{const p=[{task:{[s.children]:g},childrenIndex:0}],k=h.getter(s.id),H=h.getter(s.children),V=h.setter(s.children),z=k(n);for(;p.length>0;){const N=p[p.length-1],O=N.task,ee=k(O),R=H(O);if(ee&&ee===z)break;R&&R.length&&R.length>N.childrenIndex?(p.push({task:R[N.childrenIndex],childrenIndex:0}),N.childrenIndex++):p.pop()}if(p.length>1){const N=p[p.length-1].task,O=p[p.length-2].childrenIndex,R=p[p.length-2].task,X=H(R);switch(r){case"child":{let A=H(N);A||(A=[],V(N,A)),w||(f(C,new Date(u(N).getTime())),d(C,new Date(m(N).getTime()))),A.push(C),Ze(p.splice(1,p.length-1).map(J=>J.task),s);break}case"above":{u(R)&&m(R)&&!w?(f(C,new Date(u(N).getTime())),d(C,new Date(m(N).getTime()))):(f(C,o),d(C,c)),X.splice(O-1,0,C),Ze(p.splice(1,p.length-2).map(A=>A.task),s);break}case"below":{u(R)&&m(R)&&!w?(f(C,new Date(u(N).getTime())),d(C,new Date(m(N).getTime()))):(f(C,o),d(C,c)),X.splice(O,0,C),Ze(p.splice(1,p.length-2).map(A=>A.task),s);break}}}}return g},Ja=e=>{const{updatedDataItem:a,taskModelFields:n,dataTree:r}=e,s=h.getter(n.id),l=h.getter(n.children),o=s(a);let c;const g=Oe(r,n.children,d=>s(d)===o?(c=d,{...a}):{...d});let f=[{task:{[n.children]:g},childrenIndex:0}];for(;f.length>0;){const d=f[f.length-1],u=d.task,m=s(u),C=l(u);if(m&&m===o)break;C&&C.length&&C.length>d.childrenIndex?(f.push({task:C[d.childrenIndex],childrenIndex:0}),d.childrenIndex++):f.pop()}if(f.length>1){f=f.splice(1,f.length-2);const d=h.getter(n.start),u=h.getter(n.end),m=h.getter(n.percentComplete);if(d(c).getTime()!==d(a).getTime()){Jn(f.map(w=>w.task),n);const C=d(a).getTime()-d(c).getTime();er(l(a),n,C)}u(c).getTime()!==u(a).getTime()&&Qn(f.map(C=>C.task),n),m(c)!==m(a)&&ea(f.map(C=>C.task),n)}return g},Qa=e=>{const{removedDataItem:a,taskModelFields:n,dataTree:r}=e,s=Oe(r,n.children,f=>({...f}));let l=[{task:{[n.children]:s},childrenIndex:0}];const o=h.getter(n.id),c=h.getter(n.children),g=o(a);for(;l.length>0;){const f=l[l.length-1],d=f.task,u=o(d),m=c(d);if(u&&u===g)break;m&&m.length&&m.length>f.childrenIndex?(l.push({task:m[f.childrenIndex],childrenIndex:0}),f.childrenIndex++):l.pop()}if(l.length>1){const f=l[l.length-2],d=f.task;c(d).splice(f.childrenIndex-1,1),l=l.splice(1,l.length-2),Ze(l.map(m=>m.task),n)}return s},Ze=(e,a)=>{Jn(e,a),Qn(e,a),ea(e,a)},Jn=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.start),s=h.setter(a.start);for(let l=e.length-1;l>=0;l--){const o=e[l],c=n(o);if(c&&c.length){const g=c.reduce((f,d)=>Math.min(f,r(d).getTime()),r(c[0]).getTime());s(o,new Date(g))}}},Qn=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.end),s=h.setter(a.end);for(let l=e.length-1;l>=0;l--){const o=e[l],c=n(o);if(c&&c.length){const g=c.reduce((f,d)=>Math.max(f,r(d).getTime()),r(c[0]).getTime());s(o,new Date(g))}}},ea=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.percentComplete),s=h.setter(a.percentComplete),l=({avg:o,n:c},g)=>({avg:((r(g)||0)+c*o)/(c+1),n:c+1});for(let o=e.length-1;o>=0;o--){const c=e[o],g=n(c);if(g&&g.length){const f=g.reduce(l,{avg:0,n:0}).avg;s(c,f)}}},er=(e,a,n)=>{if(!e)return;const r=h.getter(a.children),s=h.getter(a.start),l=h.setter(a.start),o=h.getter(a.end),c=h.setter(a.end),g=e.map(f=>({task:f,childrenIndex:0}));for(;g.length>0;){const f=g[g.length-1],d=f.task,u=r(d);u&&u.length&&u.length>f.childrenIndex?(g.push({task:u[f.childrenIndex],childrenIndex:0}),f.childrenIndex++):(g.pop(),l(d,new Date(s(d).getTime()+n)),c(d,new Date(o(d).getTime()+n)))}},tr=e=>{const{validationMessage:a,touched:n,label:r,id:s,valid:l,disabled:o,hint:c,type:g,optional:f,...d}=e,u=n&&a,m=!u&&c,C=m?`${s}_hint`:"",w=u?`${s}_error`:"";return t.createElement(oe.FieldWrapper,null,t.createElement(se.Label,{editorId:s,editorValid:l,editorDisabled:o,optional:f},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(At.Input,{valid:l,type:g,id:s,disabled:o,ariaDescribedBy:`${C} ${w}`,...d}),m&&t.createElement(se.Hint,{id:C},c),u&&t.createElement(se.Error,{id:w},a)))},ta=e=>{const{validationMessage:a,touched:n,label:r,id:s,valid:l,disabled:o,hint:c,wrapperStyle:g,...f}=e,d=n&&a,u=!d&&c,m=u?`${s}_hint`:"",C=d?`${s}_error`:"",w=r?`${s}_label`:"";return t.createElement(oe.FieldWrapper,{style:g},t.createElement(se.Label,{id:w,editorId:s,editorValid:l,editorDisabled:o},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(ra.DateTimePicker,{ariaLabelledBy:w,ariaDescribedBy:`${m} ${C}`,valid:l,id:s,disabled:o,...f}),u&&t.createElement(se.Hint,{id:m},c),d&&t.createElement(se.Error,{id:C},a)))},nr=e=>{const{validationMessage:a,touched:n,label:r,id:s,valid:l,disabled:o,hint:c,...g}=e,f=n&&a,d=!f&&c,u=d?`${s}_hint`:"",m=f?`${s}_error`:"";return t.createElement(oe.FieldWrapper,null,t.createElement(se.Label,{editorId:s,editorValid:l,editorDisabled:o},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(At.NumericTextBox,{ariaDescribedBy:`${u} ${m}`,valid:l,id:s,disabled:o,...g}),d&&t.createElement(se.Hint,{id:u},c),f&&t.createElement(se.Error,{id:m},a)))},ar=()=>{const e=st(),a=B.useLocalization(),n=p=>a.toLanguageString(p,re[p]),r=n(kn),s=n(In),l=n(xn),o=n(Rn),c=n(Nn),g=n(Fn),f=n(Ln),d=t.useCallback(p=>p||p===0?void 0:c,[c]),u=t.useCallback((p,k)=>p&&k(e.end)&&p.getTime()>k(e.end).getTime()?g:void 0,[e,g]),m=t.useCallback((p,k)=>p&&k(e.start)&&p.getTime()<k(e.start).getTime()?f:void 0,[e,f]),C=t.useMemo(()=>[d,u],[d,u]),w=t.useMemo(()=>[d,m],[d,m]);return t.createElement(oe.FormElement,{style:{width:400},horizontal:!0},t.createElement(oe.Field,{id:`${e.title}_gantteditor`,name:e.title,label:r,component:tr,validator:d}),t.createElement(oe.Field,{id:`${e.start}_gantteditor`,name:e.start,label:s,component:ta,validator:C}),t.createElement(oe.Field,{id:`${e.end}_gantteditor`,name:e.end,label:l,component:ta,validator:w}),t.createElement(oe.Field,{id:`${e.percentComplete}_gantteditor`,name:e.percentComplete,format:"p",label:o,component:nr,step:.01,validator:d}))},rr=e=>{const{onCancel:a,onClose:n,onSubmit:r,...s}=e,l=B.useLocalization(),o=w=>l.toLanguageString(w,re[w]),c=o(Tn),g=o(kt),f=o(Sn),d=t.useCallback(w=>{if(a){const p={syntheticEvent:w,nativeEvent:w.nativeEvent,dataItem:e.dataItem};a.call(void 0,p)}},[a,e.dataItem]),u=t.useCallback(({syntheticEvent:w})=>{if(n){const p={syntheticEvent:w,nativeEvent:w.nativeEvent,dataItem:e.dataItem};n.call(void 0,p)}},[n,e.dataItem]),m=t.useCallback((w,p)=>{if(r){const k={dataItem:w,syntheticEvent:p,nativeEvent:p&&p.nativeEvent};r.call(void 0,k)}},[r]),C=t.createElement(oe.Form,{initialValues:e.dataItem,onSubmit:m,render:w=>t.createElement(Me.Dialog,{title:f,minWidth:600,onClose:u,style:{zIndex:90}},t.createElement(ar,null),t.createElement(Me.DialogActionsBar,null,t.createElement(ne.Button,{disabled:!w.allowSubmit,onClick:w.onSubmit},c),t.createElement(ne.Button,{onClick:d},g))),...s});return h.canUseDOM?Vt.createPortal(C,document&&document.body):null},or=e=>{const{onClose:a,onCancel:n,onConfirm:r,dataItem:s}=e,l=B.useLocalization(),o=p=>l.toLanguageString(p,re[p]),c=o(Vn),g=o(kt),f=o(On),d=o(Gn),u=t.useCallback(({syntheticEvent:p})=>{a&&a.call(void 0,{syntheticEvent:p,nativeEvent:p&&p.nativeEvent,dataItem:null})},[a]),m=t.useCallback(p=>{n&&n.call(void 0,{syntheticEvent:p,nativeEvent:p&&p.nativeEvent,dataItem:null})},[n]),C=t.useCallback(p=>{r&&r.call(void 0,{syntheticEvent:p,nativeEvent:p&&p.nativeEvent,dataItem:s})},[r,s]),w=t.createElement(Me.Dialog,{title:d,onClose:u},f,t.createElement(Me.DialogActionsBar,null,t.createElement("button",{className:"k-button",onClick:m},g),t.createElement("button",{className:"k-button",onClick:C},c)));return h.canUseDOM?Vt.createPortal(w,document&&document.body):null},sr=ie.TreeListRow;Object.defineProperty(D,"getSelectedState",{enumerable:!0,get:()=>b.getSelectedState}),Object.defineProperty(D,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>b.getSelectedStateFromKeyDown}),Object.defineProperty(D,"setSelectedState",{enumerable:!0,get:()=>b.setSelectedState}),D.GANTT_COL_INDEX_ATTRIBUTE=sa,D.GANTT_PREVENT_SELECTION_ELEMENT=la,D.GANTT_ROW_INDEX_ATTRIBUTE=oa,D.Gantt=Be,D.GanttBooleanFilter=jn,D.GanttDateFilter=Xn,D.GanttDayView=Ue,D.GanttForm=rr,D.GanttMonthView=qe,D.GanttNumericFilter=Zn,D.GanttRemoveDialog=or,D.GanttRow=sr,D.GanttTextFilter=Yn,D.GanttWeekView=Ie,D.GanttYearView=$e,D.addDependency=ja,D.addTask=Xa,D.createDataTree=Ca,D.extendDataItem=pa,D.filterBy=ma,D.mapTree=Oe,D.orderBy=ha,D.removeTask=Qa,D.updateTask=Ja,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});
5
+ (function(D,be){typeof exports=="object"&&typeof module<"u"?be(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-date-math"),require("@progress/kendo-react-data-tools"),require("@progress/kendo-react-treelist"),require("@progress/kendo-react-intl"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-buttons"),require("react-dom"),require("@progress/kendo-react-form"),require("@progress/kendo-react-dialogs"),require("@progress/kendo-react-labels"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-dateinputs")):typeof define=="function"&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-date-math","@progress/kendo-react-data-tools","@progress/kendo-react-treelist","@progress/kendo-react-intl","@progress/kendo-svg-icons","@progress/kendo-react-buttons","react-dom","@progress/kendo-react-form","@progress/kendo-react-dialogs","@progress/kendo-react-labels","@progress/kendo-react-inputs","@progress/kendo-react-dateinputs"],be):(D=typeof globalThis<"u"?globalThis:D||self,be(D.KendoReactGantt={},D.React,D.PropTypes,D.KendoReactCommon,D.KendoDateMath,D.KendoReactDataTools,D.KendoReactTreelist,D.KendoReactIntl,D.KendoSvgIcons,D.KendoReactButtons,D.ReactDOM,D.KendoReactForm,D.KendoReactDialogs,D.KendoReactLabels,D.KendoReactInputs,D.KendoReactDateinputs))})(this,function(D,be,na,h,E,b,de,B,Xe,ae,aa,oe,Me,le,At,ra){"use strict";"use client";function Je(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(a,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return a.default=e,Object.freeze(a)}const t=Je(be),i=Je(na),Vt=Je(aa),sa=b.TABLE_ROW_INDEX_ATTRIBUTE,oa=b.TABLE_COL_INDEX_ATTRIBUTE,la=b.TABLE_PREVENT_SELECTION_ELEMENT,Ot=new Date().getTime(),Gt=7,ia="hh:mm a",Qe={skeleton:"MEd"},ca="MMM",da="yyyy",Te=100,ua=6,Ae="data-dependency-drag-handle",ga="start",fa="finish",Wt={[Ae]:ga},Pt={[Ae]:fa},Ve="data-task-id",_t={id:"id",start:"start",end:"end",title:"title",percentComplete:"percentComplete",isRollup:"isRollup",isExpanded:"isExpanded",isInEdit:"isInEdit",children:"children",isSelected:"isSelected"},Kt={id:"id",fromId:"fromId",toId:"toId",type:"type"},ha=b.orderBy,ma=b.filterBy,Oe=h.mapTree,pa=h.extendDataItem,Ca=de.createDataTree,Ea=e=>({fields:{..._t,...e}}),wa=e=>({fields:{...Kt,...e}}),Bt=e=>E.getDate(e),et=(e,a)=>E.getDate(E.addDays(e,a||1)),ya=(e,a,n,r)=>n<a&&e<=r;function ie(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()))}const re=4,tt=10,va=(e,a,n,r)=>{const o=[];let l=0,s=0;const c=tt,g=Math.floor(n/2),f=e.top<a.top,d=()=>o.push({left:s,top:l});if(r===0||r===3){const u=r===3?"start":"end";l=e.top,s=e[u],d(),s=Math[u==="start"?"min":"max"](e[u],a[u]),s=u==="start"?s-c:s+c,d(),l=a.top,d(),s=u==="start"?a[u]-re:a[u]+re,d(),Ut(l,s,o,u!=="start")}else{const u=r===2?"start":"end",m=r===2?"end":"start",C=r===2?e[u]-tt*2>=a[m]:e[u]+tt*2<=a[m];l=e.top,s=e[u],d(),s=u==="start"?s-c:s+c,d(),C||(l=f?l+g:l-g,d(),s=u==="start"?a[m]+c:a[m]-c,d()),l=a.top,d(),s=m==="start"?a[m]-re:a[m]+re,d(),Ut(l,s,o,m!=="start")}return o},Ut=(e,a,n,r)=>r?Da(e,a,n):ba(e,a,n),Da=(e,a,n)=>{n.push({top:e-re/2,left:a}),n.push({top:e,left:a-re+1}),n.push({top:e+re/2,left:a}),n.push({top:e,left:a})},ba=(e,a,n)=>{n.push({top:e+re/2,left:a}),n.push({top:e,left:a+re-1}),n.push({top:e-re/2,left:a}),n.push({top:e,left:a})},qt=e=>{if(e.workWeekStart===void 0||e.workWeekEnd===void 0)return[];const a=[];let n=e.workWeekStart;for(a.push(n);e.workWeekEnd!==n;)n>6?n-=7:n++,a.push(n);return a},Ta=(e,a)=>{const n=e.getDay();return a.indexOf(n)>-1},$t=(e,{step:a,timezone:n})=>{const r=[],o=E.ZonedDate.fromLocalDate(e.start,n),l=E.ZonedDate.fromLocalDate(e.end,n);let s=o.clone();for(;s.getTime()<l.getTime();){const c=s.clone(),g=c.clone().addTime(a),f=new Date(c.getTime()),u={end:new Date(g.getTime()),start:f,zonedStart:c,zonedEnd:g};r.push(u),s=s.addTime(a)}return r},Sa=(e,{timezone:a},n)=>{const r=[],o=E.ZonedDate.fromLocalDate(e.start,a),l=E.ZonedDate.fromLocalDate(e.end,a);for(let s=o.clone(),c=0;s.getTime()<l.getTime();c++){const g=s.clone(),f=et(E.firstDayInWeek(E.getDate(g),n.firstDay()),Gt),d=E.ZonedDate.fromUTCDate(ie(f),a),u=d.getTime()>l.getTime()?l.clone():d;s=u.clone();const m=new Date(g.getTime()),w={end:new Date(u.getTime()),start:m,zonedStart:g,zonedEnd:u};r.push(w)}return r},ka=(e,{timezone:a})=>{const n=[],r=E.ZonedDate.fromLocalDate(e.start,a),o=E.ZonedDate.fromLocalDate(e.end,a);for(let l=r.clone(),s=0;l.getTime()<o.getTime();s++){const c=l.clone(),g=E.ZonedDate.fromLocalDate(E.addMonths(new Date(c.getTime()),1),a);l=g.clone();const f=new Date(c.getTime()),u={end:new Date(g.getTime()),start:f,zonedStart:c,zonedEnd:g};n.push(u)}return n},Ia=(e,{timezone:a})=>{const n=[],r=E.ZonedDate.fromLocalDate(e.start,a),o=E.ZonedDate.fromLocalDate(e.end,a);for(let l=r.clone(),s=0;l.getTime()<o.getTime();s++){const c=l.clone(),g=E.ZonedDate.fromLocalDate(E.addMonths(new Date(c.getTime()),12),a);l=g.clone();const f=new Date(c.getTime()),u={end:new Date(g.getTime()),start:f,zonedStart:c,zonedEnd:g};n.push(u)}return n},xa=(e,a,n)=>{const r=n.parseDate(a.workDayStart).getHours(),o=n.parseDate(a.workDayEnd).getHours();return $t(e,{step:E.MS_PER_MINUTE*a.slotDuration,timezone:a.timezone}).map(s=>{const c=s.zonedStart.getHours();return{range:s,isWork:c>=r&&c<o,span:1,text:n.formatDate(s.zonedStart,ia),type:"time"}})},Yt=(e,a,n)=>$t(e,{step:E.MS_PER_DAY,timezone:a.timezone}).map(o=>({range:o,isWork:Ta(o.start,a.workDays),span:1,text:n.formatDate(o.zonedStart,Qe),type:"day"})),Zt=(e,a,n)=>Sa(e,{timezone:a.timezone},n).map(o=>{const l=Math.round((o.zonedEnd.getTime()-o.zonedStart.getTime())/E.MS_PER_DAY);return{range:o,isWork:!1,span:l,text:`${n.formatDate(o.zonedStart,Qe)} - ${n.formatDate(o.zonedEnd,Qe)}`,type:"week"}}),jt=(e,a,n)=>ka(e,{timezone:a.timezone}).map(o=>{const l=Math.round((o.zonedEnd.getTime()-o.zonedStart.getTime())/E.MS_PER_DAY);return{range:o,isWork:!1,span:l,text:n.formatDate(o.zonedStart,ca),type:"month"}}),Ra=(e,a,n)=>Ia(e,{timezone:a.timezone}).map(o=>{const l=Math.round((o.zonedEnd.getTime()-o.zonedStart.getTime())/E.MS_PER_DAY);return{range:o,isWork:!1,span:l,text:n.formatDate(o.zonedStart,da),type:"year"}}),Na=(e,a,n)=>{const r=n;return t.createElement("table",{className:"k-table k-table-md",ref:a,"aria-hidden":!0},t.createElement("tbody",{className:"k-table-tbody"},e.map((o,l)=>t.createElement("tr",{className:"k-table-row",key:l},o.map((s,c)=>t.createElement("td",{key:s.range.start.getTime(),colSpan:s.span,className:h.classNames("k-table-th",{"k-header":!0,"k-nonwork-hour":!s.isWork})},r?t.createElement(r,{rowIndex:l,index:c,range:s.range,text:s.text,isWork:s.isWork,type:s.type}):s.text))))))},Fa=(e,a)=>{const n=e[e.length-1];return t.createElement("table",{className:"k-table k-table-md k-gantt-columns",ref:a,"aria-hidden":!0},t.createElement("tbody",{className:"k-table-tbody"},t.createElement("tr",{className:"k-table-row"},n.map(r=>t.createElement("td",{key:r.range.start.getTime(),colSpan:r.span,className:h.classNames("k-table-td",{"k-nonwork-hour":!r.isWork})})))))},La=(e,a)=>{const n=e[e.length-1];let r=0,o=0;return n.forEach(l=>{const s=l.span;o+=s,s>r&&(r=s)}),Math.round(o*a/r)},nt=(e,a)=>!!h.getter(a)(e),Xt=(e,a)=>!!h.getter(a)(e),za=(e,a)=>n=>nt(n,e)&&Xt(n,a)?[...h.getter(a)(n)]:[],at=t.createContext([]),Ha=()=>t.useContext(at);at.displayName="KendoReactGanttTaskDataContext";const rt=t.createContext([]),Ma=()=>t.useContext(rt);rt.displayName="KendoReactGanttDependencyDataContext";const st=t.createContext(_t),ot=()=>t.useContext(st);st.displayName="KendoReactGanttTaskModelFieldsContext";const lt=t.createContext(Kt),Jt=()=>t.useContext(lt);lt.displayName="KendoReactGanttDependencyModelFieldsContext";const it=t.createContext({}),Se=()=>t.useContext(it);it.displayName="KendoReactGanttPropsContext";const ct=t.createContext({start:new Date,end:new Date,zonedStart:E.ZonedDate.fromLocalDate(new Date),zonedEnd:E.ZonedDate.fromLocalDate(new Date)}),ke=()=>t.useContext(ct);ct.displayName="KendoReactGanttDateRangeContext";const dt=t.createContext([]),Aa=()=>t.useContext(dt);dt.displayName="KendoReactGanttViewsContext";const ut=t.createContext(["week",h.noop]),Qt=()=>t.useContext(ut);ut.displayName="KendoReactGanttActiveViewContext";const gt=t.createContext(0),en=()=>t.useContext(gt);gt.displayName="KendoReactGanttRowHeightContext";const ft=t.createContext(0),Va=()=>t.useContext(ft);ft.displayName="KendoReactGanttToolbarHeightContext";const ht=t.createContext({onDataStateChange:h.noop,onSortChange:h.noop,onFilterChange:h.noop,onColumnMenuFilterChange:h.noop,onExpandChange:h.noop,onRowClick:h.noop,onRowDoubleClick:h.noop,onRowContextMenu:h.noop,onColumnResize:h.noop,onColumnReorder:h.noop,onDependencyCreate:h.noop,onKeyDown:h.noop,onSelectionChange:h.noop,onHeaderSelectionChange:h.noop}),Oa=()=>t.useContext(ht);ht.displayName="KendoReactGanttEventsContext";const mt=t.createContext({onTaskClick:h.noop,onTaskDoubleClick:h.noop,onTaskContextMenu:h.noop}),Ga=()=>t.useContext(mt);mt.displayName="KendoReactGanttTaskEventsContext";const tn=({children:e,taskData:a,dependencyData:n,taskModelFields:r,dependencyModelFields:o,props:l,dateRange:s,views:c,activeView:g,rowHeight:f,toolbarHeight:d,events:u,taskEvents:m})=>t.createElement(it.Provider,{value:l},t.createElement(at.Provider,{value:a},t.createElement(rt.Provider,{value:n},t.createElement(st.Provider,{value:r},t.createElement(lt.Provider,{value:o},t.createElement(ct.Provider,{value:s},t.createElement(dt.Provider,{value:c},t.createElement(ut.Provider,{value:g},t.createElement(gt.Provider,{value:f},t.createElement(ft.Provider,{value:d},t.createElement(ht.Provider,{value:u},t.createElement(mt.Provider,{value:m},e))))))))))));tn.displayName="KendoReactGanttContext";const pt=t.createContext([{current:{}},h.noop]),nn=()=>t.useContext(pt);pt.displayName="KendoReactGanttViewContext";const Ct=t.createContext(0),Wa=()=>t.useContext(Ct);Ct.displayName="KendoReactGanttViewTimelineWidthContext";const Et=t.createContext({onDependencyHandlePress:h.noop,onDependencyHandleDrag:h.noop,onDependencyHandleRelease:h.noop,isEnabled:!1,draggedId:null}),Pa=()=>t.useContext(Et);Et.displayName="KendoReactGanttViewDependencyDragContext";const an=({children:e,tasksStore:a,timelineWidth:n,dependencyDrag:r})=>t.createElement(pt.Provider,{value:a},t.createElement(Ct.Provider,{value:n},t.createElement(Et.Provider,{value:r},e)));an.displayName="KendoReactGanttViewContext";var wt=(e=>(e[e.add=0]="add",e[e.remove=1]="remove",e))(wt||{});const _a=()=>{const e=t.useRef({}),a=t.useCallback(n=>{switch(n.type){case 0:e.current[n.id]=n.itemRef;break;case 1:delete e.current[n.id];break}},[]);return[e,a]},Ka=(e,a,n,r)=>{const o=t.useRef(null),[,l]=nn();t.useImperativeHandle(o,()=>({element:r.current,dataItem:e})),t.useImperativeHandle(n,()=>o.current),t.useLayoutEffect(()=>{const s=o.current;if(s)return l({type:wt.add,itemRef:s,id:a}),()=>{l({type:wt.remove,itemRef:s,id:a})}})},rn=t.forwardRef((e,a)=>{const n=ke(),r=ot(),o=Wa(),l=Pa(),s=Ga(),c=t.useRef(null),g=t.useRef(null);Ka(e.dataItem,h.getter(r.id)(e.dataItem),a,c);const f=t.useRef(null),d=h.getter(r.id)(e.dataItem),u=h.getter(r.start)(e.dataItem),m=h.getter(r.end)(e.dataItem),C=h.getter(r.title)(e.dataItem),w=h.getter(r.percentComplete)(e.dataItem),p=h.getter(r.children)(e.dataItem),k=h.getter(r.isSelected)(e.dataItem),H=u&&u.getTime(),V=m&&m.getTime(),L=p&&p.length,N=!L&&H===V,O=H&&V&&ya(n.start,n.end,u,m),[ee,x]=t.useState(!1),X=t.useRef(null),A=t.useRef(null);h.useDraggable(X,{onPress:l.onDependencyHandlePress,onDrag:l.onDependencyHandleDrag,onRelease:l.onDependencyHandleRelease}),h.useDraggable(A,{onPress:l.onDependencyHandlePress,onDrag:l.onDependencyHandleDrag,onRelease:l.onDependencyHandleRelease});const J=t.useCallback(T=>{s.onTaskClick&&s.onTaskClick({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),G=t.useCallback(T=>{s.onTaskDoubleClick&&s.onTaskDoubleClick({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),q=t.useCallback(T=>{s.onTaskContextMenu&&s.onTaskContextMenu({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),v=t.useCallback(T=>{s.onTaskRemoveClick&&s.onTaskRemoveClick({dataItem:e.dataItem,level:e.level,nativeEvent:T&&T.nativeEvent,syntheticEvent:T,target:null})},[e.dataItem,e.level]),M=t.useCallback(()=>{const T=n.start,Q=n.end,I=f.current,R=c.current,U=g.current;if(!O||I===null||R===null)return;const Z=I.clientWidth/(Q.getTime()-T.getTime()),W=(u.getTime()-T.getTime())*Z,P=(m.getTime()-u.getTime())*Z,pe=(I.offsetHeight-R.offsetHeight)/2;R.style.left=`${Math.round(N?W-ua:W)}px`,R.style.top=`${Math.round(pe)}px`,N||(R.style.width=`${Math.round(P)}px`,U!==null&&(U.style.width=`${Math.round(P*(w||0))}px`)),x(!0)},[n.start.getTime(),n.end.getTime(),H,V,O,w,o]);t.useEffect(M,[M]);const te={visibility:ee?void 0:"hidden",display:O?void 0:"none"},K={userSelect:"none",display:l.draggedId===String(d)?"block":void 0};return t.createElement("td",{ref:f,key:d,role:"presentation"},N?t.createElement("div",{"aria-hidden":!0,className:h.classNames({"k-task":!0,"k-task-milestone":!0,"k-selected":k&&!Array.isArray(k)}),style:te,ref:c,[Ve]:d,onClick:J,onDoubleClick:G,onContextMenu:q},t.createElement("div",{className:"k-task-milestone-content"}),l.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-start",ref:X,style:K,...Wt}),l.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-end",ref:A,style:K,...Pt})):t.createElement("div",{"aria-hidden":!0,className:h.classNames({"k-task":!0,"k-task-summary":L,"k-task-single":!L,"k-selected":k&&!Array.isArray(k)}),ref:c,style:te,[Ve]:d,onClick:J,onDoubleClick:G,onContextMenu:q},L?t.createElement("div",{className:"k-task-summary-progress",ref:g},t.createElement("div",{className:"k-task-summary-complete"})):t.createElement("div",{className:"k-task-complete",ref:g}),!L&&t.createElement(t.Fragment,null,t.createElement("div",{className:"k-task-content"},C),s.onTaskRemoveClick?t.createElement("span",{className:"k-task-actions"},t.createElement("span",{onClick:v,className:"k-link k-task-delete","aria-label":"Delete"},t.createElement(h.IconWrap,{name:"x",icon:Xe.xIcon}))):null),l.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-start",ref:X,style:K,...Wt}),l.isEnabled&&t.createElement("div",{className:"k-task-dot k-task-end",ref:A,style:K,...Pt})))});rn.displayName="KendoReactGanttTask";const sn=e=>{const{dependency:a}=e,[n]=nn(),r=t.useRef(null),o=Jt(),l=en(),[s,c]=t.useState(!1),g=()=>{if(r.current===null||n.current===null){c(!1);return}const f=n.current[h.getter(o.fromId)(a)],d=n.current[h.getter(o.toId)(a)];if(!f||!d){c(!1);return}const u=f.element,m=d.element;if(!u||!m){c(!1);return}if(s===!1){c(!0);return}const C={top:u.offsetTop+u.offsetHeight/2,start:u.offsetLeft,end:u.offsetLeft+u.offsetWidth},w={top:m.offsetTop+m.offsetHeight/2,start:m.offsetLeft,end:m.offsetLeft+m.offsetWidth},p=h.getter(o.type)(a),k=va(C,w,l,p);k&&k.length&&r.current.setAttribute("points",k.map(H=>`${H.left},${H.top}`).join(" "))};return t.useEffect(g),t.createElement("polyline",{ref:r,style:{display:s?void 0:"none"}})};sn.displayName="KendoReactGanttDependency";class yt extends t.Component{constructor(a){super(a),this.state={activeId:void 0,level:0},this.tableElement=null,this.tbodyElement=null,this.wrapperScrollLeft=0,this.wrapperScrollTop=0,this.updateOnScroll=!1,this.tbodyOffsetTop=0,this.prevData=[],this.flattedData=[],this.element=null,this.contextStateRef={current:void 0},this.navigationStateRef={current:void 0},this.scrollIntoView=n=>{if(!this.element)return;const{rowIndex:r=0}=n,{rowHeight:o=0}=this.props;this.element.scroll(0,(r-1)*o)},this.getColumns=n=>{const r=n.filter(l=>l.declarationIndex>=0&&l.parentIndex===-1),o=l=>(l.sort((s,c)=>s.declarationIndex-c.declarationIndex),l.map(s=>{const{declarationIndex:c,parentIndex:g,depth:f,colSpan:d,rowSpan:u,index:m,kFirst:C,groupable:w,children:p,...k}=s;return p.length?{children:o(p),...k}:k}));return o(r)},this.onKeyDown=n=>{if(b.tableKeyboardNavigation.onKeyDown(n,{contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),this.props.onKeyDown){const{mode:r,cell:o}=b.getSelectionOptions(this.props.selectable),l={dataItems:this.getLeafDataItems(),mode:r,cell:o,componentId:this.props.treelistId,selectedField:this.props.selectedField,...this.getEventArguments(n)};this.props.onKeyDown.call(void 0,l)}},this.onFocus=n=>{b.tableKeyboardNavigation.onFocus(n,{contextStateRef:this.contextStateRef})},this.onRowDrag=n=>{if(this.props.onRowDrag){const r={...n,target:this};this.props.onRowDrag.call(void 0,r)}},this.onRowDrop=n=>{if(this.props.onRowDrop){const r={...n,target:this};this.props.onRowDrop.call(void 0,r)}},this.onColumnReorder=(n,r,o)=>{const{extendedColumns:l}=this.props,s=l[n].depth,c=d=>{do d++;while(d<l.length&&l[d].depth>s);return d},g=[...l],f=g.splice(n,c(n)-n);if(g.splice(n<r?c(r-f.length):r,0,...f),g.filter(d=>d.declarationIndex>=0).forEach((d,u)=>d.orderIndex=u),this.props.onColumnReorder){const d={target:this,columns:this.getColumns(g),nativeEvent:o};this.props.onColumnReorder.call(void 0,d)}},this.onColumnResize=(n,r,o,l,s)=>{if(this.props.onColumnResize){const c=this.props.extendedColumns.filter(f=>f.children.length===0).reduce((f,d)=>f+=parseFloat(String(d.width)),0);this.tableElement&&(this.tableElement.style.width=c+"px");const g={columns:this.getColumns(this.props.extendedColumns),totalWidth:c,index:n,nativeEvent:l,newWidth:r,oldWidth:o,end:s,target:this};this.props.onColumnResize.call(void 0,g)}},this.onScroll=n=>{const r=n.currentTarget.scrollLeft,o=n.currentTarget.scrollTop,{columnVirtualization:l,scrollable:s,rowHeight:c=0}=this.props,g=c,f=0;let d=!1;l&&Math.abs(this.wrapperScrollLeft-r)>f&&(this.wrapperScrollLeft=r,d=!0),s==="virtual"&&Math.abs(this.wrapperScrollTop-o)>g&&(this.wrapperScrollTop=o,d=!0),d&&(this.updateOnScroll=!0,this.forceUpdate())},this.calculateSizes=n=>{if(!n||this.props.scrollable==="none")return;const r=Array.from(n.childNodes),o=r.find(c=>c.nodeName==="TABLE"),l=this.props.toolbar&&r.find(c=>c.nodeType===1&&c.classList.contains("k-grid-toolbar"));let s=0;if(l){const c=l.style.boxSizing;l.style.boxSizing="border-box",s=parseFloat(String(window.getComputedStyle(l).height))||l.offsetHeight,l.style.boxSizing=c,l.getAttribute("style")||l.removeAttribute("style")}this.tbodyOffsetTop=o.tBodies[0].offsetTop,de.setHeaderRowsTop(o,s)},this.onItemChange=n=>{if(n.field===this.props.expandField){const r=this.props.onExpandChange;if(r){const o={...this.getEventArguments(n.syntheticEvent),dataItem:n.dataItem,level:n.level,value:n.value};r.call(void 0,o)}return}if(this.props.onItemChange){const r={...this.getEventArguments(n.syntheticEvent),dataItem:n.dataItem,level:n.level,field:n.field,value:n.value};this.props.onItemChange.call(void 0,r)}},this.onHeaderSelectionChange=n=>{if(this.props.onHeaderSelectionChange){const r={field:n.field,nativeEvent:n.syntheticEvent&&n.syntheticEvent.nativeEvent,syntheticEvent:n.syntheticEvent,target:this,dataItems:this.getLeafDataItems()};this.props.onHeaderSelectionChange.call(void 0,r)}},this.selectionRelease=n=>{if(this.props.onSelectionChange){const r={syntheticEvent:void 0,target:this,selectedField:this.props.selectedField||"",componentId:this.props.treelistId,dataItems:this.getLeafDataItems(),dataItem:null,level:[],...n};this.props.onSelectionChange.call(void 0,r)}},this.onSortChange=(n,r,o)=>{this.onDataStateChange(this.props.onSortChange,{sort:r,field:o},n)},this.onFilterChange=n=>{const{filter:r,field:o}=n;this.onDataStateChange(this.props.onFilterChange,{filter:r,field:o},n.syntheticEvent)},this.onColumnMenuFilterChange=(n,r,o)=>{if(!o)return;const{onColumnMenuFilterChange:l}=this.props;if(!l)return;const s={syntheticEvent:n,filter:r,field:o,target:this,nativeEvent:n.nativeEvent};l.call(void 0,s)},this.onExpandChange=(n,r,o)=>{const{expandField:l,onExpandChange:s}=this.props;if(l&&s){const c={...this.getEventArguments(n),dataItem:r,level:o,value:nt(r,this.props.expandField)};s.call(void 0,c)}},this.onRowClick=(n,r)=>{if(this.props.onRowClick&&n.target.nodeName==="TD"){const o={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowClick.call(void 0,o)}},this.rowDoubleClick=(n,r)=>{if(this.props.onRowDoubleClick&&n.target.nodeName==="TD"){const o={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowDoubleClick.call(void 0,o)}},this.rowContextMenu=(n,r)=>{if(this.props.onRowContextMenu&&n.target.nodeName==="TD"){const o={dataItem:r.dataItem,level:r.level,...this.getEventArguments(n)};this.props.onRowContextMenu.call(void 0,o)}},this.onPageChange=n=>{if(this.props.onPageChange){const r={...this.getEventArguments(n.syntheticEvent),skip:n.skip,take:n.take};this.props.onPageChange.call(void 0,r)}},this.onDataStateChange=(n,r,o)=>{if(n&&n.call(void 0,{...this.getEventArguments(o),...r}),this.props.onDataStateChange){const l={...this.getEventArguments(o),dataState:{...this.getDataState(),...r}};this.props.onDataStateChange.call(void 0,l)}},this.getDataState=()=>({filter:this.props.filter,sort:this.props.sort}),this.getEventArguments=n=>({nativeEvent:n&&n.nativeEvent,syntheticEvent:n,target:this}),this.getLeafDataItems=()=>this.flatData.map(n=>n.dataItem),this.dragLogic=new b.CommonDragLogic(this.onColumnReorder,h.noop,h.noop),this.columnResize=new b.ColumnResize(this.onColumnResize),b.tableKeyboardNavigation.onConstructor({navigatable:!!a.navigatable,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef,idPrefix:a.idPrefix})}get document(){if(h.canUseDOM)return this.element&&this.element.ownerDocument||document}componentDidMount(){this.calculateSizes(this.element),b.tableKeyboardNavigation.onComponentDidMount({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}getSnapshotBeforeUpdate(){return b.tableKeyboardNavigation.onGetSnapshotBeforeUpdate({document:this.document,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef}),null}componentDidUpdate(a){a.columns!==this.props.columns&&this.calculateSizes(this.element),b.tableKeyboardNavigation.onComponentDidUpdate({scope:this.element||void 0,contextStateRef:this.contextStateRef,navigationStateRef:this.navigationStateRef})}componentWillUnmount(){this.columnResize.columns=[],this.dragLogic.columns=[],this.prevData=[],this.flattedData=[],this.updateOnScroll=!1}render(){const{filterRow:a,scrollable:n="scrollable",resizable:r=!1,reorderable:o=!1,skip:l,take:s,afterContent:c,extendedColumns:g=[],columnsMap:f}=this.props,d=g.some(v=>!!v.filter)||a!==void 0,u=a||b.FilterRow,m=b.tableKeyboardNavigationTools.getIdPrefix(this.navigationStateRef);this.columnResize.columns=g,this.columnResize.resizable=r,this.dragLogic.columns=g,this.dragLogic.reorderable=o,this.dragLogic.groupable=!1;const C=g.filter(v=>v.children.length===0),w=t.createElement(b.Header,{headerRow:t.createElement(b.HeaderRow,{sort:this.props.sort,sortable:this.props.sortable,sortChange:this.onSortChange,selectionChange:this.onHeaderSelectionChange,columns:g,columnsMap:f,cellRender:this.props.headerCellRender,columnResize:this.columnResize,columnMenu:this.props.columnMenu,columnMenuFilter:this.props.columnMenuFilter,columnMenuFilterChange:this.onColumnMenuFilterChange,pressHandler:this.dragLogic.pressHandler,dragHandler:this.dragLogic.dragHandler,releaseHandler:this.dragLogic.releaseHandler}),filterRow:d&&t.createElement(u,{columns:C,filter:this.props.filter,filterChange:this.onFilterChange,sort:this.props.sort,ariaRowIndex:f.length+1})||void 0,columnResize:this.columnResize}),p=this.props.style||{},{colSpans:k,hiddenColumns:H}=b.tableColumnsVirtualization({enabled:this.props.columnVirtualization,columns:C,scrollLeft:this.wrapperScrollLeft,tableViewPortWidth:parseFloat((p.width||"").toString())}),V=(v,M,te,K,T,Q)=>C.map((I,R)=>{if(H[R])return null;const U=I.id?I.id:R,Z=`k-table-td ${I.className?I.className+" ":""}${I.locked?"k-grid-content-sticky":""}`,W={id:b.tableKeyboardNavigationTools.generateNavigatableId(`${te}-${String(R)}`,m),colSpan:k[R],dataItem:v.dataItem,field:I.field,format:I.format,className:Z||void 0,render:this.props.cellRender,onChange:this.onItemChange,selectionChange:this.props.onSelectionChange?P=>{this.onSelectionChange({event:P,item:v,columnIndex:R,dataIndex:T})}:void 0,level:v.level,expandable:I.expandable,expanded:K,hasChildren:Xt(v.dataItem,this.props.subItemsField),colIndex:R,ariaColumnIndex:I.ariaColumnIndex,onExpandChange:this.onExpandChange,style:I.left!==void 0&&{left:I.left,right:I.right,borderRightWidth:I.rightBorder?"1px":""}||{},isSelected:Array.isArray(Q)&&Q.indexOf(R)>-1};return M&&I.editCell?t.createElement(I.editCell,{...W,onChange:this.onItemChange,key:U}):I.cell?t.createElement(I.cell,{key:U,...W}):t.createElement(de.TreeListCell,{key:U,...W})});let L=this.flatData;const N=L.length;l!==void 0&&s!==void 0&&(L=L.slice(l,l+s)),n==="virtual"&&(L=de.tableRowsVirtualization({rows:L,tableViewPortHeight:parseFloat((p.height||p.maxHeight||"").toString()),scrollTop:this.wrapperScrollTop}),this.updateOnScroll=!1);const O=L.map(v=>v.level),ee=f.length+(d?1:0)+1,x=L.length>0&&L.map((v,M)=>{const te=h.getter(this.props.editField||"")(v.dataItem),K=h.getter(this.props.dataItemKey)(v.dataItem),T=String(K||v.level.join(".")),Q=nt(v.dataItem,this.props.expandField),I=this.props.selectedField?h.getter(this.props.selectedField)(v.dataItem):void 0,R={key:T,level:v.level,levels:O,dataItem:v.dataItem,selectedField:this.props.selectedField,rowHeight:v.height,render:this.props.rowRender,onDrop:this.onRowDrop,onDrag:this.onRowDrag,onClick:P=>this.onRowClick(P,v),onDoubleClick:P=>this.rowDoubleClick(P,v),onContextMenu:P=>this.rowContextMenu(P,v),isAltRow:M%2!==0,expanded:Q,rowIndex:M,ariaRowIndex:ee+M,ariaSetSize:v.levelCount,ariaPosInSet:v.level[v.level.length-1]+1,isSelected:typeof I=="boolean"&&I},U=this.props.editRow,Z=this.props.row||de.TreeListRow,W=V(v,te,T,Q,M,I);return te&&U?t.createElement(U,{...R,key:R.key},W):t.createElement(Z,{...R,key:R.key},W)})||t.createElement("tr",{className:"k-table-row k-grid-norecords"},t.createElement("td",{className:"k-table-td",colSpan:C.length},this.props.noRecords||t.createElement(de.TreeListNoRecords,null))),X=v=>this.props.sort&&this.props.sort.some(M=>M.field===v),A=t.createElement("colgroup",{ref:v=>{this.columnResize.colGroupMain=v}},C.map((v,M)=>t.createElement("col",{key:M.toString(),className:X(v.field)?"k-sorted":void 0,style:v.width!==void 0?{width:v.width}:void 0}))),J=this.props.columnVirtualization||this.props.scrollable==="virtual",G=this.props.selectable&&this.props.selectable.drag?"none":void 0,q=this.props.tableProps||{};return t.createElement(b.TableKeyboardNavigationContext.Provider,{value:this.contextStateRef.current},t.createElement("div",{id:this.props.treelistId,style:this.props.style,className:h.classNames("k-grid k-grid-md",this.props.className,{"k-treelist-scrollable":n!=="none"}),ref:v=>this.element=v,onScroll:J?this.onScroll:void 0,onKeyDown:this.onKeyDown,onFocus:this.onFocus,"aria-rowcount":N,"aria-colcount":C.length,role:"treegrid",...b.tableKeyboardNavigationScopeAttributes},this.props.toolbar,t.createElement(b.TableSelection,{selectable:this.props.selectable,onRelease:this.selectionRelease,childRef:v=>{this.tableElement=v}},t.createElement("table",{className:"k-table k-table-md",...this.props.tableProps||{},style:{...q.style||{},userSelect:G},role:"presentation"},A,w,t.createElement("tbody",{className:"k-table-tbody",...b.tableKeyboardNavigationBodyAttributes,ref:v=>this.tbodyElement=v,role:"presentation"},x))),this.props.pager&&t.createElement(this.props.pager,{className:"k-grid-pager",total:N,skip:l,take:s,onPageChange:this.onPageChange}),o&&t.createElement(t.Fragment,null,t.createElement(b.DropClue,{ref:this.dragLogic.refDropElementClue}),t.createElement(b.DragClue,{ref:this.dragLogic.refDragElementClue})),c))}get flatData(){const{data:a=[],rowHeight:n=0}=this.props;let r=0;const o=()=>{const s={height:n,offsetTop:r};return r+=s.height,s},l=this.updateOnScroll&&this.prevData===a&&this.tbodyOffsetTop>0&&this.flattedData.length?this.flattedData:a.map(s=>({...s,...o()}));return this.prevData=a,this.flattedData=l,l}onSelectionChange(a){if(this.props.onSelectionChange){const{event:n,item:r,dataIndex:o,columnIndex:l}=a,{mode:s,cell:c}=b.getSelectionOptions(this.props.selectable),g={...this.getEventArguments(n.syntheticEvent),dataItem:r.dataItem,level:r.level,startColIndex:l,endColIndex:l,startRowIndex:o,endRowIndex:o,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:s,cell:c,isDrag:!1,componentId:this.props.treelistId,selectedField:this.props.selectedField||""};this.props.onSelectionChange.call(void 0,g)}}}yt.propTypes={data:i.array,resizable:i.bool,reorderable:i.bool,sortable:i.oneOfType([i.bool,i.shape({mode:i.oneOf(["single","multiple"]),allowUnsort:i.bool})]),onSortChange:i.func,sort:i.array,columns:i.arrayOf(i.object),columnVirtualization:i.bool,filter:i.array,onFilterChange:i.func,filterRow:i.any,toolbar:i.any,noRecords:i.any,onExpandChange:i.func,expandField:i.string,subItemsField:i.string,selectedField:i.string,onSelectionChange:i.func,onHeaderSelectionChange:i.func,onRowClick:i.func,onItemChange:i.func,editField:i.string,scrollable:i.oneOf(["none","scrollable","virtual"]),rowHeight:i.number,style:i.object,tableProps:i.object,pager:i.any,skip:i.number,take:i.number,onPageChange:i.func,onDataStateChange:i.func,onColumnResize:i.func,onColumnReorder:i.func,extendedColumns:i.arrayOf(i.object),columnsMap:i.arrayOf(i.array),dataItemKey:i.string.isRequired,afterContent:i.any,navigatable:i.bool,idPrefix:i.string,treelistId:i.string},yt.contextType=b.TableKeyboardNavigationContext;const Ie=t.forwardRef((e,a)=>{const{slotLevels:n,slotWidth:r,timelineHeaderCell:o}=e,{columns:l,noRecords:s,resizable:c,reorderable:g,sortable:f,sort:d,filter:u,columnMenuFilter:m,columnMenu:C,navigatable:w,row:p,selectable:k}=Se(),{onDataStateChange:H,onSortChange:V,onFilterChange:L,onColumnMenuFilterChange:N,onExpandChange:O,onRowClick:ee,onRowDoubleClick:x,onRowContextMenu:X,onColumnResize:A,onColumnReorder:J,onDependencyCreate:G,onKeyDown:q,onSelectionChange:v,onHeaderSelectionChange:M}=Oa(),te=en(),K=Va(),T=ot(),Q=Jt(),I=Ha(),R=Ma(),U=t.useRef(null),Z=t.useRef(null),W=t.useRef(null),P=t.useRef(null),pe=t.useRef(0),Ne=t.useRef(h.useId()),z=t.useRef(h.useId()),ne=t.useRef(null),je=t.useRef(null),It=t.useCallback(S=>{W.current&&W.current.scrollIntoView(S)},[]);t.useImperativeHandle(je,()=>({scrollIntoView:It})),t.useImperativeHandle(a,()=>je.current);const Ce=t.useRef(0),Ee=t.useRef(0),we=t.useRef(0),ye=t.useRef(0),he=t.useRef(null),Fe=t.useRef(null),[me,Le]=t.useState(null),xt=Na(n,U,o),Rt=Fa(n,Z),ve=La(n,r),{extendedColumns:Nt,columnsWidth:Ft,columnsMap:Lt}=t.useMemo(()=>{const S=b.readColumns([...l,{title:"",sortable:!1,resizable:!1,reorderable:!1,width:ve,headerCell:()=>xt,cell:rn,orderIndex:Number.MAX_SAFE_INTEGER,navigatable:!1}],{prevId:0,idPrefix:Ne.current});let _=0;return S.forEach((F,$,j)=>{const Y=$+1===j.length,ge=F.children.length===0;Y?F.isAccessible=!1:(F.locked=!0,ge&&(F.width=F.width||Te)),ge&&(_+=parseFloat(String(F.width)))}),{extendedColumns:S,columnsWidth:_,columnsMap:b.mapColumns(S)}},[l,ve]),[zt,Ht]=_a(),y=t.useCallback(()=>U.current&&U.current.parentElement,[]),ce=()=>{const S=y(),_=Z.current,F=W.current&&W.current.tbodyElement;if(!S||!_||!F)return;const $=F.offsetTop,j=S.offsetLeft,Y=ve;_.style.top=$+"px",_.style.left=j+"px",_.style.width=Y+"px",_.style.height=F.offsetHeight+"px"},ue=()=>{const S=y();S&&(pe.current=S.offsetLeft)};t.useEffect(ce),t.useEffect(ue);const ze=t.useCallback(S=>{if(!P.current)return;const _=S.columns.slice(0,S.columns.length-1);if(S.end)P.current.style.left="0px";else{const F=y();if(!F)return;P.current.style.left=F.offsetLeft-pe.current+"px",ce()}A({...S,columns:_})},[A]),He=t.useCallback(S=>{const _=S.columns.slice(0,S.columns.length-1);J({...S,columns:_})},[A]),Mt=t.useCallback(S=>{const F=(ne.current&&ne.current.ownerDocument?ne.current.ownerDocument:document).elementFromPoint(S.clientX,S.clientY),$=ne.current;if(!F||!F.parentElement||!$)return;const j=$.parentElement,Y=$.firstElementChild;if(!j||!Y)return;const ge=F.getAttribute(Ae);if(ge){const ir=$.offsetTop,cr=$.offsetLeft,dr=j.offsetTop,ur=j.offsetLeft,gr=Y.scrollTop,fr=Y.scrollLeft;we.current=cr+ur,ye.current=ir+dr,Ce.current=S.clientX-we.current+fr,Ee.current=S.clientY-ye.current+gr,he.current=F.parentElement.getAttribute(Ve),Fe.current=ge}},[]),De=t.useCallback(S=>{const _=ne.current;if(!_)return;const F=_.firstElementChild;if(!F)return;const $=F.scrollTop,j=F.scrollLeft,Y=S.clientX-we.current+j,ge=S.clientY-ye.current+$;Math.abs(Ce.current-Y)<10&&Math.abs(Ee.current-ge)<10||Le({startX:Ce.current,startY:Ee.current,endX:Y,endY:ge})},[]),lr=t.useCallback(S=>{const F=(ne.current&&ne.current.ownerDocument?ne.current.ownerDocument:document).elementFromPoint(S.clientX,S.clientY);if(!F||!F.parentElement)return;const $=F.parentElement.getAttribute(Ve),j=F.getAttribute(Ae);if(j&&$!==he.current&&G){let Y;Fe.current==="start"?Y=j==="start"?3:2:Y=j==="start"?1:0,G({fromId:he.current,toId:$,type:Y})}Ce.current=0,Ee.current=0,we.current=0,ye.current=0,he.current=null,Fe.current=null,Le(null)},[G,Le]);return t.createElement(an,{tasksStore:[zt,Ht],timelineWidth:ve,dependencyDrag:{isEnabled:!!G,draggedId:he.current,onDependencyHandlePress:Mt,onDependencyHandleDrag:De,onDependencyHandleRelease:lr}},t.createElement("div",{className:"k-gantt-content",ref:ne,style:{height:`calc(100% - ${K}px)`}},t.createElement(yt,{treelistId:z.current,ref:W,extendedColumns:Nt,columnsMap:Lt,dataItemKey:T.id,data:I,idPrefix:Ne.current,navigatable:w,expandField:T.isExpanded,subItemsField:T.children,editField:T.isInEdit,selectedField:T.isSelected,onDataStateChange:H,onSortChange:V,onFilterChange:L,onExpandChange:O,onRowClick:ee,onRowDoubleClick:x,onRowContextMenu:X,onColumnResize:ze,onColumnReorder:He,onColumnMenuFilterChange:N,onKeyDown:q,onSelectionChange:v,onHeaderSelectionChange:M,tableProps:{style:{width:Ft},className:"k-table k-table-md k-table-layout-fixed"},noRecords:s,rowHeight:te,resizable:c,reorderable:g,sortable:f,sort:d,filter:u,columnMenuFilter:m,columnMenu:C,row:p,selectable:k,afterContent:t.createElement(t.Fragment,null,t.createElement("svg",{className:"k-gantt-dependencies-svg",ref:P,style:{left:0,top:0}},R.map(S=>t.createElement(sn,{key:h.getter(Q.id)(S),dependency:S}))),t.createElement("svg",{className:"k-gantt-dependencies-svg",style:{left:0,top:0,zIndex:3}},me&&t.createElement("polyline",{points:`${me.startX},${me.startY} ${me.endX},${me.endY}`})),I&&I.length?Rt:null)})))});Ie.displayName="KendoReactGanttBaseView";const vt="gantt.weekViewTitle",Dt="gantt.dayViewTitle",bt="gantt.monthViewTitle",Tt="gantt.yearViewTitle",St="gantt.filterClearButton",Ge="gantt.filterEqOperator",We="gantt.filterNotEqOperator",Pe="gantt.filterIsNullOperator",_e="gantt.filterIsNotNullOperator",on="gantt.filterIsEmptyOperator",ln="gantt.filterIsNotEmptyOperator",cn="gantt.filterStartsWithOperator",dn="gantt.filterContainsOperator",un="gantt.filterNotContainsOperator",gn="gantt.filterEndsWithOperator",fn="gantt.filterGteOperator",hn="gantt.filterGtOperator",mn="gantt.filterLteOperator",pn="gantt.filterLtOperator",Cn="gantt.filterIsTrue",En="gantt.filterIsFalse",wn="gantt.filterBooleanAll",yn="gantt.filterAfterOrEqualOperator",vn="gantt.filterAfterOperator",Dn="gantt.filterBeforeOperator",bn="gantt.filterBeforeOrEqualOperator",Ba="gantt.noRecords",Tn="gantt.editSave",kt="gantt.editCancel",Sn="gantt.editorTitle",kn="gantt.editorTaskTitle",In="gantt.editorTaskStart",xn="gantt.editorTaskEnd",Rn="gantt.editorTaskComplete",Nn="gantt.editorValidationRequired",Fn="gantt.editorValidationStart",Ln="gantt.editorValidationEnd",zn="gantt.addTask",Hn="gantt.addChild",Mn="gantt.addAbove",An="gantt.addBelow",Vn="gantt.editorDelete",On="gantt.deleteConfirmation",Gn="gantt.deleteDialogTitle",se={[vt]:"Week",[Dt]:"Day",[bt]:"Month",[Tt]:"Year",[St]:"Clear",[Ge]:"Is equal to",[We]:"Is not equal to",[Pe]:"Is null",[_e]:"Is not null",[on]:"Is empty",[ln]:"Is not empty",[cn]:"Starts with",[dn]:"Contains",[un]:"Does not contain",[gn]:"Ends with",[fn]:"Is greater than or equal to",[hn]:"Is greater than",[mn]:"Is less than or equal to",[pn]:"Is less than",[Cn]:"Is true",[En]:"Is false",[wn]:"(All)",[yn]:"Is after or equal to",[vn]:"Is after",[Dn]:"Is before",[bn]:"Is before or equal to",[Ba]:"No records available",[Tn]:"Save",[kt]:"Cancel",[Sn]:"Task",[kn]:"Title",[In]:"Start",[xn]:"End",[Rn]:"Complete",[Nn]:"Field is required.",[Fn]:"Start time must be be before End time.",[Ln]:"End time must be after Start time.",[zn]:"Add Task",[Hn]:"Add Child",[Mn]:"Add Above",[An]:"Add Below",[Vn]:"Delete",[On]:"Are you sure you want to delete this event?",[Gn]:"Delete Event"},xe=t.forwardRef((e,a)=>{const{slotWidth:n=Ke.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:o}=e,{timezone:l}=Se(),s=B.useInternationalization(),c=t.useRef(null),g=t.useRef(null),f=t.useCallback(w=>{g.current&&g.current.scrollIntoView(w)},[]);t.useImperativeHandle(c,()=>({scrollIntoView:f})),t.useImperativeHandle(a,()=>c.current);const d=ke(),u=e.workWeekStart||Ke.workWeekStart,m=e.workWeekEnd||Ke.workWeekEnd,C=t.useMemo(()=>{const w=qt({workWeekStart:u,workWeekEnd:m}),p=[],k=Zt(d,{timezone:l},s);return k.forEach(H=>{const V=Yt(H.range,{workDays:w,timezone:l},s);p.push.apply(p,V)}),r&&p[0]&&(r.current=p[0].range),[k,p]},[l,d.start.getTime(),d.end.getTime(),s,u,m]);return t.createElement(Ie,{ref:g,slotWidth:n,slotLevels:C,timelineHeaderCell:o})}),Ke={name:"week",dateRange:({intl:e,tasksStart:a,tasksEnd:n,timezone:r})=>{const o=E.ZonedDate.fromLocalDate(a,r),l=E.ZonedDate.fromLocalDate(n,r),s=Bt(E.firstDayInWeek(E.getDate(o),e.firstDay())),c=et(E.firstDayInWeek(E.getDate(l),e.firstDay()),Gt),g=E.ZonedDate.fromUTCDate(ie(s),r),f=E.ZonedDate.fromUTCDate(ie(c),r);return{start:new Date(g.getTime()),end:new Date(f.getTime()),zonedStart:g,zonedEnd:f}},title:e=>e.toLanguageString(vt,se[vt]),slotWidth:Te,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};xe.defaultProps=Ke,xe.propTypes={name:i.string,dateRange:i.oneOfType([i.func,i.object]),title:i.oneOfType([i.string,i.func]),slotWidth:i.number,workWeekStart:i.number,workWeekEnd:i.number,workDayStart:i.string,workDayEnd:i.string},xe.displayName="KendoReactGanttWeekView";const Ua=(e,a,n)=>{const[r,o]=t.useState(a||e),l=t.useCallback((s,c)=>{o(s),n&&n.call(void 0,{...c,value:s})},[n,o]);return[a!==void 0?a:r,l]},Wn=e=>{const[a,n]=Qt(),r=B.useLocalization(),o=t.useMemo(()=>typeof e.view.title=="function"?e.view.title.call(void 0,r):e.view.title,[e.view.title,r]),l=t.useCallback(()=>{e.view.name&&n(e.view.name)},[n,e.view.name]);return t.createElement(ae.Button,{role:"button",type:"button",tabIndex:-1,togglable:!0,selected:e.view.name===a,onClick:l},o)};Wn.displayName="KendoReactGanttViewSelectorItem";const Pn=t.forwardRef(()=>{const e=Aa(),[a,n]=Qt(),r=e.find(s=>s.props.name===a),o=B.useLocalization(),l=t.useCallback(s=>{n&&(s.syntheticEvent.preventDefault(),n(s.item.name))},[n]);return t.createElement("div",{className:"k-gantt-views-wrapper"},t.createElement(ae.ButtonGroup,{className:"k-gantt-views"},e.map(s=>t.createElement(Wn,{key:s.props.name,view:s.props}))),r&&t.createElement(ae.DropDownButton,{className:"k-views-dropdown",onItemClick:l,popupSettings:{popupClass:"k-gantt-toolbar"},textField:"title",items:e.map(s=>({...s.props,selected:s.props.name===a,title:typeof s.props.title=="function"?s.props.title.call(void 0,o):s.props.title})),text:t.createElement(t.Fragment,null,typeof r.props.title=="function"?r.props.title.call(void 0,o):r.props.title,t.createElement(h.IconWrap,{name:"caret-alt-down",icon:Xe.caretAltDownIcon}))}))});Pn.displayName="KendoReactGanttViewSelectorList";const _n=t.forwardRef((e,a)=>{const{className:n,...r}=e,o=t.useRef(null);return t.useImperativeHandle(a,()=>({element:o.current,props:e})),t.createElement(ae.ToolbarItem,{ref:l=>{l&&(o.current=l.element)},className:h.classNames("k-gantt-views",n),...r},e.children)});_n.displayName="KendoReactGanttViewSelector";const Kn=t.forwardRef((e,a)=>{const{className:n,...r}=e,o=t.useRef(null),l=t.useRef(null);t.useImperativeHandle(l,()=>({element:o.current,props:e})),t.useImperativeHandle(a,()=>l.current);const s=t.useMemo(()=>h.classNames("k-gantt-toolbar k-gantt-header",n),[n]);return t.createElement(ae.Toolbar,{ref:c=>{c&&(o.current=c.element)},className:s,...r},e.children)});Kn.displayName="KendoReactGanttToolbar";const Bn={name:"@progress/kendo-react-gantt",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},Un=t.forwardRef((e,a)=>{const n=B.useLocalization(),r=u=>n.toLanguageString(u,se[u]),o=r(zn),l=r(Hn),s=r(Mn),c=r(An),g=t.useCallback(u=>{u.syntheticEvent.preventDefault();const m=u.item&&u.item.direction?u.item.direction:"none";e.onClick&&e.onClick({nativeEvent:u.nativeEvent,syntheticEvent:u.syntheticEvent,direction:m})},[e.onClick]),f=t.useCallback(u=>{u.preventDefault(),e.onClick&&e.onClick({nativeEvent:u&&u.nativeEvent,syntheticEvent:u,direction:"none"})},[e.onClick]),d=t.createElement(t.Fragment,null,t.createElement(h.IconWrap,{name:"plus",icon:Xe.plusIcon}),o);return e.selectedTask?t.createElement(ae.DropDownButton,{className:"k-views-dropdown",onItemClick:g,popupSettings:{popupClass:"k-gantt-toolbar"},textField:"title",items:[{title:l,direction:"child"},{title:s,direction:"above"},{title:c,direction:"below"}],text:d}):t.createElement(ae.Button,{onClick:f},d)});Un.displayName="KendoReactGanttAddButton";const Be=t.forwardRef((e,a)=>{h.validatePackage(Bn);const n=h.shouldShowValidationUI(Bn),{columns:r=Re.columns,taskData:o=Re.taskData,dependencyData:l=Re.dependencyData,style:s,className:c,noRecords:g,timezone:f,rowHeight:d=Re.rowHeight,resizable:u,reorderable:m,sortable:C,sort:w,filter:p,columnMenuFilter:k,columnMenu:H,navigatable:V,toolbar:L,row:N,selectable:O}=e,ee=B.useInternationalization(),{fields:x}=t.useMemo(()=>Ea(e.taskModelFields),[e.taskModelFields]),{fields:X}=t.useMemo(()=>wa(e.dependencyModelFields),[e.dependencyModelFields]),A=t.useCallback(za(x.isExpanded,x.children),[x.isExpanded,x.children]),J=t.useRef(null),G=t.useRef(null),q=t.useRef(null),v=t.useRef(null),M=t.useRef(null),te=t.useCallback(y=>{const ce=h.getter(x.start)(y),ue=h.getter(x.end)(y),ze=h.getter(x.isSelected)(y);(!G.current||ce<G.current)&&(G.current=ce),(!q.current||ue>q.current)&&(q.current=ue),ze&&(v.current=y)},[x.start,x.end]),K=t.useMemo(()=>(G.current=null,q.current=null,v.current=null,de.flatData(o,A,te)),[o,A]);(!G.current||!q.current)&&(G.current=new Date(Ot),q.current=new Date(Ot));const T=t.Children.toArray(e.children||[t.createElement(xe,{key:"week",firstSlotRangeRef:M})]),[Q,I]=Ua(e.defaultView||T[0].props.name,e.view,e.onViewChange),R=T.find(y=>y.props.name===Q)||T[0],U=typeof R.props.dateRange=="function"?R.props.dateRange.call(void 0,{intl:ee,tasksStart:G.current,tasksEnd:q.current,timezone:f}):R.props.dateRange,Z=t.useRef(null),[W,P]=t.useState(0);t.useLayoutEffect(()=>{Z.current&&P(Z.current.element.offsetHeight)},[]);const pe=t.useCallback(y=>{J.current&&J.current.scrollIntoView(y)},[]),Ne=t.useRef(null),z=t.useRef(null);t.useImperativeHandle(z,()=>({props:e,element:Ne.current,scrollIntoView:pe})),t.useImperativeHandle(a,()=>z.current);const ne=t.useCallback(y=>{e.onDataStateChange&&e.onDataStateChange.call(void 0,{...y,target:z.current})},[e.onDataStateChange]),je=t.useCallback(y=>{e.onSortChange&&e.onSortChange.call(void 0,{...y,target:z.current})},[e.onSortChange]),It=t.useCallback(y=>{e.onKeyDown&&e.onKeyDown.call(void 0,{...y,target:z.current})},[e.onKeyDown]),Ce=t.useCallback(y=>{e.onSelectionChange&&e.onSelectionChange.call(void 0,{...y,target:z.current})},[e.onSelectionChange]),Ee=t.useCallback(y=>{e.onHeaderSelectionChange&&e.onHeaderSelectionChange.call(void 0,{...y,target:z.current})},[e.onHeaderSelectionChange]),we=t.useCallback(y=>{e.onFilterChange&&e.onFilterChange.call(void 0,{...y,target:z.current})},[e.onFilterChange]),ye=t.useCallback(y=>{e.onColumnMenuFilterChange&&e.onColumnMenuFilterChange.call(void 0,{...y,target:z.current})},[e.onColumnMenuFilterChange]),he=t.useCallback(y=>{e.onExpandChange&&e.onExpandChange.call(void 0,{...y,target:z.current})},[e.onExpandChange]),Fe=t.useCallback(y=>{e.onAddClick&&e.onAddClick.call(void 0,{...y,target:z.current,selectedDataItem:v.current,slotStart:M.current&&new Date(M.current.start.getTime()),slotEnd:M.current&&new Date(M.current.end.getTime())})},[e.onAddClick]),me=t.useCallback(y=>{e.onColumnResize&&e.onColumnResize.call(void 0,{...y,target:z.current})},[e.onColumnResize]),Le=t.useCallback(y=>{e.onColumnReorder&&e.onColumnReorder.call(void 0,{...y,target:z.current})},[e.onColumnReorder]),xt=t.useCallback(y=>{e.onRowClick&&e.onRowClick.call(void 0,{...y,target:z.current})},[e.onRowClick]),Rt=t.useCallback(y=>{e.onRowDoubleClick&&e.onRowDoubleClick.call(void 0,{...y,target:z.current})},[e.onRowClick]),ve=t.useCallback(y=>{e.onRowContextMenu&&e.onRowContextMenu.call(void 0,{...y,target:z.current})},[e.onRowClick]),Nt=t.useCallback(y=>{e.onTaskClick&&e.onTaskClick.call(void 0,{...y,target:z.current})},[e.onTaskClick]),Ft=t.useCallback(y=>{e.onTaskDoubleClick&&e.onTaskDoubleClick.call(void 0,{...y,target:z.current})},[e.onTaskDoubleClick]),Lt=t.useCallback(y=>{e.onTaskContextMenu&&e.onTaskContextMenu.call(void 0,{...y,target:z.current})},[e.onTaskContextMenu]),zt=t.useCallback(y=>{e.onTaskRemoveClick&&e.onTaskRemoveClick.call(void 0,{...y,target:z.current})},[e.onTaskRemoveClick]),Ht=t.useCallback(y=>{if(e.onDependencyCreate){let ce,ue;const ze=h.getter(x.id);for(let He=0;He<K.length;He++){const Mt=K[He],De=ze(Mt.dataItem);if(String(De)===y.fromId&&(ce=De),String(De)===y.toId&&(ue=De),ce&&ue)break}e.onDependencyCreate.call(void 0,{fromId:ce,toId:ue,target:z.current,type:y.type})}},[e.onDependencyCreate,x,K]);return t.createElement(tn,{dateRange:U,taskData:K,dependencyData:l,taskModelFields:x,dependencyModelFields:X,views:T,activeView:[Q,I],rowHeight:d,toolbarHeight:W,props:{columns:r,noRecords:g,timezone:f,resizable:u,reorderable:m,sortable:C,sort:w,filter:p,columnMenuFilter:k,columnMenu:H,navigatable:V,row:N,selectable:O},events:{onDataStateChange:ne,onSortChange:je,onFilterChange:we,onColumnMenuFilterChange:ye,onExpandChange:he,onRowClick:xt,onRowDoubleClick:Rt,onRowContextMenu:ve,onColumnResize:me,onColumnReorder:Le,onDependencyCreate:e.onDependencyCreate&&Ht,onKeyDown:It,onSelectionChange:Ce,onHeaderSelectionChange:Ee},taskEvents:{onTaskClick:Nt,onTaskDoubleClick:Ft,onTaskContextMenu:Lt,onTaskRemoveClick:e.onTaskRemoveClick&&zt}},t.createElement("div",{ref:Ne,role:"application",style:s,className:h.classNames("k-gantt",c)},t.createElement(Kn,{ref:Z},L&&L.addTaskButton?t.createElement(Un,{selectedTask:v.current,onClick:Fe}):null,t.createElement(ae.ToolbarSpacer,null),t.createElement(_n,null,t.createElement(Pn,null))),R&&t.createElement(R.type,{key:R.props.name,ref:J,...R.props,firstSlotRangeRef:M}),n&&t.createElement(h.WatermarkOverlay,null)))}),Re={taskData:[],dependencyData:[],columns:[],rowHeight:40};Be.propTypes={taskData:i.array,taskModelFields:i.shape({id:i.string,start:i.string,end:i.string,title:i.string,percentComplete:i.string,isRollup:i.string,isExpanded:i.string,children:i.string,isInEdit:i.string}),dependencyData:i.array,dependencyModelFields:i.shape({id:i.string,fromId:i.string,toId:i.string,type:i.string}),columns:i.arrayOf(i.shape({width:i.number,cell:i.any,editCell:i.any,headerCell:i.any,filter:i.any,children:i.any,field:i.string,title:i.string,sortable:i.any,expandable:i.bool,headerSelectionValue:i.bool,format:i.string,headerClassName:i.string,className:i.string,resizable:i.bool,reorderable:i.bool,minResizableWidth:i.number,orderIndex:i.number,columnMenu:i.any})),sort:i.array,filter:i.array,columnMenuFilter:i.array,columnMenu:i.any,style:i.object,className:i.string,children:i.any,timezone:i.string,defaultView:i.string,view:i.string,rowHeight:i.number,navigatable:i.bool,onViewChange:i.func,onDataStateChange:i.func,onSortChange:i.func,onFilterChange:i.func,onExpandChange:i.func,onRowClick:i.func,onColumnResize:i.func,onColumnReorder:i.func},Be.defaultProps=Re,Be.displayName="KendoReactGantt";const Ue=t.forwardRef((e,a)=>{const{slotWidth:n=fe.slotWidth,slotDuration:r=fe.slotDuration,firstSlotRangeRef:o,timelineHeaderCell:l}=e,{timezone:s}=Se(),c=B.useInternationalization(),g=t.useRef(null),f=t.useRef(null),d=t.useCallback(H=>{f.current&&f.current.scrollIntoView(H)},[]);t.useImperativeHandle(g,()=>({scrollIntoView:d})),t.useImperativeHandle(a,()=>g.current);const u=ke(),m=e.workWeekStart||fe.workWeekStart,C=e.workWeekEnd||fe.workWeekEnd,w=e.workDayStart||fe.workDayStart,p=e.workDayEnd||fe.workDayEnd,k=t.useMemo(()=>{const H=qt({workWeekStart:m,workWeekEnd:C}),V=[],L=Yt(u,{workDays:H,timezone:s},c);return L.forEach(N=>{const O=xa(N.range,{workDayStart:w,workDayEnd:p,timezone:s,slotDuration:r},c);N.span=O.length,V.push.apply(V,O)}),o&&V[0]&&(o.current=V[0].range),[L,V]},[s,u.start.getTime(),u.end.getTime(),c,m,C,w,p]);return t.createElement(Ie,{ref:f,slotWidth:n,slotLevels:k,timelineHeaderCell:l})}),fe={name:"day",dateRange:({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=E.ZonedDate.fromLocalDate(e,n),o=E.ZonedDate.fromLocalDate(a,n),l=Bt(r),s=et(o),c=E.ZonedDate.fromUTCDate(ie(l),n),g=E.ZonedDate.fromUTCDate(ie(s),n);return{start:new Date(c.getTime()),end:new Date(g.getTime()),zonedStart:c,zonedEnd:g}},title:e=>e.toLanguageString(Dt,se[Dt]),slotWidth:Te,slotDuration:60,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};Ue.defaultProps=fe,Ue.propTypes={name:i.string,dateRange:i.oneOfType([i.func,i.object]),title:i.oneOfType([i.string,i.func]),slotWidth:i.number,slotDuration:i.number,workWeekStart:i.number,workWeekEnd:i.number,workDayStart:i.string,workDayEnd:i.string},Ue.displayName="KendoReactGanttDayView";const qe=t.forwardRef((e,a)=>{const{slotWidth:n=qn.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:o}=e,{timezone:l}=Se(),s=B.useInternationalization(),c=t.useRef(null),g=t.useRef(null),f=t.useCallback(m=>{g.current&&g.current.scrollIntoView(m)},[]);t.useImperativeHandle(c,()=>({scrollIntoView:f})),t.useImperativeHandle(a,()=>c.current);const d=ke(),u=t.useMemo(()=>{const m=[],C=jt(d,{timezone:l},s);return C.forEach(w=>{const p=Zt(w.range,{timezone:l},s);m.push.apply(m,p)}),r&&m[0]&&(r.current=m[0].range),[C,m]},[l,d.start.getTime(),d.end.getTime(),s]);return t.createElement(Ie,{ref:g,slotWidth:n,slotLevels:u,timelineHeaderCell:o})}),qn={name:"month",dateRange:({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=E.ZonedDate.fromLocalDate(e,n),o=E.ZonedDate.fromLocalDate(a,n),l=E.firstDayOfMonth(E.getDate(r)),s=E.addDays(E.lastDayOfMonth(E.getDate(o)),1),c=E.ZonedDate.fromUTCDate(ie(l),n),g=E.ZonedDate.fromUTCDate(ie(s),n);return{start:new Date(c.getTime()),end:new Date(g.getTime()),zonedStart:c,zonedEnd:g}},title:e=>e.toLanguageString(bt,se[bt]),slotWidth:Te,workWeekStart:1,workWeekEnd:5,workDayStart:"08:00",workDayEnd:"17:00"};qe.defaultProps=qn,qe.propTypes={name:i.string,dateRange:i.oneOfType([i.func,i.object]),title:i.oneOfType([i.string,i.func]),slotWidth:i.number,workWeekStart:i.number,workWeekEnd:i.number,workDayStart:i.string,workDayEnd:i.string},qe.displayName="GanttMonthView";const $e=t.forwardRef((e,a)=>{const{slotWidth:n=$n.slotWidth,firstSlotRangeRef:r,timelineHeaderCell:o}=e,{timezone:l}=Se(),s=B.useInternationalization(),c=t.useRef(null),g=t.useRef(null),f=t.useCallback(m=>{g.current&&g.current.scrollIntoView(m)},[]);t.useImperativeHandle(c,()=>({scrollIntoView:f})),t.useImperativeHandle(a,()=>c.current);const d=ke(),u=t.useMemo(()=>{const m=Ra(d,{timezone:l},s),C=[];return m.forEach(w=>{const p=jt(w.range,{timezone:l},s);C.push.apply(C,p)}),r&&C[0]&&(r.current=C[0].range),[m,C]},[l,d.start.getTime(),d.end.getTime(),s]);return t.createElement(Ie,{slotWidth:n,slotLevels:u,timelineHeaderCell:o})}),$n={name:"year",dateRange:({tasksStart:e,tasksEnd:a,timezone:n})=>{const r=E.ZonedDate.fromLocalDate(e,n),o=E.ZonedDate.fromLocalDate(a,n),l=E.firstDayOfMonth(E.firstMonthOfYear(E.getDate(r))),s=E.addDays(E.lastDayOfMonth(E.lastMonthOfYear(E.getDate(o))),1),c=E.ZonedDate.fromUTCDate(ie(l),n),g=E.ZonedDate.fromUTCDate(ie(s),n);return{start:new Date(c.getTime()),end:new Date(g.getTime()),zonedStart:c,zonedEnd:g}},title:e=>e.toLanguageString(Tt,se[Tt]),slotWidth:Te};$e.defaultProps=$n,$e.propTypes={name:i.string,dateRange:i.oneOfType([i.func,i.object]),title:i.oneOfType([i.string,i.func]),slotWidth:i.number},$e.displayName="GanttYearView";const qa=[{text:dn,operator:"contains"},{text:un,operator:"doesnotcontain"},{text:Ge,operator:"eq"},{text:We,operator:"neq"},{text:cn,operator:"startswith"},{text:gn,operator:"endswith"},{text:Pe,operator:"isnull"},{text:_e,operator:"isnotnull"},{text:on,operator:"isempty"},{text:ln,operator:"isnotempty"}],$a=[{text:Ge,operator:"eq"},{text:We,operator:"neq"},{text:fn,operator:"gte"},{text:hn,operator:"gt"},{text:mn,operator:"lte"},{text:pn,operator:"lt"},{text:Pe,operator:"isnull"},{text:_e,operator:"isnotnull"}],Ya=[{text:Ge,operator:"eq"},{text:We,operator:"neq"},{text:yn,operator:"gte"},{text:vn,operator:"gt"},{text:Dn,operator:"lt"},{text:bn,operator:"lte"},{text:Pe,operator:"isnull"},{text:_e,operator:"isnotnull"}],Za=[{text:wn,operator:""},{text:Cn,operator:!0},{text:En,operator:!1}];function Ye(e,a){return{clearButtonTitle:e.toLanguageString(St,se[St]),operators:a.map(n=>({text:e.toLanguageString(n.text,se[n.text]),operator:n.operator}))}}const Yn=e=>{const{operators:a,...n}=e;return t.createElement(b.TextFilterCell,{ariaLabel:"text filter",...Ye(B.useLocalization(),a||qa),...n})};Yn.displayName="KendoReactGanttTextFilter";const Zn=e=>{const{operators:a,...n}=e;return t.createElement(b.NumericFilterCell,{ariaLabel:"numeric filter",...Ye(B.useLocalization(),a||$a),...n})};Zn.displayName="KendoReactGanttNumericFilter";const jn=e=>{const{operators:a,...n}=e;return t.createElement(b.BooleanFilterCell,{ariaLabel:"boolean filter",...Ye(B.useLocalization(),a||Za),...n})};jn.displayName="KendoReactGanttBooleanFilter";const Xn=e=>{const{operators:a,...n}=e;return t.createElement(b.DateFilterCell,{ariaLabel:"date filter",...Ye(B.useLocalization(),a||Ya),...n})};Xn.displayName="KendoReactGanttDateFilter";const ja=e=>{const{dependencyData:a,dependencyModelFields:n,defaultDataItem:r,fromId:o,toId:l,type:s}=e,c=a.map(m=>({...m})),g=h.setter(n.fromId),f=h.setter(n.toId),d=h.setter(n.type),u=r?{...r}:{};return g(u,o),f(u,l),d(u,s),c.push(u),c},Xa=e=>{const{defaultDataItem:a,selectedDataItem:n,direction:r,taskModelFields:o,dataTree:l,slotStart:s,slotEnd:c}=e,g=Oe(l,o.children,p=>({...p})),f=h.setter(o.start),d=h.setter(o.end),u=h.getter(o.start),m=h.getter(o.end),C=a?{...a}:{},w=u(C)&&m(C);if(!n||r==="none")w||(f(C,s),d(C,c)),g.unshift(C);else{const p=[{task:{[o.children]:g},childrenIndex:0}],k=h.getter(o.id),H=h.getter(o.children),V=h.setter(o.children),L=k(n);for(;p.length>0;){const N=p[p.length-1],O=N.task,ee=k(O),x=H(O);if(ee&&ee===L)break;x&&x.length&&x.length>N.childrenIndex?(p.push({task:x[N.childrenIndex],childrenIndex:0}),N.childrenIndex++):p.pop()}if(p.length>1){const N=p[p.length-1].task,O=p[p.length-2].childrenIndex,x=p[p.length-2].task,X=H(x);switch(r){case"child":{let A=H(N);A||(A=[],V(N,A)),w||(f(C,new Date(u(N).getTime())),d(C,new Date(m(N).getTime()))),A.push(C),Ze(p.splice(1,p.length-1).map(J=>J.task),o);break}case"above":{u(x)&&m(x)&&!w?(f(C,new Date(u(N).getTime())),d(C,new Date(m(N).getTime()))):(f(C,s),d(C,c)),X.splice(O-1,0,C),Ze(p.splice(1,p.length-2).map(A=>A.task),o);break}case"below":{u(x)&&m(x)&&!w?(f(C,new Date(u(N).getTime())),d(C,new Date(m(N).getTime()))):(f(C,s),d(C,c)),X.splice(O,0,C),Ze(p.splice(1,p.length-2).map(A=>A.task),o);break}}}}return g},Ja=e=>{const{updatedDataItem:a,taskModelFields:n,dataTree:r}=e,o=h.getter(n.id),l=h.getter(n.children),s=o(a);let c;const g=Oe(r,n.children,d=>o(d)===s?(c=d,{...a}):{...d});let f=[{task:{[n.children]:g},childrenIndex:0}];for(;f.length>0;){const d=f[f.length-1],u=d.task,m=o(u),C=l(u);if(m&&m===s)break;C&&C.length&&C.length>d.childrenIndex?(f.push({task:C[d.childrenIndex],childrenIndex:0}),d.childrenIndex++):f.pop()}if(f.length>1){f=f.splice(1,f.length-2);const d=h.getter(n.start),u=h.getter(n.end),m=h.getter(n.percentComplete);if(d(c).getTime()!==d(a).getTime()){Jn(f.map(w=>w.task),n);const C=d(a).getTime()-d(c).getTime();er(l(a),n,C)}u(c).getTime()!==u(a).getTime()&&Qn(f.map(C=>C.task),n),m(c)!==m(a)&&ea(f.map(C=>C.task),n)}return g},Qa=e=>{const{removedDataItem:a,taskModelFields:n,dataTree:r}=e,o=Oe(r,n.children,f=>({...f}));let l=[{task:{[n.children]:o},childrenIndex:0}];const s=h.getter(n.id),c=h.getter(n.children),g=s(a);for(;l.length>0;){const f=l[l.length-1],d=f.task,u=s(d),m=c(d);if(u&&u===g)break;m&&m.length&&m.length>f.childrenIndex?(l.push({task:m[f.childrenIndex],childrenIndex:0}),f.childrenIndex++):l.pop()}if(l.length>1){const f=l[l.length-2],d=f.task;c(d).splice(f.childrenIndex-1,1),l=l.splice(1,l.length-2),Ze(l.map(m=>m.task),n)}return o},Ze=(e,a)=>{Jn(e,a),Qn(e,a),ea(e,a)},Jn=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.start),o=h.setter(a.start);for(let l=e.length-1;l>=0;l--){const s=e[l],c=n(s);if(c&&c.length){const g=c.reduce((f,d)=>Math.min(f,r(d).getTime()),r(c[0]).getTime());o(s,new Date(g))}}},Qn=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.end),o=h.setter(a.end);for(let l=e.length-1;l>=0;l--){const s=e[l],c=n(s);if(c&&c.length){const g=c.reduce((f,d)=>Math.max(f,r(d).getTime()),r(c[0]).getTime());o(s,new Date(g))}}},ea=(e,a)=>{if(!e.length)return;const n=h.getter(a.children),r=h.getter(a.percentComplete),o=h.setter(a.percentComplete),l=({avg:s,n:c},g)=>({avg:((r(g)||0)+c*s)/(c+1),n:c+1});for(let s=e.length-1;s>=0;s--){const c=e[s],g=n(c);if(g&&g.length){const f=g.reduce(l,{avg:0,n:0}).avg;o(c,f)}}},er=(e,a,n)=>{if(!e)return;const r=h.getter(a.children),o=h.getter(a.start),l=h.setter(a.start),s=h.getter(a.end),c=h.setter(a.end),g=e.map(f=>({task:f,childrenIndex:0}));for(;g.length>0;){const f=g[g.length-1],d=f.task,u=r(d);u&&u.length&&u.length>f.childrenIndex?(g.push({task:u[f.childrenIndex],childrenIndex:0}),f.childrenIndex++):(g.pop(),l(d,new Date(o(d).getTime()+n)),c(d,new Date(s(d).getTime()+n)))}},tr=e=>{const{validationMessage:a,touched:n,label:r,id:o,valid:l,disabled:s,hint:c,type:g,optional:f,...d}=e,u=n&&a,m=!u&&c,C=m?`${o}_hint`:"",w=u?`${o}_error`:"";return t.createElement(oe.FieldWrapper,null,t.createElement(le.Label,{editorId:o,editorValid:l,editorDisabled:s,optional:f},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(At.Input,{valid:l,type:g,id:o,disabled:s,ariaDescribedBy:`${C} ${w}`,...d}),m&&t.createElement(le.Hint,{id:C},c),u&&t.createElement(le.Error,{id:w},a)))},ta=e=>{const{validationMessage:a,touched:n,label:r,id:o,valid:l,disabled:s,hint:c,wrapperStyle:g,...f}=e,d=n&&a,u=!d&&c,m=u?`${o}_hint`:"",C=d?`${o}_error`:"",w=r?`${o}_label`:"";return t.createElement(oe.FieldWrapper,{style:g},t.createElement(le.Label,{id:w,editorId:o,editorValid:l,editorDisabled:s},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(ra.DateTimePicker,{ariaLabelledBy:w,ariaDescribedBy:`${m} ${C}`,valid:l,id:o,disabled:s,...f}),u&&t.createElement(le.Hint,{id:m},c),d&&t.createElement(le.Error,{id:C},a)))},nr=e=>{const{validationMessage:a,touched:n,label:r,id:o,valid:l,disabled:s,hint:c,...g}=e,f=n&&a,d=!f&&c,u=d?`${o}_hint`:"",m=f?`${o}_error`:"";return t.createElement(oe.FieldWrapper,null,t.createElement(le.Label,{editorId:o,editorValid:l,editorDisabled:s},r),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(At.NumericTextBox,{ariaDescribedBy:`${u} ${m}`,valid:l,id:o,disabled:s,...g}),d&&t.createElement(le.Hint,{id:u},c),f&&t.createElement(le.Error,{id:m},a)))},ar=()=>{const e=ot(),a=B.useLocalization(),n=p=>a.toLanguageString(p,se[p]),r=n(kn),o=n(In),l=n(xn),s=n(Rn),c=n(Nn),g=n(Fn),f=n(Ln),d=t.useCallback(p=>p||p===0?void 0:c,[c]),u=t.useCallback((p,k)=>p&&k(e.end)&&p.getTime()>k(e.end).getTime()?g:void 0,[e,g]),m=t.useCallback((p,k)=>p&&k(e.start)&&p.getTime()<k(e.start).getTime()?f:void 0,[e,f]),C=t.useMemo(()=>[d,u],[d,u]),w=t.useMemo(()=>[d,m],[d,m]);return t.createElement(oe.FormElement,{style:{width:400},horizontal:!0},t.createElement(oe.Field,{id:`${e.title}_gantteditor`,name:e.title,label:r,component:tr,validator:d}),t.createElement(oe.Field,{id:`${e.start}_gantteditor`,name:e.start,label:o,component:ta,validator:C}),t.createElement(oe.Field,{id:`${e.end}_gantteditor`,name:e.end,label:l,component:ta,validator:w}),t.createElement(oe.Field,{id:`${e.percentComplete}_gantteditor`,name:e.percentComplete,format:"p",label:s,component:nr,step:.01,validator:d}))},rr=e=>{const{onCancel:a,onClose:n,onSubmit:r,...o}=e,l=B.useLocalization(),s=w=>l.toLanguageString(w,se[w]),c=s(Tn),g=s(kt),f=s(Sn),d=t.useCallback(w=>{if(a){const p={syntheticEvent:w,nativeEvent:w.nativeEvent,dataItem:e.dataItem};a.call(void 0,p)}},[a,e.dataItem]),u=t.useCallback(({syntheticEvent:w})=>{if(n){const p={syntheticEvent:w,nativeEvent:w.nativeEvent,dataItem:e.dataItem};n.call(void 0,p)}},[n,e.dataItem]),m=t.useCallback((w,p)=>{if(r){const k={dataItem:w,syntheticEvent:p,nativeEvent:p&&p.nativeEvent};r.call(void 0,k)}},[r]),C=t.createElement(oe.Form,{initialValues:e.dataItem,onSubmit:m,render:w=>t.createElement(Me.Dialog,{title:f,minWidth:600,onClose:u,style:{zIndex:90}},t.createElement(ar,null),t.createElement(Me.DialogActionsBar,null,t.createElement(ae.Button,{disabled:!w.allowSubmit,onClick:w.onSubmit},c),t.createElement(ae.Button,{onClick:d},g))),...o});return h.canUseDOM?Vt.createPortal(C,document&&document.body):null},sr=e=>{const{onClose:a,onCancel:n,onConfirm:r,dataItem:o}=e,l=B.useLocalization(),s=p=>l.toLanguageString(p,se[p]),c=s(Vn),g=s(kt),f=s(On),d=s(Gn),u=t.useCallback(({syntheticEvent:p})=>{a&&a.call(void 0,{syntheticEvent:p,nativeEvent:p&&p.nativeEvent,dataItem:null})},[a]),m=t.useCallback(p=>{n&&n.call(void 0,{syntheticEvent:p,nativeEvent:p&&p.nativeEvent,dataItem:null})},[n]),C=t.useCallback(p=>{r&&r.call(void 0,{syntheticEvent:p,nativeEvent:p&&p.nativeEvent,dataItem:o})},[r,o]),w=t.createElement(Me.Dialog,{title:d,onClose:u},f,t.createElement(Me.DialogActionsBar,null,t.createElement("button",{className:"k-button",onClick:m},g),t.createElement("button",{className:"k-button",onClick:C},c)));return h.canUseDOM?Vt.createPortal(w,document&&document.body):null},or=de.TreeListRow;Object.defineProperty(D,"getSelectedState",{enumerable:!0,get:()=>b.getSelectedState}),Object.defineProperty(D,"getSelectedStateFromKeyDown",{enumerable:!0,get:()=>b.getSelectedStateFromKeyDown}),Object.defineProperty(D,"setSelectedState",{enumerable:!0,get:()=>b.setSelectedState}),D.GANTT_COL_INDEX_ATTRIBUTE=oa,D.GANTT_PREVENT_SELECTION_ELEMENT=la,D.GANTT_ROW_INDEX_ATTRIBUTE=sa,D.Gantt=Be,D.GanttBooleanFilter=jn,D.GanttDateFilter=Xn,D.GanttDayView=Ue,D.GanttForm=rr,D.GanttMonthView=qe,D.GanttNumericFilter=Zn,D.GanttRemoveDialog=sr,D.GanttRow=or,D.GanttTextFilter=Yn,D.GanttWeekView=xe,D.GanttYearView=$e,D.addDependency=ja,D.addTask=Xa,D.createDataTree=Ca,D.extendDataItem=pa,D.filterBy=ma,D.mapTree=Oe,D.orderBy=ha,D.removeTask=Qa,D.updateTask=Ja,Object.defineProperty(D,Symbol.toStringTag,{value:"Module"})});