@libxai/board 0.17.413 → 0.17.415

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -108,7 +108,7 @@
108
108
  1.
109
109
 
110
110
  **Action items:**
111
- - [ ] `,priority:"MEDIUM",labels:["meeting"]}}];function xi({templates:e,onSelectTemplate:t,className:a}){let[r,o]=react.useState(false),s=react.useRef(null),n=react.useRef(null);react.useEffect(()=>{function i(p){s.current&&!s.current.contains(p.target)&&n.current&&!n.current.contains(p.target)&&o(false);}if(r)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]);let c=i=>{t(i),o(false);},g=e.reduce((i,p)=>{let l=p.category||"Other";return i[l]||(i[l]=[]),i[l].push(p),i},{});return jsxRuntime.jsxs("div",{className:d("relative inline-block",a),children:[jsxRuntime.jsxs("button",{ref:n,onClick:()=>o(!r),className:"flex items-center gap-2 px-3 py-2 rounded-lg border transition-all text-sm font-medium shadow-lg",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-primary)"},onMouseEnter:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",i.currentTarget.style.borderColor="var(--theme-border-secondary)";},onMouseLeave:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",i.currentTarget.style.borderColor="var(--theme-border-primary)";},title:"Create from template",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:"\u{1F4CB}"}),jsxRuntime.jsx("span",{children:"Templates"}),jsxRuntime.jsx("svg",{className:d("w-4 h-4 transition-transform",r&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxRuntime.jsxs("div",{ref:s,className:"absolute top-full left-0 mt-2 min-w-[320px] max-w-[400px] rounded-xl backdrop-blur-xl border shadow-2xl z-50 overflow-hidden max-h-[500px] overflow-y-auto",style:{backgroundColor:"var(--theme-bg-primary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-4 py-3 border-b sticky top-0 backdrop-blur-sm",style:{borderColor:"var(--theme-border-primary)",backgroundColor:"var(--theme-bg-secondary)"},children:[jsxRuntime.jsx("span",{className:"text-sm font-bold uppercase tracking-wider",style:{color:"var(--theme-text-primary)"},children:"Card Templates"}),jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:"Quick start with pre-configured cards"})]}),Object.entries(g).map(([i,p])=>jsxRuntime.jsxs("div",{className:"py-2",children:[jsxRuntime.jsx("div",{className:"px-4 py-2",children:jsxRuntime.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--theme-text-secondary)"},children:i})}),jsxRuntime.jsx("div",{children:p.map(l=>jsxRuntime.jsxs("button",{onClick:()=>c(l),className:"w-full px-4 py-3 flex items-start gap-3 text-left transition-all active:scale-[0.98]",style:{color:"var(--theme-text-primary)"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-2xl leading-none mt-0.5",children:l.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"font-semibold text-sm",style:{color:"var(--theme-text-primary)"},children:l.name}),l.description&&jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:l.description})]})]},l.id))})]},i)),e.length===0&&jsxRuntime.jsx("div",{className:"px-4 py-8 text-center",style:{color:"var(--theme-text-tertiary)"},children:jsxRuntime.jsx("p",{className:"text-sm",children:"No templates available"})})]})]})}function wi({board:e,isOpen:t,onClose:a,onImport:r,boardElementRef:o,className:s}){let[n,c]=react.useState("export"),[g,i]=react.useState("json"),[p,l]=react.useState(null),f=react.useRef(null);if(!t)return null;let y=async()=>{let C=o?.current||void 0,h=await pd(e,g,C);ud(h,g);},k=async C=>{let h=C.target.files?.[0];if(h){try{let b=await bd(h),u=h.name.endsWith(".json")?"json":"csv",x=fd(b,u);l(x),x.success&&r&&r(x,b);}catch(b){l({success:false,errors:[`Failed to read file: ${b instanceof Error?b.message:"Unknown error"}`]});}f.current&&(f.current.value="");}};return jsxRuntime.jsxs("div",{className:d("fixed inset-0 z-[9999] flex items-center justify-center",s),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:a}),jsxRuntime.jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-2xl w-full mx-4",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u{1F4E6}"}),"Export / Import"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Transfer your board data"})]}),jsxRuntime.jsx("button",{onClick:a,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"flex border-b border-white/10",children:[jsxRuntime.jsx("button",{onClick:()=>c("export"),className:d("flex-1 px-6 py-4 font-semibold transition-colors",n==="export"?"text-white border-b-2 border-blue-500":"text-white/50 hover:text-white/80"),children:"Export"}),jsxRuntime.jsx("button",{onClick:()=>c("import"),className:d("flex-1 px-6 py-4 font-semibold transition-colors",n==="import"?"text-white border-b-2 border-blue-500":"text-white/50 hover:text-white/80"),children:"Import"})]}),jsxRuntime.jsxs("div",{className:"p-6",children:[n==="export"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Select format"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-3",children:["json","csv","pdf"].map(C=>jsxRuntime.jsxs("button",{onClick:()=>i(C),className:d("p-4 rounded-lg border-2 transition-all text-center",g===C?"border-blue-500 bg-blue-500/20 text-white":"border-white/20 hover:border-white/40 text-white/70 hover:text-white"),children:[jsxRuntime.jsxs("div",{className:"text-2xl mb-2",children:[C==="json"&&"\u{1F4C4}",C==="csv"&&"\u{1F4CA}",C==="pdf"&&"\u{1F4DD}"]}),jsxRuntime.jsx("div",{className:"font-semibold uppercase text-xs",children:C})]},C))})]}),jsxRuntime.jsxs("div",{className:"bg-white/5 rounded-lg p-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:"Preview"}),jsxRuntime.jsxs("div",{className:"text-xs text-white/60",children:[jsxRuntime.jsxs("div",{children:["Board: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.title||"Untitled"})]}),jsxRuntime.jsxs("div",{children:["Columns: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.columns.length})]}),jsxRuntime.jsxs("div",{children:["Cards: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.cards.length})]})]})]}),jsxRuntime.jsx("button",{onClick:y,className:"w-full py-3 px-4 bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-500 hover:to-blue-600 text-white font-semibold rounded-lg transition-all shadow-lg shadow-blue-500/20",children:"Export Board"})]}),n==="import"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Upload file"}),jsxRuntime.jsx("input",{ref:f,type:"file",accept:".json,.csv",onChange:k,className:"hidden"}),jsxRuntime.jsxs("button",{onClick:()=>f.current?.click(),className:"w-full py-12 px-4 border-2 border-dashed border-white/30 hover:border-white/50 rounded-lg transition-colors text-white/70 hover:text-white",children:[jsxRuntime.jsx("div",{className:"text-5xl mb-3",children:"\u{1F4C1}"}),jsxRuntime.jsx("div",{className:"font-semibold mb-1",children:"Click to select file"}),jsxRuntime.jsx("div",{className:"text-xs text-white/50",children:"Supports JSON and CSV files"})]})]}),p&&jsxRuntime.jsxs("div",{className:d("p-4 rounded-lg",p.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"),children:[jsxRuntime.jsx("h3",{className:d("font-semibold mb-2",p.success?"text-green-400":"text-red-400"),children:p.success?"\u2713 Import Successful":"\u2717 Import Failed"}),p.success&&jsxRuntime.jsxs("div",{className:"text-sm text-white/80",children:[jsxRuntime.jsxs("div",{children:["Cards imported: ",p.cardsImported]}),jsxRuntime.jsxs("div",{children:["Columns imported: ",p.columnsImported]})]}),p.errors&&p.errors.length>0&&jsxRuntime.jsx("div",{className:"mt-2 text-sm",children:p.errors.map((C,h)=>jsxRuntime.jsxs("div",{className:"text-red-300",children:["\u2022 ",C]},h))})]})]})]})]})]})}var x0=["URGENT","HIGH","MEDIUM","LOW"],k0=[{value:"none",label:"None"},{value:"created",label:"Date Created"},{value:"priority",label:"Priority"},{value:"dueDate",label:"Due Date"},{value:"title",label:"Title"},{value:"estimate",label:"Estimate"}],w0=[{value:"none",label:"No Grouping"},{value:"priority",label:"By Priority"},{value:"assignee",label:"By Assignee"},{value:"label",label:"By Label"}];function Ci({filters:e,sort:t,onFiltersChange:a,onSortChange:r,onReset:o,onFilterMyTasks:s,onFilterOverdue:n,onFilterHighPriority:c,availableUsers:g=[],availableLabels:i=[],availableColumns:p=[],showQuickFilters:l=true,compact:f=false,groupBy:y="none",onGroupByChange:k}){let[C,h]=react.useState(true),b=react.useCallback(w=>{a({search:w.target.value});},[a]),u=react.useCallback(w=>{a({dateFilter:w.target.value});},[a]),x=react.useCallback(w=>{r({by:w.target.value});},[r]),m=react.useCallback(()=>{r({order:t.order==="asc"?"desc":"asc"});},[t.order,r]),N=e.search||e.dateFilter!=="all"||e.priorities.length>0||e.assignees.length>0||e.labels.length>0||t.by!=="none";return jsxRuntime.jsxs("div",{className:`filter-bar ${f?"filter-bar--compact":""} ${C?"filter-bar--collapsed":""}`,children:[jsxRuntime.jsxs("div",{className:"filter-bar__header",onClick:()=>h(!C),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:C?"0":"12px",padding:"4px 6px",borderRadius:"6px",transition:"all 0.2s ease"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:C?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--theme-text-secondary)"},children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})}),jsxRuntime.jsx("span",{className:"filter-bar__label",style:{fontWeight:500,fontSize:"0.875rem",color:"var(--theme-text-primary)"},children:"Filters & Grouping"}),N&&jsxRuntime.jsxs("span",{style:{color:"var(--theme-accent-primary)",fontSize:"0.75rem",fontWeight:600},children:["(",[e.search&&"search",e.dateFilter!=="all"&&"date",e.priorities.length>0&&"priority",e.assignees.length>0&&"assignee",e.labels.length>0&&"label",t.by!=="none"&&"sort"].filter(Boolean).length," active)"]})]}),!C&&jsxRuntime.jsxs("div",{className:"filter-bar__content",children:[l&&jsxRuntime.jsxs("div",{className:"filter-bar__quick",style:{marginBottom:"12px"},children:[jsxRuntime.jsx("span",{className:"filter-bar__label",children:"Quick:"}),s&&jsxRuntime.jsx("button",{onClick:s,className:"filter-bar__quick-btn",title:"Show only my tasks",children:"My Tasks"}),n&&jsxRuntime.jsx("button",{onClick:n,className:"filter-bar__quick-btn",title:"Show overdue tasks",children:"Overdue"}),c&&jsxRuntime.jsx("button",{onClick:c,className:"filter-bar__quick-btn",title:"Show high priority tasks",children:"High Priority"})]}),jsxRuntime.jsxs("div",{className:"filter-bar__main",children:[jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Search tasks...",value:e.search,onChange:b,className:"filter-bar__search"})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.dateFilter,onChange:u,className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Dates"}),jsxRuntime.jsx("option",{value:"overdue",children:"Overdue"}),jsxRuntime.jsx("option",{value:"today",children:"Today"}),jsxRuntime.jsx("option",{value:"this-week",children:"This Week"})]})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.priorities[0]||"all",onChange:w=>{let B=w.target.value;a({priorities:B==="all"?[]:[B]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Priorities"}),x0.map(w=>jsxRuntime.jsx("option",{value:w,children:w},w))]})}),g.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.assignees[0]||"all",onChange:w=>{let B=w.target.value;a({assignees:B==="all"?[]:[B]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Assignees"}),g.map(w=>jsxRuntime.jsx("option",{value:w.id,children:w.name},w.id))]})}),i.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.labels[0]||"all",onChange:w=>{let B=w.target.value;a({labels:B==="all"?[]:[B]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Labels"}),i.map(w=>jsxRuntime.jsx("option",{value:w,children:w},w))]})}),jsxRuntime.jsxs("div",{className:"filter-bar__field filter-bar__sort",children:[jsxRuntime.jsx("span",{className:"filter-bar__label",style:{color:"var(--theme-text-secondary)"},children:"Sort:"}),jsxRuntime.jsx("select",{value:t.by,onChange:x,className:"filter-bar__select filter-bar__select--sm",children:k0.map(w=>jsxRuntime.jsx("option",{value:w.value,children:w.label},w.value))}),t.by!=="none"&&jsxRuntime.jsx("button",{onClick:m,className:"filter-bar__sort-toggle",title:`Sort ${t.order==="asc"?"descending":"ascending"}`,children:t.order==="asc"?"\u2191":"\u2193"})]}),k&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("select",{value:y,onChange:w=>k(w.target.value),className:"filter-bar__select",style:{fontWeight:500,borderWidth:"2px"},children:w0.map(w=>jsxRuntime.jsx("option",{value:w.value,children:w.label},w.value))})}),N&&jsxRuntime.jsx("button",{onClick:o,className:"filter-bar__reset",title:"Clear all filters",children:"Clear"})]})]})]})}function Ti({onOpenExport:e,onOpenThemes:t,onOpenShortcuts:a,className:r,viewMode:o="kanban",onExportGanttPDF:s,onExportGanttExcel:n,onExportGanttPNG:c,onExportGanttCSV:g}){let[i,p]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let y=k=>{l.current&&!l.current.contains(k.target)&&p(false);};return i&&document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y);}},[i]);let f=y=>{y(),p(false);};return jsxRuntime.jsxs("div",{className:d("relative",r),ref:l,children:[jsxRuntime.jsxs("button",{onClick:()=>p(!i),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all border",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-secondary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",y.currentTarget.style.color="var(--theme-text-primary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",y.currentTarget.style.color="var(--theme-text-secondary)";},"aria-label":"Configuration Menu","aria-expanded":i,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6M5.6 5.6l4.2 4.2m4.2 4.2l4.2 4.2M1 12h6m6 0h6M5.6 18.4l4.2-4.2m4.2-4.2l4.2-4.2"})]}),jsxRuntime.jsx("span",{children:"Config"})]}),i&&jsxRuntime.jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-lg border shadow-lg overflow-hidden z-50",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[o==="kanban"?jsxRuntime.jsxs("button",{onClick:()=>f(e),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Export"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await s?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Export PDF"]}),jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await n?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntime.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"Export Excel"]}),jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await c?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),jsxRuntime.jsx("polyline",{points:"21 15 16 10 5 21"})]}),"Export PNG"]}),jsxRuntime.jsxs("button",{onClick:()=>f(()=>g?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),jsxRuntime.jsx("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]}),"Export CSV"]})]}),jsxRuntime.jsxs("button",{onClick:()=>f(t),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"5"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6m8.5-8.5L17 15M7 9L3.5 5.5M7 15l-3.5 3.5M20.5 5.5L17 9m3.5 11.5L17 17"})]}),"Themes"]}),jsxRuntime.jsxs("button",{onClick:()=>f(a),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),"Shortcuts"]})]})]})}var Ni={name:"dark",displayName:"Dark (Enhanced)",emoji:"\u{1F319}",colors:{bgPrimary:"#222326",bgSecondary:"#2A2B2F",bgTertiary:"#33343A",bgCard:"#2d2d2d",bgHover:"#353535",bgActive:"#404040",bgInput:"#2a2a2a",textPrimary:"#F4F5F8",textSecondary:"#AEB6C0",textTertiary:"#7A7F8A",textDisabled:"#606060",textInverse:"#1a1a1a",borderPrimary:"rgba(255, 255, 255, 0.1)",borderSecondary:"rgba(255, 255, 255, 0.05)",borderDefault:"#404040",borderHover:"#505050",borderSubtle:"#2a2a2a",accentPrimary:"#5E6AD2",accentHover:"#7780DD",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.1)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.2)",success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#3B82F6",danger:"#ef4444",dangerBorder:"rgba(239, 68, 68, 0.3)",dangerBackground:"rgba(239, 68, 68, 0.1)",dangerBackgroundHover:"rgba(239, 68, 68, 0.2)"},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 4px 12px rgba(0, 0, 0, 0.4)",lg:"0 12px 32px rgba(0, 0, 0, 0.5)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Di={name:"light",displayName:"Light (Standard)",emoji:"\u2600\uFE0F",colors:{bgPrimary:"#FFFFFF",bgSecondary:"#F7F7F8",bgTertiary:"#EEEFF1",bgCard:"#ffffff",bgHover:"#f3f4f6",bgActive:"#e5e7eb",bgInput:"#f9fafb",textPrimary:"#1A1A1A",textSecondary:"#5A5A5A",textTertiary:"#8A8A8A",textDisabled:"#d1d5db",textInverse:"#ffffff",borderPrimary:"rgba(0, 0, 0, 0.1)",borderSecondary:"rgba(0, 0, 0, 0.05)",borderDefault:"#e5e7eb",borderHover:"#d1d5db",borderSubtle:"#f3f4f6",accentPrimary:"#5E6AD2",accentHover:"#4A56B8",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.08)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.15)",success:"#059669",warning:"#D97706",error:"#DC2626",info:"#2563EB",danger:"#dc2626",dangerBorder:"rgba(220, 38, 38, 0.3)",dangerBackground:"rgba(220, 38, 38, 0.08)",dangerBackgroundHover:"rgba(220, 38, 38, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.12)",md:"0 4px 12px rgba(0, 0, 0, 0.15)",lg:"0 12px 32px rgba(0, 0, 0, 0.2)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Si={name:"neutral",emoji:"\u26AA",displayName:"Neutral (Zen)",colors:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgTertiary:"#E7E5E4",bgCard:"#FEFEFE",bgHover:"#F0EFEE",bgActive:"#E7E5E4",bgInput:"#FAFAF9",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",textDisabled:"#D6D3D1",textInverse:"#FAFAF9",borderPrimary:"#E7E5E4",borderSecondary:"#F0EFEE",borderDefault:"#E7E5E4",borderHover:"#D6D3D1",borderSubtle:"#F5F5F4",accentPrimary:"#292524",accentHover:"#44403C",interactivePrimary:"#292524",interactivePrimaryHover:"#44403C",interactivePrimaryBorder:"rgba(41, 37, 36, 0.3)",interactivePrimaryBackground:"rgba(41, 37, 36, 0.06)",interactivePrimaryBackgroundHover:"rgba(41, 37, 36, 0.12)",success:"#15803D",warning:"#CA8A04",error:"#B91C1C",info:"#1D4ED8",danger:"#B91C1C",dangerBorder:"rgba(185, 28, 28, 0.3)",dangerBackground:"rgba(185, 28, 28, 0.08)",dangerBackgroundHover:"rgba(185, 28, 28, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 12px rgba(0, 0, 0, 0.12)",lg:"0 12px 32px rgba(0, 0, 0, 0.15)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},co={dark:Ni,light:Di,neutral:Si},Un="dark";var zn=react.createContext(void 0),F0="asakaa-theme";function Mc({children:e,defaultTheme:t=Un,storageKey:a=F0}){let[r,o]=react.useState(()=>{if(typeof window<"u"){let c=localStorage.getItem(a);if(c&&(c==="dark"||c==="light"||c==="neutral"))return c}return t}),s=react.useCallback(c=>{o(c),typeof window<"u"&&localStorage.setItem(a,c);},[a]);react.useEffect(()=>{if(typeof window>"u")return;let c=document.documentElement,g=co[r];Object.entries(g.colors).forEach(([p,l])=>{l&&c.style.setProperty(`--theme-${L0(p)}`,l);}),Object.entries({bgPrimary:"--asakaa-color-background-primary",bgSecondary:"--asakaa-color-background-secondary",bgTertiary:"--asakaa-color-background-tertiary",bgCard:"--asakaa-color-background-card",bgHover:"--asakaa-color-background-hover",bgActive:"--asakaa-color-background-active",bgInput:"--asakaa-color-background-input",textPrimary:"--asakaa-color-text-primary",textSecondary:"--asakaa-color-text-secondary",textTertiary:"--asakaa-color-text-tertiary",textDisabled:"--asakaa-color-text-disabled",textInverse:"--asakaa-color-text-inverse",borderPrimary:"--asakaa-color-border-primary",borderSecondary:"--asakaa-color-border-secondary",borderDefault:"--asakaa-color-border-default",borderHover:"--asakaa-color-border-hover",borderSubtle:"--asakaa-color-border-subtle",accentPrimary:"--asakaa-color-accent-primary",accentHover:"--asakaa-color-accent-hover",interactivePrimary:"--asakaa-color-interactive-primary",interactivePrimaryHover:"--asakaa-color-interactive-primaryHover",interactivePrimaryBorder:"--asakaa-color-interactive-primaryBorder",interactivePrimaryBackground:"--asakaa-color-interactive-primaryBackground",interactivePrimaryBackgroundHover:"--asakaa-color-interactive-primaryBackgroundHover",success:"--asakaa-color-status-success",warning:"--asakaa-color-status-warning",error:"--asakaa-color-status-error",info:"--asakaa-color-status-info",danger:"--asakaa-color-danger",dangerBorder:"--asakaa-color-danger-border",dangerBackground:"--asakaa-color-danger-background",dangerBackgroundHover:"--asakaa-color-danger-backgroundHover"}).forEach(([p,l])=>{let f=g.colors[p];f&&c.style.setProperty(l,f);}),c.setAttribute("data-theme",r),c.classList.remove("theme-dark","theme-light","theme-neutral"),c.classList.add(`theme-${r}`);},[r]);let n={theme:r,setTheme:s,themes:co};return jsxRuntime.jsx(zn.Provider,{value:n,children:e})}function Ao(){let e=react.useContext(zn);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function L0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ei({isOpen:e,onClose:t,className:a}){let{theme:r,setTheme:o}=Ao();return e?jsxRuntime.jsxs("div",{className:d("fixed inset-0 z-[9999] flex items-center justify-center",a),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),jsxRuntime.jsxs("div",{className:"relative rounded-2xl border shadow-2xl max-w-md w-full mx-4",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between",style:{borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsx("h2",{className:"text-2xl font-bold",style:{color:"var(--theme-text-primary)"},children:"Select Theme"}),jsxRuntime.jsx("button",{onClick:t,className:"text-2xl leading-none p-2 hover:bg-white/10 rounded-lg transition-colors",style:{color:"var(--theme-text-secondary)"},"aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"p-6 space-y-3",children:Object.entries(co).map(([s,n])=>jsxRuntime.jsxs("button",{onClick:()=>{o(s),t();},className:d("w-full p-4 rounded-lg border-2 transition-all flex items-center gap-4",r===s?"border-blue-500 bg-blue-500/20":"border-white/20 hover:border-white/40"),style:{backgroundColor:r===s?"var(--theme-accent-primary)20":"transparent"},children:[jsxRuntime.jsx("div",{className:"text-3xl",children:n.emoji}),jsxRuntime.jsxs("div",{className:"text-left flex-1",children:[jsxRuntime.jsx("div",{className:"font-semibold",style:{color:"var(--theme-text-primary)"},children:n.displayName}),jsxRuntime.jsxs("div",{className:"text-xs",style:{color:"var(--theme-text-secondary)"},children:[s==="dark"&&"Default dark theme with Linear-inspired colors",s==="light"&&"Clean light theme with high contrast",s==="neutral"&&"Monochrome zen theme"]})]}),r===s&&jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})})]},s))})]})]}):null}function Ac(e="dark"){if(typeof window>"u"||typeof getComputedStyle>"u")return at[e]||at.dark;let t=document.documentElement,a=getComputedStyle(t),r=(s,n)=>a.getPropertyValue(s).trim()||n;return {bgPrimary:r("--theme-bg-primary",at[e].bgPrimary),bgSecondary:r("--theme-bg-secondary",at[e].bgSecondary),bgGrid:r("--theme-bg-card",at[e].bgGrid),bgWeekend:r("--theme-bg-hover",at[e].bgWeekend),border:r("--theme-border-primary",at[e].border),borderLight:r("--theme-border-subtle",at[e].borderLight),textPrimary:r("--theme-text-primary",at[e].textPrimary),textSecondary:r("--theme-text-secondary",at[e].textSecondary),textTertiary:r("--theme-text-tertiary",at[e].textTertiary),accent:r("--theme-accent-primary",at[e].accent),accentHover:r("--theme-accent-hover",at[e].accentHover),accentLight:r("--theme-accent-primary",at[e].accentLight),taskBarPrimary:r("--theme-accent-primary",at[e].taskBarPrimary),taskBarProgress:r("--theme-accent-hover",at[e].taskBarProgress),taskBarHandle:r("--theme-text-inverse",at[e].taskBarHandle||"#FFFFFF"),dependency:r("--theme-border-secondary",at[e].dependency),dependencyHover:r("--theme-border-secondary",at[e].dependencyHover),criticalPath:r("--theme-error",at[e].criticalPath),criticalPathLight:r("--theme-error",at[e].criticalPathLight),today:e==="light"?r("--theme-accent-primary",at[e].today):e==="neutral"?r("--theme-text-primary",at[e].today):r("--theme-error",at[e].today),todayLight:e==="light"?r("--theme-accent-primary",at[e].todayLight):e==="neutral"?r("--theme-text-primary",at[e].todayLight):r("--theme-error",at[e].todayLight),milestone:r("--theme-warning",at[e].milestone),milestoneLight:r("--theme-warning",at[e].milestoneLight),statusTodo:r("--theme-text-tertiary",at[e].statusTodo),statusInProgress:r("--theme-accent-primary",at[e].statusInProgress),statusCompleted:r("--theme-success",at[e].statusCompleted),hoverBg:r("--theme-bg-hover",at[e].hoverBg),focusRing:r("--theme-accent-primary",at[e].focusRing)}}var Hn={columns:{taskName:"TASK NAME",startDate:"Start Date",endDate:"End Date",duration:"Duration",assignees:"Assignees",status:"Status",progress:"% Complete",priority:"Priority"},toolbar:{today:"Today",day:"Day",week:"Week",month:"Month",export:"Export",exportPdf:"Export to PDF",exportPng:"Export to PNG",exportCsv:"Export to CSV",exportExcel:"Export to Excel",exportMsProject:"Export to MS Project",undo:"Undo",redo:"Redo",createTask:"New Task",density:"Row Density",compact:"Compact",normal:"Normal",spacious:"Spacious",filterAll:"All",filterIncomplete:"Incomplete",filterInProgress:"In Progress",filterCompleted:"Completed",filter:"Filters",filterBy:"FILTER BY STATUS",filterAllDesc:"Show all tasks",filterIncompleteDesc:"Hide completed tasks",filterInProgressDesc:"Tasks currently being worked on",filterCompletedDesc:"Only show finished tasks",clearFilter:"Clear filter",hideCompleted:"Hide Completed Tasks",toDo:"To Do / Pending"},contextMenu:{editTask:"Edit Task",addSubtask:"Add Subtask",markIncomplete:"Mark Incomplete",setInProgress:"Set In Progress",markComplete:"Mark Complete",splitTask:"Split Task",deleteTask:"Delete Task"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",addSubtask:"Add Subtask",indent:"Indent",outdent:"Outdent",moveUp:"Move Up",moveDown:"Move Down",splitTask:"Split Task",linkTasks:"Link Tasks",unlinkTasks:"Unlink Tasks"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{progress:"Progress",duration:"Duration",days:"days",day:"day",assigned:"Assigned",milestone:"Milestone",criticalPath:"Critical Path",subtask:"Subtask",task:"Task",noTasks:"No tasks yet",addTask:"Add task",newTask:"New Task",loading:"Loading...",error:"Error",today:"Today",week:"Week",clickToSetDates:"Click to set dates..."},ai:{placeholder:'Ask AI to edit tasks... (e.g., "Move Design to next week")',thinking:"Thinking...",suggestions:{moveTask:'Move "Task Name" to next Monday',extendTask:'Extend "Task Name" by 3 days',renameTask:'Rename "Old Name" to "New Name"',setProgress:'Set "Task Name" progress to 50%',linkTasks:'Link "Task A" to "Task B"',createTask:'Create a new task called "New Task"',deleteTask:'Delete "Task Name"',assignTask:'Assign John to "Task Name"'},errors:{taskNotFound:"Task not found",invalidDate:"Invalid date",invalidDuration:"Invalid duration",invalidProgress:"Invalid progress value",unknownCommand:"Unknown command",processingError:"Error processing command"}},export:{projectName:"Gantt Project",ganttTasks:"Gantt Tasks",taskId:"Task ID",taskName:"Task Name",startDate:"Start Date",endDate:"End Date",isMilestone:"Is Milestone",parentId:"Parent ID",yes:"Yes",no:"No",noTasksToExport:"No tasks available to export"},dateFormat:{short:"MM/dd",medium:"MMM d",long:"MMMM d, yyyy"}},Fc={columns:{taskName:"NOMBRE DE TAREA",startDate:"Fecha Inicio",endDate:"Fecha Fin",duration:"Duraci\xF3n",assignees:"Asignados",status:"Estado",progress:"% Completado",priority:"Prioridad"},toolbar:{today:"Hoy",day:"D\xEDa",week:"Semana",month:"Mes",export:"Exportar",exportPdf:"Exportar a PDF",exportPng:"Exportar a PNG",exportCsv:"Exportar a CSV",exportExcel:"Exportar a Excel",exportMsProject:"Exportar a MS Project",undo:"Deshacer",redo:"Rehacer",createTask:"Nueva Tarea",density:"Densidad",compact:"Compacto",normal:"Normal",spacious:"Espacioso",filterAll:"Todas",filterIncomplete:"Sin completar",filterInProgress:"En progreso",filterCompleted:"Completadas",filter:"Filtros",filterBy:"FILTRAR POR ESTADO",filterAllDesc:"Mostrar todas las tareas",filterIncompleteDesc:"Ocultar tareas completadas",filterInProgressDesc:"Tareas en las que se est\xE1 trabajando",filterCompletedDesc:"Solo mostrar tareas terminadas",clearFilter:"Limpiar filtro",hideCompleted:"Ocultar Tareas Completadas",toDo:"Por Hacer / Pendiente"},contextMenu:{editTask:"Editar Tarea",addSubtask:"Agregar Subtarea",markIncomplete:"Marcar Incompleta",setInProgress:"Marcar En Progreso",markComplete:"Marcar Completada",splitTask:"Dividir Tarea",deleteTask:"Eliminar Tarea"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",addSubtask:"Agregar Subtarea",indent:"Aumentar Nivel",outdent:"Disminuir Nivel",moveUp:"Mover Arriba",moveDown:"Mover Abajo",splitTask:"Dividir Tarea",linkTasks:"Vincular Tareas",unlinkTasks:"Desvincular Tareas"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{progress:"Progreso",duration:"Duraci\xF3n",days:"d\xEDas",day:"d\xEDa",assigned:"Asignado",milestone:"Hito",criticalPath:"Ruta Cr\xEDtica",subtask:"Subtarea",task:"Tarea",noTasks:"Sin tareas a\xFAn",addTask:"Agregar tarea",newTask:"Nueva Tarea",loading:"Cargando...",error:"Error",today:"Hoy",week:"Semana",clickToSetDates:"Clic para establecer fechas..."},ai:{placeholder:'P\xEDdele a la IA que edite tareas... (ej: "Mover Dise\xF1o a la pr\xF3xima semana")',thinking:"Pensando...",suggestions:{moveTask:'Mover "Nombre de Tarea" al pr\xF3ximo lunes',extendTask:'Extender "Nombre de Tarea" por 3 d\xEDas',renameTask:'Renombrar "Nombre Anterior" a "Nombre Nuevo"',setProgress:'Establecer progreso de "Nombre de Tarea" al 50%',linkTasks:'Vincular "Tarea A" con "Tarea B"',createTask:'Crear una nueva tarea llamada "Nueva Tarea"',deleteTask:'Eliminar "Nombre de Tarea"',assignTask:'Asignar a Juan a "Nombre de Tarea"'},errors:{taskNotFound:"Tarea no encontrada",invalidDate:"Fecha inv\xE1lida",invalidDuration:"Duraci\xF3n inv\xE1lida",invalidProgress:"Valor de progreso inv\xE1lido",unknownCommand:"Comando desconocido",processingError:"Error procesando el comando"}},export:{projectName:"Proyecto Gantt",ganttTasks:"Tareas Gantt",taskId:"ID de Tarea",taskName:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",isMilestone:"Es Hito",parentId:"ID Padre",yes:"S\xED",no:"No",noTasksToExport:"No hay tareas disponibles para exportar"},dateFormat:{short:"dd/MM",medium:"d MMM",long:"d de MMMM de yyyy"}},Pi={en:Hn,es:Fc};function Lc(e){return Pi[e]||Pi.en}function Mi(e,t){let a=Lc(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},contextMenu:{...a.contextMenu,...t.contextMenu},actions:{...a.actions,...t.actions},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},ai:{...a.ai,...t.ai,suggestions:{...a.ai.suggestions,...t.ai?.suggestions},errors:{...a.ai.errors,...t.ai?.errors}},export:{...a.export,...t.export},dateFormat:{...a.dateFormat,...t.dateFormat}}:a}var Lo=react.createContext(Hn);function Vr(){return react.useContext(Lo)}function eb({theme:e,onExportPNG:t,onExportPDF:a,onExportExcel:r,onExportCSV:o,onExportJSON:s,onExportMSProject:n}){let[c,g]=react.useState(false),[i,p]=react.useState(null),l=react.useRef(null),f=Vr();if(react.useEffect(()=>{let h=b=>{l.current&&!l.current.contains(b.target)&&g(false);};return c&&document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[c]),!(t||a||r||o||s||n))return null;let k=[{id:"png",label:"PNG",description:"Image",icon:jsxRuntime.jsx(lucideReact.FileImage,{className:"w-4 h-4"}),handler:t},{id:"pdf",label:"PDF",description:"Document",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"excel",label:"Excel",description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-4 h-4"}),handler:r},{id:"csv",label:"CSV",description:"Comma-separated",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:o},{id:"json",label:"JSON",description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:s},{id:"msproject",label:"MS Project",description:"XML",icon:jsxRuntime.jsx(lucideReact.FolderKanban,{className:"w-4 h-4"}),handler:n}].filter(h=>h.handler),C=async(h,b)=>{if(b){p(h);try{await b();}catch(u){console.error(`Export ${h} failed:`,u);}finally{p(null),g(false);}}};return jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>g(!c),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{backgroundColor:c?e.accent:e.bgSecondary,border:`1px solid ${c?e.accent:e.borderLight}`,color:c?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:f.toolbar.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:c?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:c&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-48 rounded-lg overflow-hidden z-50",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsx("div",{className:"py-1",children:k.map((h,b)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>C(h.id,h.handler),disabled:i!==null,className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:b<k.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:b*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:i===h.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-4 h-4"})}):h.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:e.textPrimary},children:h.label}),jsxRuntime.jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:h.description})]})]},h.id))})})})]})}function tb({options:e,value:t,onChange:a,theme:r,layoutId:o="activeSegment"}){return jsxRuntime.jsx("div",{className:"inline-flex p-1 rounded-lg relative",style:{backgroundColor:r.bgSecondary,border:`1px solid ${r.borderLight}`},children:e.map(s=>{let n=t===s.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(s.value),className:"relative px-3 py-1.5 rounded-md text-xs transition-all flex items-center gap-1.5 min-w-[70px] justify-center",style:{color:n?r.textPrimary:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:n?600:500,zIndex:n?2:1},whileHover:{scale:1.02},whileTap:{scale:.98},children:[n&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:o,className:"absolute inset-0 rounded-md",style:{backgroundColor:r.accent,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},transition:{type:"spring",stiffness:400,damping:30}}),s.icon&&jsxRuntime.jsx("span",{className:"relative z-10",style:{color:n?"#FFFFFF":r.textTertiary},children:s.icon}),jsxRuntime.jsx("span",{className:"relative z-10",style:{color:n?"#FFFFFF":r.textTertiary},children:s.label})]},s.value)})})}function ab({options:e,value:t,onChange:a,theme:r}){return jsxRuntime.jsx("div",{className:"inline-flex items-center gap-1",children:e.map(o=>{let s=t===o.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(o.value),className:"relative px-3 py-1.5 text-xs transition-all",style:{color:s?r.accent:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:s?600:500},whileHover:{color:s?r.accent:r.textSecondary},whileTap:{scale:.98},children:[jsxRuntime.jsx("span",{children:o.label}),s&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:"timeScaleUnderline",className:"absolute bottom-0 left-1 right-1 h-0.5 rounded-full",style:{backgroundColor:r.accent},transition:{type:"spring",stiffness:400,damping:30}})]},o.value)})})}function rb({theme:e,value:t,onChange:a}){let[r,o]=react.useState(false),s=react.useRef(null),n=Vr();react.useEffect(()=>{let i=p=>{s.current&&!s.current.contains(p.target)&&o(false);};return r&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]);let c=[{value:"compact",label:n.toolbar.compact||"Compact"},{value:"comfortable",label:n.toolbar.normal||"Normal"},{value:"spacious",label:n.toolbar.spacious||"Spacious"}],g=c.find(i=>i.value===t)?.label||"Normal";return jsxRuntime.jsxs("div",{ref:s,className:"relative",children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>o(!r),className:"flex items-center justify-center p-2 rounded-lg transition-all",style:{backgroundColor:r?e.accentLight:e.bgSecondary,border:`1px solid ${r?e.accent:e.borderLight}`,color:r?e.accent:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},title:`${n.toolbar.density||"Density"}: ${g}`,children:jsxRuntime.jsx(lucideReact.Rows3,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:r&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute left-0 mt-2 w-36 rounded-lg overflow-hidden z-50",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsx("div",{className:"py-1",children:c.map((i,p)=>{let l=t===i.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(i.value),o(false);},className:"w-full flex items-center justify-between px-3 py-2 text-left transition-all",style:{backgroundColor:l?e.accentLight:"transparent",borderBottom:p<c.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:l?e.accentLight:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:p*.03},children:[jsxRuntime.jsx("span",{className:"text-xs",style:{color:l?e.accent:e.textPrimary,fontFamily:"Inter, sans-serif",fontWeight:l?600:500},children:i.label}),l&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent}})]},i.value)})})})})]})}function ob({theme:e,value:t,onChange:a,hideCompleted:r=false,onHideCompletedChange:o}){let[s,n]=react.useState(false),c=react.useRef(null),g=Vr();react.useEffect(()=>{if(!s)return;let f=setTimeout(()=>{let y=C=>{c.current&&!c.current.contains(C.target)&&n(false);},k=C=>{C.key==="Escape"&&n(false);};document.addEventListener("mousedown",y),document.addEventListener("keydown",k),c._cleanup=()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",k);};},100);return ()=>{clearTimeout(f),c._cleanup&&c._cleanup();}},[s]);let i=[{value:"all",label:g.toolbar.filterAll||"Show All",icon:jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#3B82F6] bg-[#3B82F6]"}),color:"text-[#3B82F6]"},{value:"completed",label:g.toolbar.filterCompleted||"Completed",icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),color:"text-green-500"},{value:"in_progress",label:g.toolbar.filterInProgress||"In Progress",icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),color:"text-blue-500"},{value:"incomplete",label:g.toolbar.toDo||"To Do / Pending",icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),color:"text-gray-400"}],p=t!=="all"||r,l=e.bgPrimary==="#0F1117"||e.bgPrimary==="#0a0a0a"||e.textPrimary==="#FFFFFF";return jsxRuntime.jsxs("div",{ref:c,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:f=>{f.stopPropagation(),n(y=>!y);},className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{backgroundColor:p?l?"rgba(59, 130, 246, 0.2)":"rgb(239 246 255)":s?e.hoverBg:e.bgSecondary,border:`1px solid ${p?l?"rgba(59, 130, 246, 0.5)":"rgb(191 219 254)":e.borderLight}`,color:p?"#3B82F6":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:g.toolbar.filter||"Filters"}),p&&jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#3B82F6"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute left-0 mt-2 w-64 rounded-lg overflow-hidden z-50",style:{backgroundColor:l?"#0F1117":"#FFFFFF",border:`1px solid ${l?"rgba(255,255,255,0.1)":"rgb(229 231 235)"}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:[jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:l?"rgba(255,255,255,0.1)":"rgb(229 231 235)"},children:jsxRuntime.jsx("span",{className:"text-xs font-medium uppercase tracking-wider",style:{color:l?"#6B7280":"#9CA3AF"},children:g.toolbar.filterBy||"FILTER BY STATUS"})}),jsxRuntime.jsx("div",{className:"py-2",children:i.map(f=>{let y=t===f.value&&!r;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(f.value),o&&o(false);},className:"w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",style:{backgroundColor:y?l?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent"},whileHover:{backgroundColor:l?"rgba(255,255,255,0.1)":"rgb(243 244 246)"},children:[jsxRuntime.jsx("span",{className:f.color,children:f.icon}),jsxRuntime.jsx("span",{className:"flex-1 text-left",style:{color:l?"#FFFFFF":"#111827"},children:f.label}),y&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:l?"#3B82F6":"#2563EB"}})]},f.value)})}),jsxRuntime.jsx("div",{className:"my-2 mx-4 h-px",style:{backgroundColor:l?"rgba(255,255,255,0.1)":"rgb(229 231 235)"}}),o&&jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{o(!r),r||a("all");},className:"w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",style:{backgroundColor:r?l?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent"},whileHover:{backgroundColor:l?"rgba(255,255,255,0.1)":"rgb(243 244 246)"},children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4",style:{color:r?l?"#3B82F6":"#2563EB":l?"#6B7280":"#9CA3AF"}}),jsxRuntime.jsx("span",{className:"flex-1 text-left",style:{color:l?"#FFFFFF":"#111827"},children:g.toolbar.hideCompleted||"Hide Completed Tasks"}),r&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:l?"#3B82F6":"#2563EB"}})]})})]})})]})}function Gn({theme:e,timeScale:t,onTimeScaleChange:a,zoom:r,onZoomChange:o,currentTheme:s,onThemeChange:n,rowDensity:c,onRowDensityChange:g,showThemeSelector:i=false,showCreateTaskButton:p=false,createTaskLabel:l,onCreateTask:f,taskFilter:y="all",onTaskFilterChange:k,hideCompleted:C=false,onHideCompletedChange:h,onExportPNG:b,onExportPDF:u,onExportExcel:x,onExportCSV:m,onExportJSON:N,onExportMSProject:w}){let B=Vr(),v=b||u||x||m||N||w,I=[{value:"day",label:B.toolbar.day},{value:"week",label:B.toolbar.week},{value:"month",label:B.toolbar.month}],A=[{value:"dark",label:"Dark",icon:jsxRuntime.jsx(lucideReact.Moon,{className:"w-3.5 h-3.5"})},{value:"light",label:"Light",icon:jsxRuntime.jsx(lucideReact.Sun,{className:"w-3.5 h-3.5"})},{value:"neutral",label:"Zen",icon:jsxRuntime.jsx(lucideReact.Palette,{className:"w-3.5 h-3.5"})}];return jsxRuntime.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.bgGrid,borderColor:e.border},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(ab,{options:I,value:t,onChange:T=>a(T),theme:e}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>o(Math.max(.5,r-.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsxs("div",{className:"px-2 py-0.5 rounded text-xs tabular-nums min-w-[42px] text-center",style:{color:e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},children:[Math.round(r*100),"%"]}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>o(Math.min(2,r+.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsx(rb,{theme:e,value:c,onChange:g}),k&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsx(ob,{theme:e,value:y,onChange:k,hideCompleted:C,onHideCompletedChange:h})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[p&&f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:f,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:l||B.toolbar.createTask})]}),(v||i)&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}})]}),v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(eb,{theme:e,onExportPNG:b,onExportPDF:u,onExportExcel:x,onExportCSV:m,onExportJSON:N,onExportMSProject:w}),i&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}})]}),i&&jsxRuntime.jsx(tb,{options:A,value:s,onChange:T=>n(T),theme:e})]})]})}function _n({columns:e,onToggleColumn:t,theme:a}){let[r,o]=react.useState(false),[s,n]=react.useState({x:0,y:0}),c=react.useRef(null),g=react.useRef(null);react.useEffect(()=>{if(!r)return;let p=l=>{c.current&&!c.current.contains(l.target)&&o(false);};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[r]);let i=e.filter(p=>p.id!=="name");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:g,onClick:()=>{if(!r&&g.current){let p=g.current.getBoundingClientRect();n({x:p.left,y:p.bottom+4});}o(!r);},className:"p-2 rounded-md transition-colors flex items-center gap-1",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.borderLight}`,color:a.textSecondary},whileHover:{backgroundColor:a.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:r&&jsxRuntime.jsx(bt,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:c,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"column-manager-menu fixed min-w-[180px] rounded-lg shadow-xl z-[9999]",style:{left:`${s.x}px`,top:`${s.y}px`,backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-xs uppercase tracking-wider",style:{color:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Add Column"}),i.map(p=>jsxRuntime.jsxs("button",{onClick:()=>{t(p.id);},className:"w-full px-3 py-2 text-left flex items-center justify-between transition-colors text-sm",style:{color:a.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor=a.hoverBg;},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{children:p.label}),p.visible&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:a.accent}})]},p.id))]})})})})]})}function Io({isOpen:e,x:t,y:a,items:r,onClose:o,theme:s}){let n=react.useRef(null),[c,g]=react.useState({x:t,y:a});if(react.useEffect(()=>{if(!e)return;let p=200,l=r.length*36+8,f=8,y=window.innerWidth,k=window.innerHeight,C=t,h=a;t+p+f>y&&(C=t-p,C<f&&(C=f)),a+l+f>k&&(h=k-l-f,h<f&&(h=f)),g({x:C,y:h});},[e,t,a,r.length]),react.useEffect(()=>{if(!e)return;let p=f=>{n.current&&!n.current.contains(f.target)&&o();},l=f=>{f.key==="Escape"&&o();};return document.addEventListener("mousedown",p),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",l);}},[e,o]),!e)return null;let i=p=>p.startsWith("#")&&(p.length===7||p.length===4)?p:s.bgPrimary?.includes("1")||s.bgPrimary?.includes("2")||s.textPrimary?.toLowerCase().includes("fff")||s.textPrimary?.toLowerCase().includes("white")?"#1E2128":"#FFFFFF";return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:n,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed z-[9999] min-w-[200px] rounded-lg",style:{left:`${c.x}px`,top:`${c.y}px`,backgroundColor:i(s.bgSecondary),border:`1px solid ${s.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2)",backdropFilter:"none"},children:jsxRuntime.jsx("div",{className:"py-1",children:r.map(p=>jsxRuntime.jsxs("div",{children:[p.separator&&jsxRuntime.jsx("div",{className:"my-1 h-px",style:{backgroundColor:s.borderLight}}),jsxRuntime.jsxs("button",{onClick:()=>{p.disabled||(p.onClick(),o());},disabled:p.disabled,className:"w-full px-3 py-2 text-left flex items-center gap-2 transition-colors text-sm",style:{color:p.disabled?s.textTertiary:s.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif",cursor:p.disabled?"not-allowed":"pointer",opacity:p.disabled?.5:1},onMouseEnter:l=>{p.disabled||(l.currentTarget.style.backgroundColor=s.hoverBg);},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="transparent";},children:[p.icon&&jsxRuntime.jsx("span",{style:{color:s.textSecondary},children:p.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:p.label}),p.submenu&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:s.textTertiary}})]})]},p.id))})})})}var Wt={Edit:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),Pencil:jsxRuntime.jsx(lucideReact.Pencil,{className:"w-4 h-4"}),Delete:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),Add:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),AddSubtask:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),Remove:jsxRuntime.jsx(lucideReact.Minus,{className:"w-4 h-4"}),Link:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),Progress:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),Sort:jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-4 h-4"}),SortAsc:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),SortDesc:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),Hide:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),Show:jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"}),Settings:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"}),Split:jsxRuntime.jsx(lucideReact.Scissors,{className:"w-4 h-4"}),MarkIncomplete:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),SetInProgress:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),MarkComplete:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"})};function Wc({tasks:e,selectedTaskIds:t,onTaskSelect:a,onTaskCreate:r,onTaskDelete:o,onTaskDuplicate:s,onTaskMove:n,onTaskIndent:c,onTaskOutdent:g,onTaskRename:i,onTaskToggleExpand:p,onOpenTaskModal:l,enableKeyboard:f=true}){let y=react.useRef(false),k=react.useCallback(x=>{y.current=x;},[]),C=react.useCallback(x=>{let m=[],N=w=>{for(let B of w)m.push(B),B.subtasks&&B.subtasks.length>0&&B.isExpanded&&N(B.subtasks);};return N(x),m},[]),h=react.useCallback(()=>{let x=C(e);for(let m of x)if(t.has(m.id))return m;return null},[e,t,C]),b=react.useCallback((x,m)=>{let N=C(e);if(N.length===0)return;let w=h();if(!w){a(N[0].id,false);return}let B=N.findIndex(A=>A.id===w.id);if(B===-1)return;let v=x==="up"?B-1:B+1;if(v<0||v>=N.length)return;let I=N[v];a(I.id,m);},[e,h,C,a]),u=react.useCallback(x=>{if(!f)return;let m=x.target;if(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable||y.current){x.key==="Escape"&&(m.blur(),y.current=false);return}let B=navigator.platform.toUpperCase().indexOf("MAC")>=0?x.metaKey:x.ctrlKey,v=Array.from(t),I=h();if(x.key==="ArrowUp"){x.preventDefault(),b("up",x.shiftKey);return}if(x.key==="ArrowDown"){x.preventDefault(),b("down",x.shiftKey);return}if(I&&(x.key==="ArrowRight"||x.key==="ArrowLeft")){I.subtasks&&I.subtasks.length>0&&(x.preventDefault(),(x.key==="ArrowRight"&&!I.isExpanded||x.key==="ArrowLeft"&&I.isExpanded)&&p(I.id));return}if(x.altKey&&(x.key==="ArrowUp"||x.key==="ArrowDown")){v.length>0&&(x.preventDefault(),n(v,x.key==="ArrowUp"?"up":"down"));return}if(x.key==="Tab"&&!x.shiftKey){v.length>0&&(x.preventDefault(),c(v));return}if(x.key==="Tab"&&x.shiftKey){v.length>0&&(x.preventDefault(),g(v));return}if(x.key==="Enter"&&!x.shiftKey&&!B){I&&(x.preventDefault(),r(I.id,"below"));return}if(x.key==="Enter"&&x.shiftKey&&!B){I&&(x.preventDefault(),r(I.id,"above"));return}if(x.key==="Enter"&&B){I&&(x.preventDefault(),l(I.id));return}if(x.key==="F2"){I&&(x.preventDefault(),i(I.id));return}if(x.key==="Delete"||x.key==="Backspace"&&B){v.length>0&&(x.preventDefault(),o(v));return}if(x.key==="d"&&B&&!x.shiftKey){v.length>0&&(x.preventDefault(),s(v));return}},[f,t,h,b,r,o,s,n,c,g,i,p,l]);return react.useEffect(()=>{if(f)return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u);}},[f,u]),{setIsEditing:k}}function _c(){let[e,t]=react.useState(new Set),[a,r]=react.useState(null),o=react.useCallback(l=>{t(new Set([l])),r(l);},[]),s=react.useCallback(l=>{t(f=>{let y=new Set(f);return y.has(l)?y.delete(l):y.add(l),y}),r(l);},[]),n=react.useCallback((l,f)=>{if(!a){o(l);return}let y=f.indexOf(a),k=f.indexOf(l);if(y===-1||k===-1){o(l);return}let C=Math.min(y,k),h=Math.max(y,k),b=f.slice(C,h+1);t(new Set(b)),r(l);},[a,o]),c=react.useCallback((l,f,y,k)=>{k?n(l,f):y?s(l):o(l);},[o,s,n]),g=react.useCallback((l,f)=>{f?t(y=>{let k=new Set(y);return k.add(l),k}):o(l);},[o]),i=react.useCallback(()=>{t(new Set),r(null);},[]),p=react.useCallback(l=>e.has(l),[e]);return {selectedTaskIds:e,selectTask:o,toggleTaskSelection:s,selectTaskRange:n,handleTaskClick:c,handleKeyboardSelection:g,clearSelection:i,isTaskSelected:p}}function Bo(e){let t=[],a=(r,o,s=0)=>{for(let n=0;n<r.length;n++){let c={...r[n],parentId:o,level:s,position:n};t.push(c),c.subtasks&&c.subtasks.length>0&&c.isExpanded&&a(c.subtasks,c.id,s+1);}};return a(e),t}function Vc(e,t){for(let a of e){if(a.id===t)return a;if(a.subtasks){let r=Vc(a.subtasks,t);if(r)return r}}return null}function Oi(e,t){for(let a of e)if(a.subtasks){if(a.subtasks.some(o=>o.id===t))return a;let r=Oi(a.subtasks,t);if(r)return r}return null}function $i(e,t){if(t.length===0)return e;let a=Bo(e),r=t[0],o=a.findIndex(l=>l.id===r);if(o<=0)return e;let s=a[o-1],n=(l,f)=>{let y=[];return {tasks:l.filter(C=>{if(f.has(C.id))return y.push(C),false;if(C.subtasks){let h=n(C.subtasks,f);C.subtasks=h.tasks,y.push(...h.removed);}return true}),removed:y}},c=(l,f,y)=>l.map(k=>k.id===f?{...k,subtasks:[...k.subtasks||[],...y],isExpanded:true}:k.subtasks?{...k,subtasks:c(k.subtasks,f,y)}:k),g=new Set(t),{tasks:i,removed:p}=n(e,g);return c(i,s.id,p)}function Ui(e,t){if(t.length===0)return e;let a=[...e];for(let r of t){let o=Oi(a,r);if(!o)continue;let s=Oi(a,o.id),n=(i,p,l)=>{for(let f=0;f<i.length;f++){let y=i[f];if(y.id===p&&y.subtasks){let k=y.subtasks.findIndex(C=>C.id===l);if(k!==-1){let[C]=y.subtasks.splice(k,1);return C}}if(y.subtasks){let k=n(y.subtasks,p,l);if(k)return k}}return null},c=(i,p,l)=>{let f=i.findIndex(y=>y.id===p);if(f!==-1)return i.splice(f+1,0,l),i;for(let y of i)y.subtasks&&c(y.subtasks,p,l);return i},g=n(a,o.id,r);g&&(s&&s.subtasks?c(s.subtasks,o.id,g):c(a,o.id,g));}return a}function zi(e,t,a){if(t.length===0)return e;let r=[...e],o=t[0],s=(n,c,g)=>{let i=n.findIndex(l=>l.id===c);if(i===-1){for(let l of n)if(l.subtasks&&s(l.subtasks,c,g))return true;return false}let p=g==="up"?i-1:i+1;return p<0||p>=n.length?false:([n[i],n[p]]=[n[p],n[i]],true)};return s(r,o,a),r}function Hi(e,t){let a=new Set(t),r=o=>o.filter(s=>!a.has(s.id)).map(s=>s.subtasks?{...s,subtasks:r(s.subtasks)}:s);return r(e)}function Wi(e,t){let a=[...e];for(let r of t){let o=n=>{let c=n.findIndex(p=>p.id===r);if(c===-1){for(let p of n)if(p.subtasks&&o(p.subtasks))return true;return false}let g=n[c],i={...g,id:`${g.id}-copy-${Date.now()}`,name:`${g.name} (Copy)`,subtasks:g.subtasks?s(g.subtasks):void 0};return n.splice(c+1,0,i),true},s=n=>n.map(c=>({...c,id:`${c.id}-copy-${Date.now()}`,subtasks:c.subtasks?s(c.subtasks):void 0}));o(a);}return a}function jc(e,t,a){let r=[...e],o=new Date,s=new Date(o);s.setDate(s.getDate()+7);let n={id:`task-${Date.now()}`,name:"New Task",progress:0,status:"todo",startDate:o,endDate:s,color:"#6366F1"},c=g=>{let i=g.findIndex(l=>l.id===t);if(i===-1){for(let l of g)if(l.subtasks&&c(l.subtasks))return true;return false}let p=a==="above"?i:i+1;return g.splice(p,0,n),true};return c(r),{tasks:r,newTask:n}}function Gi(e,t,a){return e.map(r=>r.id===t?{...r,name:a}:r.subtasks?{...r,subtasks:Gi(r.subtasks,t,a)}:r)}function _i(e,t){return e.map(a=>a.id===t?{...a,isExpanded:!a.isExpanded}:a.subtasks?{...a,subtasks:_i(a.subtasks,t)}:a)}function Vi(e,t){let a=p=>{for(let l of p){if(l.id===t)return l;if(l.subtasks){let f=a(l.subtasks);if(f)return f}}return null},r=a(e),o=new Date,s=new Date(o);s.setDate(s.getDate()+7);let n=r?.startDate||o,c=r?.endDate||s,g={id:`task-${Date.now()}`,name:"New Subtask",progress:0,status:"todo",startDate:new Date(n),endDate:new Date(c),color:r?.color||"#3B82F6"},i=p=>p.map(l=>{if(l.id===t){let f=l.subtasks||[];return {...l,subtasks:[...f,g],isExpanded:true}}return l.subtasks?{...l,subtasks:i(l.subtasks)}:l});return {tasks:i(e),newTask:g}}function Kc(e,t,a,r){if(t===a)return e;let o=Vc(e,t);if(!o)return e;if(a){let c=(g,i)=>{if(!g.subtasks)return false;for(let p of g.subtasks)if(p.id===i||c(p,i))return true;return false};if(c(o,a))return e}let s=c=>c.filter(g=>g.id!==t).map(g=>g.subtasks&&g.subtasks.length>0?{...g,subtasks:s(g.subtasks)}:g),n=s(e);if(a===null){let c=r!==void 0?r:n.length;n.splice(c,0,{...o,parentId:void 0});}else {let c=g=>g.map(i=>{if(i.id===a){let p=i.subtasks||[],l=r!==void 0?r:p.length,f=[...p];return f.splice(l,0,{...o,parentId:a}),{...i,subtasks:f,isExpanded:true}}return i.subtasks&&i.subtasks.length>0?{...i,subtasks:c(i.subtasks)}:i});n=c(n);}return n}function Kn({tasks:e,theme:t,rowHeight:a,availableUsers:r=[],templates:o,onTaskClick:s,onTaskDblClick:n,onTaskContextMenu:c,onTaskToggle:g,scrollTop:i,columns:p,onToggleColumn:l,onColumnResize:f,onTaskUpdate:y,onTaskIndent:k,onTaskOutdent:C,onTaskMove:h,onMultiTaskDelete:b,onTaskDuplicate:u,onTaskCreate:x,onTaskRename:m,onCreateSubtask:N,onOpenTaskModal:w,onDeleteRequest:B,onTaskReparent:v}){let I=react.useContext(Lo),[A,T]=react.useState(null),[W,$]=react.useState(null),[j,te]=react.useState(""),oe=react.useRef(null),[re,ge]=react.useState(null),[fe,Ie]=react.useState(0),[M,R]=react.useState(0),[L,V]=react.useState({isOpen:false,x:0,y:0,type:"header"}),[q,z]=react.useState(null),[ye,ne]=react.useState(null),[Be,qe]=react.useState(null),tt=react.useRef(0),le=5,Je=react.useRef(false),[ct,wt]=react.useState(null),[vt,U]=react.useState(false),[me,Ae]=react.useState(null),[Fe,je]=react.useState(false),Qe=react.useRef(null);react.useEffect(()=>{function _(Y){Qe.current&&!Qe.current.contains(Y.target)&&je(false);}if(Fe)return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[Fe]),react.useEffect(()=>{W&&oe.current&&(oe.current.focus(),oe.current.select());},[W]),react.useEffect(()=>{if(!re)return;let _=se=>{let Ye=se.clientX-fe,Ue=M+Ye;f?.(re,Ue);},Y=()=>{ge(null),document.body.style.cursor="",document.body.style.userSelect="";};return document.addEventListener("mousemove",_),document.addEventListener("mouseup",Y),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",Y),document.body.style.cursor="",document.body.style.userSelect="";}},[re,fe,M,f]);let{selectedTaskIds:Pt,handleTaskClick:Re,isTaskSelected:J}=_c(),{setIsEditing:ve}=Wc({tasks:e,selectedTaskIds:Pt,onTaskSelect:(_,Y)=>{let Ye=Bo(e).map(Ue=>Ue.id);Re(_,Ye,Y||false,false);},onTaskCreate:x||(()=>{}),onTaskDelete:b||(()=>{}),onTaskDuplicate:u||(()=>{}),onTaskMove:h||(()=>{}),onTaskIndent:k||(()=>{}),onTaskOutdent:C||(()=>{}),onTaskRename:_=>{let Y=Bo(e).find(se=>se.id===_);Y&&ea(Y);},onTaskToggleExpand:g||(()=>{}),onOpenTaskModal:_=>{let Y=Bo(e).find(se=>se.id===_);Y&&w&&w(Y);},enableKeyboard:true}),He=(_,Y=0)=>{let se=[];for(let Ye of _)se.push({task:Ye,level:Y}),Ye.subtasks&&Ye.subtasks.length>0&&Ye.isExpanded&&se.push(...He(Ye.subtasks,Y+1));return se},Le=He(e),nt=48,st=Math.max(Le.length*a,600-nt),_e=_=>!_.startDate||!_.endDate?"-":`${Math.ceil((_.endDate.getTime()-_.startDate.getTime())/(1e3*60*60*24))}d`,ea=_=>{$(_.id),te(_.name),ve(true);},ke=_=>{j.trim()&&j!==e.find(Y=>Y.id===_)?.name&&m?.(_,j.trim()),$(null),te(""),ve(false);},be=()=>{$(null),te(""),ve(false);},Ke=(_,Y)=>{Y.stopPropagation(),N?.(_.id);},F=(_,Y)=>{Y.preventDefault(),tt.current=Y.clientY,z(_),Je.current=false,U(false),wt({x:Y.clientX,y:Y.clientY});},Ce=_=>{if(!q||(Math.abs(_.clientY-tt.current)>le&&!Je.current&&(Je.current=true,U(true)),wt({x:_.clientX,y:_.clientY}),!Je.current))return;let se=document.querySelectorAll("[data-task-row]"),Ye=null,Ue=null;se.forEach(H=>{let ie=H.getBoundingClientRect(),We=H.getAttribute("data-task-row");if(We&&We!==q&&_.clientY>=ie.top&&_.clientY<=ie.bottom){Ye=We;let Mt=_.clientY-ie.top,pt=ie.height;Mt<pt*.25?Ue="above":Mt>pt*.75?Ue="below":Ue="child";}}),ne(Ye),qe(Ue);},Z=()=>{if(Je.current&&q&&ye&&Be){if(Be==="child")v?.(q,ye);else if(Be==="above"||Be==="below"){let _=(Ye,Ue,H=null)=>{for(let ie of Ye){if(ie.id===Ue)return H;if(ie.subtasks){let We=_(ie.subtasks,Ue,ie.id);if(We!==void 0)return We}}},Y=_(e,ye,null),se=(Ye,Ue)=>{let H=Ye.findIndex(ie=>ie.id===Ue);return Be==="below"?H+1:H};if(Y===null){let Ye=se(e,ye);v?.(q,null,Ye);}else {let Ye=Le.find(Ue=>Ue.task.id===Y)?.task;if(Ye?.subtasks){let Ue=se(Ye.subtasks,ye);v?.(q,Y,Ue);}}}}z(null),ne(null),qe(null),wt(null),Je.current=false,U(false);};react.useEffect(()=>{if(q)return document.addEventListener("mousemove",Ce),document.addEventListener("mouseup",Z),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",Ce),document.removeEventListener("mouseup",Z),document.body.style.cursor="",document.body.style.userSelect="";}},[q,ye,Be]);let Te=(_,Y,se)=>{switch(_.id){case "name":let Ye=W===Y.id,Ue=A===Y.id;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 relative",style:{paddingLeft:`${se*20}px`},children:[v&&jsxRuntime.jsx("div",{className:"cursor-grab active:cursor-grabbing p-0.5 rounded hover:bg-white/10 transition-all flex-shrink-0",style:{color:t.textTertiary,opacity:Ue?1:.3},onMouseDown:O=>F(Y.id,O),title:"Arrastrar para mover tarea",children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-4 h-4"})}),Y.subtasks&&Y.subtasks.length>0?jsxRuntime.jsx("button",{onClick:O=>{O.stopPropagation(),g?.(Y.id);},className:"p-0.5 hover:bg-opacity-10 rounded transition-colors flex-shrink-0",style:{color:t.textSecondary},children:Y.isExpanded?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})}):jsxRuntime.jsx("div",{className:"w-5 h-5 flex-shrink-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full border",style:{backgroundColor:Y.color||"#3B82F6",opacity:Y.parentId?.6:1,borderColor:Y.isMilestone?t.accent:"transparent",borderWidth:Y.isMilestone?"2px":"0px"},title:Y.isMilestone?"Milestone":Y.parentId?"Subtask":"Task"})}),Ye?jsxRuntime.jsx("input",{ref:oe,type:"text",value:j,onChange:O=>te(O.target.value),onKeyDown:O=>{O.key==="Enter"?ke(Y.id):O.key==="Escape"&&be();},onBlur:()=>ke(Y.id),className:"flex-1 px-2 py-1 rounded border outline-none",style:{backgroundColor:t.bgPrimary,borderColor:t.accent,color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:"13px",fontWeight:500},onClick:O=>O.stopPropagation()}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"flex-1",style:{color:Y.parentId?t.textSecondary:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:Y.parentId?"13px":"14px",fontWeight:Y.isMilestone?600:Y.parentId?400:600,letterSpacing:Y.parentId?"0":"-0.01em"},title:Y.name,children:Y.name}),Ue&&!Ye&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 ml-2",onClick:O=>O.stopPropagation(),children:[jsxRuntime.jsx("button",{onClick:O=>Ke(Y,O),className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Create subtask",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:O=>{O.stopPropagation(),ea(Y);},className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Rename (F2)",children:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-3.5 h-3.5"})})]})]})]});case "startDate":case "endDate":let ie=_.id==="startDate"?"startDate":"endDate",We=Y[ie],Mt=me?.taskId===Y.id&&me?.field===ie,pt=O=>O?(typeof O=="string"?new Date(O):O).toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric"}):"-";return jsxRuntime.jsxs("div",{className:"flex items-center justify-center w-full relative",onClick:O=>O.stopPropagation(),children:[jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors hover:bg-white/5",style:{color:t.textSecondary},onClick:O=>{if(Mt)Ae(null);else {let Me=O.currentTarget.getBoundingClientRect();Ae({taskId:Y.id,field:ie,month:We?typeof We=="string"?new Date(We):We:new Date,position:{top:Me.bottom+4,left:Me.left}});}},children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3 h-3",style:{color:t.textTertiary}}),jsxRuntime.jsx("span",{children:pt(We)})]}),Mt&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>Ae(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"fixed z-[9999] rounded-xl shadow-2xl overflow-visible flex",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,top:me?.position.top,left:me?.position.left},onClick:O=>O.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"w-36 py-2",style:{borderRight:`1px solid ${t.border}`},children:[(()=>{let O=new Date,Me=new Date(O);Me.setDate(O.getDate()+1);let Xe=new Date(O);Xe.setDate(O.getDate()+7);let Lt=new Date(O);return Lt.setDate(O.getDate()+14),[{label:"Hoy",date:O},{label:"Ma\xF1ana",date:Me},{label:"Pr\xF3xima semana",date:Xe},{label:"2 semanas",date:Lt}].map((ze,xt)=>jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:t.textPrimary},onMouseEnter:Ve=>Ve.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:Ve=>Ve.currentTarget.style.backgroundColor="transparent",onClick:()=>{y?.(Y.id,{[ie]:ze.date}),Ae(null);},children:ze.label},xt))})(),jsxRuntime.jsx("div",{style:{borderTop:`1px solid ${t.border}`,margin:"0.25rem 0"}}),jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:"#EF4444"},onMouseEnter:O=>O.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:O=>O.currentTarget.style.backgroundColor="transparent",onClick:()=>{y?.(Y.id,{[ie]:void 0}),Ae(null);},children:"Borrar"})]}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>Ae(O=>O?{...O,month:new Date(O.month.getFullYear(),O.month.getMonth()-1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textPrimary},children:me?.month.toLocaleDateString("es-ES",{month:"long",year:"numeric"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>Ae(O=>O?{...O,month:new Date(O.month.getFullYear(),O.month.getMonth()+1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:["D","L","M","M","J","V","S"].map((O,Me)=>jsxRuntime.jsx("div",{className:"w-6 h-6 flex items-center justify-center text-[10px]",style:{color:t.textTertiary},children:O},Me))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let O=me?.month||new Date,Me=O.getFullYear(),Xe=O.getMonth(),Lt=new Date(Me,Xe,1).getDay(),de=new Date(Me,Xe+1,0).getDate(),ze=new Date,xt=[];for(let ft=Lt-1;ft>=0;ft--)xt.push({day:new Date(Me,Xe,-ft).getDate(),date:new Date(Me,Xe-1,new Date(Me,Xe,-ft).getDate()),isCurrentMonth:false});for(let ft=1;ft<=de;ft++)xt.push({day:ft,date:new Date(Me,Xe,ft),isCurrentMonth:true});let Ve=42-xt.length;for(let ft=1;ft<=Ve;ft++)xt.push({day:ft,date:new Date(Me,Xe+1,ft),isCurrentMonth:false});return xt.map((ft,aa)=>{let Ca=ft.date.toDateString()===ze.toDateString(),Ze=(We?typeof We=="string"?new Date(We):We:null)?.toDateString()===ft.date.toDateString();return jsxRuntime.jsx("button",{type:"button",className:"w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",style:{color:ft.isCurrentMonth?Ze?"#FFF":t.textPrimary:t.textTertiary,backgroundColor:Ze?"#3B82F6":"transparent",boxShadow:Ca&&!Ze?"inset 0 0 0 1px #3B82F6":"none"},onClick:()=>{y?.(Y.id,{[ie]:ft.date}),Ae(null);},children:ft.day},aa)})})()})]})]})]}),document.body)]});case "duration":return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",children:jsxRuntime.jsx("span",{className:"text-xs tabular-nums",style:{color:t.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:600},children:_e(Y)})});case "assignees":let Ar=r.filter(O=>Y.assignees?.some(Me=>Me.name===O.name||Me.initials===O.initials));return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:O=>O.stopPropagation(),children:jsxRuntime.jsx(ro,{assignedUsers:Ar,availableUsers:r,onChange:O=>{let Me=O.map(Xe=>({id:Xe.id,name:Xe.name,initials:Xe.initials,color:Xe.color}));y?.(Y.id,{assignees:Me.length>0?Me:void 0});}})});case "status":return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:O=>O.stopPropagation(),children:jsxRuntime.jsx(Bd,{status:Y.status||"todo",onChange:O=>{y?.(Y.id,{status:O,progress:O==="completed"?100:Y.progress});}})});case "progress":return jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden max-w-[60px]",style:{backgroundColor:t.bgSecondary},children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Y.progress}%`,backgroundColor:Y.progress===100?t.statusCompleted:t.accent}})}),jsxRuntime.jsxs("span",{className:"text-xs tabular-nums min-w-[35px] text-right",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[Y.progress,"%"]})]});case "priority":let wa={low:"LOW",medium:"MEDIUM",high:"HIGH",urgent:"URGENT"},ta={LOW:"low",MEDIUM:"medium",HIGH:"high",URGENT:"urgent"},P=wa[Y.priority||"medium"]||"MEDIUM";return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:O=>O.stopPropagation(),children:jsxRuntime.jsx(to,{priority:P,onChange:O=>{O&&y?.(Y.id,{priority:ta[O]||"medium"});}})});default:return null}},we=_=>[{id:"hide",label:"Hide Column",icon:Wt.Hide,onClick:()=>l(_),disabled:_==="name"},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"sortAsc",label:"Sort Ascending",icon:Wt.SortAsc,onClick:()=>{}},{id:"sortDesc",label:"Sort Descending",icon:Wt.SortDesc,onClick:()=>{}}],Oe=_=>_.subtasks&&_.subtasks.length>0?[{id:"addSubtask",label:I?.contextMenu?.addSubtask||"Add Subtask",icon:Wt.Add,onClick:()=>{N?.(_.id);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"delete",label:I?.contextMenu?.deleteTask||"Delete Task",icon:Wt.Delete,onClick:()=>{B?B(_.id,_.name):b?.([_.id]);}}]:[{id:"edit",label:I?.contextMenu?.editTask||"Edit Task",icon:Wt.Pencil,onClick:()=>{n?.(_);}},{id:"addSubtask",label:I?.contextMenu?.addSubtask||"Add Subtask",icon:Wt.Add,onClick:()=>{N?.(_.id);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"markIncomplete",label:I?.contextMenu?.markIncomplete||"Mark Incomplete",icon:Wt.MarkIncomplete,onClick:()=>{y?.(_.id,{status:"todo",progress:0});},disabled:_.status==="todo"},{id:"setInProgress",label:I?.contextMenu?.setInProgress||"Set In Progress",icon:Wt.SetInProgress,onClick:()=>{y?.(_.id,{status:"in-progress"});},disabled:_.status==="in-progress"},{id:"markComplete",label:I?.contextMenu?.markComplete||"Mark Complete",icon:Wt.MarkComplete,onClick:()=>{y?.(_.id,{status:"completed",progress:100});},disabled:_.status==="completed"},{id:"sep2",label:"",onClick:()=>{},separator:true},{id:"split",label:I?.contextMenu?.splitTask||"Split Task",icon:Wt.Split,onClick:()=>{},disabled:true},{id:"sep3",label:"",onClick:()=>{},separator:true},{id:"delete",label:I?.contextMenu?.deleteTask||"Delete Task",icon:Wt.Delete,onClick:()=>{B?B(_.id,_.name):b?.([_.id]);}}],$e=p.filter(_=>_.visible),dt=$e.reduce((_,Y)=>_+Y.width,0);return jsxRuntime.jsxs("div",{className:"gantt-taskgrid-content",style:{backgroundColor:t.bgPrimary,minWidth:dt},children:[jsxRuntime.jsxs("div",{className:"sticky top-0 z-10 flex items-center",style:{backgroundColor:t.bgGrid,height:`${nt}px`,paddingLeft:"3px",borderBottom:`1px solid ${t.border}`,boxSizing:"border-box"},children:[jsxRuntime.jsx("div",{className:"flex items-center flex-1 min-w-0",children:$e.map((_,Y)=>{let se=Y===$e.length-1,Ye=_.id==="name";return jsxRuntime.jsxs("div",{className:`flex items-center px-4 cursor-pointer hover:bg-opacity-50 transition-colors relative ${Ye?"":"justify-center"}`,style:{width:`${_.width}px`,minWidth:`${_.minWidth??(Ye?200:60)}px`,maxWidth:`${_.maxWidth??2e3}px`,flexShrink:0,flexGrow:0,borderRight:se?"none":`1px solid ${t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"hidden"},onContextMenu:Ue=>{Ue.preventDefault(),V({isOpen:true,x:Ue.clientX,y:Ue.clientY,type:"header",columnId:_.id});},onMouseEnter:Ue=>{Ue.currentTarget.style.backgroundColor=t.hoverBg;},onMouseLeave:Ue=>{Ue.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,paddingRight:"0"},title:_.label,children:_.label}),_.resizable&&jsxRuntime.jsx("div",{className:"absolute right-0 top-0 bottom-0 cursor-col-resize transition-colors group",style:{width:"8px",marginRight:"-4px",backgroundColor:re===_.id?`${t.accent}30`:"transparent",zIndex:5},onMouseDown:Ue=>{Ue.preventDefault(),Ue.stopPropagation(),ge(_.id),Ie(Ue.clientX),R(_.width);},title:"Drag to resize column",children:jsxRuntime.jsx("div",{className:"absolute top-2 bottom-2 opacity-0 group-hover:opacity-100 transition-opacity",style:{left:"3px",width:"2px",backgroundColor:t.accent,borderRadius:"1px"}})})]},_.id)})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 px-2",style:{position:"sticky",right:0,height:"100%",backgroundColor:t.bgGrid,zIndex:5},children:[jsxRuntime.jsx(_n,{columns:p,onToggleColumn:l,theme:t}),jsxRuntime.jsx("button",{onClick:()=>je(!Fe),className:"p-1.5 rounded hover:bg-opacity-10 transition-colors",style:{color:t.textTertiary},title:"Keyboard shortcuts",children:jsxRuntime.jsx(lucideReact.Keyboard,{className:"w-4 h-4"})}),Fe&&jsxRuntime.jsxs("div",{ref:Qe,className:"absolute top-full right-0 mt-2 p-4 rounded-lg shadow-2xl z-50 min-w-[400px]",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,color:t.textPrimary},onClick:_=>_.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b",style:{borderColor:t.border},children:[jsxRuntime.jsx("h3",{className:"font-semibold text-sm",style:{color:t.textPrimary},children:"Keyboard Shortcuts"}),jsxRuntime.jsx("button",{onClick:()=>je(false),className:"text-xs px-2 py-1 rounded hover:bg-opacity-10",style:{color:t.textTertiary},children:"Close"})]}),jsxRuntime.jsxs("div",{className:"space-y-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Navigation"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move focus up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Select range"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Toggle selection"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Click"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Hierarchy"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Indent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Outdent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Expand/Collapse"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2192 / \u2190"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Editing"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task below"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task above"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Open task modal"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Rename task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"F2"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Actions"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move task up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Alt + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Delete task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Delete"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Duplicate task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + D"})]})]})]})]})]})]})]}),jsxRuntime.jsx("div",{className:"gantt-taskgrid-content",style:{minHeight:st},children:Le.map(({task:_,level:Y},se)=>{let Ye=J(_.id),Ue=ye===_.id,H=Ue&&Be==="above",ie=Ue&&Be==="below",We=Ue&&Be==="child",Mt={};return We&&(Mt.backgroundColor=`${t.accent}15`,Mt.boxShadow=`inset 0 0 0 2px ${t.accent}`),jsxRuntime.jsxs(framerMotion.motion.div,{"data-task-row":_.id,className:`flex items-center cursor-pointer group ${q===_.id?"opacity-50":""}`,style:{position:"relative",height:`${a}px`,borderLeft:Ye?`3px solid ${t.accent}`:"3px solid transparent",backgroundColor:Ye?t.accentLight:We?`${t.accent}15`:se%2===0?t.bgPrimary:t.bgGrid,...Mt},onMouseEnter:()=>T(_.id),onMouseLeave:()=>T(null),onClick:pt=>{let wa=Bo(e).map(O=>O.id),P=navigator.platform.toUpperCase().indexOf("MAC")>=0?pt.metaKey:pt.ctrlKey;Re(_.id,wa,P,pt.shiftKey),s?.(_);},onDoubleClick:pt=>{pt.stopPropagation(),n?.(_);},onContextMenu:pt=>{pt.preventDefault(),V({isOpen:true,x:pt.clientX,y:pt.clientY,type:"task",task:_}),c?.(_,pt);},whileHover:{backgroundColor:Ye?t.accentLight:t.hoverBg},children:[H&&jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),ie&&jsxRuntime.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),$e.map((pt,Ar)=>{let wa=Ar===$e.length-1,ta=pt.id==="name";return jsxRuntime.jsx("div",{className:`px-4 flex items-center ${ta?"justify-start":"justify-center"}`,style:{width:`${pt.width}px`,minWidth:`${pt.minWidth??(ta?200:60)}px`,maxWidth:`${pt.maxWidth??2e3}px`,flexShrink:0,flexGrow:0,borderRight:wa?"none":`1px solid ${A===_.id?t.border:t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"hidden"},children:Te(pt,_,ta?Y:0)},`${_.id}-${pt.id}`)})]},_.id)})}),jsxRuntime.jsx(Io,{isOpen:L.isOpen,x:L.x,y:L.y,items:L.type==="header"&&L.columnId?we(L.columnId):L.type==="task"&&L.task?Oe(L.task):[],onClose:()=>V({...L,isOpen:false}),theme:t}),vt&&ct&&q&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",left:ct.x+12,top:ct.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let _=Le.find(Y=>Y.task.id===q)?.task;return _?jsxRuntime.jsx("div",{className:"flex items-center gap-2 px-2 py-1 rounded",style:{backgroundColor:"rgba(255, 255, 255, 0.08)",backdropFilter:"blur(4px)"},children:jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textSecondary,opacity:.9},children:_.name})}):null})()}),document.body)]})}function Zc(e,t){let[a,r]=react.useState("none"),[o,s]=react.useState(0),[n,c]=react.useState(e),[g,i]=react.useState(t),[p,l]=react.useState(null),[f,y]=react.useState(null),[k,C]=react.useState(null),[h,b]=react.useState(null),[u,x]=react.useState(0),[m,N]=react.useState(0),[w,B]=react.useState(null),[v,I]=react.useState(false);return {dragMode:a,setDragMode:r,dragOffset:o,setDragOffset:s,ghostX:n,setGhostX:c,ghostWidth:g,setGhostWidth:i,connectionLine:p,setConnectionLine:l,hoveredTaskId:f,setHoveredTaskId:y,activeZone:k,setActiveZone:C,draggedSegmentIndex:h,setDraggedSegmentIndex:b,draggedSegmentStartX:u,setDraggedSegmentStartX:x,segmentDragOffsetX:m,setSegmentDragOffsetX:N,hoveredSegmentIndex:w,setHoveredSegmentIndex:B,isHovered:v,setIsHovered:I,isDragging:a!=="none",isResizing:a==="resize-start"||a==="resize-end",isConnecting:a==="connect",resetDragState:(j,te)=>{r("none"),l(null),y(null),c(j),i(te),N(0),b(null),x(0);}}}function qn({task:e,x:t,y:a,width:r,theme:o,dayWidth:s,startDate:n,templates:c,onClick:g,onDoubleClick:i,onContextMenu:p,onDateChange:l,onDependencyCreate:f,allTaskPositions:y=[],onDragMove:k,onHoverChange:C}){let h=Zc(t,r),b=react.useRef(null),u=react.useRef(null),x=react.useRef(null),{dragMode:m,setDragMode:N,dragOffset:w,setDragOffset:B,ghostX:v,setGhostX:I,ghostWidth:A,setGhostWidth:T,connectionLine:W,setConnectionLine:$,hoveredTaskId:j,setHoveredTaskId:te,activeZone:oe,setActiveZone:re,draggedSegmentIndex:ge,setDraggedSegmentIndex:fe,draggedSegmentStartX:Ie,setDraggedSegmentStartX:M,segmentDragOffsetX:R,setSegmentDragOffsetX:L,hoveredSegmentIndex:V,setHoveredSegmentIndex:q,isHovered:z,setIsHovered:ye,isDragging:ne,isResizing:Be,isConnecting:qe,resetDragState:tt}=h,le=32,Je=8,ct=e.endDate&&e.endDate<new Date&&e.progress<100,wt=e.isCriticalPath,vt=o.name==="neutral"||o.today==="#1C1917",U=e.status==="completed"||e.progress===100,me={low:"#2ECC71",LOW:"#2ECC71",medium:"#F1C40F",MEDIUM:"#F1C40F",high:"#E67E22",HIGH:"#E67E22",urgent:"#E74C3C",URGENT:"#E74C3C"},Fe=e.isCriticalPath||ct?"#DC2626":e.color?e.color:e.priority&&me[e.priority]?me[e.priority]:o.taskBarPrimary,Qe=(Z=>Z>=80?20:Z>=60?15:Z>=50?12:10)(r),Pt=r<50,Re=r<40;react.useEffect(()=>{if(C)if(z&&!ne&&!e.segments){let Z=a<100;C({task:e,x:t,y:a,width:r,height:le,showBelow:Z});}else C(null);},[z,ne,e,t,a,r,le,C]);let J=Z=>Z.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),ve=()=>{let Z=Math.ceil((e.endDate.getTime()-e.startDate.getTime())/864e5);return `${Z} day${Z!==1?"s":""}`},He=Z=>Math.round(Z/s)*s,Le=Z=>{let Te=Math.round(Z/s),we=new Date(n);return we.setDate(we.getDate()+Te),we},nt=(Z,Te)=>{for(let we of y){if(we.id===e.id)continue;let Oe=5;if(Z>=we.x-Oe&&Z<=we.x+we.width+Oe&&Te>=we.y-Oe&&Te<=we.y+we.height+Oe)return we.id}return null},st=react.useCallback((Z,Te,we)=>{Z.preventDefault(),Z.stopPropagation();let Oe=b.current?.ownerSVGElement;if(!Oe)return;let $e=Oe.createSVGPoint();$e.x=Z.clientX,$e.y=Z.clientY;let dt=$e.matrixTransform(Oe.getScreenCTM()?.inverse()),_=we!==void 0?we:t,Y=Te;if(!Y){let se=dt.x-_;Z.shiftKey?(Y="connect",$({x:t+r,y:a+le/2})):Z.ctrlKey||Z.metaKey?Y="move":Z.altKey?Y=se<r/2?"resize-start":"resize-end":Re?se<r/2?Y="move":Y="resize-end":Pt?se<=Qe/2?Y="resize-start":se>=r-Qe/2?Y="resize-end":Y="move":se<=Qe?Y="resize-start":se>=r-Qe?Y="resize-end":Y="move";}N(Y),ye(false),re(null),Y==="move"?B(dt.x-_):Y==="connect"?$({x:t+r,y:a+le/2}):B(0),I(_),T(r);},[t,r,a,le]),_e=react.useCallback(Z=>{let Te=b.current?.ownerSVGElement;if(!Te)return;let we=Te.closest(".gantt-timeline-scroll");if(!we)return;let Oe=we.getBoundingClientRect(),$e=60,dt=15,_=0;if(Z.clientX<Oe.left+$e){let Y=Oe.left+$e-Z.clientX;_=-Math.min(dt,Y/2);}else if(Z.clientX>Oe.right-$e){let Y=Z.clientX-(Oe.right-$e);_=Math.min(dt,Y/2);}return _!==0&&(we.scrollLeft+=_),_!==0},[]),ea=react.useCallback(Z=>{if(m==="none")return;x.current=Z;let Te=b.current?.ownerSVGElement;if(!Te)return;if(m==="move"||m==="resize-start"||m==="resize-end"){let $e=_e(Z);$e&&!u.current?u.current=window.setInterval(()=>{x.current&&(_e(x.current),ea(x.current));},16):!$e&&u.current&&(window.clearInterval(u.current),u.current=null);}let we=Te.createSVGPoint();we.x=Z.clientX,we.y=Z.clientY;let Oe=we.matrixTransform(Te.getScreenCTM()?.inverse());if(m==="connect"){$({x:Oe.x,y:Oe.y});let $e=nt(Oe.x,Oe.y);te($e);}else if(m==="move"){let $e=Oe.x-w,dt=He($e);I(dt),T(r);let _=Math.round((dt-t)/s);if(k?.(e.id,_,true),e.segments&&e.segments.length>0&&ge!==null){let Y=dt-Ie;L(Y);}}else if(m==="resize-start"){let $e=Oe.x,dt=He($e),_=t+r-dt;_>=s&&(I(dt),T(_));}else if(m==="resize-end"){let $e=Oe.x,_=He($e)-t;_>=s&&T(_);}},[m,t,r,s,w,e,He,ge,Ie,nt,te,$,I,T,L,k,_e]),ke=react.useCallback(()=>{if(u.current&&(window.clearInterval(u.current),u.current=null),x.current=null,m!=="none"){if(m==="connect")j&&f&&f(e,j),$(null),te(null);else {let Z=e.endDate.getTime()-e.startDate.getTime(),Te,we,Oe=true;if(m==="move"){if(Te=Le(v),we=new Date(Te.getTime()+Z),e.segments&&e.segments.length>0&&ge!==null){let $e=Math.round(R/s),dt=e.segments.map((Ye,Ue)=>{if(Ue===ge){let H=new Date(Ye.startDate),ie=new Date(Ye.endDate);return H.setDate(H.getDate()+$e),ie.setDate(ie.getDate()+$e),{startDate:H,endDate:ie}}return Ye}),_=dt.flatMap(Ye=>[Ye.startDate,Ye.endDate]),Y=new Date(Math.min(..._.map(Ye=>Ye.getTime()))),se=new Date(Math.max(..._.map(Ye=>Ye.getTime())));l?.({...e,segments:dt},Y,se),tt(t,r);return}}else m==="resize-start"?(Te=Le(v),we=e.endDate,Te>we&&(console.warn("Invalid date range: start date must be before or equal to end date"),Oe=false)):m==="resize-end"?(Te=e.startDate,we=Le(v+A),we<Te&&(console.warn("Invalid date range: end date must be after or equal to start date"),Oe=false)):Oe=false;Oe&&Te&&we&&(we.getTime()<Te.getTime()?console.warn("Invalid date range: end date cannot be before start date"):l?.(e,Te,we));}k?.(e.id,0,false),tt(t,r);}},[m,v,A,e,l,j,f,t,r,s,Le,R,ge,tt,k]);react.useEffect(()=>{if(m==="none")return;let Z=we=>{ea(we);},Te=()=>{ke();};return window.addEventListener("mousemove",Z),window.addEventListener("mouseup",Te),()=>{window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",Te),u.current&&(window.clearInterval(u.current),u.current=null);}},[m,ea,ke]);let be=ne&&!qe?v:t,Ke=ne&&!qe?A:r,F=c.taskClass(e);return jsxRuntime.jsxs("g",{ref:b,"data-task-bar":"true",onClick:()=>!ne&&g?.(e),onDoubleClick:Z=>{ne||(Z.stopPropagation(),i?.(e));},onContextMenu:Z=>{Z.preventDefault(),p?.(e,Z);},onMouseEnter:()=>!ne&&ye(true),onMouseLeave:()=>{ne||(ye(false),re(null));},children:[jsxRuntime.jsx("rect",{x:t,y:a,width:r+24,height:le,fill:"transparent",style:{pointerEvents:"all"}}),z&&!ne&&!Pt&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:Qe,height:le,fill:oe==="resize-start"?o.accent:"transparent",opacity:oe==="resize-start"?.15:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>re("resize-start"),onMouseDown:Z=>st(Z,"resize-start")}),jsxRuntime.jsx("rect",{x:t+Qe,y:a,width:r-Qe*2,height:le,fill:oe==="move"?o.accent:"transparent",opacity:oe==="move"?.1:0,style:{cursor:"grab",pointerEvents:"all"},onMouseEnter:()=>re("move"),onMouseDown:Z=>st(Z,"move")}),jsxRuntime.jsx("rect",{x:t+r-Qe,y:a,width:Qe,height:le,fill:oe==="resize-end"?o.accent:"transparent",opacity:oe==="resize-end"?.15:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>re("resize-end"),onMouseDown:Z=>st(Z,"resize-end")})]}),z&&!ne&&Re&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:r/2,height:le,fill:oe==="move"?o.accent:"transparent",opacity:oe==="move"?.2:0,style:{cursor:"grab",pointerEvents:"all"},onMouseEnter:()=>re("move"),onMouseDown:Z=>st(Z,"move")}),jsxRuntime.jsx("rect",{x:t+r/2,y:a,width:r/2,height:le,fill:oe==="resize-end"?o.accent:"transparent",opacity:oe==="resize-end"?.2:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>re("resize-end"),onMouseDown:Z=>st(Z,"resize-end")}),z&&jsxRuntime.jsx(framerMotion.motion.line,{x1:t+r/2,y1:a+4,x2:t+r/2,y2:a+le-4,stroke:o.textTertiary,strokeWidth:1,strokeDasharray:"2 2",opacity:.3,initial:{opacity:0},animate:{opacity:.3},transition:{duration:.2},style:{pointerEvents:"none"}})]}),ne&&!qe&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:v,y:a,width:A,height:le,rx:Je,fill:o.accent,opacity:.5,stroke:o.accent,strokeWidth:2,strokeDasharray:"4 4",initial:{opacity:0},animate:{opacity:.6},transition:{duration:.15},style:{pointerEvents:"none"}}),!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:be,y:a,width:Ke,height:le,rx:Je,fill:Fe,"data-task-class":F,initial:{opacity:0,scale:.95},animate:{opacity:ne&&!qe?.15:e.parentId?.6:z?.9:.8,scale:z&&!ne?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:Z=>st(Z),style:{cursor:ne?qe?"crosshair":Be?"ew-resize":"grabbing":"grab",pointerEvents:"all"}}),!e.segments&&jsxRuntime.jsx("rect",{x:be,y:a,width:Ke*(e.progress/100),height:le,rx:Je,fill:Fe,opacity:1,style:{pointerEvents:"none"}}),e.segments&&e.segments.map((Z,Te)=>{let we=(Z.startDate.getTime()-n.getTime())/864e5*s,$e=(Z.endDate.getTime()-n.getTime())/(1e3*60*60*24)*s-we+s,dt=ne&&m==="move"&&ge===Te,_=V===Te,Y=dt?we+R:we;return jsxRuntime.jsxs("g",{onMouseEnter:()=>!ne&&q(Te),onMouseLeave:()=>!ne&&q(null),children:[jsxRuntime.jsx(framerMotion.motion.rect,{x:Y,y:a,width:$e,height:le,rx:Je,fill:Fe,initial:{opacity:0,scale:.95},animate:{opacity:dt||e.parentId?.6:_?.9:.8,scale:_&&!ne?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:se=>{se.stopPropagation(),fe(Te),M(we),st(se,void 0,we);},style:{cursor:ne?qe?"crosshair":Be?"ew-resize":"grabbing":"grab",pointerEvents:"all"}}),jsxRuntime.jsx("rect",{x:Y,y:a,width:$e*(e.progress/100),height:le,rx:Je,fill:Fe,opacity:1,style:{pointerEvents:"none"}})]},`segment-${Te}`)}),vt&&(ct||wt)&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[wt&&!ct&&jsxRuntime.jsx("rect",{x:be,y:a,width:Ke,height:le,rx:Je,fill:"none",stroke:o.border,strokeWidth:2,strokeDasharray:"4 4",opacity:.8,style:{pointerEvents:"none"}}),ct&&jsxRuntime.jsx("rect",{x:be,y:a,width:Ke,height:le,rx:Je,fill:"url(#diagonal-stripes)",opacity:.3,style:{pointerEvents:"none"}})]}),Ke>60&&!e.segments&&(()=>{let Z=c.taskLabel(e),Te=typeof Z=="string"?Z:e.name,we=Te.length>Math.floor(Ke/8)?`${Te.substring(0,Math.floor(Ke/8))}...`:Te;return jsxRuntime.jsx("text",{x:be+12,y:a+le/2,dominantBaseline:"middle",fill:U?"rgba(255, 255, 255, 0.6)":"#FFFFFF",fontSize:"13",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none",textDecoration:U?"line-through":"none"},children:we})})(),Ke>100&&e.progress>0&&e.progress<100&&!ne&&!e.segments&&jsxRuntime.jsxs("text",{x:be+Ke-12,y:a+le/2,dominantBaseline:"middle",textAnchor:"end",fill:"rgba(255, 255, 255, 0.9)",fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}),e.status&&Ke>80&&!ne&&!e.segments&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[e.status==="completed"&&jsxRuntime.jsx("circle",{cx:be+Ke-8,cy:a+8,r:4,fill:o.statusCompleted,stroke:"#FFFFFF",strokeWidth:1.5}),e.status==="in-progress"&&jsxRuntime.jsx("circle",{cx:be+Ke-8,cy:a+8,r:4,fill:o.statusInProgress,stroke:"#FFFFFF",strokeWidth:1.5,opacity:.8})]}),(z||Be)&&!qe&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:be-2,y:a,width:16,height:le,fill:"transparent",style:{cursor:"ew-resize"},onMouseEnter:()=>re("resize-start"),onMouseLeave:()=>re(null),onMouseDown:Z=>{Z.stopPropagation(),st(Z,"resize-start");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:be+4,y:a+8,width:3,height:le-16,rx:1.5,fill:oe==="resize-start"||m==="resize-start"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]}),jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:be+Ke-14,y:a,width:16,height:le,fill:"transparent",style:{cursor:"ew-resize"},onMouseEnter:()=>re("resize-end"),onMouseLeave:()=>re(null),onMouseDown:Z=>{Z.stopPropagation(),st(Z,"resize-end");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:be+Ke-7,y:a+8,width:3,height:le-16,rx:1.5,fill:oe==="resize-end"||m==="resize-end"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:z&&!ne&&!e.segments&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[jsxRuntime.jsx("circle",{cx:t+r+10,cy:a+le/2,r:10,fill:"transparent",style:{cursor:"crosshair"},onMouseEnter:()=>re("connect"),onMouseLeave:()=>re(null),onMouseDown:Z=>{Z.stopPropagation(),st(Z,"connect");}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:t+r+10,cy:a+le/2,r:4,fill:o.accent,stroke:"#FFFFFF",strokeWidth:1.5,style:{pointerEvents:"none"},initial:{scale:0},animate:{scale:oe==="connect"?1.4:1},exit:{scale:0},transition:{duration:.15,type:"spring",stiffness:500,damping:30}})]})}),qe&&W&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx(framerMotion.motion.line,{x1:t+r,y1:a+le/2,x2:W.x,y2:W.y,stroke:j?o.statusCompleted:o.accent,strokeWidth:j?3:2,strokeDasharray:"6 4",initial:{opacity:0},animate:{opacity:j?1:.8},transition:{duration:.15}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:W.x,cy:W.y,r:j?8:6,fill:j?o.statusCompleted:o.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},transition:{duration:.15}}),j&&jsxRuntime.jsx(framerMotion.motion.text,{x:W.x+15,y:W.y,dominantBaseline:"middle",fill:o.statusCompleted,fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",initial:{opacity:0,x:W.x+10},animate:{opacity:1,x:W.x+15},transition:{duration:.2},children:"Connect"})]}),(z||ne)&&!qe&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:be-2,y:a-2,width:Ke+4,height:le+4,rx:Je+2,fill:"none",stroke:ne?o.accent:o.taskBarPrimary,strokeWidth:2,opacity:ne?.6:.4,initial:{opacity:0},animate:{opacity:ne?.6:.4},transition:{duration:.2},style:{pointerEvents:"none"}}),Be&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("line",{x1:v,y1:0,x2:v,y2:1e3,stroke:o.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:v+A,y1:0,x2:v+A,y2:1e3,stroke:o.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:z&&!ne&&!e.segments&&!C&&(()=>{let we=a<100,Oe=we?a+le+13:a-82-13,$e=we?`M ${be+Ke/2-6} ${a+le+3} L ${be+Ke/2} ${a+le+13} L ${be+Ke/2+6} ${a+le+3}`:`M ${be+Ke/2-6} ${a-13} L ${be+Ke/2} ${a-3} L ${be+Ke/2+6} ${a-13}`,dt=Oe+22,_=Oe+40,Y=Oe+55,se=Oe+70,Ye=we?Oe+82-5:a-18;return jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:we?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:we?-10:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsxRuntime.jsx("path",{d:$e,fill:o.bgSecondary,stroke:o.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:be+Ke/2-120,y:Oe,width:240,height:82,rx:8,fill:o.bgSecondary,stroke:o.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("text",{x:be+Ke/2,y:dt,textAnchor:"middle",fill:o.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>28?`${e.name.substring(0,28)}...`:e.name}),jsxRuntime.jsx("text",{x:be+Ke/2-110,y:_,fill:o.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Start:"}),jsxRuntime.jsx("text",{x:be+Ke/2-70,y:_,fill:o.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:J(e.startDate)}),jsxRuntime.jsx("text",{x:be+Ke/2-110,y:Y,fill:o.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"End:"}),jsxRuntime.jsx("text",{x:be+Ke/2-70,y:Y,fill:o.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:J(e.endDate)}),jsxRuntime.jsx("text",{x:be+Ke/2+10,y:_,fill:o.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Duration:"}),jsxRuntime.jsx("text",{x:be+Ke/2+65,y:_,fill:o.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:ve()}),jsxRuntime.jsx("text",{x:be+Ke/2+10,y:Y,fill:o.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Progress:"}),jsxRuntime.jsxs("text",{x:be+Ke/2+65,y:Y,fill:o.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.progress,"%"]}),e.assignees&&e.assignees.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("text",{x:be+Ke/2-110,y:se,fill:o.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Assignees:"}),jsxRuntime.jsxs("text",{x:be+Ke/2-50,y:se,fill:o.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.assignees.map(Ue=>Ue.name).join(", ").substring(0,30),e.assignees.map(Ue=>Ue.name).join(", ").length>30?"...":""]})]}),!we&&jsxRuntime.jsx("text",{x:be+Ke/2,y:Ye,textAnchor:"middle",fill:o.textTertiary,fontSize:"9",fontFamily:"Inter, sans-serif",style:{opacity:.7},children:Re?"Left: move \u2022 Right: resize":Pt?"Drag to move \u2022 Hold ALT + drag edge to resize":"Drag edges to resize \u2022 Drag center to move \u2022 Click \u26AB to link"})]})})()})]})}function tm({tooltipData:e,theme:t}){if(!e)return null;let {task:a,x:r,y:o,width:s,height:n,showBelow:c}=e,g=82,i=13,p=c?o+n+i:o-g-i,l=c?`M ${r+s/2-6} ${o+n+3} L ${r+s/2} ${o+n+13} L ${r+s/2+6} ${o+n+3}`:`M ${r+s/2-6} ${o-13} L ${r+s/2} ${o-3} L ${r+s/2+6} ${o-13}`,f=p+22,y=p+40,k=p+55,C=p+70,h=m=>m.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),b=()=>{if(!a.startDate||!a.endDate)return "N/A";let m=Math.ceil((a.endDate.getTime()-a.startDate.getTime())/(1e3*60*60*24));return `${m} day${m!==1?"s":""}`};return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:c?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:c?-10:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsxRuntime.jsx("path",{d:l,fill:t.bgSecondary,stroke:t.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:r+s/2-120,y:p,width:240,height:g,rx:8,fill:t.bgSecondary,stroke:t.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("text",{x:r+s/2,y:f,textAnchor:"middle",fill:t.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:a.name.length>28?`${a.name.substring(0,28)}...`:a.name}),jsxRuntime.jsx("text",{x:r+s/2-110,y,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Start:"}),jsxRuntime.jsx("text",{x:r+s/2-70,y,fill:t.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:a.startDate?h(a.startDate):"N/A"}),jsxRuntime.jsx("text",{x:r+s/2-110,y:k,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"End:"}),jsxRuntime.jsx("text",{x:r+s/2-70,y:k,fill:t.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:a.endDate?h(a.endDate):"N/A"}),jsxRuntime.jsx("text",{x:r+s/2+10,y,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Duration:"}),jsxRuntime.jsx("text",{x:r+s/2+65,y,fill:t.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:b()}),jsxRuntime.jsx("text",{x:r+s/2+10,y:k,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Progress:"}),jsxRuntime.jsxs("text",{x:r+s/2+65,y:k,fill:t.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[a.progress,"%"]}),a.assignees&&a.assignees.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("text",{x:r+s/2-110,y:C,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Assignees:"}),jsxRuntime.jsxs("text",{x:r+s/2-50,y:C,fill:t.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[a.assignees.map(m=>m.name).join(", ").substring(0,30),a.assignees.map(m=>m.name).join(", ").length>30?"...":""]})]})]})})}function Zn({x1:e,y1:t,x2:a,y2:r,theme:o,onDelete:s,lineStyle:n="curved",isHoverLayer:c=false}){let[g,i]=react.useState(false),[p,l]=react.useState(null),f=r-t,y=f>0,k=Math.abs(f)<5,h=5,b=20,u=!k&&a<=e,x,m;if(k)if(m=(e+a)/2,n==="squared")x=`M ${e} ${t} L ${a} ${r}`;else {let oe=Math.min(Math.abs(a-e)/3,30);x=`M ${e} ${t} C ${e+oe} ${t}, ${a-oe} ${r}, ${a} ${r}`;}else if(m=a-b,u){let re=e+15,ge=a-b,fe=y?t+20:t-20;m=ge,n==="squared"?x=`M ${e} ${t} L ${re} ${t} L ${re} ${fe} L ${ge} ${fe} L ${ge} ${r} L ${a} ${r}`:y?x=`M ${e} ${t} L ${re-h} ${t} Q ${re} ${t} ${re} ${t+h} L ${re} ${fe-h} Q ${re} ${fe} ${re-h} ${fe} L ${ge+h} ${fe} Q ${ge} ${fe} ${ge} ${fe+h} L ${ge} ${r-h} Q ${ge} ${r} ${ge+h} ${r} L ${a} ${r}`:x=`M ${e} ${t} L ${re-h} ${t} Q ${re} ${t} ${re} ${t-h} L ${re} ${fe+h} Q ${re} ${fe} ${re-h} ${fe} L ${ge+h} ${fe} Q ${ge} ${fe} ${ge} ${fe-h} L ${ge} ${r+h} Q ${ge} ${r} ${ge+h} ${r} L ${a} ${r}`;}else n==="squared"?x=`M ${e} ${t} L ${m} ${t} L ${m} ${r} L ${a} ${r}`:y?x=`M ${e} ${t} L ${m-h} ${t} Q ${m} ${t} ${m} ${t+h} L ${m} ${r-h} Q ${m} ${r} ${m+h} ${r} L ${a} ${r}`:x=`M ${e} ${t} L ${m-h} ${t} Q ${m} ${t} ${m} ${t-h} L ${m} ${r+h} Q ${m} ${r} ${m+h} ${r} L ${a} ${r}`;let N=5,w=`M ${a} ${r} L ${a-N} ${r-N*.5} M ${a} ${r} L ${a-N} ${r+N*.5}`,B=o.dependency,v=o.dependencyHover||B,I="#f87171",A="rgba(248, 113, 113, 0.15)",T=m,W=(t+r)/2;if(p)if(k)T=Math.max(e+10,Math.min(a-10,p.x)),W=t;else if(u){let oe=e+15,re=a-b,ge=y?t+20:t-20,fe=[[e,t,oe,t],[oe,t,oe,ge],[oe,ge,re,ge],[re,ge,re,r],[re,r,a,r]],Ie=1/0,M={x:T,y:W};for(let R of fe){let L=$(p.x,p.y,R[0],R[1],R[2],R[3]),V=Math.hypot(p.x-L.x,p.y-L.y);V<Ie&&(Ie=V,M=L);}T=M.x,W=M.y;}else {let oe=[[e,t,m,t],[m,t,m,r],[m,r,a,r]],re=1/0,ge={x:T,y:W};for(let fe of oe){let Ie=$(p.x,p.y,fe[0],fe[1],fe[2],fe[3]),M=Math.hypot(p.x-Ie.x,p.y-Ie.y);M<re&&(re=M,ge=Ie);}T=ge.x,W=ge.y;}function $(oe,re,ge,fe,Ie,M){let R=Ie-ge,L=M-fe,V=R*R+L*L;if(V===0)return {x:ge,y:fe};let q=((oe-ge)*R+(re-fe)*L)/V;return q=Math.max(0,Math.min(1,q)),{x:ge+q*R,y:fe+q*L}}let j=oe=>{let re=oe.currentTarget.ownerSVGElement;if(!re)return;let ge=re.getBoundingClientRect();l({x:oe.clientX-ge.left,y:oe.clientY-ge.top});},te=()=>{i(false),l(null);};return c?jsxRuntime.jsxs("g",{"data-dependency-line":"true",onMouseLeave:te,onMouseMove:j,children:[jsxRuntime.jsx("path",{d:x,fill:"none",stroke:"transparent",strokeWidth:20,strokeLinecap:"round",style:{cursor:"pointer"}}),jsxRuntime.jsx("path",{d:x,fill:"none",stroke:v,strokeWidth:8,strokeLinecap:"round",opacity:.15,style:{pointerEvents:"none",filter:"blur(4px)"}}),jsxRuntime.jsx("path",{d:x,fill:"none",stroke:v,strokeWidth:2.5,strokeLinecap:"round",opacity:.9,style:{pointerEvents:"none"}}),jsxRuntime.jsx("path",{d:w,fill:"none",stroke:v,strokeWidth:2.5,strokeLinecap:"round",opacity:.9,style:{pointerEvents:"none"}}),jsxRuntime.jsx("circle",{cx:a,cy:r,r:4,fill:v,opacity:.9,style:{pointerEvents:"none"}}),s&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.15,ease:"easeOut"},onClick:oe=>{oe.stopPropagation(),s();},style:{cursor:"pointer"},children:[jsxRuntime.jsx("circle",{cx:T,cy:W,r:9,fill:A,stroke:I,strokeWidth:1.5}),jsxRuntime.jsx("line",{x1:T-3,y1:W-3,x2:T+3,y2:W+3,stroke:I,strokeWidth:1.5,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:T+3,y1:W-3,x2:T-3,y2:W+3,stroke:I,strokeWidth:1.5,strokeLinecap:"round"})]})]}):jsxRuntime.jsxs("g",{"data-dependency-line":"true",onMouseEnter:()=>i(true),onMouseLeave:te,onMouseMove:j,style:{cursor:s?"pointer":"default"},children:[jsxRuntime.jsx("path",{d:x,fill:"none",stroke:"transparent",strokeWidth:16,strokeLinecap:"round",style:{cursor:s?"pointer":"default"}}),jsxRuntime.jsx(framerMotion.motion.path,{d:x,fill:"none",stroke:g?v:B,strokeWidth:g?2.5:2,strokeLinecap:"round",initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:1},transition:{pathLength:{duration:.5,ease:"easeInOut"},opacity:{duration:.2}}}),jsxRuntime.jsx(framerMotion.motion.path,{d:w,fill:"none",stroke:g?v:B,strokeWidth:g?2.5:2,strokeLinecap:"round",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,delay:.3}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:a,cy:r,r:g?4:3,fill:g?v:B,initial:{scale:0},animate:{scale:1},transition:{delay:.3,duration:.15}}),g&&s&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},transition:{duration:.15},onClick:oe=>{oe.stopPropagation(),s();},style:{cursor:"pointer"},children:[jsxRuntime.jsx("circle",{cx:T,cy:W,r:9,fill:A,stroke:I,strokeWidth:1.5}),jsxRuntime.jsx("line",{x1:T-3,y1:W-3,x2:T+3,y2:W+3,stroke:I,strokeWidth:1.5,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:T+3,y1:W-3,x2:T-3,y2:W+3,stroke:I,strokeWidth:1.5,strokeLinecap:"round"})]})]})}function es({task:e,x:t,y:a,theme:r,onClick:o}){let[s,n]=react.useState(false),c=16,g=i=>i.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return jsxRuntime.jsxs("g",{"data-task-bar":"true",onMouseEnter:()=>n(true),onMouseLeave:()=>n(false),onClick:()=>o?.(e),style:{cursor:"pointer"},children:[e.isCriticalPath&&jsxRuntime.jsx(framerMotion.motion.circle,{cx:t,cy:a+16,r:c+4,fill:r.criticalPathLight,initial:{scale:0},animate:{scale:s?1.2:1},transition:{duration:.3}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:t-c/2,y:a+16-c/2,width:c,height:c,fill:e.isCriticalPath?r.criticalPath:r.milestone,stroke:r.bgGrid,strokeWidth:2,transform:`rotate(45 ${t} ${a+16})`,initial:{scale:0,rotate:0},animate:{scale:s?1.15:1,rotate:45},transition:{duration:.3,type:"spring",stiffness:300,damping:20}}),s&&jsxRuntime.jsx(framerMotion.motion.rect,{x:t-(c+4)/2,y:a+16-(c+4)/2,width:c+4,height:c+4,fill:"none",stroke:e.isCriticalPath?r.criticalPath:r.milestone,strokeWidth:2,opacity:.5,transform:`rotate(45 ${t} ${a+16})`,initial:{scale:.8,opacity:0},animate:{scale:1,opacity:.5},transition:{duration:.2}}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},children:[jsxRuntime.jsx("rect",{x:t-80,y:a-50,width:160,height:44,rx:8,fill:r.bgSecondary,stroke:r.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("path",{d:`M ${t-6} ${a-6} L ${t} ${a+4} L ${t+6} ${a-6}`,fill:r.bgSecondary,stroke:r.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:t-70,y:a-38,width:8,height:8,fill:e.isCriticalPath?r.criticalPath:r.milestone,transform:`rotate(45 ${t-66} ${a-34})`}),jsxRuntime.jsx("text",{x:t-55,y:a-32,fill:r.textPrimary,fontSize:"12",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>18?`${e.name.substring(0,18)}...`:e.name}),jsxRuntime.jsx("text",{x:t-55,y:a-18,fill:r.textTertiary,fontSize:"10",fontFamily:"Inter, sans-serif",children:g(e.startDate)}),e.isCriticalPath&&jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:t+10,y:a-40,width:60,height:16,rx:4,fill:r.criticalPathLight}),jsxRuntime.jsx("text",{x:t+40,y:a-30,textAnchor:"middle",fill:r.criticalPath,fontSize:"9",fontWeight:"700",fontFamily:"Inter, sans-serif",letterSpacing:"0.5",children:"CRITICAL"})]})]})})]})}var he={calculateEndDate:(e,t)=>{let a=new Date(e);return a.setDate(a.getDate()+t),a},calculateDuration:(e,t)=>{let a=t.getTime()-e.getTime();return Math.ceil(a/(1e3*60*60*24))},calculateWorkingDays:(e,t)=>{let a=0,r=new Date(e);for(;r<=t;){let o=r.getDay();o!==0&&o!==6&&a++,r.setDate(r.getDate()+1);}return a},addWorkingDays:(e,t)=>{let a=new Date(e),r=0;for(;r<t;){a.setDate(a.getDate()+1);let o=a.getDay();o!==0&&o!==6&&r++;}return a},isWeekend:e=>{let t=e.getDay();return t===0||t===6},validateDependencies:(e,t,a)=>{let r=new Map,o=i=>{i.forEach(p=>{p.dependencies&&r.set(p.id,p.dependencies),p.subtasks&&o(p.subtasks);});};o(e);let s=r.get(a)||[];r.set(a,[...s,t]);let n=new Set,c=new Set,g=i=>{if(!n.has(i)){n.add(i),c.add(i);let p=r.get(i)||[];for(let l of p){if(!n.has(l)&&g(l))return true;if(c.has(l))return true}}return c.delete(i),false};return g(a)},flattenTasks:e=>{let t=[],a=r=>{r.forEach(o=>{t.push(o),o.subtasks&&o.subtasks.length>0&&a(o.subtasks);});};return a(e),t},findTaskById:(e,t)=>{for(let a of e){if(a.id===t)return a;if(a.subtasks){let r=he.findTaskById(a.subtasks,t);if(r)return r}}},getParentTasks:(e,t)=>{let a=[],r=he.findTaskById(e,t);if(!r||!r.parentId)return a;let o=r.parentId;for(;o;){let s=he.findTaskById(e,o);if(s)a.unshift(s),o=s.parentId;else break}return a},exportToJSON:e=>JSON.stringify(e,null,2),importFromJSON:e=>{try{let t=JSON.parse(e);if(!Array.isArray(t))throw new Error("Invalid JSON: expected an array of tasks");return t.forEach((a,r)=>{if(!a.id||!a.name)throw new Error(`Invalid task at index ${r}: missing required fields (id, name)`)}),t}catch(t){throw new Error(`Failed to import tasks: ${t instanceof Error?t.message:"Unknown error"}`)}},exportToCSV:e=>{let t=he.flattenTasks(e),r=[["ID","Name","Start Date","End Date","Progress","Status","Dependencies"].join(",")];return t.forEach(o=>{let s=[o.id,`"${o.name.replace(/"/g,'""')}"`,o.startDate?o.startDate.toISOString().split("T")[0]:"",o.endDate?o.endDate.toISOString().split("T")[0]:"",o.progress.toString(),o.status||"",o.dependencies?.join(";")||""];r.push(s.join(","));}),r.join(`
111
+ - [ ] `,priority:"MEDIUM",labels:["meeting"]}}];function xi({templates:e,onSelectTemplate:t,className:a}){let[r,o]=react.useState(false),s=react.useRef(null),n=react.useRef(null);react.useEffect(()=>{function i(p){s.current&&!s.current.contains(p.target)&&n.current&&!n.current.contains(p.target)&&o(false);}if(r)return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]);let c=i=>{t(i),o(false);},g=e.reduce((i,p)=>{let l=p.category||"Other";return i[l]||(i[l]=[]),i[l].push(p),i},{});return jsxRuntime.jsxs("div",{className:d("relative inline-block",a),children:[jsxRuntime.jsxs("button",{ref:n,onClick:()=>o(!r),className:"flex items-center gap-2 px-3 py-2 rounded-lg border transition-all text-sm font-medium shadow-lg",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-primary)"},onMouseEnter:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",i.currentTarget.style.borderColor="var(--theme-border-secondary)";},onMouseLeave:i=>{i.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",i.currentTarget.style.borderColor="var(--theme-border-primary)";},title:"Create from template",children:[jsxRuntime.jsx("span",{className:"text-base leading-none",children:"\u{1F4CB}"}),jsxRuntime.jsx("span",{children:"Templates"}),jsxRuntime.jsx("svg",{className:d("w-4 h-4 transition-transform",r&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),r&&jsxRuntime.jsxs("div",{ref:s,className:"absolute top-full left-0 mt-2 min-w-[320px] max-w-[400px] rounded-xl backdrop-blur-xl border shadow-2xl z-50 overflow-hidden max-h-[500px] overflow-y-auto",style:{backgroundColor:"var(--theme-bg-primary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-4 py-3 border-b sticky top-0 backdrop-blur-sm",style:{borderColor:"var(--theme-border-primary)",backgroundColor:"var(--theme-bg-secondary)"},children:[jsxRuntime.jsx("span",{className:"text-sm font-bold uppercase tracking-wider",style:{color:"var(--theme-text-primary)"},children:"Card Templates"}),jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:"Quick start with pre-configured cards"})]}),Object.entries(g).map(([i,p])=>jsxRuntime.jsxs("div",{className:"py-2",children:[jsxRuntime.jsx("div",{className:"px-4 py-2",children:jsxRuntime.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"var(--theme-text-secondary)"},children:i})}),jsxRuntime.jsx("div",{children:p.map(l=>jsxRuntime.jsxs("button",{onClick:()=>c(l),className:"w-full px-4 py-3 flex items-start gap-3 text-left transition-all active:scale-[0.98]",style:{color:"var(--theme-text-primary)"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-2xl leading-none mt-0.5",children:l.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"font-semibold text-sm",style:{color:"var(--theme-text-primary)"},children:l.name}),l.description&&jsxRuntime.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--theme-text-tertiary)"},children:l.description})]})]},l.id))})]},i)),e.length===0&&jsxRuntime.jsx("div",{className:"px-4 py-8 text-center",style:{color:"var(--theme-text-tertiary)"},children:jsxRuntime.jsx("p",{className:"text-sm",children:"No templates available"})})]})]})}function wi({board:e,isOpen:t,onClose:a,onImport:r,boardElementRef:o,className:s}){let[n,c]=react.useState("export"),[g,i]=react.useState("json"),[p,l]=react.useState(null),f=react.useRef(null);if(!t)return null;let y=async()=>{let C=o?.current||void 0,h=await pd(e,g,C);ud(h,g);},k=async C=>{let h=C.target.files?.[0];if(h){try{let b=await bd(h),u=h.name.endsWith(".json")?"json":"csv",x=fd(b,u);l(x),x.success&&r&&r(x,b);}catch(b){l({success:false,errors:[`Failed to read file: ${b instanceof Error?b.message:"Unknown error"}`]});}f.current&&(f.current.value="");}};return jsxRuntime.jsxs("div",{className:d("fixed inset-0 z-[9999] flex items-center justify-center",s),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:a}),jsxRuntime.jsxs("div",{className:"relative bg-gradient-to-br from-gray-900/95 to-gray-800/95 backdrop-blur-xl rounded-2xl border border-white/20 shadow-2xl max-w-2xl w-full mx-4",children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-3",children:[jsxRuntime.jsx("span",{className:"text-3xl",children:"\u{1F4E6}"}),"Export / Import"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Transfer your board data"})]}),jsxRuntime.jsx("button",{onClick:a,className:"text-white/50 hover:text-white transition-colors text-2xl leading-none p-2 hover:bg-white/10 rounded-lg","aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsxs("div",{className:"flex border-b border-white/10",children:[jsxRuntime.jsx("button",{onClick:()=>c("export"),className:d("flex-1 px-6 py-4 font-semibold transition-colors",n==="export"?"text-white border-b-2 border-blue-500":"text-white/50 hover:text-white/80"),children:"Export"}),jsxRuntime.jsx("button",{onClick:()=>c("import"),className:d("flex-1 px-6 py-4 font-semibold transition-colors",n==="import"?"text-white border-b-2 border-blue-500":"text-white/50 hover:text-white/80"),children:"Import"})]}),jsxRuntime.jsxs("div",{className:"p-6",children:[n==="export"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Select format"}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-3",children:["json","csv","pdf"].map(C=>jsxRuntime.jsxs("button",{onClick:()=>i(C),className:d("p-4 rounded-lg border-2 transition-all text-center",g===C?"border-blue-500 bg-blue-500/20 text-white":"border-white/20 hover:border-white/40 text-white/70 hover:text-white"),children:[jsxRuntime.jsxs("div",{className:"text-2xl mb-2",children:[C==="json"&&"\u{1F4C4}",C==="csv"&&"\u{1F4CA}",C==="pdf"&&"\u{1F4DD}"]}),jsxRuntime.jsx("div",{className:"font-semibold uppercase text-xs",children:C})]},C))})]}),jsxRuntime.jsxs("div",{className:"bg-white/5 rounded-lg p-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:"Preview"}),jsxRuntime.jsxs("div",{className:"text-xs text-white/60",children:[jsxRuntime.jsxs("div",{children:["Board: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.title||"Untitled"})]}),jsxRuntime.jsxs("div",{children:["Columns: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.columns.length})]}),jsxRuntime.jsxs("div",{children:["Cards: ",jsxRuntime.jsx("span",{className:"text-white/90",children:e.cards.length})]})]})]}),jsxRuntime.jsx("button",{onClick:y,className:"w-full py-3 px-4 bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-500 hover:to-blue-600 text-white font-semibold rounded-lg transition-all shadow-lg shadow-blue-500/20",children:"Export Board"})]}),n==="import"&&jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-3",children:"Upload file"}),jsxRuntime.jsx("input",{ref:f,type:"file",accept:".json,.csv",onChange:k,className:"hidden"}),jsxRuntime.jsxs("button",{onClick:()=>f.current?.click(),className:"w-full py-12 px-4 border-2 border-dashed border-white/30 hover:border-white/50 rounded-lg transition-colors text-white/70 hover:text-white",children:[jsxRuntime.jsx("div",{className:"text-5xl mb-3",children:"\u{1F4C1}"}),jsxRuntime.jsx("div",{className:"font-semibold mb-1",children:"Click to select file"}),jsxRuntime.jsx("div",{className:"text-xs text-white/50",children:"Supports JSON and CSV files"})]})]}),p&&jsxRuntime.jsxs("div",{className:d("p-4 rounded-lg",p.success?"bg-green-500/20 border border-green-500/30":"bg-red-500/20 border border-red-500/30"),children:[jsxRuntime.jsx("h3",{className:d("font-semibold mb-2",p.success?"text-green-400":"text-red-400"),children:p.success?"\u2713 Import Successful":"\u2717 Import Failed"}),p.success&&jsxRuntime.jsxs("div",{className:"text-sm text-white/80",children:[jsxRuntime.jsxs("div",{children:["Cards imported: ",p.cardsImported]}),jsxRuntime.jsxs("div",{children:["Columns imported: ",p.columnsImported]})]}),p.errors&&p.errors.length>0&&jsxRuntime.jsx("div",{className:"mt-2 text-sm",children:p.errors.map((C,h)=>jsxRuntime.jsxs("div",{className:"text-red-300",children:["\u2022 ",C]},h))})]})]})]})]})]})}var x0=["URGENT","HIGH","MEDIUM","LOW"],k0=[{value:"none",label:"None"},{value:"created",label:"Date Created"},{value:"priority",label:"Priority"},{value:"dueDate",label:"Due Date"},{value:"title",label:"Title"},{value:"estimate",label:"Estimate"}],w0=[{value:"none",label:"No Grouping"},{value:"priority",label:"By Priority"},{value:"assignee",label:"By Assignee"},{value:"label",label:"By Label"}];function Ci({filters:e,sort:t,onFiltersChange:a,onSortChange:r,onReset:o,onFilterMyTasks:s,onFilterOverdue:n,onFilterHighPriority:c,availableUsers:g=[],availableLabels:i=[],availableColumns:p=[],showQuickFilters:l=true,compact:f=false,groupBy:y="none",onGroupByChange:k}){let[C,h]=react.useState(true),b=react.useCallback(w=>{a({search:w.target.value});},[a]),u=react.useCallback(w=>{a({dateFilter:w.target.value});},[a]),x=react.useCallback(w=>{r({by:w.target.value});},[r]),m=react.useCallback(()=>{r({order:t.order==="asc"?"desc":"asc"});},[t.order,r]),N=e.search||e.dateFilter!=="all"||e.priorities.length>0||e.assignees.length>0||e.labels.length>0||t.by!=="none";return jsxRuntime.jsxs("div",{className:`filter-bar ${f?"filter-bar--compact":""} ${C?"filter-bar--collapsed":""}`,children:[jsxRuntime.jsxs("div",{className:"filter-bar__header",onClick:()=>h(!C),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",marginBottom:C?"0":"12px",padding:"4px 6px",borderRadius:"6px",transition:"all 0.2s ease"},onMouseEnter:w=>{w.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:C?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--theme-text-secondary)"},children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})}),jsxRuntime.jsx("span",{className:"filter-bar__label",style:{fontWeight:500,fontSize:"0.875rem",color:"var(--theme-text-primary)"},children:"Filters & Grouping"}),N&&jsxRuntime.jsxs("span",{style:{color:"var(--theme-accent-primary)",fontSize:"0.75rem",fontWeight:600},children:["(",[e.search&&"search",e.dateFilter!=="all"&&"date",e.priorities.length>0&&"priority",e.assignees.length>0&&"assignee",e.labels.length>0&&"label",t.by!=="none"&&"sort"].filter(Boolean).length," active)"]})]}),!C&&jsxRuntime.jsxs("div",{className:"filter-bar__content",children:[l&&jsxRuntime.jsxs("div",{className:"filter-bar__quick",style:{marginBottom:"12px"},children:[jsxRuntime.jsx("span",{className:"filter-bar__label",children:"Quick:"}),s&&jsxRuntime.jsx("button",{onClick:s,className:"filter-bar__quick-btn",title:"Show only my tasks",children:"My Tasks"}),n&&jsxRuntime.jsx("button",{onClick:n,className:"filter-bar__quick-btn",title:"Show overdue tasks",children:"Overdue"}),c&&jsxRuntime.jsx("button",{onClick:c,className:"filter-bar__quick-btn",title:"Show high priority tasks",children:"High Priority"})]}),jsxRuntime.jsxs("div",{className:"filter-bar__main",children:[jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("input",{type:"text",placeholder:"Search tasks...",value:e.search,onChange:b,className:"filter-bar__search"})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.dateFilter,onChange:u,className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Dates"}),jsxRuntime.jsx("option",{value:"overdue",children:"Overdue"}),jsxRuntime.jsx("option",{value:"today",children:"Today"}),jsxRuntime.jsx("option",{value:"this-week",children:"This Week"})]})}),jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.priorities[0]||"all",onChange:w=>{let B=w.target.value;a({priorities:B==="all"?[]:[B]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Priorities"}),x0.map(w=>jsxRuntime.jsx("option",{value:w,children:w},w))]})}),g.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.assignees[0]||"all",onChange:w=>{let B=w.target.value;a({assignees:B==="all"?[]:[B]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Assignees"}),g.map(w=>jsxRuntime.jsx("option",{value:w.id,children:w.name},w.id))]})}),i.length>0&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsxs("select",{value:e.labels[0]||"all",onChange:w=>{let B=w.target.value;a({labels:B==="all"?[]:[B]});},className:"filter-bar__select",children:[jsxRuntime.jsx("option",{value:"all",children:"All Labels"}),i.map(w=>jsxRuntime.jsx("option",{value:w,children:w},w))]})}),jsxRuntime.jsxs("div",{className:"filter-bar__field filter-bar__sort",children:[jsxRuntime.jsx("span",{className:"filter-bar__label",style:{color:"var(--theme-text-secondary)"},children:"Sort:"}),jsxRuntime.jsx("select",{value:t.by,onChange:x,className:"filter-bar__select filter-bar__select--sm",children:k0.map(w=>jsxRuntime.jsx("option",{value:w.value,children:w.label},w.value))}),t.by!=="none"&&jsxRuntime.jsx("button",{onClick:m,className:"filter-bar__sort-toggle",title:`Sort ${t.order==="asc"?"descending":"ascending"}`,children:t.order==="asc"?"\u2191":"\u2193"})]}),k&&jsxRuntime.jsx("div",{className:"filter-bar__field",children:jsxRuntime.jsx("select",{value:y,onChange:w=>k(w.target.value),className:"filter-bar__select",style:{fontWeight:500,borderWidth:"2px"},children:w0.map(w=>jsxRuntime.jsx("option",{value:w.value,children:w.label},w.value))})}),N&&jsxRuntime.jsx("button",{onClick:o,className:"filter-bar__reset",title:"Clear all filters",children:"Clear"})]})]})]})}function Ti({onOpenExport:e,onOpenThemes:t,onOpenShortcuts:a,className:r,viewMode:o="kanban",onExportGanttPDF:s,onExportGanttExcel:n,onExportGanttPNG:c,onExportGanttCSV:g}){let[i,p]=react.useState(false),l=react.useRef(null);react.useEffect(()=>{let y=k=>{l.current&&!l.current.contains(k.target)&&p(false);};return i&&document.addEventListener("mousedown",y),()=>{document.removeEventListener("mousedown",y);}},[i]);let f=y=>{y(),p(false);};return jsxRuntime.jsxs("div",{className:d("relative",r),ref:l,children:[jsxRuntime.jsxs("button",{onClick:()=>p(!i),className:"flex items-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-all border",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)",color:"var(--theme-text-secondary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)",y.currentTarget.style.color="var(--theme-text-primary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-secondary)",y.currentTarget.style.color="var(--theme-text-secondary)";},"aria-label":"Configuration Menu","aria-expanded":i,children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6M5.6 5.6l4.2 4.2m4.2 4.2l4.2 4.2M1 12h6m6 0h6M5.6 18.4l4.2-4.2m4.2-4.2l4.2-4.2"})]}),jsxRuntime.jsx("span",{children:"Config"})]}),i&&jsxRuntime.jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-lg border shadow-lg overflow-hidden z-50",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[o==="kanban"?jsxRuntime.jsxs("button",{onClick:()=>f(e),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"})}),"Export"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await s?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntime.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntime.jsx("polyline",{points:"10 9 9 9 8 9"})]}),"Export PDF"]}),jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await n?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntime.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"Export Excel"]}),jsxRuntime.jsxs("button",{onClick:()=>f(async()=>await c?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntime.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),jsxRuntime.jsx("polyline",{points:"21 15 16 10 5 21"})]}),"Export PNG"]}),jsxRuntime.jsxs("button",{onClick:()=>f(()=>g?.()),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntime.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntime.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),jsxRuntime.jsx("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]}),"Export CSV"]})]}),jsxRuntime.jsxs("button",{onClick:()=>f(t),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"5"}),jsxRuntime.jsx("path",{d:"M12 1v6m0 6v6m8.5-8.5L17 15M7 9L3.5 5.5M7 15l-3.5 3.5M20.5 5.5L17 9m3.5 11.5L17 17"})]}),"Themes"]}),jsxRuntime.jsxs("button",{onClick:()=>f(a),className:"w-full px-4 py-3 text-left text-sm font-medium transition-colors flex items-center gap-3",style:{color:"var(--theme-text-primary)"},onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--theme-bg-tertiary)";},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),jsxRuntime.jsx("path",{d:"M6 8h.01M10 8h.01M14 8h.01M18 8h.01M8 12h.01M12 12h.01M16 12h.01M7 16h10"})]}),"Shortcuts"]})]})]})}var Ni={name:"dark",displayName:"Dark (Enhanced)",emoji:"\u{1F319}",colors:{bgPrimary:"#222326",bgSecondary:"#2A2B2F",bgTertiary:"#33343A",bgCard:"#2d2d2d",bgHover:"#353535",bgActive:"#404040",bgInput:"#2a2a2a",textPrimary:"#F4F5F8",textSecondary:"#AEB6C0",textTertiary:"#7A7F8A",textDisabled:"#606060",textInverse:"#1a1a1a",borderPrimary:"rgba(255, 255, 255, 0.1)",borderSecondary:"rgba(255, 255, 255, 0.05)",borderDefault:"#404040",borderHover:"#505050",borderSubtle:"#2a2a2a",accentPrimary:"#5E6AD2",accentHover:"#7780DD",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.1)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.2)",success:"#10B981",warning:"#F59E0B",error:"#EF4444",info:"#3B82F6",danger:"#ef4444",dangerBorder:"rgba(239, 68, 68, 0.3)",dangerBackground:"rgba(239, 68, 68, 0.1)",dangerBackgroundHover:"rgba(239, 68, 68, 0.2)"},shadows:{sm:"0 1px 2px rgba(0, 0, 0, 0.3)",md:"0 4px 12px rgba(0, 0, 0, 0.4)",lg:"0 12px 32px rgba(0, 0, 0, 0.5)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Di={name:"light",displayName:"Light (Standard)",emoji:"\u2600\uFE0F",colors:{bgPrimary:"#FFFFFF",bgSecondary:"#F7F7F8",bgTertiary:"#EEEFF1",bgCard:"#ffffff",bgHover:"#f3f4f6",bgActive:"#e5e7eb",bgInput:"#f9fafb",textPrimary:"#1A1A1A",textSecondary:"#5A5A5A",textTertiary:"#8A8A8A",textDisabled:"#d1d5db",textInverse:"#ffffff",borderPrimary:"rgba(0, 0, 0, 0.1)",borderSecondary:"rgba(0, 0, 0, 0.05)",borderDefault:"#e5e7eb",borderHover:"#d1d5db",borderSubtle:"#f3f4f6",accentPrimary:"#5E6AD2",accentHover:"#4A56B8",interactivePrimary:"#0ea5e9",interactivePrimaryHover:"#0284c7",interactivePrimaryBorder:"rgba(14, 165, 233, 0.3)",interactivePrimaryBackground:"rgba(14, 165, 233, 0.08)",interactivePrimaryBackgroundHover:"rgba(14, 165, 233, 0.15)",success:"#059669",warning:"#D97706",error:"#DC2626",info:"#2563EB",danger:"#dc2626",dangerBorder:"rgba(220, 38, 38, 0.3)",dangerBackground:"rgba(220, 38, 38, 0.08)",dangerBackgroundHover:"rgba(220, 38, 38, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.12)",md:"0 4px 12px rgba(0, 0, 0, 0.15)",lg:"0 12px 32px rgba(0, 0, 0, 0.2)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},Si={name:"neutral",emoji:"\u26AA",displayName:"Neutral (Zen)",colors:{bgPrimary:"#FAFAF9",bgSecondary:"#F5F5F4",bgTertiary:"#E7E5E4",bgCard:"#FEFEFE",bgHover:"#F0EFEE",bgActive:"#E7E5E4",bgInput:"#FAFAF9",textPrimary:"#1C1917",textSecondary:"#57534E",textTertiary:"#A8A29E",textDisabled:"#D6D3D1",textInverse:"#FAFAF9",borderPrimary:"#E7E5E4",borderSecondary:"#F0EFEE",borderDefault:"#E7E5E4",borderHover:"#D6D3D1",borderSubtle:"#F5F5F4",accentPrimary:"#292524",accentHover:"#44403C",interactivePrimary:"#292524",interactivePrimaryHover:"#44403C",interactivePrimaryBorder:"rgba(41, 37, 36, 0.3)",interactivePrimaryBackground:"rgba(41, 37, 36, 0.06)",interactivePrimaryBackgroundHover:"rgba(41, 37, 36, 0.12)",success:"#15803D",warning:"#CA8A04",error:"#B91C1C",info:"#1D4ED8",danger:"#B91C1C",dangerBorder:"rgba(185, 28, 28, 0.3)",dangerBackground:"rgba(185, 28, 28, 0.08)",dangerBackgroundHover:"rgba(185, 28, 28, 0.15)"},shadows:{sm:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 12px rgba(0, 0, 0, 0.12)",lg:"0 12px 32px rgba(0, 0, 0, 0.15)"},radii:{sm:"6px",md:"8px",lg:"12px",full:"9999px"},spacing:{xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"}},co={dark:Ni,light:Di,neutral:Si},Un="dark";var zn=react.createContext(void 0),F0="asakaa-theme";function Mc({children:e,defaultTheme:t=Un,storageKey:a=F0}){let[r,o]=react.useState(()=>{if(typeof window<"u"){let c=localStorage.getItem(a);if(c&&(c==="dark"||c==="light"||c==="neutral"))return c}return t}),s=react.useCallback(c=>{o(c),typeof window<"u"&&localStorage.setItem(a,c);},[a]);react.useEffect(()=>{if(typeof window>"u")return;let c=document.documentElement,g=co[r];Object.entries(g.colors).forEach(([p,l])=>{l&&c.style.setProperty(`--theme-${L0(p)}`,l);}),Object.entries({bgPrimary:"--asakaa-color-background-primary",bgSecondary:"--asakaa-color-background-secondary",bgTertiary:"--asakaa-color-background-tertiary",bgCard:"--asakaa-color-background-card",bgHover:"--asakaa-color-background-hover",bgActive:"--asakaa-color-background-active",bgInput:"--asakaa-color-background-input",textPrimary:"--asakaa-color-text-primary",textSecondary:"--asakaa-color-text-secondary",textTertiary:"--asakaa-color-text-tertiary",textDisabled:"--asakaa-color-text-disabled",textInverse:"--asakaa-color-text-inverse",borderPrimary:"--asakaa-color-border-primary",borderSecondary:"--asakaa-color-border-secondary",borderDefault:"--asakaa-color-border-default",borderHover:"--asakaa-color-border-hover",borderSubtle:"--asakaa-color-border-subtle",accentPrimary:"--asakaa-color-accent-primary",accentHover:"--asakaa-color-accent-hover",interactivePrimary:"--asakaa-color-interactive-primary",interactivePrimaryHover:"--asakaa-color-interactive-primaryHover",interactivePrimaryBorder:"--asakaa-color-interactive-primaryBorder",interactivePrimaryBackground:"--asakaa-color-interactive-primaryBackground",interactivePrimaryBackgroundHover:"--asakaa-color-interactive-primaryBackgroundHover",success:"--asakaa-color-status-success",warning:"--asakaa-color-status-warning",error:"--asakaa-color-status-error",info:"--asakaa-color-status-info",danger:"--asakaa-color-danger",dangerBorder:"--asakaa-color-danger-border",dangerBackground:"--asakaa-color-danger-background",dangerBackgroundHover:"--asakaa-color-danger-backgroundHover"}).forEach(([p,l])=>{let f=g.colors[p];f&&c.style.setProperty(l,f);}),c.setAttribute("data-theme",r),c.classList.remove("theme-dark","theme-light","theme-neutral"),c.classList.add(`theme-${r}`);},[r]);let n={theme:r,setTheme:s,themes:co};return jsxRuntime.jsx(zn.Provider,{value:n,children:e})}function Ao(){let e=react.useContext(zn);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function L0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ei({isOpen:e,onClose:t,className:a}){let{theme:r,setTheme:o}=Ao();return e?jsxRuntime.jsxs("div",{className:d("fixed inset-0 z-[9999] flex items-center justify-center",a),children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:t}),jsxRuntime.jsxs("div",{className:"relative rounded-2xl border shadow-2xl max-w-md w-full mx-4",style:{backgroundColor:"var(--theme-bg-secondary)",borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsxs("div",{className:"px-6 py-5 border-b flex items-center justify-between",style:{borderColor:"var(--theme-border-primary)"},children:[jsxRuntime.jsx("h2",{className:"text-2xl font-bold",style:{color:"var(--theme-text-primary)"},children:"Select Theme"}),jsxRuntime.jsx("button",{onClick:t,className:"text-2xl leading-none p-2 hover:bg-white/10 rounded-lg transition-colors",style:{color:"var(--theme-text-secondary)"},"aria-label":"Close",children:"\xD7"})]}),jsxRuntime.jsx("div",{className:"p-6 space-y-3",children:Object.entries(co).map(([s,n])=>jsxRuntime.jsxs("button",{onClick:()=>{o(s),t();},className:d("w-full p-4 rounded-lg border-2 transition-all flex items-center gap-4",r===s?"border-blue-500 bg-blue-500/20":"border-white/20 hover:border-white/40"),style:{backgroundColor:r===s?"var(--theme-accent-primary)20":"transparent"},children:[jsxRuntime.jsx("div",{className:"text-3xl",children:n.emoji}),jsxRuntime.jsxs("div",{className:"text-left flex-1",children:[jsxRuntime.jsx("div",{className:"font-semibold",style:{color:"var(--theme-text-primary)"},children:n.displayName}),jsxRuntime.jsxs("div",{className:"text-xs",style:{color:"var(--theme-text-secondary)"},children:[s==="dark"&&"Default dark theme with Linear-inspired colors",s==="light"&&"Clean light theme with high contrast",s==="neutral"&&"Monochrome zen theme"]})]}),r===s&&jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:jsxRuntime.jsx("path",{d:"M20 6L9 17l-5-5"})})]},s))})]})]}):null}function Ac(e="dark"){if(typeof window>"u"||typeof getComputedStyle>"u")return at[e]||at.dark;let t=document.documentElement,a=getComputedStyle(t),r=(s,n)=>a.getPropertyValue(s).trim()||n;return {bgPrimary:r("--theme-bg-primary",at[e].bgPrimary),bgSecondary:r("--theme-bg-secondary",at[e].bgSecondary),bgGrid:r("--theme-bg-card",at[e].bgGrid),bgWeekend:r("--theme-bg-hover",at[e].bgWeekend),border:r("--theme-border-primary",at[e].border),borderLight:r("--theme-border-subtle",at[e].borderLight),textPrimary:r("--theme-text-primary",at[e].textPrimary),textSecondary:r("--theme-text-secondary",at[e].textSecondary),textTertiary:r("--theme-text-tertiary",at[e].textTertiary),accent:r("--theme-accent-primary",at[e].accent),accentHover:r("--theme-accent-hover",at[e].accentHover),accentLight:r("--theme-accent-primary",at[e].accentLight),taskBarPrimary:r("--theme-accent-primary",at[e].taskBarPrimary),taskBarProgress:r("--theme-accent-hover",at[e].taskBarProgress),taskBarHandle:r("--theme-text-inverse",at[e].taskBarHandle||"#FFFFFF"),dependency:r("--theme-border-secondary",at[e].dependency),dependencyHover:r("--theme-border-secondary",at[e].dependencyHover),criticalPath:r("--theme-error",at[e].criticalPath),criticalPathLight:r("--theme-error",at[e].criticalPathLight),today:e==="light"?r("--theme-accent-primary",at[e].today):e==="neutral"?r("--theme-text-primary",at[e].today):r("--theme-error",at[e].today),todayLight:e==="light"?r("--theme-accent-primary",at[e].todayLight):e==="neutral"?r("--theme-text-primary",at[e].todayLight):r("--theme-error",at[e].todayLight),milestone:r("--theme-warning",at[e].milestone),milestoneLight:r("--theme-warning",at[e].milestoneLight),statusTodo:r("--theme-text-tertiary",at[e].statusTodo),statusInProgress:r("--theme-accent-primary",at[e].statusInProgress),statusCompleted:r("--theme-success",at[e].statusCompleted),hoverBg:r("--theme-bg-hover",at[e].hoverBg),focusRing:r("--theme-accent-primary",at[e].focusRing)}}var Hn={columns:{taskName:"TASK NAME",startDate:"Start Date",endDate:"End Date",duration:"Duration",assignees:"Assignees",status:"Status",progress:"% Complete",priority:"Priority"},toolbar:{today:"Today",day:"Day",week:"Week",month:"Month",export:"Export",exportPdf:"Export to PDF",exportPng:"Export to PNG",exportCsv:"Export to CSV",exportExcel:"Export to Excel",exportMsProject:"Export to MS Project",undo:"Undo",redo:"Redo",createTask:"New Task",density:"Row Density",compact:"Compact",normal:"Normal",spacious:"Spacious",filterAll:"All",filterIncomplete:"Incomplete",filterInProgress:"In Progress",filterCompleted:"Completed",filter:"Filters",filterBy:"FILTER BY STATUS",filterAllDesc:"Show all tasks",filterIncompleteDesc:"Hide completed tasks",filterInProgressDesc:"Tasks currently being worked on",filterCompletedDesc:"Only show finished tasks",clearFilter:"Clear filter",hideCompleted:"Hide Completed Tasks",toDo:"To Do / Pending"},contextMenu:{editTask:"Edit Task",addSubtask:"Add Subtask",markIncomplete:"Mark Incomplete",setInProgress:"Set In Progress",markComplete:"Mark Complete",splitTask:"Split Task",deleteTask:"Delete Task"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",addSubtask:"Add Subtask",indent:"Indent",outdent:"Outdent",moveUp:"Move Up",moveDown:"Move Down",splitTask:"Split Task",linkTasks:"Link Tasks",unlinkTasks:"Unlink Tasks"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{progress:"Progress",duration:"Duration",days:"days",day:"day",assigned:"Assigned",milestone:"Milestone",criticalPath:"Critical Path",subtask:"Subtask",task:"Task",noTasks:"No tasks yet",addTask:"Add task",newTask:"New Task",loading:"Loading...",error:"Error",today:"Today",week:"Week",clickToSetDates:"Click to set dates..."},ai:{placeholder:'Ask AI to edit tasks... (e.g., "Move Design to next week")',thinking:"Thinking...",suggestions:{moveTask:'Move "Task Name" to next Monday',extendTask:'Extend "Task Name" by 3 days',renameTask:'Rename "Old Name" to "New Name"',setProgress:'Set "Task Name" progress to 50%',linkTasks:'Link "Task A" to "Task B"',createTask:'Create a new task called "New Task"',deleteTask:'Delete "Task Name"',assignTask:'Assign John to "Task Name"'},errors:{taskNotFound:"Task not found",invalidDate:"Invalid date",invalidDuration:"Invalid duration",invalidProgress:"Invalid progress value",unknownCommand:"Unknown command",processingError:"Error processing command"}},export:{projectName:"Gantt Project",ganttTasks:"Gantt Tasks",taskId:"Task ID",taskName:"Task Name",startDate:"Start Date",endDate:"End Date",isMilestone:"Is Milestone",parentId:"Parent ID",yes:"Yes",no:"No",noTasksToExport:"No tasks available to export"},dateFormat:{short:"MM/dd",medium:"MMM d",long:"MMMM d, yyyy"}},Fc={columns:{taskName:"NOMBRE DE TAREA",startDate:"Fecha Inicio",endDate:"Fecha Fin",duration:"Duraci\xF3n",assignees:"Asignados",status:"Estado",progress:"% Completado",priority:"Prioridad"},toolbar:{today:"Hoy",day:"D\xEDa",week:"Semana",month:"Mes",export:"Exportar",exportPdf:"Exportar a PDF",exportPng:"Exportar a PNG",exportCsv:"Exportar a CSV",exportExcel:"Exportar a Excel",exportMsProject:"Exportar a MS Project",undo:"Deshacer",redo:"Rehacer",createTask:"Nueva Tarea",density:"Densidad",compact:"Compacto",normal:"Normal",spacious:"Espacioso",filterAll:"Todas",filterIncomplete:"Sin completar",filterInProgress:"En progreso",filterCompleted:"Completadas",filter:"Filtros",filterBy:"FILTRAR POR ESTADO",filterAllDesc:"Mostrar todas las tareas",filterIncompleteDesc:"Ocultar tareas completadas",filterInProgressDesc:"Tareas en las que se est\xE1 trabajando",filterCompletedDesc:"Solo mostrar tareas terminadas",clearFilter:"Limpiar filtro",hideCompleted:"Ocultar Tareas Completadas",toDo:"Por Hacer / Pendiente"},contextMenu:{editTask:"Editar Tarea",addSubtask:"Agregar Subtarea",markIncomplete:"Marcar Incompleta",setInProgress:"Marcar En Progreso",markComplete:"Marcar Completada",splitTask:"Dividir Tarea",deleteTask:"Eliminar Tarea"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",addSubtask:"Agregar Subtarea",indent:"Aumentar Nivel",outdent:"Disminuir Nivel",moveUp:"Mover Arriba",moveDown:"Mover Abajo",splitTask:"Dividir Tarea",linkTasks:"Vincular Tareas",unlinkTasks:"Desvincular Tareas"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{progress:"Progreso",duration:"Duraci\xF3n",days:"d\xEDas",day:"d\xEDa",assigned:"Asignado",milestone:"Hito",criticalPath:"Ruta Cr\xEDtica",subtask:"Subtarea",task:"Tarea",noTasks:"Sin tareas a\xFAn",addTask:"Agregar tarea",newTask:"Nueva Tarea",loading:"Cargando...",error:"Error",today:"Hoy",week:"Semana",clickToSetDates:"Clic para establecer fechas..."},ai:{placeholder:'P\xEDdele a la IA que edite tareas... (ej: "Mover Dise\xF1o a la pr\xF3xima semana")',thinking:"Pensando...",suggestions:{moveTask:'Mover "Nombre de Tarea" al pr\xF3ximo lunes',extendTask:'Extender "Nombre de Tarea" por 3 d\xEDas',renameTask:'Renombrar "Nombre Anterior" a "Nombre Nuevo"',setProgress:'Establecer progreso de "Nombre de Tarea" al 50%',linkTasks:'Vincular "Tarea A" con "Tarea B"',createTask:'Crear una nueva tarea llamada "Nueva Tarea"',deleteTask:'Eliminar "Nombre de Tarea"',assignTask:'Asignar a Juan a "Nombre de Tarea"'},errors:{taskNotFound:"Tarea no encontrada",invalidDate:"Fecha inv\xE1lida",invalidDuration:"Duraci\xF3n inv\xE1lida",invalidProgress:"Valor de progreso inv\xE1lido",unknownCommand:"Comando desconocido",processingError:"Error procesando el comando"}},export:{projectName:"Proyecto Gantt",ganttTasks:"Tareas Gantt",taskId:"ID de Tarea",taskName:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",isMilestone:"Es Hito",parentId:"ID Padre",yes:"S\xED",no:"No",noTasksToExport:"No hay tareas disponibles para exportar"},dateFormat:{short:"dd/MM",medium:"d MMM",long:"d de MMMM de yyyy"}},Pi={en:Hn,es:Fc};function Lc(e){return Pi[e]||Pi.en}function Mi(e,t){let a=Lc(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},contextMenu:{...a.contextMenu,...t.contextMenu},actions:{...a.actions,...t.actions},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},ai:{...a.ai,...t.ai,suggestions:{...a.ai.suggestions,...t.ai?.suggestions},errors:{...a.ai.errors,...t.ai?.errors}},export:{...a.export,...t.export},dateFormat:{...a.dateFormat,...t.dateFormat}}:a}var Lo=react.createContext(Hn);function Vr(){return react.useContext(Lo)}function eb({theme:e,onExportPNG:t,onExportPDF:a,onExportExcel:r,onExportCSV:o,onExportJSON:s,onExportMSProject:n}){let[c,g]=react.useState(false),[i,p]=react.useState(null),l=react.useRef(null),f=Vr();if(react.useEffect(()=>{let h=b=>{l.current&&!l.current.contains(b.target)&&g(false);};return c&&document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[c]),!(t||a||r||o||s||n))return null;let k=[{id:"png",label:"PNG",description:"Image",icon:jsxRuntime.jsx(lucideReact.FileImage,{className:"w-4 h-4"}),handler:t},{id:"pdf",label:"PDF",description:"Document",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:a},{id:"excel",label:"Excel",description:"Spreadsheet",icon:jsxRuntime.jsx(lucideReact.FileSpreadsheet,{className:"w-4 h-4"}),handler:r},{id:"csv",label:"CSV",description:"Comma-separated",icon:jsxRuntime.jsx(lucideReact.FileText,{className:"w-4 h-4"}),handler:o},{id:"json",label:"JSON",description:"Data",icon:jsxRuntime.jsx(lucideReact.FileJson,{className:"w-4 h-4"}),handler:s},{id:"msproject",label:"MS Project",description:"XML",icon:jsxRuntime.jsx(lucideReact.FolderKanban,{className:"w-4 h-4"}),handler:n}].filter(h=>h.handler),C=async(h,b)=>{if(b){p(h);try{await b();}catch(u){console.error(`Export ${h} failed:`,u);}finally{p(null),g(false);}}};return jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>g(!c),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{backgroundColor:c?e.accent:e.bgSecondary,border:`1px solid ${c?e.accent:e.borderLight}`,color:c?"#FFFFFF":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{scale:1.02,backgroundColor:e.accent,color:"#FFFFFF"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Download,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:f.toolbar.export}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-3 h-3 transition-transform",style:{transform:c?"rotate(180deg)":"rotate(0deg)"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:c&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute right-0 mt-2 w-48 rounded-lg overflow-hidden z-50",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsx("div",{className:"py-1",children:k.map((h,b)=>jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>C(h.id,h.handler),disabled:i!==null,className:"w-full flex items-center gap-3 px-3 py-2.5 text-left transition-all",style:{backgroundColor:"transparent",borderBottom:b<k.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:b*.03},children:[jsxRuntime.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-md",style:{backgroundColor:e.accentLight,color:e.accent},children:i===h.id?jsxRuntime.jsx(framerMotion.motion.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:jsxRuntime.jsx(lucideReact.Download,{className:"w-4 h-4"})}):h.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{className:"text-xs font-medium truncate",style:{color:e.textPrimary},children:h.label}),jsxRuntime.jsx("div",{className:"text-[10px] truncate",style:{color:e.textTertiary},children:h.description})]})]},h.id))})})})]})}function tb({options:e,value:t,onChange:a,theme:r,layoutId:o="activeSegment"}){return jsxRuntime.jsx("div",{className:"inline-flex p-1 rounded-lg relative",style:{backgroundColor:r.bgSecondary,border:`1px solid ${r.borderLight}`},children:e.map(s=>{let n=t===s.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(s.value),className:"relative px-3 py-1.5 rounded-md text-xs transition-all flex items-center gap-1.5 min-w-[70px] justify-center",style:{color:n?r.textPrimary:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:n?600:500,zIndex:n?2:1},whileHover:{scale:1.02},whileTap:{scale:.98},children:[n&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:o,className:"absolute inset-0 rounded-md",style:{backgroundColor:r.accent,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)"},transition:{type:"spring",stiffness:400,damping:30}}),s.icon&&jsxRuntime.jsx("span",{className:"relative z-10",style:{color:n?"#FFFFFF":r.textTertiary},children:s.icon}),jsxRuntime.jsx("span",{className:"relative z-10",style:{color:n?"#FFFFFF":r.textTertiary},children:s.label})]},s.value)})})}function ab({options:e,value:t,onChange:a,theme:r}){return jsxRuntime.jsx("div",{className:"inline-flex items-center gap-1",children:e.map(o=>{let s=t===o.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>a(o.value),className:"relative px-3 py-1.5 text-xs transition-all",style:{color:s?r.accent:r.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:s?600:500},whileHover:{color:s?r.accent:r.textSecondary},whileTap:{scale:.98},children:[jsxRuntime.jsx("span",{children:o.label}),s&&jsxRuntime.jsx(framerMotion.motion.div,{layoutId:"timeScaleUnderline",className:"absolute bottom-0 left-1 right-1 h-0.5 rounded-full",style:{backgroundColor:r.accent},transition:{type:"spring",stiffness:400,damping:30}})]},o.value)})})}function rb({theme:e,value:t,onChange:a}){let[r,o]=react.useState(false),s=react.useRef(null),n=Vr();react.useEffect(()=>{let i=p=>{s.current&&!s.current.contains(p.target)&&o(false);};return r&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[r]);let c=[{value:"compact",label:n.toolbar.compact||"Compact"},{value:"comfortable",label:n.toolbar.normal||"Normal"},{value:"spacious",label:n.toolbar.spacious||"Spacious"}],g=c.find(i=>i.value===t)?.label||"Normal";return jsxRuntime.jsxs("div",{ref:s,className:"relative",children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>o(!r),className:"flex items-center justify-center p-2 rounded-lg transition-all",style:{backgroundColor:r?e.accentLight:e.bgSecondary,border:`1px solid ${r?e.accent:e.borderLight}`,color:r?e.accent:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},title:`${n.toolbar.density||"Density"}: ${g}`,children:jsxRuntime.jsx(lucideReact.Rows3,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:r&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute left-0 mt-2 w-36 rounded-lg overflow-hidden z-50",style:{backgroundColor:e.bgSecondary,border:`1px solid ${e.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:jsxRuntime.jsx("div",{className:"py-1",children:c.map((i,p)=>{let l=t===i.value;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(i.value),o(false);},className:"w-full flex items-center justify-between px-3 py-2 text-left transition-all",style:{backgroundColor:l?e.accentLight:"transparent",borderBottom:p<c.length-1?`1px solid ${e.borderLight}`:"none"},whileHover:{backgroundColor:l?e.accentLight:e.hoverBg},initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:p*.03},children:[jsxRuntime.jsx("span",{className:"text-xs",style:{color:l?e.accent:e.textPrimary,fontFamily:"Inter, sans-serif",fontWeight:l?600:500},children:i.label}),l&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5",style:{color:e.accent}})]},i.value)})})})})]})}function ob({theme:e,value:t,onChange:a,hideCompleted:r=false,onHideCompletedChange:o}){let[s,n]=react.useState(false),c=react.useRef(null),g=Vr();react.useEffect(()=>{if(!s)return;let f=setTimeout(()=>{let y=C=>{c.current&&!c.current.contains(C.target)&&n(false);},k=C=>{C.key==="Escape"&&n(false);};document.addEventListener("mousedown",y),document.addEventListener("keydown",k),c._cleanup=()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",k);};},100);return ()=>{clearTimeout(f),c._cleanup&&c._cleanup();}},[s]);let i=[{value:"all",label:g.toolbar.filterAll||"Show All",icon:jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#3B82F6] bg-[#3B82F6]"}),color:"text-[#3B82F6]"},{value:"completed",label:g.toolbar.filterCompleted||"Completed",icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),color:"text-green-500"},{value:"in_progress",label:g.toolbar.filterInProgress||"In Progress",icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),color:"text-blue-500"},{value:"incomplete",label:g.toolbar.toDo||"To Do / Pending",icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),color:"text-gray-400"}],p=t!=="all"||r,l=e.bgPrimary==="#0F1117"||e.bgPrimary==="#0a0a0a"||e.textPrimary==="#FFFFFF";return jsxRuntime.jsxs("div",{ref:c,className:"relative",children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:f=>{f.stopPropagation(),n(y=>!y);},className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{backgroundColor:p?l?"rgba(59, 130, 246, 0.2)":"rgb(239 246 255)":s?e.hoverBg:e.bgSecondary,border:`1px solid ${p?l?"rgba(59, 130, 246, 0.5)":"rgb(191 219 254)":e.borderLight}`,color:p?"#3B82F6":e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},whileHover:{backgroundColor:e.hoverBg,scale:1.02},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),jsxRuntime.jsx("span",{children:g.toolbar.filter||"Filters"}),p&&jsxRuntime.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#3B82F6"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-8,scale:.95},transition:{duration:.15,ease:"easeOut"},className:"absolute left-0 mt-2 w-72 rounded-lg overflow-hidden z-50",style:{backgroundColor:l?"#0F1117":"#FFFFFF",border:`1px solid ${l?"rgba(255,255,255,0.1)":"rgb(229 231 235)"}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.25)"},children:[jsxRuntime.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:l?"rgba(255,255,255,0.1)":"rgb(229 231 235)"},children:jsxRuntime.jsx("span",{className:"text-xs font-medium uppercase tracking-wider",style:{color:l?"#6B7280":"#9CA3AF"},children:g.toolbar.filterBy||"FILTER BY STATUS"})}),jsxRuntime.jsx("div",{className:"py-2",children:i.map(f=>{let y=t===f.value&&!r;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{a(f.value),o&&o(false);},className:"w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",style:{backgroundColor:y?l?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent"},whileHover:{backgroundColor:l?"rgba(255,255,255,0.1)":"rgb(243 244 246)"},children:[jsxRuntime.jsx("span",{className:`${f.color} flex-shrink-0`,children:f.icon}),jsxRuntime.jsx("span",{className:"flex-1 text-left whitespace-nowrap",style:{color:l?"#FFFFFF":"#111827"},children:f.label}),y&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 flex-shrink-0",style:{color:l?"#3B82F6":"#2563EB"}})]},f.value)})}),jsxRuntime.jsx("div",{className:"my-2 mx-4 h-px",style:{backgroundColor:l?"rgba(255,255,255,0.1)":"rgb(229 231 235)"}}),o&&jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{o(!r),r||a("all");},className:"w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",style:{backgroundColor:r?l?"rgba(255,255,255,0.05)":"rgb(249 250 251)":"transparent"},whileHover:{backgroundColor:l?"rgba(255,255,255,0.1)":"rgb(243 244 246)"},children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4 flex-shrink-0",style:{color:r?l?"#3B82F6":"#2563EB":l?"#6B7280":"#9CA3AF"}}),jsxRuntime.jsx("span",{className:"flex-1 text-left whitespace-nowrap",style:{color:l?"#FFFFFF":"#111827"},children:g.toolbar.hideCompleted||"Hide Completed Tasks"}),r&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 flex-shrink-0",style:{color:l?"#3B82F6":"#2563EB"}})]})})]})})]})}function Gn({theme:e,timeScale:t,onTimeScaleChange:a,zoom:r,onZoomChange:o,currentTheme:s,onThemeChange:n,rowDensity:c,onRowDensityChange:g,showThemeSelector:i=false,showCreateTaskButton:p=false,createTaskLabel:l,onCreateTask:f,taskFilter:y="all",onTaskFilterChange:k,hideCompleted:C=false,onHideCompletedChange:h,onExportPNG:b,onExportPDF:u,onExportExcel:x,onExportCSV:m,onExportJSON:N,onExportMSProject:w}){let B=Vr(),v=b||u||x||m||N||w,I=[{value:"day",label:B.toolbar.day},{value:"week",label:B.toolbar.week},{value:"month",label:B.toolbar.month}],A=[{value:"dark",label:"Dark",icon:jsxRuntime.jsx(lucideReact.Moon,{className:"w-3.5 h-3.5"})},{value:"light",label:"Light",icon:jsxRuntime.jsx(lucideReact.Sun,{className:"w-3.5 h-3.5"})},{value:"neutral",label:"Zen",icon:jsxRuntime.jsx(lucideReact.Palette,{className:"w-3.5 h-3.5"})}];return jsxRuntime.jsxs("div",{className:"h-12 px-4 flex items-center justify-between border-b",style:{backgroundColor:e.bgGrid,borderColor:e.border},children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(ab,{options:I,value:t,onChange:T=>a(T),theme:e}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>o(Math.max(.5,r-.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomOut,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsxs("div",{className:"px-2 py-0.5 rounded text-xs tabular-nums min-w-[42px] text-center",style:{color:e.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:500},children:[Math.round(r*100),"%"]}),jsxRuntime.jsx(framerMotion.motion.button,{onClick:()=>o(Math.min(2,r+.1)),className:"p-1.5 rounded-md transition-all",style:{backgroundColor:"transparent",color:e.textSecondary},whileHover:{backgroundColor:e.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.ZoomIn,{className:"w-3.5 h-3.5"})})]}),jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsx(rb,{theme:e,value:c,onChange:g}),k&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-px h-5",style:{backgroundColor:e.borderLight}}),jsxRuntime.jsx(ob,{theme:e,value:y,onChange:k,hideCompleted:C,onHideCompletedChange:h})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[p&&f&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(framerMotion.motion.button,{onClick:f,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs transition-all",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#FFFFFF",fontFamily:"Inter, sans-serif",fontWeight:500,boxShadow:"0 2px 8px rgba(59, 130, 246, 0.3)"},whileHover:{scale:1.02,boxShadow:"0 4px 12px rgba(59, 130, 246, 0.4)"},whileTap:{scale:.98},children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{children:l||B.toolbar.createTask})]}),(v||i)&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}})]}),v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(eb,{theme:e,onExportPNG:b,onExportPDF:u,onExportExcel:x,onExportCSV:m,onExportJSON:N,onExportMSProject:w}),i&&jsxRuntime.jsx("div",{className:"w-px h-6",style:{backgroundColor:e.borderLight}})]}),i&&jsxRuntime.jsx(tb,{options:A,value:s,onChange:T=>n(T),theme:e})]})]})}function _n({columns:e,onToggleColumn:t,theme:a}){let[r,o]=react.useState(false),[s,n]=react.useState({x:0,y:0}),c=react.useRef(null),g=react.useRef(null);react.useEffect(()=>{if(!r)return;let p=l=>{c.current&&!c.current.contains(l.target)&&o(false);};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[r]);let i=e.filter(p=>p.id!=="name");return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.button,{ref:g,onClick:()=>{if(!r&&g.current){let p=g.current.getBoundingClientRect();n({x:p.left,y:p.bottom+4});}o(!r);},className:"p-2 rounded-md transition-colors flex items-center gap-1",style:{backgroundColor:a.bgSecondary,border:`1px solid ${a.borderLight}`,color:a.textSecondary},whileHover:{backgroundColor:a.hoverBg,scale:1.05},whileTap:{scale:.95},children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:r&&jsxRuntime.jsx(bt,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:c,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15},className:"column-manager-menu fixed min-w-[180px] rounded-lg shadow-xl z-[9999]",style:{left:`${s.x}px`,top:`${s.y}px`,backgroundColor:a.bgSecondary,border:`1px solid ${a.border}`},children:jsxRuntime.jsxs("div",{className:"py-1",children:[jsxRuntime.jsx("div",{className:"px-3 py-2 text-xs uppercase tracking-wider",style:{color:a.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:"Add Column"}),i.map(p=>jsxRuntime.jsxs("button",{onClick:()=>{t(p.id);},className:"w-full px-3 py-2 text-left flex items-center justify-between transition-colors text-sm",style:{color:a.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor=a.hoverBg;},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{children:p.label}),p.visible&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4",style:{color:a.accent}})]},p.id))]})})})})]})}function Io({isOpen:e,x:t,y:a,items:r,onClose:o,theme:s}){let n=react.useRef(null),[c,g]=react.useState({x:t,y:a});if(react.useEffect(()=>{if(!e)return;let p=200,l=r.length*36+8,f=8,y=window.innerWidth,k=window.innerHeight,C=t,h=a;t+p+f>y&&(C=t-p,C<f&&(C=f)),a+l+f>k&&(h=k-l-f,h<f&&(h=f)),g({x:C,y:h});},[e,t,a,r.length]),react.useEffect(()=>{if(!e)return;let p=f=>{n.current&&!n.current.contains(f.target)&&o();},l=f=>{f.key==="Escape"&&o();};return document.addEventListener("mousedown",p),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",l);}},[e,o]),!e)return null;let i=p=>p.startsWith("#")&&(p.length===7||p.length===4)?p:s.bgPrimary?.includes("1")||s.bgPrimary?.includes("2")||s.textPrimary?.toLowerCase().includes("fff")||s.textPrimary?.toLowerCase().includes("white")?"#1E2128":"#FFFFFF";return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{ref:n,initial:{opacity:0,scale:.95,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{duration:.15,ease:[.4,0,.2,1]},className:"fixed z-[9999] min-w-[200px] rounded-lg",style:{left:`${c.x}px`,top:`${c.y}px`,backgroundColor:i(s.bgSecondary),border:`1px solid ${s.border}`,boxShadow:"0 10px 40px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2)",backdropFilter:"none"},children:jsxRuntime.jsx("div",{className:"py-1",children:r.map(p=>jsxRuntime.jsxs("div",{children:[p.separator&&jsxRuntime.jsx("div",{className:"my-1 h-px",style:{backgroundColor:s.borderLight}}),jsxRuntime.jsxs("button",{onClick:()=>{p.disabled||(p.onClick(),o());},disabled:p.disabled,className:"w-full px-3 py-2 text-left flex items-center gap-2 transition-colors text-sm",style:{color:p.disabled?s.textTertiary:s.textPrimary,backgroundColor:"transparent",fontFamily:"Inter, sans-serif",cursor:p.disabled?"not-allowed":"pointer",opacity:p.disabled?.5:1},onMouseEnter:l=>{p.disabled||(l.currentTarget.style.backgroundColor=s.hoverBg);},onMouseLeave:l=>{l.currentTarget.style.backgroundColor="transparent";},children:[p.icon&&jsxRuntime.jsx("span",{style:{color:s.textSecondary},children:p.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:p.label}),p.submenu&&jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:s.textTertiary}})]})]},p.id))})})})}var Wt={Edit:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),Pencil:jsxRuntime.jsx(lucideReact.Pencil,{className:"w-4 h-4"}),Delete:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),Add:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),AddSubtask:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),Remove:jsxRuntime.jsx(lucideReact.Minus,{className:"w-4 h-4"}),Link:jsxRuntime.jsx(lucideReact.Link2,{className:"w-4 h-4"}),Progress:jsxRuntime.jsx(lucideReact.BarChart3,{className:"w-4 h-4"}),Sort:jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:"w-4 h-4"}),SortAsc:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),SortDesc:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),Hide:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),Show:jsxRuntime.jsx(lucideReact.Eye,{className:"w-4 h-4"}),Settings:jsxRuntime.jsx(lucideReact.Settings,{className:"w-4 h-4"}),Split:jsxRuntime.jsx(lucideReact.Scissors,{className:"w-4 h-4"}),MarkIncomplete:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),SetInProgress:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),MarkComplete:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"})};function Wc({tasks:e,selectedTaskIds:t,onTaskSelect:a,onTaskCreate:r,onTaskDelete:o,onTaskDuplicate:s,onTaskMove:n,onTaskIndent:c,onTaskOutdent:g,onTaskRename:i,onTaskToggleExpand:p,onOpenTaskModal:l,enableKeyboard:f=true}){let y=react.useRef(false),k=react.useCallback(x=>{y.current=x;},[]),C=react.useCallback(x=>{let m=[],N=w=>{for(let B of w)m.push(B),B.subtasks&&B.subtasks.length>0&&B.isExpanded&&N(B.subtasks);};return N(x),m},[]),h=react.useCallback(()=>{let x=C(e);for(let m of x)if(t.has(m.id))return m;return null},[e,t,C]),b=react.useCallback((x,m)=>{let N=C(e);if(N.length===0)return;let w=h();if(!w){a(N[0].id,false);return}let B=N.findIndex(A=>A.id===w.id);if(B===-1)return;let v=x==="up"?B-1:B+1;if(v<0||v>=N.length)return;let I=N[v];a(I.id,m);},[e,h,C,a]),u=react.useCallback(x=>{if(!f)return;let m=x.target;if(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable||y.current){x.key==="Escape"&&(m.blur(),y.current=false);return}let B=navigator.platform.toUpperCase().indexOf("MAC")>=0?x.metaKey:x.ctrlKey,v=Array.from(t),I=h();if(x.key==="ArrowUp"){x.preventDefault(),b("up",x.shiftKey);return}if(x.key==="ArrowDown"){x.preventDefault(),b("down",x.shiftKey);return}if(I&&(x.key==="ArrowRight"||x.key==="ArrowLeft")){I.subtasks&&I.subtasks.length>0&&(x.preventDefault(),(x.key==="ArrowRight"&&!I.isExpanded||x.key==="ArrowLeft"&&I.isExpanded)&&p(I.id));return}if(x.altKey&&(x.key==="ArrowUp"||x.key==="ArrowDown")){v.length>0&&(x.preventDefault(),n(v,x.key==="ArrowUp"?"up":"down"));return}if(x.key==="Tab"&&!x.shiftKey){v.length>0&&(x.preventDefault(),c(v));return}if(x.key==="Tab"&&x.shiftKey){v.length>0&&(x.preventDefault(),g(v));return}if(x.key==="Enter"&&!x.shiftKey&&!B){I&&(x.preventDefault(),r(I.id,"below"));return}if(x.key==="Enter"&&x.shiftKey&&!B){I&&(x.preventDefault(),r(I.id,"above"));return}if(x.key==="Enter"&&B){I&&(x.preventDefault(),l(I.id));return}if(x.key==="F2"){I&&(x.preventDefault(),i(I.id));return}if(x.key==="Delete"||x.key==="Backspace"&&B){v.length>0&&(x.preventDefault(),o(v));return}if(x.key==="d"&&B&&!x.shiftKey){v.length>0&&(x.preventDefault(),s(v));return}},[f,t,h,b,r,o,s,n,c,g,i,p,l]);return react.useEffect(()=>{if(f)return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u);}},[f,u]),{setIsEditing:k}}function _c(){let[e,t]=react.useState(new Set),[a,r]=react.useState(null),o=react.useCallback(l=>{t(new Set([l])),r(l);},[]),s=react.useCallback(l=>{t(f=>{let y=new Set(f);return y.has(l)?y.delete(l):y.add(l),y}),r(l);},[]),n=react.useCallback((l,f)=>{if(!a){o(l);return}let y=f.indexOf(a),k=f.indexOf(l);if(y===-1||k===-1){o(l);return}let C=Math.min(y,k),h=Math.max(y,k),b=f.slice(C,h+1);t(new Set(b)),r(l);},[a,o]),c=react.useCallback((l,f,y,k)=>{k?n(l,f):y?s(l):o(l);},[o,s,n]),g=react.useCallback((l,f)=>{f?t(y=>{let k=new Set(y);return k.add(l),k}):o(l);},[o]),i=react.useCallback(()=>{t(new Set),r(null);},[]),p=react.useCallback(l=>e.has(l),[e]);return {selectedTaskIds:e,selectTask:o,toggleTaskSelection:s,selectTaskRange:n,handleTaskClick:c,handleKeyboardSelection:g,clearSelection:i,isTaskSelected:p}}function Bo(e){let t=[],a=(r,o,s=0)=>{for(let n=0;n<r.length;n++){let c={...r[n],parentId:o,level:s,position:n};t.push(c),c.subtasks&&c.subtasks.length>0&&c.isExpanded&&a(c.subtasks,c.id,s+1);}};return a(e),t}function Vc(e,t){for(let a of e){if(a.id===t)return a;if(a.subtasks){let r=Vc(a.subtasks,t);if(r)return r}}return null}function Oi(e,t){for(let a of e)if(a.subtasks){if(a.subtasks.some(o=>o.id===t))return a;let r=Oi(a.subtasks,t);if(r)return r}return null}function $i(e,t){if(t.length===0)return e;let a=Bo(e),r=t[0],o=a.findIndex(l=>l.id===r);if(o<=0)return e;let s=a[o-1],n=(l,f)=>{let y=[];return {tasks:l.filter(C=>{if(f.has(C.id))return y.push(C),false;if(C.subtasks){let h=n(C.subtasks,f);C.subtasks=h.tasks,y.push(...h.removed);}return true}),removed:y}},c=(l,f,y)=>l.map(k=>k.id===f?{...k,subtasks:[...k.subtasks||[],...y],isExpanded:true}:k.subtasks?{...k,subtasks:c(k.subtasks,f,y)}:k),g=new Set(t),{tasks:i,removed:p}=n(e,g);return c(i,s.id,p)}function Ui(e,t){if(t.length===0)return e;let a=[...e];for(let r of t){let o=Oi(a,r);if(!o)continue;let s=Oi(a,o.id),n=(i,p,l)=>{for(let f=0;f<i.length;f++){let y=i[f];if(y.id===p&&y.subtasks){let k=y.subtasks.findIndex(C=>C.id===l);if(k!==-1){let[C]=y.subtasks.splice(k,1);return C}}if(y.subtasks){let k=n(y.subtasks,p,l);if(k)return k}}return null},c=(i,p,l)=>{let f=i.findIndex(y=>y.id===p);if(f!==-1)return i.splice(f+1,0,l),i;for(let y of i)y.subtasks&&c(y.subtasks,p,l);return i},g=n(a,o.id,r);g&&(s&&s.subtasks?c(s.subtasks,o.id,g):c(a,o.id,g));}return a}function zi(e,t,a){if(t.length===0)return e;let r=[...e],o=t[0],s=(n,c,g)=>{let i=n.findIndex(l=>l.id===c);if(i===-1){for(let l of n)if(l.subtasks&&s(l.subtasks,c,g))return true;return false}let p=g==="up"?i-1:i+1;return p<0||p>=n.length?false:([n[i],n[p]]=[n[p],n[i]],true)};return s(r,o,a),r}function Hi(e,t){let a=new Set(t),r=o=>o.filter(s=>!a.has(s.id)).map(s=>s.subtasks?{...s,subtasks:r(s.subtasks)}:s);return r(e)}function Wi(e,t){let a=[...e];for(let r of t){let o=n=>{let c=n.findIndex(p=>p.id===r);if(c===-1){for(let p of n)if(p.subtasks&&o(p.subtasks))return true;return false}let g=n[c],i={...g,id:`${g.id}-copy-${Date.now()}`,name:`${g.name} (Copy)`,subtasks:g.subtasks?s(g.subtasks):void 0};return n.splice(c+1,0,i),true},s=n=>n.map(c=>({...c,id:`${c.id}-copy-${Date.now()}`,subtasks:c.subtasks?s(c.subtasks):void 0}));o(a);}return a}function jc(e,t,a){let r=[...e],o=new Date,s=new Date(o);s.setDate(s.getDate()+7);let n={id:`task-${Date.now()}`,name:"New Task",progress:0,status:"todo",startDate:o,endDate:s,color:"#6366F1"},c=g=>{let i=g.findIndex(l=>l.id===t);if(i===-1){for(let l of g)if(l.subtasks&&c(l.subtasks))return true;return false}let p=a==="above"?i:i+1;return g.splice(p,0,n),true};return c(r),{tasks:r,newTask:n}}function Gi(e,t,a){return e.map(r=>r.id===t?{...r,name:a}:r.subtasks?{...r,subtasks:Gi(r.subtasks,t,a)}:r)}function _i(e,t){return e.map(a=>a.id===t?{...a,isExpanded:!a.isExpanded}:a.subtasks?{...a,subtasks:_i(a.subtasks,t)}:a)}function Vi(e,t){let a=p=>{for(let l of p){if(l.id===t)return l;if(l.subtasks){let f=a(l.subtasks);if(f)return f}}return null},r=a(e),o=new Date,s=new Date(o);s.setDate(s.getDate()+7);let n=r?.startDate||o,c=r?.endDate||s,g={id:`task-${Date.now()}`,name:"New Subtask",progress:0,status:"todo",startDate:new Date(n),endDate:new Date(c),color:r?.color||"#3B82F6"},i=p=>p.map(l=>{if(l.id===t){let f=l.subtasks||[];return {...l,subtasks:[...f,g],isExpanded:true}}return l.subtasks?{...l,subtasks:i(l.subtasks)}:l});return {tasks:i(e),newTask:g}}function Kc(e,t,a,r){if(t===a)return e;let o=Vc(e,t);if(!o)return e;if(a){let c=(g,i)=>{if(!g.subtasks)return false;for(let p of g.subtasks)if(p.id===i||c(p,i))return true;return false};if(c(o,a))return e}let s=c=>c.filter(g=>g.id!==t).map(g=>g.subtasks&&g.subtasks.length>0?{...g,subtasks:s(g.subtasks)}:g),n=s(e);if(a===null){let c=r!==void 0?r:n.length;n.splice(c,0,{...o,parentId:void 0});}else {let c=g=>g.map(i=>{if(i.id===a){let p=i.subtasks||[],l=r!==void 0?r:p.length,f=[...p];return f.splice(l,0,{...o,parentId:a}),{...i,subtasks:f,isExpanded:true}}return i.subtasks&&i.subtasks.length>0?{...i,subtasks:c(i.subtasks)}:i});n=c(n);}return n}function Kn({tasks:e,theme:t,rowHeight:a,availableUsers:r=[],templates:o,onTaskClick:s,onTaskDblClick:n,onTaskContextMenu:c,onTaskToggle:g,scrollTop:i,columns:p,onToggleColumn:l,onColumnResize:f,onTaskUpdate:y,onTaskIndent:k,onTaskOutdent:C,onTaskMove:h,onMultiTaskDelete:b,onTaskDuplicate:u,onTaskCreate:x,onTaskRename:m,onCreateSubtask:N,onOpenTaskModal:w,onDeleteRequest:B,onTaskReparent:v}){let I=react.useContext(Lo),[A,T]=react.useState(null),[W,$]=react.useState(null),[j,te]=react.useState(""),oe=react.useRef(null),[re,ge]=react.useState(null),[fe,Ie]=react.useState(0),[M,R]=react.useState(0),[L,V]=react.useState({isOpen:false,x:0,y:0,type:"header"}),[q,z]=react.useState(null),[ye,ne]=react.useState(null),[Be,qe]=react.useState(null),tt=react.useRef(0),le=5,Je=react.useRef(false),[ct,wt]=react.useState(null),[vt,U]=react.useState(false),[me,Ae]=react.useState(null),[Fe,je]=react.useState(false),Qe=react.useRef(null);react.useEffect(()=>{function _(Y){Qe.current&&!Qe.current.contains(Y.target)&&je(false);}if(Fe)return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[Fe]),react.useEffect(()=>{W&&oe.current&&(oe.current.focus(),oe.current.select());},[W]),react.useEffect(()=>{if(!re)return;let _=se=>{let Ye=se.clientX-fe,Ue=M+Ye;f?.(re,Ue);},Y=()=>{ge(null),document.body.style.cursor="",document.body.style.userSelect="";};return document.addEventListener("mousemove",_),document.addEventListener("mouseup",Y),document.body.style.cursor="col-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",Y),document.body.style.cursor="",document.body.style.userSelect="";}},[re,fe,M,f]);let{selectedTaskIds:Pt,handleTaskClick:Re,isTaskSelected:J}=_c(),{setIsEditing:ve}=Wc({tasks:e,selectedTaskIds:Pt,onTaskSelect:(_,Y)=>{let Ye=Bo(e).map(Ue=>Ue.id);Re(_,Ye,Y||false,false);},onTaskCreate:x||(()=>{}),onTaskDelete:b||(()=>{}),onTaskDuplicate:u||(()=>{}),onTaskMove:h||(()=>{}),onTaskIndent:k||(()=>{}),onTaskOutdent:C||(()=>{}),onTaskRename:_=>{let Y=Bo(e).find(se=>se.id===_);Y&&ea(Y);},onTaskToggleExpand:g||(()=>{}),onOpenTaskModal:_=>{let Y=Bo(e).find(se=>se.id===_);Y&&w&&w(Y);},enableKeyboard:true}),He=(_,Y=0)=>{let se=[];for(let Ye of _)se.push({task:Ye,level:Y}),Ye.subtasks&&Ye.subtasks.length>0&&Ye.isExpanded&&se.push(...He(Ye.subtasks,Y+1));return se},Le=He(e),nt=48,st=Math.max(Le.length*a,600-nt),_e=_=>!_.startDate||!_.endDate?"-":`${Math.ceil((_.endDate.getTime()-_.startDate.getTime())/(1e3*60*60*24))}d`,ea=_=>{$(_.id),te(_.name),ve(true);},ke=_=>{j.trim()&&j!==e.find(Y=>Y.id===_)?.name&&m?.(_,j.trim()),$(null),te(""),ve(false);},be=()=>{$(null),te(""),ve(false);},Ke=(_,Y)=>{Y.stopPropagation(),N?.(_.id);},F=(_,Y)=>{Y.preventDefault(),tt.current=Y.clientY,z(_),Je.current=false,U(false),wt({x:Y.clientX,y:Y.clientY});},Ce=_=>{if(!q||(Math.abs(_.clientY-tt.current)>le&&!Je.current&&(Je.current=true,U(true)),wt({x:_.clientX,y:_.clientY}),!Je.current))return;let se=document.querySelectorAll("[data-task-row]"),Ye=null,Ue=null;se.forEach(H=>{let ie=H.getBoundingClientRect(),We=H.getAttribute("data-task-row");if(We&&We!==q&&_.clientY>=ie.top&&_.clientY<=ie.bottom){Ye=We;let Mt=_.clientY-ie.top,pt=ie.height;Mt<pt*.25?Ue="above":Mt>pt*.75?Ue="below":Ue="child";}}),ne(Ye),qe(Ue);},Z=()=>{if(Je.current&&q&&ye&&Be){if(Be==="child")v?.(q,ye);else if(Be==="above"||Be==="below"){let _=(Ye,Ue,H=null)=>{for(let ie of Ye){if(ie.id===Ue)return H;if(ie.subtasks){let We=_(ie.subtasks,Ue,ie.id);if(We!==void 0)return We}}},Y=_(e,ye,null),se=(Ye,Ue)=>{let H=Ye.findIndex(ie=>ie.id===Ue);return Be==="below"?H+1:H};if(Y===null){let Ye=se(e,ye);v?.(q,null,Ye);}else {let Ye=Le.find(Ue=>Ue.task.id===Y)?.task;if(Ye?.subtasks){let Ue=se(Ye.subtasks,ye);v?.(q,Y,Ue);}}}}z(null),ne(null),qe(null),wt(null),Je.current=false,U(false);};react.useEffect(()=>{if(q)return document.addEventListener("mousemove",Ce),document.addEventListener("mouseup",Z),document.body.style.cursor="grabbing",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",Ce),document.removeEventListener("mouseup",Z),document.body.style.cursor="",document.body.style.userSelect="";}},[q,ye,Be]);let Te=(_,Y,se)=>{switch(_.id){case "name":let Ye=W===Y.id,Ue=A===Y.id;return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 relative",style:{paddingLeft:`${se*20}px`},children:[v&&jsxRuntime.jsx("div",{className:"cursor-grab active:cursor-grabbing p-0.5 rounded hover:bg-white/10 transition-all flex-shrink-0",style:{color:t.textTertiary,opacity:Ue?1:.3},onMouseDown:O=>F(Y.id,O),title:"Arrastrar para mover tarea",children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-4 h-4"})}),Y.subtasks&&Y.subtasks.length>0?jsxRuntime.jsx("button",{onClick:O=>{O.stopPropagation(),g?.(Y.id);},className:"p-0.5 hover:bg-opacity-10 rounded transition-colors flex-shrink-0",style:{color:t.textSecondary},children:Y.isExpanded?jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})}):jsxRuntime.jsx("div",{className:"w-5 h-5 flex-shrink-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full border",style:{backgroundColor:Y.color||"#3B82F6",opacity:Y.parentId?.6:1,borderColor:Y.isMilestone?t.accent:"transparent",borderWidth:Y.isMilestone?"2px":"0px"},title:Y.isMilestone?"Milestone":Y.parentId?"Subtask":"Task"})}),Ye?jsxRuntime.jsx("input",{ref:oe,type:"text",value:j,onChange:O=>te(O.target.value),onKeyDown:O=>{O.key==="Enter"?ke(Y.id):O.key==="Escape"&&be();},onBlur:()=>ke(Y.id),className:"flex-1 px-2 py-1 rounded border outline-none",style:{backgroundColor:t.bgPrimary,borderColor:t.accent,color:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:"13px",fontWeight:500},onClick:O=>O.stopPropagation()}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"flex-1",style:{color:Y.parentId?t.textSecondary:t.textPrimary,fontFamily:"Inter, sans-serif",fontSize:Y.parentId?"13px":"14px",fontWeight:Y.isMilestone?600:Y.parentId?400:600,letterSpacing:Y.parentId?"0":"-0.01em"},title:Y.name,children:Y.name}),Ue&&!Ye&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1 ml-2",onClick:O=>O.stopPropagation(),children:[jsxRuntime.jsx("button",{onClick:O=>Ke(Y,O),className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Create subtask",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:O=>{O.stopPropagation(),ea(Y);},className:"p-1 rounded hover:bg-opacity-20 transition-colors",style:{color:t.textTertiary,backgroundColor:"transparent"},title:"Rename (F2)",children:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-3.5 h-3.5"})})]})]})]});case "startDate":case "endDate":let ie=_.id==="startDate"?"startDate":"endDate",We=Y[ie],Mt=me?.taskId===Y.id&&me?.field===ie,pt=O=>O?(typeof O=="string"?new Date(O):O).toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric"}):"-";return jsxRuntime.jsxs("div",{className:"flex items-center justify-center w-full relative",onClick:O=>O.stopPropagation(),children:[jsxRuntime.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors hover:bg-white/5",style:{color:t.textSecondary},onClick:O=>{if(Mt)Ae(null);else {let Me=O.currentTarget.getBoundingClientRect();Ae({taskId:Y.id,field:ie,month:We?typeof We=="string"?new Date(We):We:new Date,position:{top:Me.bottom+4,left:Me.left}});}},children:[jsxRuntime.jsx(lucideReact.Calendar,{className:"w-3 h-3",style:{color:t.textTertiary}}),jsxRuntime.jsx("span",{children:pt(We)})]}),Mt&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-[9998]",onClick:()=>Ae(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"fixed z-[9999] rounded-xl shadow-2xl overflow-visible flex",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,top:me?.position.top,left:me?.position.left},onClick:O=>O.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"w-36 py-2",style:{borderRight:`1px solid ${t.border}`},children:[(()=>{let O=new Date,Me=new Date(O);Me.setDate(O.getDate()+1);let Xe=new Date(O);Xe.setDate(O.getDate()+7);let Lt=new Date(O);return Lt.setDate(O.getDate()+14),[{label:"Hoy",date:O},{label:"Ma\xF1ana",date:Me},{label:"Pr\xF3xima semana",date:Xe},{label:"2 semanas",date:Lt}].map((ze,xt)=>jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:t.textPrimary},onMouseEnter:Ve=>Ve.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:Ve=>Ve.currentTarget.style.backgroundColor="transparent",onClick:()=>{y?.(Y.id,{[ie]:ze.date}),Ae(null);},children:ze.label},xt))})(),jsxRuntime.jsx("div",{style:{borderTop:`1px solid ${t.border}`,margin:"0.25rem 0"}}),jsxRuntime.jsx("button",{type:"button",className:"w-full px-3 py-1.5 text-xs text-left transition-colors",style:{color:"#EF4444"},onMouseEnter:O=>O.currentTarget.style.backgroundColor=t.hoverBg||"rgba(255,255,255,0.05)",onMouseLeave:O=>O.currentTarget.style.backgroundColor="transparent",onClick:()=>{y?.(Y.id,{[ie]:void 0}),Ae(null);},children:"Borrar"})]}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>Ae(O=>O?{...O,month:new Date(O.month.getFullYear(),O.month.getMonth()-1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})}),jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textPrimary},children:me?.month.toLocaleDateString("es-ES",{month:"long",year:"numeric"})}),jsxRuntime.jsx("button",{type:"button",onClick:()=>Ae(O=>O?{...O,month:new Date(O.month.getFullYear(),O.month.getMonth()+1)}:null),className:"p-1 rounded hover:bg-white/10",children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5",style:{color:t.textSecondary}})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:["D","L","M","M","J","V","S"].map((O,Me)=>jsxRuntime.jsx("div",{className:"w-6 h-6 flex items-center justify-center text-[10px]",style:{color:t.textTertiary},children:O},Me))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let O=me?.month||new Date,Me=O.getFullYear(),Xe=O.getMonth(),Lt=new Date(Me,Xe,1).getDay(),de=new Date(Me,Xe+1,0).getDate(),ze=new Date,xt=[];for(let ft=Lt-1;ft>=0;ft--)xt.push({day:new Date(Me,Xe,-ft).getDate(),date:new Date(Me,Xe-1,new Date(Me,Xe,-ft).getDate()),isCurrentMonth:false});for(let ft=1;ft<=de;ft++)xt.push({day:ft,date:new Date(Me,Xe,ft),isCurrentMonth:true});let Ve=42-xt.length;for(let ft=1;ft<=Ve;ft++)xt.push({day:ft,date:new Date(Me,Xe+1,ft),isCurrentMonth:false});return xt.map((ft,aa)=>{let Ca=ft.date.toDateString()===ze.toDateString(),Ze=(We?typeof We=="string"?new Date(We):We:null)?.toDateString()===ft.date.toDateString();return jsxRuntime.jsx("button",{type:"button",className:"w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",style:{color:ft.isCurrentMonth?Ze?"#FFF":t.textPrimary:t.textTertiary,backgroundColor:Ze?"#3B82F6":"transparent",boxShadow:Ca&&!Ze?"inset 0 0 0 1px #3B82F6":"none"},onClick:()=>{y?.(Y.id,{[ie]:ft.date}),Ae(null);},children:ft.day},aa)})})()})]})]})]}),document.body)]});case "duration":return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",children:jsxRuntime.jsx("span",{className:"text-xs tabular-nums",style:{color:t.textSecondary,fontFamily:"Inter, sans-serif",fontWeight:600},children:_e(Y)})});case "assignees":let Ar=r.filter(O=>Y.assignees?.some(Me=>Me.name===O.name||Me.initials===O.initials));return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:O=>O.stopPropagation(),children:jsxRuntime.jsx(ro,{assignedUsers:Ar,availableUsers:r,onChange:O=>{let Me=O.map(Xe=>({id:Xe.id,name:Xe.name,initials:Xe.initials,color:Xe.color}));y?.(Y.id,{assignees:Me.length>0?Me:void 0});}})});case "status":return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:O=>O.stopPropagation(),children:jsxRuntime.jsx(Bd,{status:Y.status||"todo",onChange:O=>{y?.(Y.id,{status:O,progress:O==="completed"?100:Y.progress});}})});case "progress":return jsxRuntime.jsxs("div",{className:"flex items-center justify-center gap-2 w-full",children:[jsxRuntime.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden max-w-[60px]",style:{backgroundColor:t.bgSecondary},children:jsxRuntime.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Y.progress}%`,backgroundColor:Y.progress===100?t.statusCompleted:t.accent}})}),jsxRuntime.jsxs("span",{className:"text-xs tabular-nums min-w-[35px] text-right",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600},children:[Y.progress,"%"]})]});case "priority":let wa={low:"LOW",medium:"MEDIUM",high:"HIGH",urgent:"URGENT"},ta={LOW:"low",MEDIUM:"medium",HIGH:"high",URGENT:"urgent"},P=wa[Y.priority||"medium"]||"MEDIUM";return jsxRuntime.jsx("div",{className:"flex items-center justify-center w-full",onClick:O=>O.stopPropagation(),children:jsxRuntime.jsx(to,{priority:P,onChange:O=>{O&&y?.(Y.id,{priority:ta[O]||"medium"});}})});default:return null}},we=_=>[{id:"hide",label:"Hide Column",icon:Wt.Hide,onClick:()=>l(_),disabled:_==="name"},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"sortAsc",label:"Sort Ascending",icon:Wt.SortAsc,onClick:()=>{}},{id:"sortDesc",label:"Sort Descending",icon:Wt.SortDesc,onClick:()=>{}}],Oe=_=>_.subtasks&&_.subtasks.length>0?[{id:"addSubtask",label:I?.contextMenu?.addSubtask||"Add Subtask",icon:Wt.Add,onClick:()=>{N?.(_.id);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"delete",label:I?.contextMenu?.deleteTask||"Delete Task",icon:Wt.Delete,onClick:()=>{B?B(_.id,_.name):b?.([_.id]);}}]:[{id:"edit",label:I?.contextMenu?.editTask||"Edit Task",icon:Wt.Pencil,onClick:()=>{n?.(_);}},{id:"addSubtask",label:I?.contextMenu?.addSubtask||"Add Subtask",icon:Wt.Add,onClick:()=>{N?.(_.id);}},{id:"sep1",label:"",onClick:()=>{},separator:true},{id:"markIncomplete",label:I?.contextMenu?.markIncomplete||"Mark Incomplete",icon:Wt.MarkIncomplete,onClick:()=>{y?.(_.id,{status:"todo",progress:0});},disabled:_.status==="todo"},{id:"setInProgress",label:I?.contextMenu?.setInProgress||"Set In Progress",icon:Wt.SetInProgress,onClick:()=>{y?.(_.id,{status:"in-progress"});},disabled:_.status==="in-progress"},{id:"markComplete",label:I?.contextMenu?.markComplete||"Mark Complete",icon:Wt.MarkComplete,onClick:()=>{y?.(_.id,{status:"completed",progress:100});},disabled:_.status==="completed"},{id:"sep2",label:"",onClick:()=>{},separator:true},{id:"split",label:I?.contextMenu?.splitTask||"Split Task",icon:Wt.Split,onClick:()=>{},disabled:true},{id:"sep3",label:"",onClick:()=>{},separator:true},{id:"delete",label:I?.contextMenu?.deleteTask||"Delete Task",icon:Wt.Delete,onClick:()=>{B?B(_.id,_.name):b?.([_.id]);}}],$e=p.filter(_=>_.visible),dt=$e.reduce((_,Y)=>_+Y.width,0);return jsxRuntime.jsxs("div",{className:"gantt-taskgrid-content",style:{backgroundColor:t.bgPrimary,minWidth:dt},children:[jsxRuntime.jsxs("div",{className:"sticky top-0 z-10 flex items-center",style:{backgroundColor:t.bgGrid,height:`${nt}px`,paddingLeft:"3px",borderBottom:`1px solid ${t.border}`,boxSizing:"border-box"},children:[jsxRuntime.jsx("div",{className:"flex items-center flex-1 min-w-0",children:$e.map((_,Y)=>{let se=Y===$e.length-1,Ye=_.id==="name";return jsxRuntime.jsxs("div",{className:`flex items-center px-4 cursor-pointer hover:bg-opacity-50 transition-colors relative ${Ye?"":"justify-center"}`,style:{width:`${_.width}px`,minWidth:`${_.minWidth??(Ye?200:60)}px`,maxWidth:`${_.maxWidth??2e3}px`,flexShrink:0,flexGrow:0,borderRight:se?"none":`1px solid ${t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"hidden"},onContextMenu:Ue=>{Ue.preventDefault(),V({isOpen:true,x:Ue.clientX,y:Ue.clientY,type:"header",columnId:_.id});},onMouseEnter:Ue=>{Ue.currentTarget.style.backgroundColor=t.hoverBg;},onMouseLeave:Ue=>{Ue.currentTarget.style.backgroundColor="transparent";},children:[jsxRuntime.jsx("span",{className:"text-xs uppercase tracking-wider",style:{color:t.textTertiary,fontFamily:"Inter, sans-serif",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,paddingRight:"0"},title:_.label,children:_.label}),_.resizable&&jsxRuntime.jsx("div",{className:"absolute right-0 top-0 bottom-0 cursor-col-resize transition-colors group",style:{width:"8px",marginRight:"-4px",backgroundColor:re===_.id?`${t.accent}30`:"transparent",zIndex:5},onMouseDown:Ue=>{Ue.preventDefault(),Ue.stopPropagation(),ge(_.id),Ie(Ue.clientX),R(_.width);},title:"Drag to resize column",children:jsxRuntime.jsx("div",{className:"absolute top-2 bottom-2 opacity-0 group-hover:opacity-100 transition-opacity",style:{left:"3px",width:"2px",backgroundColor:t.accent,borderRadius:"1px"}})})]},_.id)})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1 px-2",style:{position:"sticky",right:0,height:"100%",backgroundColor:t.bgGrid,zIndex:5},children:[jsxRuntime.jsx(_n,{columns:p,onToggleColumn:l,theme:t}),jsxRuntime.jsx("button",{onClick:()=>je(!Fe),className:"p-1.5 rounded hover:bg-opacity-10 transition-colors",style:{color:t.textTertiary},title:"Keyboard shortcuts",children:jsxRuntime.jsx(lucideReact.Keyboard,{className:"w-4 h-4"})}),Fe&&jsxRuntime.jsxs("div",{ref:Qe,className:"absolute top-full right-0 mt-2 p-4 rounded-lg shadow-2xl z-50 min-w-[400px]",style:{backgroundColor:t.bgPrimary,border:`1px solid ${t.border}`,color:t.textPrimary},onClick:_=>_.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 pb-2 border-b",style:{borderColor:t.border},children:[jsxRuntime.jsx("h3",{className:"font-semibold text-sm",style:{color:t.textPrimary},children:"Keyboard Shortcuts"}),jsxRuntime.jsx("button",{onClick:()=>je(false),className:"text-xs px-2 py-1 rounded hover:bg-opacity-10",style:{color:t.textTertiary},children:"Close"})]}),jsxRuntime.jsxs("div",{className:"space-y-3 text-xs",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Navigation"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move focus up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Select range"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Toggle selection"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Click"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Hierarchy"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Indent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Outdent task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Tab"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Expand/Collapse"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"\u2192 / \u2190"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Editing"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task below"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Create task above"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Shift + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Open task modal"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + Enter"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Rename task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"F2"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"font-semibold mb-1.5",style:{color:t.textSecondary},children:"Actions"}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Move task up/down"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Alt + \u2191 / \u2193"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Delete task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Delete"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{style:{color:t.textTertiary},children:"Duplicate task"}),jsxRuntime.jsx("kbd",{className:"px-2 py-0.5 rounded font-mono text-xs",style:{backgroundColor:t.bgGrid,color:t.textPrimary},children:"Cmd/Ctrl + D"})]})]})]})]})]})]})]}),jsxRuntime.jsx("div",{className:"gantt-taskgrid-content",style:{minHeight:st},children:Le.map(({task:_,level:Y},se)=>{let Ye=J(_.id),Ue=ye===_.id,H=Ue&&Be==="above",ie=Ue&&Be==="below",We=Ue&&Be==="child",Mt={};return We&&(Mt.backgroundColor=`${t.accent}15`,Mt.boxShadow=`inset 0 0 0 2px ${t.accent}`),jsxRuntime.jsxs(framerMotion.motion.div,{"data-task-row":_.id,className:`flex items-center cursor-pointer group ${q===_.id?"opacity-50":""}`,style:{position:"relative",height:`${a}px`,borderLeft:Ye?`3px solid ${t.accent}`:"3px solid transparent",backgroundColor:Ye?t.accentLight:We?`${t.accent}15`:se%2===0?t.bgPrimary:t.bgGrid,...Mt},onMouseEnter:()=>T(_.id),onMouseLeave:()=>T(null),onClick:pt=>{let wa=Bo(e).map(O=>O.id),P=navigator.platform.toUpperCase().indexOf("MAC")>=0?pt.metaKey:pt.ctrlKey;Re(_.id,wa,P,pt.shiftKey),s?.(_);},onDoubleClick:pt=>{pt.stopPropagation(),n?.(_);},onContextMenu:pt=>{pt.preventDefault(),V({isOpen:true,x:pt.clientX,y:pt.clientY,type:"task",task:_}),c?.(_,pt);},whileHover:{backgroundColor:Ye?t.accentLight:t.hoverBg},children:[H&&jsxRuntime.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),ie&&jsxRuntime.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:"2px",backgroundColor:t.accent,zIndex:10}}),$e.map((pt,Ar)=>{let wa=Ar===$e.length-1,ta=pt.id==="name";return jsxRuntime.jsx("div",{className:`px-4 flex items-center ${ta?"justify-start":"justify-center"}`,style:{width:`${pt.width}px`,minWidth:`${pt.minWidth??(ta?200:60)}px`,maxWidth:`${pt.maxWidth??2e3}px`,flexShrink:0,flexGrow:0,borderRight:wa?"none":`1px solid ${A===_.id?t.border:t.borderLight}`,height:"100%",boxSizing:"border-box",overflow:"hidden"},children:Te(pt,_,ta?Y:0)},`${_.id}-${pt.id}`)})]},_.id)})}),jsxRuntime.jsx(Io,{isOpen:L.isOpen,x:L.x,y:L.y,items:L.type==="header"&&L.columnId?we(L.columnId):L.type==="task"&&L.task?Oe(L.task):[],onClose:()=>V({...L,isOpen:false}),theme:t}),vt&&ct&&q&&typeof document<"u"&&reactDom.createPortal(jsxRuntime.jsx("div",{style:{position:"fixed",left:ct.x+12,top:ct.y-10,zIndex:99999,pointerEvents:"none"},children:(()=>{let _=Le.find(Y=>Y.task.id===q)?.task;return _?jsxRuntime.jsx("div",{className:"flex items-center gap-2 px-2 py-1 rounded",style:{backgroundColor:"rgba(255, 255, 255, 0.08)",backdropFilter:"blur(4px)"},children:jsxRuntime.jsx("span",{className:"text-xs font-medium",style:{color:t.textSecondary,opacity:.9},children:_.name})}):null})()}),document.body)]})}function Zc(e,t){let[a,r]=react.useState("none"),[o,s]=react.useState(0),[n,c]=react.useState(e),[g,i]=react.useState(t),[p,l]=react.useState(null),[f,y]=react.useState(null),[k,C]=react.useState(null),[h,b]=react.useState(null),[u,x]=react.useState(0),[m,N]=react.useState(0),[w,B]=react.useState(null),[v,I]=react.useState(false);return {dragMode:a,setDragMode:r,dragOffset:o,setDragOffset:s,ghostX:n,setGhostX:c,ghostWidth:g,setGhostWidth:i,connectionLine:p,setConnectionLine:l,hoveredTaskId:f,setHoveredTaskId:y,activeZone:k,setActiveZone:C,draggedSegmentIndex:h,setDraggedSegmentIndex:b,draggedSegmentStartX:u,setDraggedSegmentStartX:x,segmentDragOffsetX:m,setSegmentDragOffsetX:N,hoveredSegmentIndex:w,setHoveredSegmentIndex:B,isHovered:v,setIsHovered:I,isDragging:a!=="none",isResizing:a==="resize-start"||a==="resize-end",isConnecting:a==="connect",resetDragState:(j,te)=>{r("none"),l(null),y(null),c(j),i(te),N(0),b(null),x(0);}}}function qn({task:e,x:t,y:a,width:r,theme:o,dayWidth:s,startDate:n,templates:c,onClick:g,onDoubleClick:i,onContextMenu:p,onDateChange:l,onDependencyCreate:f,allTaskPositions:y=[],onDragMove:k,onHoverChange:C}){let h=Zc(t,r),b=react.useRef(null),u=react.useRef(null),x=react.useRef(null),{dragMode:m,setDragMode:N,dragOffset:w,setDragOffset:B,ghostX:v,setGhostX:I,ghostWidth:A,setGhostWidth:T,connectionLine:W,setConnectionLine:$,hoveredTaskId:j,setHoveredTaskId:te,activeZone:oe,setActiveZone:re,draggedSegmentIndex:ge,setDraggedSegmentIndex:fe,draggedSegmentStartX:Ie,setDraggedSegmentStartX:M,segmentDragOffsetX:R,setSegmentDragOffsetX:L,hoveredSegmentIndex:V,setHoveredSegmentIndex:q,isHovered:z,setIsHovered:ye,isDragging:ne,isResizing:Be,isConnecting:qe,resetDragState:tt}=h,le=32,Je=8,ct=e.endDate&&e.endDate<new Date&&e.progress<100,wt=e.isCriticalPath,vt=o.name==="neutral"||o.today==="#1C1917",U=e.status==="completed"||e.progress===100,me={low:"#2ECC71",LOW:"#2ECC71",medium:"#F1C40F",MEDIUM:"#F1C40F",high:"#E67E22",HIGH:"#E67E22",urgent:"#E74C3C",URGENT:"#E74C3C"},Fe=e.isCriticalPath||ct?"#DC2626":e.color?e.color:e.priority&&me[e.priority]?me[e.priority]:o.taskBarPrimary,Qe=(Z=>Z>=80?20:Z>=60?15:Z>=50?12:10)(r),Pt=r<50,Re=r<40;react.useEffect(()=>{if(C)if(z&&!ne&&!e.segments){let Z=a<100;C({task:e,x:t,y:a,width:r,height:le,showBelow:Z});}else C(null);},[z,ne,e,t,a,r,le,C]);let J=Z=>Z.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),ve=()=>{let Z=Math.ceil((e.endDate.getTime()-e.startDate.getTime())/864e5);return `${Z} day${Z!==1?"s":""}`},He=Z=>Math.round(Z/s)*s,Le=Z=>{let Te=Math.round(Z/s),we=new Date(n);return we.setDate(we.getDate()+Te),we},nt=(Z,Te)=>{for(let we of y){if(we.id===e.id)continue;let Oe=5;if(Z>=we.x-Oe&&Z<=we.x+we.width+Oe&&Te>=we.y-Oe&&Te<=we.y+we.height+Oe)return we.id}return null},st=react.useCallback((Z,Te,we)=>{Z.preventDefault(),Z.stopPropagation();let Oe=b.current?.ownerSVGElement;if(!Oe)return;let $e=Oe.createSVGPoint();$e.x=Z.clientX,$e.y=Z.clientY;let dt=$e.matrixTransform(Oe.getScreenCTM()?.inverse()),_=we!==void 0?we:t,Y=Te;if(!Y){let se=dt.x-_;Z.shiftKey?(Y="connect",$({x:t+r,y:a+le/2})):Z.ctrlKey||Z.metaKey?Y="move":Z.altKey?Y=se<r/2?"resize-start":"resize-end":Re?se<r/2?Y="move":Y="resize-end":Pt?se<=Qe/2?Y="resize-start":se>=r-Qe/2?Y="resize-end":Y="move":se<=Qe?Y="resize-start":se>=r-Qe?Y="resize-end":Y="move";}N(Y),ye(false),re(null),Y==="move"?B(dt.x-_):Y==="connect"?$({x:t+r,y:a+le/2}):B(0),I(_),T(r);},[t,r,a,le]),_e=react.useCallback(Z=>{let Te=b.current?.ownerSVGElement;if(!Te)return;let we=Te.closest(".gantt-timeline-scroll");if(!we)return;let Oe=we.getBoundingClientRect(),$e=60,dt=15,_=0;if(Z.clientX<Oe.left+$e){let Y=Oe.left+$e-Z.clientX;_=-Math.min(dt,Y/2);}else if(Z.clientX>Oe.right-$e){let Y=Z.clientX-(Oe.right-$e);_=Math.min(dt,Y/2);}return _!==0&&(we.scrollLeft+=_),_!==0},[]),ea=react.useCallback(Z=>{if(m==="none")return;x.current=Z;let Te=b.current?.ownerSVGElement;if(!Te)return;if(m==="move"||m==="resize-start"||m==="resize-end"){let $e=_e(Z);$e&&!u.current?u.current=window.setInterval(()=>{x.current&&(_e(x.current),ea(x.current));},16):!$e&&u.current&&(window.clearInterval(u.current),u.current=null);}let we=Te.createSVGPoint();we.x=Z.clientX,we.y=Z.clientY;let Oe=we.matrixTransform(Te.getScreenCTM()?.inverse());if(m==="connect"){$({x:Oe.x,y:Oe.y});let $e=nt(Oe.x,Oe.y);te($e);}else if(m==="move"){let $e=Oe.x-w,dt=He($e);I(dt),T(r);let _=Math.round((dt-t)/s);if(k?.(e.id,_,true),e.segments&&e.segments.length>0&&ge!==null){let Y=dt-Ie;L(Y);}}else if(m==="resize-start"){let $e=Oe.x,dt=He($e),_=t+r-dt;_>=s&&(I(dt),T(_));}else if(m==="resize-end"){let $e=Oe.x,_=He($e)-t;_>=s&&T(_);}},[m,t,r,s,w,e,He,ge,Ie,nt,te,$,I,T,L,k,_e]),ke=react.useCallback(()=>{if(u.current&&(window.clearInterval(u.current),u.current=null),x.current=null,m!=="none"){if(m==="connect")j&&f&&f(e,j),$(null),te(null);else {let Z=e.endDate.getTime()-e.startDate.getTime(),Te,we,Oe=true;if(m==="move"){if(Te=Le(v),we=new Date(Te.getTime()+Z),e.segments&&e.segments.length>0&&ge!==null){let $e=Math.round(R/s),dt=e.segments.map((Ye,Ue)=>{if(Ue===ge){let H=new Date(Ye.startDate),ie=new Date(Ye.endDate);return H.setDate(H.getDate()+$e),ie.setDate(ie.getDate()+$e),{startDate:H,endDate:ie}}return Ye}),_=dt.flatMap(Ye=>[Ye.startDate,Ye.endDate]),Y=new Date(Math.min(..._.map(Ye=>Ye.getTime()))),se=new Date(Math.max(..._.map(Ye=>Ye.getTime())));l?.({...e,segments:dt},Y,se),tt(t,r);return}}else m==="resize-start"?(Te=Le(v),we=e.endDate,Te>we&&(console.warn("Invalid date range: start date must be before or equal to end date"),Oe=false)):m==="resize-end"?(Te=e.startDate,we=Le(v+A),we<Te&&(console.warn("Invalid date range: end date must be after or equal to start date"),Oe=false)):Oe=false;Oe&&Te&&we&&(we.getTime()<Te.getTime()?console.warn("Invalid date range: end date cannot be before start date"):l?.(e,Te,we));}k?.(e.id,0,false),tt(t,r);}},[m,v,A,e,l,j,f,t,r,s,Le,R,ge,tt,k]);react.useEffect(()=>{if(m==="none")return;let Z=we=>{ea(we);},Te=()=>{ke();};return window.addEventListener("mousemove",Z),window.addEventListener("mouseup",Te),()=>{window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",Te),u.current&&(window.clearInterval(u.current),u.current=null);}},[m,ea,ke]);let be=ne&&!qe?v:t,Ke=ne&&!qe?A:r,F=c.taskClass(e);return jsxRuntime.jsxs("g",{ref:b,"data-task-bar":"true",onClick:()=>!ne&&g?.(e),onDoubleClick:Z=>{ne||(Z.stopPropagation(),i?.(e));},onContextMenu:Z=>{Z.preventDefault(),p?.(e,Z);},onMouseEnter:()=>!ne&&ye(true),onMouseLeave:()=>{ne||(ye(false),re(null));},children:[jsxRuntime.jsx("rect",{x:t,y:a,width:r+24,height:le,fill:"transparent",style:{pointerEvents:"all"}}),z&&!ne&&!Pt&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:Qe,height:le,fill:oe==="resize-start"?o.accent:"transparent",opacity:oe==="resize-start"?.15:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>re("resize-start"),onMouseDown:Z=>st(Z,"resize-start")}),jsxRuntime.jsx("rect",{x:t+Qe,y:a,width:r-Qe*2,height:le,fill:oe==="move"?o.accent:"transparent",opacity:oe==="move"?.1:0,style:{cursor:"grab",pointerEvents:"all"},onMouseEnter:()=>re("move"),onMouseDown:Z=>st(Z,"move")}),jsxRuntime.jsx("rect",{x:t+r-Qe,y:a,width:Qe,height:le,fill:oe==="resize-end"?o.accent:"transparent",opacity:oe==="resize-end"?.15:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>re("resize-end"),onMouseDown:Z=>st(Z,"resize-end")})]}),z&&!ne&&Re&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:t,y:a,width:r/2,height:le,fill:oe==="move"?o.accent:"transparent",opacity:oe==="move"?.2:0,style:{cursor:"grab",pointerEvents:"all"},onMouseEnter:()=>re("move"),onMouseDown:Z=>st(Z,"move")}),jsxRuntime.jsx("rect",{x:t+r/2,y:a,width:r/2,height:le,fill:oe==="resize-end"?o.accent:"transparent",opacity:oe==="resize-end"?.2:0,style:{cursor:"ew-resize",pointerEvents:"all"},onMouseEnter:()=>re("resize-end"),onMouseDown:Z=>st(Z,"resize-end")}),z&&jsxRuntime.jsx(framerMotion.motion.line,{x1:t+r/2,y1:a+4,x2:t+r/2,y2:a+le-4,stroke:o.textTertiary,strokeWidth:1,strokeDasharray:"2 2",opacity:.3,initial:{opacity:0},animate:{opacity:.3},transition:{duration:.2},style:{pointerEvents:"none"}})]}),ne&&!qe&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:v,y:a,width:A,height:le,rx:Je,fill:o.accent,opacity:.5,stroke:o.accent,strokeWidth:2,strokeDasharray:"4 4",initial:{opacity:0},animate:{opacity:.6},transition:{duration:.15},style:{pointerEvents:"none"}}),!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:be,y:a,width:Ke,height:le,rx:Je,fill:Fe,"data-task-class":F,initial:{opacity:0,scale:.95},animate:{opacity:ne&&!qe?.15:e.parentId?.6:z?.9:.8,scale:z&&!ne?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:Z=>st(Z),style:{cursor:ne?qe?"crosshair":Be?"ew-resize":"grabbing":"grab",pointerEvents:"all"}}),!e.segments&&jsxRuntime.jsx("rect",{x:be,y:a,width:Ke*(e.progress/100),height:le,rx:Je,fill:Fe,opacity:1,style:{pointerEvents:"none"}}),e.segments&&e.segments.map((Z,Te)=>{let we=(Z.startDate.getTime()-n.getTime())/864e5*s,$e=(Z.endDate.getTime()-n.getTime())/(1e3*60*60*24)*s-we+s,dt=ne&&m==="move"&&ge===Te,_=V===Te,Y=dt?we+R:we;return jsxRuntime.jsxs("g",{onMouseEnter:()=>!ne&&q(Te),onMouseLeave:()=>!ne&&q(null),children:[jsxRuntime.jsx(framerMotion.motion.rect,{x:Y,y:a,width:$e,height:le,rx:Je,fill:Fe,initial:{opacity:0,scale:.95},animate:{opacity:dt||e.parentId?.6:_?.9:.8,scale:_&&!ne?1.02:1},transition:{duration:.2,ease:[.4,0,.2,1]},onMouseDown:se=>{se.stopPropagation(),fe(Te),M(we),st(se,void 0,we);},style:{cursor:ne?qe?"crosshair":Be?"ew-resize":"grabbing":"grab",pointerEvents:"all"}}),jsxRuntime.jsx("rect",{x:Y,y:a,width:$e*(e.progress/100),height:le,rx:Je,fill:Fe,opacity:1,style:{pointerEvents:"none"}})]},`segment-${Te}`)}),vt&&(ct||wt)&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[wt&&!ct&&jsxRuntime.jsx("rect",{x:be,y:a,width:Ke,height:le,rx:Je,fill:"none",stroke:o.border,strokeWidth:2,strokeDasharray:"4 4",opacity:.8,style:{pointerEvents:"none"}}),ct&&jsxRuntime.jsx("rect",{x:be,y:a,width:Ke,height:le,rx:Je,fill:"url(#diagonal-stripes)",opacity:.3,style:{pointerEvents:"none"}})]}),Ke>60&&!e.segments&&(()=>{let Z=c.taskLabel(e),Te=typeof Z=="string"?Z:e.name,we=Te.length>Math.floor(Ke/8)?`${Te.substring(0,Math.floor(Ke/8))}...`:Te;return jsxRuntime.jsx("text",{x:be+12,y:a+le/2,dominantBaseline:"middle",fill:U?"rgba(255, 255, 255, 0.6)":"#FFFFFF",fontSize:"13",fontWeight:"500",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none",textDecoration:U?"line-through":"none"},children:we})})(),Ke>100&&e.progress>0&&e.progress<100&&!ne&&!e.segments&&jsxRuntime.jsxs("text",{x:be+Ke-12,y:a+le/2,dominantBaseline:"middle",textAnchor:"end",fill:"rgba(255, 255, 255, 0.9)",fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",style:{pointerEvents:"none",userSelect:"none"},children:[e.progress,"%"]}),e.status&&Ke>80&&!ne&&!e.segments&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[e.status==="completed"&&jsxRuntime.jsx("circle",{cx:be+Ke-8,cy:a+8,r:4,fill:o.statusCompleted,stroke:"#FFFFFF",strokeWidth:1.5}),e.status==="in-progress"&&jsxRuntime.jsx("circle",{cx:be+Ke-8,cy:a+8,r:4,fill:o.statusInProgress,stroke:"#FFFFFF",strokeWidth:1.5,opacity:.8})]}),(z||Be)&&!qe&&!e.segments&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:be-2,y:a,width:16,height:le,fill:"transparent",style:{cursor:"ew-resize"},onMouseEnter:()=>re("resize-start"),onMouseLeave:()=>re(null),onMouseDown:Z=>{Z.stopPropagation(),st(Z,"resize-start");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:be+4,y:a+8,width:3,height:le-16,rx:1.5,fill:oe==="resize-start"||m==="resize-start"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]}),jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:be+Ke-14,y:a,width:16,height:le,fill:"transparent",style:{cursor:"ew-resize"},onMouseEnter:()=>re("resize-end"),onMouseLeave:()=>re(null),onMouseDown:Z=>{Z.stopPropagation(),st(Z,"resize-end");}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:be+Ke-7,y:a+8,width:3,height:le-16,rx:1.5,fill:oe==="resize-end"||m==="resize-end"?"#ffffff":"rgba(255,255,255,0.5)",style:{pointerEvents:"none"},initial:{opacity:0},animate:{opacity:1},transition:{duration:.15}})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:z&&!ne&&!e.segments&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},children:[jsxRuntime.jsx("circle",{cx:t+r+10,cy:a+le/2,r:10,fill:"transparent",style:{cursor:"crosshair"},onMouseEnter:()=>re("connect"),onMouseLeave:()=>re(null),onMouseDown:Z=>{Z.stopPropagation(),st(Z,"connect");}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:t+r+10,cy:a+le/2,r:4,fill:o.accent,stroke:"#FFFFFF",strokeWidth:1.5,style:{pointerEvents:"none"},initial:{scale:0},animate:{scale:oe==="connect"?1.4:1},exit:{scale:0},transition:{duration:.15,type:"spring",stiffness:500,damping:30}})]})}),qe&&W&&jsxRuntime.jsxs("g",{style:{pointerEvents:"none"},children:[jsxRuntime.jsx(framerMotion.motion.line,{x1:t+r,y1:a+le/2,x2:W.x,y2:W.y,stroke:j?o.statusCompleted:o.accent,strokeWidth:j?3:2,strokeDasharray:"6 4",initial:{opacity:0},animate:{opacity:j?1:.8},transition:{duration:.15}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:W.x,cy:W.y,r:j?8:6,fill:j?o.statusCompleted:o.accent,stroke:"#FFFFFF",strokeWidth:2,initial:{scale:0},animate:{scale:1},transition:{duration:.15}}),j&&jsxRuntime.jsx(framerMotion.motion.text,{x:W.x+15,y:W.y,dominantBaseline:"middle",fill:o.statusCompleted,fontSize:"11",fontWeight:"600",fontFamily:"Inter, sans-serif",initial:{opacity:0,x:W.x+10},animate:{opacity:1,x:W.x+15},transition:{duration:.2},children:"Connect"})]}),(z||ne)&&!qe&&!e.segments&&jsxRuntime.jsx(framerMotion.motion.rect,{x:be-2,y:a-2,width:Ke+4,height:le+4,rx:Je+2,fill:"none",stroke:ne?o.accent:o.taskBarPrimary,strokeWidth:2,opacity:ne?.6:.4,initial:{opacity:0},animate:{opacity:ne?.6:.4},transition:{duration:.2},style:{pointerEvents:"none"}}),Be&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("line",{x1:v,y1:0,x2:v,y2:1e3,stroke:o.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}}),jsxRuntime.jsx("line",{x1:v+A,y1:0,x2:v+A,y2:1e3,stroke:o.accent,strokeWidth:1,strokeDasharray:"4 4",opacity:.3,style:{pointerEvents:"none"}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:z&&!ne&&!e.segments&&!C&&(()=>{let we=a<100,Oe=we?a+le+13:a-82-13,$e=we?`M ${be+Ke/2-6} ${a+le+3} L ${be+Ke/2} ${a+le+13} L ${be+Ke/2+6} ${a+le+3}`:`M ${be+Ke/2-6} ${a-13} L ${be+Ke/2} ${a-3} L ${be+Ke/2+6} ${a-13}`,dt=Oe+22,_=Oe+40,Y=Oe+55,se=Oe+70,Ye=we?Oe+82-5:a-18;return jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:we?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:we?-10:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsxRuntime.jsx("path",{d:$e,fill:o.bgSecondary,stroke:o.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:be+Ke/2-120,y:Oe,width:240,height:82,rx:8,fill:o.bgSecondary,stroke:o.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("text",{x:be+Ke/2,y:dt,textAnchor:"middle",fill:o.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>28?`${e.name.substring(0,28)}...`:e.name}),jsxRuntime.jsx("text",{x:be+Ke/2-110,y:_,fill:o.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Start:"}),jsxRuntime.jsx("text",{x:be+Ke/2-70,y:_,fill:o.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:J(e.startDate)}),jsxRuntime.jsx("text",{x:be+Ke/2-110,y:Y,fill:o.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"End:"}),jsxRuntime.jsx("text",{x:be+Ke/2-70,y:Y,fill:o.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:J(e.endDate)}),jsxRuntime.jsx("text",{x:be+Ke/2+10,y:_,fill:o.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Duration:"}),jsxRuntime.jsx("text",{x:be+Ke/2+65,y:_,fill:o.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:ve()}),jsxRuntime.jsx("text",{x:be+Ke/2+10,y:Y,fill:o.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Progress:"}),jsxRuntime.jsxs("text",{x:be+Ke/2+65,y:Y,fill:o.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.progress,"%"]}),e.assignees&&e.assignees.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("text",{x:be+Ke/2-110,y:se,fill:o.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Assignees:"}),jsxRuntime.jsxs("text",{x:be+Ke/2-50,y:se,fill:o.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[e.assignees.map(Ue=>Ue.name).join(", ").substring(0,30),e.assignees.map(Ue=>Ue.name).join(", ").length>30?"...":""]})]}),!we&&jsxRuntime.jsx("text",{x:be+Ke/2,y:Ye,textAnchor:"middle",fill:o.textTertiary,fontSize:"9",fontFamily:"Inter, sans-serif",style:{opacity:.7},children:Re?"Left: move \u2022 Right: resize":Pt?"Drag to move \u2022 Hold ALT + drag edge to resize":"Drag edges to resize \u2022 Drag center to move \u2022 Click \u26AB to link"})]})})()})]})}function tm({tooltipData:e,theme:t}){if(!e)return null;let {task:a,x:r,y:o,width:s,height:n,showBelow:c}=e,g=82,i=13,p=c?o+n+i:o-g-i,l=c?`M ${r+s/2-6} ${o+n+3} L ${r+s/2} ${o+n+13} L ${r+s/2+6} ${o+n+3}`:`M ${r+s/2-6} ${o-13} L ${r+s/2} ${o-3} L ${r+s/2+6} ${o-13}`,f=p+22,y=p+40,k=p+55,C=p+70,h=m=>m.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),b=()=>{if(!a.startDate||!a.endDate)return "N/A";let m=Math.ceil((a.endDate.getTime()-a.startDate.getTime())/(1e3*60*60*24));return `${m} day${m!==1?"s":""}`};return jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:c?-10:10},animate:{opacity:1,y:0},exit:{opacity:0,y:c?-10:10},transition:{duration:.2},style:{pointerEvents:"none"},children:[jsxRuntime.jsx("path",{d:l,fill:t.bgSecondary,stroke:t.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:r+s/2-120,y:p,width:240,height:g,rx:8,fill:t.bgSecondary,stroke:t.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("text",{x:r+s/2,y:f,textAnchor:"middle",fill:t.textPrimary,fontSize:"13",fontWeight:"600",fontFamily:"Inter, sans-serif",children:a.name.length>28?`${a.name.substring(0,28)}...`:a.name}),jsxRuntime.jsx("text",{x:r+s/2-110,y,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Start:"}),jsxRuntime.jsx("text",{x:r+s/2-70,y,fill:t.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:a.startDate?h(a.startDate):"N/A"}),jsxRuntime.jsx("text",{x:r+s/2-110,y:k,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"End:"}),jsxRuntime.jsx("text",{x:r+s/2-70,y:k,fill:t.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:a.endDate?h(a.endDate):"N/A"}),jsxRuntime.jsx("text",{x:r+s/2+10,y,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Duration:"}),jsxRuntime.jsx("text",{x:r+s/2+65,y,fill:t.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:b()}),jsxRuntime.jsx("text",{x:r+s/2+10,y:k,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Progress:"}),jsxRuntime.jsxs("text",{x:r+s/2+65,y:k,fill:t.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[a.progress,"%"]}),a.assignees&&a.assignees.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("text",{x:r+s/2-110,y:C,fill:t.textTertiary,fontSize:"11",fontFamily:"Inter, sans-serif",children:"Assignees:"}),jsxRuntime.jsxs("text",{x:r+s/2-50,y:C,fill:t.textSecondary,fontSize:"11",fontWeight:"500",fontFamily:"Inter, sans-serif",children:[a.assignees.map(m=>m.name).join(", ").substring(0,30),a.assignees.map(m=>m.name).join(", ").length>30?"...":""]})]})]})})}function Zn({x1:e,y1:t,x2:a,y2:r,theme:o,onDelete:s,lineStyle:n="curved",isHoverLayer:c=false}){let[g,i]=react.useState(false),[p,l]=react.useState(null),f=r-t,y=f>0,k=Math.abs(f)<5,h=5,b=20,u=!k&&a<=e,x,m;if(k)if(m=(e+a)/2,n==="squared")x=`M ${e} ${t} L ${a} ${r}`;else {let oe=Math.min(Math.abs(a-e)/3,30);x=`M ${e} ${t} C ${e+oe} ${t}, ${a-oe} ${r}, ${a} ${r}`;}else if(m=a-b,u){let re=e+15,ge=a-b,fe=y?t+20:t-20;m=ge,n==="squared"?x=`M ${e} ${t} L ${re} ${t} L ${re} ${fe} L ${ge} ${fe} L ${ge} ${r} L ${a} ${r}`:y?x=`M ${e} ${t} L ${re-h} ${t} Q ${re} ${t} ${re} ${t+h} L ${re} ${fe-h} Q ${re} ${fe} ${re-h} ${fe} L ${ge+h} ${fe} Q ${ge} ${fe} ${ge} ${fe+h} L ${ge} ${r-h} Q ${ge} ${r} ${ge+h} ${r} L ${a} ${r}`:x=`M ${e} ${t} L ${re-h} ${t} Q ${re} ${t} ${re} ${t-h} L ${re} ${fe+h} Q ${re} ${fe} ${re-h} ${fe} L ${ge+h} ${fe} Q ${ge} ${fe} ${ge} ${fe-h} L ${ge} ${r+h} Q ${ge} ${r} ${ge+h} ${r} L ${a} ${r}`;}else n==="squared"?x=`M ${e} ${t} L ${m} ${t} L ${m} ${r} L ${a} ${r}`:y?x=`M ${e} ${t} L ${m-h} ${t} Q ${m} ${t} ${m} ${t+h} L ${m} ${r-h} Q ${m} ${r} ${m+h} ${r} L ${a} ${r}`:x=`M ${e} ${t} L ${m-h} ${t} Q ${m} ${t} ${m} ${t-h} L ${m} ${r+h} Q ${m} ${r} ${m+h} ${r} L ${a} ${r}`;let N=5,w=`M ${a} ${r} L ${a-N} ${r-N*.5} M ${a} ${r} L ${a-N} ${r+N*.5}`,B=o.dependency,v=o.dependencyHover||B,I="#f87171",A="rgba(248, 113, 113, 0.15)",T=m,W=(t+r)/2;if(p)if(k)T=Math.max(e+10,Math.min(a-10,p.x)),W=t;else if(u){let oe=e+15,re=a-b,ge=y?t+20:t-20,fe=[[e,t,oe,t],[oe,t,oe,ge],[oe,ge,re,ge],[re,ge,re,r],[re,r,a,r]],Ie=1/0,M={x:T,y:W};for(let R of fe){let L=$(p.x,p.y,R[0],R[1],R[2],R[3]),V=Math.hypot(p.x-L.x,p.y-L.y);V<Ie&&(Ie=V,M=L);}T=M.x,W=M.y;}else {let oe=[[e,t,m,t],[m,t,m,r],[m,r,a,r]],re=1/0,ge={x:T,y:W};for(let fe of oe){let Ie=$(p.x,p.y,fe[0],fe[1],fe[2],fe[3]),M=Math.hypot(p.x-Ie.x,p.y-Ie.y);M<re&&(re=M,ge=Ie);}T=ge.x,W=ge.y;}function $(oe,re,ge,fe,Ie,M){let R=Ie-ge,L=M-fe,V=R*R+L*L;if(V===0)return {x:ge,y:fe};let q=((oe-ge)*R+(re-fe)*L)/V;return q=Math.max(0,Math.min(1,q)),{x:ge+q*R,y:fe+q*L}}let j=oe=>{let re=oe.currentTarget.ownerSVGElement;if(!re)return;let ge=re.getBoundingClientRect();l({x:oe.clientX-ge.left,y:oe.clientY-ge.top});},te=()=>{i(false),l(null);};return c?jsxRuntime.jsxs("g",{"data-dependency-line":"true",onMouseLeave:te,onMouseMove:j,children:[jsxRuntime.jsx("path",{d:x,fill:"none",stroke:"transparent",strokeWidth:20,strokeLinecap:"round",style:{cursor:"pointer"}}),jsxRuntime.jsx("path",{d:x,fill:"none",stroke:v,strokeWidth:8,strokeLinecap:"round",opacity:.15,style:{pointerEvents:"none",filter:"blur(4px)"}}),jsxRuntime.jsx("path",{d:x,fill:"none",stroke:v,strokeWidth:2.5,strokeLinecap:"round",opacity:.9,style:{pointerEvents:"none"}}),jsxRuntime.jsx("path",{d:w,fill:"none",stroke:v,strokeWidth:2.5,strokeLinecap:"round",opacity:.9,style:{pointerEvents:"none"}}),jsxRuntime.jsx("circle",{cx:a,cy:r,r:4,fill:v,opacity:.9,style:{pointerEvents:"none"}}),s&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.15,ease:"easeOut"},onClick:oe=>{oe.stopPropagation(),s();},style:{cursor:"pointer"},children:[jsxRuntime.jsx("circle",{cx:T,cy:W,r:9,fill:A,stroke:I,strokeWidth:1.5}),jsxRuntime.jsx("line",{x1:T-3,y1:W-3,x2:T+3,y2:W+3,stroke:I,strokeWidth:1.5,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:T+3,y1:W-3,x2:T-3,y2:W+3,stroke:I,strokeWidth:1.5,strokeLinecap:"round"})]})]}):jsxRuntime.jsxs("g",{"data-dependency-line":"true",onMouseEnter:()=>i(true),onMouseLeave:te,onMouseMove:j,style:{cursor:s?"pointer":"default"},children:[jsxRuntime.jsx("path",{d:x,fill:"none",stroke:"transparent",strokeWidth:16,strokeLinecap:"round",style:{cursor:s?"pointer":"default"}}),jsxRuntime.jsx(framerMotion.motion.path,{d:x,fill:"none",stroke:g?v:B,strokeWidth:g?2.5:2,strokeLinecap:"round",initial:{pathLength:0,opacity:0},animate:{pathLength:1,opacity:1},transition:{pathLength:{duration:.5,ease:"easeInOut"},opacity:{duration:.2}}}),jsxRuntime.jsx(framerMotion.motion.path,{d:w,fill:"none",stroke:g?v:B,strokeWidth:g?2.5:2,strokeLinecap:"round",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2,delay:.3}}),jsxRuntime.jsx(framerMotion.motion.circle,{cx:a,cy:r,r:g?4:3,fill:g?v:B,initial:{scale:0},animate:{scale:1},transition:{delay:.3,duration:.15}}),g&&s&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,scale:0},animate:{opacity:1,scale:1},transition:{duration:.15},onClick:oe=>{oe.stopPropagation(),s();},style:{cursor:"pointer"},children:[jsxRuntime.jsx("circle",{cx:T,cy:W,r:9,fill:A,stroke:I,strokeWidth:1.5}),jsxRuntime.jsx("line",{x1:T-3,y1:W-3,x2:T+3,y2:W+3,stroke:I,strokeWidth:1.5,strokeLinecap:"round"}),jsxRuntime.jsx("line",{x1:T+3,y1:W-3,x2:T-3,y2:W+3,stroke:I,strokeWidth:1.5,strokeLinecap:"round"})]})]})}function es({task:e,x:t,y:a,theme:r,onClick:o}){let[s,n]=react.useState(false),c=16,g=i=>i.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return jsxRuntime.jsxs("g",{"data-task-bar":"true",onMouseEnter:()=>n(true),onMouseLeave:()=>n(false),onClick:()=>o?.(e),style:{cursor:"pointer"},children:[e.isCriticalPath&&jsxRuntime.jsx(framerMotion.motion.circle,{cx:t,cy:a+16,r:c+4,fill:r.criticalPathLight,initial:{scale:0},animate:{scale:s?1.2:1},transition:{duration:.3}}),jsxRuntime.jsx(framerMotion.motion.rect,{x:t-c/2,y:a+16-c/2,width:c,height:c,fill:e.isCriticalPath?r.criticalPath:r.milestone,stroke:r.bgGrid,strokeWidth:2,transform:`rotate(45 ${t} ${a+16})`,initial:{scale:0,rotate:0},animate:{scale:s?1.15:1,rotate:45},transition:{duration:.3,type:"spring",stiffness:300,damping:20}}),s&&jsxRuntime.jsx(framerMotion.motion.rect,{x:t-(c+4)/2,y:a+16-(c+4)/2,width:c+4,height:c+4,fill:"none",stroke:e.isCriticalPath?r.criticalPath:r.milestone,strokeWidth:2,opacity:.5,transform:`rotate(45 ${t} ${a+16})`,initial:{scale:.8,opacity:0},animate:{scale:1,opacity:.5},transition:{duration:.2}}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:s&&jsxRuntime.jsxs(framerMotion.motion.g,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},children:[jsxRuntime.jsx("rect",{x:t-80,y:a-50,width:160,height:44,rx:8,fill:r.bgSecondary,stroke:r.border,strokeWidth:1,filter:"drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15))"}),jsxRuntime.jsx("path",{d:`M ${t-6} ${a-6} L ${t} ${a+4} L ${t+6} ${a-6}`,fill:r.bgSecondary,stroke:r.border,strokeWidth:1}),jsxRuntime.jsx("rect",{x:t-70,y:a-38,width:8,height:8,fill:e.isCriticalPath?r.criticalPath:r.milestone,transform:`rotate(45 ${t-66} ${a-34})`}),jsxRuntime.jsx("text",{x:t-55,y:a-32,fill:r.textPrimary,fontSize:"12",fontWeight:"600",fontFamily:"Inter, sans-serif",children:e.name.length>18?`${e.name.substring(0,18)}...`:e.name}),jsxRuntime.jsx("text",{x:t-55,y:a-18,fill:r.textTertiary,fontSize:"10",fontFamily:"Inter, sans-serif",children:g(e.startDate)}),e.isCriticalPath&&jsxRuntime.jsxs("g",{children:[jsxRuntime.jsx("rect",{x:t+10,y:a-40,width:60,height:16,rx:4,fill:r.criticalPathLight}),jsxRuntime.jsx("text",{x:t+40,y:a-30,textAnchor:"middle",fill:r.criticalPath,fontSize:"9",fontWeight:"700",fontFamily:"Inter, sans-serif",letterSpacing:"0.5",children:"CRITICAL"})]})]})})]})}var he={calculateEndDate:(e,t)=>{let a=new Date(e);return a.setDate(a.getDate()+t),a},calculateDuration:(e,t)=>{let a=t.getTime()-e.getTime();return Math.ceil(a/(1e3*60*60*24))},calculateWorkingDays:(e,t)=>{let a=0,r=new Date(e);for(;r<=t;){let o=r.getDay();o!==0&&o!==6&&a++,r.setDate(r.getDate()+1);}return a},addWorkingDays:(e,t)=>{let a=new Date(e),r=0;for(;r<t;){a.setDate(a.getDate()+1);let o=a.getDay();o!==0&&o!==6&&r++;}return a},isWeekend:e=>{let t=e.getDay();return t===0||t===6},validateDependencies:(e,t,a)=>{let r=new Map,o=i=>{i.forEach(p=>{p.dependencies&&r.set(p.id,p.dependencies),p.subtasks&&o(p.subtasks);});};o(e);let s=r.get(a)||[];r.set(a,[...s,t]);let n=new Set,c=new Set,g=i=>{if(!n.has(i)){n.add(i),c.add(i);let p=r.get(i)||[];for(let l of p){if(!n.has(l)&&g(l))return true;if(c.has(l))return true}}return c.delete(i),false};return g(a)},flattenTasks:e=>{let t=[],a=r=>{r.forEach(o=>{t.push(o),o.subtasks&&o.subtasks.length>0&&a(o.subtasks);});};return a(e),t},findTaskById:(e,t)=>{for(let a of e){if(a.id===t)return a;if(a.subtasks){let r=he.findTaskById(a.subtasks,t);if(r)return r}}},getParentTasks:(e,t)=>{let a=[],r=he.findTaskById(e,t);if(!r||!r.parentId)return a;let o=r.parentId;for(;o;){let s=he.findTaskById(e,o);if(s)a.unshift(s),o=s.parentId;else break}return a},exportToJSON:e=>JSON.stringify(e,null,2),importFromJSON:e=>{try{let t=JSON.parse(e);if(!Array.isArray(t))throw new Error("Invalid JSON: expected an array of tasks");return t.forEach((a,r)=>{if(!a.id||!a.name)throw new Error(`Invalid task at index ${r}: missing required fields (id, name)`)}),t}catch(t){throw new Error(`Failed to import tasks: ${t instanceof Error?t.message:"Unknown error"}`)}},exportToCSV:e=>{let t=he.flattenTasks(e),r=[["ID","Name","Start Date","End Date","Progress","Status","Dependencies"].join(",")];return t.forEach(o=>{let s=[o.id,`"${o.name.replace(/"/g,'""')}"`,o.startDate?o.startDate.toISOString().split("T")[0]:"",o.endDate?o.endDate.toISOString().split("T")[0]:"",o.progress.toString(),o.status||"",o.dependencies?.join(";")||""];r.push(s.join(","));}),r.join(`
112
112
  `)},formatDate:e=>{let t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return `${t}-${a}-${r}`},parseDate:e=>new Date(e),getTaskDateRange:e=>!e.startDate||!e.endDate?null:{start:e.startDate,end:e.endDate},getEarliestStartDate:e=>{let a=he.flattenTasks(e).filter(r=>r.startDate);return a.length===0?null:new Date(Math.min(...a.map(r=>r.startDate.getTime())))},getLatestEndDate:e=>{let a=he.flattenTasks(e).filter(r=>r.endDate);return a.length===0?null:new Date(Math.max(...a.map(r=>r.endDate.getTime())))},tasksOverlap:(e,t)=>!e.startDate||!e.endDate||!t.startDate||!t.endDate?false:e.startDate<=t.endDate&&t.startDate<=e.endDate,getDependentTasks:(e,t)=>he.flattenTasks(e).filter(r=>r.dependencies&&r.dependencies.includes(t)),getDependencyTasks:(e,t)=>{let a=he.findTaskById(e,t);return !a||!a.dependencies?[]:he.flattenTasks(e).filter(o=>a.dependencies.includes(o.id))},filterByStatus:(e,t)=>he.flattenTasks(e).filter(a=>a.status===t),filterByDateRange:(e,t,a)=>he.flattenTasks(e).filter(r=>!r.startDate||!r.endDate?false:r.startDate<=a&&r.endDate>=t),sortByStartDate:(e,t=true)=>[...e].sort((a,r)=>{if(!a.startDate||!r.startDate)return 0;let o=a.startDate.getTime()-r.startDate.getTime();return t?o:-o}),sortByEndDate:(e,t=true)=>[...e].sort((a,r)=>{if(!a.endDate||!r.endDate)return 0;let o=a.endDate.getTime()-r.endDate.getTime();return t?o:-o}),sortByProgress:(e,t=true)=>[...e].sort((a,r)=>{let o=a.progress-r.progress;return t?o:-o}),calculateTotalProgress:e=>{let t=he.flattenTasks(e);if(t.length===0)return 0;let a=t.reduce((r,o)=>r+o.progress,0);return Math.round(a/t.length)},getTaskByPath:(e,t)=>{let a=e,r;for(let o=0;o<t.length;o++){let s=t[o];if(!a||s===void 0||s>=a.length||(r=a[s],!r))return;o<t.length-1&&(a=r.subtasks||[]);}return r},cloneTask:(e,t)=>({...e,id:t||`${e.id}-copy`,subtasks:e.subtasks?.map(a=>he.cloneTask(a))}),exportToPDF:async(e,t="gantt-chart.pdf")=>{try{if(!e||e.length===0){alert("No tasks available to export to PDF");return}let{jsPDF:a}=await import('jspdf'),{default:r}=await import('jspdf-autotable'),o=new a,s=he.flattenTasks(e);if(s.length===0){alert("No tasks found to export");return}o.setFontSize(16),o.text("Gantt Chart - Task List",14,20);let n=[["Task Name","Start Date","End Date","Duration","Progress","Status"]],c=s.map(g=>{let i=g.startDate&&g.endDate?he.calculateDuration(g.startDate,g.endDate):0;return [g.name,g.startDate?he.formatDate(g.startDate):"N/A",g.endDate?he.formatDate(g.endDate):"N/A",i>0?`${i} days`:"N/A",`${g.progress}%`,g.status||"N/A"]});r(o,{head:n,body:c,startY:30,styles:{fontSize:9,cellPadding:3},headStyles:{fillColor:[66,139,202],textColor:255,fontStyle:"bold"},alternateRowStyles:{fillColor:[245,245,245]},columnStyles:{0:{cellWidth:60},1:{cellWidth:30},2:{cellWidth:30},3:{cellWidth:25},4:{cellWidth:20},5:{cellWidth:25}}}),o.save(t);}catch(a){throw a}},exportToExcel:async(e,t="gantt-chart.xlsx")=>{let a=await import('xlsx'),o=he.flattenTasks(e).map(g=>{let i=g.startDate&&g.endDate?he.calculateDuration(g.startDate,g.endDate):0;return {"Task ID":g.id,"Task Name":g.name,"Start Date":g.startDate?he.formatDate(g.startDate):"","End Date":g.endDate?he.formatDate(g.endDate):"","Duration (days)":i>0?i:"","Progress (%)":g.progress,Status:g.status||"",Assignees:g.assignees?.map(p=>p.name).join(", ")||"",Dependencies:g.dependencies?.join(", ")||"","Is Milestone":g.isMilestone?"Yes":"No","Parent ID":g.parentId||"",Level:g.level||0}}),s=a.utils.json_to_sheet(o),n=[{wch:15},{wch:40},{wch:12},{wch:12},{wch:15},{wch:12},{wch:15},{wch:30},{wch:20},{wch:12},{wch:15},{wch:8}];s["!cols"]=n;let c=a.utils.book_new();a.utils.book_append_sheet(c,s,"Gantt Tasks"),a.writeFile(c,t);},exportToMSProject:(e,t="Gantt Project",a="project.xml")=>{let r=he.flattenTasks(e),o=new Map;r.forEach((f,y)=>{o.set(f.id,y+1);});let s=f=>f.toISOString().replace("Z",""),n=he.getEarliestStartDate(e)||new Date,c=he.getLatestEndDate(e)||new Date,g=r.map((f,y)=>{let k=o.get(f.id),C=f.startDate&&f.endDate?he.calculateDuration(f.startDate,f.endDate):0,h=(f.dependencies||[]).filter(b=>o.has(b)).map(b=>`
113
113
  <PredecessorLink>
114
114
  <PredecessorUID>${o.get(b)}</PredecessorUID>
@@ -386,7 +386,7 @@ If ambiguous, ask for clarification in the message field.`;function bm(e){return
386
386
  ${hm(e).map(r=>{let o=r.startDate?r.startDate.toISOString().split("T")[0]:"no date",s=r.endDate?r.endDate.toISOString().split("T")[0]:"no date",n=r.dependencies?.length?`deps: [${r.dependencies.join(", ")}]`:"";return `- ${r.id}: "${r.name}" (${o} to ${s}, ${r.progress}%, ${r.status||"todo"}) ${n}`}).join(`
387
387
  `)}
388
388
 
389
- Today's date: ${new Date().toISOString().split("T")[0]}`}function hm(e){let t=[],a=r=>{for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);};return a(e),t}function Mr(e,t){let a=hm(e),r=t.toLowerCase().trim(),o=a.find(c=>c.name.toLowerCase()===r);if(o)return o;let s=a.find(c=>c.name.toLowerCase().includes(r));if(s)return s;let n=r.split(/\s+/);return a.find(c=>{let g=c.name.toLowerCase();return n.every(i=>g.includes(i))})}function Qi(e,t=new Date){let a=e.toLowerCase().trim(),r=new Date(t);if(r.setHours(0,0,0,0),a==="today"||a==="hoy")return r;if(a==="tomorrow"||a==="ma\xF1ana"){let f=new Date(r);return f.setDate(f.getDate()+1),f}if(a==="yesterday"||a==="ayer"){let f=new Date(r);return f.setDate(f.getDate()-1),f}if(a==="next week"||a==="la pr\xF3xima semana"){let f=new Date(r);return f.setDate(f.getDate()+7),f}let o=a.match(/(?:next\s+)?(monday|tuesday|wednesday|thursday|friday|saturday|sunday|lunes|martes|miércoles|miercoles|jueves|viernes|sábado|sabado|domingo)/i);if(o){let y={sunday:0,domingo:0,monday:1,lunes:1,tuesday:2,martes:2,wednesday:3,mi\u00E9rcoles:3,miercoles:3,thursday:4,jueves:4,friday:5,viernes:5,saturday:6,s\u00E1bado:6,sabado:6}[o[1].toLowerCase()];if(y!==void 0){let k=new Date(r),C=k.getDay(),h=y-C;return h<=0&&(h+=7),k.setDate(k.getDate()+h),k}}let s=a.match(/in\s+(\d+)\s+(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(s&&s[1]&&s[2]){let f=parseInt(s[1],10),y=s[2].toLowerCase(),k=new Date(r);return y==="day"||y==="d\xEDa"||y==="dias"?k.setDate(k.getDate()+f):y==="week"||y==="semana"||y==="semanas"?k.setDate(k.getDate()+f*7):(y==="month"||y==="mes"||y==="meses")&&k.setMonth(k.getMonth()+f),k}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let c=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(c&&c[1]&&c[2]&&c[3]){let f=parseInt(c[1],10),y=parseInt(c[2],10)-1,k=parseInt(c[3],10);return new Date(k,y,f)}let g={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},i=a.match(/(\d{1,2})\s+de\s+(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)(?:\s+de\s+(\d{4}))?/i);if(i&&i[1]&&i[2]){let f=parseInt(i[1],10),y=g[i[2].toLowerCase()],k=i[3]?parseInt(i[3],10):r.getFullYear();if(y!==void 0)return new Date(k,y,f)}let p={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},l=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(l&&l[1]&&l[2]){let f=p[l[1].toLowerCase()],y=parseInt(l[2],10),k=l[3]?parseInt(l[3],10):r.getFullYear();if(f!==void 0)return new Date(k,f,y)}return null}function el(e){let a=e.toLowerCase().trim().match(/(\d+)\s*(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(a&&a[1]&&a[2]){let r=parseInt(a[1],10),o=a[2].toLowerCase();if(o==="day"||o==="d\xEDa"||o==="dias")return r;if(o==="week"||o==="semana"||o==="semanas")return r*7;if(o==="month"||o==="mes"||o==="meses")return r*30}return null}function tl(e){let t=e.match(/(\d+)(?:\s*%)?/);if(t&&t[1]){let a=parseInt(t[1],10);return Math.max(0,Math.min(100,a))}return null}function ym(e){let t=e.toLowerCase().trim();return t.includes("todo")||t.includes("pendiente")||t.includes("por hacer")?"todo":t.includes("in progress")||t.includes("in-progress")||t.includes("en progreso")||t.includes("working")||t.includes("trabajando")?"in-progress":t.includes("done")||t.includes("complete")||t.includes("finished")||t.includes("completado")||t.includes("terminado")||t.includes("hecho")?"completed":null}function vm(e,t){let a=e.toLowerCase().trim(),r=a.match(/(?:move|mover|mueve)\s+(?:la\s+tarea\s+)?["""]?(.+?)["""]?\s+(?:to|a|para)\s+(?:la\s+fecha\s+)?(.+)/i);if(r&&r[1]&&r[2]){let i=r[1].trim(),p=r[2].trim(),l=Mr(t,i),f=Qi(p);if(!l)return {type:"move_task",taskName:i,message:`Could not find a task named "${i}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!f)return {type:"move_task",taskId:l.id,taskName:l.name,message:`Could not parse the date "${p}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let y=l.startDate&&l.endDate?Math.round((l.endDate.getTime()-l.startDate.getTime())/(1e3*60*60*24)):1,k=new Date(f);return k.setDate(k.getDate()+y),{type:"move_task",taskId:l.id,taskName:l.name,updates:{startDate:f,endDate:k},message:`Moved "${l.name}" to ${f.toLocaleDateString()}.`,success:true}}let o=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(o&&o[1]&&o[2]){let i=o[1].trim(),p=o[2].trim(),l=Mr(t,i),f=el(p);if(!l)return {type:"resize_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"};if(!f||!l.endDate)return {type:"resize_task",taskId:l.id,taskName:l.name,message:`Could not parse the duration "${p}".`,success:false,error:"Invalid duration"};let y=new Date(l.endDate);return y.setDate(y.getDate()+f),{type:"resize_task",taskId:l.id,taskName:l.name,updates:{endDate:y},message:`Extended "${l.name}" by ${f} days. New end date: ${y.toLocaleDateString()}.`,success:true}}let s=a.match(/(?:set|establecer|poner)\s+["""]?(.+?)["""]?\s+(?:progress|progreso)\s+(?:to|a|en)\s+(.+)/i);if(s&&s[1]&&s[2]){let i=s[1].trim(),p=s[2].trim(),l=Mr(t,i),f=tl(p);return l?f===null?{type:"set_progress",taskId:l.id,taskName:l.name,message:`Could not parse the progress value "${p}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:l.id,taskName:l.name,updates:{progress:f},message:`Set "${l.name}" progress to ${f}%.`,success:true}:{type:"set_progress",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let n=a.match(/(?:rename|renombrar|cambiar nombre de)\s+["""]?(.+?)["""]?\s+(?:to|a|por)\s+["""]?(.+?)["""]?$/i);if(n&&n[1]&&n[2]){let i=n[1].trim(),p=n[2].trim(),l=Mr(t,i);return l?{type:"rename_task",taskId:l.id,taskName:l.name,updates:{name:p},message:`Renamed "${l.name}" to "${p}".`,success:true}:{type:"rename_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let c=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(c&&c[1]&&c[2]){let i=c[1].trim(),p=c[2].trim(),l=Mr(t,i),f=Mr(t,p);return l?f?{type:"link_tasks",taskId:f.id,taskName:f.name,dependencyFrom:l.id,dependencyTo:f.id,message:`Linked "${l.name}" \u2192 "${f.name}".`,success:true}:{type:"link_tasks",taskName:p,message:`Could not find a task named "${p}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Source task not found"}}let g=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(g&&g[1]){let i=g[1].trim(),p=Mr(t,i);return p?{type:"delete_task",taskId:p.id,taskName:p.name,message:`Deleted "${p.name}".`,success:true}:{type:"delete_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}return null}function xm(e){if(!e||typeof e!="object")return {type:"unknown",message:"Invalid response from AI",success:false,error:"Invalid response format"};let t=e;return {type:t.type||"unknown",taskId:typeof t.taskId=="string"?t.taskId:void 0,taskName:typeof t.taskName=="string"?t.taskName:void 0,updates:t.updates,newTask:t.newTask,dependencyFrom:typeof t.dependencyFrom=="string"?t.dependencyFrom:void 0,dependencyTo:typeof t.dependencyTo=="string"?t.dependencyTo:void 0,message:typeof t.message=="string"?t.message:"Command processed",success:typeof t.success=="boolean"?t.success:false,error:typeof t.error=="string"?t.error:void 0}}function xh(e){if(e)switch(e.toUpperCase()){case "TODO":case "BLOCKED":return "todo";case "IN_PROGRESS":case "REVIEW":return "in-progress";case "DONE":return "completed";default:return "todo"}}function kh(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function ns(e,t=[],a=[]){let r=e.assignedUserIds?.map(p=>{let l=a.find(f=>f.id===p);return l?{name:l.name,initials:l.initials,color:l.color}:null}).filter(p=>p!==null),o=t.filter(p=>p.metadata?.parentCardId===e.id).map(p=>ns(p,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(p=>p.type==="finish-to-start").map(p=>p.taskId));let n=p=>{if(p)return typeof p=="string"?new Date(p):p},c=n(e.startDate),g=n(e.endDate),i=e.metadata?.isMilestone===true||c&&g&&Math.abs(g.getTime()-c.getTime())<=864e5;return {id:e.id,name:e.title,startDate:c,endDate:g,progress:e.progress||0,status:xh(e.metadata?.status),assignees:r?.length?r:void 0,dependencies:s?.length?s:void 0,subtasks:o?.length?o:void 0,isExpanded:e.metadata?.isExpanded===true,isMilestone:i,isCriticalPath:e.metadata?.isCriticalPath===true}}function km(e,t=[]){let a;return e.assignees&&e.assignees.length>0&&(a=e.assignees.map(r=>t.find(s=>s.name===r.name||s.initials===r.initials)?.id).filter(r=>r!==void 0)),{id:e.id,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,assignedUserIds:a?.length?a:void 0,metadata:{status:kh(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function wm(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>ns(r,e,t))}var al={columns:{name:"Task Name",startDate:"Start Date",endDate:"End Date",progress:"Progress",status:"Status",assignees:"Assignees",priority:"Priority",actions:"Actions"},toolbar:{search:"Search",searchPlaceholder:"Search tasks...",filter:"Filter",clearFilters:"Clear Filters",export:"Export",columns:"Columns",newTask:"New Task"},filters:{status:"Status",assignees:"Assignees",dateRange:"Date Range",showCompleted:"Show Completed",all:"All",none:"None"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",viewDetails:"View Details"},empty:{noTasks:"No tasks yet",noResults:"No tasks match your filters",addFirstTask:"Add your first task"},pagination:{showing:"Showing",of:"of",tasks:"tasks",previous:"Previous",next:"Next"},bulk:{selected:"selected",delete:"Delete",move:"Move to",assignTo:"Assign to"}},rl={columns:{name:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",status:"Estado",assignees:"Asignados",priority:"Prioridad",actions:"Acciones"},toolbar:{search:"Buscar",searchPlaceholder:"Buscar tareas...",filter:"Filtrar",clearFilters:"Limpiar Filtros",export:"Exportar",columns:"Columnas",newTask:"Nueva Tarea"},filters:{status:"Estado",assignees:"Asignados",dateRange:"Rango de Fechas",showCompleted:"Mostrar Completadas",all:"Todos",none:"Ninguno"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",viewDetails:"Ver Detalles"},empty:{noTasks:"Sin tareas a\xFAn",noResults:"Ninguna tarea coincide con los filtros",addFirstTask:"Agrega tu primera tarea"},pagination:{showing:"Mostrando",of:"de",tasks:"tareas",previous:"Anterior",next:"Siguiente"},bulk:{selected:"seleccionadas",delete:"Eliminar",move:"Mover a",assignTo:"Asignar a"}},ss={en:al,es:rl};function ol(e){return ss[e]||ss.en}function is(e,t){let a=ol(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},filters:{...a.filters,...t.filters},status:{...a.status,...t.status},actions:{...a.actions,...t.actions},empty:{...a.empty,...t.empty},pagination:{...a.pagination,...t.pagination},bulk:{...a.bulk,...t.bulk}}:a}var nl=[{value:"todo",icon:lucideReact.Circle,color:"text-gray-400"},{value:"in-progress",icon:lucideReact.PlayCircle,color:"text-blue-500"},{value:"completed",icon:lucideReact.CheckCircle2,color:"text-green-500"}];function Cm({value:e,onChange:t,isDark:a,translations:r,disabled:o=false}){let[s,n]=react.useState(false),c=react.useRef(null);react.useEffect(()=>{let f=y=>{c.current&&!c.current.contains(y.target)&&n(false);};return s&&document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[s]);let g=nl[0],i=nl.find(f=>f.value===e)??g,p=i.icon,l=f=>{switch(f){case "completed":return r.completed;case "in-progress":return r.inProgress;default:return r.todo}};return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(p,{className:d("w-4 h-4",i.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:l(e)})]}):jsxRuntime.jsxs("div",{ref:c,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(p,{className:d("w-4 h-4",i.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:l(e)}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:d("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[140px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:nl.map(f=>{let y=f.icon;return jsxRuntime.jsxs("button",{onClick:k=>{k.stopPropagation(),t(f.value),n(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",e===f.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx(y,{className:d("w-4 h-4",f.color)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:l(f.value)})]},f.value)})})]})}var sl=[{value:"urgent",label:{en:"Urgent",es:"Urgente"},color:"text-red-500",bg:"bg-red-500"},{value:"high",label:{en:"High",es:"Alta"},color:"text-orange-500",bg:"bg-orange-500"},{value:"medium",label:{en:"Medium",es:"Media"},color:"text-yellow-500",bg:"bg-yellow-500"},{value:"low",label:{en:"Low",es:"Baja"},color:"text-blue-500",bg:"bg-blue-500"},{value:"none",label:{en:"None",es:"Ninguna"},color:"text-gray-400",bg:"bg-gray-400"}];function Nm({value:e="none",onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),c=react.useRef(null);react.useEffect(()=>{let p=l=>{c.current&&!c.current.contains(l.target)&&n(false);};return s&&document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]);let g=sl.find(p=>p.value===e)??sl[4],i=r==="es"?"es":"en";return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:g.label[i]})]}):jsxRuntime.jsxs("div",{ref:c,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:p=>{p.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:g.label[i]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:d("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:sl.map(p=>jsxRuntime.jsxs("button",{onClick:l=>{l.stopPropagation(),t(p.value),n(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",e===p.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-2 h-2 rounded-full",p.bg)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:p.label[i]})]},p.value))})]})}function cs(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function ms(e){let t=["bg-blue-500","bg-green-500","bg-purple-500","bg-pink-500","bg-yellow-500","bg-red-500","bg-indigo-500","bg-teal-500"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"bg-blue-500"}function Sm({value:e=[],availableUsers:t=[],onChange:a,isDark:r,locale:o,disabled:s=false}){let[n,c]=react.useState(false),[g,i]=react.useState(""),p=react.useRef(null);react.useEffect(()=>{let k=C=>{p.current&&!p.current.contains(C.target)&&(c(false),i(""));};return n&&document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[n]);let l=t.filter(k=>k.name.toLowerCase().includes(g.toLowerCase())||k.email?.toLowerCase().includes(g.toLowerCase())),f=k=>e.some(C=>C.name===k),y=k=>{if(a)if(f(k.name))a(e.filter(C=>C.name!==k.name));else {let C={name:k.name,initials:cs(k.name),color:k.color||ms(k.name).replace("bg-","").replace("-500",""),avatar:k.avatarUrl};a([...e,C]);}};return s||!a?e.length===0?jsxRuntime.jsx("span",{className:d("text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"-"}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-2",children:[e.slice(0,3).map((k,C)=>jsxRuntime.jsx("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white border-2",r?"border-[#0F1117]":"border-white",!k.avatar&&ms(k.name)),style:k.color&&!k.avatar?{backgroundColor:k.color}:void 0,title:k.name,children:k.avatar?jsxRuntime.jsx("img",{src:k.avatar,alt:k.name,className:"w-full h-full rounded-full object-cover"}):k.initials||cs(k.name)},`${k.name}-${C}`)),e.length>3&&jsxRuntime.jsxs("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium border-2",r?"bg-[#374151] border-[#0F1117] text-white":"bg-gray-200 border-white text-gray-600"),children:["+",e.length-3]})]}):jsxRuntime.jsxs("div",{ref:p,className:"relative",children:[jsxRuntime.jsx("button",{onClick:k=>{k.stopPropagation(),c(!n);},className:d("flex items-center gap-1 px-2 py-1 rounded transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100"),children:e.length===0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.User,{className:d("w-4 h-4",r?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx(lucideReact.Plus,{className:d("w-3 h-3",r?"text-[#6B7280]":"text-gray-400")})]}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-1",children:[e.slice(0,2).map((k,C)=>jsxRuntime.jsx("div",{className:d("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-medium text-white border",r?"border-[#0F1117]":"border-white",!k.avatar&&ms(k.name)),style:k.color&&!k.avatar?{backgroundColor:k.color}:void 0,children:k.avatar?jsxRuntime.jsx("img",{src:k.avatar,alt:k.name,className:"w-full h-full rounded-full object-cover"}):k.initials||cs(k.name)},`${k.name}-${C}`)),e.length>2&&jsxRuntime.jsxs("span",{className:d("text-xs ml-1",r?"text-[#9CA3AF]":"text-gray-500"),children:["+",e.length-2]})]})}),n&&jsxRuntime.jsxs("div",{className:d("absolute z-50 top-full left-0 mt-1 rounded-lg shadow-lg border w-64",r?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:"p-2 border-b",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:jsxRuntime.jsx("input",{type:"text",value:g,onChange:k=>i(k.target.value),placeholder:o==="es"?"Buscar usuario...":"Search user...",className:d("w-full px-3 py-1.5 text-sm rounded border outline-none",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),onClick:k=>k.stopPropagation()})}),jsxRuntime.jsx("div",{className:"max-h-48 overflow-y-auto py-1",children:l.length===0?jsxRuntime.jsx("p",{className:d("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:o==="es"?"No se encontraron usuarios":"No users found"}):l.map(k=>jsxRuntime.jsxs("button",{onClick:C=>{C.stopPropagation(),y(k);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white",!k.avatarUrl&&ms(k.name)),children:k.avatarUrl?jsxRuntime.jsx("img",{src:k.avatarUrl,alt:k.name,className:"w-full h-full rounded-full object-cover"}):cs(k.name)}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:r?"text-white":"text-gray-900",children:k.name}),k.email&&jsxRuntime.jsx("div",{className:d("text-xs",r?"text-[#6B7280]":"text-gray-400"),children:k.email})]}),f(k.name)&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},k.id))}),e.length>0&&jsxRuntime.jsx("div",{className:"p-2 border-t flex flex-wrap gap-1",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:e.map((k,C)=>jsxRuntime.jsxs("span",{className:d("inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full",r?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:[k.name,jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),a(e.filter(b=>b.name!==k.name));},className:"hover:text-red-500",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},`${k.name}-${C}`))})]})]})}var Vh={en:["January","February","March","April","May","June","July","August","September","October","November","December"],es:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"]},jh={en:["Su","Mo","Tu","We","Th","Fr","Sa"],es:["Do","Lu","Ma","Mi","Ju","Vi","S\xE1"]};function ps({value:e,onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),[c,g]=react.useState(()=>{if(e){let h=e instanceof Date?e:new Date(e);return new Date(h.getFullYear(),h.getMonth(),1)}return new Date(new Date().getFullYear(),new Date().getMonth(),1)}),i=react.useRef(null),p=e?e instanceof Date?e:new Date(e):null,l=r==="es"?"es":"en";react.useEffect(()=>{let h=b=>{i.current&&!i.current.contains(b.target)&&n(false);};return s&&document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]);let f=h=>h?h.toLocaleDateString(r==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):"-",y=(h,b)=>new Date(h,b+1,0).getDate(),k=(h,b)=>new Date(h,b,1).getDay(),C=()=>{let h=c.getFullYear(),b=c.getMonth(),u=y(h,b),x=k(h,b),m=new Date,N=[];for(let w=0;w<x;w++)N.push(jsxRuntime.jsx("div",{className:"w-8 h-8"},`empty-${w}`));for(let w=1;w<=u;w++){let B=new Date(h,b,w),v=p&&p.getDate()===w&&p.getMonth()===b&&p.getFullYear()===h,I=m.getDate()===w&&m.getMonth()===b&&m.getFullYear()===h;N.push(jsxRuntime.jsx("button",{onClick:A=>{A.stopPropagation(),t?.(B),n(false);},className:d("w-8 h-8 rounded-full text-sm transition-colors",v?"bg-[#3B82F6] text-white":I?a?"bg-white/10 text-white":"bg-gray-100 text-gray-900":a?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-900"),children:w},w));}return N};return o||!t?jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:f(p)}):jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:h=>{h.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:d("w-4 h-4",a?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:f(p)})]}),s&&jsxRuntime.jsxs("div",{className:d("absolute z-50 top-full left-0 mt-1 p-3 rounded-lg shadow-lg border",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),g(new Date(c.getFullYear(),c.getMonth()-1,1));},className:d("p-1 rounded",a?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:d("w-4 h-4",a?"text-white":"text-gray-600")})}),jsxRuntime.jsxs("span",{className:d("text-sm font-medium",a?"text-white":"text-gray-900"),children:[Vh[l][c.getMonth()]," ",c.getFullYear()]}),jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),g(new Date(c.getFullYear(),c.getMonth()+1,1));},className:d("p-1 rounded",a?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",a?"text-white":"text-gray-600")})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-1",children:jh[l].map(h=>jsxRuntime.jsx("div",{className:d("w-8 h-6 text-xs flex items-center justify-center",a?"text-[#6B7280]":"text-gray-400"),children:h},h))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:C()}),jsxRuntime.jsxs("div",{className:"mt-3 pt-3 border-t flex gap-2",style:{borderColor:a?"rgba(255,255,255,0.1)":"#E5E7EB"},children:[jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),t?.(new Date),n(false);},className:d("flex-1 py-1.5 text-xs rounded",a?"bg-white/10 text-white hover:bg-white/20":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:r==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation();let b=new Date;b.setDate(b.getDate()+1),t?.(b),n(false);},className:d("flex-1 py-1.5 text-xs rounded",a?"bg-white/10 text-white hover:bg-white/20":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:r==="es"?"Ma\xF1ana":"Tomorrow"})]})]})]})}function Am({value:e=0,onChange:t,isDark:a,disabled:r=false}){return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{onClick:s=>{if(r||!t)return;s.stopPropagation();let n=s.currentTarget.getBoundingClientRect(),c=s.clientX-n.left,g=Math.round(c/n.width*100),i=Math.max(0,Math.min(100,g));t(i);},className:d("flex-1 h-2 rounded-full overflow-hidden",a?"bg-white/10":"bg-gray-200",!r&&t&&"cursor-pointer"),children:jsxRuntime.jsx("div",{className:d("h-full rounded-full transition-all",e===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${e}%`}})}),jsxRuntime.jsxs("span",{className:d("text-xs w-8 text-right",a?"text-[#9CA3AF]":"text-gray-500"),children:[e,"%"]})]})}function Im({value:e="",onChange:t,isDark:a,placeholder:r="-",disabled:o=false}){let[s,n]=react.useState(false),[c,g]=react.useState(e),i=react.useRef(null);react.useEffect(()=>{s&&i.current&&(i.current.focus(),i.current.select());},[s]),react.useEffect(()=>{g(e);},[e]);let p=()=>{c!==e&&t?.(c),n(false);},l=f=>{f.key==="Enter"?p():f.key==="Escape"&&(g(e),n(false));};return o||!t?jsxRuntime.jsx("span",{className:d("text-sm truncate",a?"text-[#94A3B8]":"text-gray-500"),children:e||r}):s?jsxRuntime.jsx("input",{ref:i,type:"text",value:c,onChange:f=>g(f.target.value),onBlur:p,onKeyDown:l,onClick:f=>f.stopPropagation(),className:d("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:f=>{f.stopPropagation(),n(true);},className:d("text-sm truncate text-left w-full px-2 py-1 rounded transition-colors",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",!e&&(a?"text-[#6B7280]":"text-gray-400")),children:e||r})}function Om({value:e,onChange:t,isDark:a,placeholder:r="-",min:o,max:s,disabled:n=false}){let[c,g]=react.useState(false),[i,p]=react.useState(e?.toString()||""),l=react.useRef(null);react.useEffect(()=>{c&&l.current&&(l.current.focus(),l.current.select());},[c]),react.useEffect(()=>{p(e?.toString()||"");},[e]);let f=()=>{let k=parseFloat(i);if(!isNaN(k)){let C=k;o!==void 0&&(C=Math.max(o,C)),s!==void 0&&(C=Math.min(s,C)),C!==e&&t?.(C);}g(false);},y=k=>{k.key==="Enter"?f():k.key==="Escape"&&(p(e?.toString()||""),g(false));};return n||!t?jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:e!==void 0?e:r}):c?jsxRuntime.jsx("input",{ref:l,type:"number",value:i,onChange:k=>p(k.target.value),onBlur:f,onKeyDown:y,onClick:k=>k.stopPropagation(),min:o,max:s,className:d("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:k=>{k.stopPropagation(),g(true);},className:d("text-sm text-left w-full px-2 py-1 rounded transition-colors",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",e===void 0&&(a?"text-[#6B7280]":"text-gray-400")),children:e!==void 0?e:r})}function $m({value:e,options:t=[],onChange:a,isDark:r,placeholder:o="-",disabled:s=false}){let[n,c]=react.useState(false),g=react.useRef(null);return react.useEffect(()=>{let i=p=>{g.current&&!g.current.contains(p.target)&&c(false);};return n&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),s||!a?jsxRuntime.jsx("span",{className:d("text-sm",r?"text-[#94A3B8]":"text-gray-500"),children:e||o}):jsxRuntime.jsxs("div",{ref:g,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:i=>{i.stopPropagation(),c(!n);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors min-w-[80px]",r?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{className:d("text-sm flex-1 text-left truncate",r?"text-[#94A3B8]":"text-gray-500",!e&&(r?"text-[#6B7280]":"text-gray-400")),children:e||o}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3 flex-shrink-0",r?"text-[#6B7280]":"text-gray-400")})]}),n&&jsxRuntime.jsx("div",{className:d("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px] max-h-48 overflow-y-auto",r?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:t.length===0?jsxRuntime.jsx("p",{className:d("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"No options"}):t.map(i=>jsxRuntime.jsxs("button",{onClick:p=>{p.stopPropagation(),a(i),c(false);},className:d("w-full flex items-center justify-between gap-2 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100",e===i&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:i}),e===i&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-[#3B82F6]"})]},i))})]})}function zm({value:e=false,onChange:t,isDark:a,disabled:r=false}){return jsxRuntime.jsx("button",{onClick:s=>{s.stopPropagation(),!r&&t&&t(!e);},disabled:r||!t,className:d("w-5 h-5 rounded border-2 flex items-center justify-center transition-colors",e?"bg-[#3B82F6] border-[#3B82F6]":a?"border-[#4B5563] hover:border-[#6B7280]":"border-gray-300 hover:border-gray-400",(r||!t)&&"opacity-50 cursor-not-allowed"),children:e&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})})}function Gm({value:e=[],isDark:t,maxVisible:a=2}){if(e.length===0)return jsxRuntime.jsx("span",{className:d("text-sm",t?"text-[#6B7280]":"text-gray-400"),children:"-"});let r=e.slice(0,a),o=e.length-a;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[r.map(s=>jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 text-xs rounded-full",style:{backgroundColor:s.color?`${s.color}20`:t?"rgba(255,255,255,0.1)":"#F3F4F6",color:s.color||(t?"#9CA3AF":"#6B7280")},children:s.name},s.id)),o>0&&jsxRuntime.jsxs("span",{className:d("inline-flex items-center px-2 py-0.5 text-xs rounded-full",t?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-500"),children:["+",o]})]})}function gy(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function fy(e){let t=["blue","green","purple","pink","yellow","red","indigo","teal"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"blue"}function Km({state:e,onClose:t,isDark:a,locale:r,onTaskEdit:o,onTaskDuplicate:s,onTaskDelete:n,onTaskUpdate:c,onColumnHide:g,onColumnSort:i,availableUsers:p=[]}){let l=react.useRef(null),f=r==="es"?Vm.es:Vm.en;if(react.useEffect(()=>{let b=x=>{l.current&&!l.current.contains(x.target)&&t();},u=x=>{x.key==="Escape"&&t();};return document.addEventListener("mousedown",b),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",u);}},[t]),!e.isOpen)return null;let y=()=>{if(!e.task)return [];let b=[];return o&&b.push({id:"edit",label:f.edit,icon:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),onClick:()=>{o(e.task),t();}}),b.push({id:"sep1",label:"",icon:null,separator:true}),c&&(b.push({id:"status",label:f.changeStatus,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),submenu:[{id:"status-todo",label:f.todo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4 text-gray-400"}),onClick:()=>{c({...e.task,status:"todo",progress:0}),t();}},{id:"status-in-progress",label:f.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4 text-blue-500"}),onClick:()=>{c({...e.task,status:"in-progress",progress:e.task.progress||50}),t();}},{id:"status-completed",label:f.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4 text-green-500"}),onClick:()=>{c({...e.task,status:"completed",progress:100}),t();}}]}),b.push({id:"priority",label:f.changePriority,icon:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),submenu:[{id:"priority-urgent",label:f.urgent,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),onClick:()=>{c({...e.task,priority:"urgent"}),t();}},{id:"priority-high",label:f.high,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-orange-500"}),onClick:()=>{c({...e.task,priority:"high"}),t();}},{id:"priority-medium",label:f.medium,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),onClick:()=>{c({...e.task,priority:"medium"}),t();}},{id:"priority-low",label:f.low,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),onClick:()=>{c({...e.task,priority:"low"}),t();}}]}),p.length>0&&b.push({id:"assign",label:f.assignUser,icon:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),submenu:p.slice(0,5).map(u=>({id:`assign-${u.id}`,label:u.name,icon:jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] text-white bg-blue-500",children:u.name.charAt(0).toUpperCase()}),onClick:()=>{let x=e.task.assignees||[],N=x.some(w=>w.name===u.name)?x.filter(w=>w.name!==u.name):[...x,{name:u.name,initials:gy(u.name),color:u.color||fy(u.name),avatar:u.avatarUrl}];c({...e.task,assignees:N}),t();}}))})),b.push({id:"sep2",label:"",icon:null,separator:true}),s&&b.push({id:"duplicate",label:f.duplicate,icon:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),onClick:()=>{s(e.task),t();}}),n&&b.push({id:"delete",label:f.delete,icon:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),danger:true,onClick:()=>{n(e.task.id),t();}}),b},k=()=>{if(!e.columnId)return [];let b=[];return i&&(b.push({id:"sort-asc",label:f.sortAsc,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"asc"),t();}}),b.push({id:"sort-desc",label:f.sortDesc,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"desc"),t();}})),g&&e.columnId!=="name"&&(b.push({id:"sep-hide",label:"",icon:null,separator:true}),b.push({id:"hide",label:f.hideColumn,icon:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),onClick:()=>{g(e.columnId),t();}})),b},C=e.type==="task"?y():k(),h={position:"fixed",left:e.x,top:e.y,zIndex:9999};return jsxRuntime.jsx("div",{ref:l,style:h,className:d("py-1 rounded-lg shadow-xl border min-w-[180px]",a?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:C.map(b=>b.separator?jsxRuntime.jsx("div",{className:d("my-1 h-px",a?"bg-white/10":"bg-gray-200")},b.id):b.submenu?jsxRuntime.jsx(by,{item:b,isDark:a},b.id):jsxRuntime.jsxs("button",{onClick:b.onClick,className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",b.danger?"text-red-500 hover:text-red-600":a?"text-white":"text-gray-700"),children:[jsxRuntime.jsx("span",{className:d(b.danger?"text-red-500":a?"text-[#9CA3AF]":"text-gray-400"),children:b.icon}),b.label]},b.id))})}function by({item:e,isDark:t}){let[a,r]=react.useState(false),o=react.useRef();return jsxRuntime.jsxs("div",{className:"relative",onMouseEnter:()=>{o.current&&clearTimeout(o.current),r(true);},onMouseLeave:()=>{o.current=setTimeout(()=>r(false),150);},children:[jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:e.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",t?"text-[#6B7280]":"text-gray-400")})]}),a&&e.submenu&&jsxRuntime.jsx("div",{className:d("absolute left-full top-0 ml-1 py-1 rounded-lg shadow-xl border min-w-[160px]",t?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:e.submenu.map(c=>jsxRuntime.jsxs("button",{onClick:c.onClick,className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:c.icon}),c.label]},c.id))})]})}var Vm={en:{edit:"Edit",changeStatus:"Change status",changePriority:"Change priority",assignUser:"Assign user",duplicate:"Duplicate",delete:"Delete",todo:"To Do",inProgress:"In Progress",completed:"Completed",urgent:"Urgent",high:"High",medium:"Medium",low:"Low",sortAsc:"Sort A \u2192 Z",sortDesc:"Sort Z \u2192 A",hideColumn:"Hide column"},es:{edit:"Editar",changeStatus:"Cambiar estado",changePriority:"Cambiar prioridad",assignUser:"Asignar usuario",duplicate:"Duplicar",delete:"Eliminar",todo:"Pendiente",inProgress:"En Progreso",completed:"Completado",urgent:"Urgente",high:"Alta",medium:"Media",low:"Baja",sortAsc:"Ordenar A \u2192 Z",sortDesc:"Ordenar Z \u2192 A",hideColumn:"Ocultar columna"}};var Xm={name:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),status:jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-4 h-4"}),priority:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),assignees:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),startDate:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),endDate:jsxRuntime.jsx(lucideReact.CalendarCheck,{className:"w-4 h-4"}),progress:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),tags:jsxRuntime.jsx(lucideReact.Tag,{className:"w-4 h-4"}),text:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),number:jsxRuntime.jsx(lucideReact.Hash,{className:"w-4 h-4"}),date:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),dropdown:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}),checkbox:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-4 h-4"})},Fy=["name","status","priority","assignees","startDate","endDate","progress","tags"];function Zm({isOpen:e,onClose:t,columns:a,customFields:r=[],onColumnsChange:o,onCreateCustomField:s,isDark:n,locale:c}){let[g,i]=react.useState(""),p=react.useRef(null),l=c==="es"?Jm.es:Jm.en;if(react.useEffect(()=>{if(!e)return;let b=setTimeout(()=>{let u=m=>{p.current&&!p.current.contains(m.target)&&t();},x=m=>{m.key==="Escape"&&t();};document.addEventListener("mousedown",u),document.addEventListener("keydown",x),p._cleanup=()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",x);};},100);return ()=>{clearTimeout(b),p._cleanup&&p._cleanup();}},[e,t]),!e)return null;let f=b=>l.columns[b]||b,y=b=>{if(b==="name")return;let u=a.map(x=>x.id===b?{...x,visible:!x.visible}:x);o(u);},k=(b,u)=>{let x=a.find(N=>N.type===b&&(!u||N.customFieldId===u));if(x){y(x.id);return}let m={id:u||b,type:b,label:u?r.find(N=>N.id===u)?.name||b:f(b),width:120,visible:true,sortable:true,resizable:true,customFieldId:u};o([...a,m]);},C=Fy.filter(b=>f(b).toLowerCase().includes(g.toLowerCase())),h=r.filter(b=>b.name.toLowerCase().includes(g.toLowerCase()));return jsxRuntime.jsxs("div",{ref:p,className:d("absolute right-0 top-full mt-1 w-72 rounded-lg shadow-xl border z-50",n?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:d("flex items-center justify-between px-4 py-3 border-b",n?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("font-medium",n?"text-white":"text-gray-900"),children:l.title}),jsxRuntime.jsx("button",{onClick:t,className:d("p-1 rounded",n?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:d("w-4 h-4",n?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsx("div",{className:"p-3",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:d("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",n?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:g,onChange:b=>i(b.target.value),placeholder:l.searchPlaceholder,className:d("w-full pl-9 pr-3 py-2 text-sm rounded-lg border outline-none",n?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")})]})}),jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:d("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:l.standardFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:C.map(b=>{let u=a.find(N=>N.type===b&&!N.customFieldId),x=u?.visible??false,m=b==="name";return jsxRuntime.jsxs("button",{onClick:()=>{m||(u?y(u.id):k(b));},disabled:m,className:d("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100",m&&"opacity-50 cursor-not-allowed"),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded border flex items-center justify-center",x?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:x&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:Xm[b]}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:f(b)})]},b)})})]}),h.length>0&&jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:d("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:l.customFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:h.map(b=>{let x=a.find(m=>m.customFieldId===b.id)?.visible??false;return jsxRuntime.jsxs("button",{onClick:()=>k(b.type,b.id),className:d("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded border flex items-center justify-center",x?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:x&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:Xm[b.type]||jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"})}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:b.name})]},b.id)})})]}),s&&jsxRuntime.jsx("div",{className:d("p-3 border-t",n?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:s,className:d("w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors",n?"bg-[#3B82F6]/20 text-[#3B82F6] hover:bg-[#3B82F6]/30":"bg-blue-50 text-blue-600 hover:bg-blue-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),l.createField]})})]})}var Jm={en:{title:"Columns",searchPlaceholder:"Search fields...",standardFields:"Standard Fields",customFields:"Custom Fields",createField:"Create custom field",columns:{name:"Name",status:"Status",priority:"Priority",assignees:"Assignees",startDate:"Start Date",endDate:"End Date",progress:"Progress",tags:"Tags",text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Columnas",searchPlaceholder:"Buscar campos...",standardFields:"Campos Est\xE1ndar",customFields:"Campos Personalizados",createField:"Crear campo personalizado",columns:{name:"Nombre",status:"Estado",priority:"Prioridad",assignees:"Asignados",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",tags:"Etiquetas",text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var Hy=[{type:"text",icon:jsxRuntime.jsx(lucideReact.Type,{className:"w-5 h-5"})},{type:"number",icon:jsxRuntime.jsx(lucideReact.Hash,{className:"w-5 h-5"})},{type:"date",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5"})},{type:"dropdown",icon:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-5 h-5"})},{type:"checkbox",icon:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-5 h-5"})}];function tp({isOpen:e,onClose:t,onSave:a,isDark:r,locale:o}){let[s,n]=react.useState(""),[c,g]=react.useState("text"),[i,p]=react.useState([""]),l=o==="es"?ep.es:ep.en;react.useEffect(()=>{e&&(n(""),g("text"),p([""]));},[e]),react.useEffect(()=>{let h=b=>{b.key==="Escape"&&t();};return e&&document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]);let f=()=>{if(!s.trim())return;let h={name:s.trim(),type:c};c==="dropdown"&&(h.options=i.filter(b=>b.trim())),a(h),t();},y=()=>{p([...i,""]);},k=(h,b)=>{let u=[...i];u[h]=b,p(u);},C=h=>{i.length>1&&p(i.filter((b,u)=>u!==h));};return e?jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),jsxRuntime.jsxs("div",{className:d("relative w-full max-w-md rounded-xl shadow-2xl border",r?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:d("flex items-center justify-between px-6 py-4 border-b",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h2",{className:d("text-lg font-semibold",r?"text-white":"text-gray-900"),children:l.title}),jsxRuntime.jsx("button",{onClick:t,className:d("p-1 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:d("w-5 h-5",r?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.fieldName}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:h=>n(h.target.value),placeholder:l.fieldNamePlaceholder,className:d("w-full px-4 py-2.5 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),autoFocus:true})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.fieldType}),jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-2",children:Hy.map(h=>jsxRuntime.jsxs("button",{onClick:()=>g(h.type),className:d("flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors",c===h.type?"border-[#3B82F6] bg-[#3B82F6]/10":r?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300"),children:[jsxRuntime.jsx("span",{className:c===h.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-400",children:h.icon}),jsxRuntime.jsx("span",{className:d("text-xs",c===h.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-500"),children:l.types[h.type]})]},h.type))})]}),c==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.options}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[i.map((h,b)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:h,onChange:u=>k(b,u.target.value),placeholder:`${l.option} ${b+1}`,className:d("flex-1 px-3 py-2 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")}),i.length>1&&jsxRuntime.jsx("button",{onClick:()=>C(b),className:d("p-2 rounded-lg transition-colors",r?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},b)),jsxRuntime.jsxs("button",{onClick:y,className:d("flex items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",r?"text-[#3B82F6] hover:bg-white/10":"text-blue-600 hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),l.addOption]})]})]})]}),jsxRuntime.jsxs("div",{className:d("flex items-center justify-end gap-3 px-6 py-4 border-t",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("button",{onClick:t,className:d("px-4 py-2 text-sm font-medium rounded-lg transition-colors",r?"text-[#9CA3AF] hover:bg-white/10":"text-gray-600 hover:bg-gray-100"),children:l.cancel}),jsxRuntime.jsx("button",{onClick:f,disabled:!s.trim(),className:d("px-4 py-2 text-sm font-medium rounded-lg transition-colors","bg-[#3B82F6] text-white hover:bg-[#2563EB]",!s.trim()&&"opacity-50 cursor-not-allowed"),children:l.create})]})]})]}):null}var ep={en:{title:"Create Custom Field",fieldName:"Field Name",fieldNamePlaceholder:"Enter field name...",fieldType:"Field Type",options:"Options",option:"Option",addOption:"Add option",cancel:"Cancel",create:"Create Field",types:{text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Crear Campo Personalizado",fieldName:"Nombre del Campo",fieldNamePlaceholder:"Ingresa el nombre...",fieldType:"Tipo de Campo",options:"Opciones",option:"Opci\xF3n",addOption:"Agregar opci\xF3n",cancel:"Cancelar",create:"Crear Campo",types:{text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var rp={en:{filters:"Filters",filterByStatus:"FILTER BY STATUS",showAll:"Show All",completed:"Completed",inProgress:"In Progress",toDo:"To Do / Pending",hideCompleted:"Hide Completed Tasks"},es:{filters:"Filtros",filterByStatus:"FILTRAR POR ESTADO",showAll:"Mostrar Todo",completed:"Completadas",inProgress:"En Progreso",toDo:"Por Hacer / Pendiente",hideCompleted:"Ocultar Tareas Completadas"}};function op({value:e,hideCompleted:t,onChange:a,onHideCompletedChange:r,isDark:o,locale:s}){let[n,c]=react.useState(false),g=react.useRef(null),i=s==="es"?rp.es:rp.en;react.useEffect(()=>{if(!n)return;let f=setTimeout(()=>{let y=C=>{g.current&&!g.current.contains(C.target)&&c(false);},k=C=>{C.key==="Escape"&&c(false);};document.addEventListener("mousedown",y),document.addEventListener("keydown",k),g._cleanup=()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",k);};},100);return ()=>{clearTimeout(f),g._cleanup&&g._cleanup();}},[n]);let p=[{value:"all",label:i.showAll,icon:jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#3B82F6] bg-[#3B82F6]"}),color:"text-[#3B82F6]"},{value:"completed",label:i.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),color:"text-green-500"},{value:"in-progress",label:i.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),color:"text-blue-500"},{value:"todo",label:i.toDo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),color:"text-gray-400"}],l=e!=="all"||t;return jsxRuntime.jsxs("div",{ref:g,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),c(y=>!y);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors border",o?"border-white/10 hover:bg-white/10 text-white":"border-gray-200 hover:bg-gray-100 text-gray-700",l&&(o?"bg-[#3B82F6]/20 border-[#3B82F6]/50 text-[#3B82F6]":"bg-blue-50 border-blue-200 text-blue-600"),n&&(o?"bg-white/10":"bg-gray-100")),children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),i.filters,l&&jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",o?"bg-[#3B82F6]":"bg-blue-500")})]}),n&&jsxRuntime.jsxs("div",{className:d("absolute left-0 top-full mt-2 w-64 rounded-lg shadow-xl border z-50",o?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:d("px-4 py-3 border-b",o?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("span",{className:d("text-xs font-medium uppercase tracking-wider",o?"text-[#6B7280]":"text-gray-400"),children:i.filterByStatus})}),jsxRuntime.jsx("div",{className:"py-2",children:p.map(f=>{let y=e===f.value&&!t;return jsxRuntime.jsxs("button",{onClick:()=>{a(f.value),r(false);},className:d("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/10":"hover:bg-gray-100",y&&(o?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:f.color,children:f.icon}),jsxRuntime.jsx("span",{className:d("flex-1 text-left",o?"text-white":"text-gray-900"),children:f.label}),y&&jsxRuntime.jsx(lucideReact.Check,{className:d("w-4 h-4",o?"text-[#3B82F6]":"text-blue-500")})]},f.value)})}),jsxRuntime.jsx("div",{className:d("my-2 mx-4 h-px",o?"bg-white/10":"bg-gray-200")}),jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:()=>{r(!t),t||a("all");},className:d("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/10":"hover:bg-gray-100",t&&(o?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:d("w-4 h-4",t?o?"text-[#3B82F6]":"text-blue-500":o?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("flex-1 text-left",o?"text-white":"text-gray-900"),children:i.hideCompleted}),t&&jsxRuntime.jsx(lucideReact.Check,{className:d("w-4 h-4",o?"text-[#3B82F6]":"text-blue-500")})]})})]})]})}var iv=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:120,visible:true,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true}];function ip(e,t=0){let a=[];for(let r of e)a.push({...r,level:t,hasChildren:(r.subtasks?.length||0)>0,parentPath:[r.id]}),r.subtasks?.length&&r.isExpanded!==false&&a.push(...ip(r.subtasks,t+1));return a}function lv({status:e,progress:t}){return t===100||e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-5 h-5 text-green-500"}):t&&t>0||e==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-5 h-5 text-blue-500"}):jsxRuntime.jsx(lucideReact.Circle,{className:"w-5 h-5 text-gray-400"})}function lp({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:n,availableUsers:c=[],customFields:g=[]}){let{theme:i="dark",locale:p="en",customTranslations:l,showSearch:f=true,showHierarchy:y=true,tableColumns:k,allowColumnCustomization:C=true,allowColumnResize:h=true,enableContextMenu:b=true}=t,u=is(p,l),x=i==="dark",[m,N]=react.useState("startDate"),[w,B]=react.useState("asc"),[v,I]=react.useState(""),[A,T]=react.useState("all"),[W,$]=react.useState(false),[j,te]=react.useState(k||iv),[oe,re]=react.useState(false),[ge,fe]=react.useState(false),[Ie,M]=react.useState({isOpen:false,x:0,y:0,type:"task"}),[R,L]=react.useState(null),[V,q]=react.useState(0),[z,ye]=react.useState(0),ne=react.useRef(null);react.useEffect(()=>{k&&te(k);},[k]);let Be=react.useMemo(()=>{let J=new Set;function ve(He){for(let Le of He)Le.subtasks?.length&&(Le.isExpanded!==false&&J.add(Le.id),ve(Le.subtasks));}return ve(e),J},[e]),qe=react.useMemo(()=>j.filter(J=>J.visible),[j]),tt=react.useCallback(J=>{a.onTaskToggleExpand?.(J);},[a]),le=react.useCallback(J=>{m===J?B(ve=>ve==="asc"?"desc":"asc"):(N(J),B("asc")),a.onSortChange?.({column:J,direction:w==="asc"?"desc":"asc"});},[m,w,a]),Je=react.useCallback(J=>{te(J),a.onColumnsChange?.(J);},[a]),ct=react.useCallback(J=>{let ve=j.map(He=>He.id===J?{...He,visible:false}:He);Je(ve);},[j,Je]),wt=react.useCallback((J,ve)=>{N(J),B(ve);},[]),vt=react.useCallback((J,ve,He)=>{b&&(J.preventDefault(),M({isOpen:true,x:J.clientX,y:J.clientY,type:ve?"task":"header",task:ve,columnId:He}));},[b]),U=react.useCallback(()=>{M(J=>({...J,isOpen:false}));},[]),me=react.useCallback((J,ve)=>{if(!h)return;J.preventDefault(),J.stopPropagation();let He=j.find(Le=>Le.id===ve);He&&(L(ve),q(J.clientX),ye(He.width));},[j,h]);react.useEffect(()=>{if(!R)return;let J=He=>{let Le=He.clientX-V,nt=Math.max(50,z+Le),st=j.map(_e=>_e.id===R?{..._e,width:nt}:_e);te(st);},ve=()=>{R&&a.onColumnsChange?.(j),L(null);};return document.addEventListener("mousemove",J),document.addEventListener("mouseup",ve),()=>{document.removeEventListener("mousemove",J),document.removeEventListener("mouseup",ve);}},[R,V,z,j,a]);let Ae=react.useCallback(async J=>{if(a.onCreateCustomField){let ve={...J,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(ve);}fe(false);},[a]),Fe=react.useCallback(J=>J.progress===100||J.status==="completed"?"completed":J.progress&&J.progress>0||J.status==="in-progress"?"in-progress":"todo",[]),je=react.useMemo(()=>{let J=ip(e);if(v.trim()){let ve=v.toLowerCase();J=J.filter(He=>He.name.toLowerCase().includes(ve));}return A!=="all"&&(J=J.filter(ve=>Fe(ve)===A)),W&&(J=J.filter(ve=>Fe(ve)!=="completed")),J.sort((ve,He)=>{let Le,nt;switch(m){case "name":Le=ve.name.toLowerCase(),nt=He.name.toLowerCase();break;case "startDate":Le=ve.startDate?.getTime()||0,nt=He.startDate?.getTime()||0;break;case "endDate":Le=ve.endDate?.getTime()||0,nt=He.endDate?.getTime()||0;break;case "progress":Le=ve.progress||0,nt=He.progress||0;break;case "status":Le=ve.status||"todo",nt=He.status||"todo";break;case "priority":let st={urgent:0,high:1,medium:2,low:3,none:4};Le=st[ve.priority]??4,nt=st[He.priority]??4;break;default:return 0}return Le<nt?w==="asc"?-1:1:Le>nt?w==="asc"?1:-1:0}),J},[e,v,A,W,m,w,Fe]),Qe=react.useCallback((J,ve)=>{let He=st=>{a.onTaskUpdate?.({...J,...st});},Le=st=>st?J.customFields?.find(ea=>ea.fieldId===st)?.value:void 0,nt=(st,_e)=>{if(!st)return;let ke=[...J.customFields||[]],be=ke.findIndex(Ke=>Ke.fieldId===st);be>=0?ke[be]={fieldId:st,value:_e}:ke.push({fieldId:st,value:_e}),He({customFields:ke});};switch(ve.type){case "name":return null;case "status":return jsxRuntime.jsx(Cm,{value:J.status||(J.progress===100?"completed":J.progress&&J.progress>0?"in-progress":"todo"),onChange:_e=>{He({status:_e,progress:_e==="completed"?100:_e==="in-progress"?50:0});},isDark:x,locale:p,translations:u.status});case "priority":return jsxRuntime.jsx(Nm,{value:J.priority,onChange:_e=>He({priority:_e}),isDark:x,locale:p});case "assignees":return jsxRuntime.jsx(Sm,{value:J.assignees||[],availableUsers:c,onChange:_e=>He({assignees:_e}),isDark:x,locale:p});case "startDate":return jsxRuntime.jsx(ps,{value:J.startDate,onChange:_e=>He({startDate:_e}),isDark:x,locale:p});case "endDate":return jsxRuntime.jsx(ps,{value:J.endDate,onChange:_e=>He({endDate:_e}),isDark:x,locale:p});case "progress":return jsxRuntime.jsx(Am,{value:J.progress||0,onChange:_e=>{let ea=_e===100?"completed":_e>0?"in-progress":"todo";He({progress:_e,status:ea});},isDark:x});case "tags":return jsxRuntime.jsx(Gm,{value:J.tags||[],isDark:x});case "text":return jsxRuntime.jsx(Im,{value:Le(ve.customFieldId)||"",onChange:_e=>nt(ve.customFieldId,_e),isDark:x});case "number":return jsxRuntime.jsx(Om,{value:Le(ve.customFieldId)||0,onChange:_e=>nt(ve.customFieldId,_e),isDark:x});case "date":let st=Le(ve.customFieldId);return jsxRuntime.jsx(ps,{value:st?new Date(st):void 0,onChange:_e=>nt(ve.customFieldId,_e),isDark:x,locale:p});case "dropdown":return jsxRuntime.jsx($m,{value:Le(ve.customFieldId)||"",options:ve.options||[],onChange:_e=>nt(ve.customFieldId,_e),isDark:x});case "checkbox":return jsxRuntime.jsx(zm,{value:Le(ve.customFieldId)||false,onChange:_e=>nt(ve.customFieldId,_e),isDark:x});default:return jsxRuntime.jsx("span",{className:d("text-sm",x?"text-[#94A3B8]":"text-gray-500"),children:"-"})}},[a,x,p,c,u]),Pt=react.useCallback(J=>({name:u.columns.name,status:u.columns.status,priority:u.columns.priority,assignees:u.columns.assignees,startDate:u.columns.startDate,endDate:u.columns.endDate,progress:u.columns.progress})[J.type]||J.label,[u]),Re=react.useMemo(()=>qe.reduce((J,ve)=>J+ve.width,0)+(C?48:0),[qe,C]);return r?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:[u.empty.noTasks,"..."]})]})}):o?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",x?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.List,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",x?"text-white":"text-gray-900"),children:u.empty.noTasks}),jsxRuntime.jsx("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:u.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{ref:ne,className:d("flex-1 flex flex-col w-full h-full overflow-hidden",x?"bg-[#0F1117]":"bg-white",R&&"select-none",s),style:n,children:[jsxRuntime.jsx("div",{className:d("flex-shrink-0 px-6 py-4 border-b",x?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx(op,{value:A,hideCompleted:W,onChange:T,onHideCompletedChange:$,isDark:x,locale:p}),f&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:d("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:v,onChange:J=>I(J.target.value),placeholder:u.toolbar.searchPlaceholder,className:d("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",x?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsxRuntime.jsxs("div",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:[je.length," ",u.pagination.tasks]})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsxs("div",{style:{minWidth:Re},children:[jsxRuntime.jsxs("div",{className:d("flex-shrink-0 flex items-center border-b text-xs font-medium uppercase tracking-wider sticky top-0 z-10",x?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[qe.map(J=>jsxRuntime.jsxs("div",{className:d("relative flex items-center gap-2 px-4 py-3",x?"text-[#9CA3AF]":"text-gray-500"),style:{width:J.width,minWidth:J.minWidth},onContextMenu:ve=>vt(ve,void 0,J.id),children:[J.sortable?jsxRuntime.jsxs("button",{onClick:()=>le(J.id),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[Pt(J),jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:d("w-3 h-3",m===J.id&&"text-[#3B82F6]")})]}):jsxRuntime.jsx("span",{children:Pt(J)}),h&&J.resizable&&jsxRuntime.jsx("div",{className:d("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#3B82F6]",R===J.id&&"bg-[#3B82F6]"),onMouseDown:ve=>me(ve,J.id)})]},J.id)),C&&jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center px-3 py-3",children:[jsxRuntime.jsx("button",{onClick:J=>{J.stopPropagation(),re(ve=>!ve);},className:d("p-1.5 rounded-lg transition-colors",x?"hover:bg-white/10 text-[#9CA3AF] hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",oe&&(x?"bg-white/10":"bg-gray-200")),title:p==="es"?"Agregar columna":"Add column",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(Zm,{isOpen:oe,onClose:()=>re(false),columns:j,customFields:g,onColumnsChange:Je,onCreateCustomField:()=>{re(false),fe(true);},isDark:x,locale:p})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:je.map((J,ve)=>{let He=Be.has(J.id);return jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{delay:ve*.02},className:d("flex items-center border-b transition-colors",x?"border-white/5 hover:bg-white/5":"border-gray-100 hover:bg-gray-50"),onClick:()=>a.onTaskClick?.(J),onDoubleClick:()=>a.onTaskDoubleClick?.(J),onContextMenu:Le=>vt(Le,J),children:[qe.map(Le=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-3 min-h-[52px]",style:{width:Le.width,minWidth:Le.minWidth},children:Le.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[y&&J.level>0&&jsxRuntime.jsx("div",{style:{width:`${J.level*24}px`},className:"flex-shrink-0"}),y&&J.hasChildren&&jsxRuntime.jsx("button",{onClick:nt=>{nt.stopPropagation(),tt(J.id);},className:d("p-0.5 rounded flex-shrink-0",x?"hover:bg-white/10":"hover:bg-gray-200"),children:He?jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")})}),y&&!J.hasChildren&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),jsxRuntime.jsx("button",{onClick:nt=>{nt.stopPropagation(),a.onTaskUpdate?.({...J,progress:J.progress===100?0:100,status:J.progress===100?"todo":"completed"});},className:"flex-shrink-0",children:jsxRuntime.jsx(lv,{status:J.status,progress:J.progress})}),jsxRuntime.jsx("span",{className:d("truncate font-medium",x?"text-white":"text-gray-900",J.progress===100&&(x?"line-through text-[#6B7280]":"line-through text-gray-400")),children:J.name})]}):Qe(J,Le)},Le.id)),C&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},J.id)})}),je.length===0&&v&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:d("w-12 h-12 mx-auto mb-4",x?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:d(x?"text-[#9CA3AF]":"text-gray-600"),children:u.empty.noResults})]})})]})}),jsxRuntime.jsx(Km,{state:Ie,onClose:U,isDark:x,locale:p,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:ct,onColumnSort:wt,availableUsers:c}),jsxRuntime.jsx(tp,{isOpen:ge,onClose:()=>fe(false),onSave:Ae,isDark:x,locale:p})]})}var dp=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:120,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"assignees",type:"assignees",label:"Assignees",width:150,visible:false,sortable:false,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true},{id:"tags",type:"tags",label:"Tags",width:150,visible:false,sortable:false,resizable:true}],cp=[{type:"name",labelKey:"columns.name",icon:"Type"},{type:"status",labelKey:"columns.status",icon:"CircleDot"},{type:"priority",labelKey:"columns.priority",icon:"Flag"},{type:"assignees",labelKey:"columns.assignees",icon:"Users"},{type:"startDate",labelKey:"columns.startDate",icon:"Calendar"},{type:"endDate",labelKey:"columns.endDate",icon:"CalendarCheck"},{type:"progress",labelKey:"columns.progress",icon:"BarChart"},{type:"tags",labelKey:"columns.tags",icon:"Tag"}],mp=[{type:"text",labelKey:"customFields.text",icon:"Type"},{type:"number",labelKey:"customFields.number",icon:"Hash"},{type:"date",labelKey:"customFields.date",icon:"Calendar"},{type:"dropdown",labelKey:"customFields.dropdown",icon:"ChevronDown"},{type:"checkbox",labelKey:"customFields.checkbox",icon:"CheckSquare"}];var pl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgSelected:"#1f6feb20",bgAlternate:"#0d111780",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff",checkboxBg:"#21262d",checkboxChecked:"#58a6ff"},ul={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgSelected:"#dbeafe",bgAlternate:"#f9fafb",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",checkboxBg:"#ffffff",checkboxChecked:"#0969da"},gl={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgSelected:"#0f4c7520",bgAlternate:"#1a1a2e80",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",checkboxBg:"#1f3460",checkboxChecked:"#6366f1"},fs={dark:pl,light:ul,neutral:gl};function pp(e){return fs[e]||fs.dark}var fl={navigation:{today:"Today",previous:"Previous",next:"Next",month:"Month",week:"Week",day:"Day"},weekdays:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weekdaysFull:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{allDay:"All day",moreEvents:"+{count} more",noEvents:"No tasks",newTask:"New Task",viewAll:"View all",week:"Week"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},bl={navigation:{today:"Hoy",previous:"Anterior",next:"Siguiente",month:"Mes",week:"Semana",day:"D\xEDa"},weekdays:{sun:"Dom",mon:"Lun",tue:"Mar",wed:"Mi\xE9",thu:"Jue",fri:"Vie",sat:"S\xE1b"},weekdaysFull:{sunday:"Domingo",monday:"Lunes",tuesday:"Martes",wednesday:"Mi\xE9rcoles",thursday:"Jueves",friday:"Viernes",saturday:"S\xE1bado"},months:{january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{allDay:"Todo el d\xEDa",moreEvents:"+{count} m\xE1s",noEvents:"Sin tareas",newTask:"Nueva Tarea",viewAll:"Ver todo",week:"Semana"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},bs={en:fl,es:bl};function ln(e){return bs[e]||bs.en}function hs(e,t){let a=ln(e);return t?{navigation:{...a.navigation,...t.navigation},weekdays:{...a.weekdays,...t.weekdays},weekdaysFull:{...a.weekdaysFull,...t.weekdaysFull},months:{...a.months,...t.months},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},tooltips:{...a.tooltips,...t.tooltips}}:a}function up(e){let t=ln(e);return [t.months.january,t.months.february,t.months.march,t.months.april,t.months.may,t.months.june,t.months.july,t.months.august,t.months.september,t.months.october,t.months.november,t.months.december]}function gp(e,t=0,a=true){let r=ln(e),o=a?[r.weekdays.sun,r.weekdays.mon,r.weekdays.tue,r.weekdays.wed,r.weekdays.thu,r.weekdays.fri,r.weekdays.sat]:[r.weekdaysFull.sunday,r.weekdaysFull.monday,r.weekdaysFull.tuesday,r.weekdaysFull.wednesday,r.weekdaysFull.thursday,r.weekdaysFull.friday,r.weekdaysFull.saturday];return [...o.slice(t),...o.slice(0,t)]}function Sv(e){let t=[];function a(r){for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);}return a(e),t}function wl(e,t){if(!t.startDate||!t.endDate)return false;let a=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.startDate.getFullYear(),t.startDate.getMonth(),t.startDate.getDate()),o=new Date(t.endDate.getFullYear(),t.endDate.getMonth(),t.endDate.getDate());return a>=r&&a<=o}function vp({task:e}){return e.progress===100||e.status==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-green-500 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3 h-3 text-blue-500 flex-shrink-0"}):jsxRuntime.jsx(lucideReact.Circle,{className:"w-3 h-3 text-gray-400 flex-shrink-0"})}function kp({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:n,style:c,availableTags:g=[],onCreateTag:i,attachmentsByTask:p,comments:l,onAddComment:f,currentUser:y,mentionableUsers:k,onTaskOpen:C}){let{theme:h="dark",locale:b="en",customTranslations:u}=t,x=hs(b,u),m=h==="dark",N={textTertiary:m?"#6B7280":"#9CA3AF",textSecondary:m?"#9CA3AF":"#6B7280",textPrimary:m?"#FFFFFF":"#111827",borderLight:m?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",border:m?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",bgPrimary:m?"#1A1D25":"#FFFFFF",bgSecondary:m?"#0F1117":"#F9FAFB",hoverBg:m?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"},[w,B]=react.useState(r||new Date),[v,I]=react.useState(null),[A,T]=react.useState(null),[W,$]=react.useState(null),[j,te]=react.useState(new Date),[oe,re]=react.useState({}),ge=4,fe=3,[Ie,M]=react.useState(false),[R,L]=react.useState(false),[V,q]=react.useState(false),[z,ye]=react.useState(false),[ne,Be]=react.useState(null),[qe,tt]=react.useState(""),[le,Je]=react.useState(void 0),[ct,wt]=react.useState(null),[vt,U]=react.useState(false),[me,Ae]=react.useState(false),[Fe,je]=react.useState(null),[Qe,Pt]=react.useState(false),[Re,J]=react.useState(new Date),[ve,He]=react.useState(false),[Le,nt]=react.useState(false),[st,_e]=react.useState(false),[ea,ke]=react.useState(""),[be,Ke]=react.useState(false),[F,Ce]=react.useState(""),[Z,Te]=react.useState(false),we=react.useCallback(()=>{B(new Date(w.getFullYear(),w.getMonth()-1,1));},[w]),Oe=react.useCallback(()=>{B(new Date(w.getFullYear(),w.getMonth()+1,1));},[w]),$e=react.useCallback(()=>{B(new Date);},[]),dt=react.useMemo(()=>{let P=w.getFullYear(),O=w.getMonth(),Me=new Date(P,O,1),Xe=new Date(P,O+1,0),Lt=Me.getDay(),de=Xe.getDate(),ze=Sv(e),xt=new Date;xt.setHours(0,0,0,0);let Ve=[],ft=Lt,aa=new Date(P,O,0).getDate();for(let jt=ft-1;jt>=0;jt--){let Ze=new Date(P,O-1,aa-jt);Ve.push({date:Ze,isCurrentMonth:false,isToday:false,isWeekend:Ze.getDay()===0||Ze.getDay()===6,events:ze.filter(Kt=>wl(Ze,Kt)).map(Kt=>({id:Kt.id,title:Kt.name,start:Kt.startDate,end:Kt.endDate,task:Kt}))});}for(let jt=1;jt<=de;jt++){let Ze=new Date(P,O,jt),Kt=Ze.getTime()===xt.getTime();Ve.push({date:Ze,isCurrentMonth:true,isToday:Kt,isWeekend:Ze.getDay()===0||Ze.getDay()===6,events:ze.filter(la=>wl(Ze,la)).map(la=>({id:la.id,title:la.name,start:la.startDate,end:la.endDate,task:la}))});}let Ca=42-Ve.length;for(let jt=1;jt<=Ca;jt++){let Ze=new Date(P,O+1,jt);Ve.push({date:Ze,isCurrentMonth:false,isToday:false,isWeekend:Ze.getDay()===0||Ze.getDay()===6,events:ze.filter(Kt=>wl(Ze,Kt)).map(Kt=>({id:Kt.id,title:Kt.name,start:Kt.startDate,end:Kt.endDate,task:Kt}))});}return Ve},[w,e]),_=b==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Y=w.toLocaleDateString(b==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),se=react.useCallback((P,O)=>{if(!v)return;let Me={...v,[P]:O};I(Me),a.onTaskUpdate?.(Me);},[v,a]),Ye=react.useCallback(P=>{if(!v)return;let O=v.progress||0;P==="completed"?O=100:P==="todo"&&(O=0);let Me={...v,status:P,progress:O};I(Me),a.onTaskUpdate?.(Me),M(false);},[v,a]),Ue=react.useCallback((P,O)=>{if(!v)return;let Me={...v,startDate:P,endDate:O};I(Me),a.onTaskUpdate?.(Me);},[v,a]),H=react.useCallback(()=>{M(false),L(false),q(false),$(null),_e(false),ke(""),Ke(false);},[]),ie=react.useCallback(async P=>{if(P.preventDefault(),P.stopPropagation(),He(false),!v||!a.onUploadAttachments)return;let O=Array.from(P.dataTransfer.files);if(O.length!==0){nt(true);try{await a.onUploadAttachments(v.id,O);}finally{nt(false);}}},[v,a]),We=react.useCallback(async P=>{if(!v||!a.onUploadAttachments||!P.target.files)return;let O=Array.from(P.target.files);if(O.length!==0){nt(true);try{await a.onUploadAttachments(v.id,O);}finally{nt(false);}P.target.value="";}},[v,a]),Mt=react.useCallback(P=>{P.preventDefault(),P.stopPropagation(),He(true);},[]),pt=react.useCallback(P=>{P.preventDefault(),P.stopPropagation(),He(false);},[]),Ar=react.useCallback(P=>P<1024?`${P} B`:P<1024*1024?`${(P/1024).toFixed(1)} KB`:`${(P/(1024*1024)).toFixed(1)} MB`,[]),wa=react.useCallback(P=>P.startsWith("image/")?lucideReact.Image:P.includes("pdf")||P.includes("document")?lucideReact.FileText:lucideReact.File,[]),ta=react.useMemo(()=>!v||!p?[]:p.get(v.id)||[],[v,p]);return o?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",m?"bg-[#0F1117]":"bg-white",n),style:c,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-600"),children:[x.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",m?"bg-[#0F1117]":"bg-white",n),style:c,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",m?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",m?"bg-[#0F1117]":"bg-white",n),style:c,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",m?"text-white":"text-gray-900"),children:x.labels.noEvents}),jsxRuntime.jsx("p",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-600"),children:x.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:d("flex-1 flex flex-col w-full h-full overflow-auto",m?"bg-[#0F1117]":"bg-white",n),style:c,children:[jsxRuntime.jsx("div",{className:d("flex-shrink-0 px-6 py-4 border-b",m?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("h2",{className:d("text-xl font-semibold capitalize",m?"text-white":"text-gray-900"),children:Y}),jsxRuntime.jsx("button",{onClick:$e,className:d("px-3 py-1.5 text-sm rounded-lg transition-colors",m?"bg-white/5 text-white hover:bg-white/10":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:x.navigation.today})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{onClick:we,className:d("p-2 rounded-lg transition-colors",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:d("w-5 h-5",m?"text-[#9CA3AF]":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:Oe,className:d("p-2 rounded-lg transition-colors",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-5 h-5",m?"text-[#9CA3AF]":"text-gray-600")})})]})]})}),jsxRuntime.jsx("div",{className:"flex-1 p-6 min-h-0",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-px mb-2",children:_.map(P=>jsxRuntime.jsx("div",{className:d("py-2 text-center text-xs font-medium uppercase",m?"text-[#9CA3AF]":"text-gray-500"),children:P},P))}),jsxRuntime.jsx("div",{className:d("grid grid-cols-7 auto-rows-min gap-px rounded-lg",m?"bg-[#2D2D2D]":"bg-gray-300"),children:dt.map((P,O)=>{let Me=P.date.getDay()===0||P.date.getDay()===6;return jsxRuntime.jsxs("div",{className:d("min-h-[120px] p-2 transition-colors flex flex-col relative group",m?Me?"bg-[#1C1F26]":P.isCurrentMonth?"bg-[#13161B]":"bg-[#0D0F13]":Me?"bg-gray-100":P.isCurrentMonth?"bg-white":"bg-gray-50",P.isToday&&"ring-2 ring-[#3B82F6] ring-inset"),children:[(()=>{let Xe=oe[O]||ge,Lt=P.events.slice(0,Xe),de=P.events.length-Xe;return jsxRuntime.jsxs("div",{className:"space-y-1 flex-1",children:[Lt.map(ze=>jsxRuntime.jsx("div",{className:"relative group",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{I(ze.task),a.onEventClick?.(ze),C?.(ze.task.id);},whileHover:{scale:1.02},className:d("w-full flex items-center gap-1 px-1.5 py-0.5 rounded text-xs truncate",ze.task.progress===100?m?"bg-green-500/20 text-green-400":"bg-green-500/10 text-green-600":m?"bg-[#3B82F6]/20 text-[#3B82F6]":"bg-[#3B82F6]/10 text-[#3B82F6]"),children:[jsxRuntime.jsx(vp,{task:ze.task}),jsxRuntime.jsx("span",{className:"truncate",children:ze.title})]})},ze.id)),de>0&&jsxRuntime.jsxs("button",{onClick:ze=>{ze.stopPropagation(),re(xt=>({...xt,[O]:Xe+fe}));},className:d("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",m?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:["+",de," ",b==="es"?"M\xC1S":"MORE"]}),Xe>ge&&P.events.length>ge&&jsxRuntime.jsx("button",{onClick:ze=>{ze.stopPropagation(),re(xt=>({...xt,[O]:ge}));},className:d("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",m?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:b==="es"?"MENOS":"LESS"})]})})(),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1",children:[(()=>{let Xe=O>=28,Lt=O%7>=5;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),ne===O?Be(null):(Be(O),tt(""),Je(void 0),wt(null),je(null),U(false),Ae(false),Pt(false),J(P.date));},className:d("w-5 h-5 rounded flex items-center justify-center transition-all",ne===O?"opacity-100 bg-[#7C3AED] text-white":"opacity-0 group-hover:opacity-100",m?"hover:bg-[#7C3AED] text-[#6B7280] hover:text-white":"hover:bg-[#7C3AED] text-gray-400 hover:text-white"),children:jsxRuntime.jsx(lucideReact.Plus,{className:d("w-3.5 h-3.5 transition-transform",ne===O&&"rotate-45")})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:ne===O&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{Be(null),tt(""),Je(void 0),wt(null),je(null),U(false),Ae(false),Pt(false);}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:Xe?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:Xe?-5:5,scale:.95},transition:{duration:.12},className:d("absolute w-[320px] rounded-lg shadow-2xl z-50",Xe?"bottom-full mb-1":"top-full mt-1",Lt?"right-0":"left-0",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>{de.stopPropagation(),U(false),Ae(false),Pt(false);},children:[jsxRuntime.jsx("div",{className:"p-2.5",children:jsxRuntime.jsx("input",{type:"text",value:qe,onChange:de=>tt(de.target.value),placeholder:b==="es"?'Escribe el nombre de la tarea o "/" para los comandos':'Type task name or "/" for commands',className:d("w-full bg-transparent text-sm outline-none placeholder:opacity-40",m?"text-white":"text-gray-900"),autoFocus:true,onKeyDown:de=>{if(de.key==="Enter"&&qe.trim()){let ze=t.availableUsers?.find(Ve=>Ve.id===ct),xt=Fe||P.date;a.onTaskCreate?.({name:qe.trim(),startDate:xt,endDate:xt,priority:le,assignees:ze?[ze]:void 0}),tt(""),Je(void 0),wt(null),je(null),Be(null);}de.key==="Escape"&&(Be(null),tt(""),Je(void 0),wt(null),je(null));}})}),jsxRuntime.jsxs("div",{className:d("px-2.5 py-2 flex items-center justify-between border-t",m?"border-white/10":"border-gray-100"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),U(!vt),Ae(false);},className:d("p-1 rounded transition-colors",le?le==="urgent"||le==="high"?"text-red-400 bg-red-500/20":le==="medium"?"text-yellow-400 bg-yellow-500/20":"text-green-400 bg-green-500/20":m?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:vt&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[120px]",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[{id:"urgent",label:b==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:b==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:b==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:b==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:b==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(de=>jsxRuntime.jsxs("button",{onClick:()=>{Je(de.id),U(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",le===de.id&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",de.color)}),jsxRuntime.jsx("span",{className:m?"text-white":"text-gray-900",children:de.label})]},de.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{onClick:de=>{de.stopPropagation(),Pt(!Qe),U(false),Ae(false),J(Fe||P.date);},className:d("flex items-center gap-1 text-xs px-1.5 py-0.5 rounded transition-colors",Fe?"bg-[#7C3AED]/20 text-[#7C3AED]":m?"bg-white/5 text-[#9CA3AF] hover:bg-white/10":"bg-gray-100 text-gray-500 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:"w-3 h-3"}),(Fe||P.date).toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Qe&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-xl shadow-2xl overflow-hidden flex",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[jsxRuntime.jsx("div",{className:d("w-40 py-2 border-r",m?"border-white/10":"border-gray-200"),children:(()=>{let de=new Date,ze=new Date(de);ze.setDate(de.getDate()+1);let xt=new Date(de);xt.setDate(de.getDate()+((6-de.getDay()+7)%7||7));let Ve=new Date(de);Ve.setDate(de.getDate()+((1-de.getDay()+7)%7||7));let ft=new Date(de);ft.setDate(de.getDate()+14);let aa=new Date(de);return aa.setDate(de.getDate()+28),[{label:b==="es"?"Hoy":"Today",date:de,display:de.toLocaleDateString(b==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:b==="es"?"Ma\xF1ana":"Tomorrow",date:ze,display:ze.toLocaleDateString(b==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:b==="es"?"Este fin de semana":"This weekend",date:xt,display:b==="es"?"s\xE1b.":"sat."},{label:b==="es"?"Pr\xF3xima semana":"Next week",date:Ve,display:b==="es"?"lun.":"mon."},{label:b==="es"?"2 semanas":"2 weeks",date:ft,display:ft.toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:b==="es"?"4 semanas":"4 weeks",date:aa,display:aa.toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((jt,Ze)=>jsxRuntime.jsxs("button",{className:d("w-full flex items-center justify-between px-3 py-1.5 text-xs transition-colors",m?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{je(jt.date),Pt(false);},children:[jsxRuntime.jsx("span",{children:jt.label}),jsxRuntime.jsx("span",{className:d("text-[10px]",m?"text-[#6B7280]":"text-gray-400"),children:jt.display})]},Ze))})()}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("span",{className:d("text-xs font-medium",m?"text-white":"text-gray-900"),children:Re.toLocaleDateString(b==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{onClick:()=>J(new Date),className:d("px-1.5 py-0.5 rounded text-[10px] transition-colors",m?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:b==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>J(new Date(Re.getFullYear(),Re.getMonth()-1)),className:d("p-0.5 rounded",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:()=>J(new Date(Re.getFullYear(),Re.getMonth()+1)),className:d("p-0.5 rounded",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(b==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(de=>jsxRuntime.jsx("div",{className:d("w-6 h-6 flex items-center justify-center text-[10px]",m?"text-[#6B7280]":"text-gray-400"),children:de},de))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let de=Re.getFullYear(),ze=Re.getMonth(),xt=new Date(de,ze,1).getDay(),Ve=new Date(de,ze+1,0).getDate(),ft=new Date(de,ze,0).getDate(),aa=new Date,Ca=[];for(let Ze=xt-1;Ze>=0;Ze--)Ca.push({dayNum:ft-Ze,isCurrentMonth:false,date:new Date(de,ze-1,ft-Ze)});for(let Ze=1;Ze<=Ve;Ze++)Ca.push({dayNum:Ze,isCurrentMonth:true,date:new Date(de,ze,Ze)});let jt=42-Ca.length;for(let Ze=1;Ze<=jt;Ze++)Ca.push({dayNum:Ze,isCurrentMonth:false,date:new Date(de,ze+1,Ze)});return Ca.map((Ze,Kt)=>{let la=Ze.date.toDateString()===aa.toDateString(),Fr=(Fe||P.date).toDateString()===Ze.date.toDateString();return jsxRuntime.jsx("button",{className:d("w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",!Ze.isCurrentMonth&&(m?"text-[#4B5563]":"text-gray-300"),Ze.isCurrentMonth&&(m?"text-white":"text-gray-900"),la&&"ring-1 ring-[#3B82F6]",Fr&&"bg-[#7C3AED] text-white",!Fr&&(m?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{je(Ze.date),Pt(false);},children:Ze.dayNum},Kt)})})()})]})]})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),Ae(!me),U(false);},className:d("p-1 rounded transition-colors",ct?"text-[#7C3AED] bg-[#7C3AED]/20":m?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:ct?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-[8px] font-medium",style:{backgroundColor:t.availableUsers?.find(de=>de.id===ct)?.color||"#7C3AED"},children:t.availableUsers?.find(de=>de.id===ct)?.initials||t.availableUsers?.find(de=>de.id===ct)?.name?.slice(0,2).toUpperCase()}):jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:me&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[160px] max-h-[200px] overflow-y-auto",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[jsxRuntime.jsxs("button",{onClick:()=>{wt(null),Ae(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",!ct&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded-full flex items-center justify-center",m?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3 h-3 text-gray-400"})}),jsxRuntime.jsx("span",{className:m?"text-[#9CA3AF]":"text-gray-500",children:b==="es"?"Sin asignar":"Unassigned"})]}),t.availableUsers?.map(de=>jsxRuntime.jsxs("button",{onClick:()=>{wt(de.id),Ae(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",ct===de.id&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-medium",style:{backgroundColor:de.color||"#7C3AED"},children:de.initials||de.name?.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:m?"text-white":"text-gray-900",children:de.name})]},de.id)),(!t.availableUsers||t.availableUsers.length===0)&&jsxRuntime.jsx("div",{className:d("px-3 py-2 text-xs",m?"text-[#6B7280]":"text-gray-400"),children:b==="es"?"No hay usuarios disponibles":"No users available"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>{if(qe.trim()){let de=t.availableUsers?.find(xt=>xt.id===ct),ze=Fe||P.date;a.onTaskCreate?.({name:qe.trim(),startDate:ze,endDate:ze,priority:le,assignees:de?[de]:void 0}),tt(""),Je(void 0),wt(null),je(null),Be(null);}},disabled:!qe.trim(),className:d("px-2.5 py-1 rounded text-xs font-medium transition-colors",qe.trim()?"bg-[#7C3AED] hover:bg-[#6D28D9] text-white":m?"bg-white/5 text-[#4B5563]":"bg-gray-100 text-gray-400"),children:b==="es"?"Guardar":"Save"})]})]})]})})]})})(),jsxRuntime.jsx("span",{className:d("text-sm font-medium",P.isToday?"text-[#3B82F6]":P.isCurrentMonth?m?"text-white":"text-gray-900":m?"text-[#6B7280]":"text-gray-400"),children:P.date.getDate()})]})]},O)})})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>{I(null),Ce("");},className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:d("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",m?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:d("px-6 py-3 border-b flex items-center gap-3",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Circle,{className:d("w-4 h-4",m?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("span",{className:d("text-xs px-2 py-0.5 rounded",m?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:[b==="es"?"Tarea":"Task"," \u2228"]}),jsxRuntime.jsx("span",{className:d("text-xs font-mono",m?"text-[#6B7280]":"text-gray-400"),children:v.id.slice(0,8)}),jsxRuntime.jsxs("button",{className:d("flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors",m?"bg-purple-500/20 text-purple-400 hover:bg-purple-500/30":"bg-purple-100 text-purple-700 hover:bg-purple-200"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-3 h-3"}),"Ask AI"]})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:d("p-1.5 rounded transition-colors",m?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.Maximize2,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{className:d("p-1.5 rounded transition-colors",m?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:()=>{I(null),Ce("");},className:d("p-1.5 rounded transition-colors",m?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{let P=v.progress===100?0:100,Me={...v,progress:P,status:P===100?"completed":"todo"};I(Me),a.onTaskUpdate?.(Me);},className:d("mt-1 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors",v.progress===100?"bg-green-500 border-green-500":m?"border-white/30 hover:border-white/50":"border-gray-300 hover:border-gray-400"),children:v.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("h2",{className:d("text-xl font-semibold flex-1",v.progress===100?"line-through text-[#6B7280]":m?"text-white":"text-gray-900"),children:v.name})]})}),jsxRuntime.jsxs("div",{className:"px-6 pb-6 flex-1 overflow-y-auto overflow-x-visible",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-12 gap-y-5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{H(),M(!Ie);},className:d("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",v.progress===100||v.status==="completed"?"bg-green-500/20 text-green-400":v.progress&&v.progress>0||v.status==="in-progress"?"bg-blue-500/20 text-blue-400":m?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:v.progress===100||v.status==="completed"?b==="es"?"COMPLETADO":"DONE":v.progress&&v.progress>0||v.status==="in-progress"?b==="es"?"EN PROGRESO":"IN PROGRESS":b==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ie&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>M(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:b==="es"?"Por hacer":"To Do",color:"bg-white/10 text-white"},{id:"in-progress",label:b==="es"?"En progreso":"In Progress",color:"bg-blue-500/20 text-blue-400"},{id:"completed",label:b==="es"?"Completado":"Done",color:"bg-green-500/20 text-green-400"}].map(P=>jsxRuntime.jsxs("button",{onClick:()=>Ye(P.id),className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",(v.status===P.id||P.id==="completed"&&v.progress===100||P.id==="in-progress"&&v.progress&&v.progress>0&&v.progress<100||P.id==="todo"&&(!v.progress||v.progress===0)&&v.status!=="in-progress"&&v.status!=="completed")&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",P.id==="completed"?"bg-green-500":P.id==="in-progress"?"bg-blue-500":"bg-gray-400")}),jsxRuntime.jsx("span",{className:m?"text-white":"text-gray-900",children:P.label})]},P.id))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.User,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Asignados":"Assignees"}),jsxRuntime.jsxs("button",{onClick:()=>{M(false),L(false),$(null),q(!V);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[v.assignees&&v.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[v.assignees.slice(0,3).map((P,O)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:P.color||"#8B5CF6"},title:P.name,children:P.initials||P.name.slice(0,2).toUpperCase()},O)),v.assignees.length>3&&jsxRuntime.jsxs("span",{className:d("text-xs",m?"text-[#6B7280]":"text-gray-400"),children:["+",v.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:d("text-sm",m?"text-[#6B7280]":"text-gray-400"),children:b==="es"?"Agregar":"Add"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",m?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:V&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>q(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[200px] max-h-[280px] overflow-y-auto",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:t.availableUsers&&t.availableUsers.length>0?t.availableUsers.map(P=>{let O=v.assignees?.some(Me=>Me.name===P.name);return jsxRuntime.jsxs("button",{onClick:()=>{let Me=v.assignees||[],Xe;O?Xe=Me.filter(Lt=>Lt.name!==P.name):Xe=[...Me,{name:P.name,avatar:P.avatar,initials:P.initials||P.name.slice(0,2).toUpperCase(),color:P.color||"#8B5CF6"}],se("assignees",Xe);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",m?"hover:bg-white/5":"hover:bg-gray-50",O&&(m?"bg-white/5":"bg-gray-50")),children:[P.avatar?jsxRuntime.jsx("img",{src:P.avatar,alt:P.name,className:"w-6 h-6 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:P.color||"#8B5CF6"},children:P.initials||P.name.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:d("flex-1 text-left",m?"text-white":"text-gray-900"),children:P.name}),O&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},P.id||P.name)}):jsxRuntime.jsx("div",{className:d("px-3 py-4 text-sm text-center",m?"text-[#6B7280]":"text-gray-400"),children:b==="es"?"No hay usuarios disponibles":"No users available"})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{$(W?null:"start"),te(v.startDate||new Date);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[v.startDate?.toLocaleDateString(b==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(b==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:d("mx-1",m?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),v.endDate?.toLocaleDateString(b==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(b==="es"?"Fin":"End"),(v.startDate||v.endDate)&&jsxRuntime.jsx(lucideReact.X,{className:"w-3.5 h-3.5 ml-1 opacity-50 hover:opacity-100",onClick:P=>{P.stopPropagation();}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:W&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>$(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:d("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:P=>P.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:d("w-44 py-2 border-r",m?"border-white/10":"border-gray-200"),children:[(()=>{let P=new Date,O=new Date(P);O.setDate(P.getDate()+1);let Me=new Date(P);Me.setDate(P.getDate()+((6-P.getDay()+7)%7||7));let Xe=new Date(P);Xe.setDate(P.getDate()+((1-P.getDay()+7)%7||7));let Lt=new Date(P);Lt.setDate(P.getDate()+(6-P.getDay()+7)%7+7);let de=new Date(P);de.setDate(P.getDate()+14);let ze=new Date(P);return ze.setDate(P.getDate()+28),[{label:b==="es"?"Hoy":"Today",date:P,display:P.toLocaleDateString(b==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:b==="es"?"Ma\xF1ana":"Tomorrow",date:O,display:O.toLocaleDateString(b==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:b==="es"?"Este fin de semana":"This weekend",date:Me,display:b==="es"?"s\xE1b.":"sat."},{label:b==="es"?"Pr\xF3xima semana":"Next week",date:Xe,display:b==="es"?"lun.":"mon."},{label:b==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:Lt,display:Lt.toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:b==="es"?"2 semanas":"2 weeks",date:de,display:de.toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:b==="es"?"4 semanas":"4 weeks",date:ze,display:ze.toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((Ve,ft)=>jsxRuntime.jsxs("button",{className:d("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",m?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{if(W==="start"){let aa=v.endDate&&Ve.date>v.endDate?Ve.date:v.endDate;Ue(Ve.date,aa),$("end");}else {let aa=v.startDate&&Ve.date<v.startDate?Ve.date:v.startDate;Ue(aa,Ve.date),$(null);}},children:[jsxRuntime.jsx("span",{children:Ve.label}),jsxRuntime.jsx("span",{className:d("text-xs",m?"text-[#6B7280]":"text-gray-400"),children:Ve.display})]},ft))})(),jsxRuntime.jsx("div",{className:d("border-t mt-2 pt-2",m?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{Ue(void 0,void 0),$(null);},className:d("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",m?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:b==="es"?"Quitar fechas":"Clear dates"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:d("text-xs mb-3 px-2 py-1 rounded",m?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:W==="start"?b==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":b==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:d("font-medium",m?"text-white":"text-gray-900"),children:j.toLocaleDateString(b==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>te(new Date),className:d("p-1 rounded text-sm transition-colors",m?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:b==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>te(new Date(j.getFullYear(),j.getMonth()-1)),className:d("p-1 rounded",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{onClick:()=>te(new Date(j.getFullYear(),j.getMonth()+1)),className:d("p-1 rounded",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(b==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(P=>jsxRuntime.jsx("div",{className:d("w-8 h-8 flex items-center justify-center text-xs",m?"text-[#6B7280]":"text-gray-400"),children:P},P))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:(()=>{let P=j.getFullYear(),O=j.getMonth(),Me=new Date(P,O,1).getDay(),Xe=new Date(P,O+1,0).getDate(),Lt=new Date(P,O,0).getDate(),de=new Date,ze=[];for(let Ve=Me-1;Ve>=0;Ve--)ze.push({day:Lt-Ve,isCurrentMonth:false,date:new Date(P,O-1,Lt-Ve)});for(let Ve=1;Ve<=Xe;Ve++)ze.push({day:Ve,isCurrentMonth:true,date:new Date(P,O,Ve)});let xt=42-ze.length;for(let Ve=1;Ve<=xt;Ve++)ze.push({day:Ve,isCurrentMonth:false,date:new Date(P,O+1,Ve)});return ze.map((Ve,ft)=>{let aa=Ve.date.toDateString()===de.toDateString(),Ca=v.startDate?.toDateString()===Ve.date.toDateString(),jt=v.endDate?.toDateString()===Ve.date.toDateString(),Ze=Ca||jt,Kt=v.startDate&&v.endDate&&Ve.date>=v.startDate&&Ve.date<=v.endDate;return jsxRuntime.jsx("button",{className:d("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!Ve.isCurrentMonth&&(m?"text-[#4B5563]":"text-gray-300"),Ve.isCurrentMonth&&(m?"text-white":"text-gray-900"),aa&&"ring-2 ring-[#3B82F6]",Ca&&"bg-[#3B82F6] text-white",jt&&!Ca&&"bg-[#7C3AED] text-white",Kt&&!Ze&&(m?"bg-[#7C3AED]/20":"bg-purple-100"),!Ze&&(m?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{let la=new Date(Ve.date);if(W==="start"){let Fr=v.endDate&&la>v.endDate?la:v.endDate;Ue(la,Fr),$("end");}else {let Fr=v.startDate&&la<v.startDate?la:v.startDate;Ue(Fr,la),$(null);}},children:Ve.day},ft)})})()})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{H(),L(!R);},className:d("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",v.priority==="high"||v.priority==="urgent"?"bg-red-500/20 text-red-400":v.priority==="medium"?"bg-yellow-500/20 text-yellow-400":v.priority==="low"?"bg-green-500/20 text-green-400":m?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:v.priority?v.priority==="high"||v.priority==="urgent"?b==="es"?"Urgente":"Urgent":v.priority==="medium"?b==="es"?"Media":"Medium":b==="es"?"Baja":"Low":b==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:R&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>L(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:b==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:b==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:b==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:b==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:b==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(P=>jsxRuntime.jsxs("button",{onClick:()=>{se("priority",P.id),L(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",v.priority===P.id&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",P.color)}),jsxRuntime.jsx("span",{className:m?"text-white":"text-gray-900",children:P.label})]},P.id||"none"))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:d("text-sm",m?"text-white":"text-gray-900"),children:v.startDate&&v.endDate?`${Math.ceil((v.endDate.getTime()-v.startDate.getTime())/(1e3*60*60*24))} ${b==="es"?"d\xEDas":"days"}`:b==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded-full border-2",m?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[z?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:v.progress||0,onChange:P=>{let O=parseInt(P.target.value),Me=v.status;O===100?Me="completed":O>0?Me="in-progress":Me="todo";let Xe={...v,progress:O,status:Me};I(Xe),a.onTaskUpdate?.(Xe);},onBlur:()=>ye(false),className:d("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",m?"bg-white/10":"bg-gray-200","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[#3B82F6] [&::-webkit-slider-thumb]:cursor-pointer"),autoFocus:true}):jsxRuntime.jsx("button",{onClick:()=>ye(true),className:d("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",m?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:d("h-full rounded-full transition-all",v.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${v.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:d("text-sm font-medium min-w-[40px]",m?"text-white":"text-gray-900"),children:[v.progress||0,"%"]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Etiquetas":"Tags"}),jsxRuntime.jsx(hr,{selectedTags:v.tags||[],availableTags:g,onChange:P=>{se("tags",P);},onCreateTag:i,theme:N})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Link2,{className:d("w-4 h-4 mt-1.5",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24 mt-1",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Relaciones":"Relations"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[v.dependencies&&v.dependencies.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:v.dependencies.map(P=>{let O=e.find(Me=>Me.id===P);return jsxRuntime.jsxs("span",{className:d("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",m?"bg-blue-500/20 text-blue-400":"bg-blue-100 text-blue-700"),children:[O?.name||P.slice(0,8),jsxRuntime.jsx("button",{onClick:()=>{let Me=(v.dependencies||[]).filter(Xe=>Xe!==P);se("dependencies",Me);},className:d("ml-0.5 hover:bg-white/20 rounded-full p-0.5 transition-colors"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},P)})}),jsxRuntime.jsxs("button",{onClick:()=>{H(),_e(!st);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Agregar dependencia":"Add dependency"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:st&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{_e(false),ke("");}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[280px] max-h-[320px]",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("div",{className:d("p-2 border-b",m?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("input",{type:"text",value:ea,onChange:P=>ke(P.target.value),placeholder:b==="es"?"Buscar tarea...":"Search task...",className:d("w-full px-3 py-2 rounded-md text-sm outline-none",m?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400"),autoFocus:true})}),jsxRuntime.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:e.length>0?e.filter(P=>P.id!==v.id).filter(P=>ea===""||P.name.toLowerCase().includes(ea.toLowerCase())).map(P=>{let O=v.dependencies?.includes(P.id);return jsxRuntime.jsxs("button",{onClick:()=>{let Me=v.dependencies||[],Xe;O?Xe=Me.filter(Lt=>Lt!==P.id):Xe=[...Me,P.id],se("dependencies",Xe);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",O&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0",O?"bg-blue-500 border-blue-500":m?"border-white/30":"border-gray-300"),children:O&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:d("block truncate",m?"text-white":"text-gray-900"),children:P.name}),jsxRuntime.jsx("span",{className:d("text-xs",m?"text-[#6B7280]":"text-gray-400"),children:P.id.slice(0,8)})]})]},P.id)}):jsxRuntime.jsx("div",{className:d("px-3 py-4 text-sm text-center",m?"text-[#6B7280]":"text-gray-500"),children:b==="es"?"No hay tareas disponibles":"No tasks available"})})]})]})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Palette,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:"Color"}),jsxRuntime.jsxs("button",{onClick:()=>{H(),Ke(!be);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:v.color||"#6366F1"}}),jsxRuntime.jsx("span",{className:d("text-sm",m?"text-white":"text-gray-900"),children:yr.find(P=>P.value===v.color)?.name||(b==="es"?"Azul":"Blue")}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",m?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:be&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Ke(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden p-3",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-6 gap-1.5",children:yr.map(P=>{let O=v.color===P.value;return jsxRuntime.jsx("button",{onClick:()=>{se("color",P.value),Ke(false);},className:d("w-7 h-7 rounded-full flex items-center justify-center transition-all",O&&"ring-2 ring-offset-2",m?"ring-offset-[#1A1D25]":"ring-offset-white"),style:{backgroundColor:P.value,outlineColor:O?P.value:void 0},title:P.name,children:O&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 text-white"})},P.value)})})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Diamond,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Hito":"Milestone"}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:v.isMilestone||false,onChange:P=>se("isMilestone",P.target.checked),className:d("w-4 h-4 rounded border-2 cursor-pointer appearance-none transition-colors",v.isMilestone?"bg-purple-500 border-purple-500":m?"border-white/30 bg-transparent":"border-gray-300 bg-transparent","checked:bg-purple-500 checked:border-purple-500")}),jsxRuntime.jsx("span",{className:d("text-sm",m?"text-white":"text-gray-900"),children:b==="es"?"Marcar como hito":"Mark as milestone"})]})]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.FileText,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("h3",{className:d("text-sm font-semibold",m?"text-white":"text-gray-900"),children:b==="es"?"Descripci\xF3n":"Description"})]}),jsxRuntime.jsx("textarea",{value:v.description||"",onChange:P=>se("description",P.target.value),placeholder:b==="es"?"Agregar descripci\xF3n...":"Add description...",className:d("w-full min-h-[100px] px-3 py-2 rounded-lg text-sm resize-none outline-none transition-colors",m?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400 focus:bg-gray-200")}),jsxRuntime.jsxs("button",{className:d("flex items-center gap-2 text-sm mt-2 transition-colors",m?"text-purple-400 hover:text-purple-300":"text-purple-600 hover:text-purple-700"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4"}),b==="es"?"Escribe con IA":"Write with AI"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold mb-3",m?"text-white":"text-gray-900"),children:b==="es"?"Campos personalizados":"Custom fields"}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),b==="es"?"Crea un campo en esta lista":"Create a field in this list"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold mb-3",m?"text-white":"text-gray-900"),children:b==="es"?"Agregar subtarea":"Add subtask"}),v.subtasks&&v.subtasks.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-3",children:v.subtasks.map(P=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded border flex items-center justify-center cursor-pointer",P.progress===100?"bg-green-500 border-green-500":m?"border-white/20 hover:border-white/40":"border-gray-300 hover:border-gray-400"),children:P.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:d("text-sm",P.progress===100?"line-through text-[#6B7280]":m?"text-white":"text-gray-900"),children:P.name})]},P.id))}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),b==="es"?"Add Tarea":"Add Task"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold",m?"text-white":"text-gray-900"),children:b==="es"?"Listas de control":"Checklists"}),jsxRuntime.jsx("button",{className:d("p-1 rounded transition-colors",m?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.ListChecks,{className:"w-4 h-4"}),b==="es"?"Crear lista de control":"Create checklist"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("h3",{className:d("text-sm font-semibold mb-3",m?"text-white":"text-gray-900"),children:[b==="es"?"Adjuntos":"Attachments",ta.length>0&&jsxRuntime.jsxs("span",{className:d("ml-2 text-xs font-normal",m?"text-[#6B7280]":"text-gray-400"),children:["(",ta.length,")"]})]}),ta.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-4",children:ta.map(P=>{let O=wa(P.type),Me=P.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:d("flex items-center gap-3 p-2 rounded-lg group transition-colors",m?"bg-white/5 hover:bg-white/10":"bg-gray-50 hover:bg-gray-100"),children:[Me&&P.thumbnailUrl?jsxRuntime.jsx("img",{src:P.thumbnailUrl,alt:P.name,className:"w-10 h-10 rounded object-cover"}):jsxRuntime.jsx("div",{className:d("w-10 h-10 rounded flex items-center justify-center",m?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(O,{className:d("w-5 h-5",m?"text-[#9CA3AF]":"text-gray-500")})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("a",{href:P.url,target:"_blank",rel:"noopener noreferrer",className:d("text-sm font-medium truncate block hover:underline",m?"text-white":"text-gray-900"),children:P.name}),jsxRuntime.jsx("p",{className:d("text-xs",m?"text-[#6B7280]":"text-gray-400"),children:Ar(P.size)})]}),a.onDeleteAttachment&&jsxRuntime.jsx("button",{onClick:()=>a.onDeleteAttachment?.(P.id),className:d("p-1.5 rounded opacity-0 group-hover:opacity-100 transition-all",m?"hover:bg-red-500/20 text-red-400":"hover:bg-red-100 text-red-500"),title:b==="es"?"Eliminar":"Delete",children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},P.id)})}),jsxRuntime.jsxs("div",{onDragOver:Mt,onDragLeave:pt,onDrop:ie,className:d("border-2 border-dashed rounded-lg p-6 text-center transition-all cursor-pointer relative",ve?m?"border-blue-500 bg-blue-500/10":"border-blue-400 bg-blue-50":m?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300",Le&&"pointer-events-none opacity-50"),children:[jsxRuntime.jsx("input",{type:"file",multiple:true,onChange:We,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:!a.onUploadAttachments||Le}),Le?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-6 h-6 mx-auto mb-2 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"}),jsxRuntime.jsx("p",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Subiendo...":"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Upload,{className:d("w-6 h-6 mx-auto mb-2",ve?"text-blue-500":m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-500"),children:ve?b==="es"?"Suelta los archivos aqu\xED":"Drop files here":b==="es"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Suelta tus archivos aqu\xED o ",jsxRuntime.jsx("span",{className:"underline",children:"haz clic para subir"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Drop your files here or ",jsxRuntime.jsx("span",{className:"underline",children:"click to upload"})]})}),!a.onUploadAttachments&&jsxRuntime.jsx("p",{className:d("text-xs mt-1",m?"text-[#6B7280]":"text-gray-400"),children:b==="es"?"Upload no disponible":"Upload not available"})]})]})]})]})]}),jsxRuntime.jsxs("div",{className:d("w-80 border-l flex flex-col",m?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsx("div",{className:d("px-4 py-3 border-b",m?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("h3",{className:d("text-sm font-semibold",m?"text-white":"text-gray-900"),children:[b==="es"?"Actividad":"Activity",l&&l.length>0&&jsxRuntime.jsxs("span",{className:d("ml-2 text-xs font-normal",m?"text-[#6B7280]":"text-gray-400"),children:["(",l.length,")"]})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:l&&l.length>0?jsxRuntime.jsx("div",{className:"space-y-4",children:l.map(P=>{let O=(()=>{let Me=new Date,Xe=new Date(P.createdAt),Lt=Me.getTime()-Xe.getTime(),de=Math.floor(Lt/6e4),ze=Math.floor(de/60),xt=Math.floor(ze/24);return de<1?b==="es"?"ahora":"now":de<60?b==="es"?`hace ${de}m`:`${de}m ago`:ze<24?b==="es"?`hace ${ze}h`:`${ze}h ago`:b==="es"?`hace ${xt}d`:`${xt}d ago`})();return jsxRuntime.jsxs("div",{className:"flex gap-3",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:"#8B5CF6"},children:P.user?.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsx("span",{className:d("text-sm font-medium",m?"text-white":"text-gray-900"),children:P.user?.name||(b==="es"?"Usuario":"User")}),jsxRuntime.jsx("span",{className:d("text-xs",m?"text-[#6B7280]":"text-gray-400"),children:O})]}),jsxRuntime.jsx("p",{className:d("text-sm break-words",m?"text-[#9CA3AF]":"text-gray-600"),children:P.content})]})]},P.id)})}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:d("w-10 h-10 mb-3",m?"text-[#3B4252]":"text-gray-300")}),jsxRuntime.jsx("p",{className:d("text-sm",m?"text-[#6B7280]":"text-gray-500"),children:b==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsxRuntime.jsx("div",{className:d("p-4 border-t",m?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[y&&jsxRuntime.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:y.color||"#8B5CF6"},children:y.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:d("flex-1 flex items-center gap-2 px-3 py-2 rounded-lg",m?"bg-white/5":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("input",{type:"text",value:F,onChange:P=>Ce(P.target.value),onKeyDown:async P=>{if(P.key==="Enter"&&!P.shiftKey&&v&&F.trim()&&f){P.preventDefault(),Te(true);try{await f(v.id,F.trim()),Ce("");}finally{Te(false);}}},placeholder:b==="es"?"Escribe un comentario...":"Write a comment...",disabled:Z||!f,className:d("flex-1 bg-transparent text-sm outline-none",m?"text-white placeholder:text-[#6B7280]":"text-gray-900 placeholder:text-gray-400",(Z||!f)&&"opacity-50")}),jsxRuntime.jsx("button",{onClick:async()=>{if(v&&F.trim()&&f){Te(true);try{await f(v.id,F.trim()),Ce("");}finally{Te(false);}}},disabled:Z||!F.trim()||!f,className:d("p-1.5 rounded transition-colors",F.trim()&&f?"bg-blue-500 text-white hover:bg-blue-600":m?"text-[#6B7280]":"text-gray-400",Z&&"opacity-50 cursor-not-allowed"),children:Z?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Send,{className:"w-4 h-4"})})]})]})})]})]})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:A&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>T(null),className:"fixed inset-0 bg-black/30 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:d("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[320px] max-h-[400px] rounded-xl shadow-2xl z-50 overflow-hidden",m?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:d("px-4 py-3 border-b flex items-center justify-between",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:d("font-medium",m?"text-white":"text-gray-900"),children:A.date.toLocaleDateString(b==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>T(null),className:d("p-1 rounded",m?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),jsxRuntime.jsx("div",{className:"p-3 max-h-[320px] overflow-y-auto space-y-2",children:A.events.map(P=>jsxRuntime.jsxs("button",{onClick:()=>{T(null),I(P.task),C?.(P.task.id);},className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",m?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx(vp,{task:P.task}),jsxRuntime.jsx("span",{className:d("text-sm truncate flex-1",m?"text-white":"text-gray-900"),children:P.title}),P.task.priority==="high"||P.task.priority==="urgent"?jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"}):null]},P.id))})]})]})})]})}var Cl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgToday:"#1f6feb20",bgWeekend:"#161b2280",bgOtherMonth:"#0d111750",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",textToday:"#58a6ff",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff"},Tl={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgToday:"#dbeafe",bgWeekend:"#f9fafb",bgOtherMonth:"#f3f4f680",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",textToday:"#0969da",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da"},Nl={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgToday:"#6366f120",bgWeekend:"#16213e80",bgOtherMonth:"#1a1a2e50",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",textToday:"#818cf8",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1"},vs={dark:Cl,light:Tl,neutral:Nl};function wp(e){return vs[e]||vs.dark}function Pv({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:n,className:c}){let[g,i]=react.useState(false),p=react.useMemo(()=>t.filter(y=>e.cardIds.includes(y.id)),[t,e.cardIds]),l=react.useMemo(()=>{let y=p.length,k=new Set(p.flatMap(b=>b.assignedUserIds||[])).size,C=p.map(b=>b.priority).filter(Boolean),h=new Set(p.flatMap(b=>b.labels||[])).size;return {totalCards:y,uniqueAssignees:k,priorities:C,labels:h}},[p]),f=()=>{o?.(e.id);};return jsxRuntime.jsxs("div",{className:d("card-stack",!e.isExpanded&&"card-stack-collapsed",c),onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:f,children:[jsxRuntime.jsxs("div",{className:"card-stack-header-left",children:[jsxRuntime.jsx("button",{className:"card-stack-toggle","aria-label":e.isExpanded?"Collapse":"Expand",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:d("card-stack-chevron",e.isExpanded&&"expanded"),children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})})}),jsxRuntime.jsx("h3",{className:"card-stack-title",children:e.title}),jsxRuntime.jsx("div",{className:"card-stack-badge",children:l.totalCards}),jsxRuntime.jsxs("div",{className:"card-stack-strategy",children:[e.strategy==="ai-similarity"&&"\u2728 AI",e.strategy==="manual"&&"\u{1F464} Manual",e.strategy==="labels"&&"\u{1F3F7}\uFE0F Labels",e.strategy==="assignee"&&"\u{1F465} Assignee",e.strategy==="priority"&&"\u{1F3AF} Priority",e.strategy==="epic"&&"\u{1F4DA} Epic"]})]}),g&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:y=>{y.stopPropagation(),n?.(e.id);},"aria-label":"Delete stack",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]}),!e.isExpanded&&jsxRuntime.jsxs("div",{className:"card-stack-summary",children:[jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsxs("span",{children:[l.uniqueAssignees," assignees"]})]}),l.labels>0&&jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsxs("span",{children:[l.labels," labels"]})]}),e.confidence&&jsxRuntime.jsx("div",{className:"card-stack-summary-item",children:jsxRuntime.jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsxRuntime.jsx("div",{className:"card-stack-content",children:p.length===0?jsxRuntime.jsxs("div",{className:"card-stack-empty",children:[jsxRuntime.jsx("p",{children:"No cards in this stack"}),jsxRuntime.jsx("span",{children:"Drag cards here or delete this stack"})]}):jsxRuntime.jsx("div",{className:"card-stack-cards",children:p.map(y=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(y),children:a(y)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(y),children:[jsxRuntime.jsx("h4",{children:y.title}),y.description&&jsxRuntime.jsxs("p",{children:[y.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:k=>{k.stopPropagation(),s?.(e.id,y.id);},"aria-label":"Remove from stack",children:jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},y.id))})})]})}var Tp={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function mn(e){switch(e.type){case "created":return "Created card";case "status_changed":return `Changed status from "${e.changes.status?.from}" to "${e.changes.status?.to}"`;case "assignee_changed":return "Changed assignee";case "priority_changed":return `Changed priority from ${e.changes.priority?.from} to ${e.changes.priority?.to}`;case "moved":return `Moved from ${e.metadata?.fromColumn||"unknown"} to ${e.metadata?.toColumn||"unknown"}`;case "title_updated":return "Updated title";case "description_updated":return "Updated description";case "dates_changed":return "Changed dates";case "labels_changed":return "Updated labels";case "dependency_added":return "Added dependency";case "dependency_removed":return "Removed dependency";case "comment_added":return "Added comment";case "archived":return "Archived card";case "restored":return "Restored card";default:return "Updated card"}}function pn(e){return {created:"\u2728",status_changed:"\u{1F504}",assignee_changed:"\u{1F464}",priority_changed:"\u{1F3AF}",moved:"\u27A1\uFE0F",title_updated:"\u270F\uFE0F",description_updated:"\u{1F4DD}",dates_changed:"\u{1F4C5}",labels_changed:"\u{1F3F7}\uFE0F",dependency_added:"\u{1F517}",dependency_removed:"\u26D3\uFE0F\u200D\u{1F4A5}",comment_added:"\u{1F4AC}",archived:"\u{1F4E6}",restored:"\u267B\uFE0F"}[e]||"\u{1F4CC}"}function Np(e){return {created:"#10b981",status_changed:"#3b82f6",assignee_changed:"#8b5cf6",priority_changed:"#f59e0b",moved:"#06b6d4",title_updated:"#6366f1",description_updated:"#6366f1",dates_changed:"#ec4899",labels_changed:"#14b8a6",dependency_added:"#a855f7",dependency_removed:"#ef4444",comment_added:"#84cc16",archived:"#6b7280",restored:"#10b981"}[e]||"#6b7280"}function Dp({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:n,className:c}){let g=react.useMemo(()=>({...Tp,...n}),[n]),[i,p]=react.useState(new Set),l=react.useRef(null),f=react.useMemo(()=>{if(!g.groupByDay)return [{date:null,events:e}];let u=new Map;return e.forEach(x=>{let m=x.timestamp.toISOString().split("T")[0],N=u.get(m);N?N.push(x):u.set(m,[x]);}),Array.from(u.entries()).sort((x,m)=>m[0].localeCompare(x[0])).map(([x,m])=>({date:new Date(x),events:m.sort((N,w)=>w.timestamp.getTime()-N.timestamp.getTime())}))},[e,g.groupByDay]),{uniqueUsers:y,uniqueTypes:k}=react.useMemo(()=>{let u=new Set,x=new Set;return e.forEach(m=>{u.add(m.userId),x.add(m.type);}),{uniqueUsers:Array.from(u),uniqueTypes:Array.from(x)}},[e]),C=u=>{p(x=>{let m=new Set(x);return m.has(u)?m.delete(u):m.add(u),m});},h=u=>{let m=new Date().getTime()-u.getTime(),N=Math.floor(m/6e4),w=Math.floor(m/36e5),B=Math.floor(m/864e5);return N<1?"just now":N<60?`${N}m ago`:w<24?`${w}h ago`:B<7?`${B}d ago`:u.toLocaleDateString()},b=react.useMemo(()=>{let u=0;return t.types&&t.types.length>0&&u++,t.users&&t.users.length>0&&u++,t.dateRange&&u++,t.searchTerm&&u++,u},[t]);return react.useEffect(()=>{if(s&&l.current){let u=l.current.querySelector(`[data-event-id="${s}"]`);u&&u.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:d("history-timeline-empty",c),children:[jsxRuntime.jsx("div",{className:"history-timeline-empty-icon",children:"\u{1F4DC}"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-text",children:"No history events yet"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-subtext",children:"Changes to this card will appear here"})]}):jsxRuntime.jsxs("div",{className:d("history-timeline",g.compact&&"compact",c),children:[jsxRuntime.jsxs("div",{className:"history-timeline-filters",children:[jsxRuntime.jsxs("div",{className:"history-timeline-filter-group",children:[jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:u=>{let x=u.target.value;a({...t,types:x?[x]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),k.map(u=>jsxRuntime.jsxs("option",{value:u,children:[pn(u)," ",u.replace("_"," ")]},u))]}),y.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:u=>{let x=u.target.value;a({...t,users:x?[x]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),y.map(u=>jsxRuntime.jsx("option",{value:u,children:u},u))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:u=>a({...t,searchTerm:u.target.value})})]}),b>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",b,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:l,children:f.map(u=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[g.groupByDay&&u.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:u.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[u.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:u.events.map((x,m)=>{let N=i.has(x.id),w=s===x.id,B=Np(x.type);return jsxRuntime.jsxs("div",{"data-event-id":x.id,className:d("history-timeline-event",N&&"expanded",w&&"selected"),onClick:()=>o?.(x),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:B},children:g.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:pn(x.type)})}),m<u.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:B}})]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-content",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header-left",children:[g.showAvatars&&x.userAvatar&&jsxRuntime.jsx("img",{src:x.userAvatar,alt:x.userName||x.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:x.userName||x.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:mn(x)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:g.useRelativeTime?h(x.timestamp):x.timestamp.toLocaleString()})]}),Object.keys(x.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:v=>{v.stopPropagation(),C(x.id);},children:[N?"\u25BC":"\u25B6"," Show changes"]}),N&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(x.changes).map(([v,I])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[v,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(I.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(I.to)})]})]},v)),x.metadata&&Object.keys(x.metadata).length>0&&jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata",children:[jsxRuntime.jsx("div",{className:"history-timeline-event-metadata-title",children:"Additional Info:"}),Object.entries(x.metadata).map(([v,I])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[v,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(I)})]},v))]})]})]})]},x.id)})})]},u.date?.toISOString()||"all"))})]})}function Ep({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:n,onGoToEvent:c,onSpeedChange:g,className:i}){let p=[.5,1,1.5,2,3],l=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),f=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:d("history-replay-empty",i),children:[jsxRuntime.jsx("div",{className:"history-replay-empty-icon",children:"\u23F3"}),jsxRuntime.jsx("p",{className:"history-replay-empty-text",children:"No history to replay"})]}):e?jsxRuntime.jsxs("div",{className:d("history-replay",i),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:l&&pn(l.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:l&&mn(l)}),jsxRuntime.jsxs("div",{className:"history-replay-event-meta",children:[jsxRuntime.jsxs("span",{className:"history-replay-event-index",children:["Event ",e.currentIndex+1," of ",e.totalEvents]}),jsxRuntime.jsx("span",{className:"history-replay-event-time",children:l&&l.timestamp.toLocaleString()})]})]})]}),jsxRuntime.jsxs("div",{className:"history-replay-progress-container",children:[jsxRuntime.jsx("input",{type:"range",className:"history-replay-progress-slider",min:"0",max:e.totalEvents-1,value:e.currentIndex,onChange:y=>c(parseInt(y.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${f}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((y,k)=>jsxRuntime.jsx("div",{className:d("history-replay-progress-marker",k===e.currentIndex&&"active"),style:{left:`${k/(e.totalEvents-1)*100}%`},onClick:()=>c(k),title:mn(y)},y.id))})]}),jsxRuntime.jsxs("div",{className:"history-replay-controls",children:[jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:s,disabled:!e.canGoBack,title:"Previous event (\u2190)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"19 20 9 12 19 4 19 20"}),jsxRuntime.jsx("line",{x1:"5",y1:"19",x2:"5",y2:"5"})]})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-control-play",onClick:o,title:e.isPlaying?"Pause (Space)":"Play (Space)",children:e.isPlaying?jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),jsxRuntime.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}):jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:n,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsxRuntime.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxRuntime.jsxs("div",{className:"history-replay-speed",children:[jsxRuntime.jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsxRuntime.jsx("div",{className:"history-replay-speed-buttons",children:p.map(y=>jsxRuntime.jsxs("button",{className:d("history-replay-speed-btn",e.speed===y&&"active"),onClick:()=>g(y),children:[y,"x"]},y))})]}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:r,title:"Stop replay (Esc)",children:jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})})]}),jsxRuntime.jsxs("div",{className:"history-replay-shortcuts",children:[jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Space"})," Play/Pause"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2190"})," Previous"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2192"})," Next"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Esc"})," Stop"]})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-header",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-title",children:"Card State at This Point"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-time",children:l&&l.timestamp.toLocaleDateString()})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-content",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Title:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.title})]}),e.cardState.description&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Description:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.description})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Priority:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.priority||"None"})]}),e.cardState.labels&&e.cardState.labels.length>0&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Labels:"}),jsxRuntime.jsx("div",{className:"history-replay-card-preview-labels",children:e.cardState.labels.map(y=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:y},y))})]})]})]})]}):jsxRuntime.jsxs("div",{className:d("history-replay-start",i),children:[jsxRuntime.jsxs("button",{className:"history-replay-start-button",onClick:a,children:[jsxRuntime.jsx("svg",{className:"history-replay-start-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),jsxRuntime.jsx("span",{children:"Start Time Travel"})]}),jsxRuntime.jsxs("p",{className:"history-replay-start-hint",children:["Replay ",t.length," events from this card's history"]})]})}function Dl(e){return {blocks:"#ef4444",blocked_by:"#dc2626",depends_on:"#f59e0b",required_by:"#d97706",relates_to:"#6b7280",duplicates:"#8b5cf6",parent_of:"#3b82f6",child_of:"#2563eb",similar_to:"#10b981"}[e]||"#6b7280"}function Sl(e){return {blocks:"Blocks",blocked_by:"Blocked by",depends_on:"Depends on",required_by:"Required by",relates_to:"Relates to",duplicates:"Duplicates",parent_of:"Parent of",child_of:"Child of",similar_to:"Similar to"}[e]||e}function Pp(e){return {blocks:"\u{1F6AB}",blocked_by:"\u26D4",depends_on:"\u{1F517}",required_by:"\u{1F4CC}",relates_to:"\u{1F504}",duplicates:"\u{1F4CB}",parent_of:"\u{1F4C2}",child_of:"\u{1F4C4}",similar_to:"\u{1F50D}"}[e]||"\u{1F517}"}function Mp(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Bv(e,t,a,r,o,s=100){let n=e.map(g=>({...g,x:g.x??a/2+Math.random()*100-50,y:g.y??r/2+Math.random()*100-50,vx:0,vy:0})),c=new Map(n.map(g=>[g.id,g]));for(let g=0;g<s;g++){let i=1-g/s;n.forEach(p=>{let l=a/2,f=r/2;p.vx+=(l-p.x)*o.centerForce*i,p.vy+=(f-p.y)*o.centerForce*i,n.forEach(y=>{if(p.id===y.id)return;let k=p.x-y.x,C=p.y-y.y,h=Math.sqrt(k*k+C*C)||1,b=o.chargeStrength*i/(h*h);p.vx+=k/h*b,p.vy+=C/h*b;});}),t.forEach(p=>{let l=c.get(typeof p.source=="string"?p.source:p.source.id),f=c.get(typeof p.target=="string"?p.target:p.target.id);if(!l||!f)return;let y=f.x-l.x,k=f.y-l.y,C=Math.sqrt(y*y+k*k)||1,h=(C-o.linkDistance)/C*o.forceStrength*i;l.vx+=y*h,l.vy+=k*h,f.vx-=y*h,f.vy-=k*h;}),n.forEach(p=>{p.fx!==null&&p.fx!==void 0?(p.x=p.fx,p.vx=0):p.x+=p.vx,p.fy!==null&&p.fy!==void 0?(p.y=p.fy,p.vy=0):p.y+=p.vy,p.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,p.x)),p.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,p.y)),p.vx*=.9,p.vy*=.9;});}return n}function Ap({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:n,onInteraction:c,className:g}){let i=react.useRef(null),[p,l]=react.useState([]),[f,y]=react.useState(null),[k,C]=react.useState(null),[h,b]=react.useState(null),[u,x]=react.useState(1),[m,N]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let $=Bv(e,t,a.width,a.height,a,150);l($);},[e,t,a]);let w=react.useCallback(($,j)=>{a.enableDragging&&(j.stopPropagation(),y($));},[a.enableDragging]),B=react.useCallback($=>{if(!f||!i.current)return;let te=i.current.getBoundingClientRect(),oe=($.clientX-te.left-m.x)/u,re=($.clientY-te.top-m.y)/u;l(ge=>ge.map(fe=>fe.id===f?{...fe,x:oe,y:re,fx:oe,fy:re}:fe));},[f,u,m]),v=react.useCallback(()=>{y(null);},[]),I=react.useCallback(($,j)=>{j.stopPropagation(),c?.({type:"node-click",node:$,position:{x:j.clientX,y:j.clientY}});},[c]),A=react.useCallback(($,j)=>{j.stopPropagation(),c?.({type:"edge-click",edge:$,position:{x:j.clientX,y:j.clientY}});},[c]),T=react.useCallback($=>{let j=p.find(te=>te.id===$);return j?{x:j.x,y:j.y}:{x:0,y:0}},[p]),W=react.useCallback($=>{if($.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return $.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let j=$.card.priority;return j==="URGENT"?"#ef4444":j==="HIGH"?"#f59e0b":j==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return $.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:d("relationships-graph-empty",g),children:[jsxRuntime.jsx("div",{className:"relationships-graph-empty-icon",children:"\u{1F517}"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-text",children:"No relationships to display"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-subtext",children:"Add relationships between cards to see the graph"})]}):jsxRuntime.jsxs("div",{className:d("relationships-graph",g),children:[jsxRuntime.jsxs("div",{className:"relationships-graph-controls",children:[jsxRuntime.jsxs("div",{className:"relationships-graph-stats",children:[jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:n.totalNodes}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Cards"})]}),jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:n.totalEdges}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),s&&jsxRuntime.jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:s.cardIds.length}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),a.enableZoom&&jsxRuntime.jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>x($=>Math.min($+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(u*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>x($=>Math.max($-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{x(1),N({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map($=>$.type))).map($=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:Dl($)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[Pp($)," ",Sl($)]})]},$))}),jsxRuntime.jsxs("svg",{ref:i,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:B,onMouseUp:v,onMouseLeave:v,children:[jsxRuntime.jsxs("g",{transform:`translate(${m.x}, ${m.y}) scale(${u})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map($=>{let j=T(typeof $.source=="string"?$.source:$.source.id),te=T(typeof $.target=="string"?$.target:$.target.id),oe=Mp($.type),re=h===$.id,ge=$.onCriticalPath;return jsxRuntime.jsxs("g",{className:d("relationships-graph-edge",re&&"hovered",ge&&"critical"),onMouseEnter:()=>b($.id),onMouseLeave:()=>b(null),onClick:fe=>A($,fe),children:[jsxRuntime.jsx("line",{x1:j.x,y1:j.y,x2:te.x,y2:te.y,stroke:Dl($.type),strokeWidth:ge?a.edgeWidth*2:a.edgeWidth,strokeOpacity:re?1:.6,markerEnd:oe?"url(#arrowhead)":void 0}),a.showEdgeLabels&&re&&jsxRuntime.jsx("text",{x:(j.x+te.x)/2,y:(j.y+te.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Sl($.type)})]},$.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:p.map($=>{let j=k===$.id,te=$.onCriticalPath;return jsxRuntime.jsxs("g",{className:d("relationships-graph-node",j&&"hovered",te&&"critical"),transform:`translate(${$.x}, ${$.y})`,onMouseDown:oe=>w($.id,oe),onMouseEnter:()=>C($.id),onMouseLeave:()=>C(null),onClick:oe=>I($,oe),children:[jsxRuntime.jsx("circle",{r:te?a.nodeSize*1.2:a.nodeSize,fill:W($),stroke:te?"#fbbf24":"#ffffff",strokeWidth:te?3:2,opacity:j?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:$.card.title.length>20?$.card.title.substring(0,20)+"...":$.card.title})]},$.id)})})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsxRuntime.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function Ip({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,n]=react.useState(""),[c,g]=react.useState(false),[i,p]=react.useState(null),[l,f]=react.useState(null),y=react.useRef(null),k=c||o;react.useEffect(()=>{e&&y.current&&y.current.focus();},[e]),react.useEffect(()=>{let u=x=>{x.key==="Escape"&&!k&&C();};if(e)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,k]);let C=()=>{k||(n(""),p(null),f(null),t());},h=async()=>{if(!(!s.trim()||k)){g(true),p(null),f(null);try{let u=await r(s.trim());f(u);}catch(u){p(u instanceof Error?u.message:"Failed to generate plan");}finally{g(false);}}},b=()=>{l&&(a(l),C());};return e?jsxRuntime.jsxs(bt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:C}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:u=>u.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsxRuntime.jsx("button",{onClick:C,disabled:k,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:l?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Plan Generated Successfully!"})]}),l.explanation&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-blue-500/10 border border-blue-500/30",children:jsxRuntime.jsx("p",{className:"text-sm text-white/90",children:l.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",l.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:l.columns.map((u,x)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:u.title},x))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",l.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[l.cards.slice(0,10).map((u,x)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:u.title}),u.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:u.description})]}),u.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${u.priority==="URGENT"?"bg-red-500/20 text-red-400":u.priority==="HIGH"?"bg-orange-500/20 text-orange-400":u.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:u.priority})]})},x)),l.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",l.cards.length-10," more tasks..."]})]})]})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description"}),jsxRuntime.jsx("textarea",{ref:y,value:s,onChange:u=>n(u.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:k}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),i&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:i}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((u,x)=>jsxRuntime.jsx("button",{onClick:()=>n(u),disabled:k,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:u},x))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:k&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:C,disabled:k,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),l?jsxRuntime.jsx("button",{onClick:b,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsxRuntime.jsx("button",{onClick:h,disabled:!s.trim()||k,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:k?"Generating...":"Generate Plan"})]})]})]})})]}):null}var El={"gpt-4-turbo":{provider:"openai",name:"GPT-4 Turbo",contextWindow:128e3,costPer1kInput:.01,costPer1kOutput:.03,supportsVision:true,supportsJSON:true},"gpt-4":{provider:"openai",name:"GPT-4",contextWindow:8192,costPer1kInput:.03,costPer1kOutput:.06,supportsVision:false,supportsJSON:true},"gpt-3.5-turbo":{provider:"openai",name:"GPT-3.5 Turbo",contextWindow:16385,costPer1kInput:5e-4,costPer1kOutput:.0015,supportsVision:false,supportsJSON:true},"claude-3-5-sonnet-20241022":{provider:"anthropic",name:"Claude 3.5 Sonnet",contextWindow:2e5,costPer1kInput:.003,costPer1kOutput:.015,supportsVision:true,supportsJSON:true},"claude-3-opus-20240229":{provider:"anthropic",name:"Claude 3 Opus",contextWindow:2e5,costPer1kInput:.015,costPer1kOutput:.075,supportsVision:true,supportsJSON:true},"claude-3-haiku-20240307":{provider:"anthropic",name:"Claude 3 Haiku",contextWindow:2e5,costPer1kInput:25e-5,costPer1kOutput:.00125,supportsVision:true,supportsJSON:true}};var Ov={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},$v={generatePlan:{enabled:true,minPlanTier:"hobby",estimatedTokens:2e3},predictRisks:{enabled:true,minPlanTier:"pro",estimatedTokens:1500},suggestAssignee:{enabled:true,minPlanTier:"hobby",estimatedTokens:800},generateReport:{enabled:true,minPlanTier:"enterprise",estimatedTokens:3e3},generateSubtasks:{enabled:true,minPlanTier:"hobby",estimatedTokens:1e3}};function Uv(e,t,a){let r=El[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function un(e){return `$${e.toFixed(4)}`}var Pl=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=Uv(t.model,t.inputTokens,t.outputTokens),r={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:a};return this.operations.push(r),this.listeners.forEach(o=>o(r)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),r}getStats(t){let a=this.operations;t&&(a=a.filter(l=>l.timestamp>=t.start&&l.timestamp<=t.end));let r=a.length,o=a.reduce((l,f)=>l+f.cost,0),s=a.reduce((l,f)=>l+f.inputTokens,0),n=a.reduce((l,f)=>l+f.outputTokens,0),c=a.filter(l=>l.success),g=a.reduce((l,f)=>l+f.duration,0),i={},p={};return a.forEach(l=>{i[l.feature]=(i[l.feature]||0)+1,p[l.feature]=(p[l.feature]||0)+l.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:n,operationsByFeature:i,costsByFeature:p,averageDuration:r>0?g/r:0,successRate:r>0?c.length/r:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,a="month"){let o={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][a],s=new Date,n=new Date;a==="month"?n.setMonth(s.getMonth()-1):n.setDate(s.getDate()-1);let c=this.operations.filter(p=>p.timestamp>=n).length,g=Math.max(0,o-c),i=c/o*100;return {used:c,limit:o,remaining:g,percentUsed:i,isExceeded:c>=o}}subscribe(t){return this.listeners.push(t),()=>{let a=this.listeners.indexOf(t);a>-1&&this.listeners.splice(a,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},bo=new Pl;function Op({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=react.useState(bo.getStats()),[s,n]=react.useState(bo.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let g=setInterval(()=>{o(bo.getStats()),n(bo.checkLimit(a));},1e3);return ()=>clearInterval(g)},[e,a]),react.useEffect(()=>{let g=i=>{i.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,t]),!e)return null;let c=bo.getRecentOperations(5);return jsxRuntime.jsxs(bt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:t}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:g=>g.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-white",children:"AI Usage Dashboard"}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Monitor your AI consumption and costs"})]}),jsxRuntime.jsx("button",{onClick:t,className:"text-white/60 hover:text-white transition-colors",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-r from-blue-500/10 to-purple-500/10 border border-blue-500/30",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white/90",children:["Monthly Usage (",a.toUpperCase(),")"]}),jsxRuntime.jsxs("span",{className:"text-sm font-bold text-white",children:[s.used," / ",s.limit]})]}),jsxRuntime.jsx("div",{className:"w-full h-2 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full transition-all",style:{width:`${Math.min(100,s.percentUsed)}%`,background:s.percentUsed>90?"#EF4444":s.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxRuntime.jsxs("p",{className:"text-xs text-white/60 mt-2",children:[s.remaining," operations remaining this month"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Total Cost"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:un(r.totalCost)})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Operations"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-400 mt-1",children:r.totalOperations})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Tokens Used"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-400 mt-1",children:(r.totalInputTokens+r.totalOutputTokens).toLocaleString()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:[r.totalInputTokens.toLocaleString()," in /"," ",r.totalOutputTokens.toLocaleString()," out"]})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Success Rate"}),jsxRuntime.jsxs("p",{className:"text-2xl font-bold text-green-400 mt-1",children:[(r.successRate*100).toFixed(1),"%"]}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",r.averageDuration.toFixed(0),"ms"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Usage by Feature"}),jsxRuntime.jsx("div",{className:"space-y-2",children:Object.entries(r.operationsByFeature).map(([g,i])=>{let p=r.costsByFeature[g]||0,l=r.totalOperations>0?i/r.totalOperations*100:0;return jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90 capitalize",children:g.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[i," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:un(p)})]})]}),jsxRuntime.jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full bg-blue-500",style:{width:`${l}%`}})})]},g)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),c.length===0?jsxRuntime.jsx("p",{className:"text-sm text-white/50 text-center py-8",children:"No operations yet. Start using AI features!"}):jsxRuntime.jsx("div",{className:"space-y-2",children:c.map(g=>jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90 capitalize",children:g.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(g.timestamp).toLocaleTimeString()," \u2022"," ",g.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[g.inputTokens+g.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:un(g.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${g.success?"bg-green-400":"bg-red-400"}`})]})]},g.id))})]})]}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("p",{className:"text-xs text-white/50",children:"Costs are estimates. Actual API charges may vary."}),jsxRuntime.jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80",children:"Close"})]})]})})]})}function zp({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[n,c]=react.useState(""),[g,i]=react.useState(""),[p,l]=react.useState(""),[f,y]=react.useState(false),[k,C]=react.useState(null),[h,b]=react.useState(null),[u,x]=react.useState(null),m=react.useRef(null),N=f||o;react.useEffect(()=>{e&&m.current&&m.current.focus();},[e]),react.useEffect(()=>{let A=T=>{T.key==="Escape"&&!N&&w();};if(e)return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[e,N]);let w=()=>{N||(c(""),i(""),l(""),C(null),b(null),x(null),t());},B=async()=>{if(!(!n.trim()||N)){y(true),C(null),b(null),x(null);try{let A=await r({prompt:n.trim(),projectName:s||"Mi Proyecto",startDate:g||void 0,endDate:p||void 0});b(A.tasks.tasks),x({from_cache:A.from_cache,tokens_used:A.tokens_used,mock_mode:A.mock_mode,similarity:A.similarity,tokens_saved:A.tokens_saved});}catch(A){C(A instanceof Error?A.message:"Failed to generate tasks");}finally{y(false);}}},v=()=>{h&&(a(h),w());};if(!e)return null;let I=u?.similarity?((u.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(bt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:w}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:A=>A.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"9",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"1",fill:"currentColor"})]}),"Generate Gantt Tasks with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete task timeline"})]}),jsxRuntime.jsx("button",{onClick:w,disabled:N,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:h?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[u?.mock_mode&&jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),u?.from_cache?jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-blue-500/20 text-blue-400 border border-blue-500/30",children:["From Cache (",I,"% similar)"]}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[u?.tokens_used||0," tokens"]}),u?.tokens_saved&&jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[u.tokens_saved," tokens saved"]}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[h.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:h.map((A,T)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/50",children:["#",T+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:A.name})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-xs text-white/60",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-white/40",children:[jsxRuntime.jsx("rect",{x:"1",y:"2",width:"10",height:"8",rx:"1",stroke:"currentColor"}),jsxRuntime.jsx("path",{d:"M1 4h10",stroke:"currentColor"})]}),A.start," \u2192 ",A.end]}),jsxRuntime.jsxs("span",{children:[A.duration," days"]}),A.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",A.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${A.priority==="high"?"bg-red-500/20 text-red-400":A.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:A.priority})]})},A.id))})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description *"}),jsxRuntime.jsx("textarea",{ref:m,value:n,onChange:A=>c(A.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:N}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Start Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:g,onChange:A=>i(A.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:N})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:p,onChange:A=>l(A.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:N})]})]}),k&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:k}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((A,T)=>jsxRuntime.jsx("button",{onClick:()=>c(A),disabled:N,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:A},T))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:N&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:w,disabled:N,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),h?jsxRuntime.jsx("button",{onClick:v,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Tasks to Gantt"}):jsxRuntime.jsx("button",{onClick:B,disabled:!n.trim()||N,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:N?"Generating...":"Generate Tasks"})]})]})]})})]})}function ws({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),o=react.useCallback(h=>{t&&Cn(()=>Promise.resolve(t(h)),{maxAttempts:3,initialDelay:1e3,onRetry:(b,u,x)=>{console.warn(`Retry attempt ${u} after ${x}ms: ${b.message}`);}}).then(b=>{b.success||console.error(`Failed to persist board after ${b.attempts} attempts:`,b.error);});},[t]),s=react.useCallback(async(h,b,u)=>{r(x=>{let m=x.cards.find(A=>A.id===h);if(!m)return x;let N=m.columnId,w={...m,columnId:b,position:u},B=x.cards.map(A=>A.id===h?w:A),v=x.columns.map(A=>{if(A.id===N)return {...A,cardIds:A.cardIds.filter(T=>T!==h)};if(A.id===b){let T=B.filter(W=>W.columnId===b).sort((W,$)=>W.position-$.position);return {...A,cardIds:T.map(W=>W.id)}}return A}),I={...x,cards:B,columns:v};return o(I),I});},[o]),n=react.useCallback(async(h,b)=>{r(u=>{let x=u.cards.map(N=>N.id===h?{...N,...b}:N),m={...u,cards:x};return o(m),m});},[o]),c=react.useCallback(async h=>{let b=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>{let x={...h,id:b},m=u.columns.map(w=>w.id===h.columnId?{...w,cardIds:[...w.cardIds,b]}:w),N={...u,cards:[...u.cards,x],columns:m};return o(N),N});},[o]),g=react.useCallback(async h=>{r(b=>{let u=b.cards.find(w=>w.id===h);if(!u)return b;let x=b.cards.filter(w=>w.id!==h),m=b.columns.map(w=>w.id===u.columnId?{...w,cardIds:w.cardIds.filter(B=>B!==h)}:w),N={...b,cards:x,columns:m};return o(N),N});},[o]),i=react.useCallback(async h=>{let b=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>{let x={...h,id:b,cardIds:[]},m={...u,columns:[...u.columns,x]};return o(m),m});},[o]),p=react.useCallback(async(h,b)=>{r(u=>{let x=u.columns.map(N=>N.id===h?{...N,...b}:N),m={...u,columns:x};return o(m),m});},[o]),l=react.useCallback(async h=>{r(b=>{let u=b.cards.filter(N=>N.columnId!==h),x=b.columns.filter(N=>N.id!==h),m={...b,cards:u,columns:x};return o(m),m});},[o]),f=react.useCallback(h=>{let b=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return c(h),b},[c]),y=react.useCallback(h=>{let b=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(h),b},[i]),k=react.useCallback(()=>{r(h=>{let b={...h,cards:[],columns:[]};return o(b),b});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:n,onCardCreate:c,onCardDelete:g,onColumnCreate:i,onColumnUpdate:p,onColumnDelete:l},setBoard:r,helpers:{addCard:f,addColumn:y,deleteCard:g,deleteColumn:l,clearBoard:k}}}function Wp({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=ws({initialBoard:e,onPersist:a}),n=react.useMemo(()=>({addCard:(g,i,p={})=>{s.addCard({title:i,columnId:g,position:r.cards.filter(l=>l.columnId===g).length,...p});},addColumn:(g,i)=>{let p=r.columns.length>0?Math.max(...r.columns.map(l=>l.position)):0;s.addColumn({title:g,position:i??p+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:react.useMemo(()=>({board:r,callbacks:o,availableUsers:t}),[r,o,t]),board:r,callbacks:o,utils:n}}var gn={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},_p={by:"none",order:"asc"};function Vp({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=react.useState({...gn,...e}),[s,n]=react.useState({..._p,...t}),c=react.useCallback(C=>{o(h=>({...h,...C}));},[]),g=react.useCallback(C=>{n(h=>({...h,...C}));},[]),i=react.useCallback(()=>{o(gn),n(_p);},[]),p=react.useCallback(()=>{a&&o({...gn,assignees:[a]});},[a]),l=react.useCallback(()=>{o({...gn,dateFilter:"overdue"});},[]),f=react.useCallback(()=>{o({...gn,priorities:["HIGH","URGENT"]});},[]),y=react.useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),k=react.useCallback(C=>{let h=[...C];if(r.search){let b=r.search.toLowerCase();h=h.filter(u=>u.title.toLowerCase().includes(b)||u.description?.toLowerCase().includes(b));}if(r.dateFilter!=="all"){let b=new Date,u=b.getFullYear(),x=String(b.getMonth()+1).padStart(2,"0"),m=String(b.getDate()).padStart(2,"0"),N=`${u}-${x}-${m}`;h=h.filter(w=>{if(!w.endDate&&!w.dueDate)return false;let B=w.endDate||w.dueDate;if(!B)return false;let v;if(typeof B=="string")v=B.split("T")[0]||B;else {let I=B.getUTCFullYear(),A=String(B.getUTCMonth()+1).padStart(2,"0"),T=String(B.getUTCDate()).padStart(2,"0");v=`${I}-${A}-${T}`;}switch(r.dateFilter){case "overdue":return v<N;case "today":return v===N;case "this-week":let I=new Date(N+"T00:00:00"),A=new Date(v+"T00:00:00"),T=new Date(I);return T.setDate(T.getDate()+7),A>=I&&A<=T;case "custom":if(r.dateRange){let W=typeof B=="string"?new Date(B):B;return W>=r.dateRange.start&&W<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(h=h.filter(b=>b.priority&&r.priorities.includes(b.priority))),r.assignees.length>0&&(h=h.filter(b=>(b.assignedUserIds||(b.assigneeId?[b.assigneeId]:[])).some(x=>r.assignees.includes(x)))),r.labels.length>0&&(h=h.filter(b=>b.labels&&b.labels.some(u=>r.labels.includes(u)))),r.columns.length>0&&(h=h.filter(b=>r.columns.includes(b.columnId))),s.by!=="none"&&h.sort((b,u)=>{let x=0;switch(s.by){case "created":let m=b.createdAt?new Date(b.createdAt).getTime():0,N=u.createdAt?new Date(u.createdAt).getTime():0;x=m-N;break;case "priority":let w={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},B=w[b.priority||"LOW"],v=w[u.priority||"LOW"];x=B-v;break;case "dueDate":let I=b.endDate||b.dueDate,A=u.endDate||u.dueDate;if(!I)return 1;if(!A)return -1;let T=typeof I=="string"?new Date(I).getTime():I.getTime(),W=typeof A=="string"?new Date(A).getTime():A.getTime();x=T-W;break;case "title":x=b.title.localeCompare(u.title);break;case "estimate":let $=b.estimatedTime||0,j=u.estimatedTime||0;x=$-j;break;default:x=0;}return s.order==="asc"?x:-x}),h},[r,s]);return {filters:r,sort:s,setFilters:c,setSort:g,resetFilters:i,filterMyTasks:p,filterOverdue:l,filterHighPriority:f,applyFilters:k,hasActiveFilters:y}}var Kp,Yp;if(typeof window<"u")try{let e=xn("ai");Kp=e.generateObject,Yp=e.generateText;}catch{}function qp(e={}){let[t,a]=react.useState(false),[r,o]=react.useState(null),s=!!(Kp&&Yp&&e.apiKey),n=react.useCallback(async l=>{if(!s)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');a(true),o(null);try{return console.log("Generating plan for:",l),{columns:[{title:"To Do",position:1e3,cardIds:[]},{title:"In Progress",position:2e3,cardIds:[]},{title:"Done",position:3e3,cardIds:[]}],cards:[{title:"Generated task from AI",description:`Based on: ${l}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(f){let y=f instanceof Error?f:new Error("Failed to generate plan");throw o(y),y}finally{a(false);}},[s]),c=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",l.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(f){let y=f instanceof Error?f:new Error("Failed to suggest assignee");throw o(y),y}finally{a(false);}},[s]),g=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Analyzing board for risks..."),[{type:"RISK_OVERLOAD",severity:"HIGH",title:"Column overload detected",description:'Too many cards in "In Progress"',confidence:.9,suggestedAction:'Consider moving some cards back to "To Do"'}]}catch(f){let y=f instanceof Error?f:new Error("Failed to predict risks");throw o(y),y}finally{a(false);}},[s]),i=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Generating subtasks for:",l.title),[{title:`Subtask 1 for: ${l.title}`,position:l.position+.1,columnId:l.columnId},{title:`Subtask 2 for: ${l.title}`,position:l.position+.2,columnId:l.columnId}]}catch(f){let y=f instanceof Error?f:new Error("Failed to generate subtasks");throw o(y),y}finally{a(false);}},[s]),p=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",l.title),{hours:8,confidence:.75}}catch(f){let y=f instanceof Error?f:new Error("Failed to estimate effort");throw o(y),y}finally{a(false);}},[s]);return {onGeneratePlan:n,onSuggestAssignee:c,onPredictRisks:g,onGenerateSubtasks:i,onEstimateEffort:p,isAvailable:s,isLoading:t,error:r}}function Al(){let[e,t]=react.useState(()=>core.selectionStore.getState());react.useEffect(()=>core.selectionStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.selectionStore.setState(r);},[]);return [e,a]}function Xp(e){let{cards:t}=e,[a,r]=Al(),o=react.useCallback(l=>a.selectedCardIds.includes(l),[a.selectedCardIds]),s=react.useCallback((l,f)=>{if(!f){r({selectedCardIds:[l],lastSelectedCardId:l});return}let y=f.ctrlKey||f.metaKey,k=f.shiftKey;if(y)a.selectedCardIds.includes(l)?r({selectedCardIds:a.selectedCardIds.filter(C=>C!==l),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,l],lastSelectedCardId:l});else if(k&&a.lastSelectedCardId){let C=t.find(b=>b.id===l),h=t.find(b=>b.id===a.lastSelectedCardId);if(C&&h&&C.columnId===h.columnId){let b=t.filter(v=>v.columnId===C.columnId).sort((v,I)=>v.position-I.position),u=b.findIndex(v=>v.id===a.lastSelectedCardId),x=b.findIndex(v=>v.id===l),[m,N]=u<x?[u,x]:[x,u],w=b.slice(m,N+1).map(v=>v.id),B=Array.from(new Set([...a.selectedCardIds,...w]));r({selectedCardIds:B,lastSelectedCardId:l});}else r({selectedCardIds:[l],lastSelectedCardId:l});}else r({selectedCardIds:[l],lastSelectedCardId:l});},[t,a,r]),n=react.useCallback(l=>{r({selectedCardIds:a.selectedCardIds.filter(f=>f!==l),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),c=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),g=react.useCallback(()=>{r({selectedCardIds:t.map(l=>l.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),i=react.useCallback(l=>{a.selectedCardIds.includes(l)?n(l):r({selectedCardIds:[...a.selectedCardIds,l],lastSelectedCardId:l});},[a,n,r]),p=react.useCallback(()=>t.filter(l=>a.selectedCardIds.includes(l.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:n,clearSelection:c,selectAll:g,toggleCard:i,getSelectedCards:p}}var Jp={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function Zp(e){let{cards:t,config:a,aiService:r}=e,o=react.useMemo(()=>({...Jp,...a}),[a]),[s,n]=react.useState([]),c=react.useCallback((C,h,b,u,x)=>{if(h.length<o.minCardsPerStack){console.warn(`Cannot create stack: minimum ${o.minCardsPerStack} cards required`);return}let m={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:C,cardIds:h,columnId:b,strategy:u,color:x,isExpanded:true,position:s.filter(N=>N.columnId===b).length,createdAt:new Date};n(N=>[...N,m]);},[o.minCardsPerStack,s]),g=react.useCallback(C=>{n(h=>h.filter(b=>b.id!==C));},[]),i=react.useCallback(C=>{n(h=>h.map(b=>b.id===C?{...b,isExpanded:!b.isExpanded}:b));},[]),p=react.useCallback((C,h)=>{n(b=>b.map(u=>u.id===C&&!u.cardIds.includes(h)?{...u,cardIds:[...u.cardIds,h]}:u));},[]),l=react.useCallback((C,h)=>{n(b=>b.map(u=>{if(u.id===C){let x=u.cardIds.filter(m=>m!==h);return x.length<o.minCardsPerStack?null:{...u,cardIds:x}}return u}).filter(u=>u!==null));},[o.minCardsPerStack]),f=react.useCallback(C=>s.filter(h=>h.columnId===C).sort((h,b)=>h.position-b.position),[s]),y=react.useCallback(async C=>{let h=t.filter(N=>N.columnId===C);if(h.length<o.minCardsPerStack*2)return [];let b=[],u=new Map;h.forEach(N=>{N.labels&&N.labels.length>0&&N.labels.forEach(w=>{u.has(w)||u.set(w,[]),u.get(w).push(N);});}),u.forEach((N,w)=>{N.length>=o.minCardsPerStack&&b.push({stack:{title:`\u{1F4CC} ${w}`,cardIds:N.map(B=>B.id),columnId:C,strategy:"labels",color:"#3b82f6"},reason:`${N.length} cards with label "${w}"`,confidence:.85});});let x=new Map;h.forEach(N=>{N.assignedUserIds&&N.assignedUserIds.length>0&&N.assignedUserIds.forEach(w=>{x.has(w)||x.set(w,[]),x.get(w).push(N);});}),x.forEach((N,w)=>{N.length>=o.minCardsPerStack&&b.push({stack:{title:`\u{1F464} Assigned to user-${w.slice(-4)}`,cardIds:N.map(B=>B.id),columnId:C,strategy:"assignee",color:"#8b5cf6"},reason:`${N.length} cards assigned to the same user`,confidence:.8});});let m=new Map;if(h.forEach(N=>{N.priority&&(m.has(N.priority)||m.set(N.priority,[]),m.get(N.priority).push(N));}),m.forEach((N,w)=>{if(N.length>=o.minCardsPerStack){let B={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[w.toLowerCase()]||"\u26AA";b.push({stack:{title:`${B} ${w} Priority`,cardIds:N.map(v=>v.id),columnId:C,strategy:"priority",color:w==="high"||w==="urgent"?"#ef4444":"#10b981"},reason:`${N.length} cards with ${w} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let N of h){let B=(await r.findSimilar(N,h)).filter(v=>v.similarity>=o.autoStackConfidenceThreshold);if(B.length>=o.minCardsPerStack-1){let v=[N.id,...B.map(A=>A.card.id)],I=B.reduce((A,T)=>A+T.similarity,0)/B.length;b.push({stack:{title:`\u2728 Similar to "${N.title.substring(0,30)}${N.title.length>30?"...":""}"`,cardIds:v,columnId:C,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${B.length+1} similar tasks`,confidence:I});}}return b.filter(N=>N.confidence>=o.autoStackConfidenceThreshold).sort((N,w)=>w.confidence-N.confidence).slice(0,5)},[t,o,r]),k=react.useCallback(C=>{c(C.stack.title,C.stack.cardIds,C.stack.columnId,C.stack.strategy,C.stack.color);},[c]);return react.useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(h=>h.columnId)).forEach(async h=>{let b=await y(h),u=b[0];b.length>0&&u&&u.confidence>=.9&&k(u);});},[]),{stacks:s,createStack:c,deleteStack:g,toggleStack:i,addToStack:p,removeFromStack:l,getStacksForColumn:f,getSuggestions:y,applySuggestion:k,config:o}}var Qp=react.createContext(null);function eu({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,n=new Map;t?.columns?.forEach(g=>{let{Column:i}=xn("@libxai/core");s.set(g.id,new i(g));}),t?.cards?.forEach(g=>{let{Card:i}=xn("@libxai/core");n.set(g.id,new i(g));});let c=null;if(t?.board){let{Board:g}=xn("@libxai/core");c=new g(t.board);}r.current=new core.BoardStore({board:c,columns:s,cards:n});}let o=r.current;return react.useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsxRuntime.jsx(Qp.Provider,{value:{store:o},children:e})}function Cs(){let e=react.useContext(Qp);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function bn(){let e=Cs(),[t,a]=react.useState(e.getBoard()),[r,o]=react.useState(e.getAllColumns()),[s,n]=react.useState(e.getAllCards());react.useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),o(e.getAllColumns()),n(e.getAllCards());}),[e]);let c=react.useCallback(u=>{e.updateBoard(u);},[e]),g=react.useCallback(u=>{e.addColumn(u);},[e]),i=react.useCallback((u,x)=>{e.updateColumn(u,x);},[e]),p=react.useCallback(u=>{e.deleteColumn(u);},[e]),l=react.useCallback(u=>e.getColumn(u),[e]),f=react.useCallback(u=>{e.addCard(u);},[e]),y=react.useCallback((u,x)=>{e.updateCard(u,x);},[e]),k=react.useCallback(u=>{e.deleteCard(u);},[e]),C=react.useCallback((u,x,m)=>{e.moveCard(u,x,m);},[e]),h=react.useCallback(u=>e.getCard(u),[e]),b=react.useCallback(u=>e.getCardsByColumn(u),[e]);return {board:t,columns:r,cards:s,updateBoard:c,addColumn:g,updateColumn:i,deleteColumn:p,getColumn:l,addCard:f,updateCard:y,deleteCard:k,moveCard:C,getCard:h,getCardsByColumn:b}}function au(e){let{cards:t}=bn();return react.useMemo(()=>e?t.filter(a=>{if(e.searchQuery){let r=e.searchQuery.toLowerCase(),o=a.title.toLowerCase().includes(r),s=a.description?.toLowerCase().includes(r);if(!o&&!s)return false}return !(e.priorities&&e.priorities.length>0&&(!a.priority||!e.priorities.includes(a.priority))||e.statuses&&e.statuses.length>0&&(!a.status||!e.statuses.includes(a.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(o=>a.isAssignedTo(o))||e.labels&&e.labels.length>0&&!e.labels.some(o=>a.hasLabel(o))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(a.columnId)||e.isOverdue!==void 0&&e.isOverdue!==a.isOverdue())}):t,[t,e])}function ru(e="position",t="asc"){let{cards:a}=bn();return react.useMemo(()=>[...a].sort((o,s)=>{let n=0;switch(e){case "title":n=o.title.localeCompare(s.title);break;case "priority":{let c={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},g=o.priority?c[o.priority]:0,i=s.priority?c[s.priority]:0;n=g-i;break}case "createdAt":n=o.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":n=o.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":n=o.position-s.position;break}return t==="asc"?n:-n}),[a,e,t])}var Ts=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=cd.child("PluginManager");}setContext(t){this.context=t;}register(t){if(!t.id||!t.name||!t.version)throw new Error("Plugin must have id, name, and version");if(this.plugins.has(t.id)&&this.pluginLogger.warn(`Plugin ${t.id} is already registered, overwriting...`),t.dependencies){for(let a of t.dependencies)if(!this.plugins.has(a))throw new Error(`Plugin ${t.id} depends on ${a} which is not registered`)}this.plugins.set(t.id,t),t.defaultConfig&&this.config.set(t.id,{...t.defaultConfig}),this.enabled.add(t.id),this.pluginLogger.info(`Plugin registered: ${t.name} v${t.version}`),t.onInit&&this.context&&Promise.resolve(t.onInit(this.context)).catch(a=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,a,{plugin:t.id});});}unregister(t){let a=this.plugins.get(t);if(!a){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}a.onDestroy&&Promise.resolve(a.onDestroy()).catch(r=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,r);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${a.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,a){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);a?(this.enabled.add(t),this.pluginLogger.info(`Plugin enabled: ${t}`)):(this.enabled.delete(t),this.pluginLogger.info(`Plugin disabled: ${t}`));}isEnabled(t){return this.enabled.has(t)}getConfig(t,a){return this.config.get(t)?.[a]}setConfig(t,a,r){this.config.has(t)||this.config.set(t,{});let o=this.config.get(t);o[a]=r,this.pluginLogger.debug(`Plugin config set: ${t}.${a}`,{value:r});}async executeHook(t,a,r){let o=r;for(let s of this.plugins.values()){if(!this.enabled.has(s.id))continue;let n=s[t];if(typeof n=="function")try{let c=await Promise.resolve(n.apply(s,a));c!==void 0&&(o=c,a[0]=c);}catch(c){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,c,{plugin:s.id,hook:t});}}return o}async executeHookParallel(t,a){let r=[];for(let o of this.plugins.values()){if(!this.enabled.has(o.id))continue;let s=o[t];typeof s=="function"&&r.push(Promise.resolve(s.apply(o,a)).catch(n=>{this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,n,{plugin:o.id,hook:t});}));}await Promise.all(r);}},ax=new Ts;function nu({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:n=false,gap:c=0,getItemKey:g}){let i=react.useRef(null),p=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>i.current,estimateSize:()=>a,overscan:s,horizontal:n,gap:c}),l=p.getVirtualItems(),f={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},y=n?{width:`${p.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${p.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:i,style:f,className:o,children:jsxRuntime.jsx("div",{style:y,children:l.map(k=>{let C=e[k.index];if(!C)return null;let h=g?g(C,k.index):k.index,b={position:"absolute",top:n?0:k.start,left:n?k.start:0,width:n?k.size:"100%",height:n?"100%":k.size};return jsxRuntime.jsx("div",{style:b,"data-index":k.index,children:r(C,k.index)},h)})})})}function su(e){return reactVirtual.useVirtualizer({count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateSize,overscan:e.overscan??5,horizontal:e.horizontal??false,gap:e.gap??0})}function lu({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:n=3,gap:c=16,getItemKey:g,horizontal:i=true}){let p=react.useRef(null),l=reactVirtual.useVirtualizer({horizontal:i,count:e.length,getScrollElement:()=>p.current,estimateSize:()=>r,overscan:n,gap:c}),f=l.getVirtualItems(),y={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},k={width:`${l.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:p,style:y,className:s,children:jsxRuntime.jsx("div",{style:k,children:f.map(C=>{let h=e[C.index];if(!h)return null;let b=g?g(h,C.index):C.index,u={position:"absolute",top:0,left:C.start,width:C.size,height:"100%"};return jsxRuntime.jsx("div",{style:u,"data-index":C.index,children:o(h,C.index)},b)})})})}function du(e){let t=reactVirtual.useVirtualizer({horizontal:true,count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateColumnWidth,overscan:e.overscan??3,gap:e.gap??0});return {columnVirtualizer:t,virtualColumns:t.getVirtualItems(),totalWidth:t.getTotalSize()}}function cu(e,t=10){return e>t}var Bl={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Rl={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Ol={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},$l={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Ul={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},zl={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},Hl={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Wl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",smooth:"cubic-bezier(0.4, 0.0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0.0, 0.6, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},Gl={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},_l={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Vl={column:{width:320,minWidth:280,maxWidth:400,gap:16,padding:12,headerHeight:48},card:{minHeight:80,maxHeight:400,padding:12,gap:8},board:{padding:16,gap:16}},jl={timeline:{headerHeight:60,rowHeight:44,minRowHeight:32,maxRowHeight:80,taskPadding:4,gridLineWidth:1},task:{height:28,minHeight:20,maxHeight:40,borderRadius:4,padding:6},dependency:{lineWidth:2,arrowSize:8},scale:{day:{columnWidth:40,minColumnWidth:30,maxColumnWidth:60},week:{columnWidth:80,minColumnWidth:60,maxColumnWidth:120},month:{columnWidth:120,minColumnWidth:80,maxColumnWidth:200},quarter:{columnWidth:200,minColumnWidth:150,maxColumnWidth:300}},milestone:{size:16,rotation:45}},Ns={spacing:Bl,borderRadius:Rl,fontSize:Ol,fontWeight:$l,lineHeight:Ul,zIndex:zl,duration:Hl,easing:Wl,shadows:Gl,opacity:_l,kanban:Vl,gantt:jl};function mu(e,t,a){return e[t]??a}function Kl(e,t="",a={}){for(let[r,o]of Object.entries(e)){let s=t?`${t}-${r}`:r;typeof o=="object"&&o!==null&&!Array.isArray(o)?Kl(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function nx(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Yl(e="asakaa"){let t=Kl(Ns),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,n=nx(o);a.push(` ${s}: ${n};`);}return `:root {
389
+ Today's date: ${new Date().toISOString().split("T")[0]}`}function hm(e){let t=[],a=r=>{for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);};return a(e),t}function Mr(e,t){let a=hm(e),r=t.toLowerCase().trim(),o=a.find(c=>c.name.toLowerCase()===r);if(o)return o;let s=a.find(c=>c.name.toLowerCase().includes(r));if(s)return s;let n=r.split(/\s+/);return a.find(c=>{let g=c.name.toLowerCase();return n.every(i=>g.includes(i))})}function Qi(e,t=new Date){let a=e.toLowerCase().trim(),r=new Date(t);if(r.setHours(0,0,0,0),a==="today"||a==="hoy")return r;if(a==="tomorrow"||a==="ma\xF1ana"){let f=new Date(r);return f.setDate(f.getDate()+1),f}if(a==="yesterday"||a==="ayer"){let f=new Date(r);return f.setDate(f.getDate()-1),f}if(a==="next week"||a==="la pr\xF3xima semana"){let f=new Date(r);return f.setDate(f.getDate()+7),f}let o=a.match(/(?:next\s+)?(monday|tuesday|wednesday|thursday|friday|saturday|sunday|lunes|martes|miércoles|miercoles|jueves|viernes|sábado|sabado|domingo)/i);if(o){let y={sunday:0,domingo:0,monday:1,lunes:1,tuesday:2,martes:2,wednesday:3,mi\u00E9rcoles:3,miercoles:3,thursday:4,jueves:4,friday:5,viernes:5,saturday:6,s\u00E1bado:6,sabado:6}[o[1].toLowerCase()];if(y!==void 0){let k=new Date(r),C=k.getDay(),h=y-C;return h<=0&&(h+=7),k.setDate(k.getDate()+h),k}}let s=a.match(/in\s+(\d+)\s+(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(s&&s[1]&&s[2]){let f=parseInt(s[1],10),y=s[2].toLowerCase(),k=new Date(r);return y==="day"||y==="d\xEDa"||y==="dias"?k.setDate(k.getDate()+f):y==="week"||y==="semana"||y==="semanas"?k.setDate(k.getDate()+f*7):(y==="month"||y==="mes"||y==="meses")&&k.setMonth(k.getMonth()+f),k}if(a.match(/(\d{4})-(\d{2})-(\d{2})/))return new Date(a);let c=a.match(/(\d{1,2})\/(\d{1,2})\/(\d{4})/);if(c&&c[1]&&c[2]&&c[3]){let f=parseInt(c[1],10),y=parseInt(c[2],10)-1,k=parseInt(c[3],10);return new Date(k,y,f)}let g={enero:0,febrero:1,marzo:2,abril:3,mayo:4,junio:5,julio:6,agosto:7,septiembre:8,octubre:9,noviembre:10,diciembre:11},i=a.match(/(\d{1,2})\s+de\s+(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)(?:\s+de\s+(\d{4}))?/i);if(i&&i[1]&&i[2]){let f=parseInt(i[1],10),y=g[i[2].toLowerCase()],k=i[3]?parseInt(i[3],10):r.getFullYear();if(y!==void 0)return new Date(k,y,f)}let p={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},l=a.match(/(january|february|march|april|may|june|july|august|september|october|november|december)\s+(\d{1,2})(?:,?\s+(\d{4}))?/i);if(l&&l[1]&&l[2]){let f=p[l[1].toLowerCase()],y=parseInt(l[2],10),k=l[3]?parseInt(l[3],10):r.getFullYear();if(f!==void 0)return new Date(k,f,y)}return null}function el(e){let a=e.toLowerCase().trim().match(/(\d+)\s*(day|week|month|día|dias|semana|semanas|mes|meses)s?/i);if(a&&a[1]&&a[2]){let r=parseInt(a[1],10),o=a[2].toLowerCase();if(o==="day"||o==="d\xEDa"||o==="dias")return r;if(o==="week"||o==="semana"||o==="semanas")return r*7;if(o==="month"||o==="mes"||o==="meses")return r*30}return null}function tl(e){let t=e.match(/(\d+)(?:\s*%)?/);if(t&&t[1]){let a=parseInt(t[1],10);return Math.max(0,Math.min(100,a))}return null}function ym(e){let t=e.toLowerCase().trim();return t.includes("todo")||t.includes("pendiente")||t.includes("por hacer")?"todo":t.includes("in progress")||t.includes("in-progress")||t.includes("en progreso")||t.includes("working")||t.includes("trabajando")?"in-progress":t.includes("done")||t.includes("complete")||t.includes("finished")||t.includes("completado")||t.includes("terminado")||t.includes("hecho")?"completed":null}function vm(e,t){let a=e.toLowerCase().trim(),r=a.match(/(?:move|mover|mueve)\s+(?:la\s+tarea\s+)?["""]?(.+?)["""]?\s+(?:to|a|para)\s+(?:la\s+fecha\s+)?(.+)/i);if(r&&r[1]&&r[2]){let i=r[1].trim(),p=r[2].trim(),l=Mr(t,i),f=Qi(p);if(!l)return {type:"move_task",taskName:i,message:`Could not find a task named "${i}". Please check the task name and try again.`,success:false,error:"Task not found"};if(!f)return {type:"move_task",taskId:l.id,taskName:l.name,message:`Could not parse the date "${p}". Try using formats like "next Monday", "in 3 days", or "2024-01-15".`,success:false,error:"Invalid date"};let y=l.startDate&&l.endDate?Math.round((l.endDate.getTime()-l.startDate.getTime())/(1e3*60*60*24)):1,k=new Date(f);return k.setDate(k.getDate()+y),{type:"move_task",taskId:l.id,taskName:l.name,updates:{startDate:f,endDate:k},message:`Moved "${l.name}" to ${f.toLocaleDateString()}.`,success:true}}let o=a.match(/(?:extend|extender|extiende|alargar)\s+["""]?(.+?)["""]?\s+(?:by|por)\s+(.+)/i);if(o&&o[1]&&o[2]){let i=o[1].trim(),p=o[2].trim(),l=Mr(t,i),f=el(p);if(!l)return {type:"resize_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"};if(!f||!l.endDate)return {type:"resize_task",taskId:l.id,taskName:l.name,message:`Could not parse the duration "${p}".`,success:false,error:"Invalid duration"};let y=new Date(l.endDate);return y.setDate(y.getDate()+f),{type:"resize_task",taskId:l.id,taskName:l.name,updates:{endDate:y},message:`Extended "${l.name}" by ${f} days. New end date: ${y.toLocaleDateString()}.`,success:true}}let s=a.match(/(?:set|establecer|poner)\s+["""]?(.+?)["""]?\s+(?:progress|progreso)\s+(?:to|a|en)\s+(.+)/i);if(s&&s[1]&&s[2]){let i=s[1].trim(),p=s[2].trim(),l=Mr(t,i),f=tl(p);return l?f===null?{type:"set_progress",taskId:l.id,taskName:l.name,message:`Could not parse the progress value "${p}".`,success:false,error:"Invalid progress"}:{type:"set_progress",taskId:l.id,taskName:l.name,updates:{progress:f},message:`Set "${l.name}" progress to ${f}%.`,success:true}:{type:"set_progress",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let n=a.match(/(?:rename|renombrar|cambiar nombre de)\s+["""]?(.+?)["""]?\s+(?:to|a|por)\s+["""]?(.+?)["""]?$/i);if(n&&n[1]&&n[2]){let i=n[1].trim(),p=n[2].trim(),l=Mr(t,i);return l?{type:"rename_task",taskId:l.id,taskName:l.name,updates:{name:p},message:`Renamed "${l.name}" to "${p}".`,success:true}:{type:"rename_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}let c=a.match(/(?:link|vincular|conectar)\s+["""]?(.+?)["""]?\s+(?:to|a|con)\s+["""]?(.+?)["""]?$/i);if(c&&c[1]&&c[2]){let i=c[1].trim(),p=c[2].trim(),l=Mr(t,i),f=Mr(t,p);return l?f?{type:"link_tasks",taskId:f.id,taskName:f.name,dependencyFrom:l.id,dependencyTo:f.id,message:`Linked "${l.name}" \u2192 "${f.name}".`,success:true}:{type:"link_tasks",taskName:p,message:`Could not find a task named "${p}".`,success:false,error:"Target task not found"}:{type:"link_tasks",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Source task not found"}}let g=a.match(/(?:delete|eliminar|borrar|remove|quitar)\s+["""]?(.+?)["""]?$/i);if(g&&g[1]){let i=g[1].trim(),p=Mr(t,i);return p?{type:"delete_task",taskId:p.id,taskName:p.name,message:`Deleted "${p.name}".`,success:true}:{type:"delete_task",taskName:i,message:`Could not find a task named "${i}".`,success:false,error:"Task not found"}}return null}function xm(e){if(!e||typeof e!="object")return {type:"unknown",message:"Invalid response from AI",success:false,error:"Invalid response format"};let t=e;return {type:t.type||"unknown",taskId:typeof t.taskId=="string"?t.taskId:void 0,taskName:typeof t.taskName=="string"?t.taskName:void 0,updates:t.updates,newTask:t.newTask,dependencyFrom:typeof t.dependencyFrom=="string"?t.dependencyFrom:void 0,dependencyTo:typeof t.dependencyTo=="string"?t.dependencyTo:void 0,message:typeof t.message=="string"?t.message:"Command processed",success:typeof t.success=="boolean"?t.success:false,error:typeof t.error=="string"?t.error:void 0}}function xh(e){if(e)switch(e.toUpperCase()){case "TODO":case "BLOCKED":return "todo";case "IN_PROGRESS":case "REVIEW":return "in-progress";case "DONE":return "completed";default:return "todo"}}function kh(e){switch(e){case "todo":return "TODO";case "in-progress":return "IN_PROGRESS";case "completed":return "DONE";default:return e||"TODO"}}function ns(e,t=[],a=[]){let r=e.assignedUserIds?.map(p=>{let l=a.find(f=>f.id===p);return l?{name:l.name,initials:l.initials,color:l.color}:null}).filter(p=>p!==null),o=t.filter(p=>p.metadata?.parentCardId===e.id).map(p=>ns(p,t,a)),s;e.dependencies&&(typeof e.dependencies[0]=="string"?s=e.dependencies:s=e.dependencies.filter(p=>p.type==="finish-to-start").map(p=>p.taskId));let n=p=>{if(p)return typeof p=="string"?new Date(p):p},c=n(e.startDate),g=n(e.endDate),i=e.metadata?.isMilestone===true||c&&g&&Math.abs(g.getTime()-c.getTime())<=864e5;return {id:e.id,name:e.title,startDate:c,endDate:g,progress:e.progress||0,status:xh(e.metadata?.status),assignees:r?.length?r:void 0,dependencies:s?.length?s:void 0,subtasks:o?.length?o:void 0,isExpanded:e.metadata?.isExpanded===true,isMilestone:i,isCriticalPath:e.metadata?.isCriticalPath===true}}function km(e,t=[]){let a;return e.assignees&&e.assignees.length>0&&(a=e.assignees.map(r=>t.find(s=>s.name===r.name||s.initials===r.initials)?.id).filter(r=>r!==void 0)),{id:e.id,title:e.name,startDate:e.startDate,endDate:e.endDate,progress:e.progress,assignedUserIds:a?.length?a:void 0,metadata:{status:kh(e.status),isExpanded:e.isExpanded,isMilestone:e.isMilestone,isCriticalPath:e.isCriticalPath}}}function wm(e,t=[]){return e.filter(r=>!r.metadata?.parentCardId).map(r=>ns(r,e,t))}var al={columns:{name:"Task Name",startDate:"Start Date",endDate:"End Date",progress:"Progress",status:"Status",assignees:"Assignees",priority:"Priority",actions:"Actions"},toolbar:{search:"Search",searchPlaceholder:"Search tasks...",filter:"Filter",clearFilters:"Clear Filters",export:"Export",columns:"Columns",newTask:"New Task"},filters:{status:"Status",assignees:"Assignees",dateRange:"Date Range",showCompleted:"Show Completed",all:"All",none:"None"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},actions:{edit:"Edit",delete:"Delete",duplicate:"Duplicate",viewDetails:"View Details"},empty:{noTasks:"No tasks yet",noResults:"No tasks match your filters",addFirstTask:"Add your first task"},pagination:{showing:"Showing",of:"of",tasks:"tasks",previous:"Previous",next:"Next"},bulk:{selected:"selected",delete:"Delete",move:"Move to",assignTo:"Assign to"}},rl={columns:{name:"Nombre de Tarea",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",status:"Estado",assignees:"Asignados",priority:"Prioridad",actions:"Acciones"},toolbar:{search:"Buscar",searchPlaceholder:"Buscar tareas...",filter:"Filtrar",clearFilters:"Limpiar Filtros",export:"Exportar",columns:"Columnas",newTask:"Nueva Tarea"},filters:{status:"Estado",assignees:"Asignados",dateRange:"Rango de Fechas",showCompleted:"Mostrar Completadas",all:"Todos",none:"Ninguno"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},actions:{edit:"Editar",delete:"Eliminar",duplicate:"Duplicar",viewDetails:"Ver Detalles"},empty:{noTasks:"Sin tareas a\xFAn",noResults:"Ninguna tarea coincide con los filtros",addFirstTask:"Agrega tu primera tarea"},pagination:{showing:"Mostrando",of:"de",tasks:"tareas",previous:"Anterior",next:"Siguiente"},bulk:{selected:"seleccionadas",delete:"Eliminar",move:"Mover a",assignTo:"Asignar a"}},ss={en:al,es:rl};function ol(e){return ss[e]||ss.en}function is(e,t){let a=ol(e);return t?{columns:{...a.columns,...t.columns},toolbar:{...a.toolbar,...t.toolbar},filters:{...a.filters,...t.filters},status:{...a.status,...t.status},actions:{...a.actions,...t.actions},empty:{...a.empty,...t.empty},pagination:{...a.pagination,...t.pagination},bulk:{...a.bulk,...t.bulk}}:a}var nl=[{value:"todo",icon:lucideReact.Circle,color:"text-gray-400"},{value:"in-progress",icon:lucideReact.PlayCircle,color:"text-blue-500"},{value:"completed",icon:lucideReact.CheckCircle2,color:"text-green-500"}];function Cm({value:e,onChange:t,isDark:a,translations:r,disabled:o=false}){let[s,n]=react.useState(false),c=react.useRef(null);react.useEffect(()=>{let f=y=>{c.current&&!c.current.contains(y.target)&&n(false);};return s&&document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[s]);let g=nl[0],i=nl.find(f=>f.value===e)??g,p=i.icon,l=f=>{switch(f){case "completed":return r.completed;case "in-progress":return r.inProgress;default:return r.todo}};return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(p,{className:d("w-4 h-4",i.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:l(e)})]}):jsxRuntime.jsxs("div",{ref:c,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(p,{className:d("w-4 h-4",i.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:l(e)}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:d("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[140px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:nl.map(f=>{let y=f.icon;return jsxRuntime.jsxs("button",{onClick:k=>{k.stopPropagation(),t(f.value),n(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",e===f.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx(y,{className:d("w-4 h-4",f.color)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:l(f.value)})]},f.value)})})]})}var sl=[{value:"urgent",label:{en:"Urgent",es:"Urgente"},color:"text-red-500",bg:"bg-red-500"},{value:"high",label:{en:"High",es:"Alta"},color:"text-orange-500",bg:"bg-orange-500"},{value:"medium",label:{en:"Medium",es:"Media"},color:"text-yellow-500",bg:"bg-yellow-500"},{value:"low",label:{en:"Low",es:"Baja"},color:"text-blue-500",bg:"bg-blue-500"},{value:"none",label:{en:"None",es:"Ninguna"},color:"text-gray-400",bg:"bg-gray-400"}];function Nm({value:e="none",onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),c=react.useRef(null);react.useEffect(()=>{let p=l=>{c.current&&!c.current.contains(l.target)&&n(false);};return s&&document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[s]);let g=sl.find(p=>p.value===e)??sl[4],i=r==="es"?"es":"en";return o||!t?jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:g.label[i]})]}):jsxRuntime.jsxs("div",{ref:c,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:p=>{p.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",g.color)}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:g.label[i]}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",a?"text-[#6B7280]":"text-gray-400")})]}),s&&jsxRuntime.jsx("div",{className:d("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px]",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:sl.map(p=>jsxRuntime.jsxs("button",{onClick:l=>{l.stopPropagation(),t(p.value),n(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",e===p.value&&(a?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-2 h-2 rounded-full",p.bg)}),jsxRuntime.jsx("span",{className:a?"text-white":"text-gray-900",children:p.label[i]})]},p.value))})]})}function cs(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function ms(e){let t=["bg-blue-500","bg-green-500","bg-purple-500","bg-pink-500","bg-yellow-500","bg-red-500","bg-indigo-500","bg-teal-500"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"bg-blue-500"}function Sm({value:e=[],availableUsers:t=[],onChange:a,isDark:r,locale:o,disabled:s=false}){let[n,c]=react.useState(false),[g,i]=react.useState(""),p=react.useRef(null);react.useEffect(()=>{let k=C=>{p.current&&!p.current.contains(C.target)&&(c(false),i(""));};return n&&document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[n]);let l=t.filter(k=>k.name.toLowerCase().includes(g.toLowerCase())||k.email?.toLowerCase().includes(g.toLowerCase())),f=k=>e.some(C=>C.name===k),y=k=>{if(a)if(f(k.name))a(e.filter(C=>C.name!==k.name));else {let C={name:k.name,initials:cs(k.name),color:k.color||ms(k.name).replace("bg-","").replace("-500",""),avatar:k.avatarUrl};a([...e,C]);}};return s||!a?e.length===0?jsxRuntime.jsx("span",{className:d("text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"-"}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-2",children:[e.slice(0,3).map((k,C)=>jsxRuntime.jsx("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white border-2",r?"border-[#0F1117]":"border-white",!k.avatar&&ms(k.name)),style:k.color&&!k.avatar?{backgroundColor:k.color}:void 0,title:k.name,children:k.avatar?jsxRuntime.jsx("img",{src:k.avatar,alt:k.name,className:"w-full h-full rounded-full object-cover"}):k.initials||cs(k.name)},`${k.name}-${C}`)),e.length>3&&jsxRuntime.jsxs("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium border-2",r?"bg-[#374151] border-[#0F1117] text-white":"bg-gray-200 border-white text-gray-600"),children:["+",e.length-3]})]}):jsxRuntime.jsxs("div",{ref:p,className:"relative",children:[jsxRuntime.jsx("button",{onClick:k=>{k.stopPropagation(),c(!n);},className:d("flex items-center gap-1 px-2 py-1 rounded transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100"),children:e.length===0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.User,{className:d("w-4 h-4",r?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx(lucideReact.Plus,{className:d("w-3 h-3",r?"text-[#6B7280]":"text-gray-400")})]}):jsxRuntime.jsxs("div",{className:"flex items-center -space-x-1",children:[e.slice(0,2).map((k,C)=>jsxRuntime.jsx("div",{className:d("w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-medium text-white border",r?"border-[#0F1117]":"border-white",!k.avatar&&ms(k.name)),style:k.color&&!k.avatar?{backgroundColor:k.color}:void 0,children:k.avatar?jsxRuntime.jsx("img",{src:k.avatar,alt:k.name,className:"w-full h-full rounded-full object-cover"}):k.initials||cs(k.name)},`${k.name}-${C}`)),e.length>2&&jsxRuntime.jsxs("span",{className:d("text-xs ml-1",r?"text-[#9CA3AF]":"text-gray-500"),children:["+",e.length-2]})]})}),n&&jsxRuntime.jsxs("div",{className:d("absolute z-50 top-full left-0 mt-1 rounded-lg shadow-lg border w-64",r?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:"p-2 border-b",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:jsxRuntime.jsx("input",{type:"text",value:g,onChange:k=>i(k.target.value),placeholder:o==="es"?"Buscar usuario...":"Search user...",className:d("w-full px-3 py-1.5 text-sm rounded border outline-none",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),onClick:k=>k.stopPropagation()})}),jsxRuntime.jsx("div",{className:"max-h-48 overflow-y-auto py-1",children:l.length===0?jsxRuntime.jsx("p",{className:d("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:o==="es"?"No se encontraron usuarios":"No users found"}):l.map(k=>jsxRuntime.jsxs("button",{onClick:C=>{C.stopPropagation(),y(k);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("div",{className:d("w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium text-white",!k.avatarUrl&&ms(k.name)),children:k.avatarUrl?jsxRuntime.jsx("img",{src:k.avatarUrl,alt:k.name,className:"w-full h-full rounded-full object-cover"}):cs(k.name)}),jsxRuntime.jsxs("div",{className:"flex-1 text-left",children:[jsxRuntime.jsx("div",{className:r?"text-white":"text-gray-900",children:k.name}),k.email&&jsxRuntime.jsx("div",{className:d("text-xs",r?"text-[#6B7280]":"text-gray-400"),children:k.email})]}),f(k.name)&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},k.id))}),e.length>0&&jsxRuntime.jsx("div",{className:"p-2 border-t flex flex-wrap gap-1",style:{borderColor:r?"rgba(255,255,255,0.1)":"#E5E7EB"},children:e.map((k,C)=>jsxRuntime.jsxs("span",{className:d("inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded-full",r?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:[k.name,jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),a(e.filter(b=>b.name!==k.name));},className:"hover:text-red-500",children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},`${k.name}-${C}`))})]})]})}var Vh={en:["January","February","March","April","May","June","July","August","September","October","November","December"],es:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"]},jh={en:["Su","Mo","Tu","We","Th","Fr","Sa"],es:["Do","Lu","Ma","Mi","Ju","Vi","S\xE1"]};function ps({value:e,onChange:t,isDark:a,locale:r,disabled:o=false}){let[s,n]=react.useState(false),[c,g]=react.useState(()=>{if(e){let h=e instanceof Date?e:new Date(e);return new Date(h.getFullYear(),h.getMonth(),1)}return new Date(new Date().getFullYear(),new Date().getMonth(),1)}),i=react.useRef(null),p=e?e instanceof Date?e:new Date(e):null,l=r==="es"?"es":"en";react.useEffect(()=>{let h=b=>{i.current&&!i.current.contains(b.target)&&n(false);};return s&&document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s]);let f=h=>h?h.toLocaleDateString(r==="es"?"es-ES":"en-US",{day:"numeric",month:"short"}):"-",y=(h,b)=>new Date(h,b+1,0).getDate(),k=(h,b)=>new Date(h,b,1).getDay(),C=()=>{let h=c.getFullYear(),b=c.getMonth(),u=y(h,b),x=k(h,b),m=new Date,N=[];for(let w=0;w<x;w++)N.push(jsxRuntime.jsx("div",{className:"w-8 h-8"},`empty-${w}`));for(let w=1;w<=u;w++){let B=new Date(h,b,w),v=p&&p.getDate()===w&&p.getMonth()===b&&p.getFullYear()===h,I=m.getDate()===w&&m.getMonth()===b&&m.getFullYear()===h;N.push(jsxRuntime.jsx("button",{onClick:A=>{A.stopPropagation(),t?.(B),n(false);},className:d("w-8 h-8 rounded-full text-sm transition-colors",v?"bg-[#3B82F6] text-white":I?a?"bg-white/10 text-white":"bg-gray-100 text-gray-900":a?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-900"),children:w},w));}return N};return o||!t?jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:f(p)}):jsxRuntime.jsxs("div",{ref:i,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:h=>{h.stopPropagation(),n(!s);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Calendar,{className:d("w-4 h-4",a?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:f(p)})]}),s&&jsxRuntime.jsxs("div",{className:d("absolute z-50 top-full left-0 mt-1 p-3 rounded-lg shadow-lg border",a?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),g(new Date(c.getFullYear(),c.getMonth()-1,1));},className:d("p-1 rounded",a?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:d("w-4 h-4",a?"text-white":"text-gray-600")})}),jsxRuntime.jsxs("span",{className:d("text-sm font-medium",a?"text-white":"text-gray-900"),children:[Vh[l][c.getMonth()]," ",c.getFullYear()]}),jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),g(new Date(c.getFullYear(),c.getMonth()+1,1));},className:d("p-1 rounded",a?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",a?"text-white":"text-gray-600")})})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-1",children:jh[l].map(h=>jsxRuntime.jsx("div",{className:d("w-8 h-6 text-xs flex items-center justify-center",a?"text-[#6B7280]":"text-gray-400"),children:h},h))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:C()}),jsxRuntime.jsxs("div",{className:"mt-3 pt-3 border-t flex gap-2",style:{borderColor:a?"rgba(255,255,255,0.1)":"#E5E7EB"},children:[jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation(),t?.(new Date),n(false);},className:d("flex-1 py-1.5 text-xs rounded",a?"bg-white/10 text-white hover:bg-white/20":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:r==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:h=>{h.stopPropagation();let b=new Date;b.setDate(b.getDate()+1),t?.(b),n(false);},className:d("flex-1 py-1.5 text-xs rounded",a?"bg-white/10 text-white hover:bg-white/20":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:r==="es"?"Ma\xF1ana":"Tomorrow"})]})]})]})}function Am({value:e=0,onChange:t,isDark:a,disabled:r=false}){return jsxRuntime.jsxs("div",{className:"flex items-center gap-2 w-full",children:[jsxRuntime.jsx("div",{onClick:s=>{if(r||!t)return;s.stopPropagation();let n=s.currentTarget.getBoundingClientRect(),c=s.clientX-n.left,g=Math.round(c/n.width*100),i=Math.max(0,Math.min(100,g));t(i);},className:d("flex-1 h-2 rounded-full overflow-hidden",a?"bg-white/10":"bg-gray-200",!r&&t&&"cursor-pointer"),children:jsxRuntime.jsx("div",{className:d("h-full rounded-full transition-all",e===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${e}%`}})}),jsxRuntime.jsxs("span",{className:d("text-xs w-8 text-right",a?"text-[#9CA3AF]":"text-gray-500"),children:[e,"%"]})]})}function Im({value:e="",onChange:t,isDark:a,placeholder:r="-",disabled:o=false}){let[s,n]=react.useState(false),[c,g]=react.useState(e),i=react.useRef(null);react.useEffect(()=>{s&&i.current&&(i.current.focus(),i.current.select());},[s]),react.useEffect(()=>{g(e);},[e]);let p=()=>{c!==e&&t?.(c),n(false);},l=f=>{f.key==="Enter"?p():f.key==="Escape"&&(g(e),n(false));};return o||!t?jsxRuntime.jsx("span",{className:d("text-sm truncate",a?"text-[#94A3B8]":"text-gray-500"),children:e||r}):s?jsxRuntime.jsx("input",{ref:i,type:"text",value:c,onChange:f=>g(f.target.value),onBlur:p,onKeyDown:l,onClick:f=>f.stopPropagation(),className:d("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:f=>{f.stopPropagation(),n(true);},className:d("text-sm truncate text-left w-full px-2 py-1 rounded transition-colors",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",!e&&(a?"text-[#6B7280]":"text-gray-400")),children:e||r})}function Om({value:e,onChange:t,isDark:a,placeholder:r="-",min:o,max:s,disabled:n=false}){let[c,g]=react.useState(false),[i,p]=react.useState(e?.toString()||""),l=react.useRef(null);react.useEffect(()=>{c&&l.current&&(l.current.focus(),l.current.select());},[c]),react.useEffect(()=>{p(e?.toString()||"");},[e]);let f=()=>{let k=parseFloat(i);if(!isNaN(k)){let C=k;o!==void 0&&(C=Math.max(o,C)),s!==void 0&&(C=Math.min(s,C)),C!==e&&t?.(C);}g(false);},y=k=>{k.key==="Enter"?f():k.key==="Escape"&&(p(e?.toString()||""),g(false));};return n||!t?jsxRuntime.jsx("span",{className:d("text-sm",a?"text-[#94A3B8]":"text-gray-500"),children:e!==void 0?e:r}):c?jsxRuntime.jsx("input",{ref:l,type:"number",value:i,onChange:k=>p(k.target.value),onBlur:f,onKeyDown:y,onClick:k=>k.stopPropagation(),min:o,max:s,className:d("w-full px-2 py-1 text-sm rounded border outline-none",a?"bg-white/5 border-[#3B82F6] text-white":"bg-white border-[#3B82F6] text-gray-900")}):jsxRuntime.jsx("button",{onClick:k=>{k.stopPropagation(),g(true);},className:d("text-sm text-left w-full px-2 py-1 rounded transition-colors",a?"text-[#94A3B8] hover:bg-white/10":"text-gray-500 hover:bg-gray-100",e===void 0&&(a?"text-[#6B7280]":"text-gray-400")),children:e!==void 0?e:r})}function $m({value:e,options:t=[],onChange:a,isDark:r,placeholder:o="-",disabled:s=false}){let[n,c]=react.useState(false),g=react.useRef(null);return react.useEffect(()=>{let i=p=>{g.current&&!g.current.contains(p.target)&&c(false);};return n&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[n]),s||!a?jsxRuntime.jsx("span",{className:d("text-sm",r?"text-[#94A3B8]":"text-gray-500"),children:e||o}):jsxRuntime.jsxs("div",{ref:g,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:i=>{i.stopPropagation(),c(!n);},className:d("flex items-center gap-2 px-2 py-1 rounded transition-colors min-w-[80px]",r?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("span",{className:d("text-sm flex-1 text-left truncate",r?"text-[#94A3B8]":"text-gray-500",!e&&(r?"text-[#6B7280]":"text-gray-400")),children:e||o}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3 flex-shrink-0",r?"text-[#6B7280]":"text-gray-400")})]}),n&&jsxRuntime.jsx("div",{className:d("absolute z-50 top-full left-0 mt-1 py-1 rounded-lg shadow-lg border min-w-[120px] max-h-48 overflow-y-auto",r?"bg-[#1F2937] border-white/10":"bg-white border-gray-200"),children:t.length===0?jsxRuntime.jsx("p",{className:d("px-3 py-2 text-sm",r?"text-[#6B7280]":"text-gray-400"),children:"No options"}):t.map(i=>jsxRuntime.jsxs("button",{onClick:p=>{p.stopPropagation(),a(i),c(false);},className:d("w-full flex items-center justify-between gap-2 px-3 py-2 text-sm transition-colors",r?"hover:bg-white/10":"hover:bg-gray-100",e===i&&(r?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:r?"text-white":"text-gray-900",children:i}),e===i&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-[#3B82F6]"})]},i))})]})}function zm({value:e=false,onChange:t,isDark:a,disabled:r=false}){return jsxRuntime.jsx("button",{onClick:s=>{s.stopPropagation(),!r&&t&&t(!e);},disabled:r||!t,className:d("w-5 h-5 rounded border-2 flex items-center justify-center transition-colors",e?"bg-[#3B82F6] border-[#3B82F6]":a?"border-[#4B5563] hover:border-[#6B7280]":"border-gray-300 hover:border-gray-400",(r||!t)&&"opacity-50 cursor-not-allowed"),children:e&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})})}function Gm({value:e=[],isDark:t,maxVisible:a=2}){if(e.length===0)return jsxRuntime.jsx("span",{className:d("text-sm",t?"text-[#6B7280]":"text-gray-400"),children:"-"});let r=e.slice(0,a),o=e.length-a;return jsxRuntime.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[r.map(s=>jsxRuntime.jsx("span",{className:"inline-flex items-center px-2 py-0.5 text-xs rounded-full",style:{backgroundColor:s.color?`${s.color}20`:t?"rgba(255,255,255,0.1)":"#F3F4F6",color:s.color||(t?"#9CA3AF":"#6B7280")},children:s.name},s.id)),o>0&&jsxRuntime.jsxs("span",{className:d("inline-flex items-center px-2 py-0.5 text-xs rounded-full",t?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-500"),children:["+",o]})]})}function gy(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function fy(e){let t=["blue","green","purple","pink","yellow","red","indigo","teal"],a=0;for(let r=0;r<e.length;r++)a=e.charCodeAt(r)+((a<<5)-a);return t[Math.abs(a)%t.length]??"blue"}function Km({state:e,onClose:t,isDark:a,locale:r,onTaskEdit:o,onTaskDuplicate:s,onTaskDelete:n,onTaskUpdate:c,onColumnHide:g,onColumnSort:i,availableUsers:p=[]}){let l=react.useRef(null),f=r==="es"?Vm.es:Vm.en;if(react.useEffect(()=>{let b=x=>{l.current&&!l.current.contains(x.target)&&t();},u=x=>{x.key==="Escape"&&t();};return document.addEventListener("mousedown",b),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",u);}},[t]),!e.isOpen)return null;let y=()=>{if(!e.task)return [];let b=[];return o&&b.push({id:"edit",label:f.edit,icon:jsxRuntime.jsx(lucideReact.Edit3,{className:"w-4 h-4"}),onClick:()=>{o(e.task),t();}}),b.push({id:"sep1",label:"",icon:null,separator:true}),c&&(b.push({id:"status",label:f.changeStatus,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),submenu:[{id:"status-todo",label:f.todo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4 text-gray-400"}),onClick:()=>{c({...e.task,status:"todo",progress:0}),t();}},{id:"status-in-progress",label:f.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4 text-blue-500"}),onClick:()=>{c({...e.task,status:"in-progress",progress:e.task.progress||50}),t();}},{id:"status-completed",label:f.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4 text-green-500"}),onClick:()=>{c({...e.task,status:"completed",progress:100}),t();}}]}),b.push({id:"priority",label:f.changePriority,icon:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),submenu:[{id:"priority-urgent",label:f.urgent,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),onClick:()=>{c({...e.task,priority:"urgent"}),t();}},{id:"priority-high",label:f.high,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-orange-500"}),onClick:()=>{c({...e.task,priority:"high"}),t();}},{id:"priority-medium",label:f.medium,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),onClick:()=>{c({...e.task,priority:"medium"}),t();}},{id:"priority-low",label:f.low,icon:jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full bg-blue-500"}),onClick:()=>{c({...e.task,priority:"low"}),t();}}]}),p.length>0&&b.push({id:"assign",label:f.assignUser,icon:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),submenu:p.slice(0,5).map(u=>({id:`assign-${u.id}`,label:u.name,icon:jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] text-white bg-blue-500",children:u.name.charAt(0).toUpperCase()}),onClick:()=>{let x=e.task.assignees||[],N=x.some(w=>w.name===u.name)?x.filter(w=>w.name!==u.name):[...x,{name:u.name,initials:gy(u.name),color:u.color||fy(u.name),avatar:u.avatarUrl}];c({...e.task,assignees:N}),t();}}))})),b.push({id:"sep2",label:"",icon:null,separator:true}),s&&b.push({id:"duplicate",label:f.duplicate,icon:jsxRuntime.jsx(lucideReact.Copy,{className:"w-4 h-4"}),onClick:()=>{s(e.task),t();}}),n&&b.push({id:"delete",label:f.delete,icon:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"}),danger:true,onClick:()=>{n(e.task.id),t();}}),b},k=()=>{if(!e.columnId)return [];let b=[];return i&&(b.push({id:"sort-asc",label:f.sortAsc,icon:jsxRuntime.jsx(lucideReact.ArrowUp,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"asc"),t();}}),b.push({id:"sort-desc",label:f.sortDesc,icon:jsxRuntime.jsx(lucideReact.ArrowDown,{className:"w-4 h-4"}),onClick:()=>{i(e.columnId,"desc"),t();}})),g&&e.columnId!=="name"&&(b.push({id:"sep-hide",label:"",icon:null,separator:true}),b.push({id:"hide",label:f.hideColumn,icon:jsxRuntime.jsx(lucideReact.EyeOff,{className:"w-4 h-4"}),onClick:()=>{g(e.columnId),t();}})),b},C=e.type==="task"?y():k(),h={position:"fixed",left:e.x,top:e.y,zIndex:9999};return jsxRuntime.jsx("div",{ref:l,style:h,className:d("py-1 rounded-lg shadow-xl border min-w-[180px]",a?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:C.map(b=>b.separator?jsxRuntime.jsx("div",{className:d("my-1 h-px",a?"bg-white/10":"bg-gray-200")},b.id):b.submenu?jsxRuntime.jsx(by,{item:b,isDark:a},b.id):jsxRuntime.jsxs("button",{onClick:b.onClick,className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",a?"hover:bg-white/10":"hover:bg-gray-100",b.danger?"text-red-500 hover:text-red-600":a?"text-white":"text-gray-700"),children:[jsxRuntime.jsx("span",{className:d(b.danger?"text-red-500":a?"text-[#9CA3AF]":"text-gray-400"),children:b.icon}),b.label]},b.id))})}function by({item:e,isDark:t}){let[a,r]=react.useState(false),o=react.useRef();return jsxRuntime.jsxs("div",{className:"relative",onMouseEnter:()=>{o.current&&clearTimeout(o.current),r(true);},onMouseLeave:()=>{o.current=setTimeout(()=>r(false),150);},children:[jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:e.icon}),jsxRuntime.jsx("span",{className:"flex-1",children:e.label}),jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",t?"text-[#6B7280]":"text-gray-400")})]}),a&&e.submenu&&jsxRuntime.jsx("div",{className:d("absolute left-full top-0 ml-1 py-1 rounded-lg shadow-xl border min-w-[160px]",t?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:e.submenu.map(c=>jsxRuntime.jsxs("button",{onClick:c.onClick,className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",t?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:[jsxRuntime.jsx("span",{className:t?"text-[#9CA3AF]":"text-gray-400",children:c.icon}),c.label]},c.id))})]})}var Vm={en:{edit:"Edit",changeStatus:"Change status",changePriority:"Change priority",assignUser:"Assign user",duplicate:"Duplicate",delete:"Delete",todo:"To Do",inProgress:"In Progress",completed:"Completed",urgent:"Urgent",high:"High",medium:"Medium",low:"Low",sortAsc:"Sort A \u2192 Z",sortDesc:"Sort Z \u2192 A",hideColumn:"Hide column"},es:{edit:"Editar",changeStatus:"Cambiar estado",changePriority:"Cambiar prioridad",assignUser:"Asignar usuario",duplicate:"Duplicar",delete:"Eliminar",todo:"Pendiente",inProgress:"En Progreso",completed:"Completado",urgent:"Urgente",high:"Alta",medium:"Media",low:"Baja",sortAsc:"Ordenar A \u2192 Z",sortDesc:"Ordenar Z \u2192 A",hideColumn:"Ocultar columna"}};var Xm={name:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),status:jsxRuntime.jsx(lucideReact.CircleDot,{className:"w-4 h-4"}),priority:jsxRuntime.jsx(lucideReact.Flag,{className:"w-4 h-4"}),assignees:jsxRuntime.jsx(lucideReact.Users,{className:"w-4 h-4"}),startDate:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),endDate:jsxRuntime.jsx(lucideReact.CalendarCheck,{className:"w-4 h-4"}),progress:jsxRuntime.jsx(lucideReact.BarChart,{className:"w-4 h-4"}),tags:jsxRuntime.jsx(lucideReact.Tag,{className:"w-4 h-4"}),text:jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"}),number:jsxRuntime.jsx(lucideReact.Hash,{className:"w-4 h-4"}),date:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-4 h-4"}),dropdown:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-4 h-4"}),checkbox:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-4 h-4"})},Fy=["name","status","priority","assignees","startDate","endDate","progress","tags"];function Zm({isOpen:e,onClose:t,columns:a,customFields:r=[],onColumnsChange:o,onCreateCustomField:s,isDark:n,locale:c}){let[g,i]=react.useState(""),p=react.useRef(null),l=c==="es"?Jm.es:Jm.en;if(react.useEffect(()=>{if(!e)return;let b=setTimeout(()=>{let u=m=>{p.current&&!p.current.contains(m.target)&&t();},x=m=>{m.key==="Escape"&&t();};document.addEventListener("mousedown",u),document.addEventListener("keydown",x),p._cleanup=()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",x);};},100);return ()=>{clearTimeout(b),p._cleanup&&p._cleanup();}},[e,t]),!e)return null;let f=b=>l.columns[b]||b,y=b=>{if(b==="name")return;let u=a.map(x=>x.id===b?{...x,visible:!x.visible}:x);o(u);},k=(b,u)=>{let x=a.find(N=>N.type===b&&(!u||N.customFieldId===u));if(x){y(x.id);return}let m={id:u||b,type:b,label:u?r.find(N=>N.id===u)?.name||b:f(b),width:120,visible:true,sortable:true,resizable:true,customFieldId:u};o([...a,m]);},C=Fy.filter(b=>f(b).toLowerCase().includes(g.toLowerCase())),h=r.filter(b=>b.name.toLowerCase().includes(g.toLowerCase()));return jsxRuntime.jsxs("div",{ref:p,className:d("absolute right-0 top-full mt-1 w-72 rounded-lg shadow-xl border z-50",n?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:d("flex items-center justify-between px-4 py-3 border-b",n?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("font-medium",n?"text-white":"text-gray-900"),children:l.title}),jsxRuntime.jsx("button",{onClick:t,className:d("p-1 rounded",n?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:d("w-4 h-4",n?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsx("div",{className:"p-3",children:jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(lucideReact.Search,{className:d("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",n?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:g,onChange:b=>i(b.target.value),placeholder:l.searchPlaceholder,className:d("w-full pl-9 pr-3 py-2 text-sm rounded-lg border outline-none",n?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")})]})}),jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:d("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:l.standardFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:C.map(b=>{let u=a.find(N=>N.type===b&&!N.customFieldId),x=u?.visible??false,m=b==="name";return jsxRuntime.jsxs("button",{onClick:()=>{m||(u?y(u.id):k(b));},disabled:m,className:d("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100",m&&"opacity-50 cursor-not-allowed"),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded border flex items-center justify-center",x?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:x&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:Xm[b]}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:f(b)})]},b)})})]}),h.length>0&&jsxRuntime.jsxs("div",{className:"px-3 pb-2",children:[jsxRuntime.jsx("h4",{className:d("text-xs font-medium uppercase tracking-wider mb-2",n?"text-[#6B7280]":"text-gray-400"),children:l.customFields}),jsxRuntime.jsx("div",{className:"space-y-1",children:h.map(b=>{let x=a.find(m=>m.customFieldId===b.id)?.visible??false;return jsxRuntime.jsxs("button",{onClick:()=>k(b.type,b.id),className:d("w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",n?"hover:bg-white/10":"hover:bg-gray-100"),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded border flex items-center justify-center",x?"bg-[#3B82F6] border-[#3B82F6]":n?"border-[#4B5563]":"border-gray-300"),children:x&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:n?"text-[#9CA3AF]":"text-gray-400",children:Xm[b.type]||jsxRuntime.jsx(lucideReact.Type,{className:"w-4 h-4"})}),jsxRuntime.jsx("span",{className:n?"text-white":"text-gray-900",children:b.name})]},b.id)})})]}),s&&jsxRuntime.jsx("div",{className:d("p-3 border-t",n?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:s,className:d("w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors",n?"bg-[#3B82F6]/20 text-[#3B82F6] hover:bg-[#3B82F6]/30":"bg-blue-50 text-blue-600 hover:bg-blue-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),l.createField]})})]})}var Jm={en:{title:"Columns",searchPlaceholder:"Search fields...",standardFields:"Standard Fields",customFields:"Custom Fields",createField:"Create custom field",columns:{name:"Name",status:"Status",priority:"Priority",assignees:"Assignees",startDate:"Start Date",endDate:"End Date",progress:"Progress",tags:"Tags",text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Columnas",searchPlaceholder:"Buscar campos...",standardFields:"Campos Est\xE1ndar",customFields:"Campos Personalizados",createField:"Crear campo personalizado",columns:{name:"Nombre",status:"Estado",priority:"Prioridad",assignees:"Asignados",startDate:"Fecha Inicio",endDate:"Fecha Fin",progress:"Progreso",tags:"Etiquetas",text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var Hy=[{type:"text",icon:jsxRuntime.jsx(lucideReact.Type,{className:"w-5 h-5"})},{type:"number",icon:jsxRuntime.jsx(lucideReact.Hash,{className:"w-5 h-5"})},{type:"date",icon:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-5 h-5"})},{type:"dropdown",icon:jsxRuntime.jsx(lucideReact.ChevronDown,{className:"w-5 h-5"})},{type:"checkbox",icon:jsxRuntime.jsx(lucideReact.CheckSquare,{className:"w-5 h-5"})}];function tp({isOpen:e,onClose:t,onSave:a,isDark:r,locale:o}){let[s,n]=react.useState(""),[c,g]=react.useState("text"),[i,p]=react.useState([""]),l=o==="es"?ep.es:ep.en;react.useEffect(()=>{e&&(n(""),g("text"),p([""]));},[e]),react.useEffect(()=>{let h=b=>{b.key==="Escape"&&t();};return e&&document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]);let f=()=>{if(!s.trim())return;let h={name:s.trim(),type:c};c==="dropdown"&&(h.options=i.filter(b=>b.trim())),a(h),t();},y=()=>{p([...i,""]);},k=(h,b)=>{let u=[...i];u[h]=b,p(u);},C=h=>{i.length>1&&p(i.filter((b,u)=>u!==h));};return e?jsxRuntime.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:t}),jsxRuntime.jsxs("div",{className:d("relative w-full max-w-md rounded-xl shadow-2xl border",r?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsxs("div",{className:d("flex items-center justify-between px-6 py-4 border-b",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h2",{className:d("text-lg font-semibold",r?"text-white":"text-gray-900"),children:l.title}),jsxRuntime.jsx("button",{onClick:t,className:d("p-1 rounded",r?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.X,{className:d("w-5 h-5",r?"text-[#9CA3AF]":"text-gray-400")})})]}),jsxRuntime.jsxs("div",{className:"p-6 space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.fieldName}),jsxRuntime.jsx("input",{type:"text",value:s,onChange:h=>n(h.target.value),placeholder:l.fieldNamePlaceholder,className:d("w-full px-4 py-2.5 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400"),autoFocus:true})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.fieldType}),jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-2",children:Hy.map(h=>jsxRuntime.jsxs("button",{onClick:()=>g(h.type),className:d("flex flex-col items-center gap-1 p-3 rounded-lg border transition-colors",c===h.type?"border-[#3B82F6] bg-[#3B82F6]/10":r?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300"),children:[jsxRuntime.jsx("span",{className:c===h.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-400",children:h.icon}),jsxRuntime.jsx("span",{className:d("text-xs",c===h.type?"text-[#3B82F6]":r?"text-[#9CA3AF]":"text-gray-500"),children:l.types[h.type]})]},h.type))})]}),c==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:d("block text-sm font-medium mb-2",r?"text-white":"text-gray-900"),children:l.options}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[i.map((h,b)=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"text",value:h,onChange:u=>k(b,u.target.value),placeholder:`${l.option} ${b+1}`,className:d("flex-1 px-3 py-2 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",r?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-50 border-gray-200 text-gray-900 placeholder:text-gray-400")}),i.length>1&&jsxRuntime.jsx("button",{onClick:()=>C(b),className:d("p-2 rounded-lg transition-colors",r?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},b)),jsxRuntime.jsxs("button",{onClick:y,className:d("flex items-center gap-2 px-3 py-2 text-sm rounded-lg transition-colors",r?"text-[#3B82F6] hover:bg-white/10":"text-blue-600 hover:bg-gray-100"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),l.addOption]})]})]})]}),jsxRuntime.jsxs("div",{className:d("flex items-center justify-end gap-3 px-6 py-4 border-t",r?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("button",{onClick:t,className:d("px-4 py-2 text-sm font-medium rounded-lg transition-colors",r?"text-[#9CA3AF] hover:bg-white/10":"text-gray-600 hover:bg-gray-100"),children:l.cancel}),jsxRuntime.jsx("button",{onClick:f,disabled:!s.trim(),className:d("px-4 py-2 text-sm font-medium rounded-lg transition-colors","bg-[#3B82F6] text-white hover:bg-[#2563EB]",!s.trim()&&"opacity-50 cursor-not-allowed"),children:l.create})]})]})]}):null}var ep={en:{title:"Create Custom Field",fieldName:"Field Name",fieldNamePlaceholder:"Enter field name...",fieldType:"Field Type",options:"Options",option:"Option",addOption:"Add option",cancel:"Cancel",create:"Create Field",types:{text:"Text",number:"Number",date:"Date",dropdown:"Dropdown",checkbox:"Checkbox"}},es:{title:"Crear Campo Personalizado",fieldName:"Nombre del Campo",fieldNamePlaceholder:"Ingresa el nombre...",fieldType:"Tipo de Campo",options:"Opciones",option:"Opci\xF3n",addOption:"Agregar opci\xF3n",cancel:"Cancelar",create:"Crear Campo",types:{text:"Texto",number:"N\xFAmero",date:"Fecha",dropdown:"Lista",checkbox:"Casilla"}}};var rp={en:{filters:"Filters",filterByStatus:"FILTER BY STATUS",showAll:"Show All",completed:"Completed",inProgress:"In Progress",toDo:"To Do / Pending",hideCompleted:"Hide Completed Tasks"},es:{filters:"Filtros",filterByStatus:"FILTRAR POR ESTADO",showAll:"Mostrar Todo",completed:"Completadas",inProgress:"En Progreso",toDo:"Por Hacer / Pendiente",hideCompleted:"Ocultar Tareas Completadas"}};function op({value:e,hideCompleted:t,onChange:a,onHideCompletedChange:r,isDark:o,locale:s}){let[n,c]=react.useState(false),g=react.useRef(null),i=s==="es"?rp.es:rp.en;react.useEffect(()=>{if(!n)return;let f=setTimeout(()=>{let y=C=>{g.current&&!g.current.contains(C.target)&&c(false);},k=C=>{C.key==="Escape"&&c(false);};document.addEventListener("mousedown",y),document.addEventListener("keydown",k),g._cleanup=()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",k);};},100);return ()=>{clearTimeout(f),g._cleanup&&g._cleanup();}},[n]);let p=[{value:"all",label:i.showAll,icon:jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-[#3B82F6] bg-[#3B82F6]"}),color:"text-[#3B82F6]"},{value:"completed",label:i.completed,icon:jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-4 h-4"}),color:"text-green-500"},{value:"in-progress",label:i.inProgress,icon:jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-4 h-4"}),color:"text-blue-500"},{value:"todo",label:i.toDo,icon:jsxRuntime.jsx(lucideReact.Circle,{className:"w-4 h-4"}),color:"text-gray-400"}],l=e!=="all"||t;return jsxRuntime.jsxs("div",{ref:g,className:"relative",children:[jsxRuntime.jsxs("button",{onClick:f=>{f.stopPropagation(),c(y=>!y);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors border",o?"border-white/10 hover:bg-white/10 text-white":"border-gray-200 hover:bg-gray-100 text-gray-700",l&&(o?"bg-[#3B82F6]/20 border-[#3B82F6]/50 text-[#3B82F6]":"bg-blue-50 border-blue-200 text-blue-600"),n&&(o?"bg-white/10":"bg-gray-100")),children:[jsxRuntime.jsx(lucideReact.Filter,{className:"w-4 h-4"}),i.filters,l&&jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",o?"bg-[#3B82F6]":"bg-blue-500")})]}),n&&jsxRuntime.jsxs("div",{className:d("absolute left-0 top-full mt-2 w-72 rounded-lg shadow-xl border z-50",o?"bg-[#0F1117] border-white/10":"bg-white border-gray-200"),children:[jsxRuntime.jsx("div",{className:d("px-4 py-3 border-b",o?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("span",{className:d("text-xs font-medium uppercase tracking-wider",o?"text-[#6B7280]":"text-gray-400"),children:i.filterByStatus})}),jsxRuntime.jsx("div",{className:"py-2",children:p.map(f=>{let y=e===f.value&&!t;return jsxRuntime.jsxs("button",{onClick:()=>{a(f.value),r(false);},className:d("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/10":"hover:bg-gray-100",y&&(o?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d(f.color,"flex-shrink-0"),children:f.icon}),jsxRuntime.jsx("span",{className:d("flex-1 text-left whitespace-nowrap",o?"text-white":"text-gray-900"),children:f.label}),y&&jsxRuntime.jsx(lucideReact.Check,{className:d("w-4 h-4 flex-shrink-0",o?"text-[#3B82F6]":"text-blue-500")})]},f.value)})}),jsxRuntime.jsx("div",{className:d("my-2 mx-4 h-px",o?"bg-white/10":"bg-gray-200")}),jsxRuntime.jsx("div",{className:"py-1",children:jsxRuntime.jsxs("button",{onClick:()=>{r(!t),t||a("all");},className:d("w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors",o?"hover:bg-white/10":"hover:bg-gray-100",t&&(o?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx(lucideReact.EyeOff,{className:d("w-4 h-4 flex-shrink-0",t?o?"text-[#3B82F6]":"text-blue-500":o?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("flex-1 text-left whitespace-nowrap",o?"text-white":"text-gray-900"),children:i.hideCompleted}),t&&jsxRuntime.jsx(lucideReact.Check,{className:d("w-4 h-4 flex-shrink-0",o?"text-[#3B82F6]":"text-blue-500")})]})})]})]})}var iv=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:120,visible:true,sortable:true,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true}];function ip(e,t=0){let a=[];for(let r of e)a.push({...r,level:t,hasChildren:(r.subtasks?.length||0)>0,parentPath:[r.id]}),r.subtasks?.length&&r.isExpanded!==false&&a.push(...ip(r.subtasks,t+1));return a}function lv({status:e,progress:t}){return t===100||e==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-5 h-5 text-green-500"}):t&&t>0||e==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-5 h-5 text-blue-500"}):jsxRuntime.jsx(lucideReact.Circle,{className:"w-5 h-5 text-gray-400"})}function lp({tasks:e,config:t={},callbacks:a={},isLoading:r=false,error:o,className:s,style:n,availableUsers:c=[],customFields:g=[]}){let{theme:i="dark",locale:p="en",customTranslations:l,showSearch:f=true,showHierarchy:y=true,tableColumns:k,allowColumnCustomization:C=true,allowColumnResize:h=true,enableContextMenu:b=true}=t,u=is(p,l),x=i==="dark",[m,N]=react.useState("startDate"),[w,B]=react.useState("asc"),[v,I]=react.useState(""),[A,T]=react.useState("all"),[W,$]=react.useState(false),[j,te]=react.useState(k||iv),[oe,re]=react.useState(false),[ge,fe]=react.useState(false),[Ie,M]=react.useState({isOpen:false,x:0,y:0,type:"task"}),[R,L]=react.useState(null),[V,q]=react.useState(0),[z,ye]=react.useState(0),ne=react.useRef(null);react.useEffect(()=>{k&&te(k);},[k]);let Be=react.useMemo(()=>{let J=new Set;function ve(He){for(let Le of He)Le.subtasks?.length&&(Le.isExpanded!==false&&J.add(Le.id),ve(Le.subtasks));}return ve(e),J},[e]),qe=react.useMemo(()=>j.filter(J=>J.visible),[j]),tt=react.useCallback(J=>{a.onTaskToggleExpand?.(J);},[a]),le=react.useCallback(J=>{m===J?B(ve=>ve==="asc"?"desc":"asc"):(N(J),B("asc")),a.onSortChange?.({column:J,direction:w==="asc"?"desc":"asc"});},[m,w,a]),Je=react.useCallback(J=>{te(J),a.onColumnsChange?.(J);},[a]),ct=react.useCallback(J=>{let ve=j.map(He=>He.id===J?{...He,visible:false}:He);Je(ve);},[j,Je]),wt=react.useCallback((J,ve)=>{N(J),B(ve);},[]),vt=react.useCallback((J,ve,He)=>{b&&(J.preventDefault(),M({isOpen:true,x:J.clientX,y:J.clientY,type:ve?"task":"header",task:ve,columnId:He}));},[b]),U=react.useCallback(()=>{M(J=>({...J,isOpen:false}));},[]),me=react.useCallback((J,ve)=>{if(!h)return;J.preventDefault(),J.stopPropagation();let He=j.find(Le=>Le.id===ve);He&&(L(ve),q(J.clientX),ye(He.width));},[j,h]);react.useEffect(()=>{if(!R)return;let J=He=>{let Le=He.clientX-V,nt=Math.max(50,z+Le),st=j.map(_e=>_e.id===R?{..._e,width:nt}:_e);te(st);},ve=()=>{R&&a.onColumnsChange?.(j),L(null);};return document.addEventListener("mousemove",J),document.addEventListener("mouseup",ve),()=>{document.removeEventListener("mousemove",J),document.removeEventListener("mouseup",ve);}},[R,V,z,j,a]);let Ae=react.useCallback(async J=>{if(a.onCreateCustomField){let ve={...J,id:`cf_${Date.now()}`,projectId:""};await a.onCreateCustomField(ve);}fe(false);},[a]),Fe=react.useCallback(J=>J.progress===100||J.status==="completed"?"completed":J.progress&&J.progress>0||J.status==="in-progress"?"in-progress":"todo",[]),je=react.useMemo(()=>{let J=ip(e);if(v.trim()){let ve=v.toLowerCase();J=J.filter(He=>He.name.toLowerCase().includes(ve));}return A!=="all"&&(J=J.filter(ve=>Fe(ve)===A)),W&&(J=J.filter(ve=>Fe(ve)!=="completed")),J.sort((ve,He)=>{let Le,nt;switch(m){case "name":Le=ve.name.toLowerCase(),nt=He.name.toLowerCase();break;case "startDate":Le=ve.startDate?.getTime()||0,nt=He.startDate?.getTime()||0;break;case "endDate":Le=ve.endDate?.getTime()||0,nt=He.endDate?.getTime()||0;break;case "progress":Le=ve.progress||0,nt=He.progress||0;break;case "status":Le=ve.status||"todo",nt=He.status||"todo";break;case "priority":let st={urgent:0,high:1,medium:2,low:3,none:4};Le=st[ve.priority]??4,nt=st[He.priority]??4;break;default:return 0}return Le<nt?w==="asc"?-1:1:Le>nt?w==="asc"?1:-1:0}),J},[e,v,A,W,m,w,Fe]),Qe=react.useCallback((J,ve)=>{let He=st=>{a.onTaskUpdate?.({...J,...st});},Le=st=>st?J.customFields?.find(ea=>ea.fieldId===st)?.value:void 0,nt=(st,_e)=>{if(!st)return;let ke=[...J.customFields||[]],be=ke.findIndex(Ke=>Ke.fieldId===st);be>=0?ke[be]={fieldId:st,value:_e}:ke.push({fieldId:st,value:_e}),He({customFields:ke});};switch(ve.type){case "name":return null;case "status":return jsxRuntime.jsx(Cm,{value:J.status||(J.progress===100?"completed":J.progress&&J.progress>0?"in-progress":"todo"),onChange:_e=>{He({status:_e,progress:_e==="completed"?100:_e==="in-progress"?50:0});},isDark:x,locale:p,translations:u.status});case "priority":return jsxRuntime.jsx(Nm,{value:J.priority,onChange:_e=>He({priority:_e}),isDark:x,locale:p});case "assignees":return jsxRuntime.jsx(Sm,{value:J.assignees||[],availableUsers:c,onChange:_e=>He({assignees:_e}),isDark:x,locale:p});case "startDate":return jsxRuntime.jsx(ps,{value:J.startDate,onChange:_e=>He({startDate:_e}),isDark:x,locale:p});case "endDate":return jsxRuntime.jsx(ps,{value:J.endDate,onChange:_e=>He({endDate:_e}),isDark:x,locale:p});case "progress":return jsxRuntime.jsx(Am,{value:J.progress||0,onChange:_e=>{let ea=_e===100?"completed":_e>0?"in-progress":"todo";He({progress:_e,status:ea});},isDark:x});case "tags":return jsxRuntime.jsx(Gm,{value:J.tags||[],isDark:x});case "text":return jsxRuntime.jsx(Im,{value:Le(ve.customFieldId)||"",onChange:_e=>nt(ve.customFieldId,_e),isDark:x});case "number":return jsxRuntime.jsx(Om,{value:Le(ve.customFieldId)||0,onChange:_e=>nt(ve.customFieldId,_e),isDark:x});case "date":let st=Le(ve.customFieldId);return jsxRuntime.jsx(ps,{value:st?new Date(st):void 0,onChange:_e=>nt(ve.customFieldId,_e),isDark:x,locale:p});case "dropdown":return jsxRuntime.jsx($m,{value:Le(ve.customFieldId)||"",options:ve.options||[],onChange:_e=>nt(ve.customFieldId,_e),isDark:x});case "checkbox":return jsxRuntime.jsx(zm,{value:Le(ve.customFieldId)||false,onChange:_e=>nt(ve.customFieldId,_e),isDark:x});default:return jsxRuntime.jsx("span",{className:d("text-sm",x?"text-[#94A3B8]":"text-gray-500"),children:"-"})}},[a,x,p,c,u]),Pt=react.useCallback(J=>({name:u.columns.name,status:u.columns.status,priority:u.columns.priority,assignees:u.columns.assignees,startDate:u.columns.startDate,endDate:u.columns.endDate,progress:u.columns.progress})[J.type]||J.label,[u]),Re=react.useMemo(()=>qe.reduce((J,ve)=>J+ve.width,0)+(C?48:0),[qe,C]);return r?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:[u.empty.noTasks,"..."]})]})}):o?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",x?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:typeof o=="string"?o:o.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",x?"bg-[#0F1117]":"bg-white",s),style:n,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.List,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",x?"text-white":"text-gray-900"),children:u.empty.noTasks}),jsxRuntime.jsx("p",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:u.empty.addFirstTask})]})}):jsxRuntime.jsxs("div",{ref:ne,className:d("flex-1 flex flex-col w-full h-full overflow-hidden",x?"bg-[#0F1117]":"bg-white",R&&"select-none",s),style:n,children:[jsxRuntime.jsx("div",{className:d("flex-shrink-0 px-6 py-4 border-b",x?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx(op,{value:A,hideCompleted:W,onChange:T,onHideCompletedChange:$,isDark:x,locale:p}),f&&jsxRuntime.jsxs("div",{className:"relative flex-1 max-w-md",children:[jsxRuntime.jsx(lucideReact.Search,{className:d("absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")}),jsxRuntime.jsx("input",{type:"text",value:v,onChange:J=>I(J.target.value),placeholder:u.toolbar.searchPlaceholder,className:d("w-full h-9 pl-10 pr-4 rounded-lg border outline-none focus:ring-2 focus:ring-[#3B82F6]/30",x?"bg-white/5 border-white/10 text-white placeholder:text-[#6B7280]":"bg-gray-100 border-gray-200 text-gray-900 placeholder:text-gray-400")})]}),jsxRuntime.jsxs("div",{className:d("text-sm",x?"text-[#9CA3AF]":"text-gray-600"),children:[je.length," ",u.pagination.tasks]})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-auto",children:jsxRuntime.jsxs("div",{style:{minWidth:Re},children:[jsxRuntime.jsxs("div",{className:d("flex-shrink-0 flex items-center border-b text-xs font-medium uppercase tracking-wider sticky top-0 z-10",x?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[qe.map(J=>jsxRuntime.jsxs("div",{className:d("relative flex items-center gap-2 px-4 py-3",x?"text-[#9CA3AF]":"text-gray-500"),style:{width:J.width,minWidth:J.minWidth},onContextMenu:ve=>vt(ve,void 0,J.id),children:[J.sortable?jsxRuntime.jsxs("button",{onClick:()=>le(J.id),className:"flex items-center gap-1 hover:text-[#3B82F6]",children:[Pt(J),jsxRuntime.jsx(lucideReact.ArrowUpDown,{className:d("w-3 h-3",m===J.id&&"text-[#3B82F6]")})]}):jsxRuntime.jsx("span",{children:Pt(J)}),h&&J.resizable&&jsxRuntime.jsx("div",{className:d("absolute right-0 top-0 bottom-0 w-1 cursor-col-resize group","hover:bg-[#3B82F6]",R===J.id&&"bg-[#3B82F6]"),onMouseDown:ve=>me(ve,J.id)})]},J.id)),C&&jsxRuntime.jsxs("div",{className:"relative flex items-center justify-center px-3 py-3",children:[jsxRuntime.jsx("button",{onClick:J=>{J.stopPropagation(),re(ve=>!ve);},className:d("p-1.5 rounded-lg transition-colors",x?"hover:bg-white/10 text-[#9CA3AF] hover:text-white":"hover:bg-gray-200 text-gray-400 hover:text-gray-600",oe&&(x?"bg-white/10":"bg-gray-200")),title:p==="es"?"Agregar columna":"Add column",children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})}),jsxRuntime.jsx(Zm,{isOpen:oe,onClose:()=>re(false),columns:j,customFields:g,onColumnsChange:Je,onCreateCustomField:()=>{re(false),fe(true);},isDark:x,locale:p})]})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:je.map((J,ve)=>{let He=Be.has(J.id);return jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{delay:ve*.02},className:d("flex items-center border-b transition-colors",x?"border-white/5 hover:bg-white/5":"border-gray-100 hover:bg-gray-50"),onClick:()=>a.onTaskClick?.(J),onDoubleClick:()=>a.onTaskDoubleClick?.(J),onContextMenu:Le=>vt(Le,J),children:[qe.map(Le=>jsxRuntime.jsx("div",{className:"flex items-center px-4 py-3 min-h-[52px]",style:{width:Le.width,minWidth:Le.minWidth},children:Le.type==="name"?jsxRuntime.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[y&&J.level>0&&jsxRuntime.jsx("div",{style:{width:`${J.level*24}px`},className:"flex-shrink-0"}),y&&J.hasChildren&&jsxRuntime.jsx("button",{onClick:nt=>{nt.stopPropagation(),tt(J.id);},className:d("p-0.5 rounded flex-shrink-0",x?"hover:bg-white/10":"hover:bg-gray-200"),children:He?jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")}):jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-4 h-4",x?"text-[#9CA3AF]":"text-gray-400")})}),y&&!J.hasChildren&&jsxRuntime.jsx("div",{className:"w-5 flex-shrink-0"}),jsxRuntime.jsx("button",{onClick:nt=>{nt.stopPropagation(),a.onTaskUpdate?.({...J,progress:J.progress===100?0:100,status:J.progress===100?"todo":"completed"});},className:"flex-shrink-0",children:jsxRuntime.jsx(lv,{status:J.status,progress:J.progress})}),jsxRuntime.jsx("span",{className:d("truncate font-medium",x?"text-white":"text-gray-900",J.progress===100&&(x?"line-through text-[#6B7280]":"line-through text-gray-400")),children:J.name})]}):Qe(J,Le)},Le.id)),C&&jsxRuntime.jsx("div",{className:"w-12 flex-shrink-0"})]},J.id)})}),je.length===0&&v&&jsxRuntime.jsx("div",{className:"flex items-center justify-center py-12",children:jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx(lucideReact.List,{className:d("w-12 h-12 mx-auto mb-4",x?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:d(x?"text-[#9CA3AF]":"text-gray-600"),children:u.empty.noResults})]})})]})}),jsxRuntime.jsx(Km,{state:Ie,onClose:U,isDark:x,locale:p,onTaskEdit:a.onTaskEdit,onTaskDuplicate:a.onTaskDuplicate,onTaskDelete:a.onTaskDelete,onTaskUpdate:a.onTaskUpdate,onColumnHide:ct,onColumnSort:wt,availableUsers:c}),jsxRuntime.jsx(tp,{isOpen:ge,onClose:()=>fe(false),onSave:Ae,isDark:x,locale:p})]})}var dp=[{id:"name",type:"name",label:"Name",width:300,visible:true,sortable:true,resizable:true},{id:"status",type:"status",label:"Status",width:120,visible:true,sortable:true,resizable:true},{id:"priority",type:"priority",label:"Priority",width:100,visible:false,sortable:true,resizable:true},{id:"assignees",type:"assignees",label:"Assignees",width:150,visible:false,sortable:false,resizable:true},{id:"startDate",type:"startDate",label:"Start Date",width:120,visible:true,sortable:true,resizable:true},{id:"endDate",type:"endDate",label:"End Date",width:120,visible:true,sortable:true,resizable:true},{id:"progress",type:"progress",label:"Progress",width:100,visible:true,sortable:true,resizable:true},{id:"tags",type:"tags",label:"Tags",width:150,visible:false,sortable:false,resizable:true}],cp=[{type:"name",labelKey:"columns.name",icon:"Type"},{type:"status",labelKey:"columns.status",icon:"CircleDot"},{type:"priority",labelKey:"columns.priority",icon:"Flag"},{type:"assignees",labelKey:"columns.assignees",icon:"Users"},{type:"startDate",labelKey:"columns.startDate",icon:"Calendar"},{type:"endDate",labelKey:"columns.endDate",icon:"CalendarCheck"},{type:"progress",labelKey:"columns.progress",icon:"BarChart"},{type:"tags",labelKey:"columns.tags",icon:"Tag"}],mp=[{type:"text",labelKey:"customFields.text",icon:"Type"},{type:"number",labelKey:"customFields.number",icon:"Hash"},{type:"date",labelKey:"customFields.date",icon:"Calendar"},{type:"dropdown",labelKey:"customFields.dropdown",icon:"ChevronDown"},{type:"checkbox",labelKey:"customFields.checkbox",icon:"CheckSquare"}];var pl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgSelected:"#1f6feb20",bgAlternate:"#0d111780",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff",checkboxBg:"#21262d",checkboxChecked:"#58a6ff"},ul={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgSelected:"#dbeafe",bgAlternate:"#f9fafb",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da",checkboxBg:"#ffffff",checkboxChecked:"#0969da"},gl={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgSelected:"#0f4c7520",bgAlternate:"#1a1a2e80",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1",checkboxBg:"#1f3460",checkboxChecked:"#6366f1"},fs={dark:pl,light:ul,neutral:gl};function pp(e){return fs[e]||fs.dark}var fl={navigation:{today:"Today",previous:"Previous",next:"Next",month:"Month",week:"Week",day:"Day"},weekdays:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weekdaysFull:{sunday:"Sunday",monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday"},months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},status:{todo:"To Do",inProgress:"In Progress",completed:"Completed"},labels:{allDay:"All day",moreEvents:"+{count} more",noEvents:"No tasks",newTask:"New Task",viewAll:"View all",week:"Week"},tooltips:{progress:"Progress",status:"Status",assignees:"Assignees",duration:"Duration",days:"days"}},bl={navigation:{today:"Hoy",previous:"Anterior",next:"Siguiente",month:"Mes",week:"Semana",day:"D\xEDa"},weekdays:{sun:"Dom",mon:"Lun",tue:"Mar",wed:"Mi\xE9",thu:"Jue",fri:"Vie",sat:"S\xE1b"},weekdaysFull:{sunday:"Domingo",monday:"Lunes",tuesday:"Martes",wednesday:"Mi\xE9rcoles",thursday:"Jueves",friday:"Viernes",saturday:"S\xE1bado"},months:{january:"Enero",february:"Febrero",march:"Marzo",april:"Abril",may:"Mayo",june:"Junio",july:"Julio",august:"Agosto",september:"Septiembre",october:"Octubre",november:"Noviembre",december:"Diciembre"},status:{todo:"Por Hacer",inProgress:"En Progreso",completed:"Completado"},labels:{allDay:"Todo el d\xEDa",moreEvents:"+{count} m\xE1s",noEvents:"Sin tareas",newTask:"Nueva Tarea",viewAll:"Ver todo",week:"Semana"},tooltips:{progress:"Progreso",status:"Estado",assignees:"Asignados",duration:"Duraci\xF3n",days:"d\xEDas"}},bs={en:fl,es:bl};function ln(e){return bs[e]||bs.en}function hs(e,t){let a=ln(e);return t?{navigation:{...a.navigation,...t.navigation},weekdays:{...a.weekdays,...t.weekdays},weekdaysFull:{...a.weekdaysFull,...t.weekdaysFull},months:{...a.months,...t.months},status:{...a.status,...t.status},labels:{...a.labels,...t.labels},tooltips:{...a.tooltips,...t.tooltips}}:a}function up(e){let t=ln(e);return [t.months.january,t.months.february,t.months.march,t.months.april,t.months.may,t.months.june,t.months.july,t.months.august,t.months.september,t.months.october,t.months.november,t.months.december]}function gp(e,t=0,a=true){let r=ln(e),o=a?[r.weekdays.sun,r.weekdays.mon,r.weekdays.tue,r.weekdays.wed,r.weekdays.thu,r.weekdays.fri,r.weekdays.sat]:[r.weekdaysFull.sunday,r.weekdaysFull.monday,r.weekdaysFull.tuesday,r.weekdaysFull.wednesday,r.weekdaysFull.thursday,r.weekdaysFull.friday,r.weekdaysFull.saturday];return [...o.slice(t),...o.slice(0,t)]}function Sv(e){let t=[];function a(r){for(let o of r)t.push(o),o.subtasks?.length&&a(o.subtasks);}return a(e),t}function wl(e,t){if(!t.startDate||!t.endDate)return false;let a=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(t.startDate.getFullYear(),t.startDate.getMonth(),t.startDate.getDate()),o=new Date(t.endDate.getFullYear(),t.endDate.getMonth(),t.endDate.getDate());return a>=r&&a<=o}function vp({task:e}){return e.progress===100||e.status==="completed"?jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-green-500 flex-shrink-0"}):e.progress&&e.progress>0||e.status==="in-progress"?jsxRuntime.jsx(lucideReact.PlayCircle,{className:"w-3 h-3 text-blue-500 flex-shrink-0"}):jsxRuntime.jsx(lucideReact.Circle,{className:"w-3 h-3 text-gray-400 flex-shrink-0"})}function kp({tasks:e,config:t={},callbacks:a={},initialDate:r,isLoading:o=false,error:s,className:n,style:c,availableTags:g=[],onCreateTag:i,attachmentsByTask:p,comments:l,onAddComment:f,currentUser:y,mentionableUsers:k,onTaskOpen:C}){let{theme:h="dark",locale:b="en",customTranslations:u}=t,x=hs(b,u),m=h==="dark",N={textTertiary:m?"#6B7280":"#9CA3AF",textSecondary:m?"#9CA3AF":"#6B7280",textPrimary:m?"#FFFFFF":"#111827",borderLight:m?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",border:m?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)",bgPrimary:m?"#1A1D25":"#FFFFFF",bgSecondary:m?"#0F1117":"#F9FAFB",hoverBg:m?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.05)"},[w,B]=react.useState(r||new Date),[v,I]=react.useState(null),[A,T]=react.useState(null),[W,$]=react.useState(null),[j,te]=react.useState(new Date),[oe,re]=react.useState({}),ge=4,fe=3,[Ie,M]=react.useState(false),[R,L]=react.useState(false),[V,q]=react.useState(false),[z,ye]=react.useState(false),[ne,Be]=react.useState(null),[qe,tt]=react.useState(""),[le,Je]=react.useState(void 0),[ct,wt]=react.useState(null),[vt,U]=react.useState(false),[me,Ae]=react.useState(false),[Fe,je]=react.useState(null),[Qe,Pt]=react.useState(false),[Re,J]=react.useState(new Date),[ve,He]=react.useState(false),[Le,nt]=react.useState(false),[st,_e]=react.useState(false),[ea,ke]=react.useState(""),[be,Ke]=react.useState(false),[F,Ce]=react.useState(""),[Z,Te]=react.useState(false),we=react.useCallback(()=>{B(new Date(w.getFullYear(),w.getMonth()-1,1));},[w]),Oe=react.useCallback(()=>{B(new Date(w.getFullYear(),w.getMonth()+1,1));},[w]),$e=react.useCallback(()=>{B(new Date);},[]),dt=react.useMemo(()=>{let P=w.getFullYear(),O=w.getMonth(),Me=new Date(P,O,1),Xe=new Date(P,O+1,0),Lt=Me.getDay(),de=Xe.getDate(),ze=Sv(e),xt=new Date;xt.setHours(0,0,0,0);let Ve=[],ft=Lt,aa=new Date(P,O,0).getDate();for(let jt=ft-1;jt>=0;jt--){let Ze=new Date(P,O-1,aa-jt);Ve.push({date:Ze,isCurrentMonth:false,isToday:false,isWeekend:Ze.getDay()===0||Ze.getDay()===6,events:ze.filter(Kt=>wl(Ze,Kt)).map(Kt=>({id:Kt.id,title:Kt.name,start:Kt.startDate,end:Kt.endDate,task:Kt}))});}for(let jt=1;jt<=de;jt++){let Ze=new Date(P,O,jt),Kt=Ze.getTime()===xt.getTime();Ve.push({date:Ze,isCurrentMonth:true,isToday:Kt,isWeekend:Ze.getDay()===0||Ze.getDay()===6,events:ze.filter(la=>wl(Ze,la)).map(la=>({id:la.id,title:la.name,start:la.startDate,end:la.endDate,task:la}))});}let Ca=42-Ve.length;for(let jt=1;jt<=Ca;jt++){let Ze=new Date(P,O+1,jt);Ve.push({date:Ze,isCurrentMonth:false,isToday:false,isWeekend:Ze.getDay()===0||Ze.getDay()===6,events:ze.filter(Kt=>wl(Ze,Kt)).map(Kt=>({id:Kt.id,title:Kt.name,start:Kt.startDate,end:Kt.endDate,task:Kt}))});}return Ve},[w,e]),_=b==="es"?["Dom","Lun","Mar","Mi\xE9","Jue","Vie","S\xE1b"]:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Y=w.toLocaleDateString(b==="es"?"es-ES":"en-US",{month:"long",year:"numeric"}),se=react.useCallback((P,O)=>{if(!v)return;let Me={...v,[P]:O};I(Me),a.onTaskUpdate?.(Me);},[v,a]),Ye=react.useCallback(P=>{if(!v)return;let O=v.progress||0;P==="completed"?O=100:P==="todo"&&(O=0);let Me={...v,status:P,progress:O};I(Me),a.onTaskUpdate?.(Me),M(false);},[v,a]),Ue=react.useCallback((P,O)=>{if(!v)return;let Me={...v,startDate:P,endDate:O};I(Me),a.onTaskUpdate?.(Me);},[v,a]),H=react.useCallback(()=>{M(false),L(false),q(false),$(null),_e(false),ke(""),Ke(false);},[]),ie=react.useCallback(async P=>{if(P.preventDefault(),P.stopPropagation(),He(false),!v||!a.onUploadAttachments)return;let O=Array.from(P.dataTransfer.files);if(O.length!==0){nt(true);try{await a.onUploadAttachments(v.id,O);}finally{nt(false);}}},[v,a]),We=react.useCallback(async P=>{if(!v||!a.onUploadAttachments||!P.target.files)return;let O=Array.from(P.target.files);if(O.length!==0){nt(true);try{await a.onUploadAttachments(v.id,O);}finally{nt(false);}P.target.value="";}},[v,a]),Mt=react.useCallback(P=>{P.preventDefault(),P.stopPropagation(),He(true);},[]),pt=react.useCallback(P=>{P.preventDefault(),P.stopPropagation(),He(false);},[]),Ar=react.useCallback(P=>P<1024?`${P} B`:P<1024*1024?`${(P/1024).toFixed(1)} KB`:`${(P/(1024*1024)).toFixed(1)} MB`,[]),wa=react.useCallback(P=>P.startsWith("image/")?lucideReact.Image:P.includes("pdf")||P.includes("document")?lucideReact.FileText:lucideReact.File,[]),ta=react.useMemo(()=>!v||!p?[]:p.get(v.id)||[],[v,p]);return o?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",m?"bg-[#0F1117]":"bg-white",n),style:c,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 animate-spin rounded-full border-b-2 border-[#3B82F6]"}),jsxRuntime.jsxs("p",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-600"),children:[x.labels.noEvents,"..."]})]})}):s?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",m?"bg-[#0F1117]":"bg-white",n),style:c,children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[jsxRuntime.jsx("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center",children:jsxRuntime.jsx("span",{className:"text-red-500 text-2xl",children:"\u26A0"})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",m?"text-white":"text-gray-900"),children:"Error"}),jsxRuntime.jsx("p",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-600"),children:typeof s=="string"?s:s.message})]})]})}):e.length===0?jsxRuntime.jsx("div",{className:d("flex-1 flex items-center justify-center",m?"bg-[#0F1117]":"bg-white",n),style:c,children:jsxRuntime.jsxs("div",{className:"text-center max-w-md",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#3B82F6]/10 flex items-center justify-center",children:jsxRuntime.jsx(lucideReact.Calendar,{className:"w-8 h-8 text-[#3B82F6]"})}),jsxRuntime.jsx("h3",{className:d("text-lg font-semibold mb-2",m?"text-white":"text-gray-900"),children:x.labels.noEvents}),jsxRuntime.jsx("p",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-600"),children:x.labels.newTask})]})}):jsxRuntime.jsxs("div",{className:d("flex-1 flex flex-col w-full h-full overflow-auto",m?"bg-[#0F1117]":"bg-white",n),style:c,children:[jsxRuntime.jsx("div",{className:d("flex-shrink-0 px-6 py-4 border-b",m?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("h2",{className:d("text-xl font-semibold capitalize",m?"text-white":"text-gray-900"),children:Y}),jsxRuntime.jsx("button",{onClick:$e,className:d("px-3 py-1.5 text-sm rounded-lg transition-colors",m?"bg-white/5 text-white hover:bg-white/10":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:x.navigation.today})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("button",{onClick:we,className:d("p-2 rounded-lg transition-colors",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:d("w-5 h-5",m?"text-[#9CA3AF]":"text-gray-600")})}),jsxRuntime.jsx("button",{onClick:Oe,className:d("p-2 rounded-lg transition-colors",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:d("w-5 h-5",m?"text-[#9CA3AF]":"text-gray-600")})})]})]})}),jsxRuntime.jsx("div",{className:"flex-1 p-6 min-h-0",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-px mb-2",children:_.map(P=>jsxRuntime.jsx("div",{className:d("py-2 text-center text-xs font-medium uppercase",m?"text-[#9CA3AF]":"text-gray-500"),children:P},P))}),jsxRuntime.jsx("div",{className:d("grid grid-cols-7 auto-rows-min gap-px rounded-lg",m?"bg-[#2D2D2D]":"bg-gray-300"),children:dt.map((P,O)=>{let Me=P.date.getDay()===0||P.date.getDay()===6;return jsxRuntime.jsxs("div",{className:d("min-h-[120px] p-2 transition-colors flex flex-col relative group",m?Me?"bg-[#1C1F26]":P.isCurrentMonth?"bg-[#13161B]":"bg-[#0D0F13]":Me?"bg-gray-100":P.isCurrentMonth?"bg-white":"bg-gray-50",P.isToday&&"ring-2 ring-[#3B82F6] ring-inset"),children:[(()=>{let Xe=oe[O]||ge,Lt=P.events.slice(0,Xe),de=P.events.length-Xe;return jsxRuntime.jsxs("div",{className:"space-y-1 flex-1",children:[Lt.map(ze=>jsxRuntime.jsx("div",{className:"relative group",children:jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>{I(ze.task),a.onEventClick?.(ze),C?.(ze.task.id);},whileHover:{scale:1.02},className:d("w-full flex items-center gap-1 px-1.5 py-0.5 rounded text-xs truncate",ze.task.progress===100?m?"bg-green-500/20 text-green-400":"bg-green-500/10 text-green-600":m?"bg-[#3B82F6]/20 text-[#3B82F6]":"bg-[#3B82F6]/10 text-[#3B82F6]"),children:[jsxRuntime.jsx(vp,{task:ze.task}),jsxRuntime.jsx("span",{className:"truncate",children:ze.title})]})},ze.id)),de>0&&jsxRuntime.jsxs("button",{onClick:ze=>{ze.stopPropagation(),re(xt=>({...xt,[O]:Xe+fe}));},className:d("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",m?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:["+",de," ",b==="es"?"M\xC1S":"MORE"]}),Xe>ge&&P.events.length>ge&&jsxRuntime.jsx("button",{onClick:ze=>{ze.stopPropagation(),re(xt=>({...xt,[O]:ge}));},className:d("text-xs px-1.5 py-0.5 hover:underline cursor-pointer font-medium",m?"text-[#6B7280] hover:text-[#9CA3AF]":"text-gray-400 hover:text-gray-600"),children:b==="es"?"MENOS":"LESS"})]})})(),jsxRuntime.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-1",children:[(()=>{let Xe=O>=28,Lt=O%7>=5;return jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),ne===O?Be(null):(Be(O),tt(""),Je(void 0),wt(null),je(null),U(false),Ae(false),Pt(false),J(P.date));},className:d("w-5 h-5 rounded flex items-center justify-center transition-all",ne===O?"opacity-100 bg-[#7C3AED] text-white":"opacity-0 group-hover:opacity-100",m?"hover:bg-[#7C3AED] text-[#6B7280] hover:text-white":"hover:bg-[#7C3AED] text-gray-400 hover:text-white"),children:jsxRuntime.jsx(lucideReact.Plus,{className:d("w-3.5 h-3.5 transition-transform",ne===O&&"rotate-45")})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:ne===O&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{Be(null),tt(""),Je(void 0),wt(null),je(null),U(false),Ae(false),Pt(false);}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:Xe?-5:5,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:Xe?-5:5,scale:.95},transition:{duration:.12},className:d("absolute w-[320px] rounded-lg shadow-2xl z-50",Xe?"bottom-full mb-1":"top-full mt-1",Lt?"right-0":"left-0",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>{de.stopPropagation(),U(false),Ae(false),Pt(false);},children:[jsxRuntime.jsx("div",{className:"p-2.5",children:jsxRuntime.jsx("input",{type:"text",value:qe,onChange:de=>tt(de.target.value),placeholder:b==="es"?'Escribe el nombre de la tarea o "/" para los comandos':'Type task name or "/" for commands',className:d("w-full bg-transparent text-sm outline-none placeholder:opacity-40",m?"text-white":"text-gray-900"),autoFocus:true,onKeyDown:de=>{if(de.key==="Enter"&&qe.trim()){let ze=t.availableUsers?.find(Ve=>Ve.id===ct),xt=Fe||P.date;a.onTaskCreate?.({name:qe.trim(),startDate:xt,endDate:xt,priority:le,assignees:ze?[ze]:void 0}),tt(""),Je(void 0),wt(null),je(null),Be(null);}de.key==="Escape"&&(Be(null),tt(""),Je(void 0),wt(null),je(null));}})}),jsxRuntime.jsxs("div",{className:d("px-2.5 py-2 flex items-center justify-between border-t",m?"border-white/10":"border-gray-100"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),U(!vt),Ae(false);},className:d("p-1 rounded transition-colors",le?le==="urgent"||le==="high"?"text-red-400 bg-red-500/20":le==="medium"?"text-yellow-400 bg-yellow-500/20":"text-green-400 bg-green-500/20":m?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:vt&&jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[120px]",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[{id:"urgent",label:b==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:b==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:b==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:b==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:b==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(de=>jsxRuntime.jsxs("button",{onClick:()=>{Je(de.id),U(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",le===de.id&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",de.color)}),jsxRuntime.jsx("span",{className:m?"text-white":"text-gray-900",children:de.label})]},de.id||"none"))})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsxs("button",{onClick:de=>{de.stopPropagation(),Pt(!Qe),U(false),Ae(false),J(Fe||P.date);},className:d("flex items-center gap-1 text-xs px-1.5 py-0.5 rounded transition-colors",Fe?"bg-[#7C3AED]/20 text-[#7C3AED]":m?"bg-white/5 text-[#9CA3AF] hover:bg-white/10":"bg-gray-100 text-gray-500 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:"w-3 h-3"}),(Fe||P.date).toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Qe&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-xl shadow-2xl overflow-hidden flex",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[jsxRuntime.jsx("div",{className:d("w-40 py-2 border-r",m?"border-white/10":"border-gray-200"),children:(()=>{let de=new Date,ze=new Date(de);ze.setDate(de.getDate()+1);let xt=new Date(de);xt.setDate(de.getDate()+((6-de.getDay()+7)%7||7));let Ve=new Date(de);Ve.setDate(de.getDate()+((1-de.getDay()+7)%7||7));let ft=new Date(de);ft.setDate(de.getDate()+14);let aa=new Date(de);return aa.setDate(de.getDate()+28),[{label:b==="es"?"Hoy":"Today",date:de,display:de.toLocaleDateString(b==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:b==="es"?"Ma\xF1ana":"Tomorrow",date:ze,display:ze.toLocaleDateString(b==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:b==="es"?"Este fin de semana":"This weekend",date:xt,display:b==="es"?"s\xE1b.":"sat."},{label:b==="es"?"Pr\xF3xima semana":"Next week",date:Ve,display:b==="es"?"lun.":"mon."},{label:b==="es"?"2 semanas":"2 weeks",date:ft,display:ft.toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:b==="es"?"4 semanas":"4 weeks",date:aa,display:aa.toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((jt,Ze)=>jsxRuntime.jsxs("button",{className:d("w-full flex items-center justify-between px-3 py-1.5 text-xs transition-colors",m?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{je(jt.date),Pt(false);},children:[jsxRuntime.jsx("span",{children:jt.label}),jsxRuntime.jsx("span",{className:d("text-[10px]",m?"text-[#6B7280]":"text-gray-400"),children:jt.display})]},Ze))})()}),jsxRuntime.jsxs("div",{className:"p-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("span",{className:d("text-xs font-medium",m?"text-white":"text-gray-900"),children:Re.toLocaleDateString(b==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-0.5",children:[jsxRuntime.jsx("button",{onClick:()=>J(new Date),className:d("px-1.5 py-0.5 rounded text-[10px] transition-colors",m?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:b==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>J(new Date(Re.getFullYear(),Re.getMonth()-1)),className:d("p-0.5 rounded",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx("button",{onClick:()=>J(new Date(Re.getFullYear(),Re.getMonth()+1)),className:d("p-0.5 rounded",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-3.5 h-3.5"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5 mb-1",children:(b==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(de=>jsxRuntime.jsx("div",{className:d("w-6 h-6 flex items-center justify-center text-[10px]",m?"text-[#6B7280]":"text-gray-400"),children:de},de))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-0.5",children:(()=>{let de=Re.getFullYear(),ze=Re.getMonth(),xt=new Date(de,ze,1).getDay(),Ve=new Date(de,ze+1,0).getDate(),ft=new Date(de,ze,0).getDate(),aa=new Date,Ca=[];for(let Ze=xt-1;Ze>=0;Ze--)Ca.push({dayNum:ft-Ze,isCurrentMonth:false,date:new Date(de,ze-1,ft-Ze)});for(let Ze=1;Ze<=Ve;Ze++)Ca.push({dayNum:Ze,isCurrentMonth:true,date:new Date(de,ze,Ze)});let jt=42-Ca.length;for(let Ze=1;Ze<=jt;Ze++)Ca.push({dayNum:Ze,isCurrentMonth:false,date:new Date(de,ze+1,Ze)});return Ca.map((Ze,Kt)=>{let la=Ze.date.toDateString()===aa.toDateString(),Fr=(Fe||P.date).toDateString()===Ze.date.toDateString();return jsxRuntime.jsx("button",{className:d("w-6 h-6 rounded-full flex items-center justify-center text-[10px] transition-colors",!Ze.isCurrentMonth&&(m?"text-[#4B5563]":"text-gray-300"),Ze.isCurrentMonth&&(m?"text-white":"text-gray-900"),la&&"ring-1 ring-[#3B82F6]",Fr&&"bg-[#7C3AED] text-white",!Fr&&(m?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{je(Ze.date),Pt(false);},children:Ze.dayNum},Kt)})})()})]})]})})]}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx("button",{onClick:de=>{de.stopPropagation(),Ae(!me),U(false);},className:d("p-1 rounded transition-colors",ct?"text-[#7C3AED] bg-[#7C3AED]/20":m?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:ct?jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center text-white text-[8px] font-medium",style:{backgroundColor:t.availableUsers?.find(de=>de.id===ct)?.color||"#7C3AED"},children:t.availableUsers?.find(de=>de.id===ct)?.initials||t.availableUsers?.find(de=>de.id===ct)?.name?.slice(0,2).toUpperCase()}):jsxRuntime.jsx(lucideReact.User,{className:"w-3.5 h-3.5"})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:me&&jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-0 bottom-full mb-1 z-[60] rounded-lg shadow-xl overflow-hidden min-w-[160px] max-h-[200px] overflow-y-auto",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:de=>de.stopPropagation(),children:[jsxRuntime.jsxs("button",{onClick:()=>{wt(null),Ae(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",!ct&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-5 h-5 rounded-full flex items-center justify-center",m?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(lucideReact.User,{className:"w-3 h-3 text-gray-400"})}),jsxRuntime.jsx("span",{className:m?"text-[#9CA3AF]":"text-gray-500",children:b==="es"?"Sin asignar":"Unassigned"})]}),t.availableUsers?.map(de=>jsxRuntime.jsxs("button",{onClick:()=>{wt(de.id),Ae(false);},className:d("w-full flex items-center gap-2 px-3 py-1.5 text-xs transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",ct===de.id&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-medium",style:{backgroundColor:de.color||"#7C3AED"},children:de.initials||de.name?.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:m?"text-white":"text-gray-900",children:de.name})]},de.id)),(!t.availableUsers||t.availableUsers.length===0)&&jsxRuntime.jsx("div",{className:d("px-3 py-2 text-xs",m?"text-[#6B7280]":"text-gray-400"),children:b==="es"?"No hay usuarios disponibles":"No users available"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>{if(qe.trim()){let de=t.availableUsers?.find(xt=>xt.id===ct),ze=Fe||P.date;a.onTaskCreate?.({name:qe.trim(),startDate:ze,endDate:ze,priority:le,assignees:de?[de]:void 0}),tt(""),Je(void 0),wt(null),je(null),Be(null);}},disabled:!qe.trim(),className:d("px-2.5 py-1 rounded text-xs font-medium transition-colors",qe.trim()?"bg-[#7C3AED] hover:bg-[#6D28D9] text-white":m?"bg-white/5 text-[#4B5563]":"bg-gray-100 text-gray-400"),children:b==="es"?"Guardar":"Save"})]})]})]})})]})})(),jsxRuntime.jsx("span",{className:d("text-sm font-medium",P.isToday?"text-[#3B82F6]":P.isCurrentMonth?m?"text-white":"text-gray-900":m?"text-[#6B7280]":"text-gray-400"),children:P.date.getDate()})]})]},O)})})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:v&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>{I(null),Ce("");},className:"fixed inset-0 bg-black/50 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},className:d("fixed inset-4 md:inset-8 lg:inset-12 rounded-xl shadow-2xl z-50 flex overflow-hidden",m?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[jsxRuntime.jsxs("div",{className:d("px-6 py-3 border-b flex items-center gap-3",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(lucideReact.Circle,{className:d("w-4 h-4",m?"text-[#9CA3AF]":"text-gray-500")}),jsxRuntime.jsxs("span",{className:d("text-xs px-2 py-0.5 rounded",m?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:[b==="es"?"Tarea":"Task"," \u2228"]}),jsxRuntime.jsx("span",{className:d("text-xs font-mono",m?"text-[#6B7280]":"text-gray-400"),children:v.id.slice(0,8)}),jsxRuntime.jsxs("button",{className:d("flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-colors",m?"bg-purple-500/20 text-purple-400 hover:bg-purple-500/30":"bg-purple-100 text-purple-700 hover:bg-purple-200"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-3 h-3"}),"Ask AI"]})]}),jsxRuntime.jsx("div",{className:"flex-1"}),jsxRuntime.jsx("button",{className:d("p-1.5 rounded transition-colors",m?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.Maximize2,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{className:d("p-1.5 rounded transition-colors",m?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.MoreHorizontal,{className:"w-5 h-5"})}),jsxRuntime.jsx("button",{onClick:()=>{I(null),Ce("");},className:d("p-1.5 rounded transition-colors",m?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"px-6 py-4",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{let P=v.progress===100?0:100,Me={...v,progress:P,status:P===100?"completed":"todo"};I(Me),a.onTaskUpdate?.(Me);},className:d("mt-1 w-5 h-5 rounded-full border-2 flex items-center justify-center transition-colors",v.progress===100?"bg-green-500 border-green-500":m?"border-white/30 hover:border-white/50":"border-gray-300 hover:border-gray-400"),children:v.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("h2",{className:d("text-xl font-semibold flex-1",v.progress===100?"line-through text-[#6B7280]":m?"text-white":"text-gray-900"),children:v.name})]})}),jsxRuntime.jsxs("div",{className:"px-6 pb-6 flex-1 overflow-y-auto overflow-x-visible",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-12 gap-y-5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CheckCircle2,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Estado":"Status"}),jsxRuntime.jsx("button",{onClick:()=>{H(),M(!Ie);},className:d("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",v.progress===100||v.status==="completed"?"bg-green-500/20 text-green-400":v.progress&&v.progress>0||v.status==="in-progress"?"bg-blue-500/20 text-blue-400":m?"bg-white/10 text-white":"bg-gray-100 text-gray-700"),children:v.progress===100||v.status==="completed"?b==="es"?"COMPLETADO":"DONE":v.progress&&v.progress>0||v.status==="in-progress"?b==="es"?"EN PROGRESO":"IN PROGRESS":b==="es"?"POR HACER":"TO DO"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:Ie&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>M(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"todo",label:b==="es"?"Por hacer":"To Do",color:"bg-white/10 text-white"},{id:"in-progress",label:b==="es"?"En progreso":"In Progress",color:"bg-blue-500/20 text-blue-400"},{id:"completed",label:b==="es"?"Completado":"Done",color:"bg-green-500/20 text-green-400"}].map(P=>jsxRuntime.jsxs("button",{onClick:()=>Ye(P.id),className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",(v.status===P.id||P.id==="completed"&&v.progress===100||P.id==="in-progress"&&v.progress&&v.progress>0&&v.progress<100||P.id==="todo"&&(!v.progress||v.progress===0)&&v.status!=="in-progress"&&v.status!=="completed")&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",P.id==="completed"?"bg-green-500":P.id==="in-progress"?"bg-blue-500":"bg-gray-400")}),jsxRuntime.jsx("span",{className:m?"text-white":"text-gray-900",children:P.label})]},P.id))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.User,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Asignados":"Assignees"}),jsxRuntime.jsxs("button",{onClick:()=>{M(false),L(false),$(null),q(!V);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[v.assignees&&v.assignees.length>0?jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[v.assignees.slice(0,3).map((P,O)=>jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:P.color||"#8B5CF6"},title:P.name,children:P.initials||P.name.slice(0,2).toUpperCase()},O)),v.assignees.length>3&&jsxRuntime.jsxs("span",{className:d("text-xs",m?"text-[#6B7280]":"text-gray-400"),children:["+",v.assignees.length-3]})]}):jsxRuntime.jsx("span",{className:d("text-sm",m?"text-[#6B7280]":"text-gray-400"),children:b==="es"?"Agregar":"Add"}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",m?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:V&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>q(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[200px] max-h-[280px] overflow-y-auto",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:t.availableUsers&&t.availableUsers.length>0?t.availableUsers.map(P=>{let O=v.assignees?.some(Me=>Me.name===P.name);return jsxRuntime.jsxs("button",{onClick:()=>{let Me=v.assignees||[],Xe;O?Xe=Me.filter(Lt=>Lt.name!==P.name):Xe=[...Me,{name:P.name,avatar:P.avatar,initials:P.initials||P.name.slice(0,2).toUpperCase(),color:P.color||"#8B5CF6"}],se("assignees",Xe);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",m?"hover:bg-white/5":"hover:bg-gray-50",O&&(m?"bg-white/5":"bg-gray-50")),children:[P.avatar?jsxRuntime.jsx("img",{src:P.avatar,alt:P.name,className:"w-6 h-6 rounded-full object-cover"}):jsxRuntime.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-white text-xs font-medium",style:{backgroundColor:P.color||"#8B5CF6"},children:P.initials||P.name.slice(0,2).toUpperCase()}),jsxRuntime.jsx("span",{className:d("flex-1 text-left",m?"text-white":"text-gray-900"),children:P.name}),O&&jsxRuntime.jsx(lucideReact.Check,{className:"w-4 h-4 text-green-500"})]},P.id||P.name)}):jsxRuntime.jsx("div",{className:d("px-3 py-4 text-sm text-center",m?"text-[#6B7280]":"text-gray-400"),children:b==="es"?"No hay usuarios disponibles":"No users available"})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.CalendarDays,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Fechas":"Dates"}),jsxRuntime.jsxs("button",{onClick:()=>{$(W?null:"start"),te(v.startDate||new Date);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10 text-white":"bg-gray-100 hover:bg-gray-200 text-gray-900"),children:[v.startDate?.toLocaleDateString(b==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(b==="es"?"Inicio":"Start"),jsxRuntime.jsx("span",{className:d("mx-1",m?"text-[#6B7280]":"text-gray-400"),children:"\u2192"}),v.endDate?.toLocaleDateString(b==="es"?"es-ES":"en-US",{month:"short",day:"numeric"})||(b==="es"?"Fin":"End"),(v.startDate||v.endDate)&&jsxRuntime.jsx(lucideReact.X,{className:"w-3.5 h-3.5 ml-1 opacity-50 hover:opacity-100",onClick:P=>{P.stopPropagation();}})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:W&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>$(null)}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:d("absolute left-0 top-full mt-2 z-50 rounded-xl shadow-2xl overflow-hidden flex",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),onClick:P=>P.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:d("w-44 py-2 border-r",m?"border-white/10":"border-gray-200"),children:[(()=>{let P=new Date,O=new Date(P);O.setDate(P.getDate()+1);let Me=new Date(P);Me.setDate(P.getDate()+((6-P.getDay()+7)%7||7));let Xe=new Date(P);Xe.setDate(P.getDate()+((1-P.getDay()+7)%7||7));let Lt=new Date(P);Lt.setDate(P.getDate()+(6-P.getDay()+7)%7+7);let de=new Date(P);de.setDate(P.getDate()+14);let ze=new Date(P);return ze.setDate(P.getDate()+28),[{label:b==="es"?"Hoy":"Today",date:P,display:P.toLocaleDateString(b==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:b==="es"?"Ma\xF1ana":"Tomorrow",date:O,display:O.toLocaleDateString(b==="es"?"es-ES":"en-US",{weekday:"short"}).slice(0,3)+"."},{label:b==="es"?"Este fin de semana":"This weekend",date:Me,display:b==="es"?"s\xE1b.":"sat."},{label:b==="es"?"Pr\xF3xima semana":"Next week",date:Xe,display:b==="es"?"lun.":"mon."},{label:b==="es"?"Pr\xF3ximo fin de semana":"Next weekend",date:Lt,display:Lt.toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:b==="es"?"2 semanas":"2 weeks",date:de,display:de.toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})},{label:b==="es"?"4 semanas":"4 weeks",date:ze,display:ze.toLocaleDateString(b==="es"?"es-ES":"en-US",{day:"numeric",month:"short"})}].map((Ve,ft)=>jsxRuntime.jsxs("button",{className:d("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",m?"hover:bg-white/5 text-white":"hover:bg-gray-50 text-gray-900"),onClick:()=>{if(W==="start"){let aa=v.endDate&&Ve.date>v.endDate?Ve.date:v.endDate;Ue(Ve.date,aa),$("end");}else {let aa=v.startDate&&Ve.date<v.startDate?Ve.date:v.startDate;Ue(aa,Ve.date),$(null);}},children:[jsxRuntime.jsx("span",{children:Ve.label}),jsxRuntime.jsx("span",{className:d("text-xs",m?"text-[#6B7280]":"text-gray-400"),children:Ve.display})]},ft))})(),jsxRuntime.jsx("div",{className:d("border-t mt-2 pt-2",m?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("button",{onClick:()=>{Ue(void 0,void 0),$(null);},className:d("w-full flex items-center justify-between px-3 py-2 text-sm transition-colors",m?"hover:bg-white/5 text-red-400":"hover:bg-gray-50 text-red-500"),children:[jsxRuntime.jsx("span",{children:b==="es"?"Quitar fechas":"Clear dates"}),jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4 opacity-50"})]})})]}),jsxRuntime.jsxs("div",{className:"p-4",children:[jsxRuntime.jsx("div",{className:d("text-xs mb-3 px-2 py-1 rounded",m?"bg-white/5 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:W==="start"?b==="es"?"\u{1F4C5} Selecciona fecha de inicio":"\u{1F4C5} Select start date":b==="es"?"\u{1F4C5} Selecciona fecha de fin":"\u{1F4C5} Select end date"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("span",{className:d("font-medium",m?"text-white":"text-gray-900"),children:j.toLocaleDateString(b==="es"?"es-ES":"en-US",{month:"long",year:"numeric"})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("button",{onClick:()=>te(new Date),className:d("p-1 rounded text-sm transition-colors",m?"hover:bg-white/10 text-white":"hover:bg-gray-100 text-gray-700"),children:b==="es"?"Hoy":"Today"}),jsxRuntime.jsx("button",{onClick:()=>te(new Date(j.getFullYear(),j.getMonth()-1)),className:d("p-1 rounded",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsx("button",{onClick:()=>te(new Date(j.getFullYear(),j.getMonth()+1)),className:d("p-1 rounded",m?"hover:bg-white/10":"hover:bg-gray-100"),children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:(b==="es"?["do","lu","ma","mi","ju","vi","s\xE1"]:["su","mo","tu","we","th","fr","sa"]).map(P=>jsxRuntime.jsx("div",{className:d("w-8 h-8 flex items-center justify-center text-xs",m?"text-[#6B7280]":"text-gray-400"),children:P},P))}),jsxRuntime.jsx("div",{className:"grid grid-cols-7 gap-1",children:(()=>{let P=j.getFullYear(),O=j.getMonth(),Me=new Date(P,O,1).getDay(),Xe=new Date(P,O+1,0).getDate(),Lt=new Date(P,O,0).getDate(),de=new Date,ze=[];for(let Ve=Me-1;Ve>=0;Ve--)ze.push({day:Lt-Ve,isCurrentMonth:false,date:new Date(P,O-1,Lt-Ve)});for(let Ve=1;Ve<=Xe;Ve++)ze.push({day:Ve,isCurrentMonth:true,date:new Date(P,O,Ve)});let xt=42-ze.length;for(let Ve=1;Ve<=xt;Ve++)ze.push({day:Ve,isCurrentMonth:false,date:new Date(P,O+1,Ve)});return ze.map((Ve,ft)=>{let aa=Ve.date.toDateString()===de.toDateString(),Ca=v.startDate?.toDateString()===Ve.date.toDateString(),jt=v.endDate?.toDateString()===Ve.date.toDateString(),Ze=Ca||jt,Kt=v.startDate&&v.endDate&&Ve.date>=v.startDate&&Ve.date<=v.endDate;return jsxRuntime.jsx("button",{className:d("w-8 h-8 rounded-full flex items-center justify-center text-sm transition-colors",!Ve.isCurrentMonth&&(m?"text-[#4B5563]":"text-gray-300"),Ve.isCurrentMonth&&(m?"text-white":"text-gray-900"),aa&&"ring-2 ring-[#3B82F6]",Ca&&"bg-[#3B82F6] text-white",jt&&!Ca&&"bg-[#7C3AED] text-white",Kt&&!Ze&&(m?"bg-[#7C3AED]/20":"bg-purple-100"),!Ze&&(m?"hover:bg-white/10":"hover:bg-gray-100")),onClick:()=>{let la=new Date(Ve.date);if(W==="start"){let Fr=v.endDate&&la>v.endDate?la:v.endDate;Ue(la,Fr),$("end");}else {let Fr=v.startDate&&la<v.startDate?la:v.startDate;Ue(Fr,la),$(null);}},children:Ve.day},ft)})})()})]})]})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Flag,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Prioridad":"Priority"}),jsxRuntime.jsx("button",{onClick:()=>{H(),L(!R);},className:d("text-xs px-2 py-1 rounded font-medium cursor-pointer transition-all hover:ring-2 hover:ring-white/20",v.priority==="high"||v.priority==="urgent"?"bg-red-500/20 text-red-400":v.priority==="medium"?"bg-yellow-500/20 text-yellow-400":v.priority==="low"?"bg-green-500/20 text-green-400":m?"bg-white/10 text-[#9CA3AF]":"bg-gray-100 text-gray-600"),children:v.priority?v.priority==="high"||v.priority==="urgent"?b==="es"?"Urgente":"Urgent":v.priority==="medium"?b==="es"?"Media":"Medium":b==="es"?"Baja":"Low":b==="es"?"Sin prioridad":"No priority"}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:R&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>L(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[140px]",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[{id:"urgent",label:b==="es"?"Urgente":"Urgent",color:"bg-red-500"},{id:"high",label:b==="es"?"Alta":"High",color:"bg-orange-500"},{id:"medium",label:b==="es"?"Media":"Medium",color:"bg-yellow-500"},{id:"low",label:b==="es"?"Baja":"Low",color:"bg-green-500"},{id:void 0,label:b==="es"?"Sin prioridad":"No priority",color:"bg-gray-400"}].map(P=>jsxRuntime.jsxs("button",{onClick:()=>{se("priority",P.id),L(false);},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",v.priority===P.id&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("span",{className:d("w-2 h-2 rounded-full",P.color)}),jsxRuntime.jsx("span",{className:m?"text-white":"text-gray-900",children:P.label})]},P.id||"none"))})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Clock,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Duraci\xF3n":"Duration"}),jsxRuntime.jsx("span",{className:d("text-sm",m?"text-white":"text-gray-900"),children:v.startDate&&v.endDate?`${Math.ceil((v.endDate.getTime()-v.startDate.getTime())/(1e3*60*60*24))} ${b==="es"?"d\xEDas":"days"}`:b==="es"?"Sin definir":"Not set"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded-full border-2",m?"border-[#6B7280]":"border-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Progreso":"Progress"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[z?jsxRuntime.jsx("input",{type:"range",min:"0",max:"100",step:"5",value:v.progress||0,onChange:P=>{let O=parseInt(P.target.value),Me=v.status;O===100?Me="completed":O>0?Me="in-progress":Me="todo";let Xe={...v,progress:O,status:Me};I(Xe),a.onTaskUpdate?.(Xe);},onBlur:()=>ye(false),className:d("flex-1 max-w-[120px] h-2 rounded-full appearance-none cursor-pointer",m?"bg-white/10":"bg-gray-200","[&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-[#3B82F6] [&::-webkit-slider-thumb]:cursor-pointer"),autoFocus:true}):jsxRuntime.jsx("button",{onClick:()=>ye(true),className:d("flex-1 h-2 rounded-full overflow-hidden max-w-[120px] cursor-pointer hover:ring-2 hover:ring-white/20 transition-all",m?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx("div",{className:d("h-full rounded-full transition-all",v.progress===100?"bg-green-500":"bg-[#3B82F6]"),style:{width:`${v.progress||0}%`}})}),jsxRuntime.jsxs("span",{className:d("text-sm font-medium min-w-[40px]",m?"text-white":"text-gray-900"),children:[v.progress||0,"%"]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Tag,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Etiquetas":"Tags"}),jsxRuntime.jsx(hr,{selectedTags:v.tags||[],availableTags:g,onChange:P=>{se("tags",P);},onCreateTag:i,theme:N})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Link2,{className:d("w-4 h-4 mt-1.5",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24 mt-1",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Relaciones":"Relations"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[v.dependencies&&v.dependencies.length>0&&jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:v.dependencies.map(P=>{let O=e.find(Me=>Me.id===P);return jsxRuntime.jsxs("span",{className:d("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",m?"bg-blue-500/20 text-blue-400":"bg-blue-100 text-blue-700"),children:[O?.name||P.slice(0,8),jsxRuntime.jsx("button",{onClick:()=>{let Me=(v.dependencies||[]).filter(Xe=>Xe!==P);se("dependencies",Me);},className:d("ml-0.5 hover:bg-white/20 rounded-full p-0.5 transition-colors"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-3 h-3"})})]},P)})}),jsxRuntime.jsxs("button",{onClick:()=>{H(),_e(!st);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-3.5 h-3.5"}),jsxRuntime.jsx("span",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Agregar dependencia":"Add dependency"})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:st&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>{_e(false),ke("");}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden min-w-[280px] max-h-[320px]",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("div",{className:d("p-2 border-b",m?"border-white/10":"border-gray-200"),children:jsxRuntime.jsx("input",{type:"text",value:ea,onChange:P=>ke(P.target.value),placeholder:b==="es"?"Buscar tarea...":"Search task...",className:d("w-full px-3 py-2 rounded-md text-sm outline-none",m?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400"),autoFocus:true})}),jsxRuntime.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:e.length>0?e.filter(P=>P.id!==v.id).filter(P=>ea===""||P.name.toLowerCase().includes(ea.toLowerCase())).map(P=>{let O=v.dependencies?.includes(P.id);return jsxRuntime.jsxs("button",{onClick:()=>{let Me=v.dependencies||[],Xe;O?Xe=Me.filter(Lt=>Lt!==P.id):Xe=[...Me,P.id],se("dependencies",Xe);},className:d("w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors text-left",m?"hover:bg-white/5":"hover:bg-gray-50",O&&(m?"bg-white/5":"bg-gray-50")),children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded border-2 flex items-center justify-center flex-shrink-0",O?"bg-blue-500 border-blue-500":m?"border-white/30":"border-gray-300"),children:O&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:d("block truncate",m?"text-white":"text-gray-900"),children:P.name}),jsxRuntime.jsx("span",{className:d("text-xs",m?"text-[#6B7280]":"text-gray-400"),children:P.id.slice(0,8)})]})]},P.id)}):jsxRuntime.jsx("div",{className:d("px-3 py-4 text-sm text-center",m?"text-[#6B7280]":"text-gray-500"),children:b==="es"?"No hay tareas disponibles":"No tasks available"})})]})]})})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 relative",children:[jsxRuntime.jsx(lucideReact.Palette,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:"Color"}),jsxRuntime.jsxs("button",{onClick:()=>{H(),Ke(!be);},className:d("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10":"bg-gray-100 hover:bg-gray-200"),children:[jsxRuntime.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:v.color||"#6366F1"}}),jsxRuntime.jsx("span",{className:d("text-sm",m?"text-white":"text-gray-900"),children:yr.find(P=>P.value===v.color)?.name||(b==="es"?"Azul":"Blue")}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:d("w-3 h-3",m?"text-[#6B7280]":"text-gray-400")})]}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:be&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Ke(false)}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:d("absolute left-32 top-full mt-1 z-50 rounded-lg shadow-xl overflow-hidden p-3",m?"bg-[#1A1D25] border border-white/10":"bg-white border border-gray-200"),children:jsxRuntime.jsx("div",{className:"grid grid-cols-6 gap-1.5",children:yr.map(P=>{let O=v.color===P.value;return jsxRuntime.jsx("button",{onClick:()=>{se("color",P.value),Ke(false);},className:d("w-7 h-7 rounded-full flex items-center justify-center transition-all",O&&"ring-2 ring-offset-2",m?"ring-offset-[#1A1D25]":"ring-offset-white"),style:{backgroundColor:P.value,outlineColor:O?P.value:void 0},title:P.name,children:O&&jsxRuntime.jsx(lucideReact.Check,{className:"w-3.5 h-3.5 text-white"})},P.value)})})})]})})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(lucideReact.Diamond,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("span",{className:d("text-sm w-24",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Hito":"Milestone"}),jsxRuntime.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:v.isMilestone||false,onChange:P=>se("isMilestone",P.target.checked),className:d("w-4 h-4 rounded border-2 cursor-pointer appearance-none transition-colors",v.isMilestone?"bg-purple-500 border-purple-500":m?"border-white/30 bg-transparent":"border-gray-300 bg-transparent","checked:bg-purple-500 checked:border-purple-500")}),jsxRuntime.jsx("span",{className:d("text-sm",m?"text-white":"text-gray-900"),children:b==="es"?"Marcar como hito":"Mark as milestone"})]})]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[jsxRuntime.jsx(lucideReact.FileText,{className:d("w-4 h-4",m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("h3",{className:d("text-sm font-semibold",m?"text-white":"text-gray-900"),children:b==="es"?"Descripci\xF3n":"Description"})]}),jsxRuntime.jsx("textarea",{value:v.description||"",onChange:P=>se("description",P.target.value),placeholder:b==="es"?"Agregar descripci\xF3n...":"Add description...",className:d("w-full min-h-[100px] px-3 py-2 rounded-lg text-sm resize-none outline-none transition-colors",m?"bg-white/5 text-white placeholder:text-[#6B7280] focus:bg-white/10":"bg-gray-100 text-gray-900 placeholder:text-gray-400 focus:bg-gray-200")}),jsxRuntime.jsxs("button",{className:d("flex items-center gap-2 text-sm mt-2 transition-colors",m?"text-purple-400 hover:text-purple-300":"text-purple-600 hover:text-purple-700"),children:[jsxRuntime.jsx(lucideReact.Sparkles,{className:"w-4 h-4"}),b==="es"?"Escribe con IA":"Write with AI"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold mb-3",m?"text-white":"text-gray-900"),children:b==="es"?"Campos personalizados":"Custom fields"}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),b==="es"?"Crea un campo en esta lista":"Create a field in this list"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold mb-3",m?"text-white":"text-gray-900"),children:b==="es"?"Agregar subtarea":"Add subtask"}),v.subtasks&&v.subtasks.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-3",children:v.subtasks.map(P=>jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:d("w-4 h-4 rounded border flex items-center justify-center cursor-pointer",P.progress===100?"bg-green-500 border-green-500":m?"border-white/20 hover:border-white/40":"border-gray-300 hover:border-gray-400"),children:P.progress===100&&jsxRuntime.jsx(lucideReact.CheckCircle2,{className:"w-3 h-3 text-white"})}),jsxRuntime.jsx("span",{className:d("text-sm",P.progress===100?"line-through text-[#6B7280]":m?"text-white":"text-gray-900"),children:P.name})]},P.id))}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"}),b==="es"?"Add Tarea":"Add Task"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsxRuntime.jsx("h3",{className:d("text-sm font-semibold",m?"text-white":"text-gray-900"),children:b==="es"?"Listas de control":"Checklists"}),jsxRuntime.jsx("button",{className:d("p-1 rounded transition-colors",m?"hover:bg-white/10 text-[#6B7280]":"hover:bg-gray-100 text-gray-400"),children:jsxRuntime.jsx(lucideReact.Plus,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("button",{className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-sm transition-colors",m?"bg-white/5 hover:bg-white/10 text-[#9CA3AF]":"bg-gray-100 hover:bg-gray-200 text-gray-600"),children:[jsxRuntime.jsx(lucideReact.ListChecks,{className:"w-4 h-4"}),b==="es"?"Crear lista de control":"Create checklist"]})]}),jsxRuntime.jsxs("div",{className:d("mt-6 pt-4 border-t",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsxs("h3",{className:d("text-sm font-semibold mb-3",m?"text-white":"text-gray-900"),children:[b==="es"?"Adjuntos":"Attachments",ta.length>0&&jsxRuntime.jsxs("span",{className:d("ml-2 text-xs font-normal",m?"text-[#6B7280]":"text-gray-400"),children:["(",ta.length,")"]})]}),ta.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-4",children:ta.map(P=>{let O=wa(P.type),Me=P.type.startsWith("image/");return jsxRuntime.jsxs("div",{className:d("flex items-center gap-3 p-2 rounded-lg group transition-colors",m?"bg-white/5 hover:bg-white/10":"bg-gray-50 hover:bg-gray-100"),children:[Me&&P.thumbnailUrl?jsxRuntime.jsx("img",{src:P.thumbnailUrl,alt:P.name,className:"w-10 h-10 rounded object-cover"}):jsxRuntime.jsx("div",{className:d("w-10 h-10 rounded flex items-center justify-center",m?"bg-white/10":"bg-gray-200"),children:jsxRuntime.jsx(O,{className:d("w-5 h-5",m?"text-[#9CA3AF]":"text-gray-500")})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("a",{href:P.url,target:"_blank",rel:"noopener noreferrer",className:d("text-sm font-medium truncate block hover:underline",m?"text-white":"text-gray-900"),children:P.name}),jsxRuntime.jsx("p",{className:d("text-xs",m?"text-[#6B7280]":"text-gray-400"),children:Ar(P.size)})]}),a.onDeleteAttachment&&jsxRuntime.jsx("button",{onClick:()=>a.onDeleteAttachment?.(P.id),className:d("p-1.5 rounded opacity-0 group-hover:opacity-100 transition-all",m?"hover:bg-red-500/20 text-red-400":"hover:bg-red-100 text-red-500"),title:b==="es"?"Eliminar":"Delete",children:jsxRuntime.jsx(lucideReact.Trash2,{className:"w-4 h-4"})})]},P.id)})}),jsxRuntime.jsxs("div",{onDragOver:Mt,onDragLeave:pt,onDrop:ie,className:d("border-2 border-dashed rounded-lg p-6 text-center transition-all cursor-pointer relative",ve?m?"border-blue-500 bg-blue-500/10":"border-blue-400 bg-blue-50":m?"border-white/10 hover:border-white/20":"border-gray-200 hover:border-gray-300",Le&&"pointer-events-none opacity-50"),children:[jsxRuntime.jsx("input",{type:"file",multiple:true,onChange:We,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",disabled:!a.onUploadAttachments||Le}),Le?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"w-6 h-6 mx-auto mb-2 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"}),jsxRuntime.jsx("p",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-500"),children:b==="es"?"Subiendo...":"Uploading..."})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(lucideReact.Upload,{className:d("w-6 h-6 mx-auto mb-2",ve?"text-blue-500":m?"text-[#6B7280]":"text-gray-400")}),jsxRuntime.jsx("p",{className:d("text-sm",m?"text-[#9CA3AF]":"text-gray-500"),children:ve?b==="es"?"Suelta los archivos aqu\xED":"Drop files here":b==="es"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Suelta tus archivos aqu\xED o ",jsxRuntime.jsx("span",{className:"underline",children:"haz clic para subir"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:["Drop your files here or ",jsxRuntime.jsx("span",{className:"underline",children:"click to upload"})]})}),!a.onUploadAttachments&&jsxRuntime.jsx("p",{className:d("text-xs mt-1",m?"text-[#6B7280]":"text-gray-400"),children:b==="es"?"Upload no disponible":"Upload not available"})]})]})]})]})]}),jsxRuntime.jsxs("div",{className:d("w-80 border-l flex flex-col",m?"border-white/10 bg-[#0F1117]":"border-gray-200 bg-gray-50"),children:[jsxRuntime.jsx("div",{className:d("px-4 py-3 border-b",m?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("h3",{className:d("text-sm font-semibold",m?"text-white":"text-gray-900"),children:[b==="es"?"Actividad":"Activity",l&&l.length>0&&jsxRuntime.jsxs("span",{className:d("ml-2 text-xs font-normal",m?"text-[#6B7280]":"text-gray-400"),children:["(",l.length,")"]})]})}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:l&&l.length>0?jsxRuntime.jsx("div",{className:"space-y-4",children:l.map(P=>{let O=(()=>{let Me=new Date,Xe=new Date(P.createdAt),Lt=Me.getTime()-Xe.getTime(),de=Math.floor(Lt/6e4),ze=Math.floor(de/60),xt=Math.floor(ze/24);return de<1?b==="es"?"ahora":"now":de<60?b==="es"?`hace ${de}m`:`${de}m ago`:ze<24?b==="es"?`hace ${ze}h`:`${ze}h ago`:b==="es"?`hace ${xt}d`:`${xt}d ago`})();return jsxRuntime.jsxs("div",{className:"flex gap-3",children:[jsxRuntime.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:"#8B5CF6"},children:P.user?.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsx("span",{className:d("text-sm font-medium",m?"text-white":"text-gray-900"),children:P.user?.name||(b==="es"?"Usuario":"User")}),jsxRuntime.jsx("span",{className:d("text-xs",m?"text-[#6B7280]":"text-gray-400"),children:O})]}),jsxRuntime.jsx("p",{className:d("text-sm break-words",m?"text-[#9CA3AF]":"text-gray-600"),children:P.content})]})]},P.id)})}):jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[jsxRuntime.jsx(lucideReact.MessageSquare,{className:d("w-10 h-10 mb-3",m?"text-[#3B4252]":"text-gray-300")}),jsxRuntime.jsx("p",{className:d("text-sm",m?"text-[#6B7280]":"text-gray-500"),children:b==="es"?"Sin actividad reciente":"No recent activity"})]})}),jsxRuntime.jsx("div",{className:d("p-4 border-t",m?"border-white/10":"border-gray-200"),children:jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[y&&jsxRuntime.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:{backgroundColor:y.color||"#8B5CF6"},children:y.name?.slice(0,2).toUpperCase()||"U"}),jsxRuntime.jsxs("div",{className:d("flex-1 flex items-center gap-2 px-3 py-2 rounded-lg",m?"bg-white/5":"bg-white border border-gray-200"),children:[jsxRuntime.jsx("input",{type:"text",value:F,onChange:P=>Ce(P.target.value),onKeyDown:async P=>{if(P.key==="Enter"&&!P.shiftKey&&v&&F.trim()&&f){P.preventDefault(),Te(true);try{await f(v.id,F.trim()),Ce("");}finally{Te(false);}}},placeholder:b==="es"?"Escribe un comentario...":"Write a comment...",disabled:Z||!f,className:d("flex-1 bg-transparent text-sm outline-none",m?"text-white placeholder:text-[#6B7280]":"text-gray-900 placeholder:text-gray-400",(Z||!f)&&"opacity-50")}),jsxRuntime.jsx("button",{onClick:async()=>{if(v&&F.trim()&&f){Te(true);try{await f(v.id,F.trim()),Ce("");}finally{Te(false);}}},disabled:Z||!F.trim()||!f,className:d("p-1.5 rounded transition-colors",F.trim()&&f?"bg-blue-500 text-white hover:bg-blue-600":m?"text-[#6B7280]":"text-gray-400",Z&&"opacity-50 cursor-not-allowed"),children:Z?jsxRuntime.jsx("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin"}):jsxRuntime.jsx(lucideReact.Send,{className:"w-4 h-4"})})]})]})})]})]})]})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:A&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>T(null),className:"fixed inset-0 bg-black/30 z-40"}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:d("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[320px] max-h-[400px] rounded-xl shadow-2xl z-50 overflow-hidden",m?"bg-[#1A1D25]":"bg-white"),children:[jsxRuntime.jsxs("div",{className:d("px-4 py-3 border-b flex items-center justify-between",m?"border-white/10":"border-gray-200"),children:[jsxRuntime.jsx("span",{className:d("font-medium",m?"text-white":"text-gray-900"),children:A.date.toLocaleDateString(b==="es"?"es-ES":"en-US",{weekday:"long",month:"long",day:"numeric"})}),jsxRuntime.jsx("button",{onClick:()=>T(null),className:d("p-1 rounded",m?"hover:bg-white/10 text-[#9CA3AF]":"hover:bg-gray-100 text-gray-500"),children:jsxRuntime.jsx(lucideReact.X,{className:"w-4 h-4"})})]}),jsxRuntime.jsx("div",{className:"p-3 max-h-[320px] overflow-y-auto space-y-2",children:A.events.map(P=>jsxRuntime.jsxs("button",{onClick:()=>{T(null),I(P.task),C?.(P.task.id);},className:d("w-full flex items-center gap-2 px-3 py-2 rounded-lg text-left transition-colors",m?"hover:bg-white/5":"hover:bg-gray-50"),children:[jsxRuntime.jsx(vp,{task:P.task}),jsxRuntime.jsx("span",{className:d("text-sm truncate flex-1",m?"text-white":"text-gray-900"),children:P.title}),P.task.priority==="high"||P.task.priority==="urgent"?jsxRuntime.jsx(lucideReact.Flag,{className:"w-3.5 h-3.5 text-red-400"}):null]},P.id))})]})]})})]})}var Cl={bgPrimary:"#0d1117",bgSecondary:"#161b22",bgHover:"#21262d",bgToday:"#1f6feb20",bgWeekend:"#161b2280",bgOtherMonth:"#0d111750",border:"#30363d",borderLight:"#21262d",textPrimary:"#c9d1d9",textSecondary:"#8b949e",textMuted:"#6e7681",textToday:"#58a6ff",accent:"#58a6ff",accentHover:"#79b8ff",accentLight:"#58a6ff20",statusTodo:"#8b949e",statusInProgress:"#f0883e",statusCompleted:"#3fb950",focusRing:"#58a6ff"},Tl={bgPrimary:"#ffffff",bgSecondary:"#f6f8fa",bgHover:"#f3f4f6",bgToday:"#dbeafe",bgWeekend:"#f9fafb",bgOtherMonth:"#f3f4f680",border:"#d0d7de",borderLight:"#e5e7eb",textPrimary:"#24292f",textSecondary:"#57606a",textMuted:"#8b949e",textToday:"#0969da",accent:"#0969da",accentHover:"#0550ae",accentLight:"#dbeafe",statusTodo:"#8b949e",statusInProgress:"#bf8700",statusCompleted:"#1a7f37",focusRing:"#0969da"},Nl={bgPrimary:"#1a1a2e",bgSecondary:"#16213e",bgHover:"#1f3460",bgToday:"#6366f120",bgWeekend:"#16213e80",bgOtherMonth:"#1a1a2e50",border:"#2a3f5f",borderLight:"#1f3460",textPrimary:"#e4e6eb",textSecondary:"#a8b2c1",textMuted:"#6b7280",textToday:"#818cf8",accent:"#6366f1",accentHover:"#818cf8",accentLight:"#6366f120",statusTodo:"#9ca3af",statusInProgress:"#fbbf24",statusCompleted:"#34d399",focusRing:"#6366f1"},vs={dark:Cl,light:Tl,neutral:Nl};function wp(e){return vs[e]||vs.dark}function Pv({stack:e,cards:t,renderCard:a,onCardClick:r,onToggleExpand:o,onUnstack:s,onDeleteStack:n,className:c}){let[g,i]=react.useState(false),p=react.useMemo(()=>t.filter(y=>e.cardIds.includes(y.id)),[t,e.cardIds]),l=react.useMemo(()=>{let y=p.length,k=new Set(p.flatMap(b=>b.assignedUserIds||[])).size,C=p.map(b=>b.priority).filter(Boolean),h=new Set(p.flatMap(b=>b.labels||[])).size;return {totalCards:y,uniqueAssignees:k,priorities:C,labels:h}},[p]),f=()=>{o?.(e.id);};return jsxRuntime.jsxs("div",{className:d("card-stack",!e.isExpanded&&"card-stack-collapsed",c),onMouseEnter:()=>i(true),onMouseLeave:()=>i(false),style:{"--stack-color":e.color||"var(--color-accent-primary)"},children:[jsxRuntime.jsxs("div",{className:"card-stack-header",onClick:f,children:[jsxRuntime.jsxs("div",{className:"card-stack-header-left",children:[jsxRuntime.jsx("button",{className:"card-stack-toggle","aria-label":e.isExpanded?"Collapse":"Expand",children:jsxRuntime.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:d("card-stack-chevron",e.isExpanded&&"expanded"),children:jsxRuntime.jsx("polyline",{points:"6 9 12 15 18 9"})})}),jsxRuntime.jsx("h3",{className:"card-stack-title",children:e.title}),jsxRuntime.jsx("div",{className:"card-stack-badge",children:l.totalCards}),jsxRuntime.jsxs("div",{className:"card-stack-strategy",children:[e.strategy==="ai-similarity"&&"\u2728 AI",e.strategy==="manual"&&"\u{1F464} Manual",e.strategy==="labels"&&"\u{1F3F7}\uFE0F Labels",e.strategy==="assignee"&&"\u{1F465} Assignee",e.strategy==="priority"&&"\u{1F3AF} Priority",e.strategy==="epic"&&"\u{1F4DA} Epic"]})]}),g&&jsxRuntime.jsx("div",{className:"card-stack-actions",children:jsxRuntime.jsx("button",{className:"card-stack-action",onClick:y=>{y.stopPropagation(),n?.(e.id);},"aria-label":"Delete stack",children:jsxRuntime.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntime.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})})]}),!e.isExpanded&&jsxRuntime.jsxs("div",{className:"card-stack-summary",children:[jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntime.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),jsxRuntime.jsxs("span",{children:[l.uniqueAssignees," assignees"]})]}),l.labels>0&&jsxRuntime.jsxs("div",{className:"card-stack-summary-item",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),jsxRuntime.jsx("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})]}),jsxRuntime.jsxs("span",{children:[l.labels," labels"]})]}),e.confidence&&jsxRuntime.jsx("div",{className:"card-stack-summary-item",children:jsxRuntime.jsxs("span",{className:"card-stack-confidence",children:[Math.round(e.confidence*100),"% match"]})})]}),e.isExpanded&&jsxRuntime.jsx("div",{className:"card-stack-content",children:p.length===0?jsxRuntime.jsxs("div",{className:"card-stack-empty",children:[jsxRuntime.jsx("p",{children:"No cards in this stack"}),jsxRuntime.jsx("span",{children:"Drag cards here or delete this stack"})]}):jsxRuntime.jsx("div",{className:"card-stack-cards",children:p.map(y=>jsxRuntime.jsxs("div",{className:"card-stack-card-wrapper",children:[a?jsxRuntime.jsx("div",{onClick:()=>r?.(y),children:a(y)}):jsxRuntime.jsxs("div",{className:"card-stack-default-card",onClick:()=>r?.(y),children:[jsxRuntime.jsx("h4",{children:y.title}),y.description&&jsxRuntime.jsxs("p",{children:[y.description.substring(0,100),"..."]})]}),jsxRuntime.jsx("button",{className:"card-stack-unstack-btn",onClick:k=>{k.stopPropagation(),s?.(e.id,y.id);},"aria-label":"Remove from stack",children:jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntime.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},y.id))})})]})}var Tp={showIcons:true,showAvatars:true,groupByDay:true,useRelativeTime:true,compact:false};function mn(e){switch(e.type){case "created":return "Created card";case "status_changed":return `Changed status from "${e.changes.status?.from}" to "${e.changes.status?.to}"`;case "assignee_changed":return "Changed assignee";case "priority_changed":return `Changed priority from ${e.changes.priority?.from} to ${e.changes.priority?.to}`;case "moved":return `Moved from ${e.metadata?.fromColumn||"unknown"} to ${e.metadata?.toColumn||"unknown"}`;case "title_updated":return "Updated title";case "description_updated":return "Updated description";case "dates_changed":return "Changed dates";case "labels_changed":return "Updated labels";case "dependency_added":return "Added dependency";case "dependency_removed":return "Removed dependency";case "comment_added":return "Added comment";case "archived":return "Archived card";case "restored":return "Restored card";default:return "Updated card"}}function pn(e){return {created:"\u2728",status_changed:"\u{1F504}",assignee_changed:"\u{1F464}",priority_changed:"\u{1F3AF}",moved:"\u27A1\uFE0F",title_updated:"\u270F\uFE0F",description_updated:"\u{1F4DD}",dates_changed:"\u{1F4C5}",labels_changed:"\u{1F3F7}\uFE0F",dependency_added:"\u{1F517}",dependency_removed:"\u26D3\uFE0F\u200D\u{1F4A5}",comment_added:"\u{1F4AC}",archived:"\u{1F4E6}",restored:"\u267B\uFE0F"}[e]||"\u{1F4CC}"}function Np(e){return {created:"#10b981",status_changed:"#3b82f6",assignee_changed:"#8b5cf6",priority_changed:"#f59e0b",moved:"#06b6d4",title_updated:"#6366f1",description_updated:"#6366f1",dates_changed:"#ec4899",labels_changed:"#14b8a6",dependency_added:"#a855f7",dependency_removed:"#ef4444",comment_added:"#84cc16",archived:"#6b7280",restored:"#10b981"}[e]||"#6b7280"}function Dp({events:e,filter:t,onFilterChange:a,onClearFilter:r,onEventClick:o,selectedEventId:s,config:n,className:c}){let g=react.useMemo(()=>({...Tp,...n}),[n]),[i,p]=react.useState(new Set),l=react.useRef(null),f=react.useMemo(()=>{if(!g.groupByDay)return [{date:null,events:e}];let u=new Map;return e.forEach(x=>{let m=x.timestamp.toISOString().split("T")[0],N=u.get(m);N?N.push(x):u.set(m,[x]);}),Array.from(u.entries()).sort((x,m)=>m[0].localeCompare(x[0])).map(([x,m])=>({date:new Date(x),events:m.sort((N,w)=>w.timestamp.getTime()-N.timestamp.getTime())}))},[e,g.groupByDay]),{uniqueUsers:y,uniqueTypes:k}=react.useMemo(()=>{let u=new Set,x=new Set;return e.forEach(m=>{u.add(m.userId),x.add(m.type);}),{uniqueUsers:Array.from(u),uniqueTypes:Array.from(x)}},[e]),C=u=>{p(x=>{let m=new Set(x);return m.has(u)?m.delete(u):m.add(u),m});},h=u=>{let m=new Date().getTime()-u.getTime(),N=Math.floor(m/6e4),w=Math.floor(m/36e5),B=Math.floor(m/864e5);return N<1?"just now":N<60?`${N}m ago`:w<24?`${w}h ago`:B<7?`${B}d ago`:u.toLocaleDateString()},b=react.useMemo(()=>{let u=0;return t.types&&t.types.length>0&&u++,t.users&&t.users.length>0&&u++,t.dateRange&&u++,t.searchTerm&&u++,u},[t]);return react.useEffect(()=>{if(s&&l.current){let u=l.current.querySelector(`[data-event-id="${s}"]`);u&&u.scrollIntoView({behavior:"smooth",block:"center"});}},[s]),e.length===0?jsxRuntime.jsxs("div",{className:d("history-timeline-empty",c),children:[jsxRuntime.jsx("div",{className:"history-timeline-empty-icon",children:"\u{1F4DC}"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-text",children:"No history events yet"}),jsxRuntime.jsx("p",{className:"history-timeline-empty-subtext",children:"Changes to this card will appear here"})]}):jsxRuntime.jsxs("div",{className:d("history-timeline",g.compact&&"compact",c),children:[jsxRuntime.jsxs("div",{className:"history-timeline-filters",children:[jsxRuntime.jsxs("div",{className:"history-timeline-filter-group",children:[jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.types?.[0]||"",onChange:u=>{let x=u.target.value;a({...t,types:x?[x]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Events"}),k.map(u=>jsxRuntime.jsxs("option",{value:u,children:[pn(u)," ",u.replace("_"," ")]},u))]}),y.length>1&&jsxRuntime.jsxs("select",{className:"history-timeline-filter-select",value:t.users?.[0]||"",onChange:u=>{let x=u.target.value;a({...t,users:x?[x]:void 0});},children:[jsxRuntime.jsx("option",{value:"",children:"All Users"}),y.map(u=>jsxRuntime.jsx("option",{value:u,children:u},u))]}),jsxRuntime.jsx("input",{type:"text",className:"history-timeline-filter-search",placeholder:"Search history...",value:t.searchTerm||"",onChange:u=>a({...t,searchTerm:u.target.value})})]}),b>0&&jsxRuntime.jsxs("button",{className:"history-timeline-filter-clear",onClick:r,children:["Clear filters (",b,")"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-container",ref:l,children:f.map(u=>jsxRuntime.jsxs("div",{className:"history-timeline-group",children:[g.groupByDay&&u.date&&jsxRuntime.jsxs("div",{className:"history-timeline-day-header",children:[jsxRuntime.jsx("span",{className:"history-timeline-day-date",children:u.date.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}),jsxRuntime.jsxs("span",{className:"history-timeline-day-count",children:[u.events.length," events"]})]}),jsxRuntime.jsx("div",{className:"history-timeline-events",children:u.events.map((x,m)=>{let N=i.has(x.id),w=s===x.id,B=Np(x.type);return jsxRuntime.jsxs("div",{"data-event-id":x.id,className:d("history-timeline-event",N&&"expanded",w&&"selected"),onClick:()=>o?.(x),children:[jsxRuntime.jsxs("div",{className:"history-timeline-line",children:[jsxRuntime.jsx("div",{className:"history-timeline-dot",style:{backgroundColor:B},children:g.showIcons&&jsxRuntime.jsx("span",{className:"history-timeline-dot-icon",children:pn(x.type)})}),m<u.events.length-1&&jsxRuntime.jsx("div",{className:"history-timeline-connector",style:{borderColor:B}})]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-content",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header",children:[jsxRuntime.jsxs("div",{className:"history-timeline-event-header-left",children:[g.showAvatars&&x.userAvatar&&jsxRuntime.jsx("img",{src:x.userAvatar,alt:x.userName||x.userId,className:"history-timeline-event-avatar"}),jsxRuntime.jsxs("div",{className:"history-timeline-event-description",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-user",children:x.userName||x.userId}),jsxRuntime.jsx("span",{className:"history-timeline-event-action",children:mn(x)})]})]}),jsxRuntime.jsx("div",{className:"history-timeline-event-time",children:g.useRelativeTime?h(x.timestamp):x.timestamp.toLocaleString()})]}),Object.keys(x.changes).length>0&&jsxRuntime.jsxs("button",{className:"history-timeline-event-toggle",onClick:v=>{v.stopPropagation(),C(x.id);},children:[N?"\u25BC":"\u25B6"," Show changes"]}),N&&jsxRuntime.jsxs("div",{className:"history-timeline-event-changes",children:[Object.entries(x.changes).map(([v,I])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-change",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-change-key",children:[v,":"]}),jsxRuntime.jsxs("div",{className:"history-timeline-event-change-values",children:[jsxRuntime.jsx("span",{className:"history-timeline-event-change-from",children:JSON.stringify(I.from)}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-arrow",children:"\u2192"}),jsxRuntime.jsx("span",{className:"history-timeline-event-change-to",children:JSON.stringify(I.to)})]})]},v)),x.metadata&&Object.keys(x.metadata).length>0&&jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata",children:[jsxRuntime.jsx("div",{className:"history-timeline-event-metadata-title",children:"Additional Info:"}),Object.entries(x.metadata).map(([v,I])=>jsxRuntime.jsxs("div",{className:"history-timeline-event-metadata-item",children:[jsxRuntime.jsxs("span",{className:"history-timeline-event-metadata-key",children:[v,":"]}),jsxRuntime.jsx("span",{className:"history-timeline-event-metadata-value",children:JSON.stringify(I)})]},v))]})]})]})]},x.id)})})]},u.date?.toISOString()||"all"))})]})}function Ep({replayState:e,events:t,onStartReplay:a,onStopReplay:r,onTogglePlayback:o,onPrevious:s,onNext:n,onGoToEvent:c,onSpeedChange:g,className:i}){let p=[.5,1,1.5,2,3],l=react.useMemo(()=>!e||t.length===0?null:t[e.currentIndex],[e,t]),f=react.useMemo(()=>!e||e.totalEvents===0?0:e.currentIndex/(e.totalEvents-1)*100,[e]);return t.length===0?jsxRuntime.jsxs("div",{className:d("history-replay-empty",i),children:[jsxRuntime.jsx("div",{className:"history-replay-empty-icon",children:"\u23F3"}),jsxRuntime.jsx("p",{className:"history-replay-empty-text",children:"No history to replay"})]}):e?jsxRuntime.jsxs("div",{className:d("history-replay",i),children:[jsxRuntime.jsxs("div",{className:"history-replay-current-event",children:[jsxRuntime.jsx("div",{className:"history-replay-event-icon",children:l&&pn(l.type)}),jsxRuntime.jsxs("div",{className:"history-replay-event-info",children:[jsxRuntime.jsx("div",{className:"history-replay-event-description",children:l&&mn(l)}),jsxRuntime.jsxs("div",{className:"history-replay-event-meta",children:[jsxRuntime.jsxs("span",{className:"history-replay-event-index",children:["Event ",e.currentIndex+1," of ",e.totalEvents]}),jsxRuntime.jsx("span",{className:"history-replay-event-time",children:l&&l.timestamp.toLocaleString()})]})]})]}),jsxRuntime.jsxs("div",{className:"history-replay-progress-container",children:[jsxRuntime.jsx("input",{type:"range",className:"history-replay-progress-slider",min:"0",max:e.totalEvents-1,value:e.currentIndex,onChange:y=>c(parseInt(y.target.value))}),jsxRuntime.jsx("div",{className:"history-replay-progress-fill",style:{width:`${f}%`}}),jsxRuntime.jsx("div",{className:"history-replay-progress-markers",children:t.map((y,k)=>jsxRuntime.jsx("div",{className:d("history-replay-progress-marker",k===e.currentIndex&&"active"),style:{left:`${k/(e.totalEvents-1)*100}%`},onClick:()=>c(k),title:mn(y)},y.id))})]}),jsxRuntime.jsxs("div",{className:"history-replay-controls",children:[jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:s,disabled:!e.canGoBack,title:"Previous event (\u2190)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"19 20 9 12 19 4 19 20"}),jsxRuntime.jsx("line",{x1:"5",y1:"19",x2:"5",y2:"5"})]})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-control-play",onClick:o,title:e.isPlaying?"Pause (Space)":"Play (Space)",children:e.isPlaying?jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"6",y:"4",width:"4",height:"16"}),jsxRuntime.jsx("rect",{x:"14",y:"4",width:"4",height:"16"})]}):jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})}),jsxRuntime.jsx("button",{className:"history-replay-control-btn",onClick:n,disabled:!e.canGoForward,title:"Next event (\u2192)",children:jsxRuntime.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsxRuntime.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),jsxRuntime.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}),jsxRuntime.jsxs("div",{className:"history-replay-speed",children:[jsxRuntime.jsx("label",{className:"history-replay-speed-label",children:"Speed:"}),jsxRuntime.jsx("div",{className:"history-replay-speed-buttons",children:p.map(y=>jsxRuntime.jsxs("button",{className:d("history-replay-speed-btn",e.speed===y&&"active"),onClick:()=>g(y),children:[y,"x"]},y))})]}),jsxRuntime.jsx("button",{className:"history-replay-control-btn history-replay-stop",onClick:r,title:"Stop replay (Esc)",children:jsxRuntime.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",children:jsxRuntime.jsx("rect",{x:"6",y:"6",width:"12",height:"12"})})})]}),jsxRuntime.jsxs("div",{className:"history-replay-shortcuts",children:[jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Space"})," Play/Pause"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2190"})," Previous"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"\u2192"})," Next"]}),jsxRuntime.jsxs("span",{className:"history-replay-shortcut",children:[jsxRuntime.jsx("kbd",{children:"Esc"})," Stop"]})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-header",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-title",children:"Card State at This Point"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-time",children:l&&l.timestamp.toLocaleDateString()})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-content",children:[jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Title:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.title})]}),e.cardState.description&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Description:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.description})]}),jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Priority:"}),jsxRuntime.jsx("span",{className:"history-replay-card-preview-value",children:e.cardState.priority||"None"})]}),e.cardState.labels&&e.cardState.labels.length>0&&jsxRuntime.jsxs("div",{className:"history-replay-card-preview-field",children:[jsxRuntime.jsx("span",{className:"history-replay-card-preview-label",children:"Labels:"}),jsxRuntime.jsx("div",{className:"history-replay-card-preview-labels",children:e.cardState.labels.map(y=>jsxRuntime.jsx("span",{className:"history-replay-card-preview-label-tag",children:y},y))})]})]})]})]}):jsxRuntime.jsxs("div",{className:d("history-replay-start",i),children:[jsxRuntime.jsxs("button",{className:"history-replay-start-button",onClick:a,children:[jsxRuntime.jsx("svg",{className:"history-replay-start-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:jsxRuntime.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})}),jsxRuntime.jsx("span",{children:"Start Time Travel"})]}),jsxRuntime.jsxs("p",{className:"history-replay-start-hint",children:["Replay ",t.length," events from this card's history"]})]})}function Dl(e){return {blocks:"#ef4444",blocked_by:"#dc2626",depends_on:"#f59e0b",required_by:"#d97706",relates_to:"#6b7280",duplicates:"#8b5cf6",parent_of:"#3b82f6",child_of:"#2563eb",similar_to:"#10b981"}[e]||"#6b7280"}function Sl(e){return {blocks:"Blocks",blocked_by:"Blocked by",depends_on:"Depends on",required_by:"Required by",relates_to:"Relates to",duplicates:"Duplicates",parent_of:"Parent of",child_of:"Child of",similar_to:"Similar to"}[e]||e}function Pp(e){return {blocks:"\u{1F6AB}",blocked_by:"\u26D4",depends_on:"\u{1F517}",required_by:"\u{1F4CC}",relates_to:"\u{1F504}",duplicates:"\u{1F4CB}",parent_of:"\u{1F4C2}",child_of:"\u{1F4C4}",similar_to:"\u{1F50D}"}[e]||"\u{1F517}"}function Mp(e){return ["blocks","blocked_by","depends_on","required_by","parent_of","child_of"].includes(e)}function Bv(e,t,a,r,o,s=100){let n=e.map(g=>({...g,x:g.x??a/2+Math.random()*100-50,y:g.y??r/2+Math.random()*100-50,vx:0,vy:0})),c=new Map(n.map(g=>[g.id,g]));for(let g=0;g<s;g++){let i=1-g/s;n.forEach(p=>{let l=a/2,f=r/2;p.vx+=(l-p.x)*o.centerForce*i,p.vy+=(f-p.y)*o.centerForce*i,n.forEach(y=>{if(p.id===y.id)return;let k=p.x-y.x,C=p.y-y.y,h=Math.sqrt(k*k+C*C)||1,b=o.chargeStrength*i/(h*h);p.vx+=k/h*b,p.vy+=C/h*b;});}),t.forEach(p=>{let l=c.get(typeof p.source=="string"?p.source:p.source.id),f=c.get(typeof p.target=="string"?p.target:p.target.id);if(!l||!f)return;let y=f.x-l.x,k=f.y-l.y,C=Math.sqrt(y*y+k*k)||1,h=(C-o.linkDistance)/C*o.forceStrength*i;l.vx+=y*h,l.vy+=k*h,f.vx-=y*h,f.vy-=k*h;}),n.forEach(p=>{p.fx!==null&&p.fx!==void 0?(p.x=p.fx,p.vx=0):p.x+=p.vx,p.fy!==null&&p.fy!==void 0?(p.y=p.fy,p.vy=0):p.y+=p.vy,p.x=Math.max(o.nodeSize,Math.min(a-o.nodeSize,p.x)),p.y=Math.max(o.nodeSize,Math.min(r-o.nodeSize,p.y)),p.vx*=.9,p.vy*=.9;});}return n}function Ap({nodes:e,edges:t,config:a,filter:r,onFilterChange:o,criticalPath:s,stats:n,onInteraction:c,className:g}){let i=react.useRef(null),[p,l]=react.useState([]),[f,y]=react.useState(null),[k,C]=react.useState(null),[h,b]=react.useState(null),[u,x]=react.useState(1),[m,N]=react.useState({x:0,y:0});react.useEffect(()=>{if(e.length===0)return;let $=Bv(e,t,a.width,a.height,a,150);l($);},[e,t,a]);let w=react.useCallback(($,j)=>{a.enableDragging&&(j.stopPropagation(),y($));},[a.enableDragging]),B=react.useCallback($=>{if(!f||!i.current)return;let te=i.current.getBoundingClientRect(),oe=($.clientX-te.left-m.x)/u,re=($.clientY-te.top-m.y)/u;l(ge=>ge.map(fe=>fe.id===f?{...fe,x:oe,y:re,fx:oe,fy:re}:fe));},[f,u,m]),v=react.useCallback(()=>{y(null);},[]),I=react.useCallback(($,j)=>{j.stopPropagation(),c?.({type:"node-click",node:$,position:{x:j.clientX,y:j.clientY}});},[c]),A=react.useCallback(($,j)=>{j.stopPropagation(),c?.({type:"edge-click",edge:$,position:{x:j.clientX,y:j.clientY}});},[c]),T=react.useCallback($=>{let j=p.find(te=>te.id===$);return j?{x:j.x,y:j.y}:{x:0,y:0}},[p]),W=react.useCallback($=>{if($.onCriticalPath)return "#ef4444";switch(a.colorScheme){case "status":return $.card.columnId==="done"?"#10b981":"#3b82f6";case "priority":let j=$.card.priority;return j==="URGENT"?"#ef4444":j==="HIGH"?"#f59e0b":j==="MEDIUM"?"#3b82f6":"#6b7280";case "assignee":return $.card.assigneeId?"#8b5cf6":"#6b7280";default:return "#3b82f6"}},[a.colorScheme]);return e.length===0?jsxRuntime.jsxs("div",{className:d("relationships-graph-empty",g),children:[jsxRuntime.jsx("div",{className:"relationships-graph-empty-icon",children:"\u{1F517}"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-text",children:"No relationships to display"}),jsxRuntime.jsx("p",{className:"relationships-graph-empty-subtext",children:"Add relationships between cards to see the graph"})]}):jsxRuntime.jsxs("div",{className:d("relationships-graph",g),children:[jsxRuntime.jsxs("div",{className:"relationships-graph-controls",children:[jsxRuntime.jsxs("div",{className:"relationships-graph-stats",children:[jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:n.totalNodes}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Cards"})]}),jsxRuntime.jsxs("span",{className:"relationships-graph-stat",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:n.totalEdges}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Relations"})]}),s&&jsxRuntime.jsxs("span",{className:"relationships-graph-stat relationships-graph-stat-critical",children:[jsxRuntime.jsx("span",{className:"relationships-graph-stat-value",children:s.cardIds.length}),jsxRuntime.jsx("span",{className:"relationships-graph-stat-label",children:"Critical Path"})]})]}),a.enableZoom&&jsxRuntime.jsxs("div",{className:"relationships-graph-zoom-controls",children:[jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>x($=>Math.min($+.2,3)),children:"+"}),jsxRuntime.jsxs("span",{className:"relationships-graph-zoom-value",children:[Math.round(u*100),"%"]}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>x($=>Math.max($-.2,.5)),children:"\u2212"}),jsxRuntime.jsx("button",{className:"relationships-graph-zoom-btn",onClick:()=>{x(1),N({x:0,y:0});},children:"Reset"})]})]}),jsxRuntime.jsx("div",{className:"relationships-graph-legend",children:Array.from(new Set(t.map($=>$.type))).map($=>jsxRuntime.jsxs("div",{className:"relationships-graph-legend-item",children:[jsxRuntime.jsx("div",{className:"relationships-graph-legend-color",style:{background:Dl($)}}),jsxRuntime.jsxs("span",{className:"relationships-graph-legend-label",children:[Pp($)," ",Sl($)]})]},$))}),jsxRuntime.jsxs("svg",{ref:i,className:"relationships-graph-canvas",width:a.width,height:a.height,onMouseMove:B,onMouseUp:v,onMouseLeave:v,children:[jsxRuntime.jsxs("g",{transform:`translate(${m.x}, ${m.y}) scale(${u})`,children:[jsxRuntime.jsx("g",{className:"relationships-graph-edges",children:t.map($=>{let j=T(typeof $.source=="string"?$.source:$.source.id),te=T(typeof $.target=="string"?$.target:$.target.id),oe=Mp($.type),re=h===$.id,ge=$.onCriticalPath;return jsxRuntime.jsxs("g",{className:d("relationships-graph-edge",re&&"hovered",ge&&"critical"),onMouseEnter:()=>b($.id),onMouseLeave:()=>b(null),onClick:fe=>A($,fe),children:[jsxRuntime.jsx("line",{x1:j.x,y1:j.y,x2:te.x,y2:te.y,stroke:Dl($.type),strokeWidth:ge?a.edgeWidth*2:a.edgeWidth,strokeOpacity:re?1:.6,markerEnd:oe?"url(#arrowhead)":void 0}),a.showEdgeLabels&&re&&jsxRuntime.jsx("text",{x:(j.x+te.x)/2,y:(j.y+te.y)/2,className:"relationships-graph-edge-label",textAnchor:"middle",children:Sl($.type)})]},$.id)})}),jsxRuntime.jsx("g",{className:"relationships-graph-nodes",children:p.map($=>{let j=k===$.id,te=$.onCriticalPath;return jsxRuntime.jsxs("g",{className:d("relationships-graph-node",j&&"hovered",te&&"critical"),transform:`translate(${$.x}, ${$.y})`,onMouseDown:oe=>w($.id,oe),onMouseEnter:()=>C($.id),onMouseLeave:()=>C(null),onClick:oe=>I($,oe),children:[jsxRuntime.jsx("circle",{r:te?a.nodeSize*1.2:a.nodeSize,fill:W($),stroke:te?"#fbbf24":"#ffffff",strokeWidth:te?3:2,opacity:j?1:.9}),a.showLabels&&jsxRuntime.jsx("text",{y:a.nodeSize+20,className:"relationships-graph-node-label",textAnchor:"middle",children:$.card.title.length>20?$.card.title.substring(0,20)+"...":$.card.title})]},$.id)})})]}),jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("marker",{id:"arrowhead",markerWidth:"10",markerHeight:"10",refX:"9",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:jsxRuntime.jsx("path",{d:"M0,0 L0,6 L9,3 z",fill:"#6b7280"})})})]})]})}function Ip({isOpen:e,onClose:t,onPlanGenerated:a,onGeneratePlan:r,isLoading:o}){let[s,n]=react.useState(""),[c,g]=react.useState(false),[i,p]=react.useState(null),[l,f]=react.useState(null),y=react.useRef(null),k=c||o;react.useEffect(()=>{e&&y.current&&y.current.focus();},[e]),react.useEffect(()=>{let u=x=>{x.key==="Escape"&&!k&&C();};if(e)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,k]);let C=()=>{k||(n(""),p(null),f(null),t());},h=async()=>{if(!(!s.trim()||k)){g(true),p(null),f(null);try{let u=await r(s.trim());f(u);}catch(u){p(u instanceof Error?u.message:"Failed to generate plan");}finally{g(false);}}},b=()=>{l&&(a(l),C());};return e?jsxRuntime.jsxs(bt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:C}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-2xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:u=>u.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 17L12 22L22 17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M2 12L12 17L22 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Generate Project Plan with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete Kanban board"})]}),jsxRuntime.jsx("button",{onClick:C,disabled:k,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:l?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Plan Generated Successfully!"})]}),l.explanation&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-blue-500/10 border border-blue-500/30",children:jsxRuntime.jsx("p",{className:"text-sm text-white/90",children:l.explanation})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Columns (",l.columns.length,")"]}),jsxRuntime.jsx("div",{className:"flex gap-2 flex-wrap",children:l.columns.map((u,x)=>jsxRuntime.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-white/5 border border-white/20 text-sm text-white/80",children:u.title},x))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-sm font-semibold text-white/90 mb-2",children:["Tasks (",l.cards.length,")"]}),jsxRuntime.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[l.cards.slice(0,10).map((u,x)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:u.title}),u.description&&jsxRuntime.jsx("p",{className:"text-xs text-white/60 mt-1 line-clamp-2",children:u.description})]}),u.priority&&jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${u.priority==="URGENT"?"bg-red-500/20 text-red-400":u.priority==="HIGH"?"bg-orange-500/20 text-orange-400":u.priority==="MEDIUM"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:u.priority})]})},x)),l.cards.length>10&&jsxRuntime.jsxs("p",{className:"text-xs text-white/50 text-center py-2",children:["+",l.cards.length-10," more tasks..."]})]})]})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description"}),jsxRuntime.jsx("textarea",{ref:y,value:s,onChange:u=>n(u.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:k}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),i&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:i}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((u,x)=>jsxRuntime.jsx("button",{onClick:()=>n(u),disabled:k,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:u},x))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:k&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:C,disabled:k,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),l?jsxRuntime.jsx("button",{onClick:b,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Plan to Board"}):jsxRuntime.jsx("button",{onClick:h,disabled:!s.trim()||k,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:k?"Generating...":"Generate Plan"})]})]})]})})]}):null}var El={"gpt-4-turbo":{provider:"openai",name:"GPT-4 Turbo",contextWindow:128e3,costPer1kInput:.01,costPer1kOutput:.03,supportsVision:true,supportsJSON:true},"gpt-4":{provider:"openai",name:"GPT-4",contextWindow:8192,costPer1kInput:.03,costPer1kOutput:.06,supportsVision:false,supportsJSON:true},"gpt-3.5-turbo":{provider:"openai",name:"GPT-3.5 Turbo",contextWindow:16385,costPer1kInput:5e-4,costPer1kOutput:.0015,supportsVision:false,supportsJSON:true},"claude-3-5-sonnet-20241022":{provider:"anthropic",name:"Claude 3.5 Sonnet",contextWindow:2e5,costPer1kInput:.003,costPer1kOutput:.015,supportsVision:true,supportsJSON:true},"claude-3-opus-20240229":{provider:"anthropic",name:"Claude 3 Opus",contextWindow:2e5,costPer1kInput:.015,costPer1kOutput:.075,supportsVision:true,supportsJSON:true},"claude-3-haiku-20240307":{provider:"anthropic",name:"Claude 3 Haiku",contextWindow:2e5,costPer1kInput:25e-5,costPer1kOutput:.00125,supportsVision:true,supportsJSON:true}};var Ov={hobby:{requestsPerMonth:50,maxConcurrent:1,maxTokensPerRequest:4096},pro:{requestsPerMonth:500,maxConcurrent:3,maxTokensPerRequest:8192},enterprise:{requestsPerMonth:2e3,maxConcurrent:10,maxTokensPerRequest:16384}},$v={generatePlan:{enabled:true,minPlanTier:"hobby",estimatedTokens:2e3},predictRisks:{enabled:true,minPlanTier:"pro",estimatedTokens:1500},suggestAssignee:{enabled:true,minPlanTier:"hobby",estimatedTokens:800},generateReport:{enabled:true,minPlanTier:"enterprise",estimatedTokens:3e3},generateSubtasks:{enabled:true,minPlanTier:"hobby",estimatedTokens:1e3}};function Uv(e,t,a){let r=El[e];if(!r)throw new Error(`Unknown model: ${e}`);let o=t/1e3*r.costPer1kInput,s=a/1e3*r.costPer1kOutput;return o+s}function un(e){return `$${e.toFixed(4)}`}var Pl=class{constructor(){this.operations=[];this.listeners=[];}record(t){let a=Uv(t.model,t.inputTokens,t.outputTokens),r={...t,id:`op_${Date.now()}_${Math.random().toString(36).substring(7)}`,timestamp:new Date,cost:a};return this.operations.push(r),this.listeners.forEach(o=>o(r)),this.operations.length>1e3&&(this.operations=this.operations.slice(-1e3)),r}getStats(t){let a=this.operations;t&&(a=a.filter(l=>l.timestamp>=t.start&&l.timestamp<=t.end));let r=a.length,o=a.reduce((l,f)=>l+f.cost,0),s=a.reduce((l,f)=>l+f.inputTokens,0),n=a.reduce((l,f)=>l+f.outputTokens,0),c=a.filter(l=>l.success),g=a.reduce((l,f)=>l+f.duration,0),i={},p={};return a.forEach(l=>{i[l.feature]=(i[l.feature]||0)+1,p[l.feature]=(p[l.feature]||0)+l.cost;}),{totalOperations:r,totalCost:o,totalInputTokens:s,totalOutputTokens:n,operationsByFeature:i,costsByFeature:p,averageDuration:r>0?g/r:0,successRate:r>0?c.length/r:0}}getRecentOperations(t=10){return this.operations.slice(-t).reverse()}checkLimit(t,a="month"){let o={hobby:{month:50,day:5},pro:{month:500,day:50},enterprise:{month:2e3,day:200}}[t][a],s=new Date,n=new Date;a==="month"?n.setMonth(s.getMonth()-1):n.setDate(s.getDate()-1);let c=this.operations.filter(p=>p.timestamp>=n).length,g=Math.max(0,o-c),i=c/o*100;return {used:c,limit:o,remaining:g,percentUsed:i,isExceeded:c>=o}}subscribe(t){return this.listeners.push(t),()=>{let a=this.listeners.indexOf(t);a>-1&&this.listeners.splice(a,1);}}clear(){this.operations=[];}export(){return JSON.stringify(this.operations,null,2)}},bo=new Pl;function Op({isOpen:e,onClose:t,planTier:a="hobby"}){let[r,o]=react.useState(bo.getStats()),[s,n]=react.useState(bo.checkLimit(a));if(react.useEffect(()=>{if(!e)return;let g=setInterval(()=>{o(bo.getStats()),n(bo.checkLimit(a));},1e3);return ()=>clearInterval(g)},[e,a]),react.useEffect(()=>{let g=i=>{i.key==="Escape"&&t();};if(e)return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[e,t]),!e)return null;let c=bo.getRecentOperations(5);return jsxRuntime.jsxs(bt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:t}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:g=>g.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-xl font-bold text-white",children:"AI Usage Dashboard"}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Monitor your AI consumption and costs"})]}),jsxRuntime.jsx("button",{onClick:t,className:"text-white/60 hover:text-white transition-colors",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-xl bg-gradient-to-r from-blue-500/10 to-purple-500/10 border border-blue-500/30",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-white/90",children:["Monthly Usage (",a.toUpperCase(),")"]}),jsxRuntime.jsxs("span",{className:"text-sm font-bold text-white",children:[s.used," / ",s.limit]})]}),jsxRuntime.jsx("div",{className:"w-full h-2 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full transition-all",style:{width:`${Math.min(100,s.percentUsed)}%`,background:s.percentUsed>90?"#EF4444":s.percentUsed>70?"#F59E0B":"#10B981"}})}),jsxRuntime.jsxs("p",{className:"text-xs text-white/60 mt-2",children:[s.remaining," operations remaining this month"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Total Cost"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-400 mt-1",children:un(r.totalCost)})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Operations"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-400 mt-1",children:r.totalOperations})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Tokens Used"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-400 mt-1",children:(r.totalInputTokens+r.totalOutputTokens).toLocaleString()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:[r.totalInputTokens.toLocaleString()," in /"," ",r.totalOutputTokens.toLocaleString()," out"]})]}),jsxRuntime.jsxs("div",{className:"p-4 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/60 uppercase tracking-wider",children:"Success Rate"}),jsxRuntime.jsxs("p",{className:"text-2xl font-bold text-green-400 mt-1",children:[(r.successRate*100).toFixed(1),"%"]}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-1",children:["Avg: ",r.averageDuration.toFixed(0),"ms"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Usage by Feature"}),jsxRuntime.jsx("div",{className:"space-y-2",children:Object.entries(r.operationsByFeature).map(([g,i])=>{let p=r.costsByFeature[g]||0,l=r.totalOperations>0?i/r.totalOperations*100:0;return jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium text-white/90 capitalize",children:g.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[i," ops"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:un(p)})]})]}),jsxRuntime.jsx("div",{className:"w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:jsxRuntime.jsx("div",{className:"h-full bg-blue-500",style:{width:`${l}%`}})})]},g)})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold text-white/90 mb-3",children:"Recent Operations"}),c.length===0?jsxRuntime.jsx("p",{className:"text-sm text-white/50 text-center py-8",children:"No operations yet. Start using AI features!"}):jsxRuntime.jsx("div",{className:"space-y-2",children:c.map(g=>jsxRuntime.jsxs("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90 capitalize",children:g.feature.replace(/([A-Z])/g," $1").trim()}),jsxRuntime.jsxs("p",{className:"text-xs text-white/50 mt-0.5",children:[new Date(g.timestamp).toLocaleTimeString()," \u2022"," ",g.duration,"ms"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/60",children:[g.inputTokens+g.outputTokens," tokens"]}),jsxRuntime.jsx("span",{className:"text-xs font-semibold text-green-400",children:un(g.cost)}),jsxRuntime.jsx("div",{className:`w-2 h-2 rounded-full ${g.success?"bg-green-400":"bg-red-400"}`})]})]},g.id))})]})]}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("p",{className:"text-xs text-white/50",children:"Costs are estimates. Actual API charges may vary."}),jsxRuntime.jsx("button",{onClick:t,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80",children:"Close"})]})]})})]})}function zp({isOpen:e,onClose:t,onTasksGenerated:a,onGenerateTasks:r,isLoading:o,projectName:s}){let[n,c]=react.useState(""),[g,i]=react.useState(""),[p,l]=react.useState(""),[f,y]=react.useState(false),[k,C]=react.useState(null),[h,b]=react.useState(null),[u,x]=react.useState(null),m=react.useRef(null),N=f||o;react.useEffect(()=>{e&&m.current&&m.current.focus();},[e]),react.useEffect(()=>{let A=T=>{T.key==="Escape"&&!N&&w();};if(e)return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[e,N]);let w=()=>{N||(c(""),i(""),l(""),C(null),b(null),x(null),t());},B=async()=>{if(!(!n.trim()||N)){y(true),C(null),b(null),x(null);try{let A=await r({prompt:n.trim(),projectName:s||"Mi Proyecto",startDate:g||void 0,endDate:p||void 0});b(A.tasks.tasks),x({from_cache:A.from_cache,tokens_used:A.tokens_used,mock_mode:A.mock_mode,similarity:A.similarity,tokens_saved:A.tokens_saved});}catch(A){C(A instanceof Error?A.message:"Failed to generate tasks");}finally{y(false);}}},v=()=>{h&&(a(h),w());};if(!e)return null;let I=u?.similarity?((u.similarity||0)*100).toFixed(0):"0";return jsxRuntime.jsxs(bt,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100000]",onClick:w}),jsxRuntime.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-[100001] p-4",children:jsxRuntime.jsxs("div",{className:"w-full max-w-3xl rounded-2xl shadow-2xl border max-h-[90vh] overflow-hidden flex flex-col",style:{background:"linear-gradient(135deg, #1f1f1f 0%, #1a1a1a 100%)",borderColor:"rgba(255, 255, 255, 0.15)",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1)"},onClick:A=>A.stopPropagation(),children:[jsxRuntime.jsxs("div",{className:"px-6 py-4 border-b border-white/10 flex items-center justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[jsxRuntime.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-blue-400",children:[jsxRuntime.jsx("rect",{x:"3",y:"4",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"9",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"14",width:"18",height:"2",rx:"1",fill:"currentColor"}),jsxRuntime.jsx("rect",{x:"3",y:"19",width:"18",height:"2",rx:"1",fill:"currentColor"})]}),"Generate Gantt Tasks with AI"]}),jsxRuntime.jsx("p",{className:"text-sm text-white/60 mt-1",children:"Describe your project and let AI create a complete task timeline"})]}),jsxRuntime.jsx("button",{onClick:w,disabled:N,className:"text-white/60 hover:text-white transition-colors disabled:opacity-50",children:jsxRuntime.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:jsxRuntime.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),jsxRuntime.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:h?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-green-400",children:[jsxRuntime.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:jsxRuntime.jsx("path",{d:"M4 10L8 14L16 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),jsxRuntime.jsx("span",{className:"font-semibold",children:"Tasks Generated Successfully!"})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[u?.mock_mode&&jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-yellow-500/20 text-yellow-400 border border-yellow-500/30",children:"Mock Mode"}),u?.from_cache?jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-blue-500/20 text-blue-400 border border-blue-500/30",children:["From Cache (",I,"% similar)"]}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-green-500/20 text-green-400 border border-green-500/30",children:"AI Generated"}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:[u?.tokens_used||0," tokens"]}),u?.tokens_saved&&jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-indigo-500/20 text-indigo-400 border border-indigo-500/30",children:[u.tokens_saved," tokens saved"]}),jsxRuntime.jsxs("span",{className:"px-2 py-1 rounded-lg text-xs font-semibold bg-pink-500/20 text-pink-400 border border-pink-500/30",children:[h.length," tasks"]})]}),jsxRuntime.jsx("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:h.map((A,T)=>jsxRuntime.jsx("div",{className:"p-3 rounded-lg bg-white/5 border border-white/10 hover:bg-white/10 transition-colors",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[jsxRuntime.jsxs("span",{className:"text-xs text-white/50",children:["#",T+1]}),jsxRuntime.jsx("p",{className:"text-sm font-medium text-white/90",children:A.name})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3 text-xs text-white/60",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",className:"text-white/40",children:[jsxRuntime.jsx("rect",{x:"1",y:"2",width:"10",height:"8",rx:"1",stroke:"currentColor"}),jsxRuntime.jsx("path",{d:"M1 4h10",stroke:"currentColor"})]}),A.start," \u2192 ",A.end]}),jsxRuntime.jsxs("span",{children:[A.duration," days"]}),A.dependencies.length>0&&jsxRuntime.jsxs("span",{className:"text-blue-400",children:["Depends: ",A.dependencies.join(", ")]})]})]}),jsxRuntime.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${A.priority==="high"?"bg-red-500/20 text-red-400":A.priority==="medium"?"bg-yellow-500/20 text-yellow-400":"bg-blue-500/20 text-blue-400"}`,children:A.priority})]})},A.id))})]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Project Description *"}),jsxRuntime.jsx("textarea",{ref:m,value:n,onChange:A=>c(A.target.value),placeholder:"Example: Build a mobile app for tracking fitness goals with user authentication, workout logging, progress charts, and social features...",className:"w-full h-32 px-4 py-3 rounded-lg text-sm bg-white/5 border border-white/20 text-white placeholder-white/40 outline-none focus:border-blue-500/50 transition-all resize-none",disabled:N}),jsxRuntime.jsx("p",{className:"text-xs text-white/50 mt-2",children:"Be as specific as possible. Include features, technologies, and any special requirements."})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"Start Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:g,onChange:A=>i(A.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:N})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-semibold text-white/90 mb-2",children:"End Date (Optional)"}),jsxRuntime.jsx("input",{type:"date",value:p,onChange:A=>l(A.target.value),className:"w-full px-4 py-2 rounded-lg text-sm bg-white/5 border border-white/20 text-white outline-none focus:border-blue-500/50 transition-all",disabled:N})]})]}),k&&jsxRuntime.jsx("div",{className:"p-4 rounded-lg bg-red-500/10 border border-red-500/30 text-red-400 text-sm",children:k}),jsxRuntime.jsxs("div",{className:"border-t border-white/10 pt-4",children:[jsxRuntime.jsx("p",{className:"text-xs font-semibold text-white/70 uppercase tracking-wider mb-3",children:"Example Prompts"}),jsxRuntime.jsx("div",{className:"space-y-2",children:["Build an e-commerce platform with product catalog, shopping cart, payment integration, and order tracking","Create a task management app with team collaboration, real-time updates, file attachments, and notifications","Develop a blog platform with markdown editor, SEO optimization, comments system, and analytics dashboard"].map((A,T)=>jsxRuntime.jsx("button",{onClick:()=>c(A),disabled:N,className:"w-full text-left px-3 py-2 rounded-lg text-xs text-white/70 hover:text-white hover:bg-white/5 transition-all border border-white/10 hover:border-white/20 disabled:opacity-50",children:A},T))})]})]})}),jsxRuntime.jsxs("div",{className:"px-6 py-4 border-t border-white/10 flex items-center justify-between",children:[jsxRuntime.jsx("div",{children:N&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-blue-400 text-sm",children:[jsxRuntime.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),jsxRuntime.jsx("span",{children:"Generating with AI..."})]})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("button",{onClick:w,disabled:N,className:"px-4 py-2 rounded-lg text-sm font-semibold transition-all hover:bg-white/10 text-white/80 disabled:opacity-50",children:"Cancel"}),h?jsxRuntime.jsx("button",{onClick:v,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all",style:{background:"linear-gradient(135deg, #10B981 0%, #059669 100%)",color:"#ffffff"},children:"Apply Tasks to Gantt"}):jsxRuntime.jsx("button",{onClick:B,disabled:!n.trim()||N,className:"px-6 py-2 rounded-lg text-sm font-semibold transition-all disabled:opacity-50",style:{background:"linear-gradient(135deg, #3B82F6 0%, #2563EB 100%)",color:"#ffffff"},children:N?"Generating...":"Generate Tasks"})]})]})]})})]})}function ws({initialBoard:e,onPersist:t}){let[a,r]=react.useState(e),o=react.useCallback(h=>{t&&Cn(()=>Promise.resolve(t(h)),{maxAttempts:3,initialDelay:1e3,onRetry:(b,u,x)=>{console.warn(`Retry attempt ${u} after ${x}ms: ${b.message}`);}}).then(b=>{b.success||console.error(`Failed to persist board after ${b.attempts} attempts:`,b.error);});},[t]),s=react.useCallback(async(h,b,u)=>{r(x=>{let m=x.cards.find(A=>A.id===h);if(!m)return x;let N=m.columnId,w={...m,columnId:b,position:u},B=x.cards.map(A=>A.id===h?w:A),v=x.columns.map(A=>{if(A.id===N)return {...A,cardIds:A.cardIds.filter(T=>T!==h)};if(A.id===b){let T=B.filter(W=>W.columnId===b).sort((W,$)=>W.position-$.position);return {...A,cardIds:T.map(W=>W.id)}}return A}),I={...x,cards:B,columns:v};return o(I),I});},[o]),n=react.useCallback(async(h,b)=>{r(u=>{let x=u.cards.map(N=>N.id===h?{...N,...b}:N),m={...u,cards:x};return o(m),m});},[o]),c=react.useCallback(async h=>{let b=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>{let x={...h,id:b},m=u.columns.map(w=>w.id===h.columnId?{...w,cardIds:[...w.cardIds,b]}:w),N={...u,cards:[...u.cards,x],columns:m};return o(N),N});},[o]),g=react.useCallback(async h=>{r(b=>{let u=b.cards.find(w=>w.id===h);if(!u)return b;let x=b.cards.filter(w=>w.id!==h),m=b.columns.map(w=>w.id===u.columnId?{...w,cardIds:w.cardIds.filter(B=>B!==h)}:w),N={...b,cards:x,columns:m};return o(N),N});},[o]),i=react.useCallback(async h=>{let b=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r(u=>{let x={...h,id:b,cardIds:[]},m={...u,columns:[...u.columns,x]};return o(m),m});},[o]),p=react.useCallback(async(h,b)=>{r(u=>{let x=u.columns.map(N=>N.id===h?{...N,...b}:N),m={...u,columns:x};return o(m),m});},[o]),l=react.useCallback(async h=>{r(b=>{let u=b.cards.filter(N=>N.columnId!==h),x=b.columns.filter(N=>N.id!==h),m={...b,cards:u,columns:x};return o(m),m});},[o]),f=react.useCallback(h=>{let b=`card-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return c(h),b},[c]),y=react.useCallback(h=>{let b=`col-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;return i(h),b},[i]),k=react.useCallback(()=>{r(h=>{let b={...h,cards:[],columns:[]};return o(b),b});},[o]);return {board:a,callbacks:{onCardMove:s,onCardUpdate:n,onCardCreate:c,onCardDelete:g,onColumnCreate:i,onColumnUpdate:p,onColumnDelete:l},setBoard:r,helpers:{addCard:f,addColumn:y,deleteCard:g,deleteColumn:l,clearBoard:k}}}function Wp({initialData:e,availableUsers:t=[],onSave:a}){let{board:r,callbacks:o,helpers:s}=ws({initialBoard:e,onPersist:a}),n=react.useMemo(()=>({addCard:(g,i,p={})=>{s.addCard({title:i,columnId:g,position:r.cards.filter(l=>l.columnId===g).length,...p});},addColumn:(g,i)=>{let p=r.columns.length>0?Math.max(...r.columns.map(l=>l.position)):0;s.addColumn({title:g,position:i??p+1e3});},reset:s.clearBoard}),[r.cards,r.columns,s]);return {props:react.useMemo(()=>({board:r,callbacks:o,availableUsers:t}),[r,o,t]),board:r,callbacks:o,utils:n}}var gn={dateFilter:"all",priorities:[],assignees:[],labels:[],columns:[],search:""},_p={by:"none",order:"asc"};function Vp({initialFilters:e={},initialSort:t={},currentUserId:a}={}){let[r,o]=react.useState({...gn,...e}),[s,n]=react.useState({..._p,...t}),c=react.useCallback(C=>{o(h=>({...h,...C}));},[]),g=react.useCallback(C=>{n(h=>({...h,...C}));},[]),i=react.useCallback(()=>{o(gn),n(_p);},[]),p=react.useCallback(()=>{a&&o({...gn,assignees:[a]});},[a]),l=react.useCallback(()=>{o({...gn,dateFilter:"overdue"});},[]),f=react.useCallback(()=>{o({...gn,priorities:["HIGH","URGENT"]});},[]),y=react.useMemo(()=>r.dateFilter!=="all"||r.priorities.length>0||r.assignees.length>0||r.labels.length>0||r.columns.length>0||r.search!==""||s.by!=="none",[r,s]),k=react.useCallback(C=>{let h=[...C];if(r.search){let b=r.search.toLowerCase();h=h.filter(u=>u.title.toLowerCase().includes(b)||u.description?.toLowerCase().includes(b));}if(r.dateFilter!=="all"){let b=new Date,u=b.getFullYear(),x=String(b.getMonth()+1).padStart(2,"0"),m=String(b.getDate()).padStart(2,"0"),N=`${u}-${x}-${m}`;h=h.filter(w=>{if(!w.endDate&&!w.dueDate)return false;let B=w.endDate||w.dueDate;if(!B)return false;let v;if(typeof B=="string")v=B.split("T")[0]||B;else {let I=B.getUTCFullYear(),A=String(B.getUTCMonth()+1).padStart(2,"0"),T=String(B.getUTCDate()).padStart(2,"0");v=`${I}-${A}-${T}`;}switch(r.dateFilter){case "overdue":return v<N;case "today":return v===N;case "this-week":let I=new Date(N+"T00:00:00"),A=new Date(v+"T00:00:00"),T=new Date(I);return T.setDate(T.getDate()+7),A>=I&&A<=T;case "custom":if(r.dateRange){let W=typeof B=="string"?new Date(B):B;return W>=r.dateRange.start&&W<=r.dateRange.end}return true;default:return true}});}return r.priorities.length>0&&(h=h.filter(b=>b.priority&&r.priorities.includes(b.priority))),r.assignees.length>0&&(h=h.filter(b=>(b.assignedUserIds||(b.assigneeId?[b.assigneeId]:[])).some(x=>r.assignees.includes(x)))),r.labels.length>0&&(h=h.filter(b=>b.labels&&b.labels.some(u=>r.labels.includes(u)))),r.columns.length>0&&(h=h.filter(b=>r.columns.includes(b.columnId))),s.by!=="none"&&h.sort((b,u)=>{let x=0;switch(s.by){case "created":let m=b.createdAt?new Date(b.createdAt).getTime():0,N=u.createdAt?new Date(u.createdAt).getTime():0;x=m-N;break;case "priority":let w={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},B=w[b.priority||"LOW"],v=w[u.priority||"LOW"];x=B-v;break;case "dueDate":let I=b.endDate||b.dueDate,A=u.endDate||u.dueDate;if(!I)return 1;if(!A)return -1;let T=typeof I=="string"?new Date(I).getTime():I.getTime(),W=typeof A=="string"?new Date(A).getTime():A.getTime();x=T-W;break;case "title":x=b.title.localeCompare(u.title);break;case "estimate":let $=b.estimatedTime||0,j=u.estimatedTime||0;x=$-j;break;default:x=0;}return s.order==="asc"?x:-x}),h},[r,s]);return {filters:r,sort:s,setFilters:c,setSort:g,resetFilters:i,filterMyTasks:p,filterOverdue:l,filterHighPriority:f,applyFilters:k,hasActiveFilters:y}}var Kp,Yp;if(typeof window<"u")try{let e=xn("ai");Kp=e.generateObject,Yp=e.generateText;}catch{}function qp(e={}){let[t,a]=react.useState(false),[r,o]=react.useState(null),s=!!(Kp&&Yp&&e.apiKey),n=react.useCallback(async l=>{if(!s)throw new Error('AI features require the "ai" package and an API key. Install with: npm install ai');a(true),o(null);try{return console.log("Generating plan for:",l),{columns:[{title:"To Do",position:1e3,cardIds:[]},{title:"In Progress",position:2e3,cardIds:[]},{title:"Done",position:3e3,cardIds:[]}],cards:[{title:"Generated task from AI",description:`Based on: ${l}`,position:1e3,columnId:"temp-col-1"}],explanation:"This is a sample plan. Real implementation would use AI SDK."}}catch(f){let y=f instanceof Error?f:new Error("Failed to generate plan");throw o(y),y}finally{a(false);}},[s]),c=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Suggesting assignee for:",l.title),{userId:"user-123",confidence:.85,reasoning:"Based on past performance and expertise"}}catch(f){let y=f instanceof Error?f:new Error("Failed to suggest assignee");throw o(y),y}finally{a(false);}},[s]),g=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Analyzing board for risks..."),[{type:"RISK_OVERLOAD",severity:"HIGH",title:"Column overload detected",description:'Too many cards in "In Progress"',confidence:.9,suggestedAction:'Consider moving some cards back to "To Do"'}]}catch(f){let y=f instanceof Error?f:new Error("Failed to predict risks");throw o(y),y}finally{a(false);}},[s]),i=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Generating subtasks for:",l.title),[{title:`Subtask 1 for: ${l.title}`,position:l.position+.1,columnId:l.columnId},{title:`Subtask 2 for: ${l.title}`,position:l.position+.2,columnId:l.columnId}]}catch(f){let y=f instanceof Error?f:new Error("Failed to generate subtasks");throw o(y),y}finally{a(false);}},[s]),p=react.useCallback(async l=>{if(!s)throw new Error("AI features not available");a(true),o(null);try{return console.log("Estimating effort for:",l.title),{hours:8,confidence:.75}}catch(f){let y=f instanceof Error?f:new Error("Failed to estimate effort");throw o(y),y}finally{a(false);}},[s]);return {onGeneratePlan:n,onSuggestAssignee:c,onPredictRisks:g,onGenerateSubtasks:i,onEstimateEffort:p,isAvailable:s,isLoading:t,error:r}}function Al(){let[e,t]=react.useState(()=>core.selectionStore.getState());react.useEffect(()=>core.selectionStore.subscribe(o=>{t(o);}),[]);let a=react.useCallback(r=>{core.selectionStore.setState(r);},[]);return [e,a]}function Xp(e){let{cards:t}=e,[a,r]=Al(),o=react.useCallback(l=>a.selectedCardIds.includes(l),[a.selectedCardIds]),s=react.useCallback((l,f)=>{if(!f){r({selectedCardIds:[l],lastSelectedCardId:l});return}let y=f.ctrlKey||f.metaKey,k=f.shiftKey;if(y)a.selectedCardIds.includes(l)?r({selectedCardIds:a.selectedCardIds.filter(C=>C!==l),lastSelectedCardId:a.lastSelectedCardId}):r({selectedCardIds:[...a.selectedCardIds,l],lastSelectedCardId:l});else if(k&&a.lastSelectedCardId){let C=t.find(b=>b.id===l),h=t.find(b=>b.id===a.lastSelectedCardId);if(C&&h&&C.columnId===h.columnId){let b=t.filter(v=>v.columnId===C.columnId).sort((v,I)=>v.position-I.position),u=b.findIndex(v=>v.id===a.lastSelectedCardId),x=b.findIndex(v=>v.id===l),[m,N]=u<x?[u,x]:[x,u],w=b.slice(m,N+1).map(v=>v.id),B=Array.from(new Set([...a.selectedCardIds,...w]));r({selectedCardIds:B,lastSelectedCardId:l});}else r({selectedCardIds:[l],lastSelectedCardId:l});}else r({selectedCardIds:[l],lastSelectedCardId:l});},[t,a,r]),n=react.useCallback(l=>{r({selectedCardIds:a.selectedCardIds.filter(f=>f!==l),lastSelectedCardId:a.lastSelectedCardId});},[a,r]),c=react.useCallback(()=>{r({selectedCardIds:[],lastSelectedCardId:null});},[r]),g=react.useCallback(()=>{r({selectedCardIds:t.map(l=>l.id),lastSelectedCardId:t[t.length-1]?.id||null});},[t,r]),i=react.useCallback(l=>{a.selectedCardIds.includes(l)?n(l):r({selectedCardIds:[...a.selectedCardIds,l],lastSelectedCardId:l});},[a,n,r]),p=react.useCallback(()=>t.filter(l=>a.selectedCardIds.includes(l.id)),[t,a.selectedCardIds]);return {selectedCardIds:a.selectedCardIds,lastSelectedCardId:a.lastSelectedCardId,isCardSelected:o,selectCard:s,deselectCard:n,clearSelection:c,selectAll:g,toggleCard:i,getSelectedCards:p}}var Jp={enableAutoStacking:true,autoStackConfidenceThreshold:.7,minCardsPerStack:2,enableManualStacking:true,showStackSummaries:true,animationDuration:200};function Zp(e){let{cards:t,config:a,aiService:r}=e,o=react.useMemo(()=>({...Jp,...a}),[a]),[s,n]=react.useState([]),c=react.useCallback((C,h,b,u,x)=>{if(h.length<o.minCardsPerStack){console.warn(`Cannot create stack: minimum ${o.minCardsPerStack} cards required`);return}let m={id:`stack-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:C,cardIds:h,columnId:b,strategy:u,color:x,isExpanded:true,position:s.filter(N=>N.columnId===b).length,createdAt:new Date};n(N=>[...N,m]);},[o.minCardsPerStack,s]),g=react.useCallback(C=>{n(h=>h.filter(b=>b.id!==C));},[]),i=react.useCallback(C=>{n(h=>h.map(b=>b.id===C?{...b,isExpanded:!b.isExpanded}:b));},[]),p=react.useCallback((C,h)=>{n(b=>b.map(u=>u.id===C&&!u.cardIds.includes(h)?{...u,cardIds:[...u.cardIds,h]}:u));},[]),l=react.useCallback((C,h)=>{n(b=>b.map(u=>{if(u.id===C){let x=u.cardIds.filter(m=>m!==h);return x.length<o.minCardsPerStack?null:{...u,cardIds:x}}return u}).filter(u=>u!==null));},[o.minCardsPerStack]),f=react.useCallback(C=>s.filter(h=>h.columnId===C).sort((h,b)=>h.position-b.position),[s]),y=react.useCallback(async C=>{let h=t.filter(N=>N.columnId===C);if(h.length<o.minCardsPerStack*2)return [];let b=[],u=new Map;h.forEach(N=>{N.labels&&N.labels.length>0&&N.labels.forEach(w=>{u.has(w)||u.set(w,[]),u.get(w).push(N);});}),u.forEach((N,w)=>{N.length>=o.minCardsPerStack&&b.push({stack:{title:`\u{1F4CC} ${w}`,cardIds:N.map(B=>B.id),columnId:C,strategy:"labels",color:"#3b82f6"},reason:`${N.length} cards with label "${w}"`,confidence:.85});});let x=new Map;h.forEach(N=>{N.assignedUserIds&&N.assignedUserIds.length>0&&N.assignedUserIds.forEach(w=>{x.has(w)||x.set(w,[]),x.get(w).push(N);});}),x.forEach((N,w)=>{N.length>=o.minCardsPerStack&&b.push({stack:{title:`\u{1F464} Assigned to user-${w.slice(-4)}`,cardIds:N.map(B=>B.id),columnId:C,strategy:"assignee",color:"#8b5cf6"},reason:`${N.length} cards assigned to the same user`,confidence:.8});});let m=new Map;if(h.forEach(N=>{N.priority&&(m.has(N.priority)||m.set(N.priority,[]),m.get(N.priority).push(N));}),m.forEach((N,w)=>{if(N.length>=o.minCardsPerStack){let B={low:"\u{1F7E2}",medium:"\u{1F7E1}",high:"\u{1F534}",urgent:"\u{1F6A8}"}[w.toLowerCase()]||"\u26AA";b.push({stack:{title:`${B} ${w} Priority`,cardIds:N.map(v=>v.id),columnId:C,strategy:"priority",color:w==="high"||w==="urgent"?"#ef4444":"#10b981"},reason:`${N.length} cards with ${w} priority`,confidence:.75});}}),r&&o.enableAutoStacking)for(let N of h){let B=(await r.findSimilar(N,h)).filter(v=>v.similarity>=o.autoStackConfidenceThreshold);if(B.length>=o.minCardsPerStack-1){let v=[N.id,...B.map(A=>A.card.id)],I=B.reduce((A,T)=>A+T.similarity,0)/B.length;b.push({stack:{title:`\u2728 Similar to "${N.title.substring(0,30)}${N.title.length>30?"...":""}"`,cardIds:v,columnId:C,strategy:"ai-similarity",color:"#f59e0b"},reason:`AI detected ${B.length+1} similar tasks`,confidence:I});}}return b.filter(N=>N.confidence>=o.autoStackConfidenceThreshold).sort((N,w)=>w.confidence-N.confidence).slice(0,5)},[t,o,r]),k=react.useCallback(C=>{c(C.stack.title,C.stack.cardIds,C.stack.columnId,C.stack.strategy,C.stack.color);},[c]);return react.useEffect(()=>{o.enableAutoStacking&&s.length===0&&new Set(t.map(h=>h.columnId)).forEach(async h=>{let b=await y(h),u=b[0];b.length>0&&u&&u.confidence>=.9&&k(u);});},[]),{stacks:s,createStack:c,deleteStack:g,toggleStack:i,addToStack:p,removeFromStack:l,getStacksForColumn:f,getSuggestions:y,applySuggestion:k,config:o}}var Qp=react.createContext(null);function eu({children:e,initialData:t,onStateChange:a}){let r=react.useRef();if(!r.current){let s=new Map,n=new Map;t?.columns?.forEach(g=>{let{Column:i}=xn("@libxai/core");s.set(g.id,new i(g));}),t?.cards?.forEach(g=>{let{Card:i}=xn("@libxai/core");n.set(g.id,new i(g));});let c=null;if(t?.board){let{Board:g}=xn("@libxai/core");c=new g(t.board);}r.current=new core.BoardStore({board:c,columns:s,cards:n});}let o=r.current;return react.useEffect(()=>{if(a)return o.subscribeAll(s=>{a(o.getState());})},[o,a]),jsxRuntime.jsx(Qp.Provider,{value:{store:o},children:e})}function Cs(){let e=react.useContext(Qp);if(!e)throw new Error("useBoardStore must be used within BoardProvider");return e.store}function bn(){let e=Cs(),[t,a]=react.useState(e.getBoard()),[r,o]=react.useState(e.getAllColumns()),[s,n]=react.useState(e.getAllCards());react.useEffect(()=>e.subscribeAll(()=>{a(e.getBoard()),o(e.getAllColumns()),n(e.getAllCards());}),[e]);let c=react.useCallback(u=>{e.updateBoard(u);},[e]),g=react.useCallback(u=>{e.addColumn(u);},[e]),i=react.useCallback((u,x)=>{e.updateColumn(u,x);},[e]),p=react.useCallback(u=>{e.deleteColumn(u);},[e]),l=react.useCallback(u=>e.getColumn(u),[e]),f=react.useCallback(u=>{e.addCard(u);},[e]),y=react.useCallback((u,x)=>{e.updateCard(u,x);},[e]),k=react.useCallback(u=>{e.deleteCard(u);},[e]),C=react.useCallback((u,x,m)=>{e.moveCard(u,x,m);},[e]),h=react.useCallback(u=>e.getCard(u),[e]),b=react.useCallback(u=>e.getCardsByColumn(u),[e]);return {board:t,columns:r,cards:s,updateBoard:c,addColumn:g,updateColumn:i,deleteColumn:p,getColumn:l,addCard:f,updateCard:y,deleteCard:k,moveCard:C,getCard:h,getCardsByColumn:b}}function au(e){let{cards:t}=bn();return react.useMemo(()=>e?t.filter(a=>{if(e.searchQuery){let r=e.searchQuery.toLowerCase(),o=a.title.toLowerCase().includes(r),s=a.description?.toLowerCase().includes(r);if(!o&&!s)return false}return !(e.priorities&&e.priorities.length>0&&(!a.priority||!e.priorities.includes(a.priority))||e.statuses&&e.statuses.length>0&&(!a.status||!e.statuses.includes(a.status))||e.assignedUserIds&&e.assignedUserIds.length>0&&!e.assignedUserIds.some(o=>a.isAssignedTo(o))||e.labels&&e.labels.length>0&&!e.labels.some(o=>a.hasLabel(o))||e.columnIds&&e.columnIds.length>0&&!e.columnIds.includes(a.columnId)||e.isOverdue!==void 0&&e.isOverdue!==a.isOverdue())}):t,[t,e])}function ru(e="position",t="asc"){let{cards:a}=bn();return react.useMemo(()=>[...a].sort((o,s)=>{let n=0;switch(e){case "title":n=o.title.localeCompare(s.title);break;case "priority":{let c={URGENT:4,HIGH:3,MEDIUM:2,LOW:1},g=o.priority?c[o.priority]:0,i=s.priority?c[s.priority]:0;n=g-i;break}case "createdAt":n=o.createdAt.getTime()-s.createdAt.getTime();break;case "updatedAt":n=o.updatedAt.getTime()-s.updatedAt.getTime();break;case "position":n=o.position-s.position;break}return t==="asc"?n:-n}),[a,e,t])}var Ts=class{constructor(){this.plugins=new Map;this.enabled=new Set;this.config=new Map;this.context=null;this.pluginLogger=cd.child("PluginManager");}setContext(t){this.context=t;}register(t){if(!t.id||!t.name||!t.version)throw new Error("Plugin must have id, name, and version");if(this.plugins.has(t.id)&&this.pluginLogger.warn(`Plugin ${t.id} is already registered, overwriting...`),t.dependencies){for(let a of t.dependencies)if(!this.plugins.has(a))throw new Error(`Plugin ${t.id} depends on ${a} which is not registered`)}this.plugins.set(t.id,t),t.defaultConfig&&this.config.set(t.id,{...t.defaultConfig}),this.enabled.add(t.id),this.pluginLogger.info(`Plugin registered: ${t.name} v${t.version}`),t.onInit&&this.context&&Promise.resolve(t.onInit(this.context)).catch(a=>{this.pluginLogger.error(`Failed to initialize plugin ${t.id}`,a,{plugin:t.id});});}unregister(t){let a=this.plugins.get(t);if(!a){this.pluginLogger.warn(`Plugin ${t} is not registered`);return}a.onDestroy&&Promise.resolve(a.onDestroy()).catch(r=>{this.pluginLogger.error(`Failed to destroy plugin ${t}`,r);}),this.plugins.delete(t),this.enabled.delete(t),this.config.delete(t),this.pluginLogger.info(`Plugin unregistered: ${a.name}`);}getPlugin(t){return this.plugins.get(t)}getPlugins(){return Array.from(this.plugins.values())}hasPlugin(t){return this.plugins.has(t)}setEnabled(t,a){if(!this.plugins.has(t))throw new Error(`Plugin ${t} is not registered`);a?(this.enabled.add(t),this.pluginLogger.info(`Plugin enabled: ${t}`)):(this.enabled.delete(t),this.pluginLogger.info(`Plugin disabled: ${t}`));}isEnabled(t){return this.enabled.has(t)}getConfig(t,a){return this.config.get(t)?.[a]}setConfig(t,a,r){this.config.has(t)||this.config.set(t,{});let o=this.config.get(t);o[a]=r,this.pluginLogger.debug(`Plugin config set: ${t}.${a}`,{value:r});}async executeHook(t,a,r){let o=r;for(let s of this.plugins.values()){if(!this.enabled.has(s.id))continue;let n=s[t];if(typeof n=="function")try{let c=await Promise.resolve(n.apply(s,a));c!==void 0&&(o=c,a[0]=c);}catch(c){this.pluginLogger.error(`Plugin hook failed: ${s.id}.${t}`,c,{plugin:s.id,hook:t});}}return o}async executeHookParallel(t,a){let r=[];for(let o of this.plugins.values()){if(!this.enabled.has(o.id))continue;let s=o[t];typeof s=="function"&&r.push(Promise.resolve(s.apply(o,a)).catch(n=>{this.pluginLogger.error(`Plugin hook failed: ${o.id}.${t}`,n,{plugin:o.id,hook:t});}));}await Promise.all(r);}},ax=new Ts;function nu({items:e,height:t,estimateSize:a,renderItem:r,className:o="",overscan:s=5,horizontal:n=false,gap:c=0,getItemKey:g}){let i=react.useRef(null),p=reactVirtual.useVirtualizer({count:e.length,getScrollElement:()=>i.current,estimateSize:()=>a,overscan:s,horizontal:n,gap:c}),l=p.getVirtualItems(),f={height:typeof t=="number"?`${t}px`:t,width:"100%",overflow:"auto",position:"relative"},y=n?{width:`${p.getTotalSize()}px`,height:"100%",position:"relative"}:{height:`${p.getTotalSize()}px`,width:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:i,style:f,className:o,children:jsxRuntime.jsx("div",{style:y,children:l.map(k=>{let C=e[k.index];if(!C)return null;let h=g?g(C,k.index):k.index,b={position:"absolute",top:n?0:k.start,left:n?k.start:0,width:n?k.size:"100%",height:n?"100%":k.size};return jsxRuntime.jsx("div",{style:b,"data-index":k.index,children:r(C,k.index)},h)})})})}function su(e){return reactVirtual.useVirtualizer({count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateSize,overscan:e.overscan??5,horizontal:e.horizontal??false,gap:e.gap??0})}function lu({items:e,height:t,width:a="100%",estimateColumnWidth:r,renderColumn:o,className:s="",overscan:n=3,gap:c=16,getItemKey:g,horizontal:i=true}){let p=react.useRef(null),l=reactVirtual.useVirtualizer({horizontal:i,count:e.length,getScrollElement:()=>p.current,estimateSize:()=>r,overscan:n,gap:c}),f=l.getVirtualItems(),y={height:typeof t=="number"?`${t}px`:t,width:typeof a=="number"?`${a}px`:a,overflow:"auto",position:"relative"},k={width:`${l.getTotalSize()}px`,height:"100%",position:"relative"};return jsxRuntime.jsx("div",{ref:p,style:y,className:s,children:jsxRuntime.jsx("div",{style:k,children:f.map(C=>{let h=e[C.index];if(!h)return null;let b=g?g(h,C.index):C.index,u={position:"absolute",top:0,left:C.start,width:C.size,height:"100%"};return jsxRuntime.jsx("div",{style:u,"data-index":C.index,children:o(h,C.index)},b)})})})}function du(e){let t=reactVirtual.useVirtualizer({horizontal:true,count:e.items.length,getScrollElement:()=>e.scrollElement,estimateSize:()=>e.estimateColumnWidth,overscan:e.overscan??3,gap:e.gap??0});return {columnVirtualizer:t,virtualColumns:t.getVirtualItems(),totalWidth:t.getTotalSize()}}function cu(e,t=10){return e>t}var Bl={none:0,xs:4,sm:8,md:12,lg:16,xl:20,"2xl":24,"3xl":32,"4xl":40,"5xl":48,"6xl":64},Rl={none:0,sm:4,md:8,lg:12,xl:16,"2xl":20,full:9999},Ol={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48},$l={light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800},Ul={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},zl={base:0,dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070},Hl={instant:0,fastest:75,faster:100,fast:150,normal:200,slow:300,slower:400,slowest:500},Wl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",smooth:"cubic-bezier(0.4, 0.0, 0.2, 1)",sharp:"cubic-bezier(0.4, 0.0, 0.6, 1)",bounce:"cubic-bezier(0.68, -0.55, 0.265, 1.55)"},Gl={none:"none",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"},_l={0:0,5:.05,10:.1,20:.2,30:.3,40:.4,50:.5,60:.6,70:.7,80:.8,90:.9,100:1},Vl={column:{width:320,minWidth:280,maxWidth:400,gap:16,padding:12,headerHeight:48},card:{minHeight:80,maxHeight:400,padding:12,gap:8},board:{padding:16,gap:16}},jl={timeline:{headerHeight:60,rowHeight:44,minRowHeight:32,maxRowHeight:80,taskPadding:4,gridLineWidth:1},task:{height:28,minHeight:20,maxHeight:40,borderRadius:4,padding:6},dependency:{lineWidth:2,arrowSize:8},scale:{day:{columnWidth:40,minColumnWidth:30,maxColumnWidth:60},week:{columnWidth:80,minColumnWidth:60,maxColumnWidth:120},month:{columnWidth:120,minColumnWidth:80,maxColumnWidth:200},quarter:{columnWidth:200,minColumnWidth:150,maxColumnWidth:300}},milestone:{size:16,rotation:45}},Ns={spacing:Bl,borderRadius:Rl,fontSize:Ol,fontWeight:$l,lineHeight:Ul,zIndex:zl,duration:Hl,easing:Wl,shadows:Gl,opacity:_l,kanban:Vl,gantt:jl};function mu(e,t,a){return e[t]??a}function Kl(e,t="",a={}){for(let[r,o]of Object.entries(e)){let s=t?`${t}-${r}`:r;typeof o=="object"&&o!==null&&!Array.isArray(o)?Kl(o,s,a):(typeof o=="string"||typeof o=="number")&&(a[s]=o);}return a}function nx(e){return typeof e=="number"?e>0&&e<1e3?`${e}px`:e.toString():e}function Yl(e="asakaa"){let t=Kl(Ns),a=[];for(let[r,o]of Object.entries(t)){let s=`--${e}-${r}`,n=nx(o);a.push(` ${s}: ${n};`);}return `:root {
390
390
  ${a.join(`
391
391
  `)}
392
392
  }`}function hn(e,t="asakaa"){let a=[],r=Kl(e);for(let[o,s]of Object.entries(r)){let n=`--${t}-color-${o}`;a.push(` ${n}: ${s};`);}return `:root {