cortex-react-components 2.12.5 → 2.12.7

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 (105) hide show
  1. package/dist/{chunk-ERJXTG6X.mjs → chunk-2GM2LPLB.mjs} +1 -1
  2. package/dist/{chunk-RNMPX2AU.mjs → chunk-2L2SAVX6.mjs} +1 -1
  3. package/dist/{chunk-M7NV6EFH.mjs → chunk-2OOJ4ZFB.mjs} +1 -1
  4. package/dist/{chunk-LBUC4M6L.mjs → chunk-3ANJOET7.mjs} +1 -1
  5. package/dist/{chunk-MXCW6SOT.mjs → chunk-4SRUEQTP.mjs} +1 -1
  6. package/dist/{chunk-W2JTSWVJ.mjs → chunk-6BKLMT5R.mjs} +1 -1
  7. package/dist/chunk-6TUNKKV7.mjs +1 -0
  8. package/dist/{chunk-FTZRG54P.mjs → chunk-77PCUNUC.mjs} +1 -1
  9. package/dist/{chunk-7GMAMIHM.mjs → chunk-7OMPPFGG.mjs} +1 -1
  10. package/dist/{chunk-5SHZBJ5R.mjs → chunk-BQQ4V4PX.mjs} +1 -1
  11. package/dist/{chunk-H3CJOE6S.mjs → chunk-F64CA5CH.mjs} +1 -1
  12. package/dist/{chunk-N3B3XNV3.mjs → chunk-FYQBRCQM.mjs} +1 -1
  13. package/dist/{chunk-67QPOSVV.mjs → chunk-GAZHKHGB.mjs} +1 -1
  14. package/dist/{chunk-255P6K5W.mjs → chunk-GETYSIZV.mjs} +1 -1
  15. package/dist/{chunk-XBCYPOFD.mjs → chunk-GTK2SGS5.mjs} +1 -1
  16. package/dist/{chunk-FKU4VQR6.mjs → chunk-HDKHF3EA.mjs} +1 -1
  17. package/dist/{chunk-YKG4FNS4.mjs → chunk-HKMNAXLM.mjs} +1 -1
  18. package/dist/{chunk-ISBVFNWD.mjs → chunk-IDG2O4B7.mjs} +1 -1
  19. package/dist/{chunk-PK3OBSCB.mjs → chunk-MO4HRQEL.mjs} +1 -1
  20. package/dist/{chunk-LJOWXPWW.mjs → chunk-O24GFE6Q.mjs} +1 -1
  21. package/dist/{chunk-EMY52VZA.mjs → chunk-OO3IFL57.mjs} +1 -1
  22. package/dist/{chunk-2RQDJ5XT.mjs → chunk-P6OSMPUQ.mjs} +1 -1
  23. package/dist/{chunk-IF3425JX.mjs → chunk-PNUBVBSR.mjs} +1 -1
  24. package/dist/{chunk-LJQPLE4S.mjs → chunk-PTZT4QJW.mjs} +1 -1
  25. package/dist/{chunk-5WVFEIMC.mjs → chunk-R6AYIVIR.mjs} +1 -1
  26. package/dist/{chunk-TL2RQFU5.mjs → chunk-TDASZ6KO.mjs} +1 -1
  27. package/dist/{chunk-HKGW6JI2.mjs → chunk-U3FYDDE2.mjs} +1 -1
  28. package/dist/{chunk-X3JZSN3W.mjs → chunk-UZSBX5GO.mjs} +1 -1
  29. package/dist/{chunk-XGIYNUGC.mjs → chunk-VNYUNZ3M.mjs} +1 -1
  30. package/dist/{chunk-2BR55L74.mjs → chunk-VRE6VCHX.mjs} +1 -1
  31. package/dist/components/Blocks/Banner.mjs +1 -1
  32. package/dist/components/Blocks/CallToAction.mjs +1 -1
  33. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  34. package/dist/components/Blocks/Content.mjs +1 -1
  35. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  36. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  37. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  38. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  39. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  40. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  41. package/dist/components/Blocks/index.mjs +1 -1
  42. package/dist/components/Cards/ContentCard.mjs +1 -1
  43. package/dist/components/Cards/FeatureCard.mjs +1 -1
  44. package/dist/components/Cards/index.mjs +1 -1
  45. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  46. package/dist/components/DigitalColleagues/Views/index.js +1 -1
  47. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  48. package/dist/components/DigitalColleagues/index.js +1 -1
  49. package/dist/components/DigitalColleagues/index.mjs +1 -1
  50. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  51. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  52. package/dist/components/HeaderFooter/index.mjs +1 -1
  53. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  54. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  55. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  56. package/dist/components/Heros/RenderHero.mjs +1 -1
  57. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  58. package/dist/components/Heros/index.mjs +1 -1
  59. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  60. package/dist/components/Layouts/Print.mjs +1 -1
  61. package/dist/components/Layouts/SlideShow.mjs +1 -1
  62. package/dist/components/Layouts/index.mjs +1 -1
  63. package/dist/components/Other/index.mjs +1 -1
  64. package/dist/components/Payload/Card/index.mjs +1 -1
  65. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  66. package/dist/components/Payload/Media/index.mjs +1 -1
  67. package/dist/components/Payload/RichText/index.mjs +1 -1
  68. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  69. package/dist/components/Payload/index.mjs +1 -1
  70. package/dist/components/Projects/PlanningView.js +1 -1
  71. package/dist/components/Projects/PlanningView.mjs +1 -1
  72. package/dist/components/Projects/ProjectPage.js +1 -1
  73. package/dist/components/Projects/ProjectPage.mjs +1 -1
  74. package/dist/components/Projects/ProjectView.js +1 -1
  75. package/dist/components/Projects/ProjectView.mjs +1 -1
  76. package/dist/components/Projects/index.d.ts +5 -0
  77. package/dist/components/Projects/index.js +2 -1
  78. package/dist/components/Projects/index.mjs +1 -1
  79. package/dist/components/index.js +10 -10
  80. package/dist/components/index.mjs +1 -1
  81. package/dist/index.js +17 -17
  82. package/dist/index.mjs +1 -1
  83. package/dist/metafile-cjs.json +1 -1
  84. package/dist/metafile-esm.json +1 -1
  85. package/dist/pages/Blog.mjs +1 -1
  86. package/dist/pages/Documentation.mjs +1 -1
  87. package/dist/pages/IndexPage.mjs +1 -1
  88. package/dist/pages/Intranet.mjs +1 -1
  89. package/dist/pages/LandingPage.mjs +1 -1
  90. package/dist/pages/Page.mjs +1 -1
  91. package/dist/pages/Publish.mjs +1 -1
  92. package/dist/pages/Website.mjs +1 -1
  93. package/dist/sections/AboutSection.mjs +1 -1
  94. package/dist/sections/BlogDetail.mjs +1 -1
  95. package/dist/sections/BlogList.mjs +1 -1
  96. package/dist/sections/BlogListSection.mjs +1 -1
  97. package/dist/sections/ContactSection.mjs +1 -1
  98. package/dist/sections/PageSections.mjs +1 -1
  99. package/dist/sections/PricingSection.mjs +1 -1
  100. package/dist/sections/ServiceDetail.mjs +1 -1
  101. package/dist/sections/ServiceDetailSection.mjs +1 -1
  102. package/dist/sections/ServiceSection.mjs +1 -1
  103. package/dist/sections/index.mjs +1 -1
  104. package/package.json +1 -1
  105. package/dist/chunk-O6GWOXTH.mjs +0 -1
@@ -2,4 +2,4 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
5
- "use strict";var Js=Object.create;var co=Object.defineProperty;var Ys=Object.getOwnPropertyDescriptor;var Zs=Object.getOwnPropertyNames;var Qs=Object.getPrototypeOf,en=Object.prototype.hasOwnProperty;var tn=(e,t)=>{for(var a in t)co(e,a,{get:t[a],enumerable:!0})},Fr=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zs(t))!en.call(e,i)&&i!==a&&co(e,i,{get:()=>t[i],enumerable:!(o=Ys(t,i))||o.enumerable});return e};var be=(e,t,a)=>(a=e!=null?Js(Qs(e)):{},Fr(t||!e||!e.__esModule?co(a,"default",{value:e,enumerable:!0}):a,e)),an=e=>Fr(co({},"__esModule",{value:!0}),e);var Ul={};tn(Ul,{ColleaguesView:()=>Jo,FileView:()=>Ya,KnowledgeView:()=>Yo,PlanningView:()=>Fo,ProjectView:()=>br,ProjectsIndexView:()=>Cr,TeamsIndexView:()=>kr});module.exports=an(Ul);var Ht=require("react"),Tt=require("lucide-react");var Kr=require("clsx");var Ko="-",on=e=>{let t=sn(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:m=>{let s=m.split(Ko);return s[0]===""&&s.length!==1&&s.shift(),Or(s,t)||rn(m)},getConflictingClassGroupIds:(m,s)=>{let c=a[m]||[];return s&&o[m]?[...c,...o[m]]:c}}},Or=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?Or(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Ko);return t.validators.find(({validator:m})=>m(r))?.classGroupId},Lr=/^\[(.+)\]$/,rn=e=>{if(Lr.test(e)){let t=Lr.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},sn=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return ln(Object.entries(e.classGroups),a).forEach(([r,m])=>{$o(m,o,r,t)}),o},$o=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:jr(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(nn(i)){$o(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,m])=>{$o(m,jr(t,r),a,o)})})},jr=(e,t)=>{let a=e;return t.split(Ko).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},nn=e=>e.isThemeGetter,ln=(e,t)=>t?e.map(([a,o])=>{let i=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([m,s])=>[t+m,s])):r);return[a,i]}):e,dn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(r,m)=>{a.set(r,m),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let m=a.get(r);if(m!==void 0)return m;if((m=o.get(r))!==void 0)return i(r,m),m},set(r,m){a.has(r)?a.set(r,m):i(r,m)}}},Hr="!",cn=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,m=s=>{let c=[],n=0,l=0,p;for(let f=0;f<s.length;f++){let P=s[f];if(n===0){if(P===i&&(o||s.slice(f,f+r)===t)){c.push(s.slice(l,f)),l=f+r;continue}if(P==="/"){p=f;continue}}P==="["?n++:P==="]"&&n--}let h=c.length===0?s:s.substring(l),u=h.startsWith(Hr),N=u?h.substring(1):h,x=p&&p>l?p-l:void 0;return{modifiers:c,hasImportantModifier:u,baseClassName:N,maybePostfixModifierPosition:x}};return a?s=>a({className:s,parseClassName:m}):m},mn=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},pn=e=>({cache:dn(e.cacheSize),parseClassName:cn(e),...on(e)}),un=/\s+/,gn=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],m=e.trim().split(un),s="";for(let c=m.length-1;c>=0;c-=1){let n=m[c],{modifiers:l,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:u}=a(n),N=!!u,x=o(N?h.substring(0,u):h);if(!x){if(!N){s=n+(s.length>0?" "+s:s);continue}if(x=o(h),!x){s=n+(s.length>0?" "+s:s);continue}N=!1}let f=mn(l).join(":"),P=p?f+Hr:f,A=P+x;if(r.includes(A))continue;r.push(A);let V=i(x,N);for(let J=0;J<V.length;++J){let S=V[J];r.push(P+S)}s=n+(s.length>0?" "+s:s)}return s};function fn(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=zr(t))&&(o&&(o+=" "),o+=a);return o}var zr=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=zr(e[o]))&&(a&&(a+=" "),a+=t);return a};function vn(e,...t){let a,o,i,r=m;function m(c){let n=t.reduce((l,p)=>p(l),e());return a=pn(n),o=a.cache.get,i=a.cache.set,r=s,s(c)}function s(c){let n=o(c);if(n)return n;let l=gn(c,a);return i(c,l),l}return function(){return r(fn.apply(null,arguments))}}var Fe=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Vr=/^\[(?:([a-qr-]+):)?(.+)\]$/i,bn=/^\qr+\/\qr+$/,hn=new Set(["px","full","screen"]),xn=/^(\qr+(\.\qr+)?)?(_o|sm|md|lg|xl)$/,yn=/\qr+(%|px|r?em|[sdl]?qr([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Nn=/^(inset_)?-?((\qr+)?\.?(\qr+)[a-qr]+|0)qr-?((\qr+)?\.?(\qr+)[a-qr]+|0)/,Cn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wt=e=>Ta(e)||hn.has(e)||bn.test(e),aa=e=>Ra(e,"length",In),Ta=e=>!!e&&!Number.isNaN(Number(e)),Uo=e=>Ra(e,"number",Ta),$a=e=>!!e&&Number.isInteger(Number(e)),Sn=e=>e.endsWith("%")&&Ta(e.slice(0,-1)),le=e=>Vr.test(e),oa=e=>xn.test(e),kn=new Set(["length","size","percentage"]),Dn=e=>Ra(e,kn,Ur),Pn=e=>Ra(e,"position",Ur),Tn=new Set(["image","url"]),Rn=e=>Ra(e,Tn,Mn),En=e=>Ra(e,"",An),Ka=()=>!0,Ra=(e,t,a)=>{let o=Vr.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},In=e=>yn.test(e)&&!wn.test(e),Ur=()=>!1,An=e=>Nn.test(e),Mn=e=>Cn.test(e);var Bn=()=>{let e=Fe("colors"),t=Fe("spacing"),a=Fe("blur"),o=Fe("brightness"),i=Fe("borderColor"),r=Fe("borderRadius"),m=Fe("borderSpacing"),s=Fe("borderWidth"),c=Fe("contrast"),n=Fe("grayscale"),l=Fe("hueRotate"),p=Fe("invert"),h=Fe("gap"),u=Fe("gradientColorStops"),N=Fe("gradientColorStopPositions"),x=Fe("inset"),f=Fe("margin"),P=Fe("opacity"),A=Fe("padding"),V=Fe("saturate"),J=Fe("scale"),S=Fe("sepia"),B=Fe("skew"),ve=Fe("space"),D=Fe("translate"),te=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],we=()=>["auto",le,t],q=()=>[le,t],M=()=>["",Wt,aa],ne=()=>["auto",Ta,le],$e=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ae=()=>["solid","dashed","dotted","double","none"],De=()=>["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"],pt=()=>["","0",le],Dt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ke=()=>[Ta,le];return{cacheSize:500,separator:":",theme:{colors:[Ka],spacing:[Wt,aa],blur:["none","",oa,le],brightness:Ke(),borderColor:[e],borderRadius:["none","","full",oa,le],borderSpacing:q(),borderWidth:M(),contrast:Ke(),grayscale:pt(),hueRotate:Ke(),invert:pt(),gap:q(),gradientColorStops:[e],gradientColorStopPositions:[Sn,aa],inset:we(),margin:we(),opacity:Ke(),padding:q(),saturate:Ke(),scale:Ke(),sepia:pt(),skew:Ke(),space:q(),translate:q()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[oa]}],"break-after":[{"break-after":Dt()}],"break-before":[{"break-before":Dt()}],"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:[...$e(),le]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],qr:[{qr:["auto",$a,le]}],basis:[{basis:we()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:pt()}],shrink:[{shrink:pt()}],order:[{order:["first","last","none",$a,le]}],"grid-cols":[{"grid-cols":[Ka]}],"col-start-end":[{col:["auto",{span:["full",$a,le]},le]}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":[Ka]}],"row-start-end":[{row:["auto",{span:[$a,le]},le]}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],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:[A]}],px:[{px:[A]}],py:[{py:[A]}],qr:[{qr:[A]}],qr:[{qr:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],qr:[{qr:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[ve]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ve]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,t]}],"min-w":[{"min-w":[le,t,"min","max","fit"]}],"max-w":[{"max-w":[le,t,"none","full","min","max","fit","prose",{screen:[oa]},oa]}],h:[{h:[le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",oa,aa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Uo]}],"font-family":[{font:[Ka]}],"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",le]}],"line-clamp":[{"line-clamp":["none",Ta,Uo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wt,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wt,aa]}],"underline-offset":[{"underline-offset":["auto",Wt,le]}],"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:q()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],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",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$e(),Pn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Dn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Rn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[u]}],"gradient-via":[{via:[u]}],"gradient-to":[{to:[u]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-qr":[{"rounded-qr":[r]}],"rounded-qr":[{"rounded-qr":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[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-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...Ae(),"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":[P]}],"divide-style":[{divide:Ae()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Ae()]}],"outline-offset":[{"outline-offset":[Wt,le]}],"outline-w":[{outline:[Wt,aa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[Wt,aa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",oa,En]}],"shadow-color":[{shadow:[Ka]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...De(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":De()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",oa,le]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[p]}],saturate:[{saturate:[V]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[V]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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",le]}],duration:[{duration:Ke()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:Ke()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[J]}],"scale-x":[{"scale-x":[J]}],"scale-y":[{"scale-y":[J]}],rotate:[{rotate:[$a,le]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[B]}],"skew-y":[{"skew-y":[B]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],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","qr-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":q()}],"scroll-mx":[{"scroll-mx":q()}],"scroll-my":[{"scroll-my":q()}],"scroll-ms":[{"scroll-ms":q()}],"scroll-me":[{"scroll-me":q()}],"scroll-qr":[{"scroll-qr":q()}],"scroll-mr":[{"scroll-mr":q()}],"scroll-mb":[{"scroll-mb":q()}],"scroll-ml":[{"scroll-ml":q()}],"scroll-p":[{"scroll-p":q()}],"scroll-px":[{"scroll-px":q()}],"scroll-py":[{"scroll-py":q()}],"scroll-qr":[{"scroll-qr":q()}],"scroll-qr":[{"scroll-qr":q()}],"scroll-pt":[{"scroll-pt":q()}],"scroll-pr":[{"scroll-pr":q()}],"scroll-pb":[{"scroll-pb":q()}],"scroll-pl":[{"scroll-pl":q()}],"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",le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wt,aa,Uo]}],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","qr","qr","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","qr","mr","mb","ml"],mx:["mr","ml"],my:["qr","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-qr","rounded-qr","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-qr","rounded-qr"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["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-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-qr","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-qr","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-qr","scroll-qr","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var $r=vn(Bn);function b(...e){return $r((0,Kr.clsx)(e))}var _r=require("@radix-ui/react-slot"),Gr=require("class-variance-authority"),Wr=be(require("react")),qr=require("react/jsx-runtime"),mo=(0,Gr.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),w=Wr.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,qr.jsx)(e?_r.Slot:"button",{className:b(mo({className:t,size:a,variant:o})),ref:r,...i}));w.displayName="Button";var pa=be(require("react"));var L=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("rounded-xl border bg-card text-card-foreground shadow",e),...t}));L.displayName="Card";var Ie=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("flex flex-col space-y-1.5 p-6",e),...t}));Ie.displayName="CardHeader";var Le=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("font-semibold leading-none tracking-tight",e),...t}));Le.displayName="CardTitle";var ua=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("text-sm text-muted-foreground",e),...t}));ua.displayName="CardDescription";var de=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("p-6 pt-0",e),...t}));de.displayName="CardContent";var ga=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("flex items-center p-6 pt-0",e),...t}));ga.displayName="CardFooter";var Xr=be(require("react"));var O=Xr.forwardRef(({className:e,type:t,...a},o)=>(0,qr.jsx)("input",{type:t,className:b("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:o,...a}));O.displayName="Input";var he=be(require("@radix-ui/react-select")),ra=be(require("react")),ze=he.Root;var Ye=he.Value,je=ra.forwardRef(({children:e,className:t,...a},o)=>(0,qr.jsxs)(he.Trigger,{className:b("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,qr.jsx)(he.Icon,{asChild:!0,children:(0,qr.jsx)(Tt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));je.displayName=he.Trigger.displayName;var Yr=ra.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(he.ScrollUpButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,qr.jsx)(Tt.ChevronUp,{className:"h-4 w-4"})}));Yr.displayName=he.ScrollUpButton.displayName;var Zr=ra.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(he.ScrollDownButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,qr.jsx)(Tt.ChevronDown,{className:"h-4 w-4"})}));Zr.displayName=he.ScrollDownButton.displayName;var Oe=ra.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,qr.jsx)(he.Portal,{children:(0,qr.jsxs)(he.Content,{className:b("relative qr-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",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:i,...o,children:[(0,qr.jsx)(Yr,{}),(0,qr.jsx)(he.Viewport,{className:b("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,qr.jsx)(Zr,{})]})}));Oe.displayName=he.Content.displayName;var Fn=ra.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(he.Label,{className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));Fn.displayName=he.Label.displayName;var Q=ra.forwardRef(({children:e,className:t,...a},o)=>(0,qr.jsxs)(he.Item,{className:b("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:o,...a,children:[(0,qr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,qr.jsx)(he.ItemIndicator,{children:(0,qr.jsx)(Tt.Check,{className:"h-4 w-4"})})}),(0,qr.jsx)(he.ItemText,{children:e})]}));Q.displayName=he.Item.displayName;var Ln=ra.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(he.Separator,{className:b("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Ln.displayName=he.Separator.displayName;var _o=require("motion/react");var ba=be(require("@radix-ui/react-tabs"));function Qr({className:e,...t}){return(0,qr.jsx)(ba.Root,{"data-slot":"tabs",className:b("flex flex-col gap-2",e),...t})}function ei({className:e,...t}){return(0,qr.jsx)(ba.List,{"data-slot":"tabs-list",className:b("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function ti({className:e,...t}){return(0,qr.jsx)(ba.Trigger,{"data-slot":"tabs-trigger",className:b("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 qt=be(require("react")),xe=be(require("@radix-ui/react-dropdown-menu")),Ea=require("@radix-ui/react-icons");var uo=xe.Root,go=xe.Trigger;var jn=qt.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,qr.jsxs)(xe.SubTrigger,{ref:i,className:b("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[a,(0,qr.jsx)(Ea.ChevronRightIcon,{className:"ml-auto"})]}));jn.displayName=xe.SubTrigger.displayName;var On=qt.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(xe.SubContent,{ref:a,className:b("qr-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}));On.displayName=xe.SubContent.displayName;var _a=qt.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,qr.jsx)(xe.Portal,{children:(0,qr.jsx)(xe.Content,{ref:o,sideOffset:t,className:b("qr-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),...a})}));_a.displayName=xe.Content.displayName;var ha=qt.forwardRef(({className:e,inset:t,...a},o)=>(0,qr.jsx)(xe.Item,{ref:o,className:b("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));ha.displayName=xe.Item.displayName;var Hn=qt.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,qr.jsxs)(xe.CheckboxItem,{ref:i,className:b("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:a,...o,children:[(0,qr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,qr.jsx)(xe.ItemIndicator,{children:(0,qr.jsx)(Ea.CheckIcon,{className:"h-4 w-4"})})}),t]}));Hn.displayName=xe.CheckboxItem.displayName;var zn=qt.forwardRef(({className:e,children:t,...a},o)=>(0,qr.jsxs)(xe.RadioItem,{ref:o,className:b("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),...a,children:[(0,qr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,qr.jsx)(xe.ItemIndicator,{children:(0,qr.jsx)(Ea.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));zn.displayName=xe.RadioItem.displayName;var Vn=qt.forwardRef(({className:e,inset:t,...a},o)=>(0,qr.jsx)(xe.Label,{ref:o,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Vn.displayName=xe.Label.displayName;var Un=qt.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(xe.Separator,{ref:a,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Un.displayName=xe.Separator.displayName;var $n=({className:e,...t})=>(0,qr.jsx)("span",{className:b("ml-auto text-_o tracking-widest opacity-60",e),...t});$n.displayName="DropdownMenuShortcut";function fo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let m=a.find(s=>s.value===e);return(0,qr.jsxs)(_o.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,qr.jsx)("div",{className:"hidden lg:block",children:(0,qr.jsx)(Qr,{value:e,onValueChange:t,children:(0,qr.jsx)(ei,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,qr.jsx)(ti,{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,qr.jsx)("div",{className:"lg:hidden",children:(0,qr.jsxs)(uo,{children:[(0,qr.jsx)(go,{asChild:!0,children:(0,qr.jsxs)(w,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[m?.label||"Select",(0,qr.jsx)(Tt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,qr.jsx)(_a,{align:"center",className:"w-[180px]",children:a.map(s=>(0,qr.jsx)(ha,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}var vo=be(require("react")),Xt=be(require("@radix-ui/react-avatar"));var Jt=vo.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Xt.Root,{ref:a,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Jt.displayName=Xt.Root.displayName;var Ga=vo.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Xt.Image,{ref:a,className:b("aspect-square h-full w-full",e),...t}));Ga.displayName=Xt.Image.displayName;var Yt=vo.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Xt.Fallback,{ref:a,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Yt.displayName=Xt.Fallback.displayName;var Kn=(0,Gr.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-_o 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 Y({className:e,variant:t,...a}){return(0,qr.jsx)("div",{className:b(Kn({variant:t}),e),...a})}function ho({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:i=!0,compact:r=!1,className:m}){let[s,c]=(0,Ht.useState)(!1),n=h=>{switch(h){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},l=h=>{switch(h){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},p=h=>{if(!h)return"Never";let N=Math.floor((new Date().getTime()-h.getTime())/(1e3*60));return N<1?"Just now":N<60?`${N}m ago`:N<1440?`${Math.floor(N/60)}h ago`:`${Math.floor(N/1440)}qr ago`};return(0,qr.jsxs)(L,{className:b("hover:shadow-md transition-shadow",r&&"p-2",m),children:[(0,qr.jsx)(Ie,{className:b("pb-3",r&&"pb-2"),children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)("div",{className:"relative",children:(0,qr.jsxs)(Jt,{className:b("h-12 w-12",r&&"h-8 w-8"),children:[(0,qr.jsx)(Ga,{src:"/placeholder.svg",alt:e.name}),(0,qr.jsx)(Yt,{children:e.name.split(" ").map(h=>h[0]).join("")})]})}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("h3",{className:b("font-semibold text-sm truncate",r&&"text-_o"),children:e.name}),e.type==="digital"?(0,qr.jsx)(Tt.Bot,{className:b("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,qr.jsx)(Tt.User,{className:b("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,qr.jsx)("p",{className:b("text-sm text-muted-foreground truncate",r&&"text-_o"),children:e.type==="human"?e.role:e.description}),!r&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 qr-1",children:[e.type==="human"&&(0,qr.jsx)(Y,{variant:"secondary",className:"text-_o",children:e.department}),e.type==="digital"&&(0,qr.jsxs)(Y,{variant:"secondary",className:"text-_o",children:["qr",e.version]}),(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:l(e.status)})]})]})]}),i&&(0,qr.jsxs)(uo,{children:[(0,qr.jsx)(go,{asChild:!0,children:(0,qr.jsx)(w,{variant:"ghost",size:"icon",className:b("h-8 w-8",r&&"h-6 w-6"),children:(0,qr.jsx)(Tt.MoreHorizontal,{className:b("h-4 w-4",r&&"h-3 w-3")})})}),(0,qr.jsxs)(_a,{align:"end",children:[e.type==="digital"&&(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsxs)(ha,{onClick:()=>o?.(e),children:[(0,qr.jsx)(Tt.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,qr.jsxs)(ha,{onClick:()=>t?.(e),children:[(0,qr.jsx)(Tt.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,qr.jsxs)(ha,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,qr.jsx)(Tt.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,qr.jsxs)(de,{className:"pt-0",children:[(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(Tt.Mail,{className:"h-3 w-3"}),(0,qr.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,qr.jsxs)(qr.Fragment,{children:[e.phone&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(Tt.Phone,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:e.phone})]}),e.location&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(Tt.MapPin,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(Tt.Settings,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:["qr",e.version]})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(Tt.Clock,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:["Last active: ",p(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,qr.jsx)("div",{className:"qr-3",children:(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,s?e.skills.length:3).map(h=>(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:h},h)),e.skills.length>3&&(0,qr.jsx)(w,{variant:"ghost",size:"sm",className:"h-5 px-2 text-_o",onClick:()=>c(!s),children:s?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,qr.jsx)("div",{className:"qr-3",children:(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,s?e.capabilities.length:2).map(h=>(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:h},h)),e.capabilities.length>2&&(0,qr.jsx)(w,{variant:"ghost",size:"sm",className:"h-5 px-2 text-_o",onClick:()=>c(!s),children:s?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var si=be(require("react")),Go=be(require("@radix-ui/react-label"));var _n=(0,Gr.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),T=si.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Go.Root,{ref:a,className:b(_n(),e),...t}));T.displayName=Go.Root.displayName;var di=be(require("react")),Ne=di.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("textarea",{className:b("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));Ne.displayName="Textarea";var Wo=be(require("react")),At=be(require("@radix-ui/react-scroll-area"));var Wa=Wo.forwardRef(({className:e,children:t,...a},o)=>(0,qr.jsxs)(At.Root,{ref:o,className:b("relative overflow-hidden",e),...a,children:[(0,qr.jsx)(At.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,qr.jsx)(mi,{}),(0,qr.jsx)(At.Corner,{})]}));Wa.displayName=At.Root.displayName;var mi=Wo.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,qr.jsx)(At.ScrollAreaScrollbar,{ref:o,orientation:t,className:b("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,qr.jsx)(At.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));mi.displayName=At.ScrollAreaScrollbar.displayName;function qo({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:m=!1}){let[s,c]=(0,Ht.useState)(""),[n,l]=(0,Ht.useState)([]),[p,h]=(0,Ht.useState)(!1);(0,Ht.useEffect)(()=>{if(!s.trim()){l([]),h(!1);return}let f=a.filter(P=>{if(e.map(J=>J.id).includes(P.id))return!1;let V=s.toLowerCase();return P.title.toLowerCase().includes(V)||P.description?.toLowerCase().includes(V)||P.tags?.some(J=>J.toLowerCase().includes(V))||Object.values(P.metadata||{}).some(J=>String(J).toLowerCase().includes(V))});l(f),h(!0)},[s,e,a]);let u=f=>{r&&e.length>=r||(t([...e,f]),c(""),h(!1))},N=f=>{t(e.filter(P=>P.id!==f))},x=!r||e.length<r;return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:o}),(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(Tt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(O,{value:s,onChange:f=>c(f.target.value),placeholder:x?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:m||!x,onFocus:()=>s&&h(!0)})]}),p&&n.length>0&&(0,qr.jsx)(L,{className:"absolute top-full left-0 right-0 qr-10 qr-1 max-h-60",children:(0,qr.jsx)(Wa,{className:"h-full",children:(0,qr.jsx)(de,{className:"p-2",children:n.map(f=>(0,qr.jsx)(w,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>u(f),disabled:m,children:(0,qr.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,qr.jsx)(Tt.FileText,{className:"h-4 w-4 qr-0.5 text-muted-foreground flex-shrink-0"}),(0,qr.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,qr.jsx)("div",{className:"font-medium text-sm truncate",children:f.title}),f.description&&(0,qr.jsx)("div",{className:"text-_o text-muted-foreground qr-1 line-clamp-2",children:f.description}),f.tags&&f.tags.length>0&&(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1 qr-2",children:[f.tags.slice(0,3).map(P=>(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:P},P)),f.tags.length>3&&(0,qr.jsxs)(Y,{variant:"outline",className:"text-_o",children:["+",f.tags.length-3," more"]})]})]})]})},f.id))})})}),p&&s&&n.length===0&&(0,qr.jsx)(L,{className:"absolute top-full left-0 right-0 qr-10 qr-1",children:(0,qr.jsxs)(de,{className:"p-4 text-center text-sm text-muted-foreground",children:['_o knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,qr.jsx)("div",{className:"space-y-2",children:e.map(f=>(0,qr.jsx)(L,{className:"p-3",children:(0,qr.jsxs)("div",{className:"flex items-start gap-3",children:[(0,qr.jsx)(Tt.FileText,{className:"h-4 w-4 qr-0.5 text-muted-foreground flex-shrink-0"}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsx)("div",{className:"font-medium text-sm",children:f.title}),f.description&&(0,qr.jsx)("div",{className:"text-_o text-muted-foreground qr-1",children:f.description}),f.tags&&f.tags.length>0&&(0,qr.jsx)("div",{className:"flex flex-wrap gap-1 qr-2",children:f.tags.map(P=>(0,qr.jsxs)(Y,{variant:"outline",className:"text-_o",children:[(0,qr.jsx)(Tt.Tag,{className:"h-3 w-3 mr-1"}),P]},P))})]}),(0,qr.jsx)(w,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>N(f.id),disabled:m,children:(0,qr.jsx)(Tt.qr,{className:"h-3 w-3"})})]})},f.id))})]}),p&&(0,qr.jsx)("div",{className:"fixed inset-0 qr-0",onClick:()=>h(!1)})]})}function Xo({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:m="Cancel",readOnly:s=!1,availableKnowledgeDocuments:c=[]}){let[n,l]=(0,Ht.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[p,h]=(0,Ht.useState)(""),[u,N]=(0,Ht.useState)(""),[x,f]=(0,Ht.useState)(!s);(0,Ht.useEffect)(()=>{e&&l(e)},[e]);let P=D=>{D.preventDefault();let te=n.version?parseInt(n.version):0,R=e?(te+1).toString():"1",we={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(we)},A=(D,te,R)=>{if(!te.trim())return;let we=n[D]||[];l({...n,[D]:[...we,te.trim()]}),R("")},V=(D,te)=>{let R=n[D]||[];l({...n,[D]:R.filter((we,q)=>q!==te)})},J=D=>{D.preventDefault(),f(!x)},S=(D,te,R,we,q)=>{let M=n[D]||[];return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:te}),x&&(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsx)(O,{value:R,onChange:ne=>we(ne.target.value),placeholder:q,onKeyPress:ne=>{ne.key==="Enter"&&(ne.preventDefault(),A(D,R,we))},disabled:o}),(0,qr.jsx)(w,{type:"button",variant:"outline",size:"icon",onClick:()=>A(D,R,we),disabled:o,children:(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"})})]}),(0,qr.jsx)("div",{className:"flex flex-wrap gap-2",children:M.map((ne,$e)=>(0,qr.jsxs)(Y,{className:"gap-1",children:[ne,x&&(0,qr.jsx)(w,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>V(D,$e),disabled:o,children:(0,qr.jsx)(Tt.qr,{className:"h-3 w-3"})})]},`${D}-${$e}-${ne}`))})]})},B=i||(x?e?"Edit Colleague":"Add New Colleague":"View Colleague"),ve=r||(e?"Update Colleague":"Add Colleague");return(0,qr.jsxs)(L,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,qr.jsx)(Ie,{children:(0,qr.jsxs)(Le,{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.Bot,{className:"h-5 w-5"}),B]})}),(0,qr.jsx)(de,{children:(0,qr.jsxs)("form",{onSubmit:P,className:"space-y-6",children:[(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",children:"Name *"}),(0,qr.jsx)(O,{id:"name",value:n.name||"",onChange:D=>l({...n,name:D.target.value}),required:!0,disabled:o||!x})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:n.description||"",onChange:D=>l({...n,description:D.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!x})]})]}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"jobDescription",children:"Job Description *"}),(0,qr.jsx)(Ne,{id:"jobDescription",value:n.jobDescription||"",onChange:D=>l({...n,jobDescription:D.target.value}),rows:4,required:n.type==="digital",disabled:o||!x})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,qr.jsx)(Ne,{id:"workInstructions",value:n.workInstructions||"",onChange:D=>l({...n,workInstructions:D.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!x})]}),S("capabilities","Capabilities",u,N,"Add capability"),(0,qr.jsx)(qo,{selectedDocuments:n.knowledge||[],onDocumentsChange:D=>l({...n,knowledge:D}),label:"Knowledge",placeholder:"Search for knowledge documents to add...",disabled:o||!x,availableDocuments:c}),(0,qr.jsx)(qo,{selectedDocuments:n.coreKnowledge||[],onDocumentsChange:D=>l({...n,coreKnowledge:D}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:o||!x,availableDocuments:c})]}),(0,qr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:a,disabled:o,children:x?m:"Close"}),x?(0,qr.jsx)(w,{type:"submit",disabled:o,children:o?"Saving...":ve}):(0,qr.jsxs)(w,{type:"button",onClick:J,disabled:o,className:"gap-2",children:[(0,qr.jsx)(Tt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function pi({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[i,r]=(0,Ht.useState)(""),m=(0,Ht.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(l=>l.toLowerCase().includes(i.toLowerCase()))),[e,i]),s=c=>{t(c)};return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(Tt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Choose a user to add Ht a colleague"})]})]}),(0,qr.jsx)(L,{className:"container",children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(Tt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(O,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:c=>r(c.target.value),className:"pl-9"})]})})})})}),(0,qr.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:m.map(c=>(0,qr.jsx)(_o.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,qr.jsxs)(L,{className:`cursor-pointer transition-all hover:shadow-lg ${o===c.id?"ring-2 ring-primary":""}`,onClick:()=>s(c),children:[(0,qr.jsx)(Ie,{className:"pb-3",children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsxs)(Jt,{children:[(0,qr.jsx)(Ga,{src:c.avatar,alt:c.name}),(0,qr.jsx)(Yt,{children:(0,qr.jsx)(Tt.User,{className:"h-4 w-4"})})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(Le,{className:"text-lg",children:c.name}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:c.role})]})]}),o===c.id&&(0,qr.jsx)(Tt.Check,{className:"h-5 w-5 text-primary"})]})}),(0,qr.jsx)(de,{className:"pt-0",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,qr.jsx)("p",{className:"text-sm font-medium",children:c.email})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"}),(0,qr.jsx)(Y,{variant:"secondary",children:c.department})]}),c.location&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Location"}),(0,qr.jsx)("p",{className:"text-sm",children:c.location})]}),c.skills&&c.skills.length>0&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[c.skills.slice(0,3).map(n=>(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:n},n)),c.skills.length>3&&(0,qr.jsxs)(Y,{variant:"outline",className:"text-_o",children:["+",c.skills.length-3]})]})]})]})})]})},c.id))}),m.length===0&&(0,qr.jsx)(L,{className:"container qr-4",children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(Tt.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"_o users found"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function ui({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[i,r]=(0,Ht.useState)(""),[m,s]=(0,Ht.useState)("all"),c=(0,Ht.useMemo)(()=>e.filter(p=>{let h=p.name.toLowerCase().includes(i.toLowerCase())||p.jobDescription.toLowerCase().includes(i.toLowerCase())||p.capabilities.some(N=>N.toLowerCase().includes(i.toLowerCase()))||p.workInstructions.toLowerCase().includes(i.toLowerCase()),u=m==="all"||p.status===m;return h&&u}),[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)},l=p=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(p);return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(Tt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(Tt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(O,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:p=>r(p.target.value),className:"pl-9"})]})}),(0,qr.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,qr.jsx)("option",{value:"all",children:"All Status"}),(0,qr.jsx)("option",{value:"active",children:"Active"}),(0,qr.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,qr.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:c.map(p=>(0,qr.jsx)(_o.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,qr.jsxs)(L,{className:`cursor-pointer transition-all hover:shadow-lg ${o===p.id?"ring-2 ring-primary":""}`,onClick:()=>n(p),children:[(0,qr.jsx)(Ie,{className:"pb-3",children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)(Jt,{children:(0,qr.jsx)(Yt,{className:"bg-blue-100",children:(0,qr.jsx)(Tt.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,qr.jsxs)("div",{children:[(0,qr.jsxs)(Le,{className:"text-lg flex items-center gap-2",children:[p.name,(0,qr.jsx)(Y,{variant:p.status==="active"?"default":"secondary",className:"text-_o",children:p.status})]}),(0,qr.jsxs)("p",{className:"text-sm text-muted-foreground",children:["qr",p.version]})]})]}),(0,qr.jsxs)(w,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:h=>{h.stopPropagation(),n(p)},children:[(0,qr.jsx)(Tt.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,qr.jsx)(de,{className:"pt-0",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,qr.jsx)("p",{className:"text-sm line-clamp-2",children:p.jobDescription})]}),p.capabilities&&p.capabilities.length>0&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[p.capabilities.slice(0,3).map(h=>(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:h},h)),p.capabilities.length>3&&(0,qr.jsxs)(Y,{variant:"outline",className:"text-_o",children:["+",p.capabilities.length-3]})]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o text-muted-foreground",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:["Updated ",l(p.lastUpdated)]})]}),p.knowledge&&(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,qr.jsx)(Tt.Users,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:[p.knowledge.length," docs"]})]})]}),p.workInstructions&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,qr.jsx)("p",{className:"text-_o line-clamp-2",children:p.workInstructions})]})]})})]})},p.id))}),c.length===0&&(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(Tt.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"_o digital colleagues found"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function gi({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(Tt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,qr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,qr.jsxs)(Ie,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(Tt.User,{className:"h-8 w-8 text-blue-600"})}),(0,qr.jsx)(Le,{className:"text-xl",children:"Add Human Colleague"})]}),(0,qr.jsxs)(de,{className:"text-center",children:[(0,qr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add Ht team members."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Users,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Browse existing users"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.User,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Import user details automatically"})]})]}),(0,qr.jsx)(w,{className:"qr-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,qr.jsxs)(Ie,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(Tt.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,qr.jsx)(Le,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,qr.jsxs)(de,{className:"text-center",children:[(0,qr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Bot,{className:"h-4 w-4 text-purple-600"}),(0,qr.jsx)("span",{children:"Clone existing colleagues"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Users,{className:"h-4 w-4 text-purple-600"}),(0,qr.jsx)("span",{children:"Create from templates"})]})]}),(0,qr.jsx)(w,{className:"qr-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function fi({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(Tt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,qr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,qr.jsxs)(Ie,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(Tt.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,qr.jsx)(Le,{className:"text-xl",children:"Clone Existing"})]}),(0,qr.jsxs)(de,{className:"text-center",children:[(0,qr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize qr for your needs."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Bot,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Copy,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,qr.jsx)(w,{className:"qr-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,qr.jsxs)(Ie,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(Tt.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,qr.jsx)(Le,{className:"text-xl",children:"Create New"})]}),(0,qr.jsxs)(de,{className:"text-center",children:[(0,qr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4 text-green-600"}),(0,qr.jsx)("span",{children:"Custom job description"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,qr.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,qr.jsx)(w,{className:"qr-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}function vi(e,t){let[a,o]=(0,Ht.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Ht.useEffect)(()=>{i(a)},[]),[a,i]}var wo=require("react-icons/qr");function st({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:m,className:s}){let[c,n]=vi(`hero-section-minimized-${e.replace(/\s+/qr,"-").toLowerCase()}`,!i&&!t),l=!i&&!t||c;return(0,qr.jsxs)(_o.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,qr.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,qr.jsx)(Y,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,qr.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[l&&o&&(0,qr.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,qr.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,qr.jsx)(wo.FaChevronDown,{size:22}):(0,qr.jsx)(wo.FaChevronUp,{size:22})})]})]}),!l&&(0,qr.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,qr.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,qr.jsx)(w,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),m&&(0,qr.jsx)("div",{className:"hidden lg:block",children:m})]})]})}function Jo({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:m,availableUsers:s=[],existingDigitalColleagues:c=[]}){let[n,l]=(0,Ht.useState)(e||[]),[p,h]=(0,Ht.useState)(""),[u,N]=(0,Ht.useState)("all"),[x,f]=(0,Ht.useState)("all"),[P,A]=(0,Ht.useState)("all"),[V,J]=(0,Ht.useState)(null),[S,B]=(0,Ht.useState)(null);(0,Ht.useEffect)(()=>{l(e||[])},[e]);let ve=Array.isArray(s)?s:[],D=Array.isArray(c)?c:[],[te,R]=(0,Ht.useState)("main"),we=n.filter(C=>{if(!C||!C.name)return!1;let He=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()),Pe=u==="all"||C.type==="human"&&C.department===u,It=x==="all"||C.status===x;return He&&Pe&&It}),q=we.filter(C=>C.type==="human"),M=we.filter(C=>C.type==="digital"),ne=()=>{R("typeSelection")},$e=C=>{C.type==="digital"&&(J(C),R("form")),console.log("Editing colleague:",C),a?.(C)},Ae=C=>{C.type==="digital"&&(B(C),R("view"))},De=C=>{let He={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};l(Pe=>[...Pe,He]),t?.(He),R("main")},ut=C=>{if(!C||!C.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",C);return}l(He=>[...He,C]),t?.(C),R("main")},pt=()=>{J(null),R("form")},Dt=C=>{if(!C||!C.id){console.error("Invalid colleague provided to handleSaveColleague:",C);return}V?(l(He=>He.map(Pe=>Pe.id===C.id?C:Pe)),a?.(C)):(l(He=>[...He,C]),t?.(C)),R("main"),J(null)},Ke=()=>{R("main"),J(null),B(null)},qe=()=>{R("main"),B(null)},Nt=()=>{S&&(J(S),B(null),R("form"))},ft=C=>{o?.(C,n.find(He=>He.id===C).type),l(He=>He.filter(Pe=>Pe.id!==C))},I=()=>{h(""),N("all"),f("all")},$=()=>{let C=[];return D.forEach(Pe=>{Pe.knowledge&&Array.isArray(Pe.knowledge)&&C.push(...Pe.knowledge),Pe.coreKnowledge&&Array.isArray(Pe.coreKnowledge)&&C.push(...Pe.coreKnowledge)}),n.forEach(Pe=>{Pe.type==="digital"&&(Pe.knowledge&&Array.isArray(Pe.knowledge)&&C.push(...Pe.knowledge),Pe.coreKnowledge&&Array.isArray(Pe.coreKnowledge)&&C.push(...Pe.coreKnowledge))}),C.filter((Pe,It,$t)=>It===$t.findIndex(K=>K.id===Pe.id))};return te==="typeSelection"?(0,qr.jsx)(gi,{onSelectHuman:()=>R("userSelection"),onSelectDigital:()=>R("digitalOptions"),onCancel:()=>R("main")}):te==="userSelection"?(0,qr.jsx)(pi,{users:ve,onUserSelect:De,onCancel:()=>R("typeSelection")}):te==="digitalOptions"?(0,qr.jsx)(fi,{onCloneExisting:()=>R("digitalClone"),onCreateNew:pt,onCancel:()=>R("typeSelection")}):te==="digitalClone"?(0,qr.jsx)(ui,{digitalColleagues:D,onColleagueClone:ut,onCancel:()=>R("digitalOptions")}):te==="form"?(0,qr.jsx)(Xo,{colleague:V||void 0,onSave:Dt,onCancel:Ke,availableKnowledgeDocuments:$()}):te==="view"?(0,qr.jsx)(Xo,{colleague:S||void 0,onSave:Dt,onCancel:qe,readOnly:!0,availableKnowledgeDocuments:$()}):(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsx)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,qr.jsxs)("div",{className:`space-y-6 ${m||""}`,children:[(0,qr.jsx)(st,{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:ne}}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,qr.jsxs)(L,{children:[(0,qr.jsxs)(Ie,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,qr.jsx)(Le,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,qr.jsx)(Tt.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,qr.jsxs)(de,{children:[(0,qr.jsx)("div",{className:"text-2xl font-bold",children:n.length}),(0,qr.jsxs)("p",{className:"text-_o text-muted-foreground",children:[n.filter(C=>C.status==="active").length," active"]})]})]}),(0,qr.jsxs)(L,{children:[(0,qr.jsxs)(Ie,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,qr.jsx)(Le,{className:"text-sm font-medium",children:"Human Members"}),(0,qr.jsx)(Tt.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,qr.jsxs)(de,{children:[(0,qr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(C=>C.type==="human").length}),(0,qr.jsxs)("p",{className:"text-_o text-muted-foreground",children:[n.filter(C=>C.type==="human"&&C.status==="active").length," ","active"]})]})]}),(0,qr.jsxs)(L,{children:[(0,qr.jsxs)(Ie,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,qr.jsx)(Le,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,qr.jsx)(Tt.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,qr.jsxs)(de,{children:[(0,qr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(C=>C.type==="digital").length}),(0,qr.jsxs)("p",{className:"text-_o text-muted-foreground",children:[n.filter(C=>C.type==="digital"&&C.status==="active").length," ","active"]})]})]})]}),(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(Tt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(O,{placeholder:"Search colleagues...",value:p,onChange:C=>h(C.target.value),className:"pl-9"})]})}),(0,qr.jsxs)(ze,{value:u,onValueChange:N,children:[(0,qr.jsx)(je,{className:"w-full md:w-[180px]",children:(0,qr.jsx)(Ye,{placeholder:"Department"})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"all",children:"All Departments"}),r.map(C=>(0,qr.jsx)(Q,{value:C,children:C},C))]})]}),(0,qr.jsxs)(ze,{value:x,onValueChange:f,children:[(0,qr.jsx)(je,{className:"w-full md:w-[140px]",children:(0,qr.jsx)(Ye,{placeholder:"Status"})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"all",children:"All Status"}),(0,qr.jsx)(Q,{value:"active",children:"Active"}),(0,qr.jsx)(Q,{value:"inactive",children:"Inactive"})]})]}),(p||u!=="all"||x!=="all")&&(0,qr.jsxs)(w,{variant:"outline",onClick:I,className:"gap-2",children:[(0,qr.jsx)(Tt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)(fo,{activeTab:P,onTabChange:A,tabOptions:[{value:"all",label:`All (${we.length})`},{value:"human",label:`Human (${q.length})`},{value:"digital",label:`Digital (${M.length})`}],maxWidth:"400px",gridCols:3}),P==="all"&&(0,qr.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:we.map(C=>(0,qr.jsx)(ho,{colleague:C,onEdit:$e,onDelete:ft,onViewDetails:Ae,compact:i},`${C}-${C.id}`))}),P==="human"&&(0,qr.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:q.map(C=>(0,qr.jsx)(ho,{colleague:C,onEdit:$e,onDelete:ft,onViewDetails:Ae,compact:i},C.id))}),P==="digital"&&(0,qr.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:M.map(C=>(0,qr.jsx)(ho,{colleague:C,onEdit:$e,onDelete:ft,onViewDetails:Ae,compact:i},C.id))})]}),we.length===0&&(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(Tt.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"_o colleagues found"}),(0,qr.jsx)("p",{className:"text-muted-foreground mb-4",children:p||u!=="all"||x!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,qr.jsxs)(w,{onClick:ne,className:"gap-2",children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function Co({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:i=!0,className:r}){return(0,qr.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,qr.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,qr.jsx)("div",{className:"col-span-6",children:"Name"}),(0,qr.jsx)("div",{className:"col-span-2",children:"Size"}),(0,qr.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,qr.jsx)("div",{className:"divide-y",children:e.map(m=>(0,qr.jsxs)(_o.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,qr.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,qr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,qr.jsx)("div",{children:(0,qr.jsx)("p",{className:"font-medium",children:m.name})})]}),(0,qr.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:m.filesize}),(0,qr.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,qr.jsx)("span",{className:"text-sm md:text-base",children:typeof m.createdAt=="string"?m.createdAt:new Date(m.createdAt).toLocaleDateString()}),(0,qr.jsx)("div",{className:"flex gap-1",children:(0,qr.jsx)(w,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),o?.(m)},children:(0,qr.jsx)(Tt.Trash2,{className:"h-4 w-4"})})})]})]},m.name))})]})}function Ya({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,compactView:r=!1,className:m}){let[s,c]=(0,Ht.useState)(e),[n,l]=(0,Ht.useState)(""),[p,h]=(0,Ht.useState)("all"),[u,N]=(0,Ht.useState)("all");(0,Ht.useEffect)(()=>{c(e)},[e]);let x=Array.from(new Set(s.map(D=>D.mimeType))),f=s.filter(D=>{let te=D.name.toLowerCase().includes(n.toLowerCase()),R=p==="all"||D.mimeType===p;return te&&R}),P=f.slice(0,10),A=f.filter(Boolean),V=()=>{t?.()},J=D=>{a?.(D)},S=D=>{console.log("deleting file",D),c(te=>te.filter(R=>R.name!==D.name)),o?.(D.id)},B=D=>{i?.(D)},ve=()=>{l(""),h("all")};return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsx)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,qr.jsxs)("div",{className:`space-y-6 ${m||""}`,children:[(0,qr.jsx)(st,{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:V},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(Tt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(O,{placeholder:"Search files...",value:n,onChange:D=>l(D.target.value),className:"pl-9"})]})}),(n||p!=="all")&&(0,qr.jsxs)(w,{variant:"outline",onClick:ve,className:"gap-2",children:[(0,qr.jsx)(Tt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)(fo,{activeTab:u,onTabChange:N,tabOptions:[{value:"all",label:`All Files (${f.length})`},{value:"recent",label:`Recent (${P.length})`}],maxWidth:"500px",gridCols:3}),u==="all"&&(0,qr.jsx)(Co,{files:f,onFileClick:B,onFileEdit:J,onFileDelete:S,showHeader:!r}),u==="recent"&&(0,qr.jsx)(Co,{files:P,onFileClick:B,onFileEdit:J,onFileDelete:S,showHeader:!r}),u==="shared"&&(0,qr.jsx)(Co,{files:A,onFileClick:B,onFileEdit:J,onFileDelete:S,showHeader:!r})]}),f.length===0&&(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(Tt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"_o files found"}),(0,qr.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,qr.jsxs)(w,{onClick:V,className:"gap-2",children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}function Ni({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:i=[]}){let[r,m]=(0,Ht.useState)({...e,updatedAt:new Date}),s=()=>{let x=new Set,f=new Set;return i.forEach(P=>{P.menuConfig.groupBy.forEach(A=>x.add(A))}),o.forEach(P=>{P.metadata&&Object.keys(P.metadata).forEach(A=>f.add(A))}),{contextKeys:Array.from(x).sort(),documentKeys:Array.from(f).sort(),allKeys:Array.from(new Set([...x,...f])).sort()}},c=x=>{let f=new Set;return o.forEach(P=>{P.metadata?.[x]&&f.add(String(P.metadata[x]))}),Array.from(f).sort()},n=s(),l=()=>{t(r)},p=(x,f)=>{m(P=>({...P,metadata:{...P.metadata,[x]:f}}))},h=(x,f)=>{f==="__custom__"?p(x,""):p(x,f)},u=()=>{let x=`field_${Date.now()}`;p(x,"")},N=x=>{m(f=>{let P={...f.metadata};return delete P[x],{...f,metadata:P}})};return(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,qr.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,qr.jsx)(Tt.Edit3,{className:"h-6 w-6 text-primary"})}),(0,qr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Edit Document"})]}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsxs)(w,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"}),"Cancel"]}),(0,qr.jsxs)(w,{size:"sm",onClick:l,className:"gap-2",children:[(0,qr.jsx)(Tt.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,qr.jsx)(O,{value:r.title,onChange:x=>m(f=>({...f,title:x.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,qr.jsx)(Ne,{value:r.description||"",onChange:x=>m(f=>({...f,description:x.target.value})),placeholder:"Document description...",rows:2})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground",children:"Metadata"}),n.contextKeys.length>0&&(0,qr.jsxs)("p",{className:"text-_o text-muted-foreground",children:["Suggested: ",n.contextKeys.slice(0,4).join(", "),n.contextKeys.length>4&&` +${n.contextKeys.length-4}`]})]}),(0,qr.jsxs)(w,{type:"button",variant:"outline",size:"sm",onClick:u,className:"gap-1 h-8",children:[(0,qr.jsx)(Tt.Plus,{className:"h-3 w-3"}),"Add"]})]}),r.metadata&&Object.keys(r.metadata).length>0?(0,qr.jsx)("div",{className:"space-y-2",children:Object.entries(r.metadata).map(([x,f])=>{let P=c(x);return(0,qr.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,qr.jsx)(O,{value:x,onChange:A=>{let V=A.target.value,J=r.metadata?.[x];m(S=>{let B={...S.metadata};return delete B[x],V&&(B[V]=J||""),{...S,metadata:B}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${x}`}),(0,qr.jsx)("datalist",{id:`metadata-keys-${x}`,children:n.allKeys.map(A=>(0,qr.jsx)("option",{value:A},A))}),(0,qr.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),P.length>0?(0,qr.jsxs)(ze,{value:String(f||""),onValueChange:A=>h(x,A),children:[(0,qr.jsx)(je,{className:"flex-1 h-8 text-sm",children:(0,qr.jsx)(Ye,{placeholder:"Value"})}),(0,qr.jsxs)(Oe,{children:[P.map(A=>(0,qr.jsx)(Q,{value:A,children:A},A)),(0,qr.jsx)(Q,{value:"__custom__",children:(0,qr.jsx)("span",{className:"text-muted-foreground text-_o",children:"Custom..."})})]})]}):(0,qr.jsx)(O,{value:String(f||""),onChange:A=>p(x,A.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,qr.jsx)(w,{type:"button",variant:"ghost",size:"sm",onClick:()=>N(x),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,qr.jsx)(Tt.qr,{className:"h-3 w-3"})})]},x)})}):(0,qr.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:(0,qr.jsx)("p",{className:"text-_o text-muted-foreground",children:'_o metadata \u2022 Click "Add" to create fields'})})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,qr.jsx)(Y,{variant:"secondary",className:"font-mono",children:r.format.toUpperCase()})]})]})]}),(0,qr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,qr.jsxs)("div",{className:"p-8",children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,qr.jsx)(Ne,{value:r.content||"",onChange:x=>m(f=>({...f,content:x.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var Di=e=>(0,qr.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/qr,"<br>").replace(/\*\*(.*?)\*\*/qr,"<strong>$1</strong>").replace(/\*(.*?)\*/qr,"<em>$1</em>").replace(/`(.*?)`/qr,'<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>')}}),Ci=e=>(0,qr.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Gn=e=>(0,qr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,qr.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,qr.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,qr.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,qr.jsx)("pre",{className:"text-sm",children:e})]}),Wn=e=>(0,qr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,qr.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,qr.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,qr.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),Di(e)]});function Pi({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:i=[],knowledgeContexts:r=[]}){let[m,s]=(0,Ht.useState)(!1),c=u=>{switch(u){case"markdown":case"mdx":return(0,qr.jsx)(Tt.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,qr.jsx)(Tt.File,{className:"h-6 w-6 text-success"});case"text":return(0,qr.jsx)(Tt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,qr.jsx)(Tt.File,{className:"h-6 w-6 text-muted-foreground"})}},n=u=>{switch(u){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richtext":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},l=(u,N)=>{let x={markdown:Di,mdx:Wn,richtext:Gn,text:Ci},f=o?.[N]||x[N];return f?f(u):Ci(u)},p=u=>{s(!1),t?.(u)},h=()=>{s(!1)};return m?(0,qr.jsx)(Ni,{document:e,onSave:p,onCancel:h,availableDocuments:i,knowledgeContexts:r}):(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,qr.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,qr.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,qr.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:c(e.format)}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,qr.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,qr.jsx)("div",{className:"flex-shrink-0",children:(0,qr.jsxs)(w,{variant:"outline",size:"sm",onClick:()=>s(!0),className:"gap-2",children:[(0,qr.jsx)(Tt.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,qr.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${n(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(u=>(0,qr.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",u]},u))]})]}),(0,qr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,qr.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,qr.jsxs)("div",{className:"mb-6",children:[(0,qr.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,qr.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,qr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-_o",children:Object.entries(e.metadata).map(([u,N])=>(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsxs)("span",{className:"text-muted-foreground font-medium",children:[u.replace(/([A-qr])/qr," $1").trim(),":"]}),(0,qr.jsx)("span",{className:"text-foreground truncate",children:String(N)})]},u))})})]}),(0,qr.jsx)("div",{className:"space-y-4",children:e.content?(0,qr.jsx)("div",{className:"relative",children:(0,qr.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:l(e.content,e.format)})}):(0,qr.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,qr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,qr.jsx)(Tt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,qr.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"_o content available"}),(0,qr.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function Ti({label:e,documents:t,children:a,level:o,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:m=!0}){let[s,c]=(0,Ht.useState)(o===0),n=a&&Object.keys(a).length>0,l=t.length+(a?Object.values(a).reduce((u,N)=>u+N.documents.length,0):0),p=u=>{switch(u){case"markdown":case"mdx":return(0,qr.jsx)(Tt.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,qr.jsx)(Tt.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,qr.jsx)(Tt.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},h=u=>{let N=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return N[u%N.length]};return(0,qr.jsxs)("div",{className:"space-y-1",children:[(n||t.length>0)&&(0,qr.jsxs)(_o.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>c(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,qr.jsx)("div",{className:`w-1 h-6 rounded-full ${h(o)}`}),(0,qr.jsx)(_o.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,qr.jsx)(Tt.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,qr.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,qr.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,qr.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),m&&l>0&&(0,qr.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,qr.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-_o font-medium bg-muted text-muted-foreground rounded-full",children:l})})]})]}),(0,qr.jsx)(_o.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,qr.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((u,N)=>(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:N*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===u.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>i?.(u),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,qr.jsx)("div",{className:"flex-shrink-0",children:p(u.format)}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsx)("p",{className:`text-sm truncate transition-colors ${r===u.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:u.title}),u.description&&(0,qr.jsx)("p",{className:"text-_o text-muted-foreground truncate qr-0.5",children:u.description})]}),u.tags&&u.tags.length>0&&(0,qr.jsx)("div",{className:"flex-shrink-0",children:(0,qr.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-_o font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:u.tags[0]})})]},u.id)),a&&Object.entries(a).map(([u,N])=>(0,qr.jsx)(Ti,{label:u,documents:N.documents,children:N.children,level:o+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:m},u))]})})]})}function Ri({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:i,selectedDocumentId:r,className:m,editable:s=!0}){let[c,n]=(0,Ht.useState)(""),[l,p]=(0,Ht.useState)(null),h=(0,Ht.useMemo)(()=>c?e.filter(x=>x.title.toLowerCase().includes(c.toLowerCase())||x.description?.toLowerCase().includes(c.toLowerCase())||x.tags?.some(f=>f.toLowerCase().includes(c.toLowerCase()))||Object.values(x.metadata||{}).some(f=>String(f).toLowerCase().includes(c.toLowerCase()))):e,[e,c]),u=(0,Ht.useMemo)(()=>{let x=(f,P)=>{if(P.length===0)return{};let[A,...V]=P;return f.reduce((S,B)=>{let ve=B.metadata?.[A]||"Uncategorized",D=String(ve);if(S[D]||(S[D]={documents:[],children:{}}),V.length===0)S[D].documents.push(B);else{let te=x([B],V),R=Object.keys(te)[0];R&&(S[D].children||(S[D].children={}),S[D].children[R]?S[D].children[R].documents.push(...te[R].documents):S[D].children[R]=te[R])}return S},{})};return x(h,t.groupBy)},[h,t.groupBy]),N=x=>{p(x),a?.(x)};return(0,qr.jsxs)("div",{className:`flex h-full ${m||""}`,children:[(0,qr.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,qr.jsx)("div",{className:"p-6 border-b border-border",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,qr.jsx)(Tt.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,qr.jsx)(O,{placeholder:"Search knowledge base...",value:c,onChange:x=>n(x.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,qr.jsx)(Wa,{className:"h-[calc(100%-100px)]",children:(0,qr.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(u).map(([x,f])=>(0,qr.jsx)(Ti,{label:x,documents:f.documents,children:f.children,level:0,onDocumentClick:N,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},x)),Object.keys(u).length===0&&(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,qr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,qr.jsx)(Tt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,qr.jsx)("p",{className:"text-sm font-medium",children:"_o documents found"}),(0,qr.jsx)("p",{className:"text-_o qr-1",children:"Try adjusting your search terms"})]})]})})]}),(0,qr.jsx)("div",{className:"flex-1 bg-background",children:l?(0,qr.jsx)(Pi,{document:l,onDocumentUpdate:i,editable:s}):(0,qr.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,qr.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,qr.jsx)(Tt.FileText,{className:"h-10 w-10 text-primary"})}),(0,qr.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,qr.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}function Yo({documents:e=[],contexts:t=[],onDocumentClick:a=m=>console.log("Document clicked:",m),onDocumentShare:o=m=>console.log("Share document:",m),onLoadDocumentContent:i,selectedDocumentId:r}){let[m,s]=(0,Ht.useState)(t[0]);return!t||t.length===0?(0,qr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,qr.jsx)(st,{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,qr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,qr.jsx)("p",{className:"text-muted-foreground",children:"_o contexts available"})})]}):(0,qr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,qr.jsx)(st,{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,qr.jsxs)("div",{className:"qr-6",children:[(0,qr.jsx)("div",{className:"border-b border-border",children:(0,qr.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(c=>(0,qr.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,qr.jsx)("div",{className:"qr-3 px-1",children:(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description})})]})]}),(0,qr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,qr.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,qr.jsx)(Ri,{documents:e,menuConfig:m.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r})})})]})}var ue=be(require("react"));var Ii=(e=768)=>{let[t,a]=(0,Ht.useState)(!1);return(0,Ht.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var Ai=be(require("react")),Zo=be(require("@radix-ui/react-separator"));var Qo=Ai.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},i)=>(0,qr.jsx)(Zo.Root,{ref:i,decorative:a,orientation:t,className:b("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Qo.displayName=Zo.Root.displayName;var Za=be(require("react")),dt=be(require("@radix-ui/react-dialog"));var Li=dt.Root;var qn=dt.Portal,ji=Za.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(dt.Overlay,{className:b("fixed inset-0 qr-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));ji.displayName=dt.Overlay.displayName;var Xn=(0,Gr.cva)("fixed qr-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),er=Za.forwardRef(({side:e="right",className:t,children:a,...o},i)=>(0,qr.jsxs)(qn,{children:[(0,qr.jsx)(ji,{}),(0,qr.jsxs)(dt.Content,{ref:i,className:b(Xn({side:e}),t),...o,children:[(0,qr.jsxs)(dt.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,qr.jsx)(Ea.Cross2Icon,{className:"h-4 w-4"}),(0,qr.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));er.displayName=dt.Content.displayName;var Jn=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});Jn.displayName="SheetHeader";var Yn=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yn.displayName="SheetFooter";var Zn=Za.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(dt.Title,{ref:a,className:b("text-lg font-semibold text-foreground",e),...t}));Zn.displayName=dt.Title.displayName;var Qn=Za.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(dt.Description,{ref:a,className:b("text-sm text-muted-foreground",e),...t}));Qn.displayName=dt.Description.displayName;function tr({className:e,...t}){return(0,qr.jsx)("div",{className:b("animate-pulse rounded-md bg-primary/10",e),...t})}var Hi=be(require("react")),Vt=be(require("@radix-ui/react-tooltip"));var zi=Vt.Provider,Vi=Vt.Root,Ui=Vt.Trigger,or=Hi.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,qr.jsx)(Vt.Portal,{children:(0,qr.jsx)(Vt.Content,{ref:o,sideOffset:t,className:b("qr-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-_o text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));or.displayName=Vt.Content.displayName;var el="sidebar:state",tl=60*60*24*7,al="16rem",ol="18rem",rl="3rem",il="b",_i=ue.createContext(null);function Do(){let e=ue.useContext(_i);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var rr=ue.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:i,children:r,...m},s)=>{let c=Ii(),[n,l]=ue.useState(!1),[p,h]=ue.useState(e),u=t??p,N=ue.useCallback(A=>{if(a)return a?.(typeof A=="function"?A(u):A);h(A),document.cookie=`${el}=${u}; path=/; max-age=${tl}`},[a,u]),x=ue.useCallback(()=>c?l(A=>!A):N(A=>!A),[c,N,l]);ue.useEffect(()=>{let A=V=>{V.key===il&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),x())};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[x]);let f=u?"expanded":"collapsed",P=ue.useMemo(()=>({state:f,open:u,setOpen:N,isMobile:c,openMobile:n,setOpenMobile:l,toggleSidebar:x}),[f,u,N,c,n,l,x]);return(0,qr.jsx)(_i.Provider,{value:P,children:(0,qr.jsx)(zi,{delayDuration:0,children:(0,qr.jsx)("div",{style:{"--sidebar-width":al,"--sidebar-width-icon":rl,...i},className:b("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:s,...m,children:r})})})});rr.displayName="SidebarProvider";var sl=ue.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:i,...r},m)=>{let{isMobile:s,state:c,openMobile:n,setOpenMobile:l}=Do();return a==="none"?(0,qr.jsx)("div",{className:b("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:m,...r,children:i}):s?(0,qr.jsx)(Li,{open:n,onOpenChange:l,...r,children:(0,qr.jsx)(er,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":ol},side:e,children:(0,qr.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})}):(0,qr.jsxs)("div",{ref:m,className:"group peer hidden md:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,qr.jsx)("div",{className:b("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)qr+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,qr.jsx)("div",{className:b("duration-200 fixed top-14 bottom-0 qr-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)qr+_theme(spacing.4)qr+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...r,children:(0,qr.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});sl.displayName="Sidebar";var nl=ue.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:i}=Do();return(0,qr.jsxs)(w,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:b("h-7 w-7",e),onClick:r=>{t?.(r),i()},...a,children:[(0,qr.jsx)(Tt.PanelLeft,{}),(0,qr.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});nl.displayName="SidebarTrigger";var ll=ue.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=Do();return(0,qr.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:b("absolute inset-y-0 qr-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]qr&]:cursor-w-resize [[data-side=right]qr&]:cursor-e-resize","[[data-side=left][data-state=collapsed]qr&]:cursor-e-resize [[data-side=right][data-state=collapsed]qr&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]qr&]:-right-2","[[data-side=right][data-collapsible=offcanvas]qr&]:-left-2",e),...t})});ll.displayName="SidebarRail";var dl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("main",{ref:a,className:b("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));dl.displayName="SidebarInset";var cl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(O,{ref:a,"data-sidebar":"input",className:b("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));cl.displayName="SidebarInput";var ml=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"header",className:b("flex flex-col gap-2 p-2",e),...t}));ml.displayName="SidebarHeader";var pl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"footer",className:b("flex flex-col gap-2 p-2",e),...t}));pl.displayName="SidebarFooter";var ul=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Qo,{ref:a,"data-sidebar":"separator",className:b("mx-2 w-auto bg-sidebar-border",e),...t}));ul.displayName="SidebarSeparator";var gl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"content",className:b("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));gl.displayName="SidebarContent";var fl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"group",className:b("relative flex w-full min-w-0 flex-col p-2",e),...t}));fl.displayName="SidebarGroup";var vl=ue.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,qr.jsx)(t?_r.Slot:"div",{ref:o,"data-sidebar":"group-label",className:b("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-_o font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-qr-8 group-data-[collapsible=icon]:opacity-0",e),...a}));vl.displayName="SidebarGroupLabel";var bl=ue.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,qr.jsx)(t?_r.Slot:"button",{ref:o,"data-sidebar":"group-action",className:b("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...a}));bl.displayName="SidebarGroupAction";var hl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"group-content",className:b("w-full text-sm",e),...t}));hl.displayName="SidebarGroupContent";var xl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("ul",{ref:a,"data-sidebar":"menu",className:b("flex w-full min-w-0 flex-col gap-1",e),...t}));xl.displayName="SidebarMenu";var yl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("qr",{ref:a,"data-sidebar":"menu-item",className:b("group/menu-item relative",e),...t}));yl.displayName="SidebarMenuItem";var wl=(0,$i.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-_o",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Nl=ue.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:i,className:r,...m},s)=>{let c=e?_r.Slot:"button",{isMobile:n,state:l}=Do(),p=(0,qr.jsx)(c,{ref:s,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:b(wl({variant:a,size:o}),r),...m});return i?(typeof i=="string"&&(i={children:i}),(0,qr.jsxs)(Vi,{children:[(0,qr.jsx)(Ui,{asChild:!0,children:p}),(0,qr.jsx)(or,{side:"right",align:"center",hidden:l!=="collapsed"||n,...i})]})):p});Nl.displayName="SidebarMenuButton";var Cl=ue.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},i)=>(0,qr.jsx)(t?_r.Slot:"button",{ref:i,"data-sidebar":"menu-action",className:b("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...o}));Cl.displayName="SidebarMenuAction";var Sl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:b("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-_o font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Sl.displayName="SidebarMenuBadge";var kl=ue.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let i=ue.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,qr.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:b("rounded-md h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,qr.jsx)(tr,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,qr.jsx)(tr,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});kl.displayName="SidebarMenuSkeleton";var Dl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:b("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Dl.displayName="SidebarMenuSub";var Pl=ue.forwardRef(({...e},t)=>(0,qr.jsx)("qr",{ref:t,...e}));Pl.displayName="SidebarMenuSubItem";var Tl=ue.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...i},r)=>(0,qr.jsx)(e?_r.Slot:"a",{ref:r,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:b("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-_o",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...i}));Tl.displayName="SidebarMenuSubButton";var Gi=({projects:e,epics:t,sprints:a,currentView:o,onUpdateProject:i,onDeleteProject:r,onAddProject:m,onUpdateEpic:s,onDeleteEpic:c,onAddEpic:n,onViewChange:l,mobileMenuOpen:p,onToggleMobileMenu:h})=>{let[u,N]=(0,Ht.useState)(null),[x,f]=(0,Ht.useState)(null),[P,A]=(0,Ht.useState)(null),[V,J]=(0,Ht.useState)({name:"",description:""}),[S,B]=(0,Ht.useState)({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0}),[ve,D]=(0,Ht.useState)(!1),[te,R]=(0,Ht.useState)({name:"",description:""}),we=["bg-brand-blue","bg-brand-green","bg-brand-plum","bg-brand-orange","bg-destructive","bg-warning","bg-brand-cyan","bg-accent"],q=[{value:"low",label:"Low",color:"text-destructive"},{value:"medium",label:"Medium",color:"text-warning"},{value:"high",label:"High",color:"text-success"}],M=[{value:1,label:"Phase 1",color:"text-brand-blue"},{value:2,label:"Phase 2",color:"text-brand-plum"},{value:3,label:"Phase 3",color:"text-brand-orange"},{value:4,label:"Phase 4",color:"text-brand-green"},{value:5,label:"Phase 5",color:"text-destructive"},{value:6,label:"Phase 6",color:"text-warning"},{value:7,label:"Phase 7",color:"text-brand-cyan"},{value:8,label:"Phase 8",color:"text-accent"},{value:9,label:"Phase 9",color:"text-muted-foreground"}],ne=I=>{f(I.id),J({name:I.name,description:I.description||""})},$e=()=>{x&&V.name.trim()&&(i(x,{name:V.name.trim(),description:V.description.trim()}),f(null))},Ae=()=>{f(null),J({name:"",description:""})},De=()=>{te.name.trim()&&(m({name:te.name.trim(),description:te.description.trim(),isSelected:!1}),R({name:"",description:""}),D(!1))},ut=I=>{i(I,{isSelected:!0})},pt=I=>{A(I.id),B({name:I.name,description:I.description||"",color:I.color,confidence:I.confidence,phase:I.phase,startDate:I.startDate.toISOString().split("T")[0],endDate:I.endDate.toISOString().split("T")[0],progress:I.progress})},Dt=()=>{P&&S.name.trim()&&(s(P,{name:S.name.trim(),description:S.description.trim(),color:S.color,confidence:S.confidence,phase:S.phase,startDate:new Date(S.startDate),endDate:new Date(S.endDate),progress:S.progress}),A(null))},Ke=()=>{A(null),B({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0})},qe=I=>I.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Nt=I=>{let $=q.find(C=>C.value===I);return $?{label:$.label,color:$.color}:{label:"Medium",color:"text-warning"}},ft=I=>{let $=M.find(C=>C.value===I);return $?{label:$.label,color:$.color}:{label:"Phase 1",color:"text-primary"}};return(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)("div",{className:`absolute h-full w-12 bg-sidebar-background flex flex-col qr-50 flex-shrink-0 transition-transform duration-300 group ${p?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:(0,qr.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,qr.jsxs)("button",{onClick:()=>{l("kanban"),N(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="kanban"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3`,title:"Kanban View",children:[(0,qr.jsx)(Tt.Kanban,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-_o font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Kanban"})]}),(0,qr.jsxs)("button",{onClick:()=>{l("planning"),N(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="planning"?"bg-brand-plum":"bg-brand-plum/75 hover:bg-brand-plum"} hidden md:flex hover:w-28 hover:justify-start hover:pl-3`,title:"Planning View",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-_o font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Planning"})]}),(0,qr.jsxs)("button",{onClick:()=>{l("epics"),N(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="epics"?"bg-brand-orange":"bg-brand-orange/75 hover:bg-brand-orange"} hover:w-28 hover:justify-start hover:pl-3`,title:"Epic Planning",children:[(0,qr.jsx)(Tt.Target,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-_o font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Epics"})]}),(0,qr.jsxs)("button",{onClick:()=>{l("files"),N(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="files"?"bg-brand-green":"bg-brand-green/75 hover:bg-brand-green"} hover:w-28 hover:justify-start hover:pl-3`,title:"Files",children:[(0,qr.jsx)(Tt.FileText,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-_o font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Files"})]}),(0,qr.jsxs)("button",{onClick:()=>{l("tasks"),N(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="tasks"?"bg-brand-cyan":"bg-brand-cyan/75 hover:bg-brand-cyan"} hover:w-28 hover:justify-start hover:pl-3`,title:"Tasks",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-_o font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Tasks"})]})]})}),p&&(0,qr.jsx)("div",{className:"md:hidden fixed inset-0 bg-background/80 backdrop-blur-sm qr-20",onClick:h}),u&&(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm qr-40",onClick:()=>N(null)}),(0,qr.jsxs)("div",{className:"absolute left-12 w-80 md:w-96 bg-card shadow-lg qr-40 transform transition-transform max-w-[calc(100vw-3rem)] md:max-w-none top-0 h-full",children:[(0,qr.jsxs)("div",{className:"p-3 md:p-4 border-b flex items-center justify-between",children:[(0,qr.jsxs)("h2",{className:"text-base md:text-lg font-semibold",children:[u==="projects"&&"Projects",u==="epics"&&"Manage Epics"]}),(0,qr.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>N(null),children:(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"})})]}),(0,qr.jsxs)("div",{className:"p-3 md:p-4 space-y-4 h-full overflow-y-auto",children:[u==="projects"&&(0,qr.jsx)(L,{className:"p-3",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("h3",{className:"font-medium text-foreground",children:"Projects"}),(0,qr.jsxs)(w,{size:"sm",onClick:()=>D(!0),className:"gap-1",children:[(0,qr.jsx)(Tt.Plus,{className:"h-3 w-3"}),"Add Project"]})]}),ve&&(0,qr.jsxs)("div",{className:"border rounded-lg p-2 space-y-2",children:[(0,qr.jsx)(O,{value:te.name,onChange:I=>R($=>({...$,name:I.target.value})),placeholder:"Project name",className:"text-sm"}),(0,qr.jsx)(Ne,{value:te.description,onChange:I=>R($=>({...$,description:I.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(w,{size:"sm",onClick:De,className:"text-_o h-6",children:"Save"}),(0,qr.jsx)(w,{size:"sm",variant:"outline",onClick:()=>D(!1),className:"text-_o h-6",children:"Cancel"})]})]}),(0,qr.jsx)("div",{className:"space-y-2",children:e.map(I=>(0,qr.jsx)("div",{className:"border rounded p-2",children:x===I.id?(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(O,{value:V.name,onChange:$=>J(C=>({...C,name:$.target.value})),placeholder:"Project name",className:"text-sm"}),(0,qr.jsx)(Ne,{value:V.description,onChange:$=>J(C=>({...C,description:$.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(w,{size:"sm",onClick:$e,className:"text-_o h-6",children:"Save"}),(0,qr.jsx)(w,{size:"sm",variant:"outline",onClick:Ae,className:"text-_o h-6",children:"Cancel"})]})]}):(0,qr.jsxs)("div",{className:`cursor-pointer p-1 rounded transition-colors ${I.isSelected?"bg-primary/10 border-primary ring-2 ring-primary/20":"hover:bg-muted"}`,onClick:()=>ut(I.id),children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,qr.jsx)(Tt.FolderOpen,{className:"h-3 w-3 text-muted-foreground"}),(0,qr.jsx)("span",{className:"font-medium text-_o",children:I.name})]}),I.description&&(0,qr.jsx)("p",{className:"text-_o text-muted-foreground mb-1",children:I.description}),(0,qr.jsxs)("div",{className:"flex gap-1",onClick:$=>$.stopPropagation(),children:[(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>ne(I),className:"h-5 px-1",children:(0,qr.jsx)(Tt.Edit2,{className:"h-3 w-3"})}),(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>r(I.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"})})]})]})},I.id))})]})}),u==="epics"&&(0,qr.jsx)(L,{className:"p-3",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("h3",{className:"font-medium text-foreground",children:"Epics"}),(0,qr.jsxs)(w,{size:"sm",onClick:n,className:"gap-1",children:[(0,qr.jsx)(Tt.Plus,{className:"h-3 w-3"}),"Add Epic"]})]}),(0,qr.jsx)("div",{className:"space-y-4",children:t.map(I=>(0,qr.jsx)("div",{className:"border rounded-lg p-3",children:P===I.id?(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsx)(O,{value:S.name,onChange:$=>B(C=>({...C,name:$.target.value})),placeholder:"Epic name",className:"text-sm"}),(0,qr.jsx)(Ne,{value:S.description,onChange:$=>B(C=>({...C,description:$.target.value})),placeholder:"Epic description",rows:2,className:"text-sm"}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"Color"}),(0,qr.jsx)("div",{className:"flex gap-1 flex-wrap",children:we.map($=>(0,qr.jsx)("button",{onClick:()=>B(C=>({...C,color:$})),className:`w-6 h-6 rounded-full ${$} ${S.color===$?"ring-2 ring-ring":""}`},$))})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"Confidence"}),(0,qr.jsx)("select",{value:S.confidence,onChange:$=>B(C=>({...C,confidence:$.target.value})),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-_o 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:q.map($=>(0,qr.jsx)("option",{value:$.value,children:$.label},$.value))})]}),(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"Phase"}),(0,qr.jsx)("select",{value:S.phase.toString(),onChange:$=>B(C=>({...C,phase:parseInt($.target.value)})),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-_o 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:M.map($=>(0,qr.jsx)("option",{value:$.value.toString(),children:$.label},$.value))})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"Start Date"}),(0,qr.jsx)(O,{type:"date",value:S.startDate,onChange:$=>B(C=>({...C,startDate:$.target.value})),className:"text-_o h-8"})]}),(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"End Date"}),(0,qr.jsx)(O,{type:"date",value:S.endDate,onChange:$=>B(C=>({...C,endDate:$.target.value})),className:"text-_o h-8"})]})]}),(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"Progress (%)"}),(0,qr.jsx)(O,{type:"number",min:"0",max:"100",value:S.progress,onChange:$=>B(C=>({...C,progress:parseInt($.target.value)||0})),className:"text-_o h-8"})]}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsx)(w,{size:"sm",onClick:Dt,className:"text-_o",children:"Save"}),(0,qr.jsx)(w,{size:"sm",variant:"outline",onClick:Ke,className:"text-_o",children:"Cancel"})]})]}):(0,qr.jsxs)("div",{className:`cursor-pointer p-2 rounded transition-colors ${I.isSelected?"bg-primary/10 border-primary":"hover:bg-muted"}`,onClick:()=>s(I.id,{isSelected:!I.isSelected}),children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${I.color}`}),(0,qr.jsx)("span",{className:"font-medium text-sm",children:I.name})]}),I.description&&(0,qr.jsx)("p",{className:"text-_o text-muted-foreground mb-2",children:I.description}),(0,qr.jsxs)("div",{className:"space-y-1 mb-2",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Confidence:"}),(0,qr.jsx)("span",{className:Nt(I.confidence).color,children:Nt(I.confidence).label})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Phase:"}),(0,qr.jsx)("span",{className:ft(I.phase).color,children:ft(I.phase).label})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Timeline:"}),(0,qr.jsxs)("span",{className:"text-foreground",children:[qe(I.startDate)," - ",qe(I.endDate)]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Progress:"}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:"w-12 h-2 bg-muted rounded-full",children:(0,qr.jsx)("div",{className:"h-2 bg-primary rounded-full",style:{width:`${I.progress}%`}})}),(0,qr.jsxs)("span",{className:"text-foreground",children:[I.progress,"%"]})]})]})]}),(0,qr.jsxs)("div",{className:"flex gap-1",onClick:$=>$.stopPropagation(),children:[(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>pt(I),className:"h-6 px-2",children:(0,qr.jsx)(Tt.Edit2,{className:"h-3 w-3"})}),(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>c(I.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"})})]})]})},I.id))})]})})]})]})]})]})},Wi=e=>(0,qr.jsx)(rr,{children:(0,qr.jsxs)("div",{className:"flex w-full h-full",children:[(0,qr.jsx)("div",{className:"hidden md:block w-12 fixed h-full",children:(0,qr.jsx)(Gi,{...e})}),(0,qr.jsx)("div",{className:"md:hidden",children:(0,qr.jsx)(Gi,{...e})}),(0,qr.jsx)("div",{className:"flex-1 min-w-0 ml-16 px-4 md:px-6 h-full",children:(0,qr.jsx)("div",{className:"w-full h-full",children:e.children})})]})});var qi=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1,height:m})=>{let s=l=>{l.preventDefault()},c=l=>{l.preventDefault(),i(t)};return(0,qr.jsxs)(L,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${r?"lg:max-w-_o":""}`,style:{height:m||"calc(100vh - 350px)"},onDragOver:s,onDrop:c,children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,qr.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,qr.jsx)(Y,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,qr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Po=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=l=>{a(e)},m=()=>{o(e)},s=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},c=()=>{switch(e.type){case"story":return(0,qr.jsx)(Tt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,qr.jsx)(Tt.Bug,{className:"h-3 w-3"});case"spike":return(0,qr.jsx)(Tt.Zap,{className:"h-3 w-3"});case"task":default:return(0,qr.jsx)(Tt.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,qr.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,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-_o font-medium ${n()}`,children:c()}),(0,qr.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,qr.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,qr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,qr.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${n()}`,children:[c(),(0,qr.jsx)("span",{className:"capitalize",children:e.type})]}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-_o font-medium ${s()}`,children:e.priority}),(0,qr.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-_o font-medium",children:e.points})]})]}),(0,qr.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,qr.jsx)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,qr.jsx)(Tt.User,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:e.assignee?.value?.name})]})})]})};var Qa=be(require("react")),ct=be(require("@radix-ui/react-dialog"));var St=ct.Root;var Rl=ct.Portal;var Ji=Qa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ct.Overlay,{ref:a,className:b("fixed inset-0 qr-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}));Ji.displayName=ct.Overlay.displayName;var bt=Qa.forwardRef(({className:e,children:t,...a},o)=>(0,qr.jsxs)(Rl,{children:[(0,qr.jsx)(Ji,{}),(0,qr.jsxs)(ct.Content,{ref:o,className:b("fixed left-[50%] top-[50%] qr-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),...a,children:[t,(0,qr.jsxs)(ct.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,qr.jsx)(Tt.qr,{className:"h-4 w-4"}),(0,qr.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));bt.displayName=ct.Content.displayName;var ht=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ht.displayName="DialogHeader";var eo=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});eo.displayName="DialogFooter";var xt=Qa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ct.Title,{ref:a,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));xt.displayName=ct.Title.displayName;var to=Qa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ct.Description,{ref:a,className:b("text-sm text-muted-foreground",e),...t}));to.displayName=ct.Description.displayName;var Sa=be(require("react")),Fa=be(require("@radix-ui/react-toggle-group"));var Yi=be(require("react")),ir=be(require("@radix-ui/react-toggle"));var sr=(0,Gr.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"}}),El=Yi.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,qr.jsx)(ir.Root,{ref:i,className:b(sr({variant:t,size:a,className:e})),...o}));El.displayName=ir.Root.displayName;var es=Sa.createContext({size:"default",variant:"default"}),ka=Sa.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,qr.jsx)(Fa.Root,{ref:r,className:b("flex items-center justify-center gap-1",e),...i,children:(0,qr.jsx)(es.Provider,{value:{variant:t,size:a},children:o})}));ka.displayName=Fa.Root.displayName;var Da=Sa.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let m=Sa.useContext(es);return(0,qr.jsx)(Fa.Item,{ref:r,className:b(sr({variant:m.variant||a,size:m.size||o}),e),...i,children:t})});Da.displayName=Fa.Item.displayName;var Il=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Tt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Tt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Tt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Tt.Zap}],Al=[{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"}],Ro=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:m})=>{let[s,c]=(0,Ht.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""});(0,Ht.useEffect)(()=>{e&&m&&c(p=>({...p,epicId:m}))},[e,m]),(0,Ht.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()&&(a({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())},l=(p,h)=>{c(u=>({...u,[p]:h}))};return(0,qr.jsx)(St,{open:e,onOpenChange:t,children:(0,qr.jsxs)(bt,{className:"sm:max-w-md",children:[(0,qr.jsx)(ht,{children:(0,qr.jsx)(xt,{children:"Add New Task"})}),(0,qr.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",children:"Task Title"}),(0,qr.jsx)(O,{id:"name",value:s.name,onChange:p=>l("name",p.target.value),placeholder:"Enter task title",required:!0})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:s.description,onChange:p=>l("description",p.target.value),placeholder:"Enter task description",rows:3})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Type"}),(0,qr.jsx)(ka,{type:"single",value:s.type,onValueChange:p=>p&&l("type",p),children:Il.map(p=>{let h=p.icon;return(0,qr.jsxs)(Da,{value:p.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,qr.jsx)(h,{className:"h-4 w-4"}),p.label]},p.value)})})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Priority"}),(0,qr.jsx)(ka,{type:"single",value:s.priority,onValueChange:p=>p&&l("priority",p),children:Al.map(p=>(0,qr.jsx)(Da,{value:p.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:p.label},p.value))})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"points",children:"Story Points"}),(0,qr.jsx)(O,{id:"points",type:"number",min:"1",max:"100",value:s.points,onChange:p=>l("points",parseInt(p.target.value)||1),placeholder:"Enter story points",required:!0})]}),!m&&(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"epic",children:"Epic"}),(0,qr.jsxs)(ze,{value:s.epicId,onValueChange:p=>l("epicId",p),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{placeholder:"Select an epic"})}),(0,qr.jsx)(Oe,{children:o.map(p=>(0,qr.jsx)(Q,{value:p.id,children:(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${p.color}`}),p.name]})},p.id))})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,qr.jsxs)(ze,{value:s.sprintId,onValueChange:p=>l("sprintId",p),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{placeholder:"Select a sprint"})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"none",children:"_o Sprint"}),i.map(p=>(0,qr.jsx)(Q,{value:p.id,children:(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[p.name,p.isActive&&(0,qr.jsx)("span",{className:"text-_o bg-green-100 text-green-800 px-1 rounded",children:"Active"})]})},p.id))]})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"sprint",children:"Assignee"}),(0,qr.jsxs)(ze,{value:s.assignee,onValueChange:p=>l("assignee",p),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{placeholder:"Select an Assignee"})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"none",children:"_o Assignee"}),r.map(p=>(0,qr.jsx)(Q,{value:p.id,children:(0,qr.jsx)("div",{className:"flex items-center gap-2",children:p.name})},p.id))]})]})]}),(0,qr.jsxs)(eo,{children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,qr.jsx)(w,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var lr=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:m=!1})=>{let[s,c]=(0,Ht.useState)(!1),[n,l]=(0,Ht.useState)(""),p=()=>{m||(c(!0),l(t))},h=async()=>{n!==t&&await i(e,n),c(!1)},u=N=>{N.key==="Enter"&&!o||N.key==="Enter"&&N.ctrlKey&&o?h():N.key==="Escape"&&(c(!1),l(""))};return(0,qr.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,qr.jsx)(T,{children:a}),s?o?(0,qr.jsx)(Ne,{value:n,onChange:N=>l(N.target.value),onBlur:h,onKeyDown:u,autoFocus:!0,rows:4,className:"resize-none"}):(0,qr.jsx)(O,{value:n,onChange:N=>l(N.target.value),onBlur:h,onKeyPress:u,autoFocus:!0,className:"text-lg font-medium"}):(0,qr.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 ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,qr.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!m&&(0,qr.jsx)(Tt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var os=({comments:e,onAddComment:t})=>{let[a,o]=(0,Ht.useState)(""),i=m=>m.split(" ").map(s=>s[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.MessageSquare,{className:"h-5 w-5"}),(0,qr.jsx)(T,{className:"text-lg font-medium",children:"Comments"}),(0,qr.jsx)(Y,{variant:"secondary",children:e.length})]}),(0,qr.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(m=>(0,qr.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,qr.jsx)(Jt,{className:"h-8 w-8 qr-1",children:(0,qr.jsx)(Yt,{className:"text-_o bg-muted text-muted-foreground",children:i(m.author)})}),(0,qr.jsxs)("div",{className:"flex-1",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,qr.jsx)("span",{className:"font-medium text-sm",children:m.author}),(0,qr.jsxs)("span",{className:"text-_o text-muted-foreground",children:[m.createdAt.toLocaleDateString()," at ",m.createdAt.toLocaleTimeString()]})]}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:m.text})]})]},m.id))}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsx)(Ne,{value:a,onChange:m=>o(m.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,qr.jsx)(w,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,qr.jsx)(Tt.Send,{className:"h-4 w-4"})})]})]})};var Io=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[m,s]=(0,Ht.useState)(!1),c=o.find(l=>l.value===t);return(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:e}),(0,qr.jsxs)(ze,{value:t,onValueChange:a,open:m,onOpenChange:l=>{r||s(l)},disabled:r,children:[(0,qr.jsx)(je,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,qr.jsxs)(Y,{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,qr.jsx)("div",{className:`w-2 h-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,qr.jsx)(Oe,{children:o.map(l=>(0,qr.jsx)(Q,{value:l.value,children:i&&l.color?(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.label]}):l.label},l.value))})]})]})};var is=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:m=!1})=>{let[s,c]=(0,Ht.useState)(!1),[n,l]=(0,Ht.useState)(""),p=o.find(f=>f.value===t),h=o.filter(f=>f.label.toLowerCase().includes(n.toLowerCase())),u=f=>{a(f),c(!1),l("")},N=()=>{r&&n.trim()&&!o.find(f=>f.value===n.trim())&&(a(n.trim()),c(!1),l(""))};return(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:e}),(0,qr.jsxs)(ze,{value:t,onValueChange:u,open:s,onOpenChange:f=>{m||c(f)},disabled:m,children:[(0,qr.jsx)(je,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,qr.jsx)(Y,{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,qr.jsxs)(Oe,{children:[(0,qr.jsx)("div",{className:"p-2",children:(0,qr.jsx)(O,{placeholder:i,value:n,onChange:f=>l(f.target.value),onKeyDown:f=>{f.key==="Enter"&&r&&N()},className:"mb-2"})}),h.map(f=>(0,qr.jsx)(Q,{value:f.value,children:f.label},f.value)),r&&n.trim()&&!h.find(f=>f.value===n.trim())&&(0,qr.jsxs)(Q,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var Ml=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Tt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Tt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Tt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Tt.Zap}],Bl=[{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 ss=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:m,isUpdating:s=!1,isDeleting:c=!1,deleteState:n="idle",teamMembers:l})=>{let p=u=>u.split(" ").map(N=>N[0]).join("").toUpperCase(),h=()=>n==="loading"?(0,qr.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-_o gap-1",children:[(0,qr.jsx)(Tt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):n==="success"?(0,qr.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-_o gap-1",children:[(0,qr.jsx)(Tt.Check,{className:"h-3 w-3"}),"Deleted"]}):n==="error"?(0,qr.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-_o gap-1",children:[(0,qr.jsx)(Tt.qr,{className:"h-3 w-3"}),"Delete failed"]}):(0,qr.jsxs)(w,{onClick:m,variant:"destructive",className:"w-full h-8 text-_o gap-1",disabled:s||c,children:[(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,qr.jsxs)("div",{className:"flex flex-col h-full",children:[(0,qr.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Status"}),(0,qr.jsx)(Io,{label:"",value:e.status,onValueChange:u=>i("status",u),options:[{value:"todo",label:"qr Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Type"}),(0,qr.jsx)(ka,{type:"single",value:e.type,onValueChange:u=>u&&i("type",u),className:"grid grid-cols-2 gap-1",disabled:s,children:Ml.map(u=>{let N=u.icon;return(0,qr.jsxs)(Da,{value:u.value,className:"flex items-center gap-1 text-_o h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,qr.jsx)(N,{className:"h-3 w-3"}),u.label]},u.value)})})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Priority"}),(0,qr.jsx)(ka,{type:"single",value:e.priority,onValueChange:u=>u&&i("priority",u),className:"grid grid-cols-3 gap-1",disabled:s,children:Bl.map(u=>(0,qr.jsx)(Da,{value:u.value,className:"text-_o h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:u.label},u.value))})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Story Points"}),(0,qr.jsx)("input",{type:"number",min:"1",max:"100",value:e.points||1,onChange:u=>i("points",u.target.value),className:"w-full h-8 px-2 text-_o 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,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Epic"}),(0,qr.jsx)(Io,{label:"",value:e.epicId,onValueChange:u=>i("epicId",u),options:(t||[]).map(u=>({value:u.id,label:u?.name,color:u.color})),showColor:!0,disabled:s})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Sprint"}),(0,qr.jsx)(Io,{label:"",value:e.sprintId||"none",onValueChange:u=>i("sprintId",u==="none"?"":u),options:[{value:"none",label:"_o Sprint"},...(a||[]).map(u=>({value:u.id,label:`${u?.name}${u.isActive?" (Active)":""}`}))],disabled:s})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Assignee"}),(0,qr.jsx)(is,{label:"",value:e.assignee?.value?.name,onValueChange:u=>i("assignee",u),options:l.map(u=>({value:`${typeof u.email=="string"?"users":"digital-colleagues"}:${u.id}`,label:u?.name})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,qr.jsxs)("div",{className:"qr-auto pt-4 space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(w,{onClick:r,variant:"outline",className:"w-full h-8 text-_o",disabled:s||c,children:"Close"}),h()]}),(0,qr.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,qr.jsx)("div",{className:"text-_o text-muted-foreground font-medium mb-2",children:"Information"}),(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("span",{className:"text-_o text-muted-foreground",children:"Logged By"}),(0,qr.jsxs)("div",{className:"flex items-center gap-1 text-_o text-muted-foreground",children:[(0,qr.jsx)(Tt.User,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:"System"})]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("span",{className:"text-_o text-muted-foreground",children:"Created"}),(0,qr.jsxs)("div",{className:"flex items-center gap-1 text-_o text-muted-foreground",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("span",{className:"text-_o text-muted-foreground",children:"Last Updated"}),(0,qr.jsxs)("div",{className:"flex items-center gap-1 text-_o text-muted-foreground",children:[(0,qr.jsx)(Tt.Clock,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var ns=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:m,onAddComment:s,colleagues:c})=>{let[n,l]=(0,Ht.useState)(a),[p,h]=(0,Ht.useState)(new Date),[u,N]=(0,Ht.useState)("idle"),[x,f]=(0,Ht.useState)("idle"),[P,A]=(0,Ht.useState)([]);(0,Ht.useEffect)(()=>{l(a)},[a]);let V=async(R,we)=>{if(we!==n[R]){N("loading");try{let q=await r(n.id,{[R]:we});l(q),h(new Date),N("success"),setTimeout(()=>N("idle"),1500)}catch{N("error"),setTimeout(()=>N("idle"),3e3)}}},J=async(R,we)=>{if(we!==n[R]){N("loading");try{let q=await r(n.id,{[R]:we});l(q),h(new Date),N("success"),setTimeout(()=>N("idle"),1500)}catch{N("error"),setTimeout(()=>N("idle"),3e3)}}},S=async R=>{if(s){N("loading");try{let we=await s?.({content:R,taskId:n.id});l(we),h(new Date),N("success"),setTimeout(()=>N("idle"),1500)}catch{N("error"),setTimeout(()=>N("idle"),3e3)}}},B=async()=>{f("loading");try{await m(n.id),f("success"),setTimeout(()=>{t(),f("idle")},1e3)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}},ve=u!=="loading"&&x!=="loading",D=()=>{ve&&t()},te=()=>u==="loading"?(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,qr.jsx)(Tt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,qr.jsx)("span",{children:"Updating..."})]}):u==="success"?(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,qr.jsx)(Tt.Check,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:"Updated successfully"})]}):u==="error"?(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:"Update failed"})]}):null;return(0,qr.jsx)(St,{open:e,onOpenChange:D,children:(0,qr.jsxs)(bt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,qr.jsxs)(ht,{children:[(0,qr.jsx)(xt,{className:"sr-only",children:n.name}),(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("div",{className:"flex-1",children:te()}),!ve&&(0,qr.jsx)("div",{className:"text-_o text-muted-foreground",children:"Please wait..."})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,qr.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,qr.jsx)(lr,{fieldName:"name",value:n.name,label:"",onSave:V,className:"border-b border-border pb-3",disabled:u==="loading"}),(0,qr.jsx)(lr,{fieldName:"description",value:n.description,label:"Description",multiline:!0,onSave:V,disabled:u==="loading"}),(0,qr.jsx)(os,{comments:(n?.comments||[]).map(R=>({author:R.author.value.name,createdAt:new Date(R.timestamp),text:R.content,id:R.id})),onAddComment:S})]}),(0,qr.jsx)(ss,{task:n,epics:o,sprints:i,lastUpdated:p,onUpdateTask:J,onClose:D,onDelete:B,isUpdating:u==="loading",isDeleting:x==="loading",deleteState:x,teamMembers:c})]})]})})};var Ao=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,Ht.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=l=>{l.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:new Date(o.startDate),endDate:new Date(o.endDate),progress:o.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=(l,p)=>{i(h=>({...h,[l]:p}))};return(0,qr.jsx)(St,{open:e,onOpenChange:t,children:(0,qr.jsxs)(bt,{className:"sm:max-w-md",children:[(0,qr.jsx)(ht,{children:(0,qr.jsx)(xt,{children:"Add New Epic"})}),(0,qr.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",children:"Epic Name"}),(0,qr.jsx)(O,{id:"name",value:o.name,onChange:l=>n("name",l.target.value),placeholder:"Enter epic name",required:!0})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:o.description,onChange:l=>n("description",l.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Color"}),(0,qr.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(l=>(0,qr.jsx)("button",{type:"button",onClick:()=>n("color",l),className:`w-8 h-8 rounded-full ${l} ${o.color===l?"ring-2 ring-gray-400":""}`},l))})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Confidence"}),(0,qr.jsxs)(ze,{value:o.confidence,onValueChange:l=>n("confidence",l),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsx)(Oe,{children:m.map(l=>(0,qr.jsx)(Q,{value:l.value,children:l.label},l.value))})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Phase"}),(0,qr.jsxs)(ze,{value:o.phase.toString(),onValueChange:l=>n("phase",parseInt(l)),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsx)(Oe,{children:s.map(l=>(0,qr.jsx)(Q,{value:l.value.toString(),children:l.label},l.value))})]})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Start Date"}),(0,qr.jsx)(O,{type:"date",value:o.startDate,onChange:l=>n("startDate",l.target.value)})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"End Date"}),(0,qr.jsx)(O,{type:"date",value:o.endDate,onChange:l=>n("endDate",l.target.value)})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Progress (%)"}),(0,qr.jsx)(O,{type:"number",min:"0",max:"100",value:o.progress,onChange:l=>n("progress",parseInt(l.target.value)||0)})]}),(0,qr.jsxs)(eo,{children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,qr.jsx)(w,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var ds=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:m,onUpdateTask:s,onDeleteTask:c,onTaskClick:n,onAddEpic:l,onAddComment:p})=>{let[h,u]=(0,Ht.useState)(e),[N,x]=(0,Ht.useState)(t),[f,P]=(0,Ht.useState)(a),[A,V]=(0,Ht.useState)(!1),[J,S]=(0,Ht.useState)(!1),[B,ve]=(0,Ht.useState)(null),[D,te]=(0,Ht.useState)(null),[R,we]=(0,Ht.useState)(o),[q,M]=(0,Ht.useState)(i),[ne,$e]=(0,Ht.useState)(0),Ae=(0,Ht.useRef)(null),De=(0,Ht.useRef)(null),ut=N.filter(K=>!0).map(K=>K.id),pt=f.find(K=>K.isSelected);ut.push("no-epic"),(0,Ht.useEffect)(()=>{u(e)},[e]),(0,Ht.useEffect)(()=>{x(t)},[t]),(0,Ht.useEffect)(()=>{P(a)},[a]),(0,Ht.useEffect)(()=>{let K=()=>{if(Ae.current){let at=Ae.current.offsetHeight;$e(at)}};K();let Ce=new ResizeObserver(K);Ae.current&&Ce.observe(Ae.current);let Re=()=>{setTimeout(K,100)};return window.addEventListener("storage",Re),()=>{Ce.disconnect(),window.removeEventListener("storage",Re)}},[]),(0,Ht.useEffect)(()=>{let K=setTimeout(()=>{Ae.current&&$e(Ae.current.offsetHeight)},300);return()=>clearTimeout(K)},[A,J]);let Dt=h.filter(K=>{let Ce=ut.includes(K.epicId)||!K.epicId;return!pt||pt.id==="all-tasks"?Ce:pt.id==="backlog"?Ce&&!K.sprintId:Ce&&K.sprintId===pt.id}),Ke=K=>Dt.filter(Ce=>Ce.status===K),qe=K=>{let Ce={};return N.forEach(Re=>{Ce[Re.id]=K.filter(at=>at.epicId===Re.id)}),Ce["no-epic"]=K.filter(Re=>!Re.epicId),Ce},Nt=K=>{te(K)},ft=K=>{D&&(u(Ce=>Ce.map(Re=>Re.id===D.id?{...Re,status:K}:Re)),s?.(D.id,{status:K}),te(null))},I=K=>{let Ce={...K,id:Date.now().toString(),createdAt:new Date};u(Re=>[...Re,Ce]),m?.(K)},$=async(K,Ce)=>{u(at=>at.map(y=>y.id===K?{...y,...Ce}:y)),s&&await s(K,Ce);let Re=h.find(at=>at.id===K);if(!Re)throw new Error("Task not found");return{...Re,...Ce}},C=async K=>{u(Ce=>Ce.filter(Re=>Re.id!==K)),B?.id===K&&ve(null),c&&await c(K)},He=K=>{let Ce={...K,id:Date.now().toString(),isSelected:!0};x(Re=>[...Re,Ce]),l?.(K)},Pe=K=>{ve(K),n?.(K)},It=[{id:"todo",title:"qr Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],$t=ne>0?`calc(100vh - ${ne+120}px)`:"calc(100vh - 12rem)";return(0,qr.jsxs)("div",{ref:De,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,qr.jsx)("div",{ref:Ae,className:"flex-shrink-0",children:(0,qr.jsx)(st,{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:()=>V(!0)},secondaryAction:{label:"Add epic",onClick:()=>S(!0)}})}),(0,qr.jsx)("div",{className:"flex-1 min-h-0 qr-8",children:(0,qr.jsx)("div",{className:"h-full",style:{height:ne>0?`calc(100vh - ${ne+120}px)`:"calc(100vh - 12rem)"},children:(0,qr.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:It.map(K=>{let Ce=Ke(K.status),Re=qe(Ce);return(0,qr.jsx)(qi,{title:K.title,status:K.status,taskCount:Ce.length,onDrop:ft,isCompact:K.status==="done",height:$t,children:ut.map(at=>{let y=N.find(me=>me.id===at),U=Re[at]||[];return U.length===0?null:(0,qr.jsxs)("div",{className:"mb-6",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${y?.color}`}),(0,qr.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:y?.name||"_o Epic"}),(0,qr.jsx)(Y,{variant:"secondary",className:"text-_o",children:U.length})]})," ",(0,qr.jsx)("div",{className:"space-y-3",children:U.map(me=>(0,qr.jsx)(Po,{task:me,epic:y,onDragStart:Nt,onTaskClick:Pe,isCompact:K.status==="done"},me.id))})]},at)})},K.id)})})})}),(0,qr.jsx)(Ro,{isOpen:A,onClose:()=>V(!1),onAddTask:I,assignees:[...q,...R],epics:N,sprints:f}),(0,qr.jsx)(Ao,{isOpen:J,onClose:()=>S(!1),onAddEpic:He}),B&&(0,qr.jsx)(ns,{isOpen:!!B,onClose:()=>ve(null),initialTask:B,epics:N,sprints:f,onUpdateTask:$,onDeleteTask:C,colleagues:[...q,...R],onAddComment:p})]})};var cs=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:m,onUpdateEpic:s,onDeleteEpic:c})=>{let[n,l]=(0,Ht.useState)(null),[p,h]=(0,Ht.useState)(null),[u,N]=(0,Ht.useState)({}),[x,f]=(0,Ht.useState)(0),P=(0,Ht.useRef)(null),A=(0,Ht.useRef)(null);(0,Ht.useEffect)(()=>{let M=()=>{if(P.current){let Ae=P.current.offsetHeight;f(Ae)}};M();let ne=new ResizeObserver(M);P.current&&ne.observe(P.current);let $e=()=>{setTimeout(M,100)};return window.addEventListener("storage",$e),()=>{ne.disconnect(),window.removeEventListener("storage",$e)}},[]),(0,Ht.useEffect)(()=>{let M=setTimeout(()=>{P.current&&f(P.current.offsetHeight)},300);return()=>clearTimeout(M)},[p]);let V=M=>{l(M)},J=M=>{M.preventDefault()},S=(M,ne)=>{M.preventDefault(),n&&n.epicId!==ne&&(o(n.id,{epicId:ne}),l(null))},B=M=>e.filter(ne=>ne.epicId===M),ve=M=>{h(M.id),N({name:M.name,description:M.description,confidence:M.confidence,phase:M.phase,progress:M.progress})},D=()=>{p&&u.name&&(s(p,u),h(null),N({}))},te=()=>{h(null),N({})},R=M=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&c(M)},we=M=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[M]||`Phase ${M}`,q=M=>{switch(M){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,qr.jsxs)("div",{ref:A,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,qr.jsx)("div",{ref:P,className:"flex-shrink-0",children:(0,qr.jsx)(st,{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,qr.jsx)("div",{className:"flex-1 min-h-0 qr-8",children:(0,qr.jsx)("div",{className:"h-full overflow-y-auto",style:{height:x>0?`calc(100vh - ${x+120}px)`:"calc(100vh - 12rem)"},children:(0,qr.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(M=>{let ne=B(M.id),$e=ne.reduce((De,ut)=>De+ut.points,0),Ae=x>0?`calc(100vh - ${x+200}px)`:"calc(100vh - 14rem)";return(0,qr.jsxs)(L,{className:`flex flex-col ${p===M.id?"h-auto":""} bg-card shadow-sm`,style:{height:p===M.id?"auto":Ae,minHeight:"400px"},onDragOver:J,onDrop:De=>S(De,M.id),children:[(0,qr.jsx)("div",{className:"p-4 border-b border-border",children:p===M.id?(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)(O,{value:u.name||"",onChange:De=>N({...u,name:De.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,qr.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:D,className:"p-1 h-8 w-8",children:(0,qr.jsx)(Tt.Check,{className:"h-4 w-4"})}),(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:te,className:"p-1 h-8 w-8",children:(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"})})]})]}),(0,qr.jsx)(Ne,{value:u.description||"",onChange:De=>N({...u,description:De.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"text-_o text-muted-foreground",children:"Confidence"}),(0,qr.jsxs)("select",{value:u.confidence||M.confidence,onChange:De=>N({...u,confidence:De.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-_o 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,qr.jsx)("option",{value:"low",children:"Low"}),(0,qr.jsx)("option",{value:"medium",children:"Medium"}),(0,qr.jsx)("option",{value:"high",children:"High"})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"text-_o text-muted-foreground",children:"Phase"}),(0,qr.jsx)("select",{value:u.phase?.toString()||M.phase.toString(),onChange:De=>N({...u,phase:parseInt(De.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-_o 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(De=>(0,qr.jsxs)("option",{value:De.toString(),children:["Phase ",De]},De))})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"text-_o text-muted-foreground",children:"Progress (%)"}),(0,qr.jsx)(O,{type:"number",min:"0",max:"100",value:u.progress||M.progress,onChange:De=>N({...u,progress:parseInt(De.target.value)||0}),className:"text-_o"})]})]}):(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,qr.jsx)("div",{className:`w-4 h-4 rounded-full ${M.color}`}),(0,qr.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:M.name}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>ve(M),className:"p-1 h-8 w-8",children:(0,qr.jsx)(Tt.Edit2,{className:"h-3 w-3"})}),(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>R(M.id),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"})})]})]}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,qr.jsxs)(Y,{className:`text-_o ${q(M.confidence)}`,children:[M.confidence," confidence"]}),(0,qr.jsxs)(Y,{variant:"outline",className:"text-_o",children:["Phase ",M.phase]}),(0,qr.jsxs)(Y,{variant:"secondary",className:"text-_o bg-muted text-muted-foreground",children:[ne.length," tasks"]}),(0,qr.jsxs)(Y,{variant:"secondary",className:"text-_o bg-muted text-muted-foreground",children:[$e," pts"]})]}),M.description&&(0,qr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:M.description}),(0,qr.jsxs)("div",{className:"mb-3",children:[(0,qr.jsxs)("div",{className:"flex justify-between text-_o text-muted-foreground mb-1",children:[(0,qr.jsx)("span",{className:"select-none",children:"Progress"}),(0,qr.jsxs)("span",{className:"select-none",children:[M.progress,"%"]})]}),(0,qr.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,qr.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${M.progress}%`}})})]}),(0,qr.jsxs)(w,{onClick:()=>r(M.id),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,qr.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,qr.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:ne.length===0?(0,qr.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,qr.jsx)(Tt.Move,{className:"h-8 w-8 mb-2"}),(0,qr.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):ne.map(De=>(0,qr.jsx)(Po,{task:De,epic:M,onDragStart:V,onTaskClick:i,isCompact:!0},De.id))})})]},M.id)})})})})]})};var ms=require("react-day-picker");function Mo({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,qr.jsx)(ms.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:b("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 pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:b(mo({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 qr-2",cell:b("relative p-0 text-center text-sm focus-within:relative focus-within:qr-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:b(mo({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}Mo.displayName="Calendar";var us=be(require("react")),Gt=be(require("@radix-ui/react-popover"));var mr=Gt.Root,pr=Gt.Trigger;var Bo=us.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,qr.jsx)(Gt.Portal,{children:(0,qr.jsx)(Gt.Content,{ref:i,align:t,sideOffset:a,className:b("qr-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),...o})}));Bo.displayName=Gt.Content.displayName;var gr=require("date-fns");var fs=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,Ht.useState)({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),r=s=>{s.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate,endDate:o.endDate,isActive:o.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,qr.jsx)(St,{open:e,onOpenChange:m,children:(0,qr.jsxs)(bt,{className:"sm:max-w-md",children:[(0,qr.jsx)(ht,{children:(0,qr.jsx)(xt,{children:"Add New Sprint"})}),(0,qr.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",children:"Sprint Name *"}),(0,qr.jsx)(O,{id:"name",value:o.name,onChange:s=>i(c=>({...c,name:s.target.value})),placeholder:"e.qr., Sprint 3",required:!0})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:o.description,onChange:s=>i(c=>({...c,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Start Date *"}),(0,qr.jsxs)(mr,{children:[(0,qr.jsx)(pr,{asChild:!0,children:(0,qr.jsxs)(w,{variant:"outline",className:b("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,qr.jsx)(Tt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,gr.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,qr.jsx)(Bo,{className:"w-auto p-0",align:"start",children:(0,qr.jsx)(Mo,{mode:"single",selected:o.startDate,onSelect:s=>i(c=>({...c,startDate:s})),initialFocus:!0})})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"End Date *"}),(0,qr.jsxs)(mr,{children:[(0,qr.jsx)(pr,{asChild:!0,children:(0,qr.jsxs)(w,{variant:"outline",className:b("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,qr.jsx)(Tt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,gr.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,qr.jsx)(Bo,{className:"w-auto p-0",align:"start",children:(0,qr.jsx)(Mo,{mode:"single",selected:o.endDate,onSelect:s=>i(c=>({...c,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"isActive",checked:o.isActive,onChange:s=>i(c=>({...c,isActive:s.target.checked})),className:"rounded border-gray-300"}),(0,qr.jsx)(T,{htmlFor:"isActive",children:"Set Ht active sprint"})]}),(0,qr.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:m,children:"Cancel"}),(0,qr.jsx)(w,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Fo=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r,onUpdateSprint:m,onDeleteSprint:s})=>{let[c,n]=(0,Ht.useState)([]),[l,p]=(0,Ht.useState)(new Set),[h,u]=(0,Ht.useState)(null),[N,x]=(0,Ht.useState)(!1),[f,P]=(0,Ht.useState)(null),[A,V]=(0,Ht.useState)(null),[J,S]=(0,Ht.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[B,ve]=(0,Ht.useState)("upcoming"),[D,te]=(0,Ht.useState)(!1),[R,we]=(0,Ht.useState)(0),q=(0,Ht.useRef)(null),M=(0,Ht.useRef)(null);(0,Ht.useEffect)(()=>{let y=()=>{q.current&&we(q.current.offsetHeight)};y();let U=new ResizeObserver(y);return q.current&&U.observe(q.current),()=>U.disconnect()},[]);let ne=y=>t.find(U=>U.id===y),$e=y=>a.find(U=>U.id===y),Ae=y=>{let U={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 U[y]||U.medium},De=y=>{let U=y.trim().split(" ");if(U.length===1)return U[0];let me=U[0],ke=U[U.length-1][0].toUpperCase();return`${me} ${ke}.`},ut=y=>{let U={},me=[];return y.forEach(ke=>{ke.epicId?(U[ke.epicId]||(U[ke.epicId]=[]),U[ke.epicId].push(ke)):me.push(ke)}),{tasksByEpic:U,unassignedTasks:me}},pt=a.filter(y=>y.id!=="backlog"&&y.id!=="all-tasks"),Dt=pt.filter(y=>{switch(B){case"active":return y.isActive;case"upcoming":return!y.isActive;default:return!0}}),Ke=pt.filter(y=>c.includes(y.id)),qe=e.filter(y=>!y.sprintId||y.sprintId==="backlog"||y.sprintId==="Backlog"),Nt=qe.reduce((y,U)=>y+(U.points||0),0),ft=y=>{n(U=>U.includes(y)?U.filter(me=>me!==y):U.length<3?[...U,y]:U)},I=y=>{p(U=>{let me=new Set(U);return me.has(y)?me.delete(y):me.add(y),me})},$=y=>{r(y),x(!1)},C=y=>{V(y.id),S({name:y.name,description:y.description||"",startDate:y.startDate instanceof Date?y.startDate.toISOString().split("T")[0]:y.startDate,endDate:y.endDate instanceof Date?y.endDate.toISOString().split("T")[0]:y.endDate,isActive:y.isActive})},He=()=>{A&&(m(A,{name:J.name,description:J.description,startDate:new Date(J.startDate),endDate:new Date(J.endDate),isActive:J.isActive}),V(null))},Pe=()=>{V(null),S({name:"",description:"",startDate:"",endDate:"",isActive:!1})},It=(y,U)=>{u(U),y.dataTransfer.effectAllowed="move"},$t=y=>{y.preventDefault(),y.dataTransfer.dropEffect="move"},K=y=>{P(y)},Ce=()=>{P(null)},Re=(y,U)=>{if(y.preventDefault(),P(null),!h)return;let me=h.sprintId||void 0,ke=U==="backlog"?void 0:U;me!==ke&&o(h.id,{sprintId:ke}),u(null)},at=({task:y,showSprint:U=!1})=>{let me=y.epicId?ne(y.epicId):null,ke=y.sprintId?$e(y.sprintId):null;return(0,qr.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:vt=>{vt.dataTransfer.effectAllowed="move",vt.dataTransfer.setData("text/plain",y.id),It(vt,y)},onClick:vt=>{h===null&&i(y)},style:{userSelect:"none"},children:(0,qr.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,qr.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:y.name}),(0,qr.jsx)(Y,{className:`text-_o ${Ae(y.priority)}`,children:y.priority[0].toUpperCase()})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[me&&(0,qr.jsx)("div",{className:`w-2 h-2 rounded-full ${me.color}`}),(0,qr.jsx)("span",{className:"text-muted-foreground truncate",children:me?.name})]}),(0,qr.jsx)("span",{className:"text-muted-foreground",children:y.assignee})]}),U&&ke&&(0,qr.jsxs)("div",{className:"flex items-center gap-1 text-_o text-muted-foreground",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:ke.name})]})]})})};return(0,qr.jsxs)("div",{ref:M,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,qr.jsx)("div",{ref:q,className:"flex-shrink-0",children:(0,qr.jsx)(st,{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:()=>x(!0)}})}),(0,qr.jsx)("div",{className:"flex-1 min-h-0 qr-8",children:(0,qr.jsxs)("div",{className:"h-full",style:{height:R>0?`calc(100vh - ${R+120}px)`:"calc(100vh - 12rem)"},children:[(0,qr.jsxs)("div",{className:"mb-4",children:[(0,qr.jsx)(L,{className:"p-3 bg-card shadow-sm",children:(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)("div",{children:(0,qr.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"})}),c.length>0&&(0,qr.jsx)("div",{className:"flex items-center gap-2",children:(0,qr.jsx)("div",{className:"flex flex-wrap gap-1",children:Ke.map(y=>(0,qr.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-_o",children:[(0,qr.jsx)("span",{className:"max-w-[80px] truncate",children:y.name}),y.isActive&&(0,qr.jsx)("span",{className:"text-success text-[10px]",children:"\u25CF"}),(0,qr.jsx)("button",{onClick:()=>ft(y.id),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"})})]},y.id))})})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsxs)(w,{onClick:()=>x(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,qr.jsx)(Tt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,qr.jsxs)(w,{onClick:()=>te(!D),variant:"outline",size:"sm",className:"gap-1",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-3 w-3"}),D?"Close":"Select"]})]})]})}),D&&(0,qr.jsx)("div",{className:"fixed inset-0 bg-black/20 qr-[5]",onClick:()=>te(!1)}),(0,qr.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl qr-10 transition-all duration-300 ease-in-out ${D?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,qr.jsxs)(L,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,qr.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,qr.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>te(!1),className:"h-8 w-8 p-0",children:(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"})})]}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground qr-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,qr.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,qr.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active",count:a.filter(y=>y.isActive).length},{key:"upcoming",label:"Upcoming",count:a.filter(y=>!y.isActive).length}].map(y=>(0,qr.jsxs)(w,{variant:B===y.key?"default":"outline",size:"sm",onClick:()=>ve(y.key),className:"text-_o h-8 px-3 flex-1",children:[y.label," (",y.count,")"]},y.key))}),(0,qr.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:Dt.length>0?Dt.map(y=>{let U=c.includes(y.id),me=e.filter(ot=>ot.sprintId===y.id).length,ke=!U&&c.length<3;return(0,qr.jsx)("div",{className:`p-3 rounded-lg border transition-all ${U?"bg-primary/10 border-primary/30":ke?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:A===y.id?(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsx)(O,{value:J.name,onChange:ot=>S(gt=>({...gt,name:ot.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,qr.jsx)(Ne,{value:J.description,onChange:ot=>S(gt=>({...gt,description:ot.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsxs)(w,{size:"sm",onClick:()=>He(),className:"flex-1",children:[(0,qr.jsx)(Tt.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,qr.jsxs)(w,{size:"sm",variant:"outline",onClick:Pe,className:"flex-1",children:[(0,qr.jsx)(Tt.qr,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,qr.jsxs)("div",{children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,qr.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:y.name}),y.isActive&&(0,qr.jsx)(Y,{variant:"default",className:"text-_o bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,qr.jsx)("p",{className:"text-_o text-muted-foreground line-clamp-2 mb-2",children:y.description}),(0,qr.jsxs)("div",{className:"flex items-center gap-3 text-_o text-muted-foreground",children:[(0,qr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,qr.jsx)(Tt.CalendarDays,{className:"h-3 w-3"}),new Date(y.startDate).toLocaleDateString()]}),(0,qr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,qr.jsx)(Tt.User,{className:"h-3 w-3"}),me," tasks"]})]})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>C(y),className:"h-6 w-6 p-0",children:(0,qr.jsx)(Tt.Edit2,{className:"h-3 w-3"})}),y.id!=="backlog"&&y.id!=="all-tasks"&&(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>s(y.id),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"})})]})]}),(0,qr.jsx)("div",{className:"flex items-center justify-between qr-2",children:(0,qr.jsx)(w,{variant:U?"default":"outline",size:"sm",className:"text-_o w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>ft(y.id),disabled:!U&&c.length>=3,children:(0,qr.jsx)("span",{className:"pointer-events-none select-none",children:U?"Deselect":c.length>=3?"Limit Reached":"Select"})})})]})},y.id)}):(0,qr.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,qr.jsxs)("p",{className:"text-sm",children:['_o sprints found for "',B,'" filter']}),(0,qr.jsx)(w,{variant:"link",size:"sm",onClick:()=>ve("all"),className:"text-_o",children:"Show all sprints"})]})}),c.length===0&&(0,qr.jsx)("div",{className:"qr-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,qr.jsxs)("div",{className:"text-center",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,qr.jsx)("p",{className:"text-_o text-muted-foreground qr-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,qr.jsx)("div",{className:"lg:col-span-1",children:(0,qr.jsxs)(L,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:$t,onDragEnter:()=>K("backlog"),onDragLeave:Ce,onDrop:y=>Re(y,"backlog"),style:{height:R>0?`calc(100vh - ${R+200}px)`:"calc(100vh - 16rem)"},children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,qr.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsxs)(Y,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[qe.length," tasks"]}),(0,qr.jsxs)(Y,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[Nt," pts"]})]})]}),(0,qr.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:y,unassignedTasks:U}=ut(qe);return(0,qr.jsxs)(qr.Fragment,{children:[Object.entries(y).map(([me,ke])=>{let ot=ne(me);if(!ot)return null;let gt=l.has(me);return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-_o cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>I(me),children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${ot.color}`}),(0,qr.jsx)("span",{className:"font-medium text-muted-foreground",children:ot.name}),(0,qr.jsxs)("span",{className:"text-muted-foreground",children:["(",ke.length,")"]}),(0,qr.jsx)("div",{className:"ml-auto",children:gt?(0,qr.jsx)(Tt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,qr.jsx)(Tt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!gt&&(0,qr.jsx)("div",{className:"space-y-2 pl-2",children:ke.map(vt=>(0,qr.jsx)(at,{task:vt},vt.id))})]},me)}),U.length>0&&(()=>{let me=l.has("no-epic");return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-_o cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>I("no-epic"),children:[(0,qr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,qr.jsx)("span",{className:"font-medium text-muted-foreground",children:"_o Epic"}),(0,qr.jsxs)("span",{className:"text-muted-foreground",children:["(",U.length,")"]}),(0,qr.jsx)("div",{className:"ml-auto",children:me?(0,qr.jsx)(Tt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,qr.jsx)(Tt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!me&&(0,qr.jsx)("div",{className:"space-y-2 pl-2",children:U.map(ke=>(0,qr.jsx)(at,{task:ke},ke.id))})]})})(),qe.length===0&&(0,qr.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"}),qe.length>0&&Object.keys(y).length===0&&U.length===0&&(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)("div",{className:"text-_o text-muted-foreground mb-2",children:"Direct backlog tasks:"}),qe.map(me=>(0,qr.jsx)(at,{task:me},me.id))]})]})})()})]})}),Ke.map(y=>{let U=e.filter(ke=>ke.sprintId===y.id),me=U.reduce((ke,ot)=>ke+(ot.points||0),0);return(0,qr.jsxs)(L,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:$t,onDragEnter:()=>K(y.id),onDragLeave:Ce,onDrop:ke=>Re(ke,y.id),style:{height:R>0?`calc(100vh - ${R+200}px)`:"calc(100vh - 16rem)"},children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:y.name}),y.isActive&&(0,qr.jsx)("span",{className:"text-_o text-success font-medium select-none",children:"Active Sprint"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsxs)(Y,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[U.length," tasks"]}),(0,qr.jsxs)(Y,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200",children:[me," pts"]}),(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>C(y),className:"h-6 px-2",children:(0,qr.jsx)(Tt.Edit2,{className:"h-3 w-3"})}),y.id!=="backlog"&&y.id!=="all-tasks"&&(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>s(y.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"})})]})]}),(0,qr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:ke,unassignedTasks:ot}=ut(U);return(0,qr.jsxs)(qr.Fragment,{children:[Object.entries(ke).map(([gt,vt])=>{let za=ne(gt);if(!za)return null;let Va=l.has(gt);return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-_o cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>I(gt),children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${za.color}`}),(0,qr.jsx)("span",{className:"font-medium text-muted-foreground",children:za.name}),(0,qr.jsxs)("span",{className:"text-muted-foreground",children:["(",vt.length,")"]}),(0,qr.jsx)("div",{className:"ml-auto",children:Va?(0,qr.jsx)(Tt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,qr.jsx)(Tt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Va&&(0,qr.jsx)("div",{className:"space-y-2 pl-2",children:vt.map(Ua=>(0,qr.jsx)(at,{task:Ua},Ua.id))})]},gt)}),ot.length>0&&(()=>{let gt=l.has("no-epic");return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-_o cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>I("no-epic"),children:[(0,qr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,qr.jsx)("span",{className:"font-medium text-muted-foreground",children:"_o Epic"}),(0,qr.jsxs)("span",{className:"text-muted-foreground",children:["(",ot.length,")"]}),(0,qr.jsx)("div",{className:"ml-auto",children:gt?(0,qr.jsx)(Tt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,qr.jsx)(Tt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!gt&&(0,qr.jsx)("div",{className:"space-y-2 pl-2",children:ot.map(vt=>(0,qr.jsx)(at,{task:vt},vt.id))})]})})(),U.length===0&&(0,qr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},y.id)})]}),(0,qr.jsx)(fs,{isOpen:N,onClose:()=>x(!1),onAddSprint:$})]})})]})};var Fl=e=>{switch(e){case"high":return"\u{1F534}";case"medium":return"\u{1F7E1}";case"low":return"\u{1F7E2}";default:return"\u26AA"}},Ll=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),jl=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},fr=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[i,r]=t.split(":");o.setHours(parseInt(i),parseInt(r))}return o<a},vr=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ol=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Hl=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,Ht.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[m,s]=(0,Ht.useState)(!1),c=l=>{l.preventDefault();let p=e.find(u=>u?.id.toString()===i.colleagueId.toString());if(!p){console.error("_o 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(u=>u.trim()):void 0};t(h),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Ht.useEffect)(()=>{i.colleagueId&&s(!1)},[i.colleagueId]);let n=e.filter(Boolean);return(0,qr.jsx)(St,{open:a,onOpenChange:o,children:(0,qr.jsxs)(bt,{className:"max-w-2xl",children:[(0,qr.jsx)(ht,{children:(0,qr.jsx)(xt,{children:"Add New Reminder"})}),(0,qr.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,qr.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"title",children:"Title"}),(0,qr.jsx)(O,{id:"title",value:i.title,onChange:l=>r({...i,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:i.description,onChange:l=>r({...i,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"dueDate",children:"Due Date"}),(0,qr.jsx)(O,{id:"dueDate",type:"date",value:i.dueDate,onChange:l=>r({...i,dueDate:l.target.value}),required:!0})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,qr.jsx)(O,{id:"dueTime",type:"time",value:i.dueTime,onChange:l=>r({...i,dueTime:l.target.value})})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{className:`${m?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,qr.jsxs)(ze,{value:i.colleagueId,onValueChange:l=>{r({...i,colleagueId:l})},required:!0,children:[(0,qr.jsx)(je,{className:`${m?"text-destructive border-red-500":""}`,children:(0,qr.jsx)(Ye,{className:`${m?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(l=>l?.id.toString()===i.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,qr.jsx)(Oe,{children:n.map(l=>(0,qr.jsx)(Q,{value:l.id,children:l.name},l.id))})]}),m&&(0,qr.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:l=>r({...i,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,qr.jsx)(T,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,qr.jsxs)(ze,{value:i.recurrencePattern,onValueChange:l=>r({...i,recurrencePattern:l}),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"daily",children:"Daily"}),(0,qr.jsx)(Q,{value:"weekly",children:"Weekly"}),(0,qr.jsx)(Q,{value:"monthly",children:"Monthly"}),(0,qr.jsx)(Q,{value:"yearly",children:"Yearly"})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"recurrenceInterval",children:"Every"}),(0,qr.jsx)(O,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:l=>r({...i,recurrenceInterval:parseInt(l.target.value)})})]})]})]}),(0,qr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,qr.jsx)(w,{type:"submit",children:"Add Reminder"})]})]})]})})},zl=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,m]=(0,Ht.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 l=t.find(p=>p?.id===r.colleagueId);if(!l){console.error("_o valid colleague selected");return}a(e.id,{title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:l,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,qr.jsx)(St,{open:o,onOpenChange:i,children:(0,qr.jsxs)(bt,{className:"max-w-2xl",children:[(0,qr.jsx)(ht,{children:(0,qr.jsx)(xt,{children:"Edit Reminder"})}),(0,qr.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-title",children:"Title"}),(0,qr.jsx)(O,{id:"edit-title",value:r.title,onChange:n=>m({...r,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-priority",children:"Priority"}),(0,qr.jsxs)(ze,{value:r.priority,onValueChange:n=>m({...r,priority:n}),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"low",children:"\u{1F7E2} Low"}),(0,qr.jsx)(Q,{value:"medium",children:"\u{1F7E1} Medium"}),(0,qr.jsx)(Q,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-description",children:"Description"}),(0,qr.jsx)(Ne,{id:"edit-description",value:r.description,onChange:n=>m({...r,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,qr.jsx)(O,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:n=>m({...r,dueDate:n.target.value}),required:!0})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,qr.jsx)(O,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:n=>m({...r,dueTime:n.target.value})})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-colleague",children:"Assigned Colleague"}),(0,qr.jsxs)(ze,{value:r.colleagueId,onValueChange:n=>m({...r,colleagueId:n}),required:!0,children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{placeholder:"Select a digital colleague"})}),(0,qr.jsx)(Oe,{children:c.map(n=>(0,qr.jsx)(Q,{value:n.id,children:n.name},n.id))})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring,onChange:n=>m({...r,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,qr.jsx)(T,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-recurrencePattern",children:"Frequency"}),(0,qr.jsxs)(ze,{value:r.recurrencePattern,onValueChange:n=>m({...r,recurrencePattern:n}),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"daily",children:"Daily"}),(0,qr.jsx)(Q,{value:"weekly",children:"Weekly"}),(0,qr.jsx)(Q,{value:"monthly",children:"Monthly"}),(0,qr.jsx)(Q,{value:"yearly",children:"Yearly"})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-recurrenceInterval",children:"Every"}),(0,qr.jsx)(O,{id:"edit-recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:n=>m({...r,recurrenceInterval:parseInt(n.target.value)})})]})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"edit-reminderEnabled",checked:r.reminderEnabled,onChange:n=>m({...r,reminderEnabled:n.target.checked}),className:"rounded border-border"}),(0,qr.jsx)(T,{htmlFor:"edit-reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,qr.jsxs)("div",{className:"pl-6",children:[(0,qr.jsx)(T,{htmlFor:"edit-reminderMinutes",children:"Remind me"}),(0,qr.jsxs)(ze,{value:r.reminderMinutes.toString(),onValueChange:n=>m({...r,reminderMinutes:parseInt(n)}),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"5",children:"5 minutes before"}),(0,qr.jsx)(Q,{value:"15",children:"15 minutes before"}),(0,qr.jsx)(Q,{value:"30",children:"30 minutes before"}),(0,qr.jsx)(Q,{value:"60",children:"1 hour before"}),(0,qr.jsx)(Q,{value:"1440",children:"1 day before"})]})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-tags",children:"Tags (comma-separated)"}),(0,qr.jsx)(O,{id:"edit-tags",value:r.tags,onChange:n=>m({...r,tags:n.target.value}),placeholder:"e.qr., urgent, meeting, follow-up"})]}),(0,qr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,qr.jsx)(w,{type:"submit",children:"Save Changes"})]})]})]})})},Vl=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,Ht.useState)(!1);if(!e||!e.id)return null;let m=fr(e.dueDate,e.dueTime),s=vr(e.dueDate),c=Ol(e.dueDate),n=()=>{a(e.id,{isCompleted:!e.isCompleted,completedAt:e.isCompleted?void 0:new Date})},l=()=>s?"Today":c?"Tomorrow":m&&!e.isCompleted?"Overdue":Ll(e.dueDate);return(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(zl,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,qr.jsx)(L,{className:`transition-all duration-200 ${e.isCompleted?"opacity-60":""} ${m&&!e.isCompleted?"border-destructive/50 bg-destructive/5":""}`,children:(0,qr.jsx)(de,{className:"p-4",children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,qr.jsx)("button",{onClick:n,className:"qr-1 text-primary hover:text-primary/80",children:e.isCompleted?(0,qr.jsx)(Tt.CheckCircle,{className:"h-5 w-5"}):(0,qr.jsx)(Tt.Circle,{className:"h-5 w-5"})}),(0,qr.jsxs)("div",{className:"flex-1",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,qr.jsx)("h3",{className:`font-semibold ${e.isCompleted?"line-through text-muted-foreground":""}`,children:e.title}),(0,qr.jsx)("span",{className:"text-sm",children:Fl(e.priority)}),e.isRecurring&&(0,qr.jsx)(Tt.Repeat,{className:"h-4 w-4 text-primary"}),e.reminderEnabled&&(0,qr.jsx)(Tt.Bell,{className:"h-4 w-4 text-success"})]}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,qr.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-4 w-4"}),(0,qr.jsx)("span",{className:m&&!e.isCompleted?"text-destructive font-medium":"",children:l()})]}),e.dueTime&&(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(Tt.Clock,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:jl(e.dueTime)})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(Tt.User,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:e.colleague?.name||"Unknown Colleague"})]})]}),e.tags&&e.tags.length>0&&(0,qr.jsx)("div",{className:"flex flex-wrap gap-1 qr-2",children:e.tags.map((p,h)=>(0,qr.jsx)(Y,{variant:"secondary",className:"text-_o",children:p},h))})]})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,qr.jsx)(Tt.Edit2,{className:"h-4 w-4"})}),(0,qr.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>o(e.id),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,qr.jsx)(Tt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},vs=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,m]=(0,Ht.useState)(e.filter(Boolean)),[s]=(0,Ht.useState)(t.filter(Boolean)),[c,n]=(0,Ht.useState)("all"),[l,p]=(0,Ht.useState)(""),[h,u]=(0,Ht.useState)(!1),N=S=>{if(!S.title||!S.colleague?.id){console.error("Invalid reminder data:",S);return}let B={...S,id:Date.now().toString(),createdAt:new Date};m(ve=>[...ve,B]),a?.(S)},x=(S,B)=>{if(!S){console.error("_o reminder ID provided for update");return}m(ve=>ve.map(D=>D?.id===S?{...D,...B}:D)),o?.(S,B)},f=S=>{if(!S){console.error("_o reminder ID provided for deletion");return}m(B=>B.filter(ve=>ve?.id!==S)),i?.(S)},A=r.filter(S=>{if(!S)return!1;if(l){let B=l.toLowerCase();if(!(S.title.toLowerCase().includes(B)||S.description.toLowerCase().includes(B)||S.colleague?.name?.toLowerCase().includes(B)||S.tags?.some(D=>D.toLowerCase().includes(B))))return!1}switch(c){case"pending":return!S.isCompleted;case"completed":return S.isCompleted;case"overdue":return!S.isCompleted&&fr(S.dueDate,S.dueTime);case"today":return vr(new Date(S.dueDate));default:return!0}}).sort((S,B)=>{if(!S||!B)return 0;if(S.isCompleted&&!B.isCompleted)return 1;if(!S.isCompleted&&B.isCompleted)return-1;let ve={high:3,medium:2,low:1},D=ve[B.priority]-ve[S.priority];return D!==0?D:S.dueDate.getTime()-B.dueDate.getTime()}),V={total:r.filter(Boolean).length,pending:r.filter(S=>S&&!S.isCompleted).length,completed:r.filter(S=>S&&S.isCompleted).length,overdue:r.filter(S=>S&&!S.isCompleted&&fr(S.dueDate,S.dueTime)).length,today:r.filter(S=>S&&vr(new Date(S.dueDate))).length},J=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,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(st,{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:()=>{u(!0)}}}),(0,qr.jsxs)("div",{className:"h-full bg-background",children:[(0,qr.jsx)(Hl,{colleagues:s,onAddReminder:N,open:h,setOpen:u}),(0,qr.jsxs)("div",{className:"p-6",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,qr.jsxs)(w,{className:"flex items-center space-x-2",onClick:()=>u(!0),children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:"Add Reminder"})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,qr.jsxs)(L,{className:"p-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-foreground",children:V.total}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,qr.jsxs)(L,{className:"p-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-primary",children:V.pending}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,qr.jsxs)(L,{className:"p-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-success",children:V.completed}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,qr.jsxs)(L,{className:"p-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-destructive",children:V.overdue}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,qr.jsxs)(L,{className:"p-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-warning",children:V.today}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsx)(O,{placeholder:"Search reminders...",value:l,onChange:S=>p(S.target.value),className:"max-w-md"})}),(0,qr.jsxs)(ze,{value:c,onValueChange:S=>n(S),children:[(0,qr.jsx)(je,{className:"w-40",children:(0,qr.jsx)(Ye,{})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsxs)(Q,{value:"all",children:["All (",V.total,")"]}),(0,qr.jsxs)(Q,{value:"pending",children:["Pending (",V.pending,")"]}),(0,qr.jsxs)(Q,{value:"completed",children:["Completed (",V.completed,")"]}),(0,qr.jsxs)(Q,{value:"overdue",children:["Overdue (",V.overdue,")"]}),(0,qr.jsxs)(Q,{value:"today",children:["Today (",V.today,")"]})]})]})]}),(0,qr.jsx)("div",{className:"space-y-4",children:A.length===0?(0,qr.jsxs)(L,{className:"p-8 text-center",children:[(0,qr.jsx)("div",{className:"text-muted-foreground",children:l||c!=="all"?"_o reminders match your filters":"_o reminders yet"}),!l&&c==="all"&&(0,qr.jsx)("p",{className:"text-sm text-muted-foreground/60 qr-2",children:"Create your first reminder to get started"})]}):A.map(S=>S&&(0,qr.jsx)(Vl,{reminder:S,colleagues:s,onUpdateReminder:x,onDeleteReminder:f},S.id))})]})]})]})};var bs=require("next/navigation");function br({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:m=[],initialUsers:s=[],initialFiles:c=[],initialView:n="kanban",onAddTask:l,onUpdateTask:p,onDeleteTask:h,onTaskClick:u,onAddEpic:N,onUpdateEpic:x,onDeleteEpic:f,onAddTaskToEpic:P,onAddSprint:A,onUpdateSprint:V,onDeleteSprint:J,onAddProject:S,onUpdateProject:B,onDeleteProject:ve,onFileAdd:D,onFileEdit:te,onFileDelete:R,onFileClick:we,onAddReminder:q,onUpdateReminder:M,onDeleteReminder:ne,onViewChange:$e,onToggleMobileMenu:Ae,onTeamClick:De,onTeamChange:ut,onCopilotClick:pt,handleAddComment:Dt}){let[Ke,qe]=(0,Ht.useState)(t),[Nt,ft]=(0,Ht.useState)(a),[I,$]=(0,Ht.useState)(o),[C,He]=(0,Ht.useState)(i),[Pe,It]=(0,Ht.useState)(r),[$t,K]=(0,Ht.useState)(m),[Ce,Re]=(0,Ht.useState)(s),[at,y]=(0,Ht.useState)(c),[U,me]=(0,Ht.useState)(!1),[ke,ot]=(0,Ht.useState)(!1),[gt,vt]=(0,Ht.useState)(null),[za,Va]=(0,Ht.useState)(null),[Ua,Dr]=(0,Ht.useState)(null),[ma,Pr]=(0,Ht.useState)(n||"kanban"),[Rs,Es]=(0,Ht.useState)(!1),Tr=(0,bs.useRouter)();(0,Ht.useEffect)(()=>{qe(t)},[t]),(0,Ht.useEffect)(()=>{$(o)},[o]),(0,Ht.useEffect)(()=>{ft(a)},[a]),(0,Ht.useEffect)(()=>{He(i)},[i]),(0,Ht.useEffect)(()=>{y(c)},[c]),(0,Ht.useEffect)(()=>{Re(s)},[s]),(0,Ht.useEffect)(()=>{K(m)},[m]),(0,Ht.useEffect)(()=>{It(r)},[r]),(0,Ht.useEffect)(()=>{Pr(n)},[n]);let Is=Nt.filter(k=>k.isSelected).map(k=>k.id),no=I.find(k=>k.isSelected),As=Ke.filter(k=>{let F=Is.includes(k.epicId);return!no||no.id==="all-tasks"?F:no.id==="backlog"?F&&!k.sprintId:F&&k.sprintId===no.id}),$l=k=>As.filter(F=>F.status===k),Kl=k=>{let F={};return Nt.forEach(oe=>{F[oe.id]=k.filter(Ee=>Ee.epicId===oe.id)}),F},_l=k=>{Dr(k)},Gl=k=>{Ua&&(qe(F=>F.map(oe=>oe.id===Ua.id?{...oe,status:k}:oe)),Dr(null))},Rr=k=>{let F={...k,id:Date.now().toString(),createdAt:new Date};qe(oe=>[...oe,F]),l?.(F)},lo=async(k,F)=>(qe(oe=>oe.map(Ee=>Ee.id===k?{...Ee,...F}:Ee)),await p?.(k,F)),Wl=async(k,F)=>{lo(k,F)},Er=k=>{qe(F=>F.filter(oe=>oe.id!==k)),gt?.id===k&&vt(null),h?.(k)},ql=async k=>{Er(k)},Ms=k=>{let F={...k,id:Date.now().toString(),isSelected:!1};He(oe=>[...oe,F]),S?.(k)},Bs=(k,F)=>{He(oe=>oe.map(Ee=>Ee.id===k?F.isSelected?(Tr.push(`/project/${k}`),{...Ee,...F}):{...Ee,...F}:F.isSelected&&k!==Ee.id?{...Ee,isSelected:!1}:Ee)),B?.(k,F)},Fs=k=>{He(F=>F.filter(oe=>oe.id!==k)),ve?.(k)},Ir=k=>{let F={...k,id:Date.now().toString(),isSelected:!0};ft(oe=>[...oe,F]),N?.({...F})},Ar=()=>{ot(!0)},Mr=(k,F)=>{ft(oe=>oe.map(Ee=>Ee.id===k?{...Ee,...F}:Ee)),x?.(k,F)},Br=k=>{ft(F=>F.filter(oe=>oe.id!==k)),qe(F=>F.filter(oe=>oe.epicId!==k)),f?.(k)},Ls=k=>{let F={...k,id:Date.now().toString(),isSelected:!1};$(oe=>[...oe,F]),A?.(k)},js=(k,F)=>{$(oe=>oe.map(Ee=>Ee.id===k?F.isSelected?{...Ee,...F}:{...Ee,...F}:F.isSelected&&k!==Ee.id?{...Ee,isSelected:!1}:Ee)),V?.(k,F)},Os=k=>{k==="backlog"||k==="all-tasks"||($(F=>F.filter(oe=>oe.id!==k)),qe(F=>F.map(oe=>oe.sprintId===k?{...oe,sprintId:void 0}:oe)),J?.(k))},zo=k=>{vt(k)},Hs=k=>{k==="planning"&&window.innerWidth<768||(Pr(k),$e?.(k))},zs=()=>{Es(k=>!k),Ae?.()},Xl=()=>{Tr.push("/")},Jl=k=>{console.log("Switching to team:",k)},Yl=k=>{console.log("Switching to team:",k)},Vs=k=>{Va(k),me(!0)},Us=()=>{me(!1),Va(null)},$s=k=>{let F={...k,id:Date.now().toString(),createdAt:new Date};It(oe=>[...oe,F]),q?.(k)},Ks=(k,F)=>{It(oe=>oe.map(Ee=>Ee.id===k?{...Ee,...F}:Ee)),M?.(k,F)},_s=k=>{It(F=>F.filter(oe=>oe.id!==k)),ne?.(k)},Gs=()=>{D?.()},Ws=k=>{te?.(k)},qs=k=>{y(F=>F.filter(oe=>oe.name!==k)),R?.(k)},Xs=k=>{we?.(k)},Zl=[{id:"todo",title:"qr Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Ql=()=>{switch(ma){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"}},Vo=[{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")}],ed=Vo.sort((k,F)=>F.lastUsed.getTime()-k.lastUsed.getTime()).slice(0,3),td=Vo.length>3,ad=Vo.slice(3);return(0,qr.jsxs)(Wi,{projects:C,epics:Nt,sprints:I,currentView:ma,onUpdateProject:Bs,onDeleteProject:Fs,onAddProject:Ms,onUpdateEpic:Mr,onDeleteEpic:Br,onAddEpic:Ar,onViewChange:Hs,mobileMenuOpen:Rs,onToggleMobileMenu:zs,children:[ma==="kanban"&&(0,qr.jsx)("div",{className:"h-full overflow-hidden",children:(0,qr.jsx)(ds,{initialProjects:C,initialEpics:Nt,initialSprints:I,initialTasks:Ke,initialColleagues:$t,initialUsers:Ce,onAddTask:Rr,onUpdateTask:lo,onDeleteTask:Er,onTaskClick:zo,onAddEpic:Ir,onAddComment:Dt})}),ma==="planning"&&(0,qr.jsx)("div",{className:"hidden md:block h-full",children:(0,qr.jsx)(Fo,{tasks:Ke,epics:Nt,sprints:I,onUpdateTask:lo,onTaskClick:zo,onAddSprint:Ls,onUpdateSprint:js,onDeleteSprint:Os})}),ma==="tasks"&&(0,qr.jsx)("div",{className:"h-full",children:(0,qr.jsx)(vs,{initialReminders:Pe,initialColleagues:$t,onAddReminder:$s,onUpdateReminder:Ks,onDeleteReminder:_s})}),ma==="files"&&(0,qr.jsx)("div",{className:"h-full",children:(0,qr.jsx)(Ya,{initialFiles:at,onFileAdd:Gs,onFileEdit:Ws,onFileDelete:qs,onFileClick:Xs,compactView:!1})}),ma==="epics"&&(0,qr.jsx)("div",{className:"h-full",children:(0,qr.jsx)(cs,{tasks:Ke,epics:Nt,sprints:I,onUpdateTask:lo,onTaskClick:zo,onAddTaskToEpic:Vs,onAddEpic:Ar,onUpdateEpic:Mr,onDeleteEpic:Br})}),(0,qr.jsx)(Ro,{isOpen:U,onClose:Us,onAddTask:Rr,epics:Nt,sprints:I,assignees:[...$t,...Ce],defaultEpicId:za||void 0}),(0,qr.jsx)(Ao,{isOpen:ke,onClose:()=>ot(!1),onAddEpic:Ir})]})}var hs=be(require("react")),oo=be(require("@radix-ui/react-progress"));var xr=hs.forwardRef(({className:e,value:t,...a},o)=>(0,qr.jsx)(oo.Root,{ref:o,className:b("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,qr.jsx)(oo.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));xr.displayName=oo.Root.displayName;function ys({project:e,onOpen:t,onShare:a,className:o}){return(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,qr.jsxs)(L,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,qr.jsxs)(Ie,{children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)(Le,{children:e.name}),(0,qr.jsxs)(Y,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,qr.jsx)(ua,{children:e.description})]}),(0,qr.jsxs)(de,{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,qr.jsx)("span",{children:"Progress"}),(0,qr.jsxs)("span",{children:[e.progress,"%"]})]}),(0,qr.jsx)(xr,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,qr.jsxs)("div",{className:"flex items-center",children:[(0,qr.jsx)(Tt.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,qr.jsxs)("div",{className:"flex items-center",children:[(0,qr.jsx)(Tt.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,qr.jsxs)(ga,{className:"flex gap-2",children:[(0,qr.jsx)(w,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,qr.jsx)(w,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,qr.jsx)(Tt.Share2,{className:"h-4 w-4"})})]})]})})}var ro=be(require("@radix-ui/react-checkbox")),Ns=be(require("react")),yr=Ns.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ro.Root,{className:b("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,qr.jsx)(ro.Indicator,{className:b("flex items-center justify-center text-current"),children:(0,qr.jsx)(Tt.Check,{className:"h-4 w-4"})})}));yr.displayName=ro.Root.displayName;var Cs=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:i=""})=>{let[r,m]=(0,Ht.useState)({name:o?.name||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,c]=(0,Ht.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},l=async h=>{if(h.preventDefault(),!!n())try{await e(r)}catch(u){console.error("Error submitting project form:",u)}},p=(h,u)=>{m(N=>({...N,[h]:u})),s[h]&&c(N=>({...N,[h]:void 0}))};return(0,qr.jsxs)(L,{className:`w-full max-w-2xl ${i}`,children:[(0,qr.jsxs)(Ie,{children:[(0,qr.jsxs)(Le,{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,qr.jsx)(ua,{children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,qr.jsxs)("form",{onSubmit:l,children:[(0,qr.jsxs)(de,{className:"space-y-6",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,qr.jsx)(O,{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:a,maxLength:100}),s.name&&(0,qr.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,qr.jsx)(Ne,{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:a,maxLength:1e3}),(0,qr.jsxs)("div",{className:"flex justify-between text-_o text-gray-500",children:[(0,qr.jsx)("span",{children:s.objectives&&(0,qr.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,qr.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,qr.jsx)(Ne,{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:a,maxLength:2e3}),(0,qr.jsxs)("div",{className:"flex justify-between text-_o text-gray-500",children:[(0,qr.jsx)("span",{children:s.workInstructions&&(0,qr.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,qr.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsx)(T,{className:"text-sm font-medium",children:"Project Management"}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(yr,{id:"plan",checked:r.plan,onCheckedChange:h=>p("plan",h===!0),disabled:a}),(0,qr.jsx)(T,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,qr.jsx)("p",{className:"text-_o text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,qr.jsxs)(ga,{className:"flex justify-end gap-3",children:[t&&(0,qr.jsxs)(w,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"}),"Cancel"]}),(0,qr.jsx)(w,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(Tt.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function Cr({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[i,r]=(0,Ht.useState)(!1),[m,s]=(0,Ht.useState)(!1),c=async l=>{s(!0);try{await t(l),r(!1)}catch(p){console.error("Error creating project:",p)}finally{s(!1)}},n=()=>{r(!0)};return(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsx)(st,{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,qr.jsxs)("section",{className:"space-y-4 qr-8",children:[(0,qr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,qr.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(l=>(0,qr.jsx)(ys,{project:l,onOpen:a,onShare:o},l.name))})]})]},"projects-index-view")}),(0,qr.jsx)(St,{open:i,onOpenChange:r,children:(0,qr.jsxs)(bt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,qr.jsxs)(ht,{className:"sr-only",children:[(0,qr.jsx)(xt,{children:"Create New Project"}),(0,qr.jsx)(to,{children:"Fill out the form below to create a new project."})]}),(0,qr.jsx)(Cs,{onSubmit:c,onCancel:()=>r(!1),isLoading:m,className:"border-0 shadow-none"})]})})]})}function ks({team:e,onOpen:t,className:a}){return(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,qr.jsxs)(L,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,qr.jsxs)(Ie,{children:[(0,qr.jsx)(Le,{className:"text-lg",children:e.name}),(0,qr.jsx)(ua,{className:"qr-1 text-sm",children:e.description})]}),(0,qr.jsxs)(de,{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.Users,{className:"h-4 w-4 text-blue-500"}),(0,qr.jsx)("span",{children:"Human"})]}),(0,qr.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.Bot,{className:"h-4 w-4 text-purple-500"}),(0,qr.jsx)("span",{children:"Digital"})]}),(0,qr.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,qr.jsx)("span",{children:"Projects"})]}),(0,qr.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,qr.jsx)(ga,{className:"flex gap-2",children:(0,qr.jsx)(w,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}var Ds=be(require("react")),io=be(require("@radix-ui/react-switch"));var Ha=Ds.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(io.Root,{className:b("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,qr.jsx)(io.Thumb,{className:b("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")})}));Ha.displayName=io.Root.displayName;function Ps({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:m="Cancel",readOnly:s=!1}){let[c,n]=(0,Ht.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[l,p]=(0,Ht.useState)(!s);(0,Ht.useEffect)(()=>{e&&n(e)},[e]);let h=f=>{f.preventDefault();let P={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(P)},u=f=>{f.preventDefault(),p(!l)},N=i||(l?e?"Edit Team":"Create New Team":"View Team"),x=r||(e?"Update Team":"Create Team");return(0,qr.jsxs)(L,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,qr.jsx)(Ie,{children:(0,qr.jsxs)(Le,{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.Users,{className:"h-5 w-5"}),N]})}),(0,qr.jsx)(de,{children:(0,qr.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",children:"Team Name *"}),(0,qr.jsx)(O,{id:"name",value:c.name||"",onChange:f=>n({...c,name:f.target.value}),required:!0,disabled:o||!l,placeholder:"Enter team name..."})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:c.description||"",onChange:f=>n({...c,description:f.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!l})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"systemMsg",children:"Ways of working"}),(0,qr.jsx)(Ne,{id:"systemMsg",value:c.systemMsg||"",onChange:f=>n({...c,systemMsg:f.target.value}),rows:3,placeholder:"Describe how this team works in Ht much detail Ht possible. Include processes, tools, systems, styles...",disabled:o||!l})]})]}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ha,{id:"useProjects",checked:c.useProjects||!1,onCheckedChange:f=>n({...c,useProjects:f}),disabled:o||!l}),(0,qr.jsx)(T,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ha,{id:"useKnowledge",checked:c.useKnowledge||!1,onCheckedChange:f=>n({...c,useKnowledge:f}),disabled:o||!l}),(0,qr.jsx)(T,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ha,{id:"useFiles",checked:c.useFiles||!1,onCheckedChange:f=>n({...c,useFiles:f}),disabled:o||!l}),(0,qr.jsx)(T,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ha,{id:"useChat",checked:c.useChat||!1,onCheckedChange:f=>n({...c,useChat:f}),disabled:o||!l}),(0,qr.jsx)(T,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,qr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:a,disabled:o,children:l?m:"Close"}),l?(0,qr.jsx)(w,{type:"submit",disabled:o||!c.name?.trim(),children:o?"Saving...":x}):(0,qr.jsxs)(w,{type:"button",onClick:u,disabled:o,className:"gap-2",children:[(0,qr.jsx)(Tt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function kr({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,i]=(0,Ht.useState)(!1),r=()=>{i(!0)},m=n=>{t?.(n),i(!1)},s=()=>{i(!1)},c=n=>{a?.(n)};return(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsx)(st,{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,qr.jsxs)("section",{className:"space-y-4 qr-8",children:[(0,qr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,qr.jsxs)("div",{className:"text-center py-12",children:[(0,qr.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'qr not part of any teams yet."}),(0,qr.jsx)("p",{className:"text-muted-foreground text-sm qr-2",children:"Create a new team or ask to be added to an existing one."})]}):(0,qr.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,qr.jsx)(ks,{team:n,onOpen:c},n.id))})]})]},"teams-index-view")}),(0,qr.jsx)(St,{open:o,onOpenChange:i,children:(0,qr.jsxs)(bt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto p-0",children:[(0,qr.jsx)("div",{className:"sr-only",children:(0,qr.jsxs)(ht,{children:[(0,qr.jsx)(xt,{children:"Create New Team"}),(0,qr.jsx)(to,{children:"Set up a new team to collaborate with colleagues on projects."})]})}),(0,qr.jsx)(Ps,{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 Js=Object.create;var co=Object.defineProperty;var Ys=Object.getOwnPropertyDescriptor;var Zs=Object.getOwnPropertyNames;var Qs=Object.getPrototypeOf,en=Object.prototype.hasOwnProperty;var tn=(e,t)=>{for(var a in t)co(e,a,{get:t[a],enumerable:!0})},Fr=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zs(t))!en.call(e,i)&&i!==a&&co(e,i,{get:()=>t[i],enumerable:!(o=Ys(t,i))||o.enumerable});return e};var be=(e,t,a)=>(a=e!=null?Js(Qs(e)):{},Fr(t||!e||!e.__esModule?co(a,"default",{value:e,enumerable:!0}):a,e)),an=e=>Fr(co({},"__esModule",{value:!0}),e);var Ul={};tn(Ul,{ColleaguesView:()=>Jo,FileView:()=>Ya,KnowledgeView:()=>Yo,PlanningView:()=>Fo,ProjectView:()=>br,ProjectsIndexView:()=>Cr,TeamsIndexView:()=>kr});module.exports=an(Ul);var Ht=require("react"),Tt=require("lucide-react");var Kr=require("clsx");var Ko="-",on=e=>{let t=sn(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:m=>{let s=m.split(Ko);return s[0]===""&&s.length!==1&&s.shift(),Or(s,t)||rn(m)},getConflictingClassGroupIds:(m,s)=>{let c=a[m]||[];return s&&o[m]?[...c,...o[m]]:c}}},Or=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?Or(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Ko);return t.validators.find(({validator:m})=>m(r))?.classGroupId},Lr=/^\[(.+)\]$/,rn=e=>{if(Lr.test(e)){let t=Lr.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},sn=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return ln(Object.entries(e.classGroups),a).forEach(([r,m])=>{$o(m,o,r,t)}),o},$o=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:jr(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(nn(i)){$o(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,m])=>{$o(m,jr(t,r),a,o)})})},jr=(e,t)=>{let a=e;return t.split(Ko).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},nn=e=>e.isThemeGetter,ln=(e,t)=>t?e.map(([a,o])=>{let i=o.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([m,s])=>[t+m,s])):r);return[a,i]}):e,dn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(r,m)=>{a.set(r,m),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let m=a.get(r);if(m!==void 0)return m;if((m=o.get(r))!==void 0)return i(r,m),m},set(r,m){a.has(r)?a.set(r,m):i(r,m)}}},Hr="!",cn=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,m=s=>{let c=[],n=0,l=0,p;for(let f=0;f<s.length;f++){let P=s[f];if(n===0){if(P===i&&(o||s.slice(f,f+r)===t)){c.push(s.slice(l,f)),l=f+r;continue}if(P==="/"){p=f;continue}}P==="["?n++:P==="]"&&n--}let h=c.length===0?s:s.substring(l),u=h.startsWith(Hr),N=u?h.substring(1):h,x=p&&p>l?p-l:void 0;return{modifiers:c,hasImportantModifier:u,baseClassName:N,maybePostfixModifierPosition:x}};return a?s=>a({className:s,parseClassName:m}):m},mn=e=>{if(e.length<=1)return e;let t=[],a=[];return e.forEach(o=>{o[0]==="["?(t.push(...a.sort(),o),a=[]):a.push(o)}),t.push(...a.sort()),t},pn=e=>({cache:dn(e.cacheSize),parseClassName:cn(e),...on(e)}),un=/\s+/,gn=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],m=e.trim().split(un),s="";for(let c=m.length-1;c>=0;c-=1){let n=m[c],{modifiers:l,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:u}=a(n),N=!!u,x=o(N?h.substring(0,u):h);if(!x){if(!N){s=n+(s.length>0?" "+s:s);continue}if(x=o(h),!x){s=n+(s.length>0?" "+s:s);continue}N=!1}let f=mn(l).join(":"),P=p?f+Hr:f,A=P+x;if(r.includes(A))continue;r.push(A);let V=i(x,N);for(let J=0;J<V.length;++J){let S=V[J];r.push(P+S)}s=n+(s.length>0?" "+s:s)}return s};function fn(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=zr(t))&&(o&&(o+=" "),o+=a);return o}var zr=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=zr(e[o]))&&(a&&(a+=" "),a+=t);return a};function vn(e,...t){let a,o,i,r=m;function m(c){let n=t.reduce((l,p)=>p(l),e());return a=pn(n),o=a.cache.get,i=a.cache.set,r=s,s(c)}function s(c){let n=o(c);if(n)return n;let l=gn(c,a);return i(c,l),l}return function(){return r(fn.apply(null,arguments))}}var Fe=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Vr=/^\[(?:([a-qr-]+):)?(.+)\]$/i,bn=/^\qr+\/\qr+$/,hn=new Set(["px","full","screen"]),xn=/^(\qr+(\.\qr+)?)?(_o|sm|md|lg|xl)$/,yn=/\qr+(%|px|r?em|[sdl]?qr([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,wn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Nn=/^(inset_)?-?((\qr+)?\.?(\qr+)[a-qr]+|0)qr-?((\qr+)?\.?(\qr+)[a-qr]+|0)/,Cn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wt=e=>Ta(e)||hn.has(e)||bn.test(e),aa=e=>Ra(e,"length",In),Ta=e=>!!e&&!Number.isNaN(Number(e)),Uo=e=>Ra(e,"number",Ta),$a=e=>!!e&&Number.isInteger(Number(e)),Sn=e=>e.endsWith("%")&&Ta(e.slice(0,-1)),le=e=>Vr.test(e),oa=e=>xn.test(e),kn=new Set(["length","size","percentage"]),Dn=e=>Ra(e,kn,Ur),Pn=e=>Ra(e,"position",Ur),Tn=new Set(["image","url"]),Rn=e=>Ra(e,Tn,Mn),En=e=>Ra(e,"",An),Ka=()=>!0,Ra=(e,t,a)=>{let o=Vr.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},In=e=>yn.test(e)&&!wn.test(e),Ur=()=>!1,An=e=>Nn.test(e),Mn=e=>Cn.test(e);var Bn=()=>{let e=Fe("colors"),t=Fe("spacing"),a=Fe("blur"),o=Fe("brightness"),i=Fe("borderColor"),r=Fe("borderRadius"),m=Fe("borderSpacing"),s=Fe("borderWidth"),c=Fe("contrast"),n=Fe("grayscale"),l=Fe("hueRotate"),p=Fe("invert"),h=Fe("gap"),u=Fe("gradientColorStops"),N=Fe("gradientColorStopPositions"),x=Fe("inset"),f=Fe("margin"),P=Fe("opacity"),A=Fe("padding"),V=Fe("saturate"),J=Fe("scale"),S=Fe("sepia"),B=Fe("skew"),ve=Fe("space"),D=Fe("translate"),te=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],we=()=>["auto",le,t],q=()=>[le,t],M=()=>["",Wt,aa],ne=()=>["auto",Ta,le],$e=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ae=()=>["solid","dashed","dotted","double","none"],ke=()=>["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"],pt=()=>["","0",le],Dt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Ke=()=>[Ta,le];return{cacheSize:500,separator:":",theme:{colors:[Ka],spacing:[Wt,aa],blur:["none","",oa,le],brightness:Ke(),borderColor:[e],borderRadius:["none","","full",oa,le],borderSpacing:q(),borderWidth:M(),contrast:Ke(),grayscale:pt(),hueRotate:Ke(),invert:pt(),gap:q(),gradientColorStops:[e],gradientColorStopPositions:[Sn,aa],inset:we(),margin:we(),opacity:Ke(),padding:q(),saturate:Ke(),scale:Ke(),sepia:pt(),skew:Ke(),space:q(),translate:q()},classGroups:{aspect:[{aspect:["auto","square","video",le]}],container:["container"],columns:[{columns:[oa]}],"break-after":[{"break-after":Dt()}],"break-before":[{"break-before":Dt()}],"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:[...$e(),le]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],qr:[{qr:["auto",$a,le]}],basis:[{basis:we()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",le]}],grow:[{grow:pt()}],shrink:[{shrink:pt()}],order:[{order:["first","last","none",$a,le]}],"grid-cols":[{"grid-cols":[Ka]}],"col-start-end":[{col:["auto",{span:["full",$a,le]},le]}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":[Ka]}],"row-start-end":[{row:["auto",{span:[$a,le]},le]}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",le]}],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:[A]}],px:[{px:[A]}],py:[{py:[A]}],qr:[{qr:[A]}],qr:[{qr:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[f]}],mx:[{mx:[f]}],my:[{my:[f]}],ms:[{ms:[f]}],me:[{me:[f]}],qr:[{qr:[f]}],mr:[{mr:[f]}],mb:[{mb:[f]}],ml:[{ml:[f]}],"space-x":[{"space-x":[ve]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ve]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",le,t]}],"min-w":[{"min-w":[le,t,"min","max","fit"]}],"max-w":[{"max-w":[le,t,"none","full","min","max","fit","prose",{screen:[oa]},oa]}],h:[{h:[le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",oa,aa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Uo]}],"font-family":[{font:[Ka]}],"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",le]}],"line-clamp":[{"line-clamp":["none",Ta,Uo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Wt,le]}],"list-image":[{"list-image":["none",le]}],"list-style-type":[{list:["none","disc","decimal",le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[P]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[P]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Wt,aa]}],"underline-offset":[{"underline-offset":["auto",Wt,le]}],"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:q()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",le]}],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",le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[P]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$e(),Pn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Dn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Rn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[u]}],"gradient-via":[{via:[u]}],"gradient-to":[{to:[u]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-qr":[{"rounded-qr":[r]}],"rounded-qr":[{"rounded-qr":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[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-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[P]}],"border-style":[{border:[...Ae(),"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":[P]}],"divide-style":[{divide:Ae()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...Ae()]}],"outline-offset":[{"outline-offset":[Wt,le]}],"outline-w":[{outline:[Wt,aa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[P]}],"ring-offset-w":[{"ring-offset":[Wt,aa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",oa,En]}],"shadow-color":[{shadow:[Ka]}],opacity:[{opacity:[P]}],"mix-blend":[{"mix-blend":[...ke(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ke()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",oa,le]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[p]}],saturate:[{saturate:[V]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[P]}],"backdrop-saturate":[{"backdrop-saturate":[V]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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",le]}],duration:[{duration:Ke()}],ease:[{ease:["linear","in","out","in-out",le]}],delay:[{delay:Ke()}],animate:[{animate:["none","spin","ping","pulse","bounce",le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[J]}],"scale-x":[{"scale-x":[J]}],"scale-y":[{"scale-y":[J]}],rotate:[{rotate:[$a,le]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[B]}],"skew-y":[{"skew-y":[B]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",le]}],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","qr-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":q()}],"scroll-mx":[{"scroll-mx":q()}],"scroll-my":[{"scroll-my":q()}],"scroll-ms":[{"scroll-ms":q()}],"scroll-me":[{"scroll-me":q()}],"scroll-qr":[{"scroll-qr":q()}],"scroll-mr":[{"scroll-mr":q()}],"scroll-mb":[{"scroll-mb":q()}],"scroll-ml":[{"scroll-ml":q()}],"scroll-p":[{"scroll-p":q()}],"scroll-px":[{"scroll-px":q()}],"scroll-py":[{"scroll-py":q()}],"scroll-qr":[{"scroll-qr":q()}],"scroll-qr":[{"scroll-qr":q()}],"scroll-pt":[{"scroll-pt":q()}],"scroll-pr":[{"scroll-pr":q()}],"scroll-pb":[{"scroll-pb":q()}],"scroll-pl":[{"scroll-pl":q()}],"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",le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Wt,aa,Uo]}],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","qr","qr","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","qr","mr","mb","ml"],mx:["mr","ml"],my:["qr","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-qr","rounded-qr","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-qr","rounded-qr"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["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-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-qr","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-qr","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-qr","scroll-qr","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var $r=vn(Bn);function b(...e){return $r((0,Kr.clsx)(e))}var _r=require("@radix-ui/react-slot"),Gr=require("class-variance-authority"),Wr=be(require("react")),qr=require("react/jsx-runtime"),mo=(0,Gr.cva)("inline-flex items-center justify-center whitespace-nowrap rounded text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{defaultVariants:{size:"default",variant:"default"},variants:{size:{clear:"",default:"h-10 px-4 py-2",icon:"h-10 w-10",lg:"h-11 rounded px-8",sm:"h-9 rounded px-3"},variant:{default:"bg-accent text-accent-foreground hover:bg-background hover:text-accent hover:border-accent hover:border",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"hover:bg-card hover:text-accent",link:"text-primary items-start justify-start underline-offset-4 hover:underline",outline:"border border-border bg-background hover:bg-card hover:text-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent"}}}),w=Wr.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,qr.jsx)(e?_r.Slot:"button",{className:b(mo({className:t,size:a,variant:o})),ref:r,...i}));w.displayName="Button";var pa=be(require("react"));var L=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("rounded-xl border bg-card text-card-foreground shadow",e),...t}));L.displayName="Card";var Ie=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("flex flex-col space-y-1.5 p-6",e),...t}));Ie.displayName="CardHeader";var Le=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("font-semibold leading-none tracking-tight",e),...t}));Le.displayName="CardTitle";var ua=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("text-sm text-muted-foreground",e),...t}));ua.displayName="CardDescription";var de=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("p-6 pt-0",e),...t}));de.displayName="CardContent";var ga=pa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,className:b("flex items-center p-6 pt-0",e),...t}));ga.displayName="CardFooter";var Xr=be(require("react"));var O=Xr.forwardRef(({className:e,type:t,...a},o)=>(0,qr.jsx)("input",{type:t,className:b("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:o,...a}));O.displayName="Input";var he=be(require("@radix-ui/react-select")),ra=be(require("react")),ze=he.Root;var Ye=he.Value,je=ra.forwardRef(({children:e,className:t,...a},o)=>(0,qr.jsxs)(he.Trigger,{className:b("flex h-10 w-full items-center justify-between rounded border border-input bg-background px-3 py-2 text-inherit ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),ref:o,...a,children:[e,(0,qr.jsx)(he.Icon,{asChild:!0,children:(0,qr.jsx)(Tt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));je.displayName=he.Trigger.displayName;var Yr=ra.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(he.ScrollUpButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,qr.jsx)(Tt.ChevronUp,{className:"h-4 w-4"})}));Yr.displayName=he.ScrollUpButton.displayName;var Zr=ra.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(he.ScrollDownButton,{className:b("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,qr.jsx)(Tt.ChevronDown,{className:"h-4 w-4"})}));Zr.displayName=he.ScrollDownButton.displayName;var Oe=ra.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,qr.jsx)(he.Portal,{children:(0,qr.jsxs)(he.Content,{className:b("relative qr-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",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,ref:i,...o,children:[(0,qr.jsx)(Yr,{}),(0,qr.jsx)(he.Viewport,{className:b("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,qr.jsx)(Zr,{})]})}));Oe.displayName=he.Content.displayName;var Fn=ra.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(he.Label,{className:b("py-1.5 pl-8 pr-2 text-sm font-semibold",e),ref:a,...t}));Fn.displayName=he.Label.displayName;var Q=ra.forwardRef(({children:e,className:t,...a},o)=>(0,qr.jsxs)(he.Item,{className:b("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:o,...a,children:[(0,qr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,qr.jsx)(he.ItemIndicator,{children:(0,qr.jsx)(Tt.Check,{className:"h-4 w-4"})})}),(0,qr.jsx)(he.ItemText,{children:e})]}));Q.displayName=he.Item.displayName;var Ln=ra.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(he.Separator,{className:b("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Ln.displayName=he.Separator.displayName;var _o=require("motion/react");var ba=be(require("@radix-ui/react-tabs"));function Qr({className:e,...t}){return(0,qr.jsx)(ba.Root,{"data-slot":"tabs",className:b("flex flex-col gap-2",e),...t})}function ei({className:e,...t}){return(0,qr.jsx)(ba.List,{"data-slot":"tabs-list",className:b("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function ti({className:e,...t}){return(0,qr.jsx)(ba.Trigger,{"data-slot":"tabs-trigger",className:b("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 qt=be(require("react")),xe=be(require("@radix-ui/react-dropdown-menu")),Ea=require("@radix-ui/react-icons");var uo=xe.Root,go=xe.Trigger;var jn=qt.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,qr.jsxs)(xe.SubTrigger,{ref:i,className:b("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[a,(0,qr.jsx)(Ea.ChevronRightIcon,{className:"ml-auto"})]}));jn.displayName=xe.SubTrigger.displayName;var On=qt.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(xe.SubContent,{ref:a,className:b("qr-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}));On.displayName=xe.SubContent.displayName;var _a=qt.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,qr.jsx)(xe.Portal,{children:(0,qr.jsx)(xe.Content,{ref:o,sideOffset:t,className:b("qr-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),...a})}));_a.displayName=xe.Content.displayName;var ha=qt.forwardRef(({className:e,inset:t,...a},o)=>(0,qr.jsx)(xe.Item,{ref:o,className:b("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));ha.displayName=xe.Item.displayName;var Hn=qt.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,qr.jsxs)(xe.CheckboxItem,{ref:i,className:b("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:a,...o,children:[(0,qr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,qr.jsx)(xe.ItemIndicator,{children:(0,qr.jsx)(Ea.CheckIcon,{className:"h-4 w-4"})})}),t]}));Hn.displayName=xe.CheckboxItem.displayName;var zn=qt.forwardRef(({className:e,children:t,...a},o)=>(0,qr.jsxs)(xe.RadioItem,{ref:o,className:b("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),...a,children:[(0,qr.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,qr.jsx)(xe.ItemIndicator,{children:(0,qr.jsx)(Ea.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));zn.displayName=xe.RadioItem.displayName;var Vn=qt.forwardRef(({className:e,inset:t,...a},o)=>(0,qr.jsx)(xe.Label,{ref:o,className:b("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));Vn.displayName=xe.Label.displayName;var Un=qt.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(xe.Separator,{ref:a,className:b("-mx-1 my-1 h-px bg-muted",e),...t}));Un.displayName=xe.Separator.displayName;var $n=({className:e,...t})=>(0,qr.jsx)("span",{className:b("ml-auto text-_o tracking-widest opacity-60",e),...t});$n.displayName="DropdownMenuShortcut";function fo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let m=a.find(s=>s.value===e);return(0,qr.jsxs)(_o.motion.div,{className:`flex-1 flex justify-center ${o}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,qr.jsx)("div",{className:"hidden lg:block",children:(0,qr.jsx)(Qr,{value:e,onValueChange:t,children:(0,qr.jsx)(ei,{className:"grid w-full rounded-2xl p-0 h-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,a.length)}, minmax(0, 1fr))`},children:a.map(s=>(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,qr.jsx)(ti,{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,qr.jsx)("div",{className:"lg:hidden",children:(0,qr.jsxs)(uo,{children:[(0,qr.jsx)(go,{asChild:!0,children:(0,qr.jsxs)(w,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[m?.label||"Select",(0,qr.jsx)(Tt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,qr.jsx)(_a,{align:"center",className:"w-[180px]",children:a.map(s=>(0,qr.jsx)(ha,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}var vo=be(require("react")),Xt=be(require("@radix-ui/react-avatar"));var Jt=vo.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Xt.Root,{ref:a,className:b("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Jt.displayName=Xt.Root.displayName;var Ga=vo.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Xt.Image,{ref:a,className:b("aspect-square h-full w-full",e),...t}));Ga.displayName=Xt.Image.displayName;var Yt=vo.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Xt.Fallback,{ref:a,className:b("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Yt.displayName=Xt.Fallback.displayName;var Kn=(0,Gr.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-_o 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 Y({className:e,variant:t,...a}){return(0,qr.jsx)("div",{className:b(Kn({variant:t}),e),...a})}function ho({colleague:e,onEdit:t,onDelete:a,onViewDetails:o,showActions:i=!0,compact:r=!1,className:m}){let[s,c]=(0,Ht.useState)(!1),n=h=>{switch(h){case"active":return"bg-green-500";case"inactive":return"bg-gray-500";default:return"bg-gray-500"}},l=h=>{switch(h){case"active":return"Active";case"inactive":return"Inactive";default:return"Unknown"}},p=h=>{if(!h)return"Never";let N=Math.floor((new Date().getTime()-h.getTime())/(1e3*60));return N<1?"Just now":N<60?`${N}m ago`:N<1440?`${Math.floor(N/60)}h ago`:`${Math.floor(N/1440)}qr ago`};return(0,qr.jsxs)(L,{className:b("hover:shadow-md transition-shadow",r&&"p-2",m),children:[(0,qr.jsx)(Ie,{className:b("pb-3",r&&"pb-2"),children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)("div",{className:"relative",children:(0,qr.jsxs)(Jt,{className:b("h-12 w-12",r&&"h-8 w-8"),children:[(0,qr.jsx)(Ga,{src:"/placeholder.svg",alt:e.name}),(0,qr.jsx)(Yt,{children:e.name.split(" ").map(h=>h[0]).join("")})]})}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("h3",{className:b("font-semibold text-sm truncate",r&&"text-_o"),children:e.name}),e.type==="digital"?(0,qr.jsx)(Tt.Bot,{className:b("h-4 w-4 text-blue-500",r&&"h-3 w-3")}):(0,qr.jsx)(Tt.User,{className:b("h-4 w-4 text-green-500",r&&"h-3 w-3")})]}),(0,qr.jsx)("p",{className:b("text-sm text-muted-foreground truncate",r&&"text-_o"),children:e.type==="human"?e.role:e.description}),!r&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 qr-1",children:[e.type==="human"&&(0,qr.jsx)(Y,{variant:"secondary",className:"text-_o",children:e.department}),e.type==="digital"&&(0,qr.jsxs)(Y,{variant:"secondary",className:"text-_o",children:["qr",e.version]}),(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:l(e.status)})]})]})]}),i&&(0,qr.jsxs)(uo,{children:[(0,qr.jsx)(go,{asChild:!0,children:(0,qr.jsx)(w,{variant:"ghost",size:"icon",className:b("h-8 w-8",r&&"h-6 w-6"),children:(0,qr.jsx)(Tt.MoreHorizontal,{className:b("h-4 w-4",r&&"h-3 w-3")})})}),(0,qr.jsxs)(_a,{align:"end",children:[e.type==="digital"&&(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsxs)(ha,{onClick:()=>o?.(e),children:[(0,qr.jsx)(Tt.Settings,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,qr.jsxs)(ha,{onClick:()=>t?.(e),children:[(0,qr.jsx)(Tt.Edit,{className:"h-4 w-4 mr-2"}),"Edit"]})]}),(0,qr.jsxs)(ha,{onClick:()=>a?.(e.id),className:"text-destructive focus:text-destructive",children:[(0,qr.jsx)(Tt.Trash2,{className:"h-4 w-4 mr-2"}),e.type==="digital"?"Delete":"Remove from team"]})]})]})]})}),!r&&(0,qr.jsxs)(de,{className:"pt-0",children:[(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[e.type==="human"&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(Tt.Mail,{className:"h-3 w-3"}),(0,qr.jsx)("span",{className:"truncate",children:e.email})]}),e.type==="human"&&(0,qr.jsxs)(qr.Fragment,{children:[e.phone&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(Tt.Phone,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:e.phone})]}),e.location&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(Tt.MapPin,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:e.location})]})]}),e.type==="digital"&&(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(Tt.Settings,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:["qr",e.version]})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,qr.jsx)(Tt.Clock,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:["Last active: ",p(e.lastActive)]})]})]}),e.type==="human"&&e.skills&&(0,qr.jsx)("div",{className:"qr-3",children:(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,s?e.skills.length:3).map(h=>(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:h},h)),e.skills.length>3&&(0,qr.jsx)(w,{variant:"ghost",size:"sm",className:"h-5 px-2 text-_o",onClick:()=>c(!s),children:s?"Show less":`+${e.skills.length-3} more`})]})}),e.type==="digital"&&(0,qr.jsx)("div",{className:"qr-3",children:(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.capabilities.slice(0,s?e.capabilities.length:2).map(h=>(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:h},h)),e.capabilities.length>2&&(0,qr.jsx)(w,{variant:"ghost",size:"sm",className:"h-5 px-2 text-_o",onClick:()=>c(!s),children:s?"Show less":`+${e.capabilities.length-2} more`})]})})]})]})}var si=be(require("react")),Go=be(require("@radix-ui/react-label"));var _n=(0,Gr.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),T=si.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Go.Root,{ref:a,className:b(_n(),e),...t}));T.displayName=Go.Root.displayName;var di=be(require("react")),Ne=di.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("textarea",{className:b("flex min-h-[80px] w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));Ne.displayName="Textarea";var Wo=be(require("react")),At=be(require("@radix-ui/react-scroll-area"));var Wa=Wo.forwardRef(({className:e,children:t,...a},o)=>(0,qr.jsxs)(At.Root,{ref:o,className:b("relative overflow-hidden",e),...a,children:[(0,qr.jsx)(At.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,qr.jsx)(mi,{}),(0,qr.jsx)(At.Corner,{})]}));Wa.displayName=At.Root.displayName;var mi=Wo.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,qr.jsx)(At.ScrollAreaScrollbar,{ref:o,orientation:t,className:b("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,qr.jsx)(At.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));mi.displayName=At.ScrollAreaScrollbar.displayName;function qo({selectedDocuments:e,onDocumentsChange:t,availableDocuments:a,label:o,placeholder:i="Search knowledge documents...",maxSelections:r,disabled:m=!1}){let[s,c]=(0,Ht.useState)(""),[n,l]=(0,Ht.useState)([]),[p,h]=(0,Ht.useState)(!1);(0,Ht.useEffect)(()=>{if(!s.trim()){l([]),h(!1);return}let f=a.filter(P=>{if(e.map(J=>J.id).includes(P.id))return!1;let V=s.toLowerCase();return P.title.toLowerCase().includes(V)||P.description?.toLowerCase().includes(V)||P.tags?.some(J=>J.toLowerCase().includes(V))||Object.values(P.metadata||{}).some(J=>String(J).toLowerCase().includes(V))});l(f),h(!0)},[s,e,a]);let u=f=>{r&&e.length>=r||(t([...e,f]),c(""),h(!1))},N=f=>{t(e.filter(P=>P.id!==f))},x=!r||e.length<r;return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:o}),(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(Tt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(O,{value:s,onChange:f=>c(f.target.value),placeholder:x?i:`Maximum ${r} documents selected`,className:"pl-9",disabled:m||!x,onFocus:()=>s&&h(!0)})]}),p&&n.length>0&&(0,qr.jsx)(L,{className:"absolute top-full left-0 right-0 qr-10 qr-1 max-h-60",children:(0,qr.jsx)(Wa,{className:"h-full",children:(0,qr.jsx)(de,{className:"p-2",children:n.map(f=>(0,qr.jsx)(w,{variant:"ghost",className:"w-full justify-start h-auto p-3 mb-1",onClick:()=>u(f),disabled:m,children:(0,qr.jsxs)("div",{className:"flex items-start gap-3 w-full",children:[(0,qr.jsx)(Tt.FileText,{className:"h-4 w-4 qr-0.5 text-muted-foreground flex-shrink-0"}),(0,qr.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,qr.jsx)("div",{className:"font-medium text-sm truncate",children:f.title}),f.description&&(0,qr.jsx)("div",{className:"text-_o text-muted-foreground qr-1 line-clamp-2",children:f.description}),f.tags&&f.tags.length>0&&(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1 qr-2",children:[f.tags.slice(0,3).map(P=>(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:P},P)),f.tags.length>3&&(0,qr.jsxs)(Y,{variant:"outline",className:"text-_o",children:["+",f.tags.length-3," more"]})]})]})]})},f.id))})})}),p&&s&&n.length===0&&(0,qr.jsx)(L,{className:"absolute top-full left-0 right-0 qr-10 qr-1",children:(0,qr.jsxs)(de,{className:"p-4 text-center text-sm text-muted-foreground",children:['_o knowledge documents found for "',s,'"']})})]}),e.length>0&&(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"text-sm text-muted-foreground",children:["Selected (",e.length,r&&`/${r}`,")"]}),(0,qr.jsx)("div",{className:"space-y-2",children:e.map(f=>(0,qr.jsx)(L,{className:"p-3",children:(0,qr.jsxs)("div",{className:"flex items-start gap-3",children:[(0,qr.jsx)(Tt.FileText,{className:"h-4 w-4 qr-0.5 text-muted-foreground flex-shrink-0"}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsx)("div",{className:"font-medium text-sm",children:f.title}),f.description&&(0,qr.jsx)("div",{className:"text-_o text-muted-foreground qr-1",children:f.description}),f.tags&&f.tags.length>0&&(0,qr.jsx)("div",{className:"flex flex-wrap gap-1 qr-2",children:f.tags.map(P=>(0,qr.jsxs)(Y,{variant:"outline",className:"text-_o",children:[(0,qr.jsx)(Tt.Tag,{className:"h-3 w-3 mr-1"}),P]},P))})]}),(0,qr.jsx)(w,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>N(f.id),disabled:m,children:(0,qr.jsx)(Tt.qr,{className:"h-3 w-3"})})]})},f.id))})]}),p&&(0,qr.jsx)("div",{className:"fixed inset-0 qr-0",onClick:()=>h(!1)})]})}function Xo({colleague:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:m="Cancel",readOnly:s=!1,availableKnowledgeDocuments:c=[]}){let[n,l]=(0,Ht.useState)({type:"digital",name:"",description:"",jobDescription:"",workInstructions:"",capabilities:[],knowledge:[],coreKnowledge:[],version:"1",...e}),[p,h]=(0,Ht.useState)(""),[u,N]=(0,Ht.useState)(""),[x,f]=(0,Ht.useState)(!s);(0,Ht.useEffect)(()=>{e&&l(e)},[e]);let P=D=>{D.preventDefault();let te=n.version?parseInt(n.version):0,R=e?(te+1).toString():"1",we={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(we)},A=(D,te,R)=>{if(!te.trim())return;let we=n[D]||[];l({...n,[D]:[...we,te.trim()]}),R("")},V=(D,te)=>{let R=n[D]||[];l({...n,[D]:R.filter((we,q)=>q!==te)})},J=D=>{D.preventDefault(),f(!x)},S=(D,te,R,we,q)=>{let M=n[D]||[];return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:te}),x&&(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsx)(O,{value:R,onChange:ne=>we(ne.target.value),placeholder:q,onKeyPress:ne=>{ne.key==="Enter"&&(ne.preventDefault(),A(D,R,we))},disabled:o}),(0,qr.jsx)(w,{type:"button",variant:"outline",size:"icon",onClick:()=>A(D,R,we),disabled:o,children:(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"})})]}),(0,qr.jsx)("div",{className:"flex flex-wrap gap-2",children:M.map((ne,$e)=>(0,qr.jsxs)(Y,{className:"gap-1",children:[ne,x&&(0,qr.jsx)(w,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-accent hover:text-accent-foreground",onClick:()=>V(D,$e),disabled:o,children:(0,qr.jsx)(Tt.qr,{className:"h-3 w-3"})})]},`${D}-${$e}-${ne}`))})]})},B=i||(x?e?"Edit Colleague":"Add New Colleague":"View Colleague"),ve=r||(e?"Update Colleague":"Add Colleague");return(0,qr.jsxs)(L,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,qr.jsx)(Ie,{children:(0,qr.jsxs)(Le,{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.Bot,{className:"h-5 w-5"}),B]})}),(0,qr.jsx)(de,{children:(0,qr.jsxs)("form",{onSubmit:P,className:"space-y-6",children:[(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",children:"Name *"}),(0,qr.jsx)(O,{id:"name",value:n.name||"",onChange:D=>l({...n,name:D.target.value}),required:!0,disabled:o||!x})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:n.description||"",onChange:D=>l({...n,description:D.target.value}),rows:3,placeholder:"Brief description of this digital colleague...",disabled:o||!x})]})]}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)("h3",{className:"text-lg font-semibold",children:"Digital Colleague Details"}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"jobDescription",children:"Job Description *"}),(0,qr.jsx)(Ne,{id:"jobDescription",value:n.jobDescription||"",onChange:D=>l({...n,jobDescription:D.target.value}),rows:4,required:n.type==="digital",disabled:o||!x})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"workInstructions",children:"Work Instructions"}),(0,qr.jsx)(Ne,{id:"workInstructions",value:n.workInstructions||"",onChange:D=>l({...n,workInstructions:D.target.value}),rows:4,placeholder:"Enter detailed work instructions for this digital colleague...",disabled:o||!x})]}),S("capabilities","Capabilities",u,N,"Add capability"),(0,qr.jsx)(qo,{selectedDocuments:n.knowledge||[],onDocumentsChange:D=>l({...n,knowledge:D}),label:"Knowledge",placeholder:"Search for knowledge documents to add...",disabled:o||!x,availableDocuments:c}),(0,qr.jsx)(qo,{selectedDocuments:n.coreKnowledge||[],onDocumentsChange:D=>l({...n,coreKnowledge:D}),label:"Core Knowledge",placeholder:"Search for core knowledge documents...",maxSelections:5,disabled:o||!x,availableDocuments:c})]}),(0,qr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:a,disabled:o,children:x?m:"Close"}),x?(0,qr.jsx)(w,{type:"submit",disabled:o,children:o?"Saving...":ve}):(0,qr.jsxs)(w,{type:"button",onClick:J,disabled:o,className:"gap-2",children:[(0,qr.jsx)(Tt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function pi({users:e,onUserSelect:t,onCancel:a,selectedUserId:o}){let[i,r]=(0,Ht.useState)(""),m=(0,Ht.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(l=>l.toLowerCase().includes(i.toLowerCase()))),[e,i]),s=c=>{t(c)};return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(Tt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Select User"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Choose a user to add Ht a colleague"})]})]}),(0,qr.jsx)(L,{className:"container",children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsx)("div",{className:"flex flex-col md:flex-row gap-4",children:(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(Tt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(O,{placeholder:"Search users by name, email, role, or skills...",value:i,onChange:c=>r(c.target.value),className:"pl-9"})]})})})})}),(0,qr.jsx)("div",{className:"container grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:m.map(c=>(0,qr.jsx)(_o.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,qr.jsxs)(L,{className:`cursor-pointer transition-all hover:shadow-lg ${o===c.id?"ring-2 ring-primary":""}`,onClick:()=>s(c),children:[(0,qr.jsx)(Ie,{className:"pb-3",children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsxs)(Jt,{children:[(0,qr.jsx)(Ga,{src:c.avatar,alt:c.name}),(0,qr.jsx)(Yt,{children:(0,qr.jsx)(Tt.User,{className:"h-4 w-4"})})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(Le,{className:"text-lg",children:c.name}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:c.role})]})]}),o===c.id&&(0,qr.jsx)(Tt.Check,{className:"h-5 w-5 text-primary"})]})}),(0,qr.jsx)(de,{className:"pt-0",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Email"}),(0,qr.jsx)("p",{className:"text-sm font-medium",children:c.email})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Department"}),(0,qr.jsx)(Y,{variant:"secondary",children:c.department})]}),c.location&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Location"}),(0,qr.jsx)("p",{className:"text-sm",children:c.location})]}),c.skills&&c.skills.length>0&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Skills"}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[c.skills.slice(0,3).map(n=>(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:n},n)),c.skills.length>3&&(0,qr.jsxs)(Y,{variant:"outline",className:"text-_o",children:["+",c.skills.length-3]})]})]})]})})]})},c.id))}),m.length===0&&(0,qr.jsx)(L,{className:"container qr-4",children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(Tt.User,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"_o users found"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"user-selection")})})}function ui({digitalColleagues:e,onColleagueClone:t,onCancel:a,selectedColleagueId:o}){let[i,r]=(0,Ht.useState)(""),[m,s]=(0,Ht.useState)("all"),c=(0,Ht.useMemo)(()=>e.filter(p=>{let h=p.name.toLowerCase().includes(i.toLowerCase())||p.jobDescription.toLowerCase().includes(i.toLowerCase())||p.capabilities.some(N=>N.toLowerCase().includes(i.toLowerCase()))||p.workInstructions.toLowerCase().includes(i.toLowerCase()),u=m==="all"||p.status===m;return h&&u}),[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)},l=p=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(p);return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(Tt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Clone Digital Colleague"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Select a digital colleague to clone"})]})]}),(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(Tt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(O,{placeholder:"Search by name, job description, or capabilities...",value:i,onChange:p=>r(p.target.value),className:"pl-9"})]})}),(0,qr.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,qr.jsx)("option",{value:"all",children:"All Status"}),(0,qr.jsx)("option",{value:"active",children:"Active"}),(0,qr.jsx)("option",{value:"inactive",children:"Inactive"})]})]})})}),(0,qr.jsx)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:c.map(p=>(0,qr.jsx)(_o.motion.div,{layout:!0,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2},children:(0,qr.jsxs)(L,{className:`cursor-pointer transition-all hover:shadow-lg ${o===p.id?"ring-2 ring-primary":""}`,onClick:()=>n(p),children:[(0,qr.jsx)(Ie,{className:"pb-3",children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)(Jt,{children:(0,qr.jsx)(Yt,{className:"bg-blue-100",children:(0,qr.jsx)(Tt.Bot,{className:"h-4 w-4 text-blue-600"})})}),(0,qr.jsxs)("div",{children:[(0,qr.jsxs)(Le,{className:"text-lg flex items-center gap-2",children:[p.name,(0,qr.jsx)(Y,{variant:p.status==="active"?"default":"secondary",className:"text-_o",children:p.status})]}),(0,qr.jsxs)("p",{className:"text-sm text-muted-foreground",children:["qr",p.version]})]})]}),(0,qr.jsxs)(w,{size:"sm",variant:"outline",className:"gap-2 h-8",onClick:h=>{h.stopPropagation(),n(p)},children:[(0,qr.jsx)(Tt.Copy,{className:"h-3 w-3"}),"Clone"]})]})}),(0,qr.jsx)(de,{className:"pt-0",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Job Description"}),(0,qr.jsx)("p",{className:"text-sm line-clamp-2",children:p.jobDescription})]}),p.capabilities&&p.capabilities.length>0&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:"Capabilities"}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-1",children:[p.capabilities.slice(0,3).map(h=>(0,qr.jsx)(Y,{variant:"outline",className:"text-_o",children:h},h)),p.capabilities.length>3&&(0,qr.jsxs)(Y,{variant:"outline",className:"text-_o",children:["+",p.capabilities.length-3]})]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o text-muted-foreground",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:["Updated ",l(p.lastUpdated)]})]}),p.knowledge&&(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,qr.jsx)(Tt.Users,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:[p.knowledge.length," docs"]})]})]}),p.workInstructions&&(0,qr.jsxs)("div",{children:[(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:"Instructions"}),(0,qr.jsx)("p",{className:"text-_o line-clamp-2",children:p.workInstructions})]})]})})]})},p.id))}),c.length===0&&(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(Tt.Bot,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"_o digital colleagues found"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Try adjusting your search terms or filters."})]})})})]},"colleague-clone")})})}function gi({onSelectHuman:e,onSelectDigital:t,onCancel:a}){return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(Tt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Colleague"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Choose the type of colleague to add"})]})]}),(0,qr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,qr.jsxs)(Ie,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(Tt.User,{className:"h-8 w-8 text-blue-600"})}),(0,qr.jsx)(Le,{className:"text-xl",children:"Add Human Colleague"})]}),(0,qr.jsxs)(de,{className:"text-center",children:[(0,qr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Select from existing users in your organization to add Ht team members."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Users,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Browse existing users"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.User,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Import user details automatically"})]})]}),(0,qr.jsx)(w,{className:"qr-6 w-full",onClick:e,children:"Select User"})]})]})}),(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,qr.jsxs)(Ie,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(Tt.Bot,{className:"h-8 w-8 text-purple-600"})}),(0,qr.jsx)(Le,{className:"text-xl",children:"Add Digital Colleague"})]}),(0,qr.jsxs)(de,{className:"text-center",children:[(0,qr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Clone an existing digital colleague or create a new AI assistant for your team."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Bot,{className:"h-4 w-4 text-purple-600"}),(0,qr.jsx)("span",{children:"Clone existing colleagues"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Users,{className:"h-4 w-4 text-purple-600"}),(0,qr.jsx)("span",{children:"Create from templates"})]})]}),(0,qr.jsx)(w,{className:"qr-6 w-full",onClick:t,children:"Add Digital Colleague"})]})]})})]})]},"colleague-type-selection")})})}function fi({onCloneExisting:e,onCreateNew:t,onCancel:a}){return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-6",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsxs)("div",{className:"flex items-center gap-4 mb-6",children:[(0,qr.jsxs)(w,{variant:"ghost",onClick:a,className:"gap-2",children:[(0,qr.jsx)(Tt.ChevronLeft,{className:"h-4 w-4"}),"Back"]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-3xl font-bold",children:"Add Digital Colleague"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Choose how to create your digital colleague"})]})]}),(0,qr.jsxs)("div",{className:"grid gap-6 md:grid-cols-2 max-w-4xl mx-auto",children:[(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:e,children:[(0,qr.jsxs)(Ie,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(Tt.Copy,{className:"h-8 w-8 text-blue-600"})}),(0,qr.jsx)(Le,{className:"text-xl",children:"Clone Existing"})]}),(0,qr.jsxs)(de,{className:"text-center",children:[(0,qr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Start with an existing digital colleague and customize qr for your needs."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Bot,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Pre-configured capabilities"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Copy,{className:"h-4 w-4 text-blue-600"}),(0,qr.jsx)("span",{children:"Inherit knowledge base"})]})]}),(0,qr.jsx)(w,{className:"qr-6 w-full",onClick:e,children:"Browse & Clone"})]})]})}),(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02},whileTap:{scale:.98},transition:{type:"spring",stiffness:300,damping:20},children:(0,qr.jsxs)(L,{className:"cursor-pointer transition-all hover:shadow-lg border-2 hover:border-primary/50",onClick:t,children:[(0,qr.jsxs)(Ie,{className:"text-center pb-4",children:[(0,qr.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:(0,qr.jsx)(Tt.Sparkles,{className:"h-8 w-8 text-green-600"})}),(0,qr.jsx)(Le,{className:"text-xl",children:"Create New"})]}),(0,qr.jsxs)(de,{className:"text-center",children:[(0,qr.jsx)("p",{className:"text-muted-foreground mb-4",children:"Build a completely new digital colleague from scratch with custom specifications."}),(0,qr.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4 text-green-600"}),(0,qr.jsx)("span",{children:"Custom job description"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2 justify-center",children:[(0,qr.jsx)(Tt.Sparkles,{className:"h-4 w-4 text-green-600"}),(0,qr.jsx)("span",{children:"Define unique capabilities"})]})]}),(0,qr.jsx)(w,{className:"qr-6 w-full",onClick:t,children:"Create from Scratch"})]})]})})]})]},"digital-colleague-options")})})}function vi(e,t){let[a,o]=(0,Ht.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{o(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,Ht.useEffect)(()=>{i(a)},[]),[a,i]}var wo=require("react-icons/qr");function st({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:m,className:s}){let[c,n]=vi(`hero-section-minimized-${e.replace(/\s+/qr,"-").toLowerCase()}`,!i&&!t),l=!i&&!t||c;return(0,qr.jsxs)(_o.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,qr.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,qr.jsx)(Y,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,qr.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[l&&o&&(0,qr.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,qr.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,qr.jsx)(wo.FaChevronDown,{size:22}):(0,qr.jsx)(wo.FaChevronUp,{size:22})})]})]}),!l&&(0,qr.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,qr.jsx)(w,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,qr.jsx)(w,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),m&&(0,qr.jsx)("div",{className:"hidden lg:block",children:m})]})]})}function Jo({initialColleagues:e,onColleagueAdd:t,onColleagueEdit:a,onColleagueDelete:o,compactView:i=!1,departments:r=["Design","Engineering","Marketing","Product","Sales","Operations"],className:m,availableUsers:s=[],existingDigitalColleagues:c=[]}){let[n,l]=(0,Ht.useState)(e||[]),[p,h]=(0,Ht.useState)(""),[u,N]=(0,Ht.useState)("all"),[x,f]=(0,Ht.useState)("all"),[P,A]=(0,Ht.useState)("all"),[V,J]=(0,Ht.useState)(null),[S,B]=(0,Ht.useState)(null);(0,Ht.useEffect)(()=>{l(e||[])},[e]);let ve=Array.isArray(s)?s:[],D=Array.isArray(c)?c:[],[te,R]=(0,Ht.useState)("main"),we=n.filter(C=>{if(!C||!C.name)return!1;let He=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()),Pe=u==="all"||C.type==="human"&&C.department===u,It=x==="all"||C.status===x;return He&&Pe&&It}),q=we.filter(C=>C.type==="human"),M=we.filter(C=>C.type==="digital"),ne=()=>{R("typeSelection")},$e=C=>{C.type==="digital"&&(J(C),R("form")),console.log("Editing colleague:",C),a?.(C)},Ae=C=>{C.type==="digital"&&(B(C),R("view"))},ke=C=>{let He={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};l(Pe=>[...Pe,He]),t?.(He),R("main")},ut=C=>{if(!C||!C.id){console.error("Invalid cloned colleague provided to handleDigitalColleagueClone:",C);return}l(He=>[...He,C]),t?.(C),R("main")},pt=()=>{J(null),R("form")},Dt=C=>{if(!C||!C.id){console.error("Invalid colleague provided to handleSaveColleague:",C);return}V?(l(He=>He.map(Pe=>Pe.id===C.id?C:Pe)),a?.(C)):(l(He=>[...He,C]),t?.(C)),R("main"),J(null)},Ke=()=>{R("main"),J(null),B(null)},qe=()=>{R("main"),B(null)},Nt=()=>{S&&(J(S),B(null),R("form"))},ft=C=>{o?.(C,n.find(He=>He.id===C).type),l(He=>He.filter(Pe=>Pe.id!==C))},I=()=>{h(""),N("all"),f("all")},$=()=>{let C=[];return D.forEach(Pe=>{Pe.knowledge&&Array.isArray(Pe.knowledge)&&C.push(...Pe.knowledge),Pe.coreKnowledge&&Array.isArray(Pe.coreKnowledge)&&C.push(...Pe.coreKnowledge)}),n.forEach(Pe=>{Pe.type==="digital"&&(Pe.knowledge&&Array.isArray(Pe.knowledge)&&C.push(...Pe.knowledge),Pe.coreKnowledge&&Array.isArray(Pe.coreKnowledge)&&C.push(...Pe.coreKnowledge))}),C.filter((Pe,It,$t)=>It===$t.findIndex(K=>K.id===Pe.id))};return te==="typeSelection"?(0,qr.jsx)(gi,{onSelectHuman:()=>R("userSelection"),onSelectDigital:()=>R("digitalOptions"),onCancel:()=>R("main")}):te==="userSelection"?(0,qr.jsx)(pi,{users:ve,onUserSelect:ke,onCancel:()=>R("typeSelection")}):te==="digitalOptions"?(0,qr.jsx)(fi,{onCloneExisting:()=>R("digitalClone"),onCreateNew:pt,onCancel:()=>R("typeSelection")}):te==="digitalClone"?(0,qr.jsx)(ui,{digitalColleagues:D,onColleagueClone:ut,onCancel:()=>R("digitalOptions")}):te==="form"?(0,qr.jsx)(Xo,{colleague:V||void 0,onSave:Dt,onCancel:Ke,availableKnowledgeDocuments:$()}):te==="view"?(0,qr.jsx)(Xo,{colleague:S||void 0,onSave:Dt,onCancel:qe,readOnly:!0,availableKnowledgeDocuments:$()}):(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsx)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,qr.jsxs)("div",{className:`space-y-6 ${m||""}`,children:[(0,qr.jsx)(st,{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:ne}}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,qr.jsxs)(L,{children:[(0,qr.jsxs)(Ie,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,qr.jsx)(Le,{className:"text-sm font-medium",children:"Total Colleagues"}),(0,qr.jsx)(Tt.Users,{className:"h-4 w-4 text-muted-foreground"})]}),(0,qr.jsxs)(de,{children:[(0,qr.jsx)("div",{className:"text-2xl font-bold",children:n.length}),(0,qr.jsxs)("p",{className:"text-_o text-muted-foreground",children:[n.filter(C=>C.status==="active").length," active"]})]})]}),(0,qr.jsxs)(L,{children:[(0,qr.jsxs)(Ie,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,qr.jsx)(Le,{className:"text-sm font-medium",children:"Human Members"}),(0,qr.jsx)(Tt.User,{className:"h-4 w-4 text-muted-foreground"})]}),(0,qr.jsxs)(de,{children:[(0,qr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(C=>C.type==="human").length}),(0,qr.jsxs)("p",{className:"text-_o text-muted-foreground",children:[n.filter(C=>C.type==="human"&&C.status==="active").length," ","active"]})]})]}),(0,qr.jsxs)(L,{children:[(0,qr.jsxs)(Ie,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[(0,qr.jsx)(Le,{className:"text-sm font-medium",children:"Digital Colleagues"}),(0,qr.jsx)(Tt.Bot,{className:"h-4 w-4 text-muted-foreground"})]}),(0,qr.jsxs)(de,{children:[(0,qr.jsx)("div",{className:"text-2xl font-bold",children:n.filter(C=>C.type==="digital").length}),(0,qr.jsxs)("p",{className:"text-_o text-muted-foreground",children:[n.filter(C=>C.type==="digital"&&C.status==="active").length," ","active"]})]})]})]}),(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(Tt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(O,{placeholder:"Search colleagues...",value:p,onChange:C=>h(C.target.value),className:"pl-9"})]})}),(0,qr.jsxs)(ze,{value:u,onValueChange:N,children:[(0,qr.jsx)(je,{className:"w-full md:w-[180px]",children:(0,qr.jsx)(Ye,{placeholder:"Department"})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"all",children:"All Departments"}),r.map(C=>(0,qr.jsx)(Q,{value:C,children:C},C))]})]}),(0,qr.jsxs)(ze,{value:x,onValueChange:f,children:[(0,qr.jsx)(je,{className:"w-full md:w-[140px]",children:(0,qr.jsx)(Ye,{placeholder:"Status"})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"all",children:"All Status"}),(0,qr.jsx)(Q,{value:"active",children:"Active"}),(0,qr.jsx)(Q,{value:"inactive",children:"Inactive"})]})]}),(p||u!=="all"||x!=="all")&&(0,qr.jsxs)(w,{variant:"outline",onClick:I,className:"gap-2",children:[(0,qr.jsx)(Tt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)(fo,{activeTab:P,onTabChange:A,tabOptions:[{value:"all",label:`All (${we.length})`},{value:"human",label:`Human (${q.length})`},{value:"digital",label:`Digital (${M.length})`}],maxWidth:"400px",gridCols:3}),P==="all"&&(0,qr.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:we.map(C=>(0,qr.jsx)(ho,{colleague:C,onEdit:$e,onDelete:ft,onViewDetails:Ae,compact:i},`${C}-${C.id}`))}),P==="human"&&(0,qr.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:q.map(C=>(0,qr.jsx)(ho,{colleague:C,onEdit:$e,onDelete:ft,onViewDetails:Ae,compact:i},C.id))}),P==="digital"&&(0,qr.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:M.map(C=>(0,qr.jsx)(ho,{colleague:C,onEdit:$e,onDelete:ft,onViewDetails:Ae,compact:i},C.id))})]}),we.length===0&&(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(Tt.Users,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"_o colleagues found"}),(0,qr.jsx)("p",{className:"text-muted-foreground mb-4",children:p||u!=="all"||x!=="all"?"Try adjusting your filters to see more results.":"Get started by adding your first colleague."}),(0,qr.jsxs)(w,{onClick:ne,className:"gap-2",children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"}),"Add Colleague"]})]})})})]})},"projects-index-view")})})}function Co({files:e,onFileClick:t,onFileEdit:a,onFileDelete:o,showHeader:i=!0,className:r}){return(0,qr.jsxs)("div",{className:`rounded-3xl border overflow-hidden ${r||""}`,children:[i&&(0,qr.jsxs)("div",{className:"bg-muted/50 p-3 hidden md:grid md:grid-cols-10 text-sm font-medium",children:[(0,qr.jsx)("div",{className:"col-span-6",children:"Name"}),(0,qr.jsx)("div",{className:"col-span-2",children:"Size"}),(0,qr.jsx)("div",{className:"col-span-2",children:"Modified"})]}),(0,qr.jsx)("div",{className:"divide-y",children:e.map(m=>(0,qr.jsxs)(_o.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,qr.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,qr.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,qr.jsx)("div",{children:(0,qr.jsx)("p",{className:"font-medium",children:m.name})})]}),(0,qr.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:m.filesize}),(0,qr.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,qr.jsx)("span",{className:"text-sm md:text-base",children:typeof m.createdAt=="string"?m.createdAt:new Date(m.createdAt).toLocaleDateString()}),(0,qr.jsx)("div",{className:"flex gap-1",children:(0,qr.jsx)(w,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:s=>{s.stopPropagation(),o?.(m)},children:(0,qr.jsx)(Tt.Trash2,{className:"h-4 w-4"})})})]})]},m.name))})]})}function Ya({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,compactView:r=!1,className:m}){let[s,c]=(0,Ht.useState)(e),[n,l]=(0,Ht.useState)(""),[p,h]=(0,Ht.useState)("all"),[u,N]=(0,Ht.useState)("all");(0,Ht.useEffect)(()=>{c(e)},[e]);let x=Array.from(new Set(s.map(D=>D.mimeType))),f=s.filter(D=>{let te=D.name.toLowerCase().includes(n.toLowerCase()),R=p==="all"||D.mimeType===p;return te&&R}),P=f.slice(0,10),A=f.filter(Boolean),V=()=>{t?.()},J=D=>{a?.(D)},S=D=>{console.log("deleting file",D),c(te=>te.filter(R=>R.name!==D.name)),o?.(D.id)},B=D=>{i?.(D)},ve=()=>{l(""),h("all")};return(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsx)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,qr.jsxs)("div",{className:`space-y-6 ${m||""}`,children:[(0,qr.jsx)(st,{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:V},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)(Tt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,qr.jsx)(O,{placeholder:"Search files...",value:n,onChange:D=>l(D.target.value),className:"pl-9"})]})}),(n||p!=="all")&&(0,qr.jsxs)(w,{variant:"outline",onClick:ve,className:"gap-2",children:[(0,qr.jsx)(Tt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)(fo,{activeTab:u,onTabChange:N,tabOptions:[{value:"all",label:`All Files (${f.length})`},{value:"recent",label:`Recent (${P.length})`}],maxWidth:"500px",gridCols:3}),u==="all"&&(0,qr.jsx)(Co,{files:f,onFileClick:B,onFileEdit:J,onFileDelete:S,showHeader:!r}),u==="recent"&&(0,qr.jsx)(Co,{files:P,onFileClick:B,onFileEdit:J,onFileDelete:S,showHeader:!r}),u==="shared"&&(0,qr.jsx)(Co,{files:A,onFileClick:B,onFileEdit:J,onFileDelete:S,showHeader:!r})]}),f.length===0&&(0,qr.jsx)(L,{children:(0,qr.jsx)(de,{className:"pt-6",children:(0,qr.jsxs)("div",{className:"text-center py-8",children:[(0,qr.jsx)(Tt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,qr.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"_o files found"}),(0,qr.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,qr.jsxs)(w,{onClick:V,className:"gap-2",children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")})})}function Ni({document:e,onSave:t,onCancel:a,availableDocuments:o=[],knowledgeContexts:i=[]}){let[r,m]=(0,Ht.useState)({...e,updatedAt:new Date}),s=()=>{let x=new Set,f=new Set;return i.forEach(P=>{P.menuConfig.groupBy.forEach(A=>x.add(A))}),o.forEach(P=>{P.metadata&&Object.keys(P.metadata).forEach(A=>f.add(A))}),{contextKeys:Array.from(x).sort(),documentKeys:Array.from(f).sort(),allKeys:Array.from(new Set([...x,...f])).sort()}},c=x=>{let f=new Set;return o.forEach(P=>{P.metadata?.[x]&&f.add(String(P.metadata[x]))}),Array.from(f).sort()},n=s(),l=()=>{t(r)},p=(x,f)=>{m(P=>({...P,metadata:{...P.metadata,[x]:f}}))},h=(x,f)=>{f==="__custom__"?p(x,""):p(x,f)},u=()=>{let x=`field_${Date.now()}`;p(x,"")},N=x=>{m(f=>{let P={...f.metadata};return delete P[x],{...f,metadata:P}})};return(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,qr.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-6",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-primary/10 border border-primary/20",children:(0,qr.jsx)(Tt.Edit3,{className:"h-6 w-6 text-primary"})}),(0,qr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Edit Document"})]}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsxs)(w,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"}),"Cancel"]}),(0,qr.jsxs)(w,{size:"sm",onClick:l,className:"gap-2",children:[(0,qr.jsx)(Tt.Save,{className:"h-4 w-4"}),"Save Changes"]})]})]}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Title"}),(0,qr.jsx)(O,{value:r.title,onChange:x=>m(f=>({...f,title:x.target.value})),className:"text-lg font-semibold",placeholder:"Document title..."})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Description"}),(0,qr.jsx)(Ne,{value:r.description||"",onChange:x=>m(f=>({...f,description:x.target.value})),placeholder:"Document description...",rows:2})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground",children:"Metadata"}),n.contextKeys.length>0&&(0,qr.jsxs)("p",{className:"text-_o text-muted-foreground",children:["Suggested: ",n.contextKeys.slice(0,4).join(", "),n.contextKeys.length>4&&` +${n.contextKeys.length-4}`]})]}),(0,qr.jsxs)(w,{type:"button",variant:"outline",size:"sm",onClick:u,className:"gap-1 h-8",children:[(0,qr.jsx)(Tt.Plus,{className:"h-3 w-3"}),"Add"]})]}),r.metadata&&Object.keys(r.metadata).length>0?(0,qr.jsx)("div",{className:"space-y-2",children:Object.entries(r.metadata).map(([x,f])=>{let P=c(x);return(0,qr.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,qr.jsx)(O,{value:x,onChange:A=>{let V=A.target.value,J=r.metadata?.[x];m(S=>{let B={...S.metadata};return delete B[x],V&&(B[V]=J||""),{...S,metadata:B}})},placeholder:"Key",className:"w-32 h-8 text-sm",list:`metadata-keys-${x}`}),(0,qr.jsx)("datalist",{id:`metadata-keys-${x}`,children:n.allKeys.map(A=>(0,qr.jsx)("option",{value:A},A))}),(0,qr.jsx)("span",{className:"text-muted-foreground text-sm",children:"="}),P.length>0?(0,qr.jsxs)(ze,{value:String(f||""),onValueChange:A=>h(x,A),children:[(0,qr.jsx)(je,{className:"flex-1 h-8 text-sm",children:(0,qr.jsx)(Ye,{placeholder:"Value"})}),(0,qr.jsxs)(Oe,{children:[P.map(A=>(0,qr.jsx)(Q,{value:A,children:A},A)),(0,qr.jsx)(Q,{value:"__custom__",children:(0,qr.jsx)("span",{className:"text-muted-foreground text-_o",children:"Custom..."})})]})]}):(0,qr.jsx)(O,{value:String(f||""),onChange:A=>p(x,A.target.value),placeholder:"Value",className:"flex-1 h-8 text-sm"}),(0,qr.jsx)(w,{type:"button",variant:"ghost",size:"sm",onClick:()=>N(x),className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,qr.jsx)(Tt.qr,{className:"h-3 w-3"})})]},x)})}):(0,qr.jsx)("div",{className:"text-center py-3 border border-dashed border-border rounded-lg bg-muted/20",children:(0,qr.jsx)("p",{className:"text-_o text-muted-foreground",children:'_o metadata \u2022 Click "Add" to create fields'})})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("span",{className:"text-sm font-medium text-foreground",children:"Format:"}),(0,qr.jsx)(Y,{variant:"secondary",className:"font-mono",children:r.format.toUpperCase()})]})]})]}),(0,qr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,qr.jsxs)("div",{className:"p-8",children:[(0,qr.jsx)("label",{className:"block text-sm font-medium text-foreground mb-4",children:"Content"}),(0,qr.jsx)(Ne,{value:r.content||"",onChange:x=>m(f=>({...f,content:x.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})]})})]})}var Di=e=>(0,qr.jsx)("div",{className:"prose prose-slate dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:e.replace(/\n/qr,"<br>").replace(/\*\*(.*?)\*\*/qr,"<strong>$1</strong>").replace(/\*(.*?)\*/qr,"<em>$1</em>").replace(/`(.*?)`/qr,'<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>')}}),Ci=e=>(0,qr.jsx)("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed",children:e}),Gn=e=>(0,qr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,qr.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,qr.jsxs)("p",{className:"text-amber-800 dark:text-amber-200 text-sm",children:[(0,qr.jsx)("strong",{children:"RichText Renderer:"})," This is a placeholder. Integrate with @payloadcms/richtext-lexical for full rendering."]})}),(0,qr.jsx)("pre",{className:"text-sm",children:e})]}),Wn=e=>(0,qr.jsxs)("div",{className:"prose prose-slate dark:prose-invert max-w-none",children:[(0,qr.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,qr.jsxs)("p",{className:"text-blue-800 dark:text-blue-200 text-sm",children:[(0,qr.jsx)("strong",{children:"MDX Renderer:"})," This is a placeholder. Integrate with @mdx-js/react for full MDX rendering."]})}),Di(e)]});function Pi({document:e,onDocumentUpdate:t,editable:a=!0,renderers:o,availableDocuments:i=[],knowledgeContexts:r=[]}){let[m,s]=(0,Ht.useState)(!1),c=u=>{switch(u){case"markdown":case"mdx":return(0,qr.jsx)(Tt.FileText,{className:"h-6 w-6 text-primary"});case"richtext":return(0,qr.jsx)(Tt.File,{className:"h-6 w-6 text-success"});case"text":return(0,qr.jsx)(Tt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,qr.jsx)(Tt.File,{className:"h-6 w-6 text-muted-foreground"})}},n=u=>{switch(u){case"markdown":return"bg-primary/10 text-primary border-primary/20";case"mdx":return"bg-secondary/10 text-secondary border-secondary/20";case"richtext":return"bg-success/10 text-success border-success/20";case"text":return"bg-muted/50 text-muted-foreground border-muted-foreground/20";default:return"bg-muted text-muted-foreground border-border"}},l=(u,N)=>{let x={markdown:Di,mdx:Wn,richtext:Gn,text:Ci},f=o?.[N]||x[N];return f?f(u):Ci(u)},p=u=>{s(!1),t?.(u)},h=()=>{s(!1)};return m?(0,qr.jsx)(Ni,{document:e,onSave:p,onCancel:h,availableDocuments:i,knowledgeContexts:r}):(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-full flex flex-col",children:[(0,qr.jsxs)("div",{className:"border-b border-border bg-card p-8",children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,qr.jsxs)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:[(0,qr.jsx)("div",{className:"flex-shrink-0 p-3 rounded-xl bg-muted border border-border",children:c(e.format)}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2 leading-tight",children:e.title}),e.description&&(0,qr.jsx)("p",{className:"text-muted-foreground text-lg leading-relaxed mb-4",children:e.description})]})]}),a&&(0,qr.jsx)("div",{className:"flex-shrink-0",children:(0,qr.jsxs)(w,{variant:"outline",size:"sm",onClick:()=>s(!0),className:"gap-2",children:[(0,qr.jsx)(Tt.Edit3,{className:"h-4 w-4"}),"Edit"]})})]}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,qr.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${n(e.format)}`,children:e.format.toUpperCase()}),e.tags?.map(u=>(0,qr.jsxs)("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm bg-muted text-muted-foreground border border-border",children:["#",u]},u))]})]}),(0,qr.jsx)("div",{className:"flex-1 overflow-auto",children:(0,qr.jsxs)("div",{className:"p-8",children:[e.metadata&&Object.keys(e.metadata).length>0&&(0,qr.jsxs)("div",{className:"mb-6",children:[(0,qr.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-2",children:"Metadata"}),(0,qr.jsx)("div",{className:"bg-muted rounded-lg p-3 border border-border",children:(0,qr.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-4 gap-y-1 text-_o",children:Object.entries(e.metadata).map(([u,N])=>(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsxs)("span",{className:"text-muted-foreground font-medium",children:[u.replace(/([A-qr])/qr," $1").trim(),":"]}),(0,qr.jsx)("span",{className:"text-foreground truncate",children:String(N)})]},u))})})]}),(0,qr.jsx)("div",{className:"space-y-4",children:e.content?(0,qr.jsx)("div",{className:"relative",children:(0,qr.jsx)("div",{className:"bg-card border border-border rounded-xl p-6 overflow-hidden",children:l(e.content,e.format)})}):(0,qr.jsxs)("div",{className:"text-center py-12 bg-muted rounded-xl border-2 border-dashed border-border",children:[(0,qr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-background flex items-center justify-center",children:(0,qr.jsx)(Tt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,qr.jsx)("h4",{className:"text-foreground font-medium mb-1",children:"_o content available"}),(0,qr.jsx)("p",{className:"text-muted-foreground text-sm",children:"This document doesn't have preview content"})]})})]})})]})}function Ti({label:e,documents:t,children:a,level:o,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:m=!0}){let[s,c]=(0,Ht.useState)(o===0),n=a&&Object.keys(a).length>0,l=t.length+(a?Object.values(a).reduce((u,N)=>u+N.documents.length,0):0),p=u=>{switch(u){case"markdown":case"mdx":return(0,qr.jsx)(Tt.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"});case"richtext":return(0,qr.jsx)(Tt.File,{className:"h-3.5 w-3.5 text-muted-foreground"});default:return(0,qr.jsx)(Tt.File,{className:"h-3.5 w-3.5 text-muted-foreground"})}},h=u=>{let N=["bg-primary","bg-secondary","bg-accent","bg-chart-1"];return N[u%N.length]};return(0,qr.jsxs)("div",{className:"space-y-1",children:[(n||t.length>0)&&(0,qr.jsxs)(_o.motion.div,{className:`group flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ${s?"bg-card shadow-sm border border-border":"hover:bg-muted/50 hover:shadow-sm"}`,style:{marginLeft:`${o*20}px`},onClick:()=>c(!s),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,qr.jsx)("div",{className:`w-1 h-6 rounded-full ${h(o)}`}),(0,qr.jsx)(_o.motion.div,{animate:{rotate:s?90:0},transition:{duration:.2},className:"flex-shrink-0",children:(0,qr.jsx)(Tt.ChevronRight,{className:"h-4 w-4 text-muted-foreground"})}),(0,qr.jsxs)("div",{className:"flex-1 flex items-center justify-between min-w-0",children:[(0,qr.jsx)("div",{className:"flex items-center gap-2 min-w-0",children:(0,qr.jsx)("span",{className:"font-medium text-foreground truncate",children:e})}),m&&l>0&&(0,qr.jsx)("div",{className:"flex-shrink-0 ml-2",children:(0,qr.jsx)("span",{className:"inline-flex items-center justify-center w-6 h-6 text-_o font-medium bg-muted text-muted-foreground rounded-full",children:l})})]})]}),(0,qr.jsx)(_o.motion.div,{initial:!1,animate:{height:s?"auto":0,opacity:s?1:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:(0,qr.jsxs)("div",{className:"pt-2 space-y-1",children:[t.map((u,N)=>(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:N*.05,duration:.2},className:`group flex items-center gap-3 p-2.5 mx-2 rounded-lg cursor-pointer transition-all duration-150 ${r===u.id?"bg-primary/10 border-l-2 border-primary shadow-sm":"hover:bg-muted/50 hover:translate-x-1"}`,style:{marginLeft:`${o*20+20}px`},onClick:()=>i?.(u),whileHover:{scale:1.01},whileTap:{scale:.99},children:[(0,qr.jsx)("div",{className:"flex-shrink-0",children:p(u.format)}),(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsx)("p",{className:`text-sm truncate transition-colors ${r===u.id?"text-primary font-medium":"text-foreground group-hover:text-foreground"}`,children:u.title}),u.description&&(0,qr.jsx)("p",{className:"text-_o text-muted-foreground truncate qr-0.5",children:u.description})]}),u.tags&&u.tags.length>0&&(0,qr.jsx)("div",{className:"flex-shrink-0",children:(0,qr.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-md text-_o font-medium bg-muted text-muted-foreground group-hover:bg-muted/80 transition-colors",children:u.tags[0]})})]},u.id)),a&&Object.entries(a).map(([u,N])=>(0,qr.jsx)(Ti,{label:u,documents:N.documents,children:N.children,level:o+1,onDocumentClick:i,selectedDocumentId:r,showDocumentCount:m},u))]})})]})}function Ri({documents:e,menuConfig:t,onDocumentClick:a,onDocumentShare:o,onDocumentUpdate:i,selectedDocumentId:r,className:m,editable:s=!0}){let[c,n]=(0,Ht.useState)(""),[l,p]=(0,Ht.useState)(null),h=(0,Ht.useMemo)(()=>c?e.filter(x=>x.title.toLowerCase().includes(c.toLowerCase())||x.description?.toLowerCase().includes(c.toLowerCase())||x.tags?.some(f=>f.toLowerCase().includes(c.toLowerCase()))||Object.values(x.metadata||{}).some(f=>String(f).toLowerCase().includes(c.toLowerCase()))):e,[e,c]),u=(0,Ht.useMemo)(()=>{let x=(f,P)=>{if(P.length===0)return{};let[A,...V]=P;return f.reduce((S,B)=>{let ve=B.metadata?.[A]||"Uncategorized",D=String(ve);if(S[D]||(S[D]={documents:[],children:{}}),V.length===0)S[D].documents.push(B);else{let te=x([B],V),R=Object.keys(te)[0];R&&(S[D].children||(S[D].children={}),S[D].children[R]?S[D].children[R].documents.push(...te[R].documents):S[D].children[R]=te[R])}return S},{})};return x(h,t.groupBy)},[h,t.groupBy]),N=x=>{p(x),a?.(x)};return(0,qr.jsxs)("div",{className:`flex h-full ${m||""}`,children:[(0,qr.jsxs)("div",{className:"w-1/3 border-r border-border bg-muted/20",children:[(0,qr.jsx)("div",{className:"p-6 border-b border-border",children:(0,qr.jsxs)("div",{className:"relative",children:[(0,qr.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,qr.jsx)(Tt.Search,{className:"h-4 w-4 text-muted-foreground"})}),(0,qr.jsx)(O,{placeholder:"Search knowledge base...",value:c,onChange:x=>n(x.target.value),className:"pl-10 bg-background/80 border-border focus:border-primary/50 focus:ring-primary/20 rounded-xl h-11 text-sm placeholder:text-muted-foreground"})]})}),(0,qr.jsx)(Wa,{className:"h-[calc(100%-100px)]",children:(0,qr.jsxs)("div",{className:"p-4 space-y-3",children:[Object.entries(u).map(([x,f])=>(0,qr.jsx)(Ti,{label:x,documents:f.documents,children:f.children,level:0,onDocumentClick:N,selectedDocumentId:r,showDocumentCount:t.showDocumentCount},x)),Object.keys(u).length===0&&(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-12",children:[(0,qr.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-muted flex items-center justify-center",children:(0,qr.jsx)(Tt.FileText,{className:"h-8 w-8 text-muted-foreground"})}),(0,qr.jsx)("p",{className:"text-sm font-medium",children:"_o documents found"}),(0,qr.jsx)("p",{className:"text-_o qr-1",children:"Try adjusting your search terms"})]})]})})]}),(0,qr.jsx)("div",{className:"flex-1 bg-background",children:l?(0,qr.jsx)(Pi,{document:l,onDocumentUpdate:i,editable:s}):(0,qr.jsx)("div",{className:"h-full flex items-center justify-center text-center",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"max-w-sm",children:[(0,qr.jsx)("div",{className:"w-20 h-20 mx-auto mb-6 rounded-full bg-primary/10 flex items-center justify-center",children:(0,qr.jsx)(Tt.FileText,{className:"h-10 w-10 text-primary"})}),(0,qr.jsx)("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Select a document"}),(0,qr.jsx)("p",{className:"text-muted-foreground leading-relaxed",children:"Choose any document from the knowledge base to view its content and details"})]})})})]})}function Yo({documents:e=[],contexts:t=[],onDocumentClick:a=m=>console.log("Document clicked:",m),onDocumentShare:o=m=>console.log("Share document:",m),onLoadDocumentContent:i,selectedDocumentId:r}){let[m,s]=(0,Ht.useState)(t[0]);return!t||t.length===0?(0,qr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,qr.jsx)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:(0,qr.jsx)(st,{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,qr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4 flex items-center justify-center",children:(0,qr.jsx)("p",{className:"text-muted-foreground",children:"_o contexts available"})})]}):(0,qr.jsxs)("div",{className:"flex flex-col h-full max-h-[calc(100vh-8rem)]",children:[(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 flex-shrink-0",children:[(0,qr.jsx)(st,{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,qr.jsxs)("div",{className:"qr-6",children:[(0,qr.jsx)("div",{className:"border-b border-border",children:(0,qr.jsx)("nav",{className:"-mb-px flex space-x-8 overflow-x-auto",children:t.map(c=>(0,qr.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,qr.jsx)("div",{className:"qr-3 px-1",children:(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:m.description})})]})]}),(0,qr.jsx)("div",{className:"flex-1 min-h-0 px-2 md:px-4 pb-4",children:(0,qr.jsx)("div",{className:"h-full rounded-3xl border overflow-hidden",children:(0,qr.jsx)(Ri,{documents:e,menuConfig:m.menuConfig,onDocumentClick:a,onDocumentShare:o,selectedDocumentId:r})})})]})}var ue=be(require("react"));var Ii=(e=768)=>{let[t,a]=(0,Ht.useState)(!1);return(0,Ht.useEffect)(()=>{let o=()=>{a(window.innerWidth<e)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[e]),t};var Ai=be(require("react")),Zo=be(require("@radix-ui/react-separator"));var Qo=Ai.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...o},i)=>(0,qr.jsx)(Zo.Root,{ref:i,decorative:a,orientation:t,className:b("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));Qo.displayName=Zo.Root.displayName;var Za=be(require("react")),dt=be(require("@radix-ui/react-dialog"));var Li=dt.Root;var qn=dt.Portal,ji=Za.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(dt.Overlay,{className:b("fixed inset-0 qr-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:a}));ji.displayName=dt.Overlay.displayName;var Xn=(0,Gr.cva)("fixed qr-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),er=Za.forwardRef(({side:e="right",className:t,children:a,...o},i)=>(0,qr.jsxs)(qn,{children:[(0,qr.jsx)(ji,{}),(0,qr.jsxs)(dt.Content,{ref:i,className:b(Xn({side:e}),t),...o,children:[(0,qr.jsxs)(dt.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,qr.jsx)(Ea.Cross2Icon,{className:"h-4 w-4"}),(0,qr.jsx)("span",{className:"sr-only",children:"Close"})]}),a]})]}));er.displayName=dt.Content.displayName;var Jn=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col space-y-2 text-center sm:text-left",e),...t});Jn.displayName="SheetHeader";var Yn=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Yn.displayName="SheetFooter";var Zn=Za.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(dt.Title,{ref:a,className:b("text-lg font-semibold text-foreground",e),...t}));Zn.displayName=dt.Title.displayName;var Qn=Za.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(dt.Description,{ref:a,className:b("text-sm text-muted-foreground",e),...t}));Qn.displayName=dt.Description.displayName;function tr({className:e,...t}){return(0,qr.jsx)("div",{className:b("animate-pulse rounded-md bg-primary/10",e),...t})}var Hi=be(require("react")),Vt=be(require("@radix-ui/react-tooltip"));var zi=Vt.Provider,Vi=Vt.Root,Ui=Vt.Trigger,or=Hi.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,qr.jsx)(Vt.Portal,{children:(0,qr.jsx)(Vt.Content,{ref:o,sideOffset:t,className:b("qr-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-_o text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));or.displayName=Vt.Content.displayName;var el="sidebar:state",tl=60*60*24*7,al="16rem",ol="18rem",rl="3rem",il="b",_i=ue.createContext(null);function Do(){let e=ue.useContext(_i);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}var rr=ue.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:a,className:o,style:i,children:r,...m},s)=>{let c=Ii(),[n,l]=ue.useState(!1),[p,h]=ue.useState(e),u=t??p,N=ue.useCallback(A=>{if(a)return a?.(typeof A=="function"?A(u):A);h(A),document.cookie=`${el}=${u}; path=/; max-age=${tl}`},[a,u]),x=ue.useCallback(()=>c?l(A=>!A):N(A=>!A),[c,N,l]);ue.useEffect(()=>{let A=V=>{V.key===il&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),x())};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[x]);let f=u?"expanded":"collapsed",P=ue.useMemo(()=>({state:f,open:u,setOpen:N,isMobile:c,openMobile:n,setOpenMobile:l,toggleSidebar:x}),[f,u,N,c,n,l,x]);return(0,qr.jsx)(_i.Provider,{value:P,children:(0,qr.jsx)(zi,{delayDuration:0,children:(0,qr.jsx)("div",{style:{"--sidebar-width":al,"--sidebar-width-icon":rl,...i},className:b("group/sidebar-wrapper flex w-full has-[[data-variant=inset]]:bg-sidebar",o),ref:s,...m,children:r})})})});rr.displayName="SidebarProvider";var sl=ue.forwardRef(({side:e="left",variant:t="sidebar",collapsible:a="offcanvas",className:o,children:i,...r},m)=>{let{isMobile:s,state:c,openMobile:n,setOpenMobile:l}=Do();return a==="none"?(0,qr.jsx)("div",{className:b("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),ref:m,...r,children:i}):s?(0,qr.jsx)(Li,{open:n,onOpenChange:l,...r,children:(0,qr.jsx)(er,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":ol},side:e,children:(0,qr.jsx)("div",{className:"flex h-full w-full flex-col",children:i})})}):(0,qr.jsxs)("div",{ref:m,className:"group peer hidden md:block text-sidebar-foreground","data-state":c,"data-collapsible":c==="collapsed"?a:"","data-variant":t,"data-side":e,children:[(0,qr.jsx)("div",{className:b("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)qr+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),(0,qr.jsx)("div",{className:b("duration-200 fixed top-14 bottom-0 qr-10 hidden w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)qr+_theme(spacing.4)qr+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...r,children:(0,qr.jsx)("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:i})})]})});sl.displayName="Sidebar";var nl=ue.forwardRef(({className:e,onClick:t,...a},o)=>{let{toggleSidebar:i}=Do();return(0,qr.jsxs)(w,{ref:o,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:b("h-7 w-7",e),onClick:r=>{t?.(r),i()},...a,children:[(0,qr.jsx)(Tt.PanelLeft,{}),(0,qr.jsx)("span",{className:"sr-only",children:"Toggle Sidebar"})]})});nl.displayName="SidebarTrigger";var ll=ue.forwardRef(({className:e,...t},a)=>{let{toggleSidebar:o}=Do();return(0,qr.jsx)("button",{ref:a,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:b("absolute inset-y-0 qr-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]qr&]:cursor-w-resize [[data-side=right]qr&]:cursor-e-resize","[[data-side=left][data-state=collapsed]qr&]:cursor-e-resize [[data-side=right][data-state=collapsed]qr&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]qr&]:-right-2","[[data-side=right][data-collapsible=offcanvas]qr&]:-left-2",e),...t})});ll.displayName="SidebarRail";var dl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("main",{ref:a,className:b("flex flex-1 flex-col bg-background overflow-y-auto relative max-h-full","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));dl.displayName="SidebarInset";var cl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(O,{ref:a,"data-sidebar":"input",className:b("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));cl.displayName="SidebarInput";var ml=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"header",className:b("flex flex-col gap-2 p-2",e),...t}));ml.displayName="SidebarHeader";var pl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"footer",className:b("flex flex-col gap-2 p-2",e),...t}));pl.displayName="SidebarFooter";var ul=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(Qo,{ref:a,"data-sidebar":"separator",className:b("mx-2 w-auto bg-sidebar-border",e),...t}));ul.displayName="SidebarSeparator";var gl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"content",className:b("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));gl.displayName="SidebarContent";var fl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"group",className:b("relative flex w-full min-w-0 flex-col p-2",e),...t}));fl.displayName="SidebarGroup";var vl=ue.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,qr.jsx)(t?_r.Slot:"div",{ref:o,"data-sidebar":"group-label",className:b("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-_o font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-qr-8 group-data-[collapsible=icon]:opacity-0",e),...a}));vl.displayName="SidebarGroupLabel";var bl=ue.forwardRef(({className:e,asChild:t=!1,...a},o)=>(0,qr.jsx)(t?_r.Slot:"button",{ref:o,"data-sidebar":"group-action",className:b("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...a}));bl.displayName="SidebarGroupAction";var hl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"group-content",className:b("w-full text-sm",e),...t}));hl.displayName="SidebarGroupContent";var xl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("ul",{ref:a,"data-sidebar":"menu",className:b("flex w-full min-w-0 flex-col gap-1",e),...t}));xl.displayName="SidebarMenu";var yl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("qr",{ref:a,"data-sidebar":"menu-item",className:b("group/menu-item relative",e),...t}));yl.displayName="SidebarMenuItem";var wl=(0,$i.cva)("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-_o",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Nl=ue.forwardRef(({asChild:e=!1,isActive:t=!1,variant:a="default",size:o="default",tooltip:i,className:r,...m},s)=>{let c=e?_r.Slot:"button",{isMobile:n,state:l}=Do(),p=(0,qr.jsx)(c,{ref:s,"data-sidebar":"menu-button","data-size":o,"data-active":t,className:b(wl({variant:a,size:o}),r),...m});return i?(typeof i=="string"&&(i={children:i}),(0,qr.jsxs)(Vi,{children:[(0,qr.jsx)(Ui,{asChild:!0,children:p}),(0,qr.jsx)(or,{side:"right",align:"center",hidden:l!=="collapsed"||n,...i})]})):p});Nl.displayName="SidebarMenuButton";var Cl=ue.forwardRef(({className:e,asChild:t=!1,showOnHover:a=!1,...o},i)=>(0,qr.jsx)(t?_r.Slot:"button",{ref:i,"data-sidebar":"menu-action",className:b("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",a&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...o}));Cl.displayName="SidebarMenuAction";var Sl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("div",{ref:a,"data-sidebar":"menu-badge",className:b("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-_o font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Sl.displayName="SidebarMenuBadge";var kl=ue.forwardRef(({className:e,showIcon:t=!1,...a},o)=>{let i=ue.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,qr.jsxs)("div",{ref:o,"data-sidebar":"menu-skeleton",className:b("rounded-md h-8 flex gap-2 px-2 items-center",e),...a,children:[t&&(0,qr.jsx)(tr,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),(0,qr.jsx)(tr,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});kl.displayName="SidebarMenuSkeleton";var Dl=ue.forwardRef(({className:e,...t},a)=>(0,qr.jsx)("ul",{ref:a,"data-sidebar":"menu-sub",className:b("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Dl.displayName="SidebarMenuSub";var Pl=ue.forwardRef(({...e},t)=>(0,qr.jsx)("qr",{ref:t,...e}));Pl.displayName="SidebarMenuSubItem";var Tl=ue.forwardRef(({asChild:e=!1,size:t="md",isActive:a,className:o,...i},r)=>(0,qr.jsx)(e?_r.Slot:"a",{ref:r,"data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:b("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-_o",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),...i}));Tl.displayName="SidebarMenuSubButton";var Gi=({projects:e,epics:t,sprints:a,currentView:o,onUpdateProject:i,onDeleteProject:r,onAddProject:m,onUpdateEpic:s,onDeleteEpic:c,onAddEpic:n,onViewChange:l,mobileMenuOpen:p,onToggleMobileMenu:h})=>{let[u,N]=(0,Ht.useState)(null),[x,f]=(0,Ht.useState)(null),[P,A]=(0,Ht.useState)(null),[V,J]=(0,Ht.useState)({name:"",description:""}),[S,B]=(0,Ht.useState)({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0}),[ve,D]=(0,Ht.useState)(!1),[te,R]=(0,Ht.useState)({name:"",description:""}),we=["bg-brand-blue","bg-brand-green","bg-brand-plum","bg-brand-orange","bg-destructive","bg-warning","bg-brand-cyan","bg-accent"],q=[{value:"low",label:"Low",color:"text-destructive"},{value:"medium",label:"Medium",color:"text-warning"},{value:"high",label:"High",color:"text-success"}],M=[{value:1,label:"Phase 1",color:"text-brand-blue"},{value:2,label:"Phase 2",color:"text-brand-plum"},{value:3,label:"Phase 3",color:"text-brand-orange"},{value:4,label:"Phase 4",color:"text-brand-green"},{value:5,label:"Phase 5",color:"text-destructive"},{value:6,label:"Phase 6",color:"text-warning"},{value:7,label:"Phase 7",color:"text-brand-cyan"},{value:8,label:"Phase 8",color:"text-accent"},{value:9,label:"Phase 9",color:"text-muted-foreground"}],ne=I=>{f(I.id),J({name:I.name,description:I.description||""})},$e=()=>{x&&V.name.trim()&&(i(x,{name:V.name.trim(),description:V.description.trim()}),f(null))},Ae=()=>{f(null),J({name:"",description:""})},ke=()=>{te.name.trim()&&(m({name:te.name.trim(),description:te.description.trim(),isSelected:!1}),R({name:"",description:""}),D(!1))},ut=I=>{i(I,{isSelected:!0})},pt=I=>{A(I.id),B({name:I.name,description:I.description||"",color:I.color,confidence:I.confidence,phase:I.phase,startDate:I.startDate.toISOString().split("T")[0],endDate:I.endDate.toISOString().split("T")[0],progress:I.progress})},Dt=()=>{P&&S.name.trim()&&(s(P,{name:S.name.trim(),description:S.description.trim(),color:S.color,confidence:S.confidence,phase:S.phase,startDate:new Date(S.startDate),endDate:new Date(S.endDate),progress:S.progress}),A(null))},Ke=()=>{A(null),B({name:"",description:"",color:"",confidence:"medium",phase:1,startDate:"",endDate:"",progress:0})},qe=I=>I.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),Nt=I=>{let $=q.find(C=>C.value===I);return $?{label:$.label,color:$.color}:{label:"Medium",color:"text-warning"}},ft=I=>{let $=M.find(C=>C.value===I);return $?{label:$.label,color:$.color}:{label:"Phase 1",color:"text-primary"}};return(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)("div",{className:`absolute h-full w-12 bg-sidebar-background flex flex-col qr-50 flex-shrink-0 transition-transform duration-300 group ${p?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:(0,qr.jsxs)("div",{className:"flex-1 flex flex-col",children:[(0,qr.jsxs)("button",{onClick:()=>{l("kanban"),N(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="kanban"?"bg-primary":"bg-primary/75 hover:bg-primary"} hover:w-28 hover:justify-start hover:pl-3`,title:"Kanban View",children:[(0,qr.jsx)(Tt.Kanban,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-_o font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Kanban"})]}),(0,qr.jsxs)("button",{onClick:()=>{l("planning"),N(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="planning"?"bg-brand-plum":"bg-brand-plum/75 hover:bg-brand-plum"} hidden md:flex hover:w-28 hover:justify-start hover:pl-3`,title:"Planning View",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-_o font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Planning"})]}),(0,qr.jsxs)("button",{onClick:()=>{l("epics"),N(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="epics"?"bg-brand-orange":"bg-brand-orange/75 hover:bg-brand-orange"} hover:w-28 hover:justify-start hover:pl-3`,title:"Epic Planning",children:[(0,qr.jsx)(Tt.Target,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-_o font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Epics"})]}),(0,qr.jsxs)("button",{onClick:()=>{l("files"),N(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="files"?"bg-brand-green":"bg-brand-green/75 hover:bg-brand-green"} hover:w-28 hover:justify-start hover:pl-3`,title:"Files",children:[(0,qr.jsx)(Tt.FileText,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-_o font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Files"})]}),(0,qr.jsxs)("button",{onClick:()=>{l("tasks"),N(null)},className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${o==="tasks"?"bg-brand-cyan":"bg-brand-cyan/75 hover:bg-brand-cyan"} hover:w-28 hover:justify-start hover:pl-3`,title:"Tasks",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-4 w-4 flex-shrink-0"}),(0,qr.jsx)("span",{className:"text-_o font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:"Tasks"})]})]})}),p&&(0,qr.jsx)("div",{className:"md:hidden fixed inset-0 bg-background/80 backdrop-blur-sm qr-20",onClick:h}),u&&(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm qr-40",onClick:()=>N(null)}),(0,qr.jsxs)("div",{className:"absolute left-12 w-80 md:w-96 bg-card shadow-lg qr-40 transform transition-transform max-w-[calc(100vw-3rem)] md:max-w-none top-0 h-full",children:[(0,qr.jsxs)("div",{className:"p-3 md:p-4 border-b flex items-center justify-between",children:[(0,qr.jsxs)("h2",{className:"text-base md:text-lg font-semibold",children:[u==="projects"&&"Projects",u==="epics"&&"Manage Epics"]}),(0,qr.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>N(null),children:(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"})})]}),(0,qr.jsxs)("div",{className:"p-3 md:p-4 space-y-4 h-full overflow-y-auto",children:[u==="projects"&&(0,qr.jsx)(L,{className:"p-3",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("h3",{className:"font-medium text-foreground",children:"Projects"}),(0,qr.jsxs)(w,{size:"sm",onClick:()=>D(!0),className:"gap-1",children:[(0,qr.jsx)(Tt.Plus,{className:"h-3 w-3"}),"Add Project"]})]}),ve&&(0,qr.jsxs)("div",{className:"border rounded-lg p-2 space-y-2",children:[(0,qr.jsx)(O,{value:te.name,onChange:I=>R($=>({...$,name:I.target.value})),placeholder:"Project name",className:"text-sm"}),(0,qr.jsx)(Ne,{value:te.description,onChange:I=>R($=>({...$,description:I.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(w,{size:"sm",onClick:ke,className:"text-_o h-6",children:"Save"}),(0,qr.jsx)(w,{size:"sm",variant:"outline",onClick:()=>D(!1),className:"text-_o h-6",children:"Cancel"})]})]}),(0,qr.jsx)("div",{className:"space-y-2",children:e.map(I=>(0,qr.jsx)("div",{className:"border rounded p-2",children:x===I.id?(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(O,{value:V.name,onChange:$=>J(C=>({...C,name:$.target.value})),placeholder:"Project name",className:"text-sm"}),(0,qr.jsx)(Ne,{value:V.description,onChange:$=>J(C=>({...C,description:$.target.value})),placeholder:"Project description",rows:2,className:"text-sm"}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(w,{size:"sm",onClick:$e,className:"text-_o h-6",children:"Save"}),(0,qr.jsx)(w,{size:"sm",variant:"outline",onClick:Ae,className:"text-_o h-6",children:"Cancel"})]})]}):(0,qr.jsxs)("div",{className:`cursor-pointer p-1 rounded transition-colors ${I.isSelected?"bg-primary/10 border-primary ring-2 ring-primary/20":"hover:bg-muted"}`,onClick:()=>ut(I.id),children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,qr.jsx)(Tt.FolderOpen,{className:"h-3 w-3 text-muted-foreground"}),(0,qr.jsx)("span",{className:"font-medium text-_o",children:I.name})]}),I.description&&(0,qr.jsx)("p",{className:"text-_o text-muted-foreground mb-1",children:I.description}),(0,qr.jsxs)("div",{className:"flex gap-1",onClick:$=>$.stopPropagation(),children:[(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>ne(I),className:"h-5 px-1",children:(0,qr.jsx)(Tt.Edit2,{className:"h-3 w-3"})}),(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>r(I.id),className:"h-5 px-1 text-destructive hover:text-destructive",children:(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"})})]})]})},I.id))})]})}),u==="epics"&&(0,qr.jsx)(L,{className:"p-3",children:(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("h3",{className:"font-medium text-foreground",children:"Epics"}),(0,qr.jsxs)(w,{size:"sm",onClick:n,className:"gap-1",children:[(0,qr.jsx)(Tt.Plus,{className:"h-3 w-3"}),"Add Epic"]})]}),(0,qr.jsx)("div",{className:"space-y-4",children:t.map(I=>(0,qr.jsx)("div",{className:"border rounded-lg p-3",children:P===I.id?(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsx)(O,{value:S.name,onChange:$=>B(C=>({...C,name:$.target.value})),placeholder:"Epic name",className:"text-sm"}),(0,qr.jsx)(Ne,{value:S.description,onChange:$=>B(C=>({...C,description:$.target.value})),placeholder:"Epic description",rows:2,className:"text-sm"}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"Color"}),(0,qr.jsx)("div",{className:"flex gap-1 flex-wrap",children:we.map($=>(0,qr.jsx)("button",{onClick:()=>B(C=>({...C,color:$})),className:`w-6 h-6 rounded-full ${$} ${S.color===$?"ring-2 ring-ring":""}`},$))})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"Confidence"}),(0,qr.jsx)("select",{value:S.confidence,onChange:$=>B(C=>({...C,confidence:$.target.value})),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-_o 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:q.map($=>(0,qr.jsx)("option",{value:$.value,children:$.label},$.value))})]}),(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"Phase"}),(0,qr.jsx)("select",{value:S.phase.toString(),onChange:$=>B(C=>({...C,phase:parseInt($.target.value)})),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-_o 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:M.map($=>(0,qr.jsx)("option",{value:$.value.toString(),children:$.label},$.value))})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"Start Date"}),(0,qr.jsx)(O,{type:"date",value:S.startDate,onChange:$=>B(C=>({...C,startDate:$.target.value})),className:"text-_o h-8"})]}),(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"End Date"}),(0,qr.jsx)(O,{type:"date",value:S.endDate,onChange:$=>B(C=>({...C,endDate:$.target.value})),className:"text-_o h-8"})]})]}),(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)("label",{className:"text-_o font-medium",children:"Progress (%)"}),(0,qr.jsx)(O,{type:"number",min:"0",max:"100",value:S.progress,onChange:$=>B(C=>({...C,progress:parseInt($.target.value)||0})),className:"text-_o h-8"})]}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsx)(w,{size:"sm",onClick:Dt,className:"text-_o",children:"Save"}),(0,qr.jsx)(w,{size:"sm",variant:"outline",onClick:Ke,className:"text-_o",children:"Cancel"})]})]}):(0,qr.jsxs)("div",{className:`cursor-pointer p-2 rounded transition-colors ${I.isSelected?"bg-primary/10 border-primary":"hover:bg-muted"}`,onClick:()=>s(I.id,{isSelected:!I.isSelected}),children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${I.color}`}),(0,qr.jsx)("span",{className:"font-medium text-sm",children:I.name})]}),I.description&&(0,qr.jsx)("p",{className:"text-_o text-muted-foreground mb-2",children:I.description}),(0,qr.jsxs)("div",{className:"space-y-1 mb-2",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Confidence:"}),(0,qr.jsx)("span",{className:Nt(I.confidence).color,children:Nt(I.confidence).label})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Phase:"}),(0,qr.jsx)("span",{className:ft(I.phase).color,children:ft(I.phase).label})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Timeline:"}),(0,qr.jsxs)("span",{className:"text-foreground",children:[qe(I.startDate)," - ",qe(I.endDate)]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o",children:[(0,qr.jsx)("span",{className:"text-muted-foreground",children:"Progress:"}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:"w-12 h-2 bg-muted rounded-full",children:(0,qr.jsx)("div",{className:"h-2 bg-primary rounded-full",style:{width:`${I.progress}%`}})}),(0,qr.jsxs)("span",{className:"text-foreground",children:[I.progress,"%"]})]})]})]}),(0,qr.jsxs)("div",{className:"flex gap-1",onClick:$=>$.stopPropagation(),children:[(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>pt(I),className:"h-6 px-2",children:(0,qr.jsx)(Tt.Edit2,{className:"h-3 w-3"})}),(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>c(I.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"})})]})]})},I.id))})]})})]})]})]})]})},Wi=e=>(0,qr.jsx)(rr,{children:(0,qr.jsxs)("div",{className:"flex w-full h-full",children:[(0,qr.jsx)("div",{className:"hidden md:block w-12 fixed h-full",children:(0,qr.jsx)(Gi,{...e})}),(0,qr.jsx)("div",{className:"md:hidden",children:(0,qr.jsx)(Gi,{...e})}),(0,qr.jsx)("div",{className:"flex-1 min-w-0 ml-16 px-4 md:px-6 h-full",children:(0,qr.jsx)("div",{className:"w-full h-full",children:e.children})})]})});var qi=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1,height:m})=>{let s=l=>{l.preventDefault()},c=l=>{l.preventDefault(),i(t)};return(0,qr.jsxs)(L,{className:`p-4 bg-card border-l-4 ${(()=>{switch(t){case"todo":return"border-l-gray-400";case"in-progress":return"border-l-blue-500";case"review":return"border-l-orange-500";case"done":return"border-l-green-500";default:return"border-l-gray-400"}})()} shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col ${r?"lg:max-w-_o":""}`,style:{height:m||"calc(100vh - 350px)"},onDragOver:s,onDrop:c,children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,qr.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,qr.jsx)(Y,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,qr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Po=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=l=>{a(e)},m=()=>{o(e)},s=()=>{switch(e.priority){case"high":return"bg-destructive/20 text-destructive border-destructive/20";case"medium":return"bg-warning/20 text-warning border-warning/20";case"low":return"bg-success/20 text-success border-success/20";default:return"bg-muted text-muted-foreground border-border"}},c=()=>{switch(e.type){case"story":return(0,qr.jsx)(Tt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,qr.jsx)(Tt.Bug,{className:"h-3 w-3"});case"spike":return(0,qr.jsx)(Tt.Zap,{className:"h-3 w-3"});case"task":default:return(0,qr.jsx)(Tt.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,qr.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,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-_o font-medium ${n()}`,children:c()}),(0,qr.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,qr.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,qr.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,qr.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${n()}`,children:[c(),(0,qr.jsx)("span",{className:"capitalize",children:e.type})]}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-_o font-medium ${s()}`,children:e.priority}),(0,qr.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-_o font-medium",children:e.points})]})]}),(0,qr.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,qr.jsx)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[(0,qr.jsx)(Tt.User,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:e.assignee?.value?.name})]})})]})};var Qa=be(require("react")),ct=be(require("@radix-ui/react-dialog"));var St=ct.Root;var Rl=ct.Portal;var Ji=Qa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ct.Overlay,{ref:a,className:b("fixed inset-0 qr-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}));Ji.displayName=ct.Overlay.displayName;var bt=Qa.forwardRef(({className:e,children:t,...a},o)=>(0,qr.jsxs)(Rl,{children:[(0,qr.jsx)(Ji,{}),(0,qr.jsxs)(ct.Content,{ref:o,className:b("fixed left-[50%] top-[50%] qr-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),...a,children:[t,(0,qr.jsxs)(ct.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,qr.jsx)(Tt.qr,{className:"h-4 w-4"}),(0,qr.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));bt.displayName=ct.Content.displayName;var ht=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ht.displayName="DialogHeader";var eo=({className:e,...t})=>(0,qr.jsx)("div",{className:b("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});eo.displayName="DialogFooter";var xt=Qa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ct.Title,{ref:a,className:b("text-lg font-semibold leading-none tracking-tight",e),...t}));xt.displayName=ct.Title.displayName;var to=Qa.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ct.Description,{ref:a,className:b("text-sm text-muted-foreground",e),...t}));to.displayName=ct.Description.displayName;var Sa=be(require("react")),Fa=be(require("@radix-ui/react-toggle-group"));var Yi=be(require("react")),ir=be(require("@radix-ui/react-toggle"));var sr=(0,Gr.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"}}),El=Yi.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,qr.jsx)(ir.Root,{ref:i,className:b(sr({variant:t,size:a,className:e})),...o}));El.displayName=ir.Root.displayName;var es=Sa.createContext({size:"default",variant:"default"}),ka=Sa.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,qr.jsx)(Fa.Root,{ref:r,className:b("flex items-center justify-center gap-1",e),...i,children:(0,qr.jsx)(es.Provider,{value:{variant:t,size:a},children:o})}));ka.displayName=Fa.Root.displayName;var Da=Sa.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let m=Sa.useContext(es);return(0,qr.jsx)(Fa.Item,{ref:r,className:b(sr({variant:m.variant||a,size:m.size||o}),e),...i,children:t})});Da.displayName=Fa.Item.displayName;var Il=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Tt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Tt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Tt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Tt.Zap}],Al=[{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"}],Ro=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:m})=>{let[s,c]=(0,Ht.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",points:1,epicId:"",sprintId:"none",assignee:""});(0,Ht.useEffect)(()=>{e&&m&&c(p=>({...p,epicId:m}))},[e,m]),(0,Ht.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()&&(a({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())},l=(p,h)=>{c(u=>({...u,[p]:h}))};return(0,qr.jsx)(St,{open:e,onOpenChange:t,children:(0,qr.jsxs)(bt,{className:"sm:max-w-md",children:[(0,qr.jsx)(ht,{children:(0,qr.jsx)(xt,{children:"Add New Task"})}),(0,qr.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",children:"Task Title"}),(0,qr.jsx)(O,{id:"name",value:s.name,onChange:p=>l("name",p.target.value),placeholder:"Enter task title",required:!0})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:s.description,onChange:p=>l("description",p.target.value),placeholder:"Enter task description",rows:3})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Type"}),(0,qr.jsx)(ka,{type:"single",value:s.type,onValueChange:p=>p&&l("type",p),children:Il.map(p=>{let h=p.icon;return(0,qr.jsxs)(Da,{value:p.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,qr.jsx)(h,{className:"h-4 w-4"}),p.label]},p.value)})})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Priority"}),(0,qr.jsx)(ka,{type:"single",value:s.priority,onValueChange:p=>p&&l("priority",p),children:Al.map(p=>(0,qr.jsx)(Da,{value:p.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:p.label},p.value))})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"points",children:"Story Points"}),(0,qr.jsx)(O,{id:"points",type:"number",min:"1",max:"100",value:s.points,onChange:p=>l("points",parseInt(p.target.value)||1),placeholder:"Enter story points",required:!0})]}),!m&&(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"epic",children:"Epic"}),(0,qr.jsxs)(ze,{value:s.epicId,onValueChange:p=>l("epicId",p),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{placeholder:"Select an epic"})}),(0,qr.jsx)(Oe,{children:o.map(p=>(0,qr.jsx)(Q,{value:p.id,children:(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${p.color}`}),p.name]})},p.id))})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,qr.jsxs)(ze,{value:s.sprintId,onValueChange:p=>l("sprintId",p),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{placeholder:"Select a sprint"})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"none",children:"_o Sprint"}),i.map(p=>(0,qr.jsx)(Q,{value:p.id,children:(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[p.name,p.isActive&&(0,qr.jsx)("span",{className:"text-_o bg-green-100 text-green-800 px-1 rounded",children:"Active"})]})},p.id))]})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"sprint",children:"Assignee"}),(0,qr.jsxs)(ze,{value:s.assignee,onValueChange:p=>l("assignee",p),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{placeholder:"Select an Assignee"})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"none",children:"_o Assignee"}),r.map(p=>(0,qr.jsx)(Q,{value:p.id,children:(0,qr.jsx)("div",{className:"flex items-center gap-2",children:p.name})},p.id))]})]})]}),(0,qr.jsxs)(eo,{children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,qr.jsx)(w,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var lr=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:m=!1})=>{let[s,c]=(0,Ht.useState)(!1),[n,l]=(0,Ht.useState)(""),p=()=>{m||(c(!0),l(t))},h=async()=>{n!==t&&await i(e,n),c(!1)},u=N=>{N.key==="Enter"&&!o||N.key==="Enter"&&N.ctrlKey&&o?h():N.key==="Escape"&&(c(!1),l(""))};return(0,qr.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,qr.jsx)(T,{children:a}),s?o?(0,qr.jsx)(Ne,{value:n,onChange:N=>l(N.target.value),onBlur:h,onKeyDown:u,autoFocus:!0,rows:4,className:"resize-none"}):(0,qr.jsx)(O,{value:n,onChange:N=>l(N.target.value),onBlur:h,onKeyPress:u,autoFocus:!0,className:"text-lg font-medium"}):(0,qr.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 ${o?"min-h-[100px]":"min-h-[40px]"} flex items-start gap-2`,children:[(0,qr.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!m&&(0,qr.jsx)(Tt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var os=({comments:e,onAddComment:t})=>{let[a,o]=(0,Ht.useState)(""),i=m=>m.split(" ").map(s=>s[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.MessageSquare,{className:"h-5 w-5"}),(0,qr.jsx)(T,{className:"text-lg font-medium",children:"Comments"}),(0,qr.jsx)(Y,{variant:"secondary",children:e.length})]}),(0,qr.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(m=>(0,qr.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,qr.jsx)(Jt,{className:"h-8 w-8 qr-1",children:(0,qr.jsx)(Yt,{className:"text-_o bg-muted text-muted-foreground",children:i(m.author)})}),(0,qr.jsxs)("div",{className:"flex-1",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,qr.jsx)("span",{className:"font-medium text-sm",children:m.author}),(0,qr.jsxs)("span",{className:"text-_o text-muted-foreground",children:[m.createdAt.toLocaleDateString()," at ",m.createdAt.toLocaleTimeString()]})]}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground",children:m.text})]})]},m.id))}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsx)(Ne,{value:a,onChange:m=>o(m.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,qr.jsx)(w,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,qr.jsx)(Tt.Send,{className:"h-4 w-4"})})]})]})};var Io=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[m,s]=(0,Ht.useState)(!1),c=o.find(l=>l.value===t);return(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:e}),(0,qr.jsxs)(ze,{value:t,onValueChange:a,open:m,onOpenChange:l=>{r||s(l)},disabled:r,children:[(0,qr.jsx)(je,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,qr.jsxs)(Y,{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,qr.jsx)("div",{className:`w-2 h-2 rounded-full ${c.color} mr-1`}),c?.label||"Select..."]})}),(0,qr.jsx)(Oe,{children:o.map(l=>(0,qr.jsx)(Q,{value:l.value,children:i&&l.color?(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.label]}):l.label},l.value))})]})]})};var is=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:m=!1})=>{let[s,c]=(0,Ht.useState)(!1),[n,l]=(0,Ht.useState)(""),p=o.find(f=>f.value===t),h=o.filter(f=>f.label.toLowerCase().includes(n.toLowerCase())),u=f=>{a(f),c(!1),l("")},N=()=>{r&&n.trim()&&!o.find(f=>f.value===n.trim())&&(a(n.trim()),c(!1),l(""))};return(0,qr.jsxs)("div",{className:"space-y-1",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:e}),(0,qr.jsxs)(ze,{value:t,onValueChange:u,open:s,onOpenChange:f=>{m||c(f)},disabled:m,children:[(0,qr.jsx)(je,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,qr.jsx)(Y,{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,qr.jsxs)(Oe,{children:[(0,qr.jsx)("div",{className:"p-2",children:(0,qr.jsx)(O,{placeholder:i,value:n,onChange:f=>l(f.target.value),onKeyDown:f=>{f.key==="Enter"&&r&&N()},className:"mb-2"})}),h.map(f=>(0,qr.jsx)(Q,{value:f.value,children:f.label},f.value)),r&&n.trim()&&!h.find(f=>f.value===n.trim())&&(0,qr.jsxs)(Q,{value:n.trim(),children:['Add "',n.trim(),'"']})]})]})]})};var Ml=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Tt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Tt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Tt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Tt.Zap}],Bl=[{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 ss=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:m,isUpdating:s=!1,isDeleting:c=!1,deleteState:n="idle",teamMembers:l})=>{let p=u=>u.split(" ").map(N=>N[0]).join("").toUpperCase(),h=()=>n==="loading"?(0,qr.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-_o gap-1",children:[(0,qr.jsx)(Tt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):n==="success"?(0,qr.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-_o gap-1",children:[(0,qr.jsx)(Tt.Check,{className:"h-3 w-3"}),"Deleted"]}):n==="error"?(0,qr.jsxs)(w,{disabled:!0,variant:"destructive",className:"w-full h-8 text-_o gap-1",children:[(0,qr.jsx)(Tt.qr,{className:"h-3 w-3"}),"Delete failed"]}):(0,qr.jsxs)(w,{onClick:m,variant:"destructive",className:"w-full h-8 text-_o gap-1",disabled:s||c,children:[(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,qr.jsxs)("div",{className:"flex flex-col h-full",children:[(0,qr.jsxs)("div",{className:"space-y-4",style:{opacity:s?.6:1},children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Status"}),(0,qr.jsx)(Io,{label:"",value:e.status,onValueChange:u=>i("status",u),options:[{value:"todo",label:"qr Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:s})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Type"}),(0,qr.jsx)(ka,{type:"single",value:e.type,onValueChange:u=>u&&i("type",u),className:"grid grid-cols-2 gap-1",disabled:s,children:Ml.map(u=>{let N=u.icon;return(0,qr.jsxs)(Da,{value:u.value,className:"flex items-center gap-1 text-_o h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:[(0,qr.jsx)(N,{className:"h-3 w-3"}),u.label]},u.value)})})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Priority"}),(0,qr.jsx)(ka,{type:"single",value:e.priority,onValueChange:u=>u&&i("priority",u),className:"grid grid-cols-3 gap-1",disabled:s,children:Bl.map(u=>(0,qr.jsx)(Da,{value:u.value,className:"text-_o h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:s,children:u.label},u.value))})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Story Points"}),(0,qr.jsx)("input",{type:"number",min:"1",max:"100",value:e.points||1,onChange:u=>i("points",u.target.value),className:"w-full h-8 px-2 text-_o 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,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Epic"}),(0,qr.jsx)(Io,{label:"",value:e.epicId,onValueChange:u=>i("epicId",u),options:(t||[]).map(u=>({value:u.id,label:u?.name,color:u.color})),showColor:!0,disabled:s})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Sprint"}),(0,qr.jsx)(Io,{label:"",value:e.sprintId||"none",onValueChange:u=>i("sprintId",u==="none"?"":u),options:[{value:"none",label:"_o Sprint"},...(a||[]).map(u=>({value:u.id,label:`${u?.name}${u.isActive?" (Active)":""}`}))],disabled:s})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{className:"text-_o text-muted-foreground",children:"Assignee"}),(0,qr.jsx)(is,{label:"",value:e.assignee?.value?.name,onValueChange:u=>i("assignee",u),options:l.map(u=>({value:`${typeof u.email=="string"?"users":"digital-colleagues"}:${u.id}`,label:u?.name})),placeholder:"Search team members...",allowCustomValue:!0,disabled:s})]})]}),(0,qr.jsxs)("div",{className:"qr-auto pt-4 space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(w,{onClick:r,variant:"outline",className:"w-full h-8 text-_o",disabled:s||c,children:"Close"}),h()]}),(0,qr.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,qr.jsx)("div",{className:"text-_o text-muted-foreground font-medium mb-2",children:"Information"}),(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("span",{className:"text-_o text-muted-foreground",children:"Logged By"}),(0,qr.jsxs)("div",{className:"flex items-center gap-1 text-_o text-muted-foreground",children:[(0,qr.jsx)(Tt.User,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:"System"})]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("span",{className:"text-_o text-muted-foreground",children:"Created"}),(0,qr.jsxs)("div",{className:"flex items-center gap-1 text-_o text-muted-foreground",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("span",{className:"text-_o text-muted-foreground",children:"Last Updated"}),(0,qr.jsxs)("div",{className:"flex items-center gap-1 text-_o text-muted-foreground",children:[(0,qr.jsx)(Tt.Clock,{className:"h-3 w-3"}),(0,qr.jsxs)("span",{children:[new Date(o).toLocaleDateString()," at"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var ns=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:m,onAddComment:s,colleagues:c})=>{let[n,l]=(0,Ht.useState)(a),[p,h]=(0,Ht.useState)(new Date),[u,N]=(0,Ht.useState)("idle"),[x,f]=(0,Ht.useState)("idle"),[P,A]=(0,Ht.useState)([]);(0,Ht.useEffect)(()=>{l(a)},[a]);let V=async(R,we)=>{if(we!==n[R]){N("loading");try{let q=await r(n.id,{[R]:we});l(q),h(new Date),N("success"),setTimeout(()=>N("idle"),1500)}catch{N("error"),setTimeout(()=>N("idle"),3e3)}}},J=async(R,we)=>{if(we!==n[R]){N("loading");try{let q=await r(n.id,{[R]:we});l(q),h(new Date),N("success"),setTimeout(()=>N("idle"),1500)}catch{N("error"),setTimeout(()=>N("idle"),3e3)}}},S=async R=>{if(s){N("loading");try{let we=await s?.({content:R,taskId:n.id});l(we),h(new Date),N("success"),setTimeout(()=>N("idle"),1500)}catch{N("error"),setTimeout(()=>N("idle"),3e3)}}},B=async()=>{f("loading");try{await m(n.id),f("success"),setTimeout(()=>{t(),f("idle")},1e3)}catch{f("error"),setTimeout(()=>f("idle"),3e3)}},ve=u!=="loading"&&x!=="loading",D=()=>{ve&&t()},te=()=>u==="loading"?(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,qr.jsx)(Tt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,qr.jsx)("span",{children:"Updating..."})]}):u==="success"?(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,qr.jsx)(Tt.Check,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:"Updated successfully"})]}):u==="error"?(0,qr.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:"Update failed"})]}):null;return(0,qr.jsx)(St,{open:e,onOpenChange:D,children:(0,qr.jsxs)(bt,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,qr.jsxs)(ht,{children:[(0,qr.jsx)(xt,{className:"sr-only",children:n.name}),(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("div",{className:"flex-1",children:te()}),!ve&&(0,qr.jsx)("div",{className:"text-_o text-muted-foreground",children:"Please wait..."})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,qr.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,qr.jsx)(lr,{fieldName:"name",value:n.name,label:"",onSave:V,className:"border-b border-border pb-3",disabled:u==="loading"}),(0,qr.jsx)(lr,{fieldName:"description",value:n.description,label:"Description",multiline:!0,onSave:V,disabled:u==="loading"}),(0,qr.jsx)(os,{comments:(n?.comments||[]).map(R=>({author:R.author.value.name,createdAt:new Date(R.timestamp),text:R.content,id:R.id})),onAddComment:S})]}),(0,qr.jsx)(ss,{task:n,epics:o,sprints:i,lastUpdated:p,onUpdateTask:J,onClose:D,onDelete:B,isUpdating:u==="loading",isDeleting:x==="loading",deleteState:x,teamMembers:c})]})]})})};var Ao=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,Ht.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=l=>{l.preventDefault(),o.name.trim()&&(a({name:o.name.trim(),description:o.description.trim(),color:o.color,confidence:o.confidence,phase:o.phase,startDate:new Date(o.startDate),endDate:new Date(o.endDate),progress:o.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=(l,p)=>{i(h=>({...h,[l]:p}))};return(0,qr.jsx)(St,{open:e,onOpenChange:t,children:(0,qr.jsxs)(bt,{className:"sm:max-w-md",children:[(0,qr.jsx)(ht,{children:(0,qr.jsx)(xt,{children:"Add New Epic"})}),(0,qr.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",children:"Epic Name"}),(0,qr.jsx)(O,{id:"name",value:o.name,onChange:l=>n("name",l.target.value),placeholder:"Enter epic name",required:!0})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:o.description,onChange:l=>n("description",l.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Color"}),(0,qr.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(l=>(0,qr.jsx)("button",{type:"button",onClick:()=>n("color",l),className:`w-8 h-8 rounded-full ${l} ${o.color===l?"ring-2 ring-gray-400":""}`},l))})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Confidence"}),(0,qr.jsxs)(ze,{value:o.confidence,onValueChange:l=>n("confidence",l),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsx)(Oe,{children:m.map(l=>(0,qr.jsx)(Q,{value:l.value,children:l.label},l.value))})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Phase"}),(0,qr.jsxs)(ze,{value:o.phase.toString(),onValueChange:l=>n("phase",parseInt(l)),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsx)(Oe,{children:s.map(l=>(0,qr.jsx)(Q,{value:l.value.toString(),children:l.label},l.value))})]})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Start Date"}),(0,qr.jsx)(O,{type:"date",value:o.startDate,onChange:l=>n("startDate",l.target.value)})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"End Date"}),(0,qr.jsx)(O,{type:"date",value:o.endDate,onChange:l=>n("endDate",l.target.value)})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Progress (%)"}),(0,qr.jsx)(O,{type:"number",min:"0",max:"100",value:o.progress,onChange:l=>n("progress",parseInt(l.target.value)||0)})]}),(0,qr.jsxs)(eo,{children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,qr.jsx)(w,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var ds=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:m,onUpdateTask:s,onDeleteTask:c,onTaskClick:n,onAddEpic:l,onAddComment:p})=>{let[h,u]=(0,Ht.useState)(e),[N,x]=(0,Ht.useState)(t),[f,P]=(0,Ht.useState)(a),[A,V]=(0,Ht.useState)(!1),[J,S]=(0,Ht.useState)(!1),[B,ve]=(0,Ht.useState)(null),[D,te]=(0,Ht.useState)(null),[R,we]=(0,Ht.useState)(o),[q,M]=(0,Ht.useState)(i),[ne,$e]=(0,Ht.useState)(0),Ae=(0,Ht.useRef)(null),ke=(0,Ht.useRef)(null),ut=N.filter(K=>!0).map(K=>K.id),pt=f.find(K=>K.isSelected);ut.push("no-epic"),(0,Ht.useEffect)(()=>{u(e)},[e]),(0,Ht.useEffect)(()=>{x(t)},[t]),(0,Ht.useEffect)(()=>{P(a)},[a]),(0,Ht.useEffect)(()=>{let K=()=>{if(Ae.current){let at=Ae.current.offsetHeight;$e(at)}};K();let Ce=new ResizeObserver(K);Ae.current&&Ce.observe(Ae.current);let Re=()=>{setTimeout(K,100)};return window.addEventListener("storage",Re),()=>{Ce.disconnect(),window.removeEventListener("storage",Re)}},[]),(0,Ht.useEffect)(()=>{let K=setTimeout(()=>{Ae.current&&$e(Ae.current.offsetHeight)},300);return()=>clearTimeout(K)},[A,J]);let Dt=h.filter(K=>{let Ce=ut.includes(K.epicId)||!K.epicId;return!pt||pt.id==="all-tasks"?Ce:pt.id==="backlog"?Ce&&!K.sprintId:Ce&&K.sprintId===pt.id}),Ke=K=>Dt.filter(Ce=>Ce.status===K),qe=K=>{let Ce={};return N.forEach(Re=>{Ce[Re.id]=K.filter(at=>at.epicId===Re.id)}),Ce["no-epic"]=K.filter(Re=>!Re.epicId),Ce},Nt=K=>{te(K)},ft=K=>{D&&(u(Ce=>Ce.map(Re=>Re.id===D.id?{...Re,status:K}:Re)),s?.(D.id,{status:K}),te(null))},I=K=>{let Ce={...K,id:Date.now().toString(),createdAt:new Date};u(Re=>[...Re,Ce]),m?.(K)},$=async(K,Ce)=>{u(at=>at.map(y=>y.id===K?{...y,...Ce}:y)),s&&await s(K,Ce);let Re=h.find(at=>at.id===K);if(!Re)throw new Error("Task not found");return{...Re,...Ce}},C=async K=>{u(Ce=>Ce.filter(Re=>Re.id!==K)),B?.id===K&&ve(null),c&&await c(K)},He=K=>{let Ce={...K,id:Date.now().toString(),isSelected:!0};x(Re=>[...Re,Ce]),l?.(K)},Pe=K=>{ve(K),n?.(K)},It=[{id:"todo",title:"qr Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],$t=ne>0?`calc(100vh - ${ne+120}px)`:"calc(100vh - 12rem)";return(0,qr.jsxs)("div",{ref:ke,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,qr.jsx)("div",{ref:Ae,className:"flex-shrink-0",children:(0,qr.jsx)(st,{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:()=>V(!0)},secondaryAction:{label:"Add epic",onClick:()=>S(!0)}})}),(0,qr.jsx)("div",{className:"flex-1 min-h-0 qr-8",children:(0,qr.jsx)("div",{className:"h-full",style:{height:ne>0?`calc(100vh - ${ne+120}px)`:"calc(100vh - 12rem)"},children:(0,qr.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:It.map(K=>{let Ce=Ke(K.status),Re=qe(Ce);return(0,qr.jsx)(qi,{title:K.title,status:K.status,taskCount:Ce.length,onDrop:ft,isCompact:K.status==="done",height:$t,children:ut.map(at=>{let y=N.find(me=>me.id===at),U=Re[at]||[];return U.length===0?null:(0,qr.jsxs)("div",{className:"mb-6",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${y?.color}`}),(0,qr.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:y?.name||"_o Epic"}),(0,qr.jsx)(Y,{variant:"secondary",className:"text-_o",children:U.length})]})," ",(0,qr.jsx)("div",{className:"space-y-3",children:U.map(me=>(0,qr.jsx)(Po,{task:me,epic:y,onDragStart:Nt,onTaskClick:Pe,isCompact:K.status==="done"},me.id))})]},at)})},K.id)})})})}),(0,qr.jsx)(Ro,{isOpen:A,onClose:()=>V(!1),onAddTask:I,assignees:[...q,...R],epics:N,sprints:f}),(0,qr.jsx)(Ao,{isOpen:J,onClose:()=>S(!1),onAddEpic:He}),B&&(0,qr.jsx)(ns,{isOpen:!!B,onClose:()=>ve(null),initialTask:B,epics:N,sprints:f,onUpdateTask:$,onDeleteTask:C,colleagues:[...q,...R],onAddComment:p})]})};var cs=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:m,onUpdateEpic:s,onDeleteEpic:c})=>{let[n,l]=(0,Ht.useState)(null),[p,h]=(0,Ht.useState)(null),[u,N]=(0,Ht.useState)({}),[x,f]=(0,Ht.useState)(0),P=(0,Ht.useRef)(null),A=(0,Ht.useRef)(null);(0,Ht.useEffect)(()=>{let M=()=>{if(P.current){let Ae=P.current.offsetHeight;f(Ae)}};M();let ne=new ResizeObserver(M);P.current&&ne.observe(P.current);let $e=()=>{setTimeout(M,100)};return window.addEventListener("storage",$e),()=>{ne.disconnect(),window.removeEventListener("storage",$e)}},[]),(0,Ht.useEffect)(()=>{let M=setTimeout(()=>{P.current&&f(P.current.offsetHeight)},300);return()=>clearTimeout(M)},[p]);let V=M=>{l(M)},J=M=>{M.preventDefault()},S=(M,ne)=>{M.preventDefault(),n&&n.epicId!==ne&&(o(n.id,{epicId:ne}),l(null))},B=M=>e.filter(ne=>ne.epicId===M),ve=M=>{h(M.id),N({name:M.name,description:M.description,confidence:M.confidence,phase:M.phase,progress:M.progress})},D=()=>{p&&u.name&&(s(p,u),h(null),N({}))},te=()=>{h(null),N({})},R=M=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&c(M)},we=M=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[M]||`Phase ${M}`,q=M=>{switch(M){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,qr.jsxs)("div",{ref:A,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,qr.jsx)("div",{ref:P,className:"flex-shrink-0",children:(0,qr.jsx)(st,{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,qr.jsx)("div",{className:"flex-1 min-h-0 qr-8",children:(0,qr.jsx)("div",{className:"h-full overflow-y-auto",style:{height:x>0?`calc(100vh - ${x+120}px)`:"calc(100vh - 12rem)"},children:(0,qr.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(M=>{let ne=B(M.id),$e=ne.reduce((ke,ut)=>ke+ut.points,0),Ae=x>0?`calc(100vh - ${x+200}px)`:"calc(100vh - 14rem)";return(0,qr.jsxs)(L,{className:`flex flex-col ${p===M.id?"h-auto":""} bg-card shadow-sm`,style:{height:p===M.id?"auto":Ae,minHeight:"400px"},onDragOver:J,onDrop:ke=>S(ke,M.id),children:[(0,qr.jsx)("div",{className:"p-4 border-b border-border",children:p===M.id?(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)(O,{value:u.name||"",onChange:ke=>N({...u,name:ke.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,qr.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:D,className:"p-1 h-8 w-8",children:(0,qr.jsx)(Tt.Check,{className:"h-4 w-4"})}),(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:te,className:"p-1 h-8 w-8",children:(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"})})]})]}),(0,qr.jsx)(Ne,{value:u.description||"",onChange:ke=>N({...u,description:ke.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"text-_o text-muted-foreground",children:"Confidence"}),(0,qr.jsxs)("select",{value:u.confidence||M.confidence,onChange:ke=>N({...u,confidence:ke.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-_o 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,qr.jsx)("option",{value:"low",children:"Low"}),(0,qr.jsx)("option",{value:"medium",children:"Medium"}),(0,qr.jsx)("option",{value:"high",children:"High"})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"text-_o text-muted-foreground",children:"Phase"}),(0,qr.jsx)("select",{value:u.phase?.toString()||M.phase.toString(),onChange:ke=>N({...u,phase:parseInt(ke.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-_o 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(ke=>(0,qr.jsxs)("option",{value:ke.toString(),children:["Phase ",ke]},ke))})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)("label",{className:"text-_o text-muted-foreground",children:"Progress (%)"}),(0,qr.jsx)(O,{type:"number",min:"0",max:"100",value:u.progress||M.progress,onChange:ke=>N({...u,progress:parseInt(ke.target.value)||0}),className:"text-_o"})]})]}):(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,qr.jsx)("div",{className:`w-4 h-4 rounded-full ${M.color}`}),(0,qr.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:M.name}),(0,qr.jsxs)("div",{className:"flex gap-1",children:[(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>ve(M),className:"p-1 h-8 w-8",children:(0,qr.jsx)(Tt.Edit2,{className:"h-3 w-3"})}),(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>R(M.id),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"})})]})]}),(0,qr.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,qr.jsxs)(Y,{className:`text-_o ${q(M.confidence)}`,children:[M.confidence," confidence"]}),(0,qr.jsxs)(Y,{variant:"outline",className:"text-_o",children:["Phase ",M.phase]}),(0,qr.jsxs)(Y,{variant:"secondary",className:"text-_o bg-muted text-muted-foreground",children:[ne.length," tasks"]}),(0,qr.jsxs)(Y,{variant:"secondary",className:"text-_o bg-muted text-muted-foreground",children:[$e," pts"]})]}),M.description&&(0,qr.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:M.description}),(0,qr.jsxs)("div",{className:"mb-3",children:[(0,qr.jsxs)("div",{className:"flex justify-between text-_o text-muted-foreground mb-1",children:[(0,qr.jsx)("span",{className:"select-none",children:"Progress"}),(0,qr.jsxs)("span",{className:"select-none",children:[M.progress,"%"]})]}),(0,qr.jsx)("div",{className:"w-full bg-muted rounded-full h-2",children:(0,qr.jsx)("div",{className:"bg-primary h-2 rounded-full transition-all duration-300",style:{width:`${M.progress}%`}})})]}),(0,qr.jsxs)(w,{onClick:()=>r(M.id),variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,qr.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,qr.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:ne.length===0?(0,qr.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,qr.jsx)(Tt.Move,{className:"h-8 w-8 mb-2"}),(0,qr.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):ne.map(ke=>(0,qr.jsx)(Po,{task:ke,epic:M,onDragStart:V,onTaskClick:i,isCompact:!0},ke.id))})})]},M.id)})})})})]})};var ms=require("react-day-picker");function Mo({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,qr.jsx)(ms.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:b("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 pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:b(mo({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 qr-2",cell:b("relative p-0 text-center text-sm focus-within:relative focus-within:qr-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:b(mo({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},...o})}Mo.displayName="Calendar";var us=be(require("react")),Gt=be(require("@radix-ui/react-popover"));var mr=Gt.Root,pr=Gt.Trigger;var Bo=us.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,qr.jsx)(Gt.Portal,{children:(0,qr.jsx)(Gt.Content,{ref:i,align:t,sideOffset:a,className:b("qr-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),...o})}));Bo.displayName=Gt.Content.displayName;var gr=require("date-fns");var fs=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,Ht.useState)({name:"",description:"",startDate:void 0,endDate:void 0,isActive:!1}),r=s=>{s.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate,endDate:o.endDate,isActive:o.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,qr.jsx)(St,{open:e,onOpenChange:m,children:(0,qr.jsxs)(bt,{className:"sm:max-w-md",children:[(0,qr.jsx)(ht,{children:(0,qr.jsx)(xt,{children:"Add New Sprint"})}),(0,qr.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",children:"Sprint Name *"}),(0,qr.jsx)(O,{id:"name",value:o.name,onChange:s=>i(c=>({...c,name:s.target.value})),placeholder:"e.qr., Sprint 3",required:!0})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:o.description,onChange:s=>i(c=>({...c,description:s.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"Start Date *"}),(0,qr.jsxs)(mr,{children:[(0,qr.jsx)(pr,{asChild:!0,children:(0,qr.jsxs)(w,{variant:"outline",className:b("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,qr.jsx)(Tt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,gr.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,qr.jsx)(Bo,{className:"w-auto p-0",align:"start",children:(0,qr.jsx)(Mo,{mode:"single",selected:o.startDate,onSelect:s=>i(c=>({...c,startDate:s})),initialFocus:!0})})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{children:"End Date *"}),(0,qr.jsxs)(mr,{children:[(0,qr.jsx)(pr,{asChild:!0,children:(0,qr.jsxs)(w,{variant:"outline",className:b("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,qr.jsx)(Tt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,gr.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,qr.jsx)(Bo,{className:"w-auto p-0",align:"start",children:(0,qr.jsx)(Mo,{mode:"single",selected:o.endDate,onSelect:s=>i(c=>({...c,endDate:s})),initialFocus:!0,disabled:s=>o.startDate?s<o.startDate:!1})})]})]})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"isActive",checked:o.isActive,onChange:s=>i(c=>({...c,isActive:s.target.checked})),className:"rounded border-gray-300"}),(0,qr.jsx)(T,{htmlFor:"isActive",children:"Set Ht active sprint"})]}),(0,qr.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:m,children:"Cancel"}),(0,qr.jsx)(w,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Fo=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r,onUpdateSprint:m,onDeleteSprint:s})=>{let[c,n]=(0,Ht.useState)([]),[l,p]=(0,Ht.useState)(new Set),[h,u]=(0,Ht.useState)(null),[N,x]=(0,Ht.useState)(!1),[f,P]=(0,Ht.useState)(null),[A,V]=(0,Ht.useState)(null),[J,S]=(0,Ht.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[B,ve]=(0,Ht.useState)("upcoming"),[D,te]=(0,Ht.useState)(!1),[R,we]=(0,Ht.useState)(0),q=(0,Ht.useRef)(null),M=(0,Ht.useRef)(null);(0,Ht.useEffect)(()=>{let y=()=>{q.current&&we(q.current.offsetHeight)};y();let U=new ResizeObserver(y);return q.current&&U.observe(q.current),()=>U.disconnect()},[]);let ne=y=>t.find(U=>U.id===y),$e=y=>a.find(U=>U.id===y),Ae=y=>{let U={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 U[y]||U.medium},ke=y=>{let U=y.trim().split(" ");if(U.length===1)return U[0];let me=U[0],De=U[U.length-1][0].toUpperCase();return`${me} ${De}`},ut=y=>{let U={},me=[];return y.forEach(De=>{De.epicId?(U[De.epicId]||(U[De.epicId]=[]),U[De.epicId].push(De)):me.push(De)}),{tasksByEpic:U,unassignedTasks:me}},pt=a.filter(y=>y.id!=="backlog"&&y.id!=="all-tasks"),Dt=pt.filter(y=>{switch(B){case"active":return y.isActive;case"upcoming":return!y.isActive;default:return!0}}),Ke=pt.filter(y=>c.includes(y.id)),qe=e.filter(y=>!y.sprintId||y.sprintId==="backlog"||y.sprintId==="Backlog"),Nt=qe.reduce((y,U)=>y+(U.points||0),0),ft=y=>{n(U=>U.includes(y)?U.filter(me=>me!==y):U.length<3?[...U,y]:U)},I=y=>{p(U=>{let me=new Set(U);return me.has(y)?me.delete(y):me.add(y),me})},$=y=>{r(y),x(!1)},C=y=>{V(y.id),S({name:y.name,description:y.description||"",startDate:y.startDate instanceof Date?y.startDate.toISOString().split("T")[0]:y.startDate,endDate:y.endDate instanceof Date?y.endDate.toISOString().split("T")[0]:y.endDate,isActive:y.isActive})},He=()=>{A&&(m(A,{name:J.name,description:J.description,startDate:new Date(J.startDate),endDate:new Date(J.endDate),isActive:J.isActive}),V(null))},Pe=()=>{V(null),S({name:"",description:"",startDate:"",endDate:"",isActive:!1})},It=(y,U)=>{u(U),y.dataTransfer.effectAllowed="move"},$t=y=>{y.preventDefault(),y.dataTransfer.dropEffect="move"},K=y=>{P(y)},Ce=()=>{P(null)},Re=(y,U)=>{if(y.preventDefault(),P(null),!h)return;let me=h.sprintId||void 0,De=U==="backlog"?void 0:U;me!==De&&o(h.id,{sprintId:De}),u(null)},at=({task:y,showSprint:U=!1})=>{let me=y.epicId?ne(y.epicId):null,De=y.sprintId?$e(y.sprintId):null;return(0,qr.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:vt=>{vt.dataTransfer.effectAllowed="move",vt.dataTransfer.setData("text/plain",y.id),It(vt,y)},onClick:vt=>{h===null&&i(y)},style:{userSelect:"none"},children:(0,qr.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,qr.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:y.name}),(0,qr.jsx)(Y,{className:`text-_o ${Ae(y.priority)}`,children:y.priority[0].toUpperCase()})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-_o",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-1",children:[me&&(0,qr.jsx)("div",{className:`w-2 h-2 rounded-full ${me.color}`}),(0,qr.jsx)("span",{className:"text-muted-foreground truncate",children:me?.name})]}),(0,qr.jsx)("span",{className:"text-muted-foreground",children:ke(y.assignee?.value?.name)})]}),U&&De&&(0,qr.jsxs)("div",{className:"flex items-center gap-1 text-_o text-muted-foreground",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-3 w-3"}),(0,qr.jsx)("span",{children:De.name})]})]})})};return(0,qr.jsxs)("div",{ref:M,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,qr.jsx)("div",{ref:q,className:"flex-shrink-0",children:(0,qr.jsx)(st,{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:()=>x(!0)}})}),(0,qr.jsx)("div",{className:"flex-1 min-h-0 qr-8",children:(0,qr.jsxs)("div",{className:"h-full",style:{height:R>0?`calc(100vh - ${R+120}px)`:"calc(100vh - 12rem)"},children:[(0,qr.jsxs)("div",{className:"mb-4",children:[(0,qr.jsx)(L,{className:"p-3 bg-card shadow-sm",children:(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-3",children:[(0,qr.jsx)("div",{children:(0,qr.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"})}),c.length>0&&(0,qr.jsx)("div",{className:"flex items-center gap-2",children:(0,qr.jsx)("div",{className:"flex flex-wrap gap-1",children:Ke.map(y=>(0,qr.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-_o",children:[(0,qr.jsx)("span",{className:"max-w-[80px] truncate",children:y.name}),y.isActive&&(0,qr.jsx)("span",{className:"text-success text-[10px]",children:"\u25CF"}),(0,qr.jsx)("button",{onClick:()=>ft(y.id),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"})})]},y.id))})})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsxs)(w,{onClick:()=>x(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,qr.jsx)(Tt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,qr.jsxs)(w,{onClick:()=>te(!D),variant:"outline",size:"sm",className:"gap-1",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-3 w-3"}),D?"Close":"Select"]})]})]})}),D&&(0,qr.jsx)("div",{className:"fixed inset-0 bg-black/20 qr-[5]",onClick:()=>te(!1)}),(0,qr.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl qr-10 transition-all duration-300 ease-in-out ${D?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,qr.jsxs)(L,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,qr.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,qr.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>te(!1),className:"h-8 w-8 p-0",children:(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"})})]}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground qr-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,qr.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,qr.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active",count:a.filter(y=>y.isActive).length},{key:"upcoming",label:"Upcoming",count:a.filter(y=>!y.isActive).length}].map(y=>(0,qr.jsxs)(w,{variant:B===y.key?"default":"outline",size:"sm",onClick:()=>ve(y.key),className:"text-_o h-8 px-3 flex-1",children:[y.label," (",y.count,")"]},y.key))}),(0,qr.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:Dt.length>0?Dt.map(y=>{let U=c.includes(y.id),me=e.filter(ot=>ot.sprintId===y.id).length,De=!U&&c.length<3;return(0,qr.jsx)("div",{className:`p-3 rounded-lg border transition-all ${U?"bg-primary/10 border-primary/30":De?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:A===y.id?(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsx)(O,{value:J.name,onChange:ot=>S(gt=>({...gt,name:ot.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,qr.jsx)(Ne,{value:J.description,onChange:ot=>S(gt=>({...gt,description:ot.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,qr.jsxs)("div",{className:"flex gap-2",children:[(0,qr.jsxs)(w,{size:"sm",onClick:()=>He(),className:"flex-1",children:[(0,qr.jsx)(Tt.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,qr.jsxs)(w,{size:"sm",variant:"outline",onClick:Pe,className:"flex-1",children:[(0,qr.jsx)(Tt.qr,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,qr.jsxs)("div",{children:[(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,qr.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:y.name}),y.isActive&&(0,qr.jsx)(Y,{variant:"default",className:"text-_o bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,qr.jsx)("p",{className:"text-_o text-muted-foreground line-clamp-2 mb-2",children:y.description}),(0,qr.jsxs)("div",{className:"flex items-center gap-3 text-_o text-muted-foreground",children:[(0,qr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,qr.jsx)(Tt.CalendarDays,{className:"h-3 w-3"}),new Date(y.startDate).toLocaleDateString()]}),(0,qr.jsxs)("span",{className:"flex items-center gap-1",children:[(0,qr.jsx)(Tt.User,{className:"h-3 w-3"}),me," tasks"]})]})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>C(y),className:"h-6 w-6 p-0",children:(0,qr.jsx)(Tt.Edit2,{className:"h-3 w-3"})}),y.id!=="backlog"&&y.id!=="all-tasks"&&(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>s(y.id),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"})})]})]}),(0,qr.jsx)("div",{className:"flex items-center justify-between qr-2",children:(0,qr.jsx)(w,{variant:U?"default":"outline",size:"sm",className:"text-_o w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>ft(y.id),disabled:!U&&c.length>=3,children:(0,qr.jsx)("span",{className:"pointer-events-none select-none",children:U?"Deselect":c.length>=3?"Limit Reached":"Select"})})})]})},y.id)}):(0,qr.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,qr.jsxs)("p",{className:"text-sm",children:['_o sprints found for "',B,'" filter']}),(0,qr.jsx)(w,{variant:"link",size:"sm",onClick:()=>ve("all"),className:"text-_o",children:"Show all sprints"})]})}),c.length===0&&(0,qr.jsx)("div",{className:"qr-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,qr.jsxs)("div",{className:"text-center",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,qr.jsx)("p",{className:"text-_o text-muted-foreground qr-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,qr.jsx)("div",{className:"lg:col-span-1",children:(0,qr.jsxs)(L,{className:"p-4 h-full bg-card border-l-4 border-l-gray-400 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:$t,onDragEnter:()=>K("backlog"),onDragLeave:Ce,onDrop:y=>Re(y,"backlog"),style:{height:R>0?`calc(100vh - ${R+200}px)`:"calc(100vh - 16rem)"},children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,qr.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsxs)(Y,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[qe.length," tasks"]}),(0,qr.jsxs)(Y,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[Nt," pts"]})]})]}),(0,qr.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:y,unassignedTasks:U}=ut(qe);return(0,qr.jsxs)(qr.Fragment,{children:[Object.entries(y).map(([me,De])=>{let ot=ne(me);if(!ot)return null;let gt=l.has(me);return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-_o cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>I(me),children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${ot.color}`}),(0,qr.jsx)("span",{className:"font-medium text-muted-foreground",children:ot.name}),(0,qr.jsxs)("span",{className:"text-muted-foreground",children:["(",De.length,")"]}),(0,qr.jsx)("div",{className:"ml-auto",children:gt?(0,qr.jsx)(Tt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,qr.jsx)(Tt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!gt&&(0,qr.jsx)("div",{className:"space-y-2 pl-2",children:De.map(vt=>(0,qr.jsx)(at,{task:vt},vt.id))})]},me)}),U.length>0&&(()=>{let me=l.has("no-epic");return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-_o cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>I("no-epic"),children:[(0,qr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,qr.jsx)("span",{className:"font-medium text-muted-foreground",children:"_o Epic"}),(0,qr.jsxs)("span",{className:"text-muted-foreground",children:["(",U.length,")"]}),(0,qr.jsx)("div",{className:"ml-auto",children:me?(0,qr.jsx)(Tt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,qr.jsx)(Tt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!me&&(0,qr.jsx)("div",{className:"space-y-2 pl-2",children:U.map(De=>(0,qr.jsx)(at,{task:De},De.id))})]})})(),qe.length===0&&(0,qr.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"}),qe.length>0&&Object.keys(y).length===0&&U.length===0&&(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)("div",{className:"text-_o text-muted-foreground mb-2",children:"Direct backlog tasks:"}),qe.map(me=>(0,qr.jsx)(at,{task:me},me.id))]})]})})()})]})}),Ke.map(y=>{let U=e.filter(De=>De.sprintId===y.id),me=U.reduce((De,ot)=>De+(ot.points||0),0);return(0,qr.jsxs)(L,{className:"p-4 h-full bg-card border-l-4 border-l-blue-500 shadow-sm hover:shadow-md transition-shadow duration-200 flex flex-col",onDragOver:$t,onDragEnter:()=>K(y.id),onDragLeave:Ce,onDrop:De=>Re(De,y.id),style:{height:R>0?`calc(100vh - ${R+200}px)`:"calc(100vh - 16rem)"},children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:y.name}),y.isActive&&(0,qr.jsx)("span",{className:"text-_o text-success font-medium select-none",children:"Active Sprint"})]}),(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsxs)(Y,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[U.length," tasks"]}),(0,qr.jsxs)(Y,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200",children:[me," pts"]}),(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>C(y),className:"h-6 px-2",children:(0,qr.jsx)(Tt.Edit2,{className:"h-3 w-3"})}),y.id!=="backlog"&&y.id!=="all-tasks"&&(0,qr.jsx)(w,{size:"sm",variant:"ghost",onClick:()=>s(y.id),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,qr.jsx)(Tt.Trash2,{className:"h-3 w-3"})})]})]}),(0,qr.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:De,unassignedTasks:ot}=ut(U);return(0,qr.jsxs)(qr.Fragment,{children:[Object.entries(De).map(([gt,vt])=>{let za=ne(gt);if(!za)return null;let Va=l.has(gt);return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-_o cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>I(gt),children:[(0,qr.jsx)("div",{className:`w-3 h-3 rounded-full ${za.color}`}),(0,qr.jsx)("span",{className:"font-medium text-muted-foreground",children:za.name}),(0,qr.jsxs)("span",{className:"text-muted-foreground",children:["(",vt.length,")"]}),(0,qr.jsx)("div",{className:"ml-auto",children:Va?(0,qr.jsx)(Tt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,qr.jsx)(Tt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Va&&(0,qr.jsx)("div",{className:"space-y-2 pl-2",children:vt.map(Ua=>(0,qr.jsx)(at,{task:Ua},Ua.id))})]},gt)}),ot.length>0&&(()=>{let gt=l.has("no-epic");return(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-_o cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>I("no-epic"),children:[(0,qr.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,qr.jsx)("span",{className:"font-medium text-muted-foreground",children:"_o Epic"}),(0,qr.jsxs)("span",{className:"text-muted-foreground",children:["(",ot.length,")"]}),(0,qr.jsx)("div",{className:"ml-auto",children:gt?(0,qr.jsx)(Tt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,qr.jsx)(Tt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!gt&&(0,qr.jsx)("div",{className:"space-y-2 pl-2",children:ot.map(vt=>(0,qr.jsx)(at,{task:vt},vt.id))})]})})(),U.length===0&&(0,qr.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},y.id)})]}),(0,qr.jsx)(fs,{isOpen:N,onClose:()=>x(!1),onAddSprint:$})]})})]})};var Fl=e=>{switch(e){case"high":return"\u{1F534}";case"medium":return"\u{1F7E1}";case"low":return"\u{1F7E2}";default:return"\u26AA"}},Ll=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),jl=e=>{let[t,a]=e.split(":"),o=new Date;return o.setHours(parseInt(t),parseInt(a)),o.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},fr=(e,t)=>{let a=new Date,o=new Date(e);if(t){let[i,r]=t.split(":");o.setHours(parseInt(i),parseInt(r))}return o<a},vr=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Ol=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},Hl=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,Ht.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[m,s]=(0,Ht.useState)(!1),c=l=>{l.preventDefault();let p=e.find(u=>u?.id.toString()===i.colleagueId.toString());if(!p){console.error("_o 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(u=>u.trim()):void 0};t(h),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,Ht.useEffect)(()=>{i.colleagueId&&s(!1)},[i.colleagueId]);let n=e.filter(Boolean);return(0,qr.jsx)(St,{open:a,onOpenChange:o,children:(0,qr.jsxs)(bt,{className:"max-w-2xl",children:[(0,qr.jsx)(ht,{children:(0,qr.jsx)(xt,{children:"Add New Reminder"})}),(0,qr.jsxs)("form",{onSubmit:c,className:"space-y-4",children:[(0,qr.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"title",children:"Title"}),(0,qr.jsx)(O,{id:"title",value:i.title,onChange:l=>r({...i,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:i.description,onChange:l=>r({...i,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"dueDate",children:"Due Date"}),(0,qr.jsx)(O,{id:"dueDate",type:"date",value:i.dueDate,onChange:l=>r({...i,dueDate:l.target.value}),required:!0})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,qr.jsx)(O,{id:"dueTime",type:"time",value:i.dueTime,onChange:l=>r({...i,dueTime:l.target.value})})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{className:`${m?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,qr.jsxs)(ze,{value:i.colleagueId,onValueChange:l=>{r({...i,colleagueId:l})},required:!0,children:[(0,qr.jsx)(je,{className:`${m?"text-destructive border-red-500":""}`,children:(0,qr.jsx)(Ye,{className:`${m?"text-destructive border-red-500":""}`,placeholder:"Select a digital colleague",children:e.find(l=>l?.id.toString()===i.colleagueId.toString())?.name||"Select a digital colleague"})}),(0,qr.jsx)(Oe,{children:n.map(l=>(0,qr.jsx)(Q,{value:l.id,children:l.name},l.id))})]}),m&&(0,qr.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:l=>r({...i,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,qr.jsx)(T,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,qr.jsxs)(ze,{value:i.recurrencePattern,onValueChange:l=>r({...i,recurrencePattern:l}),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"daily",children:"Daily"}),(0,qr.jsx)(Q,{value:"weekly",children:"Weekly"}),(0,qr.jsx)(Q,{value:"monthly",children:"Monthly"}),(0,qr.jsx)(Q,{value:"yearly",children:"Yearly"})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"recurrenceInterval",children:"Every"}),(0,qr.jsx)(O,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:l=>r({...i,recurrenceInterval:parseInt(l.target.value)})})]})]})]}),(0,qr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,qr.jsx)(w,{type:"submit",children:"Add Reminder"})]})]})]})})},zl=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,m]=(0,Ht.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 l=t.find(p=>p?.id===r.colleagueId);if(!l){console.error("_o valid colleague selected");return}a(e.id,{title:r.title,description:r.description,dueDate:new Date(r.dueDate),dueTime:r.dueTime||void 0,colleague:l,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,qr.jsx)(St,{open:o,onOpenChange:i,children:(0,qr.jsxs)(bt,{className:"max-w-2xl",children:[(0,qr.jsx)(ht,{children:(0,qr.jsx)(xt,{children:"Edit Reminder"})}),(0,qr.jsxs)("form",{onSubmit:s,className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-title",children:"Title"}),(0,qr.jsx)(O,{id:"edit-title",value:r.title,onChange:n=>m({...r,title:n.target.value}),placeholder:"Enter reminder title",required:!0})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-priority",children:"Priority"}),(0,qr.jsxs)(ze,{value:r.priority,onValueChange:n=>m({...r,priority:n}),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"low",children:"\u{1F7E2} Low"}),(0,qr.jsx)(Q,{value:"medium",children:"\u{1F7E1} Medium"}),(0,qr.jsx)(Q,{value:"high",children:"\u{1F534} High"})]})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-description",children:"Description"}),(0,qr.jsx)(Ne,{id:"edit-description",value:r.description,onChange:n=>m({...r,description:n.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,qr.jsx)(O,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:n=>m({...r,dueDate:n.target.value}),required:!0})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,qr.jsx)(O,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:n=>m({...r,dueTime:n.target.value})})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-colleague",children:"Assigned Colleague"}),(0,qr.jsxs)(ze,{value:r.colleagueId,onValueChange:n=>m({...r,colleagueId:n}),required:!0,children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{placeholder:"Select a digital colleague"})}),(0,qr.jsx)(Oe,{children:c.map(n=>(0,qr.jsx)(Q,{value:n.id,children:n.name},n.id))})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring,onChange:n=>m({...r,isRecurring:n.target.checked}),className:"rounded border-border"}),(0,qr.jsx)(T,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]}),r.isRecurring&&(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-recurrencePattern",children:"Frequency"}),(0,qr.jsxs)(ze,{value:r.recurrencePattern,onValueChange:n=>m({...r,recurrencePattern:n}),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"daily",children:"Daily"}),(0,qr.jsx)(Q,{value:"weekly",children:"Weekly"}),(0,qr.jsx)(Q,{value:"monthly",children:"Monthly"}),(0,qr.jsx)(Q,{value:"yearly",children:"Yearly"})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-recurrenceInterval",children:"Every"}),(0,qr.jsx)(O,{id:"edit-recurrenceInterval",type:"number",min:"1",value:r.recurrenceInterval,onChange:n=>m({...r,recurrenceInterval:parseInt(n.target.value)})})]})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)("input",{type:"checkbox",id:"edit-reminderEnabled",checked:r.reminderEnabled,onChange:n=>m({...r,reminderEnabled:n.target.checked}),className:"rounded border-border"}),(0,qr.jsx)(T,{htmlFor:"edit-reminderEnabled",children:"Enable reminder notifications"})]}),r.reminderEnabled&&(0,qr.jsxs)("div",{className:"pl-6",children:[(0,qr.jsx)(T,{htmlFor:"edit-reminderMinutes",children:"Remind me"}),(0,qr.jsxs)(ze,{value:r.reminderMinutes.toString(),onValueChange:n=>m({...r,reminderMinutes:parseInt(n)}),children:[(0,qr.jsx)(je,{children:(0,qr.jsx)(Ye,{})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsx)(Q,{value:"5",children:"5 minutes before"}),(0,qr.jsx)(Q,{value:"15",children:"15 minutes before"}),(0,qr.jsx)(Q,{value:"30",children:"30 minutes before"}),(0,qr.jsx)(Q,{value:"60",children:"1 hour before"}),(0,qr.jsx)(Q,{value:"1440",children:"1 day before"})]})]})]})]}),(0,qr.jsxs)("div",{children:[(0,qr.jsx)(T,{htmlFor:"edit-tags",children:"Tags (comma-separated)"}),(0,qr.jsx)(O,{id:"edit-tags",value:r.tags,onChange:n=>m({...r,tags:n.target.value}),placeholder:"e.qr., urgent, meeting, follow-up"})]}),(0,qr.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,qr.jsx)(w,{type:"submit",children:"Save Changes"})]})]})]})})},Vl=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,Ht.useState)(!1);if(!e||!e.id)return null;let m=fr(e.dueDate,e.dueTime),s=vr(e.dueDate),c=Ol(e.dueDate),n=()=>{a(e.id,{isCompleted:!e.isCompleted,completedAt:e.isCompleted?void 0:new Date})},l=()=>s?"Today":c?"Tomorrow":m&&!e.isCompleted?"Overdue":Ll(e.dueDate);return(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(zl,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,qr.jsx)(L,{className:`transition-all duration-200 ${e.isCompleted?"opacity-60":""} ${m&&!e.isCompleted?"border-destructive/50 bg-destructive/5":""}`,children:(0,qr.jsx)(de,{className:"p-4",children:(0,qr.jsxs)("div",{className:"flex items-start justify-between",children:[(0,qr.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,qr.jsx)("button",{onClick:n,className:"qr-1 text-primary hover:text-primary/80",children:e.isCompleted?(0,qr.jsx)(Tt.CheckCircle,{className:"h-5 w-5"}):(0,qr.jsx)(Tt.Circle,{className:"h-5 w-5"})}),(0,qr.jsxs)("div",{className:"flex-1",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2 mb-1",children:[(0,qr.jsx)("h3",{className:`font-semibold ${e.isCompleted?"line-through text-muted-foreground":""}`,children:e.title}),(0,qr.jsx)("span",{className:"text-sm",children:Fl(e.priority)}),e.isRecurring&&(0,qr.jsx)(Tt.Repeat,{className:"h-4 w-4 text-primary"}),e.reminderEnabled&&(0,qr.jsx)(Tt.Bell,{className:"h-4 w-4 text-success"})]}),(0,qr.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,qr.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(Tt.Calendar,{className:"h-4 w-4"}),(0,qr.jsx)("span",{className:m&&!e.isCompleted?"text-destructive font-medium":"",children:l()})]}),e.dueTime&&(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(Tt.Clock,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:jl(e.dueTime)})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(Tt.User,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:e.colleague?.name||"Unknown Colleague"})]})]}),e.tags&&e.tags.length>0&&(0,qr.jsx)("div",{className:"flex flex-wrap gap-1 qr-2",children:e.tags.map((p,h)=>(0,qr.jsx)(Y,{variant:"secondary",className:"text-_o",children:p},h))})]})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,qr.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,qr.jsx)(Tt.Edit2,{className:"h-4 w-4"})}),(0,qr.jsx)(w,{variant:"ghost",size:"sm",onClick:()=>o(e.id),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,qr.jsx)(Tt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},vs=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,m]=(0,Ht.useState)(e.filter(Boolean)),[s]=(0,Ht.useState)(t.filter(Boolean)),[c,n]=(0,Ht.useState)("all"),[l,p]=(0,Ht.useState)(""),[h,u]=(0,Ht.useState)(!1),N=S=>{if(!S.title||!S.colleague?.id){console.error("Invalid reminder data:",S);return}let B={...S,id:Date.now().toString(),createdAt:new Date};m(ve=>[...ve,B]),a?.(S)},x=(S,B)=>{if(!S){console.error("_o reminder ID provided for update");return}m(ve=>ve.map(D=>D?.id===S?{...D,...B}:D)),o?.(S,B)},f=S=>{if(!S){console.error("_o reminder ID provided for deletion");return}m(B=>B.filter(ve=>ve?.id!==S)),i?.(S)},A=r.filter(S=>{if(!S)return!1;if(l){let B=l.toLowerCase();if(!(S.title.toLowerCase().includes(B)||S.description.toLowerCase().includes(B)||S.colleague?.name?.toLowerCase().includes(B)||S.tags?.some(D=>D.toLowerCase().includes(B))))return!1}switch(c){case"pending":return!S.isCompleted;case"completed":return S.isCompleted;case"overdue":return!S.isCompleted&&fr(S.dueDate,S.dueTime);case"today":return vr(new Date(S.dueDate));default:return!0}}).sort((S,B)=>{if(!S||!B)return 0;if(S.isCompleted&&!B.isCompleted)return 1;if(!S.isCompleted&&B.isCompleted)return-1;let ve={high:3,medium:2,low:1},D=ve[B.priority]-ve[S.priority];return D!==0?D:S.dueDate.getTime()-B.dueDate.getTime()}),V={total:r.filter(Boolean).length,pending:r.filter(S=>S&&!S.isCompleted).length,completed:r.filter(S=>S&&S.isCompleted).length,overdue:r.filter(S=>S&&!S.isCompleted&&fr(S.dueDate,S.dueTime)).length,today:r.filter(S=>S&&vr(new Date(S.dueDate))).length},J=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,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(st,{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:()=>{u(!0)}}}),(0,qr.jsxs)("div",{className:"h-full bg-background",children:[(0,qr.jsx)(Hl,{colleagues:s,onAddReminder:N,open:h,setOpen:u}),(0,qr.jsxs)("div",{className:"p-6",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,qr.jsxs)("div",{children:[(0,qr.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,qr.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,qr.jsxs)(w,{className:"flex items-center space-x-2",onClick:()=>u(!0),children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"}),(0,qr.jsx)("span",{children:"Add Reminder"})]})]}),(0,qr.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,qr.jsxs)(L,{className:"p-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-foreground",children:V.total}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,qr.jsxs)(L,{className:"p-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-primary",children:V.pending}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,qr.jsxs)(L,{className:"p-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-success",children:V.completed}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,qr.jsxs)(L,{className:"p-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-destructive",children:V.overdue}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,qr.jsxs)(L,{className:"p-4",children:[(0,qr.jsx)("div",{className:"text-2xl font-bold text-warning",children:V.today}),(0,qr.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,qr.jsx)("div",{className:"flex-1",children:(0,qr.jsx)(O,{placeholder:"Search reminders...",value:l,onChange:S=>p(S.target.value),className:"max-w-md"})}),(0,qr.jsxs)(ze,{value:c,onValueChange:S=>n(S),children:[(0,qr.jsx)(je,{className:"w-40",children:(0,qr.jsx)(Ye,{})}),(0,qr.jsxs)(Oe,{children:[(0,qr.jsxs)(Q,{value:"all",children:["All (",V.total,")"]}),(0,qr.jsxs)(Q,{value:"pending",children:["Pending (",V.pending,")"]}),(0,qr.jsxs)(Q,{value:"completed",children:["Completed (",V.completed,")"]}),(0,qr.jsxs)(Q,{value:"overdue",children:["Overdue (",V.overdue,")"]}),(0,qr.jsxs)(Q,{value:"today",children:["Today (",V.today,")"]})]})]})]}),(0,qr.jsx)("div",{className:"space-y-4",children:A.length===0?(0,qr.jsxs)(L,{className:"p-8 text-center",children:[(0,qr.jsx)("div",{className:"text-muted-foreground",children:l||c!=="all"?"_o reminders match your filters":"_o reminders yet"}),!l&&c==="all"&&(0,qr.jsx)("p",{className:"text-sm text-muted-foreground/60 qr-2",children:"Create your first reminder to get started"})]}):A.map(S=>S&&(0,qr.jsx)(Vl,{reminder:S,colleagues:s,onUpdateReminder:x,onDeleteReminder:f},S.id))})]})]})]})};var bs=require("next/navigation");function br({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:m=[],initialUsers:s=[],initialFiles:c=[],initialView:n="kanban",onAddTask:l,onUpdateTask:p,onDeleteTask:h,onTaskClick:u,onAddEpic:N,onUpdateEpic:x,onDeleteEpic:f,onAddTaskToEpic:P,onAddSprint:A,onUpdateSprint:V,onDeleteSprint:J,onAddProject:S,onUpdateProject:B,onDeleteProject:ve,onFileAdd:D,onFileEdit:te,onFileDelete:R,onFileClick:we,onAddReminder:q,onUpdateReminder:M,onDeleteReminder:ne,onViewChange:$e,onToggleMobileMenu:Ae,onTeamClick:ke,onTeamChange:ut,onCopilotClick:pt,handleAddComment:Dt}){let[Ke,qe]=(0,Ht.useState)(t),[Nt,ft]=(0,Ht.useState)(a),[I,$]=(0,Ht.useState)(o),[C,He]=(0,Ht.useState)(i),[Pe,It]=(0,Ht.useState)(r),[$t,K]=(0,Ht.useState)(m),[Ce,Re]=(0,Ht.useState)(s),[at,y]=(0,Ht.useState)(c),[U,me]=(0,Ht.useState)(!1),[De,ot]=(0,Ht.useState)(!1),[gt,vt]=(0,Ht.useState)(null),[za,Va]=(0,Ht.useState)(null),[Ua,Dr]=(0,Ht.useState)(null),[ma,Pr]=(0,Ht.useState)(n||"kanban"),[Rs,Es]=(0,Ht.useState)(!1),Tr=(0,bs.useRouter)();(0,Ht.useEffect)(()=>{qe(t)},[t]),(0,Ht.useEffect)(()=>{$(o)},[o]),(0,Ht.useEffect)(()=>{ft(a)},[a]),(0,Ht.useEffect)(()=>{He(i)},[i]),(0,Ht.useEffect)(()=>{y(c)},[c]),(0,Ht.useEffect)(()=>{Re(s)},[s]),(0,Ht.useEffect)(()=>{K(m)},[m]),(0,Ht.useEffect)(()=>{It(r)},[r]),(0,Ht.useEffect)(()=>{Pr(n)},[n]);let Is=Nt.filter(k=>k.isSelected).map(k=>k.id),no=I.find(k=>k.isSelected),As=Ke.filter(k=>{let F=Is.includes(k.epicId);return!no||no.id==="all-tasks"?F:no.id==="backlog"?F&&!k.sprintId:F&&k.sprintId===no.id}),$l=k=>As.filter(F=>F.status===k),Kl=k=>{let F={};return Nt.forEach(oe=>{F[oe.id]=k.filter(Ee=>Ee.epicId===oe.id)}),F},_l=k=>{Dr(k)},Gl=k=>{Ua&&(qe(F=>F.map(oe=>oe.id===Ua.id?{...oe,status:k}:oe)),Dr(null))},Rr=k=>{let F={...k,id:Date.now().toString(),createdAt:new Date};qe(oe=>[...oe,F]),l?.(F)},lo=async(k,F)=>(qe(oe=>oe.map(Ee=>Ee.id===k?{...Ee,...F}:Ee)),await p?.(k,F)),Wl=async(k,F)=>{lo(k,F)},Er=k=>{qe(F=>F.filter(oe=>oe.id!==k)),gt?.id===k&&vt(null),h?.(k)},ql=async k=>{Er(k)},Ms=k=>{let F={...k,id:Date.now().toString(),isSelected:!1};He(oe=>[...oe,F]),S?.(k)},Bs=(k,F)=>{He(oe=>oe.map(Ee=>Ee.id===k?F.isSelected?(Tr.push(`/project/${k}`),{...Ee,...F}):{...Ee,...F}:F.isSelected&&k!==Ee.id?{...Ee,isSelected:!1}:Ee)),B?.(k,F)},Fs=k=>{He(F=>F.filter(oe=>oe.id!==k)),ve?.(k)},Ir=k=>{let F={...k,id:Date.now().toString(),isSelected:!0};ft(oe=>[...oe,F]),N?.({...F})},Ar=()=>{ot(!0)},Mr=(k,F)=>{ft(oe=>oe.map(Ee=>Ee.id===k?{...Ee,...F}:Ee)),x?.(k,F)},Br=k=>{ft(F=>F.filter(oe=>oe.id!==k)),qe(F=>F.filter(oe=>oe.epicId!==k)),f?.(k)},Ls=k=>{let F={...k,id:Date.now().toString(),isSelected:!1};$(oe=>[...oe,F]),A?.(k)},js=(k,F)=>{$(oe=>oe.map(Ee=>Ee.id===k?F.isSelected?{...Ee,...F}:{...Ee,...F}:F.isSelected&&k!==Ee.id?{...Ee,isSelected:!1}:Ee)),V?.(k,F)},Os=k=>{k==="backlog"||k==="all-tasks"||($(F=>F.filter(oe=>oe.id!==k)),qe(F=>F.map(oe=>oe.sprintId===k?{...oe,sprintId:void 0}:oe)),J?.(k))},zo=k=>{vt(k)},Hs=k=>{k==="planning"&&window.innerWidth<768||(Pr(k),$e?.(k))},zs=()=>{Es(k=>!k),Ae?.()},Xl=()=>{Tr.push("/")},Jl=k=>{console.log("Switching to team:",k)},Yl=k=>{console.log("Switching to team:",k)},Vs=k=>{Va(k),me(!0)},Us=()=>{me(!1),Va(null)},$s=k=>{let F={...k,id:Date.now().toString(),createdAt:new Date};It(oe=>[...oe,F]),q?.(k)},Ks=(k,F)=>{It(oe=>oe.map(Ee=>Ee.id===k?{...Ee,...F}:Ee)),M?.(k,F)},_s=k=>{It(F=>F.filter(oe=>oe.id!==k)),ne?.(k)},Gs=()=>{D?.()},Ws=k=>{te?.(k)},qs=k=>{y(F=>F.filter(oe=>oe.name!==k)),R?.(k)},Xs=k=>{we?.(k)},Zl=[{id:"todo",title:"qr Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Ql=()=>{switch(ma){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"}},Vo=[{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")}],ed=Vo.sort((k,F)=>F.lastUsed.getTime()-k.lastUsed.getTime()).slice(0,3),td=Vo.length>3,ad=Vo.slice(3);return(0,qr.jsxs)(Wi,{projects:C,epics:Nt,sprints:I,currentView:ma,onUpdateProject:Bs,onDeleteProject:Fs,onAddProject:Ms,onUpdateEpic:Mr,onDeleteEpic:Br,onAddEpic:Ar,onViewChange:Hs,mobileMenuOpen:Rs,onToggleMobileMenu:zs,children:[ma==="kanban"&&(0,qr.jsx)("div",{className:"h-full overflow-hidden",children:(0,qr.jsx)(ds,{initialProjects:C,initialEpics:Nt,initialSprints:I,initialTasks:Ke,initialColleagues:$t,initialUsers:Ce,onAddTask:Rr,onUpdateTask:lo,onDeleteTask:Er,onTaskClick:zo,onAddEpic:Ir,onAddComment:Dt})}),ma==="planning"&&(0,qr.jsx)("div",{className:"hidden md:block h-full",children:(0,qr.jsx)(Fo,{tasks:Ke,epics:Nt,sprints:I,onUpdateTask:lo,onTaskClick:zo,onAddSprint:Ls,onUpdateSprint:js,onDeleteSprint:Os})}),ma==="tasks"&&(0,qr.jsx)("div",{className:"h-full",children:(0,qr.jsx)(vs,{initialReminders:Pe,initialColleagues:$t,onAddReminder:$s,onUpdateReminder:Ks,onDeleteReminder:_s})}),ma==="files"&&(0,qr.jsx)("div",{className:"h-full",children:(0,qr.jsx)(Ya,{initialFiles:at,onFileAdd:Gs,onFileEdit:Ws,onFileDelete:qs,onFileClick:Xs,compactView:!1})}),ma==="epics"&&(0,qr.jsx)("div",{className:"h-full",children:(0,qr.jsx)(cs,{tasks:Ke,epics:Nt,sprints:I,onUpdateTask:lo,onTaskClick:zo,onAddTaskToEpic:Vs,onAddEpic:Ar,onUpdateEpic:Mr,onDeleteEpic:Br})}),(0,qr.jsx)(Ro,{isOpen:U,onClose:Us,onAddTask:Rr,epics:Nt,sprints:I,assignees:[...$t,...Ce],defaultEpicId:za||void 0}),(0,qr.jsx)(Ao,{isOpen:De,onClose:()=>ot(!1),onAddEpic:Ir})]})}var hs=be(require("react")),oo=be(require("@radix-ui/react-progress"));var xr=hs.forwardRef(({className:e,value:t,...a},o)=>(0,qr.jsx)(oo.Root,{ref:o,className:b("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...a,children:(0,qr.jsx)(oo.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));xr.displayName=oo.Root.displayName;function ys({project:e,onOpen:t,onShare:a,className:o}){return(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:o,children:(0,qr.jsxs)(L,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,qr.jsxs)(Ie,{children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between",children:[(0,qr.jsx)(Le,{children:e.name}),(0,qr.jsxs)(Y,{variant:"outline",className:"rounded-xl",children:["Due ",e.dueDate]})]}),(0,qr.jsx)(ua,{children:e.description})]}),(0,qr.jsxs)(de,{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,qr.jsx)("span",{children:"Progress"}),(0,qr.jsxs)("span",{children:[e.progress,"%"]})]}),(0,qr.jsx)(xr,{value:e.progress,className:"h-2 rounded-xl"})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,qr.jsxs)("div",{className:"flex items-center",children:[(0,qr.jsx)(Tt.Users,{className:"mr-1 h-4 w-4"}),e.members," members"]}),(0,qr.jsxs)("div",{className:"flex items-center",children:[(0,qr.jsx)(Tt.FileText,{className:"mr-1 h-4 w-4"}),e.files," files"]})]})]}),(0,qr.jsxs)(ga,{className:"flex gap-2",children:[(0,qr.jsx)(w,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"Open Project"}),(0,qr.jsx)(w,{variant:"outline",size:"icon",className:"rounded-2xl",onClick:()=>a?.(e),children:(0,qr.jsx)(Tt.Share2,{className:"h-4 w-4"})})]})]})})}var ro=be(require("@radix-ui/react-checkbox")),Ns=be(require("react")),yr=Ns.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(ro.Root,{className:b("peer h-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:a,...t,children:(0,qr.jsx)(ro.Indicator,{className:b("flex items-center justify-center text-current"),children:(0,qr.jsx)(Tt.Check,{className:"h-4 w-4"})})}));yr.displayName=ro.Root.displayName;var Cs=({onSubmit:e,onCancel:t,isLoading:a=!1,initialData:o,className:i=""})=>{let[r,m]=(0,Ht.useState)({name:o?.name||"",objectives:o?.objectives||"",workInstructions:o?.workInstructions||"",plan:o?.plan||!1}),[s,c]=(0,Ht.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},l=async h=>{if(h.preventDefault(),!!n())try{await e(r)}catch(u){console.error("Error submitting project form:",u)}},p=(h,u)=>{m(N=>({...N,[h]:u})),s[h]&&c(N=>({...N,[h]:void 0}))};return(0,qr.jsxs)(L,{className:`w-full max-w-2xl ${i}`,children:[(0,qr.jsxs)(Ie,{children:[(0,qr.jsxs)(Le,{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.Plus,{className:"h-5 w-5"}),"Create New Project"]}),(0,qr.jsx)(ua,{children:"Set up a new project with clear objectives and work instructions to help your team collaborate effectively."})]}),(0,qr.jsxs)("form",{onSubmit:l,children:[(0,qr.jsxs)(de,{className:"space-y-6",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",className:"text-sm font-medium",children:"Project Name *"}),(0,qr.jsx)(O,{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:a,maxLength:100}),s.name&&(0,qr.jsx)("p",{className:"text-sm text-red-600",children:s.name})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"objectives",className:"text-sm font-medium",children:"Project Objectives *"}),(0,qr.jsx)(Ne,{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:a,maxLength:1e3}),(0,qr.jsxs)("div",{className:"flex justify-between text-_o text-gray-500",children:[(0,qr.jsx)("span",{children:s.objectives&&(0,qr.jsx)("span",{className:"text-red-600",children:s.objectives})}),(0,qr.jsxs)("span",{children:[r.objectives.length,"/1000"]})]})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"workInstructions",className:"text-sm font-medium",children:"Work Instructions *"}),(0,qr.jsx)(Ne,{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:a,maxLength:2e3}),(0,qr.jsxs)("div",{className:"flex justify-between text-_o text-gray-500",children:[(0,qr.jsx)("span",{children:s.workInstructions&&(0,qr.jsx)("span",{className:"text-red-600",children:s.workInstructions})}),(0,qr.jsxs)("span",{children:[r.workInstructions.length,"/2000"]})]})]}),(0,qr.jsxs)("div",{className:"space-y-3",children:[(0,qr.jsx)(T,{className:"text-sm font-medium",children:"Project Management"}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(yr,{id:"plan",checked:r.plan,onCheckedChange:h=>p("plan",h===!0),disabled:a}),(0,qr.jsx)(T,{htmlFor:"plan",className:"text-sm text-gray-700 cursor-pointer",children:"Enable project planning and management features"})]}),(0,qr.jsx)("p",{className:"text-_o text-gray-500 ml-6",children:"This will allow project managers to create sprints, assign tasks, and track progress."})]})]}),(0,qr.jsxs)(ga,{className:"flex justify-end gap-3",children:[t&&(0,qr.jsxs)(w,{type:"button",variant:"outline",onClick:t,disabled:a,className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.qr,{className:"h-4 w-4"}),"Cancel"]}),(0,qr.jsx)(w,{type:"submit",disabled:a,className:"flex items-center gap-2",children:a?(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(Tt.Loader2,{className:"h-4 w-4 animate-spin"}),"Creating..."]}):(0,qr.jsxs)(qr.Fragment,{children:[(0,qr.jsx)(Tt.Plus,{className:"h-4 w-4"}),"Create Project"]})})]})]})]})};function Cr({projects:e=[],onAddProject:t,handleProjectOpen:a,handleProjectShare:o}){let[i,r]=(0,Ht.useState)(!1),[m,s]=(0,Ht.useState)(!1),c=async l=>{s(!0);try{await t(l),r(!1)}catch(p){console.error("Error creating project:",p)}finally{s(!1)}},n=()=>{r(!0)};return(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsx)(st,{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,qr.jsxs)("section",{className:"space-y-4 qr-8",children:[(0,qr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Projects"}),(0,qr.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.map(l=>(0,qr.jsx)(ys,{project:l,onOpen:a,onShare:o},l.name))})]})]},"projects-index-view")}),(0,qr.jsx)(St,{open:i,onOpenChange:r,children:(0,qr.jsxs)(bt,{className:"max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,qr.jsxs)(ht,{className:"sr-only",children:[(0,qr.jsx)(xt,{children:"Create New Project"}),(0,qr.jsx)(to,{children:"Fill out the form below to create a new project."})]}),(0,qr.jsx)(Cs,{onSubmit:c,onCancel:()=>r(!1),isLoading:m,className:"border-0 shadow-none"})]})})]})}function ks({team:e,onOpen:t,className:a}){return(0,qr.jsx)(_o.motion.div,{whileHover:{scale:1.02,y:-5},whileTap:{scale:.98},className:a,children:(0,qr.jsxs)(L,{className:"overflow-hidden rounded-3xl border hover:border-primary/50 transition-all duration-300",children:[(0,qr.jsxs)(Ie,{children:[(0,qr.jsx)(Le,{className:"text-lg",children:e.name}),(0,qr.jsx)(ua,{className:"qr-1 text-sm",children:e.description})]}),(0,qr.jsxs)(de,{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.Users,{className:"h-4 w-4 text-blue-500"}),(0,qr.jsx)("span",{children:"Human"})]}),(0,qr.jsx)("span",{className:"font-medium",children:e.humanColleagues})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.Bot,{className:"h-4 w-4 text-purple-500"}),(0,qr.jsx)("span",{children:"Digital"})]}),(0,qr.jsx)("span",{className:"font-medium",children:e.digitalColleagues})]})]}),(0,qr.jsxs)("div",{className:"flex items-center justify-between text-sm border-t pt-4",children:[(0,qr.jsxs)("div",{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.FolderOpen,{className:"h-4 w-4 text-green-500"}),(0,qr.jsx)("span",{children:"Projects"})]}),(0,qr.jsx)("span",{className:"font-medium",children:e.projects})]})]}),(0,qr.jsx)(ga,{className:"flex gap-2",children:(0,qr.jsx)(w,{variant:"secondary",className:"flex-1 rounded-2xl",onClick:()=>t?.(e),children:"View Team"})})]})})}var Ds=be(require("react")),io=be(require("@radix-ui/react-switch"));var Ha=Ds.forwardRef(({className:e,...t},a)=>(0,qr.jsx)(io.Root,{className:b("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:(0,qr.jsx)(io.Thumb,{className:b("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")})}));Ha.displayName=io.Root.displayName;function Ps({team:e,onSave:t,onCancel:a,isLoading:o=!1,title:i,submitLabel:r,cancelLabel:m="Cancel",readOnly:s=!1}){let[c,n]=(0,Ht.useState)({name:"",description:"",systemMsg:"",useProjects:!1,useKnowledge:!1,useFiles:!1,useChat:!1,...e}),[l,p]=(0,Ht.useState)(!s);(0,Ht.useEffect)(()=>{e&&n(e)},[e]);let h=f=>{f.preventDefault();let P={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(P)},u=f=>{f.preventDefault(),p(!l)},N=i||(l?e?"Edit Team":"Create New Team":"View Team"),x=r||(e?"Update Team":"Create Team");return(0,qr.jsxs)(L,{className:"m-8 w-full max-w-4xl mx-auto",children:[(0,qr.jsx)(Ie,{children:(0,qr.jsxs)(Le,{className:"flex items-center gap-2",children:[(0,qr.jsx)(Tt.Users,{className:"h-5 w-5"}),N]})}),(0,qr.jsx)(de,{children:(0,qr.jsxs)("form",{onSubmit:h,className:"space-y-6",children:[(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"name",children:"Team Name *"}),(0,qr.jsx)(O,{id:"name",value:c.name||"",onChange:f=>n({...c,name:f.target.value}),required:!0,disabled:o||!l,placeholder:"Enter team name..."})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"description",children:"Description"}),(0,qr.jsx)(Ne,{id:"description",value:c.description||"",onChange:f=>n({...c,description:f.target.value}),rows:3,placeholder:"Brief description of this team...",disabled:o||!l})]}),(0,qr.jsxs)("div",{className:"space-y-2",children:[(0,qr.jsx)(T,{htmlFor:"systemMsg",children:"Ways of working"}),(0,qr.jsx)(Ne,{id:"systemMsg",value:c.systemMsg||"",onChange:f=>n({...c,systemMsg:f.target.value}),rows:3,placeholder:"Describe how this team works in Ht much detail Ht possible. Include processes, tools, systems, styles...",disabled:o||!l})]})]}),(0,qr.jsxs)("div",{className:"space-y-4",children:[(0,qr.jsx)("h3",{className:"text-lg font-semibold",children:"Team Configuration"}),(0,qr.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ha,{id:"useProjects",checked:c.useProjects||!1,onCheckedChange:f=>n({...c,useProjects:f}),disabled:o||!l}),(0,qr.jsx)(T,{htmlFor:"useProjects",children:"Enable Projects"})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ha,{id:"useKnowledge",checked:c.useKnowledge||!1,onCheckedChange:f=>n({...c,useKnowledge:f}),disabled:o||!l}),(0,qr.jsx)(T,{htmlFor:"useKnowledge",children:"Enable Knowledge Base"})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ha,{id:"useFiles",checked:c.useFiles||!1,onCheckedChange:f=>n({...c,useFiles:f}),disabled:o||!l}),(0,qr.jsx)(T,{htmlFor:"useFiles",children:"Enable File Management"})]}),(0,qr.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,qr.jsx)(Ha,{id:"useChat",checked:c.useChat||!1,onCheckedChange:f=>n({...c,useChat:f}),disabled:o||!l}),(0,qr.jsx)(T,{htmlFor:"useChat",children:"Enable Team Chat"})]})]})]}),(0,qr.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t",children:[(0,qr.jsx)(w,{type:"button",variant:"outline",onClick:a,disabled:o,children:l?m:"Close"}),l?(0,qr.jsx)(w,{type:"submit",disabled:o||!c.name?.trim(),children:o?"Saving...":x}):(0,qr.jsxs)(w,{type:"button",onClick:u,disabled:o,className:"gap-2",children:[(0,qr.jsx)(Tt.Edit,{className:"h-4 w-4"}),"Edit"]})]})]})})]})}function kr({teams:e=[],onCreateTeam:t,onTeamOpen:a}){let[o,i]=(0,Ht.useState)(!1),r=()=>{i(!0)},m=n=>{t?.(n),i(!1)},s=()=>{i(!1)},c=n=>{a?.(n)};return(0,qr.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,qr.jsx)(_o.AnimatePresence,{mode:"wait",children:(0,qr.jsxs)(_o.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:[(0,qr.jsx)(st,{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,qr.jsxs)("section",{className:"space-y-4 qr-8",children:[(0,qr.jsx)("h2",{className:"text-2xl font-semibold",children:"Active Teams"}),e.length===0?(0,qr.jsxs)("div",{className:"text-center py-12",children:[(0,qr.jsx)("p",{className:"text-muted-foreground text-lg",children:"You'qr not part of any teams yet."}),(0,qr.jsx)("p",{className:"text-muted-foreground text-sm qr-2",children:"Create a new team or ask to be added to an existing one."})]}):(0,qr.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(n=>(0,qr.jsx)(ks,{team:n,onOpen:c},n.id))})]})]},"teams-index-view")}),(0,qr.jsx)(St,{open:o,onOpenChange:i,children:(0,qr.jsxs)(bt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto p-0",children:[(0,qr.jsx)("div",{className:"sr-only",children:(0,qr.jsxs)(ht,{children:[(0,qr.jsx)(xt,{children:"Create New Team"}),(0,qr.jsx)(to,{children:"Set up a new team to collaborate with colleagues on projects."})]})}),(0,qr.jsx)(Ps,{title:"Create New Team",submitLabel:"Create Team",onSave:m,onCancel:s})]})})]})}0&&(module.exports={ColleaguesView,FileView,KnowledgeView,PlanningView,ProjectView,ProjectsIndexView,TeamsIndexView});