cortex-react-components 2.26.3 → 2.26.5

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 (200) hide show
  1. package/dist/{chunk-BDNY6OKE.mjs → chunk-2GM2LPLB.mjs} +1 -1
  2. package/dist/{chunk-2GZQYAN3.mjs → chunk-2OOJ4ZFB.mjs} +1 -1
  3. package/dist/{chunk-UX5OJ3WS.mjs → chunk-3ANJOET7.mjs} +1 -1
  4. package/dist/{chunk-HB57GPGK.mjs → chunk-3M5KHST3.mjs} +1 -1
  5. package/dist/{chunk-NXG2Y4N4.mjs → chunk-4SRUEQTP.mjs} +1 -1
  6. package/dist/{chunk-AGWQ5S2Z.mjs → chunk-5NIEZE7A.mjs} +1 -1
  7. package/dist/chunk-6YHCNPFB.mjs +4 -0
  8. package/dist/{chunk-PRK2XFAZ.mjs → chunk-7OMPPFGG.mjs} +1 -1
  9. package/dist/{chunk-CNCT3JZV.mjs → chunk-AQQCH7Z2.mjs} +1 -1
  10. package/dist/{chunk-WDZOGIT2.mjs → chunk-BQQ4V4PX.mjs} +1 -1
  11. package/dist/{chunk-R3SDBXF2.mjs → chunk-CKU2T3AN.mjs} +1 -1
  12. package/dist/{chunk-RIFUOB7A.mjs → chunk-EFNFK7TR.mjs} +1 -1
  13. package/dist/{chunk-T36QUKC6.mjs → chunk-F64CA5CH.mjs} +1 -1
  14. package/dist/{chunk-VDN4LQSS.mjs → chunk-F6DMXMR4.mjs} +1 -1
  15. package/dist/{chunk-KRLNPNMZ.mjs → chunk-FEWOSBUJ.mjs} +1 -1
  16. package/dist/{chunk-CJ2ZX7QN.mjs → chunk-FMXCT6LU.mjs} +1 -1
  17. package/dist/{chunk-BGADMIWV.mjs → chunk-FYQBRCQM.mjs} +1 -1
  18. package/dist/{chunk-JLUX7EHB.mjs → chunk-GAZHKHGB.mjs} +1 -1
  19. package/dist/{chunk-5KS3DITB.mjs → chunk-GETYSIZV.mjs} +1 -1
  20. package/dist/chunk-GLZEHRPY.mjs +4 -0
  21. package/dist/chunk-HD6E7KI2.mjs +4 -0
  22. package/dist/{chunk-M74BIPBM.mjs → chunk-HDKHF3EA.mjs} +1 -1
  23. package/dist/{chunk-BN747TQM.mjs → chunk-HKMNAXLM.mjs} +1 -1
  24. package/dist/{chunk-TKCFCYEQ.mjs → chunk-HSQAHQNP.mjs} +1 -1
  25. package/dist/{chunk-6LY5CH7J.mjs → chunk-JCWFPKF3.mjs} +1 -1
  26. package/dist/{chunk-OP6ZWZIM.mjs → chunk-JVTCOOUV.mjs} +1 -1
  27. package/dist/{chunk-DJ2KA3MS.mjs → chunk-KBLVWXLK.mjs} +1 -1
  28. package/dist/{chunk-S3P6OGB7.mjs → chunk-KVLUT4U2.mjs} +1 -1
  29. package/dist/{chunk-WUA65ZZB.mjs → chunk-L3BLBPSR.mjs} +1 -1
  30. package/dist/{chunk-CLGBBNRB.mjs → chunk-LAQ3QAUW.mjs} +1 -1
  31. package/dist/chunk-LCEEFZH7.mjs +4 -0
  32. package/dist/chunk-LEF6M5ZD.mjs +4 -0
  33. package/dist/{chunk-ERHNVIOZ.mjs → chunk-LHO4WFYP.mjs} +1 -1
  34. package/dist/{chunk-JT65KF7C.mjs → chunk-MO4HRQEL.mjs} +1 -1
  35. package/dist/{chunk-DKRRVTCV.mjs → chunk-MS7YIAWP.mjs} +1 -1
  36. package/dist/chunk-MXMW65GM.mjs +4 -0
  37. package/dist/{chunk-GIL2SMPM.mjs → chunk-O24GFE6Q.mjs} +1 -1
  38. package/dist/chunk-P2B3OITE.mjs +4 -0
  39. package/dist/{chunk-PZZTGPEO.mjs → chunk-P6OSMPUQ.mjs} +1 -1
  40. package/dist/{chunk-23XORW7A.mjs → chunk-P7S6XFU4.mjs} +1 -1
  41. package/dist/{chunk-4NHQXOKZ.mjs → chunk-PNUBVBSR.mjs} +1 -1
  42. package/dist/{chunk-66ODXUVL.mjs → chunk-PTZT4QJW.mjs} +1 -1
  43. package/dist/{chunk-YJ7XPZWV.mjs → chunk-QUMUO63J.mjs} +1 -1
  44. package/dist/{chunk-JUFFNFV6.mjs → chunk-R6AYIVIR.mjs} +1 -1
  45. package/dist/{chunk-67PJ7D4O.mjs → chunk-RS4VD3ML.mjs} +1 -1
  46. package/dist/{chunk-CTTBF7F4.mjs → chunk-RS4WAAGI.mjs} +1 -1
  47. package/dist/{chunk-Y62OBV2E.mjs → chunk-U3FYDDE2.mjs} +1 -1
  48. package/dist/chunk-U3PUWUVM.mjs +4 -0
  49. package/dist/{chunk-DVE2KPLR.mjs → chunk-WH6JZSIA.mjs} +1 -1
  50. package/dist/{chunk-PXLSH6S2.mjs → chunk-ZFUP5NVF.mjs} +1 -1
  51. package/dist/{chunk-I6OBIS4J.mjs → chunk-ZG5N4C4S.mjs} +1 -1
  52. package/dist/components/AdvancedComponents/AppSidebar.d.ts +3 -2
  53. package/dist/components/AdvancedComponents/AppSidebar.js +1 -2
  54. package/dist/components/AdvancedComponents/AppSidebar.mjs +1 -1
  55. package/dist/components/AdvancedComponents/app-header.js +1 -1
  56. package/dist/components/AdvancedComponents/app-header.mjs +1 -1
  57. package/dist/components/AdvancedComponents/index.js +1 -1
  58. package/dist/components/AdvancedComponents/index.mjs +1 -1
  59. package/dist/components/AdvancedComponents/navigation-tabs.js +1 -1
  60. package/dist/components/AdvancedComponents/navigation-tabs.mjs +1 -1
  61. package/dist/components/AdvancedComponents/user-selection.js +1 -1
  62. package/dist/components/AdvancedComponents/user-selection.mjs +1 -1
  63. package/dist/components/Blocks/Banner.mjs +1 -1
  64. package/dist/components/Blocks/CallToAction.mjs +1 -1
  65. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  66. package/dist/components/Blocks/Content.mjs +1 -1
  67. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  68. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  69. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  70. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  71. package/dist/components/Blocks/index.mjs +1 -1
  72. package/dist/components/Cards/ContentCard.mjs +1 -1
  73. package/dist/components/Cards/FeatureCard.mjs +1 -1
  74. package/dist/components/Cards/index.mjs +1 -1
  75. package/dist/components/Chat/CopilotInterface.js +3 -3
  76. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  77. package/dist/components/Chat/demo-long-messages.js +5 -5
  78. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  79. package/dist/components/Chat/demo-tests.js +5 -5
  80. package/dist/components/Chat/demo-tests.mjs +1 -1
  81. package/dist/components/Chat/demo.js +3 -3
  82. package/dist/components/Chat/demo.mjs +1 -1
  83. package/dist/components/Chat/example-usage.js +3 -3
  84. package/dist/components/Chat/example-usage.mjs +1 -1
  85. package/dist/components/Chat/example-with-vercel-ai.js +3 -3
  86. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  87. package/dist/components/Chat/index.js +3 -3
  88. package/dist/components/Chat/index.mjs +1 -1
  89. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  90. package/dist/components/DigitalColleagues/DigitalColleageusLayout.js +1 -1
  91. package/dist/components/DigitalColleagues/DigitalColleageusLayout.mjs +1 -1
  92. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  93. package/dist/components/DigitalColleagues/Pages/dashboardpage.js +5 -5
  94. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  95. package/dist/components/DigitalColleagues/Views/ColleaguesView.js +1 -1
  96. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
  97. package/dist/components/DigitalColleagues/Views/index.js +5 -5
  98. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  99. package/dist/components/DigitalColleagues/index.js +5 -5
  100. package/dist/components/DigitalColleagues/index.mjs +1 -1
  101. package/dist/components/Foundary/AppSidebarLeft.mjs +1 -1
  102. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  103. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  104. package/dist/components/Foundary/MainPage.mjs +1 -1
  105. package/dist/components/Foundary/Pages/dashboardpage.js +6 -6
  106. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  107. package/dist/components/Foundary/Views/ColleaguesView.d.ts +12 -1
  108. package/dist/components/Foundary/Views/ColleaguesView.js +1 -1
  109. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  110. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  111. package/dist/components/Foundary/Views/index.js +5 -5
  112. package/dist/components/Foundary/Views/index.mjs +1 -1
  113. package/dist/components/Foundary/colleague-card.js +1 -1
  114. package/dist/components/Foundary/colleague-card.mjs +1 -1
  115. package/dist/components/Foundary/colleague-form.d.ts +12 -1
  116. package/dist/components/Foundary/colleague-form.js +1 -1
  117. package/dist/components/Foundary/colleague-form.mjs +1 -1
  118. package/dist/components/Foundary/file-edit.mjs +1 -1
  119. package/dist/components/Foundary/foundary-clone.js +1 -1
  120. package/dist/components/Foundary/foundary-clone.mjs +1 -1
  121. package/dist/components/Foundary/foundary-layout.d.ts +2 -1
  122. package/dist/components/Foundary/foundary-layout.js +1 -1
  123. package/dist/components/Foundary/foundary-layout.mjs +1 -1
  124. package/dist/components/Foundary/index.js +5 -5
  125. package/dist/components/Foundary/index.mjs +1 -1
  126. package/dist/components/Foundary/knowledge-search.js +1 -1
  127. package/dist/components/Foundary/knowledge-search.mjs +1 -1
  128. package/dist/components/Foundary/types.d.ts +32 -9
  129. package/dist/components/HeaderFooter/Header.mjs +1 -1
  130. package/dist/components/HeaderFooter/HeaderDesktop.mjs +1 -1
  131. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  132. package/dist/components/HeaderFooter/VideoHeader.mjs +1 -1
  133. package/dist/components/HeaderFooter/index.mjs +1 -1
  134. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  135. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  136. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  137. package/dist/components/Heros/PostHero/index.mjs +1 -1
  138. package/dist/components/Heros/RenderHero.mjs +1 -1
  139. package/dist/components/Heros/SectionHero/index.mjs +1 -1
  140. package/dist/components/Heros/index.mjs +1 -1
  141. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  142. package/dist/components/Layouts/Print.mjs +1 -1
  143. package/dist/components/Layouts/SlideShow.mjs +1 -1
  144. package/dist/components/Layouts/index.mjs +1 -1
  145. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  146. package/dist/components/Menus/SidebarRight.mjs +1 -1
  147. package/dist/components/Menus/index.mjs +1 -1
  148. package/dist/components/Other/index.mjs +1 -1
  149. package/dist/components/Payload/RichText/index.mjs +1 -1
  150. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  151. package/dist/components/Payload/index.mjs +1 -1
  152. package/dist/components/Projects/FileView.js +1 -1
  153. package/dist/components/Projects/FileView.mjs +1 -1
  154. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  155. package/dist/components/Projects/ProjectPage.js +5 -5
  156. package/dist/components/Projects/ProjectPage.mjs +1 -1
  157. package/dist/components/Projects/ProjectView.js +1 -1
  158. package/dist/components/Projects/ProjectView.mjs +1 -1
  159. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  160. package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
  161. package/dist/components/Projects/file-list.mjs +1 -1
  162. package/dist/components/Projects/index.mjs +1 -1
  163. package/dist/components/dc-temp/index.js +1 -1
  164. package/dist/components/dc-temp/index.mjs +1 -1
  165. package/dist/components/index.js +20 -20
  166. package/dist/components/index.mjs +1 -1
  167. package/dist/components/ui/index.mjs +1 -1
  168. package/dist/components/ui/sidebar.mjs +1 -1
  169. package/dist/index.js +27 -27
  170. package/dist/index.mjs +1 -1
  171. package/dist/metafile-cjs.json +1 -1
  172. package/dist/metafile-esm.json +1 -1
  173. package/dist/pages/Blog.mjs +1 -1
  174. package/dist/pages/Documentation.mjs +1 -1
  175. package/dist/pages/IndexPage.mjs +1 -1
  176. package/dist/pages/Intranet.mjs +1 -1
  177. package/dist/pages/LandingPage.mjs +1 -1
  178. package/dist/pages/Page.mjs +1 -1
  179. package/dist/pages/Publish.mjs +1 -1
  180. package/dist/pages/Website.mjs +1 -1
  181. package/dist/sections/AboutSection.mjs +1 -1
  182. package/dist/sections/BlogDetail.mjs +1 -1
  183. package/dist/sections/BlogList.mjs +1 -1
  184. package/dist/sections/BlogListSection.mjs +1 -1
  185. package/dist/sections/ContactSection.mjs +1 -1
  186. package/dist/sections/PageSections.mjs +1 -1
  187. package/dist/sections/PricingSection.mjs +1 -1
  188. package/dist/sections/ServiceDetail.mjs +1 -1
  189. package/dist/sections/ServiceDetailSection.mjs +1 -1
  190. package/dist/sections/ServiceSection.mjs +1 -1
  191. package/dist/sections/index.mjs +1 -1
  192. package/package.json +1 -1
  193. package/dist/chunk-4WA47ZQA.mjs +0 -4
  194. package/dist/chunk-5HT2KC5I.mjs +0 -4
  195. package/dist/chunk-CRAFZGCI.mjs +0 -4
  196. package/dist/chunk-FGEFYI5E.mjs +0 -4
  197. package/dist/chunk-GPFPTU7U.mjs +0 -4
  198. package/dist/chunk-KKW3FINI.mjs +0 -4
  199. package/dist/chunk-NDZ26EG6.mjs +0 -4
  200. package/dist/chunk-Y7H3EUBR.mjs +0 -4
@@ -2,9 +2,9 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
5
- "use strict";"use client";var Jn=Object.create;var ao=Object.defineProperty;var Zn=Object.getOwnPropertyDescriptor;var Xn=Object.getOwnPropertyNames;var Yn=Object.getPrototypeOf,Qn=Object.prototype.hasOwnProperty;var es=(e,t)=>{for(var a in t)ao(e,a,{get:t[a],enumerable:!0})},Si=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Xn(t))!Qn.call(e,i)&&i!==a&&ao(e,i,{get:()=>t[i],enumerable:!(o=Zn(t,i))||o.enumerable});return e};var fe=(e,t,a)=>(a=e!=null?Jn(Yn(e)):{},Si(t||!e||!e.__esModule?ao(a,"default",{value:e,enumerable:!0}):a,e)),ts=e=>Si(ao({},"__esModule",{value:!0}),e);var Al={};es(Al,{default:()=>Rn});module.exports=ts(Al);var yi=require("react"),Mo=require("motion/react");var Fi=require("clsx");var Oo="-",as=e=>{let t=is(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{let n=s.split(Oo);return n[0]===""&&n.length!==1&&n.shift(),Pi(n,t)||os(s)},getConflictingClassGroupIds:(s,n)=>{let m=a[s]||[];return n&&o[s]?[...m,...o[s]]:m}}},Pi=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?Pi(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Oo);return t.validators.find(({validator:s})=>s(r))?.classGroupId},Ti=/^\[(.+)\]$/,os=e=>{if(Ti.test(e)){let t=Ti.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},is=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return ns(Object.entries(e.classGroups),a).forEach(([r,s])=>{Bo(s,o,r,t)}),o},Bo=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:ki(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(rs(i)){Bo(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,s])=>{Bo(s,ki(t,r),a,o)})})},ki=(e,t)=>{let a=e;return t.split(Oo).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},rs=e=>e.isThemeGetter,ns=(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(([s,n])=>[t+s,n])):r);return[a,i]}):e,ss=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(r,s)=>{a.set(r,s),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let s=a.get(r);if(s!==void 0)return s;if((s=o.get(r))!==void 0)return i(r,s),s},set(r,s){a.has(r)?a.set(r,s):i(r,s)}}},Ri="!",ls=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,s=n=>{let m=[],p=0,l=0,g;for(let u=0;u<n.length;u++){let h=n[u];if(p===0){if(h===i&&(o||n.slice(u,u+r)===t)){m.push(n.slice(l,u)),l=u+r;continue}if(h==="/"){g=u;continue}}h==="["?p++:h==="]"&&p--}let f=m.length===0?n:n.substring(l),x=f.startsWith(Ri),b=x?f.substring(1):f,R=g&&g>l?g-l:void 0;return{modifiers:m,hasImportantModifier:x,baseClassName:b,maybePostfixModifierPosition:R}};return a?n=>a({className:n,parseClassName:s}):s},ds=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},cs=e=>({cache:ss(e.cacheSize),parseClassName:ls(e),...as(e)}),ms=/\s+/,ps=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],s=e.trim().split(ms),n="";for(let m=s.length-1;m>=0;m-=1){let p=s[m],{modifiers:l,hasImportantModifier:g,baseClassName:f,maybePostfixModifierPosition:x}=a(p),b=!!x,R=o(b?f.substring(0,x):f);if(!R){if(!b){n=p+(n.length>0?" "+n:n);continue}if(R=o(f),!R){n=p+(n.length>0?" "+n:n);continue}b=!1}let u=ds(l).join(":"),h=g?u+Ri:u,F=h+R;if(r.includes(F))continue;r.push(F);let D=i(R,b);for(let N=0;N<D.length;++N){let q=D[N];r.push(h+q)}n=p+(n.length>0?" "+n:n)}return n};function us(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Ai(t))&&(o&&(o+=" "),o+=a);return o}var Ai=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Ai(e[o]))&&(a&&(a+=" "),a+=t);return a};function gs(e,...t){let a,o,i,r=s;function s(m){let p=t.reduce((l,g)=>g(l),e());return a=cs(p),o=a.cache.get,i=a.cache.set,r=n,n(m)}function n(m){let p=o(m);if(p)return p;let l=ps(m,a);return i(m,l),l}return function(){return r(us.apply(null,arguments))}}var Te=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Ei=/^\[(?:([a-z-]+):)?(.+)\]$/i,fs=/^\Bi+\/\Bi+$/,vs=new Set(["px","full","screen"]),hs=/^(\Bi+(\.\Bi+)?)?(xs|sm|md|lg|xl)$/,bs=/\Bi+(%|px|r?em|[sdl]?v([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$/,xs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ys=/^(inset_)?-?((\Bi+)?\.?(\Bi+)[a-z]+|0)Bi-?((\Bi+)?\.?(\Bi+)[a-z]+|0)/,ws=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lt=e=>xa(e)||vs.has(e)||fs.test(e),$t=e=>ya(e,"length",Rs),xa=e=>!!e&&!Number.isNaN(Number(e)),Lo=e=>ya(e,"number",xa),Ba=e=>!!e&&Number.isInteger(Number(e)),Ns=e=>e.endsWith("%")&&xa(e.slice(0,-1)),Y=e=>Ei.test(e),_t=e=>hs.test(e),Cs=new Set(["length","size","percentage"]),Ds=e=>ya(e,Cs,Mi),Ss=e=>ya(e,"position",Mi),Ts=new Set(["image","url"]),ks=e=>ya(e,Ts,Es),Ps=e=>ya(e,"",As),Oa=()=>!0,ya=(e,t,a)=>{let o=Ei.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Rs=e=>bs.test(e)&&!xs.test(e),Mi=()=>!1,As=e=>ys.test(e),Es=e=>ws.test(e);var Ms=()=>{let e=Te("colors"),t=Te("spacing"),a=Te("blur"),o=Te("brightness"),i=Te("borderColor"),r=Te("borderRadius"),s=Te("borderSpacing"),n=Te("borderWidth"),m=Te("contrast"),p=Te("grayscale"),l=Te("hueRotate"),g=Te("invert"),f=Te("gap"),x=Te("gradientColorStops"),b=Te("gradientColorStopPositions"),R=Te("inset"),u=Te("margin"),h=Te("opacity"),F=Te("padding"),D=Te("saturate"),N=Te("scale"),q=Te("sepia"),A=Te("skew"),K=Te("space"),W=Te("translate"),V=()=>["auto","contain","none"],ae=()=>["auto","hidden","clip","visible","scroll"],le=()=>["auto",Y,t],I=()=>[Y,t],he=()=>["",Lt,$t],C=()=>["auto",xa,Y],S=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],be=()=>["start","end","center","between","around","evenly","stretch"],we=()=>["","0",Y],de=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[xa,Y];return{cacheSize:500,separator:":",theme:{colors:[Oa],spacing:[Lt,$t],blur:["none","",_t,Y],brightness:P(),borderColor:[e],borderRadius:["none","","full",_t,Y],borderSpacing:I(),borderWidth:he(),contrast:P(),grayscale:we(),hueRotate:P(),invert:we(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Ns,$t],inset:le(),margin:le(),opacity:P(),padding:I(),saturate:P(),scale:P(),sepia:we(),skew:P(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[_t]}],"break-after":[{"break-after":de()}],"break-before":[{"break-before":de()}],"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:[...S(),Y]}],overflow:[{overflow:ae()}],"overflow-x":[{"overflow-x":ae()}],"overflow-y":[{"overflow-y":ae()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[R]}],"inset-x":[{"inset-x":[R]}],"inset-y":[{"inset-y":[R]}],start:[{start:[R]}],end:[{end:[R]}],top:[{top:[R]}],right:[{right:[R]}],bottom:[{bottom:[R]}],left:[{left:[R]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ba,Y]}],basis:[{basis:le()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:we()}],shrink:[{shrink:we()}],order:[{order:["first","last","none",Ba,Y]}],"grid-cols":[{"grid-cols":[Oa]}],"col-start-end":[{col:["auto",{span:["full",Ba,Y]},Y]}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":[Oa]}],"row-start-end":[{row:["auto",{span:[Ba,Y]},Y]}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...be()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...be(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...be(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],Wt:[{Wt:[F]}],pt:[{pt:[F]}],Bi:[{Bi:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],Bi:[{Bi:[u]}],yi:[{yi:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[K]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[K]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,t]}],"min-w":[{"min-w":[Y,t,"min","max","fit"]}],"max-w":[{"max-w":[Y,t,"none","full","min","max","fit","prose",{screen:[_t]},_t]}],h:[{h:[Y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_t,$t]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Lo]}],"font-family":[{font:[Oa]}],"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",Y]}],"line-clamp":[{"line-clamp":["none",xa,Lo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Lt,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[h]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Lt,$t]}],"underline-offset":[{"underline-offset":["auto",Lt,Y]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],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",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[h]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...S(),Ss]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ds]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ks]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],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-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[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:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:B()}],"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:["",...B()]}],"outline-offset":[{"outline-offset":[Lt,Y]}],"outline-w":[{outline:[Lt,$t]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-w":[{"ring-offset":[Lt,$t]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_t,Ps]}],"shadow-color":[{shadow:[Oa]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",_t,Y]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[g]}],saturate:[{saturate:[D]}],sepia:[{sepia:[q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[D]}],"backdrop-sepia":[{"backdrop-sepia":[q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Y]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Ba,Y]}],"translate-x":[{"translate-x":[W]}],"translate-y":[{"translate-y":[W]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-Bi":[{"scroll-Bi":I()}],"scroll-yi":[{"scroll-yi":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-Wt":[{"scroll-Wt":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-Bi":[{"scroll-Bi":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Lt,$t,Lo]}],stroke:[{stroke:[e,"none"]}],Wt:["Wt-only","not-Wt-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","Wt","pt","Bi","pb","pl"],px:["Bi","pl"],py:["pt","pb"],m:["mx","my","ms","Bi","yi","mr","mb","ml"],mx:["mr","ml"],my:["yi","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-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"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-Bi","scroll-yi","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-yi","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-Wt","scroll-pt","scroll-Bi","scroll-pb","scroll-pl"],"scroll-px":["scroll-Bi","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 Ii=gs(Ms);function w(...e){return Ii((0,Fi.clsx)(e))}var uo=fe(require("react")),jo=fe(require("next/link")),Wt=require("lucide-react");var Li=require("class-variance-authority");var Bi=require("react/jsx-runtime"),Is=(0,Li.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function xe({className:e,variant:t,...a}){return(0,Bi.jsx)("div",{className:w(Is({variant:t}),e),...a})}var Oi=require("@radix-Mo/react-slot"),Ui=fe(require("react")),Ha=(0,Li.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"}}}),T=Ui.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,Bi.jsx)(e?Oi.Slot:"button",{className:w(Ha({className:t,size:a,variant:o})),ref:r,...i}));T.displayName="Button";var zi=fe(require("react"));var ce=zi.forwardRef(({className:e,type:t,...a},o)=>(0,Bi.jsx)("input",{type:t,className:w("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}));ce.displayName="Input";var Ho=fe(require("react")),pt=fe(require("@radix-Mo/react-scroll-area"));var wa=Ho.forwardRef(({className:e,children:t,...a},o)=>(0,Bi.jsxs)(pt.Root,{ref:o,className:w("relative overflow-hidden",e),...a,children:[(0,Bi.jsx)(pt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Bi.jsx)($i,{}),(0,Bi.jsx)(pt.Corner,{})]}));wa.displayName=pt.Root.displayName;var $i=Ho.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Bi.jsx)(pt.ScrollAreaScrollbar,{ref:o,orientation:t,className:w("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,Bi.jsx)(pt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));$i.displayName=pt.ScrollAreaScrollbar.displayName;var Ua=fe(require("react")),je=fe(require("@radix-Mo/react-dialog"));var $e=je.Root;var Uo=je.Portal;var oo=Ua.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(je.Overlay,{ref:a,className:w("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));oo.displayName=je.Overlay.displayName;var Ke=Ua.forwardRef(({className:e,children:t,...a},o)=>(0,Bi.jsxs)(Uo,{children:[(0,Bi.jsx)(oo,{}),(0,Bi.jsxs)(je.Content,{ref:o,className:w("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,Bi.jsxs)(je.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,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{className:"Wt-only",children:"Close"})]})]})]}));Ke.displayName=je.Content.displayName;var qe=({className:e,...t})=>(0,Bi.jsx)("div",{className:w("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});qe.displayName="DialogHeader";var Va=({className:e,...t})=>(0,Bi.jsx)("div",{className:w("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Va.displayName="DialogFooter";var Le=Ua.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(je.Title,{ref:a,className:w("text-lg font-semibold leading-none tracking-tight",e),...t}));Le.displayName=je.Title.displayName;var Fs=Ua.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(je.Description,{ref:a,className:w("text-sm text-muted-foreground",e),...t}));Fs.displayName=je.Description.displayName;var za=fe(require("@radix-Mo/react-checkbox")),Wi=fe(require("react")),Vo=Wi.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(za.Root,{className:w("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,Bi.jsx)(za.Indicator,{className:w("flex items-center justify-center text-current"),children:(0,Bi.jsx)(Wt.Check,{className:"h-4 w-4"})})}));Vo.displayName=za.Root.displayName;var Dt=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date}),qi=[{id:"home",title:"Home",icon:(0,Bi.jsx)(Wt.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,Bi.jsx)(Wt.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,Bi.jsx)(Wt.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with Wt",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,Bi.jsx)(Wt.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,Bi.jsx)(Wt.FileText,{}),url:"/knowledge"}],Ji=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project is due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated to version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You'Bi used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' is now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}],Zi=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Bi.jsx)(Wt.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Bi.jsx)(Wt.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Bi.jsx)(Wt.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Bi.jsx)(Wt.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"Bi",name:"Human Resources",description:"People operations and talent management",icon:(0,Bi.jsx)(Wt.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Bi.jsx)(Wt.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Bi.jsx)(Wt.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Bi.jsx)(Wt.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Bi.jsx)(Wt.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Bi.jsx)(Wt.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],so=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var zo=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],ro=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],co=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Ls=[...co,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],Bs=[...so,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],no={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},Ki={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:co.filter(e=>e.epicId==="1")};var hd={empty:{initialProjects:no.projects,initialEpics:no.epics,initialSprints:no.sprints,initialTasks:no.tasks},default:{initialProjects:so,initialEpics:zo,initialSprints:ro,initialTasks:co},highDensity:{initialProjects:so,initialEpics:zo,initialSprints:ro,initialTasks:Ls},singleEpic:{initialProjects:so,initialEpics:Ki.epics,initialSprints:ro,initialTasks:Ki.tasks},multipleProjects:{initialProjects:Bs,initialEpics:zo,initialSprints:ro,initialTasks:co}},lo=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(Dt),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Dt),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Dt),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Dt),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(Dt),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Dt),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Dt),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Dt),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Dt),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Dt),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],bd=[{id:"1",title:"Review quarterly report",description:"Bi through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:lo.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:lo.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:lo.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var xd=lo.filter(e=>e.type==="digital");function po(e,t){let[a,o]=(0,yi.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,yi.useEffect)(()=>{i(a)},[]),[a,i]}function $o({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:i=Zi[0],onBusinessUnitChange:r,onSearch:s,className:n,logo:m="/headerlogo.png",appName:p="Nuvia",tagline:l="Collaboration Platform"}){let[g,f]=uo.useState({}),[x,b]=po("sidebar-favorites",{}),[R,u]=uo.useState(null),[h,F]=uo.useState(""),D=C=>{f(S=>({...S,[C]:!S[C]}))},N=C=>{r?.(C)},q=()=>{h.trim()&&s?.(h.trim())},A=C=>{C.key==="Enter"&&(C.preventDefault(),q())},K=(C,S)=>{let B=x[C]||[],Q=B.includes(S)?B.filter(be=>be!==S):B.concat(S);b({...x,[C]:Q})},W=C=>{if(!C.items||!C.maxItems||C.items.length<=C.maxItems)return C.items||[];let S=x[C.id]||[],B=C.items.filter(be=>S.includes(be.id)),Q=C.items.filter(be=>!S.includes(be.id));return[...B,...Q].slice(0,C.maxItems)},V=C=>C.maxItems&&C.items&&C.items.length>C.maxItems,ae=e,le=C=>{let S=V(C),B=W(C),Q=(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[C.icon,(0,Bi.jsx)("span",{children:C.title})]}),C.badge&&(0,Bi.jsx)(xe,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:C.badge}),C.items&&(0,Bi.jsx)(Wt.ChevronDown,{className:w("ml-2 h-4 w-4 transition-transform",g[C.title]?"rotate-180":"")})]}),be=w("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",C.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return C.url?(0,Bi.jsx)(jo.default,{href:C.url,className:be,onClick:a?o:void 0,children:Q}):(0,Bi.jsx)("button",{className:be,onClick:()=>C.items&&D(C.title),children:Q})},I=()=>{let C=e.find(B=>B.id===R);if(!C||!C.items||!C.maxItems)return null;let S=x[C.id]||[];return(0,Bi.jsx)($e,{open:!!R,onOpenChange:B=>!B&&u(null),children:(0,Bi.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Bi.jsxs)(qe,{children:[(0,Bi.jsxs)(Le,{children:["Manage ",C.title," Favorites"]}),(0,Bi.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",C.maxItems," items to show in ",C.title.toLowerCase(),"."]})]}),(0,Bi.jsx)(wa,{className:"max-h-96 Bi-4",children:(0,Bi.jsx)("div",{className:"space-y-4",children:C.items.map(B=>(0,Bi.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Bi.jsx)(Vo,{id:B.id,checked:S.includes(B.id),onCheckedChange:()=>K(C.id,B.id),disabled:!S.includes(B.id)&&S.length>=(C.maxItems||0)}),(0,Bi.jsxs)("label",{htmlFor:B.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[B.title,B.badge&&(0,Bi.jsx)(xe,{variant:"outline",className:"text-xs",children:B.badge})]})]},B.id))})})]})})},he=(0,Bi.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Bi.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Bi.jsx)("img",{src:m,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("h2",{className:"font-semibold",children:p}),(0,Bi.jsx)("p",{className:"text-xs text-muted-foreground",children:l})]})]}),a&&(0,Bi.jsx)(T,{variant:"ghost",size:"icon",onClick:o,children:(0,Bi.jsx)(Wt.Bi,{className:"h-5 w-5"})})]}),(0,Bi.jsx)("div",{className:"px-3 py-2",children:(0,Bi.jsxs)("div",{className:"relative",children:[(0,Bi.jsx)(Wt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Bi.jsx)(ce,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 Bi-4 py-2",value:h,onChange:C=>F(C.target.value),onKeyPress:A})]})}),(0,Bi.jsx)(wa,{className:"flex-1 px-3 py-2",children:(0,Bi.jsx)("div",{className:"space-y-1",children:ae.map(C=>(0,Bi.jsxs)("div",{className:"mb-1",children:[le(C),C.items&&g[C.title]&&(0,Bi.jsxs)("div",{className:"yi-1 ml-6 space-y-1 border-l pl-3",children:[W(C).map(S=>(0,Bi.jsxs)(jo.default,{href:S.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[S.title,S.badge&&(0,Bi.jsx)(xe,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:S.badge})]},S.id)),V(C)&&C.items&&C.items.length>W(C).length&&(0,Bi.jsxs)("button",{onClick:()=>u(C.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",C.items.length-W(C).length," more available"]})]})]},C.id))})}),(0,Bi.jsx)("div",{className:"p-3",children:(0,Bi.jsx)("div",{className:"space-y-1",children:(0,Bi.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Bi.jsx)(Wt.Settings,{className:"h-5 w-5"}),(0,Bi.jsx)("span",{children:"Settings"})]})})}),(0,Bi.jsx)(I,{})]});return a?(0,Bi.jsx)("div",{className:w("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:he}):(0,Bi.jsx)("div",{className:w("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:he})}var go=fe(require("react")),Bt=fe(require("@radix-Mo/react-avatar"));var ja=go.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(Bt.Root,{ref:a,className:w("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ja.displayName=Bt.Root.displayName;var _o=go.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(Bt.Image,{ref:a,className:w("aspect-square h-full w-full",e),...t}));_o.displayName=Bt.Image.displayName;var $a=go.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(Bt.Fallback,{ref:a,className:w("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));$a.displayName=Bt.Fallback.displayName;var Xi=fe(require("react")),yt=fe(require("@radix-Mo/react-tooltip"));var Kt=yt.Provider,qt=yt.Root,Jt=yt.Trigger,Ot=Xi.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Bi.jsx)(yt.Portal,{children:(0,Bi.jsx)(yt.Content,{ref:o,sideOffset:t,className:w("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs 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})}));Ot.displayName=yt.Content.displayName;var Yi=require("next-themes");function Qi(){let{setTheme:e,theme:t}=(0,Yi.useTheme)();return(0,Bi.jsx)(Kt,{children:(0,Bi.jsxs)(qt,{children:[(0,Bi.jsx)(Jt,{asChild:!0,children:(0,Bi.jsxs)(T,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Bi.jsx)(Wt.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Bi.jsx)(Wt.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Bi.jsx)("span",{className:"Wt-only",children:"Toggle theme"})]})}),(0,Bi.jsx)(Ot,{children:"Toggle theme"})]})})}function er({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:i,className:r}){let s=e.filter(p=>!p.read),n=s.length,m=p=>{switch(p){case"info":return(0,Bi.jsx)(Wt.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Bi.jsx)(Wt.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Bi.jsx)(Wt.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Bi.jsx)(Wt.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Bi.jsx)(Mo.AnimatePresence,{children:t&&(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsx)(Mo.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Bi.jsx)(Mo.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:w("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,Bi.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)(Wt.Bell,{className:"h-5 w-5"}),(0,Bi.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,Bi.jsxs)(xe,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,Bi.jsxs)(T,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Bi.jsx)(Wt.Bi,{className:"h-5 w-5"}),(0,Bi.jsx)("span",{className:"Wt-only",children:"Close"})]})]}),n>0&&(0,Bi.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Bi.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,Bi.jsx)(T,{variant:"ghost",size:"sm",onClick:i,className:"text-sm",children:"Dismiss all"})]}),s.length>0?(0,Bi.jsx)(wa,{className:"flex-1",children:(0,Bi.jsx)("div",{className:"divide-y",children:s.map(p=>(0,Bi.jsxs)("div",{className:w("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Bi.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:m(p.type)}),(0,Bi.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("p",{className:"font-medium",children:p.title}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("p",{className:"text-xs text-muted-foreground",children:p.time}),(0,Bi.jsx)(T,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(p.id),title:"Dismiss",children:(0,Bi.jsx)(Wt.Check,{className:"h-3 w-3"})})]})]}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground",children:p.description}),p.actionLabel&&(0,Bi.jsxs)(T,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:p.onAction,children:[p.actionLabel,(0,Bi.jsx)(Wt.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},p.id))})}):(0,Bi.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Bi.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Bi.jsx)(Wt.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Bi.jsx)("h3",{className:"yi-4 text-lg font-medium",children:"No notifications"}),(0,Bi.jsx)("p",{className:"yi-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var na=fe(require("@radix-Mo/react-tabs"));function tr({className:e,...t}){return(0,Bi.jsx)(na.Root,{"data-slot":"tabs",className:w("flex flex-col gap-2",e),...t})}function ar({className:e,...t}){return(0,Bi.jsx)(na.List,{"data-slot":"tabs-list",className:w("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function or({className:e,...t}){return(0,Bi.jsx)(na.Trigger,{"data-slot":"tabs-trigger",className:w("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 Ht=fe(require("react")),ne=fe(require("@radix-Mo/react-dropdown-menu")),Na=require("@radix-Mo/react-icons");var Ca=ne.Root,Da=ne.Trigger;var Os=Ht.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,Bi.jsxs)(ne.SubTrigger,{ref:i,className:w("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,Bi.jsx)(Na.ChevronRightIcon,{className:"ml-auto"})]}));Os.displayName=ne.SubTrigger.displayName;var Hs=Ht.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(ne.SubContent,{ref:a,className:w("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Hs.displayName=ne.SubContent.displayName;var sa=Ht.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Bi.jsx)(ne.Portal,{children:(0,Bi.jsx)(ne.Content,{ref:o,sideOffset:t,className:w("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));sa.displayName=ne.Content.displayName;var la=Ht.forwardRef(({className:e,inset:t,...a},o)=>(0,Bi.jsx)(ne.Item,{ref:o,className:w("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}));la.displayName=ne.Item.displayName;var Us=Ht.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,Bi.jsxs)(ne.CheckboxItem,{ref:i,className:w("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Bi-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,Bi.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Bi.jsx)(ne.ItemIndicator,{children:(0,Bi.jsx)(Na.CheckIcon,{className:"h-4 w-4"})})}),t]}));Us.displayName=ne.CheckboxItem.displayName;var Vs=Ht.forwardRef(({className:e,children:t,...a},o)=>(0,Bi.jsxs)(ne.RadioItem,{ref:o,className:w("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Bi-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,Bi.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Bi.jsx)(ne.ItemIndicator,{children:(0,Bi.jsx)(Na.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Vs.displayName=ne.RadioItem.displayName;var zs=Ht.forwardRef(({className:e,inset:t,...a},o)=>(0,Bi.jsx)(ne.Label,{ref:o,className:w("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));zs.displayName=ne.Label.displayName;var js=Ht.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(ne.Separator,{ref:a,className:w("-mx-1 my-1 h-px bg-muted",e),...t}));js.displayName=ne.Separator.displayName;var $s=({className:e,...t})=>(0,Bi.jsx)("span",{className:w("ml-auto text-xs tracking-widest opacity-60",e),...t});$s.displayName="DropdownMenuShortcut";function bo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let s=a.find(n=>n.value===e);return(0,Bi.jsxs)(Mo.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,Bi.jsx)("div",{className:"hidden lg:block",children:(0,Bi.jsx)(tr,{value:e,onValueChange:t,children:(0,Bi.jsx)(ar,{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(n=>(0,Bi.jsx)(Mo.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Bi.jsx)(or,{value:n.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:n.label})},n.value))})})}),(0,Bi.jsx)("div",{className:"lg:hidden",children:(0,Bi.jsxs)(Ca,{children:[(0,Bi.jsx)(Da,{asChild:!0,children:(0,Bi.jsxs)(T,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[s?.label||"Select",(0,Bi.jsx)(Wt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Bi.jsx)(sa,{align:"center",className:"w-[180px]",children:a.map(n=>(0,Bi.jsx)(la,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function rr({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:i=!0,className:r,activeTab:s="assistant",onTabChange:n,showTabs:m=!0,tabOptions:p=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:l,actionIcon:g=(0,Bi.jsx)(Wt.Bot,{className:"mr-2 h-4 w-4"}),actionText:f="Action",onNotificationRemove:x,onRemoveAll:b,logo:R="/headerlogo.png",appName:u="Nuvia",tagline:h="Collaboration Platform"}){let[F,D]=(0,yi.useState)(!1),[N,q]=(0,yi.useState)(t),A=N.filter(V=>!V.read).length,K=V=>{q(ae=>ae.filter(le=>le.id!==V)),x?.(V)},W=()=>{q(V=>V.filter(ae=>ae.read)),b?.()};return(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 Bi-4 backdrop-blur ${r||""}`,children:[(0,Bi.jsx)(T,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Bi.jsx)(Wt.Menu,{className:"h-5 w-5"})}),(0,Bi.jsx)(T,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Bi.jsx)(Wt.PanelLeft,{className:"h-5 w-5"})}),!i&&(0,Bi.jsxs)(Mo.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Bi.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Bi.jsx)("img",{src:R,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("h2",{className:"font-semibold text-sm",children:u}),(0,Bi.jsx)("p",{className:"text-xs text-muted-foreground",children:h})]})]}),(0,Bi.jsxs)("div",{className:"flex flex-1 items-center",children:[m&&(0,Bi.jsx)(bo,{activeTab:s,onTabChange:n,tabOptions:p}),(0,Bi.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Bi.jsx)(Mo.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Bi.jsx)(Mo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Bi.jsxs)(T,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:l,children:[g,f]})})}),(0,Bi.jsx)(Qi,{}),(0,Bi.jsx)(Kt,{children:(0,Bi.jsxs)(qt,{children:[(0,Bi.jsx)(Jt,{asChild:!0,children:(0,Bi.jsx)(Mo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Bi.jsxs)(T,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>D(!0),children:[(0,Bi.jsx)(Mo.motion.div,{animate:A>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:A>0?1/0:0,repeatDelay:3},children:(0,Bi.jsx)(Wt.Bell,{className:"h-5 w-5"})}),A>0&&(0,Bi.jsx)(Mo.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:A})]})})}),(0,Bi.jsx)(Ot,{children:"Notifications"})]})}),(0,Bi.jsx)(Mo.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Bi.jsxs)(ja,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Bi.jsx)(_o,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Bi.jsx)($a,{})]})})]})]})]}),(0,Bi.jsx)(er,{notifications:N,open:F,onClose:()=>D(!1),onNotificationRemove:K,onRemoveAll:W})]})}var nr=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Bi.jsx)(Wt.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function lr({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:i=nr[0],onBusinessUnitChange:r,onSearch:s,businessUnits:n=nr,activeTab:m,onTabChange:p,showTabs:l=!1,onActionClick:g,actionIcon:f,actionText:x="Action",onNotificationRemove:b,onRemoveAll:R,logo:u="/headerlogo.png",appName:h="Nuvia",tagline:F="Collaboration Platform",sidebarInitiallyClosed:D=!1}){let[N,q]=(0,yi.useState)(!D),[A,K]=(0,yi.useState)(!1),[W,V]=(0,yi.useState)(i),ae=le=>{V(le),r?.(le)};return(0,Bi.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[A&&(0,Bi.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>K(!1)}),(0,Bi.jsx)("div",{className:"md:hidden",children:(0,Bi.jsx)($o,{items:e,isOpen:A,isMobile:!0,onClose:()=>K(!1),currentBusinessUnit:W,onBusinessUnitChange:ae,onSearch:s,logo:u,appName:h,tagline:F})}),(0,Bi.jsx)("div",{className:"hidden md:block",children:(0,Bi.jsx)($o,{items:e,isOpen:N,isMobile:!1,currentBusinessUnit:W,onBusinessUnitChange:ae,onSearch:s,logo:u,appName:h,tagline:F})}),(0,Bi.jsxs)("div",{className:w("min-h-screen fixed w-full transition-all duration-300 ease-in-out",N?"md:pl-64":"md:pl-0"),children:[(0,Bi.jsx)(rr,{title:a,notifications:o,onToggleSidebar:()=>q(!N),onToggleMobileMenu:()=>K(!0),sidebarOpen:N,activeTab:m,onTabChange:p,showTabs:l,onActionClick:g,actionIcon:f,actionText:x,onNotificationRemove:b,onRemoveAll:R,logo:u,appName:h,tagline:F}),(0,Bi.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var _s=[{key:"kanban",icon:Wt.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Wt.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Wt.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Wt.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Wt.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],dr=({currentView:e,onViewChange:t,children:a})=>(0,Bi.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Bi.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:_s.map(o=>{let i=o.icon,r=e===o.key;return(0,Bi.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Bi.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,Bi.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Bi.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Bi.jsx)("div",{className:"w-full h-full",children:a})})]});var Ce=fe(require("react"));var da=fe(require("react"));var ke=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ke.displayName="Card";var Gs=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("flex flex-col space-y-1.5 p-6",e),...t}));Gs.displayName="CardHeader";var Ws=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("font-semibold leading-none tracking-tight",e),...t}));Ws.displayName="CardTitle";var Ks=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("text-sm text-muted-foreground",e),...t}));Ks.displayName="CardDescription";var Sa=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("p-6 pt-0",e),...t}));Sa.displayName="CardContent";var qs=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("flex items-center p-6 pt-0",e),...t}));qs.displayName="CardFooter";var cr=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1,height:s})=>{let n=l=>{l.preventDefault()},m=l=>{l.preventDefault(),i(t)};return(0,Bi.jsxs)(ke,{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-xs":""}`,style:{height:s||"calc(100vh - 350px)"},onDragOver:n,onDrop:m,children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Bi.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Bi.jsx)(xe,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Bi.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Ga=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=l=>{a(e)},s=()=>{o(e)},n=()=>{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"}},m=()=>{switch(e.type){case"story":return(0,Bi.jsx)(Wt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Bi.jsx)(Wt.Bug,{className:"h-3 w-3"});case"spike":return(0,Bi.jsx)(Wt.Zap,{className:"h-3 w-3"});case"task":default:return(0,Bi.jsx)(Wt.AlertCircle,{className:"h-3 w-3"})}},p=()=>{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,Bi.jsx)(ke,{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:s,children:(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:m()}),(0,Bi.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Bi.jsxs)(ke,{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:s,children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Bi.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[m(),(0,Bi.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Bi.jsxs)("div",{className:"flex gap-1",children:[(0,Bi.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,Bi.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,Bi.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Bi.jsx)(Wt.User,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Bi.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var mr=fe(require("react")),Be=mr.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("textarea",{className:w("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}));Be.displayName="Textarea";var se=fe(require("@radix-Mo/react-select")),Yt=fe(require("react")),it=se.Root;var wt=se.Value,Qe=Yt.forwardRef(({children:e,className:t,...a},o)=>(0,Bi.jsxs)(se.Trigger,{className:w("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,Bi.jsx)(se.Icon,{asChild:!0,children:(0,Bi.jsx)(Wt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Qe.displayName=se.Trigger.displayName;var ur=Yt.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(se.ScrollUpButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Bi.jsx)(Wt.ChevronUp,{className:"h-4 w-4"})}));ur.displayName=se.ScrollUpButton.displayName;var gr=Yt.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(se.ScrollDownButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Bi.jsx)(Wt.ChevronDown,{className:"h-4 w-4"})}));gr.displayName=se.ScrollDownButton.displayName;var et=Yt.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,Bi.jsx)(se.Portal,{children:(0,Bi.jsxs)(se.Content,{className:w("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",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,Bi.jsx)(ur,{}),(0,Bi.jsx)(se.Viewport,{className:w("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Bi.jsx)(gr,{})]})}));et.displayName=se.Content.displayName;var Js=Yt.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(se.Label,{className:w("py-1.5 pl-8 Bi-2 text-sm font-semibold",e),ref:a,...t}));Js.displayName=se.Label.displayName;var Pe=Yt.forwardRef(({children:e,className:t,...a},o)=>(0,Bi.jsxs)(se.Item,{className:w("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 Bi-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,Bi.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Bi.jsx)(se.ItemIndicator,{children:(0,Bi.jsx)(Wt.Check,{className:"h-4 w-4"})})}),(0,Bi.jsx)(se.ItemText,{children:e})]}));Pe.displayName=se.Item.displayName;var Zs=Yt.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(se.Separator,{className:w("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Zs.displayName=se.Separator.displayName;var fr=fe(require("react")),qo=fe(require("@radix-Mo/react-label"));var Xs=(0,Li.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),z=fr.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(qo.Root,{ref:a,className:w(Xs(),e),...t}));z.displayName=qo.Root.displayName;var ua=fe(require("react")),Ta=fe(require("@radix-Mo/react-toggle-group"));var br=fe(require("react")),Jo=fe(require("@radix-Mo/react-toggle"));var Zo=(0,Li.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"}}),Ys=br.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,Bi.jsx)(Jo.Root,{ref:i,className:w(Zo({variant:t,size:a,className:e})),...o}));Ys.displayName=Jo.Root.displayName;var wr=ua.createContext({size:"default",variant:"default"}),ga=ua.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,Bi.jsx)(Ta.Root,{ref:r,className:w("flex items-center justify-center gap-1",e),...i,children:(0,Bi.jsx)(wr.Provider,{value:{variant:t,size:a},children:o})}));ga.displayName=Ta.Root.displayName;var fa=ua.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let s=ua.useContext(wr);return(0,Bi.jsx)(Ta.Item,{ref:r,className:w(Zo({variant:s.variant||a,size:s.size||o}),e),...i,children:t})});fa.displayName=Ta.Item.displayName;var Qs=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Wt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Wt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Wt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Wt.Zap}],el=[{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"}],ka=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:s})=>{let[n,m]=(0,yi.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,yi.useEffect)(()=>{e&&s&&m(g=>({...g,epic:s}))},[e,s]),(0,yi.useEffect)(()=>{e&&m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:s||"",sprint:"none",assignee:""})},[e]);let p=g=>{g.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:s||"",sprint:"",assignee:""}),t())},l=(g,f)=>{m(x=>({...x,[g]:f}))};return(0,Bi.jsx)($e,{open:e,onOpenChange:t,children:(0,Bi.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Add New Task"})}),(0,Bi.jsxs)("form",{onSubmit:p,className:"space-y-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"name",children:"Task Title"}),(0,Bi.jsx)(ce,{id:"name",value:n.name,onChange:g=>l("name",g.target.value),placeholder:"Enter task title",required:!0})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"description",children:"Description"}),(0,Bi.jsx)(Be,{id:"description",value:n.description,onChange:g=>l("description",g.target.value),placeholder:"Enter task description",rows:3})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Type"}),(0,Bi.jsx)(ga,{type:"single",value:n.type||"",onValueChange:g=>g&&l("type",g),children:Qs.map(g=>{let f=g.icon;return(0,Bi.jsxs)(fa,{value:g.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Bi.jsx)(f,{className:"h-4 w-4"}),g.label]},g.value)})})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Priority"}),(0,Bi.jsx)(ga,{type:"single",value:n.priority||"",onValueChange:g=>g&&l("priority",g),children:el.map(g=>(0,Bi.jsx)(fa,{value:g.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:g.label},g.value))})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"points",children:"Story Points"}),(0,Bi.jsx)(ce,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:g=>l("storyPoints",parseInt(g.target.value)||1),placeholder:"Enter story points",required:!0})]}),!s&&(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"epic",children:"Epic"}),(0,Bi.jsxs)(it,{value:n.epic,onValueChange:g=>l("epic",g),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{placeholder:"Select an epic"})}),(0,Bi.jsx)(et,{children:o.map(g=>(0,Bi.jsx)(Pe,{value:g.id.toString(),children:(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("div",{className:`w-3 h-3 rounded-full ${g.color}`}),g.name]})},g.id))})]})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Bi.jsxs)(it,{value:n.sprint,onValueChange:g=>l("sprint",g),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{placeholder:"Select a sprint"})}),(0,Bi.jsxs)(et,{children:[(0,Bi.jsx)(Pe,{value:"none",children:"No Sprint"}),i.map(g=>(0,Bi.jsx)(Pe,{value:g.id.toString(),children:(0,Bi.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"sprint",children:"Assignee"}),(0,Bi.jsxs)(it,{value:n.assignee,onValueChange:g=>l("assignee",g),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{placeholder:"Select an Assignee"})}),(0,Bi.jsxs)(et,{children:[(0,Bi.jsx)(Pe,{value:"none",children:"No Assignee"}),r.map(g=>(0,Bi.jsx)(Pe,{value:g.id.toString(),children:(0,Bi.jsx)("div",{className:"flex items-center gap-2",children:g.name})},g.id))]})]})]}),(0,Bi.jsxs)(Va,{children:[(0,Bi.jsx)(T,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Bi.jsx)(T,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Ka=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:s=!1})=>{let[n,m]=(0,yi.useState)(!1),[p,l]=(0,yi.useState)(""),g=()=>{s||(m(!0),l(t))},f=async()=>{p!==t&&await i(e,p),m(!1)},x=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?f():b.key==="Escape"&&(m(!1),l(""))};return(0,Bi.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Bi.jsx)(z,{children:a}),n?o?(0,Bi.jsx)(Be,{value:p,onChange:b=>l(b.target.value),onBlur:f,onKeyDown:x,autoFocus:!0,rows:4,className:"resize-none"}):(0,Bi.jsx)(ce,{value:p,onChange:b=>l(b.target.value),onBlur:f,onKeyPress:x,autoFocus:!0,className:"text-lg font-medium"}):(0,Bi.jsxs)("div",{onClick:g,className:`${s?"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,Bi.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!s&&(0,Bi.jsx)(Wt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Dr=({comments:e,onAddComment:t})=>{let[a,o]=(0,yi.useState)(""),i=s=>s.split(" ").map(n=>n[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,Bi.jsxs)("div",{className:"space-y-4",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)(Wt.MessageSquare,{className:"h-5 w-5"}),(0,Bi.jsx)(z,{className:"text-lg font-medium",children:"Comments"}),(0,Bi.jsx)(xe,{variant:"secondary",children:e.length})]}),(0,Bi.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(s=>(0,Bi.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Bi.jsx)(ja,{className:"h-8 w-8 yi-1",children:(0,Bi.jsx)($a,{className:"text-xs bg-muted text-muted-foreground",children:i(s.author)})}),(0,Bi.jsxs)("div",{className:"flex-1",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Bi.jsx)("span",{className:"font-medium text-sm",children:s.author}),(0,Bi.jsxs)("span",{className:"text-xs text-muted-foreground",children:[s.createdAt.toLocaleDateString()," Wt ",s.createdAt.toLocaleTimeString()]})]}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground",children:s.text})]})]},s.id))}),(0,Bi.jsxs)("div",{className:"flex gap-2",children:[(0,Bi.jsx)(Be,{value:a,onChange:s=>o(s.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Bi.jsx)(T,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Bi.jsx)(Wt.Send,{className:"h-4 w-4"})})]})]})};var No=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[s,n]=(0,yi.useState)(!1),m=o.find(l=>l.value===t);return(0,Bi.jsxs)("div",{className:"space-y-1",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:e}),(0,Bi.jsxs)(it,{value:t,onValueChange:a,open:s,onOpenChange:l=>{r||n(l)},disabled:r,children:[(0,Bi.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Bi.jsxs)(xe,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&n(!s),children:[i&&m?.color&&(0,Bi.jsx)("div",{className:`w-2 h-2 rounded-full ${m.color} mr-1`}),m?.label||"Select..."]})}),(0,Bi.jsx)(et,{children:o.map(l=>(0,Bi.jsx)(Pe,{value:l.value,children:i&&l.color?(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.label]}):l.label},l.value))})]})]})};var Tr=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:s=!1})=>{let[n,m]=(0,yi.useState)(!1),[p,l]=(0,yi.useState)(""),g=o.find(u=>u.value===t),f=o.filter(u=>u.label.toLowerCase().includes(p.toLowerCase())),x=u=>{a(u),m(!1),l("")},b=()=>{r&&p.trim()&&!o.find(u=>u.value===p.trim())&&(a(p.trim()),m(!1),l(""))};return(0,Bi.jsxs)("div",{className:"space-y-1",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:e}),(0,Bi.jsxs)(it,{value:t,onValueChange:x,open:n,onOpenChange:u=>{s||m(u)},disabled:s,children:[(0,Bi.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Bi.jsx)(xe,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&m(!n),children:g?.label||t||"Select..."})}),(0,Bi.jsxs)(et,{children:[(0,Bi.jsx)("div",{className:"p-2",children:(0,Bi.jsx)(ce,{placeholder:i,value:p,onChange:u=>l(u.target.value),onKeyDown:u=>{u.key==="Enter"&&r&&b()},className:"mb-2"})}),f.map(u=>(0,Bi.jsx)(Pe,{value:u.value,children:u.label},u.value)),r&&p.trim()&&!f.find(u=>u.value===p.trim())&&(0,Bi.jsxs)(Pe,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var Fe=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var tl=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Wt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Wt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Wt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Wt.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"}];var kr=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:s,isUpdating:n=!1,isDeleting:m=!1,deleteState:p="idle",teamMembers:l})=>{let[g,f]=(0,yi.useState)(e.storyPoints),x=(0,yi.useRef)(null),[b,R]=(0,yi.useState)(l);(0,yi.useEffect)(()=>{R(l)},[l]);let u=(0,yi.useCallback)((D,N)=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{i(D,N)},500)},[i]);(0,yi.useEffect)(()=>{u("storyPoints",g?.toString()||"1")},[g]);let h=D=>D.split(" ").map(N=>N[0]).join("").toUpperCase(),F=()=>p==="loading"?(0,Bi.jsxs)(T,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Bi.jsx)(Wt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,Bi.jsxs)(T,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Bi.jsx)(Wt.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,Bi.jsxs)(T,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Bi.jsx)(Wt.Bi,{className:"h-3 w-3"}),"Delete failed"]}):(0,Bi.jsxs)(T,{onClick:s,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||m,children:[(0,Bi.jsx)(Wt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Bi.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Bi.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Bi.jsx)(No,{label:"",value:e.status,onValueChange:D=>i("status",D),options:[{value:"todo",label:"To So"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Bi.jsx)(ga,{type:"single",value:e.type||"",onValueChange:D=>D&&i("type",D),className:"grid grid-cols-2 gap-1",disabled:n,children:tl.map(D=>{let N=D.icon;return(0,Bi.jsxs)(fa,{value:D.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:[(0,Bi.jsx)(N,{className:"h-3 w-3"}),D.label]},D.value)})})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Bi.jsx)(ga,{type:"single",value:e.priority||"",onValueChange:D=>D&&i("priority",D),className:"grid grid-cols-3 gap-1",disabled:n,children:al.map(D=>(0,Bi.jsx)(fa,{value:D.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:D.label},D.value))})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Bi.jsx)("input",{type:"number",min:"1",max:"100",value:g||1,onChange:D=>{let N=Number(D.target.value);N<1?f(1):N>100?f(100):f(N)},className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:n})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Bi.jsx)(No,{label:"",value:Fe(e.epic).toString(),onValueChange:D=>i("epic",D),options:(t||[]).map(D=>({value:D.id.toString(),label:D?.name,color:D.color})),showColor:!0,disabled:n})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Bi.jsx)(No,{label:"",value:Fe(e.sprint).toString()||"none",onValueChange:D=>i("sprint",D==="none"?"":D),options:[{value:"none",label:"No Sprint"},...(a||[]).map(D=>({value:D.id.toString(),label:`${D?.name}`}))],disabled:n})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Bi.jsx)(Tr,{label:"",value:e.assignee?.value?.name,onValueChange:D=>i("assignee",D),options:b.map(D=>({value:`${typeof D.email=="string"?"users":"digital-colleagues"}:${D.id}`,label:D?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,Bi.jsxs)("div",{className:"yi-auto pt-4 space-y-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(T,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:n||m,children:"Close"}),F()]}),(0,Bi.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Bi.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Bi.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Bi.jsx)(Wt.User,{className:"h-3 w-3"}),(0,Bi.jsx)("span",{children:"System"})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Bi.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-3 w-3"}),(0,Bi.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Bi.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Bi.jsx)(Wt.Clock,{className:"h-3 w-3"}),(0,Bi.jsxs)("span",{children:[new Date(o).toLocaleDateString()," Wt"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var hn=fe(require("@radix-Mo/react-dialog"));var Qr=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),en=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),tn=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),an=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),on=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),rn=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),nn=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),So=require("@payloadcms/richtext-lexical/lexical/list"),sn=require("@payloadcms/richtext-lexical/lexical/rich-text"),ln=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Xr=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Xa=require("@payloadcms/richtext-lexical/lexical/utils"),ee=require("@payloadcms/richtext-lexical/lexical"),li=require("@payloadcms/richtext-lexical/lexical/selection");var Or=require("@radix-Mo/react-dialog"),Co=require("@payloadcms/richtext-lexical/client");var Qo=fe(require("bson-objectid"));var Pr=require("@payloadcms/Mo");var ol=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[i]=(0,Xr.useLexicalComposerContext)(),[r,s]=(0,yi.useState)(""),[n,m]=(0,yi.useState)(""),[p,l]=(0,yi.useState)(""),g=async u=>{console.log("fetchMedia",u)};(0,yi.useEffect)(()=>{typeof a=="string"?a.length===24?g(a):(s(a||""),l(R(b())),m(x()||"")):typeof a=="object"&&(s(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),l(R(a.filesize)),m(a.mimeType?.split("/")[1]||""))},[]);let f=(0,yi.useCallback)(()=>{i.update(()=>{(0,ee.$getNodeByKey)(o)?.remove()})},[i,o]),x=()=>{let u=e.data.value;return typeof u=="string"?u.split(";base64")[0]?.split("image/")[1]:""},b=()=>{let u=e.data.value;if(typeof u=="string"){let h=u.split(",")[1]?.length||0;return 4*Math.ceil(h/3)*.5624896334383812/1e3}return 0};function R(u){if(u>=1e6){let F=u/1e6;return`${F>=10?Math.round(F).toString():F.toFixed(1)} MB`}return`${Math.floor(u/1e3)} KB`}return(0,Bi.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Bi.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Bi.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,Bi.jsx)("div",{className:"flex-1",children:e.data.value?(0,Bi.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":a,"data-lexical-upload-relation-to":t,src:r}):(0,Bi.jsx)(Pr.File,{})}),(0,Bi.jsx)(Kt,{children:(0,Bi.jsxs)(qt,{children:[(0,Bi.jsxs)(Jt,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Bi.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Bi.jsx)("button",{onClick:u=>{u.preventDefault(),f()},className:"flex-1 flex justify-center items-center",children:(0,Bi.jsx)(Wt.Bi,{width:24,height:24,strokeWidth:1})})]}),(0,Bi.jsx)(Ot,{children:(0,Bi.jsx)("span",{children:"Remove image"})})]})})]}),(0,Bi.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,Bi.jsx)("span",{className:"",children:n?.toLocaleUpperCase()}),(0,Bi.jsx)("span",{children:p})]})]})})},Mr=ol;function il(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id");if(a)return{node:Pa({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var qa=class extends Co.UploadNode{static importDOM(){return{img:()=>({conversion:il,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new Qo.default().toHexString(),t.version=3);let a={id:t.id??new Qo.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=Pa(a);return o.setFormat?.(t.format),o}decorate(){return(0,Bi.jsx)(Mr,{data:this.__data,nodeKey:this.getKey()})}};function Pa(e){return new qa({data:e})}var rl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nl=e=>rl?(e||window).getSelection():null,Bm=(0,ee.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),ei=(0,ee.createCommand)("INSERT_UPLOAD_COMMAND");function Hr({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,yi.useRef)(!1),[i,r]=(0,yi.useState)(!0),[s,n]=(0,yi.useState)(""),[m,p]=(0,yi.useState)(""),[l,g]=(0,yi.useState)(!1),[f,x]=(0,yi.useState)("left"),b=s==="",R=N=>{g(N.target.checked)},u=N=>{x(N.target.value)},h=N=>{let q=new FileReader;q.onload=function(){return typeof q.result=="string"&&n(q.result),""},N!==null&&N[0]&&q.readAsDataURL(N[0])};(0,yi.useEffect)(()=>{o.current=!1;let N=q=>{o.current=q.altKey};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[e]),(0,yi.useEffect)(()=>{i||t()},[i]),(0,yi.useEffect)(()=>{r(a)},[a]);let F=({editor:N,relationTo:q,replaceNodeKey:A,value:K})=>{if(A)N.update(()=>{let W=(0,ee.$getNodeByKey)(A);W&&W.replace(Pa({id:"",fields:{},relationTo:"media",value:K}))});else{let W=N.dispatchCommand(ei,{fields:null,relationTo:"media",value:K})}},D=()=>{F({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:m,src:s,showCaption:l,position:f}.src}),r(!1),t()};return(0,Bi.jsx)($e,{open:i,onOpenChange:N=>r(N),children:(0,Bi.jsxs)(Ke,{children:[(0,Bi.jsxs)(qe,{children:[(0,Bi.jsx)(Le,{children:"Upload Image"}),(0,Bi.jsx)(Or.DialogDescription,{children:"Description"})]}),(0,Bi.jsxs)("div",{className:"",children:[(0,Bi.jsx)("div",{style:{marginBottom:"1em"},children:(0,Bi.jsx)(ce,{type:"file",onChange:N=>h(N.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Bi.jsx)("div",{style:{marginBottom:"1em"},children:(0,Bi.jsx)(ce,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:N=>p(N.currentTarget.value),value:m,"data-test-id":"image-modal-alt-text-input"})}),(0,Bi.jsx)(T,{"data-test-id":"image-modal-file-upload-btn",disabled:b,onClick:()=>D(),children:"Confirm"})]})]})})}function ti({captionsEnabled:e}){let[t]=(0,Xr.useLexicalComposerContext)();return(0,yi.useEffect)(()=>{if(!t.hasNodes([Co.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Xa.mergeRegister)(t.registerCommand(ee.DRAGSTART_COMMAND,a=>sl(a),ee.COMMAND_PRIORITY_HIGH),t.registerCommand(ee.DRAGOVER_COMMAND,a=>ll(a),ee.COMMAND_PRIORITY_LOW),t.registerCommand(ee.DROP_COMMAND,a=>dl(a,t),ee.COMMAND_PRIORITY_HIGH))},[e,t]),null}function sl(e){if(!ai())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","Bi"),!0):!1}function ll(e){return ai()?(Ur(e)||e.preventDefault(),!0):!1}function dl(e,t){let a=ai();if(!a)return!1;if(e.preventDefault(),Ur(e)){let o=cl(e);a.remove();let i=(0,ee.$createRangeSelection)();o!=null&&i.applyDOMRange(o),(0,ee.$setSelection)(i)}return!0}function ai(){let e=(0,ee.$getSelection)();if(!(0,ee.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,Co.$isUploadNode)(a)?a:null}function Ur(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function cl(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,i=nl(o);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset||0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var ml=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),Vr=ml;var pl=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),zr=pl;var ul=()=>(0,Bi.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Bi.jsx)("path",{Bi:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Bi.jsx)("path",{Bi:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),jr=ul;var gl=()=>(0,Bi.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Bi.jsx)("path",{Bi:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Bi.jsx)("path",{Bi:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),$r=gl;var fl=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),_r=fl;var vl=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),Gr=vl;var Wr=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),Kr=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),qr=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),Jr=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),Zr=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var si=1;function hl(){return(0,Bi.jsx)("span",{className:"border border-[#222222]"})}function di(){let[e]=(0,Xr.useLexicalComposerContext)(),t=(0,yi.useRef)(null),[a,o]=(0,yi.useState)(!1),[i,r]=(0,yi.useState)(!1),[s,n]=(0,yi.useState)(!1),[m,p]=(0,yi.useState)(!1),[l,g]=(0,yi.useState)(!1),[f,x]=(0,yi.useState)(!1),[b,R]=(0,yi.useState)(!1),[u,h]=(0,yi.useState)(!1),[F,D]=(0,yi.useState)(!1),[N,q]=(0,yi.useState)("left"),[A,K]=(0,yi.useState)("p"),W=S=>{e.update(()=>{let B=(0,ee.$getSelection)();(0,ee.$isRangeSelection)(B)&&(S==="p"?(0,li.$setBlocksType)(B,()=>(0,ee.$createParagraphNode)()):(0,li.$setBlocksType)(B,()=>(0,sn.$createHeadingNode)(S)))})},V=(0,yi.useCallback)(()=>{let S=(0,ee.$getSelection)();if((0,ee.$isRangeSelection)(S)){n(S.hasFormat("bold")),p(S.hasFormat("italic")),g(S.hasFormat("underline")),x(S.hasFormat("strikethrough")),R(S.hasFormat("subscript")),h(S.hasFormat("superscript"));let B=S.anchor.getNode(),Q=B;for(;Q&&!(0,ee.$isParagraphNode)(Q)&&Q!==(0,ee.$getRoot)();){let we=Q.getParent();we&&(Q=we)}if(Q){let we=Q.getFormatType();q(we||"left")}let be=B.getTopLevelElement()?.__tag;K(be||"p")}},[]);(0,yi.useEffect)(()=>(0,Xa.mergeRegister)(e.registerUpdateListener(({editorState:S})=>{S.read(()=>{V()})}),e.registerCommand(ee.SELECTION_CHANGE_COMMAND,(S,B)=>(V(),!1),si),e.registerCommand(ee.CAN_UNDO_COMMAND,S=>(o(S),!1),si),e.registerCommand(ee.CAN_REDO_COMMAND,S=>(r(S),!1),si),(0,Xa.mergeRegister)(e.registerCommand(ei,S=>(e.update(()=>{let B=(0,ee.$getSelection)()||(0,ee.$getPreviousSelection)();if((0,ee.$isRangeSelection)(B)){let Q=Pa({id:S.id,fields:S.fields,relationTo:S.relationTo,value:S.value}),{focus:be}=B,we=be.getNode();(0,Xa.$insertNodeToNearestRoot)(Q),(0,ee.$isParagraphNode)(we)&&!we.__first&&we.remove()}}),!0),ee.COMMAND_PRIORITY_EDITOR))),[e,V]);let ae=[[{label:"Undo",icon:(0,Bi.jsx)(Wt.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ee.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,Bi.jsx)(Wt.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ee.UNDO_COMMAND,void 0)},disabled:!i}],[{label:"Bold",icon:(0,Bi.jsx)(Vr,{}),onClick:()=>{e.dispatchCommand(ee.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:s},{label:"Italic",icon:(0,Bi.jsx)(zr,{}),onClick:()=>{e.dispatchCommand(ee.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:m},{label:"Underline",icon:(0,Bi.jsx)(jr,{}),onClick:()=>{e.dispatchCommand(ee.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:l},{label:"Strikethrough",icon:(0,Bi.jsx)($r,{}),onClick:()=>{e.dispatchCommand(ee.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:f},{label:"Subscript",icon:(0,Bi.jsx)(_r,{}),onClick:()=>{e.dispatchCommand(ee.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:b},{label:"Superscript",icon:(0,Bi.jsx)(Gr,{}),onClick:()=>{e.dispatchCommand(ee.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:u}]],le=[{label:"Left Align",direction:"left",icon:(0,Bi.jsx)(Wt.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ee.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Bi.jsx)(Wt.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ee.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Bi.jsx)(Wt.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ee.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Bi.jsx)(Wt.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(ee.FORMAT_ELEMENT_COMMAND,"justify")}}],he=[{label:"Normal Text",value:"p",icon:(0,Bi.jsx)(Wr,{}),onClick:()=>W("p")},{label:"Heading 1",value:"h1",icon:(0,Bi.jsx)(Kr,{}),onClick:()=>W("h1")},{label:"Heading 2",value:"h2",icon:(0,Bi.jsx)(qr,{}),onClick:()=>W("h2")},{label:"Heading 3",value:"h3",icon:(0,Bi.jsx)(Jr,{}),onClick:()=>W("h3")},{label:"Heading 4",value:"h4",icon:(0,Bi.jsx)(Zr,{}),onClick:()=>W("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Bi.jsx)(Wt.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(So.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Bi.jsx)(Wt.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(So.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],C=[{label:"Insert Image",icon:(0,Bi.jsx)(Wt.ImageUp,{width:15,height:15}),onClick:()=>{D(!0)},disabled:!1}];return(0,Bi.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,Bi.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[ae.map((S,B)=>(0,Bi.jsxs)(yi.Fragment,{children:[(0,Bi.jsx)("div",{className:"flex items-center gap-2",children:S.map((Q,be)=>(0,Bi.jsx)("div",{role:"button","aria-disabled":Q.disabled||!1,onClick:Q.onClick,className:w("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",Q.active&&"bg-[#3c3c3c]"),"aria-label":Q.label,children:(0,Bi.jsx)(Kt,{children:(0,Bi.jsxs)(qt,{children:[(0,Bi.jsx)(Jt,{className:"text-[#b5b5b5]",children:Q.icon}),(0,Bi.jsx)(Ot,{children:(0,Bi.jsx)("p",{children:Q.label})})]})})},be))}),(0,Bi.jsx)(hl,{})]},`toolbar-option-${S.length}-${B}`)),(0,Bi.jsxs)(Ca,{children:[(0,Bi.jsxs)(Da,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[le.find(S=>S.direction===N)?.icon,le.find(S=>S.direction===N)?.label,(0,Bi.jsx)(Wt.ChevronDown,{width:15,height:15})]}),(0,Bi.jsx)(sa,{className:"bg-black hover:bg-black",children:le.map((S,B)=>(0,Bi.jsxs)(la,{onClick:S.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Bi.jsx)("span",{children:S.icon}),(0,Bi.jsx)("span",{children:S.label})]},`${S.label}-${B}`))})]}),(0,Bi.jsxs)(Ca,{children:[(0,Bi.jsxs)(Da,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[he.find(S=>S.value===A)?.icon,he.find(S=>S.value===A)?.label,(0,Bi.jsx)(Wt.ChevronDown,{width:15,height:15})]}),(0,Bi.jsx)(sa,{className:"bg-black hover:bg-black",children:he.map((S,B)=>(0,Bi.jsxs)(la,{onClick:S.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Bi.jsx)("span",{children:S.icon}),(0,Bi.jsx)("span",{children:S.label})]},`heading-option-${S.label}-${B}`))})]}),(0,Bi.jsxs)(Ca,{children:[(0,Bi.jsxs)(Da,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,Bi.jsx)(Wt.Plus,{width:15,height:15}),(0,Bi.jsx)(Wt.ChevronDown,{width:15,height:15})]}),(0,Bi.jsx)(sa,{className:"bg-black hover:bg-black",children:C.map((S,B)=>(0,Bi.jsxs)(la,{onClick:S.onClick,disabled:S.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Bi.jsx)("span",{children:S.icon}),(0,Bi.jsx)("span",{children:S.label})]},B))})]}),F&&(0,Bi.jsx)(Hr,{activeEditor:e,onClose:()=>{D(!1)},isOpen:F})]})})}var bl=({setValue:e,value:t,name:a,editable:o=!0})=>{let[i]=(0,Xr.useLexicalComposerContext)(),r=(0,yi.useRef)(null),s=n=>{n.read(()=>{let m=n.toJSON();JSON.stringify(m)!==JSON.stringify(r.current)&&(r.current=m,e?.(()=>m))})};return(0,yi.useEffect)(()=>{i.setEditable(o)},[o,i]),(0,yi.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(r.current)&&i.update(()=>{try{let n=i.parseEditorState(t);i.setEditorState(n),r.current=t}catch(n){console.error("Error parsing editor state:",n)}},{discrete:!0})},[t,i]),(0,Bi.jsx)("div",{className:"w-full",children:(0,Bi.jsxs)("div",{className:" ",children:[o&&(0,Bi.jsx)(di,{}),(0,Bi.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,Bi.jsx)(rn.RichTextPlugin,{contentEditable:(0,Bi.jsx)(tn.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:an.LexicalErrorBoundary}),o&&(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsx)(on.HistoryPlugin,{}),(0,Bi.jsx)(Qr.AutoFocusPlugin,{}),(0,Bi.jsx)(nn.ListPlugin,{}),(0,Bi.jsx)(ln.OnChangePlugin,{onChange:s}),(0,Bi.jsx)(ti,{})]})]})]})})},xl=({setValue:e,value:t,name:a,editable:o=!0})=>(0,Bi.jsx)(en.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[So.ListNode,So.ListItemNode,sn.HeadingNode,qa],onError(r){throw console.error("Lexical error:",r),r},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Bi.jsx)(bl,{value:t,setValue:e,name:a,editable:o})}),cn=xl;var mn=fe(require("react")),kt=fe(require("@radix-Mo/react-popover"));var mi=kt.Root,pi=kt.Trigger;var To=mn.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,Bi.jsx)(kt.Portal,{children:(0,Bi.jsx)(kt.Content,{ref:i,align:t,sideOffset:a,className:w("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));To.displayName=kt.Content.displayName;var pn=require("react-day-picker");function ko({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,Bi.jsx)(pn.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:w("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:w(Ha({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 yi-2",cell:w("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",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:w(Ha({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})}ko.displayName="Calendar";var Qa=e=>"mimeType"in e&&"url"in e&&!("format"in e),yl=e=>{if(!e?.root?.children)return"";let t=[],a=r=>{if(!r)return"";switch(r.type){case"heading":{let s=r.tag?parseInt(r.tag.replace("h","")):1,n=o(r.children||[]);return"#".repeat(s)+" "+n}case"paragraph":return r.children&&r.children.some(m=>m.type==="text"?m.text&&m.text.trim().length>0:(m.type==="linebreak",!0))?o(r.children||[]):"";case"list":{let s=[],n=r.listType==="number"?"1.":"-";return r.children?.forEach((m,p)=>{if(m.type==="listitem"){let l=o(m.children||[]),g=r.listType==="number"?`${p+1}.`:n;s.push(`${g} ${l}`)}}),s.join(`
6
- `)}case"listitem":return o(r.children||[]);case"text":{let s=r.text||"";if(r.format){let n=(r.format&1)!==0,m=(r.format&2)!==0,p=(r.format&4)!==0,l=(r.format&8)!==0;(r.format&16)!==0?s=`\`${s}\``:(n&&(s=`**${s}**`),m&&(s=`*${s}*`),p&&(s=`~~${s}~~`),l&&(s=`<u>${s}</u>`))}return s}default:return r.children?o(r.children):""}},o=r=>r.map(s=>{if(s.type==="text"){let n=s.text||"";if(s.format){let m=(s.format&1)!==0,p=(s.format&2)!==0,l=(s.format&4)!==0,g=(s.format&8)!==0;(s.format&16)!==0?n=`\`${n}\``:(m&&(n=`**${n}**`),p&&(n=`*${n}*`),l&&(n=`~~${n}~~`),g&&(n=`<u>${n}</u>`))}return n}else{if(s.type==="paragraph")return o(s.children||[]);if(s.type==="listitem")return o(s.children||[]);if(s.type==="linebreak")return`
5
+ "use strict";"use client";var Jn=Object.create;var ao=Object.defineProperty;var Zn=Object.getOwnPropertyDescriptor;var Xn=Object.getOwnPropertyNames;var Yn=Object.getPrototypeOf,Qn=Object.prototype.hasOwnProperty;var es=(e,t)=>{for(var a in t)ao(e,a,{get:t[a],enumerable:!0})},Si=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Xn(t))!Qn.call(e,i)&&i!==a&&ao(e,i,{get:()=>t[i],enumerable:!(o=Zn(t,i))||o.enumerable});return e};var fe=(e,t,a)=>(a=e!=null?Jn(Yn(e)):{},Si(t||!e||!e.__esModule?ao(a,"default",{value:e,enumerable:!0}):a,e)),ts=e=>Si(ao({},"__esModule",{value:!0}),e);var Al={};es(Al,{default:()=>Rn});module.exports=ts(Al);var yi=require("react"),Io=require("motion/react");var Fi=require("clsx");var Ho="-",as=e=>{let t=is(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{let n=s.split(Ho);return n[0]===""&&n.length!==1&&n.shift(),Pi(n,t)||os(s)},getConflictingClassGroupIds:(s,n)=>{let m=a[s]||[];return n&&o[s]?[...m,...o[s]]:m}}},Pi=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),i=o?Pi(e.slice(1),o):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Ho);return t.validators.find(({validator:s})=>s(r))?.classGroupId},Ti=/^\[(.+)\]$/,os=e=>{if(Ti.test(e)){let t=Ti.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},is=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return ns(Object.entries(e.classGroups),a).forEach(([r,s])=>{Oo(s,o,r,t)}),o},Oo=(e,t,a,o)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:ki(t,i);r.classGroupId=a;return}if(typeof i=="function"){if(rs(i)){Oo(i(o),t,a,o);return}t.validators.push({validator:i,classGroupId:a});return}Object.entries(i).forEach(([r,s])=>{Oo(s,ki(t,r),a,o)})})},ki=(e,t)=>{let a=e;return t.split(Ho).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},rs=e=>e.isThemeGetter,ns=(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(([s,n])=>[t+s,n])):r);return[a,i]}):e,ss=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,i=(r,s)=>{a.set(r,s),t++,t>e&&(t=0,o=a,a=new Map)};return{get(r){let s=a.get(r);if(s!==void 0)return s;if((s=o.get(r))!==void 0)return i(r,s),s},set(r,s){a.has(r)?a.set(r,s):i(r,s)}}},Ri="!",ls=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,i=t[0],r=t.length,s=n=>{let m=[],p=0,l=0,f;for(let u=0;u<n.length;u++){let x=n[u];if(p===0){if(x===i&&(o||n.slice(u,u+r)===t)){m.push(n.slice(l,u)),l=u+r;continue}if(x==="/"){f=u;continue}}x==="["?p++:x==="]"&&p--}let v=m.length===0?n:n.substring(l),C=v.startsWith(Ri),b=C?v.substring(1):v,P=f&&f>l?f-l:void 0;return{modifiers:m,hasImportantModifier:C,baseClassName:b,maybePostfixModifierPosition:P}};return a?n=>a({className:n,parseClassName:s}):s},ds=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},cs=e=>({cache:ss(e.cacheSize),parseClassName:ls(e),...as(e)}),ms=/\s+/,ps=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:i}=t,r=[],s=e.trim().split(ms),n="";for(let m=s.length-1;m>=0;m-=1){let p=s[m],{modifiers:l,hasImportantModifier:f,baseClassName:v,maybePostfixModifierPosition:C}=a(p),b=!!C,P=o(b?v.substring(0,C):v);if(!P){if(!b){n=p+(n.length>0?" "+n:n);continue}if(P=o(v),!P){n=p+(n.length>0?" "+n:n);continue}b=!1}let u=ds(l).join(":"),x=f?u+Ri:u,I=x+P;if(r.includes(I))continue;r.push(I);let D=i(P,b);for(let N=0;N<D.length;++N){let J=D[N];r.push(x+J)}n=p+(n.length>0?" "+n:n)}return n};function us(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Ai(t))&&(o&&(o+=" "),o+=a);return o}var Ai=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Ai(e[o]))&&(a&&(a+=" "),a+=t);return a};function gs(e,...t){let a,o,i,r=s;function s(m){let p=t.reduce((l,f)=>f(l),e());return a=cs(p),o=a.cache.get,i=a.cache.set,r=n,n(m)}function n(m){let p=o(m);if(p)return p;let l=ps(m,a);return i(m,l),l}return function(){return r(us.apply(null,arguments))}}var Te=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Ei=/^\[(?:([a-z-]+):)?(.+)\]$/i,fs=/^\Bi+\/\Bi+$/,vs=new Set(["px","full","screen"]),hs=/^(\Bi+(\.\Bi+)?)?(xs|sm|md|lg|xl)$/,bs=/\Bi+(%|px|r?em|[sdl]?v([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$/,xs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ys=/^(inset_)?-?((\Bi+)?\.?(\Bi+)[a-z]+|0)Bi-?((\Bi+)?\.?(\Bi+)[a-z]+|0)/,ws=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lt=e=>xa(e)||vs.has(e)||fs.test(e),$t=e=>ya(e,"length",Rs),xa=e=>!!e&&!Number.isNaN(Number(e)),Bo=e=>ya(e,"number",xa),Ba=e=>!!e&&Number.isInteger(Number(e)),Ns=e=>e.endsWith("%")&&xa(e.slice(0,-1)),Y=e=>Ei.test(e),_t=e=>hs.test(e),Cs=new Set(["length","size","percentage"]),Ds=e=>ya(e,Cs,Mi),Ss=e=>ya(e,"position",Mi),Ts=new Set(["image","url"]),ks=e=>ya(e,Ts,Es),Ps=e=>ya(e,"",As),Oa=()=>!0,ya=(e,t,a)=>{let o=Ei.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},Rs=e=>bs.test(e)&&!xs.test(e),Mi=()=>!1,As=e=>ys.test(e),Es=e=>ws.test(e);var Ms=()=>{let e=Te("colors"),t=Te("spacing"),a=Te("blur"),o=Te("brightness"),i=Te("borderColor"),r=Te("borderRadius"),s=Te("borderSpacing"),n=Te("borderWidth"),m=Te("contrast"),p=Te("grayscale"),l=Te("hueRotate"),f=Te("invert"),v=Te("gap"),C=Te("gradientColorStops"),b=Te("gradientColorStopPositions"),P=Te("inset"),u=Te("margin"),x=Te("opacity"),I=Te("padding"),D=Te("saturate"),N=Te("scale"),J=Te("sepia"),R=Te("skew"),W=Te("space"),K=Te("translate"),O=()=>["auto","contain","none"],ee=()=>["auto","hidden","clip","visible","scroll"],le=()=>["auto",Y,t],M=()=>[Y,t],xe=()=>["",Lt,$t],Se=()=>["auto",xa,Y],g=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],we=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",Y],de=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[xa,Y];return{cacheSize:500,separator:":",theme:{colors:[Oa],spacing:[Lt,$t],blur:["none","",_t,Y],brightness:k(),borderColor:[e],borderRadius:["none","","full",_t,Y],borderSpacing:M(),borderWidth:xe(),contrast:k(),grayscale:ae(),hueRotate:k(),invert:ae(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Ns,$t],inset:le(),margin:le(),opacity:k(),padding:M(),saturate:k(),scale:k(),sepia:ae(),skew:k(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[_t]}],"break-after":[{"break-after":de()}],"break-before":[{"break-before":de()}],"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:[...g(),Y]}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[P]}],"inset-x":[{"inset-x":[P]}],"inset-y":[{"inset-y":[P]}],start:[{start:[P]}],end:[{end:[P]}],top:[{top:[P]}],right:[{right:[P]}],bottom:[{bottom:[P]}],left:[{left:[P]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ba,Y]}],basis:[{basis:le()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",Ba,Y]}],"grid-cols":[{"grid-cols":[Oa]}],"col-start-end":[{col:["auto",{span:["full",Ba,Y]},Y]}],"col-start":[{"col-start":Se()}],"col-end":[{"col-end":Se()}],"grid-rows":[{"grid-rows":[Oa]}],"row-start-end":[{row:["auto",{span:[Ba,Y]},Y]}],"row-start":[{"row-start":Se()}],"row-end":[{"row-end":Se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...we()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...we(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...we(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[I]}],px:[{px:[I]}],py:[{py:[I]}],ps:[{ps:[I]}],Wt:[{Wt:[I]}],pt:[{pt:[I]}],Bi:[{Bi:[I]}],pb:[{pb:[I]}],pl:[{pl:[I]}],m:[{m:[u]}],mx:[{mx:[u]}],my:[{my:[u]}],ms:[{ms:[u]}],Bi:[{Bi:[u]}],yi:[{yi:[u]}],mr:[{mr:[u]}],mb:[{mb:[u]}],ml:[{ml:[u]}],"space-x":[{"space-x":[W]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[W]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,t]}],"min-w":[{"min-w":[Y,t,"min","max","fit"]}],"max-w":[{"max-w":[Y,t,"none","full","min","max","fit","prose",{screen:[_t]},_t]}],h:[{h:[Y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_t,$t]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Bo]}],"font-family":[{font:[Oa]}],"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",Y]}],"line-clamp":[{"line-clamp":["none",xa,Bo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Lt,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Lt,$t]}],"underline-offset":[{"underline-offset":["auto",Lt,Y]}],"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:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],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",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...g(),Ss]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ds]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ks]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],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-se":[{"rounded-se":[r]}],"rounded-ee":[{"rounded-ee":[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:[n]}],"border-w-x":[{"border-x":[n]}],"border-w-y":[{"border-y":[n]}],"border-w-s":[{"border-s":[n]}],"border-w-e":[{"border-e":[n]}],"border-w-t":[{"border-t":[n]}],"border-w-r":[{"border-r":[n]}],"border-w-b":[{"border-b":[n]}],"border-w-l":[{"border-l":[n]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[n]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[n]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:L()}],"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:["",...L()]}],"outline-offset":[{"outline-offset":[Lt,Y]}],"outline-w":[{outline:[Lt,$t]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:xe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Lt,$t]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_t,Ps]}],"shadow-color":[{shadow:[Oa]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",_t,Y]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[f]}],saturate:[{saturate:[D]}],sepia:[{sepia:[J]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[D]}],"backdrop-sepia":[{"backdrop-sepia":[J]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Y]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[Ba,Y]}],"translate-x":[{"translate-x":[K]}],"translate-y":[{"translate-y":[K]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-Bi":[{"scroll-Bi":M()}],"scroll-yi":[{"scroll-yi":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-Wt":[{"scroll-Wt":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-Bi":[{"scroll-Bi":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",Y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Lt,$t,Bo]}],stroke:[{stroke:[e,"none"]}],Wt:["Wt-only","not-Wt-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","Wt","pt","Bi","pb","pl"],px:["Bi","pl"],py:["pt","pb"],m:["mx","my","ms","Bi","yi","mr","mb","ml"],mx:["mr","ml"],my:["yi","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-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"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-Bi","scroll-yi","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-yi","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-Wt","scroll-pt","scroll-Bi","scroll-pb","scroll-pl"],"scroll-px":["scroll-Bi","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 Ii=gs(Ms);function w(...e){return Ii((0,Fi.clsx)(e))}var uo=fe(require("react")),go=fe(require("next/link")),Wt=require("lucide-react");var Li=require("class-variance-authority");var Bi=require("react/jsx-runtime"),Is=(0,Li.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function he({className:e,variant:t,...a}){return(0,Bi.jsx)("div",{className:w(Is({variant:t}),e),...a})}var Oi=require("@radix-Io/react-slot"),Ui=fe(require("react")),Ha=(0,Li.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"}}}),S=Ui.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...i},r)=>(0,Bi.jsx)(e?Oi.Slot:"button",{className:w(Ha({className:t,size:a,variant:o})),ref:r,...i}));S.displayName="Button";var zi=fe(require("react"));var ce=zi.forwardRef(({className:e,type:t,...a},o)=>(0,Bi.jsx)("input",{type:t,className:w("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}));ce.displayName="Input";var Uo=fe(require("react")),pt=fe(require("@radix-Io/react-scroll-area"));var wa=Uo.forwardRef(({className:e,children:t,...a},o)=>(0,Bi.jsxs)(pt.Root,{ref:o,className:w("relative overflow-hidden",e),...a,children:[(0,Bi.jsx)(pt.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),(0,Bi.jsx)($i,{}),(0,Bi.jsx)(pt.Corner,{})]}));wa.displayName=pt.Root.displayName;var $i=Uo.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,Bi.jsx)(pt.ScrollAreaScrollbar,{ref:o,orientation:t,className:w("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,Bi.jsx)(pt.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));$i.displayName=pt.ScrollAreaScrollbar.displayName;var Ua=fe(require("react")),je=fe(require("@radix-Io/react-dialog"));var $e=je.Root;var Vo=je.Portal;var oo=Ua.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(je.Overlay,{ref:a,className:w("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));oo.displayName=je.Overlay.displayName;var Ke=Ua.forwardRef(({className:e,children:t,...a},o)=>(0,Bi.jsxs)(Vo,{children:[(0,Bi.jsx)(oo,{}),(0,Bi.jsxs)(je.Content,{ref:o,className:w("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,(0,Bi.jsxs)(je.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,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{className:"Wt-only",children:"Close"})]})]})]}));Ke.displayName=je.Content.displayName;var qe=({className:e,...t})=>(0,Bi.jsx)("div",{className:w("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});qe.displayName="DialogHeader";var Va=({className:e,...t})=>(0,Bi.jsx)("div",{className:w("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Va.displayName="DialogFooter";var Le=Ua.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(je.Title,{ref:a,className:w("text-lg font-semibold leading-none tracking-tight",e),...t}));Le.displayName=je.Title.displayName;var Fs=Ua.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(je.Description,{ref:a,className:w("text-sm text-muted-foreground",e),...t}));Fs.displayName=je.Description.displayName;var za=fe(require("@radix-Io/react-checkbox")),Wi=fe(require("react")),zo=Wi.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(za.Root,{className:w("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,Bi.jsx)(za.Indicator,{className:w("flex items-center justify-center text-current"),children:(0,Bi.jsx)(Wt.Check,{className:"h-4 w-4"})})}));zo.displayName=za.Root.displayName;var Dt=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date}),qi=[{id:"home",title:"Home",icon:(0,Bi.jsx)(Wt.Home,{}),isActive:!0},{id:"teams",title:"Teams",icon:(0,Bi.jsx)(Wt.Users,{}),maxItems:2,items:[{id:"design",title:"Design",url:"#"},{id:"marketing",title:"Marketing",url:"#"},{id:"finance",title:"Finance",url:"#"},{id:"engineering",title:"Engineering",url:"#"},{id:"sales",title:"Sales",url:"#"}]},{id:"projects",title:"Projects",icon:(0,Bi.jsx)(Wt.Layers,{}),badge:"4",maxItems:2,items:[{id:"active-projects",title:"Active Projects",url:"#",badge:"4"},{id:"archived",title:"Archived",url:"#"},{id:"templates",title:"Templates",url:"#"},{id:"drafts",title:"Drafts",url:"#"},{id:"shared",title:"Shared with Wt",url:"#",badge:"2"}]},{id:"copilot",title:"Copilot",icon:(0,Bi.jsx)(Wt.Bot,{}),url:"/copilot"},{id:"knowledge",title:"Knowledge",icon:(0,Bi.jsx)(Wt.FileText,{}),url:"/knowledge"}],Ji=[{id:"1",title:"New comment on your post",description:"Alex Morgan commented on your 'Minimalist Logo Design' post.",time:"Just now",read:!1,type:"info",actionLabel:"View comment",onAction:()=>console.log("View comment clicked")},{id:"2",title:"Project deadline approaching",description:"The 'Website Redesign' project is due in 2 days.",time:"5 minutes ago",read:!1,type:"warning",actionLabel:"View project",onAction:()=>console.log("View project clicked")},{id:"3",title:"File shared with you",description:"Emma Thompson shared 'Brand Guidelines.pdf' with you.",time:"1 hour ago",read:!1,type:"info",actionLabel:"Open file",onAction:()=>console.log("Open file clicked")},{id:"4",title:"Update successful",description:"PixelMaster has been updated to version 2.4.0.",time:"3 hours ago",read:!0,type:"success",actionLabel:"See what's new",onAction:()=>console.log("See what's new clicked")},{id:"5",title:"Storage limit reached",description:"You'Bi used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' is now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}],Zi=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Bi.jsx)(Wt.Palette,{className:"h-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Bi.jsx)(Wt.Code,{className:"h-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Bi.jsx)(Wt.TrendingUp,{className:"h-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Bi.jsx)(Wt.DollarSign,{className:"h-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"Bi",name:"Human Resources",description:"People operations and talent management",icon:(0,Bi.jsx)(Wt.Users,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Bi.jsx)(Wt.Wrench,{className:"h-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Bi.jsx)(Wt.Scale,{className:"h-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Bi.jsx)(Wt.Package,{className:"h-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Bi.jsx)(Wt.Zap,{className:"h-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Bi.jsx)(Wt.Building2,{className:"h-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],so=[{id:"1",name:"E-commerce Platform",description:"Main customer-facing e-commerce application",isSelected:!0},{id:"2",name:"Admin Dashboard",description:"Internal administration and analytics dashboard",isSelected:!1},{id:"3",name:"Mobile App",description:"Native mobile application for iOS and Android",isSelected:!1}];var jo=[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0},{id:"2",name:"Dashboard Features",color:"bg-green-500",description:"Build comprehensive dashboard functionality",confidence:"medium",phase:1,startDate:new Date("2024-02-01"),endDate:new Date("2024-03-15"),progress:30,isSelected:!0},{id:"3",name:"Mobile Optimization",color:"bg-purple-500",description:"Optimize application for mobile devices",confidence:"low",phase:1,startDate:new Date("2024-03-01"),endDate:new Date("2024-04-15"),progress:10,isSelected:!0},{id:"4",name:"Performance Improvements",color:"bg-orange-500",description:"Enhance application performance and speed",confidence:"high",phase:3,startDate:new Date("2024-01-15"),endDate:new Date("2024-02-28"),progress:90,isSelected:!0}],ro=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned to a sprint",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!1},{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0},{id:"1",name:"Sprint 1",description:"Initial development phase",startDate:new Date("2024-01-01"),endDate:new Date("2024-01-14"),isActive:!1,isSelected:!1},{id:"2",name:"Sprint 2",description:"Feature development",startDate:new Date("2024-01-15"),endDate:new Date("2024-01-28"),isActive:!0,isSelected:!1}],co=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],Ls=[...co,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],Bs=[...so,{id:"4",name:"Analytics Platform",description:"Business intelligence and reporting system",isSelected:!1},{id:"5",name:"API Gateway",description:"Microservices API management layer",isSelected:!1}],no={projects:[{id:"1",name:"Empty Project",description:"A project with no tasks",isSelected:!0}],epics:[],sprints:[{id:"all-tasks",name:"All Tasks",description:"View all tasks across all sprints",startDate:new Date("2024-01-01"),endDate:new Date("2024-12-31"),isActive:!1,isSelected:!0}],tasks:[]},Ki={epics:[{id:"1",name:"User Authentication",color:"bg-blue-500",description:"Implement secure user authentication system",confidence:"high",phase:2,startDate:new Date("2024-01-01"),endDate:new Date("2024-02-15"),progress:75,isSelected:!0}],tasks:co.filter(e=>e.epicId==="1")};var hd={empty:{initialProjects:no.projects,initialEpics:no.epics,initialSprints:no.sprints,initialTasks:no.tasks},default:{initialProjects:so,initialEpics:jo,initialSprints:ro,initialTasks:co},highDensity:{initialProjects:so,initialEpics:jo,initialSprints:ro,initialTasks:Ls},singleEpic:{initialProjects:so,initialEpics:Ki.epics,initialSprints:ro,initialTasks:Ki.tasks},multipleProjects:{initialProjects:Bs,initialEpics:jo,initialSprints:ro,initialTasks:co}},lo=[{id:"1",type:"human",name:"Sarah Johnson",email:"sarah.johnson@company.com",role:"Senior Designer",department:"Design",status:"active",joinedDate:new Date("2023-01-15"),lastActive:new Date,phone:"+1 (555) 123-4567",location:"San Francisco, CA",timezone:"PST",skills:["UI/UX Design","Figma","Adobe Creative Suite","Prototyping","User Research"],bio:"Passionate designer with 8+ years of experience creating user-centered digital experiences."},{id:"2",type:"digital",name:"CodeAssist Pro",status:"active",joinedDate:new Date("2024-01-01"),lastActive:new Date,jobDescription:"AI-powered coding assistant that helps with code review, debugging, and documentation generation.",workInstructions:"Review pull requests for code quality and best practices. Generate comprehensive documentation for new features. Assist with debugging complex issues. Provide code suggestions and optimizations.",capabilities:["Code Review","Documentation Generation","Debugging","Code Optimization","Testing"],knowledge:["JavaScript","TypeScript","React","Node.js","Python","Git"].map(Dt),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Dt),version:"2",lastUpdated:new Date("2024-01-15"),isActive:!0},{id:"3",type:"human",name:"Michael Chen",email:"michael.chen@company.com",role:"Product Manager",department:"Product",status:"inactive",joinedDate:new Date("2022-08-20"),lastActive:new Date(Date.now()-2*60*60*1e3),phone:"+1 (555) 987-6543",location:"New York, NY",timezone:"EST",skills:["Product Strategy","Agile","Data Analysis","User Stories","Roadmapping"],bio:"Strategic product manager focused on driving user engagement and business growth."},{id:"4",type:"digital",name:"MarketingBot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"Specialized AI assistant for marketing campaigns, content creation, and social media management.",workInstructions:"Create engaging social media content. Analyze campaign performance metrics. Generate marketing copy and headlines. Schedule and manage social media posts.",capabilities:["Content Creation","Social Media Management","Analytics","SEO Optimization","Campaign Management"],knowledge:["Digital Marketing","Social Media Platforms","Content Strategy","Analytics Tools"].map(Dt),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Dt),version:"52",lastUpdated:new Date("2024-02-10"),isActive:!0},{id:"5",type:"human",name:"Emily Rodriguez",email:"emily.rodriguez@company.com",role:"UX Researcher",department:"Design",status:"inactive",joinedDate:new Date("2023-06-10"),lastActive:new Date(Date.now()-7*24*60*60*1e3),phone:"+1 (555) 456-7890",location:"Austin, TX",timezone:"CST",skills:["User Research","Usability Testing","Data Analysis","Survey Design","Interview Techniques"],bio:"User researcher dedicated to understanding user needs and improving product experiences."},{id:"6",type:"digital",name:"DataAnalyzer Pro",status:"active",joinedDate:new Date("2024-01-10"),lastActive:new Date,jobDescription:"Advanced AI assistant specializing in data analysis, reporting, and business intelligence.",workInstructions:"Analyze complex datasets, generate insightful reports, create data visualizations, and provide actionable business recommendations.",capabilities:["Data Analysis","Report Generation","Data Visualization","Business Intelligence","Statistical Analysis"],knowledge:["Python","SQL","Tableau","Excel","R","Statistics"].map(Dt),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Dt),version:"3.1",lastUpdated:new Date("2024-02-20"),isActive:!0},{id:"7",type:"digital",name:"ProjectManager AI",status:"active",joinedDate:new Date("2024-01-05"),lastActive:new Date,jobDescription:"Intelligent project management assistant that helps coordinate tasks, track progress, and manage timelines.",workInstructions:"Coordinate project activities, track milestones, manage resource allocation, and provide project status updates.",capabilities:["Project Planning","Task Coordination","Timeline Management","Resource Allocation","Progress Tracking"],knowledge:["Agile","Scrum","Gantt Charts","Risk Management","Stakeholder Management"].map(Dt),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Dt),version:"2.5",lastUpdated:new Date("2024-02-15"),isActive:!0},{id:"8",type:"digital",name:"CustomerSupport Bot",status:"active",joinedDate:new Date("2024-02-01"),lastActive:new Date,jobDescription:"AI-powered customer support assistant that handles inquiries, resolves issues, and escalates complex problems.",workInstructions:"Respond to customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases to human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Dt),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Dt),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],bd=[{id:"1",title:"Review quarterly report",description:"Bi through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:lo.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:30,createdAt:new Date(2024,2,10),tags:["quarterly","review","urgent"]},{id:"2",title:"Weekly team standup",description:"Join the weekly team synchronization meeting",dueDate:new Date(2024,2,18),dueTime:"10:00",colleague:lo.find(e=>e.id==="4"&&e.type==="digital"),isCompleted:!1,isRecurring:!0,recurrencePattern:"weekly",recurrenceInterval:1,priority:"medium",reminderEnabled:!0,reminderMinutes:15,createdAt:new Date(2024,2,11),tags:["meeting","standup","weekly"]},{id:"3",title:"Deploy to production",description:"Deploy the latest version to production environment",dueDate:new Date,dueTime:"16:00",colleague:lo.find(e=>e.id==="2"&&e.type==="digital"),isCompleted:!1,isRecurring:!1,priority:"high",reminderEnabled:!0,reminderMinutes:60,createdAt:new Date,tags:["deploy","production","urgent"]}];var xd=lo.filter(e=>e.type==="digital");function po(e,t){let[a,o]=(0,yi.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,yi.useEffect)(()=>{i(a)},[]),[a,i]}function $o({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:i=Zi[0],onBusinessUnitChange:r,onSearch:s,className:n,logo:m="/headerlogo.png",logoLink:p="/teams",appName:l="Nuvia",tagline:f="Collaboration Platform"}){let[v,C]=uo.useState({}),[b,P]=po("sidebar-favorites",{}),[u,x]=uo.useState(null),[I,D]=uo.useState(""),N=g=>{C(L=>({...L,[g]:!L[g]}))},J=g=>{r?.(g)},R=()=>{I.trim()&&s?.(I.trim())},W=g=>{g.key==="Enter"&&(g.preventDefault(),R())},K=(g,L)=>{let V=b[g]||[],we=V.includes(L)?V.filter(ae=>ae!==L):V.concat(L);P({...b,[g]:we})},O=g=>{if(!g.items||!g.maxItems||g.items.length<=g.maxItems)return g.items||[];let L=b[g.id]||[],V=g.items.filter(ae=>L.includes(ae.id)),we=g.items.filter(ae=>!L.includes(ae.id));return[...V,...we].slice(0,g.maxItems)},ee=g=>g.maxItems&&g.items&&g.items.length>g.maxItems,le=e,M=g=>{let L=ee(g),V=O(g),we=(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[g.icon,(0,Bi.jsx)("span",{children:g.title})]}),g.badge&&(0,Bi.jsx)(he,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:g.badge}),g.items&&(0,Bi.jsx)(Wt.ChevronDown,{className:w("ml-2 h-4 w-4 transition-transform",v[g.title]?"rotate-180":"")})]}),ae=w("flex w-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",g.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return g.url?(0,Bi.jsx)(go.default,{href:g.url,className:ae,onClick:a?o:void 0,children:we}):(0,Bi.jsx)("button",{className:ae,onClick:()=>g.items&&N(g.title),children:we})},xe=()=>{let g=e.find(V=>V.id===u);if(!g||!g.items||!g.maxItems)return null;let L=b[g.id]||[];return(0,Bi.jsx)($e,{open:!!u,onOpenChange:V=>!V&&x(null),children:(0,Bi.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Bi.jsxs)(qe,{children:[(0,Bi.jsxs)(Le,{children:["Manage ",g.title," Favorites"]}),(0,Bi.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",g.maxItems," items to show in ",g.title.toLowerCase(),"."]})]}),(0,Bi.jsx)(wa,{className:"max-h-96 Bi-4",children:(0,Bi.jsx)("div",{className:"space-y-4",children:g.items.map(V=>(0,Bi.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Bi.jsx)(zo,{id:V.id,checked:L.includes(V.id),onCheckedChange:()=>K(g.id,V.id),disabled:!L.includes(V.id)&&L.length>=(g.maxItems||0)}),(0,Bi.jsxs)("label",{htmlFor:V.id,className:"flex items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer flex-1",children:[V.title,V.badge&&(0,Bi.jsx)(he,{variant:"outline",className:"text-xs",children:V.badge})]})]},V.id))})})]})})},Se=(0,Bi.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Bi.jsxs)(go.default,{href:p,className:"flex items-center gap-3",children:[(0,Bi.jsx)("div",{className:"flex h-14 w-14 items-center justify-center",children:(0,Bi.jsx)("img",{src:m,alt:"Header Logo",className:"h-14 w-14 object-contain"})}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("h2",{className:"font-semibold",children:l}),(0,Bi.jsx)("p",{className:"text-xs text-muted-foreground",children:f})]})]}),a&&(0,Bi.jsx)(S,{variant:"ghost",size:"icon",onClick:o,children:(0,Bi.jsx)(Wt.Bi,{className:"h-5 w-5"})})]}),(0,Bi.jsx)("div",{className:"px-3 py-2",children:(0,Bi.jsxs)("div",{className:"relative",children:[(0,Bi.jsx)(Wt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Bi.jsx)(ce,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 Bi-4 py-2",value:I,onChange:g=>D(g.target.value),onKeyPress:W})]})}),(0,Bi.jsx)(wa,{className:"flex-1 px-3 py-2",children:(0,Bi.jsx)("div",{className:"space-y-1",children:le.map(g=>(0,Bi.jsxs)("div",{className:"mb-1",children:[M(g),g.items&&v[g.title]&&(0,Bi.jsxs)("div",{className:"yi-1 ml-6 space-y-1 border-l pl-3",children:[O(g).map(L=>(0,Bi.jsxs)(go.default,{href:L.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[L.title,L.badge&&(0,Bi.jsx)(he,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:L.badge})]},L.id)),ee(g)&&g.items&&g.items.length>O(g).length&&(0,Bi.jsxs)("button",{onClick:()=>x(g.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",g.items.length-O(g).length," more available"]})]})]},g.id))})}),(0,Bi.jsx)("div",{className:"p-3",children:(0,Bi.jsx)("div",{className:"space-y-1",children:(0,Bi.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Bi.jsx)(Wt.Settings,{className:"h-5 w-5"}),(0,Bi.jsx)("span",{children:"Settings"})]})})}),(0,Bi.jsx)(xe,{})]});return a?(0,Bi.jsx)("div",{className:w("fixed inset-y-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:Se}):(0,Bi.jsx)("div",{className:w("fixed inset-y-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",n),children:Se})}var fo=fe(require("react")),Bt=fe(require("@radix-Io/react-avatar"));var ja=fo.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(Bt.Root,{ref:a,className:w("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));ja.displayName=Bt.Root.displayName;var _o=fo.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(Bt.Image,{ref:a,className:w("aspect-square h-full w-full",e),...t}));_o.displayName=Bt.Image.displayName;var $a=fo.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(Bt.Fallback,{ref:a,className:w("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));$a.displayName=Bt.Fallback.displayName;var Xi=fe(require("react")),yt=fe(require("@radix-Io/react-tooltip"));var Kt=yt.Provider,qt=yt.Root,Jt=yt.Trigger,Ot=Xi.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Bi.jsx)(yt.Portal,{children:(0,Bi.jsx)(yt.Content,{ref:o,sideOffset:t,className:w("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs 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})}));Ot.displayName=yt.Content.displayName;var Yi=require("next-themes");function Qi(){let{setTheme:e,theme:t}=(0,Yi.useTheme)();return(0,Bi.jsx)(Kt,{children:(0,Bi.jsxs)(qt,{children:[(0,Bi.jsx)(Jt,{asChild:!0,children:(0,Bi.jsxs)(S,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Bi.jsx)(Wt.Sun,{className:"h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Bi.jsx)(Wt.Moon,{className:"absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Bi.jsx)("span",{className:"Wt-only",children:"Toggle theme"})]})}),(0,Bi.jsx)(Ot,{children:"Toggle theme"})]})})}function er({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:i,className:r}){let s=e.filter(p=>!p.read),n=s.length,m=p=>{switch(p){case"info":return(0,Bi.jsx)(Wt.Info,{className:"h-5 w-5 text-blue-500"});case"success":return(0,Bi.jsx)(Wt.Check,{className:"h-5 w-5 text-green-500"});case"warning":return(0,Bi.jsx)(Wt.AlertTriangle,{className:"h-5 w-5 text-amber-500"});case"error":return(0,Bi.jsx)(Wt.AlertTriangle,{className:"h-5 w-5 text-red-500"})}};return(0,Bi.jsx)(Io.AnimatePresence,{children:t&&(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsx)(Io.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:a}),(0,Bi.jsx)(Io.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:w("fixed inset-y-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,Bi.jsxs)("div",{className:"flex h-full flex-col",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)(Wt.Bell,{className:"h-5 w-5"}),(0,Bi.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),n>0&&(0,Bi.jsxs)(he,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[n," new"]})]}),(0,Bi.jsxs)(S,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,Bi.jsx)(Wt.Bi,{className:"h-5 w-5"}),(0,Bi.jsx)("span",{className:"Wt-only",children:"Close"})]})]}),n>0&&(0,Bi.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Bi.jsxs)("span",{className:"text-sm text-muted-foreground",children:[n," unread notification",n!==1?"s":""]}),(0,Bi.jsx)(S,{variant:"ghost",size:"sm",onClick:i,className:"text-sm",children:"Dismiss all"})]}),s.length>0?(0,Bi.jsx)(wa,{className:"flex-1",children:(0,Bi.jsx)("div",{className:"divide-y",children:s.map(p=>(0,Bi.jsxs)("div",{className:w("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Bi.jsx)("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:m(p.type)}),(0,Bi.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("p",{className:"font-medium",children:p.title}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("p",{className:"text-xs text-muted-foreground",children:p.time}),(0,Bi.jsx)(S,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o?.(p.id),title:"Dismiss",children:(0,Bi.jsx)(Wt.Check,{className:"h-3 w-3"})})]})]}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground",children:p.description}),p.actionLabel&&(0,Bi.jsxs)(S,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:p.onAction,children:[p.actionLabel,(0,Bi.jsx)(Wt.ChevronRight,{className:"ml-1 h-3 w-3"})]})]})]},p.id))})}):(0,Bi.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Bi.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Bi.jsx)(Wt.Bell,{className:"h-8 w-8 text-muted-foreground"})}),(0,Bi.jsx)("h3",{className:"yi-4 text-lg font-medium",children:"Wt notifications"}),(0,Bi.jsx)("p",{className:"yi-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var na=fe(require("@radix-Io/react-tabs"));function tr({className:e,...t}){return(0,Bi.jsx)(na.Root,{"data-slot":"tabs",className:w("flex flex-col gap-2",e),...t})}function ar({className:e,...t}){return(0,Bi.jsx)(na.List,{"data-slot":"tabs-list",className:w("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function or({className:e,...t}){return(0,Bi.jsx)(na.Trigger,{"data-slot":"tabs-trigger",className:w("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 Ht=fe(require("react")),ne=fe(require("@radix-Io/react-dropdown-menu")),Na=require("@radix-Io/react-icons");var Ca=ne.Root,Da=ne.Trigger;var Os=Ht.forwardRef(({className:e,inset:t,children:a,...o},i)=>(0,Bi.jsxs)(ne.SubTrigger,{ref:i,className:w("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,Bi.jsx)(Na.ChevronRightIcon,{className:"ml-auto"})]}));Os.displayName=ne.SubTrigger.displayName;var Hs=Ht.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(ne.SubContent,{ref:a,className:w("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Hs.displayName=ne.SubContent.displayName;var sa=Ht.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,Bi.jsx)(ne.Portal,{children:(0,Bi.jsx)(ne.Content,{ref:o,sideOffset:t,className:w("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));sa.displayName=ne.Content.displayName;var la=Ht.forwardRef(({className:e,inset:t,...a},o)=>(0,Bi.jsx)(ne.Item,{ref:o,className:w("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}));la.displayName=ne.Item.displayName;var Us=Ht.forwardRef(({className:e,children:t,checked:a,...o},i)=>(0,Bi.jsxs)(ne.CheckboxItem,{ref:i,className:w("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Bi-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,Bi.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Bi.jsx)(ne.ItemIndicator,{children:(0,Bi.jsx)(Na.CheckIcon,{className:"h-4 w-4"})})}),t]}));Us.displayName=ne.CheckboxItem.displayName;var Vs=Ht.forwardRef(({className:e,children:t,...a},o)=>(0,Bi.jsxs)(ne.RadioItem,{ref:o,className:w("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 Bi-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,Bi.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Bi.jsx)(ne.ItemIndicator,{children:(0,Bi.jsx)(Na.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));Vs.displayName=ne.RadioItem.displayName;var zs=Ht.forwardRef(({className:e,inset:t,...a},o)=>(0,Bi.jsx)(ne.Label,{ref:o,className:w("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));zs.displayName=ne.Label.displayName;var js=Ht.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(ne.Separator,{ref:a,className:w("-mx-1 my-1 h-px bg-muted",e),...t}));js.displayName=ne.Separator.displayName;var $s=({className:e,...t})=>(0,Bi.jsx)("span",{className:w("ml-auto text-xs tracking-widest opacity-60",e),...t});$s.displayName="DropdownMenuShortcut";function xo({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:i="700px",gridCols:r=6}){let s=a.find(n=>n.value===e);return(0,Bi.jsxs)(Io.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,Bi.jsx)("div",{className:"hidden lg:block",children:(0,Bi.jsx)(tr,{value:e,onValueChange:t,children:(0,Bi.jsx)(ar,{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(n=>(0,Bi.jsx)(Io.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Bi.jsx)(or,{value:n.value,onClick:()=>t?.(n.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:n.label})},n.value))})})}),(0,Bi.jsx)("div",{className:"lg:hidden",children:(0,Bi.jsxs)(Ca,{children:[(0,Bi.jsx)(Da,{asChild:!0,children:(0,Bi.jsxs)(S,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[s?.label||"Select",(0,Bi.jsx)(Wt.ChevronDown,{className:"h-4 w-4 ml-2"})]})}),(0,Bi.jsx)(sa,{align:"center",className:"w-[180px]",children:a.map(n=>(0,Bi.jsx)(la,{onClick:()=>t?.(n.value),className:`cursor-pointer ${e===n.value?"bg-accent":""}`,children:n.label},n.value))})]})})]})}function rr({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:i=!0,className:r,activeTab:s="assistant",onTabChange:n,showTabs:m=!0,tabOptions:p=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:l,actionIcon:f=(0,Bi.jsx)(Wt.Bot,{className:"mr-2 h-4 w-4"}),actionText:v="Action",onNotificationRemove:C,onRemoveAll:b,logo:P="/headerlogo.png",appName:u="Nuvia",tagline:x="Collaboration Platform"}){let[I,D]=(0,yi.useState)(!1),[N,J]=(0,yi.useState)(t),R=N.filter(O=>!O.read).length,W=O=>{J(ee=>ee.filter(le=>le.id!==O)),C?.(O)},K=()=>{J(O=>O.filter(ee=>ee.read)),b?.()};return(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 pl-2 Bi-4 backdrop-blur ${r||""}`,children:[(0,Bi.jsx)(S,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,Bi.jsx)(Wt.Menu,{className:"h-5 w-5"})}),(0,Bi.jsx)(S,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,Bi.jsx)(Wt.PanelLeft,{className:"h-5 w-5"})}),!i&&(0,Bi.jsxs)(Io.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Bi.jsx)("div",{className:"flex h-10 w-10 items-center justify-center",children:(0,Bi.jsx)("img",{src:P,alt:"Logo",className:"h-10 w-10 object-contain"})}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("h2",{className:"font-semibold text-sm",children:u}),(0,Bi.jsx)("p",{className:"text-xs text-muted-foreground",children:x})]})]}),(0,Bi.jsxs)("div",{className:"flex flex-1 items-center",children:[m&&(0,Bi.jsx)(xo,{activeTab:s,onTabChange:n,tabOptions:p}),(0,Bi.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Bi.jsx)(Io.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,Bi.jsx)(Io.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Bi.jsxs)(S,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:l,children:[f,v]})})}),(0,Bi.jsx)(Qi,{}),(0,Bi.jsx)(Kt,{children:(0,Bi.jsxs)(qt,{children:[(0,Bi.jsx)(Jt,{asChild:!0,children:(0,Bi.jsx)(Io.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Bi.jsxs)(S,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>D(!0),children:[(0,Bi.jsx)(Io.motion.div,{animate:R>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:R>0?1/0:0,repeatDelay:3},children:(0,Bi.jsx)(Wt.Bell,{className:"h-5 w-5"})}),R>0&&(0,Bi.jsx)(Io.motion.span,{className:"absolute -right-1 -top-1 flex h-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:R})]})})}),(0,Bi.jsx)(Ot,{children:"Notifications"})]})}),(0,Bi.jsx)(Io.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Bi.jsxs)(ja,{className:"h-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Bi.jsx)(_o,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Bi.jsx)($a,{})]})})]})]})]}),(0,Bi.jsx)(er,{notifications:N,open:I,onClose:()=>D(!1),onNotificationRemove:W,onRemoveAll:K})]})}var nr=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Bi.jsx)(Wt.User,{className:"h-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function lr({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:i=nr[0],onBusinessUnitChange:r,onSearch:s,businessUnits:n=nr,activeTab:m,onTabChange:p,showTabs:l=!1,onActionClick:f,actionIcon:v,actionText:C="Action",onNotificationRemove:b,onRemoveAll:P,logo:u="/headerlogo.png",appName:x="Nuvia",tagline:I="Collaboration Platform",sidebarInitiallyClosed:D=!1}){let[N,J]=(0,yi.useState)(!D),[R,W]=(0,yi.useState)(!1),[K,O]=(0,yi.useState)(i),ee=le=>{O(le),r?.(le)};return(0,Bi.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[R&&(0,Bi.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>W(!1)}),(0,Bi.jsx)("div",{className:"md:hidden",children:(0,Bi.jsx)($o,{items:e,isOpen:R,isMobile:!0,onClose:()=>W(!1),currentBusinessUnit:K,onBusinessUnitChange:ee,onSearch:s,logo:u,appName:x,tagline:I})}),(0,Bi.jsx)("div",{className:"hidden md:block",children:(0,Bi.jsx)($o,{items:e,isOpen:N,isMobile:!1,currentBusinessUnit:K,onBusinessUnitChange:ee,onSearch:s,logo:u,appName:x,tagline:I})}),(0,Bi.jsxs)("div",{className:w("min-h-screen fixed w-full transition-all duration-300 ease-in-out",N?"md:pl-64":"md:pl-0"),children:[(0,Bi.jsx)(rr,{title:a,notifications:o,onToggleSidebar:()=>J(!N),onToggleMobileMenu:()=>W(!0),sidebarOpen:N,activeTab:m,onTabChange:p,showTabs:l,onActionClick:f,actionIcon:v,actionText:C,onNotificationRemove:b,onRemoveAll:P,logo:u,appName:x,tagline:I}),(0,Bi.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}var _s=[{key:"kanban",icon:Wt.Kanban,label:"Kanban",color:"bg-primary",title:"Kanban View"},{key:"planning",icon:Wt.Calendar,label:"Planning",color:"bg-brand-plum",title:"Planning View",hiddenOnMobile:!0},{key:"epics",icon:Wt.Target,label:"Epics",color:"bg-brand-orange",title:"Epic Planning"},{key:"files",icon:Wt.FileText,label:"Files",color:"bg-brand-green",title:"Files"},{key:"tasks",icon:Wt.Calendar,label:"Tasks",color:"bg-brand-cyan",title:"Tasks"}],dr=({currentView:e,onViewChange:t,children:a})=>(0,Bi.jsxs)("div",{className:"flex w-full h-screen",children:[(0,Bi.jsx)("div",{className:"w-12 h-full bg-sidebar-background flex flex-col flex-shrink-0",children:_s.map(o=>{let i=o.icon,r=e===o.key;return(0,Bi.jsxs)("button",{onClick:()=>t(o.key),className:`flex-1 w-12 flex items-center justify-center text-sidebar-foreground transition-all duration-200 relative overflow-hidden group/btn ${r?o.color:`${o.color}/75 hover:${o.color}`} ${o.hiddenOnMobile?"hidden md:flex":""} hover:w-28 hover:justify-start hover:pl-3`,title:o.title,children:[(0,Bi.jsx)(i,{className:"h-4 w-4 flex-shrink-0"}),(0,Bi.jsx)("span",{className:"text-xs font-medium whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity duration-200 absolute left-8",children:o.label})]},o.key)})}),(0,Bi.jsx)("div",{className:"flex-1 min-w-0 px-4 md:px-6 h-full overflow-auto",children:(0,Bi.jsx)("div",{className:"w-full h-full",children:a})})]});var Ne=fe(require("react"));var da=fe(require("react"));var ke=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ke.displayName="Card";var Gs=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("flex flex-col space-y-1.5 p-6",e),...t}));Gs.displayName="CardHeader";var Ws=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("font-semibold leading-none tracking-tight",e),...t}));Ws.displayName="CardTitle";var Ks=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("text-sm text-muted-foreground",e),...t}));Ks.displayName="CardDescription";var Sa=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("p-6 pt-0",e),...t}));Sa.displayName="CardContent";var qs=da.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("div",{ref:a,className:w("flex items-center p-6 pt-0",e),...t}));qs.displayName="CardFooter";var cr=({title:e,status:t,taskCount:a,children:o,onDrop:i,isCompact:r=!1,height:s})=>{let n=l=>{l.preventDefault()},m=l=>{l.preventDefault(),i(t)};return(0,Bi.jsxs)(ke,{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-xs":""}`,style:{height:s||"calc(100vh - 350px)"},onDragOver:n,onDrop:m,children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Bi.jsx)("h3",{className:`font-semibold text-foreground select-none-important ${r?"text-base":"text-lg"}`,children:e}),(0,Bi.jsx)(he,{variant:"secondary",className:"bg-muted text-muted-foreground",children:a})]}),(0,Bi.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 min-h-0",children:o})]})};var Ga=({task:e,epic:t,onDragStart:a,onTaskClick:o,isCompact:i=!1})=>{let r=l=>{a(e)},s=()=>{o(e)},n=()=>{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"}},m=()=>{switch(e.type){case"story":return(0,Bi.jsx)(Wt.BookOpen,{className:"h-3 w-3"});case"bug":return(0,Bi.jsx)(Wt.Bug,{className:"h-3 w-3"});case"spike":return(0,Bi.jsx)(Wt.Zap,{className:"h-3 w-3"});case"task":default:return(0,Bi.jsx)(Wt.AlertCircle,{className:"h-3 w-3"})}},p=()=>{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,Bi.jsx)(ke,{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:s,children:(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("div",{className:`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium ${p()}`,children:m()}),(0,Bi.jsx)("h4",{className:"font-medium text-foreground text-sm mb-1 line-clamp-2 select-none-important",children:e.name})]})}):(0,Bi.jsxs)(ke,{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:s,children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Bi.jsxs)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-sm font-medium ${p()}`,children:[m(),(0,Bi.jsx)("span",{className:"capitalize",children:e.type})]}),(0,Bi.jsxs)("div",{className:"flex gap-1",children:[(0,Bi.jsx)("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${n()}`,children:e.priority}),(0,Bi.jsx)("div",{className:"flex items-center gap-2 px-3 py-1 border border-accent rounded-full text-xs font-medium",children:e.storyPoints})]})]}),(0,Bi.jsx)("h4",{className:"font-semibold text-foreground mb-2 select-none-important",children:e.name}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground mb-3 line-clamp-2 select-none-important",children:e.description}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Bi.jsx)(Wt.User,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:e.assignee?.value?.name})]}),(0,Bi.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString()})]})]})]})};var mr=fe(require("react")),Be=mr.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)("textarea",{className:w("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}));Be.displayName="Textarea";var se=fe(require("@radix-Io/react-select")),Yt=fe(require("react")),it=se.Root;var wt=se.Value,Qe=Yt.forwardRef(({children:e,className:t,...a},o)=>(0,Bi.jsxs)(se.Trigger,{className:w("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,Bi.jsx)(se.Icon,{asChild:!0,children:(0,Bi.jsx)(Wt.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Qe.displayName=se.Trigger.displayName;var ur=Yt.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(se.ScrollUpButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Bi.jsx)(Wt.ChevronUp,{className:"h-4 w-4"})}));ur.displayName=se.ScrollUpButton.displayName;var gr=Yt.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(se.ScrollDownButton,{className:w("flex cursor-default items-center justify-center py-1",e),ref:a,...t,children:(0,Bi.jsx)(Wt.ChevronDown,{className:"h-4 w-4"})}));gr.displayName=se.ScrollDownButton.displayName;var et=Yt.forwardRef(({children:e,className:t,position:a="popper",...o},i)=>(0,Bi.jsx)(se.Portal,{children:(0,Bi.jsxs)(se.Content,{className:w("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded border bg-card text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",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,Bi.jsx)(ur,{}),(0,Bi.jsx)(se.Viewport,{className:w("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),(0,Bi.jsx)(gr,{})]})}));et.displayName=se.Content.displayName;var Js=Yt.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(se.Label,{className:w("py-1.5 pl-8 Bi-2 text-sm font-semibold",e),ref:a,...t}));Js.displayName=se.Label.displayName;var Pe=Yt.forwardRef(({children:e,className:t,...a},o)=>(0,Bi.jsxs)(se.Item,{className:w("relative flex w-full cursor-default select-none items-center rounded py-1.5 pl-8 Bi-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,Bi.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,Bi.jsx)(se.ItemIndicator,{children:(0,Bi.jsx)(Wt.Check,{className:"h-4 w-4"})})}),(0,Bi.jsx)(se.ItemText,{children:e})]}));Pe.displayName=se.Item.displayName;var Zs=Yt.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(se.Separator,{className:w("-mx-1 my-1 h-px bg-muted",e),ref:a,...t}));Zs.displayName=se.Separator.displayName;var fr=fe(require("react")),qo=fe(require("@radix-Io/react-label"));var Xs=(0,Li.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),z=fr.forwardRef(({className:e,...t},a)=>(0,Bi.jsx)(qo.Root,{ref:a,className:w(Xs(),e),...t}));z.displayName=qo.Root.displayName;var ua=fe(require("react")),Ta=fe(require("@radix-Io/react-toggle-group"));var br=fe(require("react")),Jo=fe(require("@radix-Io/react-toggle"));var Zo=(0,Li.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"}}),Ys=br.forwardRef(({className:e,variant:t,size:a,...o},i)=>(0,Bi.jsx)(Jo.Root,{ref:i,className:w(Zo({variant:t,size:a,className:e})),...o}));Ys.displayName=Jo.Root.displayName;var wr=ua.createContext({size:"default",variant:"default"}),ga=ua.forwardRef(({className:e,variant:t,size:a,children:o,...i},r)=>(0,Bi.jsx)(Ta.Root,{ref:r,className:w("flex items-center justify-center gap-1",e),...i,children:(0,Bi.jsx)(wr.Provider,{value:{variant:t,size:a},children:o})}));ga.displayName=Ta.Root.displayName;var fa=ua.forwardRef(({className:e,children:t,variant:a,size:o,...i},r)=>{let s=ua.useContext(wr);return(0,Bi.jsx)(Ta.Item,{ref:r,className:w(Zo({variant:s.variant||a,size:s.size||o}),e),...i,children:t})});fa.displayName=Ta.Item.displayName;var Qs=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Wt.BookOpen},{value:"task",label:"Task",color:"bg-secondary/20 text-secondary-foreground",icon:Wt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Wt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Wt.Zap}],el=[{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"}],ka=({isOpen:e,onClose:t,onAddTask:a,epics:o,sprints:i,assignees:r,defaultEpicId:s})=>{let[n,m]=(0,yi.useState)({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:"",sprint:"none",assignee:""});(0,yi.useEffect)(()=>{e&&s&&m(f=>({...f,epic:s}))},[e,s]),(0,yi.useEffect)(()=>{e&&m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:s||"",sprint:"none",assignee:""})},[e]);let p=f=>{f.preventDefault(),n.name.trim()&&(a({name:n.name.trim(),description:n.description.trim(),status:"todo",priority:n.priority,type:n.type,storyPoints:n.storyPoints,epic:Number(n.epic),sprint:Number(n.sprint),assignee:n.assignee.trim()?{relationTo:"digital-colleagues",value:Number(n.assignee)}:null,dateLogged:new Date().toISOString(),index:0}),m({name:"",description:"",status:"todo",priority:"medium",type:"story",storyPoints:1,epic:s||"",sprint:"",assignee:""}),t())},l=(f,v)=>{m(C=>({...C,[f]:v}))};return(0,Bi.jsx)($e,{open:e,onOpenChange:t,children:(0,Bi.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Add New Task"})}),(0,Bi.jsxs)("form",{onSubmit:p,className:"space-y-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"name",children:"Task Title"}),(0,Bi.jsx)(ce,{id:"name",value:n.name,onChange:f=>l("name",f.target.value),placeholder:"Enter task title",required:!0})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"description",children:"Description"}),(0,Bi.jsx)(Be,{id:"description",value:n.description,onChange:f=>l("description",f.target.value),placeholder:"Enter task description",rows:3})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Type"}),(0,Bi.jsx)(ga,{type:"single",value:n.type||"",onValueChange:f=>f&&l("type",f),children:Qs.map(f=>{let v=f.icon;return(0,Bi.jsxs)(fa,{value:f.value,className:"flex items-center gap-2 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[(0,Bi.jsx)(v,{className:"h-4 w-4"}),f.label]},f.value)})})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Priority"}),(0,Bi.jsx)(ga,{type:"single",value:n.priority||"",onValueChange:f=>f&&l("priority",f),children:el.map(f=>(0,Bi.jsx)(fa,{value:f.value,className:"data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:f.label},f.value))})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"points",children:"Story Points"}),(0,Bi.jsx)(ce,{id:"points",type:"number",min:"1",max:"100",value:n.storyPoints,onChange:f=>l("storyPoints",parseInt(f.target.value)||1),placeholder:"Enter story points",required:!0})]}),!s&&(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"epic",children:"Epic"}),(0,Bi.jsxs)(it,{value:n.epic,onValueChange:f=>l("epic",f),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{placeholder:"Select an epic"})}),(0,Bi.jsx)(et,{children:o.map(f=>(0,Bi.jsx)(Pe,{value:f.id.toString(),children:(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("div",{className:`w-3 h-3 rounded-full ${f.color}`}),f.name]})},f.id))})]})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"sprint",children:"Sprint (Optional)"}),(0,Bi.jsxs)(it,{value:n.sprint,onValueChange:f=>l("sprint",f),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{placeholder:"Select a sprint"})}),(0,Bi.jsxs)(et,{children:[(0,Bi.jsx)(Pe,{value:"none",children:"Wt Sprint"}),i.map(f=>(0,Bi.jsx)(Pe,{value:f.id.toString(),children:(0,Bi.jsx)("div",{className:"flex items-center gap-2",children:f.name})},f.id))]})]})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"sprint",children:"Assignee"}),(0,Bi.jsxs)(it,{value:n.assignee,onValueChange:f=>l("assignee",f),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{placeholder:"Select an Assignee"})}),(0,Bi.jsxs)(et,{children:[(0,Bi.jsx)(Pe,{value:"none",children:"Wt Assignee"}),r.map(f=>(0,Bi.jsx)(Pe,{value:f.id.toString(),children:(0,Bi.jsx)("div",{className:"flex items-center gap-2",children:f.name})},f.id))]})]})]}),(0,Bi.jsxs)(Va,{children:[(0,Bi.jsx)(S,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Bi.jsx)(S,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Task"})]})]})]})})};var Ka=({fieldName:e,value:t,label:a,multiline:o=!1,onSave:i,className:r="",disabled:s=!1})=>{let[n,m]=(0,yi.useState)(!1),[p,l]=(0,yi.useState)(""),f=()=>{s||(m(!0),l(t))},v=async()=>{p!==t&&await i(e,p),m(!1)},C=b=>{b.key==="Enter"&&!o||b.key==="Enter"&&b.ctrlKey&&o?v():b.key==="Escape"&&(m(!1),l(""))};return(0,Bi.jsxs)("div",{className:`space-y-2 ${r}`,children:[(0,Bi.jsx)(z,{children:a}),n?o?(0,Bi.jsx)(Be,{value:p,onChange:b=>l(b.target.value),onBlur:v,onKeyDown:C,autoFocus:!0,rows:4,className:"resize-none"}):(0,Bi.jsx)(ce,{value:p,onChange:b=>l(b.target.value),onBlur:v,onKeyPress:C,autoFocus:!0,className:"text-lg font-medium"}):(0,Bi.jsxs)("div",{onClick:f,className:`${s?"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,Bi.jsx)("span",{className:o?"text-sm text-muted-foreground":"text-lg font-medium text-foreground",children:t||"Click to edit..."}),!s&&(0,Bi.jsx)(Wt.Edit,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]})]})};var Dr=({comments:e,onAddComment:t})=>{let[a,o]=(0,yi.useState)(""),i=s=>s.split(" ").map(n=>n[0]).join("").toUpperCase(),r=()=>{a.trim()&&(t(a),o(""))};return(0,Bi.jsxs)("div",{className:"space-y-4",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)(Wt.MessageSquare,{className:"h-5 w-5"}),(0,Bi.jsx)(z,{className:"text-lg font-medium",children:"Comments"}),(0,Bi.jsx)(he,{variant:"secondary",children:e.length})]}),(0,Bi.jsx)("div",{className:"space-y-4 max-h-60 overflow-y-auto",children:e.map(s=>(0,Bi.jsxs)("div",{className:"flex gap-3 p-3 bg-muted/50 rounded-lg",children:[(0,Bi.jsx)(ja,{className:"h-8 w-8 yi-1",children:(0,Bi.jsx)($a,{className:"text-xs bg-muted text-muted-foreground",children:i(s.author)})}),(0,Bi.jsxs)("div",{className:"flex-1",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Bi.jsx)("span",{className:"font-medium text-sm",children:s.author}),(0,Bi.jsxs)("span",{className:"text-xs text-muted-foreground",children:[s.createdAt.toLocaleDateString()," Wt ",s.createdAt.toLocaleTimeString()]})]}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground",children:s.text})]})]},s.id))}),(0,Bi.jsxs)("div",{className:"flex gap-2",children:[(0,Bi.jsx)(Be,{value:a,onChange:s=>o(s.target.value),placeholder:"Add a comment...",rows:2,className:"flex-1 resize-none"}),(0,Bi.jsx)(S,{onClick:r,disabled:!a.trim(),size:"sm",className:"self-end",children:(0,Bi.jsx)(Wt.Send,{className:"h-4 w-4"})})]})]})};var Co=({label:e,value:t,onValueChange:a,options:o,showColor:i=!1,disabled:r=!1})=>{let[s,n]=(0,yi.useState)(!1),m=o.find(l=>l.value===t);return(0,Bi.jsxs)("div",{className:"space-y-1",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:e}),(0,Bi.jsxs)(it,{value:t,onValueChange:a,open:s,onOpenChange:l=>{r||n(l)},disabled:r,children:[(0,Bi.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Bi.jsxs)(he,{variant:"secondary",className:`${r?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!r&&n(!s),children:[i&&m?.color&&(0,Bi.jsx)("div",{className:`w-2 h-2 rounded-full ${m.color} mr-1`}),m?.label||"Select..."]})}),(0,Bi.jsx)(et,{children:o.map(l=>(0,Bi.jsx)(Pe,{value:l.value,children:i&&l.color?(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("div",{className:`w-3 h-3 rounded-full ${l.color}`}),l.label]}):l.label},l.value))})]})]})};var Tr=({label:e,value:t,onValueChange:a,options:o,placeholder:i="Search...",allowCustomValue:r=!1,disabled:s=!1})=>{let[n,m]=(0,yi.useState)(!1),[p,l]=(0,yi.useState)(""),f=o.find(u=>u.value===t),v=o.filter(u=>u.label.toLowerCase().includes(p.toLowerCase())),C=u=>{a(u),m(!1),l("")},b=()=>{r&&p.trim()&&!o.find(u=>u.value===p.trim())&&(a(p.trim()),m(!1),l(""))};return(0,Bi.jsxs)("div",{className:"space-y-1",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:e}),(0,Bi.jsxs)(it,{value:t,onValueChange:C,open:n,onOpenChange:u=>{s||m(u)},disabled:s,children:[(0,Bi.jsx)(Qe,{className:"h-auto p-0 border-none bg-transparent hover:bg-muted/50 rounded-md",children:(0,Bi.jsx)(he,{variant:"secondary",className:`${s?"cursor-not-allowed opacity-50":"cursor-pointer"} hover:bg-muted transition-colors`,onClick:()=>!s&&m(!n),children:f?.label||t||"Select..."})}),(0,Bi.jsxs)(et,{children:[(0,Bi.jsx)("div",{className:"p-2",children:(0,Bi.jsx)(ce,{placeholder:i,value:p,onChange:u=>l(u.target.value),onKeyDown:u=>{u.key==="Enter"&&r&&b()},className:"mb-2"})}),v.map(u=>(0,Bi.jsx)(Pe,{value:u.value,children:u.label},u.value)),r&&p.trim()&&!v.find(u=>u.value===p.trim())&&(0,Bi.jsxs)(Pe,{value:p.trim(),children:['Add "',p.trim(),'"']})]})]})]})};var Fe=e=>e?typeof e=="number"?e:typeof e=="object"&&e&&"id"in e?e.id:0:0;var tl=[{value:"story",label:"Story",color:"bg-primary/20 text-primary",icon:Wt.BookOpen},{value:"task",label:"Task",color:"bg-muted text-muted-foreground",icon:Wt.AlertCircle},{value:"bug",label:"Bug",color:"bg-destructive/20 text-destructive",icon:Wt.Bug},{value:"spike",label:"Spike",color:"bg-accent/20 text-accent",icon:Wt.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"}];var kr=({task:e,epics:t,sprints:a,lastUpdated:o,onUpdateTask:i,onClose:r,onDelete:s,isUpdating:n=!1,isDeleting:m=!1,deleteState:p="idle",teamMembers:l})=>{let[f,v]=(0,yi.useState)(e.storyPoints),C=(0,yi.useRef)(null),[b,P]=(0,yi.useState)(l);(0,yi.useEffect)(()=>{P(l)},[l]);let u=(0,yi.useCallback)((D,N)=>{C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{i(D,N)},500)},[i]);(0,yi.useEffect)(()=>{u("storyPoints",f?.toString()||"1")},[f]);let x=D=>D.split(" ").map(N=>N[0]).join("").toUpperCase(),I=()=>p==="loading"?(0,Bi.jsxs)(S,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Bi.jsx)(Wt.Loader2,{className:"h-3 w-3 animate-spin"}),"Deleting..."]}):p==="success"?(0,Bi.jsxs)(S,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Bi.jsx)(Wt.Check,{className:"h-3 w-3"}),"Deleted"]}):p==="error"?(0,Bi.jsxs)(S,{disabled:!0,variant:"destructive",className:"w-full h-8 text-xs gap-1",children:[(0,Bi.jsx)(Wt.Bi,{className:"h-3 w-3"}),"Delete failed"]}):(0,Bi.jsxs)(S,{onClick:s,variant:"destructive",className:"w-full h-8 text-xs gap-1",disabled:n||m,children:[(0,Bi.jsx)(Wt.Trash2,{className:"h-3 w-3"}),"Delete Task"]});return(0,Bi.jsxs)("div",{className:"flex flex-col h-full",children:[(0,Bi.jsxs)("div",{className:"space-y-4",style:{opacity:n?.6:1},children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Status"}),(0,Bi.jsx)(Co,{label:"",value:e.status,onValueChange:D=>i("status",D),options:[{value:"todo",label:"To Do"},{value:"in-progress",label:"In Progress"},{value:"done",label:"Done"}],disabled:n})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Type"}),(0,Bi.jsx)(ga,{type:"single",value:e.type||"",onValueChange:D=>D&&i("type",D),className:"grid grid-cols-2 gap-1",disabled:n,children:tl.map(D=>{let N=D.icon;return(0,Bi.jsxs)(fa,{value:D.value,className:"flex items-center gap-1 text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:[(0,Bi.jsx)(N,{className:"h-3 w-3"}),D.label]},D.value)})})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Priority"}),(0,Bi.jsx)(ga,{type:"single",value:e.priority||"",onValueChange:D=>D&&i("priority",D),className:"grid grid-cols-3 gap-1",disabled:n,children:al.map(D=>(0,Bi.jsx)(fa,{value:D.value,className:"text-xs h-8 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",size:"sm",disabled:n,children:D.label},D.value))})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Story Points"}),(0,Bi.jsx)("input",{type:"number",min:"1",max:"100",value:f||1,onChange:D=>{let N=Number(D.target.value);N<1?v(1):N>100?v(100):v(N)},className:"w-full h-8 px-2 text-xs border border-border rounded-md focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent bg-background text-foreground disabled:opacity-50 disabled:cursor-not-allowed",disabled:n})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Epic"}),(0,Bi.jsx)(Co,{label:"",value:Fe(e.epic).toString(),onValueChange:D=>i("epic",D),options:(t||[]).map(D=>({value:D.id.toString(),label:D?.name,color:D.color})),showColor:!0,disabled:n})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Sprint"}),(0,Bi.jsx)(Co,{label:"",value:Fe(e.sprint).toString()||"none",onValueChange:D=>i("sprint",D==="none"?"":D),options:[{value:"none",label:"Wt Sprint"},...(a||[]).map(D=>({value:D.id.toString(),label:`${D?.name}`}))],disabled:n})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{className:"text-xs text-muted-foreground",children:"Assignee"}),(0,Bi.jsx)(Tr,{label:"",value:e.assignee?.value?.name,onValueChange:D=>i("assignee",D),options:b.map(D=>({value:`${typeof D.email=="string"?"users":"digital-colleagues"}:${D.id}`,label:D?.name||""})),placeholder:"Search team members...",allowCustomValue:!0,disabled:n})]})]}),(0,Bi.jsxs)("div",{className:"yi-auto pt-4 space-y-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(S,{onClick:r,variant:"outline",className:"w-full h-8 text-xs",disabled:n||m,children:"Close"}),I()]}),(0,Bi.jsxs)("div",{className:"pt-4 border-t border-border space-y-2",children:[(0,Bi.jsx)("div",{className:"text-xs text-muted-foreground font-medium mb-2",children:"Information"}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("span",{className:"text-xs text-muted-foreground",children:"Logged By"}),(0,Bi.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Bi.jsx)(Wt.User,{className:"h-3 w-3"}),(0,Bi.jsx)("span",{children:"System"})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("span",{className:"text-xs text-muted-foreground",children:"Created"}),(0,Bi.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-3 w-3"}),(0,Bi.jsx)("span",{children:new Date(e.createdAt)?.toLocaleDateString()})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("span",{className:"text-xs text-muted-foreground",children:"Last Updated"}),(0,Bi.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Bi.jsx)(Wt.Clock,{className:"h-3 w-3"}),(0,Bi.jsxs)("span",{children:[new Date(o).toLocaleDateString()," Wt"," ",new Date(o).toLocaleTimeString()]})]})]})]})]})]})};var hn=fe(require("@radix-Io/react-dialog"));var Qr=require("@payloadcms/richtext-lexical/lexical/react/LexicalAutoFocusPlugin"),en=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposer"),tn=require("@payloadcms/richtext-lexical/lexical/react/LexicalContentEditable"),an=require("@payloadcms/richtext-lexical/lexical/react/LexicalErrorBoundary"),on=require("@payloadcms/richtext-lexical/lexical/react/LexicalHistoryPlugin"),rn=require("@payloadcms/richtext-lexical/lexical/react/LexicalRichTextPlugin"),nn=require("@payloadcms/richtext-lexical/lexical/react/LexicalListPlugin"),To=require("@payloadcms/richtext-lexical/lexical/list"),sn=require("@payloadcms/richtext-lexical/lexical/rich-text"),ln=require("@payloadcms/richtext-lexical/lexical/react/LexicalOnChangePlugin");var Xr=require("@payloadcms/richtext-lexical/lexical/react/LexicalComposerContext"),Xa=require("@payloadcms/richtext-lexical/lexical/utils"),Q=require("@payloadcms/richtext-lexical/lexical"),li=require("@payloadcms/richtext-lexical/lexical/selection");var Or=require("@radix-Io/react-dialog"),Do=require("@payloadcms/richtext-lexical/client");var Qo=fe(require("bson-objectid"));var Pr=require("@payloadcms/Io");var ol=e=>{let{data:{relationTo:t,value:a},nodeKey:o}=e,[i]=(0,Xr.useLexicalComposerContext)(),[r,s]=(0,yi.useState)(""),[n,m]=(0,yi.useState)(""),[p,l]=(0,yi.useState)(""),f=async u=>{console.log("fetchMedia",u)};(0,yi.useEffect)(()=>{typeof a=="string"?a.length===24?f(a):(s(a||""),l(P(b())),m(C()||"")):typeof a=="object"&&(s(`${process.env.NEXT_PUBLIC_API_URL}${a.url}`||""),l(P(a.filesize)),m(a.mimeType?.split("/")[1]||""))},[]);let v=(0,yi.useCallback)(()=>{i.update(()=>{(0,Q.$getNodeByKey)(o)?.remove()})},[i,o]),C=()=>{let u=e.data.value;return typeof u=="string"?u.split(";base64")[0]?.split("image/")[1]:""},b=()=>{let u=e.data.value;if(typeof u=="string"){let x=u.split(",")[1]?.length||0;return 4*Math.ceil(x/3)*.5624896334383812/1e3}return 0};function P(u){if(u>=1e6){let I=u/1e6;return`${I>=10?Math.round(I).toString():I.toFixed(1)} MB`}return`${Math.floor(u/1e3)} KB`}return(0,Bi.jsx)("div",{className:"my-2",contentEditable:!1,children:(0,Bi.jsxs)("div",{className:"border border-slate-800 rounded-xl overflow-clip w-60 flex flex-col gap-2 bg-[#222222]",children:[(0,Bi.jsxs)("div",{className:"flex gap-2 border-b border-b-slate-100/10",children:[(0,Bi.jsx)("div",{className:"flex-1",children:e.data.value?(0,Bi.jsx)("img",{className:"object-cover m-0 w-full min-w-[115px] min-h-[105px]","data-lexical-upload-id":a,"data-lexical-upload-relation-to":t,src:r}):(0,Bi.jsx)(Pr.File,{})}),(0,Bi.jsx)(Kt,{children:(0,Bi.jsxs)(qt,{children:[(0,Bi.jsxs)(Jt,{className:"flex-1 flex justify-center items-center text-[#b5b5b5]",children:[(0,Bi.jsx)("span",{className:"font-medium text-sm",children:"Media"}),(0,Bi.jsx)("button",{onClick:u=>{u.preventDefault(),v()},className:"flex-1 flex justify-center items-center",children:(0,Bi.jsx)(Wt.Bi,{width:24,height:24,strokeWidth:1})})]}),(0,Bi.jsx)(Ot,{children:(0,Bi.jsx)("span",{children:"Remove image"})})]})})]}),(0,Bi.jsxs)("div",{className:"flex items-center justify-center gap-4 py-3 flex-1 text-xs font-bold",children:[(0,Bi.jsx)("span",{className:"",children:n?.toLocaleUpperCase()}),(0,Bi.jsx)("span",{children:p})]})]})})},Mr=ol;function il(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id");if(a)return{node:Pa({fields:{},relationTo:"media",value:a})}}return e.src.startsWith("file:///"),null}var qa=class extends Do.UploadNode{static importDOM(){return{img:()=>({conversion:il,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new Qo.default().toHexString(),t.version=3);let a={id:t.id??new Qo.default().toHexString(),fields:t.fields,relationTo:"media",value:t.value},o=Pa(a);return o.setFormat?.(t.format),o}decorate(){return(0,Bi.jsx)(Mr,{data:this.__data,nodeKey:this.getKey()})}};function Pa(e){return new qa({data:e})}var rl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nl=e=>rl?(e||window).getSelection():null,Bm=(0,Q.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND"),ei=(0,Q.createCommand)("INSERT_UPLOAD_COMMAND");function Hr({activeEditor:e,onClose:t,isOpen:a=!1}){let o=(0,yi.useRef)(!1),[i,r]=(0,yi.useState)(!0),[s,n]=(0,yi.useState)(""),[m,p]=(0,yi.useState)(""),[l,f]=(0,yi.useState)(!1),[v,C]=(0,yi.useState)("left"),b=s==="",P=N=>{f(N.target.checked)},u=N=>{C(N.target.value)},x=N=>{let J=new FileReader;J.onload=function(){return typeof J.result=="string"&&n(J.result),""},N!==null&&N[0]&&J.readAsDataURL(N[0])};(0,yi.useEffect)(()=>{o.current=!1;let N=J=>{o.current=J.altKey};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[e]),(0,yi.useEffect)(()=>{i||t()},[i]),(0,yi.useEffect)(()=>{r(a)},[a]);let I=({editor:N,relationTo:J,replaceNodeKey:R,value:W})=>{if(R)N.update(()=>{let K=(0,Q.$getNodeByKey)(R);K&&K.replace(Pa({id:"",fields:{},relationTo:"media",value:W}))});else{let K=N.dispatchCommand(ei,{fields:null,relationTo:"media",value:W})}},D=()=>{I({editor:e,relationTo:"media",replaceNodeKey:null,value:{altText:m,src:s,showCaption:l,position:v}.src}),r(!1),t()};return(0,Bi.jsx)($e,{open:i,onOpenChange:N=>r(N),children:(0,Bi.jsxs)(Ke,{children:[(0,Bi.jsxs)(qe,{children:[(0,Bi.jsx)(Le,{children:"Upload Image"}),(0,Bi.jsx)(Or.DialogDescription,{children:"Description"})]}),(0,Bi.jsxs)("div",{className:"",children:[(0,Bi.jsx)("div",{style:{marginBottom:"1em"},children:(0,Bi.jsx)(ce,{type:"file",onChange:N=>x(N.target.files),accept:"image/*","data-test-id":"image-modal-file-upload"})}),(0,Bi.jsx)("div",{style:{marginBottom:"1em"},children:(0,Bi.jsx)(ce,{"aria-label":"Alt Text",placeholder:"Descriptive alternative text",onChange:N=>p(N.currentTarget.value),value:m,"data-test-id":"image-modal-alt-text-input"})}),(0,Bi.jsx)(S,{"data-test-id":"image-modal-file-upload-btn",disabled:b,onClick:()=>D(),children:"Confirm"})]})]})})}function ti({captionsEnabled:e}){let[t]=(0,Xr.useLexicalComposerContext)();return(0,yi.useEffect)(()=>{if(!t.hasNodes([Do.UploadNode]))throw new Error("ImagesPlugin: ImageNode not registered on editor");return(0,Xa.mergeRegister)(t.registerCommand(Q.DRAGSTART_COMMAND,a=>sl(a),Q.COMMAND_PRIORITY_HIGH),t.registerCommand(Q.DRAGOVER_COMMAND,a=>ll(a),Q.COMMAND_PRIORITY_LOW),t.registerCommand(Q.DROP_COMMAND,a=>dl(a,t),Q.COMMAND_PRIORITY_HIGH))},[e,t]),null}function sl(e){if(!ai())return!1;let a=e.dataTransfer;return a?(a.setData("text/plain","Bi"),!0):!1}function ll(e){return ai()?(Ur(e)||e.preventDefault(),!0):!1}function dl(e,t){let a=ai();if(!a)return!1;if(e.preventDefault(),Ur(e)){let o=cl(e);a.remove();let i=(0,Q.$createRangeSelection)();o!=null&&i.applyDOMRange(o),(0,Q.$setSelection)(i)}return!0}function ai(){let e=(0,Q.$getSelection)();if(!(0,Q.$isNodeSelection)(e))return null;let a=e.getNodes()[0];return(0,Do.$isUploadNode)(a)?a:null}function Ur(e){let t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.editor-image")&&t.parentElement&&t.parentElement.closest("div.ContentEditable__root"))}function cl(e){let t,a=e.target,o=a==null?null:a.nodeType===9?a.defaultView:a.ownerDocument.defaultView,i=nl(o);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&i!==null)i.collapse(e.rangeParent,e.rangeOffset||0),t=i.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var ml=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})}),Vr=ml;var pl=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})}),zr=pl;var ul=()=>(0,Bi.jsxs)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Bi.jsx)("path",{Bi:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),(0,Bi.jsx)("path",{Bi:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]}),jr=ul;var gl=()=>(0,Bi.jsxs)("svg",{"aria-hidden":"true",className:"",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,Bi.jsx)("path",{Bi:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),(0,Bi.jsx)("path",{Bi:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]}),$r=gl;var fl=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})}),_r=fl;var vl=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})}),Gr=vl;var Wr=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})}),Kr=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})}),qr=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})}),Jr=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})}),Zr=()=>(0,Bi.jsx)("svg",{"aria-hidden":"true",className:"w-5 size-5",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,Bi.jsx)("path",{Bi:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});var si=1;function hl(){return(0,Bi.jsx)("span",{className:"border border-[#222222]"})}function di(){let[e]=(0,Xr.useLexicalComposerContext)(),t=(0,yi.useRef)(null),[a,o]=(0,yi.useState)(!1),[i,r]=(0,yi.useState)(!1),[s,n]=(0,yi.useState)(!1),[m,p]=(0,yi.useState)(!1),[l,f]=(0,yi.useState)(!1),[v,C]=(0,yi.useState)(!1),[b,P]=(0,yi.useState)(!1),[u,x]=(0,yi.useState)(!1),[I,D]=(0,yi.useState)(!1),[N,J]=(0,yi.useState)("left"),[R,W]=(0,yi.useState)("p"),K=g=>{e.update(()=>{let L=(0,Q.$getSelection)();(0,Q.$isRangeSelection)(L)&&(g==="p"?(0,li.$setBlocksType)(L,()=>(0,Q.$createParagraphNode)()):(0,li.$setBlocksType)(L,()=>(0,sn.$createHeadingNode)(g)))})},O=(0,yi.useCallback)(()=>{let g=(0,Q.$getSelection)();if((0,Q.$isRangeSelection)(g)){n(g.hasFormat("bold")),p(g.hasFormat("italic")),f(g.hasFormat("underline")),C(g.hasFormat("strikethrough")),P(g.hasFormat("subscript")),x(g.hasFormat("superscript"));let L=g.anchor.getNode(),V=L;for(;V&&!(0,Q.$isParagraphNode)(V)&&V!==(0,Q.$getRoot)();){let ae=V.getParent();ae&&(V=ae)}if(V){let ae=V.getFormatType();J(ae||"left")}let we=L.getTopLevelElement()?.__tag;W(we||"p")}},[]);(0,yi.useEffect)(()=>(0,Xa.mergeRegister)(e.registerUpdateListener(({editorState:g})=>{g.read(()=>{O()})}),e.registerCommand(Q.SELECTION_CHANGE_COMMAND,(g,L)=>(O(),!1),si),e.registerCommand(Q.CAN_UNDO_COMMAND,g=>(o(g),!1),si),e.registerCommand(Q.CAN_REDO_COMMAND,g=>(r(g),!1),si),(0,Xa.mergeRegister)(e.registerCommand(ei,g=>(e.update(()=>{let L=(0,Q.$getSelection)()||(0,Q.$getPreviousSelection)();if((0,Q.$isRangeSelection)(L)){let V=Pa({id:g.id,fields:g.fields,relationTo:g.relationTo,value:g.value}),{focus:we}=L,ae=we.getNode();(0,Xa.$insertNodeToNearestRoot)(V),(0,Q.$isParagraphNode)(ae)&&!ae.__first&&ae.remove()}}),!0),Q.COMMAND_PRIORITY_EDITOR))),[e,O]);let ee=[[{label:"Undo",icon:(0,Bi.jsx)(Wt.RotateCcw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Q.UNDO_COMMAND,void 0)},disabled:!a},{label:"Redo",icon:(0,Bi.jsx)(Wt.RotateCw,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Q.UNDO_COMMAND,void 0)},disabled:!i}],[{label:"Bold",icon:(0,Bi.jsx)(Vr,{}),onClick:()=>{e.dispatchCommand(Q.FORMAT_TEXT_COMMAND,"bold")},value:"bold",active:s},{label:"Italic",icon:(0,Bi.jsx)(zr,{}),onClick:()=>{e.dispatchCommand(Q.FORMAT_TEXT_COMMAND,"italic")},value:"italic",active:m},{label:"Underline",icon:(0,Bi.jsx)(jr,{}),onClick:()=>{e.dispatchCommand(Q.FORMAT_TEXT_COMMAND,"underline")},value:"underline",active:l},{label:"Strikethrough",icon:(0,Bi.jsx)($r,{}),onClick:()=>{e.dispatchCommand(Q.FORMAT_TEXT_COMMAND,"strikethrough")},value:"strikethrough",active:v},{label:"Subscript",icon:(0,Bi.jsx)(_r,{}),onClick:()=>{e.dispatchCommand(Q.FORMAT_TEXT_COMMAND,"subscript")},value:"subscript",active:b},{label:"Superscript",icon:(0,Bi.jsx)(Gr,{}),onClick:()=>{e.dispatchCommand(Q.FORMAT_TEXT_COMMAND,"superscript")},value:"superscript",active:u}]],le=[{label:"Left Align",direction:"left",icon:(0,Bi.jsx)(Wt.AlignLeft,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Q.FORMAT_ELEMENT_COMMAND,"left")}},{label:"Center Align",direction:"center",icon:(0,Bi.jsx)(Wt.AlignCenter,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Q.FORMAT_ELEMENT_COMMAND,"center")}},{label:"Right Align",direction:"right",icon:(0,Bi.jsx)(Wt.AlignRight,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Q.FORMAT_ELEMENT_COMMAND,"right")}},{label:"Justify Align",direction:"justify",icon:(0,Bi.jsx)(Wt.AlignJustify,{width:15,height:15}),onClick:()=>{e.dispatchCommand(Q.FORMAT_ELEMENT_COMMAND,"justify")}}],xe=[{label:"Normal Text",value:"p",icon:(0,Bi.jsx)(Wr,{}),onClick:()=>K("p")},{label:"Heading 1",value:"h1",icon:(0,Bi.jsx)(Kr,{}),onClick:()=>K("h1")},{label:"Heading 2",value:"h2",icon:(0,Bi.jsx)(qr,{}),onClick:()=>K("h2")},{label:"Heading 3",value:"h3",icon:(0,Bi.jsx)(Jr,{}),onClick:()=>K("h3")},{label:"Heading 4",value:"h4",icon:(0,Bi.jsx)(Zr,{}),onClick:()=>K("h4")},...[{label:"Unordered List",value:"ul",icon:(0,Bi.jsx)(Wt.List,{width:15,height:15}),onClick:()=>{e.dispatchCommand(To.INSERT_UNORDERED_LIST_COMMAND,void 0)}},{label:"Ordered List",value:"ol",icon:(0,Bi.jsx)(Wt.ListOrdered,{width:15,height:15}),onClick:()=>{e.dispatchCommand(To.INSERT_ORDERED_LIST_COMMAND,void 0)}}]],Se=[{label:"Insert Image",icon:(0,Bi.jsx)(Wt.ImageUp,{width:15,height:15}),onClick:()=>{D(!0)},disabled:!1}];return(0,Bi.jsx)("div",{className:"flex justify-between border border-[#222222] py-2 px-2 sticky top-0 bg-black z-50",children:(0,Bi.jsxs)("div",{className:"flex gap-2 ",ref:t,children:[ee.map((g,L)=>(0,Bi.jsxs)(yi.Fragment,{children:[(0,Bi.jsx)("div",{className:"flex items-center gap-2",children:g.map((V,we)=>(0,Bi.jsx)("div",{role:"button","aria-disabled":V.disabled||!1,onClick:V.onClick,className:w("p-1 transition-all flex items-center justify-center rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",V.active&&"bg-[#3c3c3c]"),"aria-label":V.label,children:(0,Bi.jsx)(Kt,{children:(0,Bi.jsxs)(qt,{children:[(0,Bi.jsx)(Jt,{className:"text-[#b5b5b5]",children:V.icon}),(0,Bi.jsx)(Ot,{children:(0,Bi.jsx)("p",{children:V.label})})]})})},we))}),(0,Bi.jsx)(hl,{})]},`toolbar-option-${g.length}-${L}`)),(0,Bi.jsxs)(Ca,{children:[(0,Bi.jsxs)(Da,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[le.find(g=>g.direction===N)?.icon,le.find(g=>g.direction===N)?.label,(0,Bi.jsx)(Wt.ChevronDown,{width:15,height:15})]}),(0,Bi.jsx)(sa,{className:"bg-black hover:bg-black",children:le.map((g,L)=>(0,Bi.jsxs)(la,{onClick:g.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Bi.jsx)("span",{children:g.icon}),(0,Bi.jsx)("span",{children:g.label})]},`${g.label}-${L}`))})]}),(0,Bi.jsxs)(Ca,{children:[(0,Bi.jsxs)(Da,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[xe.find(g=>g.value===R)?.icon,xe.find(g=>g.value===R)?.label,(0,Bi.jsx)(Wt.ChevronDown,{width:15,height:15})]}),(0,Bi.jsx)(sa,{className:"bg-black hover:bg-black",children:xe.map((g,L)=>(0,Bi.jsxs)(la,{onClick:g.onClick,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Bi.jsx)("span",{children:g.icon}),(0,Bi.jsx)("span",{children:g.label})]},`heading-option-${g.label}-${L}`))})]}),(0,Bi.jsxs)(Ca,{children:[(0,Bi.jsxs)(Da,{className:"flex items-center justify-center gap-2 px-2 py-1 rounded hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c] text-[#b5b5b5] text-xs",children:[(0,Bi.jsx)(Wt.Plus,{width:15,height:15}),(0,Bi.jsx)(Wt.ChevronDown,{width:15,height:15})]}),(0,Bi.jsx)(sa,{className:"bg-black hover:bg-black",children:Se.map((g,L)=>(0,Bi.jsxs)(la,{onClick:g.onClick,disabled:g.disabled,className:"flex items-center gap-2 text-xs text-[#b5b5b5] hover:bg-[#3c3c3c] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#3a3a3a] focus:ring-[#3c3c3c]",children:[(0,Bi.jsx)("span",{children:g.icon}),(0,Bi.jsx)("span",{children:g.label})]},L))})]}),I&&(0,Bi.jsx)(Hr,{activeEditor:e,onClose:()=>{D(!1)},isOpen:I})]})})}var bl=({setValue:e,value:t,name:a,editable:o=!0})=>{let[i]=(0,Xr.useLexicalComposerContext)(),r=(0,yi.useRef)(null),s=n=>{n.read(()=>{let m=n.toJSON();JSON.stringify(m)!==JSON.stringify(r.current)&&(r.current=m,e?.(()=>m))})};return(0,yi.useEffect)(()=>{i.setEditable(o)},[o,i]),(0,yi.useEffect)(()=>{t&&JSON.stringify(t)!==JSON.stringify(r.current)&&i.update(()=>{try{let n=i.parseEditorState(t);i.setEditorState(n),r.current=t}catch(n){console.error("Error parsing editor state:",n)}},{discrete:!0})},[t,i]),(0,Bi.jsx)("div",{className:"w-full",children:(0,Bi.jsxs)("div",{className:" ",children:[o&&(0,Bi.jsx)(di,{}),(0,Bi.jsxs)("div",{className:"px-4 my-4 border-l border-[#222222]",children:[(0,Bi.jsx)(rn.RichTextPlugin,{contentEditable:(0,Bi.jsx)(tn.ContentEditable,{name:a,className:"focus:outline-none focus:ring-0 focus-visible:outline-none min-h-40"}),ErrorBoundary:an.LexicalErrorBoundary}),o&&(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsx)(on.HistoryPlugin,{}),(0,Bi.jsx)(Qr.AutoFocusPlugin,{}),(0,Bi.jsx)(nn.ListPlugin,{}),(0,Bi.jsx)(ln.OnChangePlugin,{onChange:s}),(0,Bi.jsx)(ti,{})]})]})]})})},xl=({setValue:e,value:t,name:a,editable:o=!0})=>(0,Bi.jsx)(en.LexicalComposer,{initialConfig:{namespace:"Lexical editor",nodes:[To.ListNode,To.ListItemNode,sn.HeadingNode,qa],onError(r){throw console.error("Lexical error:",r),r},theme:{code:"editor-code",heading:{h1:"text-4xl text-primary",h2:"text-3xl",h3:"text-2xl",h4:"text-lg",h5:"text-sm"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"list-decimal",ul:"list-disc"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold font-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough line-through",underline:"editor-text-underline underline",underlineStrikethrough:"underline line-through"}}},children:(0,Bi.jsx)(bl,{value:t,setValue:e,name:a,editable:o})}),cn=xl;var mn=fe(require("react")),kt=fe(require("@radix-Io/react-popover"));var mi=kt.Root,pi=kt.Trigger;var ko=mn.forwardRef(({className:e,align:t="center",sideOffset:a=4,...o},i)=>(0,Bi.jsx)(kt.Portal,{children:(0,Bi.jsx)(kt.Content,{ref:i,align:t,sideOffset:a,className:w("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));ko.displayName=kt.Content.displayName;var pn=require("react-day-picker");function Po({className:e,classNames:t,showOutsideDays:a=!0,...o}){return(0,Bi.jsx)(pn.DayPicker,{showOutsideDays:a,weekStartsOn:1,className:w("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:w(Ha({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 yi-2",cell:w("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",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:w(Ha({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})}Po.displayName="Calendar";var Qa=e=>"mimeType"in e&&"url"in e&&!("format"in e),yl=e=>{if(!e?.root?.children)return"";let t=[],a=r=>{if(!r)return"";switch(r.type){case"heading":{let s=r.tag?parseInt(r.tag.replace("h","")):1,n=o(r.children||[]);return"#".repeat(s)+" "+n}case"paragraph":return r.children&&r.children.some(m=>m.type==="text"?m.text&&m.text.trim().length>0:(m.type==="linebreak",!0))?o(r.children||[]):"";case"list":{let s=[],n=r.listType==="number"?"1.":"-";return r.children?.forEach((m,p)=>{if(m.type==="listitem"){let l=o(m.children||[]),f=r.listType==="number"?`${p+1}.`:n;s.push(`${f} ${l}`)}}),s.join(`
6
+ `)}case"listitem":return o(r.children||[]);case"text":{let s=r.text||"";if(r.format){let n=(r.format&1)!==0,m=(r.format&2)!==0,p=(r.format&4)!==0,l=(r.format&8)!==0;(r.format&16)!==0?s=`\`${s}\``:(n&&(s=`**${s}**`),m&&(s=`*${s}*`),p&&(s=`~~${s}~~`),l&&(s=`<u>${s}</u>`))}return s}default:return r.children?o(r.children):""}},o=r=>r.map(s=>{if(s.type==="text"){let n=s.text||"";if(s.format){let m=(s.format&1)!==0,p=(s.format&2)!==0,l=(s.format&4)!==0,f=(s.format&8)!==0;(s.format&16)!==0?n=`\`${n}\``:(m&&(n=`**${n}**`),p&&(n=`*${n}*`),l&&(n=`~~${n}~~`),f&&(n=`<u>${n}</u>`))}return n}else{if(s.type==="paragraph")return o(s.children||[]);if(s.type==="listitem")return o(s.children||[]);if(s.type==="linebreak")return`
7
7
  `}return a(s)}).filter(Boolean).join("");e.root.children.forEach(r=>{let s=a(r);r.type==="paragraph"?t.push(s||""):s&&t.push(s)});let i=[];for(let r=0;r<t.length;r++)i.push(t[r]),r<t.length-1&&(t[r]===""||t[r+1]===""||i.push(""));return i.join(`
8
- `)},ta=e=>{let t=[],a=0;for(;a<e.length;){let i=e.slice(a).match(/^<u\s*[^>]*>([\s\S]*?)<\/u>/i);if(i&&i[0]){let f=i[1]||"",x=f?ta(f):[];x.length>0?(x.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|8)}),t.push(...x)):f===""&&t.push({type:"text",text:"",format:8}),a+=i[0].length;continue}if(e.slice(a).startsWith("</u>")){a+=4;continue}let r=e.slice(a).match(/^(`+)([^`]+)\1/);if(r){let f=r[2];f&&t.push({type:"text",text:f,format:16}),a+=r[0].length;continue}let s=e.slice(a).match(/^(~~)(.+?)\1/);if(s){let f=s[2],x=ta(f);x.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|4)}),t.push(...x),a+=s[0].length;continue}let n=e.slice(a).match(/^(\*\*|__)(.+?)\1/);if(n){let f=n[2],x=ta(f);x.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|1)}),t.push(...x),a+=n[0].length;continue}let m=e.slice(a).match(/^(\*|Bi)([^*Bi\n]+?)\1(?!\*|Bi)/);if(m&&m[0].length>2){let f=m[2],x=ta(f);x.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|2)}),t.push(...x),a+=m[0].length;continue}if(e[a]===`
9
- `){t.push({type:"linebreak",version:1}),a+=1;continue}let p=e.length,l=[{pattern:/<u>/i,offset:0},{pattern:/\*\*/,offset:0},{pattern:/__/,offset:0},{pattern:/~~/,offset:0},{pattern:/`+/,offset:0},{pattern:/\*[^*\n]/,offset:0},{pattern:/Bi[^Bi\n]/,offset:0},{pattern:/\n/,offset:0}];for(let{pattern:f}of l){let x=e.slice(a+1).search(f);x!==-1&&x+1<p-a&&(p=a+x+1)}let g=e.slice(a,p);g&&t.push({type:"text",text:g,format:0}),a=p}let o=[];for(let i of t)i.type==="linebreak"?o.push(i):o.length>0&&o[o.length-1].type==="text"&&i.type==="text"&&o[o.length-1].format===i.format?o[o.length-1].text+=i.text:o.push(i);return o.length>0?o:[{type:"text",text:"",format:0}]},wl=e=>{let t=e.split(`
10
- `),a=[],o=[],i=[],r=null,s=()=>{if(o.length>0){for(let m=0;m<o.length;m++){let p=o[m],l=ta(p),g=l.length>0?l.map(f=>({...f,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];a.push({type:"paragraph",children:g,direction:"ltr",format:"",indent:0,version:1})}o=[]}},n=()=>{i.length>0&&r&&(a.push({type:"list",listType:r,tag:r==="number"?"ol":"ul",start:1,format:"",indent:0,version:1,direction:"ltr",children:i}),i=[],r=null)};for(let m of t){let p=m.trim();if(!p){s(),n(),a.push({children:[],direction:null,format:"",indent:0,type:"paragraph",version:1,textFormat:0,textStyle:""});continue}let l=p.match(/^(#{1,6})\s+(.+)$/);if(l){s(),n();let x=l[1].length,b=l[2],R=ta(b);a.push({type:"heading",tag:`h${x}`,children:R.length>0?R:[{type:"text",text:"",format:0}]});continue}let g=p.match(/^(\Bi+)\.\s+(.*)$/);if(g){s(),r==="bullet"&&n(),r!=="number"&&(i.length>0&&n(),r="number");let x=g[2]||"",b=ta(x),R=b.length>0?b.map(u=>({...u,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];i.push({type:"listitem",value:i.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:R,direction:"ltr",format:"",indent:0,version:1}]});continue}let f=p.match(/^[-*+]\s+(.+)$/);if(f){s(),r==="number"&&n(),r!=="bullet"&&(i.length>0&&n(),r="bullet");let x=f[1],b=ta(x),R=b.length>0?b.map(u=>({...u,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];i.push({type:"listitem",value:i.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:R,direction:"ltr",format:"",indent:0,version:1}]});continue}i.length>0&&n(),o.push(m)}return s(),n(),a.length===0&&a.push({type:"paragraph",children:[{type:"text",text:"",format:0}]}),{root:{type:"root",children:a,direction:"ltr",format:"",indent:0,version:1}}},Nl=async e=>{let t="",a,o="text";if(e.url)try{let i=e.url;!i.startsWith("http://")&&!i.startsWith("https://")&&!i.startsWith("/")&&(i="/"+i);let r=await fetch(i);r.ok?(t=await r.text(),console.log("Successfully loaded content, length:",t.length)):console.error("Failed to fetch file content:",r.status,r.statusText)}catch(i){console.error("Failed to fetch file content:",i)}else console.warn("No URL provided for file:",e.name);return e.mimeType==="text/markdown"?(o="richText",a=wl(t)):e.mimeType?.startsWith("text/")&&(o="text"),{id:e.id.toString(),title:e.name,description:void 0,content:o==="richText"?void 0:t,richTextContent:o==="richText"?a:void 0,format:o,metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}};function fn({document:e,onCancel:t,onSave:a,onFileUpdate:o}){let[i,r]=(0,yi.useState)(Qa(e)),[s,n]=(0,yi.useState)(Qa(e)?{id:e.id.toString(),title:e.name,description:void 0,content:"",format:"text",metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}:{...e,updatedAt:new Date}),[m,p]=(0,yi.useState)(Qa(e)?void 0:s.richTextContent),[l,g]=(0,yi.useState)(!1),f=(0,yi.useRef)(Qa(e)?e:null);(0,yi.useEffect)(()=>{Qa(e)?(r(!0),Nl(e).then(u=>{n(u),p(u.richTextContent),r(!1)}).catch(u=>{u instanceof Error&&u.name!=="AbortError"&&(console.error("Failed to convert file:",u),r(!1))})):(n({...e,updatedAt:new Date}),p(e.richTextContent))},[e]);let x=u=>{switch(u){case"markdown":case"mdx":return(0,Bi.jsx)(Wt.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Bi.jsx)(Wt.File,{className:"h-6 w-6 text-success"});case"text":return(0,Bi.jsx)(Wt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Bi.jsx)(Wt.File,{className:"h-6 w-6 text-muted-foreground"})}},b=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"}},R=async()=>{g(!0);try{let u,h;if(f.current&&f.current.mimeType==="text/markdown"){let D=m?yl(m):"";u={...s,format:"markdown",content:D,richTextContent:void 0},h=D}else u={...s,richTextContent:m},h=s.content||"";let F=f.current?f.current.id.toString():s.id;await Promise.resolve(a()),o?.(F,h)}finally{g(!1)}};return(0,Bi.jsxs)(Mo.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Bi.jsx)("div",{className:"border-b border-border bg-card p-8 pb-6",children:(0,Bi.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Bi.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Bi.jsx)("div",{className:"flex-1 min-w-0",children:(0,Bi.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Bi.jsx)("div",{className:"flex-1 min-w-0",children:(0,Bi.jsx)(Ka,{fieldName:"title",value:s.title,label:"",onSave:(u,h)=>n(F=>({...F,title:h})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Bi.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${b(s.format)} flex-shrink-0 yi-1`,children:s.format.toUpperCase()})]})})}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Bi.jsxs)(T,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"}),"Close"]}),(0,Bi.jsxs)(T,{size:"sm",onClick:R,className:"gap-2",disabled:l,children:[l?(0,Bi.jsx)(Wt.Loader2,{className:"h-4 w-4 animate-spin"}):(0,Bi.jsx)(Wt.Save,{className:"h-4 w-4"}),l?"Saving...":"Save"]})]})]})}),(0,Bi.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Bi.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:i?(0,Bi.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,Bi.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,Bi.jsx)(Wt.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,Bi.jsx)(Bi.Fragment,{children:s.format==="richText"?(0,Bi.jsx)(cn,{setValue:p,value:m,name:"richTextContent"},`richtext-${s.id}-${i?"loading":"loaded"}`):(0,Bi.jsx)(Be,{value:s.content||"",onChange:u=>n(h=>({...h,content:u.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var vn=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function Aa({files:e,onFileClick:t,onFileDelete:a,onFileUpdate:o,showHeader:i=!0,className:r,viewMode:s="list"}){let[n,m]=(0,yi.useState)(!1),[p,l]=(0,yi.useState)(!1),[g,f]=(0,yi.useState)(null),x=()=>{m(!1),f(null)},b=()=>{l(!0),setTimeout(()=>{l(!1),m(!1),f(null)},500)},R=u=>{f(u),m(!0)};return(0,Bi.jsxs)("div",{className:w("rounded-3xl border overflow-hidden",r),children:[(0,Bi.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[i&&s==="list"&&(0,Bi.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,Bi.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Bi.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Bi.jsx)("div",{className:"col-span-2",children:"Modified"})]}),s==="card"&&(0,Bi.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),s==="list"&&(0,Bi.jsx)("div",{className:"divide-y",children:e.map(u=>(0,Bi.jsxs)(Mo.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?.(u),children:[(0,Bi.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Bi.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Bi.jsx)("div",{children:(0,Bi.jsx)("p",{className:"font-medium",children:u.name})})]}),(0,Bi.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:vn(u.filesize)}),(0,Bi.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Bi.jsx)("span",{className:"text-sm md:text-base",children:new Date(u.createdAt).toLocaleDateString()}),(0,Bi.jsxs)("div",{className:"flex gap-1",children:[u.mimeType==="text/markdown"&&(0,Bi.jsx)(T,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:h=>{h.stopPropagation(),R(u)},children:(0,Bi.jsx)(Wt.Edit,{className:"h-4 w-4"})}),(0,Bi.jsx)(T,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:h=>{h.stopPropagation(),a?.(u)},children:(0,Bi.jsx)(Wt.Trash2,{className:"h-4 w-4"})})]})]})]},u.name))}),s==="card"&&(0,Bi.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(u=>(0,Bi.jsx)(Mo.motion.div,{whileHover:{scale:1.02},className:"border rounded-lg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(u),children:(0,Bi.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Bi.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Bi.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,Bi.jsx)("div",{className:"min-w-0 flex-1",children:(0,Bi.jsx)("p",{className:"font-medium truncate",children:u.name})})]}),(0,Bi.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("span",{className:"font-medium",children:"Size:"}),(0,Bi.jsx)("span",{children:vn(u.filesize)})]}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,Bi.jsx)("span",{children:new Date(u.createdAt).toLocaleDateString()})]})]})]}),(0,Bi.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[u.mimeType==="text/markdown"&&(0,Bi.jsx)(T,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:h=>{h.stopPropagation(),R(u)},title:"Edit",children:(0,Bi.jsx)(Wt.Edit,{className:"h-4 w-4"})}),(0,Bi.jsx)(T,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:h=>{h.stopPropagation(),a?.(u)},title:"Delete",children:(0,Bi.jsx)(Wt.Trash2,{className:"h-4 w-4"})})]})]})},u.name))}),(0,Bi.jsx)($e,{open:n,onOpenChange:u=>!u&&x(),children:(0,Bi.jsxs)(Uo,{children:[(0,Bi.jsx)(oo,{}),(0,Bi.jsxs)(hn.Content,{className:w("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[(0,Bi.jsx)(Le,{className:"Wt-only",children:g?`Edit ${g.name}`:"Edit File"}),p&&(0,Bi.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,Bi.jsx)(Wt.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),g&&(0,Bi.jsx)(fn,{document:g,onSave:b,onFileUpdate:o,onCancel:x})]})]})})]})}var Ro=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,i]=(0,yi.useState)(null),[r,s]=(0,yi.useState)(""),[n,m]=(0,yi.useState)(""),[p,l]=(0,yi.useState)(""),g=x=>{let b=x.target.files?.[0];b&&(i(b),r||s(b.name))},f=async x=>{if(x.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",r),n&&b.append("description",n),p&&b.append("tags",p),a?.(b),t(),i(null),s(""),m(""),l("")};return(0,Bi.jsx)($e,{open:e,onOpenChange:t,children:(0,Bi.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Add New File"})}),(0,Bi.jsxs)("form",{onSubmit:f,className:"grid gap-4",children:[(0,Bi.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Bi.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,Bi.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,Bi.jsx)(Cl,{className:"w-10 h-10 text-gray-400"}),(0,Bi.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Bi.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,Bi.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,Bi.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:g})]})}),o&&(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("p",{className:"font-medium",children:o.name}),(0,Bi.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,Bi.jsx)(T,{type:"submit",onClick:f,children:"Upload"})]})]})]})})};function Cl(e){return(0,Bi.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Bi.jsx)("path",{Bi:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Bi.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Bi.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}var xn=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:s,onAddComment:n,colleagues:m,onUploadFile:p,onDeleteFile:l,onFileUpdate:g})=>{let[f,x]=(0,yi.useState)(a),[b,R]=(0,yi.useState)(new Date),[u,h]=(0,yi.useState)("idle"),[F,D]=(0,yi.useState)("idle"),[N,q]=(0,yi.useState)(!1),[A,K]=(0,yi.useState)([]),[W,V]=(0,yi.useState)(m);(0,yi.useEffect)(()=>{x(a)},[a]);let ae=async(de,P)=>{if(P!==f[de]){h("loading");try{await r(f.id.toString(),{[de]:P}),R(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(te){console.log("error",te),h("error"),setTimeout(()=>h("idle"),3e3)}}},le=async(de,P)=>{if(P!==f[de]){h("loading");try{await r(f.id.toString(),{[de]:P}),R(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(te){console.log("error",te),h("error"),setTimeout(()=>h("idle"),3e3)}}},I=async de=>{if(n){h("loading");try{await n?.({content:de,taskId:f.id.toString()}),R(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch{h("error"),setTimeout(()=>h("idle"),3e3)}}},he=async()=>{D("loading");try{await s(f.id.toString()),D("success"),setTimeout(()=>{t(),D("idle")},1e3)}catch{D("error"),setTimeout(()=>D("idle"),3e3)}},C=async de=>{if(p){h("loading");try{await p(f.id.toString(),de),R(new Date),h("success"),q(!1),setTimeout(()=>h("idle"),1500)}catch(P){console.error("Error uploading file:",P),h("error"),setTimeout(()=>h("idle"),3e3)}}},S=async de=>{if(l){h("loading");try{await l(f.id.toString(),de.id.toString()),R(new Date),h("success"),setTimeout(()=>h("idle"),1500)}catch(P){console.error("Error deleting file:",P),h("error"),setTimeout(()=>h("idle"),3e3)}}},B=(f.files||[]).map(de=>typeof de=="number"?null:de).filter(de=>de!==null),Q=u!=="loading"&&F!=="loading",be=()=>{Q&&t()},we=()=>u==="loading"?(0,Bi.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Bi.jsx)(Wt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Bi.jsx)("span",{children:"Updating..."})]}):u==="success"?(0,Bi.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Bi.jsx)(Wt.Check,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:"Updated successfully"})]}):u==="error"?(0,Bi.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:"Update failed"})]}):null;return(0,Bi.jsxs)($e,{open:e,onOpenChange:be,children:[(0,Bi.jsxs)(Ke,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Bi.jsxs)(qe,{children:[(0,Bi.jsx)(Le,{className:"Wt-only",children:f?.name}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("div",{className:"flex-1",children:we()}),!Q&&(0,Bi.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Bi.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Bi.jsx)(Ka,{fieldName:"name",value:f.name||"",label:"",onSave:ae,className:"border-b border-border pb-3",disabled:u==="loading"}),(0,Bi.jsx)(Ka,{fieldName:"description",value:f.description||"",label:"Description",multiline:!0,onSave:ae,disabled:u==="loading"}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)(Wt.File,{className:"h-4 w-4 text-muted-foreground"}),(0,Bi.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),p&&(0,Bi.jsxs)(T,{variant:"outline",size:"sm",onClick:()=>q(!0),disabled:u==="loading",className:"gap-2",children:[(0,Bi.jsx)(Wt.Upload,{className:"h-4 w-4"}),"Upload"]})]}),B.length>0?(0,Bi.jsx)(Aa,{files:B,onFileDelete:l?S:void 0,onFileUpdate:g,showHeader:!1,className:"border rounded-lg",viewMode:"card"}):(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-lg",children:"No files attached"})]}),(0,Bi.jsx)(Dr,{comments:(f?.comments||[]).map(de=>({author:de.author?.value.name||"",createdAt:new Date(de.timestamp),text:de.text,id:de.id||""})),onAddComment:I})]}),(0,Bi.jsx)(kr,{task:f,epics:o,sprints:i,lastUpdated:b,onUpdateTask:le,onClose:be,onDelete:he,isUpdating:u==="loading",isDeleting:F==="loading",deleteState:F,teamMembers:W})]})]}),p&&(0,Bi.jsx)(Ro,{isOpen:N,onClose:()=>q(!1),onAddFile:C})]})};var Ea=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,yi.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"],s=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],m=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:o.startDate,endDate:o.endDate}),i({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},p=(l,g)=>{i(f=>({...f,[l]:g}))};return(0,Bi.jsx)($e,{open:e,onOpenChange:t,children:(0,Bi.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Add New Epic"})}),(0,Bi.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"name",children:"Epic Name"}),(0,Bi.jsx)(ce,{id:"name",value:o.name,onChange:l=>p("name",l.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"description",children:"Description"}),(0,Bi.jsx)(Be,{id:"description",value:o.description,onChange:l=>p("description",l.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Color"}),(0,Bi.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(l=>(0,Bi.jsx)("button",{type:"button",onClick:()=>p("color",l),className:`w-8 h-8 rounded-full ${l} ${o.color===l?"ring-2 ring-gray-400":""}`},l))})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Confidence"}),(0,Bi.jsxs)(it,{value:o.confidence,onValueChange:l=>p("confidence",l),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{})}),(0,Bi.jsx)(et,{children:s.map(l=>(0,Bi.jsx)(Pe,{value:l.value,children:l.label},l.value))})]})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Phase"}),(0,Bi.jsxs)(it,{value:o.phase.toString(),onValueChange:l=>p("phase",parseInt(l)),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{})}),(0,Bi.jsx)(et,{children:n.map(l=>(0,Bi.jsx)(Pe,{value:l.value.toString(),children:l.label},l.value))})]})]})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Start Date"}),(0,Bi.jsx)(ce,{type:"date",value:o.startDate,onChange:l=>p("startDate",l.target.value)})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"End Date"}),(0,Bi.jsx)(ce,{type:"date",value:o.endDate,onChange:l=>p("endDate",l.target.value)})]})]}),(0,Bi.jsxs)(Va,{children:[(0,Bi.jsx)(T,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Bi.jsx)(T,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Ao=require("react-icons/fa");function At({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:s,className:n}){let[m,p]=po(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),l=!i&&!t||m;return(0,Bi.jsxs)(Mo.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 ${n||""}`,children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Bi.jsx)(xe,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Bi.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[l&&o&&(0,Bi.jsx)(T,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,Bi.jsx)("button",{"aria-label":m?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>p(!m),style:{lineHeight:0},children:m?(0,Bi.jsx)(Ao.FaChevronDown,{size:22}):(0,Bi.jsx)(Ao.FaChevronUp,{size:22})})]})]}),!l&&(0,Bi.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Bi.jsxs)("div",{className:"space-y-4",children:[(0,Bi.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Bi.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Bi.jsx)(T,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,Bi.jsx)(T,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),s&&(0,Bi.jsx)("div",{className:"hidden lg:block",children:s})]})]})}var Nn=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:s,onUpdateTask:n,onDeleteTask:m,onTaskClick:p,onAddEpic:l,onAddComment:g,onUploadFile:f,onDeleteFile:x,onFileUpdate:b})=>{let[R,u]=(0,Ce.useState)([]),[h,F]=(0,Ce.useState)([]),[D,N]=(0,Ce.useState)([]),[q,A]=(0,Ce.useState)(!1),[K,W]=(0,Ce.useState)(!1),[V,ae]=(0,Ce.useState)(null),[le,I]=(0,Ce.useState)(null),[he,C]=(0,Ce.useState)([]),[S,B]=(0,Ce.useState)([]),[Q,be]=(0,Ce.useState)(0),we=(0,Ce.useRef)(null),de=(0,Ce.useRef)(null),P=Ce.default.useMemo(()=>[...h.map(y=>y.id),0],[h]),te=(0,Ce.useRef)(""),re=(0,Ce.useRef)(""),lt=(0,Ce.useRef)(""),Ne=(0,Ce.useRef)(""),Xe=(y,M)=>y.map($=>`${$.id}-${new Date($.createdAt).getTime()}-${new Date($.updatedAt).getTime()}`).join("-")+(M?`-${M}`:"");(0,Ce.useEffect)(()=>{let y=e.map($=>$.files?.filter(ie=>typeof ie=="object").map(ie=>new Date(ie.updatedAt).getTime())).flat(),M=Xe(e,y.join("-"));M!==te.current&&(u(e),V&&ae(e.find($=>$.id===V.id)||null),te.current=M)},[e]),(0,Ce.useEffect)(()=>{let y=Xe(t);y!==re.current&&(F(t),re.current=y)},[t]),(0,Ce.useEffect)(()=>{let y=Xe(a);y!==lt.current&&(N(a),lt.current=y)},[a]),(0,Ce.useEffect)(()=>{let y=Xe(i.map(M=>({id:M.id,updatedAt:M.updatedAt,createdAt:M.createdAt})));y!==Ne.current&&(B(i),Ne.current=y)},[i]),(0,Ce.useEffect)(()=>{let y=()=>{if(we.current){let ie=we.current.offsetHeight;be(ie)}};y();let M=new ResizeObserver(y);we.current&&M.observe(we.current);let $=()=>{setTimeout(y,100)};return window.addEventListener("storage",$),()=>{M.disconnect(),window.removeEventListener("storage",$)}},[]),(0,Ce.useEffect)(()=>{let y=setTimeout(()=>{we.current&&be(we.current.offsetHeight)},300);return()=>clearTimeout(y)},[q,K]);let Ia=R.filter(y=>!0),Mt=y=>Ia.filter(M=>M.status===y),Fa=y=>{let M={};return h.forEach($=>{M[$.id]=y.filter(ie=>Fe(ie.epic)===$.id)}),M["no-epic"]=y.filter($=>!Fe($.epic)),M},It=y=>{I(y)},oa=y=>{le&&(u(M=>M.map($=>$.id===le.id?{...$,status:y}:$)),n?.(le.id.toString(),{status:y}),I(null))},va=y=>{let M={...y,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};u($=>[...$,M]),s?.(y)},ia=async(y,M)=>{u($=>$.map(ie=>ie.id===Number(y)?{...ie,...M}:ie)),n&&await n(y,M),V?.id===Number(y)&&ae($=>({...$,...M}))},ha=async y=>{u(M=>M.filter($=>$.id!==Number(y))),V?.id===Number(y)&&ae(null),m&&await m(y)},ba=y=>{let M={...y,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};F($=>[...$,M]),l?.(y)},xt=y=>{ae(y),p?.(y)},v=[{id:"todo",title:"To So",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],E=Q>0?`calc(100vh - ${Q+120}px)`:"calc(100vh - 12rem)";return(0,Bi.jsxs)("div",{ref:de,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Bi.jsx)("div",{ref:we,className:"flex-shrink-0",children:(0,Bi.jsx)(At,{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:()=>A(!0)},secondaryAction:{label:"Add epic",onClick:()=>W(!0)}})}),(0,Bi.jsx)("div",{className:"flex-1 min-h-0 yi-8",children:(0,Bi.jsx)("div",{className:"h-full",style:{height:Q>0?`calc(100vh - ${Q+120}px)`:"calc(100vh - 12rem)"},children:(0,Bi.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:v.map(y=>{let M=Mt(y.status),$=Fa(M);return(0,Bi.jsxs)(cr,{title:y.title,status:y.status,taskCount:M.length,onDrop:oa,isCompact:y.status==="done",height:E,children:[$["no-epic"].map(ie=>(0,Bi.jsx)(Ga,{epic:null,task:ie,onDragStart:It,onTaskClick:xt,isCompact:y.status==="done"},ie.id)),P.map(ie=>{let Ve=h.find(Ct=>Ct.id===ie),Ft=$[ie]||[];return Ft.length===0?null:(0,Bi.jsxs)("div",{className:"mb-6",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Bi.jsx)("div",{className:`w-3 h-3 rounded-full ${Ve?.color}`}),(0,Bi.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Ve?.name||"No Epic"}),(0,Bi.jsx)(xe,{variant:"secondary",className:"text-xs",children:Ft.length})]})," ",(0,Bi.jsx)("div",{className:"space-y-3",children:Ft.map(Ct=>(0,Bi.jsx)(Ga,{task:Ct,epic:Ve,onDragStart:It,onTaskClick:xt,isCompact:y.status==="done"},Ct.id))})]},ie)})]},y.id)})})})}),(0,Bi.jsx)(ka,{isOpen:q,onClose:()=>A(!1),onAddTask:va,assignees:[...S,...he],epics:h,sprints:D}),(0,Bi.jsx)(Ea,{isOpen:K,onClose:()=>W(!1),onAddEpic:ba}),V&&(0,Bi.jsx)(xn,{isOpen:!!V,onClose:()=>ae(null),initialTask:V,epics:h,sprints:D,onUpdateTask:ia,onDeleteTask:ha,colleagues:S,onUploadFile:f,onDeleteFile:x,onFileUpdate:b,onAddComment:g})]})};var Cn=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:s,onUpdateEpic:n,onDeleteEpic:m})=>{let[p,l]=(0,yi.useState)(t),[g,f]=(0,yi.useState)(null),[x,b]=(0,yi.useState)(null),[R,u]=(0,yi.useState)({}),[h,F]=(0,yi.useState)(0),[D,N]=(0,yi.useState)(!1),[q,A]=(0,yi.useState)(!1),[K,W]=(0,yi.useState)(null),V=(0,yi.useRef)(null),ae=(0,yi.useRef)(null);(0,yi.useEffect)(()=>{l(t)},[t]),(0,yi.useEffect)(()=>{let P=()=>{if(V.current){let lt=V.current.offsetHeight;F(lt)}};P();let te=new ResizeObserver(P);V.current&&te.observe(V.current);let re=()=>{setTimeout(P,100)};return window.addEventListener("storage",re),()=>{te.disconnect(),window.removeEventListener("storage",re)}},[]),(0,yi.useEffect)(()=>{let P=setTimeout(()=>{V.current&&F(V.current.offsetHeight)},300);return()=>clearTimeout(P)},[x]);let le=P=>{f(P)},I=P=>{P.preventDefault()},he=(P,te)=>{P.preventDefault(),g&&Fe(g.epic).toString()!==te&&(o(g.id.toString(),{epic:Number(te)}),f(null))},C=P=>e.filter(te=>Fe(te.epic).toString()===P),S=P=>{b(P.id.toString()),u({name:P.name,description:P.description,confidence:P.confidence,phase:P.phase})},B=async()=>{x&&R.name&&(await n(x.toString(),R),l(P=>P.map(te=>te.id.toString()===x?{...te,...R}:te)),b(null),u({}))},Q=()=>{b(null),u({})},be=async P=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await m(P),l(te=>te.filter(re=>re.id.toString()!==P)))},we=P=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[P]||`Phase ${P}`,de=P=>{switch(P){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,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsxs)("div",{ref:ae,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Bi.jsx)("div",{ref:V,className:"flex-shrink-0",children:(0,Bi.jsx)(At,{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:()=>N(!0)}})}),(0,Bi.jsx)("div",{className:"flex-1 min-h-0 yi-8",children:(0,Bi.jsx)("div",{className:"h-full overflow-y-auto",style:{height:h>0?`calc(100vh - ${h+120}px)`:"calc(100vh - 12rem)"},children:(0,Bi.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:p.map(P=>{let te=C(P.id.toString()),re=te.reduce((Ne,Xe)=>Ne+(Xe.storyPoints||0),0),lt=h>0?`calc(100vh - ${h+200}px)`:"calc(100vh - 14rem)";return(0,Bi.jsxs)(ke,{className:`flex flex-col ${x===P.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:x===P.id.toString()?"auto":lt,minHeight:"400px"},onDragOver:I,onDrop:Ne=>he(Ne,P.id.toString()),children:[(0,Bi.jsx)("div",{className:"p-4 border-b border-border",children:x===P.id.toString()?(0,Bi.jsxs)("div",{className:"space-y-4",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)(ce,{value:R.name||"",onChange:Ne=>u({...R,name:Ne.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Bi.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Bi.jsx)(T,{size:"sm",variant:"ghost",onClick:B,className:"p-1 h-8 w-8",children:(0,Bi.jsx)(Wt.Check,{className:"h-4 w-4"})}),(0,Bi.jsx)(T,{size:"sm",variant:"ghost",onClick:Q,className:"p-1 h-8 w-8",children:(0,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"})})]})]}),(0,Bi.jsx)(Be,{value:R.description||"",onChange:Ne=>u({...R,description:Ne.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Bi.jsxs)("select",{value:R.confidence||P.confidence,onChange:Ne=>u({...R,confidence:Ne.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,Bi.jsx)("option",{value:"low",children:"Low"}),(0,Bi.jsx)("option",{value:"medium",children:"Medium"}),(0,Bi.jsx)("option",{value:"high",children:"High"})]})]}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Bi.jsx)("select",{value:R.phase?.toString()||P.phase.toString(),onChange:Ne=>u({...R,phase:parseInt(Ne.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(Ne=>(0,Bi.jsxs)("option",{value:Ne.toString(),children:["Phase ",Ne]},Ne))})]})]})]}):(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Bi.jsx)("div",{className:`w-4 h-4 rounded-full ${P.color}`}),(0,Bi.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:P.name}),(0,Bi.jsxs)("div",{className:"flex gap-1",children:[(0,Bi.jsx)(T,{size:"sm",variant:"ghost",onClick:()=>S(P),className:"p-1 h-8 w-8",children:(0,Bi.jsx)(Wt.Edit2,{className:"h-3 w-3"})}),(0,Bi.jsx)(T,{size:"sm",variant:"ghost",onClick:()=>be(P.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Bi.jsx)(Wt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Bi.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Bi.jsxs)(xe,{className:`text-xs ${de(P.confidence)}`,children:[P.confidence," confidence"]}),(0,Bi.jsxs)(xe,{variant:"outline",className:"text-xs",children:["Phase ",P.phase]}),(0,Bi.jsxs)(xe,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[te.length," tasks"]}),(0,Bi.jsxs)(xe,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[re," pts"]})]}),P.description&&(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:P.description}),(0,Bi.jsxs)(T,{onClick:()=>{A(!0),W(P)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Bi.jsx)(Wt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Bi.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Bi.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${g?"border-primary bg-primary/10":"border-border"}`,children:te.length===0?(0,Bi.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,Bi.jsx)(Wt.Move,{className:"h-8 w-8 mb-2"}),(0,Bi.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):te.map(Ne=>(0,Bi.jsx)(Ga,{task:Ne,epic:P,onDragStart:le,onTaskClick:i,isCompact:!0},Ne.id))})})]},P.id)})})})})]}),(0,Bi.jsx)(Ea,{isOpen:D,onClose:()=>N(!1),onAddEpic:s}),(0,Bi.jsx)(ka,{isOpen:q,onClose:()=>A(!1),onAddTask:r,assignees:[],epics:[],defaultEpicId:K?.id.toString()||"",sprints:a})]})};var fi=require("date-fns");var Sn=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,yi.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),r=n=>{n.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),i({name:"",description:"",startDate:void 0,endDate:void 0}),t())},s=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Bi.jsx)($e,{open:e,onOpenChange:s,children:(0,Bi.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Add New Sprint"})}),(0,Bi.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"name",children:"Sprint Name *"}),(0,Bi.jsx)(ce,{id:"name",value:o.name,onChange:n=>i(m=>({...m,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"description",children:"Description"}),(0,Bi.jsx)(Be,{id:"description",value:o.description,onChange:n=>i(m=>({...m,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Start Date *"}),(0,Bi.jsxs)(mi,{children:[(0,Bi.jsx)(pi,{asChild:!0,children:(0,Bi.jsxs)(T,{variant:"outline",className:w("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Bi.jsx)(Wt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,fi.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Bi.jsx)(To,{className:"w-auto p-0",align:"start",children:(0,Bi.jsx)(ko,{mode:"single",selected:o.startDate,onSelect:n=>i(m=>({...m,startDate:n})),initialFocus:!0})})]})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"End Date *"}),(0,Bi.jsxs)(mi,{children:[(0,Bi.jsx)(pi,{asChild:!0,children:(0,Bi.jsxs)(T,{variant:"outline",className:w("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Bi.jsx)(Wt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,fi.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Bi.jsx)(To,{className:"w-auto p-0",align:"start",children:(0,Bi.jsx)(ko,{mode:"single",selected:o.endDate,onSelect:n=>i(m=>({...m,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,Bi.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Bi.jsx)(T,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),(0,Bi.jsx)(T,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Tn=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r,onUpdateSprint:s,onDeleteSprint:n})=>{let[m,p]=(0,yi.useState)([]),[l,g]=(0,yi.useState)(new Set),[f,x]=(0,yi.useState)(null),[b,R]=(0,yi.useState)(!1),[u,h]=(0,yi.useState)(null),[F,D]=(0,yi.useState)(null),[N,q]=(0,yi.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[A,K]=(0,yi.useState)([]),[W,V]=(0,yi.useState)("upcoming"),[ae,le]=(0,yi.useState)(!1),[I,he]=(0,yi.useState)(0),C=(0,yi.useRef)(null),S=(0,yi.useRef)(null);(0,yi.useEffect)(()=>{let v=()=>{C.current&&he(C.current.offsetHeight)};v();let E=new ResizeObserver(v);return C.current&&E.observe(C.current),()=>E.disconnect()},[]);let B=v=>t.find(E=>E.id===Number(v)),Q=v=>a.find(E=>E.id===Number(v)),be=v=>{let E={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 E[v]||E.medium},we=v=>{if(!v||v?.length===0)return"";let E=v?.trim().split(" ");if(E?.length===1)return E[0];let y=E[0],M=E[E.length-1][0].toUpperCase();return`${y} ${M}`},de=v=>{let E={},y=[];return v.forEach(M=>{M.epic?(E[Fe(M.epic)]||(E[Fe(M.epic)]=[]),E[Fe(M.epic)].push(M)):y.push(M)}),{tasksByEpic:E,unassignedTasks:y}};(0,yi.useEffect)(()=>{K(a)},[a]);let P=A.filter(v=>{switch(W){default:return!0}}),te=A.filter(v=>m.includes(v.id.toString())),re=e.filter(v=>!v.sprint||v.status==="backlog"),lt=re.reduce((v,E)=>v+(E.storyPoints||0),0),Ne=v=>{p(E=>E.includes(v)?E.filter(y=>y!==v):E?.length<3?[...E,v]:E)},Xe=v=>{g(E=>{let y=new Set(E);return y.has(v)?y.delete(v):y.add(v),y})},Ia=v=>{r(v),R(!1)},Mt=v=>{D(v.id.toString()),q({name:v.name,description:v.description||"",startDate:v.startDate?new Date(v.startDate).toISOString().split("T")[0]:v.startDate,endDate:v.endDate?new Date(v.endDate).toISOString().split("T")[0]:v.endDate,isActive:!1})},Fa=()=>{F&&(s(F,{name:N.name,description:N.description,startDate:N.startDate,endDate:N.endDate}),K(v=>v.map(E=>(E.id===Number(F)&&(E.name=N.name,E.description=N.description,E.startDate=N.startDate,E.endDate=N.endDate),E))),D(null))},It=()=>{D(null),q({name:"",description:"",startDate:"",endDate:"",isActive:!1})},oa=(v,E)=>{x(E),v.dataTransfer.effectAllowed="move"},va=v=>{v.preventDefault(),v.dataTransfer.dropEffect="move"},ia=v=>{h(v)},ha=()=>{h(null)},ba=(v,E)=>{if(v.preventDefault(),h(null),!f)return;(Fe(f.sprint)||void 0)!==Number(E)&&o(f.id.toString(),{sprint:Number(E)}),x(null)},xt=({task:v,showSprint:E=!1})=>{let y=v.epic?B(Fe(v.epic).toString()):null,M=v.sprint?Q(Fe(v.sprint).toString()):null;return(0,Bi.jsx)(ke,{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:Ve=>{Ve.dataTransfer.effectAllowed="move",Ve.dataTransfer.setData("text/plain",v.id.toString()),oa(Ve,v)},onClick:Ve=>{f===null&&i(v)},style:{userSelect:"none"},children:(0,Bi.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Bi.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Bi.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:v.name}),(0,Bi.jsx)(xe,{className:`text-xs ${be(v.priority||"medium")}`,children:v.priority?.[0]?.toUpperCase()})]}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-1",children:[y&&(0,Bi.jsx)("div",{className:`w-2 h-2 rounded-full ${y.color}`}),(0,Bi.jsx)("span",{className:"text-muted-foreground truncate",children:y?.name})]}),(0,Bi.jsx)("span",{className:"text-muted-foreground",children:we(v.assignee?.value?.name)})]}),E&&M&&(0,Bi.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-3 w-3"}),(0,Bi.jsx)("span",{children:M.name})]})]})})};return(0,Bi.jsxs)("div",{ref:S,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Bi.jsx)("div",{ref:C,className:"flex-shrink-0",children:(0,Bi.jsx)(At,{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:()=>R(!0)}})}),(0,Bi.jsx)("div",{className:"flex-1 min-h-0 yi-8",children:(0,Bi.jsxs)("div",{className:"h-full",style:{height:I>0?`calc(100vh - ${I+120}px)`:"calc(100vh - 12rem)"},children:[(0,Bi.jsxs)("div",{className:"mb-4",children:[(0,Bi.jsx)(ke,{className:"p-3 bg-card shadow-sm",children:(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Bi.jsxs)("p",{className:"text-xs text-muted-foreground",children:[m?.length,"/3 selected"]})]}),m?.length>0&&(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,Bi.jsx)("div",{className:"flex flex-wrap gap-1",children:te.map(v=>(0,Bi.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Bi.jsx)("span",{className:"max-w-[80px] truncate",children:v.name}),(0,Bi.jsx)("button",{onClick:()=>Ne(v.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"})})]},v.id))})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsxs)(T,{onClick:()=>R(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Bi.jsx)(Wt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Bi.jsxs)(T,{onClick:()=>le(!ae),variant:"outline",size:"sm",className:"gap-1",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-3 w-3"}),ae?"Close":"Select"]})]})]})}),ae&&(0,Bi.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>le(!1)}),(0,Bi.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl z-10 transition-all duration-300 ease-in-out ${ae?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Bi.jsxs)(ke,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Bi.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Bi.jsx)(T,{variant:"ghost",size:"sm",onClick:()=>le(!1),className:"h-8 w-8 p-0",children:(0,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"})})]}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground yi-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Bi.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Bi.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(v=>(0,Bi.jsxs)(T,{variant:W===v.key?"default":"outline",size:"sm",onClick:()=>V(v.key),className:"text-xs h-8 px-3 flex-1",children:[v.label," (",v.count,")"]},v.key))}),(0,Bi.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:P.length>0?P.map(v=>{let E=m.includes(v.id.toString()),y=e.filter($=>Fe($.sprint)===v.id).length,M=!E&&m.length<3;return(0,Bi.jsx)("div",{className:`p-3 rounded-lg border transition-all ${E?"bg-primary/10 border-primary/30":M?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:F===v.id.toString()?(0,Bi.jsxs)("div",{className:"space-y-3",children:[(0,Bi.jsx)(ce,{value:N.name,onChange:$=>q(ie=>({...ie,name:$.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Bi.jsx)(Be,{value:N.description,onChange:$=>q(ie=>({...ie,description:$.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Bi.jsxs)("div",{className:"flex gap-2",children:[(0,Bi.jsxs)(T,{size:"sm",onClick:()=>Fa(),className:"flex-1",children:[(0,Bi.jsx)(Wt.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,Bi.jsxs)(T,{size:"sm",variant:"outline",onClick:It,className:"flex-1",children:[(0,Bi.jsx)(Wt.Bi,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,Bi.jsxs)("div",{children:[(0,Bi.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Bi.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Bi.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:v.name}),(0,Bi.jsx)(xe,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Bi.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:v.description}),(0,Bi.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Bi.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Bi.jsx)(Wt.CalendarDays,{className:"h-3 w-3"}),new Date(v.startDate).toLocaleDateString()]}),(0,Bi.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Bi.jsx)(Wt.User,{className:"h-3 w-3"}),y," tasks"]})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Bi.jsx)(T,{size:"sm",variant:"ghost",onClick:()=>Mt(v),className:"h-6 w-6 p-0",children:(0,Bi.jsx)(Wt.Edit2,{className:"h-3 w-3"})}),(0,Bi.jsx)(T,{size:"sm",variant:"ghost",onClick:()=>n(v.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Bi.jsx)(Wt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Bi.jsx)("div",{className:"flex items-center justify-between yi-2",children:(0,Bi.jsx)(T,{variant:E?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>Ne(v.id.toString()),disabled:!E&&m?.length>=3,children:(0,Bi.jsx)("span",{className:"pointer-events-none select-none",children:E?"Deselect":m?.length>=3?"Limit Reached":"Select"})})})]})},v.id)}):(0,Bi.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Bi.jsxs)("p",{className:"text-sm",children:['No sprints found for "',W,'" filter']}),(0,Bi.jsx)(T,{variant:"link",size:"sm",onClick:()=>V("all"),className:"text-xs",children:"Show all sprints"})]})}),m?.length===0&&(0,Bi.jsx)("div",{className:"yi-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Bi.jsxs)("div",{className:"text-center",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Bi.jsx)("p",{className:"text-xs text-muted-foreground yi-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Bi.jsx)("div",{className:"lg:col-span-1",children:(0,Bi.jsxs)(ke,{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:va,onDragEnter:()=>ia("backlog"),onDragLeave:ha,onDrop:v=>ba(v,"backlog"),style:{height:I>0?`calc(100vh - ${I+200}px)`:"calc(100vh - 16rem)"},children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Bi.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsxs)(xe,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[re?.length," tasks"]}),(0,Bi.jsxs)(xe,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[lt," pts"]})]})]}),(0,Bi.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${u==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:v,unassignedTasks:E}=de(re);return(0,Bi.jsxs)(Bi.Fragment,{children:[Object.entries(v).map(([y,M])=>{let $=B(y);if(!$)return null;let ie=l.has(y);return(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Xe(y),children:[(0,Bi.jsx)("div",{className:`w-3 h-3 rounded-full ${$.color}`}),(0,Bi.jsx)("span",{className:"font-medium text-muted-foreground",children:$.name}),(0,Bi.jsxs)("span",{className:"text-muted-foreground",children:["(",M?.length,")"]}),(0,Bi.jsx)("div",{className:"ml-auto",children:ie?(0,Bi.jsx)(Wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Bi.jsx)(Wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ie&&(0,Bi.jsx)("div",{className:"space-y-2 pl-2",children:M.map(Ve=>(0,Bi.jsx)(xt,{task:Ve},Ve.id))})]},y)}),E?.length>0&&(()=>{let y=l.has("no-epic");return(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Xe("no-epic"),children:[(0,Bi.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Bi.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Bi.jsxs)("span",{className:"text-muted-foreground",children:["(",E?.length,")"]}),(0,Bi.jsx)("div",{className:"ml-auto",children:y?(0,Bi.jsx)(Wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Bi.jsx)(Wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!y&&(0,Bi.jsx)("div",{className:"space-y-2 pl-2",children:E?.map(M=>(0,Bi.jsx)(xt,{task:M},M.id))})]})})(),re?.length===0&&(0,Bi.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"}),re?.length>0&&Object.keys(v).length===0&&E.length===0&&(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),re?.map(y=>(0,Bi.jsx)(xt,{task:y},y.id))]})]})})()})]})}),te.map(v=>{let E=e.filter(M=>Fe(M?.sprint)===v.id),y=E.reduce((M,$)=>M+($?.storyPoints||0),0);return(0,Bi.jsxs)(ke,{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:va,onDragEnter:()=>ia(v.id.toString()),onDragLeave:ha,onDrop:M=>ba(M,v.id.toString()),style:{height:I>0?`calc(100vh - ${I+200}px)`:"calc(100vh - 16rem)"},children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Bi.jsx)("div",{children:(0,Bi.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:v.name})}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsxs)(xe,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[E?.length," tasks"]}),(0,Bi.jsxs)(xe,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[y," pts"]}),(0,Bi.jsx)(T,{size:"sm",variant:"ghost",onClick:()=>{le(!0),Mt(v)},className:"h-6 px-2",children:(0,Bi.jsx)(Wt.Edit2,{className:"h-3 w-3"})}),(0,Bi.jsx)(T,{size:"sm",variant:"ghost",onClick:()=>n(v.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Bi.jsx)(Wt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Bi.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:M,unassignedTasks:$}=de(E);return(0,Bi.jsxs)(Bi.Fragment,{children:[Object.entries(M).map(([ie,Ve])=>{let Ft=B(ie);if(!Ft)return null;let Ct=l.has(ie);return(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Xe(ie),children:[(0,Bi.jsx)("div",{className:`w-3 h-3 rounded-full ${Ft.color}`}),(0,Bi.jsx)("span",{className:"font-medium text-muted-foreground",children:Ft.name}),(0,Bi.jsxs)("span",{className:"text-muted-foreground",children:["(",Ve?.length,")"]}),(0,Bi.jsx)("div",{className:"ml-auto",children:Ct?(0,Bi.jsx)(Wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Bi.jsx)(Wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Ct&&(0,Bi.jsx)("div",{className:"space-y-2 pl-2",children:Ve?.map(La=>(0,Bi.jsx)(xt,{task:La},La.id))})]},ie)}),$?.length>0&&(()=>{let ie=l.has("no-epic");return(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Xe("no-epic"),children:[(0,Bi.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Bi.jsx)("span",{className:"font-medium text-muted-foreground",children:"No Epic"}),(0,Bi.jsxs)("span",{className:"text-muted-foreground",children:["(",$?.length,")"]}),(0,Bi.jsx)("div",{className:"ml-auto",children:ie?(0,Bi.jsx)(Wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Bi.jsx)(Wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ie&&(0,Bi.jsx)("div",{className:"space-y-2 pl-2",children:$?.map(Ve=>(0,Bi.jsx)(xt,{task:Ve},Ve.id))})]})})(),E?.length===0&&(0,Bi.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},v.id)})]}),(0,Bi.jsx)(Sn,{isOpen:b,onClose:()=>R(!1),onAddSprint:Ia})]})})]})};var Dl=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Sl=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})},vi=(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},hi=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Tl=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},kl=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,yi.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[s,n]=(0,yi.useState)(!1),m=l=>{if(l.preventDefault(),!e.find(x=>x?.id.toString()===i.colleagueId.toString())){console.error("No valid colleague selected"),n(!0);return}n(!1);let f={title:i.title,description:i.description,dueDate:new Date(i.dueDate).toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring,assignedColleague:Number(i.colleagueId),project:1,updatedAt:new Date().toISOString()};t(f),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,yi.useEffect)(()=>{i.colleagueId&&n(!1)},[i.colleagueId]);let p=e.filter(Boolean);return(0,Bi.jsx)($e,{open:a,onOpenChange:o,children:(0,Bi.jsxs)(Ke,{className:"max-w-2xl",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Add New Reminder"})}),(0,Bi.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Bi.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"title",children:"Title"}),(0,Bi.jsx)(ce,{id:"title",value:i.title,onChange:l=>r({...i,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"description",children:"Description"}),(0,Bi.jsx)(Be,{id:"description",value:i.description,onChange:l=>r({...i,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"dueDate",children:"Due Date"}),(0,Bi.jsx)(ce,{id:"dueDate",type:"date",value:i.dueDate,onChange:l=>r({...i,dueDate:l.target.value}),required:!0})]}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Bi.jsx)(ce,{id:"dueTime",type:"time",value:i.dueTime,onChange:l=>r({...i,dueTime:l.target.value})})]})]}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{className:`${s?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Bi.jsxs)(it,{value:i.colleagueId,onValueChange:l=>{r({...i,colleagueId:l})},required:!0,children:[(0,Bi.jsx)(Qe,{className:`${s?"text-destructive border-red-500":""}`,children:(0,Bi.jsx)(wt,{className:`${s?"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,Bi.jsx)(et,{children:p.map(l=>(0,Bi.jsx)(Pe,{value:l.id.toString(),children:l.name},l.id))})]}),s&&(0,Bi.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Bi.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:l=>r({...i,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,Bi.jsx)(z,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Bi.jsxs)(it,{value:i.recurrencePattern,onValueChange:l=>r({...i,recurrencePattern:l}),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{})}),(0,Bi.jsxs)(et,{children:[(0,Bi.jsx)(Pe,{value:"daily",children:"Daily"}),(0,Bi.jsx)(Pe,{value:"weekly",children:"Weekly"}),(0,Bi.jsx)(Pe,{value:"monthly",children:"Monthly"}),(0,Bi.jsx)(Pe,{value:"yearly",children:"Yearly"})]})]})]}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Bi.jsx)(ce,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:l=>r({...i,recurrenceInterval:parseInt(l.target.value)})})]})]})]}),(0,Bi.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Bi.jsx)(T,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,Bi.jsx)(T,{type:"submit",children:"Add Reminder"})]})]})]})})},Pl=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,s]=(0,yi.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=p=>{p.preventDefault(),a(e.id.toString(),{title:r.title,description:r.description,dueDate:new Date(r.dueDate||"").toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring}),i()},m=t.filter(Boolean);return(0,Bi.jsx)($e,{open:o,onOpenChange:i,children:(0,Bi.jsxs)(Ke,{className:"max-w-2xl",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Edit Reminder"})}),(0,Bi.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,Bi.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"edit-title",children:"Title"}),(0,Bi.jsx)(ce,{id:"edit-title",value:r.title,onChange:p=>s({...r,title:p.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"edit-description",children:"Description"}),(0,Bi.jsx)(Be,{id:"edit-description",value:r.description||"",onChange:p=>s({...r,description:p.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Bi.jsx)(ce,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:p=>s({...r,dueDate:p.target.value}),required:!0})]}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Bi.jsx)(ce,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:p=>s({...r,dueTime:p.target.value})})]})]}),(0,Bi.jsx)("div",{className:"space-y-2",children:(0,Bi.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Bi.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring||!1,onChange:p=>s({...r,isRecurring:p.target.checked}),className:"rounded border-border"}),(0,Bi.jsx)(z,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Bi.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Bi.jsx)(T,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,Bi.jsx)(T,{type:"submit",children:"Save Changes"})]})]})]})})},Rl=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,yi.useState)(!1);if(!e||!e.id)return null;let s=vi(new Date(e.dueDate||""),e.dueTime||""),n=hi(new Date(e.dueDate||"")),m=Tl(new Date(e.dueDate||"")),p=()=>{a(e.id.toString(),{})},l=()=>n?"Today":m?"Tomorrow":Dl(new Date(e.dueDate||""));return(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsx)(Pl,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,Bi.jsx)(ke,{children:(0,Bi.jsx)(Sa,{className:"p-4",children:(0,Bi.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Bi.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Bi.jsx)("button",{onClick:p,className:"yi-1 text-primary hover:text-primary/80"}),(0,Bi.jsxs)("div",{className:"flex-1",children:[(0,Bi.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Bi.jsx)("h3",{children:e.title})}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Bi.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Bi.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{className:s?"text-destructive font-medium":"",children:l()})]}),e.dueTime&&(0,Bi.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Bi.jsx)(Wt.Clock,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:Sl(e.dueTime)})]}),(0,Bi.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Bi.jsx)(Wt.User,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Bi.jsx)(T,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,Bi.jsx)(Wt.Edit2,{className:"h-4 w-4"})}),(0,Bi.jsx)(T,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Bi.jsx)(Wt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},kn=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,s]=(0,yi.useState)(e.filter(Boolean)),[n,m]=(0,yi.useState)(t.filter(Boolean)),[p,l]=(0,yi.useState)("all"),[g,f]=(0,yi.useState)(""),[x,b]=(0,yi.useState)(!1);(0,yi.useEffect)(()=>{s(e.filter(Boolean))},[e]),(0,yi.useEffect)(()=>{m(t.filter(Boolean))},[t]);let R=A=>{if(!A.title){console.error("Invalid reminder data:",A);return}let K={...A,id:Date.now(),createdAt:new Date().toISOString()};s(W=>[...W,K]),a?.(A)},u=(A,K)=>{if(!A){console.error("No reminder ID provided for update");return}s(W=>W.map(V=>V?.id.toString()===A?{...V,...K}:V)),o?.(A,K)},h=A=>{if(!A){console.error("No reminder ID provided for deletion");return}s(K=>K.filter(W=>W?.id.toString()!==A)),i?.(A)},D=r.filter(A=>{if(!A)return!1;if(g){let K=g.toLowerCase();if(!(A.title.toLowerCase().includes(K)||A.description?.toLowerCase().includes(K)))return!1}switch(p){case"pending":case"completed":case"overdue":return vi(new Date(A.dueDate||""),A.dueTime||"");case"today":return hi(new Date(A.dueDate||""));default:return!0}}).sort((A,K)=>{if(!A||!K)return 0;let W={high:3,medium:2,low:1},V=0;return V!==0?V:new Date(A.dueDate||"").getTime()-new Date(K.dueDate||"").getTime()}),N={total:r.filter(Boolean).length,overdue:r.filter(A=>A&&vi(new Date(A.dueDate||""),A.dueTime||"")).length,today:r.filter(A=>A&&hi(new Date(A.dueDate||""))).length},q=n.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,Bi.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Bi.jsx)(At,{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:()=>{b(!0)}}}),(0,Bi.jsxs)("div",{className:"h-full bg-background",children:[(0,Bi.jsx)(kl,{colleagues:n,onAddReminder:R,open:x,setOpen:b}),(0,Bi.jsxs)("div",{className:"p-6",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Bi.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Bi.jsxs)(T,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,Bi.jsx)(Wt.Plus,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:"Add Reminder"})]})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Bi.jsxs)(ke,{className:"p-4",children:[(0,Bi.jsx)("div",{className:"text-2xl font-bold text-foreground",children:N.total}),(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Bi.jsxs)(ke,{className:"p-4",children:[(0,Bi.jsx)("div",{className:"text-2xl font-bold text-primary",children:N.overdue}),(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Bi.jsxs)(ke,{className:"p-4",children:[(0,Bi.jsx)("div",{className:"text-2xl font-bold text-success",children:N.today}),(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Bi.jsxs)(ke,{className:"p-4",children:[(0,Bi.jsx)("div",{className:"text-2xl font-bold text-destructive",children:N.overdue}),(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Bi.jsxs)(ke,{className:"p-4",children:[(0,Bi.jsx)("div",{className:"text-2xl font-bold text-warning",children:N.today}),(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Bi.jsx)("div",{className:"flex-1",children:(0,Bi.jsx)(ce,{placeholder:"Search reminders...",value:g,onChange:A=>f(A.target.value),className:"max-w-md"})}),(0,Bi.jsxs)(it,{value:p,onValueChange:A=>l(A),children:[(0,Bi.jsx)(Qe,{className:"w-40",children:(0,Bi.jsx)(wt,{})}),(0,Bi.jsxs)(et,{children:[(0,Bi.jsxs)(Pe,{value:"all",children:["All (",N.total,")"]}),(0,Bi.jsxs)(Pe,{value:"overdue",children:["Overdue (",N.overdue,")"]}),(0,Bi.jsxs)(Pe,{value:"overdue",children:["Overdue (",N.overdue,")"]}),(0,Bi.jsxs)(Pe,{value:"today",children:["Today (",N.today,")"]})]})]})]}),(0,Bi.jsx)("div",{className:"space-y-4",children:D.length===0?(0,Bi.jsxs)(ke,{className:"p-8 text-center",children:[(0,Bi.jsx)("div",{className:"text-muted-foreground",children:g||p!=="all"?"No reminders match your filters":"No reminders yet"}),!g&&p==="all"&&(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground/60 yi-2",children:"Create your first reminder to get started"})]}):D.map(A=>A&&(0,Bi.jsx)(Rl,{reminder:A,colleagues:n,onUpdateReminder:u,onDeleteReminder:h},A.id))})]})]})]})};function bi({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,onFileUpdate:r,compactView:s=!1,className:n}){let[m,p]=(0,yi.useState)(e),[l,g]=(0,yi.useState)(""),[f,x]=(0,yi.useState)("all"),[b,R]=(0,yi.useState)("all"),[u,h]=(0,yi.useState)(!1),F=(0,yi.useRef)(""),D=I=>I.map(he=>`${he.id}-${new Date(he.createdAt).getTime()}-${new Date(he.updatedAt).getTime()}`).join("-");(0,yi.useEffect)(()=>{let I=D(e.map(he=>({...he,updatedAt:new Date().toISOString()})));I!==F.current&&(p(e),F.current=I)},[e]);let N=m.filter(I=>I.name.toLowerCase().includes(l.toLowerCase())),q=N.slice(0,10),A=N.filter(Boolean),K=()=>{h(!0)},W=I=>{a?.(I)},V=I=>{console.log("deleting file",I),p(he=>he.filter(C=>C.name!==I.name)),o?.(I.id.toString())},ae=I=>{i?.(I)},le=()=>{g(""),x("all")};return(0,Bi.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Bi.jsx)(Mo.AnimatePresence,{mode:"wait",children:(0,Bi.jsx)(Mo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Bi.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Bi.jsx)(At,{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:K},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Bi.jsx)(ke,{children:(0,Bi.jsx)(Sa,{className:"pt-6",children:(0,Bi.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Bi.jsx)("div",{className:"flex-1",children:(0,Bi.jsxs)("div",{className:"relative",children:[(0,Bi.jsx)(Wt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Bi.jsx)(ce,{placeholder:"Search files...",value:l,onChange:I=>g(I.target.value),className:"pl-9"})]})}),(l||f!=="all")&&(0,Bi.jsxs)(T,{variant:"outline",onClick:le,className:"gap-2",children:[(0,Bi.jsx)(Wt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Bi.jsxs)("div",{className:"space-y-4",children:[(0,Bi.jsx)(bo,{activeTab:b,onTabChange:R,tabOptions:[{value:"all",label:`All Files (${N.length})`},{value:"recent",label:`Recent (${q.length})`}],maxWidth:"500px",gridCols:3}),b==="all"&&(0,Bi.jsx)(Aa,{files:N,onFileClick:ae,onFileUpdate:r,onFileDelete:V,showHeader:!s}),b==="recent"&&(0,Bi.jsx)(Aa,{files:q,onFileClick:ae,onFileUpdate:r,onFileDelete:V,showHeader:!s}),b==="shared"&&(0,Bi.jsx)(Aa,{files:A,onFileClick:ae,onFileUpdate:r,onFileDelete:V,showHeader:!s})]}),N.length===0&&(0,Bi.jsx)(ke,{children:(0,Bi.jsx)(Sa,{className:"pt-6",children:(0,Bi.jsxs)("div",{className:"text-center py-8",children:[(0,Bi.jsx)(Wt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Bi.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No files found"}),(0,Bi.jsx)("p",{className:"text-muted-foreground mb-4",children:l||f!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,Bi.jsxs)(T,{onClick:K,className:"gap-2",children:[(0,Bi.jsx)(Wt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,Bi.jsx)(Ro,{isOpen:u,onClose:()=>h(!1),onAddFile:t})]})}var Pn=require("next/navigation");function xi({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:s=[],initialUsers:n=[],initialFiles:m=[],initialView:p="kanban",onAddTask:l,onUpdateTask:g,onDeleteTask:f,onTaskClick:x,onAddEpic:b,onUpdateEpic:R,onDeleteEpic:u,onAddTaskToEpic:h,onAddSprint:F,onUpdateSprint:D,onDeleteSprint:N,onAddProject:q,onUpdateProject:A,onDeleteProject:K,onFileAdd:W,onFileEdit:V,onFileDelete:ae,onFileClick:le,onAddReminder:I,onUpdateReminder:he,onDeleteReminder:C,onViewChange:S,onToggleMobileMenu:B,onTeamClick:Q,onTeamChange:be,onCopilotClick:we,handleAddComment:de}){let[P,te]=(0,yi.useState)(t),[re,lt]=(0,yi.useState)(a),[Ne,Xe]=(0,yi.useState)(o),[Ia,Mt]=(0,yi.useState)(i),[Fa,It]=(0,yi.useState)(r),[oa,va]=(0,yi.useState)(s),[ia,ha]=(0,yi.useState)(n),[ba,xt]=(0,yi.useState)(m),[v,E]=(0,yi.useState)(!1),[y,M]=(0,yi.useState)(!1),[$,ie]=(0,yi.useState)(null),[Ve,Ft]=(0,yi.useState)(null),[Ct,La]=(0,yi.useState)(null),[ra,wi]=(0,yi.useState)(p||"kanban"),[El,An]=(0,yi.useState)(!1),En=(0,Pn.useRouter)();(0,yi.useEffect)(()=>{te(t)},[t]),(0,yi.useEffect)(()=>{Xe(o)},[o]),(0,yi.useEffect)(()=>{lt(a)},[a]),(0,yi.useEffect)(()=>{Mt(i)},[i]),(0,yi.useEffect)(()=>{xt(m)},[m]),(0,yi.useEffect)(()=>{ha(n)},[n]),(0,yi.useEffect)(()=>{va(s)},[s]),(0,yi.useEffect)(()=>{It(r)},[r]),(0,yi.useEffect)(()=>{wi(p)},[p]);let Mn=P.filter(k=>{}),Ml=k=>Mn.filter(j=>j.status===k),Il=k=>{let j={};return re.forEach(Z=>{}),j},Fl=k=>{La(k)},Ll=k=>{Ct&&(te(j=>j.map(Z=>Z.id===Ct.id?{...Z,status:k}:Z)),La(null))},Ni=k=>{let j={...k,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};te(Z=>[...Z,j]),l?.(j)},to=async(k,j)=>(te(Z=>Z.map(ze=>ze.id===Number(k)?{...ze,...j}:ze)),await g?.(k,j)),Bl=async(k,j)=>{to(k,j)},Ci=k=>{te(j=>j.filter(Z=>Z.id!==Number(k))),$?.id===Number(k)&&ie(null),f?.(k)},Ol=async k=>{Ci(k)},Hl=k=>{let j={...k,id:Date.now()};Mt(Z=>[...Z,j]),q?.(k)},Ul=(k,j)=>{Mt(Z=>Z.map(ze=>ze.id===Number(k)?{...ze,...j}:ze)),A?.(k,j)},Vl=k=>{Mt(j=>j.filter(Z=>Z.id!==Number(k))),K?.(k)},Di=k=>{let j={...k,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};lt(Z=>[...Z,j]),b?.({...j})},In=()=>{M(!0)},Fn=(k,j)=>{lt(Z=>Z.map(ze=>ze.id===Number(k)?{...ze,...j}:ze)),R?.(k,j)},Ln=k=>{lt(j=>j.filter(Z=>Z.id!==Number(k))),te(j=>j.filter(Z=>Fe(Z.epic)!==Number(k))),u?.(k)},Bn=k=>{let j={...k,id:Date.now()};Xe(Z=>[...Z,j]),F?.(k)},On=(k,j)=>{Xe(Z=>Z.map(ze=>ze.id===Number(k)?{...ze,...j}:ze)),D?.(k,j)},Hn=k=>{k==="backlog"||k==="all-tasks"||(Xe(j=>j.filter(Z=>Z.id!==Number(k))),te(j=>j.map(Z=>Fe(Z.sprint)===Number(k)?{...Z,sprint:void 0}:Z)),N?.(k))},Io=k=>{ie(k)},Un=k=>{k==="planning"&&window.innerWidth<768||(wi(k),S?.(k))},zl=()=>{An(k=>!k),B?.()},jl=()=>{En.push("/")},$l=k=>{console.log("Switching to team:",k)},_l=k=>{console.log("Switching to team:",k)},Vn=k=>{E(!0)},zn=()=>{E(!1),Ft(null)},jn=k=>{let j={...k,id:Date.now(),createdAt:new Date().toISOString()};It(Z=>[...Z,j]),I?.(k)},$n=(k,j)=>{It(Z=>Z.map(ze=>ze.id===Number(k)?{...ze,...j}:ze)),he?.(k,j)},_n=k=>{It(j=>j.filter(Z=>Z.id!==Number(k))),C?.(k)},Gn=()=>{W?.()},Wn=k=>{V?.(k)},Kn=k=>{xt(j=>j.filter(Z=>Z.name!==k)),ae?.(k)},qn=k=>{le?.(k)},Gl=[{id:"todo",title:"To So",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Wl=()=>{switch(ra){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"}},Fo=[{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")}],Kl=Fo.sort((k,j)=>j.lastUsed.getTime()-k.lastUsed.getTime()).slice(0,3),ql=Fo.length>3,Jl=Fo.slice(3);return(0,Bi.jsxs)(dr,{currentView:ra,onViewChange:Un,children:[ra==="kanban"&&(0,Bi.jsx)("div",{className:"h-full overflow-hidden",children:(0,Bi.jsx)(Nn,{initialProjects:Ia,initialEpics:re,initialSprints:Ne.map(k=>({...k,isSelected:!1})),initialTasks:P,initialColleagues:oa,initialUsers:ia,onAddTask:Ni,onUpdateTask:to,onDeleteTask:Ci,onTaskClick:Io,onAddEpic:Di,onAddComment:de})}),ra==="planning"&&(0,Bi.jsx)("div",{className:"hidden md:block h-full",children:(0,Bi.jsx)(Tn,{tasks:P,epics:re,sprints:Ne,onUpdateTask:to,onTaskClick:Io,onAddSprint:Bn,onUpdateSprint:On,onDeleteSprint:Hn})}),ra==="tasks"&&(0,Bi.jsx)("div",{className:"h-full",children:(0,Bi.jsx)(kn,{initialReminders:Fa,initialColleagues:oa,onAddReminder:jn,onUpdateReminder:$n,onDeleteReminder:_n})}),ra==="files"&&(0,Bi.jsx)("div",{className:"h-full",children:(0,Bi.jsx)(bi,{initialFiles:ba,onFileAdd:Gn,onFileEdit:Wn,onFileDelete:Kn,onFileClick:qn,compactView:!1})}),ra==="epics"&&(0,Bi.jsx)("div",{className:"h-full",children:(0,Bi.jsx)(Cn,{tasks:P,epics:re,sprints:Ne,onUpdateTask:to,onTaskClick:Io,onAddTaskToEpic:Vn,onAddEpic:In,onUpdateEpic:Fn,onDeleteEpic:Ln})}),(0,Bi.jsx)(ka,{isOpen:v,onClose:zn,onAddTask:Ni,epics:re,sprints:Ne,assignees:[...oa,...ia],defaultEpicId:Ve||void 0}),(0,Bi.jsx)(Ea,{isOpen:y,onClose:()=>M(!1),onAddEpic:Di})]})}function Rn({title:e="",projects:t,businessUnits:a,epics:o,sprints:i,tasks:r,currentView:s,onAddTask:n,onUpdateTask:m,onDeleteTask:p,onTaskClick:l,onAddEpic:g,onUpdateEpic:f,onDeleteEpic:x,onAddTaskToEpic:b,onAddSprint:R,onUpdateSprint:u,onDeleteSprint:h,onAddProject:F,onUpdateProject:D,onDeleteProject:N,onViewChange:q,mobileMenuOpen:A,onToggleMobileMenu:K,onTeamClick:W,onTeamChange:V,onCopilotClick:ae}){let[le,I]=(0,yi.useState)("projects"),[he,C]=(0,yi.useState)(a[0]),S=re=>{console.log("Opening app:",re.name)},B=re=>{console.log("Favoriting app:",re.name)},Q=re=>{console.log("Opening file:",re.name)},be=re=>{console.log("Sharing file:",re.name)},we=re=>{console.log("Opening project:",re.name)},de=re=>{console.log("Sharing project:",re.name)},P=re=>{console.log("Business unit changed to:",re.name)},te=()=>{switch(le){case"projects":return(0,Bi.jsx)(xi,{initialProjects:t,initialEpics:o,initialSprints:i,initialTasks:r,onAddTask:n,onUpdateTask:m,onDeleteTask:p,onTaskClick:l,onAddEpic:g,onUpdateEpic:f,onDeleteEpic:x,onAddTaskToEpic:b,onAddSprint:R,onUpdateSprint:u,onDeleteSprint:h,onAddProject:F,onUpdateProject:D,onDeleteProject:N,onViewChange:q,onToggleMobileMenu:K,onTeamClick:W,onTeamChange:V,onCopilotClick:ae});default:return null}};return(0,Bi.jsx)(lr,{sidebarItems:qi,title:e,notifications:Ji,businessUnits:a,currentBusinessUnit:he,onBusinessUnitChange:P,activeTab:le,onTabChange:I,showTabs:!0,children:(0,Bi.jsx)(Mo.AnimatePresence,{mode:"wait",children:(0,Bi.jsx)(Mo.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:te()},le)})})}
8
+ `)},ta=e=>{let t=[],a=0;for(;a<e.length;){let i=e.slice(a).match(/^<u\s*[^>]*>([\s\S]*?)<\/u>/i);if(i&&i[0]){let v=i[1]||"",C=v?ta(v):[];C.length>0?(C.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|8)}),t.push(...C)):v===""&&t.push({type:"text",text:"",format:8}),a+=i[0].length;continue}if(e.slice(a).startsWith("</u>")){a+=4;continue}let r=e.slice(a).match(/^(`+)([^`]+)\1/);if(r){let v=r[2];v&&t.push({type:"text",text:v,format:16}),a+=r[0].length;continue}let s=e.slice(a).match(/^(~~)(.+?)\1/);if(s){let v=s[2],C=ta(v);C.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|4)}),t.push(...C),a+=s[0].length;continue}let n=e.slice(a).match(/^(\*\*|__)(.+?)\1/);if(n){let v=n[2],C=ta(v);C.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|1)}),t.push(...C),a+=n[0].length;continue}let m=e.slice(a).match(/^(\*|Bi)([^*Bi\n]+?)\1(?!\*|Bi)/);if(m&&m[0].length>2){let v=m[2],C=ta(v);C.forEach(b=>{b.type==="text"&&(b.format=(b.format||0)|2)}),t.push(...C),a+=m[0].length;continue}if(e[a]===`
9
+ `){t.push({type:"linebreak",version:1}),a+=1;continue}let p=e.length,l=[{pattern:/<u>/i,offset:0},{pattern:/\*\*/,offset:0},{pattern:/__/,offset:0},{pattern:/~~/,offset:0},{pattern:/`+/,offset:0},{pattern:/\*[^*\n]/,offset:0},{pattern:/Bi[^Bi\n]/,offset:0},{pattern:/\n/,offset:0}];for(let{pattern:v}of l){let C=e.slice(a+1).search(v);C!==-1&&C+1<p-a&&(p=a+C+1)}let f=e.slice(a,p);f&&t.push({type:"text",text:f,format:0}),a=p}let o=[];for(let i of t)i.type==="linebreak"?o.push(i):o.length>0&&o[o.length-1].type==="text"&&i.type==="text"&&o[o.length-1].format===i.format?o[o.length-1].text+=i.text:o.push(i);return o.length>0?o:[{type:"text",text:"",format:0}]},wl=e=>{let t=e.split(`
10
+ `),a=[],o=[],i=[],r=null,s=()=>{if(o.length>0){for(let m=0;m<o.length;m++){let p=o[m],l=ta(p),f=l.length>0?l.map(v=>({...v,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];a.push({type:"paragraph",children:f,direction:"ltr",format:"",indent:0,version:1})}o=[]}},n=()=>{i.length>0&&r&&(a.push({type:"list",listType:r,tag:r==="number"?"ol":"ul",start:1,format:"",indent:0,version:1,direction:"ltr",children:i}),i=[],r=null)};for(let m of t){let p=m.trim();if(!p){s(),n(),a.push({children:[],direction:null,format:"",indent:0,type:"paragraph",version:1,textFormat:0,textStyle:""});continue}let l=p.match(/^(#{1,6})\s+(.+)$/);if(l){s(),n();let C=l[1].length,b=l[2],P=ta(b);a.push({type:"heading",tag:`h${C}`,children:P.length>0?P:[{type:"text",text:"",format:0}]});continue}let f=p.match(/^(\Bi+)\.\s+(.*)$/);if(f){s(),r==="bullet"&&n(),r!=="number"&&(i.length>0&&n(),r="number");let C=f[2]||"",b=ta(C),P=b.length>0?b.map(u=>({...u,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];i.push({type:"listitem",value:i.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:P,direction:"ltr",format:"",indent:0,version:1}]});continue}let v=p.match(/^[-*+]\s+(.+)$/);if(v){s(),r==="number"&&n(),r!=="bullet"&&(i.length>0&&n(),r="bullet");let C=v[1],b=ta(C),P=b.length>0?b.map(u=>({...u,mode:"normal",style:"",detail:0,version:1})):[{type:"text",text:"",format:0,mode:"normal",style:"",detail:0,version:1}];i.push({type:"listitem",value:i.length+1,format:"start",indent:0,version:1,direction:"ltr",children:[{type:"paragraph",children:P,direction:"ltr",format:"",indent:0,version:1}]});continue}i.length>0&&n(),o.push(m)}return s(),n(),a.length===0&&a.push({type:"paragraph",children:[{type:"text",text:"",format:0}]}),{root:{type:"root",children:a,direction:"ltr",format:"",indent:0,version:1}}},Nl=async e=>{let t="",a,o="text";if(e.url)try{let i=e.url;!i.startsWith("http://")&&!i.startsWith("https://")&&!i.startsWith("/")&&(i="/"+i);let r=await fetch(i);r.ok?(t=await r.text(),console.log("Successfully loaded content, length:",t.length)):console.error("Failed to fetch file content:",r.status,r.statusText)}catch(i){console.error("Failed to fetch file content:",i)}else console.warn("Wt URL provided for file:",e.name);return e.mimeType==="text/markdown"?(o="richText",a=wl(t)):e.mimeType?.startsWith("text/")&&(o="text"),{id:e.id.toString(),title:e.name,description:void 0,content:o==="richText"?void 0:t,richTextContent:o==="richText"?a:void 0,format:o,metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}};function fn({document:e,onCancel:t,onSave:a,onFileUpdate:o}){let[i,r]=(0,yi.useState)(Qa(e)),[s,n]=(0,yi.useState)(Qa(e)?{id:e.id.toString(),title:e.name,description:void 0,content:"",format:"text",metadata:{},createdAt:typeof e.createdAt=="string"?new Date(e.createdAt):e.createdAt,updatedAt:new Date}:{...e,updatedAt:new Date}),[m,p]=(0,yi.useState)(Qa(e)?void 0:s.richTextContent),[l,f]=(0,yi.useState)(!1),v=(0,yi.useRef)(Qa(e)?e:null);(0,yi.useEffect)(()=>{Qa(e)?(r(!0),Nl(e).then(u=>{n(u),p(u.richTextContent),r(!1)}).catch(u=>{u instanceof Error&&u.name!=="AbortError"&&(console.error("Failed to convert file:",u),r(!1))})):(n({...e,updatedAt:new Date}),p(e.richTextContent))},[e]);let C=u=>{switch(u){case"markdown":case"mdx":return(0,Bi.jsx)(Wt.FileText,{className:"h-6 w-6 text-primary"});case"richText":return(0,Bi.jsx)(Wt.File,{className:"h-6 w-6 text-success"});case"text":return(0,Bi.jsx)(Wt.Type,{className:"h-6 w-6 text-muted-foreground"});default:return(0,Bi.jsx)(Wt.File,{className:"h-6 w-6 text-muted-foreground"})}},b=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"}},P=async()=>{f(!0);try{let u,x;if(v.current&&v.current.mimeType==="text/markdown"){let D=m?yl(m):"";u={...s,format:"markdown",content:D,richTextContent:void 0},x=D}else u={...s,richTextContent:m},x=s.content||"";let I=v.current?v.current.id.toString():s.id;await Promise.resolve(a()),o?.(I,x)}finally{f(!1)}};return(0,Bi.jsxs)(Io.motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"h-screen flex flex-col",children:[(0,Bi.jsx)("div",{className:"border-b border-border bg-card p-8 pb-6",children:(0,Bi.jsxs)("div",{className:"flex items-start justify-between gap-4 mb-4",children:[(0,Bi.jsx)("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:(0,Bi.jsx)("div",{className:"flex-1 min-w-0",children:(0,Bi.jsxs)("div",{className:"flex items-start gap-4 mb-0 leading-tight",children:[(0,Bi.jsx)("div",{className:"flex-1 min-w-0",children:(0,Bi.jsx)(Ka,{fieldName:"title",value:s.title,label:"",onSave:(u,x)=>n(I=>({...I,title:x})),className:"[&>div:last-child]:text-2xl [&>div:last-child]:font-bold [&>div:last-child]:leading-tight [&>div:last-child]:text-foreground [&>div:last-child]:p-0 [&>div:last-child]:border-0 [&>div:last-child]:hover:bg-muted/30 [&>div:last-child]:min-h-0"})}),(0,Bi.jsx)("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium border ${b(s.format)} flex-shrink-0 yi-1`,children:s.format.toUpperCase()})]})})}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,Bi.jsxs)(S,{variant:"outline",size:"sm",onClick:t,className:"gap-2",children:[(0,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"}),"Close"]}),(0,Bi.jsxs)(S,{size:"sm",onClick:P,className:"gap-2",disabled:l,children:[l?(0,Bi.jsx)(Wt.Loader2,{className:"h-4 w-4 animate-spin"}):(0,Bi.jsx)(Wt.Save,{className:"h-4 w-4"}),l?"Saving...":"Save"]})]})]})}),(0,Bi.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,Bi.jsx)("div",{className:"p-8 pt-0 h-full max-h-full overflow-auto",children:i?(0,Bi.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,Bi.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,Bi.jsx)(Wt.Loader2,{className:"h-8 w-8 animate-spin text-primary"}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading file content..."})]})}):(0,Bi.jsx)(Bi.Fragment,{children:s.format==="richText"?(0,Bi.jsx)(cn,{setValue:p,value:m,name:"richTextContent"},`richtext-${s.id}-${i?"loading":"loaded"}`):(0,Bi.jsx)(Be,{value:s.content||"",onChange:u=>n(x=>({...x,content:u.target.value})),placeholder:"Document content...",className:"min-h-[400px] font-mono text-sm",style:{resize:"vertical"}})})})})]})}var vn=e=>{if(!e||e<=0)return"0 KB";let t=e/1024;return t<1024?`${t.toFixed(2)} KB`:`${(t/1024).toFixed(2)} MB`};function Aa({files:e,onFileClick:t,onFileDelete:a,onFileUpdate:o,showHeader:i=!0,className:r,viewMode:s="list"}){let[n,m]=(0,yi.useState)(!1),[p,l]=(0,yi.useState)(!1),[f,v]=(0,yi.useState)(null),C=()=>{m(!1),v(null)},b=()=>{l(!0),setTimeout(()=>{l(!1),m(!1),v(null)},500)},P=u=>{v(u),m(!0)};return(0,Bi.jsxs)("div",{className:w("rounded-3xl border overflow-hidden",r),children:[(0,Bi.jsxs)("div",{className:"bg-muted/50 p-3 flex items-center justify-between",children:[i&&s==="list"&&(0,Bi.jsxs)("div",{className:"hidden md:grid md:grid-cols-10 text-sm font-medium flex-1",children:[(0,Bi.jsx)("div",{className:"col-span-6",children:"Name"}),(0,Bi.jsx)("div",{className:"col-span-2",children:"Size"}),(0,Bi.jsx)("div",{className:"col-span-2",children:"Modified"})]}),s==="card"&&(0,Bi.jsx)("div",{className:"text-sm font-medium",children:"Files"})]}),s==="list"&&(0,Bi.jsx)("div",{className:"divide-y",children:e.map(u=>(0,Bi.jsxs)(Io.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?.(u),children:[(0,Bi.jsxs)("div",{className:"col-span-6 flex items-center gap-3 w-full md:w-auto",children:[(0,Bi.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted"}),(0,Bi.jsx)("div",{children:(0,Bi.jsx)("p",{className:"font-medium",children:u.name})})]}),(0,Bi.jsx)("div",{className:"col-span-2 text-sm md:text-base",children:vn(u.filesize)}),(0,Bi.jsxs)("div",{className:"col-span-2 flex items-center justify-between w-full md:w-auto",children:[(0,Bi.jsx)("span",{className:"text-sm md:text-base",children:new Date(u.createdAt).toLocaleDateString()}),(0,Bi.jsxs)("div",{className:"flex gap-1",children:[u.mimeType==="text/markdown"&&(0,Bi.jsx)(S,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:x=>{x.stopPropagation(),P(u)},children:(0,Bi.jsx)(Wt.Edit,{className:"h-4 w-4"})}),(0,Bi.jsx)(S,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:x=>{x.stopPropagation(),a?.(u)},children:(0,Bi.jsx)(Wt.Trash2,{className:"h-4 w-4"})})]})]})]},u.name))}),s==="card"&&(0,Bi.jsx)("div",{className:"p-4 grid grid-cols-1 gap-4",children:e.map(u=>(0,Bi.jsx)(Io.motion.div,{whileHover:{scale:1.02},className:"border rounded-lg p-4 bg-card hover:bg-muted/50 transition-colors cursor-pointer",onClick:()=>t?.(u),children:(0,Bi.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,Bi.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Bi.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-2xl bg-muted flex-shrink-0"}),(0,Bi.jsx)("div",{className:"min-w-0 flex-1",children:(0,Bi.jsx)("p",{className:"font-medium truncate",children:u.name})})]}),(0,Bi.jsxs)("div",{className:"space-y-1 text-sm text-muted-foreground pl-[52px]",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("span",{className:"font-medium",children:"Size:"}),(0,Bi.jsx)("span",{children:vn(u.filesize)})]}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("span",{className:"font-medium",children:"Modified:"}),(0,Bi.jsx)("span",{children:new Date(u.createdAt).toLocaleDateString()})]})]})]}),(0,Bi.jsxs)("div",{className:"flex flex-col gap-2 flex-shrink-0",children:[u.mimeType==="text/markdown"&&(0,Bi.jsx)(S,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl",onClick:x=>{x.stopPropagation(),P(u)},title:"Edit",children:(0,Bi.jsx)(Wt.Edit,{className:"h-4 w-4"})}),(0,Bi.jsx)(S,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-xl text-red-500 hover:text-red-600",onClick:x=>{x.stopPropagation(),a?.(u)},title:"Delete",children:(0,Bi.jsx)(Wt.Trash2,{className:"h-4 w-4"})})]})]})},u.name))}),(0,Bi.jsx)($e,{open:n,onOpenChange:u=>!u&&C(),children:(0,Bi.jsxs)(Vo,{children:[(0,Bi.jsx)(oo,{}),(0,Bi.jsxs)(hn.Content,{className:w("fixed inset-0 z-50 bg-background p-0 m-0 border-0","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"),children:[(0,Bi.jsx)(Le,{className:"Wt-only",children:f?`Edit ${f.name}`:"Edit File"}),p&&(0,Bi.jsx)("div",{className:"absolute inset-0 bg-background/50 flex items-center justify-center z-50",children:(0,Bi.jsx)(Wt.Loader2,{className:"h-8 w-8 animate-spin text-primary"})}),f&&(0,Bi.jsx)(fn,{document:f,onSave:b,onFileUpdate:o,onCancel:C})]})]})})]})}var Ao=({isOpen:e,onClose:t,onAddFile:a})=>{let[o,i]=(0,yi.useState)(null),[r,s]=(0,yi.useState)(""),[n,m]=(0,yi.useState)(""),[p,l]=(0,yi.useState)(""),f=C=>{let b=C.target.files?.[0];b&&(i(b),r||s(b.name))},v=async C=>{if(C.preventDefault(),!o)return;let b=new FormData;b.append("file",o),b.append("name",r),n&&b.append("description",n),p&&b.append("tags",p),a?.(b),t(),i(null),s(""),m(""),l("")};return(0,Bi.jsx)($e,{open:e,onOpenChange:t,children:(0,Bi.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Add New File"})}),(0,Bi.jsxs)("form",{onSubmit:v,className:"grid gap-4",children:[(0,Bi.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,Bi.jsxs)("label",{htmlFor:"dropzone-file",className:"flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600",children:[(0,Bi.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,Bi.jsx)(Cl,{className:"w-10 h-10 text-gray-400"}),(0,Bi.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,Bi.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,Bi.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"SVG, PNG, JPG or GIF (MAX. 800x400px)"})]}),(0,Bi.jsx)("input",{id:"dropzone-file",type:"file",className:"hidden",onChange:f})]})}),o&&(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("p",{className:"font-medium",children:o.name}),(0,Bi.jsxs)("p",{className:"text-sm text-muted-foreground",children:[((o.size||0)/1024).toFixed(2)," KB"]})]}),(0,Bi.jsx)(S,{type:"submit",onClick:v,children:"Upload"})]})]})]})})};function Cl(e){return(0,Bi.jsxs)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Bi.jsx)("path",{Bi:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,Bi.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,Bi.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})}var xn=({isOpen:e,onClose:t,initialTask:a,epics:o,sprints:i,onUpdateTask:r,onDeleteTask:s,onAddComment:n,colleagues:m,onUploadFile:p,onDeleteFile:l,onFileUpdate:f})=>{let[v,C]=(0,yi.useState)(a),[b,P]=(0,yi.useState)(new Date),[u,x]=(0,yi.useState)("idle"),[I,D]=(0,yi.useState)("idle"),[N,J]=(0,yi.useState)(!1),[R,W]=(0,yi.useState)([]),[K,O]=(0,yi.useState)(m);(0,yi.useEffect)(()=>{C(a)},[a]);let ee=async(de,k)=>{if(k!==v[de]){x("loading");try{await r(v.id.toString(),{[de]:k}),P(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(te){console.log("error",te),x("error"),setTimeout(()=>x("idle"),3e3)}}},le=async(de,k)=>{if(k!==v[de]){x("loading");try{await r(v.id.toString(),{[de]:k}),P(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(te){console.log("error",te),x("error"),setTimeout(()=>x("idle"),3e3)}}},M=async de=>{if(n){x("loading");try{await n?.({content:de,taskId:v.id.toString()}),P(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch{x("error"),setTimeout(()=>x("idle"),3e3)}}},xe=async()=>{D("loading");try{await s(v.id.toString()),D("success"),setTimeout(()=>{t(),D("idle")},1e3)}catch{D("error"),setTimeout(()=>D("idle"),3e3)}},Se=async de=>{if(p){x("loading");try{await p(v.id.toString(),de),P(new Date),x("success"),J(!1),setTimeout(()=>x("idle"),1500)}catch(k){console.error("Error uploading file:",k),x("error"),setTimeout(()=>x("idle"),3e3)}}},g=async de=>{if(l){x("loading");try{await l(v.id.toString(),de.id.toString()),P(new Date),x("success"),setTimeout(()=>x("idle"),1500)}catch(k){console.error("Error deleting file:",k),x("error"),setTimeout(()=>x("idle"),3e3)}}},L=(v.files||[]).map(de=>typeof de=="number"?null:de).filter(de=>de!==null),V=u!=="loading"&&I!=="loading",we=()=>{V&&t()},ae=()=>u==="loading"?(0,Bi.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,Bi.jsx)(Wt.Loader2,{className:"h-4 w-4 animate-spin"}),(0,Bi.jsx)("span",{children:"Updating..."})]}):u==="success"?(0,Bi.jsxs)("div",{className:"flex items-center gap-2 text-sm text-success",children:[(0,Bi.jsx)(Wt.Check,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:"Updated successfully"})]}):u==="error"?(0,Bi.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:"Update failed"})]}):null;return(0,Bi.jsxs)($e,{open:e,onOpenChange:we,children:[(0,Bi.jsxs)(Ke,{className:"max-w-3xl max-h-[80vh] overflow-y-auto p-4",children:[(0,Bi.jsxs)(qe,{children:[(0,Bi.jsx)(Le,{className:"Wt-only",children:v?.name}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("div",{className:"flex-1",children:ae()}),!V&&(0,Bi.jsx)("div",{className:"text-xs text-muted-foreground",children:"Please wait..."})]})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[(0,Bi.jsxs)("div",{className:"lg:col-span-2 space-y-4",children:[(0,Bi.jsx)(Ka,{fieldName:"name",value:v.name||"",label:"",onSave:ee,className:"border-b border-border pb-3",disabled:u==="loading"}),(0,Bi.jsx)(Ka,{fieldName:"description",value:v.description||"",label:"Description",multiline:!0,onSave:ee,disabled:u==="loading"}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)(Wt.File,{className:"h-4 w-4 text-muted-foreground"}),(0,Bi.jsx)("h3",{className:"text-sm font-medium",children:"Files"})]}),p&&(0,Bi.jsxs)(S,{variant:"outline",size:"sm",onClick:()=>J(!0),disabled:u==="loading",className:"gap-2",children:[(0,Bi.jsx)(Wt.Upload,{className:"h-4 w-4"}),"Upload"]})]}),L.length>0?(0,Bi.jsx)(Aa,{files:L,onFileDelete:l?g:void 0,onFileUpdate:f,showHeader:!1,className:"border rounded-lg",viewMode:"card"}):(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground py-4 text-center border border-dashed rounded-lg",children:"Wt files attached"})]}),(0,Bi.jsx)(Dr,{comments:(v?.comments||[]).map(de=>({author:de.author?.value.name||"",createdAt:new Date(de.timestamp),text:de.text,id:de.id||""})),onAddComment:M})]}),(0,Bi.jsx)(kr,{task:v,epics:o,sprints:i,lastUpdated:b,onUpdateTask:le,onClose:we,onDelete:xe,isUpdating:u==="loading",isDeleting:I==="loading",deleteState:I,teamMembers:K})]})]}),p&&(0,Bi.jsx)(Ao,{isOpen:N,onClose:()=>J(!1),onAddFile:Se})]})};var Ea=({isOpen:e,onClose:t,onAddEpic:a})=>{let[o,i]=(0,yi.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"],s=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}],n=[{value:1,label:"Planning"},{value:2,label:"Development"},{value:3,label:"Testing"},{value:4,label:"Done"}],m=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:o.startDate,endDate:o.endDate}),i({name:"",description:"",color:"bg-blue-500",confidence:"medium",phase:1,startDate:new Date().toISOString(),endDate:new Date().toISOString(),progress:0}),t())},p=(l,f)=>{i(v=>({...v,[l]:f}))};return(0,Bi.jsx)($e,{open:e,onOpenChange:t,children:(0,Bi.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Add New Epic"})}),(0,Bi.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"name",children:"Epic Name"}),(0,Bi.jsx)(ce,{id:"name",value:o.name,onChange:l=>p("name",l.target.value),placeholder:"Enter epic name",required:!0})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"description",children:"Description"}),(0,Bi.jsx)(Be,{id:"description",value:o.description,onChange:l=>p("description",l.target.value),placeholder:"Enter epic description (optional)",rows:3})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Color"}),(0,Bi.jsx)("div",{className:"flex gap-2 flex-wrap",children:r.map(l=>(0,Bi.jsx)("button",{type:"button",onClick:()=>p("color",l),className:`w-8 h-8 rounded-full ${l} ${o.color===l?"ring-2 ring-gray-400":""}`},l))})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Confidence"}),(0,Bi.jsxs)(it,{value:o.confidence,onValueChange:l=>p("confidence",l),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{})}),(0,Bi.jsx)(et,{children:s.map(l=>(0,Bi.jsx)(Pe,{value:l.value,children:l.label},l.value))})]})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Phase"}),(0,Bi.jsxs)(it,{value:o.phase.toString(),onValueChange:l=>p("phase",parseInt(l)),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{})}),(0,Bi.jsx)(et,{children:n.map(l=>(0,Bi.jsx)(Pe,{value:l.value.toString(),children:l.label},l.value))})]})]})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Start Date"}),(0,Bi.jsx)(ce,{type:"date",value:o.startDate,onChange:l=>p("startDate",l.target.value)})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"End Date"}),(0,Bi.jsx)(ce,{type:"date",value:o.endDate,onChange:l=>p("endDate",l.target.value)})]})]}),(0,Bi.jsxs)(Va,{children:[(0,Bi.jsx)(S,{type:"button",variant:"outline",onClick:t,children:"Cancel"}),(0,Bi.jsx)(S,{type:"submit",className:"bg-blue-600 hover:bg-blue-700",children:"Add Epic"})]})]})]})})};var Eo=require("react-icons/fa");function At({title:e,description:t,badge:a,primaryAction:o,secondaryAction:i,gradient:r,children:s,className:n}){let[m,p]=po(`hero-section-minimized-${e.replace(/\s+/g,"-").toLowerCase()}`,!i&&!t),l=!i&&!t||m;return(0,Bi.jsxs)(Io.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 ${n||""}`,children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[a&&(0,Bi.jsx)(he,{className:"bg-white/20 text-white hover:bg-white/30 rounded-xl",children:a}),(0,Bi.jsx)("h2",{className:"text-3xl font-bold m-0",children:e})]}),(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[l&&o&&(0,Bi.jsx)(S,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),(i||t)&&(0,Bi.jsx)("button",{"aria-label":m?"Expand hero section":"Minimize hero section",className:"rounded-full bg-white/20 hover:bg-white/30 p-1 text-white transition-colors",onClick:()=>p(!m),style:{lineHeight:0},children:m?(0,Bi.jsx)(Eo.FaChevronDown,{size:22}):(0,Bi.jsx)(Eo.FaChevronUp,{size:22})})]})]}),!l&&(0,Bi.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-center md:justify-between",children:[(0,Bi.jsxs)("div",{className:"space-y-4",children:[(0,Bi.jsx)("p",{className:"max-w-[600px] text-white/80",children:t}),(0,Bi.jsxs)("div",{className:"flex flex-wrap gap-3",children:[o&&(0,Bi.jsx)(S,{className:"rounded-2xl bg-white text-indigo-700 hover:bg-white/90",onClick:o.onClick,children:o.label}),i&&(0,Bi.jsx)(S,{variant:"outline",className:"rounded-2xl bg-transparent border-white text-white hover:bg-white/10",onClick:i.onClick,children:i.label})]})]}),s&&(0,Bi.jsx)("div",{className:"hidden lg:block",children:s})]})]})}var Nn=({initialTasks:e=[],initialEpics:t=[],initialSprints:a=[],initialUsers:o=[],initialColleagues:i=[],initialProjects:r=[],onAddTask:s,onUpdateTask:n,onDeleteTask:m,onTaskClick:p,onAddEpic:l,onAddComment:f,onUploadFile:v,onDeleteFile:C,onFileUpdate:b})=>{let[P,u]=(0,Ne.useState)([]),[x,I]=(0,Ne.useState)([]),[D,N]=(0,Ne.useState)([]),[J,R]=(0,Ne.useState)(!1),[W,K]=(0,Ne.useState)(!1),[O,ee]=(0,Ne.useState)(null),[le,M]=(0,Ne.useState)(null),[xe,Se]=(0,Ne.useState)([]),[g,L]=(0,Ne.useState)([]),[V,we]=(0,Ne.useState)(0),ae=(0,Ne.useRef)(null),de=(0,Ne.useRef)(null),k=Ne.default.useMemo(()=>[...x.map(y=>y.id),0],[x]),te=(0,Ne.useRef)(""),re=(0,Ne.useRef)(""),lt=(0,Ne.useRef)(""),ye=(0,Ne.useRef)(""),Xe=(y,E)=>y.map($=>`${$.id}-${new Date($.createdAt).getTime()}-${new Date($.updatedAt).getTime()}`).join("-")+(E?`-${E}`:"");(0,Ne.useEffect)(()=>{let y=e.map($=>$.files?.filter(ie=>typeof ie=="object").map(ie=>new Date(ie.updatedAt).getTime())).flat(),E=Xe(e,y.join("-"));E!==te.current&&(u(e),O&&ee(e.find($=>$.id===O.id)||null),te.current=E)},[e]),(0,Ne.useEffect)(()=>{let y=Xe(t);y!==re.current&&(I(t),re.current=y)},[t]),(0,Ne.useEffect)(()=>{let y=Xe(a);y!==lt.current&&(N(a),lt.current=y)},[a]),(0,Ne.useEffect)(()=>{let y=Xe(i.map(E=>({id:E.id,updatedAt:E.updatedAt,createdAt:E.createdAt})));y!==ye.current&&(L(i),ye.current=y)},[i]),(0,Ne.useEffect)(()=>{let y=()=>{if(ae.current){let ie=ae.current.offsetHeight;we(ie)}};y();let E=new ResizeObserver(y);ae.current&&E.observe(ae.current);let $=()=>{setTimeout(y,100)};return window.addEventListener("storage",$),()=>{E.disconnect(),window.removeEventListener("storage",$)}},[]),(0,Ne.useEffect)(()=>{let y=setTimeout(()=>{ae.current&&we(ae.current.offsetHeight)},300);return()=>clearTimeout(y)},[J,W]);let Ia=P.filter(y=>!0),Mt=y=>Ia.filter(E=>E.status===y),Fa=y=>{let E={};return x.forEach($=>{E[$.id]=y.filter(ie=>Fe(ie.epic)===$.id)}),E["no-epic"]=y.filter($=>!Fe($.epic)),E},It=y=>{M(y)},oa=y=>{le&&(u(E=>E.map($=>$.id===le.id?{...$,status:y}:$)),n?.(le.id.toString(),{status:y}),M(null))},va=y=>{let E={...y,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};u($=>[...$,E]),s?.(y)},ia=async(y,E)=>{u($=>$.map(ie=>ie.id===Number(y)?{...ie,...E}:ie)),n&&await n(y,E),O?.id===Number(y)&&ee($=>({...$,...E}))},ha=async y=>{u(E=>E.filter($=>$.id!==Number(y))),O?.id===Number(y)&&ee(null),m&&await m(y)},ba=y=>{let E={...y,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};I($=>[...$,E]),l?.(y)},xt=y=>{ee(y),p?.(y)},h=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],A=V>0?`calc(100vh - ${V+120}px)`:"calc(100vh - 12rem)";return(0,Bi.jsxs)("div",{ref:de,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Bi.jsx)("div",{ref:ae,className:"flex-shrink-0",children:(0,Bi.jsx)(At,{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:()=>R(!0)},secondaryAction:{label:"Add epic",onClick:()=>K(!0)}})}),(0,Bi.jsx)("div",{className:"flex-1 min-h-0 yi-8",children:(0,Bi.jsx)("div",{className:"h-full",style:{height:V>0?`calc(100vh - ${V+120}px)`:"calc(100vh - 12rem)"},children:(0,Bi.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full",children:h.map(y=>{let E=Mt(y.status),$=Fa(E);return(0,Bi.jsxs)(cr,{title:y.title,status:y.status,taskCount:E.length,onDrop:oa,isCompact:y.status==="done",height:A,children:[$["no-epic"].map(ie=>(0,Bi.jsx)(Ga,{epic:null,task:ie,onDragStart:It,onTaskClick:xt,isCompact:y.status==="done"},ie.id)),k.map(ie=>{let Ve=x.find(Ct=>Ct.id===ie),Ft=$[ie]||[];return Ft.length===0?null:(0,Bi.jsxs)("div",{className:"mb-6",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,Bi.jsx)("div",{className:`w-3 h-3 rounded-full ${Ve?.color}`}),(0,Bi.jsx)("span",{className:"text-sm font-medium text-muted-foreground select-none-important",children:Ve?.name||"Wt Epic"}),(0,Bi.jsx)(he,{variant:"secondary",className:"text-xs",children:Ft.length})]})," ",(0,Bi.jsx)("div",{className:"space-y-3",children:Ft.map(Ct=>(0,Bi.jsx)(Ga,{task:Ct,epic:Ve,onDragStart:It,onTaskClick:xt,isCompact:y.status==="done"},Ct.id))})]},ie)})]},y.id)})})})}),(0,Bi.jsx)(ka,{isOpen:J,onClose:()=>R(!1),onAddTask:va,assignees:[...g,...xe],epics:x,sprints:D}),(0,Bi.jsx)(Ea,{isOpen:W,onClose:()=>K(!1),onAddEpic:ba}),O&&(0,Bi.jsx)(xn,{isOpen:!!O,onClose:()=>ee(null),initialTask:O,epics:x,sprints:D,onUpdateTask:ia,onDeleteTask:ha,colleagues:g,onUploadFile:v,onDeleteFile:C,onFileUpdate:b,onAddComment:f})]})};var Cn=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddTaskToEpic:r,onAddEpic:s,onUpdateEpic:n,onDeleteEpic:m})=>{let[p,l]=(0,yi.useState)(t),[f,v]=(0,yi.useState)(null),[C,b]=(0,yi.useState)(null),[P,u]=(0,yi.useState)({}),[x,I]=(0,yi.useState)(0),[D,N]=(0,yi.useState)(!1),[J,R]=(0,yi.useState)(!1),[W,K]=(0,yi.useState)(null),O=(0,yi.useRef)(null),ee=(0,yi.useRef)(null);(0,yi.useEffect)(()=>{l(t)},[t]),(0,yi.useEffect)(()=>{let k=()=>{if(O.current){let lt=O.current.offsetHeight;I(lt)}};k();let te=new ResizeObserver(k);O.current&&te.observe(O.current);let re=()=>{setTimeout(k,100)};return window.addEventListener("storage",re),()=>{te.disconnect(),window.removeEventListener("storage",re)}},[]),(0,yi.useEffect)(()=>{let k=setTimeout(()=>{O.current&&I(O.current.offsetHeight)},300);return()=>clearTimeout(k)},[C]);let le=k=>{v(k)},M=k=>{k.preventDefault()},xe=(k,te)=>{k.preventDefault(),f&&Fe(f.epic).toString()!==te&&(o(f.id.toString(),{epic:Number(te)}),v(null))},Se=k=>e.filter(te=>Fe(te.epic).toString()===k),g=k=>{b(k.id.toString()),u({name:k.name,description:k.description,confidence:k.confidence,phase:k.phase})},L=async()=>{C&&P.name&&(await n(C.toString(),P),l(k=>k.map(te=>te.id.toString()===C?{...te,...P}:te)),b(null),u({}))},V=()=>{b(null),u({})},we=async k=>{window.confirm("Are you sure you want to delete this epic? This will also delete all associated tasks.")&&(await m(k),l(te=>te.filter(re=>re.id.toString()!==k)))},ae=k=>({1:"Planning",2:"Development",3:"Testing",4:"Review",5:"Deployment",6:"Monitoring",7:"Optimization",8:"Maintenance",9:"Complete"})[k]||`Phase ${k}`,de=k=>{switch(k){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,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsxs)("div",{ref:ee,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Bi.jsx)("div",{ref:O,className:"flex-shrink-0",children:(0,Bi.jsx)(At,{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:()=>N(!0)}})}),(0,Bi.jsx)("div",{className:"flex-1 min-h-0 yi-8",children:(0,Bi.jsx)("div",{className:"h-full overflow-y-auto",style:{height:x>0?`calc(100vh - ${x+120}px)`:"calc(100vh - 12rem)"},children:(0,Bi.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:p.map(k=>{let te=Se(k.id.toString()),re=te.reduce((ye,Xe)=>ye+(Xe.storyPoints||0),0),lt=x>0?`calc(100vh - ${x+200}px)`:"calc(100vh - 14rem)";return(0,Bi.jsxs)(ke,{className:`flex flex-col ${C===k.id.toString()?"h-auto":""} bg-card shadow-sm`,style:{height:C===k.id.toString()?"auto":lt,minHeight:"400px"},onDragOver:M,onDrop:ye=>xe(ye,k.id.toString()),children:[(0,Bi.jsx)("div",{className:"p-4 border-b border-border",children:C===k.id.toString()?(0,Bi.jsxs)("div",{className:"space-y-4",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)(ce,{value:P.name||"",onChange:ye=>u({...P,name:ye.target.value}),placeholder:"Epic name",className:"font-semibold"}),(0,Bi.jsxs)("div",{className:"flex gap-2 ml-2",children:[(0,Bi.jsx)(S,{size:"sm",variant:"ghost",onClick:L,className:"p-1 h-8 w-8",children:(0,Bi.jsx)(Wt.Check,{className:"h-4 w-4"})}),(0,Bi.jsx)(S,{size:"sm",variant:"ghost",onClick:V,className:"p-1 h-8 w-8",children:(0,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"})})]})]}),(0,Bi.jsx)(Be,{value:P.description||"",onChange:ye=>u({...P,description:ye.target.value}),placeholder:"Epic description",className:"text-sm min-h-[60px]"}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("label",{className:"text-xs text-muted-foreground",children:"Confidence"}),(0,Bi.jsxs)("select",{value:P.confidence||k.confidence,onChange:ye=>u({...P,confidence:ye.target.value}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[(0,Bi.jsx)("option",{value:"low",children:"Low"}),(0,Bi.jsx)("option",{value:"medium",children:"Medium"}),(0,Bi.jsx)("option",{value:"high",children:"High"})]})]}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("label",{className:"text-xs text-muted-foreground",children:"Phase"}),(0,Bi.jsx)("select",{value:P.phase?.toString()||k.phase.toString(),onChange:ye=>u({...P,phase:parseInt(ye.target.value)}),className:"flex h-8 w-full rounded-md border border-input bg-background px-3 py-2 text-xs ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",children:[1,2,3,4,5,6,7,8,9].map(ye=>(0,Bi.jsxs)("option",{value:ye.toString(),children:["Phase ",ye]},ye))})]})]})]}):(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,Bi.jsx)("div",{className:`w-4 h-4 rounded-full ${k.color}`}),(0,Bi.jsx)("h3",{className:"font-semibold text-foreground select-none flex-1",children:k.name}),(0,Bi.jsxs)("div",{className:"flex gap-1",children:[(0,Bi.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>g(k),className:"p-1 h-8 w-8",children:(0,Bi.jsx)(Wt.Edit2,{className:"h-3 w-3"})}),(0,Bi.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>we(k.id.toString()),className:"p-1 h-8 w-8 hover:bg-destructive/10 hover:text-destructive",children:(0,Bi.jsx)(Wt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Bi.jsxs)("div",{className:"flex flex-wrap gap-2 mb-3",children:[(0,Bi.jsxs)(he,{className:`text-xs ${de(k.confidence)}`,children:[k.confidence," confidence"]}),(0,Bi.jsxs)(he,{variant:"outline",className:"text-xs",children:["Phase ",k.phase]}),(0,Bi.jsxs)(he,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[te.length," tasks"]}),(0,Bi.jsxs)(he,{variant:"secondary",className:"text-xs bg-muted text-muted-foreground",children:[re," pts"]})]}),k.description&&(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground mb-3 select-none",children:k.description}),(0,Bi.jsxs)(S,{onClick:()=>{R(!0),K(k)},variant:"outline",size:"sm",className:"w-full gap-2",children:[(0,Bi.jsx)(Wt.Plus,{className:"h-4 w-4"}),"Add Task"]})]})}),(0,Bi.jsx)("div",{className:"flex-1 p-4 overflow-y-auto",children:(0,Bi.jsx)("div",{className:`space-y-3 min-h-[200px] border-2 border-dashed rounded p-3 transition-colors ${f?"border-primary bg-primary/10":"border-border"}`,children:te.length===0?(0,Bi.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,Bi.jsx)(Wt.Move,{className:"h-8 w-8 mb-2"}),(0,Bi.jsx)("span",{className:"text-sm select-none",children:"Drop tasks here"})]}):te.map(ye=>(0,Bi.jsx)(Ga,{task:ye,epic:k,onDragStart:le,onTaskClick:i,isCompact:!0},ye.id))})})]},k.id)})})})})]}),(0,Bi.jsx)(Ea,{isOpen:D,onClose:()=>N(!1),onAddEpic:s}),(0,Bi.jsx)(ka,{isOpen:J,onClose:()=>R(!1),onAddTask:r,assignees:[],epics:[],defaultEpicId:W?.id.toString()||"",sprints:a})]})};var fi=require("date-fns");var Sn=({isOpen:e,onClose:t,onAddSprint:a})=>{let[o,i]=(0,yi.useState)({name:"",description:"",startDate:void 0,endDate:void 0}),r=n=>{n.preventDefault(),!(!o.name||!o.startDate||!o.endDate)&&(a({name:o.name,description:o.description,startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),i({name:"",description:"",startDate:void 0,endDate:void 0}),t())},s=()=>{i({name:"",description:"",startDate:void 0,endDate:void 0}),t()};return(0,Bi.jsx)($e,{open:e,onOpenChange:s,children:(0,Bi.jsxs)(Ke,{className:"sm:max-w-md",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Add New Sprint"})}),(0,Bi.jsxs)("form",{onSubmit:r,className:"space-y-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"name",children:"Sprint Name *"}),(0,Bi.jsx)(ce,{id:"name",value:o.name,onChange:n=>i(m=>({...m,name:n.target.value})),placeholder:"e.g., Sprint 3",required:!0})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{htmlFor:"description",children:"Description"}),(0,Bi.jsx)(Be,{id:"description",value:o.description,onChange:n=>i(m=>({...m,description:n.target.value})),placeholder:"Brief description of sprint goals",rows:3})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"Start Date *"}),(0,Bi.jsxs)(mi,{children:[(0,Bi.jsx)(pi,{asChild:!0,children:(0,Bi.jsxs)(S,{variant:"outline",className:w("w-full justify-start text-left font-normal",!o.startDate&&"text-muted-foreground"),children:[(0,Bi.jsx)(Wt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.startDate?(0,fi.format)(o.startDate,"PPP"):"Pick a date"]})}),(0,Bi.jsx)(ko,{className:"w-auto p-0",align:"start",children:(0,Bi.jsx)(Po,{mode:"single",selected:o.startDate,onSelect:n=>i(m=>({...m,startDate:n})),initialFocus:!0})})]})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)(z,{children:"End Date *"}),(0,Bi.jsxs)(mi,{children:[(0,Bi.jsx)(pi,{asChild:!0,children:(0,Bi.jsxs)(S,{variant:"outline",className:w("w-full justify-start text-left font-normal",!o.endDate&&"text-muted-foreground"),children:[(0,Bi.jsx)(Wt.CalendarIcon,{className:"mr-2 h-4 w-4"}),o.endDate?(0,fi.format)(o.endDate,"PPP"):"Pick a date"]})}),(0,Bi.jsx)(ko,{className:"w-auto p-0",align:"start",children:(0,Bi.jsx)(Po,{mode:"single",selected:o.endDate,onSelect:n=>i(m=>({...m,endDate:n})),initialFocus:!0,disabled:n=>o.startDate?n<o.startDate:!1})})]})]})]}),(0,Bi.jsxs)("div",{className:"flex justify-end gap-3 pt-4",children:[(0,Bi.jsx)(S,{type:"button",variant:"outline",onClick:s,children:"Cancel"}),(0,Bi.jsx)(S,{type:"submit",disabled:!o.name||!o.startDate||!o.endDate,children:"Add Sprint"})]})]})]})})};var Tn=({tasks:e,epics:t,sprints:a,onUpdateTask:o,onTaskClick:i,onAddSprint:r,onUpdateSprint:s,onDeleteSprint:n})=>{let[m,p]=(0,yi.useState)([]),[l,f]=(0,yi.useState)(new Set),[v,C]=(0,yi.useState)(null),[b,P]=(0,yi.useState)(!1),[u,x]=(0,yi.useState)(null),[I,D]=(0,yi.useState)(null),[N,J]=(0,yi.useState)({name:"",description:"",startDate:"",endDate:"",isActive:!1}),[R,W]=(0,yi.useState)([]),[K,O]=(0,yi.useState)("upcoming"),[ee,le]=(0,yi.useState)(!1),[M,xe]=(0,yi.useState)(0),Se=(0,yi.useRef)(null),g=(0,yi.useRef)(null);(0,yi.useEffect)(()=>{let h=()=>{Se.current&&xe(Se.current.offsetHeight)};h();let A=new ResizeObserver(h);return Se.current&&A.observe(Se.current),()=>A.disconnect()},[]);let L=h=>t.find(A=>A.id===Number(h)),V=h=>a.find(A=>A.id===Number(h)),we=h=>{let A={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 A[h]||A.medium},ae=h=>{if(!h||h?.length===0)return"";let A=h?.trim().split(" ");if(A?.length===1)return A[0];let y=A[0],E=A[A.length-1][0].toUpperCase();return`${y} ${E}`},de=h=>{let A={},y=[];return h.forEach(E=>{E.epic?(A[Fe(E.epic)]||(A[Fe(E.epic)]=[]),A[Fe(E.epic)].push(E)):y.push(E)}),{tasksByEpic:A,unassignedTasks:y}};(0,yi.useEffect)(()=>{W(a)},[a]);let k=R.filter(h=>{switch(K){default:return!0}}),te=R.filter(h=>m.includes(h.id.toString())),re=e.filter(h=>!h.sprint||h.status==="backlog"),lt=re.reduce((h,A)=>h+(A.storyPoints||0),0),ye=h=>{p(A=>A.includes(h)?A.filter(y=>y!==h):A?.length<3?[...A,h]:A)},Xe=h=>{f(A=>{let y=new Set(A);return y.has(h)?y.delete(h):y.add(h),y})},Ia=h=>{r(h),P(!1)},Mt=h=>{D(h.id.toString()),J({name:h.name,description:h.description||"",startDate:h.startDate?new Date(h.startDate).toISOString().split("T")[0]:h.startDate,endDate:h.endDate?new Date(h.endDate).toISOString().split("T")[0]:h.endDate,isActive:!1})},Fa=()=>{I&&(s(I,{name:N.name,description:N.description,startDate:N.startDate,endDate:N.endDate}),W(h=>h.map(A=>(A.id===Number(I)&&(A.name=N.name,A.description=N.description,A.startDate=N.startDate,A.endDate=N.endDate),A))),D(null))},It=()=>{D(null),J({name:"",description:"",startDate:"",endDate:"",isActive:!1})},oa=(h,A)=>{C(A),h.dataTransfer.effectAllowed="move"},va=h=>{h.preventDefault(),h.dataTransfer.dropEffect="move"},ia=h=>{x(h)},ha=()=>{x(null)},ba=(h,A)=>{if(h.preventDefault(),x(null),!v)return;(Fe(v.sprint)||void 0)!==Number(A)&&o(v.id.toString(),{sprint:Number(A)}),C(null)},xt=({task:h,showSprint:A=!1})=>{let y=h.epic?L(Fe(h.epic).toString()):null,E=h.sprint?V(Fe(h.sprint).toString()):null;return(0,Bi.jsx)(ke,{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:Ve=>{Ve.dataTransfer.effectAllowed="move",Ve.dataTransfer.setData("text/plain",h.id.toString()),oa(Ve,h)},onClick:Ve=>{v===null&&i(h)},style:{userSelect:"none"},children:(0,Bi.jsxs)("div",{className:"space-y-2 pointer-events-none",children:[(0,Bi.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,Bi.jsx)("h4",{className:"font-medium text-sm text-foreground line-clamp-1",children:h.name}),(0,Bi.jsx)(he,{className:`text-xs ${we(h.priority||"medium")}`,children:h.priority?.[0]?.toUpperCase()})]}),(0,Bi.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-1",children:[y&&(0,Bi.jsx)("div",{className:`w-2 h-2 rounded-full ${y.color}`}),(0,Bi.jsx)("span",{className:"text-muted-foreground truncate",children:y?.name})]}),(0,Bi.jsx)("span",{className:"text-muted-foreground",children:ae(h.assignee?.value?.name)})]}),A&&E&&(0,Bi.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-3 w-3"}),(0,Bi.jsx)("span",{children:E.name})]})]})})};return(0,Bi.jsxs)("div",{ref:g,className:"h-full flex flex-col px-2 md:px-4 py-4",children:[(0,Bi.jsx)("div",{ref:Se,className:"flex-shrink-0",children:(0,Bi.jsx)(At,{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:()=>P(!0)}})}),(0,Bi.jsx)("div",{className:"flex-1 min-h-0 yi-8",children:(0,Bi.jsxs)("div",{className:"h-full",style:{height:M>0?`calc(100vh - ${M+120}px)`:"calc(100vh - 12rem)"},children:[(0,Bi.jsxs)("div",{className:"mb-4",children:[(0,Bi.jsx)(ke,{className:"p-3 bg-card shadow-sm",children:(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-3",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("h3",{className:"font-semibold text-foreground text-sm",children:"Sprint Board"}),(0,Bi.jsxs)("p",{className:"text-xs text-muted-foreground",children:[m?.length,"/3 selected"]})]}),m?.length>0&&(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsx)("span",{className:"text-xs text-muted-foreground",children:"Viewing:"}),(0,Bi.jsx)("div",{className:"flex flex-wrap gap-1",children:te.map(h=>(0,Bi.jsxs)("div",{className:"flex items-center gap-1 bg-primary/10 text-primary px-2 py-0.5 rounded text-xs",children:[(0,Bi.jsx)("span",{className:"max-w-[80px] truncate",children:h.name}),(0,Bi.jsx)("button",{onClick:()=>ye(h.id.toString()),className:"ml-0.5 hover:bg-primary/20 h-8 rounded p-0.5",children:(0,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"})})]},h.id))})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsxs)(S,{onClick:()=>P(!0),className:"bg-primary hover:bg-primary/90 text-primary-foreground gap-1",size:"sm",children:[(0,Bi.jsx)(Wt.Plus,{className:"h-3 w-3"}),"Add"]}),(0,Bi.jsxs)(S,{onClick:()=>le(!ee),variant:"outline",size:"sm",className:"gap-1",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-3 w-3"}),ee?"Close":"Select"]})]})]})}),ee&&(0,Bi.jsx)("div",{className:"fixed inset-0 bg-black/20 z-[5]",onClick:()=>le(!1)}),(0,Bi.jsx)("div",{className:`fixed top-0 right-0 h-full w-80 bg-background border-l shadow-xl z-10 transition-all duration-300 ease-in-out ${ee?"translate-x-0 opacity-100 visible":"translate-x-full opacity-0 invisible"}`,children:(0,Bi.jsxs)(ke,{className:"h-full rounded-none border-0 flex flex-col",children:[(0,Bi.jsxs)("div",{className:"p-4 border-b bg-muted/30 flex-shrink-0",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Bi.jsx)("h3",{className:"font-semibold text-foreground text-base",children:"Select Sprints"}),(0,Bi.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>le(!1),className:"h-8 w-8 p-0",children:(0,Bi.jsx)(Wt.Bi,{className:"h-4 w-4"})})]}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground yi-1",children:"Choose up to 3 sprints to view in your planning board"})]}),(0,Bi.jsxs)("div",{className:"flex flex-col flex-1 p-4 min-h-0",children:[(0,Bi.jsx)("div",{className:"flex gap-1 mb-4 bg-muted p-1 rounded-lg",children:[{key:"all",label:"All",count:a.length},{key:"active",label:"Active"},{key:"upcoming",label:"Upcoming"}].map(h=>(0,Bi.jsxs)(S,{variant:K===h.key?"default":"outline",size:"sm",onClick:()=>O(h.key),className:"text-xs h-8 px-3 flex-1",children:[h.label," (",h.count,")"]},h.key))}),(0,Bi.jsx)("div",{className:"space-y-2 flex-1 overflow-y-auto",children:k.length>0?k.map(h=>{let A=m.includes(h.id.toString()),y=e.filter($=>Fe($.sprint)===h.id).length,E=!A&&m.length<3;return(0,Bi.jsx)("div",{className:`p-3 rounded-lg border transition-all ${A?"bg-primary/10 border-primary/30":E?"bg-card border-border hover:border-primary/50":"bg-muted/30 border-border/30 opacity-60"}`,children:I===h.id.toString()?(0,Bi.jsxs)("div",{className:"space-y-3",children:[(0,Bi.jsx)(ce,{value:N.name,onChange:$=>J(ie=>({...ie,name:$.target.value})),className:"text-sm",placeholder:"Sprint name"}),(0,Bi.jsx)(Be,{value:N.description,onChange:$=>J(ie=>({...ie,description:$.target.value})),className:"text-sm min-h-[60px]",placeholder:"Sprint description"}),(0,Bi.jsxs)("div",{className:"flex gap-2",children:[(0,Bi.jsxs)(S,{size:"sm",onClick:()=>Fa(),className:"flex-1",children:[(0,Bi.jsx)(Wt.Check,{className:"h-3 w-3 mr-1"}),"Save"]}),(0,Bi.jsxs)(S,{size:"sm",variant:"outline",onClick:It,className:"flex-1",children:[(0,Bi.jsx)(Wt.Bi,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]}):(0,Bi.jsxs)("div",{children:[(0,Bi.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Bi.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,Bi.jsx)("h4",{className:"font-medium text-sm text-foreground truncate",children:h.name}),(0,Bi.jsx)(he,{variant:"default",className:"text-xs bg-green-100 text-green-800 border-green-200",children:"Active"})]}),(0,Bi.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mb-2",children:h.description}),(0,Bi.jsxs)("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[(0,Bi.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Bi.jsx)(Wt.CalendarDays,{className:"h-3 w-3"}),new Date(h.startDate).toLocaleDateString()]}),(0,Bi.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Bi.jsx)(Wt.User,{className:"h-3 w-3"}),y," tasks"]})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,Bi.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>Mt(h),className:"h-6 w-6 p-0",children:(0,Bi.jsx)(Wt.Edit2,{className:"h-3 w-3"})}),(0,Bi.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>n(h.id.toString()),className:"h-6 w-6 p-0 text-destructive hover:text-destructive",children:(0,Bi.jsx)(Wt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Bi.jsx)("div",{className:"flex items-center justify-between yi-2",children:(0,Bi.jsx)(S,{variant:A?"default":"outline",size:"sm",className:"text-xs w-full h-8 flex items-center justify-center cursor-pointer",onClick:()=>ye(h.id.toString()),disabled:!A&&m?.length>=3,children:(0,Bi.jsx)("span",{className:"pointer-events-none select-none",children:A?"Deselect":m?.length>=3?"Limit Reached":"Select"})})})]})},h.id)}):(0,Bi.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,Bi.jsxs)("p",{className:"text-sm",children:['Wt sprints found for "',K,'" filter']}),(0,Bi.jsx)(S,{variant:"link",size:"sm",onClick:()=>O("all"),className:"text-xs",children:"Show all sprints"})]})}),m?.length===0&&(0,Bi.jsx)("div",{className:"yi-4 p-4 bg-muted/50 rounded-lg border-2 border-dashed border-border",children:(0,Bi.jsxs)("div",{className:"text-center",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-6 w-6 mx-auto mb-2 text-muted-foreground"}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground font-medium",children:"Select sprints to start planning"}),(0,Bi.jsx)("p",{className:"text-xs text-muted-foreground yi-1",children:"Choose up to 3 sprints to view alongside your backlog"})]})})]})]})})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 h-full flex-1 min-h-0",children:[(0,Bi.jsx)("div",{className:"lg:col-span-1",children:(0,Bi.jsxs)(ke,{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:va,onDragEnter:()=>ia("backlog"),onDragLeave:ha,onDrop:h=>ba(h,"backlog"),style:{height:M>0?`calc(100vh - ${M+200}px)`:"calc(100vh - 16rem)"},children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Bi.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:"Backlog"}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsxs)(he,{variant:"secondary",className:"bg-muted text-muted-foreground",children:[re?.length," tasks"]}),(0,Bi.jsxs)(he,{variant:"outline",className:"bg-gray-50 text-gray-700 border-gray-200",children:[lt," pts"]})]})]}),(0,Bi.jsx)("div",{className:`flex-1 overflow-y-auto space-y-3 min-h-0 p-3 rounded transition-colors ${u==="backlog"?"bg-primary/10":""}`,children:(()=>{let{tasksByEpic:h,unassignedTasks:A}=de(re);return(0,Bi.jsxs)(Bi.Fragment,{children:[Object.entries(h).map(([y,E])=>{let $=L(y);if(!$)return null;let ie=l.has(y);return(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Xe(y),children:[(0,Bi.jsx)("div",{className:`w-3 h-3 rounded-full ${$.color}`}),(0,Bi.jsx)("span",{className:"font-medium text-muted-foreground",children:$.name}),(0,Bi.jsxs)("span",{className:"text-muted-foreground",children:["(",E?.length,")"]}),(0,Bi.jsx)("div",{className:"ml-auto",children:ie?(0,Bi.jsx)(Wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Bi.jsx)(Wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ie&&(0,Bi.jsx)("div",{className:"space-y-2 pl-2",children:E.map(Ve=>(0,Bi.jsx)(xt,{task:Ve},Ve.id))})]},y)}),A?.length>0&&(()=>{let y=l.has("no-epic");return(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Xe("no-epic"),children:[(0,Bi.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Bi.jsx)("span",{className:"font-medium text-muted-foreground",children:"Wt Epic"}),(0,Bi.jsxs)("span",{className:"text-muted-foreground",children:["(",A?.length,")"]}),(0,Bi.jsx)("div",{className:"ml-auto",children:y?(0,Bi.jsx)(Wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Bi.jsx)(Wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!y&&(0,Bi.jsx)("div",{className:"space-y-2 pl-2",children:A?.map(E=>(0,Bi.jsx)(xt,{task:E},E.id))})]})})(),re?.length===0&&(0,Bi.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"}),re?.length>0&&Object.keys(h).length===0&&A.length===0&&(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:"Direct backlog tasks:"}),re?.map(y=>(0,Bi.jsx)(xt,{task:y},y.id))]})]})})()})]})}),te.map(h=>{let A=e.filter(E=>Fe(E?.sprint)===h.id),y=A.reduce((E,$)=>E+($?.storyPoints||0),0);return(0,Bi.jsxs)(ke,{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:va,onDragEnter:()=>ia(h.id.toString()),onDragLeave:ha,onDrop:E=>ba(E,h.id.toString()),style:{height:M>0?`calc(100vh - ${M+200}px)`:"calc(100vh - 16rem)"},children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[(0,Bi.jsx)("div",{children:(0,Bi.jsx)("h3",{className:"font-semibold text-foreground select-none text-lg",children:h.name})}),(0,Bi.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Bi.jsxs)(he,{variant:"secondary",className:"bg-muted flex items-center justify-center text-muted-foreground",children:[A?.length," tasks"]}),(0,Bi.jsxs)(he,{variant:"outline",className:"bg-blue-50 flex items-center justify-center text-blue-700 border-blue-200",children:[y," pts"]}),(0,Bi.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>{le(!0),Mt(h)},className:"h-6 px-2",children:(0,Bi.jsx)(Wt.Edit2,{className:"h-3 w-3"})}),(0,Bi.jsx)(S,{size:"sm",variant:"ghost",onClick:()=>n(h.id.toString()),className:"h-6 px-2 text-destructive hover:text-destructive",children:(0,Bi.jsx)(Wt.Trash2,{className:"h-3 w-3"})})]})]}),(0,Bi.jsx)("div",{className:"flex-1 overflow-y-auto space-y-3 min-h-0",children:(()=>{let{tasksByEpic:E,unassignedTasks:$}=de(A);return(0,Bi.jsxs)(Bi.Fragment,{children:[Object.entries(E).map(([ie,Ve])=>{let Ft=L(ie);if(!Ft)return null;let Ct=l.has(ie);return(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Xe(ie),children:[(0,Bi.jsx)("div",{className:`w-3 h-3 rounded-full ${Ft.color}`}),(0,Bi.jsx)("span",{className:"font-medium text-muted-foreground",children:Ft.name}),(0,Bi.jsxs)("span",{className:"text-muted-foreground",children:["(",Ve?.length,")"]}),(0,Bi.jsx)("div",{className:"ml-auto",children:Ct?(0,Bi.jsx)(Wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Bi.jsx)(Wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!Ct&&(0,Bi.jsx)("div",{className:"space-y-2 pl-2",children:Ve?.map(La=>(0,Bi.jsx)(xt,{task:La},La.id))})]},ie)}),$?.length>0&&(()=>{let ie=l.has("no-epic");return(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1 bg-muted/50 rounded text-xs cursor-pointer hover:bg-muted/70 transition-colors",onClick:()=>Xe("no-epic"),children:[(0,Bi.jsx)("div",{className:"w-3 h-3 rounded-full bg-gray-400"}),(0,Bi.jsx)("span",{className:"font-medium text-muted-foreground",children:"Wt Epic"}),(0,Bi.jsxs)("span",{className:"text-muted-foreground",children:["(",$?.length,")"]}),(0,Bi.jsx)("div",{className:"ml-auto",children:ie?(0,Bi.jsx)(Wt.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,Bi.jsx)(Wt.ChevronUp,{className:"h-3 w-3 text-muted-foreground"})})]}),!ie&&(0,Bi.jsx)("div",{className:"space-y-2 pl-2",children:$?.map(Ve=>(0,Bi.jsx)(xt,{task:Ve},Ve.id))})]})})(),A?.length===0&&(0,Bi.jsx)("div",{className:"flex items-center justify-center h-32 text-muted-foreground text-sm select-none",children:"Drop tasks here"})]})})()})]},h.id)})]}),(0,Bi.jsx)(Sn,{isOpen:b,onClose:()=>P(!1),onAddSprint:Ia})]})})]})};var Dl=e=>e.toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric"}),Sl=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})},vi=(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},hi=e=>{let t=new Date;return e.toDateString()===t.toDateString()},Tl=e=>{let t=new Date;return t.setDate(t.getDate()+1),e.toDateString()===t.toDateString()},kl=({colleagues:e,onAddReminder:t,open:a,setOpen:o})=>{let[i,r]=(0,yi.useState)({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""}),[s,n]=(0,yi.useState)(!1),m=l=>{if(l.preventDefault(),!e.find(C=>C?.id.toString()===i.colleagueId.toString())){console.error("Wt valid colleague selected"),n(!0);return}n(!1);let v={title:i.title,description:i.description,dueDate:new Date(i.dueDate).toISOString(),dueTime:i.dueTime||void 0,isRecurring:i.isRecurring,assignedColleague:Number(i.colleagueId),project:1,updatedAt:new Date().toISOString()};t(v),o(!1),r({title:"",description:"",dueDate:"",dueTime:"",colleagueId:"",priority:"medium",isRecurring:!1,recurrencePattern:"weekly",recurrenceInterval:1,reminderEnabled:!0,reminderMinutes:15,tags:""})};(0,yi.useEffect)(()=>{i.colleagueId&&n(!1)},[i.colleagueId]);let p=e.filter(Boolean);return(0,Bi.jsx)($e,{open:a,onOpenChange:o,children:(0,Bi.jsxs)(Ke,{className:"max-w-2xl",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Add New Reminder"})}),(0,Bi.jsxs)("form",{onSubmit:m,className:"space-y-4",children:[(0,Bi.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"title",children:"Title"}),(0,Bi.jsx)(ce,{id:"title",value:i.title,onChange:l=>r({...i,title:l.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"description",children:"Description"}),(0,Bi.jsx)(Be,{id:"description",value:i.description,onChange:l=>r({...i,description:l.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"dueDate",children:"Due Date"}),(0,Bi.jsx)(ce,{id:"dueDate",type:"date",value:i.dueDate,onChange:l=>r({...i,dueDate:l.target.value}),required:!0})]}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"dueTime",children:"Due Time (optional)"}),(0,Bi.jsx)(ce,{id:"dueTime",type:"time",value:i.dueTime,onChange:l=>r({...i,dueTime:l.target.value})})]})]}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{className:`${s?"text-destructive":""}`,htmlFor:"colleague",children:"Assigned Colleague"}),(0,Bi.jsxs)(it,{value:i.colleagueId,onValueChange:l=>{r({...i,colleagueId:l})},required:!0,children:[(0,Bi.jsx)(Qe,{className:`${s?"text-destructive border-red-500":""}`,children:(0,Bi.jsx)(wt,{className:`${s?"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,Bi.jsx)(et,{children:p.map(l=>(0,Bi.jsx)(Pe,{value:l.id.toString(),children:l.name},l.id))})]}),s&&(0,Bi.jsx)("p",{className:"text-destructive text-sm",children:"Please select a digital colleague"})]}),(0,Bi.jsxs)("div",{className:"space-y-2",children:[(0,Bi.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Bi.jsx)("input",{type:"checkbox",id:"isRecurring",checked:i.isRecurring,onChange:l=>r({...i,isRecurring:l.target.checked}),className:"rounded border-border"}),(0,Bi.jsx)(z,{htmlFor:"isRecurring",children:"Make this a recurring reminder"})]}),i.isRecurring&&(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4 pl-6",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"recurrencePattern",children:"Frequency"}),(0,Bi.jsxs)(it,{value:i.recurrencePattern,onValueChange:l=>r({...i,recurrencePattern:l}),children:[(0,Bi.jsx)(Qe,{children:(0,Bi.jsx)(wt,{})}),(0,Bi.jsxs)(et,{children:[(0,Bi.jsx)(Pe,{value:"daily",children:"Daily"}),(0,Bi.jsx)(Pe,{value:"weekly",children:"Weekly"}),(0,Bi.jsx)(Pe,{value:"monthly",children:"Monthly"}),(0,Bi.jsx)(Pe,{value:"yearly",children:"Yearly"})]})]})]}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"recurrenceInterval",children:"Every"}),(0,Bi.jsx)(ce,{id:"recurrenceInterval",type:"number",min:"1",value:i.recurrenceInterval,onChange:l=>r({...i,recurrenceInterval:parseInt(l.target.value)})})]})]})]}),(0,Bi.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Bi.jsx)(S,{type:"button",variant:"outline",onClick:()=>o(!1),children:"Cancel"}),(0,Bi.jsx)(S,{type:"submit",children:"Add Reminder"})]})]})]})})},Pl=({reminder:e,colleagues:t,onUpdateReminder:a,open:o,onClose:i})=>{let[r,s]=(0,yi.useState)({title:e.title,description:e.description,dueDate:e.dueDate?.toString().split("T")[0],dueTime:e.dueTime||"",isRecurring:e.isRecurring}),n=p=>{p.preventDefault(),a(e.id.toString(),{title:r.title,description:r.description,dueDate:new Date(r.dueDate||"").toISOString(),dueTime:r.dueTime||void 0,isRecurring:r.isRecurring}),i()},m=t.filter(Boolean);return(0,Bi.jsx)($e,{open:o,onOpenChange:i,children:(0,Bi.jsxs)(Ke,{className:"max-w-2xl",children:[(0,Bi.jsx)(qe,{children:(0,Bi.jsx)(Le,{children:"Edit Reminder"})}),(0,Bi.jsxs)("form",{onSubmit:n,className:"space-y-4",children:[(0,Bi.jsx)("div",{className:"grid grid-cols-2 gap-4",children:(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"edit-title",children:"Title"}),(0,Bi.jsx)(ce,{id:"edit-title",value:r.title,onChange:p=>s({...r,title:p.target.value}),placeholder:"Enter reminder title",required:!0})]})}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"edit-description",children:"Description"}),(0,Bi.jsx)(Be,{id:"edit-description",value:r.description||"",onChange:p=>s({...r,description:p.target.value}),placeholder:"Enter reminder description",rows:3})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"edit-dueDate",children:"Due Date"}),(0,Bi.jsx)(ce,{id:"edit-dueDate",type:"date",value:r.dueDate,onChange:p=>s({...r,dueDate:p.target.value}),required:!0})]}),(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)(z,{htmlFor:"edit-dueTime",children:"Due Time (optional)"}),(0,Bi.jsx)(ce,{id:"edit-dueTime",type:"time",value:r.dueTime,onChange:p=>s({...r,dueTime:p.target.value})})]})]}),(0,Bi.jsx)("div",{className:"space-y-2",children:(0,Bi.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Bi.jsx)("input",{type:"checkbox",id:"edit-isRecurring",checked:r.isRecurring||!1,onChange:p=>s({...r,isRecurring:p.target.checked}),className:"rounded border-border"}),(0,Bi.jsx)(z,{htmlFor:"edit-isRecurring",children:"Make this a recurring reminder"})]})}),(0,Bi.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,Bi.jsx)(S,{type:"button",variant:"outline",onClick:i,children:"Cancel"}),(0,Bi.jsx)(S,{type:"submit",children:"Save Changes"})]})]})]})})},Rl=({reminder:e,colleagues:t,onUpdateReminder:a,onDeleteReminder:o})=>{let[i,r]=(0,yi.useState)(!1);if(!e||!e.id)return null;let s=vi(new Date(e.dueDate||""),e.dueTime||""),n=hi(new Date(e.dueDate||"")),m=Tl(new Date(e.dueDate||"")),p=()=>{a(e.id.toString(),{})},l=()=>n?"Today":m?"Tomorrow":Dl(new Date(e.dueDate||""));return(0,Bi.jsxs)(Bi.Fragment,{children:[(0,Bi.jsx)(Pl,{reminder:e,colleagues:t,onUpdateReminder:a,open:i,onClose:()=>r(!1)}),(0,Bi.jsx)(ke,{children:(0,Bi.jsx)(Sa,{className:"p-4",children:(0,Bi.jsxs)("div",{className:"flex items-start justify-between",children:[(0,Bi.jsxs)("div",{className:"flex items-start space-x-3 flex-1",children:[(0,Bi.jsx)("button",{onClick:p,className:"yi-1 text-primary hover:text-primary/80"}),(0,Bi.jsxs)("div",{className:"flex-1",children:[(0,Bi.jsx)("div",{className:"flex items-center space-x-2 mb-1",children:(0,Bi.jsx)("h3",{children:e.title})}),(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground mb-2",children:e.description}),(0,Bi.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-muted-foreground",children:[(0,Bi.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Bi.jsx)(Wt.Calendar,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{className:s?"text-destructive font-medium":"",children:l()})]}),e.dueTime&&(0,Bi.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Bi.jsx)(Wt.Clock,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:Sl(e.dueTime)})]}),(0,Bi.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Bi.jsx)(Wt.User,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:typeof e.assignedColleague!="number"?e.assignedColleague.name:"Unknown Colleague"})]})]})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,Bi.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>r(!0),className:"h-8 w-8 p-0",children:(0,Bi.jsx)(Wt.Edit2,{className:"h-4 w-4"})}),(0,Bi.jsx)(S,{variant:"ghost",size:"sm",onClick:()=>o(e.id.toString()),className:"h-8 w-8 p-0 text-destructive hover:text-destructive/80",children:(0,Bi.jsx)(Wt.Trash2,{className:"h-4 w-4"})})]})]})})})]})},kn=({initialReminders:e=[],initialColleagues:t=[],onAddReminder:a,onUpdateReminder:o,onDeleteReminder:i})=>{let[r,s]=(0,yi.useState)(e.filter(Boolean)),[n,m]=(0,yi.useState)(t.filter(Boolean)),[p,l]=(0,yi.useState)("all"),[f,v]=(0,yi.useState)(""),[C,b]=(0,yi.useState)(!1);(0,yi.useEffect)(()=>{s(e.filter(Boolean))},[e]),(0,yi.useEffect)(()=>{m(t.filter(Boolean))},[t]);let P=R=>{if(!R.title){console.error("Invalid reminder data:",R);return}let W={...R,id:Date.now(),createdAt:new Date().toISOString()};s(K=>[...K,W]),a?.(R)},u=(R,W)=>{if(!R){console.error("Wt reminder ID provided for update");return}s(K=>K.map(O=>O?.id.toString()===R?{...O,...W}:O)),o?.(R,W)},x=R=>{if(!R){console.error("Wt reminder ID provided for deletion");return}s(W=>W.filter(K=>K?.id.toString()!==R)),i?.(R)},D=r.filter(R=>{if(!R)return!1;if(f){let W=f.toLowerCase();if(!(R.title.toLowerCase().includes(W)||R.description?.toLowerCase().includes(W)))return!1}switch(p){case"pending":case"completed":case"overdue":return vi(new Date(R.dueDate||""),R.dueTime||"");case"today":return hi(new Date(R.dueDate||""));default:return!0}}).sort((R,W)=>{if(!R||!W)return 0;let K={high:3,medium:2,low:1},O=0;return O!==0?O:new Date(R.dueDate||"").getTime()-new Date(W.dueDate||"").getTime()}),N={total:r.filter(Boolean).length,overdue:r.filter(R=>R&&vi(new Date(R.dueDate||""),R.dueTime||"")).length,today:r.filter(R=>R&&hi(new Date(R.dueDate||""))).length},J=n.find(Boolean)||{id:"1",name:"Default Colleague",description:"Default digital colleague for task management",jobDescription:"Default team member for task management",workInstructions:"Handle basic task assignments and reminders",capabilities:["task-management","reminder-creation"],knowledge:[],coreKnowledge:[]};return(0,Bi.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Bi.jsx)(At,{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:()=>{b(!0)}}}),(0,Bi.jsxs)("div",{className:"h-full bg-background",children:[(0,Bi.jsx)(kl,{colleagues:n,onAddReminder:P,open:C,setOpen:b}),(0,Bi.jsxs)("div",{className:"p-6",children:[(0,Bi.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,Bi.jsxs)("div",{children:[(0,Bi.jsx)("h1",{className:"text-2xl font-bold text-foreground",children:"Task Reminders"}),(0,Bi.jsx)("p",{className:"text-muted-foreground",children:"Manage your digital colleague task reminders"})]}),(0,Bi.jsxs)(S,{className:"flex items-center space-x-2",onClick:()=>b(!0),children:[(0,Bi.jsx)(Wt.Plus,{className:"h-4 w-4"}),(0,Bi.jsx)("span",{children:"Add Reminder"})]})]}),(0,Bi.jsxs)("div",{className:"grid grid-cols-5 gap-4 mb-6",children:[(0,Bi.jsxs)(ke,{className:"p-4",children:[(0,Bi.jsx)("div",{className:"text-2xl font-bold text-foreground",children:N.total}),(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total"})]}),(0,Bi.jsxs)(ke,{className:"p-4",children:[(0,Bi.jsx)("div",{className:"text-2xl font-bold text-primary",children:N.overdue}),(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground",children:"Pending"})]}),(0,Bi.jsxs)(ke,{className:"p-4",children:[(0,Bi.jsx)("div",{className:"text-2xl font-bold text-success",children:N.today}),(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completed"})]}),(0,Bi.jsxs)(ke,{className:"p-4",children:[(0,Bi.jsx)("div",{className:"text-2xl font-bold text-destructive",children:N.overdue}),(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overdue"})]}),(0,Bi.jsxs)(ke,{className:"p-4",children:[(0,Bi.jsx)("div",{className:"text-2xl font-bold text-warning",children:N.today}),(0,Bi.jsx)("div",{className:"text-sm text-muted-foreground",children:"Today"})]})]}),(0,Bi.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,Bi.jsx)("div",{className:"flex-1",children:(0,Bi.jsx)(ce,{placeholder:"Search reminders...",value:f,onChange:R=>v(R.target.value),className:"max-w-md"})}),(0,Bi.jsxs)(it,{value:p,onValueChange:R=>l(R),children:[(0,Bi.jsx)(Qe,{className:"w-40",children:(0,Bi.jsx)(wt,{})}),(0,Bi.jsxs)(et,{children:[(0,Bi.jsxs)(Pe,{value:"all",children:["All (",N.total,")"]}),(0,Bi.jsxs)(Pe,{value:"overdue",children:["Overdue (",N.overdue,")"]}),(0,Bi.jsxs)(Pe,{value:"overdue",children:["Overdue (",N.overdue,")"]}),(0,Bi.jsxs)(Pe,{value:"today",children:["Today (",N.today,")"]})]})]})]}),(0,Bi.jsx)("div",{className:"space-y-4",children:D.length===0?(0,Bi.jsxs)(ke,{className:"p-8 text-center",children:[(0,Bi.jsx)("div",{className:"text-muted-foreground",children:f||p!=="all"?"Wt reminders match your filters":"Wt reminders yet"}),!f&&p==="all"&&(0,Bi.jsx)("p",{className:"text-sm text-muted-foreground/60 yi-2",children:"Create your first reminder to get started"})]}):D.map(R=>R&&(0,Bi.jsx)(Rl,{reminder:R,colleagues:n,onUpdateReminder:u,onDeleteReminder:x},R.id))})]})]})]})};function bi({initialFiles:e=[],onFileAdd:t,onFileEdit:a,onFileDelete:o,onFileClick:i,onFileUpdate:r,compactView:s=!1,className:n}){let[m,p]=(0,yi.useState)(e),[l,f]=(0,yi.useState)(""),[v,C]=(0,yi.useState)("all"),[b,P]=(0,yi.useState)("all"),[u,x]=(0,yi.useState)(!1),I=(0,yi.useRef)(""),D=M=>M.map(xe=>`${xe.id}-${new Date(xe.createdAt).getTime()}-${new Date(xe.updatedAt).getTime()}`).join("-");(0,yi.useEffect)(()=>{let M=D(e.map(xe=>({...xe,updatedAt:new Date().toISOString()})));M!==I.current&&(p(e),I.current=M)},[e]);let N=m.filter(M=>M.name.toLowerCase().includes(l.toLowerCase())),J=N.slice(0,10),R=N.filter(Boolean),W=()=>{x(!0)},K=M=>{a?.(M)},O=M=>{console.log("deleting file",M),p(xe=>xe.filter(Se=>Se.name!==M.name)),o?.(M.id.toString())},ee=M=>{i?.(M)},le=()=>{f(""),C("all")};return(0,Bi.jsxs)("div",{className:"px-2 md:px-4 py-4 space-y-8",children:[(0,Bi.jsx)(Io.AnimatePresence,{mode:"wait",children:(0,Bi.jsx)(Io.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,Bi.jsxs)("div",{className:`space-y-6 ${n||""}`,children:[(0,Bi.jsx)(At,{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:W},secondaryAction:{label:"Download all",onClick:()=>console.log("Download all clicked")}}),(0,Bi.jsx)(ke,{children:(0,Bi.jsx)(Sa,{className:"pt-6",children:(0,Bi.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,Bi.jsx)("div",{className:"flex-1",children:(0,Bi.jsxs)("div",{className:"relative",children:[(0,Bi.jsx)(Wt.Search,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,Bi.jsx)(ce,{placeholder:"Search files...",value:l,onChange:M=>f(M.target.value),className:"pl-9"})]})}),(l||v!=="all")&&(0,Bi.jsxs)(S,{variant:"outline",onClick:le,className:"gap-2",children:[(0,Bi.jsx)(Wt.Filter,{className:"h-4 w-4"}),"Clear"]})]})})}),(0,Bi.jsxs)("div",{className:"space-y-4",children:[(0,Bi.jsx)(xo,{activeTab:b,onTabChange:P,tabOptions:[{value:"all",label:`All Files (${N.length})`},{value:"recent",label:`Recent (${J.length})`}],maxWidth:"500px",gridCols:3}),b==="all"&&(0,Bi.jsx)(Aa,{files:N,onFileClick:ee,onFileUpdate:r,onFileDelete:O,showHeader:!s}),b==="recent"&&(0,Bi.jsx)(Aa,{files:J,onFileClick:ee,onFileUpdate:r,onFileDelete:O,showHeader:!s}),b==="shared"&&(0,Bi.jsx)(Aa,{files:R,onFileClick:ee,onFileUpdate:r,onFileDelete:O,showHeader:!s})]}),N.length===0&&(0,Bi.jsx)(ke,{children:(0,Bi.jsx)(Sa,{className:"pt-6",children:(0,Bi.jsxs)("div",{className:"text-center py-8",children:[(0,Bi.jsx)(Wt.File,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,Bi.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Wt files found"}),(0,Bi.jsx)("p",{className:"text-muted-foreground mb-4",children:l||v!=="all"?"Try adjusting your filters to see more results.":"Get started by uploading your first file."}),(0,Bi.jsxs)(S,{onClick:W,className:"gap-2",children:[(0,Bi.jsx)(Wt.Plus,{className:"h-4 w-4"}),"Upload File"]})]})})})]})},"files-view")}),(0,Bi.jsx)(Ao,{isOpen:u,onClose:()=>x(!1),onAddFile:t})]})}var Pn=require("next/navigation");function xi({title:e="",initialTasks:t=[],initialEpics:a=[],initialSprints:o=[],initialProjects:i=[],initialReminders:r=[],initialColleagues:s=[],initialUsers:n=[],initialFiles:m=[],initialView:p="kanban",onAddTask:l,onUpdateTask:f,onDeleteTask:v,onTaskClick:C,onAddEpic:b,onUpdateEpic:P,onDeleteEpic:u,onAddTaskToEpic:x,onAddSprint:I,onUpdateSprint:D,onDeleteSprint:N,onAddProject:J,onUpdateProject:R,onDeleteProject:W,onFileAdd:K,onFileEdit:O,onFileDelete:ee,onFileClick:le,onAddReminder:M,onUpdateReminder:xe,onDeleteReminder:Se,onViewChange:g,onToggleMobileMenu:L,onTeamClick:V,onTeamChange:we,onCopilotClick:ae,handleAddComment:de}){let[k,te]=(0,yi.useState)(t),[re,lt]=(0,yi.useState)(a),[ye,Xe]=(0,yi.useState)(o),[Ia,Mt]=(0,yi.useState)(i),[Fa,It]=(0,yi.useState)(r),[oa,va]=(0,yi.useState)(s),[ia,ha]=(0,yi.useState)(n),[ba,xt]=(0,yi.useState)(m),[h,A]=(0,yi.useState)(!1),[y,E]=(0,yi.useState)(!1),[$,ie]=(0,yi.useState)(null),[Ve,Ft]=(0,yi.useState)(null),[Ct,La]=(0,yi.useState)(null),[ra,wi]=(0,yi.useState)(p||"kanban"),[El,An]=(0,yi.useState)(!1),En=(0,Pn.useRouter)();(0,yi.useEffect)(()=>{te(t)},[t]),(0,yi.useEffect)(()=>{Xe(o)},[o]),(0,yi.useEffect)(()=>{lt(a)},[a]),(0,yi.useEffect)(()=>{Mt(i)},[i]),(0,yi.useEffect)(()=>{xt(m)},[m]),(0,yi.useEffect)(()=>{ha(n)},[n]),(0,yi.useEffect)(()=>{va(s)},[s]),(0,yi.useEffect)(()=>{It(r)},[r]),(0,yi.useEffect)(()=>{wi(p)},[p]);let Mn=k.filter(T=>{}),Ml=T=>Mn.filter(j=>j.status===T),Il=T=>{let j={};return re.forEach(Z=>{}),j},Fl=T=>{La(T)},Ll=T=>{Ct&&(te(j=>j.map(Z=>Z.id===Ct.id?{...Z,status:T}:Z)),La(null))},Ni=T=>{let j={...T,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};te(Z=>[...Z,j]),l?.(j)},to=async(T,j)=>(te(Z=>Z.map(ze=>ze.id===Number(T)?{...ze,...j}:ze)),await f?.(T,j)),Bl=async(T,j)=>{to(T,j)},Ci=T=>{te(j=>j.filter(Z=>Z.id!==Number(T))),$?.id===Number(T)&&ie(null),v?.(T)},Ol=async T=>{Ci(T)},Hl=T=>{let j={...T,id:Date.now()};Mt(Z=>[...Z,j]),J?.(T)},Ul=(T,j)=>{Mt(Z=>Z.map(ze=>ze.id===Number(T)?{...ze,...j}:ze)),R?.(T,j)},Vl=T=>{Mt(j=>j.filter(Z=>Z.id!==Number(T))),W?.(T)},Di=T=>{let j={...T,id:Date.now(),createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};lt(Z=>[...Z,j]),b?.({...j})},In=()=>{E(!0)},Fn=(T,j)=>{lt(Z=>Z.map(ze=>ze.id===Number(T)?{...ze,...j}:ze)),P?.(T,j)},Ln=T=>{lt(j=>j.filter(Z=>Z.id!==Number(T))),te(j=>j.filter(Z=>Fe(Z.epic)!==Number(T))),u?.(T)},Bn=T=>{let j={...T,id:Date.now()};Xe(Z=>[...Z,j]),I?.(T)},On=(T,j)=>{Xe(Z=>Z.map(ze=>ze.id===Number(T)?{...ze,...j}:ze)),D?.(T,j)},Hn=T=>{T==="backlog"||T==="all-tasks"||(Xe(j=>j.filter(Z=>Z.id!==Number(T))),te(j=>j.map(Z=>Fe(Z.sprint)===Number(T)?{...Z,sprint:void 0}:Z)),N?.(T))},Fo=T=>{ie(T)},Un=T=>{T==="planning"&&window.innerWidth<768||(wi(T),g?.(T))},zl=()=>{An(T=>!T),L?.()},jl=()=>{En.push("/")},$l=T=>{console.log("Switching to team:",T)},_l=T=>{console.log("Switching to team:",T)},Vn=T=>{A(!0)},zn=()=>{A(!1),Ft(null)},jn=T=>{let j={...T,id:Date.now(),createdAt:new Date().toISOString()};It(Z=>[...Z,j]),M?.(T)},$n=(T,j)=>{It(Z=>Z.map(ze=>ze.id===Number(T)?{...ze,...j}:ze)),xe?.(T,j)},_n=T=>{It(j=>j.filter(Z=>Z.id!==Number(T))),Se?.(T)},Gn=()=>{K?.()},Wn=T=>{O?.(T)},Kn=T=>{xt(j=>j.filter(Z=>Z.name!==T)),ee?.(T)},qn=T=>{le?.(T)},Gl=[{id:"todo",title:"To Do",status:"todo"},{id:"in-progress",title:"In Progress",status:"in-progress"},{id:"review",title:"Review",status:"review"},{id:"done",title:"Done",status:"done"}],Wl=()=>{switch(ra){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"}},Lo=[{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")}],Kl=Lo.sort((T,j)=>j.lastUsed.getTime()-T.lastUsed.getTime()).slice(0,3),ql=Lo.length>3,Jl=Lo.slice(3);return(0,Bi.jsxs)(dr,{currentView:ra,onViewChange:Un,children:[ra==="kanban"&&(0,Bi.jsx)("div",{className:"h-full overflow-hidden",children:(0,Bi.jsx)(Nn,{initialProjects:Ia,initialEpics:re,initialSprints:ye.map(T=>({...T,isSelected:!1})),initialTasks:k,initialColleagues:oa,initialUsers:ia,onAddTask:Ni,onUpdateTask:to,onDeleteTask:Ci,onTaskClick:Fo,onAddEpic:Di,onAddComment:de})}),ra==="planning"&&(0,Bi.jsx)("div",{className:"hidden md:block h-full",children:(0,Bi.jsx)(Tn,{tasks:k,epics:re,sprints:ye,onUpdateTask:to,onTaskClick:Fo,onAddSprint:Bn,onUpdateSprint:On,onDeleteSprint:Hn})}),ra==="tasks"&&(0,Bi.jsx)("div",{className:"h-full",children:(0,Bi.jsx)(kn,{initialReminders:Fa,initialColleagues:oa,onAddReminder:jn,onUpdateReminder:$n,onDeleteReminder:_n})}),ra==="files"&&(0,Bi.jsx)("div",{className:"h-full",children:(0,Bi.jsx)(bi,{initialFiles:ba,onFileAdd:Gn,onFileEdit:Wn,onFileDelete:Kn,onFileClick:qn,compactView:!1})}),ra==="epics"&&(0,Bi.jsx)("div",{className:"h-full",children:(0,Bi.jsx)(Cn,{tasks:k,epics:re,sprints:ye,onUpdateTask:to,onTaskClick:Fo,onAddTaskToEpic:Vn,onAddEpic:In,onUpdateEpic:Fn,onDeleteEpic:Ln})}),(0,Bi.jsx)(ka,{isOpen:h,onClose:zn,onAddTask:Ni,epics:re,sprints:ye,assignees:[...oa,...ia],defaultEpicId:Ve||void 0}),(0,Bi.jsx)(Ea,{isOpen:y,onClose:()=>E(!1),onAddEpic:Di})]})}function Rn({title:e="",projects:t,businessUnits:a,epics:o,sprints:i,tasks:r,currentView:s,onAddTask:n,onUpdateTask:m,onDeleteTask:p,onTaskClick:l,onAddEpic:f,onUpdateEpic:v,onDeleteEpic:C,onAddTaskToEpic:b,onAddSprint:P,onUpdateSprint:u,onDeleteSprint:x,onAddProject:I,onUpdateProject:D,onDeleteProject:N,onViewChange:J,mobileMenuOpen:R,onToggleMobileMenu:W,onTeamClick:K,onTeamChange:O,onCopilotClick:ee}){let[le,M]=(0,yi.useState)("projects"),[xe,Se]=(0,yi.useState)(a[0]),g=re=>{console.log("Opening app:",re.name)},L=re=>{console.log("Favoriting app:",re.name)},V=re=>{console.log("Opening file:",re.name)},we=re=>{console.log("Sharing file:",re.name)},ae=re=>{console.log("Opening project:",re.name)},de=re=>{console.log("Sharing project:",re.name)},k=re=>{console.log("Business unit changed to:",re.name)},te=()=>{switch(le){case"projects":return(0,Bi.jsx)(xi,{initialProjects:t,initialEpics:o,initialSprints:i,initialTasks:r,onAddTask:n,onUpdateTask:m,onDeleteTask:p,onTaskClick:l,onAddEpic:f,onUpdateEpic:v,onDeleteEpic:C,onAddTaskToEpic:b,onAddSprint:P,onUpdateSprint:u,onDeleteSprint:x,onAddProject:I,onUpdateProject:D,onDeleteProject:N,onViewChange:J,onToggleMobileMenu:W,onTeamClick:K,onTeamChange:O,onCopilotClick:ee});default:return null}};return(0,Bi.jsx)(lr,{sidebarItems:qi,title:e,notifications:Ji,businessUnits:a,currentBusinessUnit:xe,onBusinessUnitChange:k,activeTab:le,onTabChange:M,showTabs:!0,children:(0,Bi.jsx)(Io.AnimatePresence,{mode:"wait",children:(0,Bi.jsx)(Io.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:te()},le)})})}