@objectstack/console 16.0.0-rc.0 → 16.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.objectui-sha +1 -1
- package/dist/assets/{AdapterProvider-DaQhp5MR.js → AdapterProvider-DkXaFA1A.js} +1 -1
- package/dist/assets/{AiPendingActionsPage-9UZ4_qZW.js → AiPendingActionsPage-C1pkyzWu.js} +1 -1
- package/dist/assets/{ApiConsolePage-DVnQPvbh.js → ApiConsolePage-BCujjvCA.js} +1 -1
- package/dist/assets/{AppDocsIndex-RWbVdvGq.js → AppDocsIndex-DwtDfwnR.js} +1 -1
- package/dist/assets/{AppManagementPage-JlGIV3AH.js → AppManagementPage-KPrmIA-f.js} +1 -1
- package/dist/assets/ApprovalsInboxPage-DFQUv0F_.js +1 -0
- package/dist/assets/{AuditLogPage-C6SMCaHa.js → AuditLogPage-BNkFvefV.js} +1 -1
- package/dist/assets/{ComponentNavView-DpWz8z8w.js → ComponentNavView-FTFk3uvC.js} +1 -1
- package/dist/assets/{CreateViewDialog-DQqqIAwO.js → CreateViewDialog-DTzKynzF.js} +1 -1
- package/dist/assets/{DashboardView-BTS9ygDI.js → DashboardView-Y6nIjjJB.js} +1 -1
- package/dist/assets/{DeveloperHubPage-CX3urxAq.js → DeveloperHubPage-CYPM3AvL.js} +1 -1
- package/dist/assets/{DocShell-CXBgEZhg.js → DocShell-DnXj6ocC.js} +1 -1
- package/dist/assets/{ExpressionProvider-C26LCaQj.js → ExpressionProvider-BrbZIz2M.js} +1 -1
- package/dist/assets/{FlowRunsPage-DKnUh_Ec.js → FlowRunsPage-BAbmqrqx.js} +1 -1
- package/dist/assets/{IntegrationsPage-BvyX5vIh.js → IntegrationsPage-CyD9iolE.js} +1 -1
- package/dist/assets/InterfaceListPage-DdaX7c_c.js +1 -0
- package/dist/assets/ManagedByBadge-DbYycO1m.js +1 -0
- package/dist/assets/{MarketplaceAccessDenied-DFaKQ3Ws.js → MarketplaceAccessDenied-Csr3Jh7C.js} +1 -1
- package/dist/assets/{MarketplaceInstalledPage-CKmxuBaG.js → MarketplaceInstalledPage-BtD9NMRl.js} +1 -1
- package/dist/assets/{MarketplacePackagePage-BjhnLR61.js → MarketplacePackagePage-DHrjr3jY.js} +1 -1
- package/dist/assets/{MarketplacePage-BWLFbDxW.js → MarketplacePage-Dw2yHsdE.js} +1 -1
- package/dist/assets/{MetadataInspector-B9z7wtJS.js → MetadataInspector-C6pU5_lx.js} +1 -1
- package/dist/assets/{MetadataProvider-Dq7I7eh-.js → MetadataProvider-BnfG1pyl.js} +1 -1
- package/dist/assets/{ObjectDataPage-Bm9tSz-w.js → ObjectDataPage-BA93ldBf.js} +1 -1
- package/dist/assets/PageView-jtsz_IPE.js +1 -0
- package/dist/assets/{ProfilePage-DAkDEioN.js → ProfilePage-BhlwjGUP.js} +1 -1
- package/dist/assets/{PublicFormsPage-CRNSj35t.js → PublicFormsPage-D5kg7qJa.js} +1 -1
- package/dist/assets/RecordDetailView-F0k3QMTV.js +9 -0
- package/dist/assets/{RecordFormPage-Cye1lcxq.js → RecordFormPage-BRDfPdPg.js} +1 -1
- package/dist/assets/{ReportDefaultInspector-B0nTPIZ8.js → ReportDefaultInspector-CYCJDOVb.js} +1 -1
- package/dist/assets/{ReportView-BeL2GZLl.js → ReportView-Dtz9IJbH.js} +1 -1
- package/dist/assets/{SearchResultsPage-XP2cdAyq.js → SearchResultsPage-0pCQZ9_u.js} +1 -1
- package/dist/assets/{SettingsHub-yoHgXGvm.js → SettingsHub-DqS8nfs-.js} +1 -1
- package/dist/assets/{SettingsView-BO0qYMbW.js → SettingsView-DHrrHsbU.js} +1 -1
- package/dist/assets/{SystemHubPage-qOFiW2Jq.js → SystemHubPage-BWPXrnc9.js} +1 -1
- package/dist/assets/data-adapter-BR5P3Htq.js +9 -0
- package/dist/assets/framework-brxTxzwx.js +8 -0
- package/dist/assets/{getIcon-CBdepA3t.js → getIcon-EzAarNT8.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-CYfwZSTb.js → highlighted-body-OFNGDK62-3tGE6imP.js} +1 -1
- package/dist/assets/{i18n-grFi0A0v.js → i18n-CWIk44wT.js} +1 -1
- package/dist/assets/index-LuGaXtX0.js +2 -0
- package/dist/assets/infrastructure-C6pQBkbt.js +3 -0
- package/dist/assets/mermaid-GHXKKRXX-btdeklf1.js +1 -0
- package/dist/assets/{metadata-admin-D3yD8v_g.js → metadata-admin-Buf34qxl.js} +7 -7
- package/dist/assets/plugin-calendar-Bx_Bsdae.js +1 -0
- package/dist/assets/plugin-charts-DqND8tT3.js +7 -0
- package/dist/assets/plugin-chatbot-DwbSyUax.js +120 -0
- package/dist/assets/plugin-dashboard-D2VhHDxA.js +6 -0
- package/dist/assets/plugin-form-HMQsT2Tp.js +1 -0
- package/dist/assets/plugin-gantt-CMpG3oO4.js +63 -0
- package/dist/assets/plugin-grid-Dz4WW_sQ.js +8 -0
- package/dist/assets/plugin-kanban-fgScBnfP.js +1 -0
- package/dist/assets/{plugin-map-fMpIp7jh.js → plugin-map-zagD7Zuk.js} +1 -1
- package/dist/assets/{plugin-markdown-wZpqyjok.js → plugin-markdown-DtcSX8M_.js} +1 -1
- package/dist/assets/{plugin-report-kGtO0FOF.js → plugin-report-BRs6v5vb.js} +3 -3
- package/dist/assets/{plugin-timeline-DZNEy3Y1.js → plugin-timeline-Cl8J9HYj.js} +1 -1
- package/dist/assets/{plugin-tree-CZRX9ChE.js → plugin-tree-B3zTpUOf.js} +1 -1
- package/dist/assets/plugin-view-BDYhOlHx.js +1 -0
- package/dist/assets/plugins-views-Dc4ARhcP.js +4 -0
- package/dist/assets/{skeletons-CX6Ch5Lg.js → skeletons-CPF9cI6N.js} +1 -1
- package/dist/assets/{src-DNd8fJOE.js → src-A4S4Zx5p.js} +1 -1
- package/dist/assets/{src-CIr5NcaF.js → src-By-rFjBo.js} +1 -1
- package/dist/assets/src-CRFYUj2Z.js +19 -0
- package/dist/assets/{types-C0F-S2Id.js → types-CtGENai_.js} +1 -1
- package/dist/assets/ui-components-D1psd5qA.js +72 -0
- package/dist/assets/{ui-layout-CmmmekN3.js → ui-layout-UgL2qgLW.js} +1 -1
- package/dist/assets/{use-book-data-DyDHAzga.js → use-book-data-CWCLCSUn.js} +1 -1
- package/dist/assets/{useMetadata-BMHVJNxp.js → useMetadata-Byeqylbl.js} +1 -1
- package/dist/assets/vendor-objectstack-CjHQG7Oa.js +114 -0
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/ApprovalsInboxPage-DMfSM-B7.js +0 -1
- package/dist/assets/InterfaceListPage-D00ihpcS.js +0 -1
- package/dist/assets/ManagedByBadge-B4O4Jy3c.js +0 -1
- package/dist/assets/PageView-BTHYu8Z9.js +0 -1
- package/dist/assets/RecordDetailView-C6UiMORv.js +0 -9
- package/dist/assets/data-adapter-CS4onYGf.js +0 -9
- package/dist/assets/framework-Oi7uo_kE.js +0 -8
- package/dist/assets/index-D_-Sh_Rw.js +0 -2
- package/dist/assets/infrastructure-CQFJ5N6p.js +0 -3
- package/dist/assets/mermaid-GHXKKRXX-DtO0m-Vl.js +0 -1
- package/dist/assets/plugin-calendar-Bm0-Kkhu.js +0 -1
- package/dist/assets/plugin-charts-BHxVdXp7.js +0 -7
- package/dist/assets/plugin-chatbot-BRbgUPLw.js +0 -120
- package/dist/assets/plugin-dashboard-ARn_CaB3.js +0 -6
- package/dist/assets/plugin-form-C969LzWi.js +0 -1
- package/dist/assets/plugin-gantt-DrEbvyAE.js +0 -63
- package/dist/assets/plugin-grid-CnxMz-9O.js +0 -8
- package/dist/assets/plugin-kanban-C-mR5I0H.js +0 -1
- package/dist/assets/plugin-view-BhPeq9o5.js +0 -1
- package/dist/assets/plugins-views-DCG6qMPm.js +0 -4
- package/dist/assets/src-CB6vSDbd.js +0 -19
- package/dist/assets/ui-components-BluZyuZX.js +0 -72
- package/dist/assets/vendor-objectstack-DxPvmbmF.js +0 -114
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import{o as e,r as t}from"./rolldown-runtime-DAXXjFlN.js";import{r as n,y as r}from"./vendor-react-BKSb6vFP.js";import{B as i,Qt as a,Zt as o,en as s,jt as c,ot as l,tt as u}from"./framework-Oi7uo_kE.js";import{_ as d}from"./vendor-objectstack-DxPvmbmF.js";import{Ba as f,Br as p,Cr as m,Er as h,Gs as g,Ic as _,Ka as v,Ks as ee,L as te,Mc as y,Mr as b,Or as x,Pa as ne,Pc as re,Sr as ie,Tr as ae,Uc as S,Ws as oe,Yi as se,Yo as C,Yr as w,Zi as ce,a as T,as as E,ba as D,br as le,c as ue,h as de,i as fe,jc as pe,jr as me,l as he,m as ge,o as _e,p as ve,va as ye,wc as be,wr as xe,xr as Se,yr as Ce,zi as we}from"./ui-components-BluZyuZX.js";import{r as Te}from"./vendor-ui-utils-D-WJ115h.js";import{o as Ee,s as De}from"./plugins-views-DCG6qMPm.js";var O=e(r(),1),Oe=1e3*60*60*24,ke=e=>e.toISOString().slice(0,10);function k(e,t){if(t.skipWeekends){let t=e.getUTCDay();if(t===0||t===6)return!1}return!(t.holidays&&t.holidays.has(ke(e)))}function A(e){let t=new Date(e);return t.setUTCHours(0,0,0,0),t}function Ae(e,t){let n=A(e);for(;!k(n,t);)n=new Date(n.getTime()+Oe);return n.getTime()}function je(e,t,n){if(t<=e)return 0;let r=0,i=A(e),a=A(t).getTime();for(;i.getTime()<a;)k(i,n)&&r++,i=new Date(i.getTime()+Oe);return r}function Me(e,t,n){if(t<=0)return A(e).getTime();let r=A(e),i=t;for(;i>0;)k(r,n)&&i--,r=new Date(r.getTime()+Oe);return r.getTime()}function j(e,t,n){if(t<=0)return A(e).getTime();let r=A(e),i=t;for(;i>0;)r=new Date(r.getTime()-Oe),k(r,n)&&i--;return r.getTime()}var M=e=>String(e);function N(e){return e===`ss`||e===`ff`||e===`sf`?e:`fs`}function Ne(e){let t=new Set(e.map(e=>M(e.id))),n=[];for(let r of e){let e=M(r.id);for(let i of r.dependencies??[]){let r=typeof i==`object`&&!!i,a=r?i.id:i;if(a==null||a===``)continue;let o=M(a);o===e||!t.has(o)||n.push({pred:o,succ:e,type:N(r?i.type:void 0)})}}return n}function Pe(e){let t=new Set;for(let n of e)n.parent!=null&&n.parent!==``&&t.add(M(n.parent));return t}function Fe(e,t){let n=new Map,r=new Map;for(let t of e)n.set(t,0),r.set(t,[]);for(let e of t)r.get(e.pred).push(e.succ),n.set(e.succ,(n.get(e.succ)??0)+1);let i=e.filter(e=>(n.get(e)??0)===0),a=[];for(;i.length;){let e=i.shift();a.push(e);for(let t of r.get(e)??[]){let e=(n.get(t)??0)-1;n.set(t,e),e===0&&i.push(t)}}if(a.length<e.length){let t=new Set(a);for(let n of e)t.has(n)||a.push(n);return{order:a,hasCycle:!0}}return{order:a,hasCycle:!1}}function Ie(e,t){let n={criticalIds:new Set,criticalEdges:new Set};if(!e.length)return n;let r=new Map;for(let n of e){let e=t?je(n.start.getTime(),n.end.getTime(),t):(n.end.getTime()-n.start.getTime())/Oe;r.set(M(n.id),Number.isFinite(e)&&e>0?e:0)}let i=Ne(e),a=e.map(e=>M(e.id)),{order:o,hasCycle:s}=Fe(a,i);if(s)return n;let c=new Map,l=new Map;for(let e of a)c.set(e,[]),l.set(e,[]);for(let e of i)c.get(e.succ).push(e),l.get(e.pred).push(e);let u=new Map,d=new Map;for(let e of o){let t=0;for(let n of c.get(e)??[])t=Math.max(t,d.get(n.pred)??0);u.set(e,t),d.set(e,t+(r.get(e)??0))}let f=Math.max(0,...a.map(e=>d.get(e)??0)),p=new Map,m=new Map;for(let e=o.length-1;e>=0;e--){let t=o[e],n=l.get(t)??[],i=f;n.length&&(i=Math.min(...n.map(e=>m.get(e.succ)??f))),p.set(t,i),m.set(t,i-(r.get(t)??0))}let h=1e-6,g=new Set;for(let e of a){let t=(m.get(e)??0)-(u.get(e)??0);Math.abs(t)<=h&&g.add(e)}let _=new Set;for(let e of i)_.add(e.pred),_.add(e.succ);for(let e of[...g])!_.has(e)&&(r.get(e)??0)===0&&g.delete(e);let v=new Set;for(let e of i)!g.has(e.pred)||!g.has(e.succ)||Math.abs((d.get(e.pred)??0)-(u.get(e.succ)??0))<=h&&v.add(`${e.pred}->${e.succ}`);return{criticalIds:g,criticalEdges:v}}function Le(e,t,n){if(!e.length)return{changes:[],skippedLocked:[]};let r=Ne(e),i=e.map(e=>M(e.id)),{order:a,hasCycle:o}=Fe(i,r);if(o)return{changes:[],skippedLocked:[]};let s=Pe(e),c=new Map;for(let t of e)c.set(M(t.id),t);let l=new Map;for(let t of e){if(t.parent==null||t.parent===``)continue;let e=M(t.parent),n=l.get(e)??[];n.push(t),l.set(e,n)}let u=n?.summaryExtent===`self`,d=e=>u&&e.hasOwnDates!==!1&&!e.locked,f=new Map;for(let e of i)f.set(e,[]);for(let e of r)f.get(e.succ).push(e);let p=new Map,m=new Map;for(let t of e)p.set(M(t.id),t.start.getTime()),m.set(M(t.id),t.end.getTime());let h=[];for(let e of a){let r=c.get(e);if(!r)continue;let i=t?je(p.get(e),m.get(e),t):m.get(e)-p.get(e),a=r.start.getTime(),o=a;for(let n of f.get(e)??[]){let e=p.get(n.pred),r=m.get(n.pred),a;switch(n.type){case`ss`:a=e;break;case`ff`:a=t?j(r,i,t):r-i;break;case`sf`:a=t?j(e,i,t):e-i;break;default:a=r;break}a>o&&(o=a)}let l=o>a;if(!(s.has(e)&&!d(r))){if(r.locked){l&&h.push(e);continue}if(l&&!t&&n?.snapStart&&(o=Math.max(o,n.snapStart(o))),t){let n=Ae(o,t);p.set(e,n),m.set(e,Me(n,i,t))}else p.set(e,o),m.set(e,o+i)}}if(u)for(let t of e){let e=M(t.id);if(!s.has(e)||!d(t))continue;let n=p.get(e)-t.start.getTime();if(n<=0)continue;let r=[...l.get(e)??[]];for(;r.length;){let e=r.pop(),t=M(e.id);if(r.push(...l.get(t)??[]),e.locked)continue;let i=e.start.getTime()+n;if(i>p.get(t)){let e=m.get(t)-p.get(t);p.set(t,i),m.set(t,i+e)}}}let g=[];for(let t of e){let e=M(t.id),n=p.get(e),r=m.get(e);(n!==t.start.getTime()||r!==t.end.getTime())&&g.push({id:e,start:new Date(n),end:new Date(r)})}return{changes:g,skippedLocked:h}}function Re(e,t,n){let r=String(t),i=String(n);if(r===i)return!0;let a=new Map;for(let[t,n]of e){let e=a.get(t);e?e.push(n):a.set(t,[n])}let o=new Set([i]),s=[i];for(;s.length;){let e=s.pop();for(let t of a.get(e)??[]){if(t===r)return!0;o.has(t)||(o.add(t),s.push(t))}}return!1}var ze=6e4;1440*ze;var P=1440;function Be(e){if(typeof e!=`string`)return null;let t=/^(\d{1,2}):(\d{2})$/.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=Number(t[2]);return n<0||n>23||r<0||r>59?null:n*60+r}function F(e){if(!e||!Array.isArray(e.bands)||e.bands.length===0)return null;let t=Be(e.dayStart)??0,n=[];for(let t=0;t<e.bands.length;t++){let r=e.bands[t],i=Be(r.start),a=Be(r.end);if(i==null||a==null||!r.label)return null;let o=(a-i+P)%P||P;n.push({key:r.key??`band${t}`,label:r.label,color:r.color,durMs:o*ze})}return{dayStartMin:t,bands:n,showMidnight:e.showMidnight!==!1}}function Ve(e,t){let n=new Date(e);return n.setHours(0,0,0,0),n.setMinutes(t),n.getTime()>e.getTime()&&n.setDate(n.getDate()-1),n}function He(e,t){if(t.bands.length===0)return null;let n=Ve(e,t.dayStartMin).getTime(),r=e.getTime()-n,i=0;for(let e of t.bands)if(i+=e.durMs,r<i)return e;return t.bands[t.bands.length-1]}var Ue={"gantt.column.taskName":`Task Name`,"gantt.column.start":`Start`,"gantt.column.end":`End`,"gantt.toolbar.prevPeriod":`Previous period`,"gantt.toolbar.nextPeriod":`Next period`,"gantt.toolbar.zoomIn":`Zoom in`,"gantt.toolbar.zoomOut":`Zoom out`,"gantt.toolbar.jumpToToday":`Jump to today`,"gantt.toolbar.today":`Today`,"gantt.toolbar.thisWeek":`This week`,"gantt.toolbar.thisMonth":`This month`,"gantt.toolbar.exportPdf":`Export PDF`,"gantt.toolbar.saveLayout":`Save layout`,"gantt.toolbar.showTaskList":`Show task list`,"gantt.toolbar.hideTaskList":`Hide task list`,"gantt.toolbar.viewMode":`Timeline granularity`,"gantt.toolbar.enterFullscreen":`Enter fullscreen`,"gantt.toolbar.exitFullscreen":`Exit fullscreen`,"gantt.toolbar.criticalPath":`Highlight critical path`,"gantt.toolbar.autoSchedule":`Auto-schedule dependencies`,"gantt.toolbar.exportPng":`Export as PNG`,"gantt.toolbar.refresh":`Refresh`,"gantt.toolbar.undo":`Undo`,"gantt.toolbar.redo":`Redo`,"gantt.viewMode.day":`Day`,"gantt.viewMode.week":`Week`,"gantt.viewMode.month":`Month`,"gantt.viewMode.quarter":`Quarter`,"gantt.viewMode.year":`Year`,"gantt.row.expand":`Expand`,"gantt.row.collapse":`Collapse`,"gantt.row.open":`Open details`,"gantt.aria.taskList":`Task list`,"gantt.tooltip.days":`d`,"gantt.menu.view":`View details`,"gantt.menu.edit":`Edit inline`,"gantt.menu.delete":`Delete`,"gantt.menu.addPredecessor":`Add predecessor…`,"gantt.menu.addSuccessor":`Add successor…`,"gantt.menu.removeDependency":`Remove dependency`,"gantt.menu.noCandidates":`No available tasks`,"gantt.menu.searchTasks":`Search tasks…`,"gantt.delete.title":`Delete this task?`,"gantt.delete.body":`"{{title}}" will be permanently removed. This action cannot be undone.`,"gantt.delete.cancel":`Cancel`,"gantt.delete.confirm":`Delete`,"gantt.delete.deleting":`Deleting…`,"gantt.drawer.fallbackTitle":`Task Details`,"gantt.linkType.fs":`Finish → Start`,"gantt.linkType.ss":`Start → Start`,"gantt.linkType.ff":`Finish → Finish`,"gantt.linkType.sf":`Start → Finish`,"gantt.linkEnd.start":`start`,"gantt.linkEnd.end":`end`,"gantt.conflict.title":`Schedule conflict`,"gantt.conflict.body":`This move conflicts with dependency constraints. Auto-reschedule {count} affected task(s)?`,"gantt.conflict.confirm":`Auto-reschedule`,"gantt.conflict.cancel":`Keep as is`,"gantt.autoScheduleDlg.title":`Auto-schedule`,"gantt.autoScheduleDlg.body":`Shift {count} task(s) later to satisfy dependency links?`,"gantt.autoScheduleDlg.skipped":`{count} locked task(s) also violate links and were skipped.`,"gantt.autoScheduleDlg.confirm":`Apply`,"gantt.autoScheduleDlg.cancel":`Cancel`,"gantt.autoScheduleDlg.none":`All dependencies satisfied — nothing to reschedule.`,"gantt.resource.header":`Resource`,"gantt.resource.peak":`Peak`,"gantt.resource.over":`overloaded`,"gantt.resource.empty":`No tasks to allocate.`,"gantt.readOnly":`Read-only`,"gantt.readOnlyHint":`Editing is disabled for this view.`,"gantt.lockedHint":`No edit permission`,"gantt.writeFailed":`Save failed — the change was rolled back`};function We(e,t){let n=Ue[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n}function Ge(){try{let e=S();return{t:(t,n)=>{let r=e.t(t,n);return typeof r==`string`&&r!==t?r:We(t,n)},language:e.language}}catch{return{t:We,language:void 0}}}var I=n(),L=8;function Ke(e,t){if(t.width<=0)return`move`;let n=Math.min(L,t.width/3),r=e-t.left;return r<=n?`resize-left`:r>=t.width-n?`resize-right`:`move`}function qe(e){return 110}function Je(e){return e<640?140:e<1024?220:320}function Ye(e){return e>=280}function Xe(e){return e<640?32:40}var Ze=[`day`,`week`,`month`,`quarter`,`year`],Qe={day:1,week:7,month:30.44,quarter:91.31,year:365.25},$e=1e3*60*60*24;function et(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour12:!1,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),r=e=>Number(n.formatToParts(t).find(t=>t.type===e)?.value??0);return Date.UTC(r(`year`),r(`month`)-1,r(`day`),r(`hour`)%24,r(`minute`),r(`second`))-Math.floor(t.getTime()/1e3)*1e3}function tt(e){let t={delta:0,to:e=>e,from:e=>e,now:()=>new Date};if(!e)return t;try{et(e,new Date)}catch{return console.warn(`[GanttView] invalid timeZone "${e}" — falling back to the browser zone`),t}let n=t=>et(e,t)- -t.getTimezoneOffset()*6e4,r=n(new Date);return r===0?t:{delta:r,to:e=>new Date(e.getTime()+n(e)),from:e=>new Date(e.getTime()-n(e)),now:()=>new Date(Date.now()+n(new Date))}}function nt(e,t){let n=new Date(e);return n.setHours(0,0,0,0),t===`week`?n.setDate(n.getDate()-(n.getDay()+6)%7):t===`month`?n.setDate(1):t===`quarter`?n.setMonth(Math.floor(n.getMonth()/3)*3,1):t===`year`&&n.setMonth(0,1),n}function rt(e,t,n){let r=e.length-1,i=0;for(;i<r&&e[i+1]<t;)i++;let a=i;for(;a<r&&e[a]<n;)a++;return{start:i,end:a}}function it(e,t,n){let r=new Date(e);if(n===`day`)r.setDate(r.getDate()+t);else if(n===`week`)r.setDate(r.getDate()+t*7);else{let e=t*(n===`month`?1:n===`quarter`?3:12),i=r.getDate();r.setDate(1),r.setMonth(r.getMonth()+e);let a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();r.setDate(Math.min(i,a))}return r}function at(e,t,n,r=2){return new Promise(i=>{let a=new Blob([e],{type:`image/svg+xml;charset=utf-8`}),o=URL.createObjectURL(a),s=new Image;s.onload=()=>{let e=document.createElement(`canvas`);e.width=t*r,e.height=n*r;let a=e.getContext(`2d`);a&&(a.fillStyle=`#ffffff`,a.fillRect(0,0,e.width,e.height),a.scale(r,r),a.drawImage(s,0,0)),URL.revokeObjectURL(o),i(e)},s.onerror=()=>{URL.revokeObjectURL(o),i(null)},s.src=o})}function ot(e,t){let n=document.createElement(`a`);n.href=URL.createObjectURL(e),n.download=t,document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(n.href),1e3)}function st(e,t,n){let r=e=>{let t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n)&255;return t},i=`q ${t} 0 0 ${n} 0 0 cm /Im0 Do Q`,a=[],o=[],s=0,c=e=>{a.push(e),s+=e.length},l=()=>{o.push(s)};c(r(`%PDF-1.3
|
|
2
|
-
%ÿÿÿÿ
|
|
3
|
-
`)),l(),c(r(`1 0 obj
|
|
4
|
-
<< /Type /Catalog /Pages 2 0 R >>
|
|
5
|
-
endobj
|
|
6
|
-
`)),l(),c(r(`2 0 obj
|
|
7
|
-
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
|
|
8
|
-
endobj
|
|
9
|
-
`)),l(),c(r(`3 0 obj\n<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${t} ${n}] /Resources << /XObject << /Im0 4 0 R >> >> /Contents 5 0 R >>\nendobj\n`)),l(),c(r(`4 0 obj\n<< /Type /XObject /Subtype /Image /Width ${t} /Height ${n} /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length ${e.length} >>\nstream\n`)),c(e),c(r(`
|
|
10
|
-
endstream
|
|
11
|
-
endobj
|
|
12
|
-
`)),l(),c(r(`5 0 obj\n<< /Length ${i.length} >>\nstream\n${i}\nendstream\nendobj\n`));let u=s,d=`xref
|
|
13
|
-
0 6
|
|
14
|
-
0000000000 65535 f
|
|
15
|
-
`;for(let e of o)d+=`${String(e).padStart(10,`0`)} 00000 n \n`;return d+=`trailer\n<< /Size 6 /Root 1 0 R >>\nstartxref\n${u}\n%%EOF\n`,c(r(d)),new Blob(a,{type:`application/pdf`})}function ct(e){let t=e.slice(e.indexOf(`,`)+1),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}var R=`gantt-layout:`;function lt(e){if(!e||typeof window>`u`)return null;try{let t=window.localStorage.getItem(R+e);if(!t)return null;let n=JSON.parse(t),r=n.viewMode&&Ze.includes(n.viewMode)?n.viewMode:null;if(!r)return null;let i=typeof n.columnWidth==`number`&&isFinite(n.columnWidth)?n.columnWidth:null,a=typeof n.taskListWidth==`number`&&isFinite(n.taskListWidth)?n.taskListWidth:null,o=Array.isArray(n.collapsedIds)?n.collapsedIds.filter(e=>typeof e==`string`):void 0;return{viewMode:r,columnWidth:i,taskListCollapsed:!!n.taskListCollapsed,taskListWidth:a,collapsedIds:o}}catch{return null}}function ut(e,t){if(!(typeof window>`u`))try{window.localStorage.setItem(R+e,JSON.stringify(t))}catch{}}function dt({tasks:e,viewMode:t,startDate:n,endDate:r,markers:i,onTaskClick:a,onTaskUpdate:o,onTaskDelete:s,onViewChange:c,onDependencyCreate:l,onBeforeDependencyCreate:u,onDependencyDelete:d,onTaskReorder:m,className:h,inlineEdit:_=!1,autoSchedule:re=!1,rescheduleOnConflict:ie=!1,criticalPathDefault:ae=!1,workingCalendar:S,shiftSegments:T,showBaselines:le=!0,readOnly:ue=!1,mobileReadOnly:de=!1,groupBy:fe,ungroupedLabel:he=`Ungrouped`,defaultCollapsedDepth:ge,summaryExtent:_e=`children`,persistLayoutKey:ve,onLayoutChange:xe,onRefresh:Se,refreshing:Ce=!1,dependencyTypes:Te=!0,timeZone:Ee,exportFileName:De,interactions:Oe,onBeforeTaskUpdate:ke}){let k=O.useMemo(()=>tt(Ee),[Ee]),A=O.useMemo(()=>k.delta===0?e:e.map(e=>({...e,start:k.to(e.start),end:k.to(e.end),baselineStart:e.baselineStart?k.to(e.baselineStart):e.baselineStart,baselineEnd:e.baselineEnd?k.to(e.baselineEnd):e.baselineEnd})),[e,k]),Ae=O.useMemo(()=>n&&k.delta!==0?k.to(n):n,[n,k]),je=O.useMemo(()=>r&&k.delta!==0?k.to(r):r,[r,k]),Me=O.useMemo(()=>!i||k.delta===0?i:i.map(e=>({...e,date:k.to(new Date(e.date))})),[i,k]),{t:j,language:M}=Ge(),N=M||void 0,[Ne,Pe]=O.useState(()=>k.now()),Fe=O.useRef(null),{width:ze}=te(Fe),P=ze||(typeof window<`u`?window.innerWidth:1024),Be=P<640,F=ue||de&&Be,He=Oe?.move!==!1,Ue=Oe?.resize!==!1,We=Oe?.progress!==!1,et=Oe?.link!==!1,R=O.useMemo(()=>{if(!(F||!o))return k.delta===0?o:(e,t)=>{let n={...t};n.start instanceof Date&&(n.start=k.from(n.start)),n.end instanceof Date&&(n.end=k.from(n.end)),o(e,n)}},[F,o,k]),dt=F?void 0:s,z=F||!et?void 0:l,ft=F||!et?void 0:d,pt=F?void 0:m,mt=!F&&_,ht=!F&&re,gt=!F&&ie,B=Xe(P),_t=qe(P),vt=O.useRef(void 0);vt.current===void 0&&(vt.current=lt(ve));let yt=vt.current,[bt,xt]=O.useState(yt?yt.columnWidth:null),[St,Ct]=O.useState(yt?yt.taskListWidth??null:null),[V,wt]=O.useState(t&&Ze.includes(t)?t:yt?.viewMode??`day`);O.useEffect(()=>{t&&Ze.includes(t)&&wt(t)},[t]);let Tt=O.useRef(null),Et=O.useRef(null),Dt=O.useRef(!0),[Ot,kt]=O.useState(yt?yt.taskListCollapsed:!1),At=O.useRef(!1);O.useEffect(()=>{!At.current&&Be&&(kt(!0),At.current=!0)},[Be]);let jt=Math.max(160,P-200),H=Ot?0:St==null?Je(P):Math.max(160,Math.min(St,jt)),Mt=O.useMemo(()=>{if(bt!=null||je||A.length===0)return null;let e=Ae?new Date(Ae):new Date(Math.min(...A.map(e=>e.start.getTime()))),t=new Date(Math.max(...A.map(e=>e.end.getTime())));Ae||e.setDate(e.getDate()-7),t.setDate(t.getDate()+14),e=nt(e,V),t.setHours(23,59,59,999);let n=Math.max(1,(t.getTime()-e.getTime())/$e),r=Math.max(0,P-H);if(r<=0)return null;let i=r/n*Qe[V];if(i<=_t)return null;let a=Math.min(i,r*.6);return a>_t?a:null},[bt,A,Ae,je,V,P,H,_t]),Nt=bt??Mt??_t,Pt=Nt/Qe[V],Ft=Ye(H),[It,Lt]=O.useState(null),[Rt,zt]=O.useState({}),[Bt,Vt]=O.useState(null),U=O.useMemo(()=>{if(!fe)return A;let e=new Set;for(let t of A){let n=t.parent!=null&&t.parent!==``?String(t.parent):null;n&&e.add(n)}let t=new Map;for(let n of A){if(e.has(String(n.id)))continue;let r=fe(n),i=r?String(r.key):`__ungrouped__`,a=r?r.label:he,o=t.get(i);o||(o={key:i,label:a,items:[]},t.set(i,o)),o.items.push(n)}let n=[];for(let e of t.values()){let t=`__group__${e.key}`,r=e.items[0];n.push({id:t,title:e.label,start:r.start,end:r.end,progress:0,type:`summary`,parent:null,data:{__group:!0}});for(let r of e.items)n.push({...r,parent:t})}return n},[fe,A,he]),Ht=O.useMemo(()=>{let e=new Set(U.map(e=>String(e.id))),t=new Map;for(let n of U){let r=n.parent!=null&&n.parent!==``?String(n.parent):null;if(r&&r!==String(n.id)&&e.has(r)){let e=t.get(r);e?e.push(n):t.set(r,[n])}}return t},[U]),Ut=O.useMemo(()=>{let e=new Map;for(let t of U)e.set(String(t.id),t);return e},[U]),Wt=O.useCallback(e=>{let t=[],n=new Set,r=e=>{for(let i of Ht.get(e)??[]){let e=String(i.id);n.has(e)||(n.add(e),t.push(i),r(e))}};return r(String(e)),t},[Ht]),[W,Gt]=O.useState(null),Kt=O.useRef(null);O.useEffect(()=>{Kt.current=W},[W]);let qt=O.useRef(!1),Jt=O.useCallback(e=>{let t=V===`day`&&T&&T.bands.length>0&&T?Math.min(...T.bands.map(e=>e.durMs)):$e,n=(e,t)=>Qn.current?Qn.current(e,t):it(e,t,`day`),r=new Date(e.originStart),i=new Date(e.originEnd);return e.mode===`move`?(r=n(e.originStart,e.unitDelta),i=new Date(e.originEnd.getTime()+(r.getTime()-e.originStart.getTime()))):e.mode===`resize-left`?(r=n(e.originStart,e.unitDelta),i.getTime()-r.getTime()<t&&(r=new Date(i.getTime()-t))):e.mode===`resize-right`&&(i=n(e.originEnd,e.unitDelta),i.getTime()-r.getTime()<t&&(i=new Date(r.getTime()+t))),{start:r,end:i}},[V,T]),Yt=O.useRef(A);Yt.current=A;let Xt=O.useRef([]),Zt=O.useRef([]),[Qt,$t]=O.useState(0),en=O.useCallback(e=>{if(!R)return;let t=e.filter(e=>!e.task.locked);(async()=>{let e=t;if(ke){let n=[];for(let e of t){let t=!0;try{t=await ke(e.task,e.changes)!==!1}catch{t=!1}t&&n.push(e)}e=n}let n=[];for(let{task:t,changes:r}of e){let e={},i={},a=!1;for(let n of Object.keys(r)){let o=r[n],s=t[n],c=o instanceof Date&&s instanceof Date?o.getTime()===s.getTime():o===s;e[n]=s,i[n]=o,c||(a=!0)}R(t,r),a&&n.push({taskId:String(t.id),before:e,after:i})}n.length&&(Xt.current.push(n),Zt.current=[],$t(e=>e+1))})()},[R,ke]),[tn,nn]=O.useState(null),rn=O.useCallback(e=>{if(!T)return e;let t=new Date(e);t.setHours(0,0,0,0);for(let n=-1;n<=1;n++){let r=t.getTime()+n*$e+T.dayStartMin*6e4;for(let t of T.bands){if(r>=e)return r;r+=t.durMs}}return e},[T]),an=O.useMemo(()=>({summaryExtent:_e,snapStart:T?rn:void 0}),[_e,T,rn]),on=O.useCallback(e=>{if(!gt)return;let t=new Map;for(let{task:n,changes:r}of e)t.set(String(n.id),{start:r.start??n.start,end:r.end??n.end});let{changes:n}=Le(Yt.current.map(e=>{let n=t.get(String(e.id));return n?{...e,start:n.start,end:n.end}:e}),S,an),r=n.filter(e=>{let n=t.get(e.id);return!n||e.start.getTime()!==n.start.getTime()||e.end.getTime()!==n.end.getTime()});r.length&&nn(r)},[gt,S,an]),sn=O.useCallback(()=>{if(!tn)return;let e=tn.map(e=>{let t=Yt.current.find(t=>String(t.id)===e.id);return t?{task:t,changes:{start:e.start,end:e.end}}:null}).filter(Boolean);e.length&&en(e),nn(null)},[tn,en]),cn=O.useCallback((e,t)=>{if(R)for(let n of e){let e=Yt.current.find(e=>String(e.id)===n.taskId);e&&R(e,t===`undo`?n.before:n.after)}},[R]),ln=O.useCallback(()=>{let e=Xt.current.pop();e&&(cn(e,`undo`),Zt.current.push(e),$t(e=>e+1))},[cn]),un=O.useCallback(()=>{let e=Zt.current.pop();e&&(cn(e,`redo`),Xt.current.push(e),$t(e=>e+1))},[cn]),{canUndo:dn,canRedo:fn}=O.useMemo(()=>({canUndo:Xt.current.length>0,canRedo:Zt.current.length>0}),[Qt]);O.useEffect(()=>{if(!W)return;let e=V===`day`&&T&&T.bands.length>0&&T?Pt*Math.min(...T.bands.map(e=>e.durMs))/$e:Pt,t=t=>{let n=Kt.current;if(!n)return;let r=Math.round((t.clientX-n.originClientX)/Math.max(e,1));r!==n.unitDelta&&Gt({...n,unitDelta:r})},n=()=>{let e=Kt.current;if(e){if(e.unitDelta!==0){let t=A.find(t=>t.id===e.taskId);if(t&&R){let{start:n,end:r}=Jt(e);if(e.group){let r=n.getTime()-e.originStart.getTime(),i=[t,...Wt(t.id).filter(e=>!e.locked)].map(e=>({task:e,changes:{start:new Date(e.start.getTime()+r),end:new Date(e.end.getTime()+r)}}));en(i),on(i)}else{let e=[{task:t,changes:{start:n,end:r}}];en(e),on(e)}}qt.current=!0,window.setTimeout(()=>{qt.current=!1},0)}Gt(null)}};return window.addEventListener(`pointermove`,t),window.addEventListener(`pointerup`,n),window.addEventListener(`pointercancel`,n),()=>{window.removeEventListener(`pointermove`,t),window.removeEventListener(`pointerup`,n),window.removeEventListener(`pointercancel`,n)}},[W,Nt,Pt,V,T,A,R,Jt,Wt,en,on]);let pn=O.useCallback((e,t,n,r)=>{!R||e.data?.__group||e.locked||(n.stopPropagation(),n.preventDefault(),Gt({taskId:e.id,mode:t,group:r?.group??!1,originStart:new Date(r?.originStart??e.start),originEnd:new Date(r?.originEnd??e.end),originClientX:n.clientX,unitDelta:0}))},[R]),[mn,hn]=O.useState(null),gn=O.useRef(null);O.useEffect(()=>{gn.current=mn},[mn]),O.useEffect(()=>{if(!mn)return;let e=e=>{let t=gn.current;if(!t)return;let n=Math.min(100,Math.max(0,Math.round(t.originProgress+(e.clientX-t.originClientX)/Math.max(t.barWidth,1)*100)));n!==t.value&&hn({...t,value:n})},t=()=>{let e=gn.current;if(e){if(e.value!==e.originProgress){let t=A.find(t=>t.id===e.taskId);t&&R&&en([{task:t,changes:{progress:e.value}}]),qt.current=!0,window.setTimeout(()=>{qt.current=!1},0)}hn(null)}};return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[mn,A,R,en]);let _n=O.useMemo(()=>{let e=[];for(let t of A)for(let n of t.dependencies??[]){let r=typeof n==`object`&&n?n.id:n;r==null||r===``||e.push([String(r),String(t.id)])}return e},[A]),vn=O.useCallback((e,t)=>String(t.id)!==String(e)&&!t.locked&&t.type!==`group`&&!Re(_n,e,t.id),[_n]),yn=O.useRef(null),[G,bn]=O.useState(null),xn=O.useRef(null);O.useEffect(()=>{xn.current=G},[G]),O.useEffect(()=>{if(!G)return;let e=e=>{let t=yn.current?.getBoundingClientRect();if(!t)return;let n=e.clientX-t.left,r=e.clientY-t.top;bn(e=>e&&{...e,x:n,y:r})},t=()=>{let e=xn.current;if(e&&e.targetId!=null&&z){let t=A.find(t=>String(t.id)===String(e.sourceId)),n=A.find(t=>String(t.id)===String(e.targetId)),r=e.targetEnd??`start`,i=Te?`${e.sourceEnd===`end`?`f`:`s`}${r===`end`?`f`:`s`}`:`fs`;t&&n&&vn(e.sourceId,n)&&(u?.(t,n,i)??!0)&&z(t,n,i)}qt.current=!0,window.setTimeout(()=>{qt.current=!1},0),bn(null)};return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[G,A,z,u,vn,Te]);let[Sn,Cn]=O.useState(null),wn=O.useRef(null);O.useEffect(()=>{if(!Sn)return;let e=e=>{wn.current&&e.target instanceof Node&&wn.current.contains(e.target)||Cn(null)},t=e=>{e.key===`Escape`&&Cn(null)};return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`keydown`,t)}},[Sn]);let[Tn,En]=O.useState(null),Dn=O.useRef(null);O.useEffect(()=>{if(!Tn)return;let e=e=>{Dn.current&&e.target instanceof Node&&Dn.current.contains(e.target)||En(null)},t=e=>{e.key===`Escape`&&En(null)};return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`keydown`,t)}},[Tn]);let[On,kn]=O.useState(null),[An,jn]=O.useState(``),Mn=O.useRef(null);O.useEffect(()=>{if(!On)return;let e=e=>{Mn.current&&e.target instanceof Node&&Mn.current.contains(e.target)||kn(null)},t=e=>{e.key===`Escape`&&kn(null)};return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`keydown`,t)}},[On]);let[Nn,Pn]=O.useState(null),Fn=!!(a||R||z||dt),In=O.useCallback((e,t)=>{t.preventDefault(),t.stopPropagation(),Pn(e.id),Fn&&Cn({x:t.clientX,y:t.clientY,taskId:e.id})},[Fn]),Ln=O.useCallback((e,t,n,r)=>{r.preventDefault(),r.stopPropagation(),!(!z&&!ft)&&En({x:r.clientX,y:r.clientY,sourceId:e,targetId:t,type:n})},[z,ft]),[Rn,zn]=O.useState(()=>new Set(yt?.collapsedIds??[])),Bn=O.useCallback(e=>{zn(t=>{let n=new Set(t),r=String(e);return n.has(r)?n.delete(r):n.add(r),n})},[]),Vn=O.useRef(yt?.collapsedIds!=null);O.useEffect(()=>{if(Vn.current||ge==null||U.length===0)return;Vn.current=!0;let e=new Map(U.map(e=>[String(e.id),e])),t=new Set;for(let n of U){let r=n.parent!=null&&n.parent!==``?String(n.parent):null;r&&r!==String(n.id)&&e.has(r)&&t.add(r)}let n=t=>{let n=0,r=new Set([String(t.id)]),i=t.parent!=null&&t.parent!==``?e.get(String(t.parent)):void 0;for(;i&&!r.has(String(i.id));)n+=1,r.add(String(i.id)),i=i.parent!=null&&i.parent!==``?e.get(String(i.parent)):void 0;return n},r=new Set;for(let e of U){let i=String(e.id);t.has(i)&&n(e)>=ge&&r.add(i)}r.size&&zn(e=>e.size?e:r)},[ge,U]);let K=O.useMemo(()=>{let e=new Set(U.map(e=>String(e.id))),t=new Map,n=[];for(let r of U){let i=r.parent!=null&&r.parent!==``?String(r.parent):null;if(i&&i!==String(r.id)&&e.has(i)){let e=t.get(i);e?e.push(r):t.set(i,[r])}else n.push(r)}let r=new Map,i=(e,n)=>{let a=String(e.id),o=r.get(a);if(o)return o;let s=t.get(a)??[],c;if(!s.length||n.has(a))c={start:e.start,end:e.end,progress:e.progress};else{n.add(a);let e=null,t=null,r=0,o=0;for(let a of s){let s=i(a,n);(!e||s.start<e)&&(e=s.start),(!t||s.end>t)&&(t=s.end);let c=Math.max(s.end.getTime()-s.start.getTime(),$e);r+=c*s.progress,o+=c}n.delete(a),c={start:e,end:t,progress:o?r/o:0}}return r.set(a,c),c},a=[],o=new Set,s=e=>{for(let n of t.get(String(e.id))??[])o.has(String(n.id))||(o.add(String(n.id)),s(n))},c=(e,n)=>{let r=String(e.id);if(o.has(r))return;o.add(r);let l=t.get(r)??[],u=l.length>0,d=u||e.type===`summary`,f=u&&_e===`self`&&e.hasOwnDates!==!1,p=u&&!f?i(e,new Set):{start:e.start,end:e.end,progress:e.progress},m=!d&&(e.type===`milestone`||e.end.getTime()<=e.start.getTime());if(a.push({task:e,depth:n,hasChildren:u,isSummary:d,isMilestone:m,...p}),u)if(Rn.has(r))s(e);else for(let e of l)c(e,n+1)};for(let e of n)c(e,0);for(let e of U)o.has(String(e.id))||c(e,0);return a},[U,Rn,_e]),Hn=O.useCallback(e=>{if(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement)return;if((e.ctrlKey||e.metaKey)&&(e.key===`z`||e.key===`Z`)){e.preventDefault(),e.shiftKey?un():ln();return}if((e.ctrlKey||e.metaKey)&&(e.key===`y`||e.key===`Y`)){e.preventDefault(),un();return}if(!K.length)return;let t=Nn==null?-1:K.findIndex(e=>String(e.task.id)===String(Nn));if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let n=e.key===`ArrowDown`?Math.min(K.length-1,t+1):Math.max(0,t<=0?0:t-1);Pn(K[n].task.id);let r=Z.current;if(r){let e=n*B;e<r.scrollTop?r.scrollTop=e:e+B>r.scrollTop+r.clientHeight&&(r.scrollTop=e+B-r.clientHeight)}return}if(t<0)return;let n=K[t];e.key===`Enter`?(e.preventDefault(),a?.(n.task)):e.key===`Delete`||e.key===`Backspace`?dt&&(e.preventDefault(),dt(n.task)):(e.key===`ArrowRight`&&n.hasChildren&&Rn.has(String(n.task.id))||e.key===`ArrowLeft`&&n.hasChildren&&!Rn.has(String(n.task.id)))&&(e.preventDefault(),Bn(n.task.id))},[K,Nn,a,dt,Rn,Bn,B,ln,un]),q=O.useMemo(()=>{let e=Ae?new Date(Ae):k.now(),t=je?new Date(je):k.now();return!Ae&&A.length>0&&(e=new Date(Math.min(...A.map(e=>e.start.getTime()))),e.setDate(e.getDate()-7)),!je&&A.length>0&&(t=new Date(Math.max(...A.map(e=>e.end.getTime()))),t.setDate(t.getDate()+14)),e=V===`day`&&T&&T.bands.length>0?Ve(e,T.dayStartMin):nt(e,V),t.setHours(23,59,59,999),{start:e,end:t}},[Ae,je,A,V,T,k]),Un=V===`day`&&!!T&&T.bands.length>0,Wn=!Un&&V===`day`&&!!S&&(!!S.skipWeekends||!!(S.holidays&&S.holidays.size)),Gn=O.useCallback(e=>{if(!S)return!0;if(S.skipWeekends){let t=e.getDay();if(t===0||t===6)return!1}if(S.holidays&&S.holidays.size){let t=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`;if(S.holidays.has(t))return!1}return!0},[S]),J=O.useMemo(()=>{let e=[];if(Un&&T){let t=new Date(q.start);for(;t<=q.end;)for(let n of T.bands){let r=n.durMs/$e*Pt;e.push({date:new Date(t),label:n.label,isWeekend:!1,width:r,realMs:n.durMs,bandColor:n.color}),t=new Date(t.getTime()+n.durMs)}return e}let t=new Date(q.start);for(;t<=q.end;){let n=it(t,1,V);if(Wn&&!Gn(t)){t=n;continue}let r=(n.getTime()-t.getTime())/$e*Pt,i,a;V===`day`?(i=String(t.getDate()),a=t.toLocaleDateString(N,{weekday:`narrow`})):i=V===`week`?t.toLocaleDateString(N,{month:`numeric`,day:`numeric`}):V===`month`?t.toLocaleDateString(N,{month:`short`}):V===`quarter`?`Q${Math.floor(t.getMonth()/3)+1}`:String(t.getFullYear()),e.push({date:new Date(t),label:i,sublabel:a,isWeekend:V===`day`&&(t.getDay()===0||t.getDay()===6),width:r}),t=n}return e},[q,V,Pt,N,Wn,Gn,Un,T]),Y=O.useMemo(()=>{let e=Array(J.length+1),t=0;for(let n=0;n<J.length;n++)e[n]=t,t+=J[n].width;return e[J.length]=t,e},[J]),Kn=Y[Y.length-1],qn=O.useMemo(()=>J.map(e=>e.date.getTime()),[J]),Jn=O.useMemo(()=>J.map(e=>e.realMs==null?it(e.date,1,V).getTime()-e.date.getTime():e.realMs),[J,V]),X=O.useCallback(e=>{let t=J.length;if(t===0)return 0;let n=e.getTime(),r=0,i=t-1,a=0;for(;r<=i;){let e=r+i>>1;qn[e]<=n?(a=e,r=e+1):i=e-1}let o=Jn[a]||864e5,s=(n-qn[a])/o;return(Wn||Un)&&(s=Math.max(0,Math.min(s,1))),Y[a]+s*J[a].width},[J,qn,Jn,Y,Wn,Un]),Yn=O.useCallback(e=>{let t=J.length;if(t===0)return new Date(q.start);let n=0,r=t-1,i=0;for(;n<=r;){let t=n+r>>1;Y[t]<=e?(i=t,n=t+1):r=t-1}let a=J[i].width||1,o=(e-Y[i])/a;return new Date(qn[i]+o*(Jn[i]||864e5))},[J,qn,Jn,Y,q]),Xn=O.useCallback(e=>{let t=Z.current;Et.current==null&&t&&t.clientWidth>0&&(Et.current=Yn(t.scrollLeft)),Tt.current=Et.current,Dt.current=!0,wt(e),c?.(e)},[c,Yn]);O.useLayoutEffect(()=>{let e=Tt.current;if(e==null)return;Tt.current=null;let t=Z.current;if(!t||t.clientWidth===0)return;let n=Math.max(0,t.scrollWidth-t.clientWidth),r=Math.max(0,Math.min(Math.round(X(nt(e,V))),n));t.scrollLeft!==r&&(t.scrollLeft=r)},[V,X]);let Zn=O.useCallback((e,t)=>{let n=J.length;if(n===0||t===0)return new Date(e);let r=e.getTime(),i=0,a=n-1,o=0;for(;i<=a;){let e=i+a>>1;qn[e]<=r?(o=e,i=e+1):a=e-1}let s=Math.min(n-1,Math.max(0,o+t)),c=r-qn[o];return new Date(qn[s]+c)},[J,qn]),Qn=O.useRef(null);Qn.current=Wn||Un?Zn:null;let $n=O.useMemo(()=>{let e=[];if(Un&&T){let t=0;for(let n of J){let r=String(Ve(n.date,T.dayStartMin).getTime()),i=e[e.length-1];i&&i.key===r?i.width+=n.width:e.push({key:r,label:n.date.toLocaleDateString(N,{month:`short`,day:`numeric`}),width:n.width,offset:t}),t+=n.width}return e}let t=V===`year`?`decade`:V===`month`||V===`quarter`?`year`:`month`,n=0;for(let r of J){let i=r.date.getFullYear(),a=Math.floor(i/10)*10,o=t===`decade`?String(a):t===`year`?String(i):`${i}-${r.date.getMonth()}`,s=e[e.length-1];s&&s.key===o?s.width+=r.width:e.push({key:o,label:t===`decade`?`${a}s`:t===`year`?String(i):r.date.toLocaleDateString(N,{month:`short`,year:`numeric`}),width:r.width,offset:n}),n+=r.width}return e},[J,V,N,Un,T]),er=O.useMemo(()=>(Me??[]).map((e,t)=>{let n=e.date instanceof Date?e.date:new Date(e.date);return{index:t,label:e.label,color:e.color||`hsl(var(--primary))`,left:Math.round(X(n)),valid:!isNaN(n.getTime())&&n>=q.start&&n<=q.end}}).filter(e=>e.valid),[Me,q,X]),tr=O.useRef(null),nr=O.useRef(null),rr=O.useRef(null),Z=O.useRef(null);O.useEffect(()=>{let e=Z.current;if(!e)return;let t=()=>{Dt.current=!1},n=new Set([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),r=e=>{n.has(e.key)&&t()};return e.addEventListener(`wheel`,t,{passive:!0}),e.addEventListener(`touchstart`,t,{passive:!0}),e.addEventListener(`pointerdown`,t,{passive:!0}),e.addEventListener(`keydown`,r),()=>{e.removeEventListener(`wheel`,t),e.removeEventListener(`touchstart`,t),e.removeEventListener(`pointerdown`,t),e.removeEventListener(`keydown`,r)}},[]);let[ir,ar]=O.useState(null),or=O.useRef([]),sr=O.useRef(null),[cr,lr]=O.useState({top:0,left:0}),[ur,dr]=O.useState({width:4e3,height:600}),fr=O.useCallback(()=>{let e=Z.current;if(!e)return;let t=e.clientWidth||4e3,n=e.clientHeight||600;dr(e=>e.width===t&&e.height===n?e:{width:t,height:n})},[]);O.useLayoutEffect(()=>{fr();let e=Z.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(fr);return t.observe(e),()=>t.disconnect()},[fr]);let pr=O.useMemo(()=>rt(Y,cr.left-240,cr.left+ur.width+240),[Y,cr.left,ur.width]),mr=O.useMemo(()=>{let e=$n.map(e=>e.offset);return e.push(Kn),e},[$n,Kn]),hr=O.useMemo(()=>rt(mr,cr.left-240,cr.left+ur.width+240),[mr,cr.left,ur.width]),Q=O.useMemo(()=>({startIdx:Math.max(0,Math.floor(cr.top/B)-6),endIdx:Math.min(K.length,Math.ceil((cr.top+ur.height)/B)+6)}),[cr.top,ur.height,B,K.length]),gr=K.length*B,[_r,vr]=O.useState(!1);O.useEffect(()=>{let e=()=>vr(!!document.fullscreenElement);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]);let yr=O.useCallback(()=>{let e=Fe.current;e&&(document.fullscreenElement?document.exitFullscreen?.():e.requestFullscreen?.())},[]),br=O.useRef(null),xr=O.useCallback(e=>{if(e.touches.length===2){let t=e.touches[0].clientX-e.touches[1].clientX,n=e.touches[0].clientY-e.touches[1].clientY;br.current={baseDistance:Math.max(1,Math.sqrt(t*t+n*n)),baseColumn:Nt}}},[Nt]),Sr=O.useCallback(e=>{if(e.touches.length!==2||!br.current)return;let t=e.touches[0].clientX-e.touches[1].clientX,n=e.touches[0].clientY-e.touches[1].clientY,r=Math.max(1,Math.sqrt(t*t+n*n))/br.current.baseDistance,i=Math.max(15,Math.min(120,Math.round(br.current.baseColumn*r)));xt(i)},[]),Cr=O.useCallback(()=>{br.current=null},[]),wr=O.useMemo(()=>{let e=k.now();return e<q.start||e>q.end?null:Math.round(X(e))},[q,X,k]),Tr=O.useCallback(()=>{if(wr==null||!Z.current)return;let e=Math.max(0,wr-Z.current.clientWidth/2);Z.current.scrollTo({left:e,behavior:`smooth`})},[wr]),Er=O.useRef(!1);O.useEffect(()=>{if(Er.current||A.length===0)return;let e=window.requestAnimationFrame(()=>{let e=Z.current;if(!e||e.clientWidth===0)return;let t=wr;if(t==null){let e=new Date(Math.min(...A.map(e=>e.start.getTime())));t=Math.round(X(e))}e.scrollLeft=Math.max(0,t-e.clientWidth/2),Er.current=!0});return()=>window.cancelAnimationFrame(e)},[A,wr,X]);let Dr=O.useCallback((e,t=`left`)=>{let n=Z.current;if(!n||e<q.start||e>q.end)return!1;let r=Math.round(X(e)),i=t===`center`?r-n.clientWidth/2:r-24;return n.scrollTo({left:Math.max(0,i),behavior:`smooth`}),!0},[q,X]),Or=O.useCallback((e,t,n)=>{let r=Z.current;if(!r)return;let i=X(e),a=X(t),o=Math.max(0,r.scrollWidth-r.clientWidth),s=Math.min(96,r.clientWidth*.15),c=a-i<=r.clientWidth-s?(i+a)/2-r.clientWidth/2:i-s,l=Math.max(0,Math.min(c,o));or.current.forEach(e=>window.clearTimeout(e)),or.current=[],sr.current?.(),sr.current=null,ar(null);let u=()=>{if(n==null)return;let e=window.requestAnimationFrame(()=>{ar(n),or.current.push(window.setTimeout(()=>ar(e=>e===n?null:e),1500))});sr.current=()=>window.cancelAnimationFrame(e)},d=Math.abs(r.scrollLeft-l)>2;if(r.scrollTo({left:l,behavior:`smooth`}),!d){u();return}let f=`onscrollend`in r,p=!1,m=()=>{p||(p=!0,r.removeEventListener(`scrollend`,m),u())};r.addEventListener(`scrollend`,m),or.current.push(window.setTimeout(m,f?1500:500)),sr.current=()=>r.removeEventListener(`scrollend`,m)},[X]);O.useEffect(()=>()=>{or.current.forEach(e=>window.clearTimeout(e)),sr.current?.()},[]);let kr=O.useCallback(()=>Dr(nt(k.now(),`week`)),[Dr,k]),Ar=O.useCallback(()=>Dr(nt(k.now(),`month`)),[Dr,k]),jr=O.useRef(null),Mr=O.useRef(null),Nr=O.useRef(null),Pr=O.useRef(null),Fr=O.useRef(null),Ir=O.useRef(null),Lr=O.useRef(null),Rr=O.useRef(null),zr=O.useCallback(()=>{let e=rr.current,t=jr.current,n=Mr.current,r=Nr.current;if(e&&t&&n&&r){let i=e.scrollWidth>e.clientWidth+1;if(t.style.display=i?`block`:`none`,i){let t=n.clientWidth;if(t>0){let n=Math.min(t,Math.max(40,e.clientWidth/e.scrollWidth*t)),i=e.scrollWidth-e.clientWidth,a=i>0?e.scrollLeft/i*(t-n):0;r.style.width=`${n}px`,r.style.transform=`translateX(${a}px)`}}}let i=Fr.current,a=Ir.current,o=Lr.current;if(e&&i&&a&&o){let t=e.scrollHeight>e.clientHeight+1;if(i.style.display=t?`block`:`none`,t){let t=a.clientHeight;if(t>0){let n=Math.min(t,Math.max(40,e.clientHeight/e.scrollHeight*t)),r=e.scrollHeight-e.clientHeight,i=r>0?e.scrollTop/r*(t-n):0;o.style.height=`${n}px`,o.style.transform=`translateY(${i}px)`}}}},[]);O.useEffect(()=>{zr()});let Br=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=rr.current,n=Mr.current,r=Nr.current;if(!t||!n||!r)return;Pr.current={startX:e.clientX,startLeft:t.scrollLeft};let i=n.clientWidth,a=r.getBoundingClientRect().width,o=t.scrollWidth-t.clientWidth,s=i-a>0?o/(i-a):0,c=e=>{let n=Pr.current;n&&(t.scrollLeft=n.startLeft+(e.clientX-n.startX)*s)},l=()=>{Pr.current=null,window.removeEventListener(`pointermove`,c),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l)};window.addEventListener(`pointermove`,c),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l)},Vr=e=>{if(e.button!==0||e.target!==e.currentTarget)return;let t=rr.current,n=Mr.current,r=Nr.current;if(!t||!n||!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect().width,o=t.scrollWidth-t.clientWidth,s=i.width-a;s<=0||(t.scrollLeft=Math.min(Math.max(e.clientX-i.x-a/2,0),s)/s*o)},Hr=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=rr.current,n=Ir.current,r=Lr.current;if(!t||!n||!r)return;Rr.current={startY:e.clientY,startTop:t.scrollTop};let i=n.clientHeight,a=r.getBoundingClientRect().height,o=t.scrollHeight-t.clientHeight,s=i-a>0?o/(i-a):0,c=e=>{let n=Rr.current;n&&(t.scrollTop=n.startTop+(e.clientY-n.startY)*s)},l=()=>{Rr.current=null,window.removeEventListener(`pointermove`,c),window.removeEventListener(`pointerup`,l),window.removeEventListener(`pointercancel`,l)};window.addEventListener(`pointermove`,c),window.addEventListener(`pointerup`,l),window.addEventListener(`pointercancel`,l)},Ur=e=>{if(e.button!==0||e.target!==e.currentTarget)return;let t=rr.current,n=Ir.current,r=Lr.current;if(!t||!n||!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect().height,o=t.scrollHeight-t.clientHeight,s=i.height-a;s<=0||(t.scrollTop=Math.min(Math.max(e.clientY-i.y-a/2,0),s)/s*o)},Wr=e=>{let t=e.currentTarget;!Dt.current&&t.clientWidth>0&&(Et.current=Yn(t.scrollLeft)),tr.current&&(tr.current.scrollLeft=t.scrollLeft),zr(),nr.current&&nr.current.scrollTop!==t.scrollTop&&(nr.current.scrollTop=t.scrollTop),lr(e=>e.top===t.scrollTop&&e.left===t.scrollLeft?e:{top:t.scrollTop,left:t.scrollLeft}),fr()},Gr=e=>{let t=e.currentTarget,n=Z.current;n&&n.scrollTop!==t.scrollTop&&(n.scrollTop=t.scrollTop),lr(e=>e.top===t.scrollTop?e:{...e,top:t.scrollTop})},Kr=(e,t)=>{let n=X(e),r=Un&&T?Pt*Math.min(...T.bands.map(e=>e.durMs))/$e:Pt;return{left:n,width:Math.max(X(t)-n,r,3)}},qr=W?.group?W.taskId:null,Jr=O.useMemo(()=>{if(qr==null)return null;let e=new Set([String(qr)]);for(let t of Wt(qr))t.locked||e.add(String(t.id));return e},[qr,Wt]),Yr=O.useMemo(()=>{if(!W||W.group)return null;let e=new Set,t=new Set,n=Ut.get(String(W.taskId));for(;n&&n.parent!=null&&n.parent!==``;){let r=String(n.parent);if(t.has(r)||!Ut.has(r))break;t.add(r),e.add(r),n=Ut.get(r)}return e.size?e:null},[W,Ut]),Xr=e=>{if(W){if(Jr?.has(String(e.task.id))){let t=Jt(W).start.getTime()-W.originStart.getTime();return Kr(new Date(e.start.getTime()+t),new Date(e.end.getTime()+t))}if(W.taskId===e.task.id&&!W.group){let e=Jt(W);return Kr(e.start,e.end)}if(e.isSummary&&Yr?.has(String(e.task.id))&&!(_e===`self`&&e.task.hasOwnDates!==!1)){let t=Jt(W),n=String(W.taskId),r=null,i=null;for(let a of Wt(e.task.id)){if((Ht.get(String(a.id))??[]).length!==0)continue;let e=String(a.id)===n?t.start:a.start,o=String(a.id)===n?t.end:a.end;(!r||e<r)&&(r=e),(!i||o>i)&&(i=o)}if(r&&i)return Kr(r,i)}}return Kr(e.start,e.end)},Zr=O.useMemo(()=>{let e=new Map;K.forEach((t,n)=>e.set(String(t.task.id),n));let t=[];return K.forEach(({task:n},r)=>{for(let i of n.dependencies??[]){let a=typeof i==`object`&&!!i,o=a?i.id:i;if(o==null||o===``)continue;let s=e.get(String(o));if(s==null||s===r)continue;let c=a?i.type:void 0,l=c===`ss`||c===`ff`||c===`sf`?c:`fs`;t.push({key:`${String(o)}->${String(n.id)}:${l}`,sourceId:o,targetId:n.id,type:l,sourceIndex:s,targetIndex:r})}}),t},[K]),Qr=Math.max(2,Math.round(B/2)-14),$r=B-Qr*2,ei=Math.round($r/2),ti=Math.max(Math.round(B*.4),12),ni=ti*Math.SQRT2/2,ri=$r,ii=Qr,ai=Math.max(3,Math.round(B*.13)),oi=B-ai-1,si=`rgba(100, 116, 139, 0.35)`,ci=`rgba(100, 116, 139, 0.6)`,li=e=>{let t=K[e.sourceIndex],n=K[e.targetIndex];if(!t||!n)return null;let r=Xr(t),i=Xr(n),a=e=>e.isSummary?ii+ri/2:B/2,o=e.sourceIndex*B+a(t),s=e.targetIndex*B+a(n),c=e.type===`fs`||e.type===`ff`,l=e.type===`ff`||e.type===`sf`,u=t.isMilestone?r.left+(c?ni:-ni):c?r.left+r.width:r.left,d=n.isMilestone?i.left+(l?ni:-ni):l?i.left+i.width:i.left,f=u+(c?10:-10),p=d+(l?10:-10),m=Math.round,h=[`M ${m(u)} ${m(o)}`,`L ${m(f)} ${m(o)}`];if(l?f>=p:f<=p)h.push(`L ${m(f)} ${m(s)}`,`L ${m(d)} ${m(s)}`);else{let t=s>=o?(e.sourceIndex+1)*B:e.sourceIndex*B;h.push(`L ${m(f)} ${m(t)}`,`L ${m(p)} ${m(t)}`,`L ${m(p)} ${m(s)}`,`L ${m(d)} ${m(s)}`)}return h.join(` `)},ui=W?.taskId??Bt,[di,fi]=O.useState(ae),pi=O.useMemo(()=>di?Ie(A,S):null,[di,A,S]),mi=O.useCallback(e=>pi?.criticalIds.has(String(e))??!1,[pi]),$=`#dc2626`,[hi,gi]=O.useState(null),[_i,vi]=O.useState(!1);O.useEffect(()=>{if(!_i)return;let e=setTimeout(()=>vi(!1),2500);return()=>clearTimeout(e)},[_i]);let yi=O.useCallback(()=>{if(!R)return;let{changes:e,skippedLocked:t}=Le(A,S,an);if(!e.length){vi(!0);return}gi({changes:e,skipped:t.length})},[A,R,S,an]),bi=O.useCallback(()=>{if(!hi)return;let e=[];for(let t of hi.changes){let n=A.find(e=>String(e.id)===t.id);n&&e.push({task:n,changes:{start:t.start,end:t.end}})}e.length&&en(e),gi(null)},[hi,A,en]),xi=O.useCallback(()=>{if(typeof document>`u`||!A.length)return null;let e=e=>String(e).replace(/[&<>"]/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`})[e]),t=Math.max(H,200),n=Math.ceil(t+Kn),r=Math.ceil(36+K.length*B),i=pi?.criticalEdges??null,a=[];a.push(`<rect x="0" y="0" width="${n}" height="${r}" fill="#ffffff"/>`),a.push(`<rect x="0" y="0" width="${n}" height="36" fill="#f8fafc"/>`),a.push(`<g transform="translate(${t},0)" font-family="sans-serif" font-size="10" fill="#475569">`),$n.forEach(t=>{a.push(`<line x1="${t.offset.toFixed(1)}" y1="0" x2="${t.offset.toFixed(1)}" y2="36" stroke="#e2e8f0"/>`),a.push(`<text x="${(t.offset+t.width/2).toFixed(1)}" y="12" text-anchor="middle" font-weight="600">${e(t.label)}</text>`)}),J.forEach((t,n)=>{let i=Y[n];a.push(`<line x1="${i.toFixed(1)}" y1="18" x2="${i.toFixed(1)}" y2="${r}" stroke="#eef2f7"/>`),a.push(`<text x="${(i+t.width/2).toFixed(1)}" y="30" text-anchor="middle" fill="#1f2937">${e(t.label)}</text>`)}),a.push(`</g>`),a.push(`<line x1="0" y1="18" x2="${n}" y2="18" stroke="#e2e8f0"/>`),a.push(`<line x1="0" y1="36" x2="${n}" y2="36" stroke="#cbd5e1"/>`),a.push(`<line x1="${t}" y1="0" x2="${t}" y2="${r}" stroke="#cbd5e1"/>`),a.push(`<g transform="translate(0,36)" font-family="sans-serif" font-size="11" fill="#1f2937">`),K.forEach((n,r)=>{let i=r*B;a.push(`<line x1="0" y1="${(i+B).toFixed(1)}" x2="${t}" y2="${(i+B).toFixed(1)}" stroke="#f1f5f9"/>`);let o=8+n.depth*14,s=Math.max(4,Math.floor((t-o)/6.5)),c=n.task.title.length>s?n.task.title.slice(0,s-1)+`…`:n.task.title,l=n.isSummary?` font-weight="600"`:``;a.push(`<text x="${o}" y="${(i+B/2+4).toFixed(1)}"${l}>${e(c)}</text>`)}),a.push(`</g>`);let o=(e,t)=>{let n=t-12;if(n<=9)return``;let r=0,i=``;for(let t of e){let a=t.charCodeAt(0)>255?9:5.5;if(r+a>n)return i.length<e.length?`${i.slice(0,-1)}…`:i;r+=a,i+=t}return i};a.push(`<g transform="translate(${t},36)" font-family="sans-serif" font-size="9">`),K.forEach((t,n)=>{if(t.task.type===`group`)return;let r=n*B,{left:i,width:s}=Kr(t.start,t.end),c=mi(t.task.id),l=c?` stroke="${$}" stroke-width="2"`:``;if(le&&t.task.baselineStart&&t.task.baselineEnd){let e=Kr(t.task.baselineStart,t.task.baselineEnd);a.push(`<rect x="${e.left.toFixed(1)}" y="${(r+oi).toFixed(1)}" width="${Math.max(2,e.width).toFixed(1)}" height="${ai}" rx="1" fill="${si}" stroke="${ci}"/>`)}if(t.isMilestone){let e=i,n=r+B/2,o=ti/2,s=c?$:t.task.color||`#3b82f6`;a.push(`<polygon points="${e},${n-o} ${e+o},${n} ${e},${n+o} ${e-o},${n}" fill="${s}"/>`)}else if(t.isSummary){let n=t.task.color||`#64748b`;a.push(`<rect x="${i.toFixed(1)}" y="${(r+ii).toFixed(1)}" width="${s.toFixed(1)}" height="${ri}" rx="3" fill="${n}"${l}/>`);let c=s*Math.min(100,Math.max(0,t.progress))/100;a.push(`<rect x="${i.toFixed(1)}" y="${(r+ii).toFixed(1)}" width="${c.toFixed(1)}" height="${ri}" rx="3" fill="rgba(0,0,0,0.2)"/>`);let u=o(t.task.title,s);u&&a.push(`<text x="${(i+6).toFixed(1)}" y="${(r+B/2+3).toFixed(1)}" fill="#ffffff" font-weight="500">${e(u)}</text>`)}else{let n=t.task.color||`#3b82f6`;a.push(`<rect x="${i.toFixed(1)}" y="${(r+Qr).toFixed(1)}" width="${s.toFixed(1)}" height="${$r}" rx="3" fill="${n}"${l}/>`);let c=s*Math.min(100,Math.max(0,t.progress))/100;a.push(`<rect x="${i.toFixed(1)}" y="${(r+Qr).toFixed(1)}" width="${c.toFixed(1)}" height="${$r}" rx="3" fill="rgba(0,0,0,0.18)"/>`);let u=o(t.task.title,s);u?a.push(`<text x="${(i+6).toFixed(1)}" y="${(r+B/2+3).toFixed(1)}" fill="#ffffff" font-weight="500">${e(u)}</text>`):s>=24&&a.push(`<text x="${(i+s/2).toFixed(1)}" y="${(r+B/2+3).toFixed(1)}" text-anchor="middle" fill="#ffffff">${Math.round(t.progress)}%</text>`)}}),Zr.forEach(e=>{let t=li(e);if(!t)return;let n=i?.has(`${String(e.sourceId)}->${String(e.targetId)}`)??!1,r=n?$:`#94a3b8`;a.push(`<path d="${t}" fill="none" stroke="${r}" stroke-width="${n?2:1.5}"/>`)}),wr!=null&&a.push(`<line x1="${wr.toFixed(1)}" y1="0" x2="${wr.toFixed(1)}" y2="${K.length*B}" stroke="#ef4444" stroke-width="1.5"/>`);let s=K.length*B;return er.forEach(t=>{let n=/var\(/.test(t.color)?`#6366f1`:t.color;if(a.push(`<line x1="${t.left.toFixed(1)}" y1="0" x2="${t.left.toFixed(1)}" y2="${s}" stroke="${e(n)}" stroke-width="1.5"/>`),t.label){let r=t.label.length*6+8;a.push(`<rect x="${(t.left-r/2).toFixed(1)}" y="0" width="${r}" height="14" rx="2" fill="${e(n)}"/>`),a.push(`<text x="${t.left.toFixed(1)}" y="10" text-anchor="middle" font-size="9" font-weight="600" fill="#ffffff">${e(t.label)}</text>`)}}),a.push(`</g>`),{svg:`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${r}" viewBox="0 0 ${n} ${r}">${a.join(``)}</svg>`,W:n,H:r}},[A,K,Zr,li,Kr,mi,pi,J,Y,Kn,H,B,Qr,$r,ii,ri,ti,wr,V,le,oi,ai,si,ci,er,$n]),Si=O.useCallback(()=>{let e=(De??``).replace(/[\\/:*?"<>|\s]+/g,` `).trim()||`gantt`,t=new Date,n=e=>String(e).padStart(2,`0`);return`${e}-${`${t.getFullYear()}${n(t.getMonth()+1)}${n(t.getDate())}-${n(t.getHours())}${n(t.getMinutes())}`}`},[De]),Ci=O.useCallback(async()=>{let e=xi();if(!e)return;let t=await at(e.svg,e.W,e.H);t&&t.toBlob(e=>{e&&ot(e,`${Si()}.png`)},`image/png`)},[xi,Si]),wi=O.useCallback(async()=>{let e=xi();if(!e)return;let t=await at(e.svg,e.W,e.H);t&&ot(st(ct(t.toDataURL(`image/jpeg`,.92)),t.width,t.height),`${Si()}.pdf`)},[xi,Si]),[Ti,Ei]=O.useState(!1),Di=O.useCallback(()=>{let e={viewMode:V,columnWidth:bt,taskListCollapsed:Ot,taskListWidth:St,collapsedIds:Array.from(Rn)};ve&&ut(ve,e),xe?.(e),Ei(!0)},[V,bt,Ot,St,Rn,ve,xe]);return O.useEffect(()=>{if(!Ti)return;let e=setTimeout(()=>Ei(!1),1500);return()=>clearTimeout(e)},[Ti]),(0,I.jsxs)(`div`,{ref:Fe,className:y(`flex flex-col h-full bg-background overflow-hidden min-w-0`,h),"data-readonly":F?`true`:void 0,"data-mobile-readonly":de&&Be?`true`:void 0,children:[(0,I.jsx)(`style`,{children:`
|
|
16
|
-
.gantt-resize-handle:hover { background-color: rgba(255, 255, 255, 0.4); }
|
|
17
|
-
.gantt-bar-hover:hover { filter: brightness(1.1); }
|
|
18
|
-
.gantt-row-open-btn { opacity: 0; transition: opacity 0.15s ease; }
|
|
19
|
-
/* :where keeps the row-hover reveal at zero specificity so the
|
|
20
|
-
button's own :hover/:focus-visible full-opacity rule can win. */
|
|
21
|
-
:where(.group\\/task-row:hover) .gantt-row-open-btn { opacity: 0.6; }
|
|
22
|
-
.gantt-row-open-btn:hover, .gantt-row-open-btn:focus-visible { opacity: 1; }
|
|
23
|
-
/* 定位闪烁: blink the located bar 3× with a thick ring + colored glow so
|
|
24
|
-
it's hard to miss. The ring is an outline (not box-shadow) and the glow
|
|
25
|
-
is a drop-shadow *filter* — both stay clear of the critical-path bar's
|
|
26
|
-
inline box-shadow, which they'd otherwise clobber. */
|
|
27
|
-
@keyframes gantt-flash {
|
|
28
|
-
0%, 25%, 50%, 100% {
|
|
29
|
-
outline-color: rgba(37, 99, 235, 0);
|
|
30
|
-
filter: drop-shadow(0 0 0 rgba(37, 99, 235, 0));
|
|
31
|
-
}
|
|
32
|
-
12%, 37%, 62% {
|
|
33
|
-
outline-color: rgba(37, 99, 235, 1);
|
|
34
|
-
filter: drop-shadow(0 0 9px rgba(37, 99, 235, 0.9));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
.gantt-flash {
|
|
38
|
-
outline: 3px solid transparent;
|
|
39
|
-
outline-offset: 3px;
|
|
40
|
-
border-radius: 2px;
|
|
41
|
-
animation: gantt-flash 1.5s ease-in-out;
|
|
42
|
-
}
|
|
43
|
-
@media (min-width: 640px) {
|
|
44
|
-
.gantt-sm-h50 { height: 50px; }
|
|
45
|
-
.gantt-sm-w20 { width: 80px; }
|
|
46
|
-
.gantt-sm-hidden { display: none; }
|
|
47
|
-
}
|
|
48
|
-
/* The timeline's NATIVE scrollbars are fully hidden — both axes are
|
|
49
|
-
replaced by the self-drawn bars (水平底部 / 垂直右侧). Styling the
|
|
50
|
-
native bar is a dead end: overlay-scrollbar engines (macOS "show
|
|
51
|
-
while scrolling", embedded Chromium) ignore ::-webkit-scrollbar
|
|
52
|
-
theming yet still flash their own auto-hiding bar on scroll, which
|
|
53
|
-
doubled up with the self-drawn one (双滚动条). scrollbar-width:none
|
|
54
|
-
is honored by overlay engines too; the ::-webkit rule covers older
|
|
55
|
-
WebKit. Wheel/trackpad/programmatic scrolling is unaffected. */
|
|
56
|
-
[data-testid="gantt-timeline"] { scrollbar-width: none; }
|
|
57
|
-
[data-testid="gantt-timeline"]::-webkit-scrollbar { display: none; width: 0; height: 0; }
|
|
58
|
-
/* The task-list pane scrolls in lockstep with the timeline, so its own
|
|
59
|
-
vertical scrollbar (butted against the divider) was a confusing second
|
|
60
|
-
bar. Hide it — the pane stays wheel/drag-scrollable and synced. */
|
|
61
|
-
.gantt-task-list::-webkit-scrollbar { width: 0; height: 0; }
|
|
62
|
-
.gantt-task-list { scrollbar-width: none; }
|
|
63
|
-
`}),(0,I.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 p-2 border-b bg-card`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":j(`gantt.toolbar.prevPeriod`),children:(0,I.jsx)(ee,{className:`h-4 w-4`})}),(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":j(`gantt.toolbar.nextPeriod`),children:(0,I.jsx)(oe,{className:`h-4 w-4`})}),(0,I.jsx)(`span`,{className:`font-semibold text-xs sm:text-sm`,children:q.start.toLocaleDateString(N,{month:`long`,year:`numeric`})}),F&&(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground`,"data-testid":`gantt-readonly-badge`,title:j(`gantt.readOnlyHint`),children:[(0,I.jsx)(v,{className:`h-3 w-3`}),j(`gantt.readOnly`)]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`flex bg-muted rounded-md p-1`,role:`group`,"aria-label":j(`gantt.toolbar.viewMode`),children:Ze.map(e=>(0,I.jsx)(x,{variant:`ghost`,size:`sm`,className:y(`h-6 px-1.5 sm:px-2 text-xs`,V===e&&`bg-background shadow-sm hover:bg-background`),onClick:()=>Xn(e),"aria-pressed":V===e,"data-testid":`gantt-view-mode-${e}`,children:j(`gantt.viewMode.${e}`)},e))}),(0,I.jsxs)(`div`,{className:`flex bg-muted rounded-md p-1`,children:[(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>{if(Nt>15)xt(Math.max(15,Nt-10));else{let e=Ze.indexOf(V);e<Ze.length-1&&(Xn(Ze[e+1]),xt(_t))}},"aria-label":j(`gantt.toolbar.zoomOut`),children:(0,I.jsx)(me,{className:`h-3 w-3`})}),(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-6 w-6`,onClick:()=>{if(Nt<120)xt(Math.min(120,Nt+10));else{let e=Ze.indexOf(V);e>0&&(Xn(Ze[e-1]),xt(_t))}},"aria-label":j(`gantt.toolbar.zoomIn`),children:(0,I.jsx)(b,{className:`h-3 w-3`})})]}),(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>kt(e=>!e),"aria-label":j(Ot?`gantt.toolbar.showTaskList`:`gantt.toolbar.hideTaskList`),"aria-pressed":Ot,"data-testid":`gantt-toggle-task-list`,children:Ot?(0,I.jsx)(ye,{className:`h-4 w-4`}):(0,I.jsx)(D,{className:`h-4 w-4`})}),(0,I.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:Tr,disabled:wr==null,"aria-label":j(`gantt.toolbar.jumpToToday`),"data-testid":`gantt-jump-today`,children:j(`gantt.toolbar.today`)}),(0,I.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:kr,"aria-label":j(`gantt.toolbar.thisWeek`),"data-testid":`gantt-jump-week`,children:j(`gantt.toolbar.thisWeek`)}),(0,I.jsx)(x,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs`,onClick:Ar,"aria-label":j(`gantt.toolbar.thisMonth`),"data-testid":`gantt-jump-month`,children:j(`gantt.toolbar.thisMonth`)}),Se?(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>void Se(),disabled:Ce,"aria-label":j(`gantt.toolbar.refresh`),"aria-busy":Ce,"data-testid":`gantt-refresh`,children:(0,I.jsx)(se,{className:`h-4 w-4`})}):null,R?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:ln,disabled:!dn,"aria-label":j(`gantt.toolbar.undo`),"data-testid":`gantt-undo`,children:(0,I.jsx)(w,{className:`h-4 w-4`})}),(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:un,disabled:!fn,"aria-label":j(`gantt.toolbar.redo`),"data-testid":`gantt-redo`,children:(0,I.jsx)(ce,{className:`h-4 w-4`})})]}):null,(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:()=>fi(e=>!e),"aria-label":j(`gantt.toolbar.criticalPath`),"aria-pressed":di,"data-testid":`gantt-critical-path`,style:di?{color:$}:void 0,children:(0,I.jsx)(pe,{className:`h-4 w-4`})}),ht&&R?(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:yi,"aria-label":j(`gantt.toolbar.autoSchedule`),"data-testid":`gantt-auto-schedule`,children:(0,I.jsx)(p,{className:`h-4 w-4`})}):null,(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:Ci,"aria-label":j(`gantt.toolbar.exportPng`),"data-testid":`gantt-export-png`,children:(0,I.jsx)(E,{className:`h-4 w-4`})}),(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:wi,"aria-label":j(`gantt.toolbar.exportPdf`),"data-testid":`gantt-export-pdf`,children:(0,I.jsx)(C,{className:`h-4 w-4`})}),xe||ve?(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:Di,"aria-label":j(`gantt.toolbar.saveLayout`),"aria-pressed":Ti,"data-testid":`gantt-save-layout`,style:Ti?{color:$}:void 0,children:(0,I.jsx)(we,{className:`h-4 w-4`})}):null,(0,I.jsx)(x,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,onClick:yr,"aria-label":j(_r?`gantt.toolbar.exitFullscreen`:`gantt.toolbar.enterFullscreen`),"aria-pressed":_r,"data-testid":`gantt-fullscreen`,children:_r?(0,I.jsx)(ne,{className:`h-4 w-4`}):(0,I.jsx)(f,{className:`h-4 w-4`})})]})]}),(0,I.jsxs)(`div`,{className:`relative flex flex-col flex-1 overflow-hidden outline-none focus-visible:ring-1 focus-visible:ring-ring`,tabIndex:0,onKeyDown:Hn,"data-testid":`gantt-body`,children:[!Ot&&H>0&&(0,I.jsx)(`div`,{className:`absolute top-0 bottom-0 z-30 group/splitter`,style:{left:H-3,width:7,cursor:`col-resize`},"data-testid":`gantt-list-resize`,role:`separator`,"aria-orientation":`vertical`,onPointerDown:e=>{if(e.button!==0)return;e.preventDefault();let t=e.clientX,n=H,r=Math.max(160,P-200),i=e=>{let i=Math.max(160,Math.min(n+(e.clientX-t),r));Ct(i)},a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a),document.body.style.cursor=``};document.body.style.cursor=`col-resize`,window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)},onDoubleClick:()=>Ct(null),children:(0,I.jsx)(`div`,{className:`absolute inset-y-0 left-1/2 -translate-x-1/2 w-px bg-border group-hover/splitter:w-[3px] group-hover/splitter:bg-primary transition-all`})}),(0,I.jsxs)(`div`,{className:`flex border-b bg-muted/30 shrink-0 h-10 gantt-sm-h50`,children:[(0,I.jsxs)(`div`,{className:`flex items-center font-medium text-xs text-muted-foreground px-2 sm:px-4 border-r bg-card z-20 shadow-sm`,style:{width:H,minWidth:H},children:[(0,I.jsx)(`div`,{className:`flex-1 truncate`,children:j(`gantt.column.taskName`)}),Ft&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`w-16 gantt-sm-w20 text-right`,children:j(`gantt.column.start`)}),(0,I.jsx)(`div`,{className:`w-16 gantt-sm-w20 text-right`,children:j(`gantt.column.end`)})]}),a&&(0,I.jsx)(`div`,{className:`w-6 shrink-0 hidden sm:block`,style:{marginLeft:4},"aria-hidden":`true`,"data-testid":`gantt-header-open-spacer`})]}),(0,I.jsx)(`div`,{className:`flex-1 overflow-hidden`,ref:tr,children:(0,I.jsxs)(`div`,{className:`flex flex-col h-full`,style:{width:Kn},children:[(0,I.jsx)(`div`,{className:`relative border-b`,style:{height:`45%`},"data-testid":`gantt-header-groups`,children:$n.slice(hr.start,hr.end).map(e=>(0,I.jsx)(`div`,{className:`absolute top-0 bottom-0 flex items-center justify-center border-r text-[10px] font-medium text-muted-foreground overflow-hidden`,style:{left:e.offset,width:e.width},children:(0,I.jsx)(`span`,{className:`truncate px-1`,children:e.label})},e.key))}),(0,I.jsx)(`div`,{className:`relative flex-1`,"data-testid":`gantt-header-units`,children:J.slice(pr.start,pr.end).map((e,t)=>{let n=pr.start+t;return(0,I.jsxs)(`div`,{className:y(`absolute top-0 bottom-0 flex items-center justify-center gap-1 border-r text-xs text-muted-foreground overflow-hidden`,e.isWeekend&&`bg-muted/50`),style:{left:Y[n],width:e.width,backgroundColor:e.bandColor?`color-mix(in srgb, ${e.bandColor} 16%, transparent)`:void 0},children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground truncate`,children:e.label}),e.sublabel&&Nt>=32&&(0,I.jsx)(`span`,{className:`text-[10px] opacity-70`,children:e.sublabel})]},n)})})]})})]}),(0,I.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,I.jsxs)(`div`,{className:`gantt-task-list overflow-y-auto overflow-x-hidden border-r bg-card z-10 shadow-sm`,ref:nr,onScroll:Gr,style:{width:H,minWidth:H},role:`tree`,"aria-label":j(`gantt.aria.taskList`),children:[Q.startIdx>0&&(0,I.jsx)(`div`,{style:{height:Q.startIdx*B},"aria-hidden":`true`}),K.slice(Q.startIdx,Q.endIdx).map(e=>{let t=e.task,n=mt&&It===t.id,r=Rn.has(String(t.id)),i=Nn!=null&&String(Nn)===String(t.id);return(0,I.jsxs)(`div`,{className:y(`group/task-row relative flex items-center border-b px-2 sm:px-4 hover:bg-accent/50 cursor-pointer transition-colors`,i&&`bg-accent/50`),style:{height:B,touchAction:`manipulation`},role:`treeitem`,"data-testid":`gantt-task-row-${t.id}`,"aria-level":e.depth+1,"aria-selected":i,"aria-expanded":e.hasChildren?!r:void 0,draggable:!!pt&&!n&&!t.locked,onDragStart:pt?e=>{e.dataTransfer.setData(`text/plain`,String(t.id)),e.dataTransfer.effectAllowed=`move`}:void 0,onDragOver:pt?e=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`}:void 0,onDrop:pt?e=>{e.preventDefault();let n=e.dataTransfer.getData(`text/plain`);if(!n||n===String(t.id))return;let r=Ut.get(n);r&&String(r.parent??``)===String(t.parent??``)&&pt(r,t)}:void 0,onContextMenu:e=>In(t,e),onClick:()=>{Pn(t.id),n||Or(e.start,e.end,t.id)},onDoubleClick:()=>{n||(mt&&R&&!e.isSummary&&!t.locked?(Lt(t.id),zt({title:t.title,start:t.start.toLocaleDateString(`en-CA`),end:t.end.toLocaleDateString(`en-CA`),progress:String(t.progress)})):a?.(t))},children:[(0,I.jsxs)(`div`,{className:`flex-1 truncate font-medium text-xs sm:text-sm flex items-center gap-2`,style:e.depth>0?{paddingLeft:e.depth*14}:void 0,children:[e.hasChildren?(0,I.jsx)(`button`,{type:`button`,className:`h-4 w-4 shrink-0 flex items-center justify-center text-muted-foreground hover:text-foreground`,style:{marginLeft:-4},onClick:e=>{e.stopPropagation(),Bn(t.id)},"aria-expanded":!r,"aria-label":j(r?`gantt.row.expand`:`gantt.row.collapse`),"data-testid":`gantt-row-toggle-${t.id}`,children:r?(0,I.jsx)(oe,{className:`h-3.5 w-3.5`}):(0,I.jsx)(g,{className:`h-3.5 w-3.5`})}):(0,I.jsx)(`span`,{className:`w-3 shrink-0`,style:{marginLeft:-4},"aria-hidden":`true`}),(0,I.jsx)(`div`,{className:`w-2 h-2 rounded-full shrink-0`,style:{backgroundColor:t.color||`#3b82f6`}}),n?(0,I.jsx)(`input`,{className:`border rounded px-1 py-0.5 text-xs w-full bg-background`,value:Rt.title||``,onChange:e=>zt(t=>({...t,title:e.target.value})),onKeyDown:e=>{e.key===`Enter`?(en([{task:t,changes:{title:Rt.title,start:new Date(Rt.start),end:new Date(Rt.end),progress:Number(Rt.progress)||0}}]),Lt(null)):e.key===`Escape`&&Lt(null)},onClick:e=>e.stopPropagation(),autoFocus:!0}):(0,I.jsxs)(`span`,{className:`flex flex-col min-w-0`,children:[(0,I.jsx)(`span`,{className:y(`truncate`,e.isSummary&&`font-semibold`),children:t.title}),(0,I.jsxs)(`span`,{className:`text-[10px] text-muted-foreground gantt-sm-hidden`,children:[e.start.toLocaleDateString(N,{month:`numeric`,day:`numeric`}),` → `,e.end.toLocaleDateString(N,{month:`numeric`,day:`numeric`})]})]})]}),(0,I.jsx)(`div`,{className:`w-16 gantt-sm-w20 text-right text-xs text-muted-foreground hidden sm:block`,hidden:!Ft,style:Ft?void 0:{display:`none`},children:n?(0,I.jsx)(`input`,{type:`date`,className:`border rounded px-1 py-0.5 text-xs w-full bg-background`,value:Rt.start||``,onChange:e=>zt(t=>({...t,start:e.target.value})),onClick:e=>e.stopPropagation()}):e.start.toLocaleDateString(N,{month:`numeric`,day:`numeric`})}),(0,I.jsx)(`div`,{className:`w-16 gantt-sm-w20 text-right text-xs text-muted-foreground hidden sm:block`,hidden:!Ft,style:Ft?void 0:{display:`none`},children:n?(0,I.jsx)(`input`,{type:`date`,className:`border rounded px-1 py-0.5 text-xs w-full bg-background`,value:Rt.end||``,onChange:e=>zt(t=>({...t,end:e.target.value})),onClick:e=>e.stopPropagation()}):e.end.toLocaleDateString(N,{month:`numeric`,day:`numeric`})}),a&&(0,I.jsx)(`div`,{className:`w-6 shrink-0 hidden sm:block`,style:{marginLeft:4},children:!n&&(0,I.jsx)(`button`,{type:`button`,title:j(`gantt.row.open`),"aria-label":j(`gantt.row.open`),"data-testid":`gantt-row-open-${t.id}`,className:`gantt-row-open-btn h-6 w-6 rounded-md flex items-center justify-center hover:bg-accent text-muted-foreground hover:text-foreground`,onClick:e=>{e.stopPropagation(),a(t)},children:(0,I.jsx)(be,{className:`h-3.5 w-3.5`})})})]},t.id)}),Q.endIdx<K.length&&(0,I.jsx)(`div`,{style:{height:(K.length-Q.endIdx)*B},"aria-hidden":`true`})]}),(0,I.jsx)(`div`,{className:`flex-1 overflow-auto bg-background/50 relative [-webkit-overflow-scrolling:touch]`,ref:e=>{rr.current=e,Z.current=e},onScroll:Wr,onTouchStart:xr,onTouchMove:Sr,onTouchEnd:Cr,"data-testid":`gantt-timeline`,children:(0,I.jsxs)(`div`,{className:`relative`,style:{width:Kn},children:[wr!=null&&(0,I.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px z-20 pointer-events-none`,style:{left:wr,backgroundColor:`rgba(239, 68, 68, 0.8)`},"data-testid":`gantt-today-marker`,"aria-label":j(`gantt.toolbar.today`),children:(0,I.jsx)(`div`,{className:`absolute -translate-x-1/2 left-0 text-[10px] font-semibold text-white rounded-sm px-1 py-0.5 whitespace-nowrap z-30`,style:{top:2,backgroundColor:`#ef4444`},children:j(`gantt.toolbar.today`)})}),er.map(e=>(0,I.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px z-20 pointer-events-none`,style:{left:e.left,backgroundColor:e.color},"data-testid":`gantt-marker-${e.index}`,"aria-label":e.label,children:e.label&&(0,I.jsx)(`div`,{className:`absolute -translate-x-1/2 left-0 text-[10px] font-semibold text-white rounded-sm px-1 py-0.5 whitespace-nowrap z-30`,style:{top:2,backgroundColor:e.color},children:e.label})},e.index)),(0,I.jsxs)(`div`,{className:`relative`,ref:yn,children:[(0,I.jsx)(`div`,{className:`absolute inset-0 pointer-events-none`,style:{zIndex:0},children:J.slice(pr.start,pr.end).map((e,t)=>{let n=pr.start+t;return(0,I.jsx)(`div`,{className:`absolute top-0 bottom-0 border-r`,style:{left:Y[n],width:e.width,backgroundColor:e.bandColor?`color-mix(in srgb, ${e.bandColor} 8%, transparent)`:e.isWeekend?`hsl(var(--muted) / 0.4)`:void 0}},n)})}),Un&&T&&T.showMidnight&&(0,I.jsx)(`div`,{className:`absolute inset-0 pointer-events-none`,style:{zIndex:0},children:J.slice(pr.start,pr.end).map((e,t)=>{let n=pr.start+t,r=e.realMs??0;if(!r)return null;let i=e.date.getTime(),a=e.date,o=new Date(a.getFullYear(),a.getMonth(),a.getDate()+1,0,0,0,0).getTime();return o<=i||o>=i+r?null:(0,I.jsx)(`div`,{className:`absolute top-0 bottom-0`,style:{left:Y[n]+(o-i)/r*e.width,borderLeft:`1px dashed hsl(var(--muted-foreground) / 0.4)`},"data-testid":`gantt-midnight-${n}`,"aria-hidden":`true`},`midnight-${n}`)})}),Q.startIdx>0&&(0,I.jsx)(`div`,{style:{height:Q.startIdx*B},"aria-hidden":`true`}),K.slice(Q.startIdx,Q.endIdx).map((e,t)=>{let n=e.task,r=Q.startIdx+t,i=mi(n.id),a=Kr(e.start,e.end),o=le&&n.baselineStart&&n.baselineEnd?Kr(n.baselineStart,n.baselineEnd):null,s=o?(0,I.jsx)(`div`,{className:`absolute pointer-events-none rounded-[1px]`,style:{left:o.left,width:Math.max(2,o.width),top:oi,height:ai,backgroundColor:si,border:`1px solid ${ci}`},"data-testid":`gantt-baseline-${n.id}`,"aria-hidden":`true`}):null,c=W?.taskId===n.id,l=Jr?.has(String(n.id))??!1,u=Yr?.has(String(n.id))??!1,d=c||l||u?Xr(e):a,f=!!n.locked,p=!!R&&!e.isSummary&&!f,m=p&&He,h=p&&Ue,g=p&&We,_=m||h,v=F||f,ee=G!=null&&G.targetId!=null&&String(G.targetId)===String(n.id)&&String(G.sourceId)!==String(n.id),te=G?e=>{let t=e.currentTarget.getBoundingClientRect(),r=t.width>0&&e.clientX-t.left>t.width/2?`end`:`start`;bn(e=>e&&vn(e.sourceId,n)?{...e,targetId:n.id,targetEnd:r}:e)}:void 0,b=G?e=>{e.target===e.currentTarget&&bn(e=>e&&{...e,targetId:null,targetEnd:null})}:void 0,x=Math.max(1,Math.round((e.end.getTime()-e.start.getTime())/$e)),ne=(r+1)*B+300>gr&&r*B>300,re=Bt===n.id&&!W&&!mn&&!G?(0,I.jsxs)(`div`,{className:`absolute z-30 pointer-events-none rounded-md border bg-popover text-popover-foreground px-2.5 py-1.5 text-xs shadow-md whitespace-nowrap`,style:{left:Math.max(d.left+8,4),...ne?{bottom:B-8}:{top:B-8}},role:`tooltip`,"data-testid":`gantt-tooltip-${n.id}`,children:[(0,I.jsx)(`div`,{className:`font-semibold`,children:n.title}),n.fields&&n.fields.length>0?(0,I.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`auto 1fr`,columnGap:10,rowGap:2,marginTop:4},children:n.fields.map((e,t)=>(0,I.jsxs)(O.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:e.label}),(0,I.jsx)(`span`,{style:{fontWeight:500},children:e.value})]},t))}):(0,I.jsxs)(`div`,{className:`text-muted-foreground`,children:[e.start.toLocaleDateString(N,{month:`short`,day:`numeric`}),` → `,e.end.toLocaleDateString(N,{month:`short`,day:`numeric`}),` · `,x,j(`gantt.tooltip.days`),` · `,Math.round(e.progress),`%`]}),n.locked||F&&!R?(0,I.jsxs)(`div`,{className:`text-muted-foreground`,style:{marginTop:4},"data-testid":`gantt-tooltip-locked-${n.id}`,children:[`🚫 `,j(`gantt.lockedHint`)]}):null]}):null;if(n.type===`group`)return(0,I.jsx)(`div`,{className:`relative border-b hover:bg-accent/50`,style:{height:B},onPointerMove:b,children:re},n.id);if(e.isSummary){let t=n.color||`#0d9488`,r=_e===`self`&&n.hasOwnDates!==!1,a=!!R&&He&&!f,o=!!R&&Ue&&r&&!f;return(0,I.jsxs)(`div`,{className:`relative border-b hover:bg-accent/50`,style:{height:B},onPointerMove:b,children:[s,(0,I.jsxs)(`div`,{className:y(`gantt-bar-hover absolute rounded-sm border shadow-sm flex items-center px-2 select-none group`,a&&`cursor-grab active:cursor-grabbing`,c&&`ring-2 ring-primary z-10`,ee&&`ring-2 ring-primary`,ir===n.id&&`gantt-flash z-10`),style:{left:d.left,width:d.width,top:ii,height:ri,cursor:a||o?void 0:v?`not-allowed`:`pointer`,backgroundColor:t,borderColor:i?$:n.borderColor||`hsl(var(--primary-foreground) / 0.2)`,boxShadow:i?`0 0 0 2px ${$}`:n.borderColor?`0 0 0 2px ${n.borderColor}`:void 0},"data-critical":i?`true`:void 0,"data-testid":`gantt-summary-bar-${n.id}`,"data-progress":Math.round(e.progress),onMouseEnter:()=>Vt(n.id),onMouseLeave:()=>Vt(e=>e===n.id?null:e),onPointerMove:te,onPointerDown:t=>{if(t.button===0){if(o){let e=Ke(t.clientX,t.currentTarget.getBoundingClientRect());if(e!==`move`){pn(n,e,t);return}}a&&pn(n,`move`,t,{group:!0,originStart:e.start,originEnd:e.end})}},onClick:()=>{qt.current||Pn(n.id)},onContextMenu:e=>In(n,e),children:[(0,I.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 pointer-events-none`,style:{width:`${Math.round(e.progress)}%`,backgroundColor:`rgba(0, 0, 0, 0.2)`,borderTopLeftRadius:`var(--radius-sm)`,borderBottomLeftRadius:`var(--radius-sm)`}}),o&&d.width>=14&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`gantt-resize-handle absolute left-0 top-0`,style:{width:L,height:ei,cursor:`ew-resize`},"data-testid":`gantt-task-resize-left-${n.id}`,onPointerDown:e=>{e.button===0&&pn(n,`resize-left`,e)},onClick:e=>e.stopPropagation()}),(0,I.jsx)(`div`,{className:`gantt-resize-handle absolute right-0 top-0`,style:{width:L,height:ei,cursor:`ew-resize`},"data-testid":`gantt-task-resize-right-${n.id}`,onPointerDown:e=>{e.button===0&&pn(n,`resize-right`,e)},onClick:e=>e.stopPropagation()})]}),(0,I.jsx)(`span`,{className:`relative text-[10px] text-white font-medium truncate pointer-events-none`,children:n.title}),z&&!f&&[`start`,`end`].map(e=>{let t=G!=null&&String(G.sourceId)===String(n.id)&&G.sourceEnd===e,r=t||Bt===n.id,i=r&&G==null;return(0,I.jsx)(`div`,{className:`absolute top-1/2 -translate-y-1/2 z-20 flex items-center transition-opacity`,style:{[e===`start`?`left`:`right`]:-28,height:24,width:30,cursor:`crosshair`,opacity:+!!r,pointerEvents:i?`auto`:`none`,justifyContent:e===`start`?`flex-start`:`flex-end`,paddingLeft:e===`start`?4:0,paddingRight:e===`end`?4:0},"data-testid":`gantt-link-dot-${e}-${n.id}`,onPointerDown:t=>{if(t.button!==0)return;t.stopPropagation(),t.preventDefault();let r=yn.current?.getBoundingClientRect();bn({sourceId:n.id,sourceEnd:e,x:r?t.clientX-r.left:0,y:r?t.clientY-r.top:0,targetId:null,targetEnd:null})},onClick:e=>e.stopPropagation(),children:(0,I.jsx)(`div`,{className:`rounded-full`,style:{height:12,width:12,backgroundColor:`hsl(var(--background))`,border:`2px solid hsl(var(--primary))`,boxShadow:t?`0 0 0 3px hsl(var(--primary) / 0.25)`:`0 1px 2px rgba(0,0,0,0.25)`}})},e)})]}),c&&W&&(0,I.jsxs)(`div`,{className:`absolute z-30 pointer-events-none rounded border bg-popover text-popover-foreground px-1.5 py-0.5 text-[10px] shadow whitespace-nowrap`,style:{left:Math.max(d.left,4),top:ii+ri+2},"data-testid":`gantt-summary-drag-chip-${n.id}`,children:[Jt(W).start.toLocaleDateString(N,{month:`numeric`,day:`numeric`}),` → `,Jt(W).end.toLocaleDateString(N,{month:`numeric`,day:`numeric`})]}),re]},n.id)}if(e.isMilestone){let e=ti;return(0,I.jsxs)(`div`,{className:`relative border-b hover:bg-accent/50`,style:{height:B},onPointerMove:b,children:[s,(0,I.jsx)(`div`,{className:y(`gantt-bar-hover absolute rotate-45 rounded-[2px] border shadow-sm select-none`,m&&`cursor-grab active:cursor-grabbing`,c&&`ring-2 ring-primary z-10`,ee&&`ring-2 ring-primary`,ir===n.id&&`gantt-flash z-10`),style:{left:d.left-e/2,top:(B-e)/2,width:e,height:e,cursor:m?void 0:v?`not-allowed`:`pointer`,backgroundColor:i?$:n.color||`#3b82f6`,borderColor:i?$:n.borderColor||`hsl(var(--primary-foreground) / 0.2)`,boxShadow:i?`0 0 0 2px ${$}`:n.borderColor?`0 0 0 2px ${n.borderColor}`:void 0},"data-critical":i?`true`:void 0,"data-testid":`gantt-milestone-${n.id}`,onMouseEnter:()=>Vt(n.id),onMouseLeave:()=>Vt(e=>e===n.id?null:e),onClick:()=>{qt.current||Pn(n.id)},onContextMenu:e=>In(n,e),onPointerMove:te,onPointerDown:m?e=>{e.button===0&&pn(n,`move`,e)}:void 0}),re]},n.id)}let ie=mn&&mn.taskId===n.id?mn.value:n.progress;return(0,I.jsxs)(`div`,{className:`relative border-b hover:bg-accent/50`,style:{height:B},onPointerMove:b,onMouseEnter:()=>Vt(n.id),onMouseLeave:()=>Vt(e=>e===n.id?null:e),children:[c&&(0,I.jsx)(`div`,{className:`absolute rounded-sm border border-dashed pointer-events-none`,style:{left:a.left,width:a.width,top:Qr,height:$r,opacity:.35,borderColor:`hsl(var(--primary) / 0.6)`},"aria-hidden":`true`}),s,(0,I.jsxs)(`div`,{className:y(`gantt-bar-hover absolute rounded-sm bg-primary border shadow-sm flex items-center px-2 group select-none`,_&&`cursor-grab active:cursor-grabbing`,c&&`ring-2 ring-primary z-10`,ee&&`ring-2 ring-primary`,ir===n.id&&`gantt-flash z-10`),style:{left:d.left,width:d.width,top:Qr,height:$r,cursor:_?void 0:v?`not-allowed`:`pointer`,backgroundColor:n.color||`#3b82f6`,borderColor:i?$:n.borderColor||`hsl(var(--primary-foreground) / 0.2)`,boxShadow:i?`0 0 0 2px ${$}`:n.borderColor?`0 0 0 2px ${n.borderColor}`:void 0},"data-critical":i?`true`:void 0,"data-testid":`gantt-task-bar-${n.id}`,onClick:()=>{qt.current||Pn(n.id)},onContextMenu:e=>In(n,e),onPointerMove:te,onPointerDown:_?e=>{if(e.button!==0)return;let t=Ke(e.clientX,e.currentTarget.getBoundingClientRect()),r=t!==`move`&&h?t:m?`move`:null;r&&pn(n,r,e)}:void 0,children:[h&&d.width>=14&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`gantt-resize-handle absolute left-0 top-0`,style:{width:L,height:ei,cursor:`ew-resize`},"data-testid":`gantt-task-resize-left-${n.id}`,onPointerDown:e=>{e.button===0&&pn(n,`resize-left`,e)},onClick:e=>e.stopPropagation()}),(0,I.jsx)(`div`,{className:`gantt-resize-handle absolute right-0 top-0`,style:{width:L,height:ei,cursor:`ew-resize`},"data-testid":`gantt-task-resize-right-${n.id}`,onPointerDown:e=>{e.button===0&&pn(n,`resize-right`,e)},onClick:e=>e.stopPropagation()})]}),ie>0&&(0,I.jsx)(`div`,{className:`absolute left-0 top-0 bottom-0 pointer-events-none`,style:{width:`${ie}%`,backgroundColor:`rgba(0, 0, 0, 0.2)`,borderTopLeftRadius:`var(--radius-sm)`,borderBottomLeftRadius:`var(--radius-sm)`}}),g&&d.width>=30&&(0,I.jsx)(`div`,{className:y(`absolute bottom-0 h-1/2 w-4 -translate-x-1/2 cursor-col-resize flex items-end justify-center pb-px`,mn?.taskId===n.id?`opacity-100`:`opacity-0 group-hover:opacity-100 transition-opacity`),style:{left:`${ie}%`},"data-testid":`gantt-progress-handle-${n.id}`,onPointerDown:e=>{e.button===0&&(e.stopPropagation(),e.preventDefault(),hn({taskId:n.id,originClientX:e.clientX,originProgress:n.progress,barWidth:d.width,value:n.progress}))},onClick:e=>e.stopPropagation(),children:(0,I.jsx)(`div`,{style:{width:0,height:0,borderLeft:`5px solid transparent`,borderRight:`5px solid transparent`,borderBottom:`7px solid #fff`,filter:`drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35))`}})}),z&&!f&&[`start`,`end`].map(e=>{let t=G!=null&&String(G.sourceId)===String(n.id)&&G.sourceEnd===e,r=t||Bt===n.id,i=r&&G==null;return(0,I.jsx)(`div`,{className:`absolute top-1/2 -translate-y-1/2 z-20 flex items-center transition-opacity`,style:{[e===`start`?`left`:`right`]:-28,height:24,width:30,cursor:`crosshair`,opacity:+!!r,pointerEvents:i?`auto`:`none`,justifyContent:e===`start`?`flex-start`:`flex-end`,paddingLeft:e===`start`?4:0,paddingRight:e===`end`?4:0},"data-testid":`gantt-link-dot-${e}-${n.id}`,onPointerDown:t=>{if(t.button!==0)return;t.stopPropagation(),t.preventDefault();let r=yn.current?.getBoundingClientRect();bn({sourceId:n.id,sourceEnd:e,x:r?t.clientX-r.left:0,y:r?t.clientY-r.top:0,targetId:null,targetEnd:null})},onClick:e=>e.stopPropagation(),children:(0,I.jsx)(`div`,{className:`rounded-full`,style:{height:12,width:12,backgroundColor:`hsl(var(--background))`,border:`2px solid hsl(var(--primary))`,boxShadow:t?`0 0 0 3px hsl(var(--primary) / 0.25)`:`0 1px 2px rgba(0,0,0,0.25)`}})},e)}),(0,I.jsx)(`span`,{className:`relative text-[10px] text-white font-medium truncate pointer-events-none group-hover:opacity-0 transition-opacity`,children:n.title}),(0,I.jsx)(`span`,{className:`absolute inset-0 flex items-center px-2 text-[10px] text-white font-medium truncate opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none`,children:c?`${Jt(W).start.toLocaleDateString(N,{month:`numeric`,day:`numeric`})} → ${Jt(W).end.toLocaleDateString(N,{month:`numeric`,day:`numeric`})}`:`${Math.round(ie)}%`})]}),re]},n.id)}),Q.endIdx<K.length&&(0,I.jsx)(`div`,{style:{height:(K.length-Q.endIdx)*B},"aria-hidden":`true`}),(Zr.length>0||G)&&(0,I.jsxs)(`svg`,{className:`absolute top-0 left-0 pointer-events-none z-10`,width:Kn,height:gr,"data-testid":`gantt-links`,"aria-hidden":`true`,children:[(0,I.jsxs)(`defs`,{children:[(0,I.jsx)(`marker`,{id:`gantt-link-arrow`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,I.jsx)(`path`,{d:`M 0 0 L 8 4 L 0 8 z`,fill:`hsl(var(--muted-foreground))`})}),(0,I.jsx)(`marker`,{id:`gantt-link-arrow-active`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,I.jsx)(`path`,{d:`M 0 0 L 8 4 L 0 8 z`,fill:`hsl(var(--primary))`})}),(0,I.jsx)(`marker`,{id:`gantt-link-arrow-critical`,viewBox:`0 0 8 8`,refX:`7`,refY:`4`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,I.jsx)(`path`,{d:`M 0 0 L 8 4 L 0 8 z`,fill:$})})]}),Zr.map(e=>{let t=Math.min(e.sourceIndex,e.targetIndex);if(Math.max(e.sourceIndex,e.targetIndex)<Q.startIdx-6||t>Q.endIdx+6)return null;let n=li(e);if(!n)return null;let r=ui!=null&&(String(e.sourceId)===String(ui)||String(e.targetId)===String(ui)),i=pi?.criticalEdges.has(`${String(e.sourceId)}->${String(e.targetId)}`)??!1,a=i?`gantt-link-arrow-critical`:r?`gantt-link-arrow-active`:`gantt-link-arrow`,o=!!(ft||z);return(0,I.jsxs)(O.Fragment,{children:[(0,I.jsx)(`path`,{d:n,fill:`none`,stroke:i?$:r?`hsl(var(--primary))`:`hsl(var(--muted-foreground))`,strokeOpacity:i||r?1:.7,strokeWidth:i||r?2:1.5,markerEnd:`url(#${a})`,"data-testid":`gantt-link-${e.sourceId}-${e.targetId}`,"data-link-type":e.type,"data-active":r?`true`:`false`,"data-critical":i?`true`:void 0}),o&&(0,I.jsx)(`path`,{d:n,fill:`none`,stroke:`transparent`,strokeWidth:10,style:{pointerEvents:`stroke`,cursor:`context-menu`},"data-testid":`gantt-link-hit-${e.sourceId}-${e.targetId}`,onContextMenu:t=>Ln(e.sourceId,e.targetId,e.type,t)})]},e.key)}),G&&(()=>{let e=K.findIndex(e=>String(e.task.id)===String(G.sourceId));if(e<0)return null;let t=Xr(K[e]),n=K[e].isMilestone?t.left+(G.sourceEnd===`start`?-ni:ni):G.sourceEnd===`start`?t.left:t.left+t.width,r=e*B+B/2;return(0,I.jsx)(`path`,{d:`M ${Math.round(n)} ${Math.round(r)} L ${Math.round(G.x)} ${Math.round(G.y)}`,fill:`none`,stroke:`hsl(var(--primary))`,strokeWidth:1.5,strokeDasharray:`4 3`,"data-testid":`gantt-link-draft`})})()]}),G&&(()=>{let e=A.find(e=>String(e.id)===String(G.sourceId));if(!e)return null;let t=G.targetId==null?null:A.find(e=>String(e.id)===String(G.targetId)),n=e=>j(`gantt.linkEnd.${e}`),r=t?`${e.title} (${n(G.sourceEnd)}) → ${t.title} (${n(G.targetEnd??`start`)})`:`${e.title} (${n(G.sourceEnd)})`;return(0,I.jsx)(`div`,{className:`absolute z-30 pointer-events-none rounded-md border bg-popover text-popover-foreground px-2 py-1 text-[11px] font-medium shadow-md whitespace-nowrap`,style:{left:G.x+12,top:G.y+12},"data-testid":`gantt-link-draft-hint`,children:r})})()]})]})}),(0,I.jsx)(`div`,{ref:Fr,className:`shrink-0 border-l bg-card/95 select-none`,style:{width:14,display:`none`},"data-testid":`gantt-vscrollbar`,children:(0,I.jsx)(`div`,{ref:Ir,className:`relative h-full`,onPointerDown:Ur,role:`scrollbar`,"aria-controls":`gantt-timeline`,"aria-orientation":`vertical`,children:(0,I.jsx)(`div`,{ref:Lr,className:`absolute rounded-full`,style:{left:2,right:2,top:0,height:0,backgroundColor:`rgba(130,130,130,0.55)`,cursor:`grab`},"data-testid":`gantt-vscrollbar-thumb`,onPointerDown:Hr})})})]}),(0,I.jsx)(`div`,{ref:jr,className:`shrink-0 border-t bg-card/95 select-none`,style:{position:`sticky`,bottom:0,zIndex:30,display:`none`},"data-testid":`gantt-hscrollbar`,children:(0,I.jsx)(`div`,{ref:Mr,className:`relative`,style:{marginLeft:H,height:14},onPointerDown:Vr,role:`scrollbar`,"aria-controls":`gantt-timeline`,"aria-orientation":`horizontal`,children:(0,I.jsx)(`div`,{ref:Nr,className:`absolute rounded-full`,style:{top:2,bottom:2,left:0,width:0,backgroundColor:`rgba(130,130,130,0.55)`,cursor:`grab`},"data-testid":`gantt-hscrollbar-thumb`,onPointerDown:Br})})})]}),Sn&&(()=>{let e=A.find(e=>String(e.id)===String(Sn.taskId));if(!e)return null;let t=K.find(e=>String(e.task.id)===String(Sn.taskId)),n=`w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none`;return(0,I.jsxs)(`div`,{ref:wn,className:`fixed z-50 min-w-[160px] rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm`,style:{left:Sn.x,top:Sn.y},role:`menu`,"data-testid":`gantt-context-menu`,children:[a&&(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:n,"data-testid":`gantt-context-menu-view`,onClick:()=>{Cn(null),a(e)},children:j(`gantt.menu.view`)}),mt&&R&&t&&!t.isSummary&&!e.locked&&(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:n,"data-testid":`gantt-context-menu-edit`,onClick:()=>{Cn(null),Lt(e.id),zt({title:e.title,start:e.start.toLocaleDateString(`en-CA`),end:e.end.toLocaleDateString(`en-CA`),progress:String(e.progress)})},children:j(`gantt.menu.edit`)}),z&&t&&!t.isMilestone&&!e.locked&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:n,"data-testid":`gantt-context-menu-add-predecessor`,onClick:()=>{let t=Sn;Cn(null),jn(``),kn({x:t.x,y:t.y,taskId:e.id,relation:`pred`})},children:j(`gantt.menu.addPredecessor`)}),(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:n,"data-testid":`gantt-context-menu-add-successor`,onClick:()=>{let t=Sn;Cn(null),jn(``),kn({x:t.x,y:t.y,taskId:e.id,relation:`succ`})},children:j(`gantt.menu.addSuccessor`)})]}),dt&&!e.locked&&(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:y(n,`text-destructive`),"data-testid":`gantt-context-menu-delete`,onClick:()=>{Cn(null),dt(e)},children:j(`gantt.menu.delete`)})]})})(),Tn&&(()=>{let e=A.find(e=>String(e.id)===String(Tn.sourceId)),t=A.find(e=>String(e.id)===String(Tn.targetId));if(!e||!t)return null;let n=`w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none`,r=[`fs`,`ss`,`ff`,`sf`],i=!!t.locked;return(0,I.jsxs)(`div`,{ref:Dn,className:`fixed z-50 min-w-[180px] rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm`,style:{left:Tn.x,top:Tn.y},role:`menu`,"data-testid":`gantt-link-context-menu`,children:[(0,I.jsxs)(`div`,{className:`px-3 py-1 text-xs text-muted-foreground truncate`,children:[e.title,` → `,t.title]}),i&&(0,I.jsxs)(`div`,{className:`px-3 py-1 text-xs text-muted-foreground`,"data-testid":`gantt-link-menu-locked`,children:[`🚫 `,j(`gantt.lockedHint`)]}),z&&Te&&r.map(r=>(0,I.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":Tn.type===r,disabled:i,className:y(n,Tn.type===r&&`font-semibold`,i&&`opacity-50 cursor-not-allowed hover:bg-transparent`),"data-testid":`gantt-link-menu-type-${r}`,onClick:()=>{i||(En(null),r!==Tn.type&&z(e,t,r))},children:[Tn.type===r?`✓ `:`\xA0\xA0`,j(`gantt.linkType.${r}`)]},r)),ft&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`my-1 border-t`}),(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,disabled:i,className:y(n,`text-destructive`,i&&`opacity-50 cursor-not-allowed hover:bg-transparent`),"data-testid":`gantt-link-menu-remove`,onClick:()=>{i||(En(null),ft(e,t))},children:j(`gantt.menu.removeDependency`)})]})]})})(),On&&z&&(()=>{let e=A.find(e=>String(e.id)===String(On.taskId));if(!e)return null;let t=new Set(Zr.map(e=>`${String(e.sourceId)}->${String(e.targetId)}`)),n=A.filter(n=>{if(String(n.id)===String(e.id)||n.type===`group`||n.locked)return!1;let r=On.relation===`pred`?`${String(n.id)}->${String(e.id)}`:`${String(e.id)}->${String(n.id)}`;return!t.has(r)}),r=An.trim().toLowerCase(),i=r?n.filter(e=>String(e.title??``).toLowerCase().includes(r)):n;return(0,I.jsxs)(`div`,{ref:Mn,className:`fixed z-50 min-w-[200px] max-h-[280px] overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md py-1 text-sm`,style:{left:On.x,top:On.y},role:`menu`,"data-testid":`gantt-dep-picker`,children:[(0,I.jsx)(`div`,{className:`px-3 py-1 text-xs text-muted-foreground`,children:On.relation===`pred`?j(`gantt.menu.addPredecessor`):j(`gantt.menu.addSuccessor`)}),(0,I.jsx)(`div`,{className:`px-2 pb-1`,children:(0,I.jsx)(`input`,{className:`border rounded px-2 py-1 text-sm w-full bg-background`,value:An,onChange:e=>jn(e.target.value),placeholder:j(`gantt.menu.searchTasks`),"data-testid":`gantt-dep-picker-search`,autoFocus:!0})}),i.length===0?(0,I.jsx)(`div`,{className:`px-3 py-1.5 text-muted-foreground`,children:j(`gantt.menu.noCandidates`)}):i.map(t=>(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:`w-full text-left px-3 py-1.5 hover:bg-accent focus:bg-accent outline-none truncate`,"data-testid":`gantt-dep-picker-option-${t.id}`,onClick:()=>{kn(null),On.relation===`pred`?z(t,e,`fs`):z(e,t,`fs`)},children:t.title},String(t.id)))]})})(),hi&&(0,I.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/30`,"data-testid":`gantt-autoschedule-overlay`,onClick:()=>gi(null),children:(0,I.jsxs)(`div`,{className:`min-w-[280px] max-w-[360px] rounded-lg border bg-popover text-popover-foreground shadow-lg p-4`,role:`alertdialog`,"aria-modal":`true`,"data-testid":`gantt-autoschedule-dialog`,onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`div`,{className:`text-sm font-semibold mb-1`,"data-testid":`gantt-autoschedule-title`,children:j(`gantt.autoScheduleDlg.title`)}),(0,I.jsxs)(`div`,{className:`text-sm text-muted-foreground mb-3`,children:[j(`gantt.autoScheduleDlg.body`).replace(`{count}`,String(hi.changes.length)),hi.skipped>0&&(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`span`,{"data-testid":`gantt-autoschedule-skipped`,children:j(`gantt.autoScheduleDlg.skipped`).replace(`{count}`,String(hi.skipped))})]})]}),(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,className:`px-3 py-1.5 text-sm rounded-md border hover:bg-accent outline-none`,"data-testid":`gantt-autoschedule-cancel`,onClick:()=>gi(null),children:j(`gantt.autoScheduleDlg.cancel`)}),(0,I.jsx)(`button`,{type:`button`,className:`px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:opacity-90 outline-none`,"data-testid":`gantt-autoschedule-confirm`,onClick:bi,children:j(`gantt.autoScheduleDlg.confirm`)})]})]})}),_i&&(0,I.jsx)(`div`,{className:`fixed bottom-6 left-1/2 -translate-x-1/2 z-[60] rounded-md border bg-popover text-popover-foreground px-3 py-1.5 text-sm shadow-md`,role:`status`,"data-testid":`gantt-autoschedule-clean`,children:j(`gantt.autoScheduleDlg.none`)}),tn&&(0,I.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/30`,"data-testid":`gantt-conflict-overlay`,onClick:()=>nn(null),children:(0,I.jsxs)(`div`,{className:`min-w-[280px] max-w-[360px] rounded-lg border bg-popover text-popover-foreground shadow-lg p-4`,role:`alertdialog`,"aria-modal":`true`,"data-testid":`gantt-conflict-dialog`,onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`div`,{className:`text-sm font-semibold mb-1`,"data-testid":`gantt-conflict-title`,children:j(`gantt.conflict.title`)}),(0,I.jsx)(`div`,{className:`text-sm text-muted-foreground mb-3`,children:j(`gantt.conflict.body`).replace(`{count}`,String(tn.length))}),(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,className:`px-3 py-1.5 text-sm rounded-md border hover:bg-accent outline-none`,"data-testid":`gantt-conflict-cancel`,onClick:()=>nn(null),children:j(`gantt.conflict.cancel`)}),(0,I.jsx)(`button`,{type:`button`,className:`px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:opacity-90 outline-none`,"data-testid":`gantt-conflict-confirm`,onClick:sn,children:j(`gantt.conflict.confirm`)})]})]})})]})}function z(e,t,n,r){return t.getTime()===e.getTime()?e.getTime()>=n.getTime()&&e.getTime()<r.getTime():e.getTime()<r.getTime()&&t.getTime()>n.getTime()}function ft(e,t,n){let{assignee:r,effort:i,capacity:a=1,unassignedLabel:o=`Unassigned`}=n,s=e=>typeof a==`function`?a(e):a,c=e=>{let t=i?i(e):1;return Number.isFinite(t)&&t>0?t:0},l=new Map;for(let t of e){let e=r(t),n=e?String(e.key):`__unassigned__`,i=e?e.label:o,a=l.get(n);a||(a={key:n,label:i,items:[]},l.set(n,a)),a.items.push(t)}let u=[];for(let e of l.values()){let n=s(e.key),r=0,i=0,a=t.map(t=>{let a=0;for(let n of e.items)z(n.start,n.end,t.start,t.end)&&(a+=c(n));a>r&&(r=a);let o=a>n+1e-9;return o&&i++,{load:a,capacity:n,overloaded:o}});u.push({key:e.key,label:e.label,capacity:n,cells:a,peak:r,overloadedCount:i})}return u}var pt={day:26,week:56,month:76,quarter:88,year:104},mt=48,ht=34,gt=180;function B(e,t,n){return t===`day`?String(e.getDate()):t===`week`?e.toLocaleDateString(n,{month:`numeric`,day:`numeric`}):t===`month`?e.toLocaleDateString(n,{month:`short`}):t===`year`?String(e.getFullYear()):`Q${Math.floor(e.getMonth()/3)+1}`}function _t({tasks:e,assignee:t,effort:n,capacity:r=1,viewMode:i=`day`,unassignedLabel:a=`Unassigned`,className:o}){let{t:s,language:c}=Ge(),l=c||void 0,u=pt[i],d=O.useMemo(()=>{if(!e.length)return[];let t=new Date(Math.min(...e.map(e=>e.start.getTime()))),n=new Date(Math.max(...e.map(e=>e.end.getTime()))),r=nt(t,i),a=it(nt(n,i),1,i),o=[],s=0;for(;r<a&&s++<4e3;){let e=it(r,1,i);o.push({date:new Date(r),col:{start:new Date(r),end:new Date(e)},label:B(r,i,l)}),r=e}return o},[e,i,l]),f=O.useMemo(()=>ft(e,d.map(e=>e.col),{assignee:t,effort:n,capacity:r,unassignedLabel:a}),[e,d,t,n,r,a]),p=O.useMemo(()=>{let e=0;for(let t of f)e=Math.max(e,t.peak,t.capacity);return e||1},[f]),m=d.length*u;return e.length?(0,I.jsx)(`div`,{className:o,"data-testid":`resource-workload`,style:{display:`flex`,flexDirection:`column`,height:`100%`,overflow:`auto`},children:(0,I.jsxs)(`div`,{style:{display:`flex`,minWidth:gt+m},children:[(0,I.jsxs)(`div`,{style:{width:gt,flexShrink:0},children:[(0,I.jsx)(`div`,{style:{height:28,display:`flex`,alignItems:`center`,padding:`0 12px`,fontSize:12,fontWeight:600,borderBottom:`1px solid hsl(var(--border))`},children:s(`gantt.resource.header`)}),f.map(e=>(0,I.jsxs)(`div`,{"data-testid":`resource-row-${e.key}`,style:{height:mt,display:`flex`,flexDirection:`column`,justifyContent:`center`,padding:`0 12px`,borderBottom:`1px solid hsl(var(--border) / 0.5)`},children:[(0,I.jsx)(`span`,{style:{fontSize:13,fontWeight:500,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:e.label}),(0,I.jsxs)(`span`,{"data-testid":`resource-peak-${e.key}`,"data-overloaded":e.overloadedCount>0?`true`:void 0,style:{fontSize:10,color:e.overloadedCount>0?`hsl(var(--destructive))`:`hsl(var(--muted-foreground))`},children:[s(`gantt.resource.peak`),`: `,Math.round(e.peak*100)/100,` / `,e.capacity,e.overloadedCount>0?` · ${e.overloadedCount} ${s(`gantt.resource.over`)}`:``]})]},e.key))]}),(0,I.jsxs)(`div`,{style:{flex:1},children:[(0,I.jsx)(`div`,{style:{display:`flex`,height:28,borderBottom:`1px solid hsl(var(--border))`},children:d.map((e,t)=>(0,I.jsx)(`div`,{style:{width:u,flexShrink:0,textAlign:`center`,fontSize:10,color:`hsl(var(--muted-foreground))`,borderLeft:`1px solid hsl(var(--border) / 0.4)`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:e.label},t))}),f.map(e=>{let t=ht*(1-Math.min(e.capacity/p,1));return(0,I.jsxs)(`div`,{style:{position:`relative`,display:`flex`,height:mt,borderBottom:`1px solid hsl(var(--border) / 0.5)`},children:[(0,I.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,left:0,right:0,top:(mt-ht)/2+t,borderTop:`1px dashed hsl(var(--muted-foreground) / 0.6)`,pointerEvents:`none`,zIndex:1}}),e.cells.map((t,n)=>{let r=Math.max(t.load>0?2:0,ht*Math.min(t.load/p,1));return(0,I.jsx)(`div`,{"data-testid":`resource-cell-${e.key}-${n}`,"data-load":t.load,"data-overloaded":t.overloaded?`true`:void 0,title:`${d[n]?.date.toLocaleDateString(l)} — ${Math.round(t.load*100)/100} / ${t.capacity}`,style:{width:u,flexShrink:0,position:`relative`,borderLeft:`1px solid hsl(var(--border) / 0.4)`,display:`flex`,alignItems:`flex-end`,justifyContent:`center`,paddingBottom:(mt-ht)/2},children:t.load>0&&(0,I.jsx)(`div`,{style:{width:u-6,height:r,borderRadius:2,backgroundColor:t.overloaded?`hsl(var(--destructive))`:`hsl(var(--primary))`,opacity:t.overloaded?.9:.75}})},n)})]},e.key)})]})]})}):(0,I.jsx)(`div`,{className:o,"data-testid":`resource-workload`,children:(0,I.jsx)(`div`,{className:`flex items-center justify-center h-40 text-sm text-muted-foreground`,children:s(`gantt.resource.empty`)})})}var vt={display:`flex`,flexWrap:`wrap`,alignItems:`center`,gap:8,padding:`8px 12px`,borderBottom:`1px solid hsl(var(--border))`,background:`hsl(var(--background))`,fontSize:13},yt={display:`inline-flex`,alignItems:`center`,gap:6,height:30,padding:`0 10px`,borderRadius:6,border:`1px solid hsl(var(--border))`,background:`hsl(var(--background))`,color:`hsl(var(--foreground))`,cursor:`pointer`,whiteSpace:`nowrap`,lineHeight:`28px`},bt={position:`absolute`,top:`calc(100% + 4px)`,left:0,zIndex:50,minWidth:200,maxHeight:320,overflowY:`auto`,padding:4,borderRadius:8,border:`1px solid hsl(var(--border))`,background:`hsl(var(--popover, var(--background)))`,color:`hsl(var(--popover-foreground, var(--foreground)))`,boxShadow:`0 8px 24px rgba(0,0,0,0.18)`},xt={display:`flex`,alignItems:`center`,gap:8,padding:`6px 8px`,borderRadius:6,cursor:`pointer`,userSelect:`none`};function St({checked:e}){return(0,I.jsx)(`span`,{"aria-hidden":!0,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:15,height:15,flex:`0 0 auto`,borderRadius:3,border:`1px solid ${e?`hsl(var(--primary))`:`hsl(var(--border))`}`,background:e?`hsl(var(--primary))`:`transparent`,color:`hsl(var(--primary-foreground, var(--background)))`,fontSize:11,lineHeight:1},children:e?`✓`:``})}function Ct({filter:e,selected:t,onChange:n,labels:r}){let[i,a]=(0,O.useState)(!1),o=(0,O.useRef)(null);(0,O.useEffect)(()=>{if(!i)return;let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[i]);let s=new Set(t),c=t.length,l=e.options.length>0&&c===e.options.length,u=t=>{let r=new Set(s);r.has(t)?r.delete(t):r.add(t),r.size===e.options.length?n([]):n([...r])},d=()=>{n(c>0?[]:e.options.map(e=>e.value))},f=c===0?e.label:c===1?`${e.label}: ${e.options.find(e=>e.value===t[0])?.label??t[0]}`:`${e.label} · ${c}`;return(0,I.jsxs)(`div`,{ref:o,style:{position:`relative`},"data-testid":`quick-filter-${e.field}`,children:[(0,I.jsxs)(`button`,{type:`button`,style:{...yt,borderColor:c>0?`hsl(var(--primary))`:`hsl(var(--border))`,color:c>0?`hsl(var(--primary))`:`hsl(var(--foreground))`},"aria-haspopup":`listbox`,"aria-expanded":i,"data-testid":`quick-filter-trigger-${e.field}`,onClick:()=>a(e=>!e),children:[(0,I.jsx)(`span`,{children:f}),(0,I.jsx)(`span`,{"aria-hidden":!0,style:{fontSize:10,opacity:.7},children:`▾`})]}),i&&(0,I.jsx)(`div`,{role:`listbox`,style:bt,"data-testid":`quick-filter-panel-${e.field}`,children:e.options.length===0?(0,I.jsx)(`div`,{style:{...xt,cursor:`default`,opacity:.6},children:r.empty}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{role:`option`,"aria-selected":l,style:{...xt,fontWeight:600},"data-testid":`quick-filter-all-${e.field}`,onClick:()=>d(),children:[(0,I.jsx)(St,{checked:l}),(0,I.jsx)(`span`,{children:r.all})]}),(0,I.jsx)(`div`,{style:{height:1,background:`hsl(var(--border))`,margin:`2px 0`}}),e.options.map(t=>{let n=s.has(t.value);return(0,I.jsxs)(`div`,{role:`option`,"aria-selected":n,style:{...xt,background:n?`hsl(var(--accent, var(--muted)))`:`transparent`},"data-testid":`quick-filter-option-${e.field}-${t.value}`,onClick:()=>u(t.value),children:[(0,I.jsx)(St,{checked:n}),(0,I.jsx)(`span`,{children:t.label})]},t.value)})]})})]})}var V=({filters:e,value:t,onChange:n,onClear:r,resultCount:i,totalCount:a,labels:o,className:s})=>{if(!e.length)return null;let c=o?.all??`All`,l=o?.empty??`No options`,u=o?.clear??`Clear`,d=e.some(e=>(t[e.field]?.length??0)>0);return(0,I.jsxs)(`div`,{style:vt,className:s,"data-testid":`quick-filter-bar`,children:[e.map(e=>(0,I.jsx)(Ct,{filter:e,selected:t[e.field]??[],onChange:t=>n(e.field,t),labels:{all:c,empty:l}},e.field)),d&&(0,I.jsx)(`button`,{type:`button`,style:{...yt,height:28,color:`hsl(var(--muted-foreground))`},"data-testid":`quick-filter-clear`,onClick:r,children:u}),o?.resultSummary&&i!=null&&a!=null&&(0,I.jsx)(`span`,{"data-testid":`quick-filter-summary`,style:{marginLeft:`auto`,color:`hsl(var(--muted-foreground))`},children:o.resultSummary(i,a)})]})};function wt(e){if(e==null)return;let t=String(e).toLowerCase().trim();if(t===`milestone`)return`milestone`;if(t===`group`||t===`folder`)return`group`;if(t===`summary`||t===`project`||t===`phase`)return`summary`;if(t===`task`)return`task`}var Tt={fs:`fs`,ss:`ss`,ff:`ff`,sf:`sf`,finish_to_start:`fs`,start_to_start:`ss`,finish_to_finish:`ff`,start_to_finish:`sf`,end_to_start:`fs`,end_to_end:`ff`,start_to_end:`sf`};function Et(e){if(e==null||e===``)return[];if(typeof e==`string`)return e.split(`,`).map(e=>e.trim()).filter(Boolean);if(typeof e==`number`)return[e];if(!Array.isArray(e))return[];let t=[];for(let n of e)if(!(n==null||n===``))if(typeof n==`object`){let e=n.id??n._id??n.task??n.target;if(e==null||e===``)continue;let r=Tt[String(n.type??``).toLowerCase().replace(/-/g,`_`)];t.push(r?{id:e,type:r}:{id:e})}else t.push(n);return t}function Dt(e){return e.data?e.data:e.staticData?{provider:`value`,items:e.staticData}:e.objectName?{provider:`object`,object:e.objectName}:null}function Ot(e){if(e){if(typeof e==`string`){let t=e.split(` `),n=t[0],r=t[1]?.toLowerCase()===`desc`?`desc`:`asc`;return{[n]:r}}if(Array.isArray(e))return e.reduce((e,t)=>(t.field&&t.order&&(e[t.field]=t.order),e),{})}}function kt(e){let t=e instanceof Error?e.message:String(e??``),n=t.indexOf(`{`);if(n>=0)try{let e=JSON.parse(t.slice(n)),r=e?.message??e?.error;if(typeof r==`string`&&r.trim())return r}catch{}return null}function At(e){let t=null;if(e.startDateField&&e.endDateField)return t={startDateField:e.startDateField,endDateField:e.endDateField,titleField:e.titleField||`name`,progressField:e.progressField,dependenciesField:e.dependenciesField||e.dependencyField,colorField:e.colorField,borderColorField:e.borderColorField,parentField:e.parentField,typeField:e.typeField,lockField:e.lockField,objectField:e.objectField,summaryExtent:e.summaryExtent,defaultCollapsedDepth:e.defaultCollapsedDepth,tooltipFields:e.tooltipFields,baselineStartField:e.baselineStartField,baselineEndField:e.baselineEndField,groupByField:e.groupByField,resourceView:e.resourceView,assigneeField:e.assigneeField,effortField:e.effortField,capacity:e.capacity,quickFilters:e.quickFilters,autoZoomToFilter:e.autoZoomToFilter,timeSegments:e.timeSegments,interactions:e.interactions,exportFileName:e.exportFileName,timeZone:e.timeZone,dependencyTypes:e.dependencyTypes},t;if(e.gantt&&(t=e.gantt),t){let e=d.safeParse(t);return e.success||console.warn(`[ObjectGantt] Invalid gantt configuration:`,e.error.format()),t}return null}var jt=({schema:e,dataSource:t,className:n,onTaskClick:r,onRowClick:s,onBeforeTaskUpdate:u,...d})=>{let[f,p]=(0,O.useState)([]),[g,v]=(0,O.useState)(!0),[ee,te]=(0,O.useState)(null),[b,x]=(0,O.useState)(null),{currency:ne}=_(),{t:S}=Ge(),oe=(0,O.useCallback)(e=>{Te.error(S(`gantt.writeFailed`),{description:kt(e)??void 0})},[S]),se=Dt(e),C=(0,O.useMemo)(()=>se,[JSON.stringify(se)]),w=At(e),ce=C?.provider===`value`,E=(0,O.useMemo)(()=>c(C,t??null),[C,t]),D=C?.provider===`object`?C.object:e.objectName??``,[pe,me]=(0,O.useState)(!1),ye=(0,O.useRef)(0),be=(0,O.useCallback)(async({silent:t=!1}={})=>{let n=++ye.current,r=()=>ye.current===n;try{if(t?me(!0):v(!0),d.data&&Array.isArray(d.data)){r()&&p(d.data);return}if(ce&&C?.provider===`value`){r()&&p(C.items);return}if(!E||typeof E.find!=`function`)throw Error(`DataSource required for object/api providers`);let n=o(b?.fields),i=await E.find(D,{$filter:e.filter,$orderby:Ot(e.sort),...n.length>0?{$expand:n}:{}});r()&&p(a(i))}catch(e){t?console.error(`[ObjectGantt] Failed to refresh data:`,e):r()&&te(e)}finally{t?me(!1):v(!1)}},[E,D,ce,C,e.filter,e.sort,b]);(0,O.useEffect)(()=>{be()},[be]),(0,O.useEffect)(()=>{!ce&&E&&(async()=>{try{if(!E||!D)return;let e=await E.getObjectSchema(D);x(e)}catch(e){console.error(`Failed to fetch object schema:`,e)}})()},[D,E,ce,C]);let we=(0,O.useMemo)(()=>{if(!w||!f.length)return[];let{startDateField:e,endDateField:t,titleField:n,progressField:r,dependenciesField:i,colorField:a,borderColorField:o,parentField:s,typeField:c,lockField:u,tooltipFields:d,baselineStartField:p,baselineEndField:m,quickFilters:h}=w,g=b?.fields??{},_=new Map;for(let e of h??[]){if(!e?.field||!Array.isArray(e.options)||!e.options.length)continue;let t=new Map;for(let n of e.options)typeof n==`string`?t.set(n,n):n&&n.value!=null&&t.set(String(n.value),n.label??String(n.value));t.size&&_.set(e.field,t)}let v=(e,t)=>{if(!t)return;let n=t.split(`.`),r=e;for(let e of n){if(r==null)return;r=r[e]}return r},ee=e=>{let t=[v(e,n),e?.account?.name,e?.opportunity?.name,e?.contact&&[e.contact.first_name,e.contact.last_name].filter(Boolean).join(` `)];for(let e of t)if(e!=null&&String(e).trim()!==``)return String(e);return l(b,e)},te=(e,t)=>{if(t)return t;let n=g[e]??g[e.split(`.`)[0]];return n?.label?n.label:de(e)},y=(e,t)=>{if(e==null||e===``)return`—`;let n=g[t]??g[t.split(`.`)[0]],r=n?.type,i=n?.options;if(Array.isArray(i)&&i.length){let t=i.find(t=>String(t.value)===String(e));if(t)return t.label}if(typeof e!=`object`){let n=_.get(t)?.get(String(e));if(n!=null)return n}if(r==null&&typeof e==`string`){if(/^\d{4}-\d{2}-\d{2}$/.test(e))return T(e);if(/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/.test(e)&&!isNaN(new Date(e).getTime()))return _e(e)}switch(r){case`date`:return T(e);case`datetime`:return _e(e);case`number`:case`integer`:case`float`:case`decimal`:return ue(Number(e));case`currency`:return fe(Number(e),re(n,ne));case`percent`:return he(Number(e));case`boolean`:case`checkbox`:return e?`Yes`:`No`;default:if(Array.isArray(e)){let t=e.map(e=>{if(e==null)return``;if(typeof e==`object`){let t=e;return String(t.name??t.label??t.title??t.id??``)}return String(e)}).filter(Boolean);return t.length?t.join(`, `):`—`}if(typeof e==`object`){let t=e;return String(t.name??t.label??t.title??t.id??`—`)}return String(e)}},x=e=>{if(!d||!d.length)return;let t=[];for(let n of d){let r=typeof n==`string`?n:n?.field;if(!r)continue;let i=typeof n==`object`?n.label:void 0,a=v(e,r);a==null||a===``||Array.isArray(a)&&a.length===0||t.push({label:te(r,i),value:y(a,r)})}return t.length?t:void 0};return f.map((n,l)=>{let d=n[e],f=n[t],h=p?n[p]:void 0,g=m?n[m]:void 0,_=h?new Date(h):void 0,v=g?new Date(g):void 0,te=ee(n),y=r?n[r]:0,b=i?n[i]:[],ne=a?n[a]:void 0;if(!ne){let e=n.status??n.state??n.priority??n.severity;if(e!=null&&e!==``){let t=ve(void 0,e);t&&(ne=ge(t))}}let re=o?n[o]:void 0,ie=re!=null&&re!==``?ge(String(re),String(re)):void 0;return{id:n.id||n._id||`task-${l}`,title:te,start:d?new Date(d):new Date,end:f?new Date(f):new Date,hasOwnDates:!!(d&&f),progress:Math.min(100,Math.max(0,y||0)),dependencies:Et(b),parent:s?n[s]??null:void 0,type:c?wt(n[c]):void 0,locked:u?!!n[u]:void 0,color:ne,borderColor:ie,baselineStart:_&&!isNaN(_.getTime())?_:void 0,baselineEnd:v&&!isNaN(v.getTime())?v:void 0,fields:x(n),data:n}}).filter(e=>!isNaN(e.start.getTime())&&!isNaN(e.end.getTime()))},[f,w,b]),Oe=(0,O.useMemo)(()=>{let e=w?.groupByField;if(!e)return;let t=b?.fields??{},n=(e,t)=>{if(!t)return;let n=e;for(let e of t.split(`.`)){if(n==null)return;n=n[e]}return n},r=n=>{let r=(t[e]??t[e.split(`.`)[0]])?.options;if(Array.isArray(r)&&r.length){let e=r.find(e=>String(e.value)===String(n));if(e)return e.label}if(typeof n==`object`&&n){let e=n;return String(e.name??e.label??e.title??e.id??n)}return String(n)};return t=>{let i=n(t.data,e);return i==null||i===``?null:{key:typeof i==`object`&&i?String(i.id??i._id??r(i)):i,label:r(i)}}},[w?.groupByField,b]),ke=(0,O.useMemo)(()=>{let e=w?.assigneeField;if(!e)return;let t=b?.fields??{},n=(e,t)=>{if(!t)return;let n=e;for(let e of t.split(`.`)){if(n==null)return;n=n[e]}return n},r=n=>{let r=(t[e]??t[e.split(`.`)[0]])?.options;if(Array.isArray(r)&&r.length){let e=r.find(e=>String(e.value)===String(n));if(e)return e.label}if(typeof n==`object`&&n){let e=n;return String(e.name??e.label??e.title??e.id??n)}return String(n)};return t=>{let i=n(t.data,e);return i==null||i===``?null:{key:typeof i==`object`&&i?String(i.id??i._id??r(i)):i,label:r(i)}}},[w?.assigneeField,b]),k=(0,O.useMemo)(()=>{let e=w?.effortField;if(e)return t=>{let n=t.data?.[e],r=Number(n);return Number.isFinite(r)&&r>0?r:1}},[w?.effortField]),A=(0,O.useMemo)(()=>{let t=e.skipWeekends,n=e.holidays;if(!(!t&&(!n||n.length===0)))return{skipWeekends:!!t,holidays:n&&n.length?new Set(n):void 0}},[e]),Ae=(0,O.useMemo)(()=>F(w?.timeSegments),[w?.timeSegments]),je=(0,O.useCallback)((e,t)=>{if(!e||!t)return null;let n=e;for(let e of t.split(`.`)){if(n==null)return null;n=n[e]}if(n==null||n===``)return null;if(typeof n==`object`){let e=n;return String(e.id??e._id??e.value??e.name??``)}return String(n)},[]),Me=w?.quickFilters,[j,M]=(0,O.useState)({});(0,O.useEffect)(()=>{if(!Me?.length||!t||typeof t.find!=`function`)return;let e=b?.fields??{},n=!1;return(async()=>{let r={};for(let n of Me){if(n.options)continue;let i=e[n.field]??e[n.field.split(`.`)[0]],o=i?.type;if(o!==`lookup`&&o!==`master_detail`)continue;let s=i?.reference_to??i?.reference??i?.referenceTo;if(s)try{let e=a(await t.find(s,{$top:1e3}));r[n.field]=e.map(e=>({value:String(e.id??e._id??e.value??``),label:String(e.name??e.label??e.title??e.id??e._id??``)}))}catch(e){console.warn(`[ObjectGantt] Failed to load quick-filter options for "${n.field}":`,e)}}n||M(e=>({...e,...r}))})(),()=>{n=!0}},[JSON.stringify(Me),t,b]);let N=(0,O.useMemo)(()=>{if(!Me?.length)return[];let e=b?.fields??{};return Me.map(t=>{let n=e[t.field]??e[t.field.split(`.`)[0]],r=t.label??n?.label??de(t.field),i=[];if(t.options?.length)i=t.options.map(e=>typeof e==`object`?{value:String(e.value),label:String(e.label??e.value)}:{value:String(e),label:String(e)});else if(Array.isArray(n?.options)&&n.options.length)i=n.options.map(e=>({value:String(e.value??e),label:String(e.label??e.value??e)}));else if(j[t.field]?.length)i=j[t.field];else{let e=new Map;for(let n of f){let r=je(n,t.field);if(r!=null&&!e.has(r)){let i=n;for(let e of t.field.split(`.`))i=i?.[e];let a=i&&typeof i==`object`?String(i.name??i.label??i.title??r):r;e.set(r,a)}}i=[...e.entries()].map(([e,t])=>({value:e,label:t}))}return{field:t.field,label:r,options:i}})},[Me,b,j,f,je]),Ne=e.persistLayout===!1?void 0:`${e.objectName||(C?.provider===`object`?C.object:``)||`gantt`}:${e.viewName||`default`}`,Pe=Ne?`gantt-layout:${Ne}:filters`:null,[Fe,Ie]=(0,O.useState)(()=>{if(!Pe||typeof window>`u`)return{};try{let e=JSON.parse(window.localStorage.getItem(Pe)||`null`);if(!e||typeof e!=`object`||Array.isArray(e))return{};let t={};for(let[n,r]of Object.entries(e))Array.isArray(r)&&(t[n]=r.filter(e=>typeof e==`string`));return t}catch{return{}}}),Le=(0,O.useCallback)(()=>{if(!(!Pe||typeof window>`u`))try{window.localStorage.setItem(Pe,JSON.stringify(Fe))}catch{}},[Pe,Fe]),Re=(0,O.useCallback)((e,t)=>{Ie(n=>({...n,[e]:t}))},[]),ze=(0,O.useCallback)(()=>Ie({}),[]),P=(0,O.useCallback)(e=>!!w?.objectField&&!String(e?.[w.objectField]??``).trim(),[w?.objectField]),Be=(0,O.useCallback)(e=>{let t=(w?.objectField?String(e[w.objectField]??``).trim():``)||D,n=e.id??e._id;if(!t||n==null)return null;let r=D?De(D,n):null;return{objectName:t,recordId:n,href:!D||t===D?r:r?.replace(`/${D}/record/`,`/${t}/record/`)??null}},[w?.objectField,D]),Ve=(0,O.useMemo)(()=>{let e=Object.entries(Fe).filter(([,e])=>e.length>0);if(!e.length)return we;let t=new Map(we.map(e=>[String(e.id),e])),n=new Set;for(let r of we){if(!e.every(([e,t])=>{let n=je(r.data,e);return n!=null&&t.includes(n)}))continue;let i=r;for(;i&&!n.has(String(i.id));)n.add(String(i.id)),i=i.parent==null?void 0:t.get(String(i.parent))}return we.filter(e=>n.has(String(e.id)))},[we,Fe,je]),He=(0,O.useMemo)(()=>{if(w?.autoZoomToFilter!==!1||!we.length)return null;let e=we[0].start.getTime(),t=we[0].end.getTime();for(let n of we)e=Math.min(e,n.start.getTime()),t=Math.max(t,n.end.getTime());return{start:new Date(e),end:new Date(t)}},[we,w?.autoZoomToFilter]),Ue=e.navigation??{mode:`drawer`,width:`min(960px, 60vw)`},We=Ue.mode===`drawer`||Ue.mode===`modal`||Ue.mode===`split`||Ue.mode===`popover`,L=i({navigation:Ue,objectName:e.objectName,onRowClick:We?void 0:s}),[Ke,qe]=(0,O.useState)(null),Je=L.isOverlay&&L.isOpen?L.selectedRecord:null;(0,O.useEffect)(()=>{if(!Je){qe(null);return}let e=Be(Je);if(!e){qe(null);return}let{objectName:n,recordId:r}=e;if(!(C?.provider===`api`||n!==D)||!t||typeof t.findOne!=`function`){qe(null);return}let i=`${n}:${r}`,a=!1;return(async()=>{try{let[e,o]=await Promise.all([t.findOne(n,String(r)),typeof t.getObjectSchema==`function`?t.getObjectSchema(n).catch(()=>null):Promise.resolve(null)]);a||qe(e?{key:i,record:e,schema:o}:null)}catch(e){console.error(`[ObjectGantt] Failed to fetch drawer record, falling back to row payload:`,e),a||qe(null)}})(),()=>{a=!0}},[Je,Be,C?.provider,D,t]);let Ye=(0,O.useCallback)(async(e,t)=>{if(!w||!E||typeof E.update!=`function`)return;let{startDateField:n,endDateField:r,titleField:i,progressField:a}=w,o={};if(t.start instanceof Date&&(o[n]=t.start.toISOString()),t.end instanceof Date&&(o[r]=t.end.toISOString()),typeof t.title==`string`&&i&&(o[i]=t.title),typeof t.progress==`number`&&a&&(o[a]=t.progress),Object.keys(o).length===0)return;let s=e.data?.id??e.data?._id??e.id;if(s==null)return;let c=f;p(e=>e.map(e=>String(e.id??e._id)===String(s)?{...e,...o}:e));try{await E.update(D,String(s),o),be({silent:!0})}catch(e){console.error(`[ObjectGantt] Failed to persist task update:`,e),p(c),oe(e)}},[w,E,D,f,be,oe]),Xe=(e,t)=>{let n=t.some(e=>typeof e==`object`&&e.type&&e.type!==`fs`);return!n&&typeof e==`string`?t.map(e=>String(typeof e==`object`?e.id:e)).join(`,`):n?t.map(e=>typeof e==`object`?e.type&&e.type!==`fs`?{id:e.id,type:e.type}:e.id:e):t.map(e=>typeof e==`object`?e.id:e)},Ze=(0,O.useCallback)(async(e,t,n)=>{let r=w?.dependenciesField;if(!r||!E||typeof E.update!=`function`)return;let i=Xe(t,n),a=f;p(t=>t.map(t=>String(t.id??t._id)===String(e)?{...t,[r]:i}:t));try{await E.update(D,String(e),{[r]:i}),be({silent:!0})}catch(e){console.error(`[ObjectGantt] Failed to persist dependency:`,e),p(a),oe(e)}},[w,E,D,f,be,oe]),Qe=(0,O.useCallback)(async(e,t,n=`fs`)=>{let r=e.data?.id??e.data?._id??e.id,i=t.data?.id??t.data?._id??t.id;if(r==null||i==null)return;let a=w?.dependenciesField;if(!a)return;let o=f.find(e=>String(e.id??e._id)===String(i))?.[a],s=Et(o),c=e=>String(typeof e==`object`?e.id:e),l=s.find(e=>c(e)===String(r)),u=l&&typeof l==`object`?l.type??`fs`:`fs`;if(l&&u===n)return;let d=n===`fs`?r:{id:r,type:n},p=l?s.map(e=>c(e)===String(r)?d:e):[...s,d];await Ze(i,o,p)},[w,f,Ze]),$e=(0,O.useCallback)(async(e,t)=>{let n=e.data?.id??e.data?._id??e.id,r=t.data?.id??t.data?._id??t.id;if(n==null||r==null)return;let i=w?.dependenciesField;if(!i)return;let a=f.find(e=>String(e.id??e._id)===String(r))?.[i],o=Et(a),s=e=>String(typeof e==`object`?e.id:e),c=o.filter(e=>s(e)!==String(n));c.length!==o.length&&await Ze(r,a,c)},[w,f,Ze]),[et,tt]=(0,O.useState)(null),[nt,rt]=(0,O.useState)(!1),it=(0,O.useCallback)(e=>{tt(e)},[]),at=(0,O.useCallback)(async()=>{if(!et)return;if(!E?.delete){tt(null);return}let e=et.data?.id??et.data?._id??et.id;if(e==null){tt(null);return}rt(!0);let t=f;p(t=>t.filter(t=>String(t.id??t._id)!==String(e)));try{if(await E.delete(D,String(e))===!1)throw Error(S(`gantt.writeFailed`));tt(null),be({silent:!0})}catch(e){console.error(`[ObjectGantt] Failed to delete:`,e),p(t),tt(null),oe(e)}finally{rt(!1)}},[et,E,D,f,be,oe,S]);return g?(0,I.jsx)(`div`,{className:n,children:(0,I.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,I.jsx)(`div`,{className:`text-muted-foreground`,children:`Loading Gantt chart...`})})}):ee?(0,I.jsx)(`div`,{className:n,children:(0,I.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,I.jsxs)(`div`,{className:`text-destructive`,children:[`Error: `,ee.message]})})}):w?(0,I.jsxs)(`div`,{className:y(`flex h-full min-h-0 flex-col`,n),children:[N.length>0&&(0,I.jsx)(V,{filters:N,value:Fe,onChange:Re,onClear:ze,resultCount:Ve.length,totalCount:we.length,labels:{all:`全部`,clear:`清除筛选`,empty:`无可选项`,resultSummary:(e,t)=>`显示 ${e} / ${t} 项任务`}}),(0,I.jsx)(`div`,{className:`flex-1 min-h-[420px]`,children:w?.resourceView&&ke?(0,I.jsx)(_t,{tasks:Ve,assignee:ke,effort:k,capacity:w?.capacity??1,viewMode:e.viewMode||`day`}):(0,I.jsx)(dt,{tasks:Ve,startDate:He?.start,endDate:He?.end,onTaskClick:e=>{P(e.data)||L.handleClick(e.data),r?.(e.data)},onTaskUpdate:Ye,onTaskDelete:it,onDependencyCreate:w?.dependenciesField?Qe:void 0,onDependencyDelete:w?.dependenciesField?$e:void 0,markers:e.markers,autoSchedule:!!w?.dependenciesField,rescheduleOnConflict:!!w?.dependenciesField,criticalPathDefault:!!e.criticalPath,workingCalendar:A,shiftSegments:Ae,showBaselines:e.showBaselines!==!1,readOnly:!!e.readOnly,mobileReadOnly:e.mobileReadOnly!==!1,persistLayoutKey:Ne,onLayoutChange:Pe?Le:void 0,groupBy:Oe,defaultCollapsedDepth:w?.defaultCollapsedDepth,summaryExtent:w?.summaryExtent,interactions:w?.interactions,dependencyTypes:w?.dependencyTypes,timeZone:w?.timeZone,onBeforeTaskUpdate:u,exportFileName:String(w?.exportFileName??e.label??b?.label??e.objectName??``)||void 0,inlineEdit:!0,onRefresh:(C?.provider===`object`||C?.provider===`api`)&&typeof E?.find==`function`?()=>be({silent:!0}):void 0,refreshing:pe})}),L.isOverlay&&L.isOpen&&L.selectedRecord&&(()=>{let n=L.selectedRecord,r=Be(n);if(!r||P(n))return null;let{objectName:i,recordId:a}=r,o=r.href??void 0,s=w?.titleField?String(n[w.titleField]??S(`gantt.drawer.fallbackTitle`)):S(`gantt.drawer.fallbackTitle`),c=!!e.readOnly||(w?.lockField?!!n[w.lockField]:!1),l=Ke?.key===`${i}:${a}`?Ke:null,u=l?.record??n,d=l?.schema??(i===D?b:void 0),f=l&&t?t:E;return(0,I.jsx)(Ee,{open:!0,onClose:L.close,title:s,record:u,objectName:i,recordId:a,dataSource:f??void 0,objectSchema:d,width:L.width,fullPageHref:o,onFieldSave:c?void 0:async(e,t)=>{if(f?.update){try{await f.update(i,String(a),{[e]:t})}catch(e){let t=kt(e);throw t?Error(t):e}l&&qe(n=>n&&n.key===l.key?{...n,record:{...n.record,[e]:t}}:n),p(n=>n.map(n=>String(n.id??n._id)===String(a)?{...n,[e]:t}:n)),be({silent:!0})}},onDelete:c?void 0:async()=>{if(E?.delete){try{if(await E.delete(i,String(a))===!1)throw Error(S(`gantt.writeFailed`))}catch(e){throw oe(e),e}p(e=>e.filter(e=>String(e.id??e._id)!==String(a)))}}})})(),(0,I.jsx)(Ce,{open:!!et,onOpenChange:e=>{!e&&!nt&&tt(null)},children:(0,I.jsxs)(ie,{children:[(0,I.jsxs)(ae,{children:[(0,I.jsx)(h,{children:S(`gantt.delete.title`)}),(0,I.jsx)(m,{children:et?S(`gantt.delete.body`,{title:et.title}):null})]}),(0,I.jsxs)(xe,{children:[(0,I.jsx)(Se,{disabled:nt,children:S(`gantt.delete.cancel`)}),(0,I.jsx)(le,{onClick:e=>{e.preventDefault(),at()},disabled:nt,"data-testid":`gantt-delete-confirm`,className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:S(nt?`gantt.delete.deleting`:`gantt.delete.confirm`)})]})]})})]}):(0,I.jsx)(`div`,{className:n,children:(0,I.jsx)(`div`,{className:`flex items-center justify-center h-96`,children:(0,I.jsx)(`div`,{className:`text-muted-foreground`,children:`Gantt configuration required. Please specify startDateField, endDateField, and titleField.`})})})},H=t({GanttView:()=>dt,ObjectGantt:()=>jt,ObjectGanttRenderer:()=>Mt,QuickFilterBar:()=>V,ResourceWorkload:()=>_t,bandAt:()=>He,computeWorkload:()=>ft,normalizeDependencies:()=>Et,normalizeShiftSegments:()=>F,normalizeTaskType:()=>wt,parseHHMM:()=>Be,shiftDayStart:()=>Ve}),Mt=({schema:e})=>{let{dataSource:t}=u()||{};return(0,I.jsx)(jt,{schema:e,dataSource:t})};s.register(`object-gantt`,Mt,{namespace:`plugin-gantt`,label:`Object Gantt`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`gantt`,type:`object`,label:`Gantt Config`,description:`startDateField, endDateField, titleField, progressField, percentageField, colorField, dependenciesField`}]}),s.register(`gantt`,Mt,{namespace:`view`,label:`Gantt View`,category:`view`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`gantt`,type:`object`,label:`Gantt Config`,description:`startDateField, endDateField, titleField, progressField, percentageField, colorField, dependenciesField`}]});export{H as t};
|