@svar-ui/trial-vue-gantt 2.7.0 → 2.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +1925 -1944
- package/dist-full/index.css +1 -1
- package/package.json +15 -15
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("@svar-ui/lib-vue"),A=require("@svar-ui/lib-dom"),Pe=require("@svar-ui/gantt-locales"),Xe=require("@svar-ui/core-locales"),tt=require("@svar-ui/lib-state"),oe=require("@svar-ui/trial-gantt-store"),Ze=require("@svar-ui/grid-store"),Ve=require("@svar-ui/vue-grid"),de=require("@svar-ui/vue-core"),dt=require("@svar-ui/vue-toolbar"),yt=require("@svar-ui/vue-menu"),Te=require("@svar-ui/vue-editor"),xt="2.7.0",wt={version:xt};function bt(a,t,n){const o=a.getBoundingClientRect(),l=t.querySelector(".wx-body").getBoundingClientRect();return{top:o.top-l.top,left:o.left-l.left,dt:o.bottom-n.clientY,db:n.clientY-o.top}}function ot(a){return a&&A.getID(a,"data-context-id")}const lt=5;function _t(a,t){let n,o,l,g,u,p,T,v,d;function b($){g=$.clientX,u=$.clientY,p={...bt(n,a,$),y:t.getTask(l).$y},document.body.style.userSelect="none"}function _($){t.isDisabled?.()||(n=A.locate($),ot(n)&&(l=A.getID(n),d=setTimeout(()=>{v=!0,t&&t.touchStart&&t.touchStart(),b($.touches[0])},500),a.addEventListener("touchmove",H),a.addEventListener("contextmenu",C),window.addEventListener("touchend",W)))}function C($){if(v||d)return $.preventDefault(),!1}function h($){t.isDisabled?.()||$.which!==1||(n=A.locate($),ot(n)&&(l=A.getID(n),a.addEventListener("mousemove",q),window.addEventListener("mouseup",Y),b($)))}function B($){a.removeEventListener("mousemove",q),a.removeEventListener("touchmove",H),document.body.removeEventListener("mouseup",Y),document.body.removeEventListener("touchend",W),document.body.style.userSelect="",$&&(a.removeEventListener("mousedown",h),a.removeEventListener("touchstart",_))}function P($){const F=$.clientX-g,R=$.clientY-u;if(!o){if(Math.abs(F)<lt&&Math.abs(R)<lt||t&&t.start&&t.start({id:l,e:$})===!1)return;o=n.cloneNode(!0),o.style.pointerEvents="none",o.classList.add("wx-reorder-task"),o.style.position="absolute",o.style.left=p.left+"px",o.style.top=p.top+"px",n.style.visibility="hidden",n.parentNode.insertBefore(o,n)}if(o){const D=Math.round(Math.max(0,p.top+R));if(t&&t.move&&t.move({id:l,top:D,detail:T})===!1)return;const O=t.getTask(l),K=O.$y;if(!p.start&&p.y===K)return j();p.start=!0,p.y=O.$y-4,o.style.top=D+"px";const N=document.elementFromPoint($.clientX,$.clientY),m=A.locate(N);if(m&&m!==n){const z=A.getID(m),G=m.getBoundingClientRect(),k=G.top+G.height/2,S=$.clientY+p.db>k&&m.nextElementSibling!==n,J=$.clientY-p.dt<k&&m.previousElementSibling!==n;T?.after===z||T?.before===z?T=null:S?T={id:l,after:z}:J&&(T={id:l,before:z})}}}function q($){P($)}function H($){v?($.preventDefault(),P($.touches[0])):d&&(clearTimeout(d),d=null)}function W(){v=null,d&&(clearTimeout(d),d=null),j()}function Y(){j()}function j(){n&&(n.style.visibility=""),o&&(o.parentNode.removeChild(o),t&&t.end&&t.end({id:l,top:p.top})),l=n=o=p=T=null,B()}return a.style.position!=="absolute"&&(a.style.position="relative"),a.addEventListener("mousedown",h),a.addEventListener("touchstart",_),{destroy(){B(!0)}}}const ce=(a,t)=>{const n=a.__vccOpts||a;for(const[o,l]of t)n[o]=l;return n},Bt={class:"wx-group-text"},$t={key:0,class:"wx-name"},St={__name:"GroupCellText",props:{row:{}},setup(a){const t=a,o=e.inject("wx-i18n").getGroup("gantt"),l=e.inject("gantt-store"),{groupBy:g,resources:u}=l.getReactiveState(),p=c.subscribe(g),T=c.subscribe(u),v=e.computed(()=>{if(p.value?.field==="resource"){let b=t.row.$groupValue;return Array.isArray(b)||(b=[b]),b.map(_=>T.value.byId(_)).filter(Boolean)}return null}),d=e.computed(()=>p.value?.field=="resource"?o("Unassigned"):o("Ungrouped"));return(b,_)=>(e.openBlock(),e.createElementBlock("div",Bt,[a.row.$groupValue==="$ungrouped"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(d.value),1)],64)):v.value?.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(de.Avatar),{value:v.value,size:28},null,8,["value"]),v.value.length===1?(e.openBlock(),e.createElementBlock("span",$t,e.toDisplayString(v.value[0].name),1)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(a.row.text),1)],64))]))}},Tt=ce(St,[["__scopeId","data-v-36807faa"]]),Ct={key:1,class:"wx-toggle-placeholder"},Et={class:"wx-text"},It={__name:"TextCell",props:{row:{},column:{}},setup(a){function t(n,o){return`justify-content:${o.align};padding-left: ${(n.$level-1)*20}px`}return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-content",style:e.normalizeStyle(t(a.row,a.column))},[!a.row.$empty&&(a.row.data?.length||a.row.lazy)?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass("wx-toggle-icon wxi-menu-"+(a.row.open?"down":"right")),"data-action":"open-task"},null,2)):(e.openBlock(),e.createElementBlock("i",Ct)),e.createElementVNode("div",Et,[a.column._cell?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.column._cell),{key:0,row:a.row,column:a.column},null,8,["row","column"])):a.row.$group?(e.openBlock(),e.createBlock(Tt,{key:1,row:a.row},null,8,["row"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(a.row.text),1)],64))])],4))}},Dt=ce(It,[["__scopeId","data-v-4fd2001c"]]),Rt=["data-action"],Lt={__name:"ActionCell",props:{column:{},row:{},cell:{}},setup(a){const t=a,n=e.computed(()=>t.column.id),o=e.computed(()=>n.value.includes("edit")?"wxi-edit":n.value.includes("add")?"wxi-plus":n.value.includes("delete")?"wxi-delete":""),l=e.computed(()=>{if(!n.value.includes("add"))return!1;const g=t.row.$groupValue;return!t.row.$group&&typeof g<"u"||t.row.$group&&typeof g>"u"});return(g,u)=>a.cell||o.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({textAlign:a.column.align})},[e.createElementVNode("i",{class:e.normalizeClass(["wx-action-icon",o.value,{"wx-disabled":l.value}]),"data-action":!l.value&&n.value},null,10,Rt)],4)):e.createCommentVNode("",!0)}},Fe=ce(Lt,[["__scopeId","data-v-3ce827d8"]]),Vt={class:"wx-avatar"},Nt={__name:"ResourcesCell",props:{row:{}},setup(a){const t=a,n=e.inject("gantt-store"),{assignments:o}=n.getReactiveState(),l=c.subscribe(o),g=e.computed(()=>(l.value,n.getTaskResources(t.row.$id||t.row.id)));return(u,p)=>(e.openBlock(),e.createElementBlock("div",Vt,[e.createVNode(e.unref(de.Avatar),{value:g.value,size:28},null,8,["value"])]))}},zt=ce(Nt,[["__scopeId","data-v-40d1c862"]]),Wt={key:0,class:"wx-avatar-box"},Mt={key:1,class:"wx-resource-option"},At={class:"wx-name"},Ht={__name:"EditorResourcesCell",props:{data:{}},setup(a){const t=a,n=e.computed(()=>t.data.length);return(o,l)=>Array.isArray(a.data)?(e.openBlock(),e.createElementBlock("div",Wt,[n.value?(e.openBlock(),e.createBlock(e.unref(de.Avatar),{key:0,value:a.data,size:28},null,8,["value"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Mt,[e.createElementVNode("div",null,[e.createVNode(e.unref(de.Avatar),{value:a.data,size:28},null,8,["value"])]),e.createElementVNode("div",At,e.toDisplayString(a.data.name),1)]))}},st=ce(Ht,[["__scopeId","data-v-7ad7c681"]]);function Ot(a,t,n){const{_assignments:o}=n.getState(),l=o.byTask[a],g=l?.map(v=>v.resource),u=new Set(g||[]),p=new Set(t||[]),T=n.getHistory();T&&T.startBatch();for(const v of u)if(!p.has(v)){const d=l.find(b=>b.resource===v);n.exec("delete-assignment",{id:d.id})}for(const v of p)u.has(v)||n.exec("add-assignment",{assignment:{resource:v,task:a}});T&&T.endBatch()}function jt(a,t){return`min-height:${a+t*4}px;`}function Ft(a,t,n){return n&&a==="all"?`width:${t}px;`:a==="grid"?n?`width:${t}px;`:"width:100%;":""}function ft(a,t,n){const o=a.find(l=>l.id==="add-task");return t==="all"?`${n}px`:t==="grid"?"calc(100% - 4px)":o?`${o.width}px`:"0"}function Pt(a,t,n,o,l){return!a&&t!=="grid"?n>l:n>o}function mt(a,t,n,o,l,g,u,p="add-task"){let T=n==="chart"?[{...a.filter(d=>d.id===p)[0],resize:!1}]:a;const v=n==="all"?l:o;if(!g){let d=t,b=!1;if(a.some(_=>_.$width)){let _=0;d=a.reduce((C,h)=>(h.hidden||(_+=h.width,C+=h.$width||h.width),C),0),_>d&&d>=v&&(b=!0)}if(b||d<v){let _=1;b||(_=(v-u)/(d-u||1));const C=p==="add-task";let h=0;return T.map((B,P)=>{if(B.id!=="add-task"&&!B.hidden&&(B.$width||(B.$width=B.width),B.width=B.$width*_,!C)){if(P===T.length-1){const q=b?d:v;B.width=q-h-1}h+=B.width}return B})}}return T}function pt(a,t){if(a&&t?.length){const n={};return t.forEach(({key:o,order:l},g)=>{n[o]={order:l,...t.length>1&&{index:g}}}),n}return{}}function vt(a){a.filter(n=>n.flexgrow&&!n.hidden).length===1&&a.forEach(n=>{n.$width&&!n.flexgrow&&!n.hidden&&(n.width=n.$width)})}function Ke(a){return a.some(t=>t.flexgrow&&!t.hidden)}function Gt(a,t,n){if(!a)return[];const o=a.rows[a.rows.length-1],{cells:l}=o;if(a.minUnit==="day")return et(l,t,n);const u=1440*60*1e3,p=l.length?(l.length>1?l[1].date.getTime():a.end.getTime())-l[0].date.getTime():0;if(p&&p<u){const v=[];let d=null;return l.forEach(b=>{(!d||d.key!==b.key)&&(d={id:b.key,key:b.key,width:0,date:b.date,unit:b.unit},v.push(d)),d.width+=b.width}),et(v,t,n)}else return et(l,t,n,!0)}function et(a,t,n,o){return a.map(l=>({id:l.key,width:l.width,date:l.date,unit:l.unit,getter:g=>o?g.$unitLoad?.[l.key]:g.$load?.[l.key],template:g=>g?n?n(g):`${g.hours}h`:"",cell:t}))}function Ut(){const a=document.createElement("div");a.style.cssText="position:absolute;left:-1000px;width:100px;padding:0;margin:0;min-height:100px;overflow-y:scroll;",document.body.appendChild(a);const t=a.offsetWidth-a.clientWidth;return document.body.removeChild(a),t}const qt=Object.assign({name:"GanttGridGrid"},{__name:"Grid",props:e.mergeModels({readonly:{},columnWidth:{}},{tableAPI:{},tableAPIModifiers:{}}),emits:["update:tableAPI"],setup(a){const t=c.asDirective(_t),n=a,o=e.useModel(a,"tableAPI"),g=e.inject("wx-i18n").getGroup("gantt"),u=e.inject("gantt-store"),{scrollTop:p,cellHeight:T,focusTask:v,_selected:d,area:b,_tasks:_,_scales:C,_headerLength:h,columns:B,_sort:P,durationUnit:q,splitTasks:H,filterValues:W,groupBy:Y,gridWidth:j,displayMode:$,_compactMode:F,_gridCollapseThreshold:R}=u.getReactiveState(),D=c.subscribe(p),O=c.subscribe(T),K=c.subscribe(d),N=c.subscribe(b),m=c.subscribe(_,!0),z=c.subscribe(C),G=c.subscribe(h),k=c.subscribe(B),S=c.subscribe(P),J=c.subscribe(q),ee=c.subscribe(H),E=c.subscribe(W),le=c.subscribe(Y),U=c.subscribe(j),se=c.subscribe($),me=c.subscribe(F),ke=c.subscribe(R);let fe=e.ref(null);function he(s,r){if(r==="add-task")u.exec(r,{target:s,task:{text:g("New Task")},mode:"child",show:!0,focus:s?"grid":null});else if(r==="open-task"){const y=$e.value.find(M=>M.id===s);(y.data||y.lazy)&&u.exec(r,{id:s,mode:!y.open})}}function ve(s){if(s.detail>1)return;const r=A.locateID(s),y=s.target.dataset.action;y&&s.preventDefault(),r?y==="add-task"||y==="open-task"?he(r,y):u.exec("select-task",{id:r,toggle:s.ctrlKey||s.metaKey,range:s.shiftKey,show:"xy",focus:"grid"}):y==="add-task"&&he(null,y)}function De(s){if(!n.readonly){const r=A.locateID(s),y=A.locateID(s,"data-col-id");!(y&&pe.value.find(V=>V.id===y))?.editor&&r&&u.exec("show-editor",{id:r})}}let we;function be(s){const r=s.id,{before:y,after:M}=s,V=s.onMove;let Q=y||M,Z=y?"before":"after";if(V){if(Z==="after"){const ge=Ee.value.findIndex(Ne=>Ne.id===r),Le=Ee.value.findIndex(Ne=>Ne.id===Q),Se=Ee.value[Le];ge-Le===1?Z="before":Se.data&&Se.open&&(Z="before",Q=Se.data[0].id)}we={id:r,[Z]:Q}}else we=null;u.exec("move-task",{id:r,mode:Z,target:Q,inProgress:V})}function _e({id:s}){if(n.readonly||(u.getTask(s).open&&u.exec("open-task",{id:s,mode:!1}),fe.value=$e.value.find(r=>r.id===s),!fe.value))return!1}function x({id:s,top:r}){we?be({...we,onMove:!1}):u.exec("drag-task",{id:s,top:r+ye.value,inProgress:!1}),fe.value=null}function te({id:s,top:r,detail:y}){y&&be({...y,onMove:!0}),u.exec("drag-task",{id:s,top:r+ye.value,inProgress:!0})}const w=e.ref(0),i=e.ref(0),I=e.ref(null),ne=e.ref(!1);function re(s){const{key:r,isInput:y}=s;if(!y&&(r==="arrowup"||r==="arrowdown"))return s.eventSource="grid",u.exec("hotkey",s),!1;if(r==="enter"){const M=o.value.getState().focusCell;if(M){const{row:V,column:Q}=M;Q==="add-task"?he(V,"add-task"):Q==="text"&&he(V,"open-task")}}}function ue(s){o.value=s,s.intercept("hotkey",re),s.intercept("select-row",()=>!1),s.intercept("scroll",()=>!1),s.intercept("sort-rows",r=>{const{key:y,add:M}=r;let V=S.value?S.value.find(Z=>Z.key===y):null,Q="asc";return V&&(Q=!V||V.order==="asc"?"desc":"asc"),u.exec("sort-tasks",{key:y,order:Q,add:M}),!1}),s.intercept("filter-rows",r=>{const{key:y,value:M}=r;return u.exec("filter-tasks",{key:y,value:M,open:!0}),!1}),s.on("resize-column",()=>{ze(!0)}),s.on("hide-column",r=>{r.mode||vt(pe.value),ze()}),s.intercept("update-cell",r=>{const{id:y,column:M,value:V}=r,Q=$e.value.find(Z=>Z.id===y);if(Q){if(M==="resources"){Ot(y,V,u);return}const Z={...Q};let ge=V;ge&&!isNaN(ge)&&!(ge instanceof Date)&&(ge*=1),Z[M]=ge,oe.prepareEditTask(Z,{durationUnit:J.value,splitTasks:ee.value},u.getTaskCalendar(Z),M),u.exec("update-task",{id:y,task:Z})}return!1})}const pe=e.computed(()=>{let s=k.value.map(V=>{V={...V};const Q=[...V.header];return Q.forEach(Z=>{Z.text&&(Z.text=g(Z.text))}),V.header=Q,V});const r=s.findIndex(V=>V.id==="text"),y=s.findIndex(V=>V.id==="add-task"),M=s.findIndex(V=>V.id==="resources");if(r!==-1&&(s[r].cell&&(s[r]._cell=s[r].cell),s[r].cell=Dt),M!==-1){const V=s[M];if(V.cell||(V.cell=zt),V.editor&&typeof V.editor!="function"){const Q=V.editor,Z=Q.config;Z.cell||(Z.cell=st),Z.cell=st,Z.dropdown||(Z.dropdown={width:"auto"}),V.editor=ge=>{if(ge.type!=="summary")return Q}}}if(y!==-1){s[y].cell=s[y].cell||Fe;const V=s[y].header[0];if(s[y].header[0].cell=V.cell||Fe,n.readonly)s.splice(y,1);else if(me.value){const[Q]=s.splice(y,1);s.unshift(Q)}}return s.length>0&&(s[s.length-1].resize=!1),s});function Ce(s){let r=`wx-text-${s.align} `;return s.id==="add-task"?r+="wx-action ":s.id==="wbs"&&(r+="wx-wbs "),r.trim()}const ye=e.computed(()=>N.value.from),Re=e.computed(()=>z.value.height),X=e.computed(()=>ft(k.value,se.value,U.value)),L=e.computed(()=>Pt(me.value,se.value,n.columnWidth,w.value,U.value)),ae=e.computed(()=>jt(i.value,O.value)),ie=e.computed(()=>ae.value+Ft(se.value,n.columnWidth,L.value)),xe=e.computed(()=>K.value.map(s=>s.id)),$e=e.computed(()=>m.value.slice(N.value.start,N.value.end)),Ee=e.computed(()=>(fe.value&&!$e.value.find(r=>r.id===fe.value.id)?[...$e.value,fe.value]:$e.value).map(r=>({...r}))),Qe=e.computed(()=>(ne.value,Ke(pe.value)));function ze(s){if(!Ke(pe.value)){const r=Ie.value.reduce((y,M)=>(s&&M.$width&&(M.$width=M.width),y+(M.hidden?0:M.width)),0);n.columnWidth}ne.value=!0,ne.value=!1}const We=e.computed(()=>pt(Ee.value,S.value)),Me=e.computed(()=>We.value?{...E.value}:E.value),Ie=e.computed(()=>mt(pe.value,n.columnWidth,se.value,w.value,U.value,Qe.value,ke.value)),Je=e.computed(()=>ye.value-D.value);let Ae;e.onMounted(()=>{I.value&&(Ae=new ResizeObserver(s=>{for(const r of s)w.value=r.contentRect.width,i.value=r.contentRect.height}),Ae.observe(I.value))}),e.onUnmounted(()=>{Ae?.disconnect()});let He=!1;const Oe=c.subscribe(v);e.watch(Oe,s=>{if(!s)return;const{id:r,column:y}=s;y&&(He||(He=!0,requestAnimationFrame(()=>{const{focusCell:M,editor:V}=o.value.getState();V||(o.value.exec("focus-cell",{row:r,column:M?.column||pe.value[0]?.id}),He=!1)})))});const Ge=e.computed(()=>({isDisabled:()=>!!le.value?.field,start:_e,end:x,move:te,getTask:u.getTask})),je=e.computed(()=>[...xe.value]),f=e.computed(()=>({rowHeight:O.value,headerHeight:Re.value/G.value}));return(s,r)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-table-container",style:e.normalizeStyle({flex:`0 0 ${X.value}`}),ref_key:"tableContainer",ref:I},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`${ie.value}--wx-body-offset:${Je.value}px;`),class:"wx-table",onClick:ve,onDblclick:De},[e.createVNode(e.unref(Ve.Grid),{init:ue,sizes:f.value,rowStyle:y=>y.$reorder?"wx-reorder-task":"",columnStyle:Ce,data:Ee.value,columns:Ie.value,selectedRows:je.value,sortMarks:We.value,filterValues:Me.value},null,8,["sizes","rowStyle","data","columns","selectedRows","sortMarks","filterValues"])],36)),[[e.unref(t),Ge.value]])],4))}}),Yt=ce(qt,[["__scopeId","data-v-d9d42faf"]]),Kt={__name:"CellGrid",setup(a){const t=e.inject("gantt-store"),{cellWidth:n,cellHeight:o,cellBorders:l}=t.getReactiveState(),g=c.subscribe(n),u=c.subscribe(o),p=c.subscribe(l),T=e.ref(null),v=e.ref("#e4e4e4");return e.watchEffect(()=>{if(typeof getComputedStyle<"u"&&T.value){const d=getComputedStyle(T.value).getPropertyValue("--wx-gantt-border");v.value=d?d.substring(d.indexOf("#")):"#1d1e261a"}}),(d,b)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"node",ref:T,style:e.normalizeStyle(`width:100%; height:100%; background:url(${e.unref(oe.grid)(e.unref(g),e.unref(u),v.value,e.unref(p))}); position: absolute;`)},null,4))}},Xt={class:"wx-links"},Zt=["onclick","data-link-id"],Qt=["points"],Jt=["points"],en=["data-link-id"],tn=["points"],nn=["points"],an=Object.assign({name:"GanttChartLinks"},{__name:"Links",props:{onSelectLink:{type:Function},selectedLink:{},readonly:{}},setup(a){const t=c.asDirective(A.clickOutside),n=a,o=e.inject("gantt-store"),{_links:l,criticalPath:g}=o.getReactiveState(),u=c.subscribe(l),p=c.subscribe(g);function T(v){const d=v?.target?.classList;!d?.contains("wx-line-hitbox")&&!d?.contains("wx-delete-button")&&n.onSelectLink(null)}return(v,d)=>(e.openBlock(),e.createElementBlock("svg",Xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),b=>(e.openBlock(),e.createElementBlock("g",{key:b.id,class:e.normalizeClass(["wx-line",{"wx-critical":e.unref(p)&&b.critical,"wx-line-selectable":!a.readonly}]),onclick:()=>!a.readonly&&a.onSelectLink(b.id),"data-link-id":e.unref(A.setID)(b.id)},[e.createElementVNode("polyline",{class:"wx-line-draw",points:b.$p},null,8,Qt),e.createElementVNode("polyline",{class:"wx-line-hitbox",points:b.$p},null,8,Jt)],10,Zt))),128)),!a.readonly&&a.selectedLink?e.withDirectives((e.openBlock(),e.createElementBlock("g",{key:0,class:"wx-line wx-line-selected wx-line-selectable wx-delete-link","data-link-id":e.unref(A.setID)(a.selectedLink.id)},[e.createElementVNode("polyline",{class:"wx-line-draw",points:a.selectedLink.$p},null,8,tn),e.createElementVNode("polyline",{class:"wx-line-hitbox",points:a.selectedLink.$p},null,8,nn)],8,en)),[[e.unref(t),T]]):e.createCommentVNode("",!0)]))}}),on=ce(an,[["__scopeId","data-v-77d14712"]]),ln=["data-rollup-id"],sn=Object.assign({name:"GanttChartRollups"},{__name:"Rollups",props:{rollup:{},parent:{}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock("div",{"data-rollup-id":e.unref(A.setID)(a.rollup.id),class:e.normalizeClass(`wx-rollup wx-${a.rollup.type}-rollup`),style:e.normalizeStyle(`left:${a.rollup.$x_rollup}px;top:${a.parent.$y+a.parent.$h+a.rollup.$y_rollup_relative}px;width:${a.rollup.$w_rollup}px;height:${a.rollup.$h_rollup}px;`)},null,14,ln))}}),rn=ce(sn,[["__scopeId","data-v-bbc697dd"]]),cn={class:"wx-segments"},un=["data-segment"],dn={key:0,class:"wx-progress-wrapper"},fn={class:"wx-content"},mn={__name:"BarSegments",props:{task:{},type:{}},setup(a){const t=a;function n(l){const g=t.task.segments[l];return`left:${g.$x}px;top:0px;width:${g.$w}px;height:100%;`}function o(l){if(!t.task.progress)return 0;const g=t.task.duration*t.task.progress/100,u=t.task.segments;let p=0,T=0,v=null;do{const d=u[T];T===l&&(p>g?v=0:v=Math.min((g-p)/d.duration,1)*100),p+=d.duration,T++}while(v===null&&T<u.length);return v||0}return(l,g)=>(e.openBlock(),e.createElementBlock("div",cn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.task.segments,(u,p)=>(e.openBlock(),e.createElementBlock("div",{key:p,class:e.normalizeClass(["wx-segment","wx-bar",`wx-${a.type}`]),"data-segment":p,style:e.normalizeStyle(n(p))},[a.task.progress?(e.openBlock(),e.createElementBlock("div",dn,[e.createElementVNode("div",{class:"wx-progress-percent",style:e.normalizeStyle(`width:${o(p)}%`)},null,4)])):e.createCommentVNode("",!0),e.createElementVNode("div",fn,e.toDisplayString(u.text||""),1)],14,un))),128))]))}},pn=ce(mn,[["__scopeId","data-v-558dfded"]]),vn=["data-id","data-task-id","tabindex"],gn={key:0,class:"wx-progress-wrapper"},hn={key:4,class:"wx-content"},kn={key:1,class:"wx-text-out"},yn=Object.assign({name:"GanttChartBars"},{__name:"Bars",props:{readonly:{},taskTemplate:{}},setup(a){const t=a,n=e.inject("gantt-store"),{_tasks:o,_links:l,area:g,_scales:u,taskTypes:p,baselines:T,_selected:v,rollups:d,_rollups:b,focusTask:_,criticalPath:C,tree:h,schedule:B,splitTasks:P,summary:q,slack:H}=n.getReactiveState(),W=c.subscribe(o,!0),Y=c.subscribe(l),j=c.subscribe(g),$=c.subscribe(u),F=c.subscribe(p),R=c.subscribe(T),D=c.subscribe(v),O=c.subscribe(d),K=c.subscribe(b),N=c.subscribe(C),m=c.subscribe(h),z=c.subscribe(B),G=c.subscribe(P),k=c.subscribe(q),S=c.subscribe(H),J=e.computed(()=>W.value.slice(j.value.start,j.value.end).map(f=>({...f}))),ee=e.computed(()=>J.value.some(f=>f.$id&&f.$id!==f.id)),E=e.computed(()=>$.value.lengthUnitWidth);let le=!1;const U=e.ref(void 0),se=e.ref(null);let me=null;const ke=e.ref(null),fe=e.computed(()=>ke.value&&{...Y.value.find(f=>f.id===ke.value)}),he=e.ref(void 0);let ve;function De(f){if(f.button!==0)return;const s=A.locate(f);s&&be(s,f)}function we(f){const s=A.locate(f);s&&(ve=setTimeout(()=>{he.value=!0,be(s,f.touches[0])},300))}function be(f,s){const{clientX:r}=s,y=A.getID(f),M=n.getTask(y),V=s.target.classList;if(!s.target.closest(".wx-delete-button")&&!t.readonly){if(V.contains("wx-progress-marker")){const{progress:Q}=n.getTask(y);me={id:y,x:r,progress:Q,dx:0,node:f,marker:s.target},s.target.classList.add("wx-progress-in-drag")}else{const Q=_e(f,s,M)||"move";if(se.value={id:y,mode:Q,x:r,dx:0,l:M.$x,w:M.$w},G.value&&M.segments?.length){const Z=A.locate(s,"data-segment");Z&&(se.value.segmentIndex=Z.dataset.segment*1,oe.extendDragOptions(M,se.value))}}re()}}function _e(f,s,r){if(s.target.classList.contains("wx-line")||(r||(r=n.getTask(A.getID(f))),r.type==="milestone"||r.type==="summary"))return"";const y=A.locate(s,"data-segment");y&&(f=y);const{left:M,width:V}=f.getBoundingClientRect(),Q=(s.clientX-M)/V;let Z=.2/(V>200?V/200:1);return Q<Z?"start":Q>1-Z?"end":""}function x(f){he.value?(f.preventDefault(),w(f,f.touches[0])):ve&&(clearTimeout(ve),ve=null)}function te(f){w(f,f)}function w(f,s){const{clientX:r}=s;if(!t.readonly)if(me){const{node:y,x:M,id:V}=me,Q=me.dx=r-M,Z=Math.round(Q/y.offsetWidth*100);let ge=me.progress+Z;me.value=ge=Math.min(Math.max(0,ge),100),n.exec("update-task",{id:V,task:{progress:ge},inProgress:!0})}else if(se.value){Ee(null);const{mode:y,l:M,w:V,x:Q,id:Z,start:ge,segment:Le,index:Se}=se.value,Ne=n.getTask(Z),Be=r-Q,at=Math.round(E.value)||1;if(!ge&&Math.abs(Be)<20||y==="start"&&V-Be<at||y==="end"&&V+Be<at||y==="move"&&(Be<0&&M+Be<0||Be>0&&M+V+Be>Me.value)||se.value.segment&&!oe.isSegmentMoveAllowed(Ne,se.value))return;se.value.dx=Be;let Ue,qe;if(y==="start"?(Ue=M+Be,qe=V-Be):y==="end"?(Ue=M,qe=V+Be):y==="move"&&(Ue=M+Be,qe=V),n.exec("drag-task",{id:Z,width:qe,left:Ue,inProgress:!0,...Le&&{segmentIndex:Se}}),!se.value.start&&(y==="move"&&Ne.$x===M||y!=="move"&&Ne.$w===V))return le=!0,ne();se.value.start=!0}else{const y=A.locate(f);if(y){const M=n.getTask(A.getID(y)),Q=A.locate(f,"data-segment")||y,Z=_e(Q,s,M);Q.style.cursor=Z&&!t.readonly?"col-resize":"pointer"}}}function i(){ne()}function I(){he.value=null,ve&&(clearTimeout(ve),ve=null),ne()}function ne(){if(me){const{dx:f,id:s,marker:r,value:y}=me;me=null,typeof y<"u"&&f&&n.exec("update-task",{id:s,task:{progress:y},inProgress:!1}),r.classList.remove("wx-progress-in-drag"),le=!0,ue()}else if(se.value){const{id:f,mode:s,dx:r,l:y,w:M,start:V,segment:Q,index:Z}=se.value;if(se.value=null,V){const ge=Math.round(r/E.value);if(!ge)n.exec("drag-task",{id:f,width:M,left:y,inProgress:!1,...Q&&{segmentIndex:Z}});else{let Le={},Se=n.getTask(f);Q&&(Se=Se.segments[Z]),s==="move"?(Le.start=Se.start,Le.end=Se.end):Le[s]=Se[s],n.exec("update-task",{id:f,diff:ge,task:Le,...Q&&{segmentIndex:Z}})}le=!0}ue()}}function re(){document.body.style.userSelect="none"}function ue(){document.body.style.userSelect=""}function pe(f){if(!t.readonly){const s=A.locateID(f.target);if(s&&!f.target.classList.contains("wx-link")){const r=A.locateID(f.target,"data-segment");n.exec("show-editor",{id:s,...r!==null&&{segmentIndex:r}})}}}function Ce(f){if(le){le=!1;return}const s=A.locateID(f.target);if(s){const r=f.target.classList;if(r.contains("wx-link")){const y=r.contains("wx-left");if(!U.value){U.value={id:s,start:y};return}U.value.id!==s&&!xe(s,y)&&n.exec("add-link",{link:{source:U.value.id,target:s,type:ie(U.value.start,y)}})}else if(r.contains("wx-delete-button-icon"))n.exec("delete-link",{id:ke.value}),ke.value=null;else{const y=A.locateID(f.target,"data-segment");n.exec("select-task",{id:s,toggle:f.ctrlKey||f.metaKey,range:f.shiftKey,...y!==null&&{segmentIndex:y}})}}$e()}function ye(f){return`left:${f.$x}px;top:${f.$y}px;width:${f.$w}px;height:${f.$h}px;line-height:${f.$h}px;`}function Re(f){return`left:${f.$x_base}px;top:${f.$y_base}px;width:${f.$w_base}px;height:${f.$h_base}px;`}function X(f){return`left:${f.$x_slack}px;top:${f.$y}px;width:${f.$w_slack}px;height:${f.$h}px;`}function L(f){if(he.value||ve)return f.preventDefault(),!1}const ae=["e2s","s2s","e2e","s2e"];function ie(f,s){return ae[(f?1:0)+(s?0:2)]}function xe(f,s){const r=U.value.id,y=U.value.start;return f===r?!0:Y.value.find(M=>M.target===f&&M.source===r&&M.type===ie(y,s))}function $e(){U.value&&(U.value=null)}function Ee(f){ke.value=f}const Qe=e.computed(()=>F.value.map(f=>f.id));function ze(f){let s=Qe.value.includes(f)?f:"task";return["task","milestone","summary"].includes(f)||(s=`task ${s}`),s}function We(f){n.exec(f.action,f.data)}const Me=e.ref(0),Ie=e.ref(null),Je=e.computed(()=>D.value.length&&Ie.value&&Ie.value.contains(document.activeElement)),Ae=e.computed(()=>Je.value&&D.value[D.value.length-1].id),He=c.subscribe(_);e.watch(He,f=>{if(f&&f.column===!1){const{id:s}=f,r=Ie.value?.querySelector(`.wx-bar[data-id='${A.setID(s)}']`);r&&r.focus()}});const Oe=f=>N.value&&f.critical;function Ge(f){if(z.value.auto){const s=m.value.getSummaryId(f,!0),r=m.value.getSummaryId(U.value.id,!0);return U.value?.id&&!(Array.isArray(s)?s:[s]).includes(U.value.id)&&!(Array.isArray(r)?r:[r]).includes(f)}return U.value}let je;return e.onMounted(()=>{window.addEventListener("mouseup",i),Ie.value&&(Me.value=Ie.value.offsetWidth,je=new ResizeObserver(f=>{for(const s of f)Me.value=s.target.offsetWidth}),je.observe(Ie.value))}),e.onUnmounted(()=>{window.removeEventListener("mouseup",i),je?.disconnect()}),(f,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"container",ref:Ie,class:"wx-bars",style:e.normalizeStyle(`line-height: ${J.value.length?J.value[0].$h:0}px`),onContextmenu:L,onMousedown:De,onMousemove:te,onTouchstart:we,onTouchmove:x,onTouchend:I,onClick:Ce,onDblclick:pe,onDragstart:s[0]||(s[0]=e.withModifiers(()=>{},["prevent"]))},[e.unref(S)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(J.value,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.id},[r.$visibleSlack?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass("wx-slack wx-slack-"+r.type),style:e.normalizeStyle(X(r))},null,6)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0),e.createVNode(on,{onSelectLink:Ee,selectedLink:fe.value,readonly:t.readonly},null,8,["selectedLink","readonly"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.id},[r.$skip?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wx-bar","wx-"+ze(r.type),{"wx-touch":he.value&&se.value&&r.id===se.value.id,"wx-selected":U.value&&U.value.id===r.id,"wx-critical":Oe(r),"wx-reorder-task":r.$reorder,"wx-split":e.unref(G)&&r.segments}]),style:e.normalizeStyle(ye(r)),"data-id":e.unref(A.setID)(r.id),"data-task-id":e.unref(A.setID)(r.id),tabindex:Ae.value===r.id?"0":"-1"},[!t.readonly&&!ee.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[r.id===fe.value?.target&&fe.value?.type[2]==="s"?(e.openBlock(),e.createBlock(e.unref(de.Button),{key:0,type:"danger",css:"wx-left wx-delete-button wx-delete-link"},{default:e.withCtx(()=>[...s[1]||(s[1]=[e.createElementVNode("i",{class:"wxi-close wx-delete-button-icon"},null,-1)])]),_:1})):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["wx-link","wx-left",{"wx-visible":U.value,"wx-target":!U.value||!xe(r.id,!0)&&Ge(r.id),"wx-selected":U.value&&U.value.id===r.id&&U.value.start,"wx-critical":Oe(r)}])},[...s[2]||(s[2]=[e.createElementVNode("div",{class:"wx-inner"},null,-1)])],2))],64)):e.createCommentVNode("",!0),r.type!=="milestone"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[r.progress&&!(e.unref(G)&&r.segments)?(e.openBlock(),e.createElementBlock("div",gn,[e.createElementVNode("div",{class:"wx-progress-percent",style:e.normalizeStyle("width:"+r.progress+"%")},null,4)])):e.createCommentVNode("",!0),!t.readonly&&!(e.unref(G)&&r.segments)&&!(r.type==="summary"&&e.unref(k)?.autoProgress)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"wx-progress-marker",style:e.normalizeStyle("left:calc("+r.progress+"% - 10px);")},e.toDisplayString(r.progress),5)):e.createCommentVNode("",!0),t.taskTemplate?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.taskTemplate),{key:2,data:r,api:e.unref(n),onaction:We},null,8,["data","api"])):e.unref(G)&&r.segments?(e.openBlock(),e.createBlock(pn,{key:3,task:r,type:ze(r.type)},null,8,["task","type"])):(e.openBlock(),e.createElementBlock("div",hn,e.toDisplayString(r.text||""),1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[s[3]||(s[3]=e.createElementVNode("div",{class:"wx-content"},null,-1)),t.taskTemplate?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.taskTemplate),{key:0,data:r,api:e.unref(n),onaction:We},null,8,["data","api"])):(e.openBlock(),e.createElementBlock("div",kn,e.toDisplayString(r.text),1))],64)),!t.readonly&&!ee.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[r.id===fe.value?.target&&fe.value?.type[2]==="e"?(e.openBlock(),e.createBlock(e.unref(de.Button),{key:0,type:"danger",css:"wx-right wx-delete-button wx-delete-link"},{default:e.withCtx(()=>[...s[4]||(s[4]=[e.createElementVNode("i",{class:"wxi-close wx-delete-button-icon"},null,-1)])]),_:1})):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["wx-link","wx-right",{"wx-visible":U.value,"wx-target":!U.value||!xe(r.id,!1)&&Ge(r.id),"wx-selected":U.value&&U.value.id===r.id&&!U.value.start,"wx-critical":Oe(r)}])},[...s[5]||(s[5]=[e.createElementVNode("div",{class:"wx-inner"},null,-1)])],2))],64)):e.createCommentVNode("",!0)],14,vn)),e.unref(O)&&e.unref(K)?.[r.id]?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(K)[r.id],y=>(e.openBlock(),e.createBlock(rn,{key:y.id,rollup:y,parent:r},null,8,["rollup","parent"]))),128)):e.createCommentVNode("",!0),e.unref(R)&&!r.$skip_baseline?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["wx-baseline",{"wx-milestone":r.type==="milestone"}]),style:e.normalizeStyle(Re(r))},null,6)):e.createCommentVNode("",!0)],64))),128))],36))}}),xn=ce(yn,[["__scopeId","data-v-d1ccbfc8"]]),wn={__name:"TimeScale",props:{api:{}},setup(a){const t=a,{_scales:n,xArea:o,highlightTime:l}=t.api.getReactiveState(),g=c.subscribe(n),u=c.subscribe(o),p=c.subscribe(l);function T(d,b,_){const C=d.cells;let h=0,B=C.length,P=0;for(let H=0;H<C.length;H++){if(P+C[H].width>b){B=H,h=P;break}P+=C[H].width}let q=B;for(;q<C.length&&P<_;)P+=C[q].width,q++;return{from:h,slice:C.slice(B,q)}}const v=e.computed(()=>{const d=g.value.rows,b=d.length-1;return d.map((_,C)=>C===b?{height:_.height,from:u.value.from,slice:_.cells.slice(u.value.start,u.value.end)}:{height:_.height,...T(_,u.value.from,u.value.to)})});return(d,b)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-scale",style:e.normalizeStyle({width:e.unref(g).width+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(_,C)=>(e.openBlock(),e.createElementBlock("div",{key:C,class:"wx-row",style:e.normalizeStyle({height:_.height+"px",paddingLeft:_.from+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.slice,(h,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["wx-cell",h.css,e.unref(p)?e.unref(p)(h.date,h.unit):""]),style:e.normalizeStyle({width:h.width+"px"})},[e.createElementVNode("span",{class:e.normalizeClass({"wx-cell-value":h.width>100})},e.toDisplayString(h.value),3)],6))),128))],4))),128))],4))}},gt=ce(wn,[["__scopeId","data-v-ec062507"]]),bn={class:"wx-content"},_n={key:0,class:"wx-gantt-holidays",style:{height:"100%"}},Bn=["data-id"],rt=1,ct=.003,$n=Object.assign({name:"GanttChartChart"},{__name:"Chart",props:{readonly:{},fullWidth:{},fullHeight:{},taskTemplate:{}},setup(a){const t=c.asDirective(Ze.hotkeys),n=a,o=e.inject("gantt-store"),{_selected:l,scrollTop:g,scrollLeft:u,cellHeight:p,_tasks:T,resources:v,_scales:d,area:b,groupBy:_,xArea:C,zoom:h,_calendars:B,_markers:P,highlightTime:q}=o.getReactiveState(),H=c.subscribe(l,!0),W=c.subscribe(g),Y=c.subscribe(u),j=c.subscribe(p),$=c.subscribe(d),F=c.subscribe(h),R=c.subscribe(P),D=c.subscribe(T),O=c.subscribe(v),K=c.subscribe(b),N=c.subscribe(_),m=c.subscribe(C),z=c.subscribe(B),G=c.subscribe(q),k=e.ref(0),S=e.ref(null),J=e.computed(()=>{const w=[];return H.value.length&&j.value&&H.value.forEach(i=>{w.push(`height: ${j.value}px;top: ${i.$y-3}px`)}),w});e.watch([W,k,j],()=>{le()});const ee=e.computed(()=>Math.max(k.value,n.fullHeight));e.watchEffect(()=>{S.value&&(S.value.scrollTop=W.value,S.value.scrollLeft=Y.value)});function E(){S.value.scrollLeft!==Y.value&&o.exec("scroll-chart",{left:S.value.scrollLeft})}function le(){const w=k.value||0,i=Math.ceil(w/j.value)+1,I=Math.floor((W.value||0)/j.value),ne=Math.max(0,I-rt),re=I+i+rt,ue=ne*j.value;o.exec("render-data",{start:ne,end:re,from:ue})}let U=performance.now();function se(w){const I=Math.abs(w)<50?.004:.01,ne=performance.now(),re=Math.min(ne-U,50);U=ne;const ue=me(-w*I,-ct*re,ct*re);return Math.exp(ue)}function me(w,i,I){return Math.max(Math.min(w,I),i)}let ke=!1;function fe(w){if(F.value&&(w.ctrlKey||w.metaKey)){w.preventDefault();const i=se(w.deltaY),I=w.clientX-S.value.getBoundingClientRect().left;ke||(ke=!0,requestAnimationFrame(()=>{o.exec("zoom-scale",{dir:i>1?1:-1,ratio:Math.abs(1-i),offset:I}),ke=!1}))}}function he(w){const i=G.value?.(w.date,w.unit);return i?{css:i,width:w.width}:null}const ve=e.computed(()=>$.value.minUnit!=="hour"&&$.value.minUnit!=="day"||!G.value?null:$.value.rows[$.value.rows.length-1].cells.slice(m.value.start,m.value.end).map(he)),De=e.computed(()=>{const i=$.value.rows[$.value.rows.length-1]?.cells;return($.value.minUnit==="hour"||$.value.minUnit==="day")&&i?i.slice(m.value.start,m.value.end):[]}),we=e.computed(()=>D.value.slice(K.value.start,K.value.end));function be(w){if(N.value?.field==="resource"){if(w.$resource){const re=o.getResourceCalendar(w);return re?[re]:[]}const I=w.$groupValue;return I===void 0||I==="$ungrouped"?[]:(Array.isArray(I)?I:[I]).flatMap(re=>{const ue=O.value?.byId(re);if(!ue)return[];const pe=o.getResourceCalendar(ue);return pe?[pe]:[]})}const i=w.calendar?o.getTaskCalendar(w):void 0;return i?[i]:[]}const _e=e.computed(()=>{const w=[];if(!z.value)return w;const i=o.getCalendar();return we.value.forEach((I,ne)=>{const re=be(I);re.length&&De.value.forEach((ue,pe)=>{const Ce=re.filter(ae=>!ae.isWorkingDay(ue.date)),ye=Ce.length===0,Re=i&&!i.isWorkingDay(ue.date),X={width:ue.width,height:j.value,left:(pe+m.value.start)*ue.width,top:K.value.from+ne*j.value};let L="";ye||(L=["wx-weekend",...Ce.map(ie=>ie.css).filter(Boolean)].join(" ")),ye&&Re&&(L="wx-weekend-override"),L&&w.push({...X,css:L})})}),w});function x(w){w.eventSource="chart",o.exec("hotkey",w)}let te;return e.onMounted(()=>{S.value&&(k.value=S.value.clientHeight,te=new ResizeObserver(w=>{for(const i of w)k.value=i.target.clientHeight}),te.observe(S.value))}),e.onUnmounted(()=>{te?.disconnect()}),(w,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"wx-chart",tabindex:"-1",ref_key:"chart",ref:S,onScroll:E,onWheel:fe},[e.createVNode(gt,{api:e.unref(o)},null,8,["api"]),e.unref(R).length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-markers",style:e.normalizeStyle(`height:${ee.value}px;`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(R),I=>(e.openBlock(),e.createElementBlock("div",{key:I.id||I.left,class:e.normalizeClass("wx-marker "+(I.css||"")),style:e.normalizeStyle(`left:${I.left}px`)},[e.createElementVNode("div",bn,e.toDisplayString(I.text),1)],6))),128))],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"wx-area",style:e.normalizeStyle(`width:${n.fullWidth}px;height:${ee.value}px`)},[ve.value?(e.openBlock(),e.createElementBlock("div",_n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne},[I?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(I.css),style:e.normalizeStyle(`width: ${I.width}px; left:${e.unref(m).from+ne*I.width}px`)},null,6)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,(I,ne)=>(e.openBlock(),e.createElementBlock("div",{key:ne,class:e.normalizeClass(I.css),style:e.normalizeStyle(`position: absolute; pointer-events: none; width:${I.width}px; height:${I.height}px; left:${I.left}px; top:${I.top}px`)},null,6))),128)),e.unref(H).length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(H),(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:I.id},[I.$y?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-selected","data-id":e.unref(A.setID)(I.id),style:e.normalizeStyle(J.value[ne])},null,12,Bn)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0),e.createVNode(Kt),e.createVNode(xn,{readonly:n.readonly,taskTemplate:n.taskTemplate},null,8,["readonly","taskTemplate"])],4)],32)),[[e.unref(t),{keys:{arrowup:!0,arrowdown:!0},exec:I=>x(I)}]])}}),Sn=ce($n,[["__scopeId","data-v-b83471b0"]]),Tn=Object.assign({name:"GanttResizer"},{__name:"Resizer",props:{api:{},position:{default:"after"},size:{default:4},dir:{default:"x"},onmove:{type:Function},containerWidth:{default:0},rightThreshold:{default:50}},setup(a){const t=a,{gridWidth:n,displayMode:o,_gridCollapseThreshold:l,_compactMode:g}=t.api.getReactiveState(),u=c.subscribe(n),p=c.subscribe(o),T=c.subscribe(l),v=c.subscribe(g);function d(F){let R=0;t.position==="center"?R=t.size/2:t.position==="before"&&(R=t.size);const D={size:[t.size+"px","auto"],p:[F-R+"px","0px"],p2:["auto","0px"]};if(t.dir!=="x")for(let O in D)D[O]=D[O].reverse();return D}let b=0,_;function C(F){return t.dir==="x"?F.clientX:F.clientY}function h(F){v.value||p.value==="grid"||p.value==="chart"||(b=C(F),_=u.value,document.body.style.cursor=$.value,document.body.style.userSelect="none",window.addEventListener("mousemove",P),window.addEventListener("mouseup",q))}let B;function P(F){const R=_+C(F)-b;t.api.exec("resize-grid",{width:R});let D;R<=T.value?D="chart":t.containerWidth-R<=t.rightThreshold?D="grid":D="all",p.value!==D&&t.api.exec("set-display-mode",{mode:D}),B&&clearTimeout(B),B=setTimeout(()=>t.onmove&&t.onmove(R),100)}function q(){document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",P),window.removeEventListener("mouseup",q)}function H(F){let R;v.value?R=p.value==="chart"?"grid":"chart":p.value==="grid"||p.value==="chart"?R="all":R=F==="left"?"chart":"grid",t.api.exec("set-display-mode",{mode:R})}function W(){H("left")}function Y(){H("right")}const j=e.computed(()=>d(u.value)),$=e.computed(()=>p.value!=="all"?"auto":t.dir==="x"?"ew-resize":"ns-resize");return(F,R)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wx-resizer",`wx-resizer-${a.dir}`,`wx-resizer-display-${e.unref(p)}`]),onMousedown:h,style:e.normalizeStyle(`width:${j.value.size[0]}; height: ${j.value.size[1]}; cursor:${$.value};`)},[e.createElementVNode("div",{class:"wx-button-expand-box"},[e.createElementVNode("div",{class:"wx-button-expand-content wx-button-expand-left"},[e.createElementVNode("i",{class:"wxi-menu-left",onClick:W})]),e.createElementVNode("div",{class:"wx-button-expand-content wx-button-expand-right"},[e.createElementVNode("i",{class:"wxi-menu-right",onClick:Y})])]),R[0]||(R[0]=e.createElementVNode("div",{class:"wx-resizer-line"},null,-1))],38))}}),ht=ce(Tn,[["__scopeId","data-v-bb9173dd"]]),Cn={tabindex:"0",class:"wx-layout"},En=Object.assign({name:"GanttLayout"},{__name:"Layout",props:e.mergeModels({taskTemplate:{},readonly:{}},{tableAPI:{},tableAPIModifiers:{},ganttWidth:{},ganttWidthModifiers:{}}),emits:["update:tableAPI","update:ganttWidth"],setup(a){const t=c.asDirective(Ze.hotkeys),n=e.useModel(a,"tableAPI"),o=e.useModel(a,"ganttWidth"),l=e.inject("gantt-store"),{_tasks:g,_scales:u,cellHeight:p,columns:T,scrollTop:v,undo:d,gridWidth:b,_columnsWidth:_}=l.getReactiveState(),C=c.subscribe(g),h=c.subscribe(u),B=c.subscribe(p),P=c.subscribe(T),q=c.subscribe(v),H=c.subscribe(d),W=c.subscribe(b),Y=c.subscribe(_),j=e.ref(void 0),$=e.ref(void 0),F=e.ref(null),R=e.computed(()=>o.value-$.value),D=e.computed(()=>h.value.width),O=e.computed(()=>C.value.length*B.value),K=e.computed(()=>h.value.height+O.value+R.value);e.watchEffect(()=>{let ee;F.value&&(ee=new ResizeObserver(N),ee.observe(F.value)),e.onWatcherCleanup(()=>{ee&&ee.disconnect()})});function N(){l.exec("resize-chart",{width:o.value-W.value-R.value-4,height:j.value-h.value.height,scrollSize:R.value})}const m=e.ref(null);function z(){l.exec("scroll-chart",{top:m.value.scrollTop})}function G(){m.value&&q.value!==m.value.scrollTop&&(m.value.scrollTop=q.value)}e.watchEffect(()=>{q.value,G()});let k;e.onMounted(()=>{m.value&&(k=new ResizeObserver(()=>{j.value=m.value?.offsetHeight,o.value=m.value?.offsetWidth}),k.observe(m.value),j.value=m.value.offsetHeight,o.value=m.value.offsetWidth)}),e.onUnmounted(()=>{k?.disconnect()});const S=e.ref(null);let J;return e.onMounted(()=>{S.value&&(J=new ResizeObserver(()=>{$.value=S.value?.offsetWidth}),J.observe(S.value),$.value=S.value.offsetWidth)}),e.onUnmounted(()=>{J?.disconnect()}),(ee,E)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-gantt",ref_key:"ganttDiv",ref:m,onScroll:z},[e.createElementVNode("div",{ref_key:"pseudoRowsDiv",ref:S,class:"wx-pseudo-rows",style:e.normalizeStyle(`height:${K.value}px;width:100%;`)},[e.createElementVNode("div",{class:"wx-stuck",style:e.normalizeStyle(`height:${j.value}px;width:${$.value}px;`)},[e.withDirectives((e.openBlock(),e.createElementBlock("div",Cn,[e.unref(P).length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Yt,{columnWidth:e.unref(Y),readonly:a.readonly,fullHeight:O.value,tableAPI:n.value,"onUpdate:tableAPI":E[0]||(E[0]=le=>n.value=le)},null,8,["columnWidth","readonly","fullHeight","tableAPI"]),e.createVNode(ht,{containerWidth:o.value,api:e.unref(l)},null,8,["containerWidth","api"])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"wx-content",ref_key:"chart",ref:F},[e.createVNode(Sn,{readonly:a.readonly,fullWidth:D.value,fullHeight:O.value,taskTemplate:a.taskTemplate},null,8,["readonly","fullWidth","fullHeight","taskTemplate"])],512)])),[[e.unref(t),{keys:{"ctrl+c":!0,"ctrl+v":!0,"ctrl+x":!0,"ctrl+d":!0,backspace:!0,"ctrl+z":e.unref(H),"ctrl+y":e.unref(H)},exec:le=>{le.isInput||e.unref(l).exec("hotkey",le)}}]])],4)],4)],544))}}),In=ce(En,[["__scopeId","data-v-0e70f272"]]);function Dn(a){return{year:"%Y",quarter:`${a("Q")} %Q`,month:"%M",week:`${a("Week")} %w`,day:"%M %j",hour:"%H:%i"}}function Rn(a,t){return typeof a=="function"?a:A.dateToString(a,t)}function kt(a,t){return a.map(({format:n,...o})=>({...o,format:Rn(n,t)}))}function Ln(a,t){const n=Dn(t);for(let o in n)n[o]=A.dateToString(n[o],a);return n}function Vn(a,t){if(!a||!a.length)return a;const n=A.dateToString("%d-%m-%Y",t);return a.map(o=>o.template?o:o.id==="start"||o.id==="end"?{...o,_template:l=>n(l),template:l=>n(l)}:o.id==="duration"?{...o,_template:l=>l,template:l=>l}:o)}function Nn(a,t){return a.levels?{...a,levels:a.levels.map(n=>({...n,scales:kt(n.scales,t)}))}:a}const zn=650,Wn=Object.assign({name:"GanttComponentsGantt"},{__name:"Gantt",props:{taskTemplate:{default:null},markers:{default:()=>[]},taskTypes:{default:()=>oe.defaultTaskTypes},tasks:{default:()=>[]},selected:{default:()=>[]},activeTask:{default:null},links:{default:()=>[]},resources:{default:null},assignments:{default:()=>[]},scales:{default:()=>[{unit:"month",step:1,format:"%F %Y"},{unit:"day",step:1,format:"%j"}]},columns:{default:null},start:{default:null},end:{default:null},lengthUnit:{default:"day"},durationUnit:{default:"day"},cellWidth:{default:100},cellHeight:{default:38},scaleHeight:{default:36},gridWidth:{default:440},displayMode:{default:"all"},readonly:{type:Boolean,default:!1},cellBorders:{default:"full"},zoom:{type:[Boolean,Object,Array],default:!1},baselines:{type:[Boolean,Object],default:!1},rollups:{type:[Boolean,Object],default:!1},highlightTime:{type:Function,default:null},init:{type:Function,default:null},autoScale:{type:Boolean,default:!0},unscheduledTasks:{type:Boolean,default:!1},criticalPath:{default:null},schedule:{default:()=>({type:"forward"})},projectStart:{default:null},projectEnd:{default:null},calendar:{default:null},calendars:{default:()=>[]},undo:{type:Boolean,default:!1},splitTasks:{type:Boolean,default:!1},summary:{default:null},slack:{type:Boolean,default:!1},groupBy:{default:null},wbs:{type:Boolean,default:!1}},setup(a,{expose:t}){const n=a,o=e.useAttrs(),l=new oe.DataStore(c.writable),g={...Xe.en,...Pe.en};let u=e.inject("wx-i18n",null);u?u=u.extend(g,!0):u=A.locale(g),e.provide("wx-i18n",u);const{calendar:p}=u.getRaw(),T=e.computed(()=>{let E={zoom:Nn(n.zoom,p),scales:kt(n.scales,p),columns:Vn(n.columns??oe.getDefaultColumns({resources:!!n.resources,wbs:n.wbs}),p),links:n.links,cellWidth:n.cellWidth};return E.zoom&&(E={...E,...oe.normalizeZoom(E.zoom,Ln(p,u.getGroup("gantt")),E.scales,n.cellWidth)}),E});let v=l.in;const d=/-/g;let b=new tt.EventBusRouter((E,le)=>{const U="on"+E.replace(d,"");o[U]&&o[U](le)});v.setNext(b);const _=e.ref(void 0),C=e.ref(void 0),h=e.computed(()=>C.value<=zn),B=l.getState.bind(l),P=l.getReactive.bind(l),q=()=>({data:l}),H=v.exec,W=E=>b=b.setNext(E),Y=v.intercept.bind(v),j=v.on.bind(v),$=v.detach.bind(v),F=E=>l.getTask(E),R=E=>l.getResource(E),D=E=>l.serialize(E),O=E=>E?new Promise(le=>setTimeout(()=>le(_.value),1)):_.value,K=()=>l.getHistory(),N=E=>l.getCalendar(E),m=E=>l.getTaskCalendar(E),z=E=>l.getResourceCalendar(E),G=E=>l.getTaskResources(E),k=E=>l.getResourceTasks(E),S={getState:B,getReactiveState:P,getStores:q,exec:H,setNext:W,intercept:Y,on:j,detach:$,getTable:O,getTask:F,getResource:R,serialize:D,getHistory:K,getCalendar:N,getTaskResources:G,getResourceTasks:k,getTaskCalendar:m};t({getState:B,getReactiveState:P,getStores:q,exec:H,setNext:W,intercept:Y,on:j,detach:$,getTable:O,getTask:F,getResource:R,serialize:D,getHistory:K,getCalendar:N,getTaskResources:G,getResourceTasks:k,getTaskCalendar:m,getResourceCalendar:z}),e.provide("gantt-store",{getReactiveState:l.getReactive.bind(l),getState:l.getState.bind(l),exec:v.exec.bind(v),getTask:l.getTask.bind(l),getTaskCalendar:l.getTaskCalendar.bind(l),getResourceCalendar:l.getResourceCalendar.bind(l),getCalendar:l.getCalendar.bind(l),getTaskResources:l.getTaskResources.bind(l),getHistory:l.getHistory.bind(l)});let J=!0;const ee=()=>{const E=T.value;l.init({tasks:n.tasks,links:E.links,resources:n.resources,assignments:n.assignments,start:n.start,columns:E.columns,end:n.end,lengthUnit:n.lengthUnit,cellWidth:E.cellWidth,cellHeight:n.cellHeight,scaleHeight:n.scaleHeight,scales:E.scales,taskTypes:n.taskTypes,zoom:E.zoom,selected:n.selected,activeTask:n.activeTask,baselines:n.baselines,rollups:n.rollups===!0?{type:"closest"}:n.rollups,autoScale:n.autoScale,unscheduledTasks:n.unscheduledTasks,markers:n.markers,durationUnit:n.durationUnit,criticalPath:n.criticalPath,schedule:n.schedule,projectStart:n.projectStart,projectEnd:n.projectEnd,calendar:n.calendar,calendars:n.calendars,slack:n.slack,undo:n.undo,_weekStart:p.weekStart,splitTasks:n.splitTasks,summary:n.summary,groupBy:n.groupBy,highlightTime:n.highlightTime,wbs:n.wbs,displayMode:n.displayMode,gridWidth:n.gridWidth,cellBorders:n.cellBorders,_compactMode:h.value}),J&&n.init&&(n.init(S),J=!1)};return e.watchEffect(ee),(E,le)=>(e.openBlock(),e.createBlock(In,{taskTemplate:n.taskTemplate,readonly:n.readonly,tableAPI:_.value,"onUpdate:tableAPI":le[0]||(le[0]=U=>_.value=U),ganttWidth:C.value,"onUpdate:ganttWidth":le[1]||(le[1]=U=>C.value=U)},null,8,["taskTemplate","readonly","tableAPI","ganttWidth"]))}}),Mn=Object.assign({name:"GanttToolbar"},{__name:"Toolbar",props:{api:{default:null},items:{default:()=>[]}},setup(a){const t=a;let n=e.inject("wx-i18n",null);n||(n=A.locale(Pe.en),e.provide("wx-i18n",n));const o=e.inject("wx-i18n").getGroup("gantt"),l=c.subscribeLater(()=>t.api?.getReactiveState()?._selected),g=c.subscribeLater(()=>t.api?.getReactiveState()?.undo),u=c.subscribeLater(()=>t.api?.getReactiveState()?.history),p=c.subscribeLater(()=>t.api?.getReactiveState()?.splitTasks),T=c.subscribeLater(()=>t.api?.getReactiveState()?.groupBy),v=["undo","redo"],d=e.computed(()=>{const _=oe.getToolbarButtons({undo:!0,splitTasks:!0});return(t.items.length?t.items:oe.getToolbarButtons({undo:g().value,splitTasks:p().value,group:!!T().value?.field})).map(h=>(h={...h,disabled:!1},h.handler=oe.isHandledAction(_,h.id)?B=>oe.handleAction(t.api,B.id,null,o):h.handler,h.text&&(h.text=o(h.text)),h.menuText&&(h.menuText=o(h.menuText)),h))}),b=e.computed(()=>{const _=l().value,C=[];return d.value.forEach(h=>{const B=h.id;if(B==="add-task"||!v.includes(B))if(!_?.length||!t.api){if(B!=="add-task")return;C.push(h)}else C.push({...h,disabled:h.isDisabled&&_.some(P=>h.isDisabled(P,t.api.getState(),t.api.getTaskCalendar(P)))});else v.includes(B)&&C.push({...h,disabled:h.isDisabled(u().value)})}),C.filter((h,B)=>{if(t.api&&h.isHidden)return!_.some(P=>h.isHidden(P,t.api.getState()));if(h.comp==="separator"){const P=C[B+1];if(!P||P.comp==="separator")return!1}return!0})});return(_,C)=>(e.openBlock(),e.createBlock(e.unref(dt.Toolbar),{items:b.value},null,8,["items"]))}}),An=["oncontextmenu"],Hn={__name:"ContextMenu",props:{options:{default:()=>[]},api:{default:null},resolver:{default:null},filter:{default:null},at:{default:"point"},onclick:{type:Function},css:{}},setup(a,{expose:t}){const n=a;let o=null;const l=e.ref(null);let g=e.inject("wx-i18n",null);g||(g=A.locale({...Pe.en,...Xe.en}),e.provide("wx-i18n",g));const u=e.inject("wx-i18n").getGroup("gantt"),p=c.subscribeLater(()=>n.api?.getReactiveState()?.taskTypes),T=c.subscribeLater(()=>n.api?.getReactiveState()?.selected),v=c.subscribeLater(()=>n.api?.getReactiveState()?._selected),d=c.subscribeLater(()=>n.api?.getReactiveState()?.splitTasks),b=c.subscribeLater(()=>n.api?.getReactiveState()?.summary),_=c.subscribeLater(()=>n.api?.getReactiveState()?.groupBy),C=e.computed(()=>({splitTasks:d().value,taskTypes:p().value,summary:b().value,group:!!_().value?.field})),h=e.computed(()=>v().value?.length?v().value:l.value?[l.value]:[]),B=e.computed(()=>oe.getMenuOptions(C.value)),P=e.computed(()=>n.options.length?n.options:null),q=e.computed(()=>W(P.value??B.value));function H(N){return N.map(m=>{const z={...m};return m.data&&(z.data=H(m.data)),z})}function W(N){return N.map(m=>(m={...m},m.text&&(m.text=u(m.text)),m.subtext&&(m.subtext=u(m.subtext)),m.data&&(m.data=W(m.data)),m))}function Y(){if(!n.api)return[];const N=H(q.value),m=z=>{z.forEach(G=>{G.isDisabled&&(G.disabled=h.value.some(k=>G.isDisabled(k,n.api.getState(),n.api.getTaskCalendar(k),o))),G.data&&m(G.data)})};return m(N),N}function j(N,m){if(A.locate(m.target,"data-menu-ignore")?.classList.contains("wx-resource-load"))return null;let z=N?n.api.getTask(N):null;if(n.resolver){const G=n.resolver(N,m);z=G===!0?z:G}if(l.value=z,z){const G=A.locateID(m.target,"data-segment");G!==null?o={id:z.id,segmentIndex:G}:o=z.id,T().value.includes(z.id)||n.api.exec("select-task",{id:z.id}),D.value=Y()}return z}function $(N){const m=N.action;m&&(oe.isHandledAction(B.value,m.id)&&oe.handleAction(n.api,m.id,o,u),n.onclick&&n.onclick(N))}function F(N){if(!n.api)return!0;let m=n.filter?h.value.every(z=>n.filter(N,z)):!0;return m&&N.isHidden&&(m=!h.value.some(z=>N.isHidden(z,n.api.getState(),o))),m}let R=!1;e.watchEffect(()=>{n.api&&!R&&(R=!0,n.api.on("scroll-chart",()=>O.value.show()),n.api.on("drag-task",()=>O.value.show()))});const D=e.ref([]),O=e.ref(null);function K(N,m){D.value=Y(),O.value.show(N,m)}return t({show:K}),(N,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(yt.ContextMenu),{filter:F,options:D.value,dataKey:"id",resolver:j,onclick:$,css:a.css,at:a.at,ref_key:"menu",ref:O},null,8,["options","css","at"]),e.createElementVNode("span",{oncontextmenu:O.value?.show,"data-menu-ignore":"true"},[e.renderSlot(N.$slots,"default",{},void 0,!0)],8,An)],64))}},On=ce(Hn,[["__scopeId","data-v-6e6920ee"]]),jn={__name:"GridSection",props:{columns:{},data:{},onaction:{type:Function},onedit:{type:Function},sizes:{},oninit:{type:Function}},setup(a){const t=a;function n(l){const g=A.locateID(l),u=l.target.dataset.action;u&&l.preventDefault(),g&&u&&t.onaction&&t.onaction(g,u)}function o(l){t.oninit&&t.oninit(l),l.on("update-cell",g=>{const{id:u,column:p,value:T}=g;t.onedit(u,p,T)})}return(l,g)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-table",onClick:n},[e.createVNode(e.unref(Ve.Grid),{init:o,columns:a.columns,data:a.data,select:!1,columnStyle:u=>`wx-editor-cell wx-text-${u.align} ${u.id==="delete"?"wx-action":""}`,sizes:a.sizes||{}},null,8,["columns","data","columnStyle","sizes"])]))}},nt=ce(jn,[["__scopeId","data-v-011a009e"]]),Fn={class:"wx-wrapper"},Pn={class:"wx-text"},Gn={key:0,class:"wxi-angle-down"},Un={__name:"LinkTypeCell",props:{row:{},column:{},data:{}},setup(a){const t=a,n=e.computed(()=>t.data?t.data.label:t.column.options.find(o=>o.id===t.row.type)?.label||"");return(o,l)=>(e.openBlock(),e.createElementBlock("div",Fn,[e.createElementVNode("div",Pn,e.toDisplayString(n.value),1),a.row?(e.openBlock(),e.createElementBlock("i",Gn)):e.createCommentVNode("",!0)]))}},it=ce(Un,[["__scopeId","data-v-2569b653"]]),qn={class:"wx-title"},Yn={key:0,class:"wx-nodata"},Kn=Object.assign({name:"GanttEditorLinks",inheritAttrs:!1},{__name:"Links",props:{api:{},autoSave:{},onextchange:{type:Function},predecessors:{default:null},successors:{default:null},batch:{default:"links"}},setup(a){const t=e.inject("wx-i18n").getGroup("gantt"),n=a,{activeTask:o,_activeTask:l,links:g,tasks:u,schedule:p,unscheduledTasks:T}=n.api.getReactiveState(),v=c.subscribe(o),d=c.subscribe(l),b=c.subscribe(g,!0),_=c.subscribe(u),C=c.subscribe(p),h=c.subscribe(T),B=e.ref();e.watchEffect(()=>{B.value=Y()});const P=[{id:"e2s",label:t("End-to-start")},{id:"s2s",label:t("Start-to-start")},{id:"e2e",label:t("End-to-end")},{id:"s2e",label:t("Start-to-end")}];function q(D){return D.type==="e2s"?{type:"text",config:{type:"number"}}:null}const H=e.computed(()=>!C.value?.auto||h.value&&d.value.unscheduled);function W(){return[{id:"taskText",header:t("Task name"),flexgrow:2},{id:"lag",header:t("Lag"),editor:q,flexgrow:1,hidden:H.value},{id:"type",header:t("Type"),width:124,options:P,editor:{type:"richselect",config:{cell:it}},cell:it},{id:"delete",header:"",cell:Fe,width:50,align:"center"}]}function Y(){if(v.value){const D=[],O=[];(!n.predecessors||!n.successors)&&b.value.forEach(m=>{!n.predecessors&&m.target===v.value&&D.push(m),!n.successors&&m.source===v.value&&O.push(m)});const K=n.predecessors||D.map(m=>{const{id:z,lag:G,type:k,source:S}=m;return{id:z,type:k,lag:G,taskText:_.value.byId(S).text}}),N=n.successors||O.map(m=>{const{id:z,lag:G,type:k,target:S}=m;return{id:z,type:k,lag:G,taskText:_.value.byId(S).text}});return[{title:t("Predecessors"),data:K},{title:t("Successors"),data:N}]}}function j(D){return{view:"links",event:D,values:{predecessors:B.value[0].data,successors:B.value[1].data}}}function $(D){n.autoSave?n.api.exec("delete-link",{id:D}):(B.value=B.value.map(O=>({...O,data:O.data.filter(K=>K.id!==D)})),n.onextchange?.(j({id:D,action:"delete-link",data:{id:D}})))}function F(D,O,K){const N={[O]:K};O==="type"&&C.value?.auto&&K!=="e2s"&&(N.lag=""),n.autoSave?n.api.exec("update-link",{id:D,link:N}):(B.value=B.value.map(m=>({...m,data:m.data.map(z=>z.id===D?{...z,...N}:z)})),n.onextchange?.(j({id:D,action:"update-link",data:{id:D,link:N}})))}const R=e.computed(()=>B.value&&!B.value[0].data.length&&!B.value[1].data.length);return(D,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wx-wrapper",{"wx-nobatch":a.batch!=="links"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,K=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K.title},[K.data.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",qn,e.toDisplayString(K.title),1),e.createVNode(nt,{columns:W(),onaction:$,onedit:F,data:K.data,sizes:{rowHeight:44}},null,8,["columns","data"])],64)):e.createCommentVNode("",!0)],64))),128)),R.value?(e.openBlock(),e.createElementBlock("div",Yn,e.toDisplayString(e.unref(t)("No links")),1)):e.createCommentVNode("",!0)],2))}}),Xn=ce(Kn,[["__scopeId","data-v-18ec7e7b"]]),Zn={class:"date-time-controll"},Qn={__name:"DateTimePicker",props:{value:{},time:{},format:{},onchange:{type:Function}},setup(a){const t=a,n=e.computed(()=>{const{value:l,time:g,format:u,onchange:p,...T}=t;return T});function o(l){const g=new Date(l.value);g.setHours(t.value.getHours()),g.setMinutes(t.value.getMinutes()),t.onchange?.({value:g})}return(l,g)=>(e.openBlock(),e.createElementBlock("div",Zn,[e.createVNode(e.unref(de.DatePicker),e.mergeProps(n.value,{value:a.value,onchange:o,format:a.format,buttons:["today"],clear:!1}),null,16,["value","format"]),a.time?(e.openBlock(),e.createBlock(e.unref(de.TimePicker),{key:0,value:a.value,onchange:a.onchange,format:a.format},null,8,["value","onchange","format"])):e.createCommentVNode("",!0)]))}},Jn=ce(Qn,[["__scopeId","data-v-1f9dfea2"]]),ea={class:"wx-avatar"},ta={class:"wx-text"},na={class:"wx-name"},aa={key:0,class:"wx-role"},oa={__name:"ResourcesEditorCell",props:{row:{},data:{}},setup(a){const t=a,n=e.computed(()=>t.data||t.row);return(o,l)=>n.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",ea,[e.createVNode(e.unref(de.Avatar),{value:n.value,size:40},null,8,["value"])]),e.createElementVNode("div",ta,[e.createElementVNode("div",na,e.toDisplayString(n.value.name),1),n.value.role?(e.openBlock(),e.createElementBlock("div",aa,e.toDisplayString(n.value.role),1)):e.createCommentVNode("",!0)])],64)):e.createCommentVNode("",!0)}},ut=ce(oa,[["__scopeId","data-v-acea3cd0"]]),la={class:"wx-section"},sa={key:1,class:"wx-nodata"},ra={class:"wx-button-wrapper"},ca=Object.assign({name:"GanttEditorResources",inheritAttrs:!1},{__name:"Resources",props:{api:{},autoSave:{},onextchange:{type:Function},taskAssignments:{default:null}},setup(a){const n=e.inject("wx-i18n").getGroup("gantt"),o=a,l=o.onextchange,{activeTask:g,resources:u,_assignments:p,assignments:T}=o.api.getReactiveState(),v=c.subscribe(g),d=c.subscribe(u),b=c.subscribe(T),_=e.ref(void 0),C=e.ref(null),h=e.ref([]);function B(k){h.value=o.taskAssignments||o.api.getTaskResources(k).map(S=>({...S,resource:S.id,id:S.assignmentId}))}const P=[g.subscribe(k=>{B(k)}),p.subscribe(()=>B(v.value))];e.onUnmounted(()=>{for(const k of P)k()});const q=e.computed(()=>{const k=[];return d.value?.eachChild(S=>{S.data||k.push({...S,label:S.name})},0),k}),H=e.computed(()=>q.value.filter(k=>!h.value.find(S=>S.resource===k.id)));function W(k){return{view:"resources",event:k,values:{taskAssignments:h.value}}}function Y(k){_.value.exec("close-editor",{ignore:!0}),o.autoSave?o.api.exec("delete-assignment",{id:k}):(h.value=h.value.filter(S=>S.id!==k),l&&l(W({id:k,action:"delete-assignment",data:{id:k}}))),C.value=null}function j(k,S){const J=v.value;S={...S,units:100,task:J,id:k};const ee={assignment:S};if(o.autoSave)o.api.exec("add-assignment",ee);else{const E=d.value?.byId(S.resource);h.value=[...h.value,{...E,...S}],l&&l(W({id:E.id,action:"add-assignment",data:ee}))}}function $(k){return k.id===C.value?H.value:[q.value.find(J=>J.id===k.resource)].concat(H.value)}function F(k,S){let J=b.value?.byId(k);J||(J=h.value.find(E=>E.id===k));const ee={id:k,assignment:{units:J.units||100,...S,id:k}};o.autoSave?o.api.exec("update-assignment",ee):(S.resource&&S.resource!==J.resource&&(S={...d.value?.byId(S.resource),...ee.assignment}),h.value=h.value.map(E=>E.id===k?{...E,...S}:E),l&&l(W({id:k,action:"update-assignment",data:ee})))}const R=e.computed(()=>(H.value,[{id:"resource",header:n("Resource"),cell:ut,type:"string",flexgrow:3,editor:k=>({type:"combo",config:{options:$(k),cell:ut}}),options:q.value},{id:"units",header:n("Units"),flexgrow:1,editor:{type:"text",config:{type:"number"}},template:k=>`${k}%`},{id:"delete",header:"",cell:Fe,width:50,align:"center"}]));function D(k,S){k&&S==="delete"&&Y(k)}function O(k,S,J){if(S==="units")F(k,{units:J*1});else if(S==="resource"){const ee={resource:J};k===C.value?j(k,ee):F(k,ee)}C.value=null}function K(k){_.value=k,_.value.on("close-editor",()=>{C.value&&(_.value.exec("delete-row",{id:C.value}),C.value=null)})}const N=e.computed(()=>C.value||!H.value.length);let m=!1;function z(){_.value?.exec("close-editor",{ignore:!0}),m||(m=!0,C.value=tt.tempID(),requestAnimationFrame(()=>{G(C.value),m=!1}))}function G(k){_.value.exec("add-row",{id:k,row:{units:100}}),setTimeout(()=>{_.value.exec("open-editor",{id:k,column:"resource"})})}return(k,S)=>(e.openBlock(),e.createElementBlock("div",la,[h.value.length||C.value?(e.openBlock(),e.createBlock(nt,{key:0,oninit:K,columns:R.value,onaction:D,onedit:O,data:h.value,sizes:{rowHeight:52}},null,8,["columns","data"])):(e.openBlock(),e.createElementBlock("div",sa,e.toDisplayString(e.unref(n)("No assignments")),1)),e.createElementVNode("div",ra,[e.createVNode(e.unref(de.Button),{disabled:N.value,icon:"wxi-plus",css:"wx-button",onclick:z},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Add resource")),1)]),_:1},8,["disabled"])])]))}}),ia=ce(ca,[["__scopeId","data-v-7bdae259"]]),ua={class:"wx-section"},da={key:1,class:"wx-nodata"},fa=Object.assign({name:"GanttEditorSegments",inheritAttrs:!1},{__name:"Segments",props:{api:{},autoSave:{},segments:{},onextchange:{type:Function}},setup(a){const t=e.inject("wx-i18n"),n=t.getGroup("gantt"),o=t.getRaw(),l=o.gantt?.dateFormat||o.formats?.dateFormat,g=A.dateToString(l,o.calendar),u=a,p=u.onextchange,{_activeTask:T}=u.api.getReactiveState(),v=c.subscribe(T),d=e.ref([]);function b(){const W=v.value;return!W||u.segments===null?[]:u.segments?[...u.segments]:W?.segments?.map(Y=>({...Y,id:Y.id||tt.tempID()}))}e.watchEffect(()=>{v.value,d.value=b()});const _=e.computed(()=>[{id:"text",header:n("Name"),type:"string",flexgrow:3,editor:"text"},{id:"start",header:n("Start"),flexgrow:2,template:W=>g(W),editor:"datepicker"},{id:"duration",header:n("Duration"),flexgrow:2,editor:{type:"text",config:{type:"number"}}},{id:"delete",header:"",cell:Fe,width:50,align:"center"}]),C=e.ref(null);function h(W){C.value=W}function B(W){return{view:"segments",event:W,values:{segments:d.value.length?[...d.value]:null}}}function P(W){const Y=d.value.findIndex(F=>F.id===W);d.value=d.value.filter((F,R)=>R!==Y);const $={id:v.value.id,task:{segments:d.value.length?[...d.value]:null}};u.autoSave?u.api.exec("update-task",$):p&&p(B({id:W,action:"update-task",data:$}))}function q(W,Y){Y==="delete"&&P(W)}function H(W,Y,j){const{data:$}=C.value.getState();let F=$.findIndex(K=>K.id===W);Y==="duration"&&(j=j*1);const R={...d.value[F],[Y]:j},D=v.value;oe.prepareEditTask(R,u.api.getState(),u.api.getTaskCalendar(D),Y);const O={id:D.id,segmentIndex:F,task:R};u.autoSave?u.api.exec("update-task",O):(d.value=d.value.map(K=>K.id===W?{...K,...R}:K),p&&p(B({id:W,action:"update-task",data:O})))}return(W,Y)=>(e.openBlock(),e.createElementBlock("div",ua,[d.value.length?(e.openBlock(),e.createBlock(nt,{key:0,columns:_.value,oninit:h,onaction:q,data:d.value,onedit:H},null,8,["columns","data"])):(e.openBlock(),e.createElementBlock("div",da,e.toDisplayString(e.unref(n)("No segments")),1))]))}}),ma=ce(fa,[["__scopeId","data-v-5a914a60"]]),Ye="general",pa=Object.assign({name:"GanttEditor"},{__name:"Editor",props:{api:{default:null},items:{default:()=>[]},css:{default:""},layout:{default:"default"},readonly:{type:Boolean,default:!1},placement:{default:"sidebar"},bottomBar:{type:[Boolean,Object],default:!1},topBar:{type:[Boolean,Object],default:!0},autoSave:{type:Boolean,default:!0},focus:{type:Boolean,default:!1},hotkeys:{default:()=>({})}},setup(a){Te.registerEditorItem("select",de.RichSelect),Te.registerEditorItem("date",Jn),Te.registerEditorItem("twostate",de.TwoState),Te.registerEditorItem("slider",de.Slider),Te.registerEditorItem("counter",de.Counter),Te.registerEditorItem("links",Xn),Te.registerEditorItem("checkbox",de.Checkbox),Te.registerEditorItem("resources",ia),Te.registerEditorItem("segments",ma),dt.registerToolbarItem("tabs",de.Tabs);const t=a;let n=e.inject("wx-i18n",null);n||(n=A.locale({...Pe.en,...Xe.en}),e.provide("wx-i18n",n));const o=n.getGroup("gantt"),l=n.getRaw(),g=l.gantt?.dateFormat||l.formats?.dateFormat,u=A.dateToString(g,l.calendar),p=c.subscribeLater(()=>t.api?.getReactiveState()?._activeTask),T=c.subscribeLater(()=>t.api?.getReactiveState()?.activeTask),v=c.subscribeLater(()=>t.api?.getReactiveState()?.unscheduledTasks),d=c.subscribeLater(()=>t.api?.getReactiveState()?.rollups),b=c.subscribeLater(()=>t.api?.getReactiveState()?.summary),_=c.subscribeLater(()=>t.api?.getReactiveState()?.links),C=c.subscribeLater(()=>t.api?.getReactiveState()?.splitTasks),h=c.subscribeLater(()=>t.api?.getReactiveState()?.taskTypes),B=c.subscribeLater(()=>t.api?.getReactiveState()?.resources??null),P=c.subscribeLater(()=>t.api?.getReactiveState()?._compactMode),q=c.subscribeLater(()=>t.api?.getReactiveState()?.undo),H=e.ref(Ye),W=e.computed(()=>P().value?"wx-full-screen":""),Y=e.computed(()=>oe.getEditorItems({unscheduledTasks:v().value,rollups:d().value,summary:b().value,taskTypes:h().value,resources:B().value,splitTasks:C().value})),j=e.ref(new Map),$=e.ref(new Map),F=e.ref(new Map),R=e.ref(null),D=e.ref(void 0),O=e.ref(null),K={taskAssignments:null,predecessors:null,successors:null},N=e.ref({...K}),m=e.computed(()=>{const x=p().value;if(!x)return null;const te={...x};if(t.readonly){let w={parent:te.parent};return Y.value.forEach(({key:i,comp:I})=>{if(I!=="links"&&I!=="resources"){const ne=te[i];I==="date"&&ne instanceof Date?w[i]=u(ne):I==="slider"&&i==="progress"?w[i]=`${ne}%`:w[i]=ne}}),w}return te||null});e.watch(m,x=>{D.value=x}),e.watch(T,()=>{j.value=new Map,$.value=new Map,F.value=new Map,O.value=null,R.value=null,H.value||(H.value=Ye),N.value={...K}});function z(x,te="form"){return!t.api||!x||!Array.isArray(x)?x:x.filter(w=>D.value?!w.isHidden||!w.isHidden(D.value,t.api.getState()):!0).map(w=>{const i={...w};return i.items&&Array.isArray(i.items)?(i.items=z(i.items),i):(te==="form"&&!i.batch&&(i.batch=Ye),["links","resources","segments"].includes(i.key)&&t.api&&(i.api=t.api,i.autoSave=t.autoSave,i.key==="resources"?i.taskAssignments=N.value.taskAssignments:i.key==="links"?(i.successors=N.value.successors,i.predecessors=N.value.predecessors):i.key==="segments"&&(i.segments=N.value.segments),i.onextchange=le),i.id==="tabs"&&(i.api=t.api,i.css="wx-gantt-tabs",i.value=H.value,i.onchange=i.onchange||_e),i.comp==="slider"&&i.key==="progress"&&(i.labelTemplate=I=>`${o(i.label)} ${I}%`),i.text&&(i.text=o(i.text)),i.label&&(i.label=o(i.label)),i.options&&(i.options=z(i.options)),i.config&&(i.config={...i.config}),i.config?.placeholder&&(i.config.placeholder=o(i.config.placeholder)),D.value&&i.isDisabled&&i.isDisabled(D.value,t.api.getState(),t.api.getTaskCalendar(D.value))?i.disabled=!0:delete i.disabled,i)})}const G=e.computed(()=>{const x=t.items.length?t.items:Y.value;return z(x)}),k=e.computed(()=>new Set(G.value.map(x=>x.batch)));e.watch(k,x=>{x.has(H.value)||(H.value=Ye)});const S=e.computed(()=>G.value.map(x=>x.key));function J(x,te,w){if(x=typeof x!="object"?{}:{...x},x.items||(x.items=oe.getEditorButtons({resources:B().value,autoSave:t.autoSave,splitTasks:C().value})),x.items=oe.filterEditorButtons(x.items,i=>!(i.id==="tabs"&&(i.type=i.type||w,i.options=i.options.filter(I=>te.has(I.id)),i.options.length<2))),x.items=z(x.items,"toolbar"),!x.layout){const i=x.items.some(I=>I.items);x.layout=i?"column":"row"}return x}const ee=e.computed(()=>!t.topBar||t.readonly?!1:J(t.topBar,k.value,"top")),E=e.computed(()=>!t.bottomBar||t.readonly?!1:J(t.bottomBar,k.value,"bottom"));function le({view:x,event:te,values:w}){const{id:i,action:I,data:ne}=te;let re;x==="links"?re=j.value:x==="resources"?re=$.value:x==="segments"&&(re=F.value),re.set(i,{action:I,data:ne}),Object.keys(w).forEach(ue=>{N.value[ue]=w[ue]})}function U(){for(let[x,te]of j.value)if(_().value.byId(x)){const{action:w,data:i}=te;t.api.exec(w,i)}[$.value,F.value].forEach(x=>{for(let[,te]of x){const{action:w,data:i}=te;t.api.exec(w,i)}})}function se(){t.api.exec("delete-task",{id:T().value})}function me(){t.api.exec("show-editor",{id:null})}function ke(x){const{item:te}=x;te.id==="delete"?se():te.id==="save"&&U(),te.comp&&me()}function fe(x){let{update:te,key:w,input:i}=x;if(i&&(R.value=!0),x.update=he({...te},w,i),!t.autoSave)D.value=x.update;else if(!O.value&&!i){const I=G.value.find(ue=>ue.key===w),ne=te[w];(!I.validation||I.validation(ne))&&(!I.required||ne)&&we(x.update)}}function he(x,te,w){return v().value&&x.type==="summary"&&(x.unscheduled=!1),oe.prepareEditTask(x,t.api.getState(),t.api.getTaskCalendar(x),te),w||(R.value=!1),x}function ve(x){t.autoSave||we(x.values,x.changes)}function De(x){O.value=x.errors}function we(x,te){delete x.links,delete x.data,(S.value.indexOf("duration")===-1||x.segments&&!x.duration)&&delete x.duration;const w={id:T().value,task:x};t.autoSave&&R.value&&(w.inProgress=R.value),t.api.exec("update-task",w),!t.autoSave&&!te?.length&&U()}const be=e.computed(()=>q().value?{"ctrl+z":x=>{x.preventDefault(),t.api.exec("undo")},"ctrl+y":x=>{x.preventDefault(),t.api.exec("redo")}}:{});function _e(x){H.value=x.value}return(x,te)=>m.value?(e.openBlock(),e.createBlock(e.unref(de.Locale),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(Te.Editor),{css:`wx-gantt-editor ${W.value} ${a.css}`,items:G.value,values:m.value,topBar:ee.value,bottomBar:E.value,placement:a.placement,layout:a.layout,readonly:a.readonly,autoSave:a.autoSave,focus:a.focus,activeBatch:H.value,onaction:ke,onsave:ve,onvalidation:De,onchange:fe,hotkeys:a.hotkeys&&{...be.value,...a.hotkeys}},null,8,["css","items","values","topBar","bottomBar","placement","layout","readonly","autoSave","focus","activeBatch","hotkeys"])]),_:1})):e.createCommentVNode("",!0)}}),va=ce(pa,[["__scopeId","data-v-b3d82b4a"]]),ga={__name:"HeaderMenu",props:{columns:{default:null},api:{}},setup(a){const t=a,n=e.computed(()=>t.api?.getTable());return(o,l)=>(e.openBlock(),e.createBlock(e.unref(Ve.HeaderMenu),{api:n.value,columns:a.columns},{default:e.withCtx(()=>[o.$slots.default?e.renderSlot(o.$slots,"default",{key:0}):e.createCommentVNode("",!0)]),_:3},8,["api","columns"]))}},ha={key:1,class:"wx-toggle-placeholder"},ka={class:"wx-name"},ya={key:1,class:"wx-avatar-name"},xa=Object.assign({name:"GanttResourceNameCell"},{__name:"NameCell",props:{row:{},column:{}},setup(a){const t=a;function n(o,l){return`justify-content:${l.align};padding-left: ${(o.$level-1)*20}px`}return(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-content",style:e.normalizeStyle(n(t.row,t.column))},[t.row.data?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`wx-toggle-icon wxi-menu-${t.row.open?"down":"right"}`),"data-action":"open-resource-row"},null,2)):(e.openBlock(),e.createElementBlock("i",ha)),e.createElementVNode("div",ka,[t.column._cell?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.column._cell),{key:0,row:t.row,column:t.column},null,8,["row","column"])):t.row.role?(e.openBlock(),e.createElementBlock("div",ya,[e.createVNode(e.unref(de.Avatar),{value:t.row,size:28},null,8,["value"]),e.createElementVNode("span",null,e.toDisplayString(t.row.name),1)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.row.name),1)],64))])],4))}}),wa=ce(xa,[["__scopeId","data-v-7202a0f4"]]),ba=["data-tooltip"],_a={class:"wx-name"},Ba={key:1,class:"wx-avatar"},$a={__name:"NameCellCompact",props:{row:{},column:{}},setup(a){const t=a;return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-content wx-compact","data-tooltip":t.row.name},[e.createElementVNode("div",_a,[t.column._cell?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.column._cell),{key:0,row:t.row,column:t.column},null,8,["row","column"])):t.row.role?(e.openBlock(),e.createElementBlock("div",Ba,[e.createVNode(e.unref(de.Avatar),{value:t.row,size:20},null,8,["value"])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.row.name),1)],64))])],8,ba))}},Sa=ce($a,[["__scopeId","data-v-a6e976d1"]]),Ta=["data-resource-id"],Ca=Object.assign({name:"GanttResourceLoadCell"},{__name:"LoadCell",props:{row:{},column:{}},setup(a){const t=a;return(n,o)=>(e.openBlock(),e.createElementBlock("div",{"data-resource-id":e.unref(A.setID)(t.row.id)},e.toDisplayString(t.column.template(e.unref(Ze.getValue)(t.row,t.column))),9,Ta))}}),Ea={class:"wx-layout"},Ia={class:"wx-y-bar-clip"},Da={class:"wx-chart"},Ra={__name:"ResourceLoad",props:{api:{},columns:{default:()=>oe.getResourceColumns()},mode:{default:"grid"},template:{}},setup(a){const t=a,n=e.ref(17);e.onMounted(()=>{n.value=Ut()});const o=e.computed(()=>t.api?.getReactiveState()),l=c.subscribeLater(()=>o.value?._resources),g=c.subscribeLater(()=>o.value?._scales),u=c.subscribeLater(()=>o.value?._resourceSort),p=c.subscribeLater(()=>o.value?.cellHeight),T=c.subscribeLater(()=>o.value?.columns),v=c.subscribeLater(()=>o.value?.scrollLeft),d=c.subscribeLater(()=>o.value?.gridWidth),b=c.subscribeLater(()=>o.value?.displayMode),_=c.subscribeLater(()=>o.value?._headerLength),C=c.subscribeLater(()=>o.value?.highlightTime),h=c.subscribeLater(()=>o.value?._columnsWidth),B=c.subscribeLater(()=>o.value?._gridCollapseThreshold),P=c.subscribeLater(()=>o.value?.cellBorders),q=e.computed(()=>l().value??[]),H=e.computed(()=>g().value??null),W=e.computed(()=>u().value??null),Y=e.computed(()=>p().value??0),j=e.computed(()=>T().value??[]),$=e.computed(()=>v().value??0),F=e.computed(()=>d().value??0),R=e.computed(()=>b().value??null),D=e.computed(()=>_().value??1),O=e.computed(()=>C().value??null),K=e.computed(()=>h().value??null),N=e.computed(()=>B().value??null),m=e.computed(()=>P().value??null);let z=e.inject("wx-i18n",null);z||(z=A.locale({...Pe.en,...Xe.en}),e.provide("wx-i18n",z));const G=z.getGroup("gantt"),k=e.ref(0),S=e.ref(null),J=e.ref(0);let ee,E;const le=e.computed(()=>{if(!t.columns||!t.columns.length)return[];let X=t.columns.map(ae=>{ae={...ae};const ie=ae.header;if(typeof ie=="object"){const xe=ie.text&&G(ie.text);ae.header={...ie,text:xe}}else ae.header=G(ie);return ae.align=ae.align||"left",ae.editor=!1,ae});const L=X.findIndex(ae=>ae.id==="name");return L!==-1&&(X[L].cell&&(X[L]._cell=X[L].cell),X[L]={...X[L],header:R.value==="chart"?"":X[L].header,cell:R.value==="chart"?Sa:wa}),X.length>0&&(X[X.length-1].resize=!1),X}),U=e.computed(()=>pt(q.value,W.value)),se=e.ref(0),me=e.ref(!1),ke=e.computed(()=>(me.value,Ke(le.value))),fe=e.ref(0);e.watchEffect(()=>{let X;K.value?X=K.value:R.value==="chart"?X=N.value||0:t.columns?.length&&t.columns.every(L=>L.width&&!L.flexgrow)?X=t.columns.reduce((L,ae)=>L+ae.width,0):X=440,fe.value=X});function he(X){if(!Ke(le.value)){const L=ve.value.reduce((ae,ie)=>(X&&ie.$width&&(ie.$width=ie.width),ae+(ie.hidden?0:ie.width)),0);L!==fe.value&&(fe.value=L)}me.value=!0,me.value=!1}const ve=e.computed(()=>mt(le.value,fe.value,R.value,se.value,F.value,ke.value,N.value,"name")),De=e.computed(()=>Gt(H.value,Ca,t.template)),we=e.computed(()=>ft(j.value,R.value,F.value)),be=e.computed(()=>(H.value?.width??0)>k.value-se.value),_e=e.computed(()=>{const X=q.value?.length*Y.value,L=J.value-(be.value?n.value:0);return X>L}),x=e.computed(()=>fe.value>se.value+(_e.value?n.value:0));e.watchEffect(()=>{const X=$.value;E?.exec("scroll-to",{left:X}),S.value&&Math.abs(S.value.scrollLeft-X)>1&&(S.value.scrollLeft=X)});function te(X){const L=X.target.dataset.action;if(L==="open-resource-row"){X.preventDefault();const ae=A.locateID(X),ie=q.value.find(xe=>xe.id===ae);ie.data&&t.api.exec(L,{id:ae,mode:!ie.open})}}const w=e.ref([]);function i(X){ee=X,ee.intercept("select-row",L=>(w.value=[L.id],!1)),ee.intercept("sort-rows",L=>{const{key:ae,add:ie}=L;let xe=W.value?W.value.find(Ee=>Ee.key===ae):null,$e="asc";return xe&&($e=!xe||xe.order==="asc"?"desc":"asc"),t.api.exec("sort-resources",{key:ae,order:$e,add:ie,_columns:le.value}),!1}),ee.on("resize-column",()=>{he(!0)}),ee.on("hide-column",L=>{L.mode||vt(le.value),he()}),ee.on("scroll-to",L=>{L.top!==void 0&&!L.rSync&&E?.exec("scroll-to",{top:L.top,rSync:!0})})}function I(X){E=X,E.intercept("select-row",L=>(w.value=[L.id],!1)),E.on("scroll-to",L=>{L.left!==void 0&&Math.abs(L.left-$.value)>1&&t.api.exec("scroll-chart",{left:L.left}),L.top!==void 0&&!L.rSync&&ee?.exec("scroll-to",{top:L.top,rSync:!0})})}function ne(X,L){const ae=Ze.getValue(X,L);if(ae)return ae.percent>100?" wx-overload":" wx-normal";if(L.unit!=="day"&&L.unit!=="hour")return"";const ie=t.api.getResourceCalendar(X);if(ie){if(!ie.isWorkingDay(L.date))return ie.css??"wx-weekend"}else if(O.value)return O.value(L.date,L.unit);return""}const re=e.ref(null);let ue;e.onMounted(()=>{re.value&&(ue=new ResizeObserver(()=>{k.value=re.value?.offsetWidth??0}),ue.observe(re.value),k.value=re.value.offsetWidth)}),e.onUnmounted(()=>{ue?.disconnect()});const pe=e.ref(null);let Ce;e.onMounted(()=>{pe.value&&(Ce=new ResizeObserver(()=>{se.value=pe.value?.clientWidth??0}),Ce.observe(pe.value),se.value=pe.value.clientWidth)}),e.onUnmounted(()=>{Ce?.disconnect()});const ye=e.ref(null);let Re;return e.onMounted(()=>{ye.value&&(Re=new ResizeObserver(()=>{J.value=ye.value?.clientHeight??0}),Re.observe(ye.value),J.value=ye.value.clientHeight)}),e.onUnmounted(()=>{Re?.disconnect()}),(X,L)=>t.api?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-resource-load",style:e.normalizeStyle(`--wx-scrollbar-width: ${n.value}px;`),ref_key:"containerDiv",ref:re,"data-menu-ignore":"true"},[e.createElementVNode("div",Ea,[t.columns&&t.columns.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{class:e.normalizeClass(["wx-grid-container",{"wx-y-scroll":_e.value,"wx-h-scroll-reserve":be.value&&!x.value}]),style:e.normalizeStyle(`flex: 0 0 ${we.value};`),ref_key:"gridContainerDiv",ref:pe},[e.createElementVNode("div",Ia,[e.createElementVNode("div",{class:"wx-resource-grid",onClick:te},[e.createVNode(e.unref(Ve.Grid),{init:i,sizes:{rowHeight:Y.value,headerHeight:H.value.height/D.value},columnStyle:ae=>`wx-text-${ae.align}`,data:q.value,columns:ve.value,sortMarks:U.value,selectedRows:w.value},null,8,["sizes","columnStyle","data","columns","sortMarks","selectedRows"])])])],6),e.createVNode(ht,{containerWidth:k.value,api:t.api},null,8,["containerWidth","api"])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Da,[e.createElementVNode("div",{class:e.normalizeClass(["wx-timescale-viewport",{"wx-v-scroll-reserve":_e.value}]),ref_key:"scalesDiv",ref:S},[e.createVNode(gt,{api:t.api},null,8,["api"])],2),t.mode==="grid"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-grid-scale-container",ref_key:"rightContainerDiv",ref:ye},[e.createVNode(e.unref(Ve.Grid),{init:I,columns:De.value,data:q.value,sizes:{rowHeight:Y.value,headerHeight:0},selectedRows:w.value,rowStyle:()=>m.value==="column"?"wx-column-border":"",cellStyle:ne},null,8,["columns","data","sizes","selectedRows","rowStyle"])],512)):e.createCommentVNode("",!0)])])],4)):e.createCommentVNode("",!0)}},La=ce(Ra,[["__scopeId","data-v-1a1f036c"]]),Va=Object.assign({name:"GanttWidgetsTooltip"},{__name:"Tooltip",props:{api:{},at:{default:"point"},overflow:{default:!1},content:{},resolver:{type:Function}},setup(a){const t=a,n=e.computed(()=>t.resolver||o);function o(l,g){if(!t.api)return null;const u=A.getID(l,"data-task-id");if(u){const d=t.api.getTask(u);if(!d)return null;if(t.overflow){const _=l.querySelector(".wx-content");if(_&&_.scrollWidth<=_.clientWidth)return null}const b=A.locateID(g.target,"data-segment");return t.content?{api:t.api,data:{task:d,segmentIndex:b}}:b!==null?d.segments?.[b]?.text??"":d.text??""}const p=A.getID(l,"data-link-id");if(p){const b=t.api.getState().links.byId(p);return b&&t.content?{api:t.api,data:{link:b}}:null}const T=A.getID(l,"data-rollup-id");if(T){const d=t.api.getTask(T);return d?t.content?{api:t.api,data:{rollup:d}}:d.text??"":null}const v=A.getID(l,"data-resource-id");if(v){const d=t.api.getResource(v);return d?t.content?{api:t.api,data:{resource:d}}:d.name??"":null}return null}return(l,g)=>(e.openBlock(),e.createBlock(e.unref(de.Tooltip),{at:a.at,content:a.content,resolver:n.value},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},8,["at","content","resolver"]))}}),Na=Object.assign({name:"GanttThemesWillow"},{__name:"Willow",props:{fonts:{type:Boolean,default:!0}},setup(a){const t=a;return(n,o)=>n.$slots.default?(e.openBlock(),e.createBlock(e.unref(de.Willow),{key:0,fonts:t.fonts},{default:e.withCtx(()=>[e.createVNode(e.unref(Ve.Willow),null,{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3})]),_:3},8,["fonts"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(Ve.Willow)),e.createVNode(e.unref(de.Willow),{fonts:t.fonts},null,8,["fonts"])],64))}}),za=ce(Na,[["__scopeId","data-v-2b00a242"]]),Wa=Object.assign({name:"GanttThemesWillowDark"},{__name:"WillowDark",props:{fonts:{type:Boolean,default:!0}},setup(a){const t=a;return(n,o)=>n.$slots.default?(e.openBlock(),e.createBlock(e.unref(de.WillowDark),{key:0,fonts:t.fonts},{default:e.withCtx(()=>[e.createVNode(e.unref(Ve.WillowDark),null,{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3})]),_:3},8,["fonts"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(Ve.WillowDark),{fonts:t.fonts},null,8,["fonts"]),e.createVNode(e.unref(de.WillowDark),{fonts:t.fonts},null,8,["fonts"])],64))}}),Ma=ce(Wa,[["__scopeId","data-v-2420f1ff"]]),Aa=wt.version;Object.defineProperty(exports,"defaultColumns",{enumerable:!0,get:()=>oe.defaultColumns});Object.defineProperty(exports,"defaultEditorItems",{enumerable:!0,get:()=>oe.defaultEditorItems});Object.defineProperty(exports,"defaultMenuOptions",{enumerable:!0,get:()=>oe.defaultMenuOptions});Object.defineProperty(exports,"defaultTaskTypes",{enumerable:!0,get:()=>oe.defaultTaskTypes});Object.defineProperty(exports,"defaultToolbarButtons",{enumerable:!0,get:()=>oe.defaultToolbarButtons});Object.defineProperty(exports,"getDefaultColumns",{enumerable:!0,get:()=>oe.getDefaultColumns});Object.defineProperty(exports,"getEditorButtons",{enumerable:!0,get:()=>oe.getEditorButtons});Object.defineProperty(exports,"getEditorItems",{enumerable:!0,get:()=>oe.getEditorItems});Object.defineProperty(exports,"getMenuOptions",{enumerable:!0,get:()=>oe.getMenuOptions});Object.defineProperty(exports,"getResourceColumns",{enumerable:!0,get:()=>oe.getResourceColumns});Object.defineProperty(exports,"getToolbarButtons",{enumerable:!0,get:()=>oe.getToolbarButtons});Object.defineProperty(exports,"registerScaleUnit",{enumerable:!0,get:()=>oe.registerScaleUnit});Object.defineProperty(exports,"registerEditorItem",{enumerable:!0,get:()=>Te.registerEditorItem});exports.ContextMenu=On;exports.Editor=va;exports.Gantt=Wn;exports.HeaderMenu=ga;exports.ResourceLoad=La;exports.Toolbar=Mn;exports.Tooltip=Va;exports.Willow=za;exports.WillowDark=Ma;exports.version=Aa;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("@svar-ui/lib-vue"),z=require("@svar-ui/lib-dom"),Pe=require("@svar-ui/gantt-locales"),Ke=require("@svar-ui/core-locales"),tt=require("@svar-ui/lib-state"),ee=require("@svar-ui/trial-gantt-store"),Xe=require("@svar-ui/grid-store"),Le=require("@svar-ui/vue-grid"),ue=require("@svar-ui/vue-core"),dt=require("@svar-ui/vue-toolbar"),xt=require("@svar-ui/vue-menu"),Ce=require("@svar-ui/vue-editor"),wt="2.7.4",_t={version:wt};function Bt(a,t,n){const o=a.getBoundingClientRect(),l=t.querySelector(".wx-body").getBoundingClientRect();return{top:o.top-l.top,left:o.left-l.left,dt:o.bottom-n.clientY,db:n.clientY-o.top}}function ot(a){return a&&z.getID(a,"data-context-id")}const lt=5;function $t(a,t){let n,o,l,v,u,m,B,y,d;function x(E){v=E.clientX,u=E.clientY,m={...Bt(n,a,E),y:t.getTask(l).$y},document.body.style.userSelect="none"}function I(E){t.isDisabled?.()||(n=z.locate(E),ot(n)&&(l=z.getID(n),d=setTimeout(()=>{y=!0,t&&t.touchStart&&t.touchStart(),x(E.touches[0])},500),a.addEventListener("touchmove",N),a.addEventListener("contextmenu",T),window.addEventListener("touchend",V)))}function T(E){if(y||d)return E.preventDefault(),!1}function b(E){t.isDisabled?.()||E.which!==1||(n=z.locate(E),ot(n)&&(l=z.getID(n),a.addEventListener("mousemove",X),window.addEventListener("mouseup",j),x(E)))}function R(E){a.removeEventListener("mousemove",X),a.removeEventListener("touchmove",N),document.body.removeEventListener("mouseup",j),document.body.removeEventListener("touchend",V),document.body.style.userSelect="",E&&(a.removeEventListener("mousedown",b),a.removeEventListener("touchstart",I))}function U(E){const P=E.clientX-v,L=E.clientY-u;if(!o){if(Math.abs(P)<lt&&Math.abs(L)<lt||t&&t.start&&t.start({id:l,e:E})===!1)return;o=n.cloneNode(!0),o.style.pointerEvents="none",o.classList.add("wx-reorder-task"),o.style.position="absolute",o.style.left=m.left+"px",o.style.top=m.top+"px",n.style.visibility="hidden",n.parentNode.insertBefore(o,n)}if(o){const _=Math.round(Math.max(0,m.top+L));if(t&&t.move&&t.move({id:l,top:_,detail:B})===!1)return;const q=t.getTask(l),k=q.$y;if(!m.start&&m.y===k)return O();m.start=!0,m.y=q.$y-4,o.style.top=_+"px";const $=document.elementFromPoint(E.clientX,E.clientY),C=z.locate($);if(C&&C!==n){const F=z.getID(C),Y=C.getBoundingClientRect(),g=Y.top+Y.height/2,S=E.clientY+m.db>g&&C.nextElementSibling!==n,Z=E.clientY-m.dt<g&&C.previousElementSibling!==n;B?.after===F||B?.before===F?B=null:S?B={id:l,after:F}:Z&&(B={id:l,before:F})}}}function X(E){U(E)}function N(E){y?(E.preventDefault(),U(E.touches[0])):d&&(clearTimeout(d),d=null)}function V(){y=null,d&&(clearTimeout(d),d=null),O()}function j(){O()}function O(){n&&(n.style.visibility=""),o&&(o.parentNode.removeChild(o),t&&t.end&&t.end({id:l,top:m.top})),l=n=o=m=B=null,R()}return a.style.position!=="absolute"&&(a.style.position="relative"),a.addEventListener("mousedown",b),a.addEventListener("touchstart",I),{destroy(){R(!0)}}}const le=(a,t)=>{const n=a.__vccOpts||a;for(const[o,l]of t)n[o]=l;return n},St={class:"wx-group-text"},Tt={key:0,class:"wx-name"},Et={__name:"GroupCellText",props:{row:{}},setup(a){const t=a,o=e.inject("wx-i18n").getGroup("gantt"),l=e.inject("gantt-store"),{groupBy:v,resources:u}=l.getReactiveState(),m=r.subscribe(v),B=r.subscribe(u),y=e.computed(()=>{if(m.value?.field==="resource"){let x=t.row.$groupValue;return Array.isArray(x)||(x=[x]),x.map(I=>B.value.byId(I)).filter(Boolean)}return null}),d=e.computed(()=>m.value?.field=="resource"?o("Unassigned"):o("Ungrouped"));return(x,I)=>(e.openBlock(),e.createElementBlock("div",St,[a.row.$groupValue==="$ungrouped"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(d.value),1)],64)):y.value?.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(ue.Avatar),{value:y.value,size:28},null,8,["value"]),y.value.length===1?(e.openBlock(),e.createElementBlock("span",Tt,e.toDisplayString(y.value[0].name),1)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(a.row.text),1)],64))]))}},Ct=le(Et,[["__scopeId","data-v-36807faa"]]),It={key:1,class:"wx-toggle-placeholder"},Dt={class:"wx-text"},Rt={__name:"TextCell",props:{row:{},column:{}},setup(a){function t(n,o){return`justify-content:${o.align};padding-left: ${(n.$level-1)*20}px`}return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-content",style:e.normalizeStyle(t(a.row,a.column))},[!a.row.$empty&&(a.row.data?.length||a.row.lazy)?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass("wx-toggle-icon wxi-menu-"+(a.row.open?"down":"right")),"data-action":"open-task"},null,2)):(e.openBlock(),e.createElementBlock("i",It)),e.createElementVNode("div",Dt,[a.column._cell?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.column._cell),{key:0,row:a.row,column:a.column},null,8,["row","column"])):a.row.$group?(e.openBlock(),e.createBlock(Ct,{key:1,row:a.row},null,8,["row"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(a.row.text),1)],64))])],4))}},Lt=le(Rt,[["__scopeId","data-v-4fd2001c"]]),Vt=["data-action"],Nt={__name:"ActionCell",props:{column:{},row:{},cell:{}},setup(a){const t=a,n=e.computed(()=>t.column.id),o=e.computed(()=>n.value.includes("edit")?"wxi-edit":n.value.includes("add")?"wxi-plus":n.value.includes("delete")?"wxi-delete":""),l=e.computed(()=>{if(!n.value.includes("add"))return!1;const v=t.row.$groupValue;return!t.row.$group&&typeof v<"u"||t.row.$group&&typeof v>"u"});return(v,u)=>a.cell||o.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({textAlign:a.column.align})},[e.createElementVNode("i",{class:e.normalizeClass(["wx-action-icon",o.value,{"wx-disabled":l.value}]),"data-action":!l.value&&n.value},null,10,Vt)],4)):e.createCommentVNode("",!0)}},je=le(Nt,[["__scopeId","data-v-3ce827d8"]]),zt={class:"wx-avatar"},Mt={__name:"ResourcesCell",props:{row:{}},setup(a){const t=a,n=e.inject("gantt-store"),{assignments:o}=n.getReactiveState(),l=r.subscribe(o),v=e.computed(()=>(l.value,n.getTaskResources(t.row.$id||t.row.id)));return(u,m)=>(e.openBlock(),e.createElementBlock("div",zt,[e.createVNode(e.unref(ue.Avatar),{value:v.value,size:28},null,8,["value"])]))}},Wt=le(Mt,[["__scopeId","data-v-3b88ddad"]]),Ht={key:0,class:"wx-avatar-box"},At={key:1,class:"wx-resource-option"},Ot={class:"wx-name"},Ft={__name:"EditorResourcesCell",props:{data:{}},setup(a){const t=a,n=e.computed(()=>t.data.length);return(o,l)=>Array.isArray(a.data)?(e.openBlock(),e.createElementBlock("div",Ht,[n.value?(e.openBlock(),e.createBlock(e.unref(ue.Avatar),{key:0,value:a.data,size:28},null,8,["value"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("div",null,[e.createVNode(e.unref(ue.Avatar),{value:a.data,size:28},null,8,["value"])]),e.createElementVNode("div",Ot,e.toDisplayString(a.data.name),1)]))}},st=le(Ft,[["__scopeId","data-v-daa03424"]]);function jt(a,t,n){const{_assignments:o}=n.getState(),l=o.byTask[a],v=l?.map(y=>y.resource),u=new Set(v||[]),m=new Set(t||[]),B=n.getHistory();B&&B.startBatch();for(const y of u)if(!m.has(y)){const d=l.find(x=>x.resource===y);n.exec("delete-assignment",{id:d.id})}for(const y of m)u.has(y)||n.exec("add-assignment",{assignment:{resource:y,task:a}});B&&B.endBatch()}function Pt(a,t){return`min-height:${a+t*4}px;`}function Gt(a,t,n){return n&&a==="all"?`width:${t}px;`:a==="grid"?n?`width:${t}px;`:"width:100%;":""}function ft(a,t,n){const o=a.find(l=>l.id==="add-task");return t==="all"?`${n}px`:t==="grid"?"calc(100% - 4px)":o?`${o.width}px`:"0"}function Ut(a,t,n,o,l){return!a&&t!=="grid"?n>l:n>o}function mt(a,t,n="add-task"){return t==="chart"?[{...a.filter(o=>o.id===n)[0],resize:!1}]:a}function pt(a,t){const n=o=>o.id!=="add-task"&&o.id!==t&&!o.hidden;return a.filter(n).reduce((o,l)=>!o||l.width>o.width?l:o,null)?.id}function Ye(a){return a.reduce((t,n)=>t+(n.hidden?0:n.width),0)}function vt(a,t){if(a&&t?.length){const n={};return t.forEach(({key:o,order:l},v)=>{n[o]={order:l,...t.length>1&&{index:v}}}),n}return{}}function qt(a,t,n){if(!a)return[];const o=a.rows[a.rows.length-1],{cells:l}=o;if(a.minUnit==="day")return et(l,t,n);const u=1440*60*1e3,m=l.length?(l.length>1?l[1].date.getTime():a.end.getTime())-l[0].date.getTime():0;if(m&&m<u){const y=[];let d=null;return l.forEach(x=>{(!d||d.key!==x.key)&&(d={id:x.key,key:x.key,width:0,date:x.date,unit:x.unit},y.push(d)),d.width+=x.width}),et(y,t,n)}else return et(l,t,n,!0)}function et(a,t,n,o){return a.map(l=>({id:l.key,width:l.width,date:l.date,unit:l.unit,getter:v=>o?v.$unitLoad?.[l.key]:v.$load?.[l.key],template:v=>v?n?n(v):`${v.hours}h`:"",cell:t}))}function Yt(){const a=document.createElement("div");a.style.cssText="position:absolute;left:-1000px;width:100px;padding:0;margin:0;min-height:100px;overflow-y:scroll;",document.body.appendChild(a);const t=a.offsetWidth-a.clientWidth;return document.body.removeChild(a),t}function Kt(a){return String(a??"").replace(/[^\w-]/g,"-")}function gt(a){let t=`wx-text-${a.align}`;return a.id&&(t+=` wx-col-${Kt(a.id)}`),a.id==="add-task"&&(t+=" wx-action"),t.trim()}const Xt=Object.assign({name:"GanttGridGrid"},{__name:"Grid",props:e.mergeModels({readonly:{}},{tableAPI:{},tableAPIModifiers:{}}),emits:["update:tableAPI"],setup(a){const t=r.asDirective($t),n=a,o=e.useModel(a,"tableAPI"),v=e.inject("wx-i18n").getGroup("gantt"),u=e.inject("gantt-store"),{scrollTop:m,cellHeight:B,focusTask:y,_selected:d,area:x,_tasks:I,_scales:T,_headerLength:b,columns:R,_sort:U,durationUnit:X,splitTasks:N,filterValues:V,groupBy:j,gridWidth:O,displayMode:E,_compactMode:P}=u.getReactiveState(),L=r.subscribe(m),_=r.subscribe(B),q=r.subscribe(d),k=r.subscribe(x),$=r.subscribe(I,!0),C=r.subscribe(T),F=r.subscribe(b),Y=r.subscribe(R),g=r.subscribe(U),S=r.subscribe(X),Z=r.subscribe(N),ne=r.subscribe(V),ce=r.subscribe(j),he=r.subscribe(O),h=r.subscribe(E),Q=r.subscribe(P);let te=e.ref(null);const ye=e.ref(0);function ve(w,D){if(D==="add-task")u.exec(D,{target:w,task:{text:v("New Task")},mode:"child",show:!0,focus:w?"grid":null});else if(D==="open-task"){const A=M.value.find(ie=>ie.id===w);(A.data||A.lazy)&&u.exec(D,{id:w,mode:!A.open})}}function we(w){if(w.detail>1)return;const D=z.locateID(w),A=w.target.dataset.action;A&&w.preventDefault(),D?A==="add-task"||A==="open-task"?ve(D,A):u.exec("select-task",{id:D,toggle:w.ctrlKey||w.metaKey,range:w.shiftKey,show:"xy",focus:"grid"}):A==="add-task"&&ve(null,A)}function be(w){if(!n.readonly){const D=z.locateID(w),A=z.locateID(w,"data-col-id");!(A&&ke.value.find(s=>s.id===A))?.editor&&D&&u.exec("show-editor",{id:D})}}let $e;function Be(w){const D=w.id,{before:A,after:ie}=w,s=w.onMove;let p=A||ie,i=A?"before":"after";if(s){if(i==="after"){const W=oe.value.findIndex(me=>me.id===D),re=oe.value.findIndex(me=>me.id===p),de=oe.value[re];W-re===1?i="before":de.data&&de.open&&(i="before",p=de.data[0].id)}$e={id:D,[i]:p}}else $e=null;u.exec("move-task",{id:D,mode:i,target:p,inProgress:s})}function J({id:w}){if(n.readonly||(u.getTask(w).open&&u.exec("open-task",{id:w,mode:!1}),te.value=M.value.find(D=>D.id===w),!te.value))return!1}function ae({id:w,top:D}){$e?Be({...$e,onMove:!1}):u.exec("drag-task",{id:w,top:D+ge.value,inProgress:!1}),te.value=null}function c({id:w,top:D,detail:A}){A&&Be({...A,onMove:!0}),u.exec("drag-task",{id:w,top:D+ge.value,inProgress:!0})}const G=e.ref(0),H=e.ref(0),f=e.ref(null);function se(w){const{key:D,isInput:A}=w;if(!A&&(D==="arrowup"||D==="arrowdown"))return w.eventSource="grid",u.exec("hotkey",w),!1;if(D==="enter"){const ie=o.value.getState().focusCell;if(ie){const{row:s,column:p}=ie;p==="add-task"?ve(s,"add-task"):p==="text"&&ve(s,"open-task")}}}function pe(w){o.value=w,w.intercept("hotkey",se),w.intercept("select-row",()=>!1),w.intercept("scroll",()=>!1),w.intercept("sort-rows",D=>{const{key:A,add:ie}=D;let s=g.value?g.value.find(i=>i.key===A):null,p="asc";return s&&(p=!s||s.order==="asc"?"desc":"asc"),u.exec("sort-tasks",{key:A,order:p,add:ie}),!1}),w.intercept("filter-rows",D=>{const{key:A,value:ie}=D;return u.exec("filter-tasks",{key:A,value:ie,open:!0}),!1}),w.intercept("resize-column",D=>{D.flexgrowFallback=pt(ke.value,D.id)}),w.on("resize-column",D=>{const A=w.getState().columns;ye.value=Ye(A),D.inProgress!==!0&&u.exec("set-columns",{columns:A})}),w.on("hide-column",()=>{const D=w.getState().columns;ye.value=Ye(D),u.exec("set-columns",{columns:D})}),w.intercept("update-cell",D=>{const{id:A,column:ie,value:s}=D,p=M.value.find(i=>i.id===A);if(p){if(ie==="resources"){jt(A,s,u);return}const i={...p};let W=s;W&&!isNaN(W)&&!(W instanceof Date)&&(W*=1),i[ie]=W,ee.prepareEditTask(i,{durationUnit:S.value,splitTasks:Z.value},u.getTaskCalendar(i),ie),u.exec("update-task",{id:A,task:i})}return!1})}const ke=e.computed(()=>{let w=Y.value.map(s=>{s={...s};const p=[...s.header];return p.forEach(i=>{i.text&&(i.text=v(i.text))}),s.header=p,s.editor=n.readonly?null:s.editor,s});const D=w.findIndex(s=>s.id==="text"),A=w.findIndex(s=>s.id==="add-task"),ie=w.findIndex(s=>s.id==="resources");if(D!==-1&&(w[D].cell&&(w[D]._cell=w[D].cell),w[D].cell=Lt),ie!==-1){const s=w[ie];if(s.cell||(s.cell=Wt),s.editor&&typeof s.editor!="function"){const p=s.editor,i=p.config;i.cell||(i.cell=st),i.cell=st,i.dropdown||(i.dropdown={width:"auto"}),s.editor=W=>{if(W.type!=="summary")return p}}}if(A!==-1){w[A].cell=w[A].cell||je;const s=w[A].header[0];if(w[A].header[0].cell=s.cell||je,n.readonly)w.splice(A,1);else if(Q.value){const[p]=w.splice(A,1);w.unshift(p)}}return w.length>0&&(w[w.length-1].resize=!1),w});e.watchEffect(()=>{ye.value=Ye(ke.value)},{flush:"pre"});const ge=e.computed(()=>k.value.from),De=e.computed(()=>C.value.height),_e=e.computed(()=>ft(Y.value,h.value,he.value)),Ie=e.computed(()=>Ut(Q.value,h.value,ye.value,G.value,he.value)),Ee=e.computed(()=>Pt(H.value,_.value)),Ne=e.computed(()=>Ee.value+Gt(h.value,ye.value,Ie.value)),K=e.computed(()=>q.value.map(w=>w.id)),M=e.computed(()=>$.value.slice(k.value.start,k.value.end)),oe=e.computed(()=>(te.value&&!M.value.find(D=>D.id===te.value.id)?[...M.value,te.value]:M.value).map(D=>({...D}))),fe=e.computed(()=>vt(oe.value,g.value)),Se=e.computed(()=>fe.value?{...ne.value}:ne.value),ze=e.computed(()=>mt(ke.value,h.value)),Oe=e.computed(()=>ge.value-L.value);let We;e.onMounted(()=>{f.value&&(We=new ResizeObserver(w=>{for(const D of w)G.value=D.contentRect.width,H.value=D.contentRect.height}),We.observe(f.value))}),e.onUnmounted(()=>{We?.disconnect()});let He=!1;const Fe=r.subscribe(y);e.watch(Fe,w=>{if(!w)return;const{id:D,column:A}=w;A&&(He||(He=!0,requestAnimationFrame(()=>{const{focusCell:ie,editor:s}=o.value.getState();s||(o.value.exec("focus-cell",{row:D,column:ie?.column||ke.value[0]?.id}),He=!1)})))});const Re=e.computed(()=>({isDisabled:()=>!!ce.value?.field,start:J,end:ae,move:c,getTask:u.getTask})),Ze=e.computed(()=>[...K.value]),Qe=e.computed(()=>({rowHeight:_.value,headerHeight:De.value/F.value}));return(w,D)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-table-container",style:e.normalizeStyle({flex:`0 0 ${_e.value}`}),ref_key:"tableContainer",ref:f},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`${Ne.value}--wx-body-offset:${Oe.value}px;`),class:"wx-table",onClick:we,onDblclick:be},[e.createVNode(e.unref(Le.Grid),{init:pe,sizes:Qe.value,rowStyle:A=>A.$reorder?"wx-reorder-task":"",columnStyle:e.unref(gt),data:oe.value,columns:ze.value,selectedRows:Ze.value,sortMarks:fe.value,filterValues:Se.value},null,8,["sizes","rowStyle","columnStyle","data","columns","selectedRows","sortMarks","filterValues"])],36)),[[e.unref(t),Re.value]])],4))}}),Zt=le(Xt,[["__scopeId","data-v-561b4fb5"]]),Qt={__name:"CellGrid",setup(a){const t=e.inject("gantt-store"),{cellWidth:n,cellHeight:o,cellBorders:l}=t.getReactiveState(),v=r.subscribe(n),u=r.subscribe(o),m=r.subscribe(l),B=e.ref(null),y=e.ref("#e4e4e4");return e.watchEffect(()=>{if(typeof getComputedStyle<"u"&&B.value){const d=getComputedStyle(B.value).getPropertyValue("--wx-gantt-border");y.value=d?d.substring(d.indexOf("#")):"#1d1e261a"}}),(d,x)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"node",ref:B,style:e.normalizeStyle(`width:100%; height:100%; background:url(${e.unref(ee.grid)(e.unref(v),e.unref(u),y.value,e.unref(m))}); position: absolute;`)},null,4))}},Jt={class:"wx-links"},en=["onclick","data-link-id"],tn=["points"],nn=["points"],an=["data-link-id"],on=["points"],ln=["points"],sn=Object.assign({name:"GanttChartLinks"},{__name:"Links",props:{onSelectLink:{type:Function},selectedLink:{},readonly:{}},setup(a){const t=r.asDirective(z.clickOutside),n=a,o=e.inject("gantt-store"),{_visibleLinks:l,criticalPath:v}=o.getReactiveState(),u=r.subscribe(l),m=r.subscribe(v);function B(y){const d=y?.target?.classList;!d?.contains("wx-line-hitbox")&&!d?.contains("wx-delete-button")&&n.onSelectLink(null)}return(y,d)=>(e.openBlock(),e.createElementBlock("svg",Jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),x=>(e.openBlock(),e.createElementBlock("g",{key:x.id,class:e.normalizeClass(["wx-line",{"wx-critical":e.unref(m)&&x.critical,"wx-line-selectable":!a.readonly}]),onclick:()=>!a.readonly&&a.onSelectLink(x.id),"data-link-id":e.unref(z.setID)(x.id)},[e.createElementVNode("polyline",{class:"wx-line-draw",points:x.$p},null,8,tn),e.createElementVNode("polyline",{class:"wx-line-hitbox",points:x.$p},null,8,nn)],10,en))),128)),!a.readonly&&a.selectedLink?e.withDirectives((e.openBlock(),e.createElementBlock("g",{key:0,class:"wx-line wx-line-selected wx-line-selectable wx-delete-link","data-link-id":e.unref(z.setID)(a.selectedLink.id)},[e.createElementVNode("polyline",{class:"wx-line-draw",points:a.selectedLink.$p},null,8,on),e.createElementVNode("polyline",{class:"wx-line-hitbox",points:a.selectedLink.$p},null,8,ln)],8,an)),[[e.unref(t),B]]):e.createCommentVNode("",!0)]))}}),rn=le(sn,[["__scopeId","data-v-21ec1498"]]),cn=["data-rollup-id"],un=Object.assign({name:"GanttChartRollups"},{__name:"Rollups",props:{rollup:{},parent:{}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock("div",{"data-rollup-id":e.unref(z.setID)(a.rollup.id),class:e.normalizeClass(`wx-rollup wx-${a.rollup.type}-rollup`),style:e.normalizeStyle(`left:${a.rollup.$x_rollup}px;top:${a.parent.$y+a.parent.$h+a.rollup.$y_rollup_relative}px;width:${a.rollup.$w_rollup}px;height:${a.rollup.$h_rollup}px;`)},null,14,cn))}}),dn=le(un,[["__scopeId","data-v-bbc697dd"]]),fn={class:"wx-segments"},mn=["data-segment"],pn={key:0,class:"wx-progress-wrapper"},vn={class:"wx-content"},gn={__name:"BarSegments",props:{task:{},type:{}},setup(a){const t=a;function n(l){const v=t.task.segments[l];return`left:${v.$x}px;top:0px;width:${v.$w}px;height:100%;`}function o(l){if(!t.task.progress)return 0;const v=t.task.duration*t.task.progress/100,u=t.task.segments;let m=0,B=0,y=null;do{const d=u[B];B===l&&(m>v?y=0:y=Math.min((v-m)/d.duration,1)*100),m+=d.duration,B++}while(y===null&&B<u.length);return y||0}return(l,v)=>(e.openBlock(),e.createElementBlock("div",fn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.task.segments,(u,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:e.normalizeClass(["wx-segment","wx-bar",`wx-${a.type}`]),"data-segment":m,style:e.normalizeStyle(n(m))},[a.task.progress?(e.openBlock(),e.createElementBlock("div",pn,[e.createElementVNode("div",{class:"wx-progress-percent",style:e.normalizeStyle(`width:${o(m)}%`)},null,4)])):e.createCommentVNode("",!0),e.createElementVNode("div",vn,e.toDisplayString(u.text||""),1)],14,mn))),128))]))}},hn=le(gn,[["__scopeId","data-v-558dfded"]]),kn=["data-id","data-task-id","tabindex"],yn={key:0,class:"wx-progress-wrapper"},bn={key:4,class:"wx-content"},xn={key:1,class:"wx-text-out"},wn=Object.assign({name:"GanttChartBars"},{__name:"Bars",props:{readonly:{},taskTemplate:{}},setup(a){const t=a,n=e.inject("gantt-store"),{_tasks:o,_links:l,area:v,_scales:u,taskTypes:m,baselines:B,_selected:y,rollups:d,_rollups:x,focusTask:I,criticalPath:T,tree:b,schedule:R,splitTasks:U,summary:X,slack:N}=n.getReactiveState(),V=r.subscribe(o,!0),j=r.subscribe(l),O=r.subscribe(v),E=r.subscribe(u),P=r.subscribe(m),L=r.subscribe(B),_=r.subscribe(y),q=r.subscribe(d),k=r.subscribe(x),$=r.subscribe(T),C=r.subscribe(b),F=r.subscribe(R),Y=r.subscribe(U),g=r.subscribe(X),S=r.subscribe(N),Z=e.computed(()=>V.value.slice(O.value.start,O.value.end).map(s=>({...s}))),ne=e.computed(()=>Z.value.some(s=>s.$id&&s.$id!==s.id)),ce=e.computed(()=>E.value.lengthUnitWidth);let he=!1;const h=e.ref(void 0),Q=e.ref(null);let te=null;const ye=e.ref(null),ve=e.computed(()=>ye.value&&{...j.value.find(s=>s.id===ye.value)}),we=e.ref(void 0);let be;function $e(s){if(s.button!==0)return;const p=z.locate(s);p&&J(p,s)}function Be(s){const p=z.locate(s);p&&(be=setTimeout(()=>{we.value=!0,J(p,s.touches[0])},300))}function J(s,p){const{clientX:i}=p,W=z.getID(s),re=n.getTask(W),de=p.target.classList;if(!p.target.closest(".wx-delete-button")&&!t.readonly){if(de.contains("wx-progress-marker")){const{progress:me}=n.getTask(W);te={id:W,x:i,progress:me,dx:0,node:s,marker:p.target},p.target.classList.add("wx-progress-in-drag")}else{const me=ae(s,p,re)||"move";if(Q.value={id:W,mode:me,x:i,dx:0,l:re.$x,w:re.$w},Y.value&&re.segments?.length){const xe=z.locate(p,"data-segment");xe&&(Q.value.segmentIndex=xe.dataset.segment*1,ee.extendDragOptions(re,Q.value))}}ke()}}function ae(s,p,i){if(p.target.classList.contains("wx-line")||(i||(i=n.getTask(z.getID(s))),i.type==="milestone"||i.type==="summary"))return"";const W=z.locate(p,"data-segment");W&&(s=W);const{left:re,width:de}=s.getBoundingClientRect(),me=(p.clientX-re)/de;let xe=.2/(de>200?de/200:1);return me<xe?"start":me>1-xe?"end":""}function c(s){we.value?(s.preventDefault(),H(s,s.touches[0])):be&&(clearTimeout(be),be=null)}function G(s){H(s,s)}function H(s,p){const{clientX:i}=p;if(!t.readonly)if(te){const{node:W,x:re,id:de}=te,me=te.dx=i-re,xe=Math.round(me/W.offsetWidth*100);let Ve=te.progress+xe;te.value=Ve=Math.min(Math.max(0,Ve),100),n.exec("update-task",{id:de,task:{progress:Ve},inProgress:!0})}else if(Q.value){ze(null);const{mode:W,l:re,w:de,x:me,id:xe,start:Ve,segment:Ae,index:Me}=Q.value,Je=n.getTask(xe),Te=i-me,at=Math.round(ce.value)||1;if(!Ve&&Math.abs(Te)<20||W==="start"&&de-Te<at||W==="end"&&de+Te<at||W==="move"&&(Te<0&&re+Te<0||Te>0&&re+de+Te>Fe.value)||Q.value.segment&&!ee.isSegmentMoveAllowed(Je,Q.value))return;Q.value.dx=Te;let Ge,Ue;if(W==="start"?(Ge=re+Te,Ue=de-Te):W==="end"?(Ge=re,Ue=de+Te):W==="move"&&(Ge=re+Te,Ue=de),n.exec("drag-task",{id:xe,width:Ue,left:Ge,inProgress:!0,...Ae&&{segmentIndex:Me}}),!Q.value.start&&(W==="move"&&Je.$x===re||W!=="move"&&Je.$w===de))return he=!0,pe();Q.value.start=!0}else{const W=z.locate(s);if(W){const re=n.getTask(z.getID(W)),me=z.locate(s,"data-segment")||W,xe=ae(me,p,re);me.style.cursor=xe&&!t.readonly?"col-resize":"pointer"}}}function f(){pe()}function se(){we.value=null,be&&(clearTimeout(be),be=null),pe()}function pe(){if(te){const{dx:s,id:p,marker:i,value:W}=te;te=null,typeof W<"u"&&s&&n.exec("update-task",{id:p,task:{progress:W},inProgress:!1}),i.classList.remove("wx-progress-in-drag"),he=!0,ge()}else if(Q.value){const{id:s,mode:p,dx:i,l:W,w:re,start:de,segment:me,index:xe}=Q.value;if(Q.value=null,de){const Ve=Math.round(i/ce.value);if(!Ve)n.exec("drag-task",{id:s,width:re,left:W,inProgress:!1,...me&&{segmentIndex:xe}});else{let Ae={},Me=n.getTask(s);me&&(Me=Me.segments[xe]),p==="move"?(Ae.start=Me.start,Ae.end=Me.end):Ae[p]=Me[p],n.exec("update-task",{id:s,diff:Ve,task:Ae,...me&&{segmentIndex:xe}})}he=!0}ge()}}function ke(){document.body.style.userSelect="none"}function ge(){document.body.style.userSelect=""}function De(s){if(!t.readonly){const p=z.locateID(s.target);if(p&&!s.target.classList.contains("wx-link")){const i=z.locateID(s.target,"data-segment");n.exec("show-editor",{id:p,...i!==null&&{segmentIndex:i}})}}}function _e(s){if(he){he=!1;return}const p=z.locateID(s.target);if(p){const i=s.target.classList;if(i.contains("wx-link")){const W=i.contains("wx-left");if(!h.value){h.value={id:p,start:W};return}h.value.id!==p&&!fe(p,W)&&n.exec("add-link",{link:{source:h.value.id,target:p,type:oe(h.value.start,W)}})}else if(i.contains("wx-delete-button-icon"))n.exec("delete-link",{id:ye.value}),ye.value=null;else{const W=z.locateID(s.target,"data-segment");n.exec("select-task",{id:p,toggle:s.ctrlKey||s.metaKey,range:s.shiftKey,...W!==null&&{segmentIndex:W}})}}Se()}function Ie(s){return`left:${s.$x}px;top:${s.$y}px;width:${s.$w}px;height:${s.$h}px;line-height:${s.$h}px;`}function Ee(s){return`left:${s.$x_base}px;top:${s.$y_base}px;width:${s.$w_base}px;height:${s.$h_base}px;`}function Ne(s){return`left:${s.$x_slack}px;top:${s.$y}px;width:${s.$w_slack}px;height:${s.$h}px;`}function K(s){if(we.value||be)return s.preventDefault(),!1}const M=["e2s","s2s","e2e","s2e"];function oe(s,p){return M[(s?1:0)+(p?0:2)]}function fe(s,p){const i=h.value.id,W=h.value.start;return s===i?!0:j.value.find(re=>re.target===s&&re.source===i&&re.type===oe(W,p))}function Se(){h.value&&(h.value=null)}function ze(s){ye.value=s}const Oe=e.computed(()=>P.value.map(s=>s.id));function We(s){let p=Oe.value.includes(s)?s:"task";return["task","milestone","summary"].includes(s)||(p=`task ${p}`),p}function He(s){n.exec(s.action,s.data)}const Fe=e.ref(0),Re=e.ref(null),Ze=e.computed(()=>_.value.length&&Re.value&&Re.value.contains(document.activeElement)),Qe=e.computed(()=>Ze.value&&_.value[_.value.length-1].id),w=r.subscribe(I);e.watch(w,s=>{if(s&&s.column===!1){const{id:p}=s,i=Re.value?.querySelector(`.wx-bar[data-id='${z.setID(p)}']`);i&&i.focus()}});const D=s=>$.value&&s.critical;function A(s){if(F.value.auto){const p=C.value.getSummaryId(s,!0),i=C.value.getSummaryId(h.value.id,!0);return h.value?.id&&!(Array.isArray(p)?p:[p]).includes(h.value.id)&&!(Array.isArray(i)?i:[i]).includes(s)}return h.value}let ie;return e.onMounted(()=>{window.addEventListener("mouseup",f),Re.value&&(Fe.value=Re.value.offsetWidth,ie=new ResizeObserver(s=>{for(const p of s)Fe.value=p.target.offsetWidth}),ie.observe(Re.value))}),e.onUnmounted(()=>{window.removeEventListener("mouseup",f),ie?.disconnect()}),(s,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"container",ref:Re,class:"wx-bars",style:e.normalizeStyle(`line-height: ${Z.value.length?Z.value[0].$h:0}px`),onContextmenu:K,onMousedown:$e,onMousemove:G,onTouchstart:Be,onTouchmove:c,onTouchend:se,onClick:_e,onDblclick:De,onDragstart:p[0]||(p[0]=e.withModifiers(()=>{},["prevent"]))},[e.unref(S)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Z.value,i=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i.id},[i.$visibleSlack?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass("wx-slack wx-slack-"+i.type),style:e.normalizeStyle(Ne(i))},null,6)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0),e.createVNode(rn,{onSelectLink:ze,selectedLink:ve.value,readonly:t.readonly},null,8,["selectedLink","readonly"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,i=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i.id},[i.$skip?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wx-bar","wx-"+We(i.type),{"wx-touch":we.value&&Q.value&&i.id===Q.value.id,"wx-selected":h.value&&h.value.id===i.id,"wx-critical":D(i),"wx-reorder-task":i.$reorder,"wx-split":e.unref(Y)&&i.segments}]),style:e.normalizeStyle(Ie(i)),"data-id":e.unref(z.setID)(i.id),"data-task-id":e.unref(z.setID)(i.id),tabindex:Qe.value===i.id?"0":"-1"},[!t.readonly&&!ne.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i.id===ve.value?.target&&ve.value?.type[2]==="s"?(e.openBlock(),e.createBlock(e.unref(ue.Button),{key:0,type:"danger",css:"wx-left wx-delete-button wx-delete-link"},{default:e.withCtx(()=>[...p[1]||(p[1]=[e.createElementVNode("i",{class:"wxi-close wx-delete-button-icon"},null,-1)])]),_:1})):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["wx-link","wx-left",{"wx-visible":h.value,"wx-target":!h.value||!fe(i.id,!0)&&A(i.id),"wx-selected":h.value&&h.value.id===i.id&&h.value.start,"wx-critical":D(i)}])},[...p[2]||(p[2]=[e.createElementVNode("div",{class:"wx-inner"},null,-1)])],2))],64)):e.createCommentVNode("",!0),i.type!=="milestone"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[i.progress&&!(e.unref(Y)&&i.segments)?(e.openBlock(),e.createElementBlock("div",yn,[e.createElementVNode("div",{class:"wx-progress-percent",style:e.normalizeStyle("width:"+i.progress+"%")},null,4)])):e.createCommentVNode("",!0),!t.readonly&&!(e.unref(Y)&&i.segments)&&!(i.type==="summary"&&e.unref(g)?.autoProgress)?(e.openBlock(),e.createElementBlock("div",{key:1,class:"wx-progress-marker",style:e.normalizeStyle("left:calc("+i.progress+"% - 10px);")},e.toDisplayString(i.progress),5)):e.createCommentVNode("",!0),t.taskTemplate?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.taskTemplate),{key:2,data:i,api:e.unref(n),onaction:He},null,8,["data","api"])):e.unref(Y)&&i.segments?(e.openBlock(),e.createBlock(hn,{key:3,task:i,type:We(i.type)},null,8,["task","type"])):(e.openBlock(),e.createElementBlock("div",bn,e.toDisplayString(i.text||""),1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[p[3]||(p[3]=e.createElementVNode("div",{class:"wx-content"},null,-1)),t.taskTemplate?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.taskTemplate),{key:0,data:i,api:e.unref(n),onaction:He},null,8,["data","api"])):(e.openBlock(),e.createElementBlock("div",xn,e.toDisplayString(i.text),1))],64)),!t.readonly&&!ne.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[i.id===ve.value?.target&&ve.value?.type[2]==="e"?(e.openBlock(),e.createBlock(e.unref(ue.Button),{key:0,type:"danger",css:"wx-right wx-delete-button wx-delete-link"},{default:e.withCtx(()=>[...p[4]||(p[4]=[e.createElementVNode("i",{class:"wxi-close wx-delete-button-icon"},null,-1)])]),_:1})):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["wx-link","wx-right",{"wx-visible":h.value,"wx-target":!h.value||!fe(i.id,!1)&&A(i.id),"wx-selected":h.value&&h.value.id===i.id&&!h.value.start,"wx-critical":D(i)}])},[...p[5]||(p[5]=[e.createElementVNode("div",{class:"wx-inner"},null,-1)])],2))],64)):e.createCommentVNode("",!0)],14,kn)),e.unref(q)&&e.unref(k)?.[i.id]?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(k)[i.id],W=>(e.openBlock(),e.createBlock(dn,{key:W.id,rollup:W,parent:i},null,8,["rollup","parent"]))),128)):e.createCommentVNode("",!0),e.unref(L)&&!i.$skip_baseline?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["wx-baseline",{"wx-milestone":i.type==="milestone"}]),style:e.normalizeStyle(Ee(i))},null,6)):e.createCommentVNode("",!0)],64))),128))],36))}}),_n=le(wn,[["__scopeId","data-v-d1ccbfc8"]]),Bn={__name:"TimeScale",props:{api:{}},setup(a){const t=a,{_scales:n,xArea:o,highlightTime:l}=t.api.getReactiveState(),v=r.subscribe(n),u=r.subscribe(o),m=r.subscribe(l);function B(d,x,I){const T=d.cells;let b=0,R=T.length,U=0;for(let N=0;N<T.length;N++){if(U+T[N].width>x){R=N,b=U;break}U+=T[N].width}let X=R;for(;X<T.length&&U<I;)U+=T[X].width,X++;return{from:b,slice:T.slice(R,X)}}const y=e.computed(()=>{const d=v.value.rows,x=d.length-1;return d.map((I,T)=>T===x?{height:I.height,from:u.value.from,slice:I.cells.slice(u.value.start,u.value.end)}:{height:I.height,...B(I,u.value.from,u.value.to)})});return(d,x)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-scale",style:e.normalizeStyle({width:e.unref(v).width+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(I,T)=>(e.openBlock(),e.createElementBlock("div",{key:T,class:"wx-row",style:e.normalizeStyle({height:I.height+"px",paddingLeft:I.from+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.slice,(b,R)=>(e.openBlock(),e.createElementBlock("div",{key:R,class:e.normalizeClass(["wx-cell",b.css,e.unref(m)?e.unref(m)(b.date,b.unit):""]),style:e.normalizeStyle({width:b.width+"px"})},[e.createElementVNode("span",{class:e.normalizeClass({"wx-cell-value":b.width>100})},e.toDisplayString(b.value),3)],6))),128))],4))),128))],4))}},ht=le(Bn,[["__scopeId","data-v-b58c6a1c"]]),rt=.003;function $n(a,t,n){return Math.max(Math.min(a,n),t)}function kt(a,t,n){let o=!1,l=performance.now();function v(u){const B=Math.abs(u)<50?.004:.01,y=performance.now(),d=Math.min(y-l,50);l=y;const x=$n(-u*B,-rt*d,rt*d);return Math.exp(x)}return function(m){if(t()&&(m.ctrlKey||m.metaKey)){m.preventDefault();const B=v(m.deltaY),y=m.clientX-n().getBoundingClientRect().left;o||(o=!0,requestAnimationFrame(()=>{a.exec("zoom-scale",{dir:B>1?1:-1,ratio:Math.abs(1-B),offset:y}),o=!1}))}}}const Sn={class:"wx-content"},Tn={key:0,class:"wx-gantt-holidays",style:{height:"100%"}},En=["data-id"],ct=1,Cn=Object.assign({name:"GanttChartChart"},{__name:"Chart",props:{readonly:{},fullWidth:{},fullHeight:{},taskTemplate:{}},setup(a){const t=r.asDirective(Xe.hotkeys),n=a,o=e.inject("gantt-store"),{_selected:l,scrollTop:v,scrollLeft:u,cellHeight:m,_tasks:B,resources:y,_scales:d,area:x,groupBy:I,xArea:T,zoom:b,_calendars:R,_markers:U,highlightTime:X}=o.getReactiveState(),N=r.subscribe(l,!0),V=r.subscribe(v),j=r.subscribe(u),O=r.subscribe(m),E=r.subscribe(d),P=r.subscribe(b),L=r.subscribe(U),_=r.subscribe(B),q=r.subscribe(y),k=r.subscribe(x),$=r.subscribe(I),C=r.subscribe(T),F=r.subscribe(R),Y=r.subscribe(X),g=e.ref(0),S=e.ref(null),Z=e.computed(()=>{const J=[];return N.value.length&&O.value&&N.value.forEach(ae=>{J.push(`height: ${O.value}px;top: ${ae.$y-3}px`)}),J});e.watch([V,g,O],()=>{he()});const ne=e.computed(()=>Math.max(g.value,n.fullHeight));e.watchEffect(()=>{ne.value,g.value,S.value&&(S.value.scrollTop=V.value,S.value.scrollLeft=j.value)});function ce(){S.value.scrollLeft!==j.value&&o.exec("scroll-chart",{left:S.value.scrollLeft})}function he(){const J=g.value||0,ae=Math.ceil(J/O.value)+1,c=Math.floor((V.value||0)/O.value),G=Math.max(0,c-ct),H=c+ae+ct,f=G*O.value;o.exec("render-data",{start:G,end:H,from:f})}const h=kt(o,()=>P.value,()=>S.value);function Q(J){const ae=Y.value?.(J.date,J.unit);return ae?{css:ae,width:J.width}:null}const te=e.computed(()=>Y.value?E.value.rows[E.value.rows.length-1].cells.slice(C.value.start,C.value.end).map(Q):null),ye=e.computed(()=>{const ae=E.value.rows[E.value.rows.length-1]?.cells;return(E.value.minUnit==="hour"||E.value.minUnit==="day")&&ae?ae.slice(C.value.start,C.value.end):[]}),ve=e.computed(()=>_.value.slice(k.value.start,k.value.end));function we(J){if($.value?.field==="resource"){if(J.$resource){const H=o.getResourceCalendar(J);return H?[H]:[]}const c=J.$groupValue;return c===void 0||c==="$ungrouped"?[]:(Array.isArray(c)?c:[c]).flatMap(H=>{const f=q.value?.byId(H);if(!f)return[];const se=o.getResourceCalendar(f);return se?[se]:[]})}const ae=J.calendar?o.getTaskCalendar(J):void 0;return ae?[ae]:[]}const be=e.computed(()=>{const J=[];if(!F.value)return J;const ae=o.getCalendar();return ve.value.forEach((c,G)=>{const H=we(c);H.length&&ye.value.forEach((f,se)=>{const pe=H.filter(Ie=>!Ie.isWorkingDay(f.date)),ke=pe.length===0,ge=ae&&!ae.isWorkingDay(f.date),De={width:f.width,height:O.value,left:(se+C.value.start)*f.width,top:k.value.from+G*O.value};let _e="";ke||(_e=["wx-weekend",...pe.map(Ee=>Ee.css).filter(Boolean)].join(" ")),ke&&ge&&(_e="wx-weekend-override"),_e&&J.push({...De,css:_e})})}),J});function $e(J){J.eventSource="chart",o.exec("hotkey",J)}let Be;return e.onMounted(()=>{S.value&&(g.value=S.value.clientHeight,Be=new ResizeObserver(J=>{for(const ae of J)g.value=ae.target.clientHeight}),Be.observe(S.value))}),e.onUnmounted(()=>{Be?.disconnect()}),(J,ae)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"wx-chart",tabindex:"-1",ref_key:"chart",ref:S,onScroll:ce,onWheel:ae[0]||(ae[0]=(...c)=>e.unref(h)&&e.unref(h)(...c))},[e.createVNode(ht,{api:e.unref(o)},null,8,["api"]),e.unref(L).length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-markers",style:e.normalizeStyle(`height:${ne.value}px;`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),c=>(e.openBlock(),e.createElementBlock("div",{key:c.id||c.left,class:e.normalizeClass("wx-marker "+(c.css||"")),style:e.normalizeStyle(`left:${c.left}px`)},[e.createElementVNode("div",Sn,e.toDisplayString(c.text),1)],6))),128))],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"wx-area",style:e.normalizeStyle(`width:${n.fullWidth}px;height:${ne.value}px`)},[te.value?(e.openBlock(),e.createElementBlock("div",Tn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(c,G)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:G},[c?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(c.css),style:e.normalizeStyle(`width: ${c.width}px; left:${e.unref(C).from+G*c.width}px`)},null,6)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,(c,G)=>(e.openBlock(),e.createElementBlock("div",{key:G,class:e.normalizeClass(c.css),style:e.normalizeStyle(`position: absolute; pointer-events: none; width:${c.width}px; height:${c.height}px; left:${c.left}px; top:${c.top}px`)},null,6))),128)),e.unref(N).length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(N),(c,G)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.id},[c.$y?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-selected","data-id":e.unref(z.setID)(c.id),style:e.normalizeStyle(Z.value[G])},null,12,En)):e.createCommentVNode("",!0)],64))),128)):e.createCommentVNode("",!0),e.createVNode(Qt),e.createVNode(_n,{readonly:n.readonly,taskTemplate:n.taskTemplate},null,8,["readonly","taskTemplate"])],4)],32)),[[e.unref(t),{keys:{arrowup:!0,arrowdown:!0},exec:c=>$e(c)}]])}}),In=le(Cn,[["__scopeId","data-v-8d85f247"]]),Dn=Object.assign({name:"GanttResizer"},{__name:"Resizer",props:{api:{},position:{default:"after"},size:{default:4},dir:{default:"x"},onmove:{type:Function},containerWidth:{default:0},rightThreshold:{default:50}},setup(a){const t=a,{gridWidth:n,displayMode:o,_gridCollapseThreshold:l,_compactMode:v}=t.api.getReactiveState(),u=r.subscribe(n),m=r.subscribe(o),B=r.subscribe(l),y=r.subscribe(v);function d(P){let L=0;t.position==="center"?L=t.size/2:t.position==="before"&&(L=t.size);const _={size:[t.size+"px","auto"],p:[P-L+"px","0px"],p2:["auto","0px"]};if(t.dir!=="x")for(let q in _)_[q]=_[q].reverse();return _}let x=0,I;function T(P){return t.dir==="x"?P.clientX:P.clientY}function b(P){y.value||m.value==="grid"||m.value==="chart"||(x=T(P),I=u.value,document.body.style.cursor=E.value,document.body.style.userSelect="none",window.addEventListener("mousemove",U),window.addEventListener("mouseup",X))}let R;function U(P){const L=I+T(P)-x;t.api.exec("resize-grid",{width:L});let _;L<=B.value?_="chart":t.containerWidth-L<=t.rightThreshold?_="grid":_="all",m.value!==_&&t.api.exec("set-display-mode",{mode:_}),R&&clearTimeout(R),R=setTimeout(()=>t.onmove&&t.onmove(L),100)}function X(){document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",U),window.removeEventListener("mouseup",X)}function N(P){let L;y.value?L=m.value==="chart"?"grid":"chart":m.value==="grid"||m.value==="chart"?L="all":L=P==="left"?"chart":"grid",t.api.exec("set-display-mode",{mode:L})}function V(){N("left")}function j(){N("right")}const O=e.computed(()=>d(u.value)),E=e.computed(()=>m.value!=="all"?"auto":t.dir==="x"?"ew-resize":"ns-resize");return(P,L)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wx-resizer",`wx-resizer-${a.dir}`,`wx-resizer-display-${e.unref(m)}`]),onMousedown:b,style:e.normalizeStyle(`width:${O.value.size[0]}; height: ${O.value.size[1]}; cursor:${E.value};`)},[e.createElementVNode("div",{class:"wx-button-expand-box"},[e.createElementVNode("div",{class:"wx-button-expand-content wx-button-expand-left"},[e.createElementVNode("i",{class:"wxi-menu-left",onClick:V})]),e.createElementVNode("div",{class:"wx-button-expand-content wx-button-expand-right"},[e.createElementVNode("i",{class:"wxi-menu-right",onClick:j})])]),L[0]||(L[0]=e.createElementVNode("div",{class:"wx-resizer-line"},null,-1))],38))}}),yt=le(Dn,[["__scopeId","data-v-bb9173dd"]]),Rn={tabindex:"0",class:"wx-layout"},Ln=Object.assign({name:"GanttLayout"},{__name:"Layout",props:e.mergeModels({taskTemplate:{},readonly:{}},{tableAPI:{},tableAPIModifiers:{},ganttWidth:{},ganttWidthModifiers:{}}),emits:["update:tableAPI","update:ganttWidth"],setup(a){const t=r.asDirective(Xe.hotkeys),n=e.useModel(a,"tableAPI"),o=e.useModel(a,"ganttWidth"),l=e.inject("gantt-store"),{_tasks:v,_scales:u,cellHeight:m,columns:B,scrollTop:y,undo:d,_columnsWidth:x}=l.getReactiveState(),I=r.subscribe(v),T=r.subscribe(u),b=r.subscribe(m),R=r.subscribe(B),U=r.subscribe(y),X=r.subscribe(d),N=r.subscribe(x),V=e.ref(void 0),j=e.ref(void 0),O=e.ref(null),E=e.computed(()=>o.value-j.value),P=e.computed(()=>T.value.width),L=e.computed(()=>I.value.length*b.value),_=e.computed(()=>T.value.height+L.value+E.value);e.watchEffect(()=>{let S;O.value&&(S=new ResizeObserver(q),S.observe(O.value)),e.onWatcherCleanup(()=>{S&&S.disconnect()})});function q(){l.exec("resize-chart",{width:o.value-N.value-E.value-4,height:V.value-T.value.height,scrollSize:E.value})}const k=e.ref(null);function $(){l.exec("scroll-chart",{top:k.value.scrollTop})}function C(){k.value&&U.value!==k.value.scrollTop&&(k.value.scrollTop=U.value)}e.watchEffect(()=>{U.value,C()});let F;e.onMounted(()=>{k.value&&(F=new ResizeObserver(()=>{V.value=k.value?.offsetHeight,o.value=k.value?.offsetWidth}),F.observe(k.value),V.value=k.value.offsetHeight,o.value=k.value.offsetWidth)}),e.onUnmounted(()=>{F?.disconnect()});const Y=e.ref(null);let g;return e.onMounted(()=>{Y.value&&(g=new ResizeObserver(()=>{j.value=Y.value?.offsetWidth}),g.observe(Y.value),j.value=Y.value.offsetWidth)}),e.onUnmounted(()=>{g?.disconnect()}),(S,Z)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-gantt",ref_key:"ganttDiv",ref:k,onScroll:$},[e.createElementVNode("div",{ref_key:"pseudoRowsDiv",ref:Y,class:"wx-pseudo-rows",style:e.normalizeStyle(`height:${_.value}px;width:100%;`)},[e.createElementVNode("div",{class:"wx-stuck",style:e.normalizeStyle(`height:${V.value}px;width:${j.value}px;`)},[e.withDirectives((e.openBlock(),e.createElementBlock("div",Rn,[e.unref(R).length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Zt,{readonly:a.readonly,fullHeight:L.value,tableAPI:n.value,"onUpdate:tableAPI":Z[0]||(Z[0]=ne=>n.value=ne)},null,8,["readonly","fullHeight","tableAPI"]),e.createVNode(yt,{containerWidth:o.value,api:e.unref(l)},null,8,["containerWidth","api"])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"wx-content",ref_key:"chart",ref:O},[e.createVNode(In,{readonly:a.readonly,fullWidth:P.value,fullHeight:L.value,taskTemplate:a.taskTemplate},null,8,["readonly","fullWidth","fullHeight","taskTemplate"])],512)])),[[e.unref(t),{keys:{"ctrl+c":!0,"ctrl+v":!0,"ctrl+x":!0,"ctrl+d":!0,backspace:!0,"ctrl+z":e.unref(X),"ctrl+y":e.unref(X)},exec:ne=>{ne.isInput||e.unref(l).exec("hotkey",ne)}}]])],4)],4)],544))}}),Vn=le(Ln,[["__scopeId","data-v-076c7979"]]);function Nn(a){return{year:"%Y",quarter:`${a("Q")} %Q`,month:"%M",week:`${a("Week")} %w`,day:"%M %j",hour:"%H:%i"}}function zn(a,t){return typeof a=="function"?a:z.dateToString(a,t)}function bt(a,t){return a.map(({format:n,...o})=>({...o,format:zn(n,t)}))}function Mn(a,t){const n=Nn(t);for(let o in n)n[o]=z.dateToString(n[o],a);return n}function Wn(a,t){if(!a||!a.length)return a;const n=z.dateToString("%d-%m-%Y",t);return a.map(o=>o.template?o:o.id==="start"||o.id==="end"?{...o,_template:l=>n(l),template:l=>n(l)}:o.id==="duration"?{...o,_template:l=>l,template:l=>l}:o)}function Hn(a,t){return a.levels?{...a,levels:a.levels.map(n=>({...n,scales:bt(n.scales,t)}))}:a}const An=650,On=Object.assign({name:"GanttComponentsGantt"},{__name:"Gantt",props:{taskTemplate:{default:null},markers:{default:()=>[]},taskTypes:{default:()=>ee.defaultTaskTypes},tasks:{default:()=>[]},selected:{default:()=>[]},activeTask:{default:null},links:{default:()=>[]},resources:{default:null},assignments:{default:()=>[]},scales:{default:()=>[{unit:"month",step:1,format:"%F %Y"},{unit:"day",step:1,format:"%j"}]},columns:{default:null},start:{default:null},end:{default:null},lengthUnit:{default:"day"},durationUnit:{default:"day"},cellWidth:{default:100},cellHeight:{default:38},scaleHeight:{default:36},gridWidth:{default:null},displayMode:{default:"all"},readonly:{type:Boolean,default:!1},cellBorders:{default:"full"},zoom:{type:[Boolean,Object,Array],default:!1},baselines:{type:[Boolean,Object],default:!1},rollups:{type:[Boolean,Object],default:!1},highlightTime:{type:Function,default:null},init:{type:Function,default:null},autoScale:{type:Boolean,default:!0},unscheduledTasks:{type:Boolean,default:!1},criticalPath:{default:null},schedule:{default:()=>({type:"forward"})},projectStart:{default:null},projectEnd:{default:null},calendar:{default:null},calendars:{default:()=>[]},undo:{type:Boolean,default:!1},splitTasks:{type:Boolean,default:!1},summary:{default:null},slack:{type:Boolean,default:!1},groupBy:{default:null},wbs:{type:Boolean,default:!1}},setup(a,{expose:t}){const n=a,o=e.useAttrs(),l=new ee.DataStore(r.writable),v={...Ke.en,...Pe.en};let u=e.inject("wx-i18n",null);u?u=u.extend(v,!0):u=z.locale(v),e.provide("wx-i18n",u);const{calendar:m}=u.getRaw(),B=e.computed(()=>ee.getDefaultColumns({resources:!!n.resources,wbs:n.wbs})),y=e.computed(()=>n.gridWidth??ee.getDefaultGridWidth(B.value)),d=e.computed(()=>{let h={zoom:Hn(n.zoom,m),scales:bt(n.scales,m),columns:Wn(n.columns??B.value,m),links:n.links,cellWidth:n.cellWidth};return h.zoom&&(h={...h,...ee.normalizeZoom(h.zoom,Mn(m,u.getGroup("gantt")),h.scales,n.cellWidth)}),h});let x=l.in;const I=/-/g;let T=new tt.EventBusRouter((h,Q)=>{const te="on"+h.replace(I,"");o[te]&&o[te](Q)});x.setNext(T);const b=e.ref(void 0),R=e.ref(void 0),U=e.computed(()=>R.value<=An),X=l.getState.bind(l),N=l.getReactive.bind(l),V=()=>({data:l}),j=x.exec,O=h=>T=T.setNext(h),E=x.intercept.bind(x),P=x.on.bind(x),L=x.detach.bind(x),_=h=>l.getTask(h),q=h=>l.getResource(h),k=h=>l.serialize(h),$=h=>h?new Promise(Q=>setTimeout(()=>Q(b.value),1)):b.value,C=()=>l.getHistory(),F=h=>l.getCalendar(h),Y=h=>l.getTaskCalendar(h),g=h=>l.getResourceCalendar(h),S=h=>l.getTaskResources(h),Z=h=>l.getResourceTasks(h),ne={getState:X,getReactiveState:N,getStores:V,exec:j,setNext:O,intercept:E,on:P,detach:L,getTable:$,getTask:_,getResource:q,serialize:k,getHistory:C,getCalendar:F,getTaskResources:S,getResourceTasks:Z,getTaskCalendar:Y};t({getState:X,getReactiveState:N,getStores:V,exec:j,setNext:O,intercept:E,on:P,detach:L,getTable:$,getTask:_,getResource:q,serialize:k,getHistory:C,getCalendar:F,getTaskResources:S,getResourceTasks:Z,getTaskCalendar:Y,getResourceCalendar:g}),e.provide("gantt-store",{getReactiveState:l.getReactive.bind(l),getState:l.getState.bind(l),exec:x.exec.bind(x),getTask:l.getTask.bind(l),getTaskCalendar:l.getTaskCalendar.bind(l),getResourceCalendar:l.getResourceCalendar.bind(l),getCalendar:l.getCalendar.bind(l),getTaskResources:l.getTaskResources.bind(l),getHistory:l.getHistory.bind(l)});let ce=!0;const he=()=>{const h=d.value;l.init({tasks:n.tasks,links:h.links,resources:n.resources,assignments:n.assignments,start:n.start,columns:h.columns,end:n.end,lengthUnit:n.lengthUnit,cellWidth:h.cellWidth,cellHeight:n.cellHeight,scaleHeight:n.scaleHeight,scales:h.scales,taskTypes:n.taskTypes,zoom:h.zoom,selected:n.selected,activeTask:n.activeTask,baselines:n.baselines,rollups:n.rollups===!0?{type:"closest"}:n.rollups,autoScale:n.autoScale,unscheduledTasks:n.unscheduledTasks,markers:n.markers,durationUnit:n.durationUnit,criticalPath:n.criticalPath,schedule:n.schedule,projectStart:n.projectStart,projectEnd:n.projectEnd,calendar:n.calendar,calendars:n.calendars,slack:n.slack,undo:n.undo,_weekStart:m.weekStart,splitTasks:n.splitTasks,summary:n.summary,groupBy:n.groupBy,highlightTime:n.highlightTime,wbs:n.wbs,displayMode:n.displayMode,gridWidth:y.value,cellBorders:n.cellBorders,_compactMode:U.value}),ce&&n.init&&(n.init(ne),ce=!1)};return e.watchEffect(he),(h,Q)=>(e.openBlock(),e.createBlock(Vn,{taskTemplate:n.taskTemplate,readonly:n.readonly,tableAPI:b.value,"onUpdate:tableAPI":Q[0]||(Q[0]=te=>b.value=te),ganttWidth:R.value,"onUpdate:ganttWidth":Q[1]||(Q[1]=te=>R.value=te)},null,8,["taskTemplate","readonly","tableAPI","ganttWidth"]))}}),Fn=Object.assign({name:"GanttToolbar"},{__name:"Toolbar",props:{api:{default:null},items:{default:()=>[]}},setup(a){const t=a;let n=e.inject("wx-i18n",null);n||(n=z.locale(Pe.en),e.provide("wx-i18n",n));const o=n.getGroup("gantt"),l=r.subscribeLater(()=>t.api?.getReactiveState()?._selected),v=r.subscribeLater(()=>t.api?.getReactiveState()?.undo),u=r.subscribeLater(()=>t.api?.getReactiveState()?.history),m=r.subscribeLater(()=>t.api?.getReactiveState()?.splitTasks),B=r.subscribeLater(()=>t.api?.getReactiveState()?.groupBy),y=["undo","redo"],d=e.computed(()=>{const I=ee.getToolbarButtons({undo:!0,splitTasks:!0});return(t.items.length?t.items:ee.getToolbarButtons({undo:v().value,splitTasks:m().value,group:!!B().value?.field})).map(b=>(b={...b,disabled:!1},b.handler=ee.isHandledAction(I,b.id)?R=>ee.handleAction(t.api,R.id,null,o):b.handler,b.text&&(b.text=o(b.text)),b.menuText&&(b.menuText=o(b.menuText)),b))}),x=e.computed(()=>{const I=l().value,T=[];return d.value.forEach(b=>{const R=b.id;if(R==="add-task"||!y.includes(R))if(!I?.length||!t.api){if(R!=="add-task")return;T.push(b)}else T.push({...b,disabled:b.isDisabled&&I.some(U=>b.isDisabled(U,t.api.getState(),t.api.getTaskCalendar(U)))});else y.includes(R)&&T.push({...b,disabled:b.isDisabled(u().value)})}),T.filter((b,R)=>{if(t.api&&b.isHidden)return!I.some(U=>b.isHidden(U,t.api.getState()));if(b.comp==="separator"){const U=T[R+1];if(!U||U.comp==="separator")return!1}return!0})});return(I,T)=>(e.openBlock(),e.createBlock(e.unref(dt.Toolbar),{items:x.value},null,8,["items"]))}}),jn=["oncontextmenu"],Pn={__name:"ContextMenu",props:{options:{default:()=>[]},api:{default:null},resolver:{default:null},filter:{default:null},at:{default:"point"},onclick:{type:Function},css:{}},setup(a,{expose:t}){const n=a;let o=null,l=e.inject("wx-i18n",null);l||(l=z.locale({...Pe.en,...Ke.en}),e.provide("wx-i18n",l));const v=l.getGroup("gantt"),u=r.subscribeLater(()=>n.api?.getReactiveState()?.taskTypes),m=r.subscribeLater(()=>n.api?.getReactiveState()?.selected),B=r.subscribeLater(()=>n.api?.getReactiveState()?._selected),y=r.subscribeLater(()=>n.api?.getReactiveState()?.splitTasks),d=r.subscribeLater(()=>n.api?.getReactiveState()?.summary),x=r.subscribeLater(()=>n.api?.getReactiveState()?.groupBy),I=e.computed(()=>({splitTasks:y().value,taskTypes:u().value,summary:d().value,group:!!x().value?.field})),T=e.computed(()=>B().value??[]),b=e.computed(()=>ee.getMenuOptions(I.value)),R=e.computed(()=>n.options.length?n.options:null),U=e.computed(()=>N(R.value??b.value));function X(k){return k.map($=>{const C={...$};return $.data&&(C.data=X($.data)),C})}function N(k){return k.map($=>($={...$},$.text&&($.text=v($.text)),$.subtext&&($.subtext=v($.subtext)),$.data&&($.data=N($.data)),$))}function V(){if(!n.api)return[];const k=X(U.value),$=C=>{C.forEach(F=>{F.isDisabled&&(F.disabled=T.value.some(Y=>F.isDisabled(Y,n.api.getState(),n.api.getTaskCalendar(Y),o))),F.data&&$(F.data)})};return $(k),k}function j(k,$){if(z.locate($.target,"data-menu-ignore")?.classList.contains("wx-resource-load"))return null;let C=k?n.api.getTask(k):null;if(n.resolver){const F=n.resolver(k,$);C=F===!0?C:F}if(C){const F=z.locateID($.target,"data-segment");F!==null?o={id:C.id,segmentIndex:F}:o=C.id,m().value.includes(C.id)||n.api.exec("select-task",{id:C.id}),L.value=V()}return C}function O(k){const $=k.action;$&&(ee.isHandledAction(b.value,$.id)&&ee.handleAction(n.api,$.id,o,v),n.onclick&&n.onclick(k))}function E(k){if(!n.api)return!0;let $=n.filter?T.value.every(C=>n.filter(k,C)):!0;return $&&k.isHidden&&($=!T.value.some(C=>k.isHidden(C,n.api.getState(),o))),$}let P=!1;e.watchEffect(()=>{n.api&&!P&&(P=!0,n.api.on("scroll-chart",()=>_.value.show()),n.api.on("drag-task",()=>_.value.show()))});const L=e.ref([]),_=e.ref(null);function q(k,$){L.value=V(),_.value.show(k,$)}return t({show:q}),(k,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(xt.ContextMenu),{filter:E,options:L.value,dataKey:"id",resolver:j,onclick:O,css:a.css,at:a.at,ref_key:"menu",ref:_},null,8,["options","css","at"]),e.createElementVNode("span",{oncontextmenu:_.value?.show,"data-menu-ignore":"true"},[e.renderSlot(k.$slots,"default",{},void 0,!0)],8,jn)],64))}},Gn=le(Pn,[["__scopeId","data-v-b683afc0"]]),Un={__name:"GridSection",props:{columns:{},data:{},onaction:{type:Function},onedit:{type:Function},sizes:{},oninit:{type:Function}},setup(a){const t=a;function n(l){const v=z.locateID(l),u=l.target.dataset.action;u&&l.preventDefault(),v&&u&&t.onaction&&t.onaction(v,u)}function o(l){t.oninit&&t.oninit(l),l.on("update-cell",v=>{const{id:u,column:m,value:B}=v;t.onedit(u,m,B)})}return(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-table",onClick:n},[e.createVNode(e.unref(Le.Grid),{init:o,columns:a.columns,data:a.data,select:!1,columnStyle:u=>`wx-editor-cell wx-text-${u.align} ${u.id==="delete"?"wx-action":""}`,sizes:a.sizes||{}},null,8,["columns","data","columnStyle","sizes"])]))}},nt=le(Un,[["__scopeId","data-v-011a009e"]]),qn={class:"wx-wrapper"},Yn={class:"wx-text"},Kn={key:0,class:"wxi-angle-down"},Xn={__name:"LinkTypeCell",props:{row:{},column:{},data:{}},setup(a){const t=a,n=e.computed(()=>t.data?t.data.label:t.column.options.find(o=>o.id===t.row.type)?.label||"");return(o,l)=>(e.openBlock(),e.createElementBlock("div",qn,[e.createElementVNode("div",Yn,e.toDisplayString(n.value),1),a.row?(e.openBlock(),e.createElementBlock("i",Kn)):e.createCommentVNode("",!0)]))}},it=le(Xn,[["__scopeId","data-v-2569b653"]]),Zn={class:"wx-title"},Qn={key:0,class:"wx-nodata"},Jn=Object.assign({name:"GanttEditorLinks",inheritAttrs:!1},{__name:"Links",props:{api:{},autoSave:{},onextchange:{type:Function},predecessors:{default:null},successors:{default:null},batch:{default:"links"}},setup(a){const t=e.inject("wx-i18n").getGroup("gantt"),n=a,{activeTask:o,_activeTask:l,links:v,tasks:u,schedule:m,unscheduledTasks:B}=n.api.getReactiveState(),y=r.subscribe(o),d=r.subscribe(l),x=r.subscribe(v,!0),I=r.subscribe(u),T=r.subscribe(m),b=r.subscribe(B),R=e.ref();e.watchEffect(()=>{R.value=j()});const U=[{id:"e2s",label:t("End-to-start")},{id:"s2s",label:t("Start-to-start")},{id:"e2e",label:t("End-to-end")},{id:"s2e",label:t("Start-to-end")}];function X(_){return _.type==="e2s"?{type:"text",config:{type:"number"}}:null}const N=e.computed(()=>!T.value?.auto||b.value&&d.value.unscheduled);function V(){return[{id:"taskText",header:t("Task name"),flexgrow:2},{id:"lag",header:t("Lag"),editor:X,flexgrow:1,hidden:N.value},{id:"type",header:t("Type"),width:124,options:U,editor:{type:"richselect",config:{cell:it}},cell:it},{id:"delete",header:"",cell:je,width:50,align:"center"}]}function j(){if(y.value){const _=[],q=[];(!n.predecessors||!n.successors)&&x.value.forEach(C=>{!n.predecessors&&C.target===y.value&&_.push(C),!n.successors&&C.source===y.value&&q.push(C)});const k=n.predecessors||_.map(C=>{const{id:F,lag:Y,type:g,source:S}=C;return{id:F,type:g,lag:Y,taskText:I.value.byId(S).text}}),$=n.successors||q.map(C=>{const{id:F,lag:Y,type:g,target:S}=C;return{id:F,type:g,lag:Y,taskText:I.value.byId(S).text}});return[{title:t("Predecessors"),data:k},{title:t("Successors"),data:$}]}}function O(_){return{view:"links",event:_,values:{predecessors:R.value[0].data,successors:R.value[1].data}}}function E(_){n.autoSave?n.api.exec("delete-link",{id:_}):(R.value=R.value.map(q=>({...q,data:q.data.filter(k=>k.id!==_)})),n.onextchange?.(O({id:_,action:"delete-link",data:{id:_}})))}function P(_,q,k){q==="lag"&&k!==""&&(k=k*1);const $={[q]:k};q==="type"&&T.value?.auto&&k!=="e2s"&&($.lag=""),n.autoSave?n.api.exec("update-link",{id:_,link:$}):(R.value=R.value.map(C=>({...C,data:C.data.map(F=>F.id===_?{...F,...$}:F)})),n.onextchange?.(O({id:_,action:"update-link",data:{id:_,link:$}})))}const L=e.computed(()=>R.value&&!R.value[0].data.length&&!R.value[1].data.length);return(_,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wx-wrapper",{"wx-nobatch":a.batch!=="links"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,k=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:k.title},[k.data.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Zn,e.toDisplayString(k.title),1),e.createVNode(nt,{columns:V(),onaction:E,onedit:P,data:k.data,sizes:{rowHeight:44}},null,8,["columns","data"])],64)):e.createCommentVNode("",!0)],64))),128)),L.value?(e.openBlock(),e.createElementBlock("div",Qn,e.toDisplayString(e.unref(t)("No links")),1)):e.createCommentVNode("",!0)],2))}}),ea=le(Jn,[["__scopeId","data-v-0a1cff38"]]),ta={class:"date-time-controll"},na={__name:"DateTimePicker",props:{value:{},time:{},format:{},onchange:{type:Function}},setup(a){const t=a,n=e.computed(()=>{const{value:l,time:v,format:u,onchange:m,...B}=t;return B});function o(l){const v=new Date(l.value);v.setHours(t.value.getHours()),v.setMinutes(t.value.getMinutes()),t.onchange?.({value:v})}return(l,v)=>(e.openBlock(),e.createElementBlock("div",ta,[e.createVNode(e.unref(ue.DatePicker),e.mergeProps(n.value,{value:a.value,onchange:o,format:a.format,buttons:["today"],clear:!1}),null,16,["value","format"]),a.time?(e.openBlock(),e.createBlock(e.unref(ue.TimePicker),{key:0,value:a.value,onchange:a.onchange,format:a.format},null,8,["value","onchange","format"])):e.createCommentVNode("",!0)]))}},aa=le(na,[["__scopeId","data-v-1f9dfea2"]]),oa={class:"wx-avatar"},la={class:"wx-text"},sa={class:"wx-name"},ra={key:0,class:"wx-role"},ca={__name:"ResourcesEditorCell",props:{row:{},data:{}},setup(a){const t=a,n=e.computed(()=>t.data||t.row);return(o,l)=>n.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",oa,[e.createVNode(e.unref(ue.Avatar),{value:n.value,size:40},null,8,["value"])]),e.createElementVNode("div",la,[e.createElementVNode("div",sa,e.toDisplayString(n.value.name),1),n.value.role?(e.openBlock(),e.createElementBlock("div",ra,e.toDisplayString(n.value.role),1)):e.createCommentVNode("",!0)])],64)):e.createCommentVNode("",!0)}},ut=le(ca,[["__scopeId","data-v-28c145a1"]]),ia={class:"wx-section"},ua={key:1,class:"wx-nodata"},da={class:"wx-button-wrapper"},fa=Object.assign({name:"GanttEditorResources",inheritAttrs:!1},{__name:"Resources",props:{api:{},autoSave:{},onextchange:{type:Function},taskAssignments:{default:null}},setup(a){const n=e.inject("wx-i18n").getGroup("gantt"),o=a,l=o.onextchange,{activeTask:v,resources:u,_assignments:m,assignments:B}=o.api.getReactiveState(),y=r.subscribe(v),d=r.subscribe(u),x=r.subscribe(B),I=e.ref(void 0),T=e.ref(null),b=e.ref([]);function R(g){b.value=o.taskAssignments||o.api.getTaskResources(g).map(S=>({...S,resource:S.id,id:S.assignmentId}))}const U=[v.subscribe(g=>{R(g)}),m.subscribe(()=>R(y.value))];e.onUnmounted(()=>{for(const g of U)g()});const X=e.computed(()=>{const g=[];return d.value?.eachChild(S=>{S.data||g.push({...S,label:S.name})},0),g}),N=e.computed(()=>X.value.filter(g=>!b.value.find(S=>S.resource===g.id)));function V(g){return{view:"resources",event:g,values:{taskAssignments:b.value}}}function j(g){I.value.exec("close-editor",{ignore:!0}),o.autoSave?o.api.exec("delete-assignment",{id:g}):(b.value=b.value.filter(S=>S.id!==g),l&&l(V({id:g,action:"delete-assignment",data:{id:g}}))),T.value=null}function O(g,S){const Z=y.value;S={...S,units:100,task:Z,id:g};const ne={assignment:S};if(o.autoSave)o.api.exec("add-assignment",ne);else{const ce=d.value?.byId(S.resource);b.value=[...b.value,{...ce,...S}],l&&l(V({id:ce.id,action:"add-assignment",data:ne}))}}function E(g){return g.id===T.value?N.value:[X.value.find(Z=>Z.id===g.resource)].concat(N.value)}function P(g,S){let Z=x.value?.byId(g);Z||(Z=b.value.find(ce=>ce.id===g));const ne={id:g,assignment:{units:Z.units||100,...S,id:g}};o.autoSave?o.api.exec("update-assignment",ne):(S.resource&&S.resource!==Z.resource&&(S={...d.value?.byId(S.resource),...ne.assignment}),b.value=b.value.map(ce=>ce.id===g?{...ce,...S}:ce),l&&l(V({id:g,action:"update-assignment",data:ne})))}const L=e.computed(()=>(N.value,[{id:"resource",header:n("Resource"),cell:ut,type:"string",flexgrow:3,editor:g=>({type:"combo",config:{options:E(g),cell:ut}}),options:X.value},{id:"units",header:n("Units"),flexgrow:1,editor:{type:"text",config:{type:"number"}},template:g=>`${g}%`},{id:"delete",header:"",cell:je,width:50,align:"center"}]));function _(g,S){g&&S==="delete"&&j(g)}function q(g,S,Z){if(S==="units")P(g,{units:Z*1});else if(S==="resource"){const ne={resource:Z};g===T.value?O(g,ne):P(g,ne)}T.value=null}function k(g){I.value=g,I.value.on("close-editor",()=>{T.value&&(I.value.exec("delete-row",{id:T.value}),T.value=null)})}const $=e.computed(()=>T.value||!N.value.length);let C=!1;function F(){I.value?.exec("close-editor",{ignore:!0}),C||(C=!0,T.value=tt.tempID(),requestAnimationFrame(()=>{Y(T.value),C=!1}))}function Y(g){I.value.exec("add-row",{id:g,row:{units:100}}),setTimeout(()=>{I.value.exec("open-editor",{id:g,column:"resource"})})}return(g,S)=>(e.openBlock(),e.createElementBlock("div",ia,[b.value.length||T.value?(e.openBlock(),e.createBlock(nt,{key:0,oninit:k,columns:L.value,onaction:_,onedit:q,data:b.value,sizes:{rowHeight:52}},null,8,["columns","data"])):(e.openBlock(),e.createElementBlock("div",ua,e.toDisplayString(e.unref(n)("No assignments")),1)),e.createElementVNode("div",da,[e.createVNode(e.unref(ue.Button),{disabled:$.value,icon:"wxi-plus",css:"wx-button",onclick:F},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n)("Add resource")),1)]),_:1},8,["disabled"])])]))}}),ma=le(fa,[["__scopeId","data-v-7bdae259"]]),pa={class:"wx-section"},va={key:1,class:"wx-nodata"},ga=Object.assign({name:"GanttEditorSegments",inheritAttrs:!1},{__name:"Segments",props:{api:{},autoSave:{},segments:{},onextchange:{type:Function}},setup(a){const t=e.inject("wx-i18n"),n=t.getGroup("gantt"),o=t.getRaw(),l=o.gantt?.dateFormat||o.formats?.dateFormat,v=z.dateToString(l,o.calendar),u=a,m=u.onextchange,{_activeTask:B}=u.api.getReactiveState(),y=r.subscribe(B),d=e.ref([]);function x(){const V=y.value;return!V||u.segments===null?[]:u.segments?[...u.segments]:V?.segments?.map(j=>({...j,id:j.id||tt.tempID()}))}e.watchEffect(()=>{y.value,d.value=x()});const I=e.computed(()=>[{id:"text",header:n("Name"),type:"string",flexgrow:3,editor:"text"},{id:"start",header:n("Start"),flexgrow:2,template:V=>v(V),editor:"datepicker"},{id:"duration",header:n("Duration"),flexgrow:2,editor:{type:"text",config:{type:"number"}}},{id:"delete",header:"",cell:je,width:50,align:"center"}]),T=e.ref(null);function b(V){T.value=V}function R(V){return{view:"segments",event:V,values:{segments:d.value.length?[...d.value]:null}}}function U(V){const j=d.value.findIndex(P=>P.id===V);d.value=d.value.filter((P,L)=>L!==j);const E={id:y.value.id,task:{segments:d.value.length?[...d.value]:null}};u.autoSave?u.api.exec("update-task",E):m&&m(R({id:V,action:"update-task",data:E}))}function X(V,j){j==="delete"&&U(V)}function N(V,j,O){const{data:E}=T.value.getState();let P=E.findIndex(k=>k.id===V);j==="duration"&&(O=O*1);const L={...d.value[P],[j]:O},_=y.value;ee.prepareEditTask(L,u.api.getState(),u.api.getTaskCalendar(_),j);const q={id:_.id,segmentIndex:P,task:L};u.autoSave?u.api.exec("update-task",q):(d.value=d.value.map(k=>k.id===V?{...k,...L}:k),m&&m(R({id:V,action:"update-task",data:q})))}return(V,j)=>(e.openBlock(),e.createElementBlock("div",pa,[d.value.length?(e.openBlock(),e.createBlock(nt,{key:0,columns:I.value,oninit:b,onaction:X,data:d.value,onedit:N},null,8,["columns","data"])):(e.openBlock(),e.createElementBlock("div",va,e.toDisplayString(e.unref(n)("No segments")),1))]))}}),ha=le(ga,[["__scopeId","data-v-5a914a60"]]),qe="general",ka=Object.assign({name:"GanttEditor"},{__name:"Editor",props:{api:{default:null},items:{default:()=>[]},css:{default:""},layout:{default:"default"},readonly:{type:Boolean,default:!1},placement:{default:"sidebar"},bottomBar:{type:[Boolean,Object],default:!1},topBar:{type:[Boolean,Object],default:!0},autoSave:{type:Boolean,default:!0},focus:{type:Boolean,default:!1},hotkeys:{default:()=>({})}},setup(a){Ce.registerEditorItem("select",ue.RichSelect),Ce.registerEditorItem("date",aa),Ce.registerEditorItem("twostate",ue.TwoState),Ce.registerEditorItem("slider",ue.Slider),Ce.registerEditorItem("counter",ue.Counter),Ce.registerEditorItem("links",ea),Ce.registerEditorItem("checkbox",ue.Checkbox),Ce.registerEditorItem("resources",ma),Ce.registerEditorItem("segments",ha),dt.registerToolbarItem("tabs",ue.Tabs);const t=a;let n=e.inject("wx-i18n",null);n||(n=z.locale({...Pe.en,...Ke.en}),e.provide("wx-i18n",n));const o=n.getGroup("gantt"),l=n.getRaw(),v=l.gantt?.dateFormat||l.formats?.dateFormat,u=z.dateToString(v,l.calendar),m=r.subscribeLater(()=>t.api?.getReactiveState()?._activeTask),B=r.subscribeLater(()=>t.api?.getReactiveState()?.activeTask),y=r.subscribeLater(()=>t.api?.getReactiveState()?.unscheduledTasks),d=r.subscribeLater(()=>t.api?.getReactiveState()?.rollups),x=r.subscribeLater(()=>t.api?.getReactiveState()?.summary),I=r.subscribeLater(()=>t.api?.getReactiveState()?.links),T=r.subscribeLater(()=>t.api?.getReactiveState()?.splitTasks),b=r.subscribeLater(()=>t.api?.getReactiveState()?.taskTypes),R=r.subscribeLater(()=>t.api?.getReactiveState()?.resources??null),U=r.subscribeLater(()=>t.api?.getReactiveState()?._compactMode),X=r.subscribeLater(()=>t.api?.getReactiveState()?.undo),N=e.ref(qe),V=e.computed(()=>U().value?"wx-full-screen":""),j=e.computed(()=>ee.getEditorItems({unscheduledTasks:y().value,rollups:d().value,summary:x().value,taskTypes:b().value,resources:R().value,splitTasks:T().value})),O=e.ref(new Map),E=e.ref(new Map),P=e.ref(new Map),L=e.ref(null),_=e.ref(void 0),q=e.ref(null),k={taskAssignments:null,predecessors:null,successors:null},$=e.ref({...k}),C=e.computed(()=>{const c=m().value;if(!c)return null;const G={...c};if(t.readonly){let H={parent:G.parent};return j.value.forEach(({key:f,comp:se})=>{if(se!=="links"&&se!=="resources"){const pe=G[f];se==="date"&&pe instanceof Date?H[f]=u(pe):se==="slider"&&f==="progress"?H[f]=`${pe}%`:H[f]=pe}}),H}return G||null});e.watch(C,c=>{_.value=c}),e.watch(B,()=>{O.value=new Map,E.value=new Map,P.value=new Map,q.value=null,L.value=null,N.value||(N.value=qe),$.value={...k}});function F(c,G="form"){return!t.api||!c||!Array.isArray(c)?c:c.filter(H=>_.value?!H.isHidden||!H.isHidden(_.value,t.api.getState()):!0).map(H=>{const f={...H};return f.items&&Array.isArray(f.items)?(f.items=F(f.items),f):(G==="form"&&!f.batch&&(f.batch=qe),["links","resources","segments"].includes(f.key)&&t.api&&(f.api=t.api,f.autoSave=t.autoSave,f.key==="resources"?f.taskAssignments=$.value.taskAssignments:f.key==="links"?(f.successors=$.value.successors,f.predecessors=$.value.predecessors):f.key==="segments"&&(f.segments=$.value.segments),f.onextchange=he),f.id==="tabs"&&(f.api=t.api,f.css="wx-gantt-tabs",f.value=N.value,f.onchange=f.onchange||ae),f.comp==="slider"&&f.key==="progress"&&(f.labelTemplate=se=>`${o(f.label)} ${se}%`),f.text&&(f.text=o(f.text)),f.label&&(f.label=o(f.label)),f.options&&(f.options=F(f.options)),f.config&&(f.config={...f.config}),f.config?.placeholder&&(f.config.placeholder=o(f.config.placeholder)),_.value&&f.isDisabled&&f.isDisabled(_.value,t.api.getState(),t.api.getTaskCalendar(_.value))?f.disabled=!0:delete f.disabled,f)})}const Y=e.computed(()=>{const c=t.items.length?t.items:j.value;return F(c)}),g=e.computed(()=>new Set(Y.value.map(c=>c.batch)));e.watch(g,c=>{c.has(N.value)||(N.value=qe)});const S=e.computed(()=>Y.value.map(c=>c.key));function Z(c,G,H){if(c=typeof c!="object"?{}:{...c},c.items||(c.items=ee.getEditorButtons({resources:R().value,autoSave:t.autoSave,splitTasks:T().value})),c.items=ee.filterEditorButtons(c.items,f=>!(f.id==="tabs"&&(f.type=f.type||H,f.options=f.options.filter(se=>G.has(se.id)),f.options.length<2))),c.items=F(c.items,"toolbar"),!c.layout){const f=c.items.some(se=>se.items);c.layout=f?"column":"row"}return c}const ne=e.computed(()=>!t.topBar||t.readonly?!1:Z(t.topBar,g.value,"top")),ce=e.computed(()=>!t.bottomBar||t.readonly?!1:Z(t.bottomBar,g.value,"bottom"));function he({view:c,event:G,values:H}){const{id:f,action:se,data:pe}=G;let ke;c==="links"?ke=O.value:c==="resources"?ke=E.value:c==="segments"&&(ke=P.value),ke.set(f,{action:se,data:pe}),Object.keys(H).forEach(ge=>{$.value[ge]=H[ge]})}function h(){for(let[c,G]of O.value)if(I().value.byId(c)){const{action:H,data:f}=G;t.api.exec(H,f)}[E.value,P.value].forEach(c=>{for(let[,G]of c){const{action:H,data:f}=G;t.api.exec(H,f)}})}function Q(){t.api.exec("delete-task",{id:B().value})}function te(){t.api.exec("show-editor",{id:null})}function ye(c){const{item:G}=c;G.id==="delete"?Q():G.id==="save"&&h(),G.comp&&te()}function ve(c){let{update:G,key:H,input:f}=c;if(f&&(L.value=!0),c.update=we({...G},H,f),!t.autoSave)_.value=c.update;else if(!q.value&&!f){const se=Y.value.find(ge=>ge.key===H),pe=G[H];(!se.validation||se.validation(pe))&&(!se.required||pe)&&Be(c.update)}}function we(c,G,H){return y().value&&c.type==="summary"&&(c.unscheduled=!1),ee.prepareEditTask(c,t.api.getState(),t.api.getTaskCalendar(c),G),H||(L.value=!1),c}function be(c){t.autoSave||Be(c.values,c.changes)}function $e(c){q.value=c.errors}function Be(c,G){delete c.links,delete c.data,(S.value.indexOf("duration")===-1||c.segments&&!c.duration)&&delete c.duration;const H={id:B().value,task:c};t.autoSave&&L.value&&(H.inProgress=L.value),t.api.exec("update-task",H),!t.autoSave&&!G?.length&&h()}const J=e.computed(()=>X().value?{"ctrl+z":c=>{c.preventDefault(),t.api.exec("undo")},"ctrl+y":c=>{c.preventDefault(),t.api.exec("redo")}}:{});function ae(c){N.value=c.value}return(c,G)=>C.value?(e.openBlock(),e.createBlock(e.unref(ue.Locale),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(Ce.Editor),{css:`wx-gantt-editor ${V.value} ${a.css}`,items:Y.value,values:C.value,topBar:ne.value,bottomBar:ce.value,placement:a.placement,layout:a.layout,readonly:a.readonly,autoSave:a.autoSave,focus:a.focus,activeBatch:N.value,onaction:ye,onsave:be,onvalidation:$e,onchange:ve,hotkeys:a.hotkeys&&{...J.value,...a.hotkeys}},null,8,["css","items","values","topBar","bottomBar","placement","layout","readonly","autoSave","focus","activeBatch","hotkeys"])]),_:1})):e.createCommentVNode("",!0)}}),ya=le(ka,[["__scopeId","data-v-311f463a"]]),ba={__name:"HeaderMenu",props:{columns:{default:null},api:{}},setup(a){const t=a,n=e.computed(()=>t.api?.getTable());return(o,l)=>(e.openBlock(),e.createBlock(e.unref(Le.HeaderMenu),{api:n.value,columns:a.columns},{default:e.withCtx(()=>[o.$slots.default?e.renderSlot(o.$slots,"default",{key:0}):e.createCommentVNode("",!0)]),_:3},8,["api","columns"]))}},xa={key:1,class:"wx-toggle-placeholder"},wa={class:"wx-name"},_a={key:1,class:"wx-avatar-name"},Ba=Object.assign({name:"GanttResourceNameCell"},{__name:"NameCell",props:{row:{},column:{}},setup(a){const t=a;function n(o,l){return`justify-content:${l.align};padding-left: ${(o.$level-1)*20}px`}return(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-content",style:e.normalizeStyle(n(t.row,t.column))},[t.row.data?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(`wx-toggle-icon wxi-menu-${t.row.open?"down":"right"}`),"data-action":"open-resource-row"},null,2)):(e.openBlock(),e.createElementBlock("i",xa)),e.createElementVNode("div",wa,[t.column._cell?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.column._cell),{key:0,row:t.row,column:t.column},null,8,["row","column"])):t.row.role?(e.openBlock(),e.createElementBlock("div",_a,[e.createVNode(e.unref(ue.Avatar),{value:t.row,size:28},null,8,["value"]),e.createElementVNode("span",null,e.toDisplayString(t.row.name),1)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.row.name),1)],64))])],4))}}),$a=le(Ba,[["__scopeId","data-v-7202a0f4"]]),Sa=["data-tooltip"],Ta={class:"wx-name"},Ea={key:1,class:"wx-avatar"},Ca={__name:"NameCellCompact",props:{row:{},column:{}},setup(a){const t=a;return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:"wx-content wx-compact","data-tooltip":t.row.name},[e.createElementVNode("div",Ta,[t.column._cell?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.column._cell),{key:0,row:t.row,column:t.column},null,8,["row","column"])):t.row.role?(e.openBlock(),e.createElementBlock("div",Ea,[e.createVNode(e.unref(ue.Avatar),{value:t.row,size:20},null,8,["value"])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(t.row.name),1)],64))])],8,Sa))}},Ia=le(Ca,[["__scopeId","data-v-a6e976d1"]]),Da=["data-resource-id"],Ra=Object.assign({name:"GanttResourceLoadCell"},{__name:"LoadCell",props:{row:{},column:{}},setup(a){const t=a;return(n,o)=>(e.openBlock(),e.createElementBlock("div",{"data-resource-id":e.unref(z.setID)(t.row.id)},e.toDisplayString(t.column.template(e.unref(Xe.getValue)(t.row,t.column))),9,Da))}}),La={class:"wx-layout"},Va={class:"wx-y-bar-clip"},Na=["onwheel"],za={__name:"ResourceLoad",props:{api:{},columns:{default:()=>ee.getResourceColumns()},mode:{default:"grid"},template:{}},setup(a){const t=a,n=e.ref(17);e.onMounted(()=>{n.value=Yt()});const o=e.computed(()=>t.api?.getReactiveState()),l=r.subscribeLater(()=>o.value?._resources),v=r.subscribeLater(()=>o.value?._scales),u=r.subscribeLater(()=>o.value?._resourceSort),m=r.subscribeLater(()=>o.value?.cellHeight),B=r.subscribeLater(()=>o.value?.columns),y=r.subscribeLater(()=>o.value?.scrollLeft),d=r.subscribeLater(()=>o.value?.gridWidth),x=r.subscribeLater(()=>o.value?.displayMode),I=r.subscribeLater(()=>o.value?._headerLength),T=r.subscribeLater(()=>o.value?.highlightTime),b=r.subscribeLater(()=>o.value?._columnsWidth),R=r.subscribeLater(()=>o.value?._gridCollapseThreshold),U=r.subscribeLater(()=>o.value?.cellBorders),X=r.subscribeLater(()=>o.value?.zoom),N=e.computed(()=>l().value??[]),V=e.computed(()=>v().value??null),j=e.computed(()=>u().value??null),O=e.computed(()=>m().value??0),E=e.computed(()=>B().value??[]),P=e.computed(()=>y().value??0),L=e.computed(()=>d().value??0),_=e.computed(()=>x().value??null),q=e.computed(()=>I().value??1),k=e.computed(()=>T().value??null),$=e.computed(()=>b().value??null),C=e.computed(()=>R().value??null),F=e.computed(()=>U().value??null),Y=e.computed(()=>X().value??null);let g=e.inject("wx-i18n",null);g||(g=z.locale({...Pe.en,...Ke.en}),e.provide("wx-i18n",g));const S=g.getGroup("gantt"),Z=e.ref(0),ne=e.ref(null),ce=e.ref(null),he=e.ref(0);let h,Q;const te=e.computed(()=>{if(!t.columns||!t.columns.length)return[];let K=ee.normalizeResourceColumns(t.columns).map(oe=>{oe={...oe};const fe=oe.header;if(typeof fe=="object"){const Se=fe.text&&S(fe.text);oe.header={...fe,text:Se}}else oe.header=S(fe);return oe.align=oe.align||"left",oe.editor=!1,oe});const M=K.findIndex(oe=>oe.id==="name");return M!==-1&&(K[M].cell&&(K[M]._cell=K[M].cell),K[M]={...K[M],header:_.value==="chart"?"":K[M].header,cell:_.value==="chart"?Ia:$a}),K.length>0&&(K[K.length-1].resize=!1),K}),ye=e.computed(()=>vt(N.value,j.value)),ve=e.ref(0),we=e.ref(0);e.watchEffect(()=>{let K;$.value?K=$.value:_.value==="chart"?K=C.value||0:K=L.value,we.value=K});const be=e.computed(()=>mt(te.value,_.value,"name")),$e=e.computed(()=>qt(V.value,Ra,t.template)),Be=e.computed(()=>ft(E.value,_.value,L.value)),J=e.computed(()=>(V.value?.width??0)>Z.value-ve.value),ae=e.computed(()=>{const K=N.value?.length*O.value,M=he.value-(J.value?n.value:0);return K>M}),c=e.computed(()=>we.value>ve.value+(ae.value?n.value:0));e.watchEffect(()=>{const K=P.value;Q?.exec("scroll-to",{left:K}),ce.value&&Math.abs(ce.value.scrollLeft-K)>1&&(ce.value.scrollLeft=K)});function G(K){const M=K.target.dataset.action;if(M==="open-resource-row"){K.preventDefault();const oe=z.locateID(K),fe=N.value.find(Se=>Se.id===oe);fe.data&&t.api.exec(M,{id:oe,mode:!fe.open})}}const H=e.ref([]);function f(K){h=K,h.on("select-row",M=>{H.value=[M.id]}),h.intercept("sort-rows",M=>{const{key:oe,add:fe}=M;let Se=j.value?j.value.find(Oe=>Oe.key===oe):null,ze="asc";return Se&&(ze=!Se||Se.order==="asc"?"desc":"asc"),t.api.exec("sort-resources",{key:oe,order:ze,add:fe,_columns:te.value}),!1}),h.intercept("resize-column",M=>{M.flexgrowFallback=pt(te.value,M.id)}),h.on("resize-column",()=>{we.value=Ye(h.getState().columns)}),h.on("scroll-to",M=>{M.top!==void 0&&!M.rSync&&Q?.exec("scroll-to",{top:M.top,rSync:!0})})}function se(K){Q=K,Q.on("select-row",M=>{H.value=[M.id]}),Q.on("scroll-to",M=>{M.left!==void 0&&Math.abs(M.left-P.value)>1&&t.api.exec("scroll-chart",{left:M.left}),M.top!==void 0&&!M.rSync&&h?.exec("scroll-to",{top:M.top,rSync:!0})})}function pe(K,M){const oe=Xe.getValue(K,M);if(oe)return oe.percent>100?" wx-overload":" wx-normal";if(M.unit!=="day"&&M.unit!=="hour")return"";const fe=t.api.getResourceCalendar(K);if(fe){if(!fe.isWorkingDay(M.date))return fe.css??"wx-weekend"}else if(k.value)return k.value(M.date,M.unit);return""}const ke=e.computed(()=>t.api&&kt(t.api,()=>Y.value,()=>ne.value)),ge=e.ref(null);let De;e.onMounted(()=>{ge.value&&(De=new ResizeObserver(()=>{Z.value=ge.value?.offsetWidth??0}),De.observe(ge.value),Z.value=ge.value.offsetWidth)}),e.onUnmounted(()=>{De?.disconnect()});const _e=e.ref(null);let Ie;e.onMounted(()=>{_e.value&&(Ie=new ResizeObserver(()=>{ve.value=_e.value?.clientWidth??0}),Ie.observe(_e.value),ve.value=_e.value.clientWidth)}),e.onUnmounted(()=>{Ie?.disconnect()});const Ee=e.ref(null);let Ne;return e.onMounted(()=>{Ee.value&&(Ne=new ResizeObserver(()=>{he.value=Ee.value?.clientHeight??0}),Ne.observe(Ee.value),he.value=Ee.value.clientHeight)}),e.onUnmounted(()=>{Ne?.disconnect()}),(K,M)=>t.api?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-resource-load",style:e.normalizeStyle(`--wx-scrollbar-width: ${n.value}px;`),ref_key:"containerDiv",ref:ge,"data-menu-ignore":"true"},[e.createElementVNode("div",La,[t.columns&&t.columns.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{class:e.normalizeClass(["wx-grid-container",{"wx-y-scroll":ae.value,"wx-h-scroll-reserve":J.value&&!c.value}]),style:e.normalizeStyle(`flex: 0 0 ${Be.value};`),ref_key:"gridContainerDiv",ref:_e},[e.createElementVNode("div",Va,[e.createElementVNode("div",{class:"wx-resource-grid",onClick:G},[e.createVNode(e.unref(Le.Grid),{init:f,sizes:{rowHeight:O.value,headerHeight:V.value.height/q.value},columnStyle:e.unref(gt),data:N.value,columns:be.value,sortMarks:ye.value,selectedRows:H.value},null,8,["sizes","columnStyle","data","columns","sortMarks","selectedRows"])])])],6),e.createVNode(yt,{containerWidth:Z.value,api:t.api},null,8,["containerWidth","api"])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"wx-chart",ref_key:"chartContainer",ref:ne,onwheel:ke.value},[e.createElementVNode("div",{class:e.normalizeClass(["wx-timescale-viewport",{"wx-v-scroll-reserve":ae.value}]),ref_key:"scalesDiv",ref:ce},[e.createVNode(ht,{api:t.api},null,8,["api"])],2),t.mode==="grid"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wx-grid-scale-container",ref_key:"rightContainerDiv",ref:Ee},[e.createVNode(e.unref(Le.Grid),{init:se,columns:$e.value,data:N.value,sizes:{rowHeight:O.value,headerHeight:0},selectedRows:H.value,rowStyle:()=>F.value==="column"?"wx-column-border":"",cellStyle:pe},null,8,["columns","data","sizes","selectedRows","rowStyle"])],512)):e.createCommentVNode("",!0)],8,Na)])],4)):e.createCommentVNode("",!0)}},Ma=le(za,[["__scopeId","data-v-6e54a028"]]),Wa=Object.assign({name:"GanttWidgetsTooltip"},{__name:"Tooltip",props:{api:{},at:{default:"point"},overflow:{default:!1},content:{},resolver:{type:Function}},setup(a){const t=a,n=e.computed(()=>t.resolver||o);function o(l,v){if(!t.api)return null;const u=z.getID(l,"data-task-id");if(u){const d=t.api.getTask(u);if(!d)return null;if(t.overflow){const I=l.querySelector(".wx-content");if(I&&I.scrollWidth<=I.clientWidth)return null}const x=z.locateID(v.target,"data-segment");return t.content?{api:t.api,data:{task:d,segmentIndex:x}}:x!==null?d.segments?.[x]?.text??"":d.text??""}const m=z.getID(l,"data-link-id");if(m){const x=t.api.getState().links.byId(m);return x&&t.content?{api:t.api,data:{link:x}}:null}const B=z.getID(l,"data-rollup-id");if(B){const d=t.api.getTask(B);return d?t.content?{api:t.api,data:{rollup:d}}:d.text??"":null}const y=z.getID(l,"data-resource-id");if(y){const d=t.api.getResource(y);return d?t.content?{api:t.api,data:{resource:d}}:d.name??"":null}return null}return(l,v)=>(e.openBlock(),e.createBlock(e.unref(ue.Tooltip),{at:a.at,content:a.content,resolver:n.value},{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},8,["at","content","resolver"]))}}),Ha=Object.assign({name:"GanttThemesWillow"},{__name:"Willow",props:{fonts:{type:Boolean,default:!0}},setup(a){const t=a;return(n,o)=>n.$slots.default?(e.openBlock(),e.createBlock(e.unref(ue.Willow),{key:0,fonts:t.fonts},{default:e.withCtx(()=>[e.createVNode(e.unref(Le.Willow),{fonts:t.fonts},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["fonts"])]),_:3},8,["fonts"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(Le.Willow),{fonts:t.fonts},null,8,["fonts"]),e.createVNode(e.unref(ue.Willow),{fonts:t.fonts},null,8,["fonts"])],64))}}),Aa=le(Ha,[["__scopeId","data-v-25fda217"]]),Oa=Object.assign({name:"GanttThemesWillowDark"},{__name:"WillowDark",props:{fonts:{type:Boolean,default:!0}},setup(a){const t=a;return(n,o)=>n.$slots.default?(e.openBlock(),e.createBlock(e.unref(ue.WillowDark),{key:0,fonts:t.fonts},{default:e.withCtx(()=>[e.createVNode(e.unref(Le.WillowDark),{fonts:t.fonts},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["fonts"])]),_:3},8,["fonts"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(Le.WillowDark),{fonts:t.fonts},null,8,["fonts"]),e.createVNode(e.unref(ue.WillowDark),{fonts:t.fonts},null,8,["fonts"])],64))}}),Fa=le(Oa,[["__scopeId","data-v-c9dbd5e1"]]),ja=_t.version;Object.defineProperty(exports,"defaultColumns",{enumerable:!0,get:()=>ee.defaultColumns});Object.defineProperty(exports,"defaultEditorItems",{enumerable:!0,get:()=>ee.defaultEditorItems});Object.defineProperty(exports,"defaultMenuOptions",{enumerable:!0,get:()=>ee.defaultMenuOptions});Object.defineProperty(exports,"defaultTaskTypes",{enumerable:!0,get:()=>ee.defaultTaskTypes});Object.defineProperty(exports,"defaultToolbarButtons",{enumerable:!0,get:()=>ee.defaultToolbarButtons});Object.defineProperty(exports,"getDefaultColumns",{enumerable:!0,get:()=>ee.getDefaultColumns});Object.defineProperty(exports,"getEditorButtons",{enumerable:!0,get:()=>ee.getEditorButtons});Object.defineProperty(exports,"getEditorItems",{enumerable:!0,get:()=>ee.getEditorItems});Object.defineProperty(exports,"getMenuOptions",{enumerable:!0,get:()=>ee.getMenuOptions});Object.defineProperty(exports,"getResourceColumns",{enumerable:!0,get:()=>ee.getResourceColumns});Object.defineProperty(exports,"getToolbarButtons",{enumerable:!0,get:()=>ee.getToolbarButtons});Object.defineProperty(exports,"registerScaleUnit",{enumerable:!0,get:()=>ee.registerScaleUnit});Object.defineProperty(exports,"registerEditorItem",{enumerable:!0,get:()=>Ce.registerEditorItem});exports.ContextMenu=Gn;exports.Editor=ya;exports.Gantt=On;exports.HeaderMenu=ba;exports.ResourceLoad=Ma;exports.Toolbar=Fn;exports.Tooltip=Wa;exports.Willow=Aa;exports.WillowDark=Fa;exports.version=ja;
|