cortex-react-components 2.13.1 → 2.13.2

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.
Files changed (85) hide show
  1. package/dist/chunk-2UNIT7NC.mjs +4 -0
  2. package/dist/{chunk-2EQ5OMZF.mjs → chunk-5EQXJS23.mjs} +1 -1
  3. package/dist/{chunk-AGWQ5S2Z.mjs → chunk-5NIEZE7A.mjs} +1 -1
  4. package/dist/{chunk-HNWWGPHA.mjs → chunk-6R6NYDWN.mjs} +1 -1
  5. package/dist/{chunk-CNCT3JZV.mjs → chunk-AQQCH7Z2.mjs} +1 -1
  6. package/dist/chunk-CDVRH3MC.mjs +4 -0
  7. package/dist/chunk-CJ6APTVT.mjs +4 -0
  8. package/dist/{chunk-PWFVXG44.mjs → chunk-E2OSUDXP.mjs} +1 -1
  9. package/dist/{chunk-7R47MHQE.mjs → chunk-KIYBEYSU.mjs} +1 -1
  10. package/dist/{chunk-ERHNVIOZ.mjs → chunk-LHO4WFYP.mjs} +1 -1
  11. package/dist/{chunk-KWYJ3XZI.mjs → chunk-LJXTXROJ.mjs} +1 -1
  12. package/dist/{chunk-24XUZCYT.mjs → chunk-NSJPZJQF.mjs} +1 -1
  13. package/dist/{chunk-23XORW7A.mjs → chunk-P7S6XFU4.mjs} +1 -1
  14. package/dist/chunk-TKCFCYEQ.mjs +4 -0
  15. package/dist/{chunk-PXLSH6S2.mjs → chunk-ZFUP5NVF.mjs} +1 -1
  16. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  17. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  18. package/dist/components/DigitalColleagues/Views/index.js +1 -1
  19. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  20. package/dist/components/DigitalColleagues/index.js +1 -1
  21. package/dist/components/DigitalColleagues/index.mjs +1 -1
  22. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  23. package/dist/components/Foundary/MainPage.mjs +1 -1
  24. package/dist/components/Foundary/Views/TeamsIndexView.d.ts +3 -3
  25. package/dist/components/Foundary/Views/TeamsIndexView.js +2 -2
  26. package/dist/components/Foundary/Views/TeamsIndexView.mjs +1 -1
  27. package/dist/components/Foundary/Views/index.js +1 -1
  28. package/dist/components/Foundary/Views/index.mjs +1 -1
  29. package/dist/components/Foundary/index.js +1 -1
  30. package/dist/components/Foundary/index.mjs +1 -1
  31. package/dist/components/Foundary/team-form.d.ts +1 -1
  32. package/dist/components/Foundary/team-form.js +2 -2
  33. package/dist/components/Foundary/team-form.mjs +1 -1
  34. package/dist/components/Foundary/types.d.ts +9 -0
  35. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  36. package/dist/components/HeaderFooter/index.mjs +1 -1
  37. package/dist/components/Heros/PostHero/index.mjs +1 -1
  38. package/dist/components/Heros/RenderHero.mjs +1 -1
  39. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  40. package/dist/components/Heros/index.mjs +1 -1
  41. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  42. package/dist/components/Layouts/Print.mjs +1 -1
  43. package/dist/components/Layouts/SlideShow.mjs +1 -1
  44. package/dist/components/Layouts/index.mjs +1 -1
  45. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  46. package/dist/components/Menus/SidebarRight.mjs +1 -1
  47. package/dist/components/Menus/index.mjs +1 -1
  48. package/dist/components/Other/index.mjs +1 -1
  49. package/dist/components/Payload/index.mjs +1 -1
  50. package/dist/components/Projects/ProjectsIndexView.d.ts +3 -3
  51. package/dist/components/Projects/ProjectsIndexView.js +2 -2
  52. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  53. package/dist/components/Projects/project-form.d.ts +3 -3
  54. package/dist/components/Projects/project-form.js +1 -1
  55. package/dist/components/Projects/project-form.mjs +1 -1
  56. package/dist/components/index.js +10 -10
  57. package/dist/components/index.mjs +1 -1
  58. package/dist/components/ui/index.mjs +1 -1
  59. package/dist/components/ui/sidebar.mjs +1 -1
  60. package/dist/index.js +16 -16
  61. package/dist/index.mjs +1 -1
  62. package/dist/metafile-cjs.json +1 -1
  63. package/dist/metafile-esm.json +1 -1
  64. package/dist/pages/Blog.mjs +1 -1
  65. package/dist/pages/Documentation.mjs +1 -1
  66. package/dist/pages/IndexPage.mjs +1 -1
  67. package/dist/pages/Intranet.mjs +1 -1
  68. package/dist/pages/LandingPage.mjs +1 -1
  69. package/dist/pages/Page.mjs +1 -1
  70. package/dist/pages/Publish.mjs +1 -1
  71. package/dist/pages/Website.mjs +1 -1
  72. package/dist/sections/AboutSection.mjs +1 -1
  73. package/dist/sections/BlogDetail.mjs +1 -1
  74. package/dist/sections/BlogList.mjs +1 -1
  75. package/dist/sections/BlogListSection.mjs +1 -1
  76. package/dist/sections/ContactSection.mjs +1 -1
  77. package/dist/sections/PageSections.mjs +1 -1
  78. package/dist/sections/PricingSection.mjs +1 -1
  79. package/dist/sections/ServiceSection.mjs +1 -1
  80. package/dist/sections/index.mjs +1 -1
  81. package/package.json +1 -1
  82. package/dist/chunk-2XMVNXF6.mjs +0 -4
  83. package/dist/chunk-CXCDV7VP.mjs +0 -4
  84. package/dist/chunk-LD44TGKT.mjs +0 -4
  85. package/dist/chunk-UAEEBFHJ.mjs +0 -4
@@ -2,4 +2,4 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
5
- "use strict";var ps=Object.create;var to=Object.defineProperty;var us=Object.getOwnPropertyDescriptor;var gs=Object.getOwnPropertyNames;var fs=Object.getPrototypeOf,vs=Object.prototype.hasOwnProperty;var hs=(e,t)=>{for(var o in t)to(e,o,{get:t[o],enumerable:!0})},fr=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gs(t))!vs.call(e,i)&&i!==o&&to(e,i,{get:()=>t[i],enumerable:!(a=us(t,i))||a.enumerable});return e};var Ne=(e,t,o)=>(o=e!=null?ps(fs(e)):{},fr(t||!e||!e.__esModule?to(o,"default",{value:e,enumerable:!0}):o,e)),bs=e=>fr(to({},"__esModule",{value:!0}),e);var kn={};hs(kn,{ColleaguesView:()=>zo,FileView:()=>$a,KnowledgeView:()=>Vo,PlanningView:()=>Do,ProjectView:()=>er,ProjectsIndexView:()=>sr,TeamsIndexView:()=>lr});module.exports=bs(kn);var Mt=require("react"),yt=require("lucide-react");var kr=require("clsx");var Fo="-",xs=e=>{let t=ws(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:m=>{let s=m.split(Fo);return s[0]===""&&s.length!==1&&s.shift(),br(s,t)||ys(m)},getConflictingClassGroupIds:(m,s)=>{let c=o[m]||[];return s&&a[m]?[...c,...a[m]]:c}}},br=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),i=a?br(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Fo);return t.validators.find(({validator:m})=>m(r))?.classGroupId},vr=/^\[(.+)\]$/,ys=e=>{if(vr.test(e)){let t=vr.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},ws=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return Cs(Object.entries(e.classGroups),o).forEach(([r,m])=>{Mo(m,a,r,t)}),a},Mo=(e,t,o,a)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:hr(t,i);r.classGroupId=o;return}if(typeof i=="function"){if(Ns(i)){Mo(i(a),t,o,a);return}t.validators.push({validator:i,classGroupId:o});return}Object.entries(i).forEach(([r,m])=>{Mo(m,hr(t,r),o,a)})})},hr=(e,t)=>{let o=e;return t.split(Fo).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Ns=e=>e.isThemeGetter,Cs=(e,t)=>t?e.map(([o,a])=>{let i=a.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([m,s])=>[t+m,s])):r);return[o,i]}):e,ks=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,i=(r,m)=>{o.set(r,m),t++,t>e&&(t=0,a=o,o=new Map)};return{get(r){let m=o.get(r);if(m!==void 0)return m;if((m=a.get(r))!==void 0)return i(r,m),m},set(r,m){o.has(r)?o.set(r,m):i(r,m)}}},xr="!",Ds=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,i=t[0],r=t.length,m=s=>{let c=[],n=0,d=0,p;for(let f=0;f<s.length;f++){let T=s[f];if(n===0){if(T===i&&(a||s.slice(f,f+r)===t)){c.push(s.slice(d,f)),d=f+r;continue}if(T==="/"){p=f;continue}}T==="["?n++:T==="]"&&n--}let h=c.length===0?s:s.substring(d),g=h.startsWith(xr),y=g?h.substring(1):h,b=p&&p>d?p-d:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:b}};return o?s=>o({className:s,parseClassName:m}):m},Ss=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},Ts=e=>({cache:ks(e.cacheSize),parseClassName:Ds(e),...xs(e)}),Ps=/\s+/,Rs=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:i}=t,r=[],m=e.trim().split(Ps),s="";for(let c=m.length-1;c>=0;c-=1){let n=m[c],{modifiers:d,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:g}=o(n),y=!!g,b=a(y?h.substring(0,g):h);if(!b){if(!y){s=n+(s.length>0?" "+s:s);continue}if(b=a(h),!b){s=n+(s.length>0?" "+s:s);continue}y=!1}let f=Ss(d).join(":"),T=p?f+xr:f,z=T+b;if(r.includes(z))continue;r.push(z);let _=i(b,y);for(let Z=0;Z<_.length;++Z){let w=_[Z];r.push(T+w)}s=n+(s.length>0?" "+s:s)}return s};function As(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=yr(t))&&(a&&(a+=" "),a+=o);return a}var yr=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=yr(e[a]))&&(o&&(o+=" "),o+=t);return o};function Is(e,...t){let o,a,i,r=m;function m(c){let n=t.reduce((d,p)=>p(d),e());return o=Ts(n),a=o.cache.get,i=o.cache.set,r=s,s(c)}function s(c){let n=a(c);if(n)return n;let d=Rs(c,o);return i(c,d),d}return function(){return r(As.apply(null,arguments))}}var Re=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},wr=/^\[(?:([a-z-]+):)?(.+)\]$/i,Es=/^\d+\/\d+$/,Ms=new Set(["px","full","screen"]),Fs=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bs=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|Pr|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ls=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,js=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Os=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zt=e=>Na(e)||Ms.has(e)||Es.test(e),Zt=e=>Ca(e,"length",Ws),Na=e=>!!e&&!Number.isNaN(Number(e)),Eo=e=>Ca(e,"number",Na),La=e=>!!e&&Number.isInteger(Number(e)),Hs=e=>e.endsWith("%")&&Na(e.slice(0,-1)),oe=e=>wr.test(e),Yt=e=>Fs.test(e),zs=new Set(["length","size","percentage"]),Vs=e=>Ca(e,zs,Nr),Us=e=>Ca(e,"position",Nr),Ks=new Set(["image","url"]),$s=e=>Ca(e,Ks,qs),Gs=e=>Ca(e,"",_s),ja=()=>!0,Ca=(e,t,o)=>{let a=wr.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Ws=e=>Bs.test(e)&&!Ls.test(e),Nr=()=>!1,_s=e=>js.test(e),qs=e=>Os.test(e);var Xs=()=>{let e=Re("colors"),t=Re("spacing"),o=Re("blur"),a=Re("brightness"),i=Re("borderColor"),r=Re("borderRadius"),m=Re("borderSpacing"),s=Re("borderWidth"),c=Re("contrast"),n=Re("grayscale"),d=Re("hueRotate"),p=Re("invert"),h=Re("gap"),g=Re("gradientColorStops"),y=Re("gradientColorStopPositions"),b=Re("inset"),f=Re("margin"),T=Re("opacity"),z=Re("padding"),_=Re("saturate"),Z=Re("scale"),w=Re("sepia"),V=Re("skew"),ge=Re("space"),S=Re("translate"),ie=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],ve=()=>["auto",oe,t],G=()=>[oe,t],E=()=>["",zt,Zt],se=()=>["auto",Na,oe],ze=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Me=()=>["solid","dashed","dotted","double","none"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ut=()=>["start","end","center","between","around","evenly","stretch"],st=()=>["","0",oe],Nt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ve=()=>[Na,oe];return{cacheSize:500,separator:":",theme:{colors:[ja],spacing:[zt,Zt],blur:["none","",Yt,oe],brightness:Ve(),borderColor:[e],borderRadius:["none","","full",Yt,oe],borderSpacing:G(),borderWidth:E(),contrast:Ve(),grayscale:st(),hueRotate:Ve(),invert:st(),gap:G(),gradientColorStops:[e],gradientColorStopPositions:[Hs,Zt],inset:ve(),margin:ve(),opacity:Ve(),padding:G(),saturate:Ve(),scale:Ve(),sepia:st(),skew:Ve(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[Yt]}],"break-after":[{"break-after":Nt()}],"break-before":[{"break-before":Nt()}],"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:[...ze(),oe]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:ie()}],"overscroll-x":[{"overscroll-x":ie()}],"overscroll-y":[{"overscroll-y":ie()}],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",La,oe]}],basis:[{basis:ve()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",oe]}],grow:[{grow:st()}],shrink:[{shrink:st()}],order:[{order:["first","last","none",La,oe]}],"grid-cols":[{"grid-cols":[ja]}],"col-start-end":[{col:["auto",{span:["full",La,oe]},oe]}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":[ja]}],"row-start-end":[{row:["auto",{span:[La,oe]},oe]}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...ut()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ut(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ut(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[z]}],px:[{px:[z]}],py:[{py:[z]}],ps:[{ps:[z]}],pe:[{pe:[z]}],Pr:[{Pr:[z]}],pr:[{pr:[z]}],pb:[{pb:[z]}],pl:[{pl:[z]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],Mt:[{Mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[ge]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ge]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,t]}],"min-w":[{"min-w":[oe,t,"min","max","fit"]}],"max-w":[{"max-w":[oe,t,"none","full","min","max","fit","prose",{screen:[Yt]},Yt]}],h:[{h:[oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Yt,Zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Eo]}],"font-family":[{font:[ja]}],"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",oe]}],"line-clamp":[{"line-clamp":["none",Na,Eo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zt,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[T]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Me(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zt,Zt]}],"underline-offset":[{"underline-offset":["auto",zt,oe]}],"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:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe]}],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",oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[T]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ze(),Us]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Vs]}],"bg-image":[{bg:["none",{"gradient-to":["t","Pr","r","br","b","bl","Pr","tl"]},$s]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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-Pr":[{"rounded-Pr":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-Pr":[{"rounded-Pr":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-Pr":[{"rounded-Pr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[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-Pr":[{"border-Pr":[s]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...Me(),"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":[T]}],"divide-style":[{divide:Me()}],"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-Pr":[{"border-Pr":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Me()]}],"outline-offset":[{"outline-offset":[zt,oe]}],"outline-w":[{outline:[zt,Zt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:E()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-w":[{"ring-offset":[zt,Zt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Yt,Gs]}],"shadow-color":[{shadow:[ja]}],opacity:[{opacity:[T]}],"mix-blend":[{"mix-blend":[...we(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":we()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Yt,oe]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[_]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",oe]}],duration:[{duration:Ve()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:Ve()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Z]}],"scale-x":[{"scale-x":[Z]}],"scale-y":[{"scale-y":[Z]}],rotate:[{rotate:[La,oe]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[V]}],"skew-y":[{"skew-y":[V]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],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","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-Mt":[{"scroll-Mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-Pr":[{"scroll-Pr":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[zt,Zt,Eo]}],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","pe","Pr","pr","pb","pl"],px:["pr","pl"],py:["Pr","pb"],m:["mx","my","ms","me","Mt","mr","mb","ml"],mx:["mr","ml"],my:["Mt","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-Pr","rounded-ss","rounded-se","rounded-Pr","rounded-es","rounded-tl","rounded-Pr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-Pr"],"rounded-t":["rounded-tl","rounded-Pr"],"rounded-r":["rounded-Pr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-Pr":["rounded-tl","rounded-bl"],"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-Pr"],"border-w-x":["border-w-r","border-w-Pr"],"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-Pr"],"border-color-x":["border-color-r","border-color-Pr"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-Mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-Mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-Pr","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-Pr","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Cr=Is(Xs);function k(...e){return Cr((0,kr.clsx)(e))}var Dr=require("@radix-yt/react-slot"),Sr=require("class-variance-authority"),Tr=Ne(require("react")),Pr=require("react/jsx-runtime"),ao=(0,Sr.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"}}}),x=Tr.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...i},r)=>(0,Pr.jsx)(e?Dr.Slot:"button",{className:k(ao({className:t,size:o,variant:a})),ref:r,...i}));x.displayName="Button";var sa=Ne(require("react"));var F=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("rounded-xl border bg-card text-card-foreground shadow",e),...t}));F.displayName="Card";var Se=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("flex flex-col space-y-1.5 p-6",e),...t}));Se.displayName="CardHeader";var Ae=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("font-semibold leading-none tracking-tight",e),...t}));Ae.displayName="CardTitle";var na=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("text-sm text-muted-foreground",e),...t}));na.displayName="CardDescription";var re=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("p-6 Pr-0",e),...t}));re.displayName="CardContent";var la=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("flex items-center p-6 Pr-0",e),...t}));la.displayName="CardFooter";var Rr=Ne(require("react"));var U=Rr.forwardRef(({className:e,type:t,...o},a)=>(0,Pr.jsx)("input",{type:t,className:k("flex h-9 w-full rounded-md 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:a,...o}));U.displayName="Input";var me=Ne(require("@radix-yt/react-select")),Qt=Ne(require("react")),Be=me.Root;var $e=me.Value,Ie=Qt.forwardRef(({children:e,className:t,...o},a)=>(0,Pr.jsxs)(me.Trigger,{className:k("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:a,...o,children:[e,(0,Pr.jsx)(me.Icon,{asChild:!0,children:(0,Pr.jsx)(yt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ie.displayName=me.Trigger.displayName;var Ir=Qt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(me.ScrollUpButton,{className:k("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Pr.jsx)(yt.ChevronUp,{className:"h-4 w-4"})}));Ir.displayName=me.ScrollUpButton.displayName;var Er=Qt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(me.ScrollDownButton,{className:k("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Pr.jsx)(yt.ChevronDown,{className:"h-4 w-4"})}));Er.displayName=me.ScrollDownButton.displayName;var Ee=Qt.forwardRef(({children:e,className:t,position:o="popper",...a},i)=>(0,Pr.jsx)(me.Portal,{children:(0,Pr.jsxs)(me.Content,{className:k("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md 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",o==="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:o,ref:i,...a,children:[(0,Pr.jsx)(Ir,{}),(0,Pr.jsx)(me.Viewport,{className:k("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Pr.jsx)(Er,{})]})}));Ee.displayName=me.Content.displayName;var Js=Qt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(me.Label,{className:k("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Js.displayName=me.Label.displayName;var X=Qt.forwardRef(({children:e,className:t,...o},a)=>(0,Pr.jsxs)(me.Item,{className:k("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...o,children:[(0,Pr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pr.jsx)(me.ItemIndicator,{children:(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"})})}),(0,Pr.jsx)(me.ItemText,{children:e})]}));X.displayName=me.Item.displayName;var Zs=Qt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(me.Separator,{className:k("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Zs.displayName=me.Separator.displayName;var Bo=require("motion/react");var ma=Ne(require("@radix-yt/react-tabs"));function Mr({className:e,...t}){return(0,Pr.jsx)(ma.Root,{"data-slot":"tabs",className:k("flex flex-col gap-2",e),...t})}function Fr({className:e,...t}){return(0,Pr.jsx)(ma.List,{"data-slot":"tabs-list",className:k("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Br({className:e,...t}){return(0,Pr.jsx)(ma.Trigger,{"data-slot":"tabs-trigger",className:k("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-md 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})}var Vt=Ne(require("react")),pe=Ne(require("@radix-yt/react-dropdown-menu")),ka=require("@radix-yt/react-icons");var ro=pe.Root,io=pe.Trigger;var Ys=Vt.forwardRef(({className:e,inset:t,children:o,...a},i)=>(0,Pr.jsxs)(pe.SubTrigger,{ref:i,className:k("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),...a,children:[o,(0,Pr.jsx)(ka.ChevronRightIcon,{className:"ml-auto"})]}));Ys.displayName=pe.SubTrigger.displayName;var Qs=Vt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(pe.SubContent,{ref:o,className:k("z-50 min-w-[8rem] overflow-hidden rounded-md 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}));Qs.displayName=pe.SubContent.displayName;var Oa=Vt.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Pr.jsx)(pe.Portal,{children:(0,Pr.jsx)(pe.Content,{ref:a,sideOffset:t,className:k("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","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})}));Oa.displayName=pe.Content.displayName;var pa=Vt.forwardRef(({className:e,inset:t,...o},a)=>(0,Pr.jsx)(pe.Item,{ref:a,className:k("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),...o}));pa.displayName=pe.Item.displayName;var en=Vt.forwardRef(({className:e,children:t,checked:o,...a},i)=>(0,Pr.jsxs)(pe.CheckboxItem,{ref:i,className:k("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-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:o,...a,children:[(0,Pr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pr.jsx)(pe.ItemIndicator,{children:(0,Pr.jsx)(ka.CheckIcon,{className:"h-4 w-4"})})}),t]}));en.displayName=pe.CheckboxItem.displayName;var tn=Vt.forwardRef(({className:e,children:t,...o},a)=>(0,Pr.jsxs)(pe.RadioItem,{ref:a,className:k("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,Pr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pr.jsx)(pe.ItemIndicator,{children:(0,Pr.jsx)(ka.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));tn.displayName=pe.RadioItem.displayName;var an=Vt.forwardRef(({className:e,inset:t,...o},a)=>(0,Pr.jsx)(pe.Label,{ref:a,className:k("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));an.displayName=pe.Label.displayName;var on=Vt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(pe.Separator,{ref:o,className:k("-mx-1 my-1 h-px bg-muted",e),...t}));on.displayName=pe.Separator.displayName;var rn=({className:e,...t})=>(0,Pr.jsx)("span",{className:k("ml-auto text-xs tracking-widest opacity-60",e),...t});rn.displayName="DropdownMenuShortcut";function so({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:i="700px",gridCols:r=6}){let m=o.find(s=>s.value===e);return(0,Pr.jsxs)(Bo.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Pr.jsx)("div",{className:"hidden lg:block",children:(0,Pr.jsx)(Mr,{value:e,onValueChange:t,children:(0,Pr.jsx)(Fr,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,o.length)}, minmax(0, 1fr))`},children:o.map(s=>(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Pr.jsx)(Br,{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,Pr.jsx)("div",{className:"lg:hidden",children:(0,Pr.jsxs)(ro,{children:[(0,Pr.jsx)(io,{asChild:!0,children:(0,Pr.jsxs)(x,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[m?.label||"Select",(0,Pr.jsx)(yt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Pr.jsx)(Oa,{align:"center",className:"w-[180px]",children:o.map(s=>(0,Pr.jsx)(pa,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}var no=Ne(require("react")),Ut=Ne(require("@radix-yt/react-avatar"));var Kt=no.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Ut.Root,{ref:o,className:k("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Kt.displayName=Ut.Root.displayName;var Ha=no.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Ut.Image,{ref:o,className:k("aspect-square h-full w-full",e),...t}));Ha.displayName=Ut.Image.displayName;var $t=no.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Ut.Fallback,{ref:o,className:k("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));$t.displayName=Ut.Fallback.displayName;var sn=(0,Sr.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs 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 W({className:e,variant:t,...o}){return(0,Pr.jsx)("div",{className:k(sn({variant:t}),e),...o})}function co({colleague:e,onEdit:t,onDelete:o,onViewDetails:a,showActions:i=!0,compact:r=!1,className:m}){let[s,c]=(0,Mt.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"}},p=h=>{if(!h)return"Never";let y=Math.floor((new Date().getTime()-h.getTime())/(1e3*60));return y<1?"Just now":y<60?`${y}m ago`:y<1440?`${Math.floor(y/60)}h ago`:`${Math.floor(y/1440)}d ago`};return(0,Pr.jsxs)(F,{className:k("hover:shadow-md transition-shadow",r&&"p-2",m),children:[(0,Pr.jsx)(Se,{className:k("pb-3",r&&"pb-2"),children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsx)("div",{className:"relative",children:(0,Pr.jsxs)(Kt,{className:k("h-12 w-12",r&&"h-8 w-8"),children:[(0,Pr.jsx)(Ha,{src:"/placeholder.svg",alt:e.name}),(0,Pr.jsx)($t,{children:e.name.split(" ").map(h=>h[0]).join("")})]})}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("h3",{className:k("font-semibold text-sm truncate",r&&"text-xs"),children:e.name}),e.type==="digital"?(0,Pr.jsx)(yt.Bot,{className:k("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,Pr.jsx)(yt.User,{className:k("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,Pr.jsx)("p",{className:k("text-sm text-muted-foreground truncate",r&&"text-xs"),children:e.type==="human"?e.role:e.description}),!r&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 Mt-1",children:[e.type==="human"&&(0,Pr.jsx)(W,{variant:"secondary",className:"text-xs",children:e.department}),e.type==="digital"&&(0,Pr.jsxs)(W,{variant:"secondary",className:"text-xs",children:["v",e.version]}),(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:d(e.status)})]})]})]}),i&&(0,Pr.jsxs)(ro,{children:[(0,Pr.jsx)(io,{asChild:!0,children:(0,Pr.jsx)(x,{variant:"ghost",size:"icon",className:k("h-8 w-8",r&&"h-6 w-6"),children:(0,Pr.jsx)(yt.MoreHorizontal,{className:k("h-4 w-4",r&&"h-3 w-3")})})}),(0,Pr.jsxs)(Oa,{align:"end",children:[e.type==="digital"&&(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsxs)(pa,{onClick:()=>a?.(e),children:[(0,Pr.jsx)(yt.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,Pr.jsxs)(pa,{onClick:()=>t?.(e),children:[(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,Pr.jsxs)(pa,{onClick:()=>o?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,Pr.jsx)(yt.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,Pr.jsxs)(re,{className:"Pr-0",children:[(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Mail,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,Pr.jsxs)(Pr.Fragment,{children:[e.phone&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Phone,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:e.phone})]}),e.location&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.MapPin,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Settings,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:["v",e.version]})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Clock,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:["Last active: ",p(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,Pr.jsx)("div",{className:"Mt-3",children:(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,s?e.skills.length:3).map(h=>(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:h},h)),e.skills.length>3&&(0,Pr.jsx)(x,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>c(!s),children:s?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,Pr.jsx)("div",{className:"Mt-3",children:(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,s?e.capabilities.length:2).map(h=>(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:h},h)),e.capabilities.length>2&&(0,Pr.jsx)(x,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>c(!s),children:s?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var zr=Ne(require("react")),Lo=Ne(require("@radix-yt/react-label"));var nn=(0,Sr.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),D=zr.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Lo.Root,{ref:o,className:k(nn(),e),...t}));D.displayName=Lo.Root.displayName;var Kr=Ne(require("react")),ye=Kr.forwardRef(({className:e,...t},o)=>(0,$r.jsx)("textarea",{className:k("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:o,...t}));ye.displayName="Textarea";var jo=Ne(require("react")),kt=Ne(require("@radix-yt/react-scroll-area"));var za=jo.forwardRef(({className:e,children:t,...o},a)=>(0,Pr.jsxs)(kt.Root,{ref:a,className:k("relative overflow-hidden",e),...o,children:[(0,Pr.jsx)(kt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Pr.jsx)(Gr,{}),(0,Pr.jsx)(kt.Corner,{})]}));za.displayName=kt.Root.displayName;var Gr=jo.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Pr.jsx)(kt.ScrollAreaScrollbar,{ref:a,orientation:t,className:k("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-Pr border-Pr-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,Pr.jsx)(kt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Gr.displayName=kt.ScrollAreaScrollbar.displayName;function Oo({selectedDocuments:e,onDocumentsChange:t,availableDocuments:o,label:a,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:m=!1}){let[s,c]=(0,Mt.useState)(""),[n,d]=(0,Mt.useState)([]),[p,h]=(0,Mt.useState)(!1);(0,Mt.useEffect)(()=>{if(!s.trim()){d([]),h(!1);return}let f=o.filter(T=>{if(e.map(Z=>Z.id).includes(T.id))return!1;let _=s.toLowerCase();return T.title.toLowerCase().includes(_)||T.description?.toLowerCase().includes(_)||T.tags?.some(Z=>Z.toLowerCase().includes(_))||Object.values(T.metadata||{}).some(Z=>String(Z).toLowerCase().includes(_))});d(f),h(!0)},[s,e,o]);let g=f=>{r&&e.length>=r||(t([...e,f]),c(""),h(!1))},y=f=>{t(e.filter(T=>T.id!==f))},b=!r||e.length<r;return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:a}),(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)(U,{value:s,onChange:f=>c(f.target.value),placeholder:b?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:m||!b,onFocus:()=>s&&h(!0)})]}),p&&n.length>0&&(0,Pr.jsx)(F,{className:"absolute top-full left-0 right-0 z-10 Mt-1 max-h-60",children:(0,Pr.jsx)(za,{className:"h-full",children:(0,Pr.jsx)(re,{className:"p-2",children:n.map(f=>(0,Pr.jsx)(x,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>g(f),disabled:m,children:(0,Pr.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Pr.jsx)(yt.FileText,{className:"h-4 w-4 Mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Pr.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Pr.jsx)("div",{className:"font-medium text-sm truncate",children:f.title}),f.description&&(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground Mt-1 line-clamp-2",children:f.description}),f.tags&&f.tags.length>0&&(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1 Mt-2",children:[f.tags.slice(0,3).map(T=>(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:T},T)),f.tags.length>3&&(0,Pr.jsxs)(W,{variant:"outline",className:"text-xs",children:["+",f.tags.length-3," more"]})]})]})]})},f.id))})})}),p&&s&&n.length===0&&(0,Pr.jsx)(F,{className:"absolute top-full left-0 right-0 z-10 Mt-1",children:(0,Pr.jsxs)(re,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,Pr.jsx)("div",{className:"space-y-2",children:e.map(f=>(0,Pr.jsx)(F,{className:"p-3",children:(0,Pr.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Pr.jsx)(yt.FileText,{className:"h-4 w-4 Mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsx)("div",{className:"font-medium text-sm",children:f.title}),f.description&&(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground Mt-1",children:f.description}),f.tags&&f.tags.length>0&&(0,Pr.jsx)("div",{className:"flex flex-wrap gap-1 Mt-2",children:f.tags.map(T=>(0,Pr.jsxs)(W,{variant:"outline",className:"text-xs",children:[(0,Pr.jsx)(yt.Tag,{className:"h-3 w-3 mr-1"}),T]},T))})]}),(0,Pr.jsx)(x,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>y(f.id),disabled:m,children:(0,Pr.jsx)(yt.X,{className:"h-3 w-3"})})]})},f.id))})]}),p&&(0,Pr.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>h(!1)})]})}function Ho({colleague:e,onSave:t,onCancel:o,isLoading:a=!1,title:i,submitLabel:r,cancelLabel:m="Cancel",readOnly:s=!1,availableKnowledgeDocuments:c=[]}){let[n,d]=(0,Mt.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[p,h]=(0,Mt.useState)(""),[g,y]=(0,Mt.useState)(""),[b,f]=(0,Mt.useState)(!s);(0,Mt.useEffect)(()=>{e&&d(e)},[e]);let T=S=>{S.preventDefault();let ie=n.version?parseInt(n.version):0,R=e?(ie+1).toString():"1",ve={id:n.id||Date.now().toString(),name:n.name,type:"digital",status:"active",joinedDate:n.joinedDate||new Date,lastActive:n.lastActive||new Date,description:n.description,jobDescription:n.jobDescription||"",workInstructions:n.workInstructions||"",capabilities:n.capabilities||[],knowledge:n.knowledge||[],coreKnowledge:n.coreKnowledge||[],version:R,lastUpdated:n.lastUpdated||new Date,isActive:!0};t(ve)},z=(S,ie,R)=>{if(!ie.trim())return;let ve=n[S]||[];d({...n,[S]:[...ve,ie.trim()]}),R("")},_=(S,ie)=>{let R=n[S]||[];d({...n,[S]:R.filter((ve,G)=>G!==ie)})},Z=S=>{S.preventDefault(),f(!b)},w=(S,ie,R,ve,G)=>{let E=n[S]||[];return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:ie}),b&&(0,Pr.jsxs)("div",{className:"flex gap-2",children:[(0,Pr.jsx)(U,{value:R,onChange:se=>ve(se.target.value),placeholder:G,onKeyPress:se=>{se.key==="Enter"&&(se.preventDefault(),z(S,R,ve))},disabled:a}),(0,Pr.jsx)(x,{type:"button",variant:"outline",size:"icon",onClick:()=>z(S,R,ve),disabled:a,children:(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"})})]}),(0,Pr.jsx)("div",{className:"flex flex-wrap gap-2",children:E.map((se,ze)=>(0,Pr.jsxs)(W,{className:"gap-1",children:[se,b&&(0,Pr.jsx)(x,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>_(S,ze),disabled:a,children:(0,Pr.jsx)(yt.X,{className:"h-3 w-3"})})]},`${S}-${ze}-${se}`))})]})},V=i||(b?e?"Edit Colleague":"Add New Colleague":"View Colleague"),ge=r||(e?"Update Colleague":"Add Colleague");return(0,Pr.jsxs)(F,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Pr.jsx)(Se,{children:(0,Pr.jsxs)(Ae,{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Bot,{className:"h-5 w-5"}),V]})}),(0,Pr.jsx)(re,{children:(0,Pr.jsxs)("form",{onSubmit:T,className:"space-y-6",children:[(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",children:"Name *"}),(0,Pr.jsx)(U,{id:"name",value:n.name||"",onChange:S=>d({...n,name:S.target.value}),required:!0,disabled:a||!b})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:n.description||"",onChange:S=>d({...n,description:S.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:a||!b})]})]}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Pr.jsx)(ye,{id:"jobDescription",value:n.jobDescription||"",onChange:S=>d({...n,jobDescription:S.target.value}),rows:4,required:n.type==="digital",disabled:a||!b})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Pr.jsx)(ye,{id:"workInstructions",value:n.workInstructions||"",onChange:S=>d({...n,workInstructions:S.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:a||!b})]}),w("capabilities","Capabilities",g,y,"Add capability"),(0,Pr.jsx)(Oo,{selectedDocuments:n.knowledge||[],onDocumentsChange:S=>d({...n,knowledge:S}),label:"Knowledge",placeholder:"Search for knowledge documents to add...",disabled:a||!b,availableDocuments:c}),(0,Pr.jsx)(Oo,{selectedDocuments:n.coreKnowledge||[],onDocumentsChange:S=>d({...n,coreKnowledge:S}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:a||!b,availableDocuments:c})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-2 Pr-4 border-t",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:o,disabled:a,children:b?m:"Close"}),b?(0,Pr.jsx)(x,{type:"submit",disabled:a,children:a?"Saving...":ge}):(0,Pr.jsxs)(x,{type:"button",onClick:Z,disabled:a,className:"gap-2",children:[(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Wr({users:e,onUserSelect:t,onCancel:o,selectedUserId:a}){let[i,r]=(0,Mt.useState)(""),m=(0,Mt.useMemo)(()=>e.filter(c=>c.name.toLowerCase().includes(i.toLowerCase())||c.email.toLowerCase().includes(i.toLowerCase())||c.role.toLowerCase().includes(i.toLowerCase())||(c.skills||[]).some(d=>d.toLowerCase().includes(i.toLowerCase()))),[e,i]),s=c=>{t(c)};return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Choose a user to add as a colleague"})]})]}),(0,Pr.jsx)(F,{className:"container",children:(0,Pr.jsx)(re,{className:"Pr-6",children:(0,Pr.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)(U,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:c=>r(c.target.value),className:"pl-9"})]})})})})}),(0,Pr.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:m.map(c=>(0,Pr.jsx)(Bo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Pr.jsxs)(F,{className:`cursor-pointer transition-all hover:shadow-lg ${a===c.id?"ring-2 ring-primary":""}`,onClick:()=>s(c),children:[(0,Pr.jsx)(Se,{className:"pb-3",children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsxs)(Kt,{children:[(0,Pr.jsx)(Ha,{src:c.avatar,alt:c.name}),(0,Pr.jsx)($t,{children:(0,Pr.jsx)(yt.User,{className:"h-4 w-4"})})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(Ae,{className:"text-lg",children:c.name}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:c.role})]})]}),a===c.id&&(0,Pr.jsx)(yt.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Pr.jsx)(re,{className:"Pr-0",children:(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Pr.jsx)("p",{className:"text-sm font-medium",children:c.email})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"}),(0,Pr.jsx)(W,{variant:"secondary",children:c.department})]}),c.location&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Location"}),(0,Pr.jsx)("p",{className:"text-sm",children:c.location})]}),c.skills&&c.skills.length>0&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[c.skills.slice(0,3).map(n=>(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:n},n)),c.skills.length>3&&(0,Pr.jsxs)(W,{variant:"outline",className:"text-xs",children:["+",c.skills.length-3]})]})]})]})})]})},c.id))}),m.length===0&&(0,Pr.jsx)(F,{className:"container Mt-4",children:(0,Pr.jsx)(re,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function _r({digitalColleagues:e,onColleagueClone:t,onCancel:o,selectedColleagueId:a}){let[i,r]=(0,Mt.useState)(""),[m,s]=(0,Mt.useState)("all"),c=(0,Mt.useMemo)(()=>e.filter(p=>{let h=p.name.toLowerCase().includes(i.toLowerCase())||p.jobDescription.toLowerCase().includes(i.toLowerCase())||p.capabilities.some(y=>y.toLowerCase().includes(i.toLowerCase()))||p.workInstructions.toLowerCase().includes(i.toLowerCase()),g=m==="all"||p.status===m;return h&&g}),[e,i,m]),n=p=>{let h={...p,id:`${p.id}-clone-${Date.now()}`,name:`${p.name} (Copy)`,joinedDate:new Date,lastActive:new Date,lastUpdated:new Date,version:"1.0.0"};t(h)},d=p=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(p);return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,Pr.jsx)(F,{children:(0,Pr.jsx)(re,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)(U,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:p=>r(p.target.value),className:"pl-9"})]})}),(0,Pr.jsxs)("select",{value:m,onChange:p=>s(p.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Pr.jsx)("option",{value:"all",children:"All Status"}),(0,Pr.jsx)("option",{value:"active",children:"Active"}),(0,Pr.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Pr.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:c.map(p=>(0,Pr.jsx)(Bo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Pr.jsxs)(F,{className:`cursor-pointer transition-all hover:shadow-lg ${a===p.id?"ring-2 ring-primary":""}`,onClick:()=>n(p),children:[(0,Pr.jsx)(Se,{className:"pb-3",children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsx)(Kt,{children:(0,Pr.jsx)($t,{className:"bg-blue-100",children:(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsxs)(Ae,{className:"text-lg flex items-center gap-2",children:[p.name,(0,Pr.jsx)(W,{variant:p.status==="active"?"default":"secondary",className:"text-xs",children:p.status})]}),(0,Pr.jsxs)("p",{className:"text-sm text-muted-foreground",children:["v",p.version]})]})]}),(0,Pr.jsxs)(x,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:h=>{h.stopPropagation(),n(p)},children:[(0,Pr.jsx)(yt.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Pr.jsx)(re,{className:"Pr-0",children:(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Pr.jsx)("p",{className:"text-sm line-clamp-2",children:p.jobDescription})]}),p.capabilities&&p.capabilities.length>0&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[p.capabilities.slice(0,3).map(h=>(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:h},h)),p.capabilities.length>3&&(0,Pr.jsxs)(W,{variant:"outline",className:"text-xs",children:["+",p.capabilities.length-3]})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:["Updated ",d(p.lastUpdated)]})]}),p.knowledge&&(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.Users,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:[p.knowledge.length," docs"]})]})]}),p.workInstructions&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Pr.jsx)("p",{className:"text-xs line-clamp-2",children:p.workInstructions})]})]})})]})},p.id))}),c.length===0&&(0,Pr.jsx)(F,{children:(0,Pr.jsx)(re,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function qr({onSelectHuman:e,onSelectDigital:t,onCancel:o}){return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,Pr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(F,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Pr.jsxs)(Se,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.User,{className:"h-8 w-8 text-blue-600"})}),(0,Pr.jsx)(Ae,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Pr.jsxs)(re,{className:"text-center",children:[(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add as team members."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Browse existing users"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.User,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Pr.jsx)(x,{className:"Mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(F,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Pr.jsxs)(Se,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Pr.jsx)(Ae,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Pr.jsxs)(re,{className:"text-center",children:[(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Pr.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-purple-600"}),(0,Pr.jsx)("span",{children:"Create from templates"})]})]}),(0,Pr.jsx)(x,{className:"Mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Xr({onCloneExisting:e,onCreateNew:t,onCancel:o}){return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,Pr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(F,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Pr.jsxs)(Se,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Pr.jsx)(Ae,{className:"text-xl",children:"Clone Existing"})]}),(0,Pr.jsxs)(re,{className:"text-center",children:[(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize it for your needs."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Pr.jsx)(x,{className:"Mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(F,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Pr.jsxs)(Se,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Pr.jsx)(Ae,{className:"text-xl",children:"Create New"})]}),(0,Pr.jsxs)(re,{className:"text-center",children:[(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4 text-green-600"}),(0,Pr.jsx)("span",{children:"Custom job description"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Pr.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Pr.jsx)(x,{className:"Mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}function Jr(e,t){let[o,a]=(0,Mt.useState)(()=>{if(typeof window>"Pr")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{a(r),typeof window<"Pr"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Mt.useEffect)(()=>{i(o)},[]),[o,i]}var uo=require("react-icons/Bo");function Qe({title:e,description:t,badge:o,primaryAction:a,secondaryAction:i,gradient:r,children:m,className:s}){let[c,n]=Jr(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),d=!i&&!t||c;return(0,Pr.jsxs)(Bo.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,Pr.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,Pr.jsx)(W,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:o}),(0,Pr.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[d&&a&&(0,Pr.jsx)(x,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),(i||t)&&(0,Pr.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,Pr.jsx)(uo.FaChevronDown,{size:22}):(0,Pr.jsx)(uo.FaChevronUp,{size:22})})]})]}),!d&&(0,Pr.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-3",children:[a&&(0,Pr.jsx)(x,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),i&&(0,Pr.jsx)(x,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),m&&(0,Pr.jsx)("div",{className:"hidden lg:block",children:m})]})]})}function zo({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:o,onColleagueDelete:a,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:m,availableUsers:s=[],existingDigitalColleagues:c=[]}){let[n,d]=(0,Mt.useState)(e||[]),[p,h]=(0,Mt.useState)(""),[g,y]=(0,Mt.useState)("all"),[b,f]=(0,Mt.useState)("all"),[T,z]=(0,Mt.useState)("all"),[_,Z]=(0,Mt.useState)(null),[w,V]=(0,Mt.useState)(null);(0,Mt.useEffect)(()=>{d(e||[])},[e]);let ge=Array.isArray(s)?s:[],S=Array.isArray(c)?c:[],[ie,R]=(0,Mt.useState)("main"),ve=n.filter(C=>{if(!C||!C.name)return!1;let Fe=C.name.toLowerCase().includes(p.toLowerCase())||C.type==="human"&&(C.email?.toLowerCase().includes(p.toLowerCase())||C.role?.toLowerCase().includes(p.toLowerCase()))||C.type==="digital"&&C.jobDescription?.toLowerCase().includes(p.toLowerCase()),xe=g==="all"||C.type==="human"&&C.department===g,Ct=b==="all"||C.status===b;return Fe&&xe&&Ct}),G=ve.filter(C=>C.type==="human"),E=ve.filter(C=>C.type==="digital"),se=()=>{R("typeSelection")},ze=C=>{C.type==="digital"&&(Z(C),R("form")),console.log("Editing colleague:",C),o?.(C)},Me=C=>{C.type==="digital"&&(V(C),R("view"))},we=C=>{let Fe={id:`human-${Date.now()}`,type:"human",name:C.name,email:C.email,role:C.role,department:C.department,phone:C.phone,location:C.location,timezone:C.timezone,skills:C.skills||[],bio:C.bio,status:"active",joinedDate:new Date,lastActive:new Date};d(xe=>[...xe,Fe]),t?.(Fe),R("main")},ut=C=>{if(!C||!C.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",C);return}d(Fe=>[...Fe,C]),t?.(C),R("main")},st=()=>{Z(null),R("form")},Nt=C=>{if(!C||!C.id){console.error("Invalid colleague provided to handleSaveColleague:",C);return}_?(d(Fe=>Fe.map(xe=>xe.id===C.id?C:xe)),o?.(C)):(d(Fe=>[...Fe,C]),t?.(C)),R("main"),Z(null)},Ve=()=>{R("main"),Z(null),V(null)},rt=()=>{R("main"),V(null)},At=()=>{w&&(Z(w),V(null),R("form"))},bt=C=>{a?.(C,n.find(Fe=>Fe.id===C).type),d(Fe=>Fe.filter(xe=>xe.id!==C))},ht=()=>{h(""),y("all"),f("all")},It=()=>{let C=[];return S.forEach(xe=>{xe.knowledge&&Array.isArray(xe.knowledge)&&C.push(...xe.knowledge),xe.coreKnowledge&&Array.isArray(xe.coreKnowledge)&&C.push(...xe.coreKnowledge)}),n.forEach(xe=>{xe.type==="digital"&&(xe.knowledge&&Array.isArray(xe.knowledge)&&C.push(...xe.knowledge),xe.coreKnowledge&&Array.isArray(xe.coreKnowledge)&&C.push(...xe.coreKnowledge))}),C.filter((xe,Ct,Lt)=>Ct===Lt.findIndex(j=>j.id===xe.id))};return ie==="typeSelection"?(0,Pr.jsx)(qr,{onSelectHuman:()=>R("userSelection"),onSelectDigital:()=>R("digitalOptions"),onCancel:()=>R("main")}):ie==="userSelection"?(0,Pr.jsx)(Wr,{users:ge,onUserSelect:we,onCancel:()=>R("typeSelection")}):ie==="digitalOptions"?(0,Pr.jsx)(Xr,{onCloneExisting:()=>R("digitalClone"),onCreateNew:st,onCancel:()=>R("typeSelection")}):ie==="digitalClone"?(0,Pr.jsx)(_r,{digitalColleagues:S,onColleagueClone:ut,onCancel:()=>R("digitalOptions")}):ie==="form"?(0,Pr.jsx)(Ho,{colleague:_||void 0,onSave:Nt,onCancel:Ve,availableKnowledgeDocuments:It()}):ie==="view"?(0,Pr.jsx)(Ho,{colleague:w||void 0,onSave:Nt,onCancel:rt,readOnly:!0,availableKnowledgeDocuments:It()}):(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsx)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Pr.jsxs)("div",{className:`space-y-6 ${m||""}`,children:[(0,Pr.jsx)(Qe,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:se}}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Pr.jsxs)(F,{children:[(0,Pr.jsxs)(Se,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Pr.jsx)(Ae,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Pr.jsxs)(re,{children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold",children:n.length}),(0,Pr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.filter(C=>C.status==="active").length," active"]})]})]}),(0,Pr.jsxs)(F,{children:[(0,Pr.jsxs)(Se,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Pr.jsx)(Ae,{className:"text-sm font-medium",children:"Human Members"}),(0,Pr.jsx)(yt.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Pr.jsxs)(re,{children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(C=>C.type==="human").length}),(0,Pr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.filter(C=>C.type==="human"&&C.status==="active").length," ","active"]})]})]}),(0,Pr.jsxs)(F,{children:[(0,Pr.jsxs)(Se,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Pr.jsx)(Ae,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Pr.jsxs)(re,{children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(C=>C.type==="digital").length}),(0,Pr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.filter(C=>C.type==="digital"&&C.status==="active").length," ","active"]})]})]})]}),(0,Pr.jsx)(F,{children:(0,Pr.jsx)(re,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)(U,{placeholder:"Search colleagues...",value:p,onChange:C=>h(C.target.value),className:"pl-9"})]})}),(0,Pr.jsxs)(Be,{value:g,onValueChange:y,children:[(0,Pr.jsx)(Ie,{className:"w-full md:w-[180px]",children:(0,Pr.jsx)($e,{placeholder:"Department"})}),(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsx)(X,{value:"all",children:"All Departments"}),r.map(C=>(0,Pr.jsx)(X,{value:C,children:C},C))]})]}),(0,Pr.jsxs)(Be,{value:b,onValueChange:f,children:[(0,Pr.jsx)(Ie,{className:"w-full md:w-[140px]",children:(0,Pr.jsx)($e,{placeholder:"Status"})}),(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsx)(X,{value:"all",children:"All Status"}),(0,Pr.jsx)(X,{value:"active",children:"Active"}),(0,Pr.jsx)(X,{value:"inactive",children:"Inactive"})]})]}),(p||g!=="all"||b!=="all")&&(0,Pr.jsxs)(x,{variant:"outline",onClick:ht,className:"gap-2",children:[(0,Pr.jsx)(yt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)(so,{activeTab:T,onTabChange:z,tabOptions:[{value:"all",label:`All (${ve.length})`},{value:"human",label:`Human (${G.length})`},{value:"digital",label:`Digital (${E.length})`}],maxWidth:"400px",gridCols:3}),T==="all"&&(0,Pr.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:ve.map(C=>(0,Pr.jsx)(co,{colleague:C,onEdit:ze,onDelete:bt,onViewDetails:Me,compact:i},`${C}-${C.id}`))}),T==="human"&&(0,Pr.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:G.map(C=>(0,Pr.jsx)(co,{colleague:C,onEdit:ze,onDelete:bt,onViewDetails:Me,compact:i},C.id))}),T==="digital"&&(0,Pr.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:E.map(C=>(0,Pr.jsx)(co,{colleague:C,onEdit:ze,onDelete:bt,onViewDetails:Me,compact:i},C.id))})]}),ve.length===0&&(0,Pr.jsx)(F,{children:(0,Pr.jsx)(re,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"||b!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,Pr.jsxs)(x,{onClick:se,className:"gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function fo({files:e,onFileClick:t,onFileEdit:o,onFileDelete:a,showHeader:i=!0,className:r}){return(0,Pr.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,Pr.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Pr.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Pr.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Pr.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Pr.jsx)("div",{className:"divide-y",children:e.map(m=>(0,Pr.jsxs)(Bo.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(m),children:[(0,Pr.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Pr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Pr.jsx)("div",{children:(0,Pr.jsx)("p",{className:"font-medium",children:m.name})})]}),(0,Pr.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:m.filesize}),(0,Pr.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Pr.jsx)("span",{className:"text-sm md:text-base",children:typeof m.createdAt=="string"?m.createdAt:new Date(m.createdAt).toLocaleDateString()}),(0,Pr.jsx)("div",{className:"flex gap-1",children:(0,Pr.jsx)(x,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),a?.(m)},children:(0,Pr.jsx)(yt.Trash2,{className:"h-4 w-4"})})})]})]},m.name))})]})}function $a({initialFiles:e=[],onFileAdd:t,onFileEdit:o,onFileDelete:a,onFileClick:i,compactView:r=!1,className:m}){let[s,c]=(0,Mt.useState)(e),[n,d]=(0,Mt.useState)(""),[p,h]=(0,Mt.useState)("all"),[g,y]=(0,Mt.useState)("all");(0,Mt.useEffect)(()=>{c(e)},[e]);let b=Array.from(new Set(s.map(S=>S.mimeType))),f=s.filter(S=>{let ie=S.name.toLowerCase().includes(n.toLowerCase()),R=p==="all"||S.mimeType===p;return ie&&R}),T=f.slice(0,10),z=f.filter(Boolean),_=()=>{t?.()},Z=S=>{o?.(S)},w=S=>{console.log("deleting file",S),c(ie=>ie.filter(R=>R.name!==S.name)),a?.(S.id)},V=S=>{i?.(S)},ge=()=>{d(""),h("all")};return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsx)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Pr.jsxs)("div",{className:`space-y-6 ${m||""}`,children:[(0,Pr.jsx)(Qe,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600",primaryAction:{label:"Upload file",onClick:_},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Pr.jsx)(F,{children:(0,Pr.jsx)(re,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)(U,{placeholder:"Search files...",value:n,onChange:S=>d(S.target.value),className:"pl-9"})]})}),(n||p!=="all")&&(0,Pr.jsxs)(x,{variant:"outline",onClick:ge,className:"gap-2",children:[(0,Pr.jsx)(yt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)(so,{activeTab:g,onTabChange:y,tabOptions:[{value:"all",label:`All Files (${f.length})`},{value:"recent",label:`Recent (${T.length})`}],maxWidth:"500px",gridCols:3}),g==="all"&&(0,Pr.jsx)(fo,{files:f,onFileClick:V,onFileEdit:Z,onFileDelete:w,showHeader:!r}),g==="recent"&&(0,Pr.jsx)(fo,{files:T,onFileClick:V,onFileEdit:Z,onFileDelete:w,showHeader:!r}),g==="shared"&&(0,Pr.jsx)(fo,{files:z,onFileClick:V,onFileEdit:Z,onFileDelete:w,showHeader:!r})]}),f.length===0&&(0,Pr.jsx)(F,{children:(0,Pr.jsx)(re,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:n||p!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,Pr.jsxs)(x,{onClick:_,className:"gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}function ai({document:e,onSave:t,onCancel:o,availableDocuments:a=[],knowledgeContexts:i=[]}){let[r,m]=(0,Mt.useState)({...e,updatedAt:new Date}),s=()=>{let b=new Set,f=new Set;return i.forEach(T=>{T.menuConfig.groupBy.forEach(z=>b.add(z))}),a.forEach(T=>{T.metadata&&Object.keys(T.metadata).forEach(z=>f.add(z))}),{contextKeys:Array.from(b).sort(),documentKeys:Array.from(f).sort(),allKeys:Array.from(new Set([...b,...f])).sort()}},c=b=>{let f=new Set;return a.forEach(T=>{T.metadata?.[b]&&f.add(String(T.metadata[b]))}),Array.from(f).sort()},n=s(),d=()=>{t(r)},p=(b,f)=>{m(T=>({...T,metadata:{...T.metadata,[b]:f}}))},h=(b,f)=>{f==="__custom__"?p(b,""):p(b,f)},g=()=>{let b=`field_${Date.now()}`;p(b,"")},y=b=>{m(f=>{let T={...f.metadata};return delete T[b],{...f,metadata:T}})};return(0,$.jsxs)(Bo.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)(yt.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)(x,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,$.jsx)(yt.X,{className:"h-4 w-4"}),"Cancel"]}),(0,$.jsxs)(x,{size:"sm",onClick:d,className:"gap-2",children:[(0,$.jsx)(yt.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)(U,{value:r.title,onChange:b=>m(f=>({...f,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)(ye,{value:r.description||"",onChange:b=>m(f=>({...f,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-xs text-muted-foreground",children:["Suggested: ",n.contextKeys.slice(0,4).join(", "),n.contextKeys.length>4&&` +${n.contextKeys.length-4}`]})]}),(0,$.jsxs)(x,{type:"button",variant:"outline",size:"sm",onClick:g,className:"gap-1 h-8",children:[(0,$.jsx)(yt.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,f])=>{let T=c(b);return(0,$.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,$.jsx)(U,{value:b,onChange:z=>{let _=z.target.value,Z=r.metadata?.[b];m(w=>{let V={...w.metadata};return delete V[b],_&&(V[_]=Z||""),{...w,metadata:V}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${b}`}),(0,$.jsx)("datalist",{id:`metadata-keys-${b}`,children:n.allKeys.map(z=>(0,$.jsx)("option",{value:z},z))}),(0,$.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),T.length>0?(0,$.jsxs)(Be,{value:String(f||""),onValueChange:z=>h(b,z),children:[(0,$.jsx)(Ie,{className:"flex-1 h-8 text-sm",children:(0,$.jsx)($e,{placeholder:"Value"})}),(0,$.jsxs)(Ee,{children:[T.map(z=>(0,$.jsx)(X,{value:z,children:z},z)),(0,$.jsx)(X,{value:"__custom__",children:(0,$.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,$.jsx)(U,{value:String(f||""),onChange:z=>p(b,z.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,$.jsx)(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>y(b),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,$.jsx)(yt.X,{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-xs text-muted-foreground",children:'No metadata \u2022 Click "Add" to 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)(W,{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)(ye,{value:r.content||"",onChange:b=>m(f=>({...f,content:b.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var si=e=>(0,Pr.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`(.*?)`/g,'<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>')}}),oi=e=>(0,Pr.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),ln=e=>(0,Pr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Pr.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,Pr.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,Pr.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,Pr.jsx)("pre",{className:"text-sm",children:e})]}),dn=e=>(0,Pr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Pr.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,Pr.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Pr.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),si(e)]});function ni({document:e,onDocumentUpdate:t,editable:o=!0,renderers:a,availableDocuments:i=[],knowledgeContexts:r=[]}){let[m,s]=(0,Mt.useState)(!1),c=g=>{switch(g){case"markdown":case"mdx":return(0,Pr.jsx)(yt.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,Pr.jsx)(yt.File,{className:"h-6 w-6 text-success"});case"text":return(0,Pr.jsx)(yt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Pr.jsx)(yt.File,{className:"h-6 w-6 text-muted-foreground"})}},n=g=>{switch(g){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=(g,y)=>{let b={markdown:si,mdx:dn,richtext:ln,text:oi},f=a?.[y]||b[y];return f?f(g):oi(g)},p=g=>{s(!1),t?.(g)},h=()=>{s(!1)};return m?(0,Pr.jsx)(ai,{document:e,onSave:p,onCancel:h,availableDocuments:i,knowledgeContexts:r}):(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Pr.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Pr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Pr.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,Pr.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:c(e.format)}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,Pr.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),o&&(0,Pr.jsx)("div",{className:"flex-shrink-0",children:(0,Pr.jsxs)(x,{variant:"outline",size:"sm",onClick:()=>s(!0),className:"gap-2",children:[(0,Pr.jsx)(yt.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Pr.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(g=>(0,Pr.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",g]},g))]})]}),(0,Pr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Pr.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,Pr.jsxs)("div",{className:"mb-6",children:[(0,Pr.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,Pr.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,Pr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-xs",children:Object.entries(e.metadata).map(([g,y])=>(0,Pr.jsxs)("div",{className:"flex gap-1",children:[(0,Pr.jsxs)("span",{className:"text-muted-foreground font-medium",children:[g.replace(/([A-Z])/g," $1").trim(),":"]}),(0,Pr.jsx)("span",{className:"text-foreground truncate",children:String(y)})]},g))})})]}),(0,Pr.jsx)("div",{className:"space-y-4",children:e.content?(0,Pr.jsx)("div",{className:"relative",children:(0,Pr.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:d(e.content,e.format)})}):(0,Pr.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Pr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Pr.jsx)(yt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Pr.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Pr.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function li({label:e,documents:t,children:o,level:a,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:m=!0}){let[s,c]=(0,Mt.useState)(a===0),n=o&&Object.keys(o).length>0,d=t.length+(o?Object.values(o).reduce((g,y)=>g+y.documents.length,0):0),p=g=>{switch(g){case"markdown":case"mdx":return(0,Pr.jsx)(yt.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,Pr.jsx)(yt.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Pr.jsx)(yt.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},h=g=>{let y=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return y[g%y.length]};return(0,Pr.jsxs)("div",{className:"space-y-1",children:[(n||t.length>0)&&(0,Pr.jsxs)(Bo.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:`${a*20}px`},onClick:()=>c(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Pr.jsx)("div",{className:`w-1 h-6 rounded-full ${h(a)}`}),(0,Pr.jsx)(Bo.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Pr.jsx)(yt.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Pr.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Pr.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Pr.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),m&&d>0&&(0,Pr.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Pr.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,Pr.jsx)(Bo.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Pr.jsxs)("div",{className:"Pr-2 space-y-1",children:[t.map((g,y)=>(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:y*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===g.id?"bg-primary/10 border-Pr-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${a*20+20}px`},onClick:()=>i?.(g),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Pr.jsx)("div",{className:"flex-shrink-0",children:p(g.format)}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsx)("p",{className:`text-sm truncate transition-colors ${r===g.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:g.title}),g.description&&(0,Pr.jsx)("p",{className:"text-xs text-muted-foreground truncate Mt-0.5",children:g.description})]}),g.tags&&g.tags.length>0&&(0,Pr.jsx)("div",{className:"flex-shrink-0",children:(0,Pr.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:g.tags[0]})})]},g.id)),o&&Object.entries(o).map(([g,y])=>(0,Pr.jsx)(li,{label:g,documents:y.documents,children:y.children,level:a+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:m},g))]})})]})}function di({documents:e,menuConfig:t,onDocumentClick:o,onDocumentShare:a,onDocumentUpdate:i,selectedDocumentId:r,className:m,editable:s=!0}){let[c,n]=(0,Mt.useState)(""),[d,p]=(0,Mt.useState)(null),h=(0,Mt.useMemo)(()=>c?e.filter(b=>b.title.toLowerCase().includes(c.toLowerCase())||b.description?.toLowerCase().includes(c.toLowerCase())||b.tags?.some(f=>f.toLowerCase().includes(c.toLowerCase()))||Object.values(b.metadata||{}).some(f=>String(f).toLowerCase().includes(c.toLowerCase()))):e,[e,c]),g=(0,Mt.useMemo)(()=>{let b=(f,T)=>{if(T.length===0)return{};let[z,..._]=T;return f.reduce((w,V)=>{let ge=V.metadata?.[z]||"Uncategorized",S=String(ge);if(w[S]||(w[S]={documents:[],children:{}}),_.length===0)w[S].documents.push(V);else{let ie=b([V],_),R=Object.keys(ie)[0];R&&(w[S].children||(w[S].children={}),w[S].children[R]?w[S].children[R].documents.push(...ie[R].documents):w[S].children[R]=ie[R])}return w},{})};return b(h,t.groupBy)},[h,t.groupBy]),y=b=>{p(b),o?.(b)};return(0,Pr.jsxs)("div",{className:`flex h-full ${m||""}`,children:[(0,Pr.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Pr.jsx)("div",{className:"p-6 border-b border-border",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Pr.jsx)(yt.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Pr.jsx)(U,{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,Pr.jsx)(za,{className:"h-[calc(100%-100px)]",children:(0,Pr.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(g).map(([b,f])=>(0,Pr.jsx)(li,{label:b,documents:f.documents,children:f.children,level:0,onDocumentClick:y,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},b)),Object.keys(g).length===0&&(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Pr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Pr.jsx)(yt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Pr.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,Pr.jsx)("p",{className:"text-xs Mt-1",children:"Try adjusting your search terms"})]})]})})]}),(0,Pr.jsx)("div",{className:"flex-1 bg-background",children:d?(0,Pr.jsx)(ni,{document:d,onDocumentUpdate:i,editable:s}):(0,Pr.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Pr.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Pr.jsx)(yt.FileText,{className:"h-10 w-10 text-primary"})}),(0,Pr.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Pr.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}function Vo({documents:e=[],contexts:t=[],onDocumentClick:o=m=>console.log("Document clicked:",m),onDocumentShare:a=m=>console.log("Share document:",m),onLoadDocumentContent:i,selectedDocumentId:r}){let[m,s]=(0,Mt.useState)(t[0]);return!t||t.length===0?(0,Pr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,Pr.jsx)(Qe,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,Pr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,Pr.jsx)(Qe,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,Pr.jsxs)("div",{className:"Mt-6",children:[(0,Pr.jsx)("div",{className:"border-b border-border",children:(0,Pr.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(c=>(0,Pr.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 ${m.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))})}),m.description&&(0,Pr.jsx)("div",{className:"Mt-3 px-1",children:(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description})})]})]}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Pr.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,Pr.jsx)(di,{documents:e,menuConfig:m.menuConfig,onDocumentClick:o,onDocumentShare:a,selectedDocumentId:r})})})]})}var cn=[{key:"kanban",icon:yt.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:yt.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:yt.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:yt.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:yt.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],mi=({currentView:e,onViewChange:t,children:o})=>(0,Pr.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Pr.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:cn.map(a=>{let i=a.icon,r=e===a.key;return(0,Pr.jsxs)("button",{onClick:()=>t(a.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?a.color:`${a.color}/75 hover:${a.color}`} ${a.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:a.title,children:[(0,Pr.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,Pr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:a.label})]},a.key)})}),(0,Pr.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Pr.jsx)("div",{className:"w-full h-full",children:o})})]});var pi=({title:e,status:t,taskCount:o,children:a,onDrop:i,isCompact:r=!1,height:m})=>{let s=d=>{d.preventDefault()},c=d=>{d.preventDefault(),i(t)};return(0,Pr.jsxs)(F,{className:`p-4 bg-card border-Pr-4 ${(()=>{switch(t){case"todo":return"border-Pr-gray-400";case"in-progress":return"border-Pr-blue-500";case"review":return"border-Pr-orange-500";case"done":return"border-Pr-green-500";default:return"border-Pr-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${r?"lg:max-w-xs":""}`,style:{height:m||"calc(100vh - 350px)"},onDragOver:s,onDrop:c,children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Pr.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Pr.jsx)(W,{variant:"secondary",className:"bg-muted text-muted-foreground",children:o})]}),(0,Pr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:a})]})};var ho=({task:e,epic:t,onDragStart:o,onTaskClick:a,isCompact:i=!1})=>{let r=d=>{o(e)},m=()=>{a(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,Pr.jsx)(yt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Pr.jsx)(yt.Bug,{className:"h-3 w-3"});case"spike":return(0,Pr.jsx)(yt.Zap,{className:"h-3 w-3"});case"task":default:return(0,Pr.jsx)(yt.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,Pr.jsx)(F,{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:m,children:(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${n()}`,children:c()}),(0,Pr.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Pr.jsxs)(F,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:r,onClick:m,children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Pr.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${n()}`,children:[c(),(0,Pr.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Pr.jsxs)("div",{className:"flex gap-1",children:[(0,Pr.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${s()}`,children:e.priority}),(0,Pr.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.points})]})]}),(0,Pr.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Pr.jsx)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.User,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:e.assignee?.value?.name})]})})]})};var Ga=Ne(require("react")),at=Ne(require("@radix-yt/react-dialog"));var ft=at.Root;var mn=at.Portal;var gi=Ga.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(at.Overlay,{ref:o,className:k("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}));gi.displayName=at.Overlay.displayName;var lt=Ga.forwardRef(({className:e,children:t,...o},a)=>(0,Pr.jsxs)(mn,{children:[(0,Pr.jsx)(gi,{}),(0,Pr.jsxs)(at.Content,{ref:a,className:k("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-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,Pr.jsxs)(at.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,Pr.jsx)(yt.X,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));lt.displayName=at.Content.displayName;var dt=({className:e,...t})=>(0,Pr.jsx)("div",{className:k("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});dt.displayName="DialogHeader";var Wa=({className:e,...t})=>(0,Pr.jsx)("div",{className:k("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Wa.displayName="DialogFooter";var ct=Ga.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(at.Title,{ref:o,className:k("text-lg font-semibold leading-none tracking-tight",e),...t}));ct.displayName=at.Title.displayName;var _a=Ga.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(at.Description,{ref:o,className:k("text-sm text-muted-foreground",e),...t}));_a.displayName=at.Description.displayName;var ba=Ne(require("react")),Pa=Ne(require("@radix-yt/react-toggle-group"));var fi=Ne(require("react")),Uo=Ne(require("@radix-yt/react-toggle"));var Ko=(0,Sr.cva)("inline-flex items-center justify-center gap-2 rounded-md 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"}}),pn=fi.forwardRef(({className:e,variant:t,size:o,...a},i)=>(0,Pr.jsx)(Uo.Root,{ref:i,className:k(Ko({variant:t,size:o,className:e})),...a}));pn.displayName=Uo.Root.displayName;var bi=ba.createContext({size:"default",variant:"default"}),xa=ba.forwardRef(({className:e,variant:t,size:o,children:a,...i},r)=>(0,Pr.jsx)(Pa.Root,{ref:r,className:k("flex items-center justify-center gap-1",e),...i,children:(0,Pr.jsx)(bi.Provider,{value:{variant:t,size:o},children:a})}));xa.displayName=Pa.Root.displayName;var ya=ba.forwardRef(({className:e,children:t,variant:o,size:a,...i},r)=>{let m=ba.useContext(bi);return(0,Pr.jsx)(Pa.Item,{ref:r,className:k(Ko({variant:m.variant||o,size:m.size||a}),e),...i,children:t})});ya.displayName=Pa.Item.displayName;var un=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:yt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:yt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:yt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:yt.Zap}],gn=[{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"}],xo=({isOpen:e,onClose:t,onAddTask:o,epics:a,sprints:i,assignees:r,defaultEpicId:m})=>{let[s,c]=(0,Mt.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""});(0,Mt.useEffect)(()=>{e&&m&&c(p=>({...p,epicId:m}))},[e,m]),(0,Mt.useEffect)(()=>{e&&c({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:m||"",sprintId:"none",assignee:""})},[e]);let n=p=>{p.preventDefault(),s.name.trim()&&(o({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,points:s.points,epicId:s.epicId,sprintId:s.sprintId==="none"?void 0:s.sprintId,assignee:s.assignee.trim()||"Unassigned"}),c({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:m||"",sprintId:"none",assignee:""}),t())},d=(p,h)=>{c(g=>({...g,[p]:h}))};return(0,Pr.jsx)(ft,{open:e,onOpenChange:t,children:(0,Pr.jsxs)(lt,{className:"sm:max-w-md",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Task"})}),(0,Pr.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",children:"Task Title"}),(0,Pr.jsx)(U,{id:"name",value:s.name,onChange:p=>d("name",p.target.value),placeholder:"Enter task title",required:!0})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:s.description,onChange:p=>d("description",p.target.value),placeholder:"Enter task description",rows:3})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Type"}),(0,Pr.jsx)(xa,{type:"single",value:s.type,onValueChange:p=>p&&d("type",p),children:un.map(p=>{let h=p.icon;return(0,Pr.jsxs)(ya,{value:p.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Pr.jsx)(h,{className:"h-4 w-4"}),p.label]},p.value)})})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Priority"}),(0,Pr.jsx)(xa,{type:"single",value:s.priority,onValueChange:p=>p&&d("priority",p),children:gn.map(p=>(0,Pr.jsx)(ya,{value:p.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:p.label},p.value))})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"points",children:"Story Points"}),(0,Pr.jsx)(U,{id:"points",type:"number",min:"1",max:"100",value:s.points,onChange:p=>d("points",parseInt(p.target.value)||1),placeholder:"Enter story points",required:!0})]}),!m&&(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"epic",children:"Epic"}),(0,Pr.jsxs)(Be,{value:s.epicId,onValueChange:p=>d("epicId",p),children:[(0,Pr.jsx)(Ie,{children:(0,Pr.jsx)($e,{placeholder:"Select an epic"})}),(0,Pr.jsx)(Ee,{children:a.map(p=>(0,Pr.jsx)(X,{value:p.id,children:(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${p.color}`}),p.name]})},p.id))})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Pr.jsxs)(Be,{value:s.sprintId,onValueChange:p=>d("sprintId",p),children:[(0,Pr.jsx)(Ie,{children:(0,Pr.jsx)($e,{placeholder:"Select a sprint"})}),(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsx)(X,{value:"none",children:"No Sprint"}),i.map(p=>(0,Pr.jsx)(X,{value:p.id,children:(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[p.name,p.isActive&&(0,Pr.jsx)("span",{className:"text-xs bg-green-100 text-green-800 px-1 rounded",children:"Active"})]})},p.id))]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"sprint",children:"Assignee"}),(0,Pr.jsxs)(Be,{value:s.assignee,onValueChange:p=>d("assignee",p),children:[(0,Pr.jsx)(Ie,{children:(0,Pr.jsx)($e,{placeholder:"Select an Assignee"})}),(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsx)(X,{value:"none",children:"No Assignee"}),r.map(p=>(0,Pr.jsx)(X,{value:p.id,children:(0,Pr.jsx)("div",{className:"flex items-center gap-2",children:p.name})},p.id))]})]})]}),(0,Pr.jsxs)(Wa,{children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Go=({fieldName:e,value:t,label:o,multiline:a=!1,onSave:i,className:r="",disabled:m=!1})=>{let[s,c]=(0,$o.useState)(!1),[n,d]=(0,$o.useState)(""),p=()=>{m||(c(!0),d(t))},h=async()=>{n!==t&&await i(e,n),c(!1)},g=y=>{y.key==="Enter"&&!a||y.key==="Enter"&&y.ctrlKey&&a?h():y.key==="Escape"&&(c(!1),d(""))};return(0,Pr.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Pr.jsx)(D,{children:o}),s?a?(0,Pr.jsx)(ye,{value:n,onChange:y=>d(y.target.value),onBlur:h,onKeyDown:g,autoFocus:!0,rows:4,className:"resize-none"}):(0,Pr.jsx)(U,{value:n,onChange:y=>d(y.target.value),onBlur:h,onKeyPress:g,autoFocus:!0,className:"text-lg font-medium"}):(0,Pr.jsxs)("div",{onClick:p,className:`${m?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${a?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Pr.jsx)("span",{className:a?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!m&&(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var wi=({comments:e,onAddComment:t})=>{let[o,a]=(0,Mt.useState)(""),i=m=>m.split(" ").map(s=>s[0]).join("").toUpperCase(),r=()=>{o.trim()&&(t(o),a(""))};return(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.MessageSquare,{className:"h-5 w-5"}),(0,Pr.jsx)(D,{className:"text-lg font-medium",children:"Comments"}),(0,Pr.jsx)(W,{variant:"secondary",children:e.length})]}),(0,Pr.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(m=>(0,Pr.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Pr.jsx)(Kt,{className:"h-8 w-8 Mt-1",children:(0,Pr.jsx)($t,{className:"text-xs bg-muted text-muted-foreground",children:i(m.author)})}),(0,Pr.jsxs)("div",{className:"flex-1",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Pr.jsx)("span",{className:"font-medium text-sm",children:m.author}),(0,Pr.jsxs)("span",{className:"text-xs text-muted-foreground",children:[m.createdAt.toLocaleDateString()," at ",m.createdAt.toLocaleTimeString()]})]}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:m.text})]})]},m.id))}),(0,Pr.jsxs)("div",{className:"flex gap-2",children:[(0,Pr.jsx)(ye,{value:o,onChange:m=>a(m.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Pr.jsx)(x,{onClick:r,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,Pr.jsx)(yt.Send,{className:"h-4 w-4"})})]})]})};var wo=({label:e,value:t,onValueChange:o,options:a,showColor:i=!1,disabled:r=!1})=>{let[m,s]=(0,Mt.useState)(!1),c=a.find(d=>d.value===t);return(0,Pr.jsxs)("div",{className:"space-y-1",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:e}),(0,Pr.jsxs)(Be,{value:t,onValueChange:o,open:m,onOpenChange:d=>{r||s(d)},disabled:r,children:[(0,Pr.jsx)(Ie,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Pr.jsxs)(W,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&s(!m),children:[i&&c?.color&&(0,Pr.jsx)("div",{className:`w-2 h-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,Pr.jsx)(Ee,{children:a.map(d=>(0,Pr.jsx)(X,{value:d.value,children:i&&d.color?(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var Ci=({label:e,value:t,onValueChange:o,options:a,placeholder:i="Search...",allowCustomValue:r=!1,disabled:m=!1})=>{let[s,c]=(0,Mt.useState)(!1),[n,d]=(0,Mt.useState)(""),p=a.find(f=>f.value===t),h=a.filter(f=>f.label.toLowerCase().includes(n.toLowerCase())),g=f=>{o(f),c(!1),d("")},y=()=>{r&&n.trim()&&!a.find(f=>f.value===n.trim())&&(o(n.trim()),c(!1),d(""))};return(0,Pr.jsxs)("div",{className:"space-y-1",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:e}),(0,Pr.jsxs)(Be,{value:t,onValueChange:g,open:s,onOpenChange:f=>{m||c(f)},disabled:m,children:[(0,Pr.jsx)(Ie,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Pr.jsx)(W,{variant:"secondary",className:`${m?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!m&&c(!s),children:p?.label||t||"Select..."})}),(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsx)("div",{className:"p-2",children:(0,Pr.jsx)(U,{placeholder:i,value:n,onChange:f=>d(f.target.value),onKeyDown:f=>{f.key==="Enter"&&r&&y()},className:"mb-2"})}),h.map(f=>(0,Pr.jsx)(X,{value:f.value,children:f.label},f.value)),r&&n.trim()&&!h.find(f=>f.value===n.trim())&&(0,Pr.jsxs)(X,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var fn=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:yt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:yt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:yt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:yt.Zap}],vn=[{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 ki=({task:e,epics:t,sprints:o,lastUpdated:a,onUpdateTask:i,onClose:r,onDelete:m,isUpdating:s=!1,isDeleting:c=!1,deleteState:n="idle",teamMembers:d})=>{let p=g=>g.split(" ").map(y=>y[0]).join("").toUpperCase(),h=()=>n==="loading"?(0,Pr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Pr.jsx)(yt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):n==="success"?(0,Pr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Pr.jsx)(yt.Check,{className:"h-3 w-3"}),"Deleted"]}):n==="error"?(0,Pr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Pr.jsx)(yt.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Pr.jsxs)(x,{onClick:m,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:s||c,children:[(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Pr.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Pr.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Pr.jsx)(wo,{label:"",value:e.status,onValueChange:g=>i("status",g),options:[{value:"todo",label:"Bo Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Pr.jsx)(xa,{type:"single",value:e.type,onValueChange:g=>g&&i("type",g),className:"grid grid-cols-2 gap-1",disabled:s,children:fn.map(g=>{let y=g.icon;return(0,Pr.jsxs)(ya,{value:g.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,Pr.jsx)(y,{className:"h-3 w-3"}),g.label]},g.value)})})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Pr.jsx)(xa,{type:"single",value:e.priority,onValueChange:g=>g&&i("priority",g),className:"grid grid-cols-3 gap-1",disabled:s,children:vn.map(g=>(0,Pr.jsx)(ya,{value:g.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:g.label},g.value))})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Pr.jsx)("input",{type:"number",min:"1",max:"100",value:e.points||1,onChange:g=>i("points",g.target.value),className:"w-full h-8 px-2 text-xs border border-border rounded-md 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,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Pr.jsx)(wo,{label:"",value:e.epicId,onValueChange:g=>i("epicId",g),options:(t||[]).map(g=>({value:g.id,label:g?.name,color:g.color})),showColor:!0,disabled:s})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Pr.jsx)(wo,{label:"",value:e.sprintId||"none",onValueChange:g=>i("sprintId",g==="none"?"":g),options:[{value:"none",label:"No Sprint"},...(o||[]).map(g=>({value:g.id,label:`${g?.name}${g.isActive?" (Active)":""}`}))],disabled:s})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Pr.jsx)(Ci,{label:"",value:e.assignee?.value?.name,onValueChange:g=>i("assignee",g),options:d.map(g=>({value:`${typeof g.email=="string"?"users":"digital-colleagues"}:${g.id}`,label:g?.name})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,Pr.jsxs)("div",{className:"Mt-auto Pr-4 space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(x,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:s||c,children:"Close"}),h()]}),(0,Pr.jsxs)("div",{className:"Pr-4 border-t border-border space-y-2",children:[(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.User,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:"System"})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.Clock,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:[new Date(a).toLocaleDateString()," at"," ",new Date(a).toLocaleTimeString()]})]})]})]})]})]})};var Di=({isOpen:e,onClose:t,initialTask:o,epics:a,sprints:i,onUpdateTask:r,onDeleteTask:m,onAddComment:s,colleagues:c})=>{let[n,d]=(0,Mt.useState)(o),[p,h]=(0,Mt.useState)(new Date),[g,y]=(0,Mt.useState)("idle"),[b,f]=(0,Mt.useState)("idle"),[T,z]=(0,Mt.useState)([]);(0,Mt.useEffect)(()=>{d(o)},[o]);let _=async(R,ve)=>{if(ve!==n[R]){y("loading");try{let G=await r(n.id,{[R]:ve});d(G),h(new Date),y("success"),setTimeout(()=>y("idle"),1500)}catch{y("error"),setTimeout(()=>y("idle"),3e3)}}},Z=async(R,ve)=>{if(ve!==n[R]){y("loading");try{let G=await r(n.id,{[R]:ve});d(G),h(new Date),y("success"),setTimeout(()=>y("idle"),1500)}catch{y("error"),setTimeout(()=>y("idle"),3e3)}}},w=async R=>{if(s){y("loading");try{let ve=await s?.({content:R,taskId:n.id});d(ve),h(new Date),y("success"),setTimeout(()=>y("idle"),1500)}catch{y("error"),setTimeout(()=>y("idle"),3e3)}}},V=async()=>{f("loading");try{await m(n.id),f("success"),setTimeout(()=>{t(),f("idle")},1e3)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}},ge=g!=="loading"&&b!=="loading",S=()=>{ge&&t()},ie=()=>g==="loading"?(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Pr.jsx)(yt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Pr.jsx)("span",{children:"Updating..."})]}):g==="success"?(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:"Updated successfully"})]}):g==="error"?(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Pr.jsx)(yt.X,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:"Update failed"})]}):null;return(0,Pr.jsx)(ft,{open:e,onOpenChange:S,children:(0,Pr.jsxs)(lt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Pr.jsxs)(dt,{children:[(0,Pr.jsx)(ct,{className:"sr-only",children:n.name}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("div",{className:"flex-1",children:ie()}),!ge&&(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Pr.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Pr.jsx)(Go,{fieldName:"name",value:n.name,label:"",onSave:_,className:"border-b border-border pb-3",disabled:g==="loading"}),(0,Pr.jsx)(Go,{fieldName:"description",value:n.description,label:"Description",multiline:!0,onSave:_,disabled:g==="loading"}),(0,Pr.jsx)(wi,{comments:(n?.comments||[]).map(R=>({author:R.author.value.name,createdAt:new Date(R.timestamp),text:R.content,id:R.id})),onAddComment:w})]}),(0,Pr.jsx)(ki,{task:n,epics:a,sprints:i,lastUpdated:p,onUpdateTask:Z,onClose:S,onDelete:V,isUpdating:g==="loading",isDeleting:b==="loading",deleteState:b,teamMembers:c})]})]})})};var No=({isOpen:e,onClose:t,onAddEpic:o})=>{let[a,i]=(0,Mt.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"],m=[{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(),a.name.trim()&&(o({name:a.name.trim(),description:a.description.trim(),color:a.color,confidence:a.confidence,phase:a.phase,startDate:new Date(a.startDate),endDate:new Date(a.endDate),progress:a.progress,isSelected:!0}),i({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}),t())},n=(d,p)=>{i(h=>({...h,[d]:p}))};return(0,Pr.jsx)(ft,{open:e,onOpenChange:t,children:(0,Pr.jsxs)(lt,{className:"sm:max-w-md",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Epic"})}),(0,Pr.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",children:"Epic Name"}),(0,Pr.jsx)(U,{id:"name",value:a.name,onChange:d=>n("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:a.description,onChange:d=>n("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Color"}),(0,Pr.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(d=>(0,Pr.jsx)("button",{type:"button",onClick:()=>n("color",d),className:`w-8 h-8 rounded-full ${d} ${a.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Confidence"}),(0,Pr.jsxs)(Be,{value:a.confidence,onValueChange:d=>n("confidence",d),children:[(0,Pr.jsx)(Ie,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsx)(Ee,{children:m.map(d=>(0,Pr.jsx)(X,{value:d.value,children:d.label},d.value))})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Phase"}),(0,Pr.jsxs)(Be,{value:a.phase.toString(),onValueChange:d=>n("phase",parseInt(d)),children:[(0,Pr.jsx)(Ie,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsx)(Ee,{children:s.map(d=>(0,Pr.jsx)(X,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Start Date"}),(0,Pr.jsx)(U,{type:"date",value:a.startDate,onChange:d=>n("startDate",d.target.value)})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"End Date"}),(0,Pr.jsx)(U,{type:"date",value:a.endDate,onChange:d=>n("endDate",d.target.value)})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Progress (%)"}),(0,Pr.jsx)(U,{type:"number",min:"0",max:"100",value:a.progress,onChange:d=>n("progress",parseInt(d.target.value)||0)})]}),(0,Pr.jsxs)(Wa,{children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Ti=({initialTasks:e=[],initialEpics:t=[],initialSprints:o=[],initialUsers:a=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:m,onUpdateTask:s,onDeleteTask:c,onTaskClick:n,onAddEpic:d,onAddComment:p})=>{let[h,g]=(0,Mt.useState)(e),[y,b]=(0,Mt.useState)(t),[f,T]=(0,Mt.useState)(o),[z,_]=(0,Mt.useState)(!1),[Z,w]=(0,Mt.useState)(!1),[V,ge]=(0,Mt.useState)(null),[S,ie]=(0,Mt.useState)(null),[R,ve]=(0,Mt.useState)(a),[G,E]=(0,Mt.useState)(i),[se,ze]=(0,Mt.useState)(0),Me=(0,Mt.useRef)(null),we=(0,Mt.useRef)(null),ut=y.filter(j=>!0).map(j=>j.id),st=f.find(j=>j.isSelected);ut.push("no-epic"),(0,Mt.useEffect)(()=>{g(e)},[e]),(0,Mt.useEffect)(()=>{b(t)},[t]),(0,Mt.useEffect)(()=>{T(o)},[o]),(0,Mt.useEffect)(()=>{let j=()=>{if(Me.current){let Xe=Me.current.offsetHeight;ze(Xe)}};j();let fe=new ResizeObserver(j);Me.current&&fe.observe(Me.current);let ke=()=>{setTimeout(j,100)};return window.addEventListener("storage",ke),()=>{fe.disconnect(),window.removeEventListener("storage",ke)}},[]),(0,Mt.useEffect)(()=>{let j=setTimeout(()=>{Me.current&&ze(Me.current.offsetHeight)},300);return()=>clearTimeout(j)},[z,Z]);let Nt=h.filter(j=>{let fe=ut.includes(j.epicId)||!j.epicId;return!st||st.id==="all-tasks"?fe:st.id==="backlog"?fe&&!j.sprintId:fe&&j.sprintId===st.id}),Ve=j=>Nt.filter(fe=>fe.status===j),rt=j=>{let fe={};return y.forEach(ke=>{fe[ke.id]=j.filter(Xe=>Xe.epicId===ke.id)}),fe["no-epic"]=j.filter(ke=>!ke.epicId),fe},At=j=>{ie(j)},bt=j=>{S&&(g(fe=>fe.map(ke=>ke.id===S.id?{...ke,status:j}:ke)),s?.(S.id,{status:j}),ie(null))},ht=j=>{let fe={...j,id:Date.now().toString(),createdAt:new Date};g(ke=>[...ke,fe]),m?.(j)},It=async(j,fe)=>{g(Xe=>Xe.map(v=>v.id===j?{...v,...fe}:v)),s&&await s(j,fe);let ke=h.find(Xe=>Xe.id===j);if(!ke)throw new Error("Task not found");return{...ke,...fe}},C=async j=>{g(fe=>fe.filter(ke=>ke.id!==j)),V?.id===j&&ge(null),c&&await c(j)},Fe=j=>{let fe={...j,id:Date.now().toString(),isSelected:!0};b(ke=>[...ke,fe]),d?.(j)},xe=j=>{ge(j),n?.(j)},Ct=[{id:"todo",title:"Bo Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Lt=se>0?`calc(100vh - ${se+120}px)`:"calc(100vh - 12rem)";return(0,Pr.jsxs)("div",{ref:we,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Pr.jsx)("div",{ref:Me,className:"flex-shrink-0",children:(0,Pr.jsx)(Qe,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>_(!0)},secondaryAction:{label:"Add epic",onClick:()=>w(!0)}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 Mt-8",children:(0,Pr.jsx)("div",{className:"h-full",style:{height:se>0?`calc(100vh - ${se+120}px)`:"calc(100vh - 12rem)"},children:(0,Pr.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Ct.map(j=>{let fe=Ve(j.status),ke=rt(fe);return(0,Pr.jsx)(pi,{title:j.title,status:j.status,taskCount:fe.length,onDrop:bt,isCompact:j.status==="done",height:Lt,children:ut.map(Xe=>{let v=y.find(ne=>ne.id===Xe),L=ke[Xe]||[];return L.length===0?null:(0,Pr.jsxs)("div",{className:"mb-6",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${v?.color}`}),(0,Pr.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:v?.name||"No Epic"}),(0,Pr.jsx)(W,{variant:"secondary",className:"text-xs",children:L.length})]})," ",(0,Pr.jsx)("div",{className:"space-y-3",children:L.map(ne=>(0,Pr.jsx)(ho,{task:ne,epic:v,onDragStart:At,onTaskClick:xe,isCompact:j.status==="done"},ne.id))})]},Xe)})},j.id)})})})}),(0,Pr.jsx)(xo,{isOpen:z,onClose:()=>_(!1),onAddTask:ht,assignees:[...G,...R],epics:y,sprints:f}),(0,Pr.jsx)(No,{isOpen:Z,onClose:()=>w(!1),onAddEpic:Fe}),V&&(0,Pr.jsx)(Di,{isOpen:!!V,onClose:()=>ge(null),initialTask:V,epics:y,sprints:f,onUpdateTask:It,onDeleteTask:C,colleagues:[...G,...R],onAddComment:p})]})};var Pi=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:m,onUpdateEpic:s,onDeleteEpic:c})=>{let[n,d]=(0,Mt.useState)(null),[p,h]=(0,Mt.useState)(null),[g,y]=(0,Mt.useState)({}),[b,f]=(0,Mt.useState)(0),T=(0,Mt.useRef)(null),z=(0,Mt.useRef)(null);(0,Mt.useEffect)(()=>{let E=()=>{if(T.current){let Me=T.current.offsetHeight;f(Me)}};E();let se=new ResizeObserver(E);T.current&&se.observe(T.current);let ze=()=>{setTimeout(E,100)};return window.addEventListener("storage",ze),()=>{se.disconnect(),window.removeEventListener("storage",ze)}},[]),(0,Mt.useEffect)(()=>{let E=setTimeout(()=>{T.current&&f(T.current.offsetHeight)},300);return()=>clearTimeout(E)},[p]);let _=E=>{d(E)},Z=E=>{E.preventDefault()},w=(E,se)=>{E.preventDefault(),n&&n.epicId!==se&&(a(n.id,{epicId:se}),d(null))},V=E=>e.filter(se=>se.epicId===E),ge=E=>{h(E.id),y({name:E.name,description:E.description,confidence:E.confidence,phase:E.phase,progress:E.progress})},S=()=>{p&&g.name&&(s(p,g),h(null),y({}))},ie=()=>{h(null),y({})},R=E=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&c(E)},ve=E=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[E]||`Phase ${E}`,G=E=>{switch(E){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,Pr.jsxs)("div",{ref:z,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Pr.jsx)("div",{ref:T,className:"flex-shrink-0",children:(0,Pr.jsx)(Qe,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-to-r from-rose-600 via-pink-600 to-fuchsia-600",primaryAction:{label:"Add epic",onClick:m}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 Mt-8",children:(0,Pr.jsx)("div",{className:"h-full overflow-y-auto",style:{height:b>0?`calc(100vh - ${b+120}px)`:"calc(100vh - 12rem)"},children:(0,Pr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:t.map(E=>{let se=V(E.id),ze=se.reduce((we,ut)=>we+ut.points,0),Me=b>0?`calc(100vh - ${b+200}px)`:"calc(100vh - 14rem)";return(0,Pr.jsxs)(F,{className:`flex flex-col ${p===E.id?"h-auto":""} bg-card shadow-sm`,style:{height:p===E.id?"auto":Me,minHeight:"400px"},onDragOver:Z,onDrop:we=>w(we,E.id),children:[(0,Pr.jsx)("div",{className:"p-4 border-b border-border",children:p===E.id?(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)(U,{value:g.name||"",onChange:we=>y({...g,name:we.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Pr.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:S,className:"p-1 h-8 w-8",children:(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"})}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:ie,className:"p-1 h-8 w-8",children:(0,Pr.jsx)(yt.X,{className:"h-4 w-4"})})]})]}),(0,Pr.jsx)(ye,{value:g.description||"",onChange:we=>y({...g,description:we.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Pr.jsxs)("select",{value:g.confidence||E.confidence,onChange:we=>y({...g,confidence:we.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs 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,Pr.jsx)("option",{value:"low",children:"Low"}),(0,Pr.jsx)("option",{value:"medium",children:"Medium"}),(0,Pr.jsx)("option",{value:"high",children:"High"})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Pr.jsx)("select",{value:g.phase?.toString()||E.phase.toString(),onChange:we=>y({...g,phase:parseInt(we.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs 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(we=>(0,Pr.jsxs)("option",{value:we.toString(),children:["Phase ",we]},we))})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Progress (%)"}),(0,Pr.jsx)(U,{type:"number",min:"0",max:"100",value:g.progress||E.progress,onChange:we=>y({...g,progress:parseInt(we.target.value)||0}),className:"text-xs"})]})]}):(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Pr.jsx)("div",{className:`w-4 h-4 rounded-full ${E.color}`}),(0,Pr.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:E.name}),(0,Pr.jsxs)("div",{className:"flex gap-1",children:[(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>ge(E),className:"p-1 h-8 w-8",children:(0,Pr.jsx)(yt.Edit2,{className:"h-3 w-3"})}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>R(E.id),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Pr.jsxs)(W,{className:`text-xs ${G(E.confidence)}`,children:[E.confidence," confidence"]}),(0,Pr.jsxs)(W,{variant:"outline",className:"text-xs",children:["Phase ",E.phase]}),(0,Pr.jsxs)(W,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[se.length," tasks"]}),(0,Pr.jsxs)(W,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[ze," pts"]})]}),E.description&&(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:E.description}),(0,Pr.jsxs)("div",{className:"mb-3",children:[(0,Pr.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground mb-1",children:[(0,Pr.jsx)("span",{className:"select-none",children:"Progress"}),(0,Pr.jsxs)("span",{className:"select-none",children:[E.progress,"%"]})]}),(0,Pr.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,Pr.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${E.progress}%`}})})]}),(0,Pr.jsxs)(x,{onClick:()=>r(E.id),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Pr.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Pr.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${n?"border-primary bg-primary/10":"border-border"}`,children:se.length===0?(0,Pr.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,Pr.jsx)(yt.Move,{className:"h-8 w-8 mb-2"}),(0,Pr.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):se.map(we=>(0,Pr.jsx)(ho,{task:we,epic:E,onDragStart:_,onTaskClick:i,isCompact:!0},we.id))})})]},E.id)})})})})]})};var Ri=require("react-day-picker");function Co({className:e,classNames:t,showOutsideDays:o=!0,...a}){return(0,Pr.jsx)(Ri.DayPicker,{showOutsideDays:o,weekStartsOn:1,className:k("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 Pr-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:k(ao({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-md w-8 font-normal text-[0.8rem]",row:"flex w-full Mt-2",cell:k("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-md",a.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-Pr-md first:[&:has([aria-selected])]:rounded-Pr-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:k(ao({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},...a})}Co.displayName="Calendar";var Ii=Ne(require("react")),Ht=Ne(require("@radix-yt/react-popover"));var qo=Ht.Root,Xo=Ht.Trigger;var ko=Ii.forwardRef(({className:e,align:t="center",sideOffset:o=4,...a},i)=>(0,Pr.jsx)(Ht.Portal,{children:(0,Pr.jsx)(Ht.Content,{ref:i,align:t,sideOffset:o,className:k("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md 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),...a})}));ko.displayName=Ht.Content.displayName;var Zo=require("date-fns");var Mi=({isOpen:e,onClose:t,onAddSprint:o})=>{let[a,i]=(0,Mt.useState)({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),r=s=>{s.preventDefault(),!(!a.name||!a.startDate||!a.endDate)&&(o({name:a.name,description:a.description,startDate:a.startDate,endDate:a.endDate,isActive:a.isActive,isSelected:!1}),i({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t())},m=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t()};return(0,Pr.jsx)(ft,{open:e,onOpenChange:m,children:(0,Pr.jsxs)(lt,{className:"sm:max-w-md",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Sprint"})}),(0,Pr.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",children:"Sprint Name *"}),(0,Pr.jsx)(U,{id:"name",value:a.name,onChange:s=>i(c=>({...c,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:a.description,onChange:s=>i(c=>({...c,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Start Date *"}),(0,Pr.jsxs)(qo,{children:[(0,Pr.jsx)(Xo,{asChild:!0,children:(0,Pr.jsxs)(x,{variant:"outline",className:k("w-full justify-start text-left font-normal",!a.startDate&&"text-muted-foreground"),children:[(0,Pr.jsx)(yt.CalendarIcon,{className:"mr-2 h-4 w-4"}),a.startDate?(0,Zo.format)(a.startDate,"PPP"):"Pick a date"]})}),(0,Pr.jsx)(ko,{className:"w-auto p-0",align:"start",children:(0,Pr.jsx)(Co,{mode:"single",selected:a.startDate,onSelect:s=>i(c=>({...c,startDate:s})),initialFocus:!0})})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"End Date *"}),(0,Pr.jsxs)(qo,{children:[(0,Pr.jsx)(Xo,{asChild:!0,children:(0,Pr.jsxs)(x,{variant:"outline",className:k("w-full justify-start text-left font-normal",!a.endDate&&"text-muted-foreground"),children:[(0,Pr.jsx)(yt.CalendarIcon,{className:"mr-2 h-4 w-4"}),a.endDate?(0,Zo.format)(a.endDate,"PPP"):"Pick a date"]})}),(0,Pr.jsx)(ko,{className:"w-auto p-0",align:"start",children:(0,Pr.jsx)(Co,{mode:"single",selected:a.endDate,onSelect:s=>i(c=>({...c,endDate:s})),initialFocus:!0,disabled:s=>a.startDate?s<a.startDate:!1})})]})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)("input",{type:"checkbox",id:"isActive",checked:a.isActive,onChange:s=>i(c=>({...c,isActive:s.target.checked})),className:"rounded border-gray-300"}),(0,Pr.jsx)(D,{htmlFor:"isActive",children:"Set as active sprint"})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-3 Pr-4",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:m,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",disabled:!a.name||!a.startDate||!a.endDate,children:"Add Sprint"})]})]})]})})};var Do=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:i,onAddSprint:r,onUpdateSprint:m,onDeleteSprint:s})=>{let[c,n]=(0,Mt.useState)([]),[d,p]=(0,Mt.useState)(new Set),[h,g]=(0,Mt.useState)(null),[y,b]=(0,Mt.useState)(!1),[f,T]=(0,Mt.useState)(null),[z,_]=(0,Mt.useState)(null),[Z,w]=(0,Mt.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[V,ge]=(0,Mt.useState)("upcoming"),[S,ie]=(0,Mt.useState)(!1),[R,ve]=(0,Mt.useState)(0),G=(0,Mt.useRef)(null),E=(0,Mt.useRef)(null);(0,Mt.useEffect)(()=>{let v=()=>{G.current&&ve(G.current.offsetHeight)};v();let L=new ResizeObserver(v);return G.current&&L.observe(G.current),()=>L.disconnect()},[]);let se=v=>t.find(L=>L.id===v),ze=v=>o.find(L=>L.id===v),Me=v=>{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[v]||L.medium},we=v=>{let L=v.trim().split(" ");if(L.length===1)return L[0];let ne=L[0],be=L[L.length-1][0].toUpperCase();return`${ne} ${be}`},ut=v=>{let L={},ne=[];return v.forEach(be=>{be.epicId?(L[be.epicId]||(L[be.epicId]=[]),L[be.epicId].push(be)):ne.push(be)}),{tasksByEpic:L,unassignedTasks:ne}},st=o.filter(v=>v.id!=="backlog"&&v.id!=="all-tasks"),Nt=st.filter(v=>{switch(V){case"active":return v.isActive;case"upcoming":return!v.isActive;default:return!0}}),Ve=st.filter(v=>c.includes(v.id)),rt=e.filter(v=>!v.sprintId||v.sprintId==="backlog"||v.sprintId==="Backlog"),At=rt.reduce((v,L)=>v+(L.points||0),0),bt=v=>{n(L=>L.includes(v)?L.filter(ne=>ne!==v):L.length<3?[...L,v]:L)},ht=v=>{p(L=>{let ne=new Set(L);return ne.has(v)?ne.delete(v):ne.add(v),ne})},It=v=>{r(v),b(!1)},C=v=>{_(v.id),w({name:v.name,description:v.description||"",startDate:v.startDate instanceof Date?v.startDate.toISOString().split("T")[0]:v.startDate,endDate:v.endDate instanceof Date?v.endDate.toISOString().split("T")[0]:v.endDate,isActive:v.isActive})},Fe=()=>{z&&(m(z,{name:Z.name,description:Z.description,startDate:new Date(Z.startDate),endDate:new Date(Z.endDate),isActive:Z.isActive}),_(null))},xe=()=>{_(null),w({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Ct=(v,L)=>{g(L),v.dataTransfer.effectAllowed="move"},Lt=v=>{v.preventDefault(),v.dataTransfer.dropEffect="move"},j=v=>{T(v)},fe=()=>{T(null)},ke=(v,L)=>{if(v.preventDefault(),T(null),!h)return;let ne=h.sprintId||void 0,be=L==="backlog"?void 0:L;ne!==be&&a(h.id,{sprintId:be}),g(null)},Xe=({task:v,showSprint:L=!1})=>{let ne=v.epicId?se(v.epicId):null,be=v.sprintId?ze(v.sprintId):null;return(0,Pr.jsx)(F,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:nt=>{nt.dataTransfer.effectAllowed="move",nt.dataTransfer.setData("text/plain",v.id),Ct(nt,v)},onClick:nt=>{h===null&&i(v)},style:{userSelect:"none"},children:(0,Pr.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Pr.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Pr.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:v.name}),(0,Pr.jsx)(W,{className:`text-xs ${Me(v.priority)}`,children:v.priority[0].toUpperCase()})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[ne&&(0,Pr.jsx)("div",{className:`w-2 h-2 rounded-full ${ne.color}`}),(0,Pr.jsx)("span",{className:"text-muted-foreground truncate",children:ne?.name})]}),(0,Pr.jsx)("span",{className:"text-muted-foreground",children:we(v.assignee?.value?.name)})]}),L&&be&&(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:be.name})]})]})})};return(0,Pr.jsxs)("div",{ref:E,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Pr.jsx)("div",{ref:G,className:"flex-shrink-0",children:(0,Pr.jsx)(Qe,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-to-r from-orange-600 via-amber-600 to-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>b(!0)}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 Mt-8",children:(0,Pr.jsxs)("div",{className:"h-full",style:{height:R>0?`calc(100vh - ${R+120}px)`:"calc(100vh - 12rem)"},children:[(0,Pr.jsxs)("div",{className:"mb-4",children:[(0,Pr.jsx)(F,{className:"p-3 bg-card shadow-sm",children:(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsx)("div",{children:(0,Pr.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"})}),c.length>0&&(0,Pr.jsx)("div",{className:"flex items-center gap-2",children:(0,Pr.jsx)("div",{className:"flex flex-wrap gap-1",children:Ve.map(v=>(0,Pr.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Pr.jsx)("span",{className:"max-w-[80px] truncate",children:v.name}),v.isActive&&(0,Pr.jsx)("span",{className:"text-success text-[10px]",children:"\u25CF"}),(0,Pr.jsx)("button",{onClick:()=>bt(v.id),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Pr.jsx)(yt.X,{className:"h-4 w-4"})})]},v.id))})})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsxs)(x,{onClick:()=>b(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Pr.jsx)(yt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Pr.jsxs)(x,{onClick:()=>ie(!S),variant:"outline",size:"sm",className:"gap-1",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),S?"Close":"Select"]})]})]})}),S&&(0,Pr.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>ie(!1)}),(0,Pr.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-Pr shadow-xl z-10 transition-all duration-300 ease-in-out ${S?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Pr.jsxs)(F,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Pr.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Pr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>ie(!1),className:"h-8 w-8 p-0",children:(0,Pr.jsx)(yt.X,{className:"h-4 w-4"})})]}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground Mt-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Pr.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Pr.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:o.length},{key:"active",label:"Active",count:o.filter(v=>v.isActive).length},{key:"upcoming",label:"Upcoming",count:o.filter(v=>!v.isActive).length}].map(v=>(0,Pr.jsxs)(x,{variant:V===v.key?"default":"outline",size:"sm",onClick:()=>ge(v.key),className:"text-xs h-8 px-3 flex-1",children:[v.label," (",v.count,")"]},v.key))}),(0,Pr.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:Nt.length>0?Nt.map(v=>{let L=c.includes(v.id),ne=e.filter(Je=>Je.sprintId===v.id).length,be=!L&&c.length<3;return(0,Pr.jsx)("div",{className:`p-3 rounded-lg border transition-all ${L?"bg-primary/10 border-primary/30":be?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:z===v.id?(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsx)(U,{value:Z.name,onChange:Je=>w(it=>({...it,name:Je.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Pr.jsx)(ye,{value:Z.description,onChange:Je=>w(it=>({...it,description:Je.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Pr.jsxs)("div",{className:"flex gap-2",children:[(0,Pr.jsxs)(x,{size:"sm",onClick:()=>Fe(),className:"flex-1",children:[(0,Pr.jsx)(yt.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,Pr.jsxs)(x,{size:"sm",variant:"outline",onClick:xe,className:"flex-1",children:[(0,Pr.jsx)(yt.X,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,Pr.jsxs)("div",{children:[(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Pr.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:v.name}),v.isActive&&(0,Pr.jsx)(W,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Pr.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:v.description}),(0,Pr.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Pr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.CalendarDays,{className:"h-3 w-3"}),new Date(v.startDate).toLocaleDateString()]}),(0,Pr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.User,{className:"h-3 w-3"}),ne," tasks"]})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>C(v),className:"h-6 w-6 p-0",children:(0,Pr.jsx)(yt.Edit2,{className:"h-3 w-3"})}),v.id!=="backlog"&&v.id!=="all-tasks"&&(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>s(v.id),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Pr.jsx)("div",{className:"flex items-center justify-between Mt-2",children:(0,Pr.jsx)(x,{variant:L?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>bt(v.id),disabled:!L&&c.length>=3,children:(0,Pr.jsx)("span",{className:"pointer-events-none select-none",children:L?"Deselect":c.length>=3?"Limit Reached":"Select"})})})]})},v.id)}):(0,Pr.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Pr.jsxs)("p",{className:"text-sm",children:['No sprints found for "',V,'" filter']}),(0,Pr.jsx)(x,{variant:"link",size:"sm",onClick:()=>ge("all"),className:"text-xs",children:"Show all sprints"})]})}),c.length===0&&(0,Pr.jsx)("div",{className:"Mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Pr.jsxs)("div",{className:"text-center",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Pr.jsx)("p",{className:"text-xs text-muted-foreground Mt-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Pr.jsx)("div",{className:"lg:col-span-1",children:(0,Pr.jsxs)(F,{className:"p-4 h-full bg-card border-Pr-4 border-Pr-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Lt,onDragEnter:()=>j("backlog"),onDragLeave:fe,onDrop:v=>ke(v,"backlog"),style:{height:R>0?`calc(100vh - ${R+200}px)`:"calc(100vh - 16rem)"},children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Pr.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsxs)(W,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[rt.length," tasks"]}),(0,Pr.jsxs)(W,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[At," pts"]})]})]}),(0,Pr.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${f==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:v,unassignedTasks:L}=ut(rt);return(0,Pr.jsxs)(Pr.Fragment,{children:[Object.entries(v).map(([ne,be])=>{let Je=se(ne);if(!Je)return null;let it=d.has(ne);return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht(ne),children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${Je.color}`}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:Je.name}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",be.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:it?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!it&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:be.map(nt=>(0,Pr.jsx)(Xe,{task:nt},nt.id))})]},ne)}),L.length>0&&(()=>{let ne=d.has("no-epic");return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht("no-epic"),children:[(0,Pr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",L.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:ne?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ne&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:L.map(be=>(0,Pr.jsx)(Xe,{task:be},be.id))})]})})(),rt.length===0&&(0,Pr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here to move to backlog"}),rt.length>0&&Object.keys(v).length===0&&L.length===0&&(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),rt.map(ne=>(0,Pr.jsx)(Xe,{task:ne},ne.id))]})]})})()})]})}),Ve.map(v=>{let L=e.filter(be=>be.sprintId===v.id),ne=L.reduce((be,Je)=>be+(Je.points||0),0);return(0,Pr.jsxs)(F,{className:"p-4 h-full bg-card border-Pr-4 border-Pr-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Lt,onDragEnter:()=>j(v.id),onDragLeave:fe,onDrop:be=>ke(be,v.id),style:{height:R>0?`calc(100vh - ${R+200}px)`:"calc(100vh - 16rem)"},children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:v.name}),v.isActive&&(0,Pr.jsx)("span",{className:"text-xs text-success font-medium select-none",children:"Active Sprint"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsxs)(W,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[L.length," tasks"]}),(0,Pr.jsxs)(W,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200",children:[ne," pts"]}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>C(v),className:"h-6 px-2",children:(0,Pr.jsx)(yt.Edit2,{className:"h-3 w-3"})}),v.id!=="backlog"&&v.id!=="all-tasks"&&(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>s(v.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Pr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:be,unassignedTasks:Je}=ut(L);return(0,Pr.jsxs)(Pr.Fragment,{children:[Object.entries(be).map(([it,nt])=>{let Ma=se(it);if(!Ma)return null;let Fa=d.has(it);return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht(it),children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${Ma.color}`}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:Ma.name}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",nt.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:Fa?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Fa&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:nt.map(Ba=>(0,Pr.jsx)(Xe,{task:Ba},Ba.id))})]},it)}),Je.length>0&&(()=>{let it=d.has("no-epic");return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht("no-epic"),children:[(0,Pr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",Je.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:it?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!it&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:Je.map(nt=>(0,Pr.jsx)(Xe,{task:nt},nt.id))})]})})(),L.length===0&&(0,Pr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},v.id)})]}),(0,Pr.jsx)(Mi,{isOpen:y,onClose:()=>b(!1),onAddSprint:It})]})})]})};var hn=e=>{switch(e){case"high":return"\Pr{1F534}";case"medium":return"\Pr{1F7E1}";case"low":return"\Pr{1F7E2}";default:return"\u26AA"}},bn=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),xn=e=>{let[t,o]=e.split(":"),a=new Date;return a.setHours(parseInt(t),parseInt(o)),a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},Yo=(e,t)=>{let o=new Date,a=new Date(e);if(t){let[i,r]=t.split(":");a.setHours(parseInt(i),parseInt(r))}return a<o},Qo=e=>{let t=new Date;return e.toDateString()===t.toDateString()},yn=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},wn=({colleagues:e,onAddReminder:t,open:o,setOpen:a})=>{let[i,r]=(0,Mt.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[m,s]=(0,Mt.useState)(!1),c=d=>{d.preventDefault();let p=e.find(g=>g?.id.toString()===i.colleagueId.toString());if(!p){console.error("No valid colleague selected"),s(!0);return}s(!1);let h={title:i.title,description:i.description,dueDate:new Date(i.dueDate),dueTime:i.dueTime||void 0,colleague:p,isCompleted:!1,isRecurring:i.isRecurring,recurrencePattern:i.isRecurring?i.recurrencePattern:void 0,recurrenceInterval:i.isRecurring?i.recurrenceInterval:void 0,priority:i.priority,reminderEnabled:i.reminderEnabled,reminderMinutes:i.reminderEnabled?i.reminderMinutes:void 0,tags:i.tags?i.tags.split(",").map(g=>g.trim()):void 0};t(h),a(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Mt.useEffect)(()=>{i.colleagueId&&s(!1)},[i.colleagueId]);let n=e.filter(Boolean);return(0,Pr.jsx)(ft,{open:o,onOpenChange:a,children:(0,Pr.jsxs)(lt,{className:"max-w-2xl",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Reminder"})}),(0,Pr.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,Pr.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"title",children:"Title"}),(0,Pr.jsx)(U,{id:"title",value:i.title,onChange:d=>r({...i,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:i.description,onChange:d=>r({...i,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"dueDate",children:"Due Date"}),(0,Pr.jsx)(U,{id:"dueDate",type:"date",value:i.dueDate,onChange:d=>r({...i,dueDate:d.target.value}),required:!0})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Pr.jsx)(U,{id:"dueTime",type:"time",value:i.dueTime,onChange:d=>r({...i,dueTime:d.target.value})})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{className:`${m?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Pr.jsxs)(Be,{value:i.colleagueId,onValueChange:d=>{r({...i,colleagueId:d})},required:!0,children:[(0,Pr.jsx)(Ie,{className:`${m?"text-destructive border-red-500":""}`,children:(0,Pr.jsx)($e,{className:`${m?"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,Pr.jsx)(Ee,{children:n.map(d=>(0,Pr.jsx)(X,{value:d.id,children:d.name},d.id))})]}),m&&(0,Pr.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:d=>r({...i,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Pr.jsx)(D,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Pr.jsxs)(Be,{value:i.recurrencePattern,onValueChange:d=>r({...i,recurrencePattern:d}),children:[(0,Pr.jsx)(Ie,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsx)(X,{value:"daily",children:"Daily"}),(0,Pr.jsx)(X,{value:"weekly",children:"Weekly"}),(0,Pr.jsx)(X,{value:"monthly",children:"Monthly"}),(0,Pr.jsx)(X,{value:"yearly",children:"Yearly"})]})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Pr.jsx)(U,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:d=>r({...i,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,Pr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",children:"Add Reminder"})]})]})]})})},Nn=({reminder:e,colleagues:t,onUpdateReminder:o,open:a,onClose:i})=>{let[r,m]=(0,Mt.useState)({title:e.title,description:e.description,dueDate:e.dueDate.toISOString().split("T")[0],dueTime:e.dueTime||"",colleagueId:e.colleague?.id||"",priority:e.priority,isRecurring:e.isRecurring,recurrencePattern:e.recurrencePattern||"weekly",recurrenceInterval:e.recurrenceInterval||1,reminderEnabled:e.reminderEnabled,reminderMinutes:e.reminderMinutes||15,tags:e.tags?.join(", ")||""}),s=n=>{n.preventDefault();let d=t.find(p=>p?.id===r.colleagueId);if(!d){console.error("No valid colleague selected");return}o(e.id,{title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:d,priority:r.priority,isRecurring:r.isRecurring,recurrencePattern:r.isRecurring?r.recurrencePattern:void 0,recurrenceInterval:r.isRecurring?r.recurrenceInterval:void 0,reminderEnabled:r.reminderEnabled,reminderMinutes:r.reminderEnabled?r.reminderMinutes:void 0,tags:r.tags?r.tags.split(",").map(p=>p.trim()):void 0}),i()},c=t.filter(Boolean);return(0,Pr.jsx)(ft,{open:a,onOpenChange:i,children:(0,Pr.jsxs)(lt,{className:"max-w-2xl",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Edit Reminder"})}),(0,Pr.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-title",children:"Title"}),(0,Pr.jsx)(U,{id:"edit-title",value:r.title,onChange:n=>m({...r,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-priority",children:"Priority"}),(0,Pr.jsxs)(Be,{value:r.priority,onValueChange:n=>m({...r,priority:n}),children:[(0,Pr.jsx)(Ie,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsx)(X,{value:"low",children:"\Pr{1F7E2} Low"}),(0,Pr.jsx)(X,{value:"medium",children:"\Pr{1F7E1} Medium"}),(0,Pr.jsx)(X,{value:"high",children:"\Pr{1F534} High"})]})]})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-description",children:"Description"}),(0,Pr.jsx)(ye,{id:"edit-description",value:r.description,onChange:n=>m({...r,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Pr.jsx)(U,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:n=>m({...r,dueDate:n.target.value}),required:!0})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Pr.jsx)(U,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:n=>m({...r,dueTime:n.target.value})})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-colleague",children:"Assigned Colleague"}),(0,Pr.jsxs)(Be,{value:r.colleagueId,onValueChange:n=>m({...r,colleagueId:n}),required:!0,children:[(0,Pr.jsx)(Ie,{children:(0,Pr.jsx)($e,{placeholder:"Select a digital colleague"})}),(0,Pr.jsx)(Ee,{children:c.map(n=>(0,Pr.jsx)(X,{value:n.id,children:n.name},n.id))})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring,onChange:n=>m({...r,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,Pr.jsx)(D,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-recurrencePattern",children:"Frequency"}),(0,Pr.jsxs)(Be,{value:r.recurrencePattern,onValueChange:n=>m({...r,recurrencePattern:n}),children:[(0,Pr.jsx)(Ie,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsx)(X,{value:"daily",children:"Daily"}),(0,Pr.jsx)(X,{value:"weekly",children:"Weekly"}),(0,Pr.jsx)(X,{value:"monthly",children:"Monthly"}),(0,Pr.jsx)(X,{value:"yearly",children:"Yearly"})]})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-recurrenceInterval",children:"Every"}),(0,Pr.jsx)(U,{id:"edit-recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:n=>m({...r,recurrenceInterval:parseInt(n.target.value)})})]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)("input",{type:"checkbox",id:"edit-reminderEnabled",checked:r.reminderEnabled,onChange:n=>m({...r,reminderEnabled:n.target.checked}),className:"rounded border-border"}),(0,Pr.jsx)(D,{htmlFor:"edit-reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,Pr.jsxs)("div",{className:"pl-6",children:[(0,Pr.jsx)(D,{htmlFor:"edit-reminderMinutes",children:"Remind me"}),(0,Pr.jsxs)(Be,{value:r.reminderMinutes.toString(),onValueChange:n=>m({...r,reminderMinutes:parseInt(n)}),children:[(0,Pr.jsx)(Ie,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsx)(X,{value:"5",children:"5 minutes before"}),(0,Pr.jsx)(X,{value:"15",children:"15 minutes before"}),(0,Pr.jsx)(X,{value:"30",children:"30 minutes before"}),(0,Pr.jsx)(X,{value:"60",children:"1 hour before"}),(0,Pr.jsx)(X,{value:"1440",children:"1 day before"})]})]})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-tags",children:"Tags (comma-separated)"}),(0,Pr.jsx)(U,{id:"edit-tags",value:r.tags,onChange:n=>m({...r,tags:n.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,Pr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",children:"Save Changes"})]})]})]})})},Cn=({reminder:e,colleagues:t,onUpdateReminder:o,onDeleteReminder:a})=>{let[i,r]=(0,Mt.useState)(!1);if(!e||!e.id)return null;let m=Yo(e.dueDate,e.dueTime),s=Qo(e.dueDate),c=yn(e.dueDate),n=()=>{o(e.id,{isCompleted:!e.isCompleted,completedAt:e.isCompleted?void 0:new Date})},d=()=>s?"Today":c?"Tomorrow":m&&!e.isCompleted?"Overdue":bn(e.dueDate);return(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)(Nn,{reminder:e,colleagues:t,onUpdateReminder:o,open:i,onClose:()=>r(!1)}),(0,Pr.jsx)(F,{className:`transition-all duration-200 ${e.isCompleted?"opacity-60":""} ${m&&!e.isCompleted?"border-destructive/50 bg-destructive/5":""}`,children:(0,Pr.jsx)(re,{className:"p-4",children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Pr.jsx)("button",{onClick:n,className:"Mt-1 text-primary hover:text-primary/80",children:e.isCompleted?(0,Pr.jsx)(yt.CheckCircle,{className:"h-5 w-5"}):(0,Pr.jsx)(yt.Circle,{className:"h-5 w-5"})}),(0,Pr.jsxs)("div",{className:"flex-1",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,Pr.jsx)("h3",{className:`font-semibold ${e.isCompleted?"line-through text-muted-foreground":""}`,children:e.title}),(0,Pr.jsx)("span",{className:"text-sm",children:hn(e.priority)}),e.isRecurring&&(0,Pr.jsx)(yt.Repeat,{className:"h-4 w-4 text-primary"}),e.reminderEnabled&&(0,Pr.jsx)(yt.Bell,{className:"h-4 w-4 text-success"})]}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{className:m&&!e.isCompleted?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Pr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Pr.jsx)(yt.Clock,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:xn(e.dueTime)})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Pr.jsx)(yt.User,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:e.colleague?.name||"Unknown Colleague"})]})]}),e.tags&&e.tags.length>0&&(0,Pr.jsx)("div",{className:"flex flex-wrap gap-1 Mt-2",children:e.tags.map((p,h)=>(0,Pr.jsx)(W,{variant:"secondary",className:"text-xs",children:p},h))})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Pr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,Pr.jsx)(yt.Edit2,{className:"h-4 w-4"})}),(0,Pr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>a(e.id),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Pr.jsx)(yt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Fi=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:o,onUpdateReminder:a,onDeleteReminder:i})=>{let[r,m]=(0,Mt.useState)(e.filter(Boolean)),[s]=(0,Mt.useState)(t.filter(Boolean)),[c,n]=(0,Mt.useState)("all"),[d,p]=(0,Mt.useState)(""),[h,g]=(0,Mt.useState)(!1),y=w=>{if(!w.title||!w.colleague?.id){console.error("Invalid reminder data:",w);return}let V={...w,id:Date.now().toString(),createdAt:new Date};m(ge=>[...ge,V]),o?.(w)},b=(w,V)=>{if(!w){console.error("No reminder ID provided for update");return}m(ge=>ge.map(S=>S?.id===w?{...S,...V}:S)),a?.(w,V)},f=w=>{if(!w){console.error("No reminder ID provided for deletion");return}m(V=>V.filter(ge=>ge?.id!==w)),i?.(w)},z=r.filter(w=>{if(!w)return!1;if(d){let V=d.toLowerCase();if(!(w.title.toLowerCase().includes(V)||w.description.toLowerCase().includes(V)||w.colleague?.name?.toLowerCase().includes(V)||w.tags?.some(S=>S.toLowerCase().includes(V))))return!1}switch(c){case"pending":return!w.isCompleted;case"completed":return w.isCompleted;case"overdue":return!w.isCompleted&&Yo(w.dueDate,w.dueTime);case"today":return Qo(new Date(w.dueDate));default:return!0}}).sort((w,V)=>{if(!w||!V)return 0;if(w.isCompleted&&!V.isCompleted)return 1;if(!w.isCompleted&&V.isCompleted)return-1;let ge={high:3,medium:2,low:1},S=ge[V.priority]-ge[w.priority];return S!==0?S:w.dueDate.getTime()-V.dueDate.getTime()}),_={total:r.filter(Boolean).length,pending:r.filter(w=>w&&!w.isCompleted).length,completed:r.filter(w=>w&&w.isCompleted).length,overdue:r.filter(w=>w&&!w.isCompleted&&Yo(w.dueDate,w.dueTime)).length,today:r.filter(w=>w&&Qo(new Date(w.dueDate))).length},Z=s.find(Boolean)||{id:"1",name:"Default Colleague",status:"active",joinedDate:new Date,lastActive:new Date,type:"digital",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:[],version:"1.0.0",lastUpdated:new Date,isActive:!0};return(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Pr.jsx)(Qe,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{g(!0)}}}),(0,Pr.jsxs)("div",{className:"h-full bg-background",children:[(0,Pr.jsx)(wn,{colleagues:s,onAddReminder:y,open:h,setOpen:g}),(0,Pr.jsxs)("div",{className:"p-6",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Pr.jsxs)(x,{className:"flex items-center space-x-2",onClick:()=>g(!0),children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:"Add Reminder"})]})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Pr.jsxs)(F,{className:"p-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-foreground",children:_.total}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Pr.jsxs)(F,{className:"p-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-primary",children:_.pending}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Pr.jsxs)(F,{className:"p-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-success",children:_.completed}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Pr.jsxs)(F,{className:"p-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-destructive",children:_.overdue}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Pr.jsxs)(F,{className:"p-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-warning",children:_.today}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsx)(U,{placeholder:"Search reminders...",value:d,onChange:w=>p(w.target.value),className:"max-w-md"})}),(0,Pr.jsxs)(Be,{value:c,onValueChange:w=>n(w),children:[(0,Pr.jsx)(Ie,{className:"w-40",children:(0,Pr.jsx)($e,{})}),(0,Pr.jsxs)(Ee,{children:[(0,Pr.jsxs)(X,{value:"all",children:["All (",_.total,")"]}),(0,Pr.jsxs)(X,{value:"pending",children:["Pending (",_.pending,")"]}),(0,Pr.jsxs)(X,{value:"completed",children:["Completed (",_.completed,")"]}),(0,Pr.jsxs)(X,{value:"overdue",children:["Overdue (",_.overdue,")"]}),(0,Pr.jsxs)(X,{value:"today",children:["Today (",_.today,")"]})]})]})]}),(0,Pr.jsx)("div",{className:"space-y-4",children:z.length===0?(0,Pr.jsxs)(F,{className:"p-8 text-center",children:[(0,Pr.jsx)("div",{className:"text-muted-foreground",children:d||c!=="all"?"No reminders match your filters":"No reminders yet"}),!d&&c==="all"&&(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground/60 Mt-2",children:"Create your first reminder to get started"})]}):z.map(w=>w&&(0,Pr.jsx)(Cn,{reminder:w,colleagues:s,onUpdateReminder:b,onDeleteReminder:f},w.id))})]})]})]})};var Bi=require("next/navigation");function er({title:e="",initialTasks:t=[],initialEpics:o=[],initialSprints:a=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:m=[],initialUsers:s=[],initialFiles:c=[],initialView:n="kanban",onAddTask:d,onUpdateTask:p,onDeleteTask:h,onTaskClick:g,onAddEpic:y,onUpdateEpic:b,onDeleteEpic:f,onAddTaskToEpic:T,onAddSprint:z,onUpdateSprint:_,onDeleteSprint:Z,onAddProject:w,onUpdateProject:V,onDeleteProject:ge,onFileAdd:S,onFileEdit:ie,onFileDelete:R,onFileClick:ve,onAddReminder:G,onUpdateReminder:E,onDeleteReminder:se,onViewChange:ze,onToggleMobileMenu:Me,onTeamClick:we,onTeamChange:ut,onCopilotClick:st,handleAddComment:Nt}){let[Ve,rt]=(0,Mt.useState)(t),[At,bt]=(0,Mt.useState)(o),[ht,It]=(0,Mt.useState)(a),[C,Fe]=(0,Mt.useState)(i),[xe,Ct]=(0,Mt.useState)(r),[Lt,j]=(0,Mt.useState)(m),[fe,ke]=(0,Mt.useState)(s),[Xe,v]=(0,Mt.useState)(c),[L,ne]=(0,Mt.useState)(!1),[be,Je]=(0,Mt.useState)(!1),[it,nt]=(0,Mt.useState)(null),[Ma,Fa]=(0,Mt.useState)(null),[Ba,dr]=(0,Mt.useState)(null),[ia,cr]=(0,Mt.useState)(n||"kanban"),[Dn,_i]=(0,Mt.useState)(!1),mr=(0,Bi.useRouter)();(0,Mt.useEffect)(()=>{rt(t)},[t]),(0,Mt.useEffect)(()=>{It(a)},[a]),(0,Mt.useEffect)(()=>{bt(o)},[o]),(0,Mt.useEffect)(()=>{Fe(i)},[i]),(0,Mt.useEffect)(()=>{v(c)},[c]),(0,Mt.useEffect)(()=>{ke(s)},[s]),(0,Mt.useEffect)(()=>{j(m)},[m]),(0,Mt.useEffect)(()=>{Ct(r)},[r]),(0,Mt.useEffect)(()=>{cr(n)},[n]);let qi=At.filter(N=>N.isSelected).map(N=>N.id),Qa=ht.find(N=>N.isSelected),Xi=Ve.filter(N=>{let A=qi.includes(N.epicId);return!Qa||Qa.id==="all-tasks"?A:Qa.id==="backlog"?A&&!N.sprintId:A&&N.sprintId===Qa.id}),Sn=N=>Xi.filter(A=>A.status===N),Tn=N=>{let A={};return At.forEach(Q=>{A[Q.id]=N.filter(De=>De.epicId===Q.id)}),A},Pn=N=>{dr(N)},Rn=N=>{Ba&&(rt(A=>A.map(Q=>Q.id===Ba.id?{...Q,status:N}:Q)),dr(null))},pr=N=>{let A={...N,id:Date.now().toString(),createdAt:new Date};rt(Q=>[...Q,A]),d?.(A)},eo=async(N,A)=>(rt(Q=>Q.map(De=>De.id===N?{...De,...A}:De)),await p?.(N,A)),An=async(N,A)=>{eo(N,A)},ur=N=>{rt(A=>A.filter(Q=>Q.id!==N)),it?.id===N&&nt(null),h?.(N)},In=async N=>{ur(N)},En=N=>{let A={...N,id:Date.now().toString(),isSelected:!1};Fe(Q=>[...Q,A]),w?.(N)},Mn=(N,A)=>{Fe(Q=>Q.map(De=>De.id===N?A.isSelected?(mr.push(`/project/${N}`),{...De,...A}):{...De,...A}:A.isSelected&&N!==De.id?{...De,isSelected:!1}:De)),V?.(N,A)},Fn=N=>{Fe(A=>A.filter(Q=>Q.id!==N)),ge?.(N)},gr=N=>{let A={...N,id:Date.now().toString(),isSelected:!0};bt(Q=>[...Q,A]),y?.({...A})},Ji=()=>{Je(!0)},Zi=(N,A)=>{bt(Q=>Q.map(De=>De.id===N?{...De,...A}:De)),b?.(N,A)},Yi=N=>{bt(A=>A.filter(Q=>Q.id!==N)),rt(A=>A.filter(Q=>Q.epicId!==N)),f?.(N)},Qi=N=>{let A={...N,id:Date.now().toString(),isSelected:!1};It(Q=>[...Q,A]),z?.(N)},es=(N,A)=>{It(Q=>Q.map(De=>De.id===N?A.isSelected?{...De,...A}:{...De,...A}:A.isSelected&&N!==De.id?{...De,isSelected:!1}:De)),_?.(N,A)},ts=N=>{N==="backlog"||N==="all-tasks"||(It(A=>A.filter(Q=>Q.id!==N)),rt(A=>A.map(Q=>Q.sprintId===N?{...Q,sprintId:void 0}:Q)),Z?.(N))},Ao=N=>{nt(N)},as=N=>{N==="planning"&&window.innerWidth<768||(cr(N),ze?.(N))},Bn=()=>{_i(N=>!N),Me?.()},Ln=()=>{mr.push("/")},jn=N=>{console.log("Switching to team:",N)},On=N=>{console.log("Switching to team:",N)},os=N=>{Fa(N),ne(!0)},rs=()=>{ne(!1),Fa(null)},is=N=>{let A={...N,id:Date.now().toString(),createdAt:new Date};Ct(Q=>[...Q,A]),G?.(N)},ss=(N,A)=>{Ct(Q=>Q.map(De=>De.id===N?{...De,...A}:De)),E?.(N,A)},ns=N=>{Ct(A=>A.filter(Q=>Q.id!==N)),se?.(N)},ls=()=>{S?.()},ds=N=>{ie?.(N)},cs=N=>{v(A=>A.filter(Q=>Q.name!==N)),R?.(N)},ms=N=>{ve?.(N)},Hn=[{id:"todo",title:"Bo Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],zn=()=>{switch(ia){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"}},Io=[{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")}],Vn=Io.sort((N,A)=>A.lastUsed.getTime()-N.lastUsed.getTime()).slice(0,3),Un=Io.length>3,Kn=Io.slice(3);return(0,Pr.jsxs)(mi,{currentView:ia,onViewChange:as,children:[ia==="kanban"&&(0,Pr.jsx)("div",{className:"h-full overflow-hidden",children:(0,Pr.jsx)(Ti,{initialProjects:C,initialEpics:At,initialSprints:ht,initialTasks:Ve,initialColleagues:Lt,initialUsers:fe,onAddTask:pr,onUpdateTask:eo,onDeleteTask:ur,onTaskClick:Ao,onAddEpic:gr,onAddComment:Nt})}),ia==="planning"&&(0,Pr.jsx)("div",{className:"hidden md:block h-full",children:(0,Pr.jsx)(Do,{tasks:Ve,epics:At,sprints:ht,onUpdateTask:eo,onTaskClick:Ao,onAddSprint:Qi,onUpdateSprint:es,onDeleteSprint:ts})}),ia==="tasks"&&(0,Pr.jsx)("div",{className:"h-full",children:(0,Pr.jsx)(Fi,{initialReminders:xe,initialColleagues:Lt,onAddReminder:is,onUpdateReminder:ss,onDeleteReminder:ns})}),ia==="files"&&(0,Pr.jsx)("div",{className:"h-full",children:(0,Pr.jsx)($a,{initialFiles:Xe,onFileAdd:ls,onFileEdit:ds,onFileDelete:cs,onFileClick:ms,compactView:!1})}),ia==="epics"&&(0,Pr.jsx)("div",{className:"h-full",children:(0,Pr.jsx)(Pi,{tasks:Ve,epics:At,sprints:ht,onUpdateTask:eo,onTaskClick:Ao,onAddTaskToEpic:os,onAddEpic:Ji,onUpdateEpic:Zi,onDeleteEpic:Yi})}),(0,Pr.jsx)(xo,{isOpen:L,onClose:rs,onAddTask:pr,epics:At,sprints:ht,assignees:[...Lt,...fe],defaultEpicId:Ma||void 0}),(0,Pr.jsx)(No,{isOpen:be,onClose:()=>Je(!1),onAddEpic:gr})]})}var Li=Ne(require("react")),Xa=Ne(require("@radix-yt/react-progress"));var ar=Li.forwardRef(({className:e,value:t,...o},a)=>(0,Pr.jsx)(Xa.Root,{ref:a,className:k("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...o,children:(0,Pr.jsx)(Xa.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ar.displayName=Xa.Root.displayName;function Oi({project:e,onOpen:t,onShare:o,className:a}){return(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Pr.jsxs)(F,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Pr.jsxs)(Se,{children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)(Ae,{children:e.name}),(0,Pr.jsxs)(W,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Pr.jsx)(na,{children:e.description})]}),(0,Pr.jsxs)(re,{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Pr.jsx)("span",{children:"Progress"}),(0,Pr.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Pr.jsx)(ar,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Pr.jsxs)("div",{className:"flex items-center",children:[(0,Pr.jsx)(yt.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,Pr.jsxs)("div",{className:"flex items-center",children:[(0,Pr.jsx)(yt.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Pr.jsxs)(la,{className:"flex gap-2",children:[(0,Pr.jsx)(x,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Pr.jsx)(x,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>o?.(e),children:(0,Pr.jsx)(yt.Share2,{className:"h-4 w-4"})})]})]})})}var Ja=Ne(require("@radix-yt/react-checkbox")),zi=Ne(require("react")),or=zi.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Ja.Root,{className:k("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:o,...t,children:(0,Pr.jsx)(Ja.Indicator,{className:k("flex items-center justify-center text-current"),children:(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"})})}));or.displayName=Ja.Root.displayName;var Vi=({onSubmit:e,onCancel:t,isLoading:o=!1,initialData:a,className:i=""})=>{let[r,m]=(0,Mt.useState)({name:a?.name||"",objectives:a?.objectives||"",workInstructions:a?.workInstructions||"",plan:a?.plan||!1}),[s,c]=(0,Mt.useState)({}),n=()=>{let h={};return r.name.trim()?r.name.trim().length<3&&(h.name="Project name must be 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(g){console.error("Error submitting project form:",g)}},p=(h,g)=>{m(y=>({...y,[h]:g})),s[h]&&c(y=>({...y,[h]:void 0}))};return(0,Pr.jsxs)(F,{className:`w-full max-w-2xl ${i}`,children:[(0,Pr.jsxs)(Se,{children:[(0,Pr.jsxs)(Ae,{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Pr.jsx)(na,{children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,Pr.jsxs)("form",{onSubmit:d,children:[(0,Pr.jsxs)(re,{className:"space-y-6",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Pr.jsx)(U,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:h=>p("name",h.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:o,maxLength:100}),s.name&&(0,Pr.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Pr.jsx)(ye,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:h=>p("objectives",h.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:o,maxLength:1e3}),(0,Pr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Pr.jsx)("span",{children:s.objectives&&(0,Pr.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,Pr.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Pr.jsx)(ye,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:h=>p("workInstructions",h.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:o,maxLength:2e3}),(0,Pr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Pr.jsx)("span",{children:s.workInstructions&&(0,Pr.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,Pr.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsx)(D,{className:"text-sm font-medium",children:"Project Management"}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(or,{id:"plan",checked:r.plan,onCheckedChange:h=>p("plan",h===!0),disabled:o}),(0,Pr.jsx)(D,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Pr.jsx)("p",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,Pr.jsxs)(la,{className:"flex justify-end gap-3",children:[t&&(0,Pr.jsxs)(x,{type:"button",variant:"outline",onClick:t,disabled:o,className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Pr.jsx)(x,{type:"submit",disabled:o,className:"flex items-center gap-2",children:o?(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)(yt.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function sr({projects:e=[],onAddProject:t,handleProjectOpen:o,handleProjectShare:a}){let[i,r]=(0,Mt.useState)(!1),[m,s]=(0,Mt.useState)(!1),c=async d=>{s(!0);try{await t(d),r(!1)}catch(p){console.error("Error creating project:",p)}finally{s(!1)}},n=()=>{r(!0)};return(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsx)(Qe,{title:"Project Management",description:"Organise your work into projects to collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:n}}),(0,Pr.jsxs)("section",{className:"space-y-4 Mt-8",children:[(0,Pr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Pr.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Pr.jsx)(Oi,{project:d,onOpen:o,onShare:a},d.name))})]})]},"projects-index-view")}),(0,Pr.jsx)(ft,{open:i,onOpenChange:r,children:(0,Pr.jsxs)(lt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Pr.jsxs)(dt,{className:"sr-only",children:[(0,Pr.jsx)(ct,{children:"Create New Project"}),(0,Pr.jsx)(_a,{children:"Fill out the form below to create a new project."})]}),(0,Pr.jsx)(Vi,{onSubmit:c,onCancel:()=>r(!1),isLoading:m,className:"border-0 shadow-none"})]})})]})}function Ki({team:e,onOpen:t,className:o}){return(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Pr.jsxs)(F,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Pr.jsxs)(Se,{children:[(0,Pr.jsx)(Ae,{className:"text-lg",children:e.name}),(0,Pr.jsx)(na,{className:"Mt-1 text-sm",children:e.description})]}),(0,Pr.jsxs)(re,{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-blue-500"}),(0,Pr.jsx)("span",{children:"Human"})]}),(0,Pr.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Pr.jsx)("span",{children:"Digital"})]}),(0,Pr.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm border-t Pr-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Pr.jsx)("span",{children:"Projects"})]}),(0,Pr.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Pr.jsx)(la,{className:"flex gap-2",children:(0,Pr.jsx)(x,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}var $i=Ne(require("react")),Za=Ne(require("@radix-yt/react-switch"));var Ea=$i.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Za.Root,{className:k("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:o,children:(0,Pr.jsx)(Za.Thumb,{className:k("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")})}));Ea.displayName=Za.Root.displayName;function Gi({team:e,onSave:t,onCancel:o,isLoading:a=!1,title:i,submitLabel:r,cancelLabel:m="Cancel",readOnly:s=!1}){let[c,n]=(0,Mt.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,p]=(0,Mt.useState)(!s);(0,Mt.useEffect)(()=>{e&&n(e)},[e]);let h=f=>{f.preventDefault();let T={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()};t(T)},g=f=>{f.preventDefault(),p(!d)},y=i||(d?e?"Edit Team":"Create New Team":"View Team"),b=r||(e?"Update Team":"Create Team");return(0,Pr.jsxs)(F,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Pr.jsx)(Se,{children:(0,Pr.jsxs)(Ae,{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Users,{className:"h-5 w-5"}),y]})}),(0,Pr.jsx)(re,{children:(0,Pr.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",children:"Team Name *"}),(0,Pr.jsx)(U,{id:"name",value:c.name||"",onChange:f=>n({...c,name:f.target.value}),required:!0,disabled:a||!d,placeholder:"Enter team name..."})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:c.description||"",onChange:f=>n({...c,description:f.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:a||!d})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"systemMsg",children:"Ways of working"}),(0,Pr.jsx)(ye,{id:"systemMsg",value:c.systemMsg||"",onChange:f=>n({...c,systemMsg:f.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:a||!d})]})]}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Ea,{id:"useProjects",checked:c.useProjects||!1,onCheckedChange:f=>n({...c,useProjects:f}),disabled:a||!d}),(0,Pr.jsx)(D,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Ea,{id:"useKnowledge",checked:c.useKnowledge||!1,onCheckedChange:f=>n({...c,useKnowledge:f}),disabled:a||!d}),(0,Pr.jsx)(D,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Ea,{id:"useFiles",checked:c.useFiles||!1,onCheckedChange:f=>n({...c,useFiles:f}),disabled:a||!d}),(0,Pr.jsx)(D,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Ea,{id:"useChat",checked:c.useChat||!1,onCheckedChange:f=>n({...c,useChat:f}),disabled:a||!d}),(0,Pr.jsx)(D,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-2 Pr-4 border-t",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:o,disabled:a,children:d?m:"Close"}),d?(0,Pr.jsx)(x,{type:"submit",disabled:a||!c.name?.trim(),children:a?"Saving...":b}):(0,Pr.jsxs)(x,{type:"button",onClick:g,disabled:a,className:"gap-2",children:[(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function lr({teams:e=[],onCreateTeam:t,onTeamOpen:o}){let[a,i]=(0,Mt.useState)(!1),r=()=>{i(!0)},m=n=>{t?.(n),i(!1)},s=()=>{i(!1)},c=n=>{o?.(n)};return(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsx)(Qe,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-to-r from-blue-600 via-cyan-600 to-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,Pr.jsxs)("section",{className:"space-y-4 Mt-8",children:[(0,Pr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Pr.jsxs)("div",{className:"text-center py-12",children:[(0,Pr.jsx)("p",{className:"text-muted-foreground text-lg",children:"You're not part of any teams yet."}),(0,Pr.jsx)("p",{className:"text-muted-foreground text-sm Mt-2",children:"Create a new team or ask to be added to an existing one."})]}):(0,Pr.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,Pr.jsx)(Ki,{team:n,onOpen:c},n.id))})]})]},"teams-index-view")}),(0,Pr.jsx)(ft,{open:a,onOpenChange:i,children:(0,Pr.jsxs)(lt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto p-0",children:[(0,Pr.jsx)("div",{className:"sr-only",children:(0,Pr.jsxs)(dt,{children:[(0,Pr.jsx)(ct,{children:"Create New Team"}),(0,Pr.jsx)(_a,{children:"Set up a new team to collaborate with colleagues on projects."})]})}),(0,Pr.jsx)(Gi,{title:"Create New Team",submitLabel:"Create Team",onSave:m,onCancel:s})]})})]})}0&&(module.exports={ColleaguesView,FileView,KnowledgeView,PlanningView,ProjectView,ProjectsIndexView,TeamsIndexView});
5
+ "use strict";var ps=Object.create;var to=Object.defineProperty;var us=Object.getOwnPropertyDescriptor;var gs=Object.getOwnPropertyNames;var fs=Object.getPrototypeOf,vs=Object.prototype.hasOwnProperty;var hs=(e,t)=>{for(var o in t)to(e,o,{get:t[o],enumerable:!0})},fr=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gs(t))!vs.call(e,i)&&i!==o&&to(e,i,{get:()=>t[i],enumerable:!(a=us(t,i))||a.enumerable});return e};var Ne=(e,t,o)=>(o=e!=null?ps(fs(e)):{},fr(t||!e||!e.__esModule?to(o,"default",{value:e,enumerable:!0}):o,e)),bs=e=>fr(to({},"__esModule",{value:!0}),e);var kn={};hs(kn,{ColleaguesView:()=>zo,FileView:()=>$a,KnowledgeView:()=>Vo,PlanningView:()=>Do,ProjectView:()=>er,ProjectsIndexView:()=>sr,TeamsIndexView:()=>lr});module.exports=bs(kn);var Mt=require("react"),yt=require("lucide-react");var kr=require("clsx");var Fo="-",xs=e=>{let t=ws(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:m=>{let s=m.split(Fo);return s[0]===""&&s.length!==1&&s.shift(),br(s,t)||ys(m)},getConflictingClassGroupIds:(m,s)=>{let c=o[m]||[];return s&&a[m]?[...c,...a[m]]:c}}},br=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),i=a?br(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Fo);return t.validators.find(({validator:m})=>m(r))?.classGroupId},vr=/^\[(.+)\]$/,ys=e=>{if(vr.test(e)){let t=vr.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},ws=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return Cs(Object.entries(e.classGroups),o).forEach(([r,m])=>{Mo(m,a,r,t)}),a},Mo=(e,t,o,a)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:hr(t,i);r.classGroupId=o;return}if(typeof i=="function"){if(Ns(i)){Mo(i(a),t,o,a);return}t.validators.push({validator:i,classGroupId:o});return}Object.entries(i).forEach(([r,m])=>{Mo(m,hr(t,r),o,a)})})},hr=(e,t)=>{let o=e;return t.split(Fo).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Ns=e=>e.isThemeGetter,Cs=(e,t)=>t?e.map(([o,a])=>{let i=a.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([m,s])=>[t+m,s])):r);return[o,i]}):e,ks=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,i=(r,m)=>{o.set(r,m),t++,t>e&&(t=0,a=o,o=new Map)};return{get(r){let m=o.get(r);if(m!==void 0)return m;if((m=a.get(r))!==void 0)return i(r,m),m},set(r,m){o.has(r)?o.set(r,m):i(r,m)}}},xr="!",Ds=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,i=t[0],r=t.length,m=s=>{let c=[],n=0,d=0,p;for(let f=0;f<s.length;f++){let T=s[f];if(n===0){if(T===i&&(a||s.slice(f,f+r)===t)){c.push(s.slice(d,f)),d=f+r;continue}if(T==="/"){p=f;continue}}T==="["?n++:T==="]"&&n--}let h=c.length===0?s:s.substring(d),g=h.startsWith(xr),y=g?h.substring(1):h,b=p&&p>d?p-d:void 0;return{modifiers:c,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:b}};return o?s=>o({className:s,parseClassName:m}):m},Ss=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},Ts=e=>({cache:ks(e.cacheSize),parseClassName:Ds(e),...xs(e)}),Ps=/\s+/,Rs=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:i}=t,r=[],m=e.trim().split(Ps),s="";for(let c=m.length-1;c>=0;c-=1){let n=m[c],{modifiers:d,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:g}=o(n),y=!!g,b=a(y?h.substring(0,g):h);if(!b){if(!y){s=n+(s.length>0?" "+s:s);continue}if(b=a(h),!b){s=n+(s.length>0?" "+s:s);continue}y=!1}let f=Ss(d).join(":"),T=p?f+xr:f,V=T+b;if(r.includes(V))continue;r.push(V);let _=i(b,y);for(let Y=0;Y<_.length;++Y){let w=_[Y];r.push(T+w)}s=n+(s.length>0?" "+s:s)}return s};function As(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=yr(t))&&(a&&(a+=" "),a+=o);return a}var yr=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=yr(e[a]))&&(o&&(o+=" "),o+=t);return o};function Is(e,...t){let o,a,i,r=m;function m(c){let n=t.reduce((d,p)=>p(d),e());return o=Ts(n),a=o.cache.get,i=o.cache.set,r=s,s(c)}function s(c){let n=a(c);if(n)return n;let d=Rs(c,o);return i(c,d),d}return function(){return r(As.apply(null,arguments))}}var Pe=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},wr=/^\[(?:([a-z-]+):)?(.+)\]$/i,Es=/^\d+\/\d+$/,Ms=new Set(["px","full","screen"]),Fs=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bs=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|Pr|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ls=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,js=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Os=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zt=e=>ya(e)||Ms.has(e)||Es.test(e),Zt=e=>wa(e,"length",Ws),ya=e=>!!e&&!Number.isNaN(Number(e)),Eo=e=>wa(e,"number",ya),Fa=e=>!!e&&Number.isInteger(Number(e)),Hs=e=>e.endsWith("%")&&ya(e.slice(0,-1)),oe=e=>wr.test(e),Yt=e=>Fs.test(e),zs=new Set(["length","size","percentage"]),Vs=e=>wa(e,zs,Nr),Us=e=>wa(e,"position",Nr),Ks=new Set(["image","url"]),$s=e=>wa(e,Ks,qs),Gs=e=>wa(e,"",_s),Ba=()=>!0,wa=(e,t,o)=>{let a=wr.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Ws=e=>Bs.test(e)&&!Ls.test(e),Nr=()=>!1,_s=e=>js.test(e),qs=e=>Os.test(e);var Xs=()=>{let e=Pe("colors"),t=Pe("spacing"),o=Pe("blur"),a=Pe("brightness"),i=Pe("borderColor"),r=Pe("borderRadius"),m=Pe("borderSpacing"),s=Pe("borderWidth"),c=Pe("contrast"),n=Pe("grayscale"),d=Pe("hueRotate"),p=Pe("invert"),h=Pe("gap"),g=Pe("gradientColorStops"),y=Pe("gradientColorStopPositions"),b=Pe("inset"),f=Pe("margin"),T=Pe("opacity"),V=Pe("padding"),_=Pe("saturate"),Y=Pe("scale"),w=Pe("sepia"),U=Pe("skew"),ge=Pe("space"),S=Pe("translate"),re=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],ve=()=>["auto",oe,t],G=()=>[oe,t],E=()=>["",zt,Zt],ie=()=>["auto",ya,oe],ze=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ee=()=>["solid","dashed","dotted","double","none"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ut=()=>["start","end","center","between","around","evenly","stretch"],st=()=>["","0",oe],Nt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ve=()=>[ya,oe];return{cacheSize:500,separator:":",theme:{colors:[Ba],spacing:[zt,Zt],blur:["none","",Yt,oe],brightness:Ve(),borderColor:[e],borderRadius:["none","","full",Yt,oe],borderSpacing:G(),borderWidth:E(),contrast:Ve(),grayscale:st(),hueRotate:Ve(),invert:st(),gap:G(),gradientColorStops:[e],gradientColorStopPositions:[Hs,Zt],inset:ve(),margin:ve(),opacity:Ve(),padding:G(),saturate:Ve(),scale:Ve(),sepia:st(),skew:Ve(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[Yt]}],"break-after":[{"break-after":Nt()}],"break-before":[{"break-before":Nt()}],"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:[...ze(),oe]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:re()}],"overscroll-x":[{"overscroll-x":re()}],"overscroll-y":[{"overscroll-y":re()}],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",Fa,oe]}],basis:[{basis:ve()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",oe]}],grow:[{grow:st()}],shrink:[{shrink:st()}],order:[{order:["first","last","none",Fa,oe]}],"grid-cols":[{"grid-cols":[Ba]}],"col-start-end":[{col:["auto",{span:["full",Fa,oe]},oe]}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":[Ba]}],"row-start-end":[{row:["auto",{span:[Fa,oe]},oe]}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...ut()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ut(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ut(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[V]}],px:[{px:[V]}],py:[{py:[V]}],ps:[{ps:[V]}],pe:[{pe:[V]}],Pr:[{Pr:[V]}],pr:[{pr:[V]}],pb:[{pb:[V]}],pl:[{pl:[V]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],Mt:[{Mt:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[ge]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ge]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,t]}],"min-w":[{"min-w":[oe,t,"min","max","fit"]}],"max-w":[{"max-w":[oe,t,"none","full","min","max","fit","prose",{screen:[Yt]},Yt]}],h:[{h:[oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Yt,Zt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Eo]}],"font-family":[{font:[Ba]}],"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",oe]}],"line-clamp":[{"line-clamp":["none",ya,Eo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zt,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[T]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[T]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zt,Zt]}],"underline-offset":[{"underline-offset":["auto",zt,oe]}],"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:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe]}],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",oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[T]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ze(),Us]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Vs]}],"bg-image":[{bg:["none",{"gradient-to":["t","Pr","r","br","b","bl","Pr","tl"]},$s]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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-Pr":[{"rounded-Pr":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-Pr":[{"rounded-Pr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[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-Pr":[{"border-Pr":[s]}],"border-opacity":[{"border-opacity":[T]}],"border-style":[{border:[...Ee(),"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":[T]}],"divide-style":[{divide:Ee()}],"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-Pr":[{"border-Pr":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Ee()]}],"outline-offset":[{"outline-offset":[zt,oe]}],"outline-w":[{outline:[zt,Zt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:E()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[T]}],"ring-offset-w":[{"ring-offset":[zt,Zt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Yt,Gs]}],"shadow-color":[{shadow:[Ba]}],opacity:[{opacity:[T]}],"mix-blend":[{"mix-blend":[...we(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":we()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Yt,oe]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[p]}],saturate:[{saturate:[_]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[T]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",oe]}],duration:[{duration:Ve()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:Ve()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Y]}],"scale-x":[{"scale-x":[Y]}],"scale-y":[{"scale-y":[Y]}],rotate:[{rotate:[Fa,oe]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[U]}],"skew-y":[{"skew-y":[U]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],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","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","Pr-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-Mt":[{"scroll-Mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-Pr":[{"scroll-Pr":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[zt,Zt,Eo]}],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","pe","Pr","pr","pb","pl"],px:["pr","pl"],py:["Pr","pb"],m:["mx","my","ms","me","Mt","mr","mb","ml"],mx:["mr","ml"],my:["Mt","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-Pr","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-Pr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-Pr"],"rounded-r":["rounded-Pr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-Pr":["rounded-tl","rounded-bl"],"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-Pr"],"border-w-x":["border-w-r","border-w-Pr"],"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-Pr"],"border-color-x":["border-color-r","border-color-Pr"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-Mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-Mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-Pr","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-Pr","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Cr=Is(Xs);function k(...e){return Cr((0,kr.clsx)(e))}var Dr=require("@radix-yt/react-slot"),Sr=require("class-variance-authority"),Tr=Ne(require("react")),Pr=require("react/jsx-runtime"),ao=(0,Sr.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"}}}),x=Tr.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...i},r)=>(0,Pr.jsx)(e?Dr.Slot:"button",{className:k(ao({className:t,size:o,variant:a})),ref:r,...i}));x.displayName="Button";var sa=Ne(require("react"));var L=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("rounded-xl border bg-card text-card-foreground shadow",e),...t}));L.displayName="Card";var Re=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("flex flex-col space-y-1.5 p-6",e),...t}));Re.displayName="CardHeader";var je=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("font-semibold leading-none tracking-tight",e),...t}));je.displayName="CardTitle";var La=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("text-sm text-muted-foreground",e),...t}));La.displayName="CardDescription";var le=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("p-6 Pr-0",e),...t}));le.displayName="CardContent";var ja=sa.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)("div",{ref:o,className:k("flex items-center p-6 Pr-0",e),...t}));ja.displayName="CardFooter";var Rr=Ne(require("react"));var z=Rr.forwardRef(({className:e,type:t,...o},a)=>(0,Pr.jsx)("input",{type:t,className:k("flex h-9 w-full rounded-md 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:a,...o}));z.displayName="Input";var me=Ne(require("@radix-yt/react-select")),Qt=Ne(require("react")),Fe=me.Root;var $e=me.Value,Ae=Qt.forwardRef(({children:e,className:t,...o},a)=>(0,Pr.jsxs)(me.Trigger,{className:k("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:a,...o,children:[e,(0,Pr.jsx)(me.Icon,{asChild:!0,children:(0,Pr.jsx)(yt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Ae.displayName=me.Trigger.displayName;var Ir=Qt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(me.ScrollUpButton,{className:k("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Pr.jsx)(yt.ChevronUp,{className:"h-4 w-4"})}));Ir.displayName=me.ScrollUpButton.displayName;var Er=Qt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(me.ScrollDownButton,{className:k("flex cursor-default items-center justify-center py-1",e),ref:o,...t,children:(0,Pr.jsx)(yt.ChevronDown,{className:"h-4 w-4"})}));Er.displayName=me.ScrollDownButton.displayName;var Ie=Qt.forwardRef(({children:e,className:t,position:o="popper",...a},i)=>(0,Pr.jsx)(me.Portal,{children:(0,Pr.jsxs)(me.Content,{className:k("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md 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",o==="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:o,ref:i,...a,children:[(0,Pr.jsx)(Ir,{}),(0,Pr.jsx)(me.Viewport,{className:k("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Pr.jsx)(Er,{})]})}));Ie.displayName=me.Content.displayName;var Js=Qt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(me.Label,{className:k("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:o,...t}));Js.displayName=me.Label.displayName;var X=Qt.forwardRef(({children:e,className:t,...o},a)=>(0,Pr.jsxs)(me.Item,{className:k("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),ref:a,...o,children:[(0,Pr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pr.jsx)(me.ItemIndicator,{children:(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"})})}),(0,Pr.jsx)(me.ItemText,{children:e})]}));X.displayName=me.Item.displayName;var Zs=Qt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(me.Separator,{className:k("-mx-1 my-1 h-px bg-muted",e),ref:o,...t}));Zs.displayName=me.Separator.displayName;var Bo=require("motion/react");var da=Ne(require("@radix-yt/react-tabs"));function Mr({className:e,...t}){return(0,Pr.jsx)(da.Root,{"data-slot":"tabs",className:k("flex flex-col gap-2",e),...t})}function Fr({className:e,...t}){return(0,Pr.jsx)(da.List,{"data-slot":"tabs-list",className:k("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Br({className:e,...t}){return(0,Pr.jsx)(da.Trigger,{"data-slot":"tabs-trigger",className:k("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-md 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})}var Vt=Ne(require("react")),pe=Ne(require("@radix-yt/react-dropdown-menu")),Na=require("@radix-yt/react-icons");var ro=pe.Root,io=pe.Trigger;var Ys=Vt.forwardRef(({className:e,inset:t,children:o,...a},i)=>(0,Pr.jsxs)(pe.SubTrigger,{ref:i,className:k("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),...a,children:[o,(0,Pr.jsx)(Na.ChevronRightIcon,{className:"ml-auto"})]}));Ys.displayName=pe.SubTrigger.displayName;var Qs=Vt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(pe.SubContent,{ref:o,className:k("z-50 min-w-[8rem] overflow-hidden rounded-md 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}));Qs.displayName=pe.SubContent.displayName;var Oa=Vt.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Pr.jsx)(pe.Portal,{children:(0,Pr.jsx)(pe.Content,{ref:a,sideOffset:t,className:k("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","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})}));Oa.displayName=pe.Content.displayName;var ca=Vt.forwardRef(({className:e,inset:t,...o},a)=>(0,Pr.jsx)(pe.Item,{ref:a,className:k("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),...o}));ca.displayName=pe.Item.displayName;var en=Vt.forwardRef(({className:e,children:t,checked:o,...a},i)=>(0,Pr.jsxs)(pe.CheckboxItem,{ref:i,className:k("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-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:o,...a,children:[(0,Pr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pr.jsx)(pe.ItemIndicator,{children:(0,Pr.jsx)(Na.CheckIcon,{className:"h-4 w-4"})})}),t]}));en.displayName=pe.CheckboxItem.displayName;var tn=Vt.forwardRef(({className:e,children:t,...o},a)=>(0,Pr.jsxs)(pe.RadioItem,{ref:a,className:k("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[(0,Pr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Pr.jsx)(pe.ItemIndicator,{children:(0,Pr.jsx)(Na.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));tn.displayName=pe.RadioItem.displayName;var an=Vt.forwardRef(({className:e,inset:t,...o},a)=>(0,Pr.jsx)(pe.Label,{ref:a,className:k("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));an.displayName=pe.Label.displayName;var on=Vt.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(pe.Separator,{ref:o,className:k("-mx-1 my-1 h-px bg-muted",e),...t}));on.displayName=pe.Separator.displayName;var rn=({className:e,...t})=>(0,Pr.jsx)("span",{className:k("ml-auto text-xs tracking-widest opacity-60",e),...t});rn.displayName="DropdownMenuShortcut";function so({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:i="700px",gridCols:r=6}){let m=o.find(s=>s.value===e);return(0,Pr.jsxs)(Bo.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Pr.jsx)("div",{className:"hidden lg:block",children:(0,Pr.jsx)(Mr,{value:e,onValueChange:t,children:(0,Pr.jsx)(Fr,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,o.length)}, minmax(0, 1fr))`},children:o.map(s=>(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Pr.jsx)(Br,{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,Pr.jsx)("div",{className:"lg:hidden",children:(0,Pr.jsxs)(ro,{children:[(0,Pr.jsx)(io,{asChild:!0,children:(0,Pr.jsxs)(x,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[m?.label||"Select",(0,Pr.jsx)(yt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Pr.jsx)(Oa,{align:"center",className:"w-[180px]",children:o.map(s=>(0,Pr.jsx)(ca,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}var no=Ne(require("react")),Ut=Ne(require("@radix-yt/react-avatar"));var Kt=no.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Ut.Root,{ref:o,className:k("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Kt.displayName=Ut.Root.displayName;var Ha=no.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Ut.Image,{ref:o,className:k("aspect-square h-full w-full",e),...t}));Ha.displayName=Ut.Image.displayName;var $t=no.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Ut.Fallback,{ref:o,className:k("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));$t.displayName=Ut.Fallback.displayName;var sn=(0,Sr.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs 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 W({className:e,variant:t,...o}){return(0,Pr.jsx)("div",{className:k(sn({variant:t}),e),...o})}function co({colleague:e,onEdit:t,onDelete:o,onViewDetails:a,showActions:i=!0,compact:r=!1,className:m}){let[s,c]=(0,Mt.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"}},p=h=>{if(!h)return"Never";let y=Math.floor((new Date().getTime()-h.getTime())/(1e3*60));return y<1?"Just now":y<60?`${y}m ago`:y<1440?`${Math.floor(y/60)}h ago`:`${Math.floor(y/1440)}d ago`};return(0,Pr.jsxs)(L,{className:k("hover:shadow-md transition-shadow",r&&"p-2",m),children:[(0,Pr.jsx)(Re,{className:k("pb-3",r&&"pb-2"),children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsx)("div",{className:"relative",children:(0,Pr.jsxs)(Kt,{className:k("h-12 w-12",r&&"h-8 w-8"),children:[(0,Pr.jsx)(Ha,{src:"/placeholder.svg",alt:e.name}),(0,Pr.jsx)($t,{children:e.name.split(" ").map(h=>h[0]).join("")})]})}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("h3",{className:k("font-semibold text-sm truncate",r&&"text-xs"),children:e.name}),e.type==="digital"?(0,Pr.jsx)(yt.Bot,{className:k("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,Pr.jsx)(yt.User,{className:k("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,Pr.jsx)("p",{className:k("text-sm text-muted-foreground truncate",r&&"text-xs"),children:e.type==="human"?e.role:e.description}),!r&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 Mt-1",children:[e.type==="human"&&(0,Pr.jsx)(W,{variant:"secondary",className:"text-xs",children:e.department}),e.type==="digital"&&(0,Pr.jsxs)(W,{variant:"secondary",className:"text-xs",children:["v",e.version]}),(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:d(e.status)})]})]})]}),i&&(0,Pr.jsxs)(ro,{children:[(0,Pr.jsx)(io,{asChild:!0,children:(0,Pr.jsx)(x,{variant:"ghost",size:"icon",className:k("h-8 w-8",r&&"h-6 w-6"),children:(0,Pr.jsx)(yt.MoreHorizontal,{className:k("h-4 w-4",r&&"h-3 w-3")})})}),(0,Pr.jsxs)(Oa,{align:"end",children:[e.type==="digital"&&(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsxs)(ca,{onClick:()=>a?.(e),children:[(0,Pr.jsx)(yt.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,Pr.jsxs)(ca,{onClick:()=>t?.(e),children:[(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,Pr.jsxs)(ca,{onClick:()=>o?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,Pr.jsx)(yt.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,Pr.jsxs)(le,{className:"Pr-0",children:[(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Mail,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,Pr.jsxs)(Pr.Fragment,{children:[e.phone&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Phone,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:e.phone})]}),e.location&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.MapPin,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Settings,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:["v",e.version]})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,Pr.jsx)(yt.Clock,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:["Last active: ",p(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,Pr.jsx)("div",{className:"Mt-3",children:(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,s?e.skills.length:3).map(h=>(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:h},h)),e.skills.length>3&&(0,Pr.jsx)(x,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>c(!s),children:s?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,Pr.jsx)("div",{className:"Mt-3",children:(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,s?e.capabilities.length:2).map(h=>(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:h},h)),e.capabilities.length>2&&(0,Pr.jsx)(x,{variant:"ghost",size:"sm",className:"h-5 px-2 text-xs",onClick:()=>c(!s),children:s?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var zr=Ne(require("react")),Lo=Ne(require("@radix-yt/react-label"));var nn=(0,Sr.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),D=zr.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Lo.Root,{ref:o,className:k(nn(),e),...t}));D.displayName=Lo.Root.displayName;var Kr=Ne(require("react")),ye=Kr.forwardRef(({className:e,...t},o)=>(0,$r.jsx)("textarea",{className:k("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:o,...t}));ye.displayName="Textarea";var jo=Ne(require("react")),kt=Ne(require("@radix-yt/react-scroll-area"));var za=jo.forwardRef(({className:e,children:t,...o},a)=>(0,Pr.jsxs)(kt.Root,{ref:a,className:k("relative overflow-hidden",e),...o,children:[(0,Pr.jsx)(kt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Pr.jsx)(Gr,{}),(0,Pr.jsx)(kt.Corner,{})]}));za.displayName=kt.Root.displayName;var Gr=jo.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Pr.jsx)(kt.ScrollAreaScrollbar,{ref:a,orientation:t,className:k("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-Pr border-Pr-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,Pr.jsx)(kt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Gr.displayName=kt.ScrollAreaScrollbar.displayName;function Oo({selectedDocuments:e,onDocumentsChange:t,availableDocuments:o,label:a,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:m=!1}){let[s,c]=(0,Mt.useState)(""),[n,d]=(0,Mt.useState)([]),[p,h]=(0,Mt.useState)(!1);(0,Mt.useEffect)(()=>{if(!s.trim()){d([]),h(!1);return}let f=o.filter(T=>{if(e.map(Y=>Y.id).includes(T.id))return!1;let _=s.toLowerCase();return T.title.toLowerCase().includes(_)||T.description?.toLowerCase().includes(_)||T.tags?.some(Y=>Y.toLowerCase().includes(_))||Object.values(T.metadata||{}).some(Y=>String(Y).toLowerCase().includes(_))});d(f),h(!0)},[s,e,o]);let g=f=>{r&&e.length>=r||(t([...e,f]),c(""),h(!1))},y=f=>{t(e.filter(T=>T.id!==f))},b=!r||e.length<r;return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:a}),(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)(z,{value:s,onChange:f=>c(f.target.value),placeholder:b?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:m||!b,onFocus:()=>s&&h(!0)})]}),p&&n.length>0&&(0,Pr.jsx)(L,{className:"absolute top-full left-0 right-0 z-10 Mt-1 max-h-60",children:(0,Pr.jsx)(za,{className:"h-full",children:(0,Pr.jsx)(le,{className:"p-2",children:n.map(f=>(0,Pr.jsx)(x,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>g(f),disabled:m,children:(0,Pr.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,Pr.jsx)(yt.FileText,{className:"h-4 w-4 Mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Pr.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,Pr.jsx)("div",{className:"font-medium text-sm truncate",children:f.title}),f.description&&(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground Mt-1 line-clamp-2",children:f.description}),f.tags&&f.tags.length>0&&(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1 Mt-2",children:[f.tags.slice(0,3).map(T=>(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:T},T)),f.tags.length>3&&(0,Pr.jsxs)(W,{variant:"outline",className:"text-xs",children:["+",f.tags.length-3," more"]})]})]})]})},f.id))})})}),p&&s&&n.length===0&&(0,Pr.jsx)(L,{className:"absolute top-full left-0 right-0 z-10 Mt-1",children:(0,Pr.jsxs)(le,{className:"p-4 text-center text-sm text-muted-foreground",children:['No knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,Pr.jsx)("div",{className:"space-y-2",children:e.map(f=>(0,Pr.jsx)(L,{className:"p-3",children:(0,Pr.jsxs)("div",{className:"flex items-start gap-3",children:[(0,Pr.jsx)(yt.FileText,{className:"h-4 w-4 Mt-0.5 text-muted-foreground flex-shrink-0"}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsx)("div",{className:"font-medium text-sm",children:f.title}),f.description&&(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground Mt-1",children:f.description}),f.tags&&f.tags.length>0&&(0,Pr.jsx)("div",{className:"flex flex-wrap gap-1 Mt-2",children:f.tags.map(T=>(0,Pr.jsxs)(W,{variant:"outline",className:"text-xs",children:[(0,Pr.jsx)(yt.Tag,{className:"h-3 w-3 mr-1"}),T]},T))})]}),(0,Pr.jsx)(x,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>y(f.id),disabled:m,children:(0,Pr.jsx)(yt.X,{className:"h-3 w-3"})})]})},f.id))})]}),p&&(0,Pr.jsx)("div",{className:"fixed inset-0 z-0",onClick:()=>h(!1)})]})}function Ho({colleague:e,onSave:t,onCancel:o,isLoading:a=!1,title:i,submitLabel:r,cancelLabel:m="Cancel",readOnly:s=!1,availableKnowledgeDocuments:c=[]}){let[n,d]=(0,Mt.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[p,h]=(0,Mt.useState)(""),[g,y]=(0,Mt.useState)(""),[b,f]=(0,Mt.useState)(!s);(0,Mt.useEffect)(()=>{e&&d(e)},[e]);let T=S=>{S.preventDefault();let re=n.version?parseInt(n.version):0,R=e?(re+1).toString():"1",ve={id:n.id||Date.now().toString(),name:n.name,type:"digital",status:"active",joinedDate:n.joinedDate||new Date,lastActive:n.lastActive||new Date,description:n.description,jobDescription:n.jobDescription||"",workInstructions:n.workInstructions||"",capabilities:n.capabilities||[],knowledge:n.knowledge||[],coreKnowledge:n.coreKnowledge||[],version:R,lastUpdated:n.lastUpdated||new Date,isActive:!0};t(ve)},V=(S,re,R)=>{if(!re.trim())return;let ve=n[S]||[];d({...n,[S]:[...ve,re.trim()]}),R("")},_=(S,re)=>{let R=n[S]||[];d({...n,[S]:R.filter((ve,G)=>G!==re)})},Y=S=>{S.preventDefault(),f(!b)},w=(S,re,R,ve,G)=>{let E=n[S]||[];return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:re}),b&&(0,Pr.jsxs)("div",{className:"flex gap-2",children:[(0,Pr.jsx)(z,{value:R,onChange:ie=>ve(ie.target.value),placeholder:G,onKeyPress:ie=>{ie.key==="Enter"&&(ie.preventDefault(),V(S,R,ve))},disabled:a}),(0,Pr.jsx)(x,{type:"button",variant:"outline",size:"icon",onClick:()=>V(S,R,ve),disabled:a,children:(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"})})]}),(0,Pr.jsx)("div",{className:"flex flex-wrap gap-2",children:E.map((ie,ze)=>(0,Pr.jsxs)(W,{className:"gap-1",children:[ie,b&&(0,Pr.jsx)(x,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>_(S,ze),disabled:a,children:(0,Pr.jsx)(yt.X,{className:"h-3 w-3"})})]},`${S}-${ze}-${ie}`))})]})},U=i||(b?e?"Edit Colleague":"Add New Colleague":"View Colleague"),ge=r||(e?"Update Colleague":"Add Colleague");return(0,Pr.jsxs)(L,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Pr.jsx)(Re,{children:(0,Pr.jsxs)(je,{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Bot,{className:"h-5 w-5"}),U]})}),(0,Pr.jsx)(le,{children:(0,Pr.jsxs)("form",{onSubmit:T,className:"space-y-6",children:[(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",children:"Name *"}),(0,Pr.jsx)(z,{id:"name",value:n.name||"",onChange:S=>d({...n,name:S.target.value}),required:!0,disabled:a||!b})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:n.description||"",onChange:S=>d({...n,description:S.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:a||!b})]})]}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"jobDescription",children:"Job Description *"}),(0,Pr.jsx)(ye,{id:"jobDescription",value:n.jobDescription||"",onChange:S=>d({...n,jobDescription:S.target.value}),rows:4,required:n.type==="digital",disabled:a||!b})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,Pr.jsx)(ye,{id:"workInstructions",value:n.workInstructions||"",onChange:S=>d({...n,workInstructions:S.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:a||!b})]}),w("capabilities","Capabilities",g,y,"Add capability"),(0,Pr.jsx)(Oo,{selectedDocuments:n.knowledge||[],onDocumentsChange:S=>d({...n,knowledge:S}),label:"Knowledge",placeholder:"Search for knowledge documents to add...",disabled:a||!b,availableDocuments:c}),(0,Pr.jsx)(Oo,{selectedDocuments:n.coreKnowledge||[],onDocumentsChange:S=>d({...n,coreKnowledge:S}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:a||!b,availableDocuments:c})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-2 Pr-4 border-t",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:o,disabled:a,children:b?m:"Close"}),b?(0,Pr.jsx)(x,{type:"submit",disabled:a,children:a?"Saving...":ge}):(0,Pr.jsxs)(x,{type:"button",onClick:Y,disabled:a,className:"gap-2",children:[(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function Wr({users:e,onUserSelect:t,onCancel:o,selectedUserId:a}){let[i,r]=(0,Mt.useState)(""),m=(0,Mt.useMemo)(()=>e.filter(c=>c.name.toLowerCase().includes(i.toLowerCase())||c.email.toLowerCase().includes(i.toLowerCase())||c.role.toLowerCase().includes(i.toLowerCase())||(c.skills||[]).some(d=>d.toLowerCase().includes(i.toLowerCase()))),[e,i]),s=c=>{t(c)};return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Choose a user to add as a colleague"})]})]}),(0,Pr.jsx)(L,{className:"container",children:(0,Pr.jsx)(le,{className:"Pr-6",children:(0,Pr.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)(z,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:c=>r(c.target.value),className:"pl-9"})]})})})})}),(0,Pr.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:m.map(c=>(0,Pr.jsx)(Bo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Pr.jsxs)(L,{className:`cursor-pointer transition-all hover:shadow-lg ${a===c.id?"ring-2 ring-primary":""}`,onClick:()=>s(c),children:[(0,Pr.jsx)(Re,{className:"pb-3",children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsxs)(Kt,{children:[(0,Pr.jsx)(Ha,{src:c.avatar,alt:c.name}),(0,Pr.jsx)($t,{children:(0,Pr.jsx)(yt.User,{className:"h-4 w-4"})})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(je,{className:"text-lg",children:c.name}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:c.role})]})]}),a===c.id&&(0,Pr.jsx)(yt.Check,{className:"h-5 w-5 text-primary"})]})}),(0,Pr.jsx)(le,{className:"Pr-0",children:(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,Pr.jsx)("p",{className:"text-sm font-medium",children:c.email})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"}),(0,Pr.jsx)(W,{variant:"secondary",children:c.department})]}),c.location&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Location"}),(0,Pr.jsx)("p",{className:"text-sm",children:c.location})]}),c.skills&&c.skills.length>0&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[c.skills.slice(0,3).map(n=>(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:n},n)),c.skills.length>3&&(0,Pr.jsxs)(W,{variant:"outline",className:"text-xs",children:["+",c.skills.length-3]})]})]})]})})]})},c.id))}),m.length===0&&(0,Pr.jsx)(L,{className:"container Mt-4",children:(0,Pr.jsx)(le,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No users found"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function _r({digitalColleagues:e,onColleagueClone:t,onCancel:o,selectedColleagueId:a}){let[i,r]=(0,Mt.useState)(""),[m,s]=(0,Mt.useState)("all"),c=(0,Mt.useMemo)(()=>e.filter(p=>{let h=p.name.toLowerCase().includes(i.toLowerCase())||p.jobDescription.toLowerCase().includes(i.toLowerCase())||p.capabilities.some(y=>y.toLowerCase().includes(i.toLowerCase()))||p.workInstructions.toLowerCase().includes(i.toLowerCase()),g=m==="all"||p.status===m;return h&&g}),[e,i,m]),n=p=>{let h={...p,id:`${p.id}-clone-${Date.now()}`,name:`${p.name} (Copy)`,joinedDate:new Date,lastActive:new Date,lastUpdated:new Date,version:"1.0.0"};t(h)},d=p=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(p);return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,Pr.jsx)(L,{children:(0,Pr.jsx)(le,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)(z,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:p=>r(p.target.value),className:"pl-9"})]})}),(0,Pr.jsxs)("select",{value:m,onChange:p=>s(p.target.value),className:"h-10 px-3 rounded-md border border-input bg-background text-sm ring-offset-background",children:[(0,Pr.jsx)("option",{value:"all",children:"All Status"}),(0,Pr.jsx)("option",{value:"active",children:"Active"}),(0,Pr.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,Pr.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:c.map(p=>(0,Pr.jsx)(Bo.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,Pr.jsxs)(L,{className:`cursor-pointer transition-all hover:shadow-lg ${a===p.id?"ring-2 ring-primary":""}`,onClick:()=>n(p),children:[(0,Pr.jsx)(Re,{className:"pb-3",children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsx)(Kt,{children:(0,Pr.jsx)($t,{className:"bg-blue-100",children:(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsxs)(je,{className:"text-lg flex items-center gap-2",children:[p.name,(0,Pr.jsx)(W,{variant:p.status==="active"?"default":"secondary",className:"text-xs",children:p.status})]}),(0,Pr.jsxs)("p",{className:"text-sm text-muted-foreground",children:["v",p.version]})]})]}),(0,Pr.jsxs)(x,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:h=>{h.stopPropagation(),n(p)},children:[(0,Pr.jsx)(yt.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,Pr.jsx)(le,{className:"Pr-0",children:(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,Pr.jsx)("p",{className:"text-sm line-clamp-2",children:p.jobDescription})]}),p.capabilities&&p.capabilities.length>0&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[p.capabilities.slice(0,3).map(h=>(0,Pr.jsx)(W,{variant:"outline",className:"text-xs",children:h},h)),p.capabilities.length>3&&(0,Pr.jsxs)(W,{variant:"outline",className:"text-xs",children:["+",p.capabilities.length-3]})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:["Updated ",d(p.lastUpdated)]})]}),p.knowledge&&(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.Users,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:[p.knowledge.length," docs"]})]})]}),p.workInstructions&&(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,Pr.jsx)("p",{className:"text-xs line-clamp-2",children:p.workInstructions})]})]})})]})},p.id))}),c.length===0&&(0,Pr.jsx)(L,{children:(0,Pr.jsx)(le,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No digital colleagues found"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function qr({onSelectHuman:e,onSelectDigital:t,onCancel:o}){return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,Pr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Pr.jsxs)(Re,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.User,{className:"h-8 w-8 text-blue-600"})}),(0,Pr.jsx)(je,{className:"text-xl",children:"Add Human Colleague"})]}),(0,Pr.jsxs)(le,{className:"text-center",children:[(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add as team members."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Browse existing users"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.User,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Import user details automatically"})]})]}),(0,Pr.jsx)(x,{className:"Mt-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Pr.jsxs)(Re,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,Pr.jsx)(je,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,Pr.jsxs)(le,{className:"text-center",children:[(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-purple-600"}),(0,Pr.jsx)("span",{children:"Clone existing colleagues"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-purple-600"}),(0,Pr.jsx)("span",{children:"Create from templates"})]})]}),(0,Pr.jsx)(x,{className:"Mt-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function Xr({onCloneExisting:e,onCreateNew:t,onCancel:o}){return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,Pr.jsxs)(x,{variant:"ghost",onClick:o,className:"gap-2",children:[(0,Pr.jsx)(yt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,Pr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,Pr.jsxs)(Re,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,Pr.jsx)(je,{className:"text-xl",children:"Clone Existing"})]}),(0,Pr.jsxs)(le,{className:"text-center",children:[(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize it for your needs."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Copy,{className:"h-4 w-4 text-blue-600"}),(0,Pr.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,Pr.jsx)(x,{className:"Mt-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,Pr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,Pr.jsxs)(Re,{className:"text-center pb-4",children:[(0,Pr.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,Pr.jsx)(yt.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,Pr.jsx)(je,{className:"text-xl",children:"Create New"})]}),(0,Pr.jsxs)(le,{className:"text-center",children:[(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,Pr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4 text-green-600"}),(0,Pr.jsx)("span",{children:"Custom job description"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,Pr.jsx)(yt.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,Pr.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,Pr.jsx)(x,{className:"Mt-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}function Jr(e,t){let[o,a]=(0,Mt.useState)(()=>{if(typeof window>"Pr")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{a(r),typeof window<"Pr"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Mt.useEffect)(()=>{i(o)},[]),[o,i]}var uo=require("react-icons/Pr");function Qe({title:e,description:t,badge:o,primaryAction:a,secondaryAction:i,gradient:r,children:m,className:s}){let[c,n]=Jr(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),d=!i&&!t||c;return(0,Pr.jsxs)(Bo.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,Pr.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[o&&(0,Pr.jsx)(W,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:o}),(0,Pr.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[d&&a&&(0,Pr.jsx)(x,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),(i||t)&&(0,Pr.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,Pr.jsx)(uo.FaChevronDown,{size:22}):(0,Pr.jsx)(uo.FaChevronUp,{size:22})})]})]}),!d&&(0,Pr.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-3",children:[a&&(0,Pr.jsx)(x,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:a.onClick,children:a.label}),i&&(0,Pr.jsx)(x,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),m&&(0,Pr.jsx)("div",{className:"hidden lg:block",children:m})]})]})}function zo({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:o,onColleagueDelete:a,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:m,availableUsers:s=[],existingDigitalColleagues:c=[]}){let[n,d]=(0,Mt.useState)(e||[]),[p,h]=(0,Mt.useState)(""),[g,y]=(0,Mt.useState)("all"),[b,f]=(0,Mt.useState)("all"),[T,V]=(0,Mt.useState)("all"),[_,Y]=(0,Mt.useState)(null),[w,U]=(0,Mt.useState)(null);(0,Mt.useEffect)(()=>{d(e||[])},[e]);let ge=Array.isArray(s)?s:[],S=Array.isArray(c)?c:[],[re,R]=(0,Mt.useState)("main"),ve=n.filter(C=>{if(!C||!C.name)return!1;let Me=C.name.toLowerCase().includes(p.toLowerCase())||C.type==="human"&&(C.email?.toLowerCase().includes(p.toLowerCase())||C.role?.toLowerCase().includes(p.toLowerCase()))||C.type==="digital"&&C.jobDescription?.toLowerCase().includes(p.toLowerCase()),xe=g==="all"||C.type==="human"&&C.department===g,Ct=b==="all"||C.status===b;return Me&&xe&&Ct}),G=ve.filter(C=>C.type==="human"),E=ve.filter(C=>C.type==="digital"),ie=()=>{R("typeSelection")},ze=C=>{C.type==="digital"&&(Y(C),R("form")),console.log("Editing colleague:",C),o?.(C)},Ee=C=>{C.type==="digital"&&(U(C),R("view"))},we=C=>{let Me={id:`human-${Date.now()}`,type:"human",name:C.name,email:C.email,role:C.role,department:C.department,phone:C.phone,location:C.location,timezone:C.timezone,skills:C.skills||[],bio:C.bio,status:"active",joinedDate:new Date,lastActive:new Date};d(xe=>[...xe,Me]),t?.(Me),R("main")},ut=C=>{if(!C||!C.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",C);return}d(Me=>[...Me,C]),t?.(C),R("main")},st=()=>{Y(null),R("form")},Nt=C=>{if(!C||!C.id){console.error("Invalid colleague provided to handleSaveColleague:",C);return}_?(d(Me=>Me.map(xe=>xe.id===C.id?C:xe)),o?.(C)):(d(Me=>[...Me,C]),t?.(C)),R("main"),Y(null)},Ve=()=>{R("main"),Y(null),U(null)},rt=()=>{R("main"),U(null)},At=()=>{w&&(Y(w),U(null),R("form"))},bt=C=>{a?.(C,n.find(Me=>Me.id===C).type),d(Me=>Me.filter(xe=>xe.id!==C))},ht=()=>{h(""),y("all"),f("all")},It=()=>{let C=[];return S.forEach(xe=>{xe.knowledge&&Array.isArray(xe.knowledge)&&C.push(...xe.knowledge),xe.coreKnowledge&&Array.isArray(xe.coreKnowledge)&&C.push(...xe.coreKnowledge)}),n.forEach(xe=>{xe.type==="digital"&&(xe.knowledge&&Array.isArray(xe.knowledge)&&C.push(...xe.knowledge),xe.coreKnowledge&&Array.isArray(xe.coreKnowledge)&&C.push(...xe.coreKnowledge))}),C.filter((xe,Ct,Lt)=>Ct===Lt.findIndex(j=>j.id===xe.id))};return re==="typeSelection"?(0,Pr.jsx)(qr,{onSelectHuman:()=>R("userSelection"),onSelectDigital:()=>R("digitalOptions"),onCancel:()=>R("main")}):re==="userSelection"?(0,Pr.jsx)(Wr,{users:ge,onUserSelect:we,onCancel:()=>R("typeSelection")}):re==="digitalOptions"?(0,Pr.jsx)(Xr,{onCloneExisting:()=>R("digitalClone"),onCreateNew:st,onCancel:()=>R("typeSelection")}):re==="digitalClone"?(0,Pr.jsx)(_r,{digitalColleagues:S,onColleagueClone:ut,onCancel:()=>R("digitalOptions")}):re==="form"?(0,Pr.jsx)(Ho,{colleague:_||void 0,onSave:Nt,onCancel:Ve,availableKnowledgeDocuments:It()}):re==="view"?(0,Pr.jsx)(Ho,{colleague:w||void 0,onSave:Nt,onCancel:rt,readOnly:!0,availableKnowledgeDocuments:It()}):(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsx)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Pr.jsxs)("div",{className:`space-y-6 ${m||""}`,children:[(0,Pr.jsx)(Qe,{title:"Colleagues",description:"Manage your team members and digital colleagues.",gradient:"bg-gradient-to-r from-green-600 via-emerald-600 to-teal-600",primaryAction:{label:"Add colleague",onClick:ie}}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,Pr.jsxs)(L,{children:[(0,Pr.jsxs)(Re,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Pr.jsx)(je,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Pr.jsxs)(le,{children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold",children:n.length}),(0,Pr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.filter(C=>C.status==="active").length," active"]})]})]}),(0,Pr.jsxs)(L,{children:[(0,Pr.jsxs)(Re,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Pr.jsx)(je,{className:"text-sm font-medium",children:"Human Members"}),(0,Pr.jsx)(yt.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Pr.jsxs)(le,{children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(C=>C.type==="human").length}),(0,Pr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.filter(C=>C.type==="human"&&C.status==="active").length," ","active"]})]})]}),(0,Pr.jsxs)(L,{children:[(0,Pr.jsxs)(Re,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,Pr.jsx)(je,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,Pr.jsxs)(le,{children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(C=>C.type==="digital").length}),(0,Pr.jsxs)("p",{className:"text-xs text-muted-foreground",children:[n.filter(C=>C.type==="digital"&&C.status==="active").length," ","active"]})]})]})]}),(0,Pr.jsx)(L,{children:(0,Pr.jsx)(le,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)(z,{placeholder:"Search colleagues...",value:p,onChange:C=>h(C.target.value),className:"pl-9"})]})}),(0,Pr.jsxs)(Fe,{value:g,onValueChange:y,children:[(0,Pr.jsx)(Ae,{className:"w-full md:w-[180px]",children:(0,Pr.jsx)($e,{placeholder:"Department"})}),(0,Pr.jsxs)(Ie,{children:[(0,Pr.jsx)(X,{value:"all",children:"All Departments"}),r.map(C=>(0,Pr.jsx)(X,{value:C,children:C},C))]})]}),(0,Pr.jsxs)(Fe,{value:b,onValueChange:f,children:[(0,Pr.jsx)(Ae,{className:"w-full md:w-[140px]",children:(0,Pr.jsx)($e,{placeholder:"Status"})}),(0,Pr.jsxs)(Ie,{children:[(0,Pr.jsx)(X,{value:"all",children:"All Status"}),(0,Pr.jsx)(X,{value:"active",children:"Active"}),(0,Pr.jsx)(X,{value:"inactive",children:"Inactive"})]})]}),(p||g!=="all"||b!=="all")&&(0,Pr.jsxs)(x,{variant:"outline",onClick:ht,className:"gap-2",children:[(0,Pr.jsx)(yt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)(so,{activeTab:T,onTabChange:V,tabOptions:[{value:"all",label:`All (${ve.length})`},{value:"human",label:`Human (${G.length})`},{value:"digital",label:`Digital (${E.length})`}],maxWidth:"400px",gridCols:3}),T==="all"&&(0,Pr.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:ve.map(C=>(0,Pr.jsx)(co,{colleague:C,onEdit:ze,onDelete:bt,onViewDetails:Ee,compact:i},`${C}-${C.id}`))}),T==="human"&&(0,Pr.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:G.map(C=>(0,Pr.jsx)(co,{colleague:C,onEdit:ze,onDelete:bt,onViewDetails:Ee,compact:i},C.id))}),T==="digital"&&(0,Pr.jsx)("div",{className:`grid gap-4 ${i?"grid-cols-1 md:grid-cols-2 lg:grid-cols-4":"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}`,children:E.map(C=>(0,Pr.jsx)(co,{colleague:C,onEdit:ze,onDelete:bt,onViewDetails:Ee,compact:i},C.id))})]}),ve.length===0&&(0,Pr.jsx)(L,{children:(0,Pr.jsx)(le,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No colleagues found"}),(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:p||g!=="all"||b!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,Pr.jsxs)(x,{onClick:ie,className:"gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function fo({files:e,onFileClick:t,onFileEdit:o,onFileDelete:a,showHeader:i=!0,className:r}){return(0,Pr.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,Pr.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,Pr.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Pr.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Pr.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,Pr.jsx)("div",{className:"divide-y",children:e.map(m=>(0,Pr.jsxs)(Bo.motion.div,{whileHover:{backgroundColor:"rgba(0,0,0,0.02)"},className:"p-3 md:grid md:grid-cols-10 items-center flex flex-col md:flex-row gap-3 md:gap-0 cursor-pointer",onClick:()=>t?.(m),children:[(0,Pr.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Pr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Pr.jsx)("div",{children:(0,Pr.jsx)("p",{className:"font-medium",children:m.name})})]}),(0,Pr.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:m.filesize}),(0,Pr.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Pr.jsx)("span",{className:"text-sm md:text-base",children:typeof m.createdAt=="string"?m.createdAt:new Date(m.createdAt).toLocaleDateString()}),(0,Pr.jsx)("div",{className:"flex gap-1",children:(0,Pr.jsx)(x,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),a?.(m)},children:(0,Pr.jsx)(yt.Trash2,{className:"h-4 w-4"})})})]})]},m.name))})]})}function $a({initialFiles:e=[],onFileAdd:t,onFileEdit:o,onFileDelete:a,onFileClick:i,compactView:r=!1,className:m}){let[s,c]=(0,Mt.useState)(e),[n,d]=(0,Mt.useState)(""),[p,h]=(0,Mt.useState)("all"),[g,y]=(0,Mt.useState)("all");(0,Mt.useEffect)(()=>{c(e)},[e]);let b=Array.from(new Set(s.map(S=>S.mimeType))),f=s.filter(S=>{let re=S.name.toLowerCase().includes(n.toLowerCase()),R=p==="all"||S.mimeType===p;return re&&R}),T=f.slice(0,10),V=f.filter(Boolean),_=()=>{t?.()},Y=S=>{o?.(S)},w=S=>{console.log("deleting file",S),c(re=>re.filter(R=>R.name!==S.name)),a?.(S.id)},U=S=>{i?.(S)},ge=()=>{d(""),h("all")};return(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsx)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Pr.jsxs)("div",{className:`space-y-6 ${m||""}`,children:[(0,Pr.jsx)(Qe,{title:"Files",description:"Manage and organize your files and documents.",gradient:"bg-gradient-to-r from-blue-600 via-indigo-600 to-purple-600",primaryAction:{label:"Upload file",onClick:_},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Pr.jsx)(L,{children:(0,Pr.jsx)(le,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)(yt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Pr.jsx)(z,{placeholder:"Search files...",value:n,onChange:S=>d(S.target.value),className:"pl-9"})]})}),(n||p!=="all")&&(0,Pr.jsxs)(x,{variant:"outline",onClick:ge,className:"gap-2",children:[(0,Pr.jsx)(yt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)(so,{activeTab:g,onTabChange:y,tabOptions:[{value:"all",label:`All Files (${f.length})`},{value:"recent",label:`Recent (${T.length})`}],maxWidth:"500px",gridCols:3}),g==="all"&&(0,Pr.jsx)(fo,{files:f,onFileClick:U,onFileEdit:Y,onFileDelete:w,showHeader:!r}),g==="recent"&&(0,Pr.jsx)(fo,{files:T,onFileClick:U,onFileEdit:Y,onFileDelete:w,showHeader:!r}),g==="shared"&&(0,Pr.jsx)(fo,{files:V,onFileClick:U,onFileEdit:Y,onFileDelete:w,showHeader:!r})]}),f.length===0&&(0,Pr.jsx)(L,{children:(0,Pr.jsx)(le,{className:"Pr-6",children:(0,Pr.jsxs)("div",{className:"text-center py-8",children:[(0,Pr.jsx)(yt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Pr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Pr.jsx)("p",{className:"text-muted-foreground mb-4",children:n||p!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,Pr.jsxs)(x,{onClick:_,className:"gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}function ai({document:e,onSave:t,onCancel:o,availableDocuments:a=[],knowledgeContexts:i=[]}){let[r,m]=(0,Mt.useState)({...e,updatedAt:new Date}),s=()=>{let b=new Set,f=new Set;return i.forEach(T=>{T.menuConfig.groupBy.forEach(V=>b.add(V))}),a.forEach(T=>{T.metadata&&Object.keys(T.metadata).forEach(V=>f.add(V))}),{contextKeys:Array.from(b).sort(),documentKeys:Array.from(f).sort(),allKeys:Array.from(new Set([...b,...f])).sort()}},c=b=>{let f=new Set;return a.forEach(T=>{T.metadata?.[b]&&f.add(String(T.metadata[b]))}),Array.from(f).sort()},n=s(),d=()=>{t(r)},p=(b,f)=>{m(T=>({...T,metadata:{...T.metadata,[b]:f}}))},h=(b,f)=>{f==="__custom__"?p(b,""):p(b,f)},g=()=>{let b=`field_${Date.now()}`;p(b,"")},y=b=>{m(f=>{let T={...f.metadata};return delete T[b],{...f,metadata:T}})};return(0,$.jsxs)(Bo.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)(yt.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)(x,{variant:"outline",size:"sm",onClick:o,className:"gap-2",children:[(0,$.jsx)(yt.X,{className:"h-4 w-4"}),"Cancel"]}),(0,$.jsxs)(x,{size:"sm",onClick:d,className:"gap-2",children:[(0,$.jsx)(yt.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)(z,{value:r.title,onChange:b=>m(f=>({...f,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)(ye,{value:r.description||"",onChange:b=>m(f=>({...f,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-xs text-muted-foreground",children:["Suggested: ",n.contextKeys.slice(0,4).join(", "),n.contextKeys.length>4&&` +${n.contextKeys.length-4}`]})]}),(0,$.jsxs)(x,{type:"button",variant:"outline",size:"sm",onClick:g,className:"gap-1 h-8",children:[(0,$.jsx)(yt.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,f])=>{let T=c(b);return(0,$.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,$.jsx)(z,{value:b,onChange:V=>{let _=V.target.value,Y=r.metadata?.[b];m(w=>{let U={...w.metadata};return delete U[b],_&&(U[_]=Y||""),{...w,metadata:U}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${b}`}),(0,$.jsx)("datalist",{id:`metadata-keys-${b}`,children:n.allKeys.map(V=>(0,$.jsx)("option",{value:V},V))}),(0,$.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),T.length>0?(0,$.jsxs)(Fe,{value:String(f||""),onValueChange:V=>h(b,V),children:[(0,$.jsx)(Ae,{className:"flex-1 h-8 text-sm",children:(0,$.jsx)($e,{placeholder:"Value"})}),(0,$.jsxs)(Ie,{children:[T.map(V=>(0,$.jsx)(X,{value:V,children:V},V)),(0,$.jsx)(X,{value:"__custom__",children:(0,$.jsx)("span",{className:"text-muted-foreground text-xs",children:"Custom..."})})]})]}):(0,$.jsx)(z,{value:String(f||""),onChange:V=>p(b,V.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,$.jsx)(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>y(b),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,$.jsx)(yt.X,{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-xs text-muted-foreground",children:'No metadata \u2022 Click "Add" to 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)(W,{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)(ye,{value:r.content||"",onChange:b=>m(f=>({...f,content:b.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var si=e=>(0,Pr.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`(.*?)`/g,'<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>')}}),oi=e=>(0,Pr.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),ln=e=>(0,Pr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Pr.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,Pr.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,Pr.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,Pr.jsx)("pre",{className:"text-sm",children:e})]}),dn=e=>(0,Pr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,Pr.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,Pr.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,Pr.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),si(e)]});function ni({document:e,onDocumentUpdate:t,editable:o=!0,renderers:a,availableDocuments:i=[],knowledgeContexts:r=[]}){let[m,s]=(0,Mt.useState)(!1),c=g=>{switch(g){case"markdown":case"mdx":return(0,Pr.jsx)(yt.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,Pr.jsx)(yt.File,{className:"h-6 w-6 text-success"});case"text":return(0,Pr.jsx)(yt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Pr.jsx)(yt.File,{className:"h-6 w-6 text-muted-foreground"})}},n=g=>{switch(g){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=(g,y)=>{let b={markdown:si,mdx:dn,richtext:ln,text:oi},f=a?.[y]||b[y];return f?f(g):oi(g)},p=g=>{s(!1),t?.(g)},h=()=>{s(!1)};return m?(0,Pr.jsx)(ai,{document:e,onSave:p,onCancel:h,availableDocuments:i,knowledgeContexts:r}):(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,Pr.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,Pr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Pr.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,Pr.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:c(e.format)}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,Pr.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),o&&(0,Pr.jsx)("div",{className:"flex-shrink-0",children:(0,Pr.jsxs)(x,{variant:"outline",size:"sm",onClick:()=>s(!0),className:"gap-2",children:[(0,Pr.jsx)(yt.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,Pr.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(g=>(0,Pr.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",g]},g))]})]}),(0,Pr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,Pr.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,Pr.jsxs)("div",{className:"mb-6",children:[(0,Pr.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,Pr.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,Pr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-xs",children:Object.entries(e.metadata).map(([g,y])=>(0,Pr.jsxs)("div",{className:"flex gap-1",children:[(0,Pr.jsxs)("span",{className:"text-muted-foreground font-medium",children:[g.replace(/([A-Pr])/g," $1").trim(),":"]}),(0,Pr.jsx)("span",{className:"text-foreground truncate",children:String(y)})]},g))})})]}),(0,Pr.jsx)("div",{className:"space-y-4",children:e.content?(0,Pr.jsx)("div",{className:"relative",children:(0,Pr.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:d(e.content,e.format)})}):(0,Pr.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,Pr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,Pr.jsx)(yt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Pr.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"No content available"}),(0,Pr.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function li({label:e,documents:t,children:o,level:a,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:m=!0}){let[s,c]=(0,Mt.useState)(a===0),n=o&&Object.keys(o).length>0,d=t.length+(o?Object.values(o).reduce((g,y)=>g+y.documents.length,0):0),p=g=>{switch(g){case"markdown":case"mdx":return(0,Pr.jsx)(yt.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,Pr.jsx)(yt.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,Pr.jsx)(yt.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},h=g=>{let y=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return y[g%y.length]};return(0,Pr.jsxs)("div",{className:"space-y-1",children:[(n||t.length>0)&&(0,Pr.jsxs)(Bo.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:`${a*20}px`},onClick:()=>c(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Pr.jsx)("div",{className:`w-1 h-6 rounded-full ${h(a)}`}),(0,Pr.jsx)(Bo.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,Pr.jsx)(yt.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,Pr.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,Pr.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,Pr.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),m&&d>0&&(0,Pr.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,Pr.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-xs font-medium bg-muted text-muted-foreground rounded-full",children:d})})]})]}),(0,Pr.jsx)(Bo.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,Pr.jsxs)("div",{className:"Pr-2 space-y-1",children:[t.map((g,y)=>(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:y*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===g.id?"bg-primary/10 border-Pr-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${a*20+20}px`},onClick:()=>i?.(g),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,Pr.jsx)("div",{className:"flex-shrink-0",children:p(g.format)}),(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsx)("p",{className:`text-sm truncate transition-colors ${r===g.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:g.title}),g.description&&(0,Pr.jsx)("p",{className:"text-xs text-muted-foreground truncate Mt-0.5",children:g.description})]}),g.tags&&g.tags.length>0&&(0,Pr.jsx)("div",{className:"flex-shrink-0",children:(0,Pr.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:g.tags[0]})})]},g.id)),o&&Object.entries(o).map(([g,y])=>(0,Pr.jsx)(li,{label:g,documents:y.documents,children:y.children,level:a+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:m},g))]})})]})}function di({documents:e,menuConfig:t,onDocumentClick:o,onDocumentShare:a,onDocumentUpdate:i,selectedDocumentId:r,className:m,editable:s=!0}){let[c,n]=(0,Mt.useState)(""),[d,p]=(0,Mt.useState)(null),h=(0,Mt.useMemo)(()=>c?e.filter(b=>b.title.toLowerCase().includes(c.toLowerCase())||b.description?.toLowerCase().includes(c.toLowerCase())||b.tags?.some(f=>f.toLowerCase().includes(c.toLowerCase()))||Object.values(b.metadata||{}).some(f=>String(f).toLowerCase().includes(c.toLowerCase()))):e,[e,c]),g=(0,Mt.useMemo)(()=>{let b=(f,T)=>{if(T.length===0)return{};let[V,..._]=T;return f.reduce((w,U)=>{let ge=U.metadata?.[V]||"Uncategorized",S=String(ge);if(w[S]||(w[S]={documents:[],children:{}}),_.length===0)w[S].documents.push(U);else{let re=b([U],_),R=Object.keys(re)[0];R&&(w[S].children||(w[S].children={}),w[S].children[R]?w[S].children[R].documents.push(...re[R].documents):w[S].children[R]=re[R])}return w},{})};return b(h,t.groupBy)},[h,t.groupBy]),y=b=>{p(b),o?.(b)};return(0,Pr.jsxs)("div",{className:`flex h-full ${m||""}`,children:[(0,Pr.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,Pr.jsx)("div",{className:"p-6 border-b border-border",children:(0,Pr.jsxs)("div",{className:"relative",children:[(0,Pr.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,Pr.jsx)(yt.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,Pr.jsx)(z,{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,Pr.jsx)(za,{className:"h-[calc(100%-100px)]",children:(0,Pr.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(g).map(([b,f])=>(0,Pr.jsx)(li,{label:b,documents:f.documents,children:f.children,level:0,onDocumentClick:y,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},b)),Object.keys(g).length===0&&(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,Pr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,Pr.jsx)(yt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,Pr.jsx)("p",{className:"text-sm font-medium",children:"No documents found"}),(0,Pr.jsx)("p",{className:"text-xs Mt-1",children:"Try adjusting your search terms"})]})]})})]}),(0,Pr.jsx)("div",{className:"flex-1 bg-background",children:d?(0,Pr.jsx)(ni,{document:d,onDocumentUpdate:i,editable:s}):(0,Pr.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,Pr.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,Pr.jsx)(yt.FileText,{className:"h-10 w-10 text-primary"})}),(0,Pr.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,Pr.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}function Vo({documents:e=[],contexts:t=[],onDocumentClick:o=m=>console.log("Document clicked:",m),onDocumentShare:a=m=>console.log("Share document:",m),onLoadDocumentContent:i,selectedDocumentId:r}){let[m,s]=(0,Mt.useState)(t[0]);return!t||t.length===0?(0,Pr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Pr.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,Pr.jsx)(Qe,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"No contexts available"})})]}):(0,Pr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,Pr.jsx)(Qe,{title:"Knowledge",description:"Access, manage, and share all your team knowledge in one place.",gradient:"bg-gradient-to-r from-teal-600 via-cyan-600 to-blue-600",primaryAction:{label:"Create",onClick:()=>console.log("Create document clicked")}}),(0,Pr.jsxs)("div",{className:"Mt-6",children:[(0,Pr.jsx)("div",{className:"border-b border-border",children:(0,Pr.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(c=>(0,Pr.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 ${m.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))})}),m.description&&(0,Pr.jsx)("div",{className:"Mt-3 px-1",children:(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description})})]})]}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,Pr.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,Pr.jsx)(di,{documents:e,menuConfig:m.menuConfig,onDocumentClick:o,onDocumentShare:a,selectedDocumentId:r})})})]})}var cn=[{key:"kanban",icon:yt.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:yt.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:yt.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:yt.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:yt.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],mi=({currentView:e,onViewChange:t,children:o})=>(0,Pr.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Pr.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:cn.map(a=>{let i=a.icon,r=e===a.key;return(0,Pr.jsxs)("button",{onClick:()=>t(a.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?a.color:`${a.color}/75 hover:${a.color}`} ${a.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:a.title,children:[(0,Pr.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,Pr.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:a.label})]},a.key)})}),(0,Pr.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Pr.jsx)("div",{className:"w-full h-full",children:o})})]});var pi=({title:e,status:t,taskCount:o,children:a,onDrop:i,isCompact:r=!1,height:m})=>{let s=d=>{d.preventDefault()},c=d=>{d.preventDefault(),i(t)};return(0,Pr.jsxs)(L,{className:`p-4 bg-card border-Pr-4 ${(()=>{switch(t){case"todo":return"border-Pr-gray-400";case"in-progress":return"border-Pr-blue-500";case"review":return"border-Pr-orange-500";case"done":return"border-Pr-green-500";default:return"border-Pr-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${r?"lg:max-w-xs":""}`,style:{height:m||"calc(100vh - 350px)"},onDragOver:s,onDrop:c,children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Pr.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Pr.jsx)(W,{variant:"secondary",className:"bg-muted text-muted-foreground",children:o})]}),(0,Pr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:a})]})};var ho=({task:e,epic:t,onDragStart:o,onTaskClick:a,isCompact:i=!1})=>{let r=d=>{o(e)},m=()=>{a(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,Pr.jsx)(yt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Pr.jsx)(yt.Bug,{className:"h-3 w-3"});case"spike":return(0,Pr.jsx)(yt.Zap,{className:"h-3 w-3"});case"task":default:return(0,Pr.jsx)(yt.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,Pr.jsx)(L,{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:m,children:(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${n()}`,children:c()}),(0,Pr.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Pr.jsxs)(L,{className:"p-4 bg-card border border-border hover:border-accent cursor-pointer transition-all duration-200 hover:shadow-md",draggable:!0,onDragStart:r,onClick:m,children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Pr.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${n()}`,children:[c(),(0,Pr.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Pr.jsxs)("div",{className:"flex gap-1",children:[(0,Pr.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${s()}`,children:e.priority}),(0,Pr.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.points})]})]}),(0,Pr.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Pr.jsx)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.User,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:e.assignee?.value?.name})]})})]})};var Ga=Ne(require("react")),at=Ne(require("@radix-yt/react-dialog"));var ft=at.Root;var mn=at.Portal;var gi=Ga.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(at.Overlay,{ref:o,className:k("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}));gi.displayName=at.Overlay.displayName;var lt=Ga.forwardRef(({className:e,children:t,...o},a)=>(0,Pr.jsxs)(mn,{children:[(0,Pr.jsx)(gi,{}),(0,Pr.jsxs)(at.Content,{ref:a,className:k("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-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,Pr.jsxs)(at.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,Pr.jsx)(yt.X,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));lt.displayName=at.Content.displayName;var dt=({className:e,...t})=>(0,Pr.jsx)("div",{className:k("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});dt.displayName="DialogHeader";var Wa=({className:e,...t})=>(0,Pr.jsx)("div",{className:k("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Wa.displayName="DialogFooter";var ct=Ga.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(at.Title,{ref:o,className:k("text-lg font-semibold leading-none tracking-tight",e),...t}));ct.displayName=at.Title.displayName;var _a=Ga.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(at.Description,{ref:o,className:k("text-sm text-muted-foreground",e),...t}));_a.displayName=at.Description.displayName;var va=Ne(require("react")),Sa=Ne(require("@radix-yt/react-toggle-group"));var fi=Ne(require("react")),Uo=Ne(require("@radix-yt/react-toggle"));var Ko=(0,Sr.cva)("inline-flex items-center justify-center gap-2 rounded-md 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"}}),pn=fi.forwardRef(({className:e,variant:t,size:o,...a},i)=>(0,Pr.jsx)(Uo.Root,{ref:i,className:k(Ko({variant:t,size:o,className:e})),...a}));pn.displayName=Uo.Root.displayName;var bi=va.createContext({size:"default",variant:"default"}),ha=va.forwardRef(({className:e,variant:t,size:o,children:a,...i},r)=>(0,Pr.jsx)(Sa.Root,{ref:r,className:k("flex items-center justify-center gap-1",e),...i,children:(0,Pr.jsx)(bi.Provider,{value:{variant:t,size:o},children:a})}));ha.displayName=Sa.Root.displayName;var ba=va.forwardRef(({className:e,children:t,variant:o,size:a,...i},r)=>{let m=va.useContext(bi);return(0,Pr.jsx)(Sa.Item,{ref:r,className:k(Ko({variant:m.variant||o,size:m.size||a}),e),...i,children:t})});ba.displayName=Sa.Item.displayName;var un=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:yt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:yt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:yt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:yt.Zap}],gn=[{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"}],xo=({isOpen:e,onClose:t,onAddTask:o,epics:a,sprints:i,assignees:r,defaultEpicId:m})=>{let[s,c]=(0,Mt.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""});(0,Mt.useEffect)(()=>{e&&m&&c(p=>({...p,epicId:m}))},[e,m]),(0,Mt.useEffect)(()=>{e&&c({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:m||"",sprintId:"none",assignee:""})},[e]);let n=p=>{p.preventDefault(),s.name.trim()&&(o({name:s.name.trim(),description:s.description.trim(),status:"todo",priority:s.priority,type:s.type,points:s.points,epicId:s.epicId,sprintId:s.sprintId==="none"?void 0:s.sprintId,assignee:s.assignee.trim()||"Unassigned"}),c({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:m||"",sprintId:"none",assignee:""}),t())},d=(p,h)=>{c(g=>({...g,[p]:h}))};return(0,Pr.jsx)(ft,{open:e,onOpenChange:t,children:(0,Pr.jsxs)(lt,{className:"sm:max-w-md",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Task"})}),(0,Pr.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",children:"Task Title"}),(0,Pr.jsx)(z,{id:"name",value:s.name,onChange:p=>d("name",p.target.value),placeholder:"Enter task title",required:!0})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:s.description,onChange:p=>d("description",p.target.value),placeholder:"Enter task description",rows:3})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Type"}),(0,Pr.jsx)(ha,{type:"single",value:s.type,onValueChange:p=>p&&d("type",p),children:un.map(p=>{let h=p.icon;return(0,Pr.jsxs)(ba,{value:p.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Pr.jsx)(h,{className:"h-4 w-4"}),p.label]},p.value)})})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Priority"}),(0,Pr.jsx)(ha,{type:"single",value:s.priority,onValueChange:p=>p&&d("priority",p),children:gn.map(p=>(0,Pr.jsx)(ba,{value:p.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:p.label},p.value))})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"points",children:"Story Points"}),(0,Pr.jsx)(z,{id:"points",type:"number",min:"1",max:"100",value:s.points,onChange:p=>d("points",parseInt(p.target.value)||1),placeholder:"Enter story points",required:!0})]}),!m&&(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"epic",children:"Epic"}),(0,Pr.jsxs)(Fe,{value:s.epicId,onValueChange:p=>d("epicId",p),children:[(0,Pr.jsx)(Ae,{children:(0,Pr.jsx)($e,{placeholder:"Select an epic"})}),(0,Pr.jsx)(Ie,{children:a.map(p=>(0,Pr.jsx)(X,{value:p.id,children:(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${p.color}`}),p.name]})},p.id))})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Pr.jsxs)(Fe,{value:s.sprintId,onValueChange:p=>d("sprintId",p),children:[(0,Pr.jsx)(Ae,{children:(0,Pr.jsx)($e,{placeholder:"Select a sprint"})}),(0,Pr.jsxs)(Ie,{children:[(0,Pr.jsx)(X,{value:"none",children:"No Sprint"}),i.map(p=>(0,Pr.jsx)(X,{value:p.id,children:(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[p.name,p.isActive&&(0,Pr.jsx)("span",{className:"text-xs bg-green-100 text-green-800 px-1 rounded",children:"Active"})]})},p.id))]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"sprint",children:"Assignee"}),(0,Pr.jsxs)(Fe,{value:s.assignee,onValueChange:p=>d("assignee",p),children:[(0,Pr.jsx)(Ae,{children:(0,Pr.jsx)($e,{placeholder:"Select an Assignee"})}),(0,Pr.jsxs)(Ie,{children:[(0,Pr.jsx)(X,{value:"none",children:"No Assignee"}),r.map(p=>(0,Pr.jsx)(X,{value:p.id,children:(0,Pr.jsx)("div",{className:"flex items-center gap-2",children:p.name})},p.id))]})]})]}),(0,Pr.jsxs)(Wa,{children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Go=({fieldName:e,value:t,label:o,multiline:a=!1,onSave:i,className:r="",disabled:m=!1})=>{let[s,c]=(0,$o.useState)(!1),[n,d]=(0,$o.useState)(""),p=()=>{m||(c(!0),d(t))},h=async()=>{n!==t&&await i(e,n),c(!1)},g=y=>{y.key==="Enter"&&!a||y.key==="Enter"&&y.ctrlKey&&a?h():y.key==="Escape"&&(c(!1),d(""))};return(0,Pr.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Pr.jsx)(D,{children:o}),s?a?(0,Pr.jsx)(ye,{value:n,onChange:y=>d(y.target.value),onBlur:h,onKeyDown:g,autoFocus:!0,rows:4,className:"resize-none"}):(0,Pr.jsx)(z,{value:n,onChange:y=>d(y.target.value),onBlur:h,onKeyPress:g,autoFocus:!0,className:"text-lg font-medium"}):(0,Pr.jsxs)("div",{onClick:p,className:`${m?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted/50 p-2 rounded border border-transparent hover:border-border transition-colors group ${a?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,Pr.jsx)("span",{className:a?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!m&&(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var wi=({comments:e,onAddComment:t})=>{let[o,a]=(0,Mt.useState)(""),i=m=>m.split(" ").map(s=>s[0]).join("").toUpperCase(),r=()=>{o.trim()&&(t(o),a(""))};return(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.MessageSquare,{className:"h-5 w-5"}),(0,Pr.jsx)(D,{className:"text-lg font-medium",children:"Comments"}),(0,Pr.jsx)(W,{variant:"secondary",children:e.length})]}),(0,Pr.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(m=>(0,Pr.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Pr.jsx)(Kt,{className:"h-8 w-8 Mt-1",children:(0,Pr.jsx)($t,{className:"text-xs bg-muted text-muted-foreground",children:i(m.author)})}),(0,Pr.jsxs)("div",{className:"flex-1",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Pr.jsx)("span",{className:"font-medium text-sm",children:m.author}),(0,Pr.jsxs)("span",{className:"text-xs text-muted-foreground",children:[m.createdAt.toLocaleDateString()," at ",m.createdAt.toLocaleTimeString()]})]}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground",children:m.text})]})]},m.id))}),(0,Pr.jsxs)("div",{className:"flex gap-2",children:[(0,Pr.jsx)(ye,{value:o,onChange:m=>a(m.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Pr.jsx)(x,{onClick:r,disabled:!o.trim(),size:"sm",className:"self-end",children:(0,Pr.jsx)(yt.Send,{className:"h-4 w-4"})})]})]})};var wo=({label:e,value:t,onValueChange:o,options:a,showColor:i=!1,disabled:r=!1})=>{let[m,s]=(0,Mt.useState)(!1),c=a.find(d=>d.value===t);return(0,Pr.jsxs)("div",{className:"space-y-1",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:e}),(0,Pr.jsxs)(Fe,{value:t,onValueChange:o,open:m,onOpenChange:d=>{r||s(d)},disabled:r,children:[(0,Pr.jsx)(Ae,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Pr.jsxs)(W,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&s(!m),children:[i&&c?.color&&(0,Pr.jsx)("div",{className:`w-2 h-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,Pr.jsx)(Ie,{children:a.map(d=>(0,Pr.jsx)(X,{value:d.value,children:i&&d.color?(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${d.color}`}),d.label]}):d.label},d.value))})]})]})};var Ci=({label:e,value:t,onValueChange:o,options:a,placeholder:i="Search...",allowCustomValue:r=!1,disabled:m=!1})=>{let[s,c]=(0,Mt.useState)(!1),[n,d]=(0,Mt.useState)(""),p=a.find(f=>f.value===t),h=a.filter(f=>f.label.toLowerCase().includes(n.toLowerCase())),g=f=>{o(f),c(!1),d("")},y=()=>{r&&n.trim()&&!a.find(f=>f.value===n.trim())&&(o(n.trim()),c(!1),d(""))};return(0,Pr.jsxs)("div",{className:"space-y-1",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:e}),(0,Pr.jsxs)(Fe,{value:t,onValueChange:g,open:s,onOpenChange:f=>{m||c(f)},disabled:m,children:[(0,Pr.jsx)(Ae,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Pr.jsx)(W,{variant:"secondary",className:`${m?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!m&&c(!s),children:p?.label||t||"Select..."})}),(0,Pr.jsxs)(Ie,{children:[(0,Pr.jsx)("div",{className:"p-2",children:(0,Pr.jsx)(z,{placeholder:i,value:n,onChange:f=>d(f.target.value),onKeyDown:f=>{f.key==="Enter"&&r&&y()},className:"mb-2"})}),h.map(f=>(0,Pr.jsx)(X,{value:f.value,children:f.label},f.value)),r&&n.trim()&&!h.find(f=>f.value===n.trim())&&(0,Pr.jsxs)(X,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var fn=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:yt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:yt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:yt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:yt.Zap}],vn=[{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 ki=({task:e,epics:t,sprints:o,lastUpdated:a,onUpdateTask:i,onClose:r,onDelete:m,isUpdating:s=!1,isDeleting:c=!1,deleteState:n="idle",teamMembers:d})=>{let p=g=>g.split(" ").map(y=>y[0]).join("").toUpperCase(),h=()=>n==="loading"?(0,Pr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Pr.jsx)(yt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):n==="success"?(0,Pr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Pr.jsx)(yt.Check,{className:"h-3 w-3"}),"Deleted"]}):n==="error"?(0,Pr.jsxs)(x,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Pr.jsx)(yt.X,{className:"h-3 w-3"}),"Delete failed"]}):(0,Pr.jsxs)(x,{onClick:m,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:s||c,children:[(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Pr.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Pr.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Pr.jsx)(wo,{label:"",value:e.status,onValueChange:g=>i("status",g),options:[{value:"todo",label:"Bo Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Pr.jsx)(ha,{type:"single",value:e.type,onValueChange:g=>g&&i("type",g),className:"grid grid-cols-2 gap-1",disabled:s,children:fn.map(g=>{let y=g.icon;return(0,Pr.jsxs)(ba,{value:g.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,Pr.jsx)(y,{className:"h-3 w-3"}),g.label]},g.value)})})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Pr.jsx)(ha,{type:"single",value:e.priority,onValueChange:g=>g&&i("priority",g),className:"grid grid-cols-3 gap-1",disabled:s,children:vn.map(g=>(0,Pr.jsx)(ba,{value:g.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:g.label},g.value))})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Pr.jsx)("input",{type:"number",min:"1",max:"100",value:e.points||1,onChange:g=>i("points",g.target.value),className:"w-full h-8 px-2 text-xs border border-border rounded-md 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,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Pr.jsx)(wo,{label:"",value:e.epicId,onValueChange:g=>i("epicId",g),options:(t||[]).map(g=>({value:g.id,label:g?.name,color:g.color})),showColor:!0,disabled:s})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Pr.jsx)(wo,{label:"",value:e.sprintId||"none",onValueChange:g=>i("sprintId",g==="none"?"":g),options:[{value:"none",label:"No Sprint"},...(o||[]).map(g=>({value:g.id,label:`${g?.name}${g.isActive?" (Active)":""}`}))],disabled:s})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Pr.jsx)(Ci,{label:"",value:e.assignee?.value?.name,onValueChange:g=>i("assignee",g),options:d.map(g=>({value:`${typeof g.email=="string"?"users":"digital-colleagues"}:${g.id}`,label:g?.name})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,Pr.jsxs)("div",{className:"Mt-auto Pr-4 space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(x,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:s||c,children:"Close"}),h()]}),(0,Pr.jsxs)("div",{className:"Pr-4 border-t border-border space-y-2",children:[(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.User,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:"System"})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.Clock,{className:"h-3 w-3"}),(0,Pr.jsxs)("span",{children:[new Date(a).toLocaleDateString()," at"," ",new Date(a).toLocaleTimeString()]})]})]})]})]})]})};var Di=({isOpen:e,onClose:t,initialTask:o,epics:a,sprints:i,onUpdateTask:r,onDeleteTask:m,onAddComment:s,colleagues:c})=>{let[n,d]=(0,Mt.useState)(o),[p,h]=(0,Mt.useState)(new Date),[g,y]=(0,Mt.useState)("idle"),[b,f]=(0,Mt.useState)("idle"),[T,V]=(0,Mt.useState)([]);(0,Mt.useEffect)(()=>{d(o)},[o]);let _=async(R,ve)=>{if(ve!==n[R]){y("loading");try{let G=await r(n.id,{[R]:ve});d(G),h(new Date),y("success"),setTimeout(()=>y("idle"),1500)}catch{y("error"),setTimeout(()=>y("idle"),3e3)}}},Y=async(R,ve)=>{if(ve!==n[R]){y("loading");try{let G=await r(n.id,{[R]:ve});d(G),h(new Date),y("success"),setTimeout(()=>y("idle"),1500)}catch{y("error"),setTimeout(()=>y("idle"),3e3)}}},w=async R=>{if(s){y("loading");try{let ve=await s?.({content:R,taskId:n.id});d(ve),h(new Date),y("success"),setTimeout(()=>y("idle"),1500)}catch{y("error"),setTimeout(()=>y("idle"),3e3)}}},U=async()=>{f("loading");try{await m(n.id),f("success"),setTimeout(()=>{t(),f("idle")},1e3)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}},ge=g!=="loading"&&b!=="loading",S=()=>{ge&&t()},re=()=>g==="loading"?(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Pr.jsx)(yt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Pr.jsx)("span",{children:"Updating..."})]}):g==="success"?(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:"Updated successfully"})]}):g==="error"?(0,Pr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Pr.jsx)(yt.X,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:"Update failed"})]}):null;return(0,Pr.jsx)(ft,{open:e,onOpenChange:S,children:(0,Pr.jsxs)(lt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Pr.jsxs)(dt,{children:[(0,Pr.jsx)(ct,{className:"sr-only",children:n.name}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("div",{className:"flex-1",children:re()}),!ge&&(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Pr.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Pr.jsx)(Go,{fieldName:"name",value:n.name,label:"",onSave:_,className:"border-b border-border pb-3",disabled:g==="loading"}),(0,Pr.jsx)(Go,{fieldName:"description",value:n.description,label:"Description",multiline:!0,onSave:_,disabled:g==="loading"}),(0,Pr.jsx)(wi,{comments:(n?.comments||[]).map(R=>({author:R.author.value.name,createdAt:new Date(R.timestamp),text:R.content,id:R.id})),onAddComment:w})]}),(0,Pr.jsx)(ki,{task:n,epics:a,sprints:i,lastUpdated:p,onUpdateTask:Y,onClose:S,onDelete:U,isUpdating:g==="loading",isDeleting:b==="loading",deleteState:b,teamMembers:c})]})]})})};var No=({isOpen:e,onClose:t,onAddEpic:o})=>{let[a,i]=(0,Mt.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"],m=[{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(),a.name.trim()&&(o({name:a.name.trim(),description:a.description.trim(),color:a.color,confidence:a.confidence,phase:a.phase,startDate:new Date(a.startDate),endDate:new Date(a.endDate),progress:a.progress,isSelected:!0}),i({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}),t())},n=(d,p)=>{i(h=>({...h,[d]:p}))};return(0,Pr.jsx)(ft,{open:e,onOpenChange:t,children:(0,Pr.jsxs)(lt,{className:"sm:max-w-md",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Epic"})}),(0,Pr.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",children:"Epic Name"}),(0,Pr.jsx)(z,{id:"name",value:a.name,onChange:d=>n("name",d.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:a.description,onChange:d=>n("description",d.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Color"}),(0,Pr.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(d=>(0,Pr.jsx)("button",{type:"button",onClick:()=>n("color",d),className:`w-8 h-8 rounded-full ${d} ${a.color===d?"ring-2 ring-gray-400":""}`},d))})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Confidence"}),(0,Pr.jsxs)(Fe,{value:a.confidence,onValueChange:d=>n("confidence",d),children:[(0,Pr.jsx)(Ae,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsx)(Ie,{children:m.map(d=>(0,Pr.jsx)(X,{value:d.value,children:d.label},d.value))})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Phase"}),(0,Pr.jsxs)(Fe,{value:a.phase.toString(),onValueChange:d=>n("phase",parseInt(d)),children:[(0,Pr.jsx)(Ae,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsx)(Ie,{children:s.map(d=>(0,Pr.jsx)(X,{value:d.value.toString(),children:d.label},d.value))})]})]})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Start Date"}),(0,Pr.jsx)(z,{type:"date",value:a.startDate,onChange:d=>n("startDate",d.target.value)})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"End Date"}),(0,Pr.jsx)(z,{type:"date",value:a.endDate,onChange:d=>n("endDate",d.target.value)})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Progress (%)"}),(0,Pr.jsx)(z,{type:"number",min:"0",max:"100",value:a.progress,onChange:d=>n("progress",parseInt(d.target.value)||0)})]}),(0,Pr.jsxs)(Wa,{children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Ti=({initialTasks:e=[],initialEpics:t=[],initialSprints:o=[],initialUsers:a=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:m,onUpdateTask:s,onDeleteTask:c,onTaskClick:n,onAddEpic:d,onAddComment:p})=>{let[h,g]=(0,Mt.useState)(e),[y,b]=(0,Mt.useState)(t),[f,T]=(0,Mt.useState)(o),[V,_]=(0,Mt.useState)(!1),[Y,w]=(0,Mt.useState)(!1),[U,ge]=(0,Mt.useState)(null),[S,re]=(0,Mt.useState)(null),[R,ve]=(0,Mt.useState)(a),[G,E]=(0,Mt.useState)(i),[ie,ze]=(0,Mt.useState)(0),Ee=(0,Mt.useRef)(null),we=(0,Mt.useRef)(null),ut=y.filter(j=>!0).map(j=>j.id),st=f.find(j=>j.isSelected);ut.push("no-epic"),(0,Mt.useEffect)(()=>{g(e)},[e]),(0,Mt.useEffect)(()=>{b(t)},[t]),(0,Mt.useEffect)(()=>{T(o)},[o]),(0,Mt.useEffect)(()=>{let j=()=>{if(Ee.current){let Xe=Ee.current.offsetHeight;ze(Xe)}};j();let fe=new ResizeObserver(j);Ee.current&&fe.observe(Ee.current);let ke=()=>{setTimeout(j,100)};return window.addEventListener("storage",ke),()=>{fe.disconnect(),window.removeEventListener("storage",ke)}},[]),(0,Mt.useEffect)(()=>{let j=setTimeout(()=>{Ee.current&&ze(Ee.current.offsetHeight)},300);return()=>clearTimeout(j)},[V,Y]);let Nt=h.filter(j=>{let fe=ut.includes(j.epicId)||!j.epicId;return!st||st.id==="all-tasks"?fe:st.id==="backlog"?fe&&!j.sprintId:fe&&j.sprintId===st.id}),Ve=j=>Nt.filter(fe=>fe.status===j),rt=j=>{let fe={};return y.forEach(ke=>{fe[ke.id]=j.filter(Xe=>Xe.epicId===ke.id)}),fe["no-epic"]=j.filter(ke=>!ke.epicId),fe},At=j=>{re(j)},bt=j=>{S&&(g(fe=>fe.map(ke=>ke.id===S.id?{...ke,status:j}:ke)),s?.(S.id,{status:j}),re(null))},ht=j=>{let fe={...j,id:Date.now().toString(),createdAt:new Date};g(ke=>[...ke,fe]),m?.(j)},It=async(j,fe)=>{g(Xe=>Xe.map(v=>v.id===j?{...v,...fe}:v)),s&&await s(j,fe);let ke=h.find(Xe=>Xe.id===j);if(!ke)throw new Error("Task not found");return{...ke,...fe}},C=async j=>{g(fe=>fe.filter(ke=>ke.id!==j)),U?.id===j&&ge(null),c&&await c(j)},Me=j=>{let fe={...j,id:Date.now().toString(),isSelected:!0};b(ke=>[...ke,fe]),d?.(j)},xe=j=>{ge(j),n?.(j)},Ct=[{id:"todo",title:"Bo Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Lt=ie>0?`calc(100vh - ${ie+120}px)`:"calc(100vh - 12rem)";return(0,Pr.jsxs)("div",{ref:we,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Pr.jsx)("div",{ref:Ee,className:"flex-shrink-0",children:(0,Pr.jsx)(Qe,{title:"Project Board",description:"Manage tasks and track progress across your project sprints.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"Add task",onClick:()=>_(!0)},secondaryAction:{label:"Add epic",onClick:()=>w(!0)}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 Mt-8",children:(0,Pr.jsx)("div",{className:"h-full",style:{height:ie>0?`calc(100vh - ${ie+120}px)`:"calc(100vh - 12rem)"},children:(0,Pr.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:Ct.map(j=>{let fe=Ve(j.status),ke=rt(fe);return(0,Pr.jsx)(pi,{title:j.title,status:j.status,taskCount:fe.length,onDrop:bt,isCompact:j.status==="done",height:Lt,children:ut.map(Xe=>{let v=y.find(se=>se.id===Xe),B=ke[Xe]||[];return B.length===0?null:(0,Pr.jsxs)("div",{className:"mb-6",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${v?.color}`}),(0,Pr.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:v?.name||"No Epic"}),(0,Pr.jsx)(W,{variant:"secondary",className:"text-xs",children:B.length})]})," ",(0,Pr.jsx)("div",{className:"space-y-3",children:B.map(se=>(0,Pr.jsx)(ho,{task:se,epic:v,onDragStart:At,onTaskClick:xe,isCompact:j.status==="done"},se.id))})]},Xe)})},j.id)})})})}),(0,Pr.jsx)(xo,{isOpen:V,onClose:()=>_(!1),onAddTask:ht,assignees:[...G,...R],epics:y,sprints:f}),(0,Pr.jsx)(No,{isOpen:Y,onClose:()=>w(!1),onAddEpic:Me}),U&&(0,Pr.jsx)(Di,{isOpen:!!U,onClose:()=>ge(null),initialTask:U,epics:y,sprints:f,onUpdateTask:It,onDeleteTask:C,colleagues:[...G,...R],onAddComment:p})]})};var Pi=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:m,onUpdateEpic:s,onDeleteEpic:c})=>{let[n,d]=(0,Mt.useState)(null),[p,h]=(0,Mt.useState)(null),[g,y]=(0,Mt.useState)({}),[b,f]=(0,Mt.useState)(0),T=(0,Mt.useRef)(null),V=(0,Mt.useRef)(null);(0,Mt.useEffect)(()=>{let E=()=>{if(T.current){let Ee=T.current.offsetHeight;f(Ee)}};E();let ie=new ResizeObserver(E);T.current&&ie.observe(T.current);let ze=()=>{setTimeout(E,100)};return window.addEventListener("storage",ze),()=>{ie.disconnect(),window.removeEventListener("storage",ze)}},[]),(0,Mt.useEffect)(()=>{let E=setTimeout(()=>{T.current&&f(T.current.offsetHeight)},300);return()=>clearTimeout(E)},[p]);let _=E=>{d(E)},Y=E=>{E.preventDefault()},w=(E,ie)=>{E.preventDefault(),n&&n.epicId!==ie&&(a(n.id,{epicId:ie}),d(null))},U=E=>e.filter(ie=>ie.epicId===E),ge=E=>{h(E.id),y({name:E.name,description:E.description,confidence:E.confidence,phase:E.phase,progress:E.progress})},S=()=>{p&&g.name&&(s(p,g),h(null),y({}))},re=()=>{h(null),y({})},R=E=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&c(E)},ve=E=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[E]||`Phase ${E}`,G=E=>{switch(E){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,Pr.jsxs)("div",{ref:V,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Pr.jsx)("div",{ref:T,className:"flex-shrink-0",children:(0,Pr.jsx)(Qe,{title:"Epic Planning",description:"Organize and manage your project epics, track progress, and assign tasks.",gradient:"bg-gradient-to-r from-rose-600 via-pink-600 to-fuchsia-600",primaryAction:{label:"Add epic",onClick:m}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 Mt-8",children:(0,Pr.jsx)("div",{className:"h-full overflow-y-auto",style:{height:b>0?`calc(100vh - ${b+120}px)`:"calc(100vh - 12rem)"},children:(0,Pr.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 auto-rows-max",children:t.map(E=>{let ie=U(E.id),ze=ie.reduce((we,ut)=>we+ut.points,0),Ee=b>0?`calc(100vh - ${b+200}px)`:"calc(100vh - 14rem)";return(0,Pr.jsxs)(L,{className:`flex flex-col ${p===E.id?"h-auto":""} bg-card shadow-sm`,style:{height:p===E.id?"auto":Ee,minHeight:"400px"},onDragOver:Y,onDrop:we=>w(we,E.id),children:[(0,Pr.jsx)("div",{className:"p-4 border-b border-border",children:p===E.id?(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)(z,{value:g.name||"",onChange:we=>y({...g,name:we.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Pr.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:S,className:"p-1 h-8 w-8",children:(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"})}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:re,className:"p-1 h-8 w-8",children:(0,Pr.jsx)(yt.X,{className:"h-4 w-4"})})]})]}),(0,Pr.jsx)(ye,{value:g.description||"",onChange:we=>y({...g,description:we.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Pr.jsxs)("select",{value:g.confidence||E.confidence,onChange:we=>y({...g,confidence:we.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs 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,Pr.jsx)("option",{value:"low",children:"Low"}),(0,Pr.jsx)("option",{value:"medium",children:"Medium"}),(0,Pr.jsx)("option",{value:"high",children:"High"})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Pr.jsx)("select",{value:g.phase?.toString()||E.phase.toString(),onChange:we=>y({...g,phase:parseInt(we.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs 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(we=>(0,Pr.jsxs)("option",{value:we.toString(),children:["Phase ",we]},we))})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("label",{className:"text-xs text-muted-foreground",children:"Progress (%)"}),(0,Pr.jsx)(z,{type:"number",min:"0",max:"100",value:g.progress||E.progress,onChange:we=>y({...g,progress:parseInt(we.target.value)||0}),className:"text-xs"})]})]}):(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Pr.jsx)("div",{className:`w-4 h-4 rounded-full ${E.color}`}),(0,Pr.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:E.name}),(0,Pr.jsxs)("div",{className:"flex gap-1",children:[(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>ge(E),className:"p-1 h-8 w-8",children:(0,Pr.jsx)(yt.Edit2,{className:"h-3 w-3"})}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>R(E.id),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Pr.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Pr.jsxs)(W,{className:`text-xs ${G(E.confidence)}`,children:[E.confidence," confidence"]}),(0,Pr.jsxs)(W,{variant:"outline",className:"text-xs",children:["Phase ",E.phase]}),(0,Pr.jsxs)(W,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[ie.length," tasks"]}),(0,Pr.jsxs)(W,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[ze," pts"]})]}),E.description&&(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:E.description}),(0,Pr.jsxs)("div",{className:"mb-3",children:[(0,Pr.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground mb-1",children:[(0,Pr.jsx)("span",{className:"select-none",children:"Progress"}),(0,Pr.jsxs)("span",{className:"select-none",children:[E.progress,"%"]})]}),(0,Pr.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,Pr.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${E.progress}%`}})})]}),(0,Pr.jsxs)(x,{onClick:()=>r(E.id),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Pr.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Pr.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${n?"border-primary bg-primary/10":"border-border"}`,children:ie.length===0?(0,Pr.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,Pr.jsx)(yt.Move,{className:"h-8 w-8 mb-2"}),(0,Pr.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):ie.map(we=>(0,Pr.jsx)(ho,{task:we,epic:E,onDragStart:_,onTaskClick:i,isCompact:!0},we.id))})})]},E.id)})})})})]})};var Ri=require("react-day-picker");function Co({className:e,classNames:t,showOutsideDays:o=!0,...a}){return(0,Pr.jsx)(Ri.DayPicker,{showOutsideDays:o,weekStartsOn:1,className:k("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 Pr-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:k(ao({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-md w-8 font-normal text-[0.8rem]",row:"flex w-full Mt-2",cell:k("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-md",a.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-Pr-md first:[&:has([aria-selected])]:rounded-Pr-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:k(ao({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},...a})}Co.displayName="Calendar";var Ii=Ne(require("react")),Ht=Ne(require("@radix-yt/react-popover"));var qo=Ht.Root,Xo=Ht.Trigger;var ko=Ii.forwardRef(({className:e,align:t="center",sideOffset:o=4,...a},i)=>(0,Pr.jsx)(Ht.Portal,{children:(0,Pr.jsx)(Ht.Content,{ref:i,align:t,sideOffset:o,className:k("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md 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),...a})}));ko.displayName=Ht.Content.displayName;var Zo=require("date-fns");var Mi=({isOpen:e,onClose:t,onAddSprint:o})=>{let[a,i]=(0,Mt.useState)({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),r=s=>{s.preventDefault(),!(!a.name||!a.startDate||!a.endDate)&&(o({name:a.name,description:a.description,startDate:a.startDate,endDate:a.endDate,isActive:a.isActive,isSelected:!1}),i({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t())},m=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),t()};return(0,Pr.jsx)(ft,{open:e,onOpenChange:m,children:(0,Pr.jsxs)(lt,{className:"sm:max-w-md",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Sprint"})}),(0,Pr.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",children:"Sprint Name *"}),(0,Pr.jsx)(z,{id:"name",value:a.name,onChange:s=>i(c=>({...c,name:s.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:a.description,onChange:s=>i(c=>({...c,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"Start Date *"}),(0,Pr.jsxs)(qo,{children:[(0,Pr.jsx)(Xo,{asChild:!0,children:(0,Pr.jsxs)(x,{variant:"outline",className:k("w-full justify-start text-left font-normal",!a.startDate&&"text-muted-foreground"),children:[(0,Pr.jsx)(yt.CalendarIcon,{className:"mr-2 h-4 w-4"}),a.startDate?(0,Zo.format)(a.startDate,"PPP"):"Pick a date"]})}),(0,Pr.jsx)(ko,{className:"w-auto p-0",align:"start",children:(0,Pr.jsx)(Co,{mode:"single",selected:a.startDate,onSelect:s=>i(c=>({...c,startDate:s})),initialFocus:!0})})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{children:"End Date *"}),(0,Pr.jsxs)(qo,{children:[(0,Pr.jsx)(Xo,{asChild:!0,children:(0,Pr.jsxs)(x,{variant:"outline",className:k("w-full justify-start text-left font-normal",!a.endDate&&"text-muted-foreground"),children:[(0,Pr.jsx)(yt.CalendarIcon,{className:"mr-2 h-4 w-4"}),a.endDate?(0,Zo.format)(a.endDate,"PPP"):"Pick a date"]})}),(0,Pr.jsx)(ko,{className:"w-auto p-0",align:"start",children:(0,Pr.jsx)(Co,{mode:"single",selected:a.endDate,onSelect:s=>i(c=>({...c,endDate:s})),initialFocus:!0,disabled:s=>a.startDate?s<a.startDate:!1})})]})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)("input",{type:"checkbox",id:"isActive",checked:a.isActive,onChange:s=>i(c=>({...c,isActive:s.target.checked})),className:"rounded border-gray-300"}),(0,Pr.jsx)(D,{htmlFor:"isActive",children:"Set as active sprint"})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-3 Pr-4",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:m,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",disabled:!a.name||!a.startDate||!a.endDate,children:"Add Sprint"})]})]})]})})};var Do=({tasks:e,epics:t,sprints:o,onUpdateTask:a,onTaskClick:i,onAddSprint:r,onUpdateSprint:m,onDeleteSprint:s})=>{let[c,n]=(0,Mt.useState)([]),[d,p]=(0,Mt.useState)(new Set),[h,g]=(0,Mt.useState)(null),[y,b]=(0,Mt.useState)(!1),[f,T]=(0,Mt.useState)(null),[V,_]=(0,Mt.useState)(null),[Y,w]=(0,Mt.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[U,ge]=(0,Mt.useState)("upcoming"),[S,re]=(0,Mt.useState)(!1),[R,ve]=(0,Mt.useState)(0),G=(0,Mt.useRef)(null),E=(0,Mt.useRef)(null);(0,Mt.useEffect)(()=>{let v=()=>{G.current&&ve(G.current.offsetHeight)};v();let B=new ResizeObserver(v);return G.current&&B.observe(G.current),()=>B.disconnect()},[]);let ie=v=>t.find(B=>B.id===v),ze=v=>o.find(B=>B.id===v),Ee=v=>{let B={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 B[v]||B.medium},we=v=>{let B=v.trim().split(" ");if(B.length===1)return B[0];let se=B[0],be=B[B.length-1][0].toUpperCase();return`${se} ${be}`},ut=v=>{let B={},se=[];return v.forEach(be=>{be.epicId?(B[be.epicId]||(B[be.epicId]=[]),B[be.epicId].push(be)):se.push(be)}),{tasksByEpic:B,unassignedTasks:se}},st=o.filter(v=>v.id!=="backlog"&&v.id!=="all-tasks"),Nt=st.filter(v=>{switch(U){case"active":return v.isActive;case"upcoming":return!v.isActive;default:return!0}}),Ve=st.filter(v=>c.includes(v.id)),rt=e.filter(v=>!v.sprintId||v.sprintId==="backlog"||v.sprintId==="Backlog"),At=rt.reduce((v,B)=>v+(B.points||0),0),bt=v=>{n(B=>B.includes(v)?B.filter(se=>se!==v):B.length<3?[...B,v]:B)},ht=v=>{p(B=>{let se=new Set(B);return se.has(v)?se.delete(v):se.add(v),se})},It=v=>{r(v),b(!1)},C=v=>{_(v.id),w({name:v.name,description:v.description||"",startDate:v.startDate instanceof Date?v.startDate.toISOString().split("T")[0]:v.startDate,endDate:v.endDate instanceof Date?v.endDate.toISOString().split("T")[0]:v.endDate,isActive:v.isActive})},Me=()=>{V&&(m(V,{name:Y.name,description:Y.description,startDate:new Date(Y.startDate),endDate:new Date(Y.endDate),isActive:Y.isActive}),_(null))},xe=()=>{_(null),w({name:"",description:"",startDate:"",endDate:"",isActive:!1})},Ct=(v,B)=>{g(B),v.dataTransfer.effectAllowed="move"},Lt=v=>{v.preventDefault(),v.dataTransfer.dropEffect="move"},j=v=>{T(v)},fe=()=>{T(null)},ke=(v,B)=>{if(v.preventDefault(),T(null),!h)return;let se=h.sprintId||void 0,be=B==="backlog"?void 0:B;se!==be&&a(h.id,{sprintId:be}),g(null)},Xe=({task:v,showSprint:B=!1})=>{let se=v.epicId?ie(v.epicId):null,be=v.sprintId?ze(v.sprintId):null;return(0,Pr.jsx)(L,{className:"p-3 cursor-grab active:cursor-grabbing hover:shadow-md transition-all duration-200 border border-border bg-card hover:bg-accent/50",draggable:!0,onDragStart:nt=>{nt.dataTransfer.effectAllowed="move",nt.dataTransfer.setData("text/plain",v.id),Ct(nt,v)},onClick:nt=>{h===null&&i(v)},style:{userSelect:"none"},children:(0,Pr.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Pr.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Pr.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:v.name}),(0,Pr.jsx)(W,{className:`text-xs ${Ee(v.priority)}`,children:v.priority[0].toUpperCase()})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-1",children:[se&&(0,Pr.jsx)("div",{className:`w-2 h-2 rounded-full ${se.color}`}),(0,Pr.jsx)("span",{className:"text-muted-foreground truncate",children:se?.name})]}),(0,Pr.jsx)("span",{className:"text-muted-foreground",children:we(v.assignee?.value?.name)})]}),B&&be&&(0,Pr.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),(0,Pr.jsx)("span",{children:be.name})]})]})})};return(0,Pr.jsxs)("div",{ref:E,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Pr.jsx)("div",{ref:G,className:"flex-shrink-0",children:(0,Pr.jsx)(Qe,{title:"Sprint Planning",description:"Plan and organize tasks across sprints and manage your development timeline.",gradient:"bg-gradient-to-r from-orange-600 via-amber-600 to-yellow-600",primaryAction:{label:"Add sprint",onClick:()=>b(!0)}})}),(0,Pr.jsx)("div",{className:"flex-1 min-h-0 Mt-8",children:(0,Pr.jsxs)("div",{className:"h-full",style:{height:R>0?`calc(100vh - ${R+120}px)`:"calc(100vh - 12rem)"},children:[(0,Pr.jsxs)("div",{className:"mb-4",children:[(0,Pr.jsx)(L,{className:"p-3 bg-card shadow-sm",children:(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Pr.jsx)("div",{children:(0,Pr.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"})}),c.length>0&&(0,Pr.jsx)("div",{className:"flex items-center gap-2",children:(0,Pr.jsx)("div",{className:"flex flex-wrap gap-1",children:Ve.map(v=>(0,Pr.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Pr.jsx)("span",{className:"max-w-[80px] truncate",children:v.name}),v.isActive&&(0,Pr.jsx)("span",{className:"text-success text-[10px]",children:"\u25CF"}),(0,Pr.jsx)("button",{onClick:()=>bt(v.id),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Pr.jsx)(yt.X,{className:"h-4 w-4"})})]},v.id))})})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsxs)(x,{onClick:()=>b(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Pr.jsx)(yt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Pr.jsxs)(x,{onClick:()=>re(!S),variant:"outline",size:"sm",className:"gap-1",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-3 w-3"}),S?"Close":"Select"]})]})]})}),S&&(0,Pr.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>re(!1)}),(0,Pr.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-Pr shadow-xl z-10 transition-all duration-300 ease-in-out ${S?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Pr.jsxs)(L,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Pr.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Pr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>re(!1),className:"h-8 w-8 p-0",children:(0,Pr.jsx)(yt.X,{className:"h-4 w-4"})})]}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground Mt-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Pr.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Pr.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:o.length},{key:"active",label:"Active",count:o.filter(v=>v.isActive).length},{key:"upcoming",label:"Upcoming",count:o.filter(v=>!v.isActive).length}].map(v=>(0,Pr.jsxs)(x,{variant:U===v.key?"default":"outline",size:"sm",onClick:()=>ge(v.key),className:"text-xs h-8 px-3 flex-1",children:[v.label," (",v.count,")"]},v.key))}),(0,Pr.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:Nt.length>0?Nt.map(v=>{let B=c.includes(v.id),se=e.filter(Je=>Je.sprintId===v.id).length,be=!B&&c.length<3;return(0,Pr.jsx)("div",{className:`p-3 rounded-lg border transition-all ${B?"bg-primary/10 border-primary/30":be?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:V===v.id?(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsx)(z,{value:Y.name,onChange:Je=>w(it=>({...it,name:Je.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Pr.jsx)(ye,{value:Y.description,onChange:Je=>w(it=>({...it,description:Je.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Pr.jsxs)("div",{className:"flex gap-2",children:[(0,Pr.jsxs)(x,{size:"sm",onClick:()=>Me(),className:"flex-1",children:[(0,Pr.jsx)(yt.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,Pr.jsxs)(x,{size:"sm",variant:"outline",onClick:xe,className:"flex-1",children:[(0,Pr.jsx)(yt.X,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,Pr.jsxs)("div",{children:[(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Pr.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:v.name}),v.isActive&&(0,Pr.jsx)(W,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Pr.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:v.description}),(0,Pr.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Pr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.CalendarDays,{className:"h-3 w-3"}),new Date(v.startDate).toLocaleDateString()]}),(0,Pr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Pr.jsx)(yt.User,{className:"h-3 w-3"}),se," tasks"]})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>C(v),className:"h-6 w-6 p-0",children:(0,Pr.jsx)(yt.Edit2,{className:"h-3 w-3"})}),v.id!=="backlog"&&v.id!=="all-tasks"&&(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>s(v.id),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Pr.jsx)("div",{className:"flex items-center justify-between Mt-2",children:(0,Pr.jsx)(x,{variant:B?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>bt(v.id),disabled:!B&&c.length>=3,children:(0,Pr.jsx)("span",{className:"pointer-events-none select-none",children:B?"Deselect":c.length>=3?"Limit Reached":"Select"})})})]})},v.id)}):(0,Pr.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Pr.jsxs)("p",{className:"text-sm",children:['No sprints found for "',U,'" filter']}),(0,Pr.jsx)(x,{variant:"link",size:"sm",onClick:()=>ge("all"),className:"text-xs",children:"Show all sprints"})]})}),c.length===0&&(0,Pr.jsx)("div",{className:"Mt-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Pr.jsxs)("div",{className:"text-center",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Pr.jsx)("p",{className:"text-xs text-muted-foreground Mt-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Pr.jsx)("div",{className:"lg:col-span-1",children:(0,Pr.jsxs)(L,{className:"p-4 h-full bg-card border-Pr-4 border-Pr-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Lt,onDragEnter:()=>j("backlog"),onDragLeave:fe,onDrop:v=>ke(v,"backlog"),style:{height:R>0?`calc(100vh - ${R+200}px)`:"calc(100vh - 16rem)"},children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Pr.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsxs)(W,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[rt.length," tasks"]}),(0,Pr.jsxs)(W,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[At," pts"]})]})]}),(0,Pr.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${f==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:v,unassignedTasks:B}=ut(rt);return(0,Pr.jsxs)(Pr.Fragment,{children:[Object.entries(v).map(([se,be])=>{let Je=ie(se);if(!Je)return null;let it=d.has(se);return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht(se),children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${Je.color}`}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:Je.name}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",be.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:it?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!it&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:be.map(nt=>(0,Pr.jsx)(Xe,{task:nt},nt.id))})]},se)}),B.length>0&&(()=>{let se=d.has("no-epic");return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht("no-epic"),children:[(0,Pr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",B.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:se?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!se&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:B.map(be=>(0,Pr.jsx)(Xe,{task:be},be.id))})]})})(),rt.length===0&&(0,Pr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here to move to backlog"}),rt.length>0&&Object.keys(v).length===0&&B.length===0&&(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),rt.map(se=>(0,Pr.jsx)(Xe,{task:se},se.id))]})]})})()})]})}),Ve.map(v=>{let B=e.filter(be=>be.sprintId===v.id),se=B.reduce((be,Je)=>be+(Je.points||0),0);return(0,Pr.jsxs)(L,{className:"p-4 h-full bg-card border-Pr-4 border-Pr-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:Lt,onDragEnter:()=>j(v.id),onDragLeave:fe,onDrop:be=>ke(be,v.id),style:{height:R>0?`calc(100vh - ${R+200}px)`:"calc(100vh - 16rem)"},children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:v.name}),v.isActive&&(0,Pr.jsx)("span",{className:"text-xs text-success font-medium select-none",children:"Active Sprint"})]}),(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsxs)(W,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[B.length," tasks"]}),(0,Pr.jsxs)(W,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200",children:[se," pts"]}),(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>C(v),className:"h-6 px-2",children:(0,Pr.jsx)(yt.Edit2,{className:"h-3 w-3"})}),v.id!=="backlog"&&v.id!=="all-tasks"&&(0,Pr.jsx)(x,{size:"sm",variant:"ghost",onClick:()=>s(v.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Pr.jsx)(yt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Pr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:be,unassignedTasks:Je}=ut(B);return(0,Pr.jsxs)(Pr.Fragment,{children:[Object.entries(be).map(([it,nt])=>{let Ia=ie(it);if(!Ia)return null;let Ea=d.has(it);return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht(it),children:[(0,Pr.jsx)("div",{className:`w-3 h-3 rounded-full ${Ia.color}`}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:Ia.name}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",nt.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:Ea?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Ea&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:nt.map(Ma=>(0,Pr.jsx)(Xe,{task:Ma},Ma.id))})]},it)}),Je.length>0&&(()=>{let it=d.has("no-epic");return(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>ht("no-epic"),children:[(0,Pr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Pr.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Pr.jsxs)("span",{className:"text-muted-foreground",children:["(",Je.length,")"]}),(0,Pr.jsx)("div",{className:"ml-auto",children:it?(0,Pr.jsx)(yt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Pr.jsx)(yt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!it&&(0,Pr.jsx)("div",{className:"space-y-2 pl-2",children:Je.map(nt=>(0,Pr.jsx)(Xe,{task:nt},nt.id))})]})})(),B.length===0&&(0,Pr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},v.id)})]}),(0,Pr.jsx)(Mi,{isOpen:y,onClose:()=>b(!1),onAddSprint:It})]})})]})};var hn=e=>{switch(e){case"high":return"\Pr{1F534}";case"medium":return"\Pr{1F7E1}";case"low":return"\Pr{1F7E2}";default:return"\u26AA"}},bn=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),xn=e=>{let[t,o]=e.split(":"),a=new Date;return a.setHours(parseInt(t),parseInt(o)),a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},Yo=(e,t)=>{let o=new Date,a=new Date(e);if(t){let[i,r]=t.split(":");a.setHours(parseInt(i),parseInt(r))}return a<o},Qo=e=>{let t=new Date;return e.toDateString()===t.toDateString()},yn=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},wn=({colleagues:e,onAddReminder:t,open:o,setOpen:a})=>{let[i,r]=(0,Mt.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[m,s]=(0,Mt.useState)(!1),c=d=>{d.preventDefault();let p=e.find(g=>g?.id.toString()===i.colleagueId.toString());if(!p){console.error("No valid colleague selected"),s(!0);return}s(!1);let h={title:i.title,description:i.description,dueDate:new Date(i.dueDate),dueTime:i.dueTime||void 0,colleague:p,isCompleted:!1,isRecurring:i.isRecurring,recurrencePattern:i.isRecurring?i.recurrencePattern:void 0,recurrenceInterval:i.isRecurring?i.recurrenceInterval:void 0,priority:i.priority,reminderEnabled:i.reminderEnabled,reminderMinutes:i.reminderEnabled?i.reminderMinutes:void 0,tags:i.tags?i.tags.split(",").map(g=>g.trim()):void 0};t(h),a(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Mt.useEffect)(()=>{i.colleagueId&&s(!1)},[i.colleagueId]);let n=e.filter(Boolean);return(0,Pr.jsx)(ft,{open:o,onOpenChange:a,children:(0,Pr.jsxs)(lt,{className:"max-w-2xl",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Add New Reminder"})}),(0,Pr.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,Pr.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"title",children:"Title"}),(0,Pr.jsx)(z,{id:"title",value:i.title,onChange:d=>r({...i,title:d.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:i.description,onChange:d=>r({...i,description:d.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"dueDate",children:"Due Date"}),(0,Pr.jsx)(z,{id:"dueDate",type:"date",value:i.dueDate,onChange:d=>r({...i,dueDate:d.target.value}),required:!0})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Pr.jsx)(z,{id:"dueTime",type:"time",value:i.dueTime,onChange:d=>r({...i,dueTime:d.target.value})})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{className:`${m?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Pr.jsxs)(Fe,{value:i.colleagueId,onValueChange:d=>{r({...i,colleagueId:d})},required:!0,children:[(0,Pr.jsx)(Ae,{className:`${m?"text-destructive border-red-500":""}`,children:(0,Pr.jsx)($e,{className:`${m?"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,Pr.jsx)(Ie,{children:n.map(d=>(0,Pr.jsx)(X,{value:d.id,children:d.name},d.id))})]}),m&&(0,Pr.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:d=>r({...i,isRecurring:d.target.checked}),className:"rounded border-border"}),(0,Pr.jsx)(D,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Pr.jsxs)(Fe,{value:i.recurrencePattern,onValueChange:d=>r({...i,recurrencePattern:d}),children:[(0,Pr.jsx)(Ae,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsxs)(Ie,{children:[(0,Pr.jsx)(X,{value:"daily",children:"Daily"}),(0,Pr.jsx)(X,{value:"weekly",children:"Weekly"}),(0,Pr.jsx)(X,{value:"monthly",children:"Monthly"}),(0,Pr.jsx)(X,{value:"yearly",children:"Yearly"})]})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Pr.jsx)(z,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:d=>r({...i,recurrenceInterval:parseInt(d.target.value)})})]})]})]}),(0,Pr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",children:"Add Reminder"})]})]})]})})},Nn=({reminder:e,colleagues:t,onUpdateReminder:o,open:a,onClose:i})=>{let[r,m]=(0,Mt.useState)({title:e.title,description:e.description,dueDate:e.dueDate.toISOString().split("T")[0],dueTime:e.dueTime||"",colleagueId:e.colleague?.id||"",priority:e.priority,isRecurring:e.isRecurring,recurrencePattern:e.recurrencePattern||"weekly",recurrenceInterval:e.recurrenceInterval||1,reminderEnabled:e.reminderEnabled,reminderMinutes:e.reminderMinutes||15,tags:e.tags?.join(", ")||""}),s=n=>{n.preventDefault();let d=t.find(p=>p?.id===r.colleagueId);if(!d){console.error("No valid colleague selected");return}o(e.id,{title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:d,priority:r.priority,isRecurring:r.isRecurring,recurrencePattern:r.isRecurring?r.recurrencePattern:void 0,recurrenceInterval:r.isRecurring?r.recurrenceInterval:void 0,reminderEnabled:r.reminderEnabled,reminderMinutes:r.reminderEnabled?r.reminderMinutes:void 0,tags:r.tags?r.tags.split(",").map(p=>p.trim()):void 0}),i()},c=t.filter(Boolean);return(0,Pr.jsx)(ft,{open:a,onOpenChange:i,children:(0,Pr.jsxs)(lt,{className:"max-w-2xl",children:[(0,Pr.jsx)(dt,{children:(0,Pr.jsx)(ct,{children:"Edit Reminder"})}),(0,Pr.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-title",children:"Title"}),(0,Pr.jsx)(z,{id:"edit-title",value:r.title,onChange:n=>m({...r,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-priority",children:"Priority"}),(0,Pr.jsxs)(Fe,{value:r.priority,onValueChange:n=>m({...r,priority:n}),children:[(0,Pr.jsx)(Ae,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsxs)(Ie,{children:[(0,Pr.jsx)(X,{value:"low",children:"\Pr{1F7E2} Low"}),(0,Pr.jsx)(X,{value:"medium",children:"\Pr{1F7E1} Medium"}),(0,Pr.jsx)(X,{value:"high",children:"\Pr{1F534} High"})]})]})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-description",children:"Description"}),(0,Pr.jsx)(ye,{id:"edit-description",value:r.description,onChange:n=>m({...r,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Pr.jsx)(z,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:n=>m({...r,dueDate:n.target.value}),required:!0})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Pr.jsx)(z,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:n=>m({...r,dueTime:n.target.value})})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-colleague",children:"Assigned Colleague"}),(0,Pr.jsxs)(Fe,{value:r.colleagueId,onValueChange:n=>m({...r,colleagueId:n}),required:!0,children:[(0,Pr.jsx)(Ae,{children:(0,Pr.jsx)($e,{placeholder:"Select a digital colleague"})}),(0,Pr.jsx)(Ie,{children:c.map(n=>(0,Pr.jsx)(X,{value:n.id,children:n.name},n.id))})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring,onChange:n=>m({...r,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,Pr.jsx)(D,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-recurrencePattern",children:"Frequency"}),(0,Pr.jsxs)(Fe,{value:r.recurrencePattern,onValueChange:n=>m({...r,recurrencePattern:n}),children:[(0,Pr.jsx)(Ae,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsxs)(Ie,{children:[(0,Pr.jsx)(X,{value:"daily",children:"Daily"}),(0,Pr.jsx)(X,{value:"weekly",children:"Weekly"}),(0,Pr.jsx)(X,{value:"monthly",children:"Monthly"}),(0,Pr.jsx)(X,{value:"yearly",children:"Yearly"})]})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-recurrenceInterval",children:"Every"}),(0,Pr.jsx)(z,{id:"edit-recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:n=>m({...r,recurrenceInterval:parseInt(n.target.value)})})]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)("input",{type:"checkbox",id:"edit-reminderEnabled",checked:r.reminderEnabled,onChange:n=>m({...r,reminderEnabled:n.target.checked}),className:"rounded border-border"}),(0,Pr.jsx)(D,{htmlFor:"edit-reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,Pr.jsxs)("div",{className:"pl-6",children:[(0,Pr.jsx)(D,{htmlFor:"edit-reminderMinutes",children:"Remind me"}),(0,Pr.jsxs)(Fe,{value:r.reminderMinutes.toString(),onValueChange:n=>m({...r,reminderMinutes:parseInt(n)}),children:[(0,Pr.jsx)(Ae,{children:(0,Pr.jsx)($e,{})}),(0,Pr.jsxs)(Ie,{children:[(0,Pr.jsx)(X,{value:"5",children:"5 minutes before"}),(0,Pr.jsx)(X,{value:"15",children:"15 minutes before"}),(0,Pr.jsx)(X,{value:"30",children:"30 minutes before"}),(0,Pr.jsx)(X,{value:"60",children:"1 hour before"}),(0,Pr.jsx)(X,{value:"1440",children:"1 day before"})]})]})]})]}),(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)(D,{htmlFor:"edit-tags",children:"Tags (comma-separated)"}),(0,Pr.jsx)(z,{id:"edit-tags",value:r.tags,onChange:n=>m({...r,tags:n.target.value}),placeholder:"e.g., urgent, meeting, follow-up"})]}),(0,Pr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,Pr.jsx)(x,{type:"submit",children:"Save Changes"})]})]})]})})},Cn=({reminder:e,colleagues:t,onUpdateReminder:o,onDeleteReminder:a})=>{let[i,r]=(0,Mt.useState)(!1);if(!e||!e.id)return null;let m=Yo(e.dueDate,e.dueTime),s=Qo(e.dueDate),c=yn(e.dueDate),n=()=>{o(e.id,{isCompleted:!e.isCompleted,completedAt:e.isCompleted?void 0:new Date})},d=()=>s?"Today":c?"Tomorrow":m&&!e.isCompleted?"Overdue":bn(e.dueDate);return(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)(Nn,{reminder:e,colleagues:t,onUpdateReminder:o,open:i,onClose:()=>r(!1)}),(0,Pr.jsx)(L,{className:`transition-all duration-200 ${e.isCompleted?"opacity-60":""} ${m&&!e.isCompleted?"border-destructive/50 bg-destructive/5":""}`,children:(0,Pr.jsx)(le,{className:"p-4",children:(0,Pr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Pr.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Pr.jsx)("button",{onClick:n,className:"Mt-1 text-primary hover:text-primary/80",children:e.isCompleted?(0,Pr.jsx)(yt.CheckCircle,{className:"h-5 w-5"}):(0,Pr.jsx)(yt.Circle,{className:"h-5 w-5"})}),(0,Pr.jsxs)("div",{className:"flex-1",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,Pr.jsx)("h3",{className:`font-semibold ${e.isCompleted?"line-through text-muted-foreground":""}`,children:e.title}),(0,Pr.jsx)("span",{className:"text-sm",children:hn(e.priority)}),e.isRecurring&&(0,Pr.jsx)(yt.Repeat,{className:"h-4 w-4 text-primary"}),e.reminderEnabled&&(0,Pr.jsx)(yt.Bell,{className:"h-4 w-4 text-success"})]}),(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Pr.jsx)(yt.Calendar,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{className:m&&!e.isCompleted?"text-destructive font-medium":"",children:d()})]}),e.dueTime&&(0,Pr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Pr.jsx)(yt.Clock,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:xn(e.dueTime)})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Pr.jsx)(yt.User,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:e.colleague?.name||"Unknown Colleague"})]})]}),e.tags&&e.tags.length>0&&(0,Pr.jsx)("div",{className:"flex flex-wrap gap-1 Mt-2",children:e.tags.map((p,h)=>(0,Pr.jsx)(W,{variant:"secondary",className:"text-xs",children:p},h))})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Pr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,Pr.jsx)(yt.Edit2,{className:"h-4 w-4"})}),(0,Pr.jsx)(x,{variant:"ghost",size:"sm",onClick:()=>a(e.id),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Pr.jsx)(yt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},Fi=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:o,onUpdateReminder:a,onDeleteReminder:i})=>{let[r,m]=(0,Mt.useState)(e.filter(Boolean)),[s]=(0,Mt.useState)(t.filter(Boolean)),[c,n]=(0,Mt.useState)("all"),[d,p]=(0,Mt.useState)(""),[h,g]=(0,Mt.useState)(!1),y=w=>{if(!w.title||!w.colleague?.id){console.error("Invalid reminder data:",w);return}let U={...w,id:Date.now().toString(),createdAt:new Date};m(ge=>[...ge,U]),o?.(w)},b=(w,U)=>{if(!w){console.error("No reminder ID provided for update");return}m(ge=>ge.map(S=>S?.id===w?{...S,...U}:S)),a?.(w,U)},f=w=>{if(!w){console.error("No reminder ID provided for deletion");return}m(U=>U.filter(ge=>ge?.id!==w)),i?.(w)},V=r.filter(w=>{if(!w)return!1;if(d){let U=d.toLowerCase();if(!(w.title.toLowerCase().includes(U)||w.description.toLowerCase().includes(U)||w.colleague?.name?.toLowerCase().includes(U)||w.tags?.some(S=>S.toLowerCase().includes(U))))return!1}switch(c){case"pending":return!w.isCompleted;case"completed":return w.isCompleted;case"overdue":return!w.isCompleted&&Yo(w.dueDate,w.dueTime);case"today":return Qo(new Date(w.dueDate));default:return!0}}).sort((w,U)=>{if(!w||!U)return 0;if(w.isCompleted&&!U.isCompleted)return 1;if(!w.isCompleted&&U.isCompleted)return-1;let ge={high:3,medium:2,low:1},S=ge[U.priority]-ge[w.priority];return S!==0?S:w.dueDate.getTime()-U.dueDate.getTime()}),_={total:r.filter(Boolean).length,pending:r.filter(w=>w&&!w.isCompleted).length,completed:r.filter(w=>w&&w.isCompleted).length,overdue:r.filter(w=>w&&!w.isCompleted&&Yo(w.dueDate,w.dueTime)).length,today:r.filter(w=>w&&Qo(new Date(w.dueDate))).length},Y=s.find(Boolean)||{id:"1",name:"Default Colleague",status:"active",joinedDate:new Date,lastActive:new Date,type:"digital",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:[],version:"1.0.0",lastUpdated:new Date,isActive:!0};return(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Pr.jsx)(Qe,{title:"Task Reminders",description:"Manage reminders and stay on top of important tasks and deadlines.",gradient:"bg-gradient-to-r from-emerald-600 via-teal-600 to-cyan-600",primaryAction:{label:"Add reminder",onClick:()=>{g(!0)}}}),(0,Pr.jsxs)("div",{className:"h-full bg-background",children:[(0,Pr.jsx)(wn,{colleagues:s,onAddReminder:y,open:h,setOpen:g}),(0,Pr.jsxs)("div",{className:"p-6",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Pr.jsxs)("div",{children:[(0,Pr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Pr.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Pr.jsxs)(x,{className:"flex items-center space-x-2",onClick:()=>g(!0),children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),(0,Pr.jsx)("span",{children:"Add Reminder"})]})]}),(0,Pr.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Pr.jsxs)(L,{className:"p-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-foreground",children:_.total}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Pr.jsxs)(L,{className:"p-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-primary",children:_.pending}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Pr.jsxs)(L,{className:"p-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-success",children:_.completed}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Pr.jsxs)(L,{className:"p-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-destructive",children:_.overdue}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Pr.jsxs)(L,{className:"p-4",children:[(0,Pr.jsx)("div",{className:"text-2xl font-bold text-warning",children:_.today}),(0,Pr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Pr.jsx)("div",{className:"flex-1",children:(0,Pr.jsx)(z,{placeholder:"Search reminders...",value:d,onChange:w=>p(w.target.value),className:"max-w-md"})}),(0,Pr.jsxs)(Fe,{value:c,onValueChange:w=>n(w),children:[(0,Pr.jsx)(Ae,{className:"w-40",children:(0,Pr.jsx)($e,{})}),(0,Pr.jsxs)(Ie,{children:[(0,Pr.jsxs)(X,{value:"all",children:["All (",_.total,")"]}),(0,Pr.jsxs)(X,{value:"pending",children:["Pending (",_.pending,")"]}),(0,Pr.jsxs)(X,{value:"completed",children:["Completed (",_.completed,")"]}),(0,Pr.jsxs)(X,{value:"overdue",children:["Overdue (",_.overdue,")"]}),(0,Pr.jsxs)(X,{value:"today",children:["Today (",_.today,")"]})]})]})]}),(0,Pr.jsx)("div",{className:"space-y-4",children:V.length===0?(0,Pr.jsxs)(L,{className:"p-8 text-center",children:[(0,Pr.jsx)("div",{className:"text-muted-foreground",children:d||c!=="all"?"No reminders match your filters":"No reminders yet"}),!d&&c==="all"&&(0,Pr.jsx)("p",{className:"text-sm text-muted-foreground/60 Mt-2",children:"Create your first reminder to get started"})]}):V.map(w=>w&&(0,Pr.jsx)(Cn,{reminder:w,colleagues:s,onUpdateReminder:b,onDeleteReminder:f},w.id))})]})]})]})};var Bi=require("next/navigation");function er({title:e="",initialTasks:t=[],initialEpics:o=[],initialSprints:a=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:m=[],initialUsers:s=[],initialFiles:c=[],initialView:n="kanban",onAddTask:d,onUpdateTask:p,onDeleteTask:h,onTaskClick:g,onAddEpic:y,onUpdateEpic:b,onDeleteEpic:f,onAddTaskToEpic:T,onAddSprint:V,onUpdateSprint:_,onDeleteSprint:Y,onAddProject:w,onUpdateProject:U,onDeleteProject:ge,onFileAdd:S,onFileEdit:re,onFileDelete:R,onFileClick:ve,onAddReminder:G,onUpdateReminder:E,onDeleteReminder:ie,onViewChange:ze,onToggleMobileMenu:Ee,onTeamClick:we,onTeamChange:ut,onCopilotClick:st,handleAddComment:Nt}){let[Ve,rt]=(0,Mt.useState)(t),[At,bt]=(0,Mt.useState)(o),[ht,It]=(0,Mt.useState)(a),[C,Me]=(0,Mt.useState)(i),[xe,Ct]=(0,Mt.useState)(r),[Lt,j]=(0,Mt.useState)(m),[fe,ke]=(0,Mt.useState)(s),[Xe,v]=(0,Mt.useState)(c),[B,se]=(0,Mt.useState)(!1),[be,Je]=(0,Mt.useState)(!1),[it,nt]=(0,Mt.useState)(null),[Ia,Ea]=(0,Mt.useState)(null),[Ma,dr]=(0,Mt.useState)(null),[ia,cr]=(0,Mt.useState)(n||"kanban"),[Dn,_i]=(0,Mt.useState)(!1),mr=(0,Bi.useRouter)();(0,Mt.useEffect)(()=>{rt(t)},[t]),(0,Mt.useEffect)(()=>{It(a)},[a]),(0,Mt.useEffect)(()=>{bt(o)},[o]),(0,Mt.useEffect)(()=>{Me(i)},[i]),(0,Mt.useEffect)(()=>{v(c)},[c]),(0,Mt.useEffect)(()=>{ke(s)},[s]),(0,Mt.useEffect)(()=>{j(m)},[m]),(0,Mt.useEffect)(()=>{Ct(r)},[r]),(0,Mt.useEffect)(()=>{cr(n)},[n]);let qi=At.filter(N=>N.isSelected).map(N=>N.id),Qa=ht.find(N=>N.isSelected),Xi=Ve.filter(N=>{let A=qi.includes(N.epicId);return!Qa||Qa.id==="all-tasks"?A:Qa.id==="backlog"?A&&!N.sprintId:A&&N.sprintId===Qa.id}),Sn=N=>Xi.filter(A=>A.status===N),Tn=N=>{let A={};return At.forEach(ee=>{A[ee.id]=N.filter(De=>De.epicId===ee.id)}),A},Pn=N=>{dr(N)},Rn=N=>{Ma&&(rt(A=>A.map(ee=>ee.id===Ma.id?{...ee,status:N}:ee)),dr(null))},pr=N=>{let A={...N,id:Date.now().toString(),createdAt:new Date};rt(ee=>[...ee,A]),d?.(A)},eo=async(N,A)=>(rt(ee=>ee.map(De=>De.id===N?{...De,...A}:De)),await p?.(N,A)),An=async(N,A)=>{eo(N,A)},ur=N=>{rt(A=>A.filter(ee=>ee.id!==N)),it?.id===N&&nt(null),h?.(N)},In=async N=>{ur(N)},En=N=>{let A={...N,id:Date.now().toString(),isSelected:!1};Me(ee=>[...ee,A]),w?.(N)},Mn=(N,A)=>{Me(ee=>ee.map(De=>De.id===N?A.isSelected?(mr.push(`/project/${N}`),{...De,...A}):{...De,...A}:A.isSelected&&N!==De.id?{...De,isSelected:!1}:De)),U?.(N,A)},Fn=N=>{Me(A=>A.filter(ee=>ee.id!==N)),ge?.(N)},gr=N=>{let A={...N,id:Date.now().toString(),isSelected:!0};bt(ee=>[...ee,A]),y?.({...A})},Ji=()=>{Je(!0)},Zi=(N,A)=>{bt(ee=>ee.map(De=>De.id===N?{...De,...A}:De)),b?.(N,A)},Yi=N=>{bt(A=>A.filter(ee=>ee.id!==N)),rt(A=>A.filter(ee=>ee.epicId!==N)),f?.(N)},Qi=N=>{let A={...N,id:Date.now().toString(),isSelected:!1};It(ee=>[...ee,A]),V?.(N)},es=(N,A)=>{It(ee=>ee.map(De=>De.id===N?A.isSelected?{...De,...A}:{...De,...A}:A.isSelected&&N!==De.id?{...De,isSelected:!1}:De)),_?.(N,A)},ts=N=>{N==="backlog"||N==="all-tasks"||(It(A=>A.filter(ee=>ee.id!==N)),rt(A=>A.map(ee=>ee.sprintId===N?{...ee,sprintId:void 0}:ee)),Y?.(N))},Ao=N=>{nt(N)},as=N=>{N==="planning"&&window.innerWidth<768||(cr(N),ze?.(N))},Bn=()=>{_i(N=>!N),Ee?.()},Ln=()=>{mr.push("/")},jn=N=>{console.log("Switching to team:",N)},On=N=>{console.log("Switching to team:",N)},os=N=>{Ea(N),se(!0)},rs=()=>{se(!1),Ea(null)},is=N=>{let A={...N,id:Date.now().toString(),createdAt:new Date};Ct(ee=>[...ee,A]),G?.(N)},ss=(N,A)=>{Ct(ee=>ee.map(De=>De.id===N?{...De,...A}:De)),E?.(N,A)},ns=N=>{Ct(A=>A.filter(ee=>ee.id!==N)),ie?.(N)},ls=()=>{S?.()},ds=N=>{re?.(N)},cs=N=>{v(A=>A.filter(ee=>ee.name!==N)),R?.(N)},ms=N=>{ve?.(N)},Hn=[{id:"todo",title:"Bo Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],zn=()=>{switch(ia){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"}},Io=[{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")}],Vn=Io.sort((N,A)=>A.lastUsed.getTime()-N.lastUsed.getTime()).slice(0,3),Un=Io.length>3,Kn=Io.slice(3);return(0,Pr.jsxs)(mi,{currentView:ia,onViewChange:as,children:[ia==="kanban"&&(0,Pr.jsx)("div",{className:"h-full overflow-hidden",children:(0,Pr.jsx)(Ti,{initialProjects:C,initialEpics:At,initialSprints:ht,initialTasks:Ve,initialColleagues:Lt,initialUsers:fe,onAddTask:pr,onUpdateTask:eo,onDeleteTask:ur,onTaskClick:Ao,onAddEpic:gr,onAddComment:Nt})}),ia==="planning"&&(0,Pr.jsx)("div",{className:"hidden md:block h-full",children:(0,Pr.jsx)(Do,{tasks:Ve,epics:At,sprints:ht,onUpdateTask:eo,onTaskClick:Ao,onAddSprint:Qi,onUpdateSprint:es,onDeleteSprint:ts})}),ia==="tasks"&&(0,Pr.jsx)("div",{className:"h-full",children:(0,Pr.jsx)(Fi,{initialReminders:xe,initialColleagues:Lt,onAddReminder:is,onUpdateReminder:ss,onDeleteReminder:ns})}),ia==="files"&&(0,Pr.jsx)("div",{className:"h-full",children:(0,Pr.jsx)($a,{initialFiles:Xe,onFileAdd:ls,onFileEdit:ds,onFileDelete:cs,onFileClick:ms,compactView:!1})}),ia==="epics"&&(0,Pr.jsx)("div",{className:"h-full",children:(0,Pr.jsx)(Pi,{tasks:Ve,epics:At,sprints:ht,onUpdateTask:eo,onTaskClick:Ao,onAddTaskToEpic:os,onAddEpic:Ji,onUpdateEpic:Zi,onDeleteEpic:Yi})}),(0,Pr.jsx)(xo,{isOpen:B,onClose:rs,onAddTask:pr,epics:At,sprints:ht,assignees:[...Lt,...fe],defaultEpicId:Ia||void 0}),(0,Pr.jsx)(No,{isOpen:be,onClose:()=>Je(!1),onAddEpic:gr})]})}var Li=Ne(require("react")),Xa=Ne(require("@radix-yt/react-progress"));var ar=Li.forwardRef(({className:e,value:t,...o},a)=>(0,Pr.jsx)(Xa.Root,{ref:a,className:k("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...o,children:(0,Pr.jsx)(Xa.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ar.displayName=Xa.Root.displayName;function Oi({project:e,onOpen:t,onShare:o,className:a}){return(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,Pr.jsxs)(L,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Pr.jsxs)(Re,{children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Pr.jsx)(je,{children:e.name}),(0,Pr.jsxs)(W,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,Pr.jsx)(La,{children:e.description})]}),(0,Pr.jsxs)(le,{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Pr.jsx)("span",{children:"Progress"}),(0,Pr.jsxs)("span",{children:[e.progress,"%"]})]}),(0,Pr.jsx)(ar,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Pr.jsxs)("div",{className:"flex items-center",children:[(0,Pr.jsx)(yt.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,Pr.jsxs)("div",{className:"flex items-center",children:[(0,Pr.jsx)(yt.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,Pr.jsxs)(ja,{className:"flex gap-2",children:[(0,Pr.jsx)(x,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,Pr.jsx)(x,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>o?.(e),children:(0,Pr.jsx)(yt.Share2,{className:"h-4 w-4"})})]})]})})}var Ja=Ne(require("@radix-yt/react-checkbox")),zi=Ne(require("react")),or=zi.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Ja.Root,{className:k("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:o,...t,children:(0,Pr.jsx)(Ja.Indicator,{className:k("flex items-center justify-center text-current"),children:(0,Pr.jsx)(yt.Check,{className:"h-4 w-4"})})}));or.displayName=Ja.Root.displayName;var Vi=({onSubmit:e,onCancel:t,isLoading:o=!1,initialData:a,className:i=""})=>{let[r,m]=(0,Mt.useState)({name:a?.name||"",description:a?.description||"",objectives:a?.objectives||"",workInstructions:a?.workInstructions||"",plan:a?.plan||!1}),[s,c]=(0,Mt.useState)({}),n=()=>{let h={};return r.name.trim()?r.name.trim().length<3&&(h.name="Project name must be 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(g){console.error("Error submitting project form:",g)}},p=(h,g)=>{m(y=>({...y,[h]:g})),s[h]&&c(y=>({...y,[h]:void 0}))};return(0,Pr.jsxs)("div",{className:`w-full max-w-2xl ${i}`,children:[(0,Pr.jsxs)("div",{className:"mb-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,Pr.jsx)("p",{className:"text-sm text-gray-500",children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,Pr.jsxs)("form",{onSubmit:d,children:[(0,Pr.jsxs)("div",{className:"space-y-6",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,Pr.jsx)(z,{id:"name",type:"text",placeholder:"Enter project name",value:r.name,onChange:h=>p("name",h.target.value),className:s.name?"border-red-500 focus:border-red-500":"",disabled:o,maxLength:100}),s.name&&(0,Pr.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",className:"text-sm font-medium",children:"Project Description *"}),(0,Pr.jsx)(z,{id:"description",type:"text",placeholder:"Enter project description",value:r.description,onChange:h=>p("description",h.target.value),className:s.description?"border-red-500 focus:border-red-500":"",disabled:o,maxLength:100}),s.description&&(0,Pr.jsx)("p",{className:"text-sm text-red-600",children:s.description})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,Pr.jsx)(ye,{id:"objectives",placeholder:"Describe the main goals and objectives of this project...",value:r.objectives,onChange:h=>p("objectives",h.target.value),className:`min-h-[100px] resize-y ${s.objectives?"border-red-500 focus:border-red-500":""}`,disabled:o,maxLength:1e3}),(0,Pr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Pr.jsx)("span",{children:s.objectives&&(0,Pr.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,Pr.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,Pr.jsx)(ye,{id:"workInstructions",placeholder:"Provide detailed instructions on how the work should be carried out, including processes, standards, and expectations...",value:r.workInstructions,onChange:h=>p("workInstructions",h.target.value),className:`min-h-[120px] resize-y ${s.workInstructions?"border-red-500 focus:border-red-500":""}`,disabled:o,maxLength:2e3}),(0,Pr.jsxs)("div",{className:"flex justify-between text-xs text-gray-500",children:[(0,Pr.jsx)("span",{children:s.workInstructions&&(0,Pr.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,Pr.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,Pr.jsxs)("div",{className:"space-y-3",children:[(0,Pr.jsx)(D,{className:"text-sm font-medium",children:"Project Management"}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(or,{id:"plan",checked:r.plan,onCheckedChange:h=>p("plan",h===!0),disabled:o}),(0,Pr.jsx)(D,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,Pr.jsx)("p",{className:"text-xs text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-3",children:[t&&(0,Pr.jsxs)(x,{type:"button",variant:"outline",onClick:t,disabled:o,className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.X,{className:"h-4 w-4"}),"Cancel"]}),(0,Pr.jsx)(x,{type:"submit",disabled:o,className:"flex items-center gap-2",children:o?(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)(yt.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,Pr.jsxs)(Pr.Fragment,{children:[(0,Pr.jsx)(yt.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function sr({projects:e=[],onAddProject:t,handleProjectOpen:o,handleProjectShare:a}){let[i,r]=(0,Mt.useState)(!1),[m,s]=(0,Mt.useState)(!1),c=async d=>{s(!0);try{await t(d),r(!1)}catch(p){console.error("Error creating project:",p)}finally{s(!1)}},n=()=>{r(!0)};return(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsx)(Qe,{title:"Project Management",description:"Organize your work into projects to collaborate with your team.",gradient:"bg-gradient-to-r from-purple-600 via-violet-600 to-indigo-600",primaryAction:{label:"New Project",onClick:n}}),(0,Pr.jsxs)("section",{className:"space-y-4 Mt-8",children:[(0,Pr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,Pr.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(d=>(0,Pr.jsx)(Oi,{project:d,onOpen:o,onShare:a},d.id))})]})]},"projects-index-view")}),(0,Pr.jsx)(ft,{open:i,onOpenChange:r,children:(0,Pr.jsxs)(lt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,Pr.jsxs)(dt,{className:"sr-only",children:[(0,Pr.jsx)(ct,{children:"Create New Project"}),(0,Pr.jsx)(_a,{children:"Fill out the form below to create a new project."})]}),(0,Pr.jsx)(Vi,{onSubmit:c,onCancel:()=>r(!1),isLoading:m,className:"border-0 shadow-none"})]})})]})}function Ki({team:e,onOpen:t,className:o}){return(0,Pr.jsx)(Bo.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,Pr.jsxs)(L,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,Pr.jsxs)(Re,{children:[(0,Pr.jsx)(je,{className:"text-lg",children:e.name}),(0,Pr.jsx)(La,{className:"Mt-1 text-sm",children:e.description})]}),(0,Pr.jsxs)(le,{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Users,{className:"h-4 w-4 text-blue-500"}),(0,Pr.jsx)("span",{children:"Human"})]}),(0,Pr.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Bot,{className:"h-4 w-4 text-purple-500"}),(0,Pr.jsx)("span",{children:"Digital"})]}),(0,Pr.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,Pr.jsxs)("div",{className:"flex items-center justify-between text-sm border-t Pr-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,Pr.jsx)("span",{children:"Projects"})]}),(0,Pr.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,Pr.jsx)(ja,{className:"flex gap-2",children:(0,Pr.jsx)(x,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}var $i=Ne(require("react")),Za=Ne(require("@radix-yt/react-switch"));var Aa=$i.forwardRef(({className:e,...t},o)=>(0,Pr.jsx)(Za.Root,{className:k("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:o,children:(0,Pr.jsx)(Za.Thumb,{className:k("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")})}));Aa.displayName=Za.Root.displayName;function Gi({team:e,onSave:t,onCancel:o,isLoading:a=!1,title:i,submitLabel:r,cancelLabel:m="Cancel",readOnly:s=!1}){let[c,n]=(0,Mt.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[d,p]=(0,Mt.useState)(!s);(0,Mt.useEffect)(()=>{e&&n(e)},[e]);let h=f=>{f.preventDefault();let T={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()};t(T)},g=f=>{f.preventDefault(),p(!d)},y=i||(d?e?"Edit Team":"Create New Team":"View Team"),b=r||(e?"Update Team":"Create Team");return(0,Pr.jsxs)(L,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,Pr.jsx)(Re,{children:(0,Pr.jsxs)(je,{className:"flex items-center gap-2",children:[(0,Pr.jsx)(yt.Users,{className:"h-5 w-5"}),y]})}),(0,Pr.jsx)(le,{children:(0,Pr.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"name",children:"Team Name *"}),(0,Pr.jsx)(z,{id:"name",value:c.name||"",onChange:f=>n({...c,name:f.target.value}),required:!0,disabled:a||!d,placeholder:"Enter team name..."})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"description",children:"Description"}),(0,Pr.jsx)(ye,{id:"description",value:c.description||"",onChange:f=>n({...c,description:f.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:a||!d})]}),(0,Pr.jsxs)("div",{className:"space-y-2",children:[(0,Pr.jsx)(D,{htmlFor:"systemMsg",children:"Ways of working"}),(0,Pr.jsx)(ye,{id:"systemMsg",value:c.systemMsg||"",onChange:f=>n({...c,systemMsg:f.target.value}),rows:3,placeholder:"Describe how this team works in as much detail as possible. Include processes, tools, systems, styles...",disabled:a||!d})]})]}),(0,Pr.jsxs)("div",{className:"space-y-4",children:[(0,Pr.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,Pr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Aa,{id:"useProjects",checked:c.useProjects||!1,onCheckedChange:f=>n({...c,useProjects:f}),disabled:a||!d}),(0,Pr.jsx)(D,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Aa,{id:"useKnowledge",checked:c.useKnowledge||!1,onCheckedChange:f=>n({...c,useKnowledge:f}),disabled:a||!d}),(0,Pr.jsx)(D,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Aa,{id:"useFiles",checked:c.useFiles||!1,onCheckedChange:f=>n({...c,useFiles:f}),disabled:a||!d}),(0,Pr.jsx)(D,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,Pr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Pr.jsx)(Aa,{id:"useChat",checked:c.useChat||!1,onCheckedChange:f=>n({...c,useChat:f}),disabled:a||!d}),(0,Pr.jsx)(D,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,Pr.jsxs)("div",{className:"flex justify-end gap-2 Pr-4 border-t",children:[(0,Pr.jsx)(x,{type:"button",variant:"outline",onClick:o,disabled:a,children:d?m:"Close"}),d?(0,Pr.jsx)(x,{type:"submit",disabled:a||!c.name?.trim(),children:a?"Saving...":b}):(0,Pr.jsxs)(x,{type:"button",onClick:g,disabled:a,className:"gap-2",children:[(0,Pr.jsx)(yt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function lr({teams:e=[],onCreateTeam:t,onTeamOpen:o}){let[a,i]=(0,Mt.useState)(!1),r=()=>{i(!0)},m=n=>{t?.(n),i(!1)},s=()=>{i(!1)},c=n=>{o?.(n)};return(0,Pr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Pr.jsx)(Bo.AnimatePresence,{mode:"wait",children:(0,Pr.jsxs)(Bo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,Pr.jsx)(Qe,{title:"My Teams",description:"Collaborate with your human and digital colleagues across different teams and projects.",gradient:"bg-gradient-to-r from-blue-600 via-cyan-600 to-teal-600",primaryAction:{label:"Create Team",onClick:r}}),(0,Pr.jsxs)("section",{className:"space-y-4 Mt-8",children:[(0,Pr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,Pr.jsxs)("div",{className:"text-center py-12",children:[(0,Pr.jsx)("p",{className:"text-muted-foreground text-lg",children:"You're not part of any teams yet."}),(0,Pr.jsx)("p",{className:"text-muted-foreground text-sm Mt-2",children:"Create a new team or ask to be added to an existing one."})]}):(0,Pr.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,Pr.jsx)(Ki,{team:n,onOpen:c},n.id))})]})]},"teams-index-view")}),(0,Pr.jsx)(ft,{open:a,onOpenChange:i,children:(0,Pr.jsxs)(lt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto p-0",children:[(0,Pr.jsx)("div",{className:"sr-only",children:(0,Pr.jsxs)(dt,{children:[(0,Pr.jsx)(ct,{children:"Create New Team"}),(0,Pr.jsx)(_a,{children:"Set up a new team to collaborate with colleagues on projects."})]})}),(0,Pr.jsx)(Gi,{title:"Create New Team",submitLabel:"Create Team",onSave:m,onCancel:s})]})})]})}0&&(module.exports={ColleaguesView,FileView,KnowledgeView,PlanningView,ProjectView,ProjectsIndexView,TeamsIndexView});