cortex-react-components 2.13.9 → 2.13.11
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/{chunk-FDRX3CL2.mjs → chunk-3E3GY7S2.mjs} +1 -1
- package/dist/{chunk-LHO4WFYP.mjs → chunk-5FWH5YVM.mjs} +1 -1
- package/dist/{chunk-USGRM22Y.mjs → chunk-6PS55VJZ.mjs} +1 -1
- package/dist/{chunk-DMCFEJ2C.mjs → chunk-6VRPQKAK.mjs} +1 -1
- package/dist/chunk-AP6ZM2J6.mjs +4 -0
- package/dist/{chunk-MFCVMJBO.mjs → chunk-BDDEMCAH.mjs} +1 -1
- package/dist/{chunk-TO7SVJIU.mjs → chunk-EUGA4BNN.mjs} +1 -1
- package/dist/chunk-F3CQJWDX.mjs +1 -0
- package/dist/{chunk-5NIEZE7A.mjs → chunk-KBEXWUKI.mjs} +1 -1
- package/dist/{chunk-OQCMTGML.mjs → chunk-KVLUT4U2.mjs} +1 -1
- package/dist/chunk-L3V5YDPH.mjs +1 -0
- package/dist/{chunk-AMVJPDM3.mjs → chunk-M527EJIX.mjs} +1 -1
- package/dist/{chunk-P7S6XFU4.mjs → chunk-MX3JKY3V.mjs} +1 -1
- package/dist/{chunk-KZAYLEFB.mjs → chunk-O24GFE6Q.mjs} +1 -1
- package/dist/{chunk-ZFUP5NVF.mjs → chunk-O5P35LEY.mjs} +1 -1
- package/dist/{chunk-7O5XSUX2.mjs → chunk-QOZ2O3FG.mjs} +1 -1
- package/dist/{chunk-G34OMFQI.mjs → chunk-RMGDXYJO.mjs} +1 -1
- package/dist/{chunk-GLBQHEMQ.mjs → chunk-TTSBUSVB.mjs} +1 -1
- package/dist/{chunk-JGX2G2OC.mjs → chunk-XOEYCVMT.mjs} +1 -1
- package/dist/{chunk-2HWSTGAP.mjs → chunk-XQ3XV5DH.mjs} +1 -1
- package/dist/chunk-XWDRWOIG.mjs +1 -0
- package/dist/{chunk-AQQCH7Z2.mjs → chunk-XX4GSGRP.mjs} +1 -1
- package/dist/{chunk-UEBQJNVT.mjs → chunk-ZGQC6O62.mjs} +1 -1
- package/dist/chunk-ZHBYZ4HE.mjs +1 -0
- package/dist/components/Blocks/index.mjs +1 -1
- package/dist/components/CRM/CogeBoard.mjs +1 -1
- package/dist/components/CRM/KanbanBoard.mjs +1 -1
- package/dist/components/CRM/index.mjs +1 -1
- package/dist/components/Chat/ChatInterface.mjs +1 -1
- package/dist/components/Chat/CopilotInterface.mjs +1 -1
- package/dist/components/Chat/demo-long-messages.mjs +1 -1
- package/dist/components/Chat/demo-tests.mjs +1 -1
- package/dist/components/Chat/demo.mjs +1 -1
- package/dist/components/Chat/example-usage.mjs +1 -1
- package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
- package/dist/components/Chat/index.mjs +1 -1
- package/dist/components/DeliveryLead/DeliveryLeadSubmissionWithList.mjs +1 -1
- package/dist/components/DeliveryLead/index.mjs +1 -1
- package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
- package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
- package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
- package/dist/components/DigitalColleagues/Views/index.js +1 -1
- package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
- package/dist/components/DigitalColleagues/index.js +1 -1
- package/dist/components/DigitalColleagues/index.mjs +1 -1
- package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
- package/dist/components/Foundary/MainPage.mjs +1 -1
- package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
- package/dist/components/Foundary/Views/index.js +1 -1
- package/dist/components/Foundary/Views/index.mjs +1 -1
- package/dist/components/Foundary/index.js +1 -1
- package/dist/components/Foundary/index.mjs +1 -1
- package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
- package/dist/components/HeaderFooter/index.mjs +1 -1
- package/dist/components/Heros/PostHero/index.mjs +1 -1
- package/dist/components/Heros/RenderHero.mjs +1 -1
- package/dist/components/Heros/SectionHero/index.mjs +1 -1
- package/dist/components/Heros/index.mjs +1 -1
- package/dist/components/Layouts/SlideShow.mjs +1 -1
- package/dist/components/Layouts/index.mjs +1 -1
- package/dist/components/Menus/SidebarLeft.mjs +1 -1
- package/dist/components/Menus/SidebarRight.mjs +1 -1
- package/dist/components/Menus/index.mjs +1 -1
- package/dist/components/Other/index.mjs +1 -1
- package/dist/components/Projects/AddEpicModal.d.ts +1 -1
- package/dist/components/Projects/AddEpicModal.js +1 -1
- package/dist/components/Projects/AddEpicModal.mjs +1 -1
- package/dist/components/Projects/EpicsView.d.ts +1 -1
- package/dist/components/Projects/EpicsView.js +1 -1
- package/dist/components/Projects/EpicsView.mjs +1 -1
- package/dist/components/Projects/KanbanBoardView.d.ts +3 -3
- package/dist/components/Projects/KanbanBoardView.js +1 -1
- package/dist/components/Projects/KanbanBoardView.mjs +1 -1
- package/dist/components/Projects/ProjectPage.js +1 -1
- package/dist/components/Projects/ProjectPage.mjs +1 -1
- package/dist/components/Projects/ProjectView.d.ts +3 -3
- package/dist/components/Projects/ProjectView.js +1 -1
- package/dist/components/Projects/ProjectView.mjs +1 -1
- package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
- package/dist/components/Projects/TaskDetailsModal.d.ts +2 -2
- package/dist/components/Projects/TaskDetailsModal.js +1 -1
- package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
- package/dist/components/Projects/TaskSidebar.js +1 -1
- package/dist/components/Projects/TaskSidebar.mjs +1 -1
- package/dist/components/Projects/TasksView.d.ts +2 -2
- package/dist/components/Projects/TasksView.js +1 -1
- package/dist/components/Projects/TasksView.mjs +1 -1
- package/dist/components/Projects/index.js +1 -1
- package/dist/components/Projects/index.mjs +1 -1
- package/dist/components/dc-temp/index.mjs +1 -1
- package/dist/components/index.js +9 -9
- package/dist/components/index.mjs +1 -1
- package/dist/components/ui/index.mjs +1 -1
- package/dist/components/ui/sidebar.mjs +1 -1
- package/dist/index.js +10 -10
- package/dist/index.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pages/Blog.mjs +1 -1
- package/dist/pages/Documentation.mjs +1 -1
- package/dist/pages/IndexPage.mjs +1 -1
- package/dist/pages/Intranet.mjs +1 -1
- package/dist/pages/LandingPage.mjs +1 -1
- package/dist/pages/Page.mjs +1 -1
- package/dist/pages/Publish.mjs +1 -1
- package/dist/pages/Website.mjs +1 -1
- package/dist/sections/AboutSection.mjs +1 -1
- package/dist/sections/BlogDetail.mjs +1 -1
- package/dist/sections/BlogList.mjs +1 -1
- package/dist/sections/BlogListSection.mjs +1 -1
- package/dist/sections/PageSections.mjs +1 -1
- package/dist/sections/PricingSection.mjs +1 -1
- package/dist/sections/ServiceSection.mjs +1 -1
- package/dist/sections/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-6BQNN2KT.mjs +0 -1
- package/dist/chunk-6R36YTGY.mjs +0 -1
- package/dist/chunk-MIOYUP5Z.mjs +0 -1
- package/dist/chunk-ULO56RLR.mjs +0 -4
- package/dist/chunk-XNEPSYCO.mjs +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
"use client"
|
|
4
4
|
|
|
5
|
-
"use strict";var Hd=Object.create;var Si=Object.defineProperty;var zd=Object.getOwnPropertyDescriptor;var Ud=Object.getOwnPropertyNames;var Vd=Object.getPrototypeOf,Kd=Object.prototype.hasOwnProperty;var Gd=(e,t)=>{for(var a in t)Si(e,a,{get:t[a],enumerable:!0})},$s=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ud(t))!Kd.call(e,i)&&i!==a&&Si(e,i,{get:()=>t[i],enumerable:!(o=zd(t,i))||o.enumerable});return e};var ae=(e,t,a)=>(a=e!=null?Hd(Vd(e)):{},$s(t||!e||!e.__esModule?Si(a,"default",{value:e,enumerable:!0}):a,e)),_d=e=>$s(Si({},"__esModule",{value:!0}),e);var Im={};Gd(Im,{AppSidebarLeft:()=>Ii,ColleagueCard:()=>Ao,ColleagueForm:()=>di,ColleagueTypeSelection:()=>tr,ColleaguesView:()=>bi,DashboardHeader:()=>Dn,DashboardPage:()=>Ds,DigitalColleagueClone:()=>ar,DigitalColleagueOptions:()=>or,DocumentEdit:()=>gr,DocumentPreview:()=>fr,FileView:()=>yi,FoundaryLayout:()=>$i,KnowledgeBrowser:()=>vr,KnowledgeSearch:()=>xd,KnowledgeView:()=>hi,MainPage:()=>vs,ManagementSidebar:()=>gl,PlanningView:()=>Sr,ProjectView:()=>Os,ProjectsIndexView:()=>zs,SearchableSelect:()=>er,TeamForm:()=>rr,TeamsIndexView:()=>Us});module.exports=_d(Im);var Sn=require("lucide-react");var vo=ae(require("@radix-Di/react-collapsible")),Rr=vo.Root,Ws=vo.CollapsibleTrigger,Js=vo.CollapsibleContent;var Wr=ae(require("clsx"));var on=require("clsx");var Mr="-",$d=e=>{let t=Jd(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let s=l.split(Mr);return s[0]===""&&s.length!==1&&s.shift(),Ys(s,t)||Wd(l)},getConflictingClassGroupIds:(l,s)=>{let c=a[l]||[];return s&&o[l]?[...c,...o[l]]:c}}},Ys=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?Ys(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Mr);return t.validators.find(({validator:l})=>l(r))?.classGroupId},qs=/^\[(.+)\]$/,Wd=e=>{if(qs.test(e)){let t=qs.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Jd=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Xd(Object.entries(e.classGroups),a).forEach(([r,l])=>{Ir(l,o,r,t)}),o},Ir=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:Xs(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(qd(i)){Ir(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,l])=>{Ir(l,Xs(t,r),a,o)})})},Xs=(e,t)=>{let a=e;return t.split(Mr).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},qd=e=>e.isThemeGetter,Xd=(e,t)=>t?e.map(([a,o])=>{let i=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([l,s])=>[t+l,s])):r);return[a,i]}):e,Yd=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(r,l)=>{a.set(r,l),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let l=a.get(r);if(l!==void 0)return l;if((l=o.get(r))!==void 0)return i(r,l),l},set(r,l){a.has(r)?a.set(r,l):i(r,l)}}},Qs="!",Qd=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,l=s=>{let c=[],n=0,d=0,m;for(let p=0;p<s.length;p++){let y=s[p];if(n===0){if(y===i&&(o||s.slice(p,p+r)===t)){c.push(s.slice(d,p)),d=p+r;continue}if(y==="/"){m=p;continue}}y==="["?n++:y==="]"&&n--}let b=c.length===0?s:s.substring(d),u=b.startsWith(Qs),h=u?b.substring(1):b,x=m&&m>d?m-d:void 0;return{modifiers:c,hasImportantModifier:u,baseClassName:h,maybePostfixModifierPosition:x}};return a?s=>a({className:s,parseClassName:l}):l},Zd=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},ec=e=>({cache:Yd(e.cacheSize),parseClassName:Qd(e),...$d(e)}),tc=/\s+/,ac=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],l=e.trim().split(tc),s="";for(let c=l.length-1;c>=0;c-=1){let n=l[c],{modifiers:d,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:u}=a(n),h=!!u,x=o(h?b.substring(0,u):b);if(!x){if(!h){s=n+(s.length>0?" "+s:s);continue}if(x=o(b),!x){s=n+(s.length>0?" "+s:s);continue}h=!1}let p=Zd(d).join(":"),y=m?p+Qs:p,D=y+x;if(r.includes(D))continue;r.push(D);let G=i(x,h);for(let F=0;F<G.length;++F){let J=G[F];r.push(y+J)}s=n+(s.length>0?" "+s:s)}return s};function oc(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Zs(t))&&(o&&(o+=" "),o+=a);return o}var Zs=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Zs(e[o]))&&(a&&(a+=" "),a+=t);return a};function ic(e,...t){let a,o,i,r=l;function l(c){let n=t.reduce((d,m)=>m(d),e());return a=ec(n),o=a.cache.get,i=a.cache.set,r=s,s(c)}function s(c){let n=o(c);if(n)return n;let d=ac(c,a);return i(c,d),d}return function(){return r(oc.apply(null,arguments))}}var Ve=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},en=/^\[(?:([a-rn-]+):)?(.+)\]$/i,rc=/^\d+\/\d+$/,sc=new Set(["px","full","screen"]),nc=/^(\d+(\.\d+)?)?(rn|sm|Di|lg|xl)$/,lc=/\d+(%|px|r?em|[sdl]?rn([hwib]|min|max)|Di|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cc=/^(inset_)?-?((\d+)?\.?(\d+)[a-rn]+|0)rn-?((\d+)?\.?(\d+)[a-rn]+|0)/,mc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ha=e=>bo(e)||sc.has(e)||rc.test(e),Ma=e=>ho(e,"length",xc),bo=e=>!!e&&!Number.isNaN(Number(e)),Ar=e=>ho(e,"number",bo),Wo=e=>!!e&&Number.isInteger(Number(e)),pc=e=>e.endsWith("%")&&bo(e.slice(0,-1)),me=e=>en.test(e),Ea=e=>nc.test(e),uc=new Set(["length","size","percentage"]),gc=e=>ho(e,uc,tn),fc=e=>ho(e,"position",tn),vc=new Set(["image","url"]),bc=e=>ho(e,vc,wc),hc=e=>ho(e,"",yc),Jo=()=>!0,ho=(e,t,a)=>{let o=en.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},xc=e=>lc.test(e)&&!dc.test(e),tn=()=>!1,yc=e=>cc.test(e),wc=e=>mc.test(e);var Nc=()=>{let e=Ve("colors"),t=Ve("spacing"),a=Ve("blur"),o=Ve("brightness"),i=Ve("borderColor"),r=Ve("borderRadius"),l=Ve("borderSpacing"),s=Ve("borderWidth"),c=Ve("contrast"),n=Ve("grayscale"),d=Ve("hueRotate"),m=Ve("invert"),b=Ve("gap"),u=Ve("gradientColorStops"),h=Ve("gradientColorStopPositions"),x=Ve("inset"),p=Ve("margin"),y=Ve("opacity"),D=Ve("padding"),G=Ve("saturate"),F=Ve("scale"),J=Ve("sepia"),k=Ve("skew"),Y=Ve("space"),I=Ve("translate"),M=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto",me,t],S=()=>[me,t],Pt=()=>["",ha,Ma],C=()=>["auto",bo,me],ge=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ie=()=>["solid","dashed","dotted","double","none"],Ct=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Qe=()=>["start","end","center","between","around","evenly","stretch"],Xt=()=>["","0",me],Ut=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[bo,me];return{cacheSize:500,separator:":",theme:{colors:[Jo],spacing:[ha,Ma],blur:["none","",Ea,me],brightness:B(),borderColor:[e],borderRadius:["none","","full",Ea,me],borderSpacing:S(),borderWidth:Pt(),contrast:B(),grayscale:Xt(),hueRotate:B(),invert:Xt(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[pc,Ma],inset:te(),margin:te(),opacity:B(),padding:S(),saturate:B(),scale:B(),sepia:Xt(),skew:B(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[Ea]}],"break-after":[{"break-after":Ut()}],"break-before":[{"break-before":Ut()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ge(),me]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],rn:[{rn:["auto",Wo,me]}],basis:[{basis:te()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:Xt()}],shrink:[{shrink:Xt()}],order:[{order:["first","last","none",Wo,me]}],"grid-cols":[{"grid-cols":[Jo]}],"col-start-end":[{col:["auto",{span:["full",Wo,me]},me]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[Jo]}],"row-start-end":[{row:["auto",{span:[Wo,me]},me]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...Qe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Qe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Qe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[D]}],px:[{px:[D]}],py:[{py:[D]}],ps:[{ps:[D]}],rn:[{rn:[D]}],Di:[{Di:[D]}],Di:[{Di:[D]}],pb:[{pb:[D]}],pl:[{pl:[D]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],rn:[{rn:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[Y]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Y]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,t]}],"min-w":[{"min-w":[me,t,"min","max","fit"]}],"max-w":[{"max-w":[me,t,"none","full","min","max","fit","prose",{screen:[Ea]},Ea]}],h:[{h:[me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ea,Ma]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ar]}],"font-family":[{font:[Jo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",me]}],"line-clamp":[{"line-clamp":["none",bo,Ar]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ha,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","Oa-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ha,Ma]}],"underline-offset":[{"underline-offset":["auto",ha,me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ge(),fc]}],"bg-repeat":[{bg:["Oa-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gc]}],"bg-image":[{bg:["none",{"gradient-Sn":["t","tr","r","Oa","b","rn","l","tl"]},bc]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-Sn-pos":[{Sn:[h]}],"gradient-from":[{from:[u]}],"gradient-via":[{via:[u]}],"gradient-Sn":[{Sn:[u]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-rn":[{"rounded-rn":[r]}],"rounded-rn":[{"rounded-rn":[r]}],"rounded-Oa":[{"rounded-Oa":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-Oa":[{"rounded-Oa":[r]}],"rounded-rn":[{"rounded-rn":[r]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...ie(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:ie()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...ie()]}],"outline-offset":[{"outline-offset":[ha,me]}],"outline-w":[{outline:[ha,Ma]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Pt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[ha,Ma]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ea,hc]}],"shadow-color":[{shadow:[Jo]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...Ct(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ct()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ea,me]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[m]}],saturate:[{saturate:[G]}],sepia:[{sepia:[J]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[G]}],"backdrop-sepia":[{"backdrop-sepia":[J]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[F]}],"scale-x":[{"scale-x":[F]}],"scale-y":[{"scale-y":[F]}],rotate:[{rotate:[Wo,me]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","Oa-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","rn-resize","nw-resize","rn-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-rn":[{"scroll-rn":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-rn":[{"scroll-rn":S()}],"scroll-Di":[{"scroll-Di":S()}],"scroll-Di":[{"scroll-Di":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ha,Ma,Ar]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","rn","Di","Di","pb","pl"],px:["Di","pl"],py:["Di","pb"],m:["mx","my","ms","me","rn","mr","mb","ml"],mx:["mr","ml"],my:["rn","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-rn","rounded-rn","rounded-Oa","rounded-tl","rounded-tr","rounded-Oa","rounded-rn"],"rounded-s":["rounded-ss","rounded-Oa"],"rounded-e":["rounded-rn","rounded-rn"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-Oa"],"rounded-b":["rounded-Oa","rounded-rn"],"rounded-l":["rounded-tl","rounded-rn"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-rn","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-rn","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-rn","scroll-Di","scroll-Di","scroll-pb","scroll-pl"],"scroll-px":["scroll-Di","scroll-pl"],"scroll-py":["scroll-Di","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var an=ic(Nc);function f(...e){return an((0,on.clsx)(e))}var rn=require("react/jsx-runtime");function Mt({className:e,...t}){return(0,rn.jsx)("div",{className:f("animate-pulse rounded-Di bg-primary/10",e),...t})}var fe=ae(require("react")),No=require("@radix-Di/react-slot"),yn=require("class-variance-authority");var Di=require("react"),sn=(e=768)=>{let[t,a]=(0,Di.useState)(!1);return(0,Di.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var dn=ae(require("react")),ki=(0,yn.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),w=dn.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,rn.jsx)(e?No.Slot:"button",{className:f(ki({className:t,size:a,variant:o})),ref:r,...i}));w.displayName="Button";var mn=ae(require("react"));var V=mn.forwardRef(({className:e,type:t,...a},o)=>(0,rn.jsx)("input",{type:t,className:f("flex h-9 w-full rounded-Di border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));V.displayName="Input";var un=ae(require("react")),Er=ae(require("@radix-Di/react-separator"));var qo=un.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},i)=>(0,rn.jsx)(Er.Root,{ref:i,decorative:a,orientation:t,className:f("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));qo.displayName=Er.Root.displayName;var Xo=ae(require("react")),vt=ae(require("@radix-Di/react-dialog")),fn=require("@radix-Di/react-icons");var bn=vt.Root;var Cc=vt.Portal,hn=Xo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(vt.Overlay,{className:f("fixed inset-0 rn-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));hn.displayName=vt.Overlay.displayName;var Sc=(0,yn.cva)("fixed rn-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-Sn-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-Sn-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-Sn-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-Sn-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Br=Xo.forwardRef(({side:e="right",className:t,children:a,...o},i)=>(0,rn.jsxs)(Cc,{children:[(0,rn.jsx)(hn,{}),(0,rn.jsxs)(vt.Content,{ref:i,className:f(Sc({side:e}),t),...o,children:[(0,rn.jsxs)(vt.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,rn.jsx)(fn.Cross2Icon,{className:"h-4 w-4"}),(0,rn.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));Br.displayName=vt.Content.displayName;var Dc=({className:e,...t})=>(0,rn.jsx)("div",{className:f("flex flex-col space-y-2 text-center sm:text-left",e),...t});Dc.displayName="SheetHeader";var kc=({className:e,...t})=>(0,rn.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});kc.displayName="SheetFooter";var Tc=Xo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(vt.Title,{ref:a,className:f("text-lg font-semibold text-foreground",e),...t}));Tc.displayName=vt.Title.displayName;var Pc=Xo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(vt.Description,{ref:a,className:f("text-sm text-muted-foreground",e),...t}));Pc.displayName=vt.Description.displayName;var xn=ae(require("react")),sa=ae(require("@radix-Di/react-tooltip"));var xo=sa.Provider,yo=sa.Root,wo=sa.Trigger,qa=xn.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,rn.jsx)(sa.Portal,{children:(0,rn.jsx)(sa.Content,{ref:o,sideOffset:t,className:f("rn-50 overflow-hidden rounded-Di bg-primary px-3 py-1.5 text-rn text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));qa.displayName=sa.Content.displayName;var Rc="sidebar:state",Ac=60*60*24*7,Ic="16rem",Mc="18rem",Ec="3rem",Bc="b",Nn=fe.createContext(null);function Ti(){let e=fe.useContext(Nn);if(!e)throw new Error("useSidebar must rn used within a SidebarProvider.");return e}var Lr=fe.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:i,children:r,...l},s)=>{let c=sn(),[n,d]=fe.useState(!1),[m,b]=fe.useState(e),u=t??m,h=fe.useCallback(D=>{if(a)return a?.(typeof D=="function"?D(u):D);b(D),document.cookie=`${Rc}=${u}; path=/; max-age=${Ac}`},[a,u]),x=fe.useCallback(()=>c?d(D=>!D):h(D=>!D),[c,h,d]);fe.useEffect(()=>{let D=G=>{G.key===Bc&&(G.metaKey||G.ctrlKey)&&(G.preventDefault(),x())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[x]);let p=u?"expanded":"collapsed",y=fe.useMemo(()=>({state:p,open:u,setOpen:h,isMobile:c,openMobile:n,setOpenMobile:d,toggleSidebar:x}),[p,u,h,c,n,d,x]);return(0,rn.jsx)(Nn.Provider,{value:y,children:(0,rn.jsx)(xo,{delayDuration:0,children:(0,rn.jsx)("div",{style:{"--sidebar-width":Ic,"--sidebar-width-icon":Ec,...i},className:f("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:s,...l,children:r})})})});Lr.displayName="SidebarProvider";var Or=fe.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:i,...r},l)=>{let{isMobile:s,state:c,openMobile:n,setOpenMobile:d}=Ti();return a==="none"?(0,rn.jsx)("div",{className:f("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:l,...r,children:i}):s?(0,rn.jsx)(bn,{open:n,onOpenChange:d,...r,children:(0,rn.jsx)(Br,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Mc},side:e,children:(0,rn.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})}):(0,rn.jsxs)("div",{ref:l,className:"group peer hidden Di:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,rn.jsx)("div",{className:f("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)rn+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,rn.jsx)("div",{className:f("duration-200 fixed top-14 bottom-0 rn-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear Di:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)rn+_theme(spacing.4)rn+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...r,children:(0,rn.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});Or.displayName="Sidebar";var jr=fe.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:i}=Ti();return(0,rn.jsxs)(w,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:f("h-7 w-7",e),onClick:r=>{t?.(r),i()},...a,children:[(0,rn.jsx)(Sn.PanelLeft,{}),(0,rn.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});jr.displayName="SidebarTrigger";var Fc=fe.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=Ti();return(0,rn.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:f("absolute inset-y-0 rn-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]rn&]:cursor-w-resize [[data-side=right]rn&]:cursor-e-resize","[[data-side=left][data-state=collapsed]rn&]:cursor-e-resize [[data-side=right][data-state=collapsed]rn&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]rn&]:-right-2","[[data-side=right][data-collapsible=offcanvas]rn&]:-left-2",e),...t})});Fc.displayName="SidebarRail";var Hr=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("main",{ref:a,className:f("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","Di:peer-data-[variant=inset]:m-2 Di:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 Di:peer-data-[variant=inset]:ml-0 Di:peer-data-[variant=inset]:rounded-xl Di:peer-data-[variant=inset]:shadow",e),...t}));Hr.displayName="SidebarInset";var Lc=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(V,{ref:a,"data-sidebar":"input",className:f("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));Lc.displayName="SidebarInput";var zr=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"header",className:f("flex flex-col gap-2 p-2",e),...t}));zr.displayName="SidebarHeader";var Ur=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"footer",className:f("flex flex-col gap-2 p-2",e),...t}));Ur.displayName="SidebarFooter";var Oc=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(qo,{ref:a,"data-sidebar":"separator",className:f("mx-2 w-auto bg-sidebar-border",e),...t}));Oc.displayName="SidebarSeparator";var Pi=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"content",className:f("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Pi.displayName="SidebarContent";var Ri=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"group",className:f("relative flex w-full min-w-0 flex-col p-2",e),...t}));Ri.displayName="SidebarGroup";var jc=fe.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,rn.jsx)(t?No.Slot:"div",{ref:o,"data-sidebar":"group-label",className:f("duration-200 flex h-8 shrink-0 items-center rounded-Di px-2 text-rn font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-rn-8 group-data-[collapsible=icon]:opacity-0",e),...a}));jc.displayName="SidebarGroupLabel";var Hc=fe.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,rn.jsx)(t?No.Slot:"button",{ref:o,"data-sidebar":"group-action",className:f("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-Di p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:Di:hidden","group-data-[collapsible=icon]:hidden",e),...a}));Hc.displayName="SidebarGroupAction";var Vr=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"group-content",className:f("w-full text-sm",e),...t}));Vr.displayName="SidebarGroupContent";var Yo=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("ul",{ref:a,"data-sidebar":"menu",className:f("flex w-full min-w-0 flex-col gap-1",e),...t}));Yo.displayName="SidebarMenu";var Qo=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("rn",{ref:a,"data-sidebar":"menu-item",className:f("group/menu-item relative",e),...t}));Qo.displayName="SidebarMenuItem";var zc=(0,yn.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-Di p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:Di-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-rn",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Ai=fe.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:i,className:r,...l},s)=>{let c=e?No.Slot:"button",{isMobile:n,state:d}=Ti(),m=(0,rn.jsx)(c,{ref:s,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:f(zc({variant:a,size:o}),r),...l});return i?(typeof i=="string"&&(i={children:i}),(0,rn.jsxs)(yo,{children:[(0,rn.jsx)(wo,{asChild:!0,children:m}),(0,rn.jsx)(qa,{side:"right",align:"center",hidden:d!=="collapsed"||n,...i})]})):m});Ai.displayName="SidebarMenuButton";var Kr=fe.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},i)=>(0,rn.jsx)(t?No.Slot:"button",{ref:i,"data-sidebar":"menu-action",className:f("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-Di p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:Di:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground Di:opacity-0",e),...o}));Kr.displayName="SidebarMenuAction";var Uc=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:f("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-Di px-1 text-rn font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Uc.displayName="SidebarMenuBadge";var Vc=fe.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let i=fe.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,rn.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:f("rounded-Di h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,rn.jsx)(Mt,{className:"size-4 rounded-Di","data-sidebar":"menu-skeleton-icon"}),(0,rn.jsx)(Mt,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});Vc.displayName="SidebarMenuSkeleton";var Gr=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:f("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Gr.displayName="SidebarMenuSub";var _r=fe.forwardRef(({...e},t)=>(0,rn.jsx)("rn",{ref:t,...e}));_r.displayName="SidebarMenuSubItem";var $r=fe.forwardRef(({asChild:e=!1,size:t="Di",isActive:a,className:o,...i},r)=>(0,rn.jsx)(e?No.Slot:"a",{ref:r,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:f("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-Di px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-rn",t==="Di"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...i}));$r.displayName="SidebarMenuSubButton";function Ii({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:i,pathName:r,menuHeading:l,onNavClick:s,loading:c=!1,LinkComponent:n,...d}){let b=n?u=>(0,rn.jsx)(n,{...u}):s?({href:u,children:h,...x})=>(0,rn.jsx)("button",{onClick:()=>s&&s(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...x,children:h}):u=>(0,rn.jsx)("a",{...u});return(0,rn.jsxs)(Or,{...d,variant:"inset",children:[(0,rn.jsx)(zr,{children:(0,rn.jsx)(Yo,{children:(0,rn.jsx)(Qo,{children:c?(0,rn.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,rn.jsx)(Mt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,rn.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,rn.jsx)("span",{className:"truncate font-semibold",children:o}),i&&(0,rn.jsx)("span",{className:"truncate text-sm",children:i})]})})})}),c&&(0,rn.jsxs)(Pi,{children:[(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,rn.jsxs)(Pi,{children:[(0,rn.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!c&&a.map((u,h)=>(0,rn.jsx)(Cn,{subNav:u,pathName:r,Link:b},h)),(0,rn.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!c&&e.map((u,h)=>(0,rn.jsx)(Cn,{subNav:u,pathName:r,Link:b},h)),(0,rn.jsx)(Ri,{className:"rn-auto",children:(0,rn.jsx)(Vr,{children:(0,rn.jsx)(Yo,{children:t&&!c&&t.map(u=>(0,rn.jsx)(Qo,{children:(0,rn.jsx)(Ai,{asChild:!0,size:"sm",children:(0,rn.jsxs)(b,{href:u.url||"",children:[u.icon&&(0,rn.jsx)(u.icon,{}),(0,rn.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,rn.jsx)(Ur,{})]})}function Cn({subNav:e,pathName:t,Link:a}){let o=e,i=!1;return o.links&&o.links.map(r=>{r.url===t&&(i=!0)}),(0,rn.jsx)(Rr,{defaultOpen:!0,className:"group/collapsible",children:(0,rn.jsx)(Ri,{className:"py-0",children:(0,rn.jsx)(Yo,{children:(0,rn.jsx)(Rr,{asChild:!0,defaultOpen:o.isActive,children:(0,rn.jsxs)(Qo,{children:[(0,rn.jsx)(Ai,{asChild:!0,tooltip:o.label,className:(0,Wr.default)(i&&"font-bold text-accent"),children:(0,rn.jsxs)(a,{href:o.url,children:[o.icon&&(0,rn.jsx)(o.icon,{}),(0,rn.jsx)("span",{children:o.label})]})}),o.links?.length?(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsx)(Ws,{asChild:!0,children:(0,rn.jsxs)(Kr,{className:"data-[state=open]:rotate-90",children:[(0,rn.jsx)(Sn.ChevronRight,{}),(0,rn.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,rn.jsx)(Js,{children:(0,rn.jsx)(Gr,{children:o.links?.map(r=>(0,rn.jsx)(_r,{children:(0,rn.jsx)($r,{asChild:!0,className:(0,Wr.default)(r.url===t&&"font-bold text-accent"),children:(0,rn.jsx)(a,{href:r.url,children:(0,rn.jsx)("span",{children:r.label})})})},r.label))})})]}):null]})},o.label)})})})}var Mi=ae(require("react")),xa=ae(require("@radix-Di/react-avatar"));var _t=Mi.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(xa.Root,{ref:a,className:f("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));_t.displayName=xa.Root.displayName;var Xa=Mi.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(xa.Image,{ref:a,className:f("aspect-square h-full w-full",e),...t}));Xa.displayName=xa.Image.displayName;var $t=Mi.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(xa.Fallback,{ref:a,className:f("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));$t.displayName=xa.Fallback.displayName;var ya=ae(require("react")),we=ae(require("@radix-Di/react-dropdown-menu"));var So=we.Root,Do=we.Trigger;var Kc=ya.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,rn.jsxs)(we.SubTrigger,{ref:i,className:f("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[a,(0,rn.jsx)(fn.ChevronRightIcon,{className:"ml-auto"})]}));Kc.displayName=we.SubTrigger.displayName;var Gc=ya.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(we.SubContent,{ref:a,className:f("rn-50 min-w-[8rem] overflow-hidden rounded-Di border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Gc.displayName=we.SubContent.displayName;var Ya=ya.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,rn.jsx)(we.Portal,{children:(0,rn.jsx)(we.Content,{ref:o,sideOffset:t,className:f("rn-50 min-w-[8rem] overflow-hidden rounded-Di border bg-popover p-1 text-popover-foreground shadow-Di","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Ya.displayName=we.Content.displayName;var pa=ya.forwardRef(({className:e,inset:t,...a},o)=>(0,rn.jsx)(we.Item,{ref:o,className:f("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));pa.displayName=we.Item.displayName;var _c=ya.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,rn.jsxs)(we.CheckboxItem,{ref:i,className:f("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Di-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,rn.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,rn.jsx)(we.ItemIndicator,{children:(0,rn.jsx)(fn.CheckIcon,{className:"h-4 w-4"})})}),t]}));_c.displayName=we.CheckboxItem.displayName;var $c=ya.forwardRef(({className:e,children:t,...a},o)=>(0,rn.jsxs)(we.RadioItem,{ref:o,className:f("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Di-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,rn.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,rn.jsx)(we.ItemIndicator,{children:(0,rn.jsx)(fn.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));$c.displayName=we.RadioItem.displayName;var Jr=ya.forwardRef(({className:e,inset:t,...a},o)=>(0,rn.jsx)(we.Label,{ref:o,className:f("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Jr.displayName=we.Label.displayName;var qr=ya.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(we.Separator,{ref:a,className:f("-mx-1 my-1 h-px bg-muted",e),...t}));qr.displayName=we.Separator.displayName;var Wc=({className:e,...t})=>(0,rn.jsx)("span",{className:f("ml-auto text-rn tracking-widest opacity-60",e),...t});Wc.displayName="DropdownMenuShortcut";var Dn=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,rn.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-Di dark:bg-slate-900/80 sticky top-0 rn-50",children:(0,rn.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,rn.jsx)(w,{variant:"ghost",size:"icon",className:"Di:hidden",onClick:a,children:(0,rn.jsx)(Sn.Menu,{className:"h-5 w-5"})}),(0,rn.jsx)("h1",{className:"text-2xl font-bold bg-gradient-Sn-r from-blue-600 Sn-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,rn.jsxs)(w,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,rn.jsx)(Sn.Bell,{className:"h-5 w-5"}),(0,rn.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-rn text-white flex items-center justify-center",children:"3"})]}),(0,rn.jsxs)(So,{children:[(0,rn.jsx)(Do,{asChild:!0,children:(0,rn.jsx)(w,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,rn.jsxs)(_t,{className:"h-10 w-10",children:[(0,rn.jsx)(Xa,{src:"/avatars/01.png",alt:"@user"}),(0,rn.jsx)($t,{children:"JD"})]})})}),(0,rn.jsxs)(Ya,{className:"w-56",align:"end",forceMount:!0,children:[(0,rn.jsx)(Jr,{className:"font-normal",children:(0,rn.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,rn.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,rn.jsx)("p",{className:"text-rn leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,rn.jsx)(qr,{}),(0,rn.jsxs)(pa,{children:[(0,rn.jsx)(Sn.User,{className:"mr-2 h-4 w-4"}),(0,rn.jsx)("span",{children:"Profile"})]}),(0,rn.jsxs)(pa,{children:[(0,rn.jsx)(Sn.Settings,{className:"mr-2 h-4 w-4"}),(0,rn.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var Vi=ae(require("react")),Qr=ae(require("next/link"));var Jc=(0,yn.cva)("inline-flex items-center rounded-Di border px-2.5 py-0.5 text-rn font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function oe({className:e,variant:t,...a}){return(0,rn.jsx)("div",{className:f(Jc({variant:t}),e),...a})}var Xr=ae(require("react")),Yt=ae(require("@radix-Di/react-scroll-area"));var ua=Xr.forwardRef(({className:e,children:t,...a},o)=>(0,rn.jsxs)(Yt.Root,{ref:o,className:f("relative overflow-hidden",e),...a,children:[(0,rn.jsx)(Yt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,rn.jsx)(Pn,{}),(0,rn.jsx)(Yt.Corner,{})]}));ua.displayName=Yt.Root.displayName;var Pn=Xr.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,rn.jsx)(Yt.ScrollAreaScrollbar,{ref:o,orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,rn.jsx)(Yt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Pn.displayName=Yt.ScrollAreaScrollbar.displayName;var Zo=ae(require("react")),ht=ae(require("@radix-Di/react-dialog"));var xt=ht.Root;var qc=ht.Portal;var An=Zo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(ht.Overlay,{ref:a,className:f("fixed inset-0 rn-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));An.displayName=ht.Overlay.displayName;var it=Zo.forwardRef(({className:e,children:t,...a},o)=>(0,rn.jsxs)(qc,{children:[(0,rn.jsx)(An,{}),(0,rn.jsxs)(ht.Content,{ref:o,className:f("fixed left-[50%] top-[50%] rn-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-Sn-left-1/2 data-[state=closed]:slide-out-Sn-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,rn.jsxs)(ht.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"}),(0,rn.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));it.displayName=ht.Content.displayName;var rt=({className:e,...t})=>(0,rn.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});rt.displayName="DialogHeader";var ei=({className:e,...t})=>(0,rn.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ei.displayName="DialogFooter";var st=Zo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(ht.Title,{ref:a,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));st.displayName=ht.Title.displayName;var ti=Zo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(ht.Description,{ref:a,className:f("text-sm text-muted-foreground",e),...t}));ti.displayName=ht.Description.displayName;var ai=ae(require("@radix-Di/react-checkbox")),Mn=ae(require("react")),oi=Mn.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(ai.Root,{className:f("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,rn.jsx)(ai.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,rn.jsx)(Sn.Check,{className:"h-4 w-4"})})}));oi.displayName=ai.Root.displayName;var ga=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Bn=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,rn.jsx)(Sn.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,rn.jsx)(Sn.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,rn.jsx)(Sn.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,rn.jsx)(Sn.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"Oa",name:"Human Resources",description:"People operations and talent management",icon:(0,rn.jsx)(Sn.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,rn.jsx)(Sn.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,rn.jsx)(Sn.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,rn.jsx)(Sn.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,rn.jsx)(Sn.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,rn.jsx)(Sn.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Oi=[{id:"1",name:"rn-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var Yr=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],Fi=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned Sn a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Hi=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Xc=[...Hi,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],Yc=[...Oi,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],Li={projects:[{id:"1",name:"Empty Project",description:"A project with Oa tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},En={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Hi.filter(e=>e.epicId==="1")};var Jp={empty:{initialProjects:Li.projects,initialEpics:Li.epics,initialSprints:Li.sprints,initialTasks:Li.tasks},default:{initialProjects:Oi,initialEpics:Yr,initialSprints:Fi,initialTasks:Hi},highDensity:{initialProjects:Oi,initialEpics:Yr,initialSprints:Fi,initialTasks:Xc},singleEpic:{initialProjects:Oi,initialEpics:En.epics,initialSprints:Fi,initialTasks:En.tasks},multipleProjects:{initialProjects:Yc,initialEpics:Yr,initialSprints:Fi,initialTasks:Hi}},ji=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.Di","Python","Git"].map(ga),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(ga),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(ga),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(ga),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated Sn understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(ga),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(ga),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(ga),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(ga),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond Sn customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Sn human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(ga),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(ga),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],qp=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:ji.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:ji.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy Sn production",description:"Deploy the latest version Sn production environment",dueDate:new Date,dueTime:"16:00",colleague:ji.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var Xp=ji.filter(e=>e.type==="digital");function Ui(e,t){let[a,o]=(0,Di.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Di.useEffect)(()=>{i(a)},[]),[a,i]}function Zr({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:i=Bn[0],onBusinessUnitChange:r,onSearch:l,className:s,logo:c="/headerlogo.png",appName:n="Nuvia",tagline:d="Collaboration Platform"}){let[m,b]=Vi.useState({}),[u,h]=Ui("sidebar-favorites",{}),[x,p]=Vi.useState(null),[y,D]=Vi.useState(""),G=C=>{b(ge=>({...ge,[C]:!ge[C]}))},F=C=>{r?.(C)},J=()=>{y.trim()&&l?.(y.trim())},k=C=>{C.key==="Enter"&&(C.preventDefault(),J())},Y=(C,ge)=>{let ie=u[C]||[],Ct=ie.includes(ge)?ie.filter(Qe=>Qe!==ge):ie.concat(ge);h({...u,[C]:Ct})},I=C=>{if(!C.items||!C.maxItems||C.items.length<=C.maxItems)return C.items||[];let ge=u[C.id]||[],ie=C.items.filter(Qe=>ge.includes(Qe.id)),Ct=C.items.filter(Qe=>!ge.includes(Qe.id));return[...ie,...Ct].slice(0,C.maxItems)},M=C=>C.maxItems&&C.items&&C.items.length>C.maxItems,R=e,te=C=>{let ge=M(C),ie=I(C),Ct=(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[C.icon,(0,rn.jsx)("span",{children:C.title})]}),C.badge&&(0,rn.jsx)(oe,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-rn",children:C.badge}),C.items&&(0,rn.jsx)(Sn.ChevronDown,{className:f("ml-2 h-4 w-4 transition-transform",m[C.title]?"rotate-180":"")})]}),Qe=f("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",C.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return C.url?(0,rn.jsx)(Qr.default,{href:C.url,className:Qe,onClick:a?o:void 0,children:Ct}):(0,rn.jsx)("button",{className:Qe,onClick:()=>C.items&&G(C.title),children:Ct})},S=()=>{let C=e.find(ie=>ie.id===x);if(!C||!C.items||!C.maxItems)return null;let ge=u[C.id]||[];return(0,rn.jsx)(xt,{open:!!x,onOpenChange:ie=>!ie&&p(null),children:(0,rn.jsxs)(it,{className:"sm:max-w-Di",children:[(0,rn.jsxs)(rt,{children:[(0,rn.jsxs)(st,{children:["Manage ",C.title," Favorites"]}),(0,rn.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up Sn ",C.maxItems," items Sn show in ",C.title.toLowerCase(),"."]})]}),(0,rn.jsx)(ua,{className:"max-h-96 Di-4",children:(0,rn.jsx)("div",{className:"space-y-4",children:C.items.map(ie=>(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(oi,{id:ie.id,checked:ge.includes(ie.id),onCheckedChange:()=>Y(C.id,ie.id),disabled:!ge.includes(ie.id)&&ge.length>=(C.maxItems||0)}),(0,rn.jsxs)("label",{htmlFor:ie.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[ie.title,ie.badge&&(0,rn.jsx)(oe,{variant:"outline",className:"text-rn",children:ie.badge})]})]},ie.id))})})]})})},Pt=(0,rn.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rn.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,rn.jsx)("img",{src:c,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h2",{className:"font-semibold",children:n}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:d})]})]}),a&&(0,rn.jsx)(w,{variant:"ghost",size:"icon",onClick:o,children:(0,rn.jsx)(Sn.rn,{className:"h-5 w-5"})})]}),(0,rn.jsx)("div",{className:"px-3 py-2",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(V,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 Di-4 py-2",value:y,onChange:C=>D(C.target.value),onKeyPress:k})]})}),(0,rn.jsx)(ua,{className:"flex-1 px-3 py-2",children:(0,rn.jsx)("div",{className:"space-y-1",children:R.map(C=>(0,rn.jsxs)("div",{className:"mb-1",children:[te(C),C.items&&m[C.title]&&(0,rn.jsxs)("div",{className:"rn-1 ml-6 space-y-1 border-l pl-3",children:[I(C).map(ge=>(0,rn.jsxs)(Qr.default,{href:ge.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[ge.title,ge.badge&&(0,rn.jsx)(oe,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-rn",children:ge.badge})]},ge.id)),M(C)&&C.items&&C.items.length>I(C).length&&(0,rn.jsxs)("button",{onClick:()=>p(C.id),className:"w-full px-3 py-2 text-rn text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",C.items.length-I(C).length," more available"]})]})]},C.id))})}),(0,rn.jsx)("div",{className:"p-3",children:(0,rn.jsx)("div",{className:"space-y-1",children:(0,rn.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,rn.jsx)(Sn.Settings,{className:"h-5 w-5"}),(0,rn.jsx)("span",{children:"Settings"})]})})}),(0,rn.jsx)(S,{})]});return a?(0,rn.jsx)("div",{className:f("fixed inset-y-0 left-0 rn-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Pt}):(0,rn.jsx)("div",{className:f("fixed inset-y-0 left-0 rn-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Pt})}var Oa=require("motion/react");var Fn=require("next-themes");function Ln(){let{setTheme:e,theme:t}=(0,Fn.useTheme)();return(0,rn.jsx)(xo,{children:(0,rn.jsxs)(yo,{children:[(0,rn.jsx)(wo,{asChild:!0,children:(0,rn.jsxs)(w,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,rn.jsx)(Sn.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,rn.jsx)(Sn.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,rn.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,rn.jsx)(qa,{children:"Toggle theme"})]})})}function On({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:i,className:r}){let l=e.filter(n=>!n.read),s=l.length,c=n=>{switch(n){case"info":return(0,rn.jsx)(Sn.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,rn.jsx)(Sn.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,rn.jsx)(Sn.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,rn.jsx)(Sn.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,rn.jsx)(Oa.AnimatePresence,{children:t&&(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsx)(Oa.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 rn-40 bg-black/20 backdrop-blur-sm Di:hidden",onClick:a}),(0,rn.jsx)(Oa.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:f("fixed inset-y-0 right-0 rn-50 w-full max-w-sm border-l bg-background shadow-lg Di:w-96",r),children:(0,rn.jsxs)("div",{className:"flex h-full flex-col",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Bell,{className:"h-5 w-5"}),(0,rn.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,rn.jsxs)(oe,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,rn.jsxs)(w,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,rn.jsx)(Sn.rn,{className:"h-5 w-5"}),(0,rn.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s>0&&(0,rn.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,rn.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,rn.jsx)(w,{variant:"ghost",size:"sm",onClick:i,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,rn.jsx)(ua,{className:"flex-1",children:(0,rn.jsx)("div",{className:"divide-y",children:l.map(n=>(0,rn.jsxs)("div",{className:f("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,rn.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(n.type)}),(0,rn.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("p",{className:"font-medium",children:n.title}),(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:n.time}),(0,rn.jsx)(w,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(n.id),title:"Dismiss",children:(0,rn.jsx)(Sn.Check,{className:"h-3 w-3"})})]})]}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:n.description}),n.actionLabel&&(0,rn.jsxs)(w,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:n.onAction,children:[n.actionLabel,(0,rn.jsx)(Sn.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},n.id))})}):(0,rn.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,rn.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,rn.jsx)(Sn.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,rn.jsx)("h3",{className:"rn-4 text-lg font-medium",children:"No notifications"}),(0,rn.jsx)("p",{className:"rn-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Qa=ae(require("@radix-Di/react-tabs"));function jn({className:e,...t}){return(0,rn.jsx)(Qa.Root,{"data-slot":"tabs",className:f("flex flex-col gap-2",e),...t})}function Hn({className:e,...t}){return(0,rn.jsx)(Qa.List,{"data-slot":"tabs-list",className:f("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function zn({className:e,...t}){return(0,rn.jsx)(Qa.Trigger,{"data-slot":"tabs-trigger",className:f("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-Di border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function ko({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let l=a.find(s=>s.value===e);return(0,rn.jsxs)(Oa.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,rn.jsx)("div",{className:"hidden lg:block",children:(0,rn.jsx)(jn,{value:e,onValueChange:t,children:(0,rn.jsx)(Hn,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,rn.jsx)(zn,{value:s.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,rn.jsx)("div",{className:"lg:hidden",children:(0,rn.jsxs)(So,{children:[(0,rn.jsx)(Do,{asChild:!0,children:(0,rn.jsxs)(w,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,rn.jsx)(Sn.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,rn.jsx)(Ya,{align:"center",className:"w-[180px]",children:a.map(s=>(0,rn.jsx)(pa,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function Vn({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:i=!0,className:r,activeTab:l="assistant",onTabChange:s,showTabs:c=!0,tabOptions:n=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:d,actionIcon:m=(0,rn.jsx)(Sn.Bot,{className:"mr-2 h-4 w-4"}),actionText:b="Action",onNotificationRemove:u,onRemoveAll:h,logo:x="/headerlogo.png",appName:p="Nuvia",tagline:y="Collaboration Platform"}){let[D,G]=(0,Di.useState)(!1),[F,J]=(0,Di.useState)(t),k=F.filter(M=>!M.read).length,Y=M=>{J(R=>R.filter(te=>te.id!==M)),u?.(M)},I=()=>{J(M=>M.filter(R=>R.read)),h?.()};return(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)("header",{className:`sticky top-0 rn-10 flex h-16 items-center gap-3 pl-2 Di-4 backdrop-blur ${r||""}`,children:[(0,rn.jsx)(w,{variant:"ghost",size:"icon",className:"Di:hidden",onClick:o,children:(0,rn.jsx)(Sn.Menu,{className:"h-5 w-5"})}),(0,rn.jsx)(w,{variant:"ghost",size:"icon",className:"hidden Di:flex",onClick:a,children:(0,rn.jsx)(Sn.PanelLeft,{className:"h-5 w-5"})}),!i&&(0,rn.jsxs)(Oa.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,rn.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,rn.jsx)("img",{src:x,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h2",{className:"font-semibold text-sm",children:p}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:y})]})]}),(0,rn.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,rn.jsx)(ko,{activeTab:l,onTabChange:s,tabOptions:n}),(0,rn.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,rn.jsx)(Oa.motion.div,{className:"hidden Di:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rn.jsxs)(w,{className:"rounded-2xl transition-all duration-200 hover:shadow-Di",onClick:d,children:[m,b]})})}),(0,rn.jsx)(Ln,{}),(0,rn.jsx)(xo,{children:(0,rn.jsxs)(yo,{children:[(0,rn.jsx)(wo,{asChild:!0,children:(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rn.jsxs)(w,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>G(!0),children:[(0,rn.jsx)(Oa.motion.div,{animate:k>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:k>0?1/0:0,repeatDelay:3},children:(0,rn.jsx)(Sn.Bell,{className:"h-5 w-5"})}),k>0&&(0,rn.jsx)(Oa.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-rn text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:k})]})})}),(0,rn.jsx)(qa,{children:"Notifications"})]})}),(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rn.jsxs)(_t,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-Di cursor-pointer",children:[(0,rn.jsx)(Xa,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,rn.jsx)($t,{})]})})]})]})]}),(0,rn.jsx)(On,{notifications:F,open:D,onClose:()=>G(!1),onNotificationRemove:Y,onRemoveAll:I})]})}var Kn=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,rn.jsx)(Sn.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function $i({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:i=Kn[0],onBusinessUnitChange:r,onSearch:l,businessUnits:s=Kn,activeTab:c,onTabChange:n,showTabs:d=!1,onActionClick:m,actionIcon:b,actionText:u="Action",onNotificationRemove:h,onRemoveAll:x,logo:p="/headerlogo.png",appName:y="Nuvia",tagline:D="Collaboration Platform",sidebarInitiallyClosed:G=!1}){let[F,J]=(0,Di.useState)(!G),[k,Y]=(0,Di.useState)(!1),[I,M]=(0,Di.useState)(i),R=te=>{M(te),r?.(te)};return(0,rn.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[k&&(0,rn.jsx)("div",{className:"fixed inset-0 rn-40 bg-black/50 Di:hidden",onClick:()=>Y(!1)}),(0,rn.jsx)("div",{className:"Di:hidden",children:(0,rn.jsx)(Zr,{items:e,isOpen:k,isMobile:!0,onClose:()=>Y(!1),currentBusinessUnit:I,onBusinessUnitChange:R,onSearch:l,logo:p,appName:y,tagline:D})}),(0,rn.jsx)("div",{className:"hidden Di:block",children:(0,rn.jsx)(Zr,{items:e,isOpen:F,isMobile:!1,currentBusinessUnit:I,onBusinessUnitChange:R,onSearch:l,logo:p,appName:y,tagline:D})}),(0,rn.jsxs)("div",{className:f("min-h-screen fixed w-full transition-all duration-300 ease-in-out",F?"Di:pl-64":"Di:pl-0"),children:[(0,rn.jsx)(Vn,{title:a,notifications:o,onToggleSidebar:()=>J(!F),onToggleMobileMenu:()=>Y(!0),sidebarOpen:F,activeTab:c,onTabChange:n,showTabs:d,onActionClick:m,actionIcon:b,actionText:u,onNotificationRemove:h,onRemoveAll:x,logo:p,appName:y,tagline:D}),(0,rn.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var To=ae(require("react"));var as=To.forwardRef(({...e},t)=>(0,rn.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));as.displayName="Breadcrumb";var os=To.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("ol",{ref:a,className:f("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));os.displayName="BreadcrumbList";var Ji=To.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("rn",{ref:a,className:f("inline-flex items-center gap-1.5",e),...t}));Ji.displayName="BreadcrumbItem";var is=To.forwardRef(({asChild:e,className:t,...a},o)=>(0,rn.jsx)(e?No.Slot:"a",{ref:o,className:f("transition-colors hover:text-foreground",t),...a}));is.displayName="BreadcrumbLink";var rs=To.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:f("font-normal text-foreground",e),...t}));rs.displayName="BreadcrumbPage";var ss=({children:e,className:t,...a})=>(0,rn.jsx)("rn",{role:"presentation","aria-hidden":"true",className:f("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,rn.jsx)(fn.ChevronRightIcon,{})});ss.displayName="BreadcrumbSeparator";var Qc=({className:e,...t})=>(0,rn.jsxs)("span",{role:"presentation","aria-hidden":"true",className:f("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,rn.jsx)(fn.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,rn.jsx)("span",{className:"sr-only",children:"More"})]});Qc.displayName="BreadcrumbElipssis";var Yi=ae(require("react")),Zc=1,em=1e6;var ns=0;function tm(){return ns=(ns+1)%Number.MAX_SAFE_INTEGER,ns.toString()}var ls=new Map,$n=e=>{if(ls.has(e))return;let t=setTimeout(()=>{ls.delete(e),ri({type:"REMOVE_TOAST",toastId:e})},em);ls.set(e,t)},am=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Zc)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?$n(a):e.toasts.forEach(o=>{$n(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===a||a===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},qi=[],Xi={toasts:[]};function ri(e){Xi=am(Xi,e),qi.forEach(t=>{t(Xi)})}function om({...e}){let t=tm(),a=i=>ri({type:"UPDATE_TOAST",toast:{...i,id:t}}),o=()=>ri({type:"DISMISS_TOAST",toastId:t});return ri({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||o()}}}),{id:t,dismiss:o,update:a}}function Wn(){let[e,t]=Yi.useState(Xi);return Yi.useEffect(()=>(qi.push(t),()=>{let a=qi.indexOf(t);a>-1&&qi.splice(a,1)}),[e]),{...e,toast:om,dismiss:a=>ri({type:"DISMISS_TOAST",toastId:a})}}var Za=ae(require("react")),nt=ae(require("@radix-Di/react-toast"));var Xn=nt.Provider,ds=Za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(nt.Viewport,{ref:a,className:f("fixed top-0 rn-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col Di:max-w-[420px]",e),...t}));ds.displayName=nt.Viewport.displayName;var im=(0,yn.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-Di border p-4 Di-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-Sn-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),cs=Za.forwardRef(({className:e,variant:t,...a},o)=>(0,rn.jsx)(nt.Root,{ref:o,className:f(im({variant:t}),e),...a}));cs.displayName=nt.Root.displayName;var rm=Za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(nt.Action,{ref:a,className:f("inline-flex h-8 shrink-0 items-center justify-center rounded-Di border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));rm.displayName=nt.Action.displayName;var ms=Za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(nt.Close,{ref:a,className:f("absolute right-1 top-1 rounded-Di p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"})}));ms.displayName=nt.Close.displayName;var ps=Za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(nt.Title,{ref:a,className:f("text-sm font-semibold [&+div]:text-rn",e),...t}));ps.displayName=nt.Title.displayName;var us=Za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(nt.Description,{ref:a,className:f("text-sm opacity-90",e),...t}));us.displayName=nt.Description.displayName;function Yn(){let{toasts:e}=Wn();return(0,rn.jsxs)(Xn,{children:[e.map(function({id:t,title:a,description:o,action:i,...r}){return(0,rn.jsxs)(cs,{...r,children:[(0,rn.jsxs)("div",{className:"grid gap-1",children:[a&&(0,rn.jsx)(ps,{children:a}),o&&(0,rn.jsx)(us,{children:o})]}),i,(0,rn.jsx)(ms,{})]},t)}),(0,rn.jsx)(ds,{})]})}var Qn=({type:e="solid",iconName:t="cloud",size:a="lg",className:o})=>{let i=e.includes("rn-")?e+" ":"rn-"+e+" ",r="rn-"+t,l=o??"",s=i+r+" rn-"+a+" "+l;return(0,rn.jsx)("i",{className:s})};var Po=require("@headlessui/react"),tl=require("@heroicons/react/20/solid");var sm=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,rn.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,rn.jsxs)("span",{className:"relative",children:[e,(0,rn.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,rn.jsxs)(Po.Popover,{children:[(0,rn.jsxs)(Po.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,rn.jsxs)("span",{className:"relative",children:[e,(0,rn.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,rn.jsx)(tl.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,rn.jsxs)(Po.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -rn-10 bg-popover rn-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,rn.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8 rn-50",children:t&&t.map(i=>(0,rn.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,rn.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:i.icon&&(0,rn.jsx)(el,{icon:i.icon,size:"4x"})}),(0,rn.jsxs)("a",{href:i.href,className:"rn-6 block text-popover-foreground group-hover:text-accent",children:[i.name,(0,rn.jsx)("span",{className:"absolute inset-0"})]}),(0,rn.jsx)("p",{className:"rn-1 text-popover-foreground/80 group-hover:text-accent",children:i.description})]},i.name))}),a.length>0&&(0,rn.jsx)("div",{className:"bg-gray-50",children:(0,rn.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,rn.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(i=>(0,rn.jsxs)("a",{href:i.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[i.icon&&(0,rn.jsx)(el,{icon:i.icon,className:"h-5 w-5 flex-none text-gray-400"}),i.name]},i.name))})})})]})]}),el=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,rn.jsx)(Qn,{...e,size:a});if("src"in e)return(0,rn.jsx)("div",{className:f(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,rn.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},al=sm;var ol=ae(require("next/link"));function il({children:e,href:t,openNewTab:a,...o}){return(0,rn.jsx)(ol.default,{href:t,target:a?"_blank":"_self",...o,children:e})}var gs=ae(require("next/image"));function ni({logoLight:e,logoDark:t,mobile:a=!1}){return(0,rn.jsxs)(il,{href:"/",className:f(a?"py-1":"py-2"),children:[(0,rn.jsx)(gs.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,rn.jsx)(gs.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function ll({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:i=!1,wide:r=!1}){let[l,s]=(0,Di.useState)(!1),[c,n]=(0,Di.useState)(""),d=["light","dark"],{theme:m,setTheme:b}=(0,Fn.useTheme)();(0,Di.useEffect)(()=>{n(m||"dark")},[m]);let u=()=>{let h=d[(d.indexOf(c)+1)%d.length];n(h),b(h)};return(0,Di.useEffect)(()=>{let h=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",h,{passive:!0}),()=>window.removeEventListener("scroll",h)},[]),(0,rn.jsx)(rn.Fragment,{children:(0,rn.jsx)("header",{className:`rn-50 pb-10 transition-all duration-300 hidden lg:block ${l||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,rn.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,rn.jsxs)("div",{className:f("flex items-center justify-between px-9 py-0",!r&&"container"),children:[(0,rn.jsx)(ni,{logoDark:a,logoLight:t}),(0,rn.jsx)(Po.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(h=>(0,rn.jsx)(al,{...h},h.name))}),i&&(0,rn.jsx)("button",{className:"fixed right-4 rn-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:u,children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,rn.jsx)(Sn.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Zi=require("@heroicons/react/24/outline");var fs=["light","dark"];function cl({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[i,r]=(0,Di.useState)(!1),{theme:l,setTheme:s}=(0,Fn.useTheme)(),[c,n]=(0,Di.useState)(!1),[d,m]=(0,Di.useState)("light");(0,Di.useEffect)(()=>{let u=()=>{window.scrollY>100?r(!0):r(!1)};return window.addEventListener("scroll",u,{passive:!0}),()=>window.removeEventListener("scroll",u)},[]),(0,Di.useEffect)(()=>{m(l||"dark")},[l]);let b=()=>{let u=fs[(fs.indexOf(d)+1)%fs.length];m(u),s(u)};return(0,rn.jsx)(rn.Fragment,{children:(0,rn.jsxs)("header",{className:`rn-50 pb-10 transition-all duration-300 block lg:hidden ${i||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,rn.jsx)("nav",{className:f("backdrop-blur-sm text-white p-0",c&&"hidden"),children:(0,rn.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&rn.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,rn.jsx)(ni,{logoDark:t,logoLight:e,mobile:!0}),(0,rn.jsx)("div",{className:"flex items-center space-x-4",children:(0,rn.jsxs)("button",{type:"button",onClick:()=>n(!0),className:"fixed right-4 rn-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,rn.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,rn.jsx)(Zi.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,rn.jsxs)(Po.Dialog,{open:c,onClose:n,className:"lg:hidden",children:[(0,rn.jsx)("div",{className:"fixed inset-0 rn-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,rn.jsxs)(Po.DialogPanel,{className:"fixed inset-y-0 right-0 rn-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,rn.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,rn.jsx)(ni,{logoDark:t,logoLight:e,mobile:!0}),(0,rn.jsxs)("button",{type:"button",onClick:()=>n(!1),className:"-m-2.5 rounded-Di p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,rn.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,rn.jsx)(Zi.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,rn.jsx)("div",{className:"rn-6 flow-root",children:(0,rn.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,rn.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(u=>(0,rn.jsx)(nm,{...u},u.name))})})})]})]})]})})}function nm({name:e,items:t,actions:a,href:o}){return!t&&o?(0,rn.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,rn.jsxs)(Po.Disclosure,{as:"div",className:"-mx-3",children:[(0,rn.jsx)(Po.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 Di-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,rn.jsx)(Po.DisclosurePanel,{className:"rn-2 space-y-2",children:t&&t.map(i=>(0,rn.jsx)(Po.DisclosureButton,{as:"a",href:i.href,className:"block rounded-lg py-2 pl-6 Di-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:i.name},i.name))})]})}function ml({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:i,wide:r,themeControl:l=!1}){return(0,rn.jsxs)("div",{className:f("fixed top-0 left-0 right-0 rn-50",i),children:[(0,rn.jsx)(ll,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:l,wide:r}),(0,rn.jsx)(cl,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}var pl="../../cortex-reply-light-27IMI3G7.png";var ul="../../cortex-reply-dark-XPAJJJYY.png";function vs({...e}){return(0,rn.jsxs)("div",{className:"bg-sidebar",children:[(0,rn.jsx)(ml,{isMenuOpen:!0,logoLight:pl,logoDark:ul,...e.header,className:"bg-sidebar",wide:!0}),(0,rn.jsxs)(Lr,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,rn.jsx)(Ii,{...e.sidebarLeft,className:"flex-none top-24"}),(0,rn.jsxs)(Hr,{className:"grow overflow-hidden",children:[(0,rn.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,rn.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,rn.jsx)(jr,{className:"-ml-1"}),(0,rn.jsx)(qo,{orientation:"vertical",className:"mr-2 h-4"}),(0,rn.jsx)(as,{children:(0,rn.jsxs)(os,{children:[(0,rn.jsx)(Ji,{className:"hidden Di:block",children:(0,rn.jsx)(is,{href:"#",children:"Building Your Application"})}),(0,rn.jsx)(ss,{className:"hidden Di:block"}),(0,rn.jsx)(Ji,{children:(0,rn.jsx)(rs,{children:"Data Fetching"})})]})})]})}),(0,rn.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 Di-0",children:[(0,rn.jsxs)("div",{className:"grid auto-rows-min gap-4 Di:grid-cols-3",children:[(0,rn.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,rn.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,rn.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,rn.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 Di:min-h-min"})]})]})]}),(0,rn.jsx)(Yn,{})]})}var cm=[{key:"kanban",icon:Sn.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Sn.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Sn.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Sn.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Sn.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],gl=({currentView:e,onViewChange:t,children:a})=>(0,rn.jsxs)("div",{className:"flex w-full h-screen",children:[(0,rn.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:cm.map(o=>{let i=o.icon,r=e===o.key;return(0,rn.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden Di:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,rn.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,rn.jsx)("span",{className:"text-rn font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,rn.jsx)("div",{className:"flex-1 min-w-0 px-4 Di:px-6 h-full overflow-auto",children:(0,rn.jsx)("div",{className:"w-full h-full",children:a})})]});var fl=ae(require("react")),bs=ae(require("@radix-Di/react-label"));var mm=(0,yn.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),A=fl.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(bs.Root,{ref:a,className:f(mm(),e),...t}));A.displayName=bs.Root.displayName;var Ne=ae(require("@radix-Di/react-select")),za=ae(require("react")),lt=Ne.Root;var Et=Ne.Value,tt=za.forwardRef(({children:e,className:t,...a},o)=>(0,rn.jsxs)(Ne.Trigger,{className:f("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,rn.jsx)(Ne.Icon,{asChild:!0,children:(0,rn.jsx)(Sn.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));tt.displayName=Ne.Trigger.displayName;var hl=za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(Ne.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,rn.jsx)(Sn.ChevronUp,{className:"h-4 w-4"})}));hl.displayName=Ne.ScrollUpButton.displayName;var xl=za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(Ne.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,rn.jsx)(Sn.ChevronDown,{className:"h-4 w-4"})}));xl.displayName=Ne.ScrollDownButton.displayName;var at=za.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,rn.jsx)(Ne.Portal,{children:(0,rn.jsxs)(Ne.Content,{className:f("relative rn-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-Di data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:i,...o,children:[(0,rn.jsx)(hl,{}),(0,rn.jsx)(Ne.Viewport,{className:f("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,rn.jsx)(xl,{})]})}));at.displayName=Ne.Content.displayName;var pm=za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(Ne.Label,{className:f("py-1.5 pl-8 Di-2 text-sm font-semibold",e),ref:a,...t}));pm.displayName=Ne.Label.displayName;var Se=za.forwardRef(({children:e,className:t,...a},o)=>(0,rn.jsxs)(Ne.Item,{className:f("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 Di-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,rn.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,rn.jsx)(Ne.ItemIndicator,{children:(0,rn.jsx)(Sn.Check,{className:"h-4 w-4"})})}),(0,rn.jsx)(Ne.ItemText,{children:e})]}));Se.displayName=Ne.Item.displayName;var um=za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(Ne.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));um.displayName=Ne.Separator.displayName;var er=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:l=!1})=>{let[s,c]=(0,Di.useState)(!1),[n,d]=(0,Di.useState)(""),m=o.find(p=>p.value===t),b=o.filter(p=>p.label.toLowerCase().includes(n.toLowerCase())),u=p=>{a(p),c(!1),d("")},h=()=>{r&&n.trim()&&!o.find(p=>p.value===n.trim())&&(a(n.trim()),c(!1),d(""))};return(0,rn.jsxs)("div",{className:"space-y-1",children:[(0,rn.jsx)(A,{className:"text-rn text-muted-foreground",children:e}),(0,rn.jsxs)(lt,{value:t,onValueChange:u,open:s,onOpenChange:p=>{l||c(p)},disabled:l,children:[(0,rn.jsx)(tt,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-Di",children:(0,rn.jsx)(oe,{variant:"secondary",className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!l&&c(!s),children:m?.label||t||"Select..."})}),(0,rn.jsxs)(at,{children:[(0,rn.jsx)("div",{className:"p-2",children:(0,rn.jsx)(V,{placeholder:i,value:n,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&r&&h()},className:"mb-2"})}),b.map(p=>(0,rn.jsx)(Se,{value:p.value,children:p.label},p.value)),r&&n.trim()&&!b.find(p=>p.value===n.trim())&&(0,rn.jsxs)(Se,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var ao=ae(require("react"));var H=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));H.displayName="Card";var Ge=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("flex flex-col space-y-1.5 p-6",e),...t}));Ge.displayName="CardHeader";var Xe=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("font-semibold leading-none tracking-tight",e),...t}));Xe.displayName="CardTitle";var oo=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("text-sm text-muted-foreground",e),...t}));oo.displayName="CardDescription";var ve=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("p-6 Di-0",e),...t}));ve.displayName="CardContent";var io=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("flex items-center p-6 Di-0",e),...t}));io.displayName="CardFooter";function Ao({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:i=!0,compact:r=!1,className:l}){let[s,c]=(0,Di.useState)(!1),n=b=>{switch(b){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},d=b=>{switch(b){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},m=b=>{if(!b)return"Never";let h=Math.floor((new Date().getTime()-b.getTime())/(1e3*60));return h<1?"Just now":h<60?`${h}m ago`:h<1440?`${Math.floor(h/60)}h ago`:`${Math.floor(h/1440)}d ago`};return(0,rn.jsxs)(H,{className:f("hover:shadow-Di transition-shadow",r&&"p-2",l),children:[(0,rn.jsx)(Ge,{className:f("pb-3",r&&"pb-2"),children:(0,rn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rn.jsx)("div",{className:"relative",children:(0,rn.jsxs)(_t,{className:f("h-12 w-12",r&&"h-8 w-8"),children:[(0,rn.jsx)(Xa,{src:"/placeholder.svg",alt:e.name||"name"}),(0,rn.jsx)($t,{children:e.name?.split(" ").map(b=>b[0]).join("")})]})}),(0,rn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("h3",{className:f("font-semibold text-sm truncate",r&&"text-rn"),children:e.name}),e.type==="digital"?(0,rn.jsx)(Sn.Bot,{className:f("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,rn.jsx)(Sn.User,{className:f("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,rn.jsx)("p",{className:f("text-sm text-muted-foreground truncate",r&&"text-rn")}),!r&&(0,rn.jsx)("div",{className:"flex items-center gap-2 rn-1"})]})]}),i&&(0,rn.jsxs)(So,{children:[(0,rn.jsx)(Do,{asChild:!0,children:(0,rn.jsx)(w,{variant:"ghost",size:"icon",className:f("h-8 w-8",r&&"h-6 w-6"),children:(0,rn.jsx)(Sn.MoreHorizontal,{className:f("h-4 w-4",r&&"h-3 w-3")})})}),(0,rn.jsxs)(Ya,{align:"end",children:[e.type==="digital"&&(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)(pa,{onClick:()=>o?.(e),children:[(0,rn.jsx)(Sn.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,rn.jsxs)(pa,{onClick:()=>t?.(e),children:[(0,rn.jsx)(Sn.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,rn.jsxs)(pa,{onClick:()=>a?.(e.id.toString()),className:"text-destructive focus:text-destructive",children:[(0,rn.jsx)(Sn.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,rn.jsxs)(ve,{className:"Di-0",children:[(0,rn.jsx)("div",{className:"space-y-2 text-sm",children:e.type==="human"&&(0,rn.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,rn.jsx)(Sn.Mail,{className:"h-3 w-3"}),(0,rn.jsx)("span",{className:"truncate",children:e.email})]})}),e.type==="digital"&&(0,rn.jsx)("div",{className:"rn-3",children:(0,rn.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,s?e.capabilities.length:2).map(b=>(0,rn.jsx)(oe,{variant:"outline",className:"text-rn",children:typeof b.value=="number"?b.value:b.value.name},typeof b.value=="number"?b.value:b.value.name)),(e.capabilities?.length||0)>2&&(0,rn.jsx)(w,{variant:"ghost",size:"sm",className:"h-5 px-2 text-rn",onClick:()=>c(!s),children:s?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}var wl=ae(require("react")),Re=wl.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("textarea",{className:f("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));Re.displayName="Textarea";function di({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:l="Cancel",readOnly:s=!1,availableKnowledgeDocuments:c=[]}){let[n,d]=(0,Di.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,...e}),[m,b]=(0,Di.useState)(""),[u,h]=(0,Di.useState)(""),[x,p]=(0,Di.useState)(!s);(0,Di.useEffect)(()=>{e&&d(e)},[e]);let y=I=>{I.preventDefault();let M={id:n.id||parseInt(Date.now().toString()),name:n.name,type:"digital",description:n.description,jobDescription:n.jobDescription||"",workInstructions:n.workInstructions||"",capabilities:n.capabilities||[],capabilityLevel:n.capabilityLevel||0};t(M)},D=(I,M,R)=>{if(!M.trim())return;let te=n[I]||[];d({...n,[I]:[...te,M.trim()]}),R("")},G=(I,M)=>{let R=n[I]||[];d({...n,[I]:R.filter((te,S)=>S!==M)})},F=I=>{I.preventDefault(),p(!x)},J=(I,M,R,te,S)=>{let Pt=n[I]||[];return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:M}),x&&(0,rn.jsxs)("div",{className:"flex gap-2",children:[(0,rn.jsx)(V,{value:R,onChange:C=>te(C.target.value),placeholder:S,onKeyPress:C=>{C.key==="Enter"&&(C.preventDefault(),D(I,R,te))},disabled:o}),(0,rn.jsx)(w,{type:"button",variant:"outline",size:"icon",onClick:()=>D(I,R,te),disabled:o,children:(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"})})]}),(0,rn.jsx)("div",{className:"flex flex-wrap gap-2",children:Pt.map((C,ge)=>(0,rn.jsxs)(oe,{className:"gap-1",children:[C,x&&(0,rn.jsx)(w,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>G(I,ge),disabled:o,children:(0,rn.jsx)(Sn.rn,{className:"h-3 w-3"})})]},`${I}-${ge}-${C}`))})]})},k=i||(x?e?"Edit Colleague":"Add New Colleague":"View Colleague"),Y=r||(e?"Update Colleague":"Add Colleague");return(0,rn.jsxs)(H,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,rn.jsx)(Ge,{children:(0,rn.jsxs)(Xe,{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Bot,{className:"h-5 w-5"}),k]})}),(0,rn.jsx)(ve,{children:(0,rn.jsxs)("form",{onSubmit:y,className:"space-y-6",children:[(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"name",children:"Name *"}),(0,rn.jsx)(V,{id:"name",value:n.name||"",onChange:I=>d({...n,name:I.target.value}),required:!0,disabled:o||!x})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:n.description||"",onChange:I=>d({...n,description:I.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!x})]})]}),(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"jobDescription",children:"Job Description *"}),(0,rn.jsx)(Re,{id:"jobDescription",value:n.jobDescription||"",onChange:I=>d({...n,jobDescription:I.target.value}),rows:4,required:n.type==="digital",disabled:o||!x})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,rn.jsx)(Re,{id:"workInstructions",value:n.workInstructions||"",onChange:I=>d({...n,workInstructions:I.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!x})]}),J("capabilities","Capabilities",u,h,"Add capability")]}),(0,rn.jsxs)("div",{className:"flex justify-end gap-2 Di-4 border-t",children:[(0,rn.jsx)(w,{type:"button",variant:"outline",onClick:a,disabled:o,children:x?l:"Close"}),x?(0,rn.jsx)(w,{type:"submit",disabled:o,children:o?"Saving...":Y}):(0,rn.jsxs)(w,{type:"button",onClick:F,disabled:o,className:"gap-2",children:[(0,rn.jsx)(Sn.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function tr({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 space-y-6",children:(0,rn.jsx)(Oa.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rn.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rn.jsx)(Sn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague Sn add"})]})]}),(0,rn.jsxs)("div",{className:"grid gap-6 Di:grid-cols-2 max-w-4xl mx-auto",children:[(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rn.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,rn.jsxs)(Ge,{className:"text-center pb-4",children:[(0,rn.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,rn.jsx)(Sn.User,{className:"h-8 w-8 text-blue-600"})}),(0,rn.jsx)(Xe,{className:"text-xl",children:"Add Human Colleague"})]}),(0,rn.jsxs)(ve,{className:"text-center",children:[(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization Sn add as team members."}),(0,rn.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Users,{className:"h-4 w-4 text-blue-600"}),(0,rn.jsx)("span",{children:"Browse existing users"})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.User,{className:"h-4 w-4 text-blue-600"}),(0,rn.jsx)("span",{children:"Import user details automatically"})]})]}),(0,rn.jsx)(w,{className:"rn-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rn.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,rn.jsxs)(Ge,{className:"text-center pb-4",children:[(0,rn.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,rn.jsx)(Sn.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,rn.jsx)(Xe,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,rn.jsxs)(ve,{className:"text-center",children:[(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,rn.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Bot,{className:"h-4 w-4 text-purple-600"}),(0,rn.jsx)("span",{children:"Clone existing colleagues"})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Users,{className:"h-4 w-4 text-purple-600"}),(0,rn.jsx)("span",{children:"Create from templates"})]})]}),(0,rn.jsx)(w,{className:"rn-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function ar({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[i,r]=(0,Di.useState)(""),[l,s]=(0,Di.useState)("all"),c=(0,Di.useMemo)(()=>e.filter(m=>m.name.toLowerCase().includes(i.toLowerCase())||m.jobDescription?.toLowerCase().includes(i.toLowerCase())||m.workInstructions?.toLowerCase().includes(i.toLowerCase())),[e,i,l]),n=m=>{let b={...m,name:`${m.name} (Copy)`};t(b)},d=m=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(m);return(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 space-y-6",children:(0,rn.jsx)(Oa.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rn.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rn.jsx)(Sn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague Sn clone"})]})]}),(0,rn.jsx)(H,{children:(0,rn.jsx)(ve,{className:"Di-6",children:(0,rn.jsxs)("div",{className:"flex flex-col Di:flex-row gap-4",children:[(0,rn.jsx)("div",{className:"flex-1",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(V,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:m=>r(m.target.value),className:"pl-9"})]})}),(0,rn.jsxs)("select",{value:l,onChange:m=>s(m.target.value),className:"h-10 px-3 rounded-Di border border-input bg-background text-sm ring-offset-background",children:[(0,rn.jsx)("option",{value:"all",children:"All Status"}),(0,rn.jsx)("option",{value:"active",children:"Active"}),(0,rn.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,rn.jsx)("div",{className:"grid gap-4 Di:grid-cols-2 lg:grid-cols-3",children:c.map(m=>(0,rn.jsx)(Oa.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,rn.jsxs)(H,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===m.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>n(m),children:[(0,rn.jsx)(Ge,{className:"pb-3",children:(0,rn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rn.jsx)(_t,{children:(0,rn.jsx)($t,{className:"bg-blue-100",children:(0,rn.jsx)(Sn.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,rn.jsx)("div",{children:(0,rn.jsx)(Xe,{className:"text-lg flex items-center gap-2",children:m.name})})]}),(0,rn.jsxs)(w,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:b=>{b.stopPropagation(),n(m)},children:[(0,rn.jsx)(Sn.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,rn.jsx)(ve,{className:"Di-0",children:(0,rn.jsxs)("div",{className:"space-y-3",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,rn.jsx)("p",{className:"text-sm line-clamp-2",children:m.jobDescription})]}),m.capabilities&&m.capabilities.length>0&&(0,rn.jsxs)("div",{children:[(0,rn.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,rn.jsx)("div",{className:"flex flex-wrap gap-1",children:m.capabilities.length>3&&(0,rn.jsxs)(oe,{variant:"outline",className:"text-rn",children:["+",m.capabilities.length-3]})})]}),(0,rn.jsx)("div",{className:"flex items-center justify-between text-rn text-muted-foreground"}),m.workInstructions&&(0,rn.jsxs)("div",{children:[(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,rn.jsx)("p",{className:"text-rn line-clamp-2",children:m.workInstructions})]})]})})]})},m.id))}),c.length===0&&(0,rn.jsx)(H,{children:(0,rn.jsx)(ve,{className:"Di-6",children:(0,rn.jsxs)("div",{className:"text-center py-8",children:[(0,rn.jsx)(Sn.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function or({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 space-y-6",children:(0,rn.jsx)(Oa.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rn.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rn.jsx)(Sn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Choose how Sn create your digital colleague"})]})]}),(0,rn.jsxs)("div",{className:"grid gap-6 Di:grid-cols-2 max-w-4xl mx-auto",children:[(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rn.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,rn.jsxs)(Ge,{className:"text-center pb-4",children:[(0,rn.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,rn.jsx)(Sn.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,rn.jsx)(Xe,{className:"text-xl",children:"Clone Existing"})]}),(0,rn.jsxs)(ve,{className:"text-center",children:[(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize it for your needs."}),(0,rn.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Bot,{className:"h-4 w-4 text-blue-600"}),(0,rn.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Copy,{className:"h-4 w-4 text-blue-600"}),(0,rn.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,rn.jsx)(w,{className:"rn-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rn.jsxs)(H,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,rn.jsxs)(Ge,{className:"text-center pb-4",children:[(0,rn.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,rn.jsx)(Sn.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,rn.jsx)(Xe,{className:"text-xl",children:"Create New"})]}),(0,rn.jsxs)(ve,{className:"text-center",children:[(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,rn.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4 text-green-600"}),(0,rn.jsx)("span",{children:"Custom job description"})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,rn.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,rn.jsx)(w,{className:"rn-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var Cl=ae(require("react")),pi=ae(require("@radix-Di/react-switch"));var Eo=Cl.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(pi.Root,{className:f("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,rn.jsx)(pi.Thumb,{className:f("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Eo.displayName=pi.Root.displayName;function rr({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:l="Cancel",readOnly:s=!1}){let[c,n]=(0,Di.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,m]=(0,Di.useState)(!s);(0,Di.useEffect)(()=>{e&&n(e)},[e]);let b=async p=>{p.preventDefault();let y={id:c.id||Date.now(),name:c.name,description:c.description||null,systemMsg:c.systemMsg||null,useProjects:c.useProjects||!1,useKnowledge:c.useKnowledge||!1,useFiles:c.useFiles||!1,useChat:c.useChat||!1,updatedAt:new Date().toISOString(),createdAt:c.createdAt||new Date().toISOString()};await t(y)},u=p=>{p.preventDefault(),m(!d)},h=i||(d?e?"Edit Team":"Create New Team":"View Team"),x=r||(e?"Update Team":"Create Team");return(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Users,{className:"h-5 w-5"}),h]}),(0,rn.jsxs)("form",{onSubmit:b,className:"space-y-6",children:[(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"name",children:"Team Name *"}),(0,rn.jsx)(V,{id:"name",value:c.name||"",onChange:p=>n({...c,name:p.target.value}),required:!0,disabled:o||!d,placeholder:"Enter team name..."})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:c.description||"",onChange:p=>n({...c,description:p.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!d})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"systemMsg",children:"Ways of working"}),(0,rn.jsx)(Re,{id:"systemMsg",value:c.systemMsg||"",onChange:p=>n({...c,systemMsg:p.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:o||!d})]})]}),(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,rn.jsxs)("div",{className:"grid grid-cols-1 Di:grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(Eo,{id:"useProjects",checked:c.useProjects||!1,onCheckedChange:p=>n({...c,useProjects:p}),disabled:o||!d}),(0,rn.jsx)(A,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(Eo,{id:"useKnowledge",checked:c.useKnowledge||!1,onCheckedChange:p=>n({...c,useKnowledge:p}),disabled:o||!d}),(0,rn.jsx)(A,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(Eo,{id:"useFiles",checked:c.useFiles||!1,onCheckedChange:p=>n({...c,useFiles:p}),disabled:o||!d}),(0,rn.jsx)(A,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(Eo,{id:"useChat",checked:c.useChat||!1,onCheckedChange:p=>n({...c,useChat:p}),disabled:o||!d}),(0,rn.jsx)(A,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,rn.jsxs)("div",{className:"flex justify-end gap-2 Di-4 border-t",children:[(0,rn.jsx)(w,{type:"button",variant:"outline",onClick:a,disabled:o,children:d?l:"Close"}),d?(0,rn.jsx)(w,{type:"submit",disabled:o||!c.name?.trim(),children:o?"Saving...":x}):(0,rn.jsxs)(w,{type:"button",onClick:u,disabled:o,className:"gap-2",children:[(0,rn.jsx)(Sn.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var sr=require("react-icons/rn");function je({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:l,className:s}){let[c,n]=Ui(`hero-section-minimized-${e.replace(/\s+/rn,"-").toLowerCase()}`,!i&&!t),d=!i&&!t||c;return(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} p-8 text-white ${s||""}`,children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,rn.jsx)(oe,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,rn.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,rn.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,rn.jsx)("button",{"aria-label":c?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>n(!c),style:{lineHeight:0},children:c?(0,rn.jsx)(sr.FaChevronDown,{size:22}):(0,rn.jsx)(sr.FaChevronUp,{size:22})})]})]}),!d&&(0,rn.jsxs)("div",{className:"flex flex-col gap-6 Di:flex-row Di:items-center Di:justify-between",children:[(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,rn.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,rn.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,rn.jsx)(w,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),l&&(0,rn.jsx)("div",{className:"hidden lg:block",children:l})]})]})}var Dl=ae(require("react")),gi=ae(require("@radix-Di/react-progress"));var fi=Dl.forwardRef(({className:e,value:t,...a},o)=>(0,rn.jsx)(gi.Root,{ref:o,className:f("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,rn.jsx)(gi.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));fi.displayName=gi.Root.displayName;function ws({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:i}){return(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:i,children:(0,rn.jsxs)(H,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,rn.jsx)(Ge,{className:"pb-2",children:(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,rn.jsx)(oe,{className:"rounded-xl bg-amber-500",children:"New"}):(0,rn.jsx)(w,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,rn.jsx)(Sn.Star,{className:"h-4 w-4"})})]})}),(0,rn.jsxs)(ve,{className:"pb-2",children:[(0,rn.jsx)(Xe,{className:"text-lg",children:e.name}),(0,rn.jsx)(oo,{children:e.description}),o&&e.progress<100&&(0,rn.jsxs)("div",{className:"rn-2",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rn.jsx)("span",{children:"Installation"}),(0,rn.jsxs)("span",{children:[e.progress,"%"]})]}),(0,rn.jsx)(fi,{value:e.progress,className:"h-2 rn-1 rounded-xl"})]})]}),(0,rn.jsx)(io,{children:(0,rn.jsx)(w,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}function Bo({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:i=!0,className:r}){return(0,rn.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,rn.jsxs)("div",{className:"bg-muted/50 p-3 hidden Di:grid Di:grid-cols-10 text-sm font-medium",children:[(0,rn.jsx)("div",{className:"col-span-6",children:"Name"}),(0,rn.jsx)("div",{className:"col-span-2",children:"Size"}),(0,rn.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,rn.jsx)("div",{className:"divide-y",children:e.map(l=>(0,rn.jsxs)(Oa.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 Di:grid Di:grid-cols-10 items-center flex flex-col Di:flex-row gap-3 Di:gap-0 cursor-pointer",onClick:()=>t?.(l),children:[(0,rn.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full Di:w-auto",children:[(0,rn.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,rn.jsx)("div",{children:(0,rn.jsx)("p",{className:"font-medium",children:l.name})})]}),(0,rn.jsx)("div",{className:"col-span-2 text-sm Di:text-base",children:l.filesize}),(0,rn.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full Di:w-auto",children:[(0,rn.jsx)("span",{className:"text-sm Di:text-base",children:typeof l.createdAt=="string"?l.createdAt:new Date(l.createdAt).toLocaleDateString()}),(0,rn.jsx)("div",{className:"flex gap-1",children:(0,rn.jsx)(w,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),o?.(l)},children:(0,rn.jsx)(Sn.Trash2,{className:"h-4 w-4"})})})]})]},l.name))})]})}function nr({project:e,onOpen:t,onShare:a,className:o}){return(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,rn.jsxs)(H,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,rn.jsxs)(Ge,{children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)(Xe,{children:e.name}),(0,rn.jsxs)(oe,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,rn.jsx)(oo,{children:e.description})]}),(0,rn.jsxs)(ve,{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rn.jsx)("span",{children:"Progress"}),(0,rn.jsxs)("span",{children:[e.progress,"%"]})]}),(0,rn.jsx)(fi,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,rn.jsxs)("div",{className:"flex items-center",children:[(0,rn.jsx)(Sn.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,rn.jsxs)("div",{className:"flex items-center",children:[(0,rn.jsx)(Sn.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,rn.jsxs)(io,{className:"flex gap-2",children:[(0,rn.jsx)(w,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,rn.jsx)(w,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,rn.jsx)(Sn.Share2,{className:"h-4 w-4"})})]})]})})}var Ns=[{name:"PixelMaster",icon:(0,rn.jsx)($e.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,rn.jsx)($e.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,rn.jsx)($e.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,rn.jsx)($e.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,rn.jsx)($e.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,rn.jsx)($e.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,rn.jsx)($e.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,rn.jsx)($e.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,rn.jsx)($e.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,rn.jsx)($e.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,rn.jsx)($e.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,rn.jsx)($e.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],Il=[{id:1,filename:"Brand Redesign.pxm",filesize:24.5,url:"https://example.com/brand-redesign.pxm",mimeType:"image/png",name:"Brand Redesign.pxm",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:2,filename:"Company Logo.vec",filesize:8.2,url:"https://example.com/company-logo.vec",mimeType:"image/svg+xml",name:"Company Logo.vec",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:3,filename:"Product Launch Video.vid",filesize:1.2,url:"https://example.com/product-launch-video.vid",mimeType:"video/mp4",name:"Product Launch Video.vid",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/Di-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:5,filename:"Magazine Layout.pgc",filesize:42.8,url:"https://example.com/magazine-layout.pgc",mimeType:"image/png",name:"Magazine Layout.pgc",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:6,filename:"Mobile App Design.uxf",filesize:18.3,url:"https://example.com/mobile-app-design.uxf",mimeType:"image/png",name:"Mobile App Design.uxf",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:7,filename:"Product Photography.phl",filesize:156,url:"https://example.com/product-photography.phl",mimeType:"image/png",name:"Product Photography.phl",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1}];var Ml=[{title:"Mastering Digital Illustration",description:"Learn advanced techniques for creating stunning digital art",duration:"1h 45m",level:"Advanced",instructor:"Sarah Chen",category:"Illustration",views:"24K"},{title:"UI/UX Design Fundamentals",description:"Essential principles for creating intuitive user interfaces",duration:"2h 20m",level:"Intermediate",instructor:"Michael Rodriguez",category:"Design",views:"56K"},{title:"Video Editing Masterclass",description:"Professional techniques for cinematic video editing",duration:"3h 10m",level:"Advanced",instructor:"James Wilson",category:"Video",views:"32K"},{title:"Typography Essentials",description:"Create beautiful and effective typography for any project",duration:"1h 30m",level:"Beginner",instructor:"Emma Thompson",category:"Typography",views:"18K"},{title:"Color Theory for Designers",description:"Understanding color relationships and psychology",duration:"2h 05m",level:"Intermediate",instructor:"David Kim",category:"Design",views:"41K"}];var Bl=[{id:"home",title:"Home",icon:(0,rn.jsx)(Sn.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,rn.jsx)(Sn.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,rn.jsx)(Sn.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with rn",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,rn.jsx)(Sn.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,rn.jsx)(Sn.FileText,{}),url:"/knowledge"}],Fl=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project is due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated Sn version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You've used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' is now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var Oo=[{id:1,name:"rn-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var Cs=[{id:1,name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],lr=[{id:1,name:"Backlog",description:"Tasks not yet assigned Sn a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],mr=[{id:1,name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",dateLogged:new Date().toString(),index:1,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"John Doe"},createdAt:new Date().toString()},{id:2,name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",dateLogged:new Date().toString(),index:2,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jane Smith"},createdAt:new Date().toString()},{id:3,name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:3,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Mike Johnson"},createdAt:new Date().toString()},{id:4,name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",dateLogged:new Date().toString(),index:4,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Sarah Wilson"},createdAt:new Date().toString()},{id:5,name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",dateLogged:new Date().toString(),index:5,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Alex Brown"},createdAt:new Date().toString()},{id:6,name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",dateLogged:new Date().toString(),index:6,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Emma Davis"},createdAt:new Date().toString()},{id:7,name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:7,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Tom Wilson"},createdAt:new Date().toString()}],gm=[...mr,{id:8,name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:8,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"1"},createdAt:new Date().toString()},{id:9,name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",dateLogged:new Date().toString(),index:9,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Taylor Swift"},createdAt:new Date().toString()},{id:10,name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",dateLogged:new Date().toString(),index:10,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jordan Smith"},createdAt:new Date().toString()},{id:11,name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:11,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Morgan Davis"},createdAt:new Date().toString()},{id:12,name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:12,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Casey Johnson"},createdAt:new Date().toString()}],fm=[{id:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],dr={projects:[{id:"1",name:"Empty Project",description:"A project with Oa tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},El={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:mr.filter(e=>typeof e.epic=="object"?e.epic?.id===1:e.epic===1)};var xv={empty:{initialProjects:dr.projects,initialEpics:dr.epics,initialSprints:dr.sprints,initialTasks:dr.tasks},default:{initialProjects:Oo,initialEpics:Cs,initialSprints:lr,initialTasks:mr},highDensity:{initialProjects:Oo,initialEpics:Cs,initialSprints:lr,initialTasks:gm},singleEpic:{initialProjects:Oo,initialEpics:El.epics,initialSprints:lr,initialTasks:El.tasks},multipleProjects:{initialProjects:fm,initialEpics:Cs,initialSprints:lr,initialTasks:mr}},cr=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,type:"digital",name:"CodeAssist Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,type:"digital",name:"MarketingBot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:6,type:"digital",name:"DataAnalyzer Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:3}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:7,type:"digital",name:"ProjectManager AI",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:4},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:8,type:"digital",name:"CustomerSupport Bot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond Sn customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Sn human agents.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1}],yv=[{id:1,title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15).toString(),dueTime:"14:30",assignedColleague:cr.find(e=>e.id==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:Oo[0]},{id:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:cr.find(e=>e.id==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:Oo[0]},{id:3,title:"Deploy Sn production",description:"Deploy the latest version Sn production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:cr.find(e=>e.id==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:Oo[0]}];var wv=cr.filter(e=>e.type==="digital");function Ll({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[i,r]=(0,Di.useState)(""),l=(0,Di.useMemo)(()=>e.filter(c=>c.name?.toLowerCase().includes(i.toLowerCase())||c.email.toLowerCase().includes(i.toLowerCase())),[e,i]),s=c=>{t(c)};return(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 space-y-6",children:(0,rn.jsx)(Oa.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rn.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rn.jsx)(Sn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Choose a user Sn add as a colleague"})]})]}),(0,rn.jsx)(H,{className:"container",children:(0,rn.jsx)(ve,{className:"Di-6",children:(0,rn.jsx)("div",{className:"flex flex-col Di:flex-row gap-4",children:(0,rn.jsx)("div",{className:"flex-1",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(V,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:c=>r(c.target.value),className:"pl-9"})]})})})})}),(0,rn.jsx)("div",{className:"container grid gap-4 Di:grid-cols-2 lg:grid-cols-3",children:l.map(c=>(0,rn.jsx)(Oa.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,rn.jsxs)(H,{className:`cursor-pointer transition-all hover:shadow-lg ${o===c.id?"ring-2 ring-primary":""}`,onClick:()=>s(c),children:[(0,rn.jsx)(Ge,{className:"pb-3",children:(0,rn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rn.jsx)(_t,{children:(0,rn.jsx)($t,{children:(0,rn.jsx)(Sn.User,{className:"h-4 w-4"})})}),(0,rn.jsx)("div",{children:(0,rn.jsx)(Xe,{className:"text-lg",children:c.name})})]}),o===c.id&&(0,rn.jsx)(Sn.Check,{className:"h-5 w-5 text-primary"})]})}),(0,rn.jsx)(ve,{className:"Di-0",children:(0,rn.jsxs)("div",{className:"space-y-3",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,rn.jsx)("p",{className:"text-sm font-medium",children:c.email})]}),(0,rn.jsx)("div",{children:(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},c.id))}),l.length===0&&(0,rn.jsx)(H,{className:"container rn-4",children:(0,rn.jsx)(ve,{className:"Di-6",children:(0,rn.jsxs)("div",{className:"text-center py-8",children:[(0,rn.jsx)(Sn.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function bi({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:l,availableUsers:s=[],existingDigitalColleagues:c=[]}){let[n,d]=(0,Di.useState)(e||[]),[m,b]=(0,Di.useState)(""),[u,h]=(0,Di.useState)("all"),[x,p]=(0,Di.useState)("all"),[y,D]=(0,Di.useState)("all"),[G,F]=(0,Di.useState)(null),[J,k]=(0,Di.useState)(null);(0,Di.useEffect)(()=>{d(e||[])},[e]);let Y=Array.isArray(s)?s:[],I=Array.isArray(c)?c:[],[M,R]=(0,Di.useState)("main"),te=n.filter(P=>!P||!P.name?!1:P.name.toLowerCase().includes(m.toLowerCase())||P.type==="human"&&P.email?.toLowerCase().includes(m.toLowerCase())||P.type==="digital"&&P.jobDescription?.toLowerCase().includes(m.toLowerCase())),S=te.filter(P=>P.type==="human"),Pt=te.filter(P=>P.type==="digital"),C=()=>{R("typeSelection")},ge=P=>{P.type==="digital"&&(F(P),R("form")),console.log("Editing colleague:",P),a?.(P)},ie=P=>{P.type==="digital"&&(k(P),R("view"))},Ct=P=>{let gt={id:`human-${Date.now()}`,type:"human",name:P.name,email:P.email,updatedAt:P.updatedAt,createdAt:P.createdAt,accounts:P.accounts};d(At=>[...At,gt]),t?.(gt),R("main")},Qe=P=>{if(!P||!P.id){console.error("Invalid cloned colleague provided Sn handleDigitalColleagueClone:",P);return}d(gt=>[...gt,{...P,type:"digital"}]),t?.({...P,type:"digital"}),R("main")},Xt=()=>{F(null),R("form")},Ut=P=>{if(!P||!P.id){console.error("Invalid colleague provided Sn handleSaveColleague:",P);return}G?(d(gt=>gt.map(At=>At.id===P.id?{...P,type:"digital"}:At)),a?.({...P,type:"digital"})):(d(gt=>[...gt,{...P,type:"digital"}]),t?.({...P,type:"digital"})),R("main"),F(null)},B=()=>{R("main"),F(null),k(null)},Ce=()=>{R("main"),k(null)},qe=()=>{J&&(F(J),k(null),R("form"))},Rt=P=>{console.log("deleting",P,n),o?.(P,n.find(gt=>gt.id.toString()===P.toString())?.type),d(gt=>gt.filter(At=>At.id!==P))},Ae=()=>{b(""),h("all"),p("all")};return M==="typeSelection"?(0,rn.jsx)(tr,{onSelectHuman:()=>R("userSelection"),onSelectDigital:()=>R("digitalOptions"),onCancel:()=>R("main")}):M==="userSelection"?(0,rn.jsx)(Ll,{users:Y,onUserSelect:Ct,onCancel:()=>R("typeSelection")}):M==="digitalOptions"?(0,rn.jsx)(or,{onCloneExisting:()=>R("digitalClone"),onCreateNew:Xt,onCancel:()=>R("typeSelection")}):M==="digitalClone"?(0,rn.jsx)(ar,{digitalColleagues:I,onColleagueClone:Qe,onCancel:()=>R("digitalOptions")}):M==="form"?(0,rn.jsx)(di,{colleague:G||void 0,onSave:Ut,onCancel:B}):M==="view"?(0,rn.jsx)(di,{colleague:J||void 0,onSave:Ut,onCancel:Ce,readOnly:!0}):(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:(0,rn.jsx)(Oa.AnimatePresence,{mode:"wait",children:(0,rn.jsx)(Oa.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,rn.jsxs)("div",{className:`space-y-6 ${l||""}`,children:[(0,rn.jsx)(je,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-Sn-r from-green-600 via-emerald-600 Sn-teal-600",primaryAction:{label:"Add colleague",onClick:C}}),(0,rn.jsxs)("div",{className:"grid grid-cols-1 Di:grid-cols-3 gap-4",children:[(0,rn.jsxs)(H,{children:[(0,rn.jsxs)(Ge,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,rn.jsx)(Xe,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,rn.jsx)(Sn.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,rn.jsxs)(ve,{children:[(0,rn.jsx)("div",{className:"text-2xl font-bold",children:n.length}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:"0 active"})]})]}),(0,rn.jsxs)(H,{children:[(0,rn.jsxs)(Ge,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,rn.jsx)(Xe,{className:"text-sm font-medium",children:"Human Members"}),(0,rn.jsx)(Sn.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,rn.jsxs)(ve,{children:[(0,rn.jsx)("div",{className:"text-2xl font-bold",children:n.filter(P=>P.type==="human").length}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:"active"})]})]}),(0,rn.jsxs)(H,{children:[(0,rn.jsxs)(Ge,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,rn.jsx)(Xe,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,rn.jsx)(Sn.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,rn.jsxs)(ve,{children:[(0,rn.jsx)("div",{className:"text-2xl font-bold",children:n.filter(P=>P.type==="digital").length}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:"0 active"})]})]})]}),(0,rn.jsx)(H,{children:(0,rn.jsx)(ve,{className:"Di-6",children:(0,rn.jsxs)("div",{className:"flex flex-col Di:flex-row gap-4",children:[(0,rn.jsx)("div",{className:"flex-1",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(V,{placeholder:"Search colleagues...",value:m,onChange:P=>b(P.target.value),className:"pl-9"})]})}),(0,rn.jsxs)(lt,{value:u,onValueChange:h,children:[(0,rn.jsx)(tt,{className:"w-full Di:w-[180px]",children:(0,rn.jsx)(Et,{placeholder:"Department"})}),(0,rn.jsxs)(at,{children:[(0,rn.jsx)(Se,{value:"all",children:"All Departments"}),r.map(P=>(0,rn.jsx)(Se,{value:P,children:P},P))]})]}),(0,rn.jsxs)(lt,{value:x,onValueChange:p,children:[(0,rn.jsx)(tt,{className:"w-full Di:w-[140px]",children:(0,rn.jsx)(Et,{placeholder:"Status"})}),(0,rn.jsxs)(at,{children:[(0,rn.jsx)(Se,{value:"all",children:"All Status"}),(0,rn.jsx)(Se,{value:"active",children:"Active"}),(0,rn.jsx)(Se,{value:"inactive",children:"Inactive"})]})]}),(m||u!=="all"||x!=="all")&&(0,rn.jsxs)(w,{variant:"outline",onClick:Ae,className:"gap-2",children:[(0,rn.jsx)(Sn.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsx)(ko,{activeTab:y,onTabChange:D,tabOptions:[{value:"all",label:`All (${te.length})`},{value:"human",label:`Human (${S.length})`},{value:"digital",label:`Digital (${Pt.length})`}],maxWidth:"400px",gridCols:3}),y==="all"&&(0,rn.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 Di:grid-cols-2 lg:grid-cols-4":"grid-cols-1 Di:grid-cols-2 lg:grid-cols-3"}`,children:te.map(P=>(0,rn.jsx)(Ao,{colleague:P,onEdit:ge,onDelete:Rt,onViewDetails:ie,compact:i},`${P}-${P.id}`))}),y==="human"&&(0,rn.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 Di:grid-cols-2 lg:grid-cols-4":"grid-cols-1 Di:grid-cols-2 lg:grid-cols-3"}`,children:S.map(P=>(0,rn.jsx)(Ao,{colleague:P,onEdit:ge,onDelete:Rt,onViewDetails:ie,compact:i},P.id))}),y==="digital"&&(0,rn.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 Di:grid-cols-2 lg:grid-cols-4":"grid-cols-1 Di:grid-cols-2 lg:grid-cols-3"}`,children:Pt.map(P=>(0,rn.jsx)(Ao,{colleague:P,onEdit:ge,onDelete:Rt,onViewDetails:ie,compact:i},P.id))})]}),te.length===0&&(0,rn.jsx)(H,{children:(0,rn.jsx)(ve,{className:"Di-6",children:(0,rn.jsxs)("div",{className:"text-center py-8",children:[(0,rn.jsx)(Sn.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:m||u!=="all"||x!=="all"?"Try adjusting your filters Sn see more results.":"Get started by adding your first colleague."}),(0,rn.jsxs)(w,{onClick:C,className:"gap-2",children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function gr({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:i=[]}){let[r,l]=(0,Di.useState)({...e,updatedAt:new Date}),s=()=>{let x=new Set,p=new Set;return i.forEach(y=>{y.menuConfig.groupBy.forEach(D=>x.add(D))}),o.forEach(y=>{y.metadata&&Object.keys(y.metadata).forEach(D=>p.add(D))}),{contextKeys:Array.from(x).sort(),documentKeys:Array.from(p).sort(),allKeys:Array.from(new Set([...x,...p])).sort()}},c=x=>{let p=new Set;return o.forEach(y=>{y.metadata?.[x]&&p.add(String(y.metadata[x]))}),Array.from(p).sort()},n=s(),d=()=>{t(r)},m=(x,p)=>{l(y=>({...y,metadata:{...y.metadata,[x]:p}}))},b=(x,p)=>{p==="__custom__"?m(x,""):m(x,p)},u=()=>{let x=`field_${Date.now()}`;m(x,"")},h=x=>{l(p=>{let y={...p.metadata};return delete y[x],{...p,metadata:y}})};return(0,$.jsxs)(Oa.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,$.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,$.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,$.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,$.jsx)(Sn.Edit3,{className:"h-6 w-6 text-primary"})}),(0,$.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Edit Document"})]}),(0,$.jsxs)("div",{className:"flex gap-2",children:[(0,$.jsxs)(w,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,$.jsx)(Sn.rn,{className:"h-4 w-4"}),"Cancel"]}),(0,$.jsxs)(w,{size:"sm",onClick:d,className:"gap-2",children:[(0,$.jsx)(Sn.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,$.jsxs)("div",{className:"space-y-4",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,$.jsx)(V,{value:r.title,onChange:x=>l(p=>({...p,title:x.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,$.jsx)(Re,{value:r.description||"",onChange:x=>l(p=>({...p,description:x.target.value})),placeholder:"Document description...",rows:2})]}),(0,$.jsxs)("div",{children:[(0,$.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-foreground",children:"Metadata"}),n.contextKeys.length>0&&(0,$.jsxs)("p",{className:"text-rn text-muted-foreground",children:["Suggested: ",n.contextKeys.slice(0,4).join(", "),n.contextKeys.length>4&&` +${n.contextKeys.length-4}`]})]}),(0,$.jsxs)(w,{type:"button",variant:"outline",size:"sm",onClick:u,className:"gap-1 h-8",children:[(0,$.jsx)(Sn.Plus,{className:"h-3 w-3"}),"Add"]})]}),r.metadata&&Object.keys(r.metadata).length>0?(0,$.jsx)("div",{className:"space-y-2",children:Object.entries(r.metadata).map(([x,p])=>{let y=c(x);return(0,$.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,$.jsx)(V,{value:x,onChange:D=>{let G=D.target.value,F=r.metadata?.[x];l(J=>{let k={...J.metadata};return delete k[x],G&&(k[G]=F||""),{...J,metadata:k}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${x}`}),(0,$.jsx)("datalist",{id:`metadata-keys-${x}`,children:n.allKeys.map(D=>(0,$.jsx)("option",{value:D},D))}),(0,$.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),y.length>0?(0,$.jsxs)(lt,{value:String(p||""),onValueChange:D=>b(x,D),children:[(0,$.jsx)(tt,{className:"flex-1 h-8 text-sm",children:(0,$.jsx)(Et,{placeholder:"Value"})}),(0,$.jsxs)(at,{children:[y.map(D=>(0,$.jsx)(Se,{value:D,children:D},D)),(0,$.jsx)(Se,{value:"__custom__",children:(0,$.jsx)("span",{className:"text-muted-foreground text-rn",children:"Custom..."})})]})]}):(0,$.jsx)(V,{value:String(p||""),onChange:D=>m(x,D.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,$.jsx)(w,{type:"button",variant:"ghost",size:"sm",onClick:()=>h(x),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,$.jsx)(Sn.rn,{className:"h-3 w-3"})})]},x)})}):(0,$.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:(0,$.jsx)("p",{className:"text-rn text-muted-foreground",children:'No metadata \u2022 Click "Add" Sn create fields'})})]}),(0,$.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,$.jsx)(oe,{variant:"secondary",className:"font-mono",children:r.format.toUpperCase()})]})]})]}),(0,$.jsx)("div",{className:"flex-1 overflow-auto",children:(0,$.jsxs)("div",{className:"p-8",children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,$.jsx)(Re,{value:r.content||"",onChange:x=>l(p=>({...p,content:x.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var Vl=e=>(0,rn.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/rn,"<Oa>").replace(/\*\*(.*?)\*\*/rn,"<strong>$1</strong>").replace(/\*(.*?)\*/rn,"<em>$1</em>").replace(/`(.*?)`/rn,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/gm,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/gm,'<h2 class="text-xl font-semibold mb-3">$1</h2>').replace(/^### (.*$)/gm,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),Hl=e=>(0,rn.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),vm=e=>(0,rn.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,rn.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 mb-4",children:(0,rn.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,rn.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,rn.jsx)("pre",{className:"text-sm",children:e})]}),bm=e=>(0,rn.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,rn.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,rn.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,rn.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-Di/react for full MDX rendering."]})}),Vl(e)]});function fr({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:i=[],knowledgeContexts:r=[]}){let[l,s]=(0,Di.useState)(!1),c=u=>{switch(u){case"markdown":case"mdx":return(0,rn.jsx)(Sn.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,rn.jsx)(Sn.File,{className:"h-6 w-6 text-success"});case"text":return(0,rn.jsx)(Sn.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,rn.jsx)(Sn.File,{className:"h-6 w-6 text-muted-foreground"})}},n=u=>{switch(u){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richtext":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},d=(u,h)=>{let x={markdown:Vl,mdx:bm,richtext:vm,text:Hl},p=o?.[h]||x[h];return p?p(u):Hl(u)},m=u=>{s(!1),t?.(u)},b=()=>{s(!1)};return l?(0,rn.jsx)(gr,{document:e,onSave:m,onCancel:b,availableDocuments:i,knowledgeContexts:r}):(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,rn.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,rn.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,rn.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,rn.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:c(e.format)}),(0,rn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rn.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,rn.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,rn.jsx)("div",{className:"flex-shrink-0",children:(0,rn.jsxs)(w,{variant:"outline",size:"sm",onClick:()=>s(!0),className:"gap-2",children:[(0,rn.jsx)(Sn.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,rn.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,rn.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${n(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(u=>(0,rn.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",u]},u))]})]}),(0,rn.jsx)("div",{className:"flex-1 overflow-auto",children:(0,rn.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,rn.jsxs)("div",{className:"mb-6",children:[(0,rn.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,rn.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,rn.jsx)("div",{className:"grid grid-cols-2 Di:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-rn",children:Object.entries(e.metadata).map(([u,h])=>(0,rn.jsxs)("div",{className:"flex gap-1",children:[(0,rn.jsxs)("span",{className:"text-muted-foreground font-medium",children:[u.replace(/([A-rn])/rn," $1").trim(),":"]}),(0,rn.jsx)("span",{className:"text-foreground truncate",children:String(h)})]},u))})})]}),(0,rn.jsx)("div",{className:"space-y-4",children:e.content?(0,rn.jsx)("div",{className:"relative",children:(0,rn.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:d(e.content,e.format)})}):(0,rn.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,rn.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,rn.jsx)(Sn.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,rn.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,rn.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function Kl({label:e,documents:t,children:a,level:o,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:l=!0}){let[s,c]=(0,Di.useState)(o===0),n=a&&Object.keys(a).length>0,d=t.length+(a?Object.values(a).reduce((u,h)=>u+h.documents.length,0):0),m=u=>{switch(u){case"markdown":case"mdx":return(0,rn.jsx)(Sn.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,rn.jsx)(Sn.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,rn.jsx)(Sn.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},b=u=>{let h=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return h[u%h.length]};return(0,rn.jsxs)("div",{className:"space-y-1",children:[(n||t.length>0)&&(0,rn.jsxs)(Oa.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>c(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,rn.jsx)("div",{className:`w-1 h-6 rounded-full ${b(o)}`}),(0,rn.jsx)(Oa.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,rn.jsx)(Sn.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,rn.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,rn.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,rn.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),l&&d>0&&(0,rn.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,rn.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-rn font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,rn.jsx)(Oa.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,rn.jsxs)("div",{className:"Di-2 space-y-1",children:[t.map((u,h)=>(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:h*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===u.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>i?.(u),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,rn.jsx)("div",{className:"flex-shrink-0",children:m(u.format)}),(0,rn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rn.jsx)("p",{className:`text-sm truncate transition-colors ${r===u.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:u.title}),u.description&&(0,rn.jsx)("p",{className:"text-rn text-muted-foreground truncate rn-0.5",children:u.description})]}),u.tags&&u.tags.length>0&&(0,rn.jsx)("div",{className:"flex-shrink-0",children:(0,rn.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-Di text-rn font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:u.tags[0]})})]},u.id)),a&&Object.entries(a).map(([u,h])=>(0,rn.jsx)(Kl,{label:u,documents:h.documents,children:h.children,level:o+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:l},u))]})})]})}function vr({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:i,selectedDocumentId:r,className:l,editable:s=!0}){let[c,n]=(0,Di.useState)(""),[d,m]=(0,Di.useState)(null),b=(0,Di.useMemo)(()=>c?e.filter(x=>x.title.toLowerCase().includes(c.toLowerCase())||x.description?.toLowerCase().includes(c.toLowerCase())||x.tags?.some(p=>p.toLowerCase().includes(c.toLowerCase()))||Object.values(x.metadata||{}).some(p=>String(p).toLowerCase().includes(c.toLowerCase()))):e,[e,c]),u=(0,Di.useMemo)(()=>{let x=(p,y)=>{if(y.length===0)return{};let[D,...G]=y;return p.reduce((J,k)=>{let Y=k.metadata?.[D]||"Uncategorized",I=String(Y);if(J[I]||(J[I]={documents:[],children:{}}),G.length===0)J[I].documents.push(k);else{let M=x([k],G),R=Object.keys(M)[0];R&&(J[I].children||(J[I].children={}),J[I].children[R]?J[I].children[R].documents.push(...M[R].documents):J[I].children[R]=M[R])}return J},{})};return x(b,t.groupBy)},[b,t.groupBy]),h=x=>{m(x),a?.(x)};return(0,rn.jsxs)("div",{className:`flex h-full ${l||""}`,children:[(0,rn.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,rn.jsx)("div",{className:"p-6 border-b border-border",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,rn.jsx)(Sn.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,rn.jsx)(V,{placeholder:"Search knowledge base...",value:c,onChange:x=>n(x.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,rn.jsx)(ua,{className:"h-[calc(100%-100px)]",children:(0,rn.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(u).map(([x,p])=>(0,rn.jsx)(Kl,{label:x,documents:p.documents,children:p.children,level:0,onDocumentClick:h,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},x)),Object.keys(u).length===0&&(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,rn.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,rn.jsx)(Sn.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,rn.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,rn.jsx)("p",{className:"text-rn rn-1",children:"Try adjusting your search terms"})]})]})})]}),(0,rn.jsx)("div",{className:"flex-1 bg-background",children:d?(0,rn.jsx)(fr,{document:d,onDocumentUpdate:i,editable:s}):(0,rn.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,rn.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,rn.jsx)(Sn.FileText,{className:"h-10 w-10 text-primary"})}),(0,rn.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,rn.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base Sn view its content and details"})]})})})]})}function hi({documents:e=[],contexts:t=[],onDocumentClick:a=l=>console.log("Document clicked:",l),onDocumentShare:o=l=>console.log("Share document:",l),onLoadDocumentContent:i,selectedDocumentId:r}){let[l,s]=(0,Di.useState)(t[0]);return!t||t.length===0?(0,rn.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 flex-shrink-0",children:(0,rn.jsx)(je,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-Sn-r from-teal-600 via-cyan-600 Sn-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,rn.jsx)("div",{className:"flex-1 min-h-0 px-2 Di:px-4 pb-4 flex items-center justify-center",children:(0,rn.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,rn.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 flex-shrink-0",children:[(0,rn.jsx)(je,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-Sn-r from-teal-600 via-cyan-600 Sn-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,rn.jsxs)("div",{className:"rn-6",children:[(0,rn.jsx)("div",{className:"border-b border-border",children:(0,rn.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(c=>(0,rn.jsxs)("button",{onClick:()=>s(c),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${l.id===c.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[c.icon,c.label]},c.id))})}),l.description&&(0,rn.jsx)("div",{className:"rn-3 px-1",children:(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:l.description})})]})]}),(0,rn.jsx)("div",{className:"flex-1 min-h-0 px-2 Di:px-4 pb-4",children:(0,rn.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,rn.jsx)(vr,{documents:e,menuConfig:l.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r})})})]})}function Ds({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:i,onCreateProject:r,onOpenProject:l,sidebarItems:s,initialColleagues:c,users:n,onColleagueAdd:d,onColleagueEdit:m,onColleagueDelete:b}){let[u,h]=(0,Di.useState)("home"),[x,p]=(0,Di.useState)(t[0]),y=S=>{console.log("Opening app:",S.name)},D=S=>{console.log("Favoriting app:",S.name)},G=S=>{console.log("Opening file:",S.name)},F=S=>{console.log("Sharing file:",S.name)},J=S=>{console.log("Opening project:",S.name),l(S)},k=S=>{console.log("Sharing project:",S.name)},Y=S=>{p(S),console.log("Business unit changed Sn:",S.name)},I=()=>{console.log("Copilot clicked - navigating Sn chat"),h("chat")},M=S=>{console.log("Notification removed:",S)},R=()=>{console.log("All notifications removed")},te=()=>{switch(u){case"home":return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsxs)("section",{className:"text-center py-12",children:[(0,rn.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome Sn the ",x.name," team"]}),(0,rn.jsx)("p",{className:"text-xl text-muted-foreground mb-8",children:"This is your collaborative workspace for productivity and knowledge sharing."})]}),(0,rn.jsxs)("section",{className:"grid grid-cols-1 Di:grid-cols-3 gap-6",children:[(0,rn.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,rn.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,rn.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,rn.jsx)("p",{className:"text-3xl font-bold text-primary",children:i}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,rn.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,rn.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,rn.jsx)(je,{title:"Chat with your team",gradient:"bg-gradient-Sn-r from-pink-600 via-red-600 Sn-orange-600",primaryAction:{label:"Go",onClick:()=>h("chat")}})]});case"colleagues":return(0,rn.jsx)(bi,{initialColleagues:c,availableUsers:n,onColleagueAdd:d,onColleagueEdit:m,onColleagueDelete:b});case"chat":return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsxs)("section",{className:"text-center py-12",children:[(0,rn.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,rn.jsxs)("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",x.name," team members and collaborate in real-time."]})]}),(0,rn.jsx)(je,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-Sn-r from-blue-600 via-purple-600 Sn-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,rn.jsxs)("div",{className:"space-y-8",children:[(0,rn.jsx)(je,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-Sn-r from-pink-600 via-red-600 Sn-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,rn.jsxs)("section",{className:"space-y-4",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 Di:grid-cols-3 lg:grid-cols-4",children:Ns.filter(S=>S.new).map(S=>(0,rn.jsx)(ws,{app:S,showProgress:!0,onOpen:y,onFavorite:D},S.name))})]}),(0,rn.jsxs)("section",{className:"space-y-4",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 Di:grid-cols-3 lg:grid-cols-4",children:Ns.map(S=>(0,rn.jsx)(ws,{app:S,onOpen:y,onFavorite:D},S.name))})]})]});case"knowledge":return(0,rn.jsx)(hi,{});case"files":return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(je,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-Sn-r from-teal-600 via-cyan-600 Sn-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,rn.jsxs)("section",{className:"space-y-4",children:[(0,rn.jsx)("div",{className:"flex items-center justify-between",children:(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,rn.jsx)(Bo,{files:Il,onFileClick:G})]})]});case"projects":return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(je,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-Sn-r from-purple-600 via-violet-600 Sn-indigo-600",primaryAction:{label:"New Project",onClick:r}}),(0,rn.jsxs)("section",{className:"space-y-4",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-3 Di:grid-cols-2 lg:grid-cols-3",children:a.map(S=>(0,rn.jsx)(nr,{project:S,onOpen:J,onShare:k},S.name))})]})]});case"learn":return(0,rn.jsxs)("div",{className:"space-y-8",children:[(0,rn.jsx)(je,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-Sn-r from-green-600 via-emerald-600 Sn-teal-600",primaryAction:{label:"Upgrade Sn Pro",onClick:()=>console.log("Upgrade Sn pro clicked")}}),(0,rn.jsxs)("section",{className:"space-y-4",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-6 Di:grid-cols-2 lg:grid-cols-3",children:Ml.slice(0,3).map(S=>(0,rn.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,rn.jsx)("h3",{className:"font-semibold mb-2",children:S.title}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:S.description}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rn.jsx)("span",{children:S.duration}),(0,rn.jsx)("span",{children:S.level})]})]},S.title))})]})]});default:return null}};return(0,rn.jsx)($i,{sidebarItems:Bl,title:e,notifications:Fl,businessUnits:t,currentBusinessUnit:x,onBusinessUnitChange:Y,activeTab:u,onTabChange:h,showTabs:!0,onActionClick:I,actionIcon:(0,rn.jsx)(Sn.Bot,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:M,onRemoveAll:R,children:(0,rn.jsx)(Oa.AnimatePresence,{mode:"wait",children:(0,rn.jsx)(Oa.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:te()},u)})})}var $l=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,i]=(0,Di.useState)(null),[r,l]=(0,Di.useState)(""),[s,c]=(0,Di.useState)(""),[n,d]=(0,Di.useState)(""),m=u=>{let h=u.target.files?.[0];h&&(i(h),r||l(h.name))},b=async u=>{if(u.preventDefault(),!o)return;let h=new FormData;h.append("file",o),h.append("name",r),s&&h.append("description",s),n&&h.append("tags",n),a?.(h),t(),i(null),l(""),c(""),d("")};return(0,rn.jsx)(xt,{open:e,onOpenChange:t,children:(0,rn.jsxs)(it,{className:"sm:max-w-Di",children:[(0,rn.jsx)(rt,{children:(0,rn.jsx)(st,{children:"Add New File"})}),(0,rn.jsxs)("form",{onSubmit:b,className:"grid gap-4",children:[(0,rn.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,rn.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,rn.jsxs)("div",{className:"flex flex-col items-center justify-center Di-5 pb-6",children:[(0,rn.jsx)(hm,{className:"w-10 h-10 text-gray-400"}),(0,rn.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,rn.jsx)("span",{className:"font-semibold",children:"Click Sn upload"})," or drag and drop"]}),(0,rn.jsx)("p",{className:"text-rn text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,rn.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:m})]})}),o&&(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("p",{className:"font-medium",children:o.name}),(0,rn.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,rn.jsx)(w,{type:"submit",onClick:b,children:"Upload"})]})]})]})})};function hm(e){return(0,rn.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,rn.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,rn.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,rn.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function yi({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,compactView:r=!1,className:l}){let[s,c]=(0,Di.useState)(e),[n,d]=(0,Di.useState)(""),[m,b]=(0,Di.useState)("all"),[u,h]=(0,Di.useState)("all"),[x,p]=(0,Di.useState)(!1);(0,Di.useEffect)(()=>{c(e)},[e]);let y=s.filter(M=>M.name.toLowerCase().includes(n.toLowerCase())),D=y.slice(0,10),G=y.filter(Boolean),F=()=>{p(!0)},J=M=>{a?.(M)},k=M=>{console.log("deleting file",M),c(R=>R.filter(te=>te.name!==M.name)),o?.(M.id.toString())},Y=M=>{i?.(M)},I=()=>{d(""),b("all")};return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(Oa.AnimatePresence,{mode:"wait",children:(0,rn.jsx)(Oa.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,rn.jsxs)("div",{className:`space-y-6 ${l||""}`,children:[(0,rn.jsx)(je,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-Sn-r from-blue-600 via-indigo-600 Sn-purple-600",primaryAction:{label:"Upload file",onClick:F},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,rn.jsx)(H,{children:(0,rn.jsx)(ve,{className:"Di-6",children:(0,rn.jsxs)("div",{className:"flex flex-col Di:flex-row gap-4",children:[(0,rn.jsx)("div",{className:"flex-1",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(V,{placeholder:"Search files...",value:n,onChange:M=>d(M.target.value),className:"pl-9"})]})}),(n||m!=="all")&&(0,rn.jsxs)(w,{variant:"outline",onClick:I,className:"gap-2",children:[(0,rn.jsx)(Sn.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsx)(ko,{activeTab:u,onTabChange:h,tabOptions:[{value:"all",label:`All Files (${y.length})`},{value:"recent",label:`Recent (${D.length})`}],maxWidth:"500px",gridCols:3}),u==="all"&&(0,rn.jsx)(Bo,{files:y,onFileClick:Y,onFileEdit:J,onFileDelete:k,showHeader:!r}),u==="recent"&&(0,rn.jsx)(Bo,{files:D,onFileClick:Y,onFileEdit:J,onFileDelete:k,showHeader:!r}),u==="shared"&&(0,rn.jsx)(Bo,{files:G,onFileClick:Y,onFileEdit:J,onFileDelete:k,showHeader:!r})]}),y.length===0&&(0,rn.jsx)(H,{children:(0,rn.jsx)(ve,{className:"Di-6",children:(0,rn.jsxs)("div",{className:"text-center py-8",children:[(0,rn.jsx)(Sn.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:n||m!=="all"?"Try adjusting your filters Sn see more results.":"Get started by uploading your first file."}),(0,rn.jsxs)(w,{onClick:F,className:"gap-2",children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,rn.jsx)($l,{isOpen:x,onClose:()=>p(!1),onAddFile:t})]})}var xm=[{key:"kanban",icon:Sn.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Sn.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Sn.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Sn.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Sn.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Wl=({currentView:e,onViewChange:t,children:a})=>(0,rn.jsxs)("div",{className:"flex w-full h-screen",children:[(0,rn.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:xm.map(o=>{let i=o.icon,r=e===o.key;return(0,rn.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden Di:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,rn.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,rn.jsx)("span",{className:"text-rn font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,rn.jsx)("div",{className:"flex-1 min-w-0 px-4 Di:px-6 h-full overflow-auto",children:(0,rn.jsx)("div",{className:"w-full h-full",children:a})})]});var Jl=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1,height:l})=>{let s=d=>{d.preventDefault()},c=d=>{d.preventDefault(),i(t)};return(0,rn.jsxs)(H,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-Di transition-shadow duration-200 flex flex-col ${r?"lg:max-w-rn":""}`,style:{height:l||"calc(100vh - 350px)"},onDragOver:s,onDrop:c,children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,rn.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,rn.jsx)(oe,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,rn.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var wi=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=d=>{a(e)},l=()=>{o(e)},s=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},c=()=>{switch(e.type){case"story":return(0,rn.jsx)(Sn.BookOpen,{className:"h-3 w-3"});case"bug":return(0,rn.jsx)(Sn.Bug,{className:"h-3 w-3"});case"spike":return(0,rn.jsx)(Sn.Zap,{className:"h-3 w-3"});case"task":default:return(0,rn.jsx)(Sn.AlertCircle,{className:"h-3 w-3"})}},n=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return i?(0,rn.jsx)(H,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:r,onClick:l,children:(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-rn font-medium ${n()}`,children:c()}),(0,rn.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,rn.jsxs)(H,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-Di",draggable:!0,onDragStart:r,onClick:l,children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,rn.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${n()}`,children:[c(),(0,rn.jsx)("span",{className:"capitalize",children:e.type})]}),(0,rn.jsxs)("div",{className:"flex gap-1",children:[(0,rn.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-rn font-medium ${s()}`,children:e.priority}),(0,rn.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-rn font-medium",children:e.storyPoints})]})]}),(0,rn.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,rn.jsx)(Sn.User,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:e.assignee?.value?.name})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var mo=ae(require("react")),jo=ae(require("@radix-Di/react-toggle-group"));var ql=ae(require("react")),ks=ae(require("@radix-Di/react-toggle"));var Ts=(0,yn.cva)("inline-flex items-center justify-center gap-2 rounded-Di text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),ym=ql.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,rn.jsx)(ks.Root,{ref:i,className:f(Ts({variant:t,size:a,className:e})),...o}));ym.displayName=ks.Root.displayName;var Ql=mo.createContext({size:"default",variant:"default"}),po=mo.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,rn.jsx)(jo.Root,{ref:r,className:f("flex items-center justify-center gap-1",e),...i,children:(0,rn.jsx)(Ql.Provider,{value:{variant:t,size:a},children:o})}));po.displayName=jo.Root.displayName;var uo=mo.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let l=mo.useContext(Ql);return(0,rn.jsx)(jo.Item,{ref:r,className:f(Ts({variant:l.variant||a,size:l.size||o}),e),...i,children:t})});uo.displayName=jo.Item.displayName;var wm=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Sn.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Sn.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Sn.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Sn.Zap}],Nm=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],Ho=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:l})=>{let[s,c]=(0,Di.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,Di.useEffect)(()=>{e&&l&&c(m=>({...m,epic:l}))},[e,l]),(0,Di.useEffect)(()=>{e&&c({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:l||"",sprint:"none",assignee:""})},[e]);let n=m=>{m.preventDefault(),s.name.trim()&&(a({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,storyPoints:s.storyPoints,epic:Number(s.epic),sprint:Number(s.sprint),assignee:s.assignee.trim()?{relationTo:"digital-colleagues",value:Number(s.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),c({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:l||"",sprint:"",assignee:""}),t())},d=(m,b)=>{c(u=>({...u,[m]:b}))};return(0,rn.jsx)(xt,{open:e,onOpenChange:t,children:(0,rn.jsxs)(it,{className:"sm:max-w-Di",children:[(0,rn.jsx)(rt,{children:(0,rn.jsx)(st,{children:"Add New Task"})}),(0,rn.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"name",children:"Task Title"}),(0,rn.jsx)(V,{id:"name",value:s.name,onChange:m=>d("name",m.target.value),placeholder:"Enter task title",required:!0})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:s.description,onChange:m=>d("description",m.target.value),placeholder:"Enter task description",rows:3})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:"Type"}),(0,rn.jsx)(po,{type:"single",value:s.type||"",onValueChange:m=>m&&d("type",m),children:wm.map(m=>{let b=m.icon;return(0,rn.jsxs)(uo,{value:m.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,rn.jsx)(b,{className:"h-4 w-4"}),m.label]},m.value)})})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:"Priority"}),(0,rn.jsx)(po,{type:"single",value:s.priority||"",onValueChange:m=>m&&d("priority",m),children:Nm.map(m=>(0,rn.jsx)(uo,{value:m.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:m.label},m.value))})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"points",children:"Story Points"}),(0,rn.jsx)(V,{id:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:m=>d("storyPoints",parseInt(m.target.value)||1),placeholder:"Enter story points",required:!0})]}),!l&&(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"epic",children:"Epic"}),(0,rn.jsxs)(lt,{value:s.epic,onValueChange:m=>d("epic",m),children:[(0,rn.jsx)(tt,{children:(0,rn.jsx)(Et,{placeholder:"Select an epic"})}),(0,rn.jsx)(at,{children:o.map(m=>(0,rn.jsx)(Se,{value:m.id.toString(),children:(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("div",{className:`w-3 h-3 rounded-full ${m.color}`}),m.name]})},m.id))})]})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,rn.jsxs)(lt,{value:s.sprint,onValueChange:m=>d("sprint",m),children:[(0,rn.jsx)(tt,{children:(0,rn.jsx)(Et,{placeholder:"Select a sprint"})}),(0,rn.jsxs)(at,{children:[(0,rn.jsx)(Se,{value:"none",children:"No Sprint"}),i.map(m=>(0,rn.jsx)(Se,{value:m.id.toString(),children:(0,rn.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"sprint",children:"Assignee"}),(0,rn.jsxs)(lt,{value:s.assignee,onValueChange:m=>d("assignee",m),children:[(0,rn.jsx)(tt,{children:(0,rn.jsx)(Et,{placeholder:"Select an Assignee"})}),(0,rn.jsxs)(at,{children:[(0,rn.jsx)(Se,{value:"none",children:"No Assignee"}),r.map(m=>(0,rn.jsx)(Se,{value:m.id.toString(),children:(0,rn.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,rn.jsxs)(ei,{children:[(0,rn.jsx)(w,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,rn.jsx)(w,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Rs=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:l=!1})=>{let[s,c]=(0,Di.useState)(!1),[n,d]=(0,Di.useState)(""),m=()=>{l||(c(!0),d(t))},b=async()=>{n!==t&&await i(e,n),c(!1)},u=h=>{h.key==="Enter"&&!o||h.key==="Enter"&&h.ctrlKey&&o?b():h.key==="Escape"&&(c(!1),d(""))};return(0,rn.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,rn.jsx)(A,{children:a}),s?o?(0,rn.jsx)(Re,{value:n,onChange:h=>d(h.target.value),onBlur:b,onKeyDown:u,autoFocus:!0,rows:4,className:"resize-none"}):(0,rn.jsx)(V,{value:n,onChange:h=>d(h.target.value),onBlur:b,onKeyPress:u,autoFocus:!0,className:"text-lg font-medium"}):(0,rn.jsxs)("div",{onClick:m,className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,rn.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click Sn edit..."}),!l&&(0,rn.jsx)(Sn.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var td=({comments:e,onAddComment:t})=>{let[a,o]=(0,Di.useState)(""),i=l=>l.split(" ").map(s=>s[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.MessageSquare,{className:"h-5 w-5"}),(0,rn.jsx)(A,{className:"text-lg font-medium",children:"Comments"}),(0,rn.jsx)(oe,{variant:"secondary",children:e.length})]}),(0,rn.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(l=>(0,rn.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,rn.jsx)(_t,{className:"h-8 w-8 rn-1",children:(0,rn.jsx)($t,{className:"text-rn bg-muted text-muted-foreground",children:i(l.author)})}),(0,rn.jsxs)("div",{className:"flex-1",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,rn.jsx)("span",{className:"font-medium text-sm",children:l.author}),(0,rn.jsxs)("span",{className:"text-rn text-muted-foreground",children:[l.createdAt.toLocaleDateString()," at ",l.createdAt.toLocaleTimeString()]})]}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:l.text})]})]},l.id))}),(0,rn.jsxs)("div",{className:"flex gap-2",children:[(0,rn.jsx)(Re,{value:a,onChange:l=>o(l.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,rn.jsx)(w,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,rn.jsx)(Sn.Send,{className:"h-4 w-4"})})]})]})};var wr=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[l,s]=(0,Di.useState)(!1),c=o.find(d=>d.value===t);return(0,rn.jsxs)("div",{className:"space-y-1",children:[(0,rn.jsx)(A,{className:"text-rn text-muted-foreground",children:e}),(0,rn.jsxs)(lt,{value:t,onValueChange:a,open:l,onOpenChange:d=>{r||s(d)},disabled:r,children:[(0,rn.jsx)(tt,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-Di",children:(0,rn.jsxs)(oe,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&s(!l),children:[i&&c?.color&&(0,rn.jsx)("div",{className:`w-2 h-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,rn.jsx)(at,{children:o.map(d=>(0,rn.jsx)(Se,{value:d.value,children:i&&d.color?(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var ot=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var Cm=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Sn.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Sn.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Sn.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Sn.Zap}],Sm=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var od=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:l,isUpdating:s=!1,isDeleting:c=!1,deleteState:n="idle",teamMembers:d})=>{let[m,b]=(0,Di.useState)(e.storyPoints),u=(0,Di.useRef)(null),h=(0,Di.useCallback)((y,D)=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{i(y,D)},500)},[i]);(0,Di.useEffect)(()=>{h("storyPoints",m?.toString()||"1")},[m]);let x=y=>y.split(" ").map(D=>D[0]).join("").toUpperCase(),p=()=>n==="loading"?(0,rn.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-rn gap-1",children:[(0,rn.jsx)(Sn.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):n==="success"?(0,rn.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-rn gap-1",children:[(0,rn.jsx)(Sn.Check,{className:"h-3 w-3"}),"Deleted"]}):n==="error"?(0,rn.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-rn gap-1",children:[(0,rn.jsx)(Sn.rn,{className:"h-3 w-3"}),"Delete failed"]}):(0,rn.jsxs)(w,{onClick:l,variant:"destructive",className:"w-full h-8 text-rn gap-1",disabled:s||c,children:[(0,rn.jsx)(Sn.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,rn.jsxs)("div",{className:"flex flex-col h-full",children:[(0,rn.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{className:"text-rn text-muted-foreground",children:"Status"}),(0,rn.jsx)(wr,{label:"",value:e.status,onValueChange:y=>i("status",y),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"Sn Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{className:"text-rn text-muted-foreground",children:"Type"}),(0,rn.jsx)(po,{type:"single",value:e.type||"",onValueChange:y=>y&&i("type",y),className:"grid grid-cols-2 gap-1",disabled:s,children:Cm.map(y=>{let D=y.icon;return(0,rn.jsxs)(uo,{value:y.value,className:"flex items-center gap-1 text-rn h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,rn.jsx)(D,{className:"h-3 w-3"}),y.label]},y.value)})})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{className:"text-rn text-muted-foreground",children:"Priority"}),(0,rn.jsx)(po,{type:"single",value:e.priority||"",onValueChange:y=>y&&i("priority",y),className:"grid grid-cols-3 gap-1",disabled:s,children:Sm.map(y=>(0,rn.jsx)(uo,{value:y.value,className:"text-rn h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:y.label},y.value))})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{className:"text-rn text-muted-foreground",children:"Story Points"}),(0,rn.jsx)("input",{type:"number",min:"1",max:"100",value:m||1,onChange:y=>{let D=Number(y.target.value);D<1?b(1):D>100?b(100):b(D)},className:"w-full h-8 px-2 text-rn border border-border rounded-Di focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:s})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{className:"text-rn text-muted-foreground",children:"Epic"}),(0,rn.jsx)(wr,{label:"",value:ot(e.epic).toString(),onValueChange:y=>i("epicId",y),options:(t||[]).map(y=>({value:y.id.toString(),label:y?.name,color:y.color})),showColor:!0,disabled:s})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{className:"text-rn text-muted-foreground",children:"Sprint"}),(0,rn.jsx)(wr,{label:"",value:ot(e.sprint).toString()||"none",onValueChange:y=>i("sprintId",y==="none"?"":y),options:[{value:"none",label:"No Sprint"},...(a||[]).map(y=>({value:y.id.toString(),label:`${y?.name}`}))],disabled:s})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{className:"text-rn text-muted-foreground",children:"Assignee"}),(0,rn.jsx)(er,{label:"",value:e.assignee?.value?.name,onValueChange:y=>i("assignee",y),options:d.map(y=>({value:`${typeof y.email=="string"?"users":"digital-colleagues"}:${y.id}`,label:y?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,rn.jsxs)("div",{className:"rn-auto Di-4 space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(w,{onClick:r,variant:"outline",className:"w-full h-8 text-rn",disabled:s||c,children:"Close"}),p()]}),(0,rn.jsxs)("div",{className:"Di-4 border-t border-border space-y-2",children:[(0,rn.jsx)("div",{className:"text-rn text-muted-foreground font-medium mb-2",children:"Information"}),(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("span",{className:"text-rn text-muted-foreground",children:"Logged By"}),(0,rn.jsxs)("div",{className:"flex items-center gap-1 text-rn text-muted-foreground",children:[(0,rn.jsx)(Sn.User,{className:"h-3 w-3"}),(0,rn.jsx)("span",{children:"System"})]})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("span",{className:"text-rn text-muted-foreground",children:"Created"}),(0,rn.jsxs)("div",{className:"flex items-center gap-1 text-rn text-muted-foreground",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-3 w-3"}),(0,rn.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("span",{className:"text-rn text-muted-foreground",children:"Last Updated"}),(0,rn.jsxs)("div",{className:"flex items-center gap-1 text-rn text-muted-foreground",children:[(0,rn.jsx)(Sn.Clock,{className:"h-3 w-3"}),(0,rn.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var id=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:l,onAddComment:s,colleagues:c})=>{let[n,d]=(0,$a.useState)(a),[m,b]=(0,$a.useState)(new Date),[u,h]=(0,$a.useState)("idle"),[x,p]=(0,$a.useState)("idle"),[y,D]=(0,$a.useState)([]);(0,$a.useEffect)(()=>{d(a)},[a]);let G=async(R,te)=>{if(te!==n[R]){h("loading");try{let S=await r(n.id.toString(),{[R]:te});d(S),b(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(S){console.log("error",S),h("error"),setTimeout(()=>h("idle"),3e3)}}},F=async(R,te)=>{if(te!==n[R]){h("loading");try{let S=await r(n.id.toString(),{[R]:te});d(S),b(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},J=async R=>{if(s){h("loading");try{let te=await s?.({content:R,taskId:n.id.toString()});d(te),b(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},k=async()=>{p("loading");try{await l(n.id.toString()),p("success"),setTimeout(()=>{t(),p("idle")},1e3)}catch{p("error"),setTimeout(()=>p("idle"),3e3)}},Y=u!=="loading"&&x!=="loading",I=()=>{Y&&t()},M=()=>u==="loading"?(0,rn.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,rn.jsx)(Sn.Loader2,{className:"h-4 w-4 animate-spin"}),(0,rn.jsx)("span",{children:"Updating..."})]}):u==="success"?(0,rn.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,rn.jsx)(Sn.Check,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:"Updated successfully"})]}):u==="error"?(0,rn.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:"Update failed"})]}):null;return(0,rn.jsx)(xt,{open:e,onOpenChange:I,children:(0,rn.jsxs)(it,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,rn.jsxs)(rt,{children:[(0,rn.jsx)(st,{className:"sr-only",children:n.name}),(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("div",{className:"flex-1",children:M()}),!Y&&(0,rn.jsx)("div",{className:"text-rn text-muted-foreground",children:"Please wait..."})]})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,rn.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,rn.jsx)(Rs,{fieldName:"name",value:n.name||"",label:"",onSave:G,className:"border-b border-border pb-3",disabled:u==="loading"}),(0,rn.jsx)(Rs,{fieldName:"description",value:n.description||"",label:"Description",multiline:!0,onSave:G,disabled:u==="loading"}),(0,rn.jsx)(td,{comments:(n?.comments||[]).map(R=>({author:R.author.value.name||"",createdAt:new Date(R.timestamp),text:R.text,id:R.id||""})),onAddComment:J})]}),(0,rn.jsx)(od,{task:n,epics:o,sprints:i,lastUpdated:m,onUpdateTask:F,onClose:I,onDelete:k,isUpdating:u==="loading",isDeleting:x==="loading",deleteState:x,teamMembers:c})]})]})})};var Uo=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,Di.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),r=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],l=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],s=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],c=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),i({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},n=(d,m)=>{i(b=>({...b,[d]:m}))};return(0,rn.jsx)(xt,{open:e,onOpenChange:t,children:(0,rn.jsxs)(it,{className:"sm:max-w-Di",children:[(0,rn.jsx)(rt,{children:(0,rn.jsx)(st,{children:"Add New Epic"})}),(0,rn.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"name",children:"Epic Name"}),(0,rn.jsx)(V,{id:"name",value:o.name,onChange:d=>n("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:o.description,onChange:d=>n("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:"Color"}),(0,rn.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(d=>(0,rn.jsx)("button",{type:"button",onClick:()=>n("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:"Confidence"}),(0,rn.jsxs)(lt,{value:o.confidence,onValueChange:d=>n("confidence",d),children:[(0,rn.jsx)(tt,{children:(0,rn.jsx)(Et,{})}),(0,rn.jsx)(at,{children:l.map(d=>(0,rn.jsx)(Se,{value:d.value,children:d.label},d.value))})]})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:"Phase"}),(0,rn.jsxs)(lt,{value:o.phase.toString(),onValueChange:d=>n("phase",parseInt(d)),children:[(0,rn.jsx)(tt,{children:(0,rn.jsx)(Et,{})}),(0,rn.jsx)(at,{children:s.map(d=>(0,rn.jsx)(Se,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:"Start Date"}),(0,rn.jsx)(V,{type:"date",value:o.startDate,onChange:d=>n("startDate",d.target.value)})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:"End Date"}),(0,rn.jsx)(V,{type:"date",value:o.endDate,onChange:d=>n("endDate",d.target.value)})]})]}),(0,rn.jsxs)(ei,{children:[(0,rn.jsx)(w,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,rn.jsx)(w,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var sd=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:l,onUpdateTask:s,onDeleteTask:c,onTaskClick:n,onAddEpic:d,onAddComment:m})=>{let[b,u]=(0,Di.useState)(e),[h,x]=(0,Di.useState)(t),[p,y]=(0,Di.useState)(a),[D,G]=(0,Di.useState)(!1),[F,J]=(0,Di.useState)(!1),[k,Y]=(0,Di.useState)(null),[I,M]=(0,Di.useState)(null),[R,te]=(0,Di.useState)(o),[S,Pt]=(0,Di.useState)(i),[C,ge]=(0,Di.useState)(0),ie=(0,Di.useRef)(null),Ct=(0,Di.useRef)(null),Qe=h.filter(q=>!0).map(q=>q.id),Xt=p.find(q=>q.isSelected);Qe.push(0),(0,Di.useEffect)(()=>{u(e)},[e]),(0,Di.useEffect)(()=>{x(t)},[t]),(0,Di.useEffect)(()=>{y(a)},[a]),(0,Di.useEffect)(()=>{let q=()=>{if(ie.current){let St=ie.current.offsetHeight;ge(St)}};q();let Be=new ResizeObserver(q);ie.current&&Be.observe(ie.current);let Fe=()=>{setTimeout(q,100)};return window.addEventListener("storage",Fe),()=>{Be.disconnect(),window.removeEventListener("storage",Fe)}},[]),(0,Di.useEffect)(()=>{let q=setTimeout(()=>{ie.current&&ge(ie.current.offsetHeight)},300);return()=>clearTimeout(q)},[D,F]);let Ut=b.filter(q=>!0),B=q=>Ut.filter(Be=>Be.status===q),Ce=q=>{let Be={};return h.forEach(Fe=>{Be[Fe.id]=q.filter(St=>ot(St.epic)===Fe.id)}),Be["Oa-epic"]=q.filter(Fe=>!ot(Fe.epic)),Be},qe=q=>{M(q)},Rt=q=>{I&&(u(Be=>Be.map(Fe=>Fe.id===I.id?{...Fe,status:q}:Fe)),s?.(I.id.toString(),{status:q}),M(null))},Ae=q=>{let Be={...q,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};u(Fe=>[...Fe,Be]),l?.(q)},P=async(q,Be)=>{if(u(St=>St.map(It=>It.id===Number(q)?{...It,...Be}:It)),s)return await s(q,Be);let Fe=b.find(St=>St.id===Number(q));if(!Fe)throw new Error("Task not found");return{...Fe,...Be}},gt=async q=>{u(Be=>Be.filter(Fe=>Fe.id!==Number(q))),k?.id===Number(q)&&Y(null),c&&await c(q)},At=q=>{let Be={...q,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};x(Fe=>[...Fe,Be]),d?.(q)},fo=q=>{Y(q),n?.(q)},Ia=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"Sn Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Wa=C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)";return(0,rn.jsxs)("div",{ref:Ct,className:"h-full flex flex-col px-2 Di:px-4 py-4",children:[(0,rn.jsx)("div",{ref:ie,className:"flex-shrink-0",children:(0,rn.jsx)(je,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-Sn-r from-purple-600 via-violet-600 Sn-indigo-600",primaryAction:{label:"Add task",onClick:()=>G(!0)},secondaryAction:{label:"Add epic",onClick:()=>J(!0)}})}),(0,rn.jsx)("div",{className:"flex-1 min-h-0 rn-8",children:(0,rn.jsx)("div",{className:"h-full",style:{height:C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)"},children:(0,rn.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Ia.map(q=>{let Be=B(q.status),Fe=Ce(Be);return(0,rn.jsxs)(Jl,{title:q.title,status:q.status,taskCount:Be.length,onDrop:Rt,isCompact:q.status==="done",height:Wa,children:[Fe["Oa-epic"].map(St=>(0,rn.jsx)(wi,{epic:null,task:St,onDragStart:qe,onTaskClick:fo,isCompact:q.status==="done"})),Qe.map(St=>{let It=h.find(L=>L.id===St),N=Fe[St]||[];return N.length===0?null:(0,rn.jsxs)("div",{className:"mb-6",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,rn.jsx)("div",{className:`w-3 h-3 rounded-full ${It?.color}`}),(0,rn.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:It?.name||"No Epic"}),(0,rn.jsx)(oe,{variant:"secondary",className:"text-rn",children:N.length})]})," ",(0,rn.jsx)("div",{className:"space-y-3",children:N.map(L=>(0,rn.jsx)(wi,{task:L,epic:It,onDragStart:qe,onTaskClick:fo,isCompact:q.status==="done"},L.id))})]},St)})]},q.id)})})})}),(0,rn.jsx)(Ho,{isOpen:D,onClose:()=>G(!1),onAddTask:Ae,assignees:[...S,...R],epics:h,sprints:p}),(0,rn.jsx)(Uo,{isOpen:F,onClose:()=>J(!1),onAddEpic:At}),k&&(0,rn.jsx)(id,{isOpen:!!k,onClose:()=>Y(null),initialTask:k,epics:h,sprints:p,onUpdateTask:P,onDeleteTask:gt,colleagues:[...S,...R],onAddComment:m})]})};var nd=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:l,onUpdateEpic:s,onDeleteEpic:c})=>{let[n,d]=(0,Di.useState)(t),[m,b]=(0,Di.useState)(null),[u,h]=(0,Di.useState)(null),[x,p]=(0,Di.useState)({}),[y,D]=(0,Di.useState)(0),[G,F]=(0,Di.useState)(!1),[J,k]=(0,Di.useState)(!1),[Y,I]=(0,Di.useState)(null),M=(0,Di.useRef)(null),R=(0,Di.useRef)(null);(0,Di.useEffect)(()=>{d(t)},[t]),(0,Di.useEffect)(()=>{let B=()=>{if(M.current){let Rt=M.current.offsetHeight;D(Rt)}};B();let Ce=new ResizeObserver(B);M.current&&Ce.observe(M.current);let qe=()=>{setTimeout(B,100)};return window.addEventListener("storage",qe),()=>{Ce.disconnect(),window.removeEventListener("storage",qe)}},[]),(0,Di.useEffect)(()=>{let B=setTimeout(()=>{M.current&&D(M.current.offsetHeight)},300);return()=>clearTimeout(B)},[u]);let te=B=>{b(B)},S=B=>{B.preventDefault()},Pt=(B,Ce)=>{B.preventDefault(),m&&ot(m.epic).toString()!==Ce&&(o(m.id.toString(),{epic:Number(Ce)}),b(null))},C=B=>e.filter(Ce=>ot(Ce.epic).toString()===B),ge=B=>{h(B.id.toString()),p({name:B.name,description:B.description,confidence:B.confidence,phase:B.phase})},ie=async()=>{u&&x.name&&(await s(u.toString(),x),d(B=>B.map(Ce=>Ce.id.toString()===u?{...Ce,...x}:Ce)),h(null),p({}))},Ct=()=>{h(null),p({})},Qe=async B=>{window.confirm("Are you sure you want Sn delete this epic? This will also delete all associated tasks.")&&(await c(B),d(Ce=>Ce.filter(qe=>qe.id.toString()!==B)))},Xt=B=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[B]||`Phase ${B}`,Ut=B=>{switch(B){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)("div",{ref:R,className:"h-full flex flex-col px-2 Di:px-4 py-4",children:[(0,rn.jsx)("div",{ref:M,className:"flex-shrink-0",children:(0,rn.jsx)(je,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-Sn-r from-rose-600 via-pink-600 Sn-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>F(!0)}})}),(0,rn.jsx)("div",{className:"flex-1 min-h-0 rn-8",children:(0,rn.jsx)("div",{className:"h-full overflow-y-auto",style:{height:y>0?`calc(100vh - ${y+120}px)`:"calc(100vh - 12rem)"},children:(0,rn.jsx)("div",{className:"grid grid-cols-1 Di:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:n.map(B=>{let Ce=C(B.id.toString()),qe=Ce.reduce((Ae,P)=>Ae+(P.storyPoints||0),0),Rt=y>0?`calc(100vh - ${y+200}px)`:"calc(100vh - 14rem)";return(0,rn.jsxs)(H,{className:`flex flex-col ${u===B.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:u===B.id.toString()?"auto":Rt,minHeight:"400px"},onDragOver:S,onDrop:Ae=>Pt(Ae,B.id.toString()),children:[(0,rn.jsx)("div",{className:"p-4 border-b border-border",children:u===B.id.toString()?(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)(V,{value:x.name||"",onChange:Ae=>p({...x,name:Ae.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,rn.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,rn.jsx)(w,{size:"sm",variant:"ghost",onClick:ie,className:"p-1 h-8 w-8",children:(0,rn.jsx)(Sn.Check,{className:"h-4 w-4"})}),(0,rn.jsx)(w,{size:"sm",variant:"ghost",onClick:Ct,className:"p-1 h-8 w-8",children:(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"})})]})]}),(0,rn.jsx)(Re,{value:x.description||"",onChange:Ae=>p({...x,description:Ae.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("label",{className:"text-rn text-muted-foreground",children:"Confidence"}),(0,rn.jsxs)("select",{value:x.confidence||B.confidence,onChange:Ae=>p({...x,confidence:Ae.target.value}),className:"flex h-8 w-full rounded-Di border border-input bg-background px-3 py-2 text-rn ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,rn.jsx)("option",{value:"low",children:"Low"}),(0,rn.jsx)("option",{value:"medium",children:"Medium"}),(0,rn.jsx)("option",{value:"high",children:"High"})]})]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("label",{className:"text-rn text-muted-foreground",children:"Phase"}),(0,rn.jsx)("select",{value:x.phase?.toString()||B.phase.toString(),onChange:Ae=>p({...x,phase:parseInt(Ae.target.value)}),className:"flex h-8 w-full rounded-Di border border-input bg-background px-3 py-2 text-rn ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(Ae=>(0,rn.jsxs)("option",{value:Ae.toString(),children:["Phase ",Ae]},Ae))})]})]})]}):(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,rn.jsx)("div",{className:`w-4 h-4 rounded-full ${B.color}`}),(0,rn.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:B.name}),(0,rn.jsxs)("div",{className:"flex gap-1",children:[(0,rn.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>ge(B),className:"p-1 h-8 w-8",children:(0,rn.jsx)(Sn.Edit2,{className:"h-3 w-3"})}),(0,rn.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>Qe(B.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,rn.jsx)(Sn.Trash2,{className:"h-3 w-3"})})]})]}),(0,rn.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,rn.jsxs)(oe,{className:`text-rn ${Ut(B.confidence)}`,children:[B.confidence," confidence"]}),(0,rn.jsxs)(oe,{variant:"outline",className:"text-rn",children:["Phase ",B.phase]}),(0,rn.jsxs)(oe,{variant:"secondary",className:"text-rn bg-muted text-muted-foreground",children:[Ce.length," tasks"]}),(0,rn.jsxs)(oe,{variant:"secondary",className:"text-rn bg-muted text-muted-foreground",children:[qe," pts"]})]}),B.description&&(0,rn.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:B.description}),(0,rn.jsxs)(w,{onClick:()=>{k(!0),I(B)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,rn.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,rn.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${m?"border-primary bg-primary/10":"border-border"}`,children:Ce.length===0?(0,rn.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,rn.jsx)(Sn.Move,{className:"h-8 w-8 mb-2"}),(0,rn.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):Ce.map(Ae=>(0,rn.jsx)(wi,{task:Ae,epic:B,onDragStart:te,onTaskClick:i,isCompact:!0},Ae.id))})})]},B.id)})})})})]}),(0,rn.jsx)(Uo,{isOpen:G,onClose:()=>F(!1),onAddEpic:l}),(0,rn.jsx)(Ho,{isOpen:J,onClose:()=>k(!1),onAddTask:r,assignees:[],epics:[],defaultEpicId:Y?.id.toString()||"",sprints:a})]})};var ld=require("react-day-picker");function Nr({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,rn.jsx)(ld.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:f("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center Di-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:f(ki({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-Di w-8 font-normal text-[0.8rem]",row:"flex w-full rn-2",cell:f("relative p-0 text-center text-sm focus-within:relative focus-within:rn-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-Di",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-Di [&:has(>.day-range-start)]:rounded-l-Di first:[&:has([aria-selected])]:rounded-l-Di last:[&:has([aria-selected])]:rounded-r-Di":"[&:has([aria-selected])]:rounded-Di"),day:f(ki({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}Nr.displayName="Calendar";var cd=ae(require("react")),ba=ae(require("@radix-Di/react-popover"));var Is=ba.Root,Ms=ba.Trigger;var Cr=cd.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,rn.jsx)(ba.Portal,{children:(0,rn.jsx)(ba.Content,{ref:i,align:t,sideOffset:a,className:f("rn-50 w-72 rounded-Di border bg-popover p-4 text-popover-foreground shadow-Di outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Cr.displayName=ba.Content.displayName;var Bs=require("date-fns");var pd=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,Di.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),r=s=>{s.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),i({name:"",description:"",startDate:void 0,endDate:void 0}),t())},l=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,rn.jsx)(xt,{open:e,onOpenChange:l,children:(0,rn.jsxs)(it,{className:"sm:max-w-Di",children:[(0,rn.jsx)(rt,{children:(0,rn.jsx)(st,{children:"Add New Sprint"})}),(0,rn.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"name",children:"Sprint Name *"}),(0,rn.jsx)(V,{id:"name",value:o.name,onChange:s=>i(c=>({...c,name:s.target.value})),placeholder:"e.rn., Sprint 3",required:!0})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:o.description,onChange:s=>i(c=>({...c,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:"Start Date *"}),(0,rn.jsxs)(Is,{children:[(0,rn.jsx)(Ms,{asChild:!0,children:(0,rn.jsxs)(w,{variant:"outline",className:f("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,rn.jsx)(Sn.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Bs.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,rn.jsx)(Cr,{className:"w-auto p-0",align:"start",children:(0,rn.jsx)(Nr,{mode:"single",selected:o.startDate,onSelect:s=>i(c=>({...c,startDate:s})),initialFocus:!0})})]})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:"End Date *"}),(0,rn.jsxs)(Is,{children:[(0,rn.jsx)(Ms,{asChild:!0,children:(0,rn.jsxs)(w,{variant:"outline",className:f("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,rn.jsx)(Sn.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Bs.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,rn.jsx)(Cr,{className:"w-auto p-0",align:"start",children:(0,rn.jsx)(Nr,{mode:"single",selected:o.endDate,onSelect:s=>i(c=>({...c,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,rn.jsxs)("div",{className:"flex justify-end gap-3 Di-4",children:[(0,rn.jsx)(w,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),(0,rn.jsx)(w,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Sr=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r,onUpdateSprint:l,onDeleteSprint:s})=>{let[c,n]=(0,Di.useState)([]),[d,m]=(0,Di.useState)(new Set),[b,u]=(0,Di.useState)(null),[h,x]=(0,Di.useState)(!1),[p,y]=(0,Di.useState)(null),[D,G]=(0,Di.useState)(null),[F,J]=(0,Di.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[k,Y]=(0,Di.useState)([]),[I,M]=(0,Di.useState)("upcoming"),[R,te]=(0,Di.useState)(!1),[S,Pt]=(0,Di.useState)(0),C=(0,Di.useRef)(null),ge=(0,Di.useRef)(null);(0,Di.useEffect)(()=>{let N=()=>{C.current&&Pt(C.current.offsetHeight)};N();let L=new ResizeObserver(N);return C.current&&L.observe(C.current),()=>L.disconnect()},[]);let ie=N=>t.find(L=>L.id===Number(N)),Ct=N=>a.find(L=>L.id===Number(N)),Qe=N=>{let L={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return L[N]||L.medium},Xt=N=>{if(!N||N?.length===0)return"";let L=N?.trim().split(" ");if(L?.length===1)return L[0];let De=L[0],Ie=L[L.length-1][0].toUpperCase();return`${De} ${Ie}`},Ut=N=>{let L={},De=[];return N.forEach(Ie=>{Ie.epic?(L[ot(Ie.epic)]||(L[ot(Ie.epic)]=[]),L[ot(Ie.epic)].push(Ie)):De.push(Ie)}),{tasksByEpic:L,unassignedTasks:De}};(0,Di.useEffect)(()=>{Y(a)},[a]);let B=k.filter(N=>{switch(I){default:return!0}}),Ce=k.filter(N=>c.includes(N.id.toString())),qe=e.filter(N=>!N.sprint||N.status==="backlog"),Rt=qe.reduce((N,L)=>N+(L.storyPoints||0),0),Ae=N=>{n(L=>L.includes(N)?L.filter(De=>De!==N):L?.length<3?[...L,N]:L)},P=N=>{m(L=>{let De=new Set(L);return De.has(N)?De.delete(N):De.add(N),De})},gt=N=>{r(N),x(!1)},At=N=>{G(N.id.toString()),J({name:N.name,description:N.description||"",startDate:N.startDate?new Date(N.startDate).toISOString().split("T")[0]:N.startDate,endDate:N.endDate?new Date(N.endDate).toISOString().split("T")[0]:N.endDate,isActive:!1})},fo=()=>{D&&(l(D,{name:F.name,description:F.description,startDate:F.startDate,endDate:F.endDate}),Y(N=>N.map(L=>(L.id===Number(D)&&(L.name=F.name,L.description=F.description,L.startDate=F.startDate,L.endDate=F.endDate),L))),G(null))},Ia=()=>{G(null),J({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Wa=(N,L)=>{u(L),N.dataTransfer.effectAllowed="move"},q=N=>{N.preventDefault(),N.dataTransfer.dropEffect="move"},Be=N=>{y(N)},Fe=()=>{y(null)},St=(N,L)=>{if(N.preventDefault(),y(null),!b)return;(ot(b.sprint)||void 0)!==Number(L)&&o(b.id.toString(),{sprint:Number(L)}),u(null)},It=({task:N,showSprint:L=!1})=>{let De=N.epic?ie(ot(N.epic).toString()):null,Ie=N.sprint?Ct(ot(N.sprint).toString()):null;return(0,rn.jsx)(H,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-Di transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:Lt=>{Lt.dataTransfer.effectAllowed="move",Lt.dataTransfer.setData("text/plain",N.id.toString()),Wa(Lt,N)},onClick:Lt=>{b===null&&i(N)},style:{userSelect:"none"},children:(0,rn.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,rn.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,rn.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:N.name}),(0,rn.jsx)(oe,{className:`text-rn ${Qe(N.priority||"medium")}`,children:N.priority?.[0]?.toUpperCase()})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-rn",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-1",children:[De&&(0,rn.jsx)("div",{className:`w-2 h-2 rounded-full ${De.color}`}),(0,rn.jsx)("span",{className:"text-muted-foreground truncate",children:De?.name})]}),(0,rn.jsx)("span",{className:"text-muted-foreground",children:Xt(N.assignee?.value?.name)})]}),L&&Ie&&(0,rn.jsxs)("div",{className:"flex items-center gap-1 text-rn text-muted-foreground",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-3 w-3"}),(0,rn.jsx)("span",{children:Ie.name})]})]})})};return(0,rn.jsxs)("div",{ref:ge,className:"h-full flex flex-col px-2 Di:px-4 py-4",children:[(0,rn.jsx)("div",{ref:C,className:"flex-shrink-0",children:(0,rn.jsx)(je,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-Sn-r from-orange-600 via-amber-600 Sn-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>x(!0)}})}),(0,rn.jsx)("div",{className:"flex-1 min-h-0 rn-8",children:(0,rn.jsxs)("div",{className:"h-full",style:{height:S>0?`calc(100vh - ${S+120}px)`:"calc(100vh - 12rem)"},children:[(0,rn.jsxs)("div",{className:"mb-4",children:[(0,rn.jsx)(H,{className:"p-3 bg-card shadow-sm",children:(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,rn.jsxs)("p",{className:"text-rn text-muted-foreground",children:[c?.length,"/3 selected"]})]}),c?.length>0&&(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("span",{className:"text-rn text-muted-foreground",children:"Viewing:"}),(0,rn.jsx)("div",{className:"flex flex-wrap gap-1",children:Ce.map(N=>(0,rn.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-rn",children:[(0,rn.jsx)("span",{className:"max-w-[80px] truncate",children:N.name}),(0,rn.jsx)("button",{onClick:()=>Ae(N.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"})})]},N.id))})]})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsxs)(w,{onClick:()=>x(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,rn.jsx)(Sn.Plus,{className:"h-3 w-3"}),"Add"]}),(0,rn.jsxs)(w,{onClick:()=>te(!R),variant:"outline",size:"sm",className:"gap-1",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-3 w-3"}),R?"Close":"Select"]})]})]})}),R&&(0,rn.jsx)("div",{className:"fixed inset-0 bg-black/20 rn-[5]",onClick:()=>te(!1)}),(0,rn.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl rn-10 transition-all duration-300 ease-in-out ${R?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,rn.jsxs)(H,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,rn.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,rn.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>te(!1),className:"h-8 w-8 p-0",children:(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"})})]}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground rn-1",children:"Choose up Sn 3 sprints Sn view in your planning board"})]}),(0,rn.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,rn.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(N=>(0,rn.jsxs)(w,{variant:I===N.key?"default":"outline",size:"sm",onClick:()=>M(N.key),className:"text-rn h-8 px-3 flex-1",children:[N.label," (",N.count,")"]},N.key))}),(0,rn.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:B.length>0?B.map(N=>{let L=c.includes(N.id.toString()),De=e.filter(Dt=>ot(Dt.sprint)===N.id).length,Ie=!L&&c.length<3;return(0,rn.jsx)("div",{className:`p-3 rounded-lg border transition-all ${L?"bg-primary/10 border-primary/30":Ie?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:D===N.id.toString()?(0,rn.jsxs)("div",{className:"space-y-3",children:[(0,rn.jsx)(V,{value:F.name,onChange:Dt=>J(kt=>({...kt,name:Dt.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,rn.jsx)(Re,{value:F.description,onChange:Dt=>J(kt=>({...kt,description:Dt.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,rn.jsxs)("div",{className:"flex gap-2",children:[(0,rn.jsxs)(w,{size:"sm",onClick:()=>fo(),className:"flex-1",children:[(0,rn.jsx)(Sn.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,rn.jsxs)(w,{size:"sm",variant:"outline",onClick:Ia,className:"flex-1",children:[(0,rn.jsx)(Sn.rn,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,rn.jsxs)("div",{children:[(0,rn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,rn.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:N.name}),(0,rn.jsx)(oe,{variant:"default",className:"text-rn bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground line-clamp-2 mb-2",children:N.description}),(0,rn.jsxs)("div",{className:"flex items-center gap-3 text-rn text-muted-foreground",children:[(0,rn.jsxs)("span",{className:"flex items-center gap-1",children:[(0,rn.jsx)(Sn.CalendarDays,{className:"h-3 w-3"}),new Date(N.startDate).toLocaleDateString()]}),(0,rn.jsxs)("span",{className:"flex items-center gap-1",children:[(0,rn.jsx)(Sn.User,{className:"h-3 w-3"}),De," tasks"]})]})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,rn.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>At(N),className:"h-6 w-6 p-0",children:(0,rn.jsx)(Sn.Edit2,{className:"h-3 w-3"})}),(0,rn.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>s(N.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,rn.jsx)(Sn.Trash2,{className:"h-3 w-3"})})]})]}),(0,rn.jsx)("div",{className:"flex items-center justify-between rn-2",children:(0,rn.jsx)(w,{variant:L?"default":"outline",size:"sm",className:"text-rn w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Ae(N.id.toString()),disabled:!L&&c?.length>=3,children:(0,rn.jsx)("span",{className:"pointer-events-none select-none",children:L?"Deselect":c?.length>=3?"Limit Reached":"Select"})})})]})},N.id)}):(0,rn.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,rn.jsxs)("p",{className:"text-sm",children:['No sprints found for "',I,'" filter']}),(0,rn.jsx)(w,{variant:"link",size:"sm",onClick:()=>M("all"),className:"text-rn",children:"Show all sprints"})]})}),c?.length===0&&(0,rn.jsx)("div",{className:"rn-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,rn.jsxs)("div",{className:"text-center",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints Sn start planning"}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground rn-1",children:"Choose up Sn 3 sprints Sn view alongside your backlog"})]})})]})]})})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,rn.jsx)("div",{className:"lg:col-span-1",children:(0,rn.jsxs)(H,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-Di transition-shadow duration-200 flex flex-col",onDragOver:q,onDragEnter:()=>Be("backlog"),onDragLeave:Fe,onDrop:N=>St(N,"backlog"),style:{height:S>0?`calc(100vh - ${S+200}px)`:"calc(100vh - 16rem)"},children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,rn.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsxs)(oe,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[qe?.length," tasks"]}),(0,rn.jsxs)(oe,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[Rt," pts"]})]})]}),(0,rn.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${p==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:N,unassignedTasks:L}=Ut(qe);return(0,rn.jsxs)(rn.Fragment,{children:[Object.entries(N).map(([De,Ie])=>{let Dt=ie(De);if(!Dt)return null;let kt=d.has(De);return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-rn cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>P(De),children:[(0,rn.jsx)("div",{className:`w-3 h-3 rounded-full ${Dt.color}`}),(0,rn.jsx)("span",{className:"font-medium text-muted-foreground",children:Dt.name}),(0,rn.jsxs)("span",{className:"text-muted-foreground",children:["(",Ie?.length,")"]}),(0,rn.jsx)("div",{className:"ml-auto",children:kt?(0,rn.jsx)(Sn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rn.jsx)(Sn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!kt&&(0,rn.jsx)("div",{className:"space-y-2 pl-2",children:Ie.map(Lt=>(0,rn.jsx)(It,{task:Lt},Lt.id))})]},De)}),L?.length>0&&(()=>{let De=d.has("Oa-epic");return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-rn cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>P("Oa-epic"),children:[(0,rn.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,rn.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,rn.jsxs)("span",{className:"text-muted-foreground",children:["(",L?.length,")"]}),(0,rn.jsx)("div",{className:"ml-auto",children:De?(0,rn.jsx)(Sn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rn.jsx)(Sn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!De&&(0,rn.jsx)("div",{className:"space-y-2 pl-2",children:L?.map(Ie=>(0,rn.jsx)(It,{task:Ie},Ie.id))})]})})(),qe?.length===0&&(0,rn.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here Sn move Sn backlog"}),qe?.length>0&&Object.keys(N).length===0&&L.length===0&&(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)("div",{className:"text-rn text-muted-foreground mb-2",children:"Direct backlog tasks:"}),qe?.map(De=>(0,rn.jsx)(It,{task:De},De.id))]})]})})()})]})}),Ce.map(N=>{let L=e.filter(Ie=>ot(Ie?.sprint)===N.id),De=L.reduce((Ie,Dt)=>Ie+(Dt?.storyPoints||0),0);return(0,rn.jsxs)(H,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-Di transition-shadow duration-200 flex flex-col",onDragOver:q,onDragEnter:()=>Be(N.id.toString()),onDragLeave:Fe,onDrop:Ie=>St(Ie,N.id.toString()),style:{height:S>0?`calc(100vh - ${S+200}px)`:"calc(100vh - 16rem)"},children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,rn.jsx)("div",{children:(0,rn.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:N.name})}),(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsxs)(oe,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[L?.length," tasks"]}),(0,rn.jsxs)(oe,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[De," pts"]}),(0,rn.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>{te(!0),At(N)},className:"h-6 px-2",children:(0,rn.jsx)(Sn.Edit2,{className:"h-3 w-3"})}),(0,rn.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>s(N.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,rn.jsx)(Sn.Trash2,{className:"h-3 w-3"})})]})]}),(0,rn.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:Ie,unassignedTasks:Dt}=Ut(L);return(0,rn.jsxs)(rn.Fragment,{children:[Object.entries(Ie).map(([kt,Lt])=>{let Go=ie(kt);if(!Go)return null;let _o=d.has(kt);return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-rn cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>P(kt),children:[(0,rn.jsx)("div",{className:`w-3 h-3 rounded-full ${Go.color}`}),(0,rn.jsx)("span",{className:"font-medium text-muted-foreground",children:Go.name}),(0,rn.jsxs)("span",{className:"text-muted-foreground",children:["(",Lt?.length,")"]}),(0,rn.jsx)("div",{className:"ml-auto",children:_o?(0,rn.jsx)(Sn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rn.jsx)(Sn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!_o&&(0,rn.jsx)("div",{className:"space-y-2 pl-2",children:Lt?.map($o=>(0,rn.jsx)(It,{task:$o},$o.id))})]},kt)}),Dt?.length>0&&(()=>{let kt=d.has("Oa-epic");return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-rn cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>P("Oa-epic"),children:[(0,rn.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,rn.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,rn.jsxs)("span",{className:"text-muted-foreground",children:["(",Dt?.length,")"]}),(0,rn.jsx)("div",{className:"ml-auto",children:kt?(0,rn.jsx)(Sn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rn.jsx)(Sn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!kt&&(0,rn.jsx)("div",{className:"space-y-2 pl-2",children:Dt?.map(Lt=>(0,rn.jsx)(It,{task:Lt},Lt.id))})]})})(),L?.length===0&&(0,rn.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},N.id)})]}),(0,rn.jsx)(pd,{isOpen:h,onClose:()=>x(!1),onAddSprint:gt})]})})]})};var Dm=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),km=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},Fs=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[i,r]=t.split(":");o.setHours(parseInt(i),parseInt(r))}return o<a},Ls=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Tm=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Pm=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,Di.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[l,s]=(0,Di.useState)(!1),c=d=>{if(d.preventDefault(),!e.find(u=>u?.id.toString()===i.colleagueId.toString())){console.error("No valid colleague selected"),s(!0);return}s(!1);let b={title:i.title,description:i.description,dueDate:new Date(i.dueDate).toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring,assignedColleague:Number(i.colleagueId),project:1,updatedAt:new Date().toISOString()};t(b),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Di.useEffect)(()=>{i.colleagueId&&s(!1)},[i.colleagueId]);let n=e.filter(Boolean);return(0,rn.jsx)(xt,{open:a,onOpenChange:o,children:(0,rn.jsxs)(it,{className:"max-w-2xl",children:[(0,rn.jsx)(rt,{children:(0,rn.jsx)(st,{children:"Add New Reminder"})}),(0,rn.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,rn.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{htmlFor:"title",children:"Title"}),(0,rn.jsx)(V,{id:"title",value:i.title,onChange:d=>r({...i,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:i.description,onChange:d=>r({...i,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{htmlFor:"dueDate",children:"Due Date"}),(0,rn.jsx)(V,{id:"dueDate",type:"date",value:i.dueDate,onChange:d=>r({...i,dueDate:d.target.value}),required:!0})]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,rn.jsx)(V,{id:"dueTime",type:"time",value:i.dueTime,onChange:d=>r({...i,dueTime:d.target.value})})]})]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{className:`${l?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,rn.jsxs)(lt,{value:i.colleagueId,onValueChange:d=>{r({...i,colleagueId:d})},required:!0,children:[(0,rn.jsx)(tt,{className:`${l?"text-destructive border-red-500":""}`,children:(0,rn.jsx)(Et,{className:`${l?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===i.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,rn.jsx)(at,{children:n.map(d=>(0,rn.jsx)(Se,{value:d.id.toString(),children:d.name},d.id))})]}),l&&(0,rn.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:d=>r({...i,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,rn.jsx)(A,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,rn.jsxs)(lt,{value:i.recurrencePattern,onValueChange:d=>r({...i,recurrencePattern:d}),children:[(0,rn.jsx)(tt,{children:(0,rn.jsx)(Et,{})}),(0,rn.jsxs)(at,{children:[(0,rn.jsx)(Se,{value:"daily",children:"Daily"}),(0,rn.jsx)(Se,{value:"weekly",children:"Weekly"}),(0,rn.jsx)(Se,{value:"monthly",children:"Monthly"}),(0,rn.jsx)(Se,{value:"yearly",children:"Yearly"})]})]})]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{htmlFor:"recurrenceInterval",children:"Every"}),(0,rn.jsx)(V,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:d=>r({...i,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,rn.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,rn.jsx)(w,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,rn.jsx)(w,{type:"submit",children:"Add Reminder"})]})]})]})})},Rm=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,l]=(0,Di.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),s=n=>{n.preventDefault(),a(e.id.toString(),{title:r.title,description:r.description,dueDate:new Date(r.dueDate||"").toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring}),i()},c=t.filter(Boolean);return(0,rn.jsx)(xt,{open:o,onOpenChange:i,children:(0,rn.jsxs)(it,{className:"max-w-2xl",children:[(0,rn.jsx)(rt,{children:(0,rn.jsx)(st,{children:"Edit Reminder"})}),(0,rn.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,rn.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{htmlFor:"edit-title",children:"Title"}),(0,rn.jsx)(V,{id:"edit-title",value:r.title,onChange:n=>l({...r,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{htmlFor:"edit-description",children:"Description"}),(0,rn.jsx)(Re,{id:"edit-description",value:r.description||"",onChange:n=>l({...r,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,rn.jsx)(V,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:n=>l({...r,dueDate:n.target.value}),required:!0})]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(A,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,rn.jsx)(V,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:n=>l({...r,dueTime:n.target.value})})]})]}),(0,rn.jsx)("div",{className:"space-y-2",children:(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring||!1,onChange:n=>l({...r,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,rn.jsx)(A,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,rn.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,rn.jsx)(w,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,rn.jsx)(w,{type:"submit",children:"Save Changes"})]})]})]})})},Am=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,Di.useState)(!1);if(!e||!e.id)return null;let l=Fs(new Date(e.dueDate||""),e.dueTime||""),s=Ls(new Date(e.dueDate||"")),c=Tm(new Date(e.dueDate||"")),n=()=>{a(e.id.toString(),{})},d=()=>s?"Today":c?"Tomorrow":Dm(new Date(e.dueDate||""));return(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsx)(Rm,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,rn.jsx)(H,{children:(0,rn.jsx)(ve,{className:"p-4",children:(0,rn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,rn.jsx)("button",{onClick:n,className:"rn-1 text-primary hover:text-primary/80"}),(0,rn.jsxs)("div",{className:"flex-1",children:[(0,rn.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,rn.jsx)("h3",{children:e.title})}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,rn.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,rn.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-4 w-4"}),(0,rn.jsx)("span",{className:l?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,rn.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rn.jsx)(Sn.Clock,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:km(e.dueTime)})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rn.jsx)(Sn.User,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rn.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,rn.jsx)(Sn.Edit2,{className:"h-4 w-4"})}),(0,rn.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,rn.jsx)(Sn.Trash2,{className:"h-4 w-4"})})]})]})})})]})},ud=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,l]=(0,Di.useState)(e.filter(Boolean)),[s,c]=(0,Di.useState)(t.filter(Boolean)),[n,d]=(0,Di.useState)("all"),[m,b]=(0,Di.useState)(""),[u,h]=(0,Di.useState)(!1);(0,Di.useEffect)(()=>{l(e.filter(Boolean))},[e]),(0,Di.useEffect)(()=>{c(t.filter(Boolean))},[t]);let x=k=>{if(!k.title){console.error("Invalid reminder data:",k);return}let Y={...k,id:Date.now(),createdAt:new Date().toISOString()};l(I=>[...I,Y]),a?.(k)},p=(k,Y)=>{if(!k){console.error("No reminder ID provided for update");return}l(I=>I.map(M=>M?.id.toString()===k?{...M,...Y}:M)),o?.(k,Y)},y=k=>{if(!k){console.error("No reminder ID provided for deletion");return}l(Y=>Y.filter(I=>I?.id.toString()!==k)),i?.(k)},G=r.filter(k=>{if(!k)return!1;if(m){let Y=m.toLowerCase();if(!(k.title.toLowerCase().includes(Y)||k.description?.toLowerCase().includes(Y)))return!1}switch(n){case"pending":case"completed":case"overdue":return Fs(new Date(k.dueDate||""),k.dueTime||"");case"today":return Ls(new Date(k.dueDate||""));default:return!0}}).sort((k,Y)=>{if(!k||!Y)return 0;let I={high:3,medium:2,low:1},M=0;return M!==0?M:new Date(k.dueDate||"").getTime()-new Date(Y.dueDate||"").getTime()}),F={total:r.filter(Boolean).length,overdue:r.filter(k=>k&&Fs(new Date(k.dueDate||""),k.dueTime||"")).length,today:r.filter(k=>k&&Ls(new Date(k.dueDate||""))).length},J=s.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(je,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-Sn-r from-emerald-600 via-teal-600 Sn-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{h(!0)}}}),(0,rn.jsxs)("div",{className:"h-full bg-background",children:[(0,rn.jsx)(Pm,{colleagues:s,onAddReminder:x,open:u,setOpen:h}),(0,rn.jsxs)("div",{className:"p-6",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,rn.jsxs)(w,{className:"flex items-center space-x-2",onClick:()=>h(!0),children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:"Add Reminder"})]})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,rn.jsxs)(H,{className:"p-4",children:[(0,rn.jsx)("div",{className:"text-2xl font-bold text-foreground",children:F.total}),(0,rn.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,rn.jsxs)(H,{className:"p-4",children:[(0,rn.jsx)("div",{className:"text-2xl font-bold text-primary",children:F.overdue}),(0,rn.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,rn.jsxs)(H,{className:"p-4",children:[(0,rn.jsx)("div",{className:"text-2xl font-bold text-success",children:F.today}),(0,rn.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,rn.jsxs)(H,{className:"p-4",children:[(0,rn.jsx)("div",{className:"text-2xl font-bold text-destructive",children:F.overdue}),(0,rn.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,rn.jsxs)(H,{className:"p-4",children:[(0,rn.jsx)("div",{className:"text-2xl font-bold text-warning",children:F.today}),(0,rn.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,rn.jsx)("div",{className:"flex-1",children:(0,rn.jsx)(V,{placeholder:"Search reminders...",value:m,onChange:k=>b(k.target.value),className:"max-w-Di"})}),(0,rn.jsxs)(lt,{value:n,onValueChange:k=>d(k),children:[(0,rn.jsx)(tt,{className:"w-40",children:(0,rn.jsx)(Et,{})}),(0,rn.jsxs)(at,{children:[(0,rn.jsxs)(Se,{value:"all",children:["All (",F.total,")"]}),(0,rn.jsxs)(Se,{value:"overdue",children:["Overdue (",F.overdue,")"]}),(0,rn.jsxs)(Se,{value:"overdue",children:["Overdue (",F.overdue,")"]}),(0,rn.jsxs)(Se,{value:"today",children:["Today (",F.today,")"]})]})]})]}),(0,rn.jsx)("div",{className:"space-y-4",children:G.length===0?(0,rn.jsxs)(H,{className:"p-8 text-center",children:[(0,rn.jsx)("div",{className:"text-muted-foreground",children:m||n!=="all"?"No reminders match your filters":"No reminders yet"}),!m&&n==="all"&&(0,rn.jsx)("p",{className:"text-sm text-muted-foreground/60 rn-2",children:"Create your first reminder Sn get started"})]}):G.map(k=>k&&(0,rn.jsx)(Am,{reminder:k,colleagues:s,onUpdateReminder:p,onDeleteReminder:y},k.id))})]})]})]})};var gd=require("next/navigation");function Os({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:l=[],initialUsers:s=[],initialFiles:c=[],initialView:n="kanban",onAddTask:d,onUpdateTask:m,onDeleteTask:b,onTaskClick:u,onAddEpic:h,onUpdateEpic:x,onDeleteEpic:p,onAddTaskToEpic:y,onAddSprint:D,onUpdateSprint:G,onDeleteSprint:F,onAddProject:J,onUpdateProject:k,onDeleteProject:Y,onFileAdd:I,onFileEdit:M,onFileDelete:R,onFileClick:te,onAddReminder:S,onUpdateReminder:Pt,onDeleteReminder:C,onViewChange:ge,onToggleMobileMenu:ie,onTeamClick:Ct,onTeamChange:Qe,onCopilotClick:Xt,handleAddComment:Ut}){let[B,Ce]=(0,Di.useState)(t),[qe,Rt]=(0,Di.useState)(a),[Ae,P]=(0,Di.useState)(o),[gt,At]=(0,Di.useState)(i),[fo,Ia]=(0,Di.useState)(r),[Wa,q]=(0,Di.useState)(l),[Be,Fe]=(0,Di.useState)(s),[St,It]=(0,Di.useState)(c),[N,L]=(0,Di.useState)(!1),[De,Ie]=(0,Di.useState)(!1),[Dt,kt]=(0,Di.useState)(null),[Lt,Go]=(0,Di.useState)(null),[_o,$o]=(0,Di.useState)(null),[Ja,Vs]=(0,Di.useState)(n||"kanban"),[Mm,yd]=(0,Di.useState)(!1),wd=(0,gd.useRouter)();(0,Di.useEffect)(()=>{Ce(t)},[t]),(0,Di.useEffect)(()=>{P(o)},[o]),(0,Di.useEffect)(()=>{Rt(a)},[a]),(0,Di.useEffect)(()=>{At(i)},[i]),(0,Di.useEffect)(()=>{It(c)},[c]),(0,Di.useEffect)(()=>{Fe(s)},[s]),(0,Di.useEffect)(()=>{q(l)},[l]),(0,Di.useEffect)(()=>{Ia(r)},[r]),(0,Di.useEffect)(()=>{Vs(n)},[n]);let Nd=B.filter(T=>{}),Em=T=>Nd.filter(W=>W.status===T),Bm=T=>{let W={};return qe.forEach(de=>{}),W},Fm=T=>{$o(T)},Lm=T=>{_o&&(Ce(W=>W.map(de=>de.id===_o.id?{...de,status:T}:de)),$o(null))},Ks=T=>{let W={...T,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Ce(de=>[...de,W]),d?.(W)},Ci=async(T,W)=>(Ce(de=>de.map(ft=>ft.id===Number(T)?{...ft,...W}:ft)),await m?.(T,W)),Om=async(T,W)=>{Ci(T,W)},Gs=T=>{Ce(W=>W.filter(de=>de.id!==Number(T))),Dt?.id===Number(T)&&kt(null),b?.(T)},jm=async T=>{Gs(T)},Hm=T=>{let W={...T,id:Date.now()};At(de=>[...de,W]),J?.(T)},zm=(T,W)=>{At(de=>de.map(ft=>ft.id===Number(T)?{...ft,...W}:ft)),k?.(T,W)},Um=T=>{At(W=>W.filter(de=>de.id!==Number(T))),Y?.(T)},_s=T=>{let W={...T,id:Date.now()};Rt(de=>[...de,W]),h?.({...W})},Cd=()=>{Ie(!0)},Sd=(T,W)=>{Rt(de=>de.map(ft=>ft.id===Number(T)?{...ft,...W}:ft)),x?.(T,W)},Dd=T=>{Rt(W=>W.filter(de=>de.id!==Number(T))),Ce(W=>W.filter(de=>ot(de.epic)!==Number(T))),p?.(T)},kd=T=>{let W={...T,id:Date.now()};P(de=>[...de,W]),D?.(T)},Td=(T,W)=>{P(de=>de.map(ft=>ft.id===Number(T)?{...ft,...W}:ft)),G?.(T,W)},Pd=T=>{T==="backlog"||T==="all-tasks"||(P(W=>W.filter(de=>de.id!==Number(T))),Ce(W=>W.map(de=>ot(de.sprint)===Number(T)?{...de,sprint:void 0}:de)),F?.(T))},Tr=T=>{kt(T)},Rd=T=>{T==="planning"&&window.innerWidth<768||(Vs(T),ge?.(T))},Vm=()=>{yd(T=>!T),ie?.()},Km=()=>{wd.push("/")},Gm=T=>{console.log("Switching Sn team:",T)},_m=T=>{console.log("Switching Sn team:",T)},Ad=T=>{L(!0)},Id=()=>{L(!1),Go(null)},Md=T=>{let W={...T,id:Date.now(),createdAt:new Date().toISOString()};Ia(de=>[...de,W]),S?.(T)},Ed=(T,W)=>{Ia(de=>de.map(ft=>ft.id===Number(T)?{...ft,...W}:ft)),Pt?.(T,W)},Bd=T=>{Ia(W=>W.filter(de=>de.id!==Number(T))),C?.(T)},Fd=()=>{I?.()},Ld=T=>{M?.(T)},Od=T=>{It(W=>W.filter(de=>de.name!==T)),R?.(T)},jd=T=>{te?.(T)},$m=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"Sn Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Wm=()=>{switch(Ja){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},Pr=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],Jm=Pr.sort((T,W)=>W.lastUsed.getTime()-T.lastUsed.getTime()).slice(0,3),qm=Pr.length>3,Xm=Pr.slice(3);return(0,rn.jsxs)(Wl,{currentView:Ja,onViewChange:Rd,children:[Ja==="kanban"&&(0,rn.jsx)("div",{className:"h-full overflow-hidden",children:(0,rn.jsx)(sd,{initialProjects:gt,initialEpics:qe,initialSprints:Ae.map(T=>({...T,isSelected:!1})),initialTasks:B,initialColleagues:Wa,initialUsers:Be,onAddTask:Ks,onUpdateTask:Ci,onDeleteTask:Gs,onTaskClick:Tr,onAddEpic:_s,onAddComment:Ut})}),Ja==="planning"&&(0,rn.jsx)("div",{className:"hidden Di:block h-full",children:(0,rn.jsx)(Sr,{tasks:B,epics:qe,sprints:Ae,onUpdateTask:Ci,onTaskClick:Tr,onAddSprint:kd,onUpdateSprint:Td,onDeleteSprint:Pd})}),Ja==="tasks"&&(0,rn.jsx)("div",{className:"h-full",children:(0,rn.jsx)(ud,{initialReminders:fo,initialColleagues:Wa,onAddReminder:Md,onUpdateReminder:Ed,onDeleteReminder:Bd})}),Ja==="files"&&(0,rn.jsx)("div",{className:"h-full",children:(0,rn.jsx)(yi,{initialFiles:St,onFileAdd:Fd,onFileEdit:Ld,onFileDelete:Od,onFileClick:jd,compactView:!1})}),Ja==="epics"&&(0,rn.jsx)("div",{className:"h-full",children:(0,rn.jsx)(nd,{tasks:B,epics:qe,sprints:Ae,onUpdateTask:Ci,onTaskClick:Tr,onAddTaskToEpic:Ad,onAddEpic:Cd,onUpdateEpic:Sd,onDeleteEpic:Dd})}),(0,rn.jsx)(Ho,{isOpen:N,onClose:Id,onAddTask:Ks,epics:qe,sprints:Ae,assignees:[...Wa,...Be],defaultEpicId:Lt||void 0}),(0,rn.jsx)(Uo,{isOpen:De,onClose:()=>Ie(!1),onAddEpic:_s})]})}var fd=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:i=""})=>{let[r,l]=(0,Di.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,c]=(0,Di.useState)({}),n=()=>{let b={};return r.name.trim()?r.name.trim().length<3&&(b.name="Project name must rn at least 3 characters"):b.name="Project name is required",r.objectives.trim()?r.objectives.trim().length<10&&(b.objectives="Please provide more detailed objectives (at least 10 characters)"):b.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(b.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):b.workInstructions="Work instructions are required",c(b),Object.keys(b).length===0},d=async b=>{if(b.preventDefault(),!!n())try{await e(r)}catch(u){console.error("Error submitting project form:",u)}},m=(b,u)=>{l(h=>({...h,[b]:u})),s[b]&&c(h=>({...h,[b]:void 0}))};return(0,rn.jsxs)("div",{className:`w-full max-w-2xl ${i}`,children:[(0,rn.jsxs)("div",{className:"mb-4",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,rn.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions Sn help your team collaborate effectively."})]}),(0,rn.jsxs)("form",{onSubmit:d,children:[(0,rn.jsxs)("div",{className:"space-y-6",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,rn.jsx)(V,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:b=>m("name",b.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.name&&(0,rn.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,rn.jsx)(V,{id:"description",type:"text",placeholder:"Enter project description",value:r.description,onChange:b=>m("description",b.target.value),className:s.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.description&&(0,rn.jsx)("p",{className:"text-sm text-red-600",children:s.description})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,rn.jsx)(Re,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:b=>m("objectives",b.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,rn.jsxs)("div",{className:"flex justify-between text-rn text-gray-500",children:[(0,rn.jsx)("span",{children:s.objectives&&(0,rn.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,rn.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,rn.jsx)(Re,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should rn carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:b=>m("workInstructions",b.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,rn.jsxs)("div",{className:"flex justify-between text-rn text-gray-500",children:[(0,rn.jsx)("span",{children:s.workInstructions&&(0,rn.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,rn.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,rn.jsxs)("div",{className:"space-y-3",children:[(0,rn.jsx)(A,{className:"text-sm font-medium",children:"Project Management"}),(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(oi,{id:"plan",checked:r.plan,onCheckedChange:b=>m("plan",b===!0),disabled:a}),(0,rn.jsx)(A,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,rn.jsx)("p",{className:"text-rn text-gray-500 ml-6",children:"This will allow project managers Sn create sprints, assign tasks, and track progress."})]})]}),(0,rn.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,rn.jsxs)(w,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"}),"Cancel"]}),(0,rn.jsx)(w,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsx)(Sn.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function zs({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[i,r]=(0,Di.useState)(!1),[l,s]=(0,Di.useState)(!1),c=async d=>{s(!0);try{await t(d),r(!1)}catch(m){console.error("Error creating project:",m)}finally{s(!1)}},n=()=>{r(!0)};return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(Oa.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsx)(je,{title:"Project Management",description:"Organize your work into projects Sn collaborate with your team.",gradient:"bg-gradient-Sn-r from-purple-600 via-violet-600 Sn-indigo-600",primaryAction:{label:"New Project",onClick:n}}),(0,rn.jsxs)("section",{className:"space-y-4 rn-8",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-3 Di:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,rn.jsx)(nr,{project:d,onOpen:a,onShare:o},d.id))})]})]},"projects-index-view")}),(0,rn.jsx)(xt,{open:i,onOpenChange:r,children:(0,rn.jsxs)(it,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,rn.jsxs)(rt,{className:"sr-only",children:[(0,rn.jsx)(st,{children:"Create New Project"}),(0,rn.jsx)(ti,{children:"Fill out the form below Sn create a new project."})]}),(0,rn.jsx)(fd,{onSubmit:c,onCancel:()=>r(!1),isLoading:l,className:"border-0 shadow-none"})]})})]})}function bd({team:e,onOpen:t,className:a}){return(0,rn.jsx)(Oa.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,rn.jsxs)(H,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,rn.jsxs)(Ge,{children:[(0,rn.jsx)(Xe,{className:"text-lg",children:e.name}),(0,rn.jsx)(oo,{className:"rn-1 text-sm",children:e.description})]}),(0,rn.jsxs)(ve,{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Users,{className:"h-4 w-4 text-blue-500"}),(0,rn.jsx)("span",{children:"Human"})]}),(0,rn.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Bot,{className:"h-4 w-4 text-purple-500"}),(0,rn.jsx)("span",{children:"Digital"})]}),(0,rn.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm border-t Di-4",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,rn.jsx)("span",{children:"Projects"})]}),(0,rn.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,rn.jsx)(io,{className:"flex gap-2",children:(0,rn.jsx)(w,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Us({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,i]=(0,Di.useState)(!1),r=()=>{i(!0)},l=async n=>{await t?.(n),i(!1)},s=()=>{i(!1)},c=n=>{a?.(n)};return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(Oa.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Oa.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsx)(je,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-Sn-r from-blue-600 via-cyan-600 Sn-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,rn.jsxs)("section",{className:"space-y-4 rn-8",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,rn.jsxs)("div",{className:"text-center py-12",children:[(0,rn.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'rn not part of any teams yet."}),(0,rn.jsx)("p",{className:"text-muted-foreground text-sm rn-2",children:"Create a new team or ask Sn rn added Sn an existing one."})]}):(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-4 Di:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,rn.jsx)(bd,{team:n,onOpen:c},n.id))})]})]},"teams-index-view")}),(0,rn.jsx)(xt,{open:o,onOpenChange:i,children:(0,rn.jsxs)(it,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,rn.jsx)("div",{className:"sr-only",children:(0,rn.jsxs)(rt,{children:[(0,rn.jsx)(st,{children:"Create New Team"}),(0,rn.jsx)(ti,{children:"Set up a new team Sn collaborate with colleagues on projects."})]})}),(0,rn.jsx)(rr,{title:"Create New Team",submitLabel:"Create Team",onSave:l,onCancel:s})]})})]})}function xd({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:l=!1}){let[s,c]=(0,Di.useState)(""),[n,d]=(0,Di.useState)([]),[m,b]=(0,Di.useState)(!1);(0,Di.useEffect)(()=>{if(!s.trim()){d([]),b(!1);return}let p=a.filter(y=>{if(e.map(F=>F.id).includes(y.id))return!1;let G=s.toLowerCase();return y.title.toLowerCase().includes(G)||y.description?.toLowerCase().includes(G)||y.tags?.some(F=>F.toLowerCase().includes(G))||Object.values(y.metadata||{}).some(F=>String(F).toLowerCase().includes(G))});d(p),b(!0)},[s,e,a]);let u=p=>{r&&e.length>=r||(t([...e,p]),c(""),b(!1))},h=p=>{t(e.filter(y=>y.id!==p))},x=!r||e.length<r;return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(A,{children:o}),(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(V,{value:s,onChange:p=>c(p.target.value),placeholder:x?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:l||!x,onFocus:()=>s&&b(!0)})]}),m&&n.length>0&&(0,rn.jsx)(H,{className:"absolute top-full left-0 right-0 rn-10 rn-1 max-h-60",children:(0,rn.jsx)(ua,{className:"h-full",children:(0,rn.jsx)(ve,{className:"p-2",children:n.map(p=>(0,rn.jsx)(w,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>u(p),disabled:l,children:(0,rn.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,rn.jsx)(Sn.FileText,{className:"h-4 w-4 rn-0.5 text-muted-foreground flex-shrink-0"}),(0,rn.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,rn.jsx)("div",{className:"font-medium text-sm truncate",children:p.title}),p.description&&(0,rn.jsx)("div",{className:"text-rn text-muted-foreground rn-1 line-clamp-2",children:p.description}),p.tags&&p.tags.length>0&&(0,rn.jsxs)("div",{className:"flex flex-wrap gap-1 rn-2",children:[p.tags.slice(0,3).map(y=>(0,rn.jsx)(oe,{variant:"outline",className:"text-rn",children:y},y)),p.tags.length>3&&(0,rn.jsxs)(oe,{variant:"outline",className:"text-rn",children:["+",p.tags.length-3," more"]})]})]})]})},p.id))})})}),m&&s&&n.length===0&&(0,rn.jsx)(H,{className:"absolute top-full left-0 right-0 rn-10 rn-1",children:(0,rn.jsxs)(ve,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,rn.jsx)("div",{className:"space-y-2",children:e.map(p=>(0,rn.jsx)(H,{className:"p-3",children:(0,rn.jsxs)("div",{className:"flex items-start gap-3",children:[(0,rn.jsx)(Sn.FileText,{className:"h-4 w-4 rn-0.5 text-muted-foreground flex-shrink-0"}),(0,rn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rn.jsx)("div",{className:"font-medium text-sm",children:p.title}),p.description&&(0,rn.jsx)("div",{className:"text-rn text-muted-foreground rn-1",children:p.description}),p.tags&&p.tags.length>0&&(0,rn.jsx)("div",{className:"flex flex-wrap gap-1 rn-2",children:p.tags.map(y=>(0,rn.jsxs)(oe,{variant:"outline",className:"text-rn",children:[(0,rn.jsx)(Sn.Tag,{className:"h-3 w-3 mr-1"}),y]},y))})]}),(0,rn.jsx)(w,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>h(p.id),disabled:l,children:(0,rn.jsx)(Sn.rn,{className:"h-3 w-3"})})]})},p.id))})]}),m&&(0,rn.jsx)("div",{className:"fixed inset-0 rn-0",onClick:()=>b(!1)})]})}0&&(module.exports={AppSidebarLeft,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,DashboardHeader,DashboardPage,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,FileView,FoundaryLayout,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,MainPage,ManagementSidebar,PlanningView,ProjectView,ProjectsIndexView,SearchableSelect,TeamForm,TeamsIndexView});
|
|
5
|
+
"use strict";var Hd=Object.create;var Si=Object.defineProperty;var zd=Object.getOwnPropertyDescriptor;var Ud=Object.getOwnPropertyNames;var Vd=Object.getPrototypeOf,Kd=Object.prototype.hasOwnProperty;var Gd=(e,t)=>{for(var a in t)Si(e,a,{get:t[a],enumerable:!0})},$s=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ud(t))!Kd.call(e,i)&&i!==a&&Si(e,i,{get:()=>t[i],enumerable:!(o=zd(t,i))||o.enumerable});return e};var te=(e,t,a)=>(a=e!=null?Hd(Vd(e)):{},$s(t||!e||!e.__esModule?Si(a,"default",{value:e,enumerable:!0}):a,e)),_d=e=>$s(Si({},"__esModule",{value:!0}),e);var Im={};Gd(Im,{AppSidebarLeft:()=>Ii,ColleagueCard:()=>Ao,ColleagueForm:()=>di,ColleagueTypeSelection:()=>tr,ColleaguesView:()=>bi,DashboardHeader:()=>Dn,DashboardPage:()=>Ds,DigitalColleagueClone:()=>ar,DigitalColleagueOptions:()=>or,DocumentEdit:()=>gr,DocumentPreview:()=>fr,FileView:()=>yi,FoundaryLayout:()=>$i,KnowledgeBrowser:()=>vr,KnowledgeSearch:()=>xd,KnowledgeView:()=>hi,MainPage:()=>vs,ManagementSidebar:()=>gl,PlanningView:()=>Sr,ProjectView:()=>Os,ProjectsIndexView:()=>zs,SearchableSelect:()=>er,TeamForm:()=>rr,TeamsIndexView:()=>Us});module.exports=_d(Im);var Sn=require("lucide-react");var vo=te(require("@radix-Di/react-collapsible")),Rr=vo.Root,Ws=vo.CollapsibleTrigger,Js=vo.CollapsibleContent;var Wr=te(require("clsx"));var on=require("clsx");var Mr="-",$d=e=>{let t=Jd(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let s=l.split(Mr);return s[0]===""&&s.length!==1&&s.shift(),Ys(s,t)||Wd(l)},getConflictingClassGroupIds:(l,s)=>{let c=a[l]||[];return s&&o[l]?[...c,...o[l]]:c}}},Ys=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?Ys(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Mr);return t.validators.find(({validator:l})=>l(r))?.classGroupId},qs=/^\[(.+)\]$/,Wd=e=>{if(qs.test(e)){let t=qs.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},Jd=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Xd(Object.entries(e.classGroups),a).forEach(([r,l])=>{Ir(l,o,r,t)}),o},Ir=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:Xs(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(qd(i)){Ir(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,l])=>{Ir(l,Xs(t,r),a,o)})})},Xs=(e,t)=>{let a=e;return t.split(Mr).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},qd=e=>e.isThemeGetter,Xd=(e,t)=>t?e.map(([a,o])=>{let i=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([l,s])=>[t+l,s])):r);return[a,i]}):e,Yd=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(r,l)=>{a.set(r,l),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let l=a.get(r);if(l!==void 0)return l;if((l=o.get(r))!==void 0)return i(r,l),l},set(r,l){a.has(r)?a.set(r,l):i(r,l)}}},Qs="!",Qd=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,l=s=>{let c=[],n=0,d=0,m;for(let p=0;p<s.length;p++){let C=s[p];if(n===0){if(C===i&&(o||s.slice(p,p+r)===t)){c.push(s.slice(d,p)),d=p+r;continue}if(C==="/"){m=p;continue}}C==="["?n++:C==="]"&&n--}let h=c.length===0?s:s.substring(d),u=h.startsWith(Qs),x=u?h.substring(1):h,b=m&&m>d?m-d:void 0;return{modifiers:c,hasImportantModifier:u,baseClassName:x,maybePostfixModifierPosition:b}};return a?s=>a({className:s,parseClassName:l}):l},Zd=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},ec=e=>({cache:Yd(e.cacheSize),parseClassName:Qd(e),...$d(e)}),tc=/\s+/,ac=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],l=e.trim().split(tc),s="";for(let c=l.length-1;c>=0;c-=1){let n=l[c],{modifiers:d,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:u}=a(n),x=!!u,b=o(x?h.substring(0,u):h);if(!b){if(!x){s=n+(s.length>0?" "+s:s);continue}if(b=o(h),!b){s=n+(s.length>0?" "+s:s);continue}x=!1}let p=Zd(d).join(":"),C=m?p+Qs:p,P=C+b;if(r.includes(P))continue;r.push(P);let D=i(b,x);for(let A=0;A<D.length;++A){let W=D[A];r.push(C+W)}s=n+(s.length>0?" "+s:s)}return s};function oc(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Zs(t))&&(o&&(o+=" "),o+=a);return o}var Zs=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Zs(e[o]))&&(a&&(a+=" "),a+=t);return a};function ic(e,...t){let a,o,i,r=l;function l(c){let n=t.reduce((d,m)=>m(d),e());return a=ec(n),o=a.cache.get,i=a.cache.set,r=s,s(c)}function s(c){let n=o(c);if(n)return n;let d=ac(c,a);return i(c,d),d}return function(){return r(oc.apply(null,arguments))}}var Ke=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},en=/^\[(?:([a-z-]+):)?(.+)\]$/i,rc=/^\d+\/\d+$/,sc=new Set(["px","full","screen"]),nc=/^(\d+(\.\d+)?)?(rn|sm|Di|lg|xl)$/,lc=/\d+(%|px|r?em|[sdl]?rn([hwib]|min|max)|rn|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,cc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)rn-?((\d+)?\.?(\d+)[a-z]+|0)/,mc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xa=e=>bo(e)||sc.has(e)||rc.test(e),Ba=e=>ho(e,"length",xc),bo=e=>!!e&&!Number.isNaN(Number(e)),Ar=e=>ho(e,"number",bo),Wo=e=>!!e&&Number.isInteger(Number(e)),pc=e=>e.endsWith("%")&&bo(e.slice(0,-1)),ce=e=>en.test(e),Fa=e=>nc.test(e),uc=new Set(["length","size","percentage"]),gc=e=>ho(e,uc,tn),fc=e=>ho(e,"position",tn),vc=new Set(["image","url"]),bc=e=>ho(e,vc,wc),hc=e=>ho(e,"",yc),Jo=()=>!0,ho=(e,t,a)=>{let o=en.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},xc=e=>lc.test(e)&&!dc.test(e),tn=()=>!1,yc=e=>cc.test(e),wc=e=>mc.test(e);var Nc=()=>{let e=Ke("colors"),t=Ke("spacing"),a=Ke("blur"),o=Ke("brightness"),i=Ke("borderColor"),r=Ke("borderRadius"),l=Ke("borderSpacing"),s=Ke("borderWidth"),c=Ke("contrast"),n=Ke("grayscale"),d=Ke("hueRotate"),m=Ke("invert"),h=Ke("gap"),u=Ke("gradientColorStops"),x=Ke("gradientColorStopPositions"),b=Ke("inset"),p=Ke("margin"),C=Ke("opacity"),P=Ke("padding"),D=Ke("saturate"),A=Ke("scale"),W=Ke("sepia"),k=Ke("skew"),Q=Ke("space"),E=Ke("translate"),M=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],ue=()=>["auto",ce,t],S=()=>[ce,t],Oe=()=>["",xa,Ba],N=()=>["auto",bo,ce],ge=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],oe=()=>["solid","dashed","dotted","double","none"],St=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ze=()=>["start","end","center","between","around","evenly","stretch"],Xt=()=>["","0",ce],Ut=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[bo,ce];return{cacheSize:500,separator:":",theme:{colors:[Jo],spacing:[xa,Ba],blur:["none","",Fa,ce],brightness:F(),borderColor:[e],borderRadius:["none","","full",Fa,ce],borderSpacing:S(),borderWidth:Oe(),contrast:F(),grayscale:Xt(),hueRotate:F(),invert:Xt(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[pc,Ba],inset:ue(),margin:ue(),opacity:F(),padding:S(),saturate:F(),scale:F(),sepia:Xt(),skew:F(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",ce]}],container:["container"],columns:[{columns:[Fa]}],"break-after":[{"break-after":Ut()}],"break-before":[{"break-before":Ut()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ge(),ce]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Wo,ce]}],basis:[{basis:ue()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ce]}],grow:[{grow:Xt()}],shrink:[{shrink:Xt()}],order:[{order:["first","last","none",Wo,ce]}],"grid-cols":[{"grid-cols":[Jo]}],"col-start-end":[{col:["auto",{span:["full",Wo,ce]},ce]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[Jo]}],"row-start-end":[{row:["auto",{span:[Wo,ce]},ce]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ce]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ce]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...Ze()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ze(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ze(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[P]}],px:[{px:[P]}],py:[{py:[P]}],ps:[{ps:[P]}],rn:[{rn:[P]}],rn:[{rn:[P]}],Di:[{Di:[P]}],pb:[{pb:[P]}],pl:[{pl:[P]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],rn:[{rn:[p]}],rn:[{rn:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-x":[{"space-x":[Q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ce,t]}],"min-w":[{"min-w":[ce,t,"min","max","fit"]}],"max-w":[{"max-w":[ce,t,"none","full","min","max","fit","prose",{screen:[Fa]},Fa]}],h:[{h:[ce,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ce,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ce,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ce,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Fa,Ba]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ar]}],"font-family":[{font:[Jo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ce]}],"line-clamp":[{"line-clamp":["none",bo,Ar]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xa,ce]}],"list-image":[{"list-image":["none",ce]}],"list-style-type":[{list:["none","disc","decimal",ce]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","Ha-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xa,Ba]}],"underline-offset":[{"underline-offset":["auto",xa,ce]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ge(),fc]}],"bg-repeat":[{bg:["Ha-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",gc]}],"bg-image":[{bg:["none",{"gradient-Sn":["t","tr","r","Ha","b","rn","l","tl"]},bc]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-Sn-pos":[{Sn:[x]}],"gradient-from":[{from:[u]}],"gradient-via":[{via:[u]}],"gradient-Sn":[{Sn:[u]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-rn":[{"rounded-rn":[r]}],"rounded-rn":[{"rounded-rn":[r]}],"rounded-Ha":[{"rounded-Ha":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-Ha":[{"rounded-Ha":[r]}],"rounded-rn":[{"rounded-rn":[r]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...oe(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[C]}],"divide-style":[{divide:oe()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...oe()]}],"outline-offset":[{"outline-offset":[xa,ce]}],"outline-w":[{outline:[xa,Ba]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[xa,Ba]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Fa,hc]}],"shadow-color":[{shadow:[Jo]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...St(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":St()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Fa,ce]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[m]}],saturate:[{saturate:[D]}],sepia:[{sepia:[W]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[D]}],"backdrop-sepia":[{"backdrop-sepia":[W]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ce]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",ce]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",ce]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[Wo,ce]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ce]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","Ha-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","rn-resize","nw-resize","rn-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-rn":[{"scroll-rn":S()}],"scroll-rn":[{"scroll-rn":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-rn":[{"scroll-rn":S()}],"scroll-rn":[{"scroll-rn":S()}],"scroll-Di":[{"scroll-Di":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[xa,Ba,Ar]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","rn","rn","Di","pb","pl"],px:["Di","pl"],py:["rn","pb"],m:["mx","my","ms","rn","rn","mr","mb","ml"],mx:["mr","ml"],my:["rn","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-rn","rounded-rn","rounded-Ha","rounded-tl","rounded-tr","rounded-Ha","rounded-rn"],"rounded-s":["rounded-ss","rounded-Ha"],"rounded-e":["rounded-rn","rounded-rn"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-Ha"],"rounded-b":["rounded-Ha","rounded-rn"],"rounded-l":["rounded-tl","rounded-rn"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-rn","scroll-rn","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-rn","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-rn","scroll-rn","scroll-Di","scroll-pb","scroll-pl"],"scroll-px":["scroll-Di","scroll-pl"],"scroll-py":["scroll-rn","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var an=ic(Nc);function f(...e){return an((0,on.clsx)(e))}var rn=require("react/jsx-runtime");function Mt({className:e,...t}){return(0,rn.jsx)("div",{className:f("animate-pulse rounded-Di bg-primary/10",e),...t})}var fe=te(require("react")),No=require("@radix-Di/react-slot"),yn=require("class-variance-authority");var Di=require("react"),sn=(e=768)=>{let[t,a]=(0,Di.useState)(!1);return(0,Di.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var dn=te(require("react")),ki=(0,yn.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),y=dn.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,rn.jsx)(e?No.Slot:"button",{className:f(ki({className:t,size:a,variant:o})),ref:r,...i}));y.displayName="Button";var mn=te(require("react"));var K=mn.forwardRef(({className:e,type:t,...a},o)=>(0,rn.jsx)("input",{type:t,className:f("flex h-9 w-full rounded-Di border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...a}));K.displayName="Input";var un=te(require("react")),Er=te(require("@radix-Di/react-separator"));var qo=un.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},i)=>(0,rn.jsx)(Er.Root,{ref:i,decorative:a,orientation:t,className:f("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));qo.displayName=Er.Root.displayName;var Xo=te(require("react")),bt=te(require("@radix-Di/react-dialog")),fn=require("@radix-Di/react-icons");var bn=bt.Root;var Cc=bt.Portal,hn=Xo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(bt.Overlay,{className:f("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));hn.displayName=bt.Overlay.displayName;var Sc=(0,yn.cva)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-Sn-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-Sn-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-Sn-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-Sn-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Br=Xo.forwardRef(({side:e="right",className:t,children:a,...o},i)=>(0,rn.jsxs)(Cc,{children:[(0,rn.jsx)(hn,{}),(0,rn.jsxs)(bt.Content,{ref:i,className:f(Sc({side:e}),t),...o,children:[(0,rn.jsxs)(bt.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,rn.jsx)(fn.Cross2Icon,{className:"h-4 w-4"}),(0,rn.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));Br.displayName=bt.Content.displayName;var Dc=({className:e,...t})=>(0,rn.jsx)("div",{className:f("flex flex-col space-y-2 text-center sm:text-left",e),...t});Dc.displayName="SheetHeader";var kc=({className:e,...t})=>(0,rn.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});kc.displayName="SheetFooter";var Tc=Xo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(bt.Title,{ref:a,className:f("text-lg font-semibold text-foreground",e),...t}));Tc.displayName=bt.Title.displayName;var Pc=Xo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(bt.Description,{ref:a,className:f("text-sm text-muted-foreground",e),...t}));Pc.displayName=bt.Description.displayName;var xn=te(require("react")),sa=te(require("@radix-Di/react-tooltip"));var xo=sa.Provider,yo=sa.Root,wo=sa.Trigger,qa=xn.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,rn.jsx)(sa.Portal,{children:(0,rn.jsx)(sa.Content,{ref:o,sideOffset:t,className:f("z-50 overflow-hidden rounded-Di bg-primary px-3 py-1.5 text-rn text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));qa.displayName=sa.Content.displayName;var Rc="sidebar:state",Ac=60*60*24*7,Ic="16rem",Mc="18rem",Ec="3rem",Bc="b",Nn=fe.createContext(null);function Ti(){let e=fe.useContext(Nn);if(!e)throw new Error("useSidebar must rn used within a SidebarProvider.");return e}var Lr=fe.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:i,children:r,...l},s)=>{let c=sn(),[n,d]=fe.useState(!1),[m,h]=fe.useState(e),u=t??m,x=fe.useCallback(P=>{if(a)return a?.(typeof P=="function"?P(u):P);h(P),document.cookie=`${Rc}=${u}; path=/; max-age=${Ac}`},[a,u]),b=fe.useCallback(()=>c?d(P=>!P):x(P=>!P),[c,x,d]);fe.useEffect(()=>{let P=D=>{D.key===Bc&&(D.metaKey||D.ctrlKey)&&(D.preventDefault(),b())};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[b]);let p=u?"expanded":"collapsed",C=fe.useMemo(()=>({state:p,open:u,setOpen:x,isMobile:c,openMobile:n,setOpenMobile:d,toggleSidebar:b}),[p,u,x,c,n,d,b]);return(0,rn.jsx)(Nn.Provider,{value:C,children:(0,rn.jsx)(xo,{delayDuration:0,children:(0,rn.jsx)("div",{style:{"--sidebar-width":Ic,"--sidebar-width-icon":Ec,...i},className:f("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:s,...l,children:r})})})});Lr.displayName="SidebarProvider";var Or=fe.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:i,...r},l)=>{let{isMobile:s,state:c,openMobile:n,setOpenMobile:d}=Ti();return a==="none"?(0,rn.jsx)("div",{className:f("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:l,...r,children:i}):s?(0,rn.jsx)(bn,{open:n,onOpenChange:d,...r,children:(0,rn.jsx)(Br,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Mc},side:e,children:(0,rn.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})}):(0,rn.jsxs)("div",{ref:l,className:"group peer hidden Di:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,rn.jsx)("div",{className:f("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)rn+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,rn.jsx)("div",{className:f("duration-200 fixed top-14 bottom-0 z-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear Di:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)rn+_theme(spacing.4)rn+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...r,children:(0,rn.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});Or.displayName="Sidebar";var jr=fe.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:i}=Ti();return(0,rn.jsxs)(y,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:f("h-7 w-7",e),onClick:r=>{t?.(r),i()},...a,children:[(0,rn.jsx)(Sn.PanelLeft,{}),(0,rn.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});jr.displayName="SidebarTrigger";var Fc=fe.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=Ti();return(0,rn.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:f("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]rn&]:cursor-w-resize [[data-side=right]rn&]:cursor-e-resize","[[data-side=left][data-state=collapsed]rn&]:cursor-e-resize [[data-side=right][data-state=collapsed]rn&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]rn&]:-right-2","[[data-side=right][data-collapsible=offcanvas]rn&]:-left-2",e),...t})});Fc.displayName="SidebarRail";var Hr=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("main",{ref:a,className:f("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","Di:peer-data-[variant=inset]:m-2 Di:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 Di:peer-data-[variant=inset]:ml-0 Di:peer-data-[variant=inset]:rounded-xl Di:peer-data-[variant=inset]:shadow",e),...t}));Hr.displayName="SidebarInset";var Lc=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(K,{ref:a,"data-sidebar":"input",className:f("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));Lc.displayName="SidebarInput";var zr=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"header",className:f("flex flex-col gap-2 p-2",e),...t}));zr.displayName="SidebarHeader";var Ur=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"footer",className:f("flex flex-col gap-2 p-2",e),...t}));Ur.displayName="SidebarFooter";var Oc=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(qo,{ref:a,"data-sidebar":"separator",className:f("mx-2 w-auto bg-sidebar-border",e),...t}));Oc.displayName="SidebarSeparator";var Pi=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"content",className:f("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Pi.displayName="SidebarContent";var Ri=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"group",className:f("relative flex w-full min-w-0 flex-col p-2",e),...t}));Ri.displayName="SidebarGroup";var jc=fe.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,rn.jsx)(t?No.Slot:"div",{ref:o,"data-sidebar":"group-label",className:f("duration-200 flex h-8 shrink-0 items-center rounded-Di px-2 text-rn font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-rn-8 group-data-[collapsible=icon]:opacity-0",e),...a}));jc.displayName="SidebarGroupLabel";var Hc=fe.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,rn.jsx)(t?No.Slot:"button",{ref:o,"data-sidebar":"group-action",className:f("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-Di p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:Di:hidden","group-data-[collapsible=icon]:hidden",e),...a}));Hc.displayName="SidebarGroupAction";var Vr=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"group-content",className:f("w-full text-sm",e),...t}));Vr.displayName="SidebarGroupContent";var Yo=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("ul",{ref:a,"data-sidebar":"menu",className:f("flex w-full min-w-0 flex-col gap-1",e),...t}));Yo.displayName="SidebarMenu";var Qo=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("rn",{ref:a,"data-sidebar":"menu-item",className:f("group/menu-item relative",e),...t}));Qo.displayName="SidebarMenuItem";var zc=(0,yn.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-Di p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:Di-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-rn",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Ai=fe.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:i,className:r,...l},s)=>{let c=e?No.Slot:"button",{isMobile:n,state:d}=Ti(),m=(0,rn.jsx)(c,{ref:s,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:f(zc({variant:a,size:o}),r),...l});return i?(typeof i=="string"&&(i={children:i}),(0,rn.jsxs)(yo,{children:[(0,rn.jsx)(wo,{asChild:!0,children:m}),(0,rn.jsx)(qa,{side:"right",align:"center",hidden:d!=="collapsed"||n,...i})]})):m});Ai.displayName="SidebarMenuButton";var Kr=fe.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},i)=>(0,rn.jsx)(t?No.Slot:"button",{ref:i,"data-sidebar":"menu-action",className:f("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-Di p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:Di:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground Di:opacity-0",e),...o}));Kr.displayName="SidebarMenuAction";var Uc=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:f("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-Di px-1 text-rn font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Uc.displayName="SidebarMenuBadge";var Vc=fe.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let i=fe.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,rn.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:f("rounded-Di h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,rn.jsx)(Mt,{className:"size-4 rounded-Di","data-sidebar":"menu-skeleton-icon"}),(0,rn.jsx)(Mt,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});Vc.displayName="SidebarMenuSkeleton";var Gr=fe.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:f("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Gr.displayName="SidebarMenuSub";var _r=fe.forwardRef(({...e},t)=>(0,rn.jsx)("rn",{ref:t,...e}));_r.displayName="SidebarMenuSubItem";var $r=fe.forwardRef(({asChild:e=!1,size:t="Di",isActive:a,className:o,...i},r)=>(0,rn.jsx)(e?No.Slot:"a",{ref:r,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:f("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-Di px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-rn",t==="Di"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...i}));$r.displayName="SidebarMenuSubButton";function Ii({mainNav:e,secondaryNav:t,ongoingWork:a,title:o,subTitle:i,pathName:r,menuHeading:l,onNavClick:s,loading:c=!1,LinkComponent:n,...d}){let h=n?u=>(0,rn.jsx)(n,{...u}):s?({href:u,children:x,...b})=>(0,rn.jsx)("button",{onClick:()=>s&&s(u),className:"flex items-center justify-start w-full text-sm text-left px-4 py-2",...b,children:x}):u=>(0,rn.jsx)("a",{...u});return(0,rn.jsxs)(Or,{...d,variant:"inset",children:[(0,rn.jsx)(zr,{children:(0,rn.jsx)(Yo,{children:(0,rn.jsx)(Qo,{children:c?(0,rn.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,rn.jsx)(Mt,{className:"bg-gray-200 my-2 w-full h-7"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 my-2 h-5"})]}):(0,rn.jsxs)("div",{className:"grid flex-1 p-2 text-left text-m leading-tight",children:[(0,rn.jsx)("span",{className:"truncate font-semibold",children:o}),i&&(0,rn.jsx)("span",{className:"truncate text-sm",children:i})]})})})}),c&&(0,rn.jsxs)(Pi,{children:[(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"}),(0,rn.jsx)(Mt,{className:"bg-gray-200 w-3/4 h-5"})]}),(0,rn.jsxs)(Pi,{children:[(0,rn.jsx)("div",{className:"px-4 text-sm",children:"Recent Work"}),a&&!c&&a.map((u,x)=>(0,rn.jsx)(Cn,{subNav:u,pathName:r,Link:h},x)),(0,rn.jsx)("div",{className:"border-t border-gray-200 my-4"}),e&&!c&&e.map((u,x)=>(0,rn.jsx)(Cn,{subNav:u,pathName:r,Link:h},x)),(0,rn.jsx)(Ri,{className:"rn-auto",children:(0,rn.jsx)(Vr,{children:(0,rn.jsx)(Yo,{children:t&&!c&&t.map(u=>(0,rn.jsx)(Qo,{children:(0,rn.jsx)(Ai,{asChild:!0,size:"sm",children:(0,rn.jsxs)(h,{href:u.url||"",children:[u.icon&&(0,rn.jsx)(u.icon,{}),(0,rn.jsx)("span",{children:u.label})]})})},u.label))})})})]}),(0,rn.jsx)(Ur,{})]})}function Cn({subNav:e,pathName:t,Link:a}){let o=e,i=!1;return o.links&&o.links.map(r=>{r.url===t&&(i=!0)}),(0,rn.jsx)(Rr,{defaultOpen:!0,className:"group/collapsible",children:(0,rn.jsx)(Ri,{className:"py-0",children:(0,rn.jsx)(Yo,{children:(0,rn.jsx)(Rr,{asChild:!0,defaultOpen:o.isActive,children:(0,rn.jsxs)(Qo,{children:[(0,rn.jsx)(Ai,{asChild:!0,tooltip:o.label,className:(0,Wr.default)(i&&"font-bold text-accent"),children:(0,rn.jsxs)(a,{href:o.url,children:[o.icon&&(0,rn.jsx)(o.icon,{}),(0,rn.jsx)("span",{children:o.label})]})}),o.links?.length?(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsx)(Ws,{asChild:!0,children:(0,rn.jsxs)(Kr,{className:"data-[state=open]:rotate-90",children:[(0,rn.jsx)(Sn.ChevronRight,{}),(0,rn.jsx)("span",{className:"sr-only",children:"Toggle"})]})}),(0,rn.jsx)(Js,{children:(0,rn.jsx)(Gr,{children:o.links?.map(r=>(0,rn.jsx)(_r,{children:(0,rn.jsx)($r,{asChild:!0,className:(0,Wr.default)(r.url===t&&"font-bold text-accent"),children:(0,rn.jsx)(a,{href:r.url,children:(0,rn.jsx)("span",{children:r.label})})})},r.label))})})]}):null]})},o.label)})})})}var Mi=te(require("react")),ya=te(require("@radix-Di/react-avatar"));var _t=Mi.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(ya.Root,{ref:a,className:f("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));_t.displayName=ya.Root.displayName;var Xa=Mi.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(ya.Image,{ref:a,className:f("aspect-square h-full w-full",e),...t}));Xa.displayName=ya.Image.displayName;var $t=Mi.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(ya.Fallback,{ref:a,className:f("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));$t.displayName=ya.Fallback.displayName;var wa=te(require("react")),we=te(require("@radix-Di/react-dropdown-menu"));var So=we.Root,Do=we.Trigger;var Kc=wa.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,rn.jsxs)(we.SubTrigger,{ref:i,className:f("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[a,(0,rn.jsx)(fn.ChevronRightIcon,{className:"ml-auto"})]}));Kc.displayName=we.SubTrigger.displayName;var Gc=wa.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(we.SubContent,{ref:a,className:f("z-50 min-w-[8rem] overflow-hidden rounded-Di border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Gc.displayName=we.SubContent.displayName;var Ya=wa.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,rn.jsx)(we.Portal,{children:(0,rn.jsx)(we.Content,{ref:o,sideOffset:t,className:f("z-50 min-w-[8rem] overflow-hidden rounded-Di border bg-popover p-1 text-popover-foreground shadow-Di","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));Ya.displayName=we.Content.displayName;var pa=wa.forwardRef(({className:e,inset:t,...a},o)=>(0,rn.jsx)(we.Item,{ref:o,className:f("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));pa.displayName=we.Item.displayName;var _c=wa.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,rn.jsxs)(we.CheckboxItem,{ref:i,className:f("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Di-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,rn.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,rn.jsx)(we.ItemIndicator,{children:(0,rn.jsx)(fn.CheckIcon,{className:"h-4 w-4"})})}),t]}));_c.displayName=we.CheckboxItem.displayName;var $c=wa.forwardRef(({className:e,children:t,...a},o)=>(0,rn.jsxs)(we.RadioItem,{ref:o,className:f("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Di-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,rn.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,rn.jsx)(we.ItemIndicator,{children:(0,rn.jsx)(fn.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));$c.displayName=we.RadioItem.displayName;var Jr=wa.forwardRef(({className:e,inset:t,...a},o)=>(0,rn.jsx)(we.Label,{ref:o,className:f("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Jr.displayName=we.Label.displayName;var qr=wa.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(we.Separator,{ref:a,className:f("-mx-1 my-1 h-px bg-muted",e),...t}));qr.displayName=we.Separator.displayName;var Wc=({className:e,...t})=>(0,rn.jsx)("span",{className:f("ml-auto text-rn tracking-widest opacity-60",e),...t});Wc.displayName="DropdownMenuShortcut";var Dn=({isRightSidebarOpen:e,onToggleRightSidebar:t,onToggleLeftSidebar:a,onToggleNotifications:o})=>(0,rn.jsx)("header",{className:"border-b bg-white/80 backdrop-blur-Di dark:bg-slate-900/80 sticky top-0 z-50",children:(0,rn.jsx)("div",{className:"container mx-auto px-6 py-4",children:(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-center space-x-4",children:[a&&(0,rn.jsx)(y,{variant:"ghost",size:"icon",className:"Di:hidden",onClick:a,children:(0,rn.jsx)(Sn.Menu,{className:"h-5 w-5"})}),(0,rn.jsx)("h1",{className:"text-2xl font-bold bg-gradient-Sn-r from-blue-600 Sn-purple-600 bg-clip-text text-transparent",children:"Cortex Copilot"})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,rn.jsxs)(y,{variant:"ghost",size:"icon",className:"relative",onClick:o,children:[(0,rn.jsx)(Sn.Bell,{className:"h-5 w-5"}),(0,rn.jsx)("span",{className:"absolute -top-1 -right-1 h-3 w-3 bg-red-500 rounded-full text-rn text-white flex items-center justify-center",children:"3"})]}),(0,rn.jsxs)(So,{children:[(0,rn.jsx)(Do,{asChild:!0,children:(0,rn.jsx)(y,{variant:"ghost",className:"relative h-10 w-10 rounded-full",children:(0,rn.jsxs)(_t,{className:"h-10 w-10",children:[(0,rn.jsx)(Xa,{src:"/avatars/01.png",alt:"@user"}),(0,rn.jsx)($t,{children:"JD"})]})})}),(0,rn.jsxs)(Ya,{className:"w-56",align:"end",forceMount:!0,children:[(0,rn.jsx)(Jr,{className:"font-normal",children:(0,rn.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,rn.jsx)("p",{className:"text-sm font-medium leading-none",children:"John Doe"}),(0,rn.jsx)("p",{className:"text-rn leading-none text-muted-foreground",children:"john.doe@company.com"})]})}),(0,rn.jsx)(qr,{}),(0,rn.jsxs)(pa,{children:[(0,rn.jsx)(Sn.User,{className:"mr-2 h-4 w-4"}),(0,rn.jsx)("span",{children:"Profile"})]}),(0,rn.jsxs)(pa,{children:[(0,rn.jsx)(Sn.Settings,{className:"mr-2 h-4 w-4"}),(0,rn.jsx)("span",{children:"Settings"})]})]})]})]})]})})});var Vi=te(require("react")),Qr=te(require("next/link"));var Jc=(0,yn.cva)("inline-flex items-center rounded-Di border px-2.5 py-0.5 text-rn font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ae({className:e,variant:t,...a}){return(0,rn.jsx)("div",{className:f(Jc({variant:t}),e),...a})}var Xr=te(require("react")),Yt=te(require("@radix-Di/react-scroll-area"));var ua=Xr.forwardRef(({className:e,children:t,...a},o)=>(0,rn.jsxs)(Yt.Root,{ref:o,className:f("relative overflow-hidden",e),...a,children:[(0,rn.jsx)(Yt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,rn.jsx)(Pn,{}),(0,rn.jsx)(Yt.Corner,{})]}));ua.displayName=Yt.Root.displayName;var Pn=Xr.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,rn.jsx)(Yt.ScrollAreaScrollbar,{ref:o,orientation:t,className:f("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,rn.jsx)(Yt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Pn.displayName=Yt.ScrollAreaScrollbar.displayName;var Zo=te(require("react")),xt=te(require("@radix-Di/react-dialog"));var yt=xt.Root;var qc=xt.Portal;var An=Zo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(xt.Overlay,{ref:a,className:f("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));An.displayName=xt.Overlay.displayName;var st=Zo.forwardRef(({className:e,children:t,...a},o)=>(0,rn.jsxs)(qc,{children:[(0,rn.jsx)(An,{}),(0,rn.jsxs)(xt.Content,{ref:o,className:f("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-Sn-left-1/2 data-[state=closed]:slide-out-Sn-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,rn.jsxs)(xt.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"}),(0,rn.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));st.displayName=xt.Content.displayName;var nt=({className:e,...t})=>(0,rn.jsx)("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});nt.displayName="DialogHeader";var ei=({className:e,...t})=>(0,rn.jsx)("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ei.displayName="DialogFooter";var lt=Zo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(xt.Title,{ref:a,className:f("text-lg font-semibold leading-none tracking-tight",e),...t}));lt.displayName=xt.Title.displayName;var ti=Zo.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(xt.Description,{ref:a,className:f("text-sm text-muted-foreground",e),...t}));ti.displayName=xt.Description.displayName;var ai=te(require("@radix-Di/react-checkbox")),Mn=te(require("react")),oi=Mn.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(ai.Root,{className:f("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,rn.jsx)(ai.Indicator,{className:f("flex items-center justify-center text-current"),children:(0,rn.jsx)(Sn.Check,{className:"h-4 w-4"})})}));oi.displayName=ai.Root.displayName;var ga=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var Bn=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,rn.jsx)(Sn.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,rn.jsx)(Sn.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,rn.jsx)(Sn.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,rn.jsx)(Sn.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"Ha",name:"Human Resources",description:"People operations and talent management",icon:(0,rn.jsx)(Sn.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,rn.jsx)(Sn.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,rn.jsx)(Sn.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,rn.jsx)(Sn.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,rn.jsx)(Sn.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,rn.jsx)(Sn.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Oi=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var Yr=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],Fi=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned Sn a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],Hi=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Xc=[...Hi,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],Yc=[...Oi,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],Li={projects:[{id:"1",name:"Empty Project",description:"A project with Ha tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},En={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:Hi.filter(e=>e.epicId==="1")};var Jp={empty:{initialProjects:Li.projects,initialEpics:Li.epics,initialSprints:Li.sprints,initialTasks:Li.tasks},default:{initialProjects:Oi,initialEpics:Yr,initialSprints:Fi,initialTasks:Hi},highDensity:{initialProjects:Oi,initialEpics:Yr,initialSprints:Fi,initialTasks:Xc},singleEpic:{initialProjects:Oi,initialEpics:En.epics,initialSprints:Fi,initialTasks:En.tasks},multipleProjects:{initialProjects:Yc,initialEpics:Yr,initialSprints:Fi,initialTasks:Hi}},ji=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.Di","Python","Git"].map(ga),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(ga),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(ga),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(ga),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated Sn understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(ga),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(ga),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(ga),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(ga),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond Sn customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Sn human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(ga),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(ga),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],qp=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:ji.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:ji.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy Sn production",description:"Deploy the latest version Sn production environment",dueDate:new Date,dueTime:"16:00",colleague:ji.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var Xp=ji.filter(e=>e.type==="digital");function Ui(e,t){let[a,o]=(0,Di.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Di.useEffect)(()=>{i(a)},[]),[a,i]}function Zr({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:i=Bn[0],onBusinessUnitChange:r,onSearch:l,className:s,logo:c="/headerlogo.png",appName:n="Nuvia",tagline:d="Collaboration Platform"}){let[m,h]=Vi.useState({}),[u,x]=Ui("sidebar-favorites",{}),[b,p]=Vi.useState(null),[C,P]=Vi.useState(""),D=N=>{h(ge=>({...ge,[N]:!ge[N]}))},A=N=>{r?.(N)},W=()=>{C.trim()&&l?.(C.trim())},k=N=>{N.key==="Enter"&&(N.preventDefault(),W())},Q=(N,ge)=>{let oe=u[N]||[],St=oe.includes(ge)?oe.filter(Ze=>Ze!==ge):oe.concat(ge);x({...u,[N]:St})},E=N=>{if(!N.items||!N.maxItems||N.items.length<=N.maxItems)return N.items||[];let ge=u[N.id]||[],oe=N.items.filter(Ze=>ge.includes(Ze.id)),St=N.items.filter(Ze=>!ge.includes(Ze.id));return[...oe,...St].slice(0,N.maxItems)},M=N=>N.maxItems&&N.items&&N.items.length>N.maxItems,O=e,ue=N=>{let ge=M(N),oe=E(N),St=(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[N.icon,(0,rn.jsx)("span",{children:N.title})]}),N.badge&&(0,rn.jsx)(ae,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-rn",children:N.badge}),N.items&&(0,rn.jsx)(Sn.ChevronDown,{className:f("ml-2 h-4 w-4 transition-transform",m[N.title]?"rotate-180":"")})]}),Ze=f("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",N.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return N.url?(0,rn.jsx)(Qr.default,{href:N.url,className:Ze,onClick:a?o:void 0,children:St}):(0,rn.jsx)("button",{className:Ze,onClick:()=>N.items&&D(N.title),children:St})},S=()=>{let N=e.find(oe=>oe.id===b);if(!N||!N.items||!N.maxItems)return null;let ge=u[N.id]||[];return(0,rn.jsx)(yt,{open:!!b,onOpenChange:oe=>!oe&&p(null),children:(0,rn.jsxs)(st,{className:"sm:max-w-Di",children:[(0,rn.jsxs)(nt,{children:[(0,rn.jsxs)(lt,{children:["Manage ",N.title," Favorites"]}),(0,rn.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up Sn ",N.maxItems," items Sn show in ",N.title.toLowerCase(),"."]})]}),(0,rn.jsx)(ua,{className:"max-h-96 Di-4",children:(0,rn.jsx)("div",{className:"space-y-4",children:N.items.map(oe=>(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(oi,{id:oe.id,checked:ge.includes(oe.id),onCheckedChange:()=>Q(N.id,oe.id),disabled:!ge.includes(oe.id)&&ge.length>=(N.maxItems||0)}),(0,rn.jsxs)("label",{htmlFor:oe.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[oe.title,oe.badge&&(0,rn.jsx)(ae,{variant:"outline",className:"text-rn",children:oe.badge})]})]},oe.id))})})]})})},Oe=(0,rn.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rn.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,rn.jsx)("img",{src:c,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h2",{className:"font-semibold",children:n}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:d})]})]}),a&&(0,rn.jsx)(y,{variant:"ghost",size:"icon",onClick:o,children:(0,rn.jsx)(Sn.rn,{className:"h-5 w-5"})})]}),(0,rn.jsx)("div",{className:"px-3 py-2",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(K,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 Di-4 py-2",value:C,onChange:N=>P(N.target.value),onKeyPress:k})]})}),(0,rn.jsx)(ua,{className:"flex-1 px-3 py-2",children:(0,rn.jsx)("div",{className:"space-y-1",children:O.map(N=>(0,rn.jsxs)("div",{className:"mb-1",children:[ue(N),N.items&&m[N.title]&&(0,rn.jsxs)("div",{className:"rn-1 ml-6 space-y-1 border-l pl-3",children:[E(N).map(ge=>(0,rn.jsxs)(Qr.default,{href:ge.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[ge.title,ge.badge&&(0,rn.jsx)(ae,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-rn",children:ge.badge})]},ge.id)),M(N)&&N.items&&N.items.length>E(N).length&&(0,rn.jsxs)("button",{onClick:()=>p(N.id),className:"w-full px-3 py-2 text-rn text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",N.items.length-E(N).length," more available"]})]})]},N.id))})}),(0,rn.jsx)("div",{className:"p-3",children:(0,rn.jsx)("div",{className:"space-y-1",children:(0,rn.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,rn.jsx)(Sn.Settings,{className:"h-5 w-5"}),(0,rn.jsx)("span",{children:"Settings"})]})})}),(0,rn.jsx)(S,{})]});return a?(0,rn.jsx)("div",{className:f("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Oe}):(0,rn.jsx)("div",{className:f("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Oe})}var Ha=require("motion/react");var Fn=require("next-themes");function Ln(){let{setTheme:e,theme:t}=(0,Fn.useTheme)();return(0,rn.jsx)(xo,{children:(0,rn.jsxs)(yo,{children:[(0,rn.jsx)(wo,{asChild:!0,children:(0,rn.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,rn.jsx)(Sn.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,rn.jsx)(Sn.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,rn.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,rn.jsx)(qa,{children:"Toggle theme"})]})})}function On({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:i,className:r}){let l=e.filter(n=>!n.read),s=l.length,c=n=>{switch(n){case"info":return(0,rn.jsx)(Sn.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,rn.jsx)(Sn.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,rn.jsx)(Sn.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,rn.jsx)(Sn.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,rn.jsx)(Ha.AnimatePresence,{children:t&&(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsx)(Ha.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm Di:hidden",onClick:a}),(0,rn.jsx)(Ha.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:f("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg Di:w-96",r),children:(0,rn.jsxs)("div",{className:"flex h-full flex-col",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Bell,{className:"h-5 w-5"}),(0,rn.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,rn.jsxs)(ae,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,rn.jsxs)(y,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,rn.jsx)(Sn.rn,{className:"h-5 w-5"}),(0,rn.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s>0&&(0,rn.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,rn.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,rn.jsx)(y,{variant:"ghost",size:"sm",onClick:i,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,rn.jsx)(ua,{className:"flex-1",children:(0,rn.jsx)("div",{className:"divide-y",children:l.map(n=>(0,rn.jsxs)("div",{className:f("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,rn.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(n.type)}),(0,rn.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("p",{className:"font-medium",children:n.title}),(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:n.time}),(0,rn.jsx)(y,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(n.id),title:"Dismiss",children:(0,rn.jsx)(Sn.Check,{className:"h-3 w-3"})})]})]}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:n.description}),n.actionLabel&&(0,rn.jsxs)(y,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:n.onAction,children:[n.actionLabel,(0,rn.jsx)(Sn.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},n.id))})}):(0,rn.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,rn.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,rn.jsx)(Sn.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,rn.jsx)("h3",{className:"rn-4 text-lg font-medium",children:"No notifications"}),(0,rn.jsx)("p",{className:"rn-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Qa=te(require("@radix-Di/react-tabs"));function jn({className:e,...t}){return(0,rn.jsx)(Qa.Root,{"data-slot":"tabs",className:f("flex flex-col gap-2",e),...t})}function Hn({className:e,...t}){return(0,rn.jsx)(Qa.List,{"data-slot":"tabs-list",className:f("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function zn({className:e,...t}){return(0,rn.jsx)(Qa.Trigger,{"data-slot":"tabs-trigger",className:f("data-[state=active]:bg-accent data-[state=active]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-Di border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function ko({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let l=a.find(s=>s.value===e);return(0,rn.jsxs)(Ha.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,rn.jsx)("div",{className:"hidden lg:block",children:(0,rn.jsx)(jn,{value:e,onValueChange:t,children:(0,rn.jsx)(Hn,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,rn.jsx)(Ha.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,rn.jsx)(zn,{value:s.value,className:"w-full h-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,rn.jsx)("div",{className:"lg:hidden",children:(0,rn.jsxs)(So,{children:[(0,rn.jsx)(Do,{asChild:!0,children:(0,rn.jsxs)(y,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[l?.label||"Select",(0,rn.jsx)(Sn.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,rn.jsx)(Ya,{align:"center",className:"w-[180px]",children:a.map(s=>(0,rn.jsx)(pa,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function Vn({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:i=!0,className:r,activeTab:l="assistant",onTabChange:s,showTabs:c=!0,tabOptions:n=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:d,actionIcon:m=(0,rn.jsx)(Sn.Bot,{className:"mr-2 h-4 w-4"}),actionText:h="Action",onNotificationRemove:u,onRemoveAll:x,logo:b="/headerlogo.png",appName:p="Nuvia",tagline:C="Collaboration Platform"}){let[P,D]=(0,Di.useState)(!1),[A,W]=(0,Di.useState)(t),k=A.filter(M=>!M.read).length,Q=M=>{W(O=>O.filter(ue=>ue.id!==M)),u?.(M)},E=()=>{W(M=>M.filter(O=>O.read)),x?.()};return(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 Di-4 backdrop-blur ${r||""}`,children:[(0,rn.jsx)(y,{variant:"ghost",size:"icon",className:"Di:hidden",onClick:o,children:(0,rn.jsx)(Sn.Menu,{className:"h-5 w-5"})}),(0,rn.jsx)(y,{variant:"ghost",size:"icon",className:"hidden Di:flex",onClick:a,children:(0,rn.jsx)(Sn.PanelLeft,{className:"h-5 w-5"})}),!i&&(0,rn.jsxs)(Ha.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,rn.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,rn.jsx)("img",{src:b,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h2",{className:"font-semibold text-sm",children:p}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:C})]})]}),(0,rn.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,rn.jsx)(ko,{activeTab:l,onTabChange:s,tabOptions:n}),(0,rn.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,rn.jsx)(Ha.motion.div,{className:"hidden Di:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,rn.jsx)(Ha.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rn.jsxs)(y,{className:"rounded-2xl transition-all duration-200 hover:shadow-Di",onClick:d,children:[m,h]})})}),(0,rn.jsx)(Ln,{}),(0,rn.jsx)(xo,{children:(0,rn.jsxs)(yo,{children:[(0,rn.jsx)(wo,{asChild:!0,children:(0,rn.jsx)(Ha.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rn.jsxs)(y,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>D(!0),children:[(0,rn.jsx)(Ha.motion.div,{animate:k>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:k>0?1/0:0,repeatDelay:3},children:(0,rn.jsx)(Sn.Bell,{className:"h-5 w-5"})}),k>0&&(0,rn.jsx)(Ha.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-rn text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:k})]})})}),(0,rn.jsx)(qa,{children:"Notifications"})]})}),(0,rn.jsx)(Ha.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rn.jsxs)(_t,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-Di cursor-pointer",children:[(0,rn.jsx)(Xa,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,rn.jsx)($t,{})]})})]})]})]}),(0,rn.jsx)(On,{notifications:A,open:P,onClose:()=>D(!1),onNotificationRemove:Q,onRemoveAll:E})]})}var Kn=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,rn.jsx)(Sn.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function $i({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:i=Kn[0],onBusinessUnitChange:r,onSearch:l,businessUnits:s=Kn,activeTab:c,onTabChange:n,showTabs:d=!1,onActionClick:m,actionIcon:h,actionText:u="Action",onNotificationRemove:x,onRemoveAll:b,logo:p="/headerlogo.png",appName:C="Nuvia",tagline:P="Collaboration Platform",sidebarInitiallyClosed:D=!1}){let[A,W]=(0,Di.useState)(!D),[k,Q]=(0,Di.useState)(!1),[E,M]=(0,Di.useState)(i),O=ue=>{M(ue),r?.(ue)};return(0,rn.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[k&&(0,rn.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 Di:hidden",onClick:()=>Q(!1)}),(0,rn.jsx)("div",{className:"Di:hidden",children:(0,rn.jsx)(Zr,{items:e,isOpen:k,isMobile:!0,onClose:()=>Q(!1),currentBusinessUnit:E,onBusinessUnitChange:O,onSearch:l,logo:p,appName:C,tagline:P})}),(0,rn.jsx)("div",{className:"hidden Di:block",children:(0,rn.jsx)(Zr,{items:e,isOpen:A,isMobile:!1,currentBusinessUnit:E,onBusinessUnitChange:O,onSearch:l,logo:p,appName:C,tagline:P})}),(0,rn.jsxs)("div",{className:f("min-h-screen fixed w-full transition-all duration-300 ease-in-out",A?"Di:pl-64":"Di:pl-0"),children:[(0,rn.jsx)(Vn,{title:a,notifications:o,onToggleSidebar:()=>W(!A),onToggleMobileMenu:()=>Q(!0),sidebarOpen:A,activeTab:c,onTabChange:n,showTabs:d,onActionClick:m,actionIcon:h,actionText:u,onNotificationRemove:x,onRemoveAll:b,logo:p,appName:C,tagline:P}),(0,rn.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var To=te(require("react"));var as=To.forwardRef(({...e},t)=>(0,rn.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...e}));as.displayName="Breadcrumb";var os=To.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("ol",{ref:a,className:f("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));os.displayName="BreadcrumbList";var Ji=To.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("rn",{ref:a,className:f("inline-flex items-center gap-1.5",e),...t}));Ji.displayName="BreadcrumbItem";var is=To.forwardRef(({asChild:e,className:t,...a},o)=>(0,rn.jsx)(e?No.Slot:"a",{ref:o,className:f("transition-colors hover:text-foreground",t),...a}));is.displayName="BreadcrumbLink";var rs=To.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("span",{ref:a,role:"link","aria-disabled":"true","aria-current":"page",className:f("font-normal text-foreground",e),...t}));rs.displayName="BreadcrumbPage";var ss=({children:e,className:t,...a})=>(0,rn.jsx)("rn",{role:"presentation","aria-hidden":"true",className:f("[&>svg]:w-3.5 [&>svg]:h-3.5",t),...a,children:e??(0,rn.jsx)(fn.ChevronRightIcon,{})});ss.displayName="BreadcrumbSeparator";var Qc=({className:e,...t})=>(0,rn.jsxs)("span",{role:"presentation","aria-hidden":"true",className:f("flex h-9 w-9 items-center justify-center",e),...t,children:[(0,rn.jsx)(fn.DotsHorizontalIcon,{className:"h-4 w-4"}),(0,rn.jsx)("span",{className:"sr-only",children:"More"})]});Qc.displayName="BreadcrumbElipssis";var Yi=te(require("react")),Zc=1,em=1e6;var ns=0;function tm(){return ns=(ns+1)%Number.MAX_SAFE_INTEGER,ns.toString()}var ls=new Map,$n=e=>{if(ls.has(e))return;let t=setTimeout(()=>{ls.delete(e),ri({type:"REMOVE_TOAST",toastId:e})},em);ls.set(e,t)},am=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Zc)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?$n(a):e.toasts.forEach(o=>{$n(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===a||a===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)}}},qi=[],Xi={toasts:[]};function ri(e){Xi=am(Xi,e),qi.forEach(t=>{t(Xi)})}function om({...e}){let t=tm(),a=i=>ri({type:"UPDATE_TOAST",toast:{...i,id:t}}),o=()=>ri({type:"DISMISS_TOAST",toastId:t});return ri({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||o()}}}),{id:t,dismiss:o,update:a}}function Wn(){let[e,t]=Yi.useState(Xi);return Yi.useEffect(()=>(qi.push(t),()=>{let a=qi.indexOf(t);a>-1&&qi.splice(a,1)}),[e]),{...e,toast:om,dismiss:a=>ri({type:"DISMISS_TOAST",toastId:a})}}var Za=te(require("react")),dt=te(require("@radix-Di/react-toast"));var Xn=dt.Provider,ds=Za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(dt.Viewport,{ref:a,className:f("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col Di:max-w-[420px]",e),...t}));ds.displayName=dt.Viewport.displayName;var im=(0,yn.cva)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-Di border p-4 Di-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-Sn-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),cs=Za.forwardRef(({className:e,variant:t,...a},o)=>(0,rn.jsx)(dt.Root,{ref:o,className:f(im({variant:t}),e),...a}));cs.displayName=dt.Root.displayName;var rm=Za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(dt.Action,{ref:a,className:f("inline-flex h-8 shrink-0 items-center justify-center rounded-Di border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));rm.displayName=dt.Action.displayName;var ms=Za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(dt.Close,{ref:a,className:f("absolute right-1 top-1 rounded-Di p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"})}));ms.displayName=dt.Close.displayName;var ps=Za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(dt.Title,{ref:a,className:f("text-sm font-semibold [&+div]:text-rn",e),...t}));ps.displayName=dt.Title.displayName;var us=Za.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(dt.Description,{ref:a,className:f("text-sm opacity-90",e),...t}));us.displayName=dt.Description.displayName;function Yn(){let{toasts:e}=Wn();return(0,rn.jsxs)(Xn,{children:[e.map(function({id:t,title:a,description:o,action:i,...r}){return(0,rn.jsxs)(cs,{...r,children:[(0,rn.jsxs)("div",{className:"grid gap-1",children:[a&&(0,rn.jsx)(ps,{children:a}),o&&(0,rn.jsx)(us,{children:o})]}),i,(0,rn.jsx)(ms,{})]},t)}),(0,rn.jsx)(ds,{})]})}var Qn=({type:e="solid",iconName:t="cloud",size:a="lg",className:o})=>{let i=e.includes("rn-")?e+" ":"rn-"+e+" ",r="rn-"+t,l=o??"",s=i+r+" rn-"+a+" "+l;return(0,rn.jsx)("i",{className:s})};var Po=require("@headlessui/react"),tl=require("@heroicons/react/20/solid");var sm=({name:e,items:t,actions:a=[],href:o})=>!t&&o?(0,rn.jsx)("a",{href:o,className:"flex items-center gap-x-1 text-sm text-foreground group",children:(0,rn.jsxs)("span",{className:"relative",children:[e,(0,rn.jsx)("span",{className:"absolute -bottom-1 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]})}):(0,rn.jsxs)(Po.Popover,{children:[(0,rn.jsxs)(Po.PopoverButton,{className:"flex items-center gap-x-1 text-sm/6 text-foreground outline-none group",children:[(0,rn.jsxs)("span",{className:"relative",children:[e,(0,rn.jsx)("span",{className:"absolute bottom-0 left-1/2 w-1/2 h-0.5 bg-accent transform -translate-x-1/2 scale-x-0 transition-transform duration-300 ease-in-out group-hover:scale-x-100"})]}),(0,rn.jsx)(tl.ChevronDownIcon,{"aria-hidden":"true",className:"h-5 w-5 flex-none text-accent"})]}),(0,rn.jsxs)(Po.PopoverPanel,{transition:!0,className:"absolute inset-x-0 top-0 -z-10 bg-popover rn-14 shadow-lg ring-1 ring-ring/5 transition data-[closed]:-translate-y-1 data-[closed]:opacity-0 data-[enter]:duration-200 data-[leave]:duration-150 data-[enter]:ease-out data-[leave]:ease-in",children:[(0,rn.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-4 gap-x-4 px-6 py-10 lg:px-8 xl:gap-x-8 z-50",children:t&&t.map(i=>(0,rn.jsxs)("div",{className:"group relative rounded-lg p-6 text-sm/6 box-border",children:[(0,rn.jsx)("div",{className:"flex h-16 items-center justify-start rounded-lg bg-popover text-muted-foreground group-hover:text-accent transition-transform duration-400 ease-in-out group-hover:scale-90",children:i.icon&&(0,rn.jsx)(el,{icon:i.icon,size:"4x"})}),(0,rn.jsxs)("a",{href:i.href,className:"rn-6 block text-popover-foreground group-hover:text-accent",children:[i.name,(0,rn.jsx)("span",{className:"absolute inset-0"})]}),(0,rn.jsx)("p",{className:"rn-1 text-popover-foreground/80 group-hover:text-accent",children:i.description})]},i.name))}),a.length>0&&(0,rn.jsx)("div",{className:"bg-gray-50",children:(0,rn.jsx)("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:(0,rn.jsx)("div",{className:"grid grid-cols-3 divide-x divide-gray-900/5 border-x border-gray-900/5",children:a.map(i=>(0,rn.jsxs)("a",{href:i.href,className:"flex items-center max-h-12 justify-center gap-x-2.5 p-3 text-sm/6 text-gray-900 hover:bg-gray-100",children:[i.icon&&(0,rn.jsx)(el,{icon:i.icon,className:"h-5 w-5 flex-none text-gray-400"}),i.name]},i.name))})})})]})]}),el=({icon:e,className:t,size:a="lg"})=>{if(!e)return null;if("type"in e)return(0,rn.jsx)(Qn,{...e,size:a});if("src"in e)return(0,rn.jsx)("div",{className:f(t,"h-full max-w-32 items-start text-left"),children:e&&typeof e.src=="string"&&(0,rn.jsx)("img",{src:e.src,style:{objectFit:"contain",width:"100%",height:"100%"}})})},al=sm;var ol=te(require("next/link"));function il({children:e,href:t,openNewTab:a,...o}){return(0,rn.jsx)(ol.default,{href:t,target:a?"_blank":"_self",...o,children:e})}var gs=te(require("next/image"));function ni({logoLight:e,logoDark:t,mobile:a=!1}){return(0,rn.jsxs)(il,{href:"/",className:f(a?"py-1":"py-2"),children:[(0,rn.jsx)(gs.default,{className:"logo-light dark:hidden",src:e.src,width:e.width,height:e.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}}),(0,rn.jsx)(gs.default,{className:"hidden dark:block",src:t.src,width:t.width,height:t.height,alt:`${process.env.NEXT_PUBLIC_SITE_NAME} brand logo`,sizes:"100vw",priority:!0,style:{width:"auto",height:a?35:50}})]})}function ll({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:i=!1,wide:r=!1}){let[l,s]=(0,Di.useState)(!1),[c,n]=(0,Di.useState)(""),d=["light","dark"],{theme:m,setTheme:h}=(0,Fn.useTheme)();(0,Di.useEffect)(()=>{n(m||"dark")},[m]);let u=()=>{let x=d[(d.indexOf(c)+1)%d.length];n(x),h(x)};return(0,Di.useEffect)(()=>{let x=()=>{window.scrollY>100?s(!0):s(!1)};return window.addEventListener("scroll",x,{passive:!0}),()=>window.removeEventListener("scroll",x)},[]),(0,rn.jsx)(rn.Fragment,{children:(0,rn.jsx)("header",{className:`z-50 pb-10 transition-all duration-300 hidden lg:block ${l||e?"translate-y-0":"-translate-y-full bg-transparent"}`,children:(0,rn.jsx)("nav",{className:"backdrop-blur-sm bg-background/80 text-white p-0",children:(0,rn.jsxs)("div",{className:f("flex items-center justify-between px-9 py-0",!r&&"container"),children:[(0,rn.jsx)(ni,{logoDark:a,logoLight:t}),(0,rn.jsx)(Po.PopoverGroup,{className:"hidden lg:flex lg:gap-x-12",children:o&&o.map(x=>(0,rn.jsx)(al,{...x},x.name))}),i&&(0,rn.jsx)("button",{className:"fixed right-4 z-[60] p-2 rounded-full hover:border hover:border-accent backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-primary dark:text-white hover:text-accent hover:scale-125",onClick:u,children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Sun,{className:"absolute h-6 w-6 rotate-0 scale-100 transition-transform dark:-rotate-90 dark:scale-0"}),(0,rn.jsx)(Sn.Moon,{className:"absoulte h-6 w-6 rotate-0 scale-0 transition-transform dark:rotate-0 dark:scale-100"})]})})]})})})})}var Zi=require("@heroicons/react/24/outline");var fs=["light","dark"];function cl({logoLight:e,logoDark:t,menuItems:a,isMenuOpen:o=!0}){let[i,r]=(0,Di.useState)(!1),{theme:l,setTheme:s}=(0,Fn.useTheme)(),[c,n]=(0,Di.useState)(!1),[d,m]=(0,Di.useState)("light");(0,Di.useEffect)(()=>{let u=()=>{window.scrollY>100?r(!0):r(!1)};return window.addEventListener("scroll",u,{passive:!0}),()=>window.removeEventListener("scroll",u)},[]),(0,Di.useEffect)(()=>{m(l||"dark")},[l]);let h=()=>{let u=fs[(fs.indexOf(d)+1)%fs.length];m(u),s(u)};return(0,rn.jsx)(rn.Fragment,{children:(0,rn.jsxs)("header",{className:`z-50 pb-10 transition-all duration-300 block lg:hidden ${i||o?"translate-y-0":"-translate-y-full bg-transparent"}`,children:[(0,rn.jsx)("nav",{className:f("backdrop-blur-sm text-white p-0",c&&"hidden"),children:(0,rn.jsxs)("div",{className:"flex items-stretch justify-between bg-background px-2 py-0 dark:bg-[#212124] [&rn.logo-light]:[filter:brightness(0)_invert(1)] dark:border-b dark:border-accent",children:[(0,rn.jsx)(ni,{logoDark:t,logoLight:e,mobile:!0}),(0,rn.jsx)("div",{className:"flex items-center space-x-4",children:(0,rn.jsxs)("button",{type:"button",onClick:()=>n(!0),className:"fixed right-4 z-[60] p-2 rounded-full bg-white/10 backdrop-blur-sm transition-all duration-300 hover:bg-white/20 text-white dark:hover:text-accent",children:[(0,rn.jsx)("span",{className:"sr-only",children:"Open main menu"}),(0,rn.jsx)(Zi.Bars3Icon,{"aria-hidden":"true",className:"h-4 w-4"})]})})]})}),(0,rn.jsxs)(Po.Dialog,{open:c,onClose:n,className:"lg:hidden",children:[(0,rn.jsx)("div",{className:"fixed inset-0 z-10 bg-black bg-opacity-50","aria-hidden":"true"}),(0,rn.jsxs)(Po.DialogPanel,{className:"fixed inset-y-0 right-0 z-20 w-full overflow-y-auto bg-background dark:bg-[#212124] px-2 sm:max-w-sm sm:ring-1 sm:ring-gray-900/10",children:[(0,rn.jsxs)("div",{className:"flex items-stretch justify-between",children:[(0,rn.jsx)(ni,{logoDark:t,logoLight:e,mobile:!0}),(0,rn.jsxs)("button",{type:"button",onClick:()=>n(!1),className:"-m-2.5 rounded-Di p-2.5 text-foreground dark:text-foreground outline-none hover:text-accent",children:[(0,rn.jsx)("span",{className:"sr-only",children:"Close menu"}),(0,rn.jsx)(Zi.XMarkIcon,{"aria-hidden":"true",className:"h-6 w-6"})]})]}),(0,rn.jsx)("div",{className:"rn-6 flow-root",children:(0,rn.jsx)("div",{className:"-my-6 divide-y divide-gray-500/10",children:(0,rn.jsx)("div",{className:"space-y-2 px-2 py-6",children:a&&a.map(u=>(0,rn.jsx)(nm,{...u},u.name))})})})]})]})]})})}function nm({name:e,items:t,actions:a,href:o}){return!t&&o?(0,rn.jsx)("a",{href:o,className:"-mx-3 block rounded-lg px-3 py-2 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}):(0,rn.jsxs)(Po.Disclosure,{as:"div",className:"-mx-3",children:[(0,rn.jsx)(Po.DisclosureButton,{className:"group flex w-full items-center justify-between rounded-lg py-2 pl-3 Di-3.5 text-base dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:e}),(0,rn.jsx)(Po.DisclosurePanel,{className:"rn-2 space-y-2",children:t&&t.map(i=>(0,rn.jsx)(Po.DisclosureButton,{as:"a",href:i.href,className:"block rounded-lg py-2 pl-6 Di-3 text-sm dark:text-foreground text-foreground hover:bg-gray-50 hover:text-accent",children:i.name},i.name))})]})}function ml({isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,className:i,wide:r,themeControl:l=!1}){return(0,rn.jsxs)("div",{className:f("fixed top-0 left-0 right-0 z-50",i),children:[(0,rn.jsx)(ll,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o,themeControl:l,wide:r}),(0,rn.jsx)(cl,{isMenuOpen:e,logoLight:t,logoDark:a,menuItems:o})]})}var pl="../../cortex-reply-light-27IMI3G7.png";var ul="../../cortex-reply-dark-XPAJJJYY.png";function vs({...e}){return(0,rn.jsxs)("div",{className:"bg-sidebar",children:[(0,rn.jsx)(ml,{isMenuOpen:!0,logoLight:pl,logoDark:ul,...e.header,className:"bg-sidebar",wide:!0}),(0,rn.jsxs)(Lr,{className:"top-24 mb-4 h-full max-h-[calc(100vh-3.5rem)] flex-1 flex-row overflow-y-clip",children:[(0,rn.jsx)(Ii,{...e.sidebarLeft,className:"flex-none top-24"}),(0,rn.jsxs)(Hr,{className:"grow overflow-hidden",children:[(0,rn.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2",children:(0,rn.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,rn.jsx)(jr,{className:"-ml-1"}),(0,rn.jsx)(qo,{orientation:"vertical",className:"mr-2 h-4"}),(0,rn.jsx)(as,{children:(0,rn.jsxs)(os,{children:[(0,rn.jsx)(Ji,{className:"hidden Di:block",children:(0,rn.jsx)(is,{href:"#",children:"Building Your Application"})}),(0,rn.jsx)(ss,{className:"hidden Di:block"}),(0,rn.jsx)(Ji,{children:(0,rn.jsx)(rs,{children:"Data Fetching"})})]})})]})}),(0,rn.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 rn-0",children:[(0,rn.jsxs)("div",{className:"grid auto-rows-min gap-4 Di:grid-cols-3",children:[(0,rn.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,rn.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"}),(0,rn.jsx)("div",{className:"aspect-video rounded-xl bg-muted/50"})]}),(0,rn.jsx)("div",{className:"flex-1 rounded-xl bg-muted/50 Di:min-h-min"})]})]})]}),(0,rn.jsx)(Yn,{})]})}var cm=[{key:"kanban",icon:Sn.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Sn.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Sn.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Sn.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Sn.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],gl=({currentView:e,onViewChange:t,children:a})=>(0,rn.jsxs)("div",{className:"flex w-full h-screen",children:[(0,rn.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:cm.map(o=>{let i=o.icon,r=e===o.key;return(0,rn.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden Di:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,rn.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,rn.jsx)("span",{className:"text-rn font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,rn.jsx)("div",{className:"flex-1 min-w-0 px-4 Di:px-6 h-full overflow-auto",children:(0,rn.jsx)("div",{className:"w-full h-full",children:a})})]});var fl=te(require("react")),bs=te(require("@radix-Di/react-label"));var mm=(0,yn.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),I=fl.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(bs.Root,{ref:a,className:f(mm(),e),...t}));I.displayName=bs.Root.displayName;var Ne=te(require("@radix-Di/react-select")),Va=te(require("react")),ct=Ne.Root;var Et=Ne.Value,at=Va.forwardRef(({children:e,className:t,...a},o)=>(0,rn.jsxs)(Ne.Trigger,{className:f("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,rn.jsx)(Ne.Icon,{asChild:!0,children:(0,rn.jsx)(Sn.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));at.displayName=Ne.Trigger.displayName;var hl=Va.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(Ne.ScrollUpButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,rn.jsx)(Sn.ChevronUp,{className:"h-4 w-4"})}));hl.displayName=Ne.ScrollUpButton.displayName;var xl=Va.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(Ne.ScrollDownButton,{className:f("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,rn.jsx)(Sn.ChevronDown,{className:"h-4 w-4"})}));xl.displayName=Ne.ScrollDownButton.displayName;var ot=Va.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,rn.jsx)(Ne.Portal,{children:(0,rn.jsxs)(Ne.Content,{className:f("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-Di data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:i,...o,children:[(0,rn.jsx)(hl,{}),(0,rn.jsx)(Ne.Viewport,{className:f("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,rn.jsx)(xl,{})]})}));ot.displayName=Ne.Content.displayName;var pm=Va.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(Ne.Label,{className:f("py-1.5 pl-8 Di-2 text-sm font-semibold",e),ref:a,...t}));pm.displayName=Ne.Label.displayName;var Se=Va.forwardRef(({children:e,className:t,...a},o)=>(0,rn.jsxs)(Ne.Item,{className:f("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 Di-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:o,...a,children:[(0,rn.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,rn.jsx)(Ne.ItemIndicator,{children:(0,rn.jsx)(Sn.Check,{className:"h-4 w-4"})})}),(0,rn.jsx)(Ne.ItemText,{children:e})]}));Se.displayName=Ne.Item.displayName;var um=Va.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(Ne.Separator,{className:f("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));um.displayName=Ne.Separator.displayName;var er=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:l=!1})=>{let[s,c]=(0,Di.useState)(!1),[n,d]=(0,Di.useState)(""),m=o.find(p=>p.value===t),h=o.filter(p=>p.label.toLowerCase().includes(n.toLowerCase())),u=p=>{a(p),c(!1),d("")},x=()=>{r&&n.trim()&&!o.find(p=>p.value===n.trim())&&(a(n.trim()),c(!1),d(""))};return(0,rn.jsxs)("div",{className:"space-y-1",children:[(0,rn.jsx)(I,{className:"text-rn text-muted-foreground",children:e}),(0,rn.jsxs)(ct,{value:t,onValueChange:u,open:s,onOpenChange:p=>{l||c(p)},disabled:l,children:[(0,rn.jsx)(at,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-Di",children:(0,rn.jsx)(ae,{variant:"secondary",className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!l&&c(!s),children:m?.label||t||"Select..."})}),(0,rn.jsxs)(ot,{children:[(0,rn.jsx)("div",{className:"p-2",children:(0,rn.jsx)(K,{placeholder:i,value:n,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&r&&x()},className:"mb-2"})}),h.map(p=>(0,rn.jsx)(Se,{value:p.value,children:p.label},p.value)),r&&n.trim()&&!h.find(p=>p.value===n.trim())&&(0,rn.jsxs)(Se,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var ao=te(require("react"));var z=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("rounded-xl border bg-card text-card-foreground shadow",e),...t}));z.displayName="Card";var _e=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("flex flex-col space-y-1.5 p-6",e),...t}));_e.displayName="CardHeader";var Ye=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("font-semibold leading-none tracking-tight",e),...t}));Ye.displayName="CardTitle";var oo=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("text-sm text-muted-foreground",e),...t}));oo.displayName="CardDescription";var ve=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("p-6 rn-0",e),...t}));ve.displayName="CardContent";var io=ao.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("div",{ref:a,className:f("flex items-center p-6 rn-0",e),...t}));io.displayName="CardFooter";function Ao({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:i=!0,compact:r=!1,className:l}){let[s,c]=(0,Di.useState)(!1),n=h=>{switch(h){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},d=h=>{switch(h){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},m=h=>{if(!h)return"Never";let x=Math.floor((new Date().getTime()-h.getTime())/(1e3*60));return x<1?"Just now":x<60?`${x}m ago`:x<1440?`${Math.floor(x/60)}h ago`:`${Math.floor(x/1440)}d ago`};return(0,rn.jsxs)(z,{className:f("hover:shadow-Di transition-shadow",r&&"p-2",l),children:[(0,rn.jsx)(_e,{className:f("pb-3",r&&"pb-2"),children:(0,rn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rn.jsx)("div",{className:"relative",children:(0,rn.jsxs)(_t,{className:f("h-12 w-12",r&&"h-8 w-8"),children:[(0,rn.jsx)(Xa,{src:"/placeholder.svg",alt:e.name||"name"}),(0,rn.jsx)($t,{children:e.name?.split(" ").map(h=>h[0]).join("")})]})}),(0,rn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("h3",{className:f("font-semibold text-sm truncate",r&&"text-rn"),children:e.name}),e.type==="digital"?(0,rn.jsx)(Sn.Bot,{className:f("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,rn.jsx)(Sn.User,{className:f("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,rn.jsx)("p",{className:f("text-sm text-muted-foreground truncate",r&&"text-rn")}),!r&&(0,rn.jsx)("div",{className:"flex items-center gap-2 rn-1"})]})]}),i&&(0,rn.jsxs)(So,{children:[(0,rn.jsx)(Do,{asChild:!0,children:(0,rn.jsx)(y,{variant:"ghost",size:"icon",className:f("h-8 w-8",r&&"h-6 w-6"),children:(0,rn.jsx)(Sn.MoreHorizontal,{className:f("h-4 w-4",r&&"h-3 w-3")})})}),(0,rn.jsxs)(Ya,{align:"end",children:[e.type==="digital"&&(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)(pa,{onClick:()=>o?.(e),children:[(0,rn.jsx)(Sn.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,rn.jsxs)(pa,{onClick:()=>t?.(e),children:[(0,rn.jsx)(Sn.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,rn.jsxs)(pa,{onClick:()=>a?.(e.id.toString()),className:"text-destructive focus:text-destructive",children:[(0,rn.jsx)(Sn.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,rn.jsxs)(ve,{className:"rn-0",children:[(0,rn.jsx)("div",{className:"space-y-2 text-sm",children:e.type==="human"&&(0,rn.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,rn.jsx)(Sn.Mail,{className:"h-3 w-3"}),(0,rn.jsx)("span",{className:"truncate",children:e.email})]})}),e.type==="digital"&&(0,rn.jsx)("div",{className:"rn-3",children:(0,rn.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities?.slice(0,s?e.capabilities.length:2).map(h=>(0,rn.jsx)(ae,{variant:"outline",className:"text-rn",children:typeof h.value=="number"?h.value:h.value.name},typeof h.value=="number"?h.value:h.value.name)),(e.capabilities?.length||0)>2&&(0,rn.jsx)(y,{variant:"ghost",size:"sm",className:"h-5 px-2 text-rn",onClick:()=>c(!s),children:s?"Show less":`+${(e.capabilities?.length||0)-2} more`})]})})]})]})}var wl=te(require("react")),Re=wl.forwardRef(({className:e,...t},a)=>(0,rn.jsx)("textarea",{className:f("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));Re.displayName="Textarea";function di({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:l="Cancel",readOnly:s=!1,availableKnowledgeDocuments:c=[]}){let[n,d]=(0,Di.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],capabilityLevel:0,...e}),[m,h]=(0,Di.useState)(""),[u,x]=(0,Di.useState)(""),[b,p]=(0,Di.useState)(!s);(0,Di.useEffect)(()=>{e&&d(e)},[e]);let C=E=>{E.preventDefault();let M={id:n.id||parseInt(Date.now().toString()),name:n.name,type:"digital",description:n.description,jobDescription:n.jobDescription||"",workInstructions:n.workInstructions||"",capabilities:n.capabilities||[],capabilityLevel:n.capabilityLevel||0};t(M)},P=(E,M,O)=>{if(!M.trim())return;let ue=n[E]||[];d({...n,[E]:[...ue,M.trim()]}),O("")},D=(E,M)=>{let O=n[E]||[];d({...n,[E]:O.filter((ue,S)=>S!==M)})},A=E=>{E.preventDefault(),p(!b)},W=(E,M,O,ue,S)=>{let Oe=n[E]||[];return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:M}),b&&(0,rn.jsxs)("div",{className:"flex gap-2",children:[(0,rn.jsx)(K,{value:O,onChange:N=>ue(N.target.value),placeholder:S,onKeyPress:N=>{N.key==="Enter"&&(N.preventDefault(),P(E,O,ue))},disabled:o}),(0,rn.jsx)(y,{type:"button",variant:"outline",size:"icon",onClick:()=>P(E,O,ue),disabled:o,children:(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"})})]}),(0,rn.jsx)("div",{className:"flex flex-wrap gap-2",children:Oe.map((N,ge)=>(0,rn.jsxs)(ae,{className:"gap-1",children:[N,b&&(0,rn.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>D(E,ge),disabled:o,children:(0,rn.jsx)(Sn.rn,{className:"h-3 w-3"})})]},`${E}-${ge}-${N}`))})]})},k=i||(b?e?"Edit Colleague":"Add New Colleague":"View Colleague"),Q=r||(e?"Update Colleague":"Add Colleague");return(0,rn.jsxs)(z,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,rn.jsx)(_e,{children:(0,rn.jsxs)(Ye,{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Bot,{className:"h-5 w-5"}),k]})}),(0,rn.jsx)(ve,{children:(0,rn.jsxs)("form",{onSubmit:C,className:"space-y-6",children:[(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"name",children:"Name *"}),(0,rn.jsx)(K,{id:"name",value:n.name||"",onChange:E=>d({...n,name:E.target.value}),required:!0,disabled:o||!b})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:n.description||"",onChange:E=>d({...n,description:E.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!b})]})]}),(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"jobDescription",children:"Job Description *"}),(0,rn.jsx)(Re,{id:"jobDescription",value:n.jobDescription||"",onChange:E=>d({...n,jobDescription:E.target.value}),rows:4,required:n.type==="digital",disabled:o||!b})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,rn.jsx)(Re,{id:"workInstructions",value:n.workInstructions||"",onChange:E=>d({...n,workInstructions:E.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!b})]}),W("capabilities","Capabilities",u,x,"Add capability")]}),(0,rn.jsxs)("div",{className:"flex justify-end gap-2 rn-4 border-t",children:[(0,rn.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:b?l:"Close"}),b?(0,rn.jsx)(y,{type:"submit",disabled:o,children:o?"Saving...":Q}):(0,rn.jsxs)(y,{type:"button",onClick:A,disabled:o,className:"gap-2",children:[(0,rn.jsx)(Sn.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function tr({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 space-y-6",children:(0,rn.jsx)(Ha.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rn.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rn.jsx)(Sn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague Sn add"})]})]}),(0,rn.jsxs)("div",{className:"grid gap-6 Di:grid-cols-2 max-w-4xl mx-auto",children:[(0,rn.jsx)(Ha.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rn.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,rn.jsxs)(_e,{className:"text-center pb-4",children:[(0,rn.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,rn.jsx)(Sn.User,{className:"h-8 w-8 text-blue-600"})}),(0,rn.jsx)(Ye,{className:"text-xl",children:"Add Human Colleague"})]}),(0,rn.jsxs)(ve,{className:"text-center",children:[(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization Sn add as team members."}),(0,rn.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Users,{className:"h-4 w-4 text-blue-600"}),(0,rn.jsx)("span",{children:"Browse existing users"})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.User,{className:"h-4 w-4 text-blue-600"}),(0,rn.jsx)("span",{children:"Import user details automatically"})]})]}),(0,rn.jsx)(y,{className:"rn-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,rn.jsx)(Ha.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rn.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,rn.jsxs)(_e,{className:"text-center pb-4",children:[(0,rn.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,rn.jsx)(Sn.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,rn.jsx)(Ye,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,rn.jsxs)(ve,{className:"text-center",children:[(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,rn.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Bot,{className:"h-4 w-4 text-purple-600"}),(0,rn.jsx)("span",{children:"Clone existing colleagues"})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Users,{className:"h-4 w-4 text-purple-600"}),(0,rn.jsx)("span",{children:"Create from templates"})]})]}),(0,rn.jsx)(y,{className:"rn-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function ar({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[i,r]=(0,Di.useState)(""),[l,s]=(0,Di.useState)("all"),c=(0,Di.useMemo)(()=>e.filter(m=>m.name.toLowerCase().includes(i.toLowerCase())||m.jobDescription?.toLowerCase().includes(i.toLowerCase())||m.workInstructions?.toLowerCase().includes(i.toLowerCase())),[e,i,l]),n=m=>{let h={...m,name:`${m.name} (Copy)`};t(h)},d=m=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(m);return(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 space-y-6",children:(0,rn.jsx)(Ha.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rn.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rn.jsx)(Sn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague Sn clone"})]})]}),(0,rn.jsx)(z,{children:(0,rn.jsx)(ve,{className:"rn-6",children:(0,rn.jsxs)("div",{className:"flex flex-col Di:flex-row gap-4",children:[(0,rn.jsx)("div",{className:"flex-1",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(K,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:m=>r(m.target.value),className:"pl-9"})]})}),(0,rn.jsxs)("select",{value:l,onChange:m=>s(m.target.value),className:"h-10 px-3 rounded-Di border border-input bg-background text-sm ring-offset-background",children:[(0,rn.jsx)("option",{value:"all",children:"All Status"}),(0,rn.jsx)("option",{value:"active",children:"Active"}),(0,rn.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,rn.jsx)("div",{className:"grid gap-4 Di:grid-cols-2 lg:grid-cols-3",children:c.map(m=>(0,rn.jsx)(Ha.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,rn.jsxs)(z,{className:`cursor-pointer transition-all hover:shadow-lg ${o?.toString()===m.id.toString()?"ring-2 ring-primary":""}`,onClick:()=>n(m),children:[(0,rn.jsx)(_e,{className:"pb-3",children:(0,rn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rn.jsx)(_t,{children:(0,rn.jsx)($t,{className:"bg-blue-100",children:(0,rn.jsx)(Sn.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,rn.jsx)("div",{children:(0,rn.jsx)(Ye,{className:"text-lg flex items-center gap-2",children:m.name})})]}),(0,rn.jsxs)(y,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:h=>{h.stopPropagation(),n(m)},children:[(0,rn.jsx)(Sn.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,rn.jsx)(ve,{className:"rn-0",children:(0,rn.jsxs)("div",{className:"space-y-3",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,rn.jsx)("p",{className:"text-sm line-clamp-2",children:m.jobDescription})]}),m.capabilities&&m.capabilities.length>0&&(0,rn.jsxs)("div",{children:[(0,rn.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,rn.jsx)("div",{className:"flex flex-wrap gap-1",children:m.capabilities.length>3&&(0,rn.jsxs)(ae,{variant:"outline",className:"text-rn",children:["+",m.capabilities.length-3]})})]}),(0,rn.jsx)("div",{className:"flex items-center justify-between text-rn text-muted-foreground"}),m.workInstructions&&(0,rn.jsxs)("div",{children:[(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,rn.jsx)("p",{className:"text-rn line-clamp-2",children:m.workInstructions})]})]})})]})},m.id))}),c.length===0&&(0,rn.jsx)(z,{children:(0,rn.jsx)(ve,{className:"rn-6",children:(0,rn.jsxs)("div",{className:"text-center py-8",children:[(0,rn.jsx)(Sn.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function or({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 space-y-6",children:(0,rn.jsx)(Ha.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rn.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rn.jsx)(Sn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Choose how Sn create your digital colleague"})]})]}),(0,rn.jsxs)("div",{className:"grid gap-6 Di:grid-cols-2 max-w-4xl mx-auto",children:[(0,rn.jsx)(Ha.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rn.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,rn.jsxs)(_e,{className:"text-center pb-4",children:[(0,rn.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,rn.jsx)(Sn.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,rn.jsx)(Ye,{className:"text-xl",children:"Clone Existing"})]}),(0,rn.jsxs)(ve,{className:"text-center",children:[(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize it for your needs."}),(0,rn.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Bot,{className:"h-4 w-4 text-blue-600"}),(0,rn.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Copy,{className:"h-4 w-4 text-blue-600"}),(0,rn.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,rn.jsx)(y,{className:"rn-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,rn.jsx)(Ha.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,rn.jsxs)(z,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,rn.jsxs)(_e,{className:"text-center pb-4",children:[(0,rn.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,rn.jsx)(Sn.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,rn.jsx)(Ye,{className:"text-xl",children:"Create New"})]}),(0,rn.jsxs)(ve,{className:"text-center",children:[(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,rn.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4 text-green-600"}),(0,rn.jsx)("span",{children:"Custom job description"})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,rn.jsx)(Sn.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,rn.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,rn.jsx)(y,{className:"rn-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}var Cl=te(require("react")),pi=te(require("@radix-Di/react-switch"));var Eo=Cl.forwardRef(({className:e,...t},a)=>(0,rn.jsx)(pi.Root,{className:f("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,rn.jsx)(pi.Thumb,{className:f("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Eo.displayName=pi.Root.displayName;function rr({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:l="Cancel",readOnly:s=!1}){let[c,n]=(0,Di.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,m]=(0,Di.useState)(!s);(0,Di.useEffect)(()=>{e&&n(e)},[e]);let h=async p=>{p.preventDefault();let C={id:c.id||Date.now(),name:c.name,description:c.description||null,systemMsg:c.systemMsg||null,useProjects:c.useProjects||!1,useKnowledge:c.useKnowledge||!1,useFiles:c.useFiles||!1,useChat:c.useChat||!1,updatedAt:new Date().toISOString(),createdAt:c.createdAt||new Date().toISOString()};await t(C)},u=p=>{p.preventDefault(),m(!d)},x=i||(d?e?"Edit Team":"Create New Team":"View Team"),b=r||(e?"Update Team":"Create Team");return(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Users,{className:"h-5 w-5"}),x]}),(0,rn.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"name",children:"Team Name *"}),(0,rn.jsx)(K,{id:"name",value:c.name||"",onChange:p=>n({...c,name:p.target.value}),required:!0,disabled:o||!d,placeholder:"Enter team name..."})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:c.description||"",onChange:p=>n({...c,description:p.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!d})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"systemMsg",children:"Ways of working"}),(0,rn.jsx)(Re,{id:"systemMsg",value:c.systemMsg||"",onChange:p=>n({...c,systemMsg:p.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:o||!d})]})]}),(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,rn.jsxs)("div",{className:"grid grid-cols-1 Di:grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(Eo,{id:"useProjects",checked:c.useProjects||!1,onCheckedChange:p=>n({...c,useProjects:p}),disabled:o||!d}),(0,rn.jsx)(I,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(Eo,{id:"useKnowledge",checked:c.useKnowledge||!1,onCheckedChange:p=>n({...c,useKnowledge:p}),disabled:o||!d}),(0,rn.jsx)(I,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(Eo,{id:"useFiles",checked:c.useFiles||!1,onCheckedChange:p=>n({...c,useFiles:p}),disabled:o||!d}),(0,rn.jsx)(I,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(Eo,{id:"useChat",checked:c.useChat||!1,onCheckedChange:p=>n({...c,useChat:p}),disabled:o||!d}),(0,rn.jsx)(I,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,rn.jsxs)("div",{className:"flex justify-end gap-2 rn-4 border-t",children:[(0,rn.jsx)(y,{type:"button",variant:"outline",onClick:a,disabled:o,children:d?l:"Close"}),d?(0,rn.jsx)(y,{type:"submit",disabled:o||!c.name?.trim(),children:o?"Saving...":b}):(0,rn.jsxs)(y,{type:"button",onClick:u,disabled:o,className:"gap-2",children:[(0,rn.jsx)(Sn.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})]})}var sr=require("react-icons/rn");function He({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:l,className:s}){let[c,n]=Ui(`hero-section-minimized-${e.replace(/\s+/rn,"-").toLowerCase()}`,!i&&!t),d=!i&&!t||c;return(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:`overflow-hidden rounded-3xl ${r} p-8 text-white ${s||""}`,children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,rn.jsx)(ae,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,rn.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[d&&o&&(0,rn.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,rn.jsx)("button",{"aria-label":c?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>n(!c),style:{lineHeight:0},children:c?(0,rn.jsx)(sr.FaChevronDown,{size:22}):(0,rn.jsx)(sr.FaChevronUp,{size:22})})]})]}),!d&&(0,rn.jsxs)("div",{className:"flex flex-col gap-6 Di:flex-row Di:items-center Di:justify-between",children:[(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,rn.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,rn.jsx)(y,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,rn.jsx)(y,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),l&&(0,rn.jsx)("div",{className:"hidden lg:block",children:l})]})]})}var Dl=te(require("react")),gi=te(require("@radix-Di/react-progress"));var fi=Dl.forwardRef(({className:e,value:t,...a},o)=>(0,rn.jsx)(gi.Root,{ref:o,className:f("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,rn.jsx)(gi.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));fi.displayName=gi.Root.displayName;function ws({app:e,onOpen:t,onFavorite:a,showProgress:o=!1,className:i}){return(0,rn.jsx)(Ha.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:i,children:(0,rn.jsxs)(z,{className:"overflow-hidden rounded-3xl border-2 hover:border-primary/50 transition-all duration-300",children:[(0,rn.jsx)(_e,{className:"pb-2",children:(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl bg-muted",children:e.icon}),e.new?(0,rn.jsx)(ae,{className:"rounded-xl bg-amber-500",children:"New"}):(0,rn.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-2xl",onClick:()=>a?.(e),children:(0,rn.jsx)(Sn.Star,{className:"h-4 w-4"})})]})}),(0,rn.jsxs)(ve,{className:"pb-2",children:[(0,rn.jsx)(Ye,{className:"text-lg",children:e.name}),(0,rn.jsx)(oo,{children:e.description}),o&&e.progress<100&&(0,rn.jsxs)("div",{className:"rn-2",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rn.jsx)("span",{children:"Installation"}),(0,rn.jsxs)("span",{children:[e.progress,"%"]})]}),(0,rn.jsx)(fi,{value:e.progress,className:"h-2 rn-1 rounded-xl"})]})]}),(0,rn.jsx)(io,{children:(0,rn.jsx)(y,{variant:"secondary",className:"w-full rounded-2xl",onClick:()=>t?.(e),children:e.progress<100?"Continue Install":"Open"})})]})})}function Bo({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:i=!0,className:r}){return(0,rn.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,rn.jsxs)("div",{className:"bg-muted/50 p-3 hidden Di:grid Di:grid-cols-10 text-sm font-medium",children:[(0,rn.jsx)("div",{className:"col-span-6",children:"Name"}),(0,rn.jsx)("div",{className:"col-span-2",children:"Size"}),(0,rn.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,rn.jsx)("div",{className:"divide-y",children:e.map(l=>(0,rn.jsxs)(Ha.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 Di:grid Di:grid-cols-10 items-center flex flex-col Di:flex-row gap-3 Di:gap-0 cursor-pointer",onClick:()=>t?.(l),children:[(0,rn.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full Di:w-auto",children:[(0,rn.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,rn.jsx)("div",{children:(0,rn.jsx)("p",{className:"font-medium",children:l.name})})]}),(0,rn.jsx)("div",{className:"col-span-2 text-sm Di:text-base",children:l.filesize}),(0,rn.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full Di:w-auto",children:[(0,rn.jsx)("span",{className:"text-sm Di:text-base",children:typeof l.createdAt=="string"?l.createdAt:new Date(l.createdAt).toLocaleDateString()}),(0,rn.jsx)("div",{className:"flex gap-1",children:(0,rn.jsx)(y,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),o?.(l)},children:(0,rn.jsx)(Sn.Trash2,{className:"h-4 w-4"})})})]})]},l.name))})]})}function nr({project:e,onOpen:t,onShare:a,className:o}){return(0,$e.jsx)(Ha.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,$e.jsxs)(z,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,$e.jsxs)(_e,{children:[(0,$e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$e.jsx)(Ye,{children:e.name}),(0,$e.jsxs)(ae,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,$e.jsx)(oo,{children:e.description})]}),(0,$e.jsxs)(ve,{className:"space-y-4",children:[(0,$e.jsxs)("div",{className:"space-y-2",children:[(0,$e.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,$e.jsx)("span",{children:"Progress"}),(0,$e.jsxs)("span",{children:[e.progress,"%"]})]}),(0,$e.jsx)(fi,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,$e.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,$e.jsxs)("div",{className:"flex items-center",children:[(0,$e.jsx)(Sn.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,$e.jsxs)("div",{className:"flex items-center",children:[(0,$e.jsx)(Sn.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,$e.jsxs)(io,{className:"flex gap-2",children:[(0,$e.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,$e.jsx)(y,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,$e.jsx)(Sn.Share2,{className:"h-4 w-4"})})]})]})})}var Ns=[{name:"PixelMaster",icon:(0,rn.jsx)(Sn.ImageIcon,{className:"text-violet-500"}),description:"Advanced image editing and composition",category:"Creative",recent:!0,new:!1,progress:100},{name:"VectorPro",icon:(0,rn.jsx)(Sn.Brush,{className:"text-orange-500"}),description:"Professional vector graphics creation",category:"Creative",recent:!0,new:!1,progress:100},{name:"VideoStudio",icon:(0,rn.jsx)(Sn.Video,{className:"text-pink-500"}),description:"Cinematic video editing and production",category:"Video",recent:!0,new:!1,progress:100},{name:"MotionFX",icon:(0,rn.jsx)(Sn.Sparkles,{className:"text-blue-500"}),description:"Stunning visual effects and animations",category:"Video",recent:!1,new:!1,progress:100},{name:"PageCraft",icon:(0,rn.jsx)(Sn.Layers,{className:"text-red-500"}),description:"Professional page design and layout",category:"Creative",recent:!1,new:!1,progress:100},{name:"UXFlow",icon:(0,rn.jsx)(Sn.LayoutGrid,{className:"text-fuchsia-500"}),description:"Intuitive user experience design",category:"Design",recent:!1,new:!0,progress:85},{name:"PhotoLab",icon:(0,rn.jsx)(Sn.Camera,{className:"text-teal-500"}),description:"Advanced photo editing and organization",category:"Photography",recent:!1,new:!1,progress:100},{name:"DocMaster",icon:(0,rn.jsx)(Sn.FileText,{className:"text-red-600"}),description:"Document editing and management",category:"Document",recent:!1,new:!1,progress:100},{name:"WebCanvas",icon:(0,rn.jsx)(Sn.Code,{className:"text-emerald-500"}),description:"Web design and development",category:"Web",recent:!1,new:!0,progress:70},{name:"3DStudio",icon:(0,rn.jsx)(Sn.CuboidIcon,{className:"text-indigo-500"}),description:"3D modeling and rendering",category:"3D",recent:!1,new:!0,progress:60},{name:"FontForge",icon:(0,rn.jsx)(Sn.Type,{className:"text-amber-500"}),description:"Typography and font creation",category:"Typography",recent:!1,new:!1,progress:100},{name:"ColorPalette",icon:(0,rn.jsx)(Sn.Palette,{className:"text-purple-500"}),description:"Color scheme creation and management",category:"Design",recent:!1,new:!1,progress:100}],Il=[{id:1,filename:"Brand Redesign.pxm",filesize:24.5,url:"https://example.com/brand-redesign.pxm",mimeType:"image/png",name:"Brand Redesign.pxm",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:2,filename:"Company Logo.vec",filesize:8.2,url:"https://example.com/company-logo.vec",mimeType:"image/svg+xml",name:"Company Logo.vec",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:3,filename:"Product Launch Video.vid",filesize:1.2,url:"https://example.com/product-launch-video.vid",mimeType:"video/mp4",name:"Product Launch Video.vid",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:4,filename:"UI Animation.mfx",filesize:345,url:"https://example.com/Di-animation.mfx",mimeType:"video/mp4",name:"UI Animation.mfx",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:5,filename:"Magazine Layout.pgc",filesize:42.8,url:"https://example.com/magazine-layout.pgc",mimeType:"image/png",name:"Magazine Layout.pgc",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:6,filename:"Mobile App Design.uxf",filesize:18.3,url:"https://example.com/mobile-app-design.uxf",mimeType:"image/png",name:"Mobile App Design.uxf",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1},{id:7,filename:"Product Photography.phl",filesize:156,url:"https://example.com/product-photography.phl",mimeType:"image/png",name:"Product Photography.phl",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),project:1}];var Ml=[{title:"Mastering Digital Illustration",description:"Learn advanced techniques for creating stunning digital art",duration:"1h 45m",level:"Advanced",instructor:"Sarah Chen",category:"Illustration",views:"24K"},{title:"UI/UX Design Fundamentals",description:"Essential principles for creating intuitive user interfaces",duration:"2h 20m",level:"Intermediate",instructor:"Michael Rodriguez",category:"Design",views:"56K"},{title:"Video Editing Masterclass",description:"Professional techniques for cinematic video editing",duration:"3h 10m",level:"Advanced",instructor:"James Wilson",category:"Video",views:"32K"},{title:"Typography Essentials",description:"Create beautiful and effective typography for any project",duration:"1h 30m",level:"Beginner",instructor:"Emma Thompson",category:"Typography",views:"18K"},{title:"Color Theory for Designers",description:"Understanding color relationships and psychology",duration:"2h 05m",level:"Intermediate",instructor:"David Kim",category:"Design",views:"41K"}];var Bl=[{id:"home",title:"Home",icon:(0,rn.jsx)(Sn.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,rn.jsx)(Sn.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,rn.jsx)(Sn.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with rn",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,rn.jsx)(Sn.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,rn.jsx)(Sn.FileText,{}),url:"/knowledge"}],Fl=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project is due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated Sn version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You've used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' is now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}];var Oo=[{id:1,name:"E-commerce Platform",description:"Main customer-facing e-commerce application",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:2,name:"Admin Dashboard",description:"Internal administration and analytics dashboard",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:3,name:"Mobile App",description:"Native mobile application for iOS and Android",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}];var Cs=[{id:1,name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],lr=[{id:1,name:"Backlog",description:"Tasks not yet assigned Sn a sprint",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:3,name:"Sprint 1",description:"Initial development phase",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,name:"Sprint 2",description:"Feature development",startDate:new Date().toString(),endDate:new Date().toString(),createdAt:new Date().toString(),updatedAt:new Date().toString()}],mr=[{id:1,name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",dateLogged:new Date().toString(),index:1,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"John Doe"},createdAt:new Date().toString()},{id:2,name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",dateLogged:new Date().toString(),index:2,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jane Smith"},createdAt:new Date().toString()},{id:3,name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:3,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Mike Johnson"},createdAt:new Date().toString()},{id:4,name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",dateLogged:new Date().toString(),index:4,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Sarah Wilson"},createdAt:new Date().toString()},{id:5,name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",dateLogged:new Date().toString(),index:5,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Alex Brown"},createdAt:new Date().toString()},{id:6,name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",dateLogged:new Date().toString(),index:6,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Emma Davis"},createdAt:new Date().toString()},{id:7,name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:7,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Tom Wilson"},createdAt:new Date().toString()}],gm=[...mr,{id:8,name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:8,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"1"},createdAt:new Date().toString()},{id:9,name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",dateLogged:new Date().toString(),index:9,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Taylor Swift"},createdAt:new Date().toString()},{id:10,name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",dateLogged:new Date().toString(),index:10,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Jordan Smith"},createdAt:new Date().toString()},{id:11,name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",dateLogged:new Date().toString(),index:11,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Morgan Davis"},createdAt:new Date().toString()},{id:12,name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",dateLogged:new Date().toString(),index:12,updatedAt:new Date().toString(),assignee:{relationTo:"users",value:"Casey Johnson"},createdAt:new Date().toString()}],fm=[{id:4,name:"Analytics Platform",description:"Business intelligence and reporting system",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1},{id:5,name:"API Gateway",description:"Microservices API management layer",createdAt:new Date().toString(),updatedAt:new Date().toString(),team:1}],dr={projects:[{id:"1",name:"Empty Project",description:"A project with Ha tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},El={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:mr.filter(e=>typeof e.epic=="object"?e.epic?.id===1:e.epic===1)};var xv={empty:{initialProjects:dr.projects,initialEpics:dr.epics,initialSprints:dr.sprints,initialTasks:dr.tasks},default:{initialProjects:Oo,initialEpics:Cs,initialSprints:lr,initialTasks:mr},highDensity:{initialProjects:Oo,initialEpics:Cs,initialSprints:lr,initialTasks:gm},singleEpic:{initialProjects:Oo,initialEpics:El.epics,initialSprints:lr,initialTasks:El.tasks},multipleProjects:{initialProjects:fm,initialEpics:Cs,initialSprints:lr,initialTasks:mr}},cr=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:2,type:"digital",name:"CodeAssist Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:4,type:"digital",name:"MarketingBot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",createdAt:new Date().toString(),updatedAt:new Date().toString()},{id:6,type:"digital",name:"DataAnalyzer Pro",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:3}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:7,type:"digital",name:"ProjectManager AI",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:4},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1},{id:8,type:"digital",name:"CustomerSupport Bot",createdAt:new Date().toString(),updatedAt:new Date().toString(),jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond Sn customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases Sn human agents.",capabilities:[{relationTo:"mcpTools",value:1},{relationTo:"mcpTools",value:2},{relationTo:"mcpTools",value:5}],knowledge:1,coreKnowledge:1,capabilityLevel:1}],yv=[{id:1,title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15).toString(),dueTime:"14:30",assignedColleague:cr.find(e=>e.id==="2"&&e.type==="digital"),isRecurring:!1,createdAt:new Date(2024,2,10).toString(),updatedAt:new Date(2024,2,10).toString(),project:Oo[0]},{id:2,title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18).toString(),dueTime:"10:00",assignedColleague:cr.find(e=>e.id==="4"&&e.type==="digital"),createdAt:new Date(2024,2,11).toString(),updatedAt:new Date(2024,2,11).toString(),project:Oo[0]},{id:3,title:"Deploy Sn production",description:"Deploy the latest version Sn production environment",dueDate:new Date().toString(),dueTime:"16:00",assignedColleague:cr.find(e=>e.id==="2"&&e.type==="digital"),createdAt:new Date().toString(),updatedAt:new Date().toString(),project:Oo[0]}];var wv=cr.filter(e=>e.type==="digital");function Ll({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[i,r]=(0,Di.useState)(""),l=(0,Di.useMemo)(()=>e.filter(c=>c.name?.toLowerCase().includes(i.toLowerCase())||c.email.toLowerCase().includes(i.toLowerCase())),[e,i]),s=c=>{t(c)};return(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 space-y-6",children:(0,rn.jsx)(Ha.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,rn.jsxs)(y,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,rn.jsx)(Sn.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Choose a user Sn add as a colleague"})]})]}),(0,rn.jsx)(z,{className:"container",children:(0,rn.jsx)(ve,{className:"rn-6",children:(0,rn.jsx)("div",{className:"flex flex-col Di:flex-row gap-4",children:(0,rn.jsx)("div",{className:"flex-1",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(K,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:c=>r(c.target.value),className:"pl-9"})]})})})})}),(0,rn.jsx)("div",{className:"container grid gap-4 Di:grid-cols-2 lg:grid-cols-3",children:l.map(c=>(0,rn.jsx)(Ha.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,rn.jsxs)(z,{className:`cursor-pointer transition-all hover:shadow-lg ${o===c.id?"ring-2 ring-primary":""}`,onClick:()=>s(c),children:[(0,rn.jsx)(_e,{className:"pb-3",children:(0,rn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rn.jsx)(_t,{children:(0,rn.jsx)($t,{children:(0,rn.jsx)(Sn.User,{className:"h-4 w-4"})})}),(0,rn.jsx)("div",{children:(0,rn.jsx)(Ye,{className:"text-lg",children:c.name})})]}),o===c.id&&(0,rn.jsx)(Sn.Check,{className:"h-5 w-5 text-primary"})]})}),(0,rn.jsx)(ve,{className:"rn-0",children:(0,rn.jsxs)("div",{className:"space-y-3",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,rn.jsx)("p",{className:"text-sm font-medium",children:c.email})]}),(0,rn.jsx)("div",{children:(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"})})]})})]})},c.id))}),l.length===0&&(0,rn.jsx)(z,{className:"container rn-4",children:(0,rn.jsx)(ve,{className:"rn-6",children:(0,rn.jsxs)("div",{className:"text-center py-8",children:[(0,rn.jsx)(Sn.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function bi({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:l,availableUsers:s=[],existingDigitalColleagues:c=[]}){let[n,d]=(0,Di.useState)(e||[]),[m,h]=(0,Di.useState)(""),[u,x]=(0,Di.useState)("all"),[b,p]=(0,Di.useState)("all"),[C,P]=(0,Di.useState)("all"),[D,A]=(0,Di.useState)(null),[W,k]=(0,Di.useState)(null);(0,Di.useEffect)(()=>{d(e||[])},[e]);let Q=Array.isArray(s)?s:[],E=Array.isArray(c)?c:[],[M,O]=(0,Di.useState)("main"),ue=n.filter(R=>!R||!R.name?!1:R.name.toLowerCase().includes(m.toLowerCase())||R.type==="human"&&R.email?.toLowerCase().includes(m.toLowerCase())||R.type==="digital"&&R.jobDescription?.toLowerCase().includes(m.toLowerCase())),S=ue.filter(R=>R.type==="human"),Oe=ue.filter(R=>R.type==="digital"),N=()=>{O("typeSelection")},ge=R=>{R.type==="digital"&&(A(R),O("form")),console.log("Editing colleague:",R),a?.(R)},oe=R=>{R.type==="digital"&&(k(R),O("view"))},St=R=>{let ft={id:`human-${Date.now()}`,type:"human",name:R.name,email:R.email,updatedAt:R.updatedAt,createdAt:R.createdAt,accounts:R.accounts};d(At=>[...At,ft]),t?.(ft),O("main")},Ze=R=>{if(!R||!R.id){console.error("Invalid cloned colleague provided Sn handleDigitalColleagueClone:",R);return}d(ft=>[...ft,{...R,type:"digital"}]),t?.({...R,type:"digital"}),O("main")},Xt=()=>{A(null),O("form")},Ut=R=>{if(!R||!R.id){console.error("Invalid colleague provided Sn handleSaveColleague:",R);return}D?(d(ft=>ft.map(At=>At.id===R.id?{...R,type:"digital"}:At)),a?.({...R,type:"digital"})):(d(ft=>[...ft,{...R,type:"digital"}]),t?.({...R,type:"digital"})),O("main"),A(null)},F=()=>{O("main"),A(null),k(null)},Ce=()=>{O("main"),k(null)},Xe=()=>{W&&(A(W),k(null),O("form"))},Rt=R=>{console.log("deleting",R,n),o?.(R,n.find(ft=>ft.id.toString()===R.toString())?.type),d(ft=>ft.filter(At=>At.id!==R))},Ae=()=>{h(""),x("all"),p("all")};return M==="typeSelection"?(0,rn.jsx)(tr,{onSelectHuman:()=>O("userSelection"),onSelectDigital:()=>O("digitalOptions"),onCancel:()=>O("main")}):M==="userSelection"?(0,rn.jsx)(Ll,{users:Q,onUserSelect:St,onCancel:()=>O("typeSelection")}):M==="digitalOptions"?(0,rn.jsx)(or,{onCloneExisting:()=>O("digitalClone"),onCreateNew:Xt,onCancel:()=>O("typeSelection")}):M==="digitalClone"?(0,rn.jsx)(ar,{digitalColleagues:E,onColleagueClone:Ze,onCancel:()=>O("digitalOptions")}):M==="form"?(0,rn.jsx)(di,{colleague:D||void 0,onSave:Ut,onCancel:F}):M==="view"?(0,rn.jsx)(di,{colleague:W||void 0,onSave:Ut,onCancel:Ce,readOnly:!0}):(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:(0,rn.jsx)(Ha.AnimatePresence,{mode:"wait",children:(0,rn.jsx)(Ha.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,rn.jsxs)("div",{className:`space-y-6 ${l||""}`,children:[(0,rn.jsx)(He,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-Sn-r from-green-600 via-emerald-600 Sn-teal-600",primaryAction:{label:"Add colleague",onClick:N}}),(0,rn.jsxs)("div",{className:"grid grid-cols-1 Di:grid-cols-3 gap-4",children:[(0,rn.jsxs)(z,{children:[(0,rn.jsxs)(_e,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,rn.jsx)(Ye,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,rn.jsx)(Sn.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,rn.jsxs)(ve,{children:[(0,rn.jsx)("div",{className:"text-2xl font-bold",children:n.length}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:"0 active"})]})]}),(0,rn.jsxs)(z,{children:[(0,rn.jsxs)(_e,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,rn.jsx)(Ye,{className:"text-sm font-medium",children:"Human Members"}),(0,rn.jsx)(Sn.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,rn.jsxs)(ve,{children:[(0,rn.jsx)("div",{className:"text-2xl font-bold",children:n.filter(R=>R.type==="human").length}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:"active"})]})]}),(0,rn.jsxs)(z,{children:[(0,rn.jsxs)(_e,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,rn.jsx)(Ye,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,rn.jsx)(Sn.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,rn.jsxs)(ve,{children:[(0,rn.jsx)("div",{className:"text-2xl font-bold",children:n.filter(R=>R.type==="digital").length}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground",children:"0 active"})]})]})]}),(0,rn.jsx)(z,{children:(0,rn.jsx)(ve,{className:"rn-6",children:(0,rn.jsxs)("div",{className:"flex flex-col Di:flex-row gap-4",children:[(0,rn.jsx)("div",{className:"flex-1",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(K,{placeholder:"Search colleagues...",value:m,onChange:R=>h(R.target.value),className:"pl-9"})]})}),(0,rn.jsxs)(ct,{value:u,onValueChange:x,children:[(0,rn.jsx)(at,{className:"w-full Di:w-[180px]",children:(0,rn.jsx)(Et,{placeholder:"Department"})}),(0,rn.jsxs)(ot,{children:[(0,rn.jsx)(Se,{value:"all",children:"All Departments"}),r.map(R=>(0,rn.jsx)(Se,{value:R,children:R},R))]})]}),(0,rn.jsxs)(ct,{value:b,onValueChange:p,children:[(0,rn.jsx)(at,{className:"w-full Di:w-[140px]",children:(0,rn.jsx)(Et,{placeholder:"Status"})}),(0,rn.jsxs)(ot,{children:[(0,rn.jsx)(Se,{value:"all",children:"All Status"}),(0,rn.jsx)(Se,{value:"active",children:"Active"}),(0,rn.jsx)(Se,{value:"inactive",children:"Inactive"})]})]}),(m||u!=="all"||b!=="all")&&(0,rn.jsxs)(y,{variant:"outline",onClick:Ae,className:"gap-2",children:[(0,rn.jsx)(Sn.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsx)(ko,{activeTab:C,onTabChange:P,tabOptions:[{value:"all",label:`All (${ue.length})`},{value:"human",label:`Human (${S.length})`},{value:"digital",label:`Digital (${Oe.length})`}],maxWidth:"400px",gridCols:3}),C==="all"&&(0,rn.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 Di:grid-cols-2 lg:grid-cols-4":"grid-cols-1 Di:grid-cols-2 lg:grid-cols-3"}`,children:ue.map(R=>(0,rn.jsx)(Ao,{colleague:R,onEdit:ge,onDelete:Rt,onViewDetails:oe,compact:i},`${R}-${R.id}`))}),C==="human"&&(0,rn.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 Di:grid-cols-2 lg:grid-cols-4":"grid-cols-1 Di:grid-cols-2 lg:grid-cols-3"}`,children:S.map(R=>(0,rn.jsx)(Ao,{colleague:R,onEdit:ge,onDelete:Rt,onViewDetails:oe,compact:i},R.id))}),C==="digital"&&(0,rn.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 Di:grid-cols-2 lg:grid-cols-4":"grid-cols-1 Di:grid-cols-2 lg:grid-cols-3"}`,children:Oe.map(R=>(0,rn.jsx)(Ao,{colleague:R,onEdit:ge,onDelete:Rt,onViewDetails:oe,compact:i},R.id))})]}),ue.length===0&&(0,rn.jsx)(z,{children:(0,rn.jsx)(ve,{className:"rn-6",children:(0,rn.jsxs)("div",{className:"text-center py-8",children:[(0,rn.jsx)(Sn.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:m||u!=="all"||b!=="all"?"Try adjusting your filters Sn see more results.":"Get started by adding your first colleague."}),(0,rn.jsxs)(y,{onClick:N,className:"gap-2",children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function gr({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:i=[]}){let[r,l]=(0,Di.useState)({...e,updatedAt:new Date}),s=()=>{let b=new Set,p=new Set;return i.forEach(C=>{C.menuConfig.groupBy.forEach(P=>b.add(P))}),o.forEach(C=>{C.metadata&&Object.keys(C.metadata).forEach(P=>p.add(P))}),{contextKeys:Array.from(b).sort(),documentKeys:Array.from(p).sort(),allKeys:Array.from(new Set([...b,...p])).sort()}},c=b=>{let p=new Set;return o.forEach(C=>{C.metadata?.[b]&&p.add(String(C.metadata[b]))}),Array.from(p).sort()},n=s(),d=()=>{t(r)},m=(b,p)=>{l(C=>({...C,metadata:{...C.metadata,[b]:p}}))},h=(b,p)=>{p==="__custom__"?m(b,""):m(b,p)},u=()=>{let b=`field_${Date.now()}`;m(b,"")},x=b=>{l(p=>{let C={...p.metadata};return delete C[b],{...p,metadata:C}})};return(0,$.jsxs)(Ha.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,$.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,$.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,$.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,$.jsx)(Sn.Edit3,{className:"h-6 w-6 text-primary"})}),(0,$.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Edit Document"})]}),(0,$.jsxs)("div",{className:"flex gap-2",children:[(0,$.jsxs)(y,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,$.jsx)(Sn.rn,{className:"h-4 w-4"}),"Cancel"]}),(0,$.jsxs)(y,{size:"sm",onClick:d,className:"gap-2",children:[(0,$.jsx)(Sn.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,$.jsxs)("div",{className:"space-y-4",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,$.jsx)(K,{value:r.title,onChange:b=>l(p=>({...p,title:b.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,$.jsx)(Re,{value:r.description||"",onChange:b=>l(p=>({...p,description:b.target.value})),placeholder:"Document description...",rows:2})]}),(0,$.jsxs)("div",{children:[(0,$.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-foreground",children:"Metadata"}),n.contextKeys.length>0&&(0,$.jsxs)("p",{className:"text-rn text-muted-foreground",children:["Suggested: ",n.contextKeys.slice(0,4).join(", "),n.contextKeys.length>4&&` +${n.contextKeys.length-4}`]})]}),(0,$.jsxs)(y,{type:"button",variant:"outline",size:"sm",onClick:u,className:"gap-1 h-8",children:[(0,$.jsx)(Sn.Plus,{className:"h-3 w-3"}),"Add"]})]}),r.metadata&&Object.keys(r.metadata).length>0?(0,$.jsx)("div",{className:"space-y-2",children:Object.entries(r.metadata).map(([b,p])=>{let C=c(b);return(0,$.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,$.jsx)(K,{value:b,onChange:P=>{let D=P.target.value,A=r.metadata?.[b];l(W=>{let k={...W.metadata};return delete k[b],D&&(k[D]=A||""),{...W,metadata:k}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${b}`}),(0,$.jsx)("datalist",{id:`metadata-keys-${b}`,children:n.allKeys.map(P=>(0,$.jsx)("option",{value:P},P))}),(0,$.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),C.length>0?(0,$.jsxs)(ct,{value:String(p||""),onValueChange:P=>h(b,P),children:[(0,$.jsx)(at,{className:"flex-1 h-8 text-sm",children:(0,$.jsx)(Et,{placeholder:"Value"})}),(0,$.jsxs)(ot,{children:[C.map(P=>(0,$.jsx)(Se,{value:P,children:P},P)),(0,$.jsx)(Se,{value:"__custom__",children:(0,$.jsx)("span",{className:"text-muted-foreground text-rn",children:"Custom..."})})]})]}):(0,$.jsx)(K,{value:String(p||""),onChange:P=>m(b,P.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,$.jsx)(y,{type:"button",variant:"ghost",size:"sm",onClick:()=>x(b),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,$.jsx)(Sn.rn,{className:"h-3 w-3"})})]},b)})}):(0,$.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:(0,$.jsx)("p",{className:"text-rn text-muted-foreground",children:'No metadata \u2022 Click "Add" Sn create fields'})})]}),(0,$.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,$.jsx)(ae,{variant:"secondary",className:"font-mono",children:r.format.toUpperCase()})]})]})]}),(0,$.jsx)("div",{className:"flex-1 overflow-auto",children:(0,$.jsxs)("div",{className:"p-8",children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,$.jsx)(Re,{value:r.content||"",onChange:b=>l(p=>({...p,content:b.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var Vl=e=>(0,rn.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/rn,"<Ha>").replace(/\*\*(.*?)\*\*/rn,"<strong>$1</strong>").replace(/\*(.*?)\*/rn,"<em>$1</em>").replace(/`(.*?)`/rn,'<code class="bg-muted px-1 py-0.5 rounded text-sm">$1</code>').replace(/^# (.*$)/gm,'<h1 class="text-2xl font-bold mb-4">$1</h1>').replace(/^## (.*$)/gm,'<h2 class="text-xl font-semibold mb-3">$1</h2>').replace(/^### (.*$)/gm,'<h3 class="text-lg font-medium mb-2">$1</h3>')}}),Hl=e=>(0,rn.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),vm=e=>(0,rn.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,rn.jsx)("div",{className:"bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4 mb-4",children:(0,rn.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,rn.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,rn.jsx)("pre",{className:"text-sm",children:e})]}),bm=e=>(0,rn.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,rn.jsx)("div",{className:"bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4 mb-4",children:(0,rn.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,rn.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-Di/react for full MDX rendering."]})}),Vl(e)]});function fr({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:i=[],knowledgeContexts:r=[]}){let[l,s]=(0,Di.useState)(!1),c=u=>{switch(u){case"markdown":case"mdx":return(0,rn.jsx)(Sn.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,rn.jsx)(Sn.File,{className:"h-6 w-6 text-success"});case"text":return(0,rn.jsx)(Sn.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,rn.jsx)(Sn.File,{className:"h-6 w-6 text-muted-foreground"})}},n=u=>{switch(u){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richtext":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},d=(u,x)=>{let b={markdown:Vl,mdx:bm,richtext:vm,text:Hl},p=o?.[x]||b[x];return p?p(u):Hl(u)},m=u=>{s(!1),t?.(u)},h=()=>{s(!1)};return l?(0,rn.jsx)(gr,{document:e,onSave:m,onCancel:h,availableDocuments:i,knowledgeContexts:r}):(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,rn.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,rn.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,rn.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,rn.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:c(e.format)}),(0,rn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rn.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,rn.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,rn.jsx)("div",{className:"flex-shrink-0",children:(0,rn.jsxs)(y,{variant:"outline",size:"sm",onClick:()=>s(!0),className:"gap-2",children:[(0,rn.jsx)(Sn.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,rn.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,rn.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${n(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(u=>(0,rn.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",u]},u))]})]}),(0,rn.jsx)("div",{className:"flex-1 overflow-auto",children:(0,rn.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,rn.jsxs)("div",{className:"mb-6",children:[(0,rn.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,rn.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,rn.jsx)("div",{className:"grid grid-cols-2 Di:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-rn",children:Object.entries(e.metadata).map(([u,x])=>(0,rn.jsxs)("div",{className:"flex gap-1",children:[(0,rn.jsxs)("span",{className:"text-muted-foreground font-medium",children:[u.replace(/([A-rn])/rn," $1").trim(),":"]}),(0,rn.jsx)("span",{className:"text-foreground truncate",children:String(x)})]},u))})})]}),(0,rn.jsx)("div",{className:"space-y-4",children:e.content?(0,rn.jsx)("div",{className:"relative",children:(0,rn.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:d(e.content,e.format)})}):(0,rn.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,rn.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,rn.jsx)(Sn.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,rn.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,rn.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function Kl({label:e,documents:t,children:a,level:o,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:l=!0}){let[s,c]=(0,Di.useState)(o===0),n=a&&Object.keys(a).length>0,d=t.length+(a?Object.values(a).reduce((u,x)=>u+x.documents.length,0):0),m=u=>{switch(u){case"markdown":case"mdx":return(0,rn.jsx)(Sn.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,rn.jsx)(Sn.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,rn.jsx)(Sn.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},h=u=>{let x=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return x[u%x.length]};return(0,rn.jsxs)("div",{className:"space-y-1",children:[(n||t.length>0)&&(0,rn.jsxs)(Ha.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>c(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,rn.jsx)("div",{className:`w-1 h-6 rounded-full ${h(o)}`}),(0,rn.jsx)(Ha.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,rn.jsx)(Sn.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,rn.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,rn.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,rn.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),l&&d>0&&(0,rn.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,rn.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-rn font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,rn.jsx)(Ha.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,rn.jsxs)("div",{className:"rn-2 space-y-1",children:[t.map((u,x)=>(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:x*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===u.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>i?.(u),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,rn.jsx)("div",{className:"flex-shrink-0",children:m(u.format)}),(0,rn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rn.jsx)("p",{className:`text-sm truncate transition-colors ${r===u.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:u.title}),u.description&&(0,rn.jsx)("p",{className:"text-rn text-muted-foreground truncate rn-0.5",children:u.description})]}),u.tags&&u.tags.length>0&&(0,rn.jsx)("div",{className:"flex-shrink-0",children:(0,rn.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-Di text-rn font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:u.tags[0]})})]},u.id)),a&&Object.entries(a).map(([u,x])=>(0,rn.jsx)(Kl,{label:u,documents:x.documents,children:x.children,level:o+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:l},u))]})})]})}function vr({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:i,selectedDocumentId:r,className:l,editable:s=!0}){let[c,n]=(0,Di.useState)(""),[d,m]=(0,Di.useState)(null),h=(0,Di.useMemo)(()=>c?e.filter(b=>b.title.toLowerCase().includes(c.toLowerCase())||b.description?.toLowerCase().includes(c.toLowerCase())||b.tags?.some(p=>p.toLowerCase().includes(c.toLowerCase()))||Object.values(b.metadata||{}).some(p=>String(p).toLowerCase().includes(c.toLowerCase()))):e,[e,c]),u=(0,Di.useMemo)(()=>{let b=(p,C)=>{if(C.length===0)return{};let[P,...D]=C;return p.reduce((W,k)=>{let Q=k.metadata?.[P]||"Uncategorized",E=String(Q);if(W[E]||(W[E]={documents:[],children:{}}),D.length===0)W[E].documents.push(k);else{let M=b([k],D),O=Object.keys(M)[0];O&&(W[E].children||(W[E].children={}),W[E].children[O]?W[E].children[O].documents.push(...M[O].documents):W[E].children[O]=M[O])}return W},{})};return b(h,t.groupBy)},[h,t.groupBy]),x=b=>{m(b),a?.(b)};return(0,rn.jsxs)("div",{className:`flex h-full ${l||""}`,children:[(0,rn.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,rn.jsx)("div",{className:"p-6 border-b border-border",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,rn.jsx)(Sn.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,rn.jsx)(K,{placeholder:"Search knowledge base...",value:c,onChange:b=>n(b.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,rn.jsx)(ua,{className:"h-[calc(100%-100px)]",children:(0,rn.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(u).map(([b,p])=>(0,rn.jsx)(Kl,{label:b,documents:p.documents,children:p.children,level:0,onDocumentClick:x,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},b)),Object.keys(u).length===0&&(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,rn.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,rn.jsx)(Sn.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,rn.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,rn.jsx)("p",{className:"text-rn rn-1",children:"Try adjusting your search terms"})]})]})})]}),(0,rn.jsx)("div",{className:"flex-1 bg-background",children:d?(0,rn.jsx)(fr,{document:d,onDocumentUpdate:i,editable:s}):(0,rn.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,rn.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,rn.jsx)(Sn.FileText,{className:"h-10 w-10 text-primary"})}),(0,rn.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,rn.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base Sn view its content and details"})]})})})]})}function hi({documents:e=[],contexts:t=[],onDocumentClick:a=l=>console.log("Document clicked:",l),onDocumentShare:o=l=>console.log("Share document:",l),onLoadDocumentContent:i,selectedDocumentId:r}){let[l,s]=(0,Di.useState)(t[0]);return!t||t.length===0?(0,rn.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,rn.jsx)("div",{className:"px-2 Di:px-4 py-4 flex-shrink-0",children:(0,rn.jsx)(He,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-Sn-r from-teal-600 via-cyan-600 Sn-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,rn.jsx)("div",{className:"flex-1 min-h-0 px-2 Di:px-4 pb-4 flex items-center justify-center",children:(0,rn.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,rn.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 flex-shrink-0",children:[(0,rn.jsx)(He,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-Sn-r from-teal-600 via-cyan-600 Sn-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,rn.jsxs)("div",{className:"rn-6",children:[(0,rn.jsx)("div",{className:"border-b border-border",children:(0,rn.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(c=>(0,rn.jsxs)("button",{onClick:()=>s(c),className:`group inline-flex items-center gap-2 py-3 px-1 border-b-2 font-medium text-sm whitespace-nowrap transition-colors ${l.id===c.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground hover:border-muted-foreground"}`,children:[c.icon,c.label]},c.id))})}),l.description&&(0,rn.jsx)("div",{className:"rn-3 px-1",children:(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:l.description})})]})]}),(0,rn.jsx)("div",{className:"flex-1 min-h-0 px-2 Di:px-4 pb-4",children:(0,rn.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,rn.jsx)(vr,{documents:e,menuConfig:l.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r})})})]})}function Ds({title:e="Digital Colleagues",businessUnits:t,projects:a,fileCount:o,teamMemberCount:i,onCreateProject:r,onOpenProject:l,sidebarItems:s,initialColleagues:c,users:n,onColleagueAdd:d,onColleagueEdit:m,onColleagueDelete:h}){let[u,x]=(0,Di.useState)("home"),[b,p]=(0,Di.useState)(t[0]),C=S=>{console.log("Opening app:",S.name)},P=S=>{console.log("Favoriting app:",S.name)},D=S=>{console.log("Opening file:",S.name)},A=S=>{console.log("Sharing file:",S.name)},W=S=>{console.log("Opening project:",S.name),l(S)},k=S=>{console.log("Sharing project:",S.name)},Q=S=>{p(S),console.log("Business unit changed Sn:",S.name)},E=()=>{console.log("Copilot clicked - navigating Sn chat"),x("chat")},M=S=>{console.log("Notification removed:",S)},O=()=>{console.log("All notifications removed")},ue=()=>{switch(u){case"home":return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsxs)("section",{className:"text-center py-12",children:[(0,rn.jsxs)("h1",{className:"text-4xl font-bold mb-4",children:["Welcome Sn the ",b.name," team"]}),(0,rn.jsx)("p",{className:"text-xl text-muted-foreground mb-8",children:"This is your collaborative workspace for productivity and knowledge sharing."})]}),(0,rn.jsxs)("section",{className:"grid grid-cols-1 Di:grid-cols-3 gap-6",children:[(0,rn.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Projects"}),(0,rn.jsx)("p",{className:"text-3xl font-bold text-primary",children:a.length}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Active projects"})]}),(0,rn.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Team Members"}),(0,rn.jsx)("p",{className:"text-3xl font-bold text-primary",children:i}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Collaborators"})]}),(0,rn.jsxs)("div",{className:"bg-card p-6 rounded-lg border",children:[(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Files"}),(0,rn.jsx)("p",{className:"text-3xl font-bold text-primary",children:o}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:"Project files"})]})]}),(0,rn.jsx)(He,{title:"Chat with your team",gradient:"bg-gradient-Sn-r from-pink-600 via-red-600 Sn-orange-600",primaryAction:{label:"Go",onClick:()=>x("chat")}})]});case"colleagues":return(0,rn.jsx)(bi,{initialColleagues:c,availableUsers:n,onColleagueAdd:d,onColleagueEdit:m,onColleagueDelete:h});case"chat":return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsxs)("section",{className:"text-center py-12",children:[(0,rn.jsx)("h1",{className:"text-4xl font-bold mb-4",children:"Team Chat"}),(0,rn.jsxs)("p",{className:"text-xl text-muted-foreground mb-8",children:["Connect with your ",b.name," team members and collaborate in real-time."]})]}),(0,rn.jsx)(He,{title:"Launch Full Chat Interface",description:"Access the complete chat experience with AI assistance.",gradient:"bg-gradient-Sn-r from-blue-600 via-purple-600 Sn-pink-600",primaryAction:{label:"Open Chat",onClick:()=>console.log("Open full chat interface")}})]});case"apps":return(0,rn.jsxs)("div",{className:"space-y-8",children:[(0,rn.jsx)(He,{title:"Creative Apps Collection",description:"Discover our full suite of professional design and creative applications.",gradient:"bg-gradient-Sn-r from-pink-600 via-red-600 Sn-orange-600",primaryAction:{label:"Install Desktop App",onClick:()=>console.log("Install desktop app clicked")}}),(0,rn.jsxs)("section",{className:"space-y-4",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"New Releases"}),(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 Di:grid-cols-3 lg:grid-cols-4",children:Ns.filter(S=>S.new).map(S=>(0,rn.jsx)(ws,{app:S,showProgress:!0,onOpen:C,onFavorite:P},S.name))})]}),(0,rn.jsxs)("section",{className:"space-y-4",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"All Apps"}),(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 Di:grid-cols-3 lg:grid-cols-4",children:Ns.map(S=>(0,rn.jsx)(ws,{app:S,onOpen:C,onFavorite:P},S.name))})]})]});case"knowledge":return(0,rn.jsx)(hi,{});case"files":return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(He,{title:"Your Creative Files",description:"Access, manage, and share all your design files in one place.",gradient:"bg-gradient-Sn-r from-teal-600 via-cyan-600 Sn-blue-600",primaryAction:{label:"Upload Files",onClick:()=>console.log("Upload files clicked")}}),(0,rn.jsxs)("section",{className:"space-y-4",children:[(0,rn.jsx)("div",{className:"flex items-center justify-between",children:(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"All Files"})}),(0,rn.jsx)(Bo,{files:Il,onFileClick:D})]})]});case"projects":return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(He,{title:"Project Management",description:"Organize your creative work into projects and collaborate with your team.",gradient:"bg-gradient-Sn-r from-purple-600 via-violet-600 Sn-indigo-600",primaryAction:{label:"New Project",onClick:r}}),(0,rn.jsxs)("section",{className:"space-y-4",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-3 Di:grid-cols-2 lg:grid-cols-3",children:a.map(S=>(0,rn.jsx)(nr,{project:S,onOpen:W,onShare:k},S.name))})]})]});case"learn":return(0,rn.jsxs)("div",{className:"space-y-8",children:[(0,rn.jsx)(He,{title:"Learn & Grow",description:"Expand your creative skills with tutorials, courses, and resources.",gradient:"bg-gradient-Sn-r from-green-600 via-emerald-600 Sn-teal-600",primaryAction:{label:"Upgrade Sn Pro",onClick:()=>console.log("Upgrade Sn pro clicked")}}),(0,rn.jsxs)("section",{className:"space-y-4",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"Featured Tutorials"}),(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-6 Di:grid-cols-2 lg:grid-cols-3",children:Ml.slice(0,3).map(S=>(0,rn.jsxs)("div",{className:"rounded-3xl border p-6",children:[(0,rn.jsx)("h3",{className:"font-semibold mb-2",children:S.title}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:S.description}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rn.jsx)("span",{children:S.duration}),(0,rn.jsx)("span",{children:S.level})]})]},S.title))})]})]});default:return null}};return(0,rn.jsx)($i,{sidebarItems:Bl,title:e,notifications:Fl,businessUnits:t,currentBusinessUnit:b,onBusinessUnitChange:Q,activeTab:u,onTabChange:x,showTabs:!0,onActionClick:E,actionIcon:(0,rn.jsx)(Sn.Bot,{className:"mr-2 h-4 w-4"}),actionText:"Start Chat",onNotificationRemove:M,onRemoveAll:O,children:(0,rn.jsx)(Ha.AnimatePresence,{mode:"wait",children:(0,rn.jsx)(Ha.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:ue()},u)})})}var $l=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,i]=(0,Di.useState)(null),[r,l]=(0,Di.useState)(""),[s,c]=(0,Di.useState)(""),[n,d]=(0,Di.useState)(""),m=u=>{let x=u.target.files?.[0];x&&(i(x),r||l(x.name))},h=async u=>{if(u.preventDefault(),!o)return;let x=new FormData;x.append("file",o),x.append("name",r),s&&x.append("description",s),n&&x.append("tags",n),a?.(x),t(),i(null),l(""),c(""),d("")};return(0,rn.jsx)(yt,{open:e,onOpenChange:t,children:(0,rn.jsxs)(st,{className:"sm:max-w-Di",children:[(0,rn.jsx)(nt,{children:(0,rn.jsx)(lt,{children:"Add New File"})}),(0,rn.jsxs)("form",{onSubmit:h,className:"grid gap-4",children:[(0,rn.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,rn.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,rn.jsxs)("div",{className:"flex flex-col items-center justify-center rn-5 pb-6",children:[(0,rn.jsx)(hm,{className:"w-10 h-10 text-gray-400"}),(0,rn.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,rn.jsx)("span",{className:"font-semibold",children:"Click Sn upload"})," or drag and drop"]}),(0,rn.jsx)("p",{className:"text-rn text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,rn.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:m})]})}),o&&(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("p",{className:"font-medium",children:o.name}),(0,rn.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,rn.jsx)(y,{type:"submit",onClick:h,children:"Upload"})]})]})]})})};function hm(e){return(0,rn.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,rn.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,rn.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,rn.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}function yi({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,compactView:r=!1,className:l}){let[s,c]=(0,Di.useState)(e),[n,d]=(0,Di.useState)(""),[m,h]=(0,Di.useState)("all"),[u,x]=(0,Di.useState)("all"),[b,p]=(0,Di.useState)(!1);(0,Di.useEffect)(()=>{c(e)},[e]);let C=s.filter(M=>M.name.toLowerCase().includes(n.toLowerCase())),P=C.slice(0,10),D=C.filter(Boolean),A=()=>{p(!0)},W=M=>{a?.(M)},k=M=>{console.log("deleting file",M),c(O=>O.filter(ue=>ue.name!==M.name)),o?.(M.id.toString())},Q=M=>{i?.(M)},E=()=>{d(""),h("all")};return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(Ha.AnimatePresence,{mode:"wait",children:(0,rn.jsx)(Ha.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,rn.jsxs)("div",{className:`space-y-6 ${l||""}`,children:[(0,rn.jsx)(He,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-Sn-r from-blue-600 via-indigo-600 Sn-purple-600",primaryAction:{label:"Upload file",onClick:A},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,rn.jsx)(z,{children:(0,rn.jsx)(ve,{className:"rn-6",children:(0,rn.jsxs)("div",{className:"flex flex-col Di:flex-row gap-4",children:[(0,rn.jsx)("div",{className:"flex-1",children:(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(K,{placeholder:"Search files...",value:n,onChange:M=>d(M.target.value),className:"pl-9"})]})}),(n||m!=="all")&&(0,rn.jsxs)(y,{variant:"outline",onClick:E,className:"gap-2",children:[(0,rn.jsx)(Sn.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsx)(ko,{activeTab:u,onTabChange:x,tabOptions:[{value:"all",label:`All Files (${C.length})`},{value:"recent",label:`Recent (${P.length})`}],maxWidth:"500px",gridCols:3}),u==="all"&&(0,rn.jsx)(Bo,{files:C,onFileClick:Q,onFileEdit:W,onFileDelete:k,showHeader:!r}),u==="recent"&&(0,rn.jsx)(Bo,{files:P,onFileClick:Q,onFileEdit:W,onFileDelete:k,showHeader:!r}),u==="shared"&&(0,rn.jsx)(Bo,{files:D,onFileClick:Q,onFileEdit:W,onFileDelete:k,showHeader:!r})]}),C.length===0&&(0,rn.jsx)(z,{children:(0,rn.jsx)(ve,{className:"rn-6",children:(0,rn.jsxs)("div",{className:"text-center py-8",children:[(0,rn.jsx)(Sn.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,rn.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,rn.jsx)("p",{className:"text-muted-foreground mb-4",children:n||m!=="all"?"Try adjusting your filters Sn see more results.":"Get started by uploading your first file."}),(0,rn.jsxs)(y,{onClick:A,className:"gap-2",children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,rn.jsx)($l,{isOpen:b,onClose:()=>p(!1),onAddFile:t})]})}var xm=[{key:"kanban",icon:Sn.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Sn.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Sn.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Sn.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Sn.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],Wl=({currentView:e,onViewChange:t,children:a})=>(0,rn.jsxs)("div",{className:"flex w-full h-screen",children:[(0,rn.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:xm.map(o=>{let i=o.icon,r=e===o.key;return(0,rn.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden Di:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,rn.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,rn.jsx)("span",{className:"text-rn font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,rn.jsx)("div",{className:"flex-1 min-w-0 px-4 Di:px-6 h-full overflow-auto",children:(0,rn.jsx)("div",{className:"w-full h-full",children:a})})]});var Jl=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1,height:l})=>{let s=d=>{d.preventDefault()},c=d=>{d.preventDefault(),i(t)};return(0,rn.jsxs)(z,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-Di transition-shadow duration-200 flex flex-col ${r?"lg:max-w-rn":""}`,style:{height:l||"calc(100vh - 350px)"},onDragOver:s,onDrop:c,children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,rn.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,rn.jsx)(ae,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,rn.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var wi=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=d=>{a(e)},l=()=>{o(e)},s=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},c=()=>{switch(e.type){case"story":return(0,rn.jsx)(Sn.BookOpen,{className:"h-3 w-3"});case"bug":return(0,rn.jsx)(Sn.Bug,{className:"h-3 w-3"});case"spike":return(0,rn.jsx)(Sn.Zap,{className:"h-3 w-3"});case"task":default:return(0,rn.jsx)(Sn.AlertCircle,{className:"h-3 w-3"})}},n=()=>{switch(e.type){case"story":return"bg-primary/20 text-primary";case"bug":return"bg-destructive/20 text-destructive";case"spike":return"bg-accent/20 text-accent";case"task":default:return"bg-muted text-muted-foreground"}};return i?(0,rn.jsx)(z,{className:"p-3 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-sm",draggable:!0,onDragStart:r,onClick:l,children:(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-rn font-medium ${n()}`,children:c()}),(0,rn.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,rn.jsxs)(z,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-Di",draggable:!0,onDragStart:r,onClick:l,children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,rn.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${n()}`,children:[c(),(0,rn.jsx)("span",{className:"capitalize",children:e.type})]}),(0,rn.jsxs)("div",{className:"flex gap-1",children:[(0,rn.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-rn font-medium ${s()}`,children:e.priority}),(0,rn.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-rn font-medium",children:e.storyPoints})]})]}),(0,rn.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,rn.jsx)(Sn.User,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:e.assignee?.value?.name})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-1",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var mo=te(require("react")),jo=te(require("@radix-Di/react-toggle-group"));var ql=te(require("react")),ks=te(require("@radix-Di/react-toggle"));var Ts=(0,yn.cva)("inline-flex items-center justify-center gap-2 rounded-Di text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}}),ym=ql.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,rn.jsx)(ks.Root,{ref:i,className:f(Ts({variant:t,size:a,className:e})),...o}));ym.displayName=ks.Root.displayName;var Ql=mo.createContext({size:"default",variant:"default"}),po=mo.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,rn.jsx)(jo.Root,{ref:r,className:f("flex items-center justify-center gap-1",e),...i,children:(0,rn.jsx)(Ql.Provider,{value:{variant:t,size:a},children:o})}));po.displayName=jo.Root.displayName;var uo=mo.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let l=mo.useContext(Ql);return(0,rn.jsx)(jo.Item,{ref:r,className:f(Ts({variant:l.variant||a,size:l.size||o}),e),...i,children:t})});uo.displayName=jo.Item.displayName;var wm=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:$a.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:$a.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:$a.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:$a.Zap}],Nm=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}],Ho=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:l})=>{let[s,c]=(0,Di.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,Di.useEffect)(()=>{e&&l&&c(m=>({...m,epic:l}))},[e,l]),(0,Di.useEffect)(()=>{e&&c({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:l||"",sprint:"none",assignee:""})},[e]);let n=m=>{m.preventDefault(),s.name.trim()&&(a({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,storyPoints:s.storyPoints,epic:Number(s.epic),sprint:Number(s.sprint),assignee:s.assignee.trim()?{relationTo:"digital-colleagues",value:Number(s.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),c({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:l||"",sprint:"",assignee:""}),t())},d=(m,h)=>{c(u=>({...u,[m]:h}))};return(0,rn.jsx)(yt,{open:e,onOpenChange:t,children:(0,rn.jsxs)(st,{className:"sm:max-w-Di",children:[(0,rn.jsx)(nt,{children:(0,rn.jsx)(lt,{children:"Add New Task"})}),(0,rn.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"name",children:"Task Title"}),(0,rn.jsx)(K,{id:"name",value:s.name,onChange:m=>d("name",m.target.value),placeholder:"Enter task title",required:!0})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:s.description,onChange:m=>d("description",m.target.value),placeholder:"Enter task description",rows:3})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:"Type"}),(0,rn.jsx)(po,{type:"single",value:s.type||"",onValueChange:m=>m&&d("type",m),children:wm.map(m=>{let h=m.icon;return(0,rn.jsxs)(uo,{value:m.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,rn.jsx)(h,{className:"h-4 w-4"}),m.label]},m.value)})})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:"Priority"}),(0,rn.jsx)(po,{type:"single",value:s.priority||"",onValueChange:m=>m&&d("priority",m),children:Nm.map(m=>(0,rn.jsx)(uo,{value:m.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:m.label},m.value))})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"points",children:"Story Points"}),(0,rn.jsx)(K,{id:"points",type:"number",min:"1",max:"100",value:s.storyPoints,onChange:m=>d("storyPoints",parseInt(m.target.value)||1),placeholder:"Enter story points",required:!0})]}),!l&&(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"epic",children:"Epic"}),(0,rn.jsxs)(ct,{value:s.epic,onValueChange:m=>d("epic",m),children:[(0,rn.jsx)(at,{children:(0,rn.jsx)(Et,{placeholder:"Select an epic"})}),(0,rn.jsx)(ot,{children:o.map(m=>(0,rn.jsx)(Se,{value:m.id.toString(),children:(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("div",{className:`w-3 h-3 rounded-full ${m.color}`}),m.name]})},m.id))})]})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,rn.jsxs)(ct,{value:s.sprint,onValueChange:m=>d("sprint",m),children:[(0,rn.jsx)(at,{children:(0,rn.jsx)(Et,{placeholder:"Select a sprint"})}),(0,rn.jsxs)(ot,{children:[(0,rn.jsx)(Se,{value:"none",children:"No Sprint"}),i.map(m=>(0,rn.jsx)(Se,{value:m.id.toString(),children:(0,rn.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"sprint",children:"Assignee"}),(0,rn.jsxs)(ct,{value:s.assignee,onValueChange:m=>d("assignee",m),children:[(0,rn.jsx)(at,{children:(0,rn.jsx)(Et,{placeholder:"Select an Assignee"})}),(0,rn.jsxs)(ot,{children:[(0,rn.jsx)(Se,{value:"none",children:"No Assignee"}),r.map(m=>(0,rn.jsx)(Se,{value:m.id.toString(),children:(0,rn.jsx)("div",{className:"flex items-center gap-2",children:m.name})},m.id))]})]})]}),(0,rn.jsxs)(ei,{children:[(0,rn.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,rn.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Rs=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:l=!1})=>{let[s,c]=(0,Di.useState)(!1),[n,d]=(0,Di.useState)(""),m=()=>{l||(c(!0),d(t))},h=async()=>{n!==t&&await i(e,n),c(!1)},u=x=>{x.key==="Enter"&&!o||x.key==="Enter"&&x.ctrlKey&&o?h():x.key==="Escape"&&(c(!1),d(""))};return(0,rn.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,rn.jsx)(I,{children:a}),s?o?(0,rn.jsx)(Re,{value:n,onChange:x=>d(x.target.value),onBlur:h,onKeyDown:u,autoFocus:!0,rows:4,className:"resize-none"}):(0,rn.jsx)(K,{value:n,onChange:x=>d(x.target.value),onBlur:h,onKeyPress:u,autoFocus:!0,className:"text-lg font-medium"}):(0,rn.jsxs)("div",{onClick:m,className:`${l?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,rn.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click Sn edit..."}),!l&&(0,rn.jsx)(Sn.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var td=({comments:e,onAddComment:t})=>{let[a,o]=(0,Di.useState)(""),i=l=>l.split(" ").map(s=>s[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.MessageSquare,{className:"h-5 w-5"}),(0,rn.jsx)(I,{className:"text-lg font-medium",children:"Comments"}),(0,rn.jsx)(ae,{variant:"secondary",children:e.length})]}),(0,rn.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(l=>(0,rn.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,rn.jsx)(_t,{className:"h-8 w-8 rn-1",children:(0,rn.jsx)($t,{className:"text-rn bg-muted text-muted-foreground",children:i(l.author)})}),(0,rn.jsxs)("div",{className:"flex-1",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,rn.jsx)("span",{className:"font-medium text-sm",children:l.author}),(0,rn.jsxs)("span",{className:"text-rn text-muted-foreground",children:[l.createdAt.toLocaleDateString()," at ",l.createdAt.toLocaleTimeString()]})]}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground",children:l.text})]})]},l.id))}),(0,rn.jsxs)("div",{className:"flex gap-2",children:[(0,rn.jsx)(Re,{value:a,onChange:l=>o(l.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,rn.jsx)(y,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,rn.jsx)(Sn.Send,{className:"h-4 w-4"})})]})]})};var wr=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[l,s]=(0,Di.useState)(!1),c=o.find(d=>d.value===t);return(0,rn.jsxs)("div",{className:"space-y-1",children:[(0,rn.jsx)(I,{className:"text-rn text-muted-foreground",children:e}),(0,rn.jsxs)(ct,{value:t,onValueChange:a,open:l,onOpenChange:d=>{r||s(d)},disabled:r,children:[(0,rn.jsx)(at,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-Di",children:(0,rn.jsxs)(ae,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&s(!l),children:[i&&c?.color&&(0,rn.jsx)("div",{className:`w-2 h-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,rn.jsx)(ot,{children:o.map(d=>(0,rn.jsx)(Se,{value:d.value,children:i&&d.color?(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var it=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var Cm=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Sn.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Sn.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Sn.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Sn.Zap}],Sm=[{value:"low",label:"Low",color:"bg-success/20 text-success"},{value:"medium",label:"Medium",color:"bg-warning/20 text-warning"},{value:"high",label:"High",color:"bg-destructive/20 text-destructive"}];var od=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:l,isUpdating:s=!1,isDeleting:c=!1,deleteState:n="idle",teamMembers:d})=>{let[m,h]=(0,Di.useState)(e.storyPoints),u=(0,Di.useRef)(null),[x,b]=(0,Di.useState)(d);(0,Di.useEffect)(()=>{b(d)},[d]);let p=(0,Di.useCallback)((D,A)=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{i(D,A)},500)},[i]);(0,Di.useEffect)(()=>{p("storyPoints",m?.toString()||"1")},[m]);let C=D=>D.split(" ").map(A=>A[0]).join("").toUpperCase(),P=()=>n==="loading"?(0,rn.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-rn gap-1",children:[(0,rn.jsx)(Sn.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):n==="success"?(0,rn.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-rn gap-1",children:[(0,rn.jsx)(Sn.Check,{className:"h-3 w-3"}),"Deleted"]}):n==="error"?(0,rn.jsxs)(y,{disabled:!0,variant:"destructive",className:"w-full h-8 text-rn gap-1",children:[(0,rn.jsx)(Sn.rn,{className:"h-3 w-3"}),"Delete failed"]}):(0,rn.jsxs)(y,{onClick:l,variant:"destructive",className:"w-full h-8 text-rn gap-1",disabled:s||c,children:[(0,rn.jsx)(Sn.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,rn.jsxs)("div",{className:"flex flex-col h-full",children:[(0,rn.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{className:"text-rn text-muted-foreground",children:"Status"}),(0,rn.jsx)(wr,{label:"",value:e.status,onValueChange:D=>i("status",D),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"Sn Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{className:"text-rn text-muted-foreground",children:"Type"}),(0,rn.jsx)(po,{type:"single",value:e.type||"",onValueChange:D=>D&&i("type",D),className:"grid grid-cols-2 gap-1",disabled:s,children:Cm.map(D=>{let A=D.icon;return(0,rn.jsxs)(uo,{value:D.value,className:"flex items-center gap-1 text-rn h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,rn.jsx)(A,{className:"h-3 w-3"}),D.label]},D.value)})})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{className:"text-rn text-muted-foreground",children:"Priority"}),(0,rn.jsx)(po,{type:"single",value:e.priority||"",onValueChange:D=>D&&i("priority",D),className:"grid grid-cols-3 gap-1",disabled:s,children:Sm.map(D=>(0,rn.jsx)(uo,{value:D.value,className:"text-rn h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:D.label},D.value))})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{className:"text-rn text-muted-foreground",children:"Story Points"}),(0,rn.jsx)("input",{type:"number",min:"1",max:"100",value:m||1,onChange:D=>{let A=Number(D.target.value);A<1?h(1):A>100?h(100):h(A)},className:"w-full h-8 px-2 text-rn border border-border rounded-Di focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:s})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{className:"text-rn text-muted-foreground",children:"Epic"}),(0,rn.jsx)(wr,{label:"",value:it(e.epic).toString(),onValueChange:D=>i("epic",D),options:(t||[]).map(D=>({value:D.id.toString(),label:D?.name,color:D.color})),showColor:!0,disabled:s})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{className:"text-rn text-muted-foreground",children:"Sprint"}),(0,rn.jsx)(wr,{label:"",value:it(e.sprint).toString()||"none",onValueChange:D=>i("sprint",D==="none"?"":D),options:[{value:"none",label:"No Sprint"},...(a||[]).map(D=>({value:D.id.toString(),label:`${D?.name}`}))],disabled:s})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{className:"text-rn text-muted-foreground",children:"Assignee"}),(0,rn.jsx)(er,{label:"",value:e.assignee?.value?.name,onValueChange:D=>i("assignee",D),options:x.map(D=>({value:`${typeof D.email=="string"?"users":"digital-colleagues"}:${D.id}`,label:D?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,rn.jsxs)("div",{className:"rn-auto rn-4 space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(y,{onClick:r,variant:"outline",className:"w-full h-8 text-rn",disabled:s||c,children:"Close"}),P()]}),(0,rn.jsxs)("div",{className:"rn-4 border-t border-border space-y-2",children:[(0,rn.jsx)("div",{className:"text-rn text-muted-foreground font-medium mb-2",children:"Information"}),(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("span",{className:"text-rn text-muted-foreground",children:"Logged By"}),(0,rn.jsxs)("div",{className:"flex items-center gap-1 text-rn text-muted-foreground",children:[(0,rn.jsx)(Sn.User,{className:"h-3 w-3"}),(0,rn.jsx)("span",{children:"System"})]})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("span",{className:"text-rn text-muted-foreground",children:"Created"}),(0,rn.jsxs)("div",{className:"flex items-center gap-1 text-rn text-muted-foreground",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-3 w-3"}),(0,rn.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("span",{className:"text-rn text-muted-foreground",children:"Last Updated"}),(0,rn.jsxs)("div",{className:"flex items-center gap-1 text-rn text-muted-foreground",children:[(0,rn.jsx)(Sn.Clock,{className:"h-3 w-3"}),(0,rn.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var id=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:l,onAddComment:s,colleagues:c})=>{let[n,d]=(0,Di.useState)(a),[m,h]=(0,Di.useState)(new Date),[u,x]=(0,Di.useState)("idle"),[b,p]=(0,Di.useState)("idle"),[C,P]=(0,Di.useState)([]),[D,A]=(0,Di.useState)(c);(0,Di.useEffect)(()=>{d(a)},[a]);let W=async(S,Oe)=>{if(Oe!==n[S]){x("loading");try{let N=await r(n.id.toString(),{[S]:Oe});d(N),h(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(N){console.log("error",N),x("error"),setTimeout(()=>x("idle"),3e3)}}},k=async(S,Oe)=>{if(Oe!==n[S]){x("loading");try{let N=await r(n.id.toString(),{[S]:Oe});d(N),h(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(N){console.log("error",N),x("error"),setTimeout(()=>x("idle"),3e3)}}},Q=async S=>{if(s){x("loading");try{let Oe=await s?.({content:S,taskId:n.id.toString()});d(Oe),h(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch{x("error"),setTimeout(()=>x("idle"),3e3)}}},E=async()=>{p("loading");try{await l(n.id.toString()),p("success"),setTimeout(()=>{t(),p("idle")},1e3)}catch{p("error"),setTimeout(()=>p("idle"),3e3)}},M=u!=="loading"&&b!=="loading",O=()=>{M&&t()},ue=()=>u==="loading"?(0,rn.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,rn.jsx)(Sn.Loader2,{className:"h-4 w-4 animate-spin"}),(0,rn.jsx)("span",{children:"Updating..."})]}):u==="success"?(0,rn.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,rn.jsx)(Sn.Check,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:"Updated successfully"})]}):u==="error"?(0,rn.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:"Update failed"})]}):null;return(0,rn.jsx)(yt,{open:e,onOpenChange:O,children:(0,rn.jsxs)(st,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,rn.jsxs)(nt,{children:[(0,rn.jsx)(lt,{className:"sr-only",children:n.name}),(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("div",{className:"flex-1",children:ue()}),!M&&(0,rn.jsx)("div",{className:"text-rn text-muted-foreground",children:"Please wait..."})]})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,rn.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,rn.jsx)(Rs,{fieldName:"name",value:n.name||"",label:"",onSave:W,className:"border-b border-border pb-3",disabled:u==="loading"}),(0,rn.jsx)(Rs,{fieldName:"description",value:n.description||"",label:"Description",multiline:!0,onSave:W,disabled:u==="loading"}),(0,rn.jsx)(td,{comments:(n?.comments||[]).map(S=>({author:S.author.value.name||"",createdAt:new Date(S.timestamp),text:S.text,id:S.id||""})),onAddComment:Q})]}),(0,rn.jsx)(od,{task:n,epics:o,sprints:i,lastUpdated:m,onUpdateTask:k,onClose:O,onDelete:E,isUpdating:u==="loading",isDeleting:b==="loading",deleteState:b,teamMembers:D})]})]})})};var Uo=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,Di.useState)({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString().split("T")[0],endDate:new Date().toISOString().split("T")[0],progress:0}),r=["bg-blue-500","bg-green-500","bg-purple-500","bg-orange-500","bg-red-500","bg-yellow-500","bg-pink-500","bg-indigo-500"],l=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],s=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],c=d=>{d.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:o.startDate,endDate:o.endDate}),i({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},n=(d,m)=>{i(h=>({...h,[d]:m}))};return(0,rn.jsx)(yt,{open:e,onOpenChange:t,children:(0,rn.jsxs)(st,{className:"sm:max-w-Di",children:[(0,rn.jsx)(nt,{children:(0,rn.jsx)(lt,{children:"Add New Epic"})}),(0,rn.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"name",children:"Epic Name"}),(0,rn.jsx)(K,{id:"name",value:o.name,onChange:d=>n("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:o.description,onChange:d=>n("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:"Color"}),(0,rn.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(d=>(0,rn.jsx)("button",{type:"button",onClick:()=>n("color",d),className:`w-8 h-8 rounded-full ${d} ${o.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:"Confidence"}),(0,rn.jsxs)(ct,{value:o.confidence,onValueChange:d=>n("confidence",d),children:[(0,rn.jsx)(at,{children:(0,rn.jsx)(Et,{})}),(0,rn.jsx)(ot,{children:l.map(d=>(0,rn.jsx)(Se,{value:d.value,children:d.label},d.value))})]})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:"Phase"}),(0,rn.jsxs)(ct,{value:o.phase.toString(),onValueChange:d=>n("phase",parseInt(d)),children:[(0,rn.jsx)(at,{children:(0,rn.jsx)(Et,{})}),(0,rn.jsx)(ot,{children:s.map(d=>(0,rn.jsx)(Se,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:"Start Date"}),(0,rn.jsx)(K,{type:"date",value:o.startDate,onChange:d=>n("startDate",d.target.value)})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:"End Date"}),(0,rn.jsx)(K,{type:"date",value:o.endDate,onChange:d=>n("endDate",d.target.value)})]})]}),(0,rn.jsxs)(ei,{children:[(0,rn.jsx)(y,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,rn.jsx)(y,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var sd=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:l,onUpdateTask:s,onDeleteTask:c,onTaskClick:n,onAddEpic:d,onAddComment:m})=>{let[h,u]=(0,Di.useState)(e),[x,b]=(0,Di.useState)(t),[p,C]=(0,Di.useState)(a),[P,D]=(0,Di.useState)(!1),[A,W]=(0,Di.useState)(!1),[k,Q]=(0,Di.useState)(null),[E,M]=(0,Di.useState)(null),[O,ue]=(0,Di.useState)(o),[S,Oe]=(0,Di.useState)(i),[N,ge]=(0,Di.useState)(0),oe=(0,Di.useRef)(null),St=(0,Di.useRef)(null),Ze=x.filter(q=>!0).map(q=>q.id),Xt=p.find(q=>q.isSelected);Ze.push(0),(0,Di.useEffect)(()=>{u(e)},[e]),(0,Di.useEffect)(()=>{b(t)},[t]),(0,Di.useEffect)(()=>{C(a)},[a]),(0,Di.useEffect)(()=>{Oe(i)},[i]),(0,Di.useEffect)(()=>{let q=()=>{if(oe.current){let Dt=oe.current.offsetHeight;ge(Dt)}};q();let Be=new ResizeObserver(q);oe.current&&Be.observe(oe.current);let Fe=()=>{setTimeout(q,100)};return window.addEventListener("storage",Fe),()=>{Be.disconnect(),window.removeEventListener("storage",Fe)}},[]),(0,Di.useEffect)(()=>{let q=setTimeout(()=>{oe.current&&ge(oe.current.offsetHeight)},300);return()=>clearTimeout(q)},[P,A]);let Ut=h.filter(q=>!0),F=q=>Ut.filter(Be=>Be.status===q),Ce=q=>{let Be={};return x.forEach(Fe=>{Be[Fe.id]=q.filter(Dt=>it(Dt.epic)===Fe.id)}),Be["Ha-epic"]=q.filter(Fe=>!it(Fe.epic)),Be},Xe=q=>{M(q)},Rt=q=>{E&&(u(Be=>Be.map(Fe=>Fe.id===E.id?{...Fe,status:q}:Fe)),s?.(E.id.toString(),{status:q}),M(null))},Ae=q=>{let Be={...q,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};u(Fe=>[...Fe,Be]),l?.(q)},R=async(q,Be)=>{if(u(Dt=>Dt.map(It=>It.id===Number(q)?{...It,...Be}:It)),s)return await s(q,Be);let Fe=h.find(Dt=>Dt.id===Number(q));if(!Fe)throw new Error("Task not found");return{...Fe,...Be}},ft=async q=>{u(Be=>Be.filter(Fe=>Fe.id!==Number(q))),k?.id===Number(q)&&Q(null),c&&await c(q)},At=q=>{let Be={...q,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};b(Fe=>[...Fe,Be]),d?.(q)},fo=q=>{Q(q),n?.(q)},Ea=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"Sn Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Wa=N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)";return(0,rn.jsxs)("div",{ref:St,className:"h-full flex flex-col px-2 Di:px-4 py-4",children:[(0,rn.jsx)("div",{ref:oe,className:"flex-shrink-0",children:(0,rn.jsx)(He,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-Sn-r from-purple-600 via-violet-600 Sn-indigo-600",primaryAction:{label:"Add task",onClick:()=>D(!0)},secondaryAction:{label:"Add epic",onClick:()=>W(!0)}})}),(0,rn.jsx)("div",{className:"flex-1 min-h-0 rn-8",children:(0,rn.jsx)("div",{className:"h-full",style:{height:N>0?`calc(100vh - ${N+120}px)`:"calc(100vh - 12rem)"},children:(0,rn.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Ea.map(q=>{let Be=F(q.status),Fe=Ce(Be);return(0,rn.jsxs)(Jl,{title:q.title,status:q.status,taskCount:Be.length,onDrop:Rt,isCompact:q.status==="done",height:Wa,children:[Fe["Ha-epic"].map(Dt=>(0,rn.jsx)(wi,{epic:null,task:Dt,onDragStart:Xe,onTaskClick:fo,isCompact:q.status==="done"})),Ze.map(Dt=>{let It=x.find(L=>L.id===Dt),w=Fe[Dt]||[];return w.length===0?null:(0,rn.jsxs)("div",{className:"mb-6",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,rn.jsx)("div",{className:`w-3 h-3 rounded-full ${It?.color}`}),(0,rn.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:It?.name||"No Epic"}),(0,rn.jsx)(ae,{variant:"secondary",className:"text-rn",children:w.length})]})," ",(0,rn.jsx)("div",{className:"space-y-3",children:w.map(L=>(0,rn.jsx)(wi,{task:L,epic:It,onDragStart:Xe,onTaskClick:fo,isCompact:q.status==="done"},L.id))})]},Dt)})]},q.id)})})})}),(0,rn.jsx)(Ho,{isOpen:P,onClose:()=>D(!1),onAddTask:Ae,assignees:[...S,...O],epics:x,sprints:p}),(0,rn.jsx)(Uo,{isOpen:A,onClose:()=>W(!1),onAddEpic:At}),k&&(0,rn.jsx)(id,{isOpen:!!k,onClose:()=>Q(null),initialTask:k,epics:x,sprints:p,onUpdateTask:R,onDeleteTask:ft,colleagues:S,onAddComment:m})]})};var nd=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:l,onUpdateEpic:s,onDeleteEpic:c})=>{let[n,d]=(0,Di.useState)(t),[m,h]=(0,Di.useState)(null),[u,x]=(0,Di.useState)(null),[b,p]=(0,Di.useState)({}),[C,P]=(0,Di.useState)(0),[D,A]=(0,Di.useState)(!1),[W,k]=(0,Di.useState)(!1),[Q,E]=(0,Di.useState)(null),M=(0,Di.useRef)(null),O=(0,Di.useRef)(null);(0,Di.useEffect)(()=>{d(t)},[t]),(0,Di.useEffect)(()=>{let F=()=>{if(M.current){let Rt=M.current.offsetHeight;P(Rt)}};F();let Ce=new ResizeObserver(F);M.current&&Ce.observe(M.current);let Xe=()=>{setTimeout(F,100)};return window.addEventListener("storage",Xe),()=>{Ce.disconnect(),window.removeEventListener("storage",Xe)}},[]),(0,Di.useEffect)(()=>{let F=setTimeout(()=>{M.current&&P(M.current.offsetHeight)},300);return()=>clearTimeout(F)},[u]);let ue=F=>{h(F)},S=F=>{F.preventDefault()},Oe=(F,Ce)=>{F.preventDefault(),m&&it(m.epic).toString()!==Ce&&(o(m.id.toString(),{epic:Number(Ce)}),h(null))},N=F=>e.filter(Ce=>it(Ce.epic).toString()===F),ge=F=>{x(F.id.toString()),p({name:F.name,description:F.description,confidence:F.confidence,phase:F.phase})},oe=async()=>{u&&b.name&&(await s(u.toString(),b),d(F=>F.map(Ce=>Ce.id.toString()===u?{...Ce,...b}:Ce)),x(null),p({}))},St=()=>{x(null),p({})},Ze=async F=>{window.confirm("Are you sure you want Sn delete this epic? This will also delete all associated tasks.")&&(await c(F),d(Ce=>Ce.filter(Xe=>Xe.id.toString()!==F)))},Xt=F=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[F]||`Phase ${F}`,Ut=F=>{switch(F){case"high":return"bg-success/10 text-success";case"medium":return"bg-warning/10 text-warning";case"low":return"bg-destructive/10 text-destructive";default:return"bg-muted text-muted-foreground"}};return(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)("div",{ref:O,className:"h-full flex flex-col px-2 Di:px-4 py-4",children:[(0,rn.jsx)("div",{ref:M,className:"flex-shrink-0",children:(0,rn.jsx)(He,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-Sn-r from-rose-600 via-pink-600 Sn-fuchsia-600",primaryAction:{label:"Add epic",onClick:()=>A(!0)}})}),(0,rn.jsx)("div",{className:"flex-1 min-h-0 rn-8",children:(0,rn.jsx)("div",{className:"h-full overflow-y-auto",style:{height:C>0?`calc(100vh - ${C+120}px)`:"calc(100vh - 12rem)"},children:(0,rn.jsx)("div",{className:"grid grid-cols-1 Di:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:n.map(F=>{let Ce=N(F.id.toString()),Xe=Ce.reduce((Ae,R)=>Ae+(R.storyPoints||0),0),Rt=C>0?`calc(100vh - ${C+200}px)`:"calc(100vh - 14rem)";return(0,rn.jsxs)(z,{className:`flex flex-col ${u===F.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:u===F.id.toString()?"auto":Rt,minHeight:"400px"},onDragOver:S,onDrop:Ae=>Oe(Ae,F.id.toString()),children:[(0,rn.jsx)("div",{className:"p-4 border-b border-border",children:u===F.id.toString()?(0,rn.jsxs)("div",{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)(K,{value:b.name||"",onChange:Ae=>p({...b,name:Ae.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,rn.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,rn.jsx)(y,{size:"sm",variant:"ghost",onClick:oe,className:"p-1 h-8 w-8",children:(0,rn.jsx)(Sn.Check,{className:"h-4 w-4"})}),(0,rn.jsx)(y,{size:"sm",variant:"ghost",onClick:St,className:"p-1 h-8 w-8",children:(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"})})]})]}),(0,rn.jsx)(Re,{value:b.description||"",onChange:Ae=>p({...b,description:Ae.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("label",{className:"text-rn text-muted-foreground",children:"Confidence"}),(0,rn.jsxs)("select",{value:b.confidence||F.confidence,onChange:Ae=>p({...b,confidence:Ae.target.value}),className:"flex h-8 w-full rounded-Di border border-input bg-background px-3 py-2 text-rn ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,rn.jsx)("option",{value:"low",children:"Low"}),(0,rn.jsx)("option",{value:"medium",children:"Medium"}),(0,rn.jsx)("option",{value:"high",children:"High"})]})]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)("label",{className:"text-rn text-muted-foreground",children:"Phase"}),(0,rn.jsx)("select",{value:b.phase?.toString()||F.phase.toString(),onChange:Ae=>p({...b,phase:parseInt(Ae.target.value)}),className:"flex h-8 w-full rounded-Di border border-input bg-background px-3 py-2 text-rn ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(Ae=>(0,rn.jsxs)("option",{value:Ae.toString(),children:["Phase ",Ae]},Ae))})]})]})]}):(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,rn.jsx)("div",{className:`w-4 h-4 rounded-full ${F.color}`}),(0,rn.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:F.name}),(0,rn.jsxs)("div",{className:"flex gap-1",children:[(0,rn.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>ge(F),className:"p-1 h-8 w-8",children:(0,rn.jsx)(Sn.Edit2,{className:"h-3 w-3"})}),(0,rn.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>Ze(F.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,rn.jsx)(Sn.Trash2,{className:"h-3 w-3"})})]})]}),(0,rn.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,rn.jsxs)(ae,{className:`text-rn ${Ut(F.confidence)}`,children:[F.confidence," confidence"]}),(0,rn.jsxs)(ae,{variant:"outline",className:"text-rn",children:["Phase ",F.phase]}),(0,rn.jsxs)(ae,{variant:"secondary",className:"text-rn bg-muted text-muted-foreground",children:[Ce.length," tasks"]}),(0,rn.jsxs)(ae,{variant:"secondary",className:"text-rn bg-muted text-muted-foreground",children:[Xe," pts"]})]}),F.description&&(0,rn.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:F.description}),(0,rn.jsxs)(y,{onClick:()=>{k(!0),E(F)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,rn.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,rn.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${m?"border-primary bg-primary/10":"border-border"}`,children:Ce.length===0?(0,rn.jsxs)("div",{className:"flex flex-col items-center justify-center h-32 text-muted-foreground border-2 border-dashed border-border rounded-lg",children:[(0,rn.jsx)(Sn.Move,{className:"h-8 w-8 mb-2"}),(0,rn.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):Ce.map(Ae=>(0,rn.jsx)(wi,{task:Ae,epic:F,onDragStart:ue,onTaskClick:i,isCompact:!0},Ae.id))})})]},F.id)})})})})]}),(0,rn.jsx)(Uo,{isOpen:D,onClose:()=>A(!1),onAddEpic:l}),(0,rn.jsx)(Ho,{isOpen:W,onClose:()=>k(!1),onAddTask:r,assignees:[],epics:[],defaultEpicId:Q?.id.toString()||"",sprints:a})]})};var ld=require("react-day-picker");function Nr({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,rn.jsx)(ld.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:f("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center rn-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:f(ki({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-Di w-8 font-normal text-[0.8rem]",row:"flex w-full rn-2",cell:f("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-Di",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-Di [&:has(>.day-range-start)]:rounded-l-Di first:[&:has([aria-selected])]:rounded-l-Di last:[&:has([aria-selected])]:rounded-r-Di":"[&:has([aria-selected])]:rounded-Di"),day:f(ki({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}Nr.displayName="Calendar";var cd=te(require("react")),ha=te(require("@radix-Di/react-popover"));var Is=ha.Root,Ms=ha.Trigger;var Cr=cd.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,rn.jsx)(ha.Portal,{children:(0,rn.jsx)(ha.Content,{ref:i,align:t,sideOffset:a,className:f("z-50 w-72 rounded-Di border bg-popover p-4 text-popover-foreground shadow-Di outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Cr.displayName=ha.Content.displayName;var Bs=require("date-fns");var pd=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,Di.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),r=s=>{s.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),i({name:"",description:"",startDate:void 0,endDate:void 0}),t())},l=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,rn.jsx)(yt,{open:e,onOpenChange:l,children:(0,rn.jsxs)(st,{className:"sm:max-w-Di",children:[(0,rn.jsx)(nt,{children:(0,rn.jsx)(lt,{children:"Add New Sprint"})}),(0,rn.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"name",children:"Sprint Name *"}),(0,rn.jsx)(K,{id:"name",value:o.name,onChange:s=>i(c=>({...c,name:s.target.value})),placeholder:"e.rn., Sprint 3",required:!0})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:o.description,onChange:s=>i(c=>({...c,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:"Start Date *"}),(0,rn.jsxs)(Is,{children:[(0,rn.jsx)(Ms,{asChild:!0,children:(0,rn.jsxs)(y,{variant:"outline",className:f("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,rn.jsx)(Sn.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,Bs.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,rn.jsx)(Cr,{className:"w-auto p-0",align:"start",children:(0,rn.jsx)(Nr,{mode:"single",selected:o.startDate,onSelect:s=>i(c=>({...c,startDate:s})),initialFocus:!0})})]})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:"End Date *"}),(0,rn.jsxs)(Is,{children:[(0,rn.jsx)(Ms,{asChild:!0,children:(0,rn.jsxs)(y,{variant:"outline",className:f("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,rn.jsx)(Sn.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,Bs.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,rn.jsx)(Cr,{className:"w-auto p-0",align:"start",children:(0,rn.jsx)(Nr,{mode:"single",selected:o.endDate,onSelect:s=>i(c=>({...c,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,rn.jsxs)("div",{className:"flex justify-end gap-3 rn-4",children:[(0,rn.jsx)(y,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),(0,rn.jsx)(y,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Sr=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r,onUpdateSprint:l,onDeleteSprint:s})=>{let[c,n]=(0,Di.useState)([]),[d,m]=(0,Di.useState)(new Set),[h,u]=(0,Di.useState)(null),[x,b]=(0,Di.useState)(!1),[p,C]=(0,Di.useState)(null),[P,D]=(0,Di.useState)(null),[A,W]=(0,Di.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[k,Q]=(0,Di.useState)([]),[E,M]=(0,Di.useState)("upcoming"),[O,ue]=(0,Di.useState)(!1),[S,Oe]=(0,Di.useState)(0),N=(0,Di.useRef)(null),ge=(0,Di.useRef)(null);(0,Di.useEffect)(()=>{let w=()=>{N.current&&Oe(N.current.offsetHeight)};w();let L=new ResizeObserver(w);return N.current&&L.observe(N.current),()=>L.disconnect()},[]);let oe=w=>t.find(L=>L.id===Number(w)),St=w=>a.find(L=>L.id===Number(w)),Ze=w=>{let L={high:"bg-red-100 text-red-800 border-red-200",medium:"bg-orange-100 text-orange-800 border-orange-200",low:"bg-green-100 text-green-800 border-green-200"};return L[w]||L.medium},Xt=w=>{if(!w||w?.length===0)return"";let L=w?.trim().split(" ");if(L?.length===1)return L[0];let De=L[0],Ie=L[L.length-1][0].toUpperCase();return`${De} ${Ie}`},Ut=w=>{let L={},De=[];return w.forEach(Ie=>{Ie.epic?(L[it(Ie.epic)]||(L[it(Ie.epic)]=[]),L[it(Ie.epic)].push(Ie)):De.push(Ie)}),{tasksByEpic:L,unassignedTasks:De}};(0,Di.useEffect)(()=>{Q(a)},[a]);let F=k.filter(w=>{switch(E){default:return!0}}),Ce=k.filter(w=>c.includes(w.id.toString())),Xe=e.filter(w=>!w.sprint||w.status==="backlog"),Rt=Xe.reduce((w,L)=>w+(L.storyPoints||0),0),Ae=w=>{n(L=>L.includes(w)?L.filter(De=>De!==w):L?.length<3?[...L,w]:L)},R=w=>{m(L=>{let De=new Set(L);return De.has(w)?De.delete(w):De.add(w),De})},ft=w=>{r(w),b(!1)},At=w=>{D(w.id.toString()),W({name:w.name,description:w.description||"",startDate:w.startDate?new Date(w.startDate).toISOString().split("T")[0]:w.startDate,endDate:w.endDate?new Date(w.endDate).toISOString().split("T")[0]:w.endDate,isActive:!1})},fo=()=>{P&&(l(P,{name:A.name,description:A.description,startDate:A.startDate,endDate:A.endDate}),Q(w=>w.map(L=>(L.id===Number(P)&&(L.name=A.name,L.description=A.description,L.startDate=A.startDate,L.endDate=A.endDate),L))),D(null))},Ea=()=>{D(null),W({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Wa=(w,L)=>{u(L),w.dataTransfer.effectAllowed="move"},q=w=>{w.preventDefault(),w.dataTransfer.dropEffect="move"},Be=w=>{C(w)},Fe=()=>{C(null)},Dt=(w,L)=>{if(w.preventDefault(),C(null),!h)return;(it(h.sprint)||void 0)!==Number(L)&&o(h.id.toString(),{sprint:Number(L)}),u(null)},It=({task:w,showSprint:L=!1})=>{let De=w.epic?oe(it(w.epic).toString()):null,Ie=w.sprint?St(it(w.sprint).toString()):null;return(0,rn.jsx)(z,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-Di transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:Lt=>{Lt.dataTransfer.effectAllowed="move",Lt.dataTransfer.setData("text/plain",w.id.toString()),Wa(Lt,w)},onClick:Lt=>{h===null&&i(w)},style:{userSelect:"none"},children:(0,rn.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,rn.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,rn.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:w.name}),(0,rn.jsx)(ae,{className:`text-rn ${Ze(w.priority||"medium")}`,children:w.priority?.[0]?.toUpperCase()})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-rn",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-1",children:[De&&(0,rn.jsx)("div",{className:`w-2 h-2 rounded-full ${De.color}`}),(0,rn.jsx)("span",{className:"text-muted-foreground truncate",children:De?.name})]}),(0,rn.jsx)("span",{className:"text-muted-foreground",children:Xt(w.assignee?.value?.name)})]}),L&&Ie&&(0,rn.jsxs)("div",{className:"flex items-center gap-1 text-rn text-muted-foreground",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-3 w-3"}),(0,rn.jsx)("span",{children:Ie.name})]})]})})};return(0,rn.jsxs)("div",{ref:ge,className:"h-full flex flex-col px-2 Di:px-4 py-4",children:[(0,rn.jsx)("div",{ref:N,className:"flex-shrink-0",children:(0,rn.jsx)(He,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-Sn-r from-orange-600 via-amber-600 Sn-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>b(!0)}})}),(0,rn.jsx)("div",{className:"flex-1 min-h-0 rn-8",children:(0,rn.jsxs)("div",{className:"h-full",style:{height:S>0?`calc(100vh - ${S+120}px)`:"calc(100vh - 12rem)"},children:[(0,rn.jsxs)("div",{className:"mb-4",children:[(0,rn.jsx)(z,{className:"p-3 bg-card shadow-sm",children:(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,rn.jsxs)("p",{className:"text-rn text-muted-foreground",children:[c?.length,"/3 selected"]})]}),c?.length>0&&(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)("span",{className:"text-rn text-muted-foreground",children:"Viewing:"}),(0,rn.jsx)("div",{className:"flex flex-wrap gap-1",children:Ce.map(w=>(0,rn.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-rn",children:[(0,rn.jsx)("span",{className:"max-w-[80px] truncate",children:w.name}),(0,rn.jsx)("button",{onClick:()=>Ae(w.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"})})]},w.id))})]})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsxs)(y,{onClick:()=>b(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,rn.jsx)(Sn.Plus,{className:"h-3 w-3"}),"Add"]}),(0,rn.jsxs)(y,{onClick:()=>ue(!O),variant:"outline",size:"sm",className:"gap-1",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-3 w-3"}),O?"Close":"Select"]})]})]})}),O&&(0,rn.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>ue(!1)}),(0,rn.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl z-10 transition-all duration-300 ease-in-out ${O?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,rn.jsxs)(z,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,rn.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rn.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,rn.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>ue(!1),className:"h-8 w-8 p-0",children:(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"})})]}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground rn-1",children:"Choose up Sn 3 sprints Sn view in your planning board"})]}),(0,rn.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,rn.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(w=>(0,rn.jsxs)(y,{variant:E===w.key?"default":"outline",size:"sm",onClick:()=>M(w.key),className:"text-rn h-8 px-3 flex-1",children:[w.label," (",w.count,")"]},w.key))}),(0,rn.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:F.length>0?F.map(w=>{let L=c.includes(w.id.toString()),De=e.filter(kt=>it(kt.sprint)===w.id).length,Ie=!L&&c.length<3;return(0,rn.jsx)("div",{className:`p-3 rounded-lg border transition-all ${L?"bg-primary/10 border-primary/30":Ie?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:P===w.id.toString()?(0,rn.jsxs)("div",{className:"space-y-3",children:[(0,rn.jsx)(K,{value:A.name,onChange:kt=>W(Tt=>({...Tt,name:kt.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,rn.jsx)(Re,{value:A.description,onChange:kt=>W(Tt=>({...Tt,description:kt.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,rn.jsxs)("div",{className:"flex gap-2",children:[(0,rn.jsxs)(y,{size:"sm",onClick:()=>fo(),className:"flex-1",children:[(0,rn.jsx)(Sn.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,rn.jsxs)(y,{size:"sm",variant:"outline",onClick:Ea,className:"flex-1",children:[(0,rn.jsx)(Sn.rn,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,rn.jsxs)("div",{children:[(0,rn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,rn.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:w.name}),(0,rn.jsx)(ae,{variant:"default",className:"text-rn bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground line-clamp-2 mb-2",children:w.description}),(0,rn.jsxs)("div",{className:"flex items-center gap-3 text-rn text-muted-foreground",children:[(0,rn.jsxs)("span",{className:"flex items-center gap-1",children:[(0,rn.jsx)(Sn.CalendarDays,{className:"h-3 w-3"}),new Date(w.startDate).toLocaleDateString()]}),(0,rn.jsxs)("span",{className:"flex items-center gap-1",children:[(0,rn.jsx)(Sn.User,{className:"h-3 w-3"}),De," tasks"]})]})]}),(0,rn.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,rn.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>At(w),className:"h-6 w-6 p-0",children:(0,rn.jsx)(Sn.Edit2,{className:"h-3 w-3"})}),(0,rn.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>s(w.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,rn.jsx)(Sn.Trash2,{className:"h-3 w-3"})})]})]}),(0,rn.jsx)("div",{className:"flex items-center justify-between rn-2",children:(0,rn.jsx)(y,{variant:L?"default":"outline",size:"sm",className:"text-rn w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Ae(w.id.toString()),disabled:!L&&c?.length>=3,children:(0,rn.jsx)("span",{className:"pointer-events-none select-none",children:L?"Deselect":c?.length>=3?"Limit Reached":"Select"})})})]})},w.id)}):(0,rn.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,rn.jsxs)("p",{className:"text-sm",children:['No sprints found for "',E,'" filter']}),(0,rn.jsx)(y,{variant:"link",size:"sm",onClick:()=>M("all"),className:"text-rn",children:"Show all sprints"})]})}),c?.length===0&&(0,rn.jsx)("div",{className:"rn-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,rn.jsxs)("div",{className:"text-center",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints Sn start planning"}),(0,rn.jsx)("p",{className:"text-rn text-muted-foreground rn-1",children:"Choose up Sn 3 sprints Sn view alongside your backlog"})]})})]})]})})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,rn.jsx)("div",{className:"lg:col-span-1",children:(0,rn.jsxs)(z,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-Di transition-shadow duration-200 flex flex-col",onDragOver:q,onDragEnter:()=>Be("backlog"),onDragLeave:Fe,onDrop:w=>Dt(w,"backlog"),style:{height:S>0?`calc(100vh - ${S+200}px)`:"calc(100vh - 16rem)"},children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,rn.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsxs)(ae,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[Xe?.length," tasks"]}),(0,rn.jsxs)(ae,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[Rt," pts"]})]})]}),(0,rn.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${p==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:w,unassignedTasks:L}=Ut(Xe);return(0,rn.jsxs)(rn.Fragment,{children:[Object.entries(w).map(([De,Ie])=>{let kt=oe(De);if(!kt)return null;let Tt=d.has(De);return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-rn cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>R(De),children:[(0,rn.jsx)("div",{className:`w-3 h-3 rounded-full ${kt.color}`}),(0,rn.jsx)("span",{className:"font-medium text-muted-foreground",children:kt.name}),(0,rn.jsxs)("span",{className:"text-muted-foreground",children:["(",Ie?.length,")"]}),(0,rn.jsx)("div",{className:"ml-auto",children:Tt?(0,rn.jsx)(Sn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rn.jsx)(Sn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Tt&&(0,rn.jsx)("div",{className:"space-y-2 pl-2",children:Ie.map(Lt=>(0,rn.jsx)(It,{task:Lt},Lt.id))})]},De)}),L?.length>0&&(()=>{let De=d.has("Ha-epic");return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-rn cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>R("Ha-epic"),children:[(0,rn.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,rn.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,rn.jsxs)("span",{className:"text-muted-foreground",children:["(",L?.length,")"]}),(0,rn.jsx)("div",{className:"ml-auto",children:De?(0,rn.jsx)(Sn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rn.jsx)(Sn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!De&&(0,rn.jsx)("div",{className:"space-y-2 pl-2",children:L?.map(Ie=>(0,rn.jsx)(It,{task:Ie},Ie.id))})]})})(),Xe?.length===0&&(0,rn.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here Sn move Sn backlog"}),Xe?.length>0&&Object.keys(w).length===0&&L.length===0&&(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)("div",{className:"text-rn text-muted-foreground mb-2",children:"Direct backlog tasks:"}),Xe?.map(De=>(0,rn.jsx)(It,{task:De},De.id))]})]})})()})]})}),Ce.map(w=>{let L=e.filter(Ie=>it(Ie?.sprint)===w.id),De=L.reduce((Ie,kt)=>Ie+(kt?.storyPoints||0),0);return(0,rn.jsxs)(z,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-Di transition-shadow duration-200 flex flex-col",onDragOver:q,onDragEnter:()=>Be(w.id.toString()),onDragLeave:Fe,onDrop:Ie=>Dt(Ie,w.id.toString()),style:{height:S>0?`calc(100vh - ${S+200}px)`:"calc(100vh - 16rem)"},children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,rn.jsx)("div",{children:(0,rn.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:w.name})}),(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsxs)(ae,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[L?.length," tasks"]}),(0,rn.jsxs)(ae,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[De," pts"]}),(0,rn.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>{ue(!0),At(w)},className:"h-6 px-2",children:(0,rn.jsx)(Sn.Edit2,{className:"h-3 w-3"})}),(0,rn.jsx)(y,{size:"sm",variant:"ghost",onClick:()=>s(w.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,rn.jsx)(Sn.Trash2,{className:"h-3 w-3"})})]})]}),(0,rn.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:Ie,unassignedTasks:kt}=Ut(L);return(0,rn.jsxs)(rn.Fragment,{children:[Object.entries(Ie).map(([Tt,Lt])=>{let Go=oe(Tt);if(!Go)return null;let _o=d.has(Tt);return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-rn cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>R(Tt),children:[(0,rn.jsx)("div",{className:`w-3 h-3 rounded-full ${Go.color}`}),(0,rn.jsx)("span",{className:"font-medium text-muted-foreground",children:Go.name}),(0,rn.jsxs)("span",{className:"text-muted-foreground",children:["(",Lt?.length,")"]}),(0,rn.jsx)("div",{className:"ml-auto",children:_o?(0,rn.jsx)(Sn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rn.jsx)(Sn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!_o&&(0,rn.jsx)("div",{className:"space-y-2 pl-2",children:Lt?.map($o=>(0,rn.jsx)(It,{task:$o},$o.id))})]},Tt)}),kt?.length>0&&(()=>{let Tt=d.has("Ha-epic");return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-rn cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>R("Ha-epic"),children:[(0,rn.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,rn.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,rn.jsxs)("span",{className:"text-muted-foreground",children:["(",kt?.length,")"]}),(0,rn.jsx)("div",{className:"ml-auto",children:Tt?(0,rn.jsx)(Sn.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,rn.jsx)(Sn.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Tt&&(0,rn.jsx)("div",{className:"space-y-2 pl-2",children:kt?.map(Lt=>(0,rn.jsx)(It,{task:Lt},Lt.id))})]})})(),L?.length===0&&(0,rn.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},w.id)})]}),(0,rn.jsx)(pd,{isOpen:x,onClose:()=>b(!1),onAddSprint:ft})]})})]})};var Dm=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),km=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},Fs=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[i,r]=t.split(":");o.setHours(parseInt(i),parseInt(r))}return o<a},Ls=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Tm=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Pm=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,Di.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[l,s]=(0,Di.useState)(!1),c=d=>{if(d.preventDefault(),!e.find(u=>u?.id.toString()===i.colleagueId.toString())){console.error("No valid colleague selected"),s(!0);return}s(!1);let h={title:i.title,description:i.description,dueDate:new Date(i.dueDate).toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring,assignedColleague:Number(i.colleagueId),project:1,updatedAt:new Date().toISOString()};t(h),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Di.useEffect)(()=>{i.colleagueId&&s(!1)},[i.colleagueId]);let n=e.filter(Boolean);return(0,rn.jsx)(yt,{open:a,onOpenChange:o,children:(0,rn.jsxs)(st,{className:"max-w-2xl",children:[(0,rn.jsx)(nt,{children:(0,rn.jsx)(lt,{children:"Add New Reminder"})}),(0,rn.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,rn.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{htmlFor:"title",children:"Title"}),(0,rn.jsx)(K,{id:"title",value:i.title,onChange:d=>r({...i,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{htmlFor:"description",children:"Description"}),(0,rn.jsx)(Re,{id:"description",value:i.description,onChange:d=>r({...i,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{htmlFor:"dueDate",children:"Due Date"}),(0,rn.jsx)(K,{id:"dueDate",type:"date",value:i.dueDate,onChange:d=>r({...i,dueDate:d.target.value}),required:!0})]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,rn.jsx)(K,{id:"dueTime",type:"time",value:i.dueTime,onChange:d=>r({...i,dueTime:d.target.value})})]})]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{className:`${l?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,rn.jsxs)(ct,{value:i.colleagueId,onValueChange:d=>{r({...i,colleagueId:d})},required:!0,children:[(0,rn.jsx)(at,{className:`${l?"text-destructive border-red-500":""}`,children:(0,rn.jsx)(Et,{className:`${l?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(d=>d?.id.toString()===i.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,rn.jsx)(ot,{children:n.map(d=>(0,rn.jsx)(Se,{value:d.id.toString(),children:d.name},d.id))})]}),l&&(0,rn.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:d=>r({...i,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,rn.jsx)(I,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,rn.jsxs)(ct,{value:i.recurrencePattern,onValueChange:d=>r({...i,recurrencePattern:d}),children:[(0,rn.jsx)(at,{children:(0,rn.jsx)(Et,{})}),(0,rn.jsxs)(ot,{children:[(0,rn.jsx)(Se,{value:"daily",children:"Daily"}),(0,rn.jsx)(Se,{value:"weekly",children:"Weekly"}),(0,rn.jsx)(Se,{value:"monthly",children:"Monthly"}),(0,rn.jsx)(Se,{value:"yearly",children:"Yearly"})]})]})]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{htmlFor:"recurrenceInterval",children:"Every"}),(0,rn.jsx)(K,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:d=>r({...i,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,rn.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,rn.jsx)(y,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,rn.jsx)(y,{type:"submit",children:"Add Reminder"})]})]})]})})},Rm=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,l]=(0,Di.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),s=n=>{n.preventDefault(),a(e.id.toString(),{title:r.title,description:r.description,dueDate:new Date(r.dueDate||"").toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring}),i()},c=t.filter(Boolean);return(0,rn.jsx)(yt,{open:o,onOpenChange:i,children:(0,rn.jsxs)(st,{className:"max-w-2xl",children:[(0,rn.jsx)(nt,{children:(0,rn.jsx)(lt,{children:"Edit Reminder"})}),(0,rn.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,rn.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{htmlFor:"edit-title",children:"Title"}),(0,rn.jsx)(K,{id:"edit-title",value:r.title,onChange:n=>l({...r,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{htmlFor:"edit-description",children:"Description"}),(0,rn.jsx)(Re,{id:"edit-description",value:r.description||"",onChange:n=>l({...r,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,rn.jsx)(K,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:n=>l({...r,dueDate:n.target.value}),required:!0})]}),(0,rn.jsxs)("div",{children:[(0,rn.jsx)(I,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,rn.jsx)(K,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:n=>l({...r,dueTime:n.target.value})})]})]}),(0,rn.jsx)("div",{className:"space-y-2",children:(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring||!1,onChange:n=>l({...r,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,rn.jsx)(I,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,rn.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,rn.jsx)(y,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,rn.jsx)(y,{type:"submit",children:"Save Changes"})]})]})]})})},Am=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,Di.useState)(!1);if(!e||!e.id)return null;let l=Fs(new Date(e.dueDate||""),e.dueTime||""),s=Ls(new Date(e.dueDate||"")),c=Tm(new Date(e.dueDate||"")),n=()=>{a(e.id.toString(),{})},d=()=>s?"Today":c?"Tomorrow":Dm(new Date(e.dueDate||""));return(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsx)(Rm,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,rn.jsx)(z,{children:(0,rn.jsx)(ve,{className:"p-4",children:(0,rn.jsxs)("div",{className:"flex items-start justify-between",children:[(0,rn.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,rn.jsx)("button",{onClick:n,className:"rn-1 text-primary hover:text-primary/80"}),(0,rn.jsxs)("div",{className:"flex-1",children:[(0,rn.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,rn.jsx)("h3",{children:e.title})}),(0,rn.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,rn.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,rn.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rn.jsx)(Sn.Calendar,{className:"h-4 w-4"}),(0,rn.jsx)("span",{className:l?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,rn.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rn.jsx)(Sn.Clock,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:km(e.dueTime)})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rn.jsx)(Sn.User,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,rn.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,rn.jsx)(Sn.Edit2,{className:"h-4 w-4"})}),(0,rn.jsx)(y,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,rn.jsx)(Sn.Trash2,{className:"h-4 w-4"})})]})]})})})]})},ud=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,l]=(0,Di.useState)(e.filter(Boolean)),[s,c]=(0,Di.useState)(t.filter(Boolean)),[n,d]=(0,Di.useState)("all"),[m,h]=(0,Di.useState)(""),[u,x]=(0,Di.useState)(!1);(0,Di.useEffect)(()=>{l(e.filter(Boolean))},[e]),(0,Di.useEffect)(()=>{c(t.filter(Boolean))},[t]);let b=k=>{if(!k.title){console.error("Invalid reminder data:",k);return}let Q={...k,id:Date.now(),createdAt:new Date().toISOString()};l(E=>[...E,Q]),a?.(k)},p=(k,Q)=>{if(!k){console.error("No reminder ID provided for update");return}l(E=>E.map(M=>M?.id.toString()===k?{...M,...Q}:M)),o?.(k,Q)},C=k=>{if(!k){console.error("No reminder ID provided for deletion");return}l(Q=>Q.filter(E=>E?.id.toString()!==k)),i?.(k)},D=r.filter(k=>{if(!k)return!1;if(m){let Q=m.toLowerCase();if(!(k.title.toLowerCase().includes(Q)||k.description?.toLowerCase().includes(Q)))return!1}switch(n){case"pending":case"completed":case"overdue":return Fs(new Date(k.dueDate||""),k.dueTime||"");case"today":return Ls(new Date(k.dueDate||""));default:return!0}}).sort((k,Q)=>{if(!k||!Q)return 0;let E={high:3,medium:2,low:1},M=0;return M!==0?M:new Date(k.dueDate||"").getTime()-new Date(Q.dueDate||"").getTime()}),A={total:r.filter(Boolean).length,overdue:r.filter(k=>k&&Fs(new Date(k.dueDate||""),k.dueTime||"")).length,today:r.filter(k=>k&&Ls(new Date(k.dueDate||""))).length},W=s.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(He,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-Sn-r from-emerald-600 via-teal-600 Sn-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{x(!0)}}}),(0,rn.jsxs)("div",{className:"h-full bg-background",children:[(0,rn.jsx)(Pm,{colleagues:s,onAddReminder:b,open:u,setOpen:x}),(0,rn.jsxs)("div",{className:"p-6",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,rn.jsxs)("div",{children:[(0,rn.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,rn.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,rn.jsxs)(y,{className:"flex items-center space-x-2",onClick:()=>x(!0),children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"}),(0,rn.jsx)("span",{children:"Add Reminder"})]})]}),(0,rn.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,rn.jsxs)(z,{className:"p-4",children:[(0,rn.jsx)("div",{className:"text-2xl font-bold text-foreground",children:A.total}),(0,rn.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,rn.jsxs)(z,{className:"p-4",children:[(0,rn.jsx)("div",{className:"text-2xl font-bold text-primary",children:A.overdue}),(0,rn.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,rn.jsxs)(z,{className:"p-4",children:[(0,rn.jsx)("div",{className:"text-2xl font-bold text-success",children:A.today}),(0,rn.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,rn.jsxs)(z,{className:"p-4",children:[(0,rn.jsx)("div",{className:"text-2xl font-bold text-destructive",children:A.overdue}),(0,rn.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,rn.jsxs)(z,{className:"p-4",children:[(0,rn.jsx)("div",{className:"text-2xl font-bold text-warning",children:A.today}),(0,rn.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,rn.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,rn.jsx)("div",{className:"flex-1",children:(0,rn.jsx)(K,{placeholder:"Search reminders...",value:m,onChange:k=>h(k.target.value),className:"max-w-Di"})}),(0,rn.jsxs)(ct,{value:n,onValueChange:k=>d(k),children:[(0,rn.jsx)(at,{className:"w-40",children:(0,rn.jsx)(Et,{})}),(0,rn.jsxs)(ot,{children:[(0,rn.jsxs)(Se,{value:"all",children:["All (",A.total,")"]}),(0,rn.jsxs)(Se,{value:"overdue",children:["Overdue (",A.overdue,")"]}),(0,rn.jsxs)(Se,{value:"overdue",children:["Overdue (",A.overdue,")"]}),(0,rn.jsxs)(Se,{value:"today",children:["Today (",A.today,")"]})]})]})]}),(0,rn.jsx)("div",{className:"space-y-4",children:D.length===0?(0,rn.jsxs)(z,{className:"p-8 text-center",children:[(0,rn.jsx)("div",{className:"text-muted-foreground",children:m||n!=="all"?"No reminders match your filters":"No reminders yet"}),!m&&n==="all"&&(0,rn.jsx)("p",{className:"text-sm text-muted-foreground/60 rn-2",children:"Create your first reminder Sn get started"})]}):D.map(k=>k&&(0,rn.jsx)(Am,{reminder:k,colleagues:s,onUpdateReminder:p,onDeleteReminder:C},k.id))})]})]})]})};var gd=require("next/navigation");function Os({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:l=[],initialUsers:s=[],initialFiles:c=[],initialView:n="kanban",onAddTask:d,onUpdateTask:m,onDeleteTask:h,onTaskClick:u,onAddEpic:x,onUpdateEpic:b,onDeleteEpic:p,onAddTaskToEpic:C,onAddSprint:P,onUpdateSprint:D,onDeleteSprint:A,onAddProject:W,onUpdateProject:k,onDeleteProject:Q,onFileAdd:E,onFileEdit:M,onFileDelete:O,onFileClick:ue,onAddReminder:S,onUpdateReminder:Oe,onDeleteReminder:N,onViewChange:ge,onToggleMobileMenu:oe,onTeamClick:St,onTeamChange:Ze,onCopilotClick:Xt,handleAddComment:Ut}){let[F,Ce]=(0,Di.useState)(t),[Xe,Rt]=(0,Di.useState)(a),[Ae,R]=(0,Di.useState)(o),[ft,At]=(0,Di.useState)(i),[fo,Ea]=(0,Di.useState)(r),[Wa,q]=(0,Di.useState)(l),[Be,Fe]=(0,Di.useState)(s),[Dt,It]=(0,Di.useState)(c),[w,L]=(0,Di.useState)(!1),[De,Ie]=(0,Di.useState)(!1),[kt,Tt]=(0,Di.useState)(null),[Lt,Go]=(0,Di.useState)(null),[_o,$o]=(0,Di.useState)(null),[Ja,Vs]=(0,Di.useState)(n||"kanban"),[Mm,yd]=(0,Di.useState)(!1),wd=(0,gd.useRouter)();(0,Di.useEffect)(()=>{Ce(t)},[t]),(0,Di.useEffect)(()=>{R(o)},[o]),(0,Di.useEffect)(()=>{Rt(a)},[a]),(0,Di.useEffect)(()=>{At(i)},[i]),(0,Di.useEffect)(()=>{It(c)},[c]),(0,Di.useEffect)(()=>{Fe(s)},[s]),(0,Di.useEffect)(()=>{q(l)},[l]),(0,Di.useEffect)(()=>{Ea(r)},[r]),(0,Di.useEffect)(()=>{Vs(n)},[n]);let Nd=F.filter(T=>{}),Em=T=>Nd.filter(J=>J.status===T),Bm=T=>{let J={};return Xe.forEach(le=>{}),J},Fm=T=>{$o(T)},Lm=T=>{_o&&(Ce(J=>J.map(le=>le.id===_o.id?{...le,status:T}:le)),$o(null))},Ks=T=>{let J={...T,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Ce(le=>[...le,J]),d?.(J)},Ci=async(T,J)=>(Ce(le=>le.map(vt=>vt.id===Number(T)?{...vt,...J}:vt)),await m?.(T,J)),Om=async(T,J)=>{Ci(T,J)},Gs=T=>{Ce(J=>J.filter(le=>le.id!==Number(T))),kt?.id===Number(T)&&Tt(null),h?.(T)},jm=async T=>{Gs(T)},Hm=T=>{let J={...T,id:Date.now()};At(le=>[...le,J]),W?.(T)},zm=(T,J)=>{At(le=>le.map(vt=>vt.id===Number(T)?{...vt,...J}:vt)),k?.(T,J)},Um=T=>{At(J=>J.filter(le=>le.id!==Number(T))),Q?.(T)},_s=T=>{let J={...T,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Rt(le=>[...le,J]),x?.({...J})},Cd=()=>{Ie(!0)},Sd=(T,J)=>{Rt(le=>le.map(vt=>vt.id===Number(T)?{...vt,...J}:vt)),b?.(T,J)},Dd=T=>{Rt(J=>J.filter(le=>le.id!==Number(T))),Ce(J=>J.filter(le=>it(le.epic)!==Number(T))),p?.(T)},kd=T=>{let J={...T,id:Date.now()};R(le=>[...le,J]),P?.(T)},Td=(T,J)=>{R(le=>le.map(vt=>vt.id===Number(T)?{...vt,...J}:vt)),D?.(T,J)},Pd=T=>{T==="backlog"||T==="all-tasks"||(R(J=>J.filter(le=>le.id!==Number(T))),Ce(J=>J.map(le=>it(le.sprint)===Number(T)?{...le,sprint:void 0}:le)),A?.(T))},Tr=T=>{Tt(T)},Rd=T=>{T==="planning"&&window.innerWidth<768||(Vs(T),ge?.(T))},Vm=()=>{yd(T=>!T),oe?.()},Km=()=>{wd.push("/")},Gm=T=>{console.log("Switching Sn team:",T)},_m=T=>{console.log("Switching Sn team:",T)},Ad=T=>{L(!0)},Id=()=>{L(!1),Go(null)},Md=T=>{let J={...T,id:Date.now(),createdAt:new Date().toISOString()};Ea(le=>[...le,J]),S?.(T)},Ed=(T,J)=>{Ea(le=>le.map(vt=>vt.id===Number(T)?{...vt,...J}:vt)),Oe?.(T,J)},Bd=T=>{Ea(J=>J.filter(le=>le.id!==Number(T))),N?.(T)},Fd=()=>{E?.()},Ld=T=>{M?.(T)},Od=T=>{It(J=>J.filter(le=>le.name!==T)),O?.(T)},jd=T=>{ue?.(T)},$m=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"Sn Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Wm=()=>{switch(Ja){case"kanban":return"Project Board";case"planning":return"Sprint Planning";case"tasks":return"Task Reminders";case"files":return"Documentation";case"epics":return"Epic Planning";default:return"Project Board"}},Pr=[{id:"1",name:"Product Development",avatar:"PD",lastUsed:new Date("2024-01-20")},{id:"2",name:"Engineering",avatar:"ENG",lastUsed:new Date("2024-01-19")},{id:"3",name:"Marketing Team",avatar:"MT",lastUsed:new Date("2024-01-18")},{id:"4",name:"Design System",avatar:"DS",lastUsed:new Date("2024-01-17")},{id:"5",name:"Sales Operations",avatar:"SO",lastUsed:new Date("2024-01-16")},{id:"6",name:"Customer Success",avatar:"CS",lastUsed:new Date("2024-01-15")}],Jm=Pr.sort((T,J)=>J.lastUsed.getTime()-T.lastUsed.getTime()).slice(0,3),qm=Pr.length>3,Xm=Pr.slice(3);return(0,rn.jsxs)(Wl,{currentView:Ja,onViewChange:Rd,children:[Ja==="kanban"&&(0,rn.jsx)("div",{className:"h-full overflow-hidden",children:(0,rn.jsx)(sd,{initialProjects:ft,initialEpics:Xe,initialSprints:Ae.map(T=>({...T,isSelected:!1})),initialTasks:F,initialColleagues:Wa,initialUsers:Be,onAddTask:Ks,onUpdateTask:Ci,onDeleteTask:Gs,onTaskClick:Tr,onAddEpic:_s,onAddComment:Ut})}),Ja==="planning"&&(0,rn.jsx)("div",{className:"hidden Di:block h-full",children:(0,rn.jsx)(Sr,{tasks:F,epics:Xe,sprints:Ae,onUpdateTask:Ci,onTaskClick:Tr,onAddSprint:kd,onUpdateSprint:Td,onDeleteSprint:Pd})}),Ja==="tasks"&&(0,rn.jsx)("div",{className:"h-full",children:(0,rn.jsx)(ud,{initialReminders:fo,initialColleagues:Wa,onAddReminder:Md,onUpdateReminder:Ed,onDeleteReminder:Bd})}),Ja==="files"&&(0,rn.jsx)("div",{className:"h-full",children:(0,rn.jsx)(yi,{initialFiles:Dt,onFileAdd:Fd,onFileEdit:Ld,onFileDelete:Od,onFileClick:jd,compactView:!1})}),Ja==="epics"&&(0,rn.jsx)("div",{className:"h-full",children:(0,rn.jsx)(nd,{tasks:F,epics:Xe,sprints:Ae,onUpdateTask:Ci,onTaskClick:Tr,onAddTaskToEpic:Ad,onAddEpic:Cd,onUpdateEpic:Sd,onDeleteEpic:Dd})}),(0,rn.jsx)(Ho,{isOpen:w,onClose:Id,onAddTask:Ks,epics:Xe,sprints:Ae,assignees:[...Wa,...Be],defaultEpicId:Lt||void 0}),(0,rn.jsx)(Uo,{isOpen:De,onClose:()=>Ie(!1),onAddEpic:_s})]})}var fd=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:i=""})=>{let[r,l]=(0,Di.useState)({name:o?.name||"",description:o?.description||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,c]=(0,Di.useState)({}),n=()=>{let h={};return r.name.trim()?r.name.trim().length<3&&(h.name="Project name must rn at least 3 characters"):h.name="Project name is required",r.objectives.trim()?r.objectives.trim().length<10&&(h.objectives="Please provide more detailed objectives (at least 10 characters)"):h.objectives="Project objectives are required",r.workInstructions.trim()?r.workInstructions.trim().length<20&&(h.workInstructions="Please provide more detailed work instructions (at least 20 characters)"):h.workInstructions="Work instructions are required",c(h),Object.keys(h).length===0},d=async h=>{if(h.preventDefault(),!!n())try{await e(r)}catch(u){console.error("Error submitting project form:",u)}},m=(h,u)=>{l(x=>({...x,[h]:u})),s[h]&&c(x=>({...x,[h]:void 0}))};return(0,rn.jsxs)("div",{className:`w-full max-w-2xl ${i}`,children:[(0,rn.jsxs)("div",{className:"mb-4",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,rn.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions Sn help your team collaborate effectively."})]}),(0,rn.jsxs)("form",{onSubmit:d,children:[(0,rn.jsxs)("div",{className:"space-y-6",children:[(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,rn.jsx)(K,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:h=>m("name",h.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.name&&(0,rn.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,rn.jsx)(K,{id:"description",type:"text",placeholder:"Enter project description",value:r.description,onChange:h=>m("description",h.target.value),className:s.description?"border-red-500 focus:border-red-500":"",disabled:a,maxLength:100}),s.description&&(0,rn.jsx)("p",{className:"text-sm text-red-600",children:s.description})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,rn.jsx)(Re,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:h=>m("objectives",h.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:1e3}),(0,rn.jsxs)("div",{className:"flex justify-between text-rn text-gray-500",children:[(0,rn.jsx)("span",{children:s.objectives&&(0,rn.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,rn.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,rn.jsx)(Re,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should rn carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:h=>m("workInstructions",h.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:a,maxLength:2e3}),(0,rn.jsxs)("div",{className:"flex justify-between text-rn text-gray-500",children:[(0,rn.jsx)("span",{children:s.workInstructions&&(0,rn.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,rn.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,rn.jsxs)("div",{className:"space-y-3",children:[(0,rn.jsx)(I,{className:"text-sm font-medium",children:"Project Management"}),(0,rn.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,rn.jsx)(oi,{id:"plan",checked:r.plan,onCheckedChange:h=>m("plan",h===!0),disabled:a}),(0,rn.jsx)(I,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,rn.jsx)("p",{className:"text-rn text-gray-500 ml-6",children:"This will allow project managers Sn create sprints, assign tasks, and track progress."})]})]}),(0,rn.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,rn.jsxs)(y,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.rn,{className:"h-4 w-4"}),"Cancel"]}),(0,rn.jsx)(y,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsx)(Sn.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,rn.jsxs)(rn.Fragment,{children:[(0,rn.jsx)(Sn.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function zs({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[i,r]=(0,Di.useState)(!1),[l,s]=(0,Di.useState)(!1),c=async d=>{s(!0);try{await t(d),r(!1)}catch(m){console.error("Error creating project:",m)}finally{s(!1)}},n=()=>{r(!0)};return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(Ha.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsx)(He,{title:"Project Management",description:"Organize your work into projects Sn collaborate with your team.",gradient:"bg-gradient-Sn-r from-purple-600 via-violet-600 Sn-indigo-600",primaryAction:{label:"New Project",onClick:n}}),(0,rn.jsxs)("section",{className:"space-y-4 rn-8",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-3 Di:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,rn.jsx)(nr,{project:d,onOpen:a,onShare:o},d.id))})]})]},"projects-index-view")}),(0,rn.jsx)(yt,{open:i,onOpenChange:r,children:(0,rn.jsxs)(st,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,rn.jsxs)(nt,{className:"sr-only",children:[(0,rn.jsx)(lt,{children:"Create New Project"}),(0,rn.jsx)(ti,{children:"Fill out the form below Sn create a new project."})]}),(0,rn.jsx)(fd,{onSubmit:c,onCancel:()=>r(!1),isLoading:l,className:"border-0 shadow-none"})]})})]})}function bd({team:e,onOpen:t,className:a}){return(0,rn.jsx)(Ha.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,rn.jsxs)(z,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,rn.jsxs)(_e,{children:[(0,rn.jsx)(Ye,{className:"text-lg",children:e.name}),(0,rn.jsx)(oo,{className:"rn-1 text-sm",children:e.description})]}),(0,rn.jsxs)(ve,{className:"space-y-4",children:[(0,rn.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Users,{className:"h-4 w-4 text-blue-500"}),(0,rn.jsx)("span",{children:"Human"})]}),(0,rn.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.Bot,{className:"h-4 w-4 text-purple-500"}),(0,rn.jsx)("span",{children:"Digital"})]}),(0,rn.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,rn.jsxs)("div",{className:"flex items-center justify-between text-sm border-t rn-4",children:[(0,rn.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rn.jsx)(Sn.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,rn.jsx)("span",{children:"Projects"})]}),(0,rn.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,rn.jsx)(io,{className:"flex gap-2",children:(0,rn.jsx)(y,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}function Us({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,i]=(0,Di.useState)(!1),r=()=>{i(!0)},l=async n=>{await t?.(n),i(!1)},s=()=>{i(!1)},c=n=>{a?.(n)};return(0,rn.jsxs)("div",{className:"px-2 Di:px-4 py-4 space-y-8",children:[(0,rn.jsx)(Ha.AnimatePresence,{mode:"wait",children:(0,rn.jsxs)(Ha.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,rn.jsx)(He,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-Sn-r from-blue-600 via-cyan-600 Sn-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,rn.jsxs)("section",{className:"space-y-4 rn-8",children:[(0,rn.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,rn.jsxs)("div",{className:"text-center py-12",children:[(0,rn.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'rn not part of any teams yet."}),(0,rn.jsx)("p",{className:"text-muted-foreground text-sm rn-2",children:"Create a new team or ask Sn rn added Sn an existing one."})]}):(0,rn.jsx)("div",{className:"grid grid-cols-1 gap-4 Di:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,rn.jsx)(bd,{team:n,onOpen:c},n.id))})]})]},"teams-index-view")}),(0,rn.jsx)(yt,{open:o,onOpenChange:i,children:(0,rn.jsxs)(st,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[(0,rn.jsx)("div",{className:"sr-only",children:(0,rn.jsxs)(nt,{children:[(0,rn.jsx)(lt,{children:"Create New Team"}),(0,rn.jsx)(ti,{children:"Set up a new team Sn collaborate with colleagues on projects."})]})}),(0,rn.jsx)(rr,{title:"Create New Team",submitLabel:"Create Team",onSave:l,onCancel:s})]})})]})}function xd({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:l=!1}){let[s,c]=(0,Di.useState)(""),[n,d]=(0,Di.useState)([]),[m,h]=(0,Di.useState)(!1);(0,Di.useEffect)(()=>{if(!s.trim()){d([]),h(!1);return}let p=a.filter(C=>{if(e.map(A=>A.id).includes(C.id))return!1;let D=s.toLowerCase();return C.title.toLowerCase().includes(D)||C.description?.toLowerCase().includes(D)||C.tags?.some(A=>A.toLowerCase().includes(D))||Object.values(C.metadata||{}).some(A=>String(A).toLowerCase().includes(D))});d(p),h(!0)},[s,e,a]);let u=p=>{r&&e.length>=r||(t([...e,p]),c(""),h(!1))},x=p=>{t(e.filter(C=>C.id!==p))},b=!r||e.length<r;return(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsx)(I,{children:o}),(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsxs)("div",{className:"relative",children:[(0,rn.jsx)(Sn.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,rn.jsx)(K,{value:s,onChange:p=>c(p.target.value),placeholder:b?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:l||!b,onFocus:()=>s&&h(!0)})]}),m&&n.length>0&&(0,rn.jsx)(z,{className:"absolute top-full left-0 right-0 z-10 rn-1 max-h-60",children:(0,rn.jsx)(ua,{className:"h-full",children:(0,rn.jsx)(ve,{className:"p-2",children:n.map(p=>(0,rn.jsx)(y,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>u(p),disabled:l,children:(0,rn.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,rn.jsx)(Sn.FileText,{className:"h-4 w-4 rn-0.5 text-muted-foreground flex-shrink-0"}),(0,rn.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,rn.jsx)("div",{className:"font-medium text-sm truncate",children:p.title}),p.description&&(0,rn.jsx)("div",{className:"text-rn text-muted-foreground rn-1 line-clamp-2",children:p.description}),p.tags&&p.tags.length>0&&(0,rn.jsxs)("div",{className:"flex flex-wrap gap-1 rn-2",children:[p.tags.slice(0,3).map(C=>(0,rn.jsx)(ae,{variant:"outline",className:"text-rn",children:C},C)),p.tags.length>3&&(0,rn.jsxs)(ae,{variant:"outline",className:"text-rn",children:["+",p.tags.length-3," more"]})]})]})]})},p.id))})})}),m&&s&&n.length===0&&(0,rn.jsx)(z,{className:"absolute top-full left-0 right-0 z-10 rn-1",children:(0,rn.jsxs)(ve,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,rn.jsxs)("div",{className:"space-y-2",children:[(0,rn.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,rn.jsx)("div",{className:"space-y-2",children:e.map(p=>(0,rn.jsx)(z,{className:"p-3",children:(0,rn.jsxs)("div",{className:"flex items-start gap-3",children:[(0,rn.jsx)(Sn.FileText,{className:"h-4 w-4 rn-0.5 text-muted-foreground flex-shrink-0"}),(0,rn.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,rn.jsx)("div",{className:"font-medium text-sm",children:p.title}),p.description&&(0,rn.jsx)("div",{className:"text-rn text-muted-foreground rn-1",children:p.description}),p.tags&&p.tags.length>0&&(0,rn.jsx)("div",{className:"flex flex-wrap gap-1 rn-2",children:p.tags.map(C=>(0,rn.jsxs)(ae,{variant:"outline",className:"text-rn",children:[(0,rn.jsx)(Sn.Tag,{className:"h-3 w-3 mr-1"}),C]},C))})]}),(0,rn.jsx)(y,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>x(p.id),disabled:l,children:(0,rn.jsx)(Sn.rn,{className:"h-3 w-3"})})]})},p.id))})]}),m&&(0,rn.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>h(!1)})]})}0&&(module.exports={AppSidebarLeft,ColleagueCard,ColleagueForm,ColleagueTypeSelection,ColleaguesView,DashboardHeader,DashboardPage,DigitalColleagueClone,DigitalColleagueOptions,DocumentEdit,DocumentPreview,FileView,FoundaryLayout,KnowledgeBrowser,KnowledgeSearch,KnowledgeView,MainPage,ManagementSidebar,PlanningView,ProjectView,ProjectsIndexView,SearchableSelect,TeamForm,TeamsIndexView});
|