cortex-react-components 2.0.4 → 2.0.6

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 (211) hide show
  1. package/dist/{chunk-VRE6VCHX.mjs → chunk-2BR55L74.mjs} +1 -1
  2. package/dist/{chunk-EZEZEBLI.mjs → chunk-2EC6ZHJE.mjs} +1 -1
  3. package/dist/chunk-2VR4KIQL.mjs +4 -0
  4. package/dist/{chunk-UCHNFFXQ.mjs → chunk-4FOM4XM6.mjs} +1 -1
  5. package/dist/{chunk-QTILVWJA.mjs → chunk-4RYG24IZ.mjs} +1 -1
  6. package/dist/{chunk-546LLRCZ.mjs → chunk-5JQAH3EN.mjs} +1 -1
  7. package/dist/{chunk-ABGNIQRP.mjs → chunk-5RDLHKTK.mjs} +1 -1
  8. package/dist/{chunk-JXFCIH2E.mjs → chunk-7WTM3LJ4.mjs} +1 -1
  9. package/dist/{chunk-VIPT3OVD.mjs → chunk-AHJIHY2A.mjs} +1 -1
  10. package/dist/{chunk-WG6ATCG3.mjs → chunk-AWMFKQHJ.mjs} +1 -1
  11. package/dist/{chunk-IV5HRCWW.mjs → chunk-BDDEMCAH.mjs} +1 -1
  12. package/dist/{chunk-TK4JC5PG.mjs → chunk-E64KWNOT.mjs} +1 -1
  13. package/dist/{chunk-LG2AWHTC.mjs → chunk-EB2UGKCE.mjs} +1 -1
  14. package/dist/{chunk-KEOMDWUC.mjs → chunk-EHSOO47V.mjs} +1 -1
  15. package/dist/{chunk-4ZEATBUU.mjs → chunk-ERURPIHS.mjs} +1 -1
  16. package/dist/{chunk-PEOZPVWF.mjs → chunk-FATHLUEL.mjs} +1 -1
  17. package/dist/{chunk-TCXAETN2.mjs → chunk-FHJ4MHLT.mjs} +1 -1
  18. package/dist/{chunk-7SPSOAIQ.mjs → chunk-GEFCIPUN.mjs} +1 -1
  19. package/dist/{chunk-MXFCHKIK.mjs → chunk-GGXCPUR2.mjs} +1 -1
  20. package/dist/{chunk-OCYVZBS7.mjs → chunk-GWAEXG22.mjs} +1 -1
  21. package/dist/{chunk-FOISWNF5.mjs → chunk-HHYHENVF.mjs} +1 -1
  22. package/dist/{chunk-EW64VNFT.mjs → chunk-HKM6FA5J.mjs} +1 -1
  23. package/dist/{chunk-F4UGWCXY.mjs → chunk-IQQ7ZWCP.mjs} +1 -1
  24. package/dist/{chunk-IDG2O4B7.mjs → chunk-ISBVFNWD.mjs} +1 -1
  25. package/dist/chunk-JHSHXYPK.mjs +4 -0
  26. package/dist/{chunk-DA2H3N3G.mjs → chunk-L3SSJ5A3.mjs} +1 -1
  27. package/dist/chunk-L7W3JS7W.mjs +1 -0
  28. package/dist/{chunk-CVLUVZR3.mjs → chunk-LLED3RQS.mjs} +1 -1
  29. package/dist/chunk-LUPNE23E.mjs +1 -0
  30. package/dist/{chunk-RK2CAIEF.mjs → chunk-M527EJIX.mjs} +1 -1
  31. package/dist/{chunk-TO2UDP5T.mjs → chunk-MMOATE43.mjs} +1 -1
  32. package/dist/{chunk-CK2TFJB2.mjs → chunk-N2336R53.mjs} +1 -1
  33. package/dist/{chunk-IPXOPQPI.mjs → chunk-NC7WGIM5.mjs} +1 -1
  34. package/dist/{chunk-SNZ5BAQQ.mjs → chunk-NHFCO6RG.mjs} +1 -1
  35. package/dist/{chunk-OB5WMODY.mjs → chunk-O3ORC6HS.mjs} +1 -1
  36. package/dist/{chunk-CAKJOTEE.mjs → chunk-OEFXIEY3.mjs} +1 -1
  37. package/dist/{chunk-TWGRQW4P.mjs → chunk-OJZQH57M.mjs} +1 -1
  38. package/dist/chunk-PA4ZBJDO.mjs +1 -0
  39. package/dist/chunk-PE3RX2EM.mjs +4 -0
  40. package/dist/{chunk-ZFUP5NVF.mjs → chunk-PXLSH6S2.mjs} +1 -1
  41. package/dist/{chunk-P6VHSIQK.mjs → chunk-RMIGFWKK.mjs} +1 -1
  42. package/dist/chunk-SWA5TRPZ.mjs +4 -0
  43. package/dist/{chunk-6UADPSC5.mjs → chunk-TEL4MSNV.mjs} +1 -1
  44. package/dist/{chunk-4VWCJYTN.mjs → chunk-UENDC4U4.mjs} +1 -1
  45. package/dist/{chunk-2JBVESQ2.mjs → chunk-WOSN4OLA.mjs} +1 -1
  46. package/dist/{chunk-77YVLEKT.mjs → chunk-WYHDFQVL.mjs} +1 -1
  47. package/dist/{chunk-UZSBX5GO.mjs → chunk-X3JZSN3W.mjs} +1 -1
  48. package/dist/{chunk-GTK2SGS5.mjs → chunk-XBCYPOFD.mjs} +1 -1
  49. package/dist/{chunk-BA53AOCS.mjs → chunk-XEZD3D7C.mjs} +1 -1
  50. package/dist/{chunk-VNYUNZ3M.mjs → chunk-XGIYNUGC.mjs} +1 -1
  51. package/dist/{chunk-RAGDUV7M.mjs → chunk-XIGBDWYI.mjs} +1 -1
  52. package/dist/{chunk-XR55FO72.mjs → chunk-Y7XREGJN.mjs} +1 -1
  53. package/dist/components/AdvancedComponents/index.mjs +1 -1
  54. package/dist/components/AdvancedComponents/sidebar.js +1 -1
  55. package/dist/components/AdvancedComponents/sidebar.mjs +3 -1
  56. package/dist/components/Blocks/Banner.mjs +1 -1
  57. package/dist/components/Blocks/CallToAction.mjs +1 -1
  58. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  59. package/dist/components/Blocks/Content.mjs +1 -1
  60. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  61. package/dist/components/Blocks/ImageBlock.mjs +1 -1
  62. package/dist/components/Blocks/MediaBlock.mjs +1 -1
  63. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  64. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  65. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  66. package/dist/components/Blocks/index.mjs +1 -1
  67. package/dist/components/CRM/CogeBoard.mjs +1 -1
  68. package/dist/components/CRM/DealDetails.mjs +1 -1
  69. package/dist/components/CRM/KanbanBoard.mjs +1 -1
  70. package/dist/components/CRM/NewDealForm.mjs +1 -1
  71. package/dist/components/CRM/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/CAPABILITIES_README.js +12 -5
  76. package/dist/components/Chat/CAPABILITIES_README.mjs +12 -5
  77. package/dist/components/Chat/{EnhancedChatInterface.d.ts → ChatInterface.d.ts} +4 -6
  78. package/dist/components/Chat/ChatInterface.js +5 -0
  79. package/dist/components/Chat/ChatInterface.mjs +1 -0
  80. package/dist/components/Chat/CopilotInterface.d.ts +31 -86
  81. package/dist/components/Chat/CopilotInterface.js +1 -1
  82. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  83. package/dist/components/Chat/README-AI-Integration.js +140 -0
  84. package/dist/components/Chat/README-AI-Integration.mjs +140 -0
  85. package/dist/components/Chat/chat-session-sidebar.d.ts +0 -2
  86. package/dist/components/Chat/chat-session-sidebar.js +1 -1
  87. package/dist/components/Chat/chat-session-sidebar.mjs +1 -1
  88. package/dist/components/Chat/demo.d.ts +7 -0
  89. package/dist/components/Chat/demo.js +5 -0
  90. package/dist/components/Chat/demo.mjs +1 -0
  91. package/dist/components/Chat/example-usage.d.ts +39 -0
  92. package/dist/components/Chat/example-usage.js +5 -0
  93. package/dist/components/Chat/example-usage.mjs +1 -0
  94. package/dist/components/Chat/example-with-vercel-ai.d.ts +43 -0
  95. package/dist/components/Chat/example-with-vercel-ai.js +5 -0
  96. package/dist/components/Chat/example-with-vercel-ai.mjs +2 -0
  97. package/dist/components/Chat/index.d.ts +2 -0
  98. package/dist/components/Chat/index.js +2 -2
  99. package/dist/components/Chat/index.mjs +1 -1
  100. package/dist/components/Chat/types.d.ts +16 -0
  101. package/dist/components/Chat/types.js +1 -0
  102. package/dist/components/Chat/types.mjs +1 -0
  103. package/dist/components/DigitalColleagues/AppSidebarLeft.mjs +1 -1
  104. package/dist/components/DigitalColleagues/DigitalColleageusLayout.d.ts +2 -1
  105. package/dist/components/DigitalColleagues/DigitalColleageusLayout.js +1 -1
  106. package/dist/components/DigitalColleagues/DigitalColleageusLayout.mjs +1 -1
  107. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  108. package/dist/components/DigitalColleagues/ManagementSidebar.mjs +1 -1
  109. package/dist/components/DigitalColleagues/Pages/dashboardpage.js +1 -1
  110. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  111. package/dist/components/DigitalColleagues/Views/ColleaguesView.mjs +1 -1
  112. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  113. package/dist/components/DigitalColleagues/colleague-form.mjs +1 -1
  114. package/dist/components/DigitalColleagues/sidebar-favorites-readme.js +228 -0
  115. package/dist/components/DigitalColleagues/sidebar-favorites-readme.mjs +228 -0
  116. package/dist/components/DigitalColleagues/sidebar-new.css +1 -0
  117. package/dist/components/{dc-temp/sidebar.d.ts → DigitalColleagues/sidebar-new.d.ts} +3 -2
  118. package/dist/components/DigitalColleagues/sidebar-new.js +5 -0
  119. package/dist/components/DigitalColleagues/sidebar-new.mjs +4 -0
  120. package/dist/components/DigitalColleagues/sidebar.css +1 -0
  121. package/dist/components/DigitalColleagues/sidebar.d.ts +17 -0
  122. package/dist/components/DigitalColleagues/sidebar.js +5 -0
  123. package/dist/components/DigitalColleagues/sidebar.mjs +2 -0
  124. package/dist/components/DigitalColleagues/test-data.js +1 -1
  125. package/dist/components/DigitalColleagues/test-data.mjs +1 -1
  126. package/dist/components/DigitalColleagues/types.d.ts +3 -0
  127. package/dist/components/DigitalColleagues/types.js +1 -1
  128. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  129. package/dist/components/HeaderFooter/enhanced-header.css +1 -0
  130. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  131. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  132. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  133. package/dist/components/Heros/PostHero/index.mjs +1 -1
  134. package/dist/components/Heros/RenderHero.mjs +1 -1
  135. package/dist/components/Heros/index.mjs +1 -1
  136. package/dist/components/Holidays/HolidayTracker.mjs +1 -1
  137. package/dist/components/Holidays/index.mjs +1 -1
  138. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  139. package/dist/components/Layouts/Print.mjs +1 -1
  140. package/dist/components/Layouts/SlideShow.mjs +1 -1
  141. package/dist/components/Layouts/index.mjs +1 -1
  142. package/dist/components/Menus/SidebarLeft.mjs +1 -1
  143. package/dist/components/Menus/SidebarRight.mjs +1 -1
  144. package/dist/components/Menus/index.mjs +1 -1
  145. package/dist/components/Payload/Card/index.mjs +1 -1
  146. package/dist/components/Payload/CollectionArchive/index.mjs +1 -1
  147. package/dist/components/Payload/Media/index.mjs +1 -1
  148. package/dist/components/Payload/RichText/index.mjs +1 -1
  149. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  150. package/dist/components/Payload/index.mjs +1 -1
  151. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  152. package/dist/components/Projects/ProjectPage.js +1 -1
  153. package/dist/components/Projects/ProjectPage.mjs +1 -1
  154. package/dist/components/Projects/ProjectView.mjs +1 -1
  155. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  156. package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
  157. package/dist/components/dc-temp/dashboard-integration-example.mjs +1 -1
  158. package/dist/components/dc-temp/index.mjs +1 -1
  159. package/dist/components/dc-temp/knowledge-search.mjs +1 -1
  160. package/dist/components/index.js +11 -11
  161. package/dist/components/index.mjs +1 -1
  162. package/dist/components/ui/index.mjs +1 -1
  163. package/dist/components/ui/sidebar.mjs +1 -1
  164. package/dist/globals.css +1 -1
  165. package/dist/index.js +15 -15
  166. package/dist/index.mjs +1 -1
  167. package/dist/metafile-cjs.json +1 -1
  168. package/dist/metafile-esm.json +1 -1
  169. package/dist/pages/Blog.mjs +1 -1
  170. package/dist/pages/Documentation.mjs +1 -1
  171. package/dist/pages/IndexPage.mjs +1 -1
  172. package/dist/pages/Intranet.mjs +1 -1
  173. package/dist/pages/LandingPage.mjs +1 -1
  174. package/dist/pages/Page.mjs +1 -1
  175. package/dist/pages/Publish.mjs +1 -1
  176. package/dist/pages/Website.mjs +1 -1
  177. package/dist/sections/AboutSection.mjs +1 -1
  178. package/dist/sections/BlogDetail.mjs +1 -1
  179. package/dist/sections/BlogList.mjs +1 -1
  180. package/dist/sections/BlogListSection.mjs +1 -1
  181. package/dist/sections/ContactSection.mjs +1 -1
  182. package/dist/sections/PageSections.mjs +1 -1
  183. package/dist/sections/PricingSection.mjs +1 -1
  184. package/dist/sections/ServiceDetail.mjs +1 -1
  185. package/dist/sections/ServiceDetailSection.mjs +1 -1
  186. package/dist/sections/ServiceSection.mjs +1 -1
  187. package/dist/sections/index.mjs +1 -1
  188. package/dist/test-useChat-api.d.ts +1 -0
  189. package/dist/test-useChat-api.js +1 -0
  190. package/dist/test-useChat-api.mjs +1 -0
  191. package/package.json +6 -2
  192. package/dist/chunk-5Z5PL7N3.mjs +0 -1
  193. package/dist/chunk-DLUWDQSW.mjs +0 -4
  194. package/dist/chunk-R7LPCFUJ.mjs +0 -4
  195. package/dist/chunk-TO7KJNKC.mjs +0 -4
  196. package/dist/chunk-WBJENB4Y.mjs +0 -4
  197. package/dist/components/.archive/ai-chat-interface.d.ts +0 -70
  198. package/dist/components/Chat/EnhancedChatInterface.js +0 -5
  199. package/dist/components/Chat/EnhancedChatInterface.mjs +0 -4
  200. package/dist/components/Chat/ai-chat-interface.d.ts +0 -70
  201. package/dist/components/Chat/ai-chat-interface.js +0 -5
  202. package/dist/components/Chat/ai-chat-interface.mjs +0 -4
  203. package/dist/components/dc-temp/sidebar.js +0 -5
  204. package/dist/components/dc-temp/sidebar.mjs +0 -4
  205. /package/dist/components/Chat/{EnhancedChatInterface.css → ChatInterface.css} +0 -0
  206. /package/dist/components/Chat/{ai-chat-interface.css → demo.css} +0 -0
  207. /package/dist/components/{dc-temp/enhanced-header.css → Chat/example-usage.css} +0 -0
  208. /package/dist/components/{dc-temp/sidebar.css → Chat/example-with-vercel-ai.css} +0 -0
  209. /package/dist/components/{dc-temp → HeaderFooter}/enhanced-header.d.ts +0 -0
  210. /package/dist/components/{dc-temp → HeaderFooter}/enhanced-header.js +0 -0
  211. /package/dist/components/{dc-temp → HeaderFooter}/enhanced-header.mjs +0 -0
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  "use client"
4
4
 
5
- "use strict";var Fa=Object.create;var it=Object.defineProperty;var Ha=Object.getOwnPropertyDescriptor;var $a=Object.getOwnPropertyNames;var Oa=Object.getPrototypeOf,Ga=Object.prototype.hasOwnProperty;var Va=(e,t)=>{for(var a in t)it(e,a,{get:t[a],enumerable:!0})},Vt=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $a(t))!Ga.call(e,s)&&s!==a&&it(e,s,{get:()=>t[s],enumerable:!(o=Ha(t,s))||o.enumerable});return e};var Y=(e,t,a)=>(a=e!=null?Fa(Oa(e)):{},Vt(t||!e||!e.__esModule?it(a,"default",{value:e,enumerable:!0}):a,e)),Wa=e=>Vt(it({},"__esModule",{value:!0}),e);var qo={};Va(qo,{CapabilityMenu:()=>Gt,ChatCardArtefact:()=>Lo,ChatCardTask:()=>Mt,ChatInterfaceMessages:()=>Mo,ChatMessage:()=>Rt,CopilotInterface:()=>_o,defaultColorScheme:()=>Bt,findCapabilityByPath:()=>Ro,getAllCapabilities:()=>Bo,getCapabilityByTeam:()=>Io,getContextualActions:()=>Lt,testCapabilities:()=>Ee});module.exports=Wa(qo);var na=Y(require("react"));var nt=Y(require("react")),ye=Y(require("@radix-ui/react-avatar"));var Zt=require("clsx");var At="-",Ka=e=>{let t=qa(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:r=>{let i=r.split(At);return i[0]===""&&i.length!==1&&i.shift(),_t(i,t)||_a(r)},getConflictingClassGroupIds:(r,i)=>{let f=a[r]||[];return i&&o[r]?[...f,...o[r]]:f}}},_t=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),s=o?_t(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;let n=e.join(At);return t.validators.find(({validator:r})=>r(n))?.classGroupId},Wt=/^\[(.+)\]$/,_a=e=>{if(Wt.test(e)){let t=Wt.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},qa=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Xa(Object.entries(e.classGroups),a).forEach(([n,r])=>{St(r,o,n,t)}),o},St=(e,t,a,o)=>{e.forEach(s=>{if(typeof s=="string"){let n=s===""?t:Kt(t,s);n.classGroupId=a;return}if(typeof s=="function"){if(Ja(s)){St(s(o),t,a,o);return}t.validators.push({validator:s,classGroupId:a});return}Object.entries(s).forEach(([n,r])=>{St(r,Kt(t,n),a,o)})})},Kt=(e,t)=>{let a=e;return t.split(At).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},Ja=e=>e.isThemeGetter,Xa=(e,t)=>t?e.map(([a,o])=>{let s=o.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([r,i])=>[t+r,i])):n);return[a,s]}):e,Qa=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,s=(n,r)=>{a.set(n,r),t++,t>e&&(t=0,o=a,a=new Map)};return{get(n){let r=a.get(n);if(r!==void 0)return r;if((r=o.get(n))!==void 0)return s(n,r),r},set(n,r){a.has(n)?a.set(n,r):s(n,r)}}},qt="!",Ya=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,s=t[0],n=t.length,r=i=>{let f=[],d=0,b=0,u;for(let p=0;p<i.length;p++){let h=i[p];if(d===0){if(h===s&&(o||i.slice(p,p+n)===t)){f.push(i.slice(b,p)),b=p+n;continue}if(h==="/"){u=p;continue}}h==="["?d++:h==="]"&&d--}let P=f.length===0?i:i.substring(b),R=P.startsWith(qt),I=R?P.substring(1):P,g=u&&u>b?u-b:void 0;return{modifiers:f,hasImportantModifier:R,baseClassName:I,maybePostfixModifierPosition:g}};return a?i=>a({className:i,parseClassName:r}):r},Za=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},eo=e=>({cache:Qa(e.cacheSize),parseClassName:Ya(e),...Ka(e)}),to=/\s+/,ao=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:s}=t,n=[],r=e.trim().split(to),i="";for(let f=r.length-1;f>=0;f-=1){let d=r[f],{modifiers:b,hasImportantModifier:u,baseClassName:P,maybePostfixModifierPosition:R}=a(d),I=!!R,g=o(I?P.substring(0,R):P);if(!g){if(!I){i=d+(i.length>0?" "+i:i);continue}if(g=o(P),!g){i=d+(i.length>0?" "+i:i);continue}I=!1}let p=Za(b).join(":"),h=u?p+qt:p,A=h+g;if(n.includes(A))continue;n.push(A);let T=s(g,I);for(let E=0;E<T.length;++E){let J=T[E];n.push(h+J)}i=d+(i.length>0?" "+i:i)}return i};function oo(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=Jt(t))&&(o&&(o+=" "),o+=a);return o}var Jt=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=Jt(e[o]))&&(a&&(a+=" "),a+=t);return a};function io(e,...t){let a,o,s,n=r;function r(f){let d=t.reduce((b,u)=>u(b),e());return a=eo(d),o=a.cache.get,s=a.cache.set,n=i,i(f)}function i(f){let d=o(f);if(d)return d;let b=ao(f,a);return s(f,b),b}return function(){return n(oo.apply(null,arguments))}}var z=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},Xt=/^\[(?:([a-z-]+):)?(.+)\]$/i,no=/^\d+\/\d+$/,ro=new Set(["px","full","screen"]),so=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(rt|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,co=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)rt-?((\d+)?\.?(\d+)[a-z]+|0)/,po=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ve=e=>Fe(e)||ro.has(e)||no.test(e),ke=e=>He(e,"length",xo),Fe=e=>!!e&&!Number.isNaN(Number(e)),Pt=e=>He(e,"number",Fe),We=e=>!!e&&Number.isInteger(Number(e)),uo=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),N=e=>Xt.test(e),De=e=>so.test(e),go=new Set(["length","size","percentage"]),fo=e=>He(e,go,Qt),bo=e=>He(e,"position",Qt),ho=new Set(["image","url"]),vo=e=>He(e,ho,Co),yo=e=>He(e,"",wo),Ke=()=>!0,He=(e,t,a)=>{let o=Xt.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},xo=e=>lo.test(e)&&!co.test(e),Qt=()=>!1,wo=e=>mo.test(e),Co=e=>po.test(e);var No=()=>{let e=z("colors"),t=z("spacing"),a=z("blur"),o=z("brightness"),s=z("borderColor"),n=z("borderRadius"),r=z("borderSpacing"),i=z("borderWidth"),f=z("contrast"),d=z("grayscale"),b=z("hueRotate"),u=z("invert"),P=z("gap"),R=z("gradientColorStops"),I=z("gradientColorStopPositions"),g=z("inset"),p=z("margin"),h=z("opacity"),A=z("padding"),T=z("saturate"),E=z("scale"),J=z("sepia"),X=z("skew"),Q=z("space"),te=z("translate"),V=()=>["auto","contain","none"],se=()=>["auto","hidden","clip","visible","scroll"],v=()=>["auto",N,t],m=()=>[N,t],L=()=>["",ve,ke],he=()=>["auto",Fe,N],at=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Ie=()=>["solid","dashed","dotted","double","none"],ot=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ve=()=>["start","end","center","between","around","evenly","stretch"],Be=()=>["","0",N],kt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],me=()=>[Fe,N];return{cacheSize:500,separator:":",theme:{colors:[Ke],spacing:[ve,ke],blur:["none","",De,N],brightness:me(),borderColor:[e],borderRadius:["none","","full",De,N],borderSpacing:m(),borderWidth:L(),contrast:me(),grayscale:Be(),hueRotate:me(),invert:Be(),gap:m(),gradientColorStops:[e],gradientColorStopPositions:[uo,ke],inset:v(),margin:v(),opacity:me(),padding:m(),saturate:me(),scale:me(),sepia:Be(),skew:me(),space:m(),translate:m()},classGroups:{aspect:[{aspect:["auto","square","video",N]}],container:["container"],columns:[{columns:[De]}],"break-after":[{"break-after":kt()}],"break-before":[{"break-before":kt()}],"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:[...at(),N]}],overflow:[{overflow:se()}],"overflow-rt":[{"overflow-rt":se()}],"overflow-y":[{"overflow-y":se()}],overscroll:[{overscroll:V()}],"overscroll-rt":[{"overscroll-rt":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-rt":[{"inset-rt":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",We,N]}],basis:[{basis:v()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",N]}],grow:[{grow:Be()}],shrink:[{shrink:Be()}],order:[{order:["first","last","none",We,N]}],"grid-cols":[{"grid-cols":[Ke]}],"col-start-end":[{col:["auto",{span:["full",We,N]},N]}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":[Ke]}],"row-start-end":[{row:["auto",{span:[We,N]},N]}],"row-start":[{"row-start":he()}],"row-end":[{"row-end":he()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",N]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",N]}],gap:[{gap:[P]}],"gap-rt":[{"gap-rt":[P]}],"gap-y":[{"gap-y":[P]}],"justify-content":[{justify:["normal",...Ve()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ve(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ve(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[p]}],mx:[{mx:[p]}],my:[{my:[p]}],ms:[{ms:[p]}],me:[{me:[p]}],mt:[{mt:[p]}],mr:[{mr:[p]}],mb:[{mb:[p]}],ml:[{ml:[p]}],"space-rt":[{"space-rt":[Q]}],"space-rt-reverse":["space-rt-reverse"],"space-y":[{"space-y":[Q]}],"space-y-reverse":["space-y-reverse"],rt:[{rt:["auto","min","max","fit","svw","lvw","dvw",N,t]}],"min-rt":[{"min-rt":[N,t,"min","max","fit"]}],"max-rt":[{"max-rt":[N,t,"none","full","min","max","fit","prose",{screen:[De]},De]}],h:[{h:[N,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[N,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[N,t,"auto","min","max","fit"]}],"font-size":[{text:["base",De,ke]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pt]}],"font-family":[{font:[Ke]}],"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",N]}],"line-clamp":[{"line-clamp":["none",Fe,Pt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ve,N]}],"list-image":[{"list-image":["none",N]}],"list-style-type":[{list:["none","disc","decimal",N]}],"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:[...Ie(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ve,ke]}],"underline-offset":[{"underline-offset":["auto",ve,N]}],"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",N]}],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",N]}],"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:[...at(),bo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","rt","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fo]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vo]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[I]}],"gradient-via-pos":[{via:[I]}],"gradient-to-pos":[{to:[I]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-b":[{"rounded-b":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-rt":[{"rounded-rt":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-rt":[{border:[i]}],"border-rt-rt":[{"border-rt":[i]}],"border-rt-y":[{"border-y":[i]}],"border-rt-s":[{"border-s":[i]}],"border-rt-e":[{"border-e":[i]}],"border-rt-t":[{"border-t":[i]}],"border-rt-r":[{"border-r":[i]}],"border-rt-b":[{"border-b":[i]}],"border-rt-l":[{"border-l":[i]}],"border-opacity":[{"border-opacity":[h]}],"border-style":[{border:[...Ie(),"hidden"]}],"divide-rt":[{"divide-rt":[i]}],"divide-rt-reverse":["divide-rt-reverse"],"divide-y":[{"divide-y":[i]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[h]}],"divide-style":[{divide:Ie()}],"border-color":[{border:[s]}],"border-color-rt":[{"border-rt":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Ie()]}],"outline-offset":[{"outline-offset":[ve,N]}],"outline-rt":[{outline:[ve,ke]}],"outline-color":[{outline:[e]}],"ring-rt":[{ring:L()}],"ring-rt-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[h]}],"ring-offset-rt":[{"ring-offset":[ve,ke]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",De,yo]}],"shadow-color":[{shadow:[Ke]}],opacity:[{opacity:[h]}],"mix-blend":[{"mix-blend":[...ot(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ot()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",De,N]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[u]}],saturate:[{saturate:[T]}],sepia:[{sepia:[J]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[h]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[J]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[r]}],"border-spacing-rt":[{"border-spacing-rt":[r]}],"border-spacing-y":[{"border-spacing-y":[r]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",N]}],duration:[{duration:me()}],ease:[{ease:["linear","in","out","in-out",N]}],delay:[{delay:me()}],animate:[{animate:["none","spin","ping","pulse","bounce",N]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-rt":[{"scale-rt":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[We,N]}],"translate-rt":[{"translate-rt":[te]}],"translate-y":[{"translate-y":[te]}],"skew-rt":[{"skew-rt":[X]}],"skew-y":[{"skew-y":[X]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",N]}],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","rt-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",N]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","rt",""]}],"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-me":[{"scroll-me":m()}],"scroll-mt":[{"scroll-mt":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-pe":[{"scroll-pe":m()}],"scroll-pt":[{"scroll-pt":m()}],"scroll-pr":[{"scroll-pr":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","rt","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-rt":[{"touch-pan":["rt","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",N]}],fill:[{fill:[e,"none"]}],"stroke-rt":[{stroke:[ve,ke,Pt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-rt","overflow-y"],overscroll:["overscroll-rt","overscroll-y"],inset:["inset-rt","inset-y","start","end","top","right","bottom","left"],"inset-rt":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-rt","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["rt","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-rt","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-rt"],"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-rt","border-spacing-y"],"border-rt":["border-rt-s","border-rt-e","border-rt-t","border-rt-r","border-rt-b","border-rt-l"],"border-rt-rt":["border-rt-r","border-rt-l"],"border-rt-y":["border-rt-t","border-rt-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-rt":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-rt","touch-y","touch-pz"],"touch-rt":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Yt=io(No);function l(...e){return Yt((0,Zt.clsx)(e))}var rt=require("react/jsx-runtime"),ie=nt.forwardRef(({className:e,...t},a)=>(0,rt.jsx)(ye.Root,{ref:a,className:l("relative flex h-10 rt-10 shrink-0 overflow-hidden rounded-full",e),...t}));ie.displayName=ye.Root.displayName;var Pe=nt.forwardRef(({className:e,...t},a)=>(0,rt.jsx)(ye.Image,{ref:a,className:l("aspect-square h-full rt-full",e),...t}));Pe.displayName=ye.Image.displayName;var oe=nt.forwardRef(({className:e,...t},a)=>(0,rt.jsx)(ye.Fallback,{ref:a,className:l("flex h-full rt-full items-center justify-center rounded-full bg-muted",e),...t}));oe.displayName=ye.Fallback.displayName;var Le=Y(require("react"));var xe=Le.forwardRef(({className:e,...t},a)=>(0,rt.jsx)("div",{ref:a,className:l("rounded-xl border bg-card text-card-foreground shadow",e),...t}));xe.displayName="Card";var _e=Le.forwardRef(({className:e,...t},a)=>(0,rt.jsx)("div",{ref:a,className:l("flex flex-col space-y-1.5 p-6",e),...t}));_e.displayName="CardHeader";var qe=Le.forwardRef(({className:e,...t},a)=>(0,rt.jsx)("div",{ref:a,className:l("font-semibold leading-none tracking-tight",e),...t}));qe.displayName="CardTitle";var Tt=Le.forwardRef(({className:e,...t},a)=>(0,rt.jsx)("div",{ref:a,className:l("text-sm text-muted-foreground",e),...t}));Tt.displayName="CardDescription";var Je=Le.forwardRef(({className:e,...t},a)=>(0,rt.jsx)("div",{ref:a,className:l("p-6 pt-0",e),...t}));Je.displayName="CardContent";var Xe=Le.forwardRef(({className:e,...t},a)=>(0,rt.jsx)("div",{ref:a,className:l("flex items-center p-6 pt-0",e),...t}));Xe.displayName="CardFooter";var ea=require("class-variance-authority");var ko=(0,ea.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 pe({className:e,variant:t,...a}){return(0,rt.jsx)("div",{className:l(ko({variant:t}),e),...a})}var oa=require("lucide-react"),ia=require("date-fns");var $e=require("react");function aa({taskId:e,polling:t=!0,system:a="payload"}){let[o,s]=(0,$e.useState)(null),[n,r]=(0,$e.useState)(!1),[i,f]=(0,$e.useState)(null),d=async(u=!0)=>{if(e){u&&r(!0);try{let P=await fetch(`/api/tasks/${e}`);if(!P.ok)throw new Error(`Failed to fetch task: ${P.statusText}`);let R=await P.json();s(R)}catch(P){console.error("Error fetching task:",P),f(P instanceof Error?P:new Error("Unknown error occurred"))}finally{u&&r(!1)}}},b=()=>d(!1);return(0,$e.useEffect)(()=>{e&&d(!0);let u=null;return e&&t&&(u=setInterval(b,5e3)),()=>{u&&clearInterval(u)}},[e,t]),{task:o,loading:n,error:i}}var Do=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},Po=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function Mt({data:e}){let{id:t,system:a,fetchLatest:o,taskData:s,error:n}=e||{};if(!t)return null;let r=null,i=!0,f=n,d=o!==void 0?o:!0;if(r=s||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:d,taskData:r,error:f}),d){let{task:R,loading:I,error:g}=aa({taskId:t,system:a});r=R,i=I,f=g}else i=!1;let b=Do(r?.status||"todo"),u=Po(r?.status||"todo"),P=r?.dateLogged||new Date().toISOString();try{let R=new Date(r?.dateLogged||"");isNaN(R.getTime())||(P=(0,ia.formatDistanceToNow)(R,{addSuffix:!0}))}catch{}return(0,rt.jsxs)(xe,{className:l("rt-full max-rt-md shadow-md",f&&"border border-destructive"),children:[(0,rt.jsxs)(_e,{className:"pb-2",children:[(0,rt.jsxs)("div",{className:"flex justify-between items-start",children:[(0,rt.jsx)(qe,{className:"text-lg font-semibold",children:i?"Loading...":r?.name||"Task"}),(0,rt.jsx)(pe,{className:`${b}`,children:u})]}),r?.project&&(0,rt.jsxs)(Tt,{className:"text-sm text-gray-500",children:["Project: ",r.project.name]})]}),(0,rt.jsx)(Je,{className:"pb-2",children:i?(0,rt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded rt-3/4 mb-2"}):f?(0,rt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,rt.jsx)("p",{className:"text-sm text-foreground",children:r?.description||"......."})}),(0,rt.jsx)(Xe,{className:"pt-2 flex items-center justify-between",children:(0,rt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,rt.jsx)(oa.Clock,{className:"h-3 rt-3 mr-1"}),(0,rt.jsxs)("span",{children:["Created ",P]}),(0,rt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,rt.jsxs)("span",{children:["Task #",t]})]})})]})}var So={task:Mt},Ao=`
5
+ "use strict";var mo=Object.create;var mt=Object.defineProperty;var po=Object.getOwnPropertyDescriptor;var uo=Object.getOwnPropertyNames;var go=Object.getPrototypeOf,fo=Object.prototype.hasOwnProperty;var bo=(e,t)=>{for(var a in t)mt(e,a,{get:t[a],enumerable:!0})},ra=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of uo(t))!fo.call(e,s)&&s!==a&&mt(e,s,{get:()=>t[s],enumerable:!(o=po(t,s))||o.enumerable});return e};var _=(e,t,a)=>(a=e!=null?mo(go(e)):{},ra(t||!e||!e.__esModule?mt(a,"default",{value:e,enumerable:!0}):a,e)),vo=e=>ra(mt({},"__esModule",{value:!0}),e);var Ti={};bo(Ti,{CapabilityMenu:()=>ta,ChatCardArtefact:()=>Vt,ChatCardTask:()=>at,ChatInterface:()=>Mt,ChatInterfaceMessages:()=>ti,ChatMessage:()=>jt,CopilotInterface:()=>Si,defaultColorScheme:()=>Ot,findCapabilityByPath:()=>ai,getAllCapabilities:()=>ii,getCapabilityByTeam:()=>oi,getContextualActions:()=>bt,getDataPart:()=>Di,getFileParts:()=>ki,getTextContent:()=>aa,getToolPart:()=>Ci,hasDataPart:()=>Pi,hasFilePart:()=>Ni,hasToolPart:()=>wi,testCapabilities:()=>ft});module.exports=vo(Ti);var xa=_(require("react"));var pt=_(require("react")),Re=_(require("@radix-ui/react-avatar"));var ga=require("clsx");var Et="-",ho=e=>{let t=xo(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let r=l.split(Et);return r[0]===""&&r.length!==1&&r.shift(),la(r,t)||yo(l)},getConflictingClassGroupIds:(l,r)=>{let u=a[l]||[];return r&&o[l]?[...u,...o[l]]:u}}},la=(e,t)=>{if(e.length===0)return t.classGroupId;let a=e[0],o=t.nextPart.get(a),s=o?la(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;let n=e.join(Et);return t.validators.find(({validator:l})=>l(n))?.classGroupId},na=/^\[(.+)\]$/,yo=e=>{if(na.test(e)){let t=na.exec(e)[1],a=t?.substring(0,t.indexOf(":"));if(a)return"arbitrary.."+a}},xo=e=>{let{theme:t,prefix:a}=e,o={nextPart:new Map,validators:[]};return Co(Object.entries(e.classGroups),a).forEach(([n,l])=>{zt(l,o,n,t)}),o},zt=(e,t,a,o)=>{e.forEach(s=>{if(typeof s=="string"){let n=s===""?t:sa(t,s);n.classGroupId=a;return}if(typeof s=="function"){if(wo(s)){zt(s(o),t,a,o);return}t.validators.push({validator:s,classGroupId:a});return}Object.entries(s).forEach(([n,l])=>{zt(l,sa(t,n),a,o)})})},sa=(e,t)=>{let a=e;return t.split(Et).forEach(o=>{a.nextPart.has(o)||a.nextPart.set(o,{nextPart:new Map,validators:[]}),a=a.nextPart.get(o)}),a},wo=e=>e.isThemeGetter,Co=(e,t)=>t?e.map(([a,o])=>{let s=o.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([l,r])=>[t+l,r])):n);return[a,s]}):e,No=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=new Map,o=new Map,s=(n,l)=>{a.set(n,l),t++,t>e&&(t=0,o=a,a=new Map)};return{get(n){let l=a.get(n);if(l!==void 0)return l;if((l=o.get(n))!==void 0)return s(n,l),l},set(n,l){a.has(n)?a.set(n,l):s(n,l)}}},ca="!",ko=e=>{let{separator:t,experimentalParseClassName:a}=e,o=t.length===1,s=t[0],n=t.length,l=r=>{let u=[],p=0,R=0,v;for(let C=0;C<r.length;C++){let S=r[C];if(p===0){if(S===s&&(o||r.slice(C,C+n)===t)){u.push(r.slice(R,C)),R=C+n;continue}if(S==="/"){v=C;continue}}S==="["?p++:S==="]"&&p--}let k=u.length===0?r:r.substring(R),D=k.startsWith(ca),z=D?k.substring(1):k,P=v&&v>R?v-R:void 0;return{modifiers:u,hasImportantModifier:D,baseClassName:z,maybePostfixModifierPosition:P}};return a?r=>a({className:r,parseClassName:l}):l},Po=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},Do=e=>({cache:No(e.cacheSize),parseClassName:ko(e),...ho(e)}),So=/\s+/,To=(e,t)=>{let{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:s}=t,n=[],l=e.trim().split(So),r="";for(let u=l.length-1;u>=0;u-=1){let p=l[u],{modifiers:R,hasImportantModifier:v,baseClassName:k,maybePostfixModifierPosition:D}=a(p),z=!!D,P=o(z?k.substring(0,D):k);if(!P){if(!z){r=p+(r.length>0?" "+r:r);continue}if(P=o(k),!P){r=p+(r.length>0?" "+r:r);continue}z=!1}let C=Po(R).join(":"),S=v?C+ca:C,A=S+P;if(n.includes(A))continue;n.push(A);let x=s(P,z);for(let O=0;O<x.length;++O){let te=x[O];n.push(S+te)}r=p+(r.length>0?" "+r:r)}return r};function Ro(){let e=0,t,a,o="";for(;e<arguments.length;)(t=arguments[e++])&&(a=da(t))&&(o&&(o+=" "),o+=a);return o}var da=e=>{if(typeof e=="string")return e;let t,a="";for(let o=0;o<e.length;o++)e[o]&&(t=da(e[o]))&&(a&&(a+=" "),a+=t);return a};function Ao(e,...t){let a,o,s,n=l;function l(u){let p=t.reduce((R,v)=>v(R),e());return a=Do(p),o=a.cache.get,s=a.cache.set,n=r,r(u)}function r(u){let p=o(u);if(p)return p;let R=To(u,a);return s(u,R),R}return function(){return n(Ro.apply(null,arguments))}}var E=e=>{let t=a=>a[e]||[];return t.isThemeGetter=!0,t},ma=/^\[(?:([a-z-]+):)?(.+)\]$/ut,Mo=/^\d+\/\d+$/,Io=new Set(["px","full","screen"]),Bo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(ut|h|ut|ut|min|max))|\ut(calc|min|max|clamp)\(.+\)|^0$/,Uo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,zo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Eo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Te=e=>Ke(e)||Io.has(e)||Mo.test(e),Le=e=>_e(e,"length",$o),Ke=e=>!!e&&!Number.isNaN(Number(e)),Ut=e=>_e(e,"number",Ke),Ze=e=>!!e&&Number.isInteger(Number(e)),Fo=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),h=e=>ma.test(e),Ue=e=>Bo.test(e),jo=new Set(["length","size","percentage"]),Ho=e=>_e(e,jo,pa),Oo=e=>_e(e,"position",pa),Vo=new Set(["image","url"]),Go=e=>_e(e,Vo,_o),Wo=e=>_e(e,"",Ko),et=()=>!0,_e=(e,t,a)=>{let o=ma.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):a(o[2]):!1},$o=e=>Lo.test(e)&&!Uo.test(e),pa=()=>!1,Ko=e=>zo.test(e),_o=e=>Eo.test(e);var qo=()=>{let e=E("colors"),t=E("spacing"),a=E("blur"),o=E("brightness"),s=E("borderColor"),n=E("borderRadius"),l=E("borderSpacing"),r=E("borderWidth"),u=E("contrast"),p=E("grayscale"),R=E("hueRotate"),v=E("invert"),k=E("gap"),D=E("gradientColorStops"),z=E("gradientColorStopPositions"),P=E("inset"),C=E("margin"),S=E("opacity"),A=E("padding"),x=E("saturate"),O=E("scale"),te=E("sepia"),$=E("skew"),ie=E("space"),X=E("translate"),K=()=>["auto","contain","none"],Z=()=>["auto","hidden","clip","visible","scroll"],be=()=>["auto",h,t],I=()=>[h,t],Se=()=>["",Te,Le],d=()=>["auto",Ke,h],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],m=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",h],de=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Ke,h];return{cacheSize:500,separator:":",theme:{colors:[et],spacing:[Te,Le],blur:["none","",Ue,h],brightness:j(),borderColor:[e],borderRadius:["none","","full",Ue,h],borderSpacing:I(),borderWidth:Se(),contrast:j(),grayscale:V(),hueRotate:j(),invert:V(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Fo,Le],inset:be(),margin:be(),opacity:j(),padding:I(),saturate:j(),scale:j(),sepia:V(),skew:j(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[Ue]}],"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:[...M(),h]}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],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",Ze,h]}],basis:[{basis:be()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",h]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",Ze,h]}],"grid-cols":[{"grid-cols":[et]}],"col-start-end":[{col:["auto",{span:["full",Ze,h]},h]}],"col-start":[{"col-start":d()}],"col-end":[{"col-end":d()}],"grid-rows":[{"grid-rows":[et]}],"row-start-end":[{row:["auto",{span:[Ze,h]},h]}],"row-start":[{"row-start":d()}],"row-end":[{"row-end":d()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[k]}],"gap-x":[{"gap-x":[k]}],"gap-y":[{"gap-y":[k]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[ie]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ie]}],"space-y-reverse":["space-y-reverse"],ut:[{ut:["auto","min","max","fit","svw","lvw","dvw",h,t]}],"min-ut":[{"min-ut":[h,t,"min","max","fit"]}],"max-ut":[{"max-ut":[h,t,"none","full","min","max","fit","prose",{screen:[Ue]},Ue]}],h:[{h:[h,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ue,Le]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ut]}],"font-family":[{font:[et]}],"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",h]}],"line-clamp":[{"line-clamp":["none",Ke,Ut]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Te,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Te,Le]}],"underline-offset":[{"underline-offset":["auto",Te,h]}],"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",h]}],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",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),Oo]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ho]}],"bg-image":[{bg:["none",{"gradient-ha":["t","tr","r","br","ut","bl","l","tl"]},Go]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[z]}],"gradient-via-pos":[{via:[z]}],"gradient-ha-pos":[{ha:[z]}],"gradient-from":[{from:[D]}],"gradient-via":[{via:[D]}],"gradient-ha":[{ha:[D]}],rounded:[{rounded:[n]}],"rounded-s":[{"rounded-s":[n]}],"rounded-e":[{"rounded-e":[n]}],"rounded-t":[{"rounded-t":[n]}],"rounded-r":[{"rounded-r":[n]}],"rounded-ut":[{"rounded-ut":[n]}],"rounded-l":[{"rounded-l":[n]}],"rounded-ss":[{"rounded-ss":[n]}],"rounded-se":[{"rounded-se":[n]}],"rounded-ut":[{"rounded-ut":[n]}],"rounded-es":[{"rounded-es":[n]}],"rounded-tl":[{"rounded-tl":[n]}],"rounded-tr":[{"rounded-tr":[n]}],"rounded-br":[{"rounded-br":[n]}],"rounded-bl":[{"rounded-bl":[n]}],"border-ut":[{border:[r]}],"border-ut-x":[{"border-x":[r]}],"border-ut-y":[{"border-y":[r]}],"border-ut-s":[{"border-s":[r]}],"border-ut-e":[{"border-e":[r]}],"border-ut-t":[{"border-t":[r]}],"border-ut-r":[{"border-r":[r]}],"border-ut-ut":[{"border-ut":[r]}],"border-ut-l":[{"border-l":[r]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...L(),"hidden"]}],"divide-x":[{"divide-x":[r]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[r]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:L()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-ut":[{"border-ut":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[Te,h]}],"outline-ut":[{outline:[Te,Le]}],"outline-color":[{outline:[e]}],"ring-ut":[{ring:Se()}],"ring-ut-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-ut":[{"ring-offset":[Te,Le]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ue,Wo]}],"shadow-color":[{shadow:[et]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...m(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":m()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[o]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Ue,h]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[R]}],invert:[{invert:[v]}],saturate:[{saturate:[x]}],sepia:[{sepia:[te]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",h]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[Ze,h]}],"translate-x":[{"translate-x":[X]}],"translate-y":[{"translate-y":[X]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],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","ut-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"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-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":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-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":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",h]}],fill:[{fill:[e,"none"]}],"stroke-ut":[{stroke:[Te,Le,Ut]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["ut","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-ut","rounded-l","rounded-ss","rounded-se","rounded-ut","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ut"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-ut":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-ut":["border-ut-s","border-ut-e","border-ut-t","border-ut-r","border-ut-ut","border-ut-l"],"border-ut-x":["border-ut-r","border-ut-l"],"border-ut-y":["border-ut-t","border-ut-ut"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-ut","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-ut"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var ua=Ao(qo);function c(...e){return ua((0,ga.clsx)(e))}var ut=require("react/jsx-runtime"),me=pt.forwardRef(({className:e,...t},a)=>(0,ut.jsx)(Re.Root,{ref:a,className:c("relative flex h-10 ut-10 shrink-0 overflow-hidden rounded-full",e),...t}));me.displayName=Re.Root.displayName;var ze=pt.forwardRef(({className:e,...t},a)=>(0,ut.jsx)(Re.Image,{ref:a,className:c("aspect-square h-full ut-full",e),...t}));ze.displayName=Re.Image.displayName;var pe=pt.forwardRef(({className:e,...t},a)=>(0,ut.jsx)(Re.Fallback,{ref:a,className:c("flex h-full ut-full items-center justify-center rounded-full bg-muted",e),...t}));pe.displayName=Re.Fallback.displayName;var Ve=_(require("react"));var se=Ve.forwardRef(({className:e,...t},a)=>(0,ut.jsx)("div",{ref:a,className:c("rounded-xl border bg-card text-card-foreground shadow",e),...t}));se.displayName="Card";var Ae=Ve.forwardRef(({className:e,...t},a)=>(0,ut.jsx)("div",{ref:a,className:c("flex flex-col space-y-1.5 p-6",e),...t}));Ae.displayName="CardHeader";var Me=Ve.forwardRef(({className:e,...t},a)=>(0,ut.jsx)("div",{ref:a,className:c("font-semibold leading-none tracking-tight",e),...t}));Me.displayName="CardTitle";var Ft=Ve.forwardRef(({className:e,...t},a)=>(0,ut.jsx)("div",{ref:a,className:c("text-sm text-muted-foreground",e),...t}));Ft.displayName="CardDescription";var Ce=Ve.forwardRef(({className:e,...t},a)=>(0,ut.jsx)("div",{ref:a,className:c("p-6 pt-0",e),...t}));Ce.displayName="CardContent";var tt=Ve.forwardRef(({className:e,...t},a)=>(0,ut.jsx)("div",{ref:a,className:c("flex items-center p-6 pt-0",e),...t}));tt.displayName="CardFooter";var fa=require("class-variance-authority");var Jo=(0,fa.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 le({className:e,variant:t,...a}){return(0,ut.jsx)("div",{className:c(Jo({variant:t}),e),...a})}var ha=require("lucide-react"),ya=require("date-fns");var qe=require("react");function va({taskId:e,polling:t=!0,system:a="payload"}){let[o,s]=(0,qe.useState)(null),[n,l]=(0,qe.useState)(!1),[r,u]=(0,qe.useState)(null),p=async(v=!0)=>{if(e){v&&l(!0);try{let k=await fetch(`/api/tasks/${e}`);if(!k.ok)throw new Error(`Failed ha fetch task: ${k.statusText}`);let D=await k.json();s(D)}catch(k){console.error("Error fetching task:",k),u(k instanceof Error?k:new Error("Unknown error occurred"))}finally{v&&l(!1)}}},R=()=>p(!1);return(0,qe.useEffect)(()=>{e&&p(!0);let v=null;return e&&t&&(v=setInterval(R,5e3)),()=>{v&&clearInterval(v)}},[e,t]),{task:o,loading:n,error:r}}var Xo=e=>{switch(e){case"backlog":return"bg-gray-200 text-gray-800";case"todo":return"bg-blue-200 text-blue-800";case"inProgress":return"bg-yellow-200 text-yellow-800";case"done":return"bg-green-200 text-green-800";case"cancelled":return"bg-red-200 text-red-800";default:return"bg-gray-200 text-gray-800"}},Qo=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function at({data:e}){let{id:t,system:a,fetchLatest:o,taskData:s,error:n}=e||{};if(!t)return null;let l=null,r=!0,u=n,p=o!==void 0?o:!0;if(l=s||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:o,system:a,fetchLatest:p,taskData:l,error:u}),p){let{task:D,loading:z,error:P}=va({taskId:t,system:a});l=D,r=z,u=P}else r=!1;let R=Xo(l?.status||"todo"),v=Qo(l?.status||"todo"),k=l?.dateLogged||new Date().toISOString();try{let D=new Date(l?.dateLogged||"");isNaN(D.getTime())||(k=(0,ya.formatDistanceToNow)(D,{addSuffix:!0}))}catch{}return(0,ut.jsxs)(se,{className:c("ut-full max-ut-md shadow-md",u&&"border border-destructive"),children:[(0,ut.jsxs)(Ae,{className:"pb-2",children:[(0,ut.jsxs)("div",{className:"flex justify-between items-start",children:[(0,ut.jsx)(Me,{className:"text-lg font-semibold",children:r?"Loading...":l?.name||"Task"}),(0,ut.jsx)(le,{className:`${R}`,children:v})]}),l?.project&&(0,ut.jsxs)(Ft,{className:"text-sm text-gray-500",children:["Project: ",l.project.name]})]}),(0,ut.jsx)(Ce,{className:"pb-2",children:r?(0,ut.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded ut-3/4 mb-2"}):u?(0,ut.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ut.jsx)("p",{className:"text-sm text-foreground",children:l?.description||"......."})}),(0,ut.jsx)(tt,{className:"pt-2 flex items-center justify-between",children:(0,ut.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ut.jsx)(ha.Clock,{className:"h-3 ut-3 mr-1"}),(0,ut.jsxs)("span",{children:["Created ",k]}),(0,ut.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ut.jsxs)("span",{children:["Task #",t]})]})})]})}var Yo={task:at},Zo=`
6
6
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="white" width="20" height="20">
7
7
  <path d="M327.5 85.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 128l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 128l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 64 426.8 7.5C425.1 3 420.8 0 416 0s-9.1 3-10.8 7.5L384 64 327.5 85.2zM205.1 73.3c-2.6-5.7-8.3-9.3-14.5-9.3s-11.9 3.6-14.5 9.3L123.3 187.3 9.3 240C3.6 242.6 0 248.3 0 254.6s3.6 11.9 9.3 14.5l114.1 52.7L176 435.8c2.6 5.7 8.3 9.3 14.5 9.3s11.9-3.6 14.5-9.3l52.7-114.1 114.1-52.7c5.7-2.6 9.3-8.3 9.3-14.5s-3.6-11.9-9.3-14.5L257.8 187.4 205.1 73.3zM384 384l-56.5 21.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 448l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 448l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 384l-21.2-56.5c-1.7-4.5-6-7.5-10.8-7.5s-9.1 3-10.8 7.5L384 384z"/>
8
- </svg>`,To=`data:image/svg+xml;utf8,${encodeURIComponent(Ao)}`,Rt=na.default.memo(function(t){let{id:a,message:o,currentUser:s,role:n}=t,r=n==="user",i=r?s?.name||"You":s?.name||"AI Assistant",f=r?s?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,rt.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${r?"flex-row-reverse":""}`,children:["Forwarding to ",o?.data?.content]},a);case"text":return(0,rt.jsxs)("div",{className:`flex items-start gap-3 ${r?"flex-row-reverse":""}`,children:[r?(0,rt.jsxs)(ie,{children:[(0,rt.jsx)(Pe,{src:f,alt:i}),(0,rt.jsx)(oe,{children:i.substring(0,2).toUpperCase()})]}):(0,rt.jsx)("img",{src:To,alt:"AI Assistant",className:"rt-10 h-10"}),(0,rt.jsxs)("div",{className:`grid gap-1.5 ${r?"text-right":""}`,children:[(0,rt.jsx)("div",{className:"flex items-center gap-2",children:(0,rt.jsx)("span",{className:"font-medium",children:i})}),(0,rt.jsx)("div",{className:`rounded-lg p-3 text-sm ${r?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,rt.jsxs)("div",{className:`flex items-start gap-3 ${r?"flex-row-reverse":""}`,children:[(0,rt.jsxs)(ie,{className:r?"":"ai-border",children:[(0,rt.jsx)(Pe,{src:f,alt:i}),(0,rt.jsx)(oe,{children:i.substring(0,2).toUpperCase()})]}),(0,rt.jsxs)("div",{className:`grid gap-1.5 ${r?"text-right":""}`,children:[(0,rt.jsx)("div",{className:"flex items-center gap-2",children:(0,rt.jsx)("span",{className:"font-medium",children:i})}),(0,rt.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${r?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},a);case"tool-invocation":if(o.data&&o.data.tool){let d=So[o.data.tool];return d?(0,rt.jsx)("div",{className:"mt-2",children:(0,rt.jsx)(d,{data:o.data})}):(console.warn(`Tool ${o.data.tool} is not defined.`),(0,rt.jsx)("div",{className:"mt-2",children:"......"}))}}});var It=Y(require("react")),ne=Y(require("@radix-ui/react-scroll-area"));var le=It.forwardRef(({className:e,children:t,...a},o)=>(0,rt.jsxs)(ne.Root,{ref:o,className:l("relative overflow-hidden",e),...a,children:[(0,rt.jsx)(ne.Viewport,{className:"h-full rt-full rounded-[inherit]",children:t}),(0,rt.jsx)(ra,{}),(0,rt.jsx)(ne.Corner,{})]}));le.displayName=ne.Root.displayName;var ra=It.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,rt.jsx)(ne.ScrollAreaScrollbar,{ref:o,orientation:t,className:l("flex touch-none select-none transition-colors",t==="vertical"&&"h-full rt-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,rt.jsx)(ne.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));ra.displayName=ne.ScrollAreaScrollbar.displayName;function Mo({messages:e,isLoading:t}){let a=(0,$e.useRef)(null);return(0,$e.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,rt.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,rt.jsxs)(le,{className:"container flex-1 p-4",children:[(0,rt.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,rt.jsx)("div",{className:"flex items-center justify-center h-full pt-60",children:(0,rt.jsxs)("div",{className:"text-center max-rt-md",children:[(0,rt.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome to Dexter"}),(0,rt.jsx)("p",{className:"text-zinc-400",children:"Ask me anything or direct your question to a business function directly using the toolbar below."})]})}),t&&(0,rt.jsxs)("div",{className:"flex items-start gap-3",children:[(0,rt.jsxs)(ie,{className:"ai-border",children:[(0,rt.jsx)(Pe,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,rt.jsx)(oe,{children:"AI"})]}),(0,rt.jsxs)("div",{className:"grid gap-1.5",children:[(0,rt.jsx)("div",{className:"flex items-center gap-2",children:(0,rt.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,rt.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,rt.jsxs)("div",{className:"flex space-rt-2",children:[(0,rt.jsx)("div",{className:"rt-2 h-2 rounded-full bg-current animate-bounce"}),(0,rt.jsx)("div",{className:"rt-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,rt.jsx)("div",{className:"rt-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,s)=>(0,rt.jsx)(Rt,{...o},s))]}),(0,rt.jsx)("div",{ref:a})]})})}var Bt={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]},Ee=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function Ro(e){let t=Ee,a=null;for(let o of e){if(a=t.find(s=>s.id===o||s.name===o)||null,!a)return null;t=a.children||[]}return a}function Lt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function Io(e){return Ee.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function Bo(){return Ee}function Lo({artefact:e,taskId:t,taskData:a,loading:o=!1,error:s=null}){let n=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},r=n.dateLogged;try{let i=new Date(n.dateLogged);isNaN(i.getTime())||(r=(0,ia.formatDistanceToNow)(i,{addSuffix:!0}))}catch{}return(0,rt.jsxs)(xe,{className:"rt-full max-rt-md shadow-md",children:[(0,rt.jsx)(_e,{className:"pb-2",children:(0,rt.jsx)("div",{className:"flex justify-between items-start",children:(0,rt.jsx)(qe,{className:"text-lg font-semibold",children:o?"Loading...":n.name})})}),(0,rt.jsx)(Je,{className:"pb-2",children:o?(0,rt.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded rt-3/4 mb-2"}):s?(0,rt.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,rt.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,rt.jsx)(Xe,{className:"pt-2 flex items-center justify-between",children:(0,rt.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,rt.jsx)(oa.Clock,{className:"h-3 rt-3 mr-1"}),(0,rt.jsxs)("span",{children:["Created ",r]}),(0,rt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,rt.jsxs)("span",{children:["Task #",n.id]})]})})]})}var Nt=require("framer-motion");var xa=Y(require("react")),jt=Y(require("next/link"));var ca=require("@radix-ui/react-slot"),ma=Y(require("react")),zo=(0,ea.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 rt-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"}}}),M=ma.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...s},n)=>(0,rt.jsx)(e?ca.Slot:"button",{className:l(zo({className:t,size:a,variant:o})),ref:n,...s}));M.displayName="Button";var ua=Y(require("react"));var Qe=ua.forwardRef(({className:e,type:t,...a},o)=>(0,rt.jsx)("input",{type:t,className:l("flex h-9 rt-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}));Qe.displayName="Input";var we=Y(require("react")),D=Y(require("@radix-ui/react-dropdown-menu")),Oe=require("@radix-ui/react-icons");var lt=D.Root,ct=D.Trigger;var Eo=we.forwardRef(({className:e,inset:t,children:a,...o},s)=>(0,rt.jsxs)(D.SubTrigger,{ref:s,className:l("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,rt.jsx)(Oe.ChevronRightIcon,{className:"ml-auto"})]}));Eo.displayName=D.SubTrigger.displayName;var Uo=we.forwardRef(({className:e,...t},a)=>(0,rt.jsx)(D.SubContent,{ref:a,className:l("z-50 min-rt-[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}));Uo.displayName=D.SubContent.displayName;var Ye=we.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,rt.jsx)(D.Portal,{children:(0,rt.jsx)(D.Content,{ref:o,sideOffset:t,className:l("z-50 min-rt-[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})}));Ye.displayName=D.Content.displayName;var Ze=we.forwardRef(({className:e,inset:t,...a},o)=>(0,rt.jsx)(D.Item,{ref:o,className:l("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}));Ze.displayName=D.Item.displayName;var jo=we.forwardRef(({className:e,children:t,checked:a,...o},s)=>(0,rt.jsxs)(D.CheckboxItem,{ref:s,className:l("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,rt.jsx)("span",{className:"absolute left-2 flex h-3.5 rt-3.5 items-center justify-center",children:(0,rt.jsx)(D.ItemIndicator,{children:(0,rt.jsx)(Oe.CheckIcon,{className:"h-4 rt-4"})})}),t]}));jo.displayName=D.CheckboxItem.displayName;var Fo=we.forwardRef(({className:e,children:t,...a},o)=>(0,rt.jsxs)(D.RadioItem,{ref:o,className:l("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,rt.jsx)("span",{className:"absolute left-2 flex h-3.5 rt-3.5 items-center justify-center",children:(0,rt.jsx)(D.ItemIndicator,{children:(0,rt.jsx)(Oe.DotFilledIcon,{className:"h-4 rt-4 fill-current"})})}),t]}));Fo.displayName=D.RadioItem.displayName;var zt=we.forwardRef(({className:e,inset:t,...a},o)=>(0,rt.jsx)(D.Label,{ref:o,className:l("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));zt.displayName=D.Label.displayName;var Et=we.forwardRef(({className:e,...t},a)=>(0,rt.jsx)(D.Separator,{ref:a,className:l("-mx-1 my-1 h-px bg-muted",e),...t}));Et.displayName=D.Separator.displayName;var Ho=({className:e,...t})=>(0,rt.jsx)("span",{className:l("ml-auto text-xs tracking-widest opacity-60",e),...t});Ho.displayName="DropdownMenuShortcut";function ba({currentUnit:e,businessUnits:t,onUnitChange:a,className:o}){let[s,n]=(0,$e.useState)(!1);return(0,$.jsxs)(lt,{open:s,onOpenChange:n,children:[(0,$.jsx)(ct,{asChild:!0,children:(0,$.jsxs)(M,{variant:"ghost",role:"combobox","aria-expanded":s,className:l("rt-full justify-between rounded-2xl px-3 py-2 h-auto min-h-[44px] hover:bg-muted/50",o),children:[(0,$.jsxs)("div",{className:"flex items-center gap-3 min-rt-0 flex-1",children:[(0,$.jsx)("div",{className:l("flex h-8 rt-8 items-center justify-center rounded-lg text-white",e.color),children:e.icon}),(0,$.jsxs)("div",{className:"flex flex-col items-start min-rt-0 flex-1",children:[(0,$.jsx)("span",{className:"font-medium text-sm truncate rt-full text-left",children:e.name}),(0,$.jsx)("span",{className:"text-xs text-muted-foreground truncate rt-full text-left",children:e.description})]})]}),(0,$.jsx)(oa.ChevronDown,{className:"ml-2 h-4 rt-4 shrink-0 opacity-50"})]})}),(0,$.jsxs)(Ye,{className:"rt-[280px] p-2",align:"start",children:[(0,$.jsx)(zt,{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:"Switch Business Unit"}),(0,$.jsx)(Et,{}),(0,$.jsx)("div",{className:"grid gap-1",children:t&&t.length>0?t.map(r=>(0,$.jsxs)(Ze,{className:"flex items-center gap-3 p-2 rounded-lg cursor-pointer",onSelect:()=>{a(r),n(!1)},children:[(0,$.jsx)("div",{className:l("flex h-8 rt-8 items-center justify-center rounded-lg text-white",r.color),children:r.icon}),(0,$.jsxs)("div",{className:"flex flex-col items-start min-rt-0 flex-1",children:[(0,$.jsxs)("div",{className:"flex items-center gap-2 rt-full",children:[(0,$.jsx)("span",{className:"font-medium text-sm truncate",children:r.name}),e.id===r.id&&(0,$.jsx)(oa.Check,{className:"h-4 rt-4 text-primary"})]}),(0,$.jsx)("span",{className:"text-xs text-muted-foreground truncate rt-full",children:r.description})]})]},r.id)):(0,$.jsx)("div",{className:"flex items-center justify-center p-4 text-sm text-muted-foreground",children:"No business units available"})})]})]})}var ue=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date}),va=[{title:"Home",icon:(0,rt.jsx)(oa.Home,{}),isActive:!0},{title:"Teams",icon:(0,rt.jsx)(oa.Users,{}),url:"/teams",items:[{title:"Design",url:"#"},{title:"Marketing",url:"#"},{title:"Finance",url:"#"}]},{title:"Projects",icon:(0,rt.jsx)(oa.Layers,{}),badge:"4",items:[{title:"Active Projects",url:"#",badge:"4"},{title:"Archived",url:"#"},{title:"Templates",url:"#"}]},{title:"Copilot",icon:(0,rt.jsx)(oa.Bot,{}),url:"/copilot"},{title:"Knowledge",icon:(0,rt.jsx)(oa.FileText,{}),url:"/knowledge"}],ya=[{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've used 95% of your storage. Consider upgrading your plan.",time:"Yesterday",read:!0,type:"error",actionLabel:"Upgrade plan",onAction:()=>console.log("Upgrade plan clicked")},{id:"6",title:"Weekly summary",description:"Check out your activity summary for the past week.",time:"2 days ago",read:!0,type:"info",actionLabel:"View summary",onAction:()=>console.log("View summary clicked")},{id:"7",title:"New tutorial available",description:"A new tutorial on 'Advanced Animation Techniques' is now available.",time:"3 days ago",read:!0,type:"info",actionLabel:"Start learning",onAction:()=>console.log("Start learning clicked")}],bt=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,rt.jsx)(oa.Palette,{className:"h-4 rt-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,rt.jsx)(oa.Code,{className:"h-4 rt-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,rt.jsx)(oa.TrendingUp,{className:"h-4 rt-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,rt.jsx)(oa.DollarSign,{className:"h-4 rt-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,rt.jsx)(oa.Users,{className:"h-4 rt-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,rt.jsx)(oa.Wrench,{className:"h-4 rt-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,rt.jsx)(oa.Scale,{className:"h-4 rt-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,rt.jsx)(oa.Package,{className:"h-4 rt-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,rt.jsx)(oa.Zap,{className:"h-4 rt-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,rt.jsx)(oa.Building2,{className:"h-4 rt-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],ut=[{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 Ut=[{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}],mt=[{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}],ft=[{id:"1",title:"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",title:"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",title:"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",title:"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",title:"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",title:"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",title:"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")}],$o=[...ft,{id:"8",title:"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",title:"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",title:"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",title:"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",title:"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")}],Oo=[...ut,{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}],pt={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:[]},ha={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:ft.filter(e=>e.epicId==="1")};var _i={empty:{initialProjects:pt.projects,initialEpics:pt.epics,initialSprints:pt.sprints,initialTasks:pt.tasks},default:{initialProjects:ut,initialEpics:Ut,initialSprints:mt,initialTasks:ft},highDensity:{initialProjects:ut,initialEpics:Ut,initialSprints:mt,initialTasks:$o},singleEpic:{initialProjects:ut,initialEpics:ha.epics,initialSprints:mt,initialTasks:ha.tasks},multipleProjects:{initialProjects:Oo,initialEpics:Ut,initialSprints:mt,initialTasks:ft}},gt=[{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(ue),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(ue),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(ue),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(ue),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(ue),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(ue),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(ue),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(ue),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(ue),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(ue),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],qi=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:gt.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:gt.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:gt.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 Ji=gt.filter(e=>e.type==="digital");function Ft({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:s=bt[0],onBusinessUnitChange:n,className:r,logo:i="/headerlogo.png",appName:f="Nuvia",tagline:d="Collaboration Platform"}){let[b,u]=xa.useState({}),P=p=>{u(h=>({...h,[p]:!h[p]}))},R=p=>{n?.(p)},I=p=>{let h=(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsxs)("div",{className:"flex items-center gap-3",children:[p.icon,(0,rt.jsx)("span",{children:p.title})]}),p.badge&&(0,rt.jsx)(pe,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:p.badge}),p.items&&(0,rt.jsx)(oa.ChevronDown,{className:l("ml-2 h-4 rt-4 transition-transform",b[p.title]?"rotate-180":"")})]}),A=l("flex rt-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",p.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return p.url?(0,rt.jsx)(jt.default,{href:p.url,className:A,onClick:a?o:void 0,children:h}):(0,rt.jsx)("button",{className:A,onClick:()=>p.items&&P(p.title),children:h})},g=(0,rt.jsxs)("div",{className:"flex h-full flex-col border-r bg-background",children:[(0,rt.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,rt.jsxs)("div",{className:"flex items-center gap-3",children:[(0,rt.jsx)("div",{className:"flex h-14 rt-14 items-center justify-center ",children:(0,rt.jsx)("img",{src:i,alt:"Header Logo",className:"h-14 rt-14 object-contain"})}),(0,rt.jsxs)("div",{children:[(0,rt.jsxs)("h2",{className:"font-semibold",children:[f,(0,rt.jsx)("br",{})]}),(0,rt.jsxs)("p",{className:"text-xs text-muted-foreground",children:[d,(0,rt.jsx)("br",{})]})]})]}),a&&(0,rt.jsx)(M,{variant:"ghost",size:"icon",onClick:o,children:(0,rt.jsx)(oa.X,{className:"h-5 rt-5"})})]}),(0,rt.jsx)("div",{className:"px-3 py-2",children:(0,rt.jsxs)("div",{className:"relative",children:[(0,rt.jsx)(oa.Search,{className:"absolute left-3 top-3 h-4 rt-4 text-muted-foreground"}),(0,rt.jsx)(Qe,{type:"search",placeholder:"Search...",className:"rt-full rounded-2xl bg-muted pl-9 pr-4 py-2"})]})}),(0,rt.jsx)("div",{className:"px-3 pb-2",children:(0,rt.jsx)(ba,{currentUnit:s,onUnitChange:R})}),(0,rt.jsx)(le,{className:"flex-1 px-3 py-2",children:(0,rt.jsx)("div",{className:"space-y-1",children:e.map(p=>(0,rt.jsxs)("div",{className:"mb-1",children:[I(p),p.items&&b[p.title]&&(0,rt.jsx)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:p.items.map(h=>(0,rt.jsxs)(jt.default,{href:h.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[h.title,h.badge&&(0,rt.jsx)(pe,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:h.badge})]},h.title))})]},p.title))})}),(0,rt.jsx)("div",{className:"border-t p-3",children:(0,rt.jsx)("div",{className:"space-y-1",children:(0,rt.jsxs)("button",{className:"flex rt-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,rt.jsx)(oa.Settings,{className:"h-5 rt-5"}),(0,rt.jsx)("span",{children:"Settings"})]})})})]});return a?(0,rt.jsx)("div",{className:l("fixed inset-y-0 left-0 z-50 rt-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-rt-0":"-translate-rt-full",r),children:g}):(0,rt.jsx)("div",{className:l("fixed inset-y-0 left-0 z-30 rt-64 transform border-r bg-background transition-transform duration-300 ease-in-out",t?"translate-rt-0":"-translate-rt-full",r),children:g})}var wa=Y(require("react")),ce=Y(require("@radix-ui/react-tooltip"));var ht=ce.Provider,vt=ce.Root,yt=ce.Trigger,et=wa.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,rt.jsx)(ce.Portal,{children:(0,rt.jsx)(ce.Content,{ref:o,sideOffset:t,className:l("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})}));et.displayName=ce.Content.displayName;var Ca=require("next-themes");function Na(){let{setTheme:e,theme:t}=(0,Ca.useTheme)();return(0,rt.jsx)(ht,{children:(0,rt.jsxs)(vt,{children:[(0,rt.jsx)(yt,{asChild:!0,children:(0,rt.jsxs)(M,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,rt.jsx)(oa.Sun,{className:"h-5 rt-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,rt.jsx)(oa.Moon,{className:"absolute h-5 rt-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,rt.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,rt.jsx)(et,{children:"Toggle theme"})]})})}function ka({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:s,className:n}){let r=e.filter(d=>!d.read),i=r.length,f=d=>{switch(d){case"info":return(0,rt.jsx)(oa.Info,{className:"h-5 rt-5 text-blue-500"});case"success":return(0,rt.jsx)(oa.Check,{className:"h-5 rt-5 text-green-500"});case"warning":return(0,rt.jsx)(oa.AlertTriangle,{className:"h-5 rt-5 text-amber-500"});case"error":return(0,rt.jsx)(oa.AlertTriangle,{className:"h-5 rt-5 text-red-500"})}};return(0,rt.jsx)(Nt.AnimatePresence,{children:t&&(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsx)(Nt.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,rt.jsx)(Nt.motion.div,{initial:{rt:"100%"},animate:{rt:0},exit:{rt:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:l("fixed inset-y-0 right-0 z-50 rt-full max-rt-sm border-l bg-background shadow-lg md:rt-96",n),children:(0,rt.jsxs)("div",{className:"flex h-full flex-col",children:[(0,rt.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,rt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rt.jsx)(oa.Bell,{className:"h-5 rt-5"}),(0,rt.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),i>0&&(0,rt.jsxs)(pe,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[i," new"]})]}),(0,rt.jsxs)(M,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,rt.jsx)(oa.X,{className:"h-5 rt-5"}),(0,rt.jsx)("span",{className:"sr-only",children:"Close"})]})]}),i>0&&(0,rt.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,rt.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i," unread notification",i!==1?"s":""]}),(0,rt.jsx)(M,{variant:"ghost",size:"sm",onClick:s,className:"text-sm",children:"Dismiss all"})]}),r.length>0?(0,rt.jsx)(le,{className:"flex-1",children:(0,rt.jsx)("div",{className:"divide-y",children:r.map(d=>(0,rt.jsxs)("div",{className:l("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,rt.jsx)("div",{className:"flex h-10 rt-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:f(d.type)}),(0,rt.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,rt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rt.jsx)("p",{className:"font-medium",children:d.title}),(0,rt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rt.jsx)("p",{className:"text-xs text-muted-foreground",children:d.time}),(0,rt.jsx)(M,{variant:"ghost",size:"sm",className:"h-6 rt-6 p-0",onClick:()=>o?.(d.id),title:"Dismiss",children:(0,rt.jsx)(oa.Check,{className:"h-3 rt-3"})})]})]}),(0,rt.jsx)("p",{className:"text-sm text-muted-foreground",children:d.description}),d.actionLabel&&(0,rt.jsxs)(M,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:d.onAction,children:[d.actionLabel,(0,rt.jsx)(oa.ChevronRight,{className:"ml-1 h-3 rt-3"})]})]})]},d.id))})}):(0,rt.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,rt.jsx)("div",{className:"flex h-16 rt-16 items-center justify-center rounded-full bg-muted",children:(0,rt.jsx)(oa.Bell,{className:"h-8 rt-8 text-muted-foreground"})}),(0,rt.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,rt.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var Ue=Y(require("@radix-ui/react-tabs"));function Da({className:e,...t}){return(0,rt.jsx)(Ue.Root,{"data-slot":"tabs",className:l("flex flex-col gap-2",e),...t})}function Pa({className:e,...t}){return(0,rt.jsx)(Ue.List,{"data-slot":"tabs-list",className:l("bg-muted text-muted-foreground inline-flex h-9 rt-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Sa({className:e,...t}){return(0,rt.jsx)(Ue.Trigger,{"data-slot":"tabs-trigger",className:l("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})}function Ta({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:s="700px",gridCols:n=6}){let r=a.find(i=>i.value===e);return(0,rt.jsxs)($t.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,rt.jsx)("div",{className:"hidden md:block",children:(0,rt.jsx)(Da,{value:e,onValueChange:t,children:(0,rt.jsx)(Pa,{className:"grid rt-full rounded-2xl p-0 h-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(n,a.length)}, minmax(0, 1fr))`},children:a.map(i=>(0,rt.jsx)($t.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,rt.jsx)(Sa,{value:i.value,className:"rt-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:i.label})},i.value))})})}),(0,rt.jsx)("div",{className:"md:hidden",children:(0,rt.jsxs)(lt,{children:[(0,rt.jsx)(ct,{asChild:!0,children:(0,rt.jsxs)(M,{variant:"outline",className:"rounded-2xl min-rt-[140px] justify-between",children:[r?.label||"Select",(0,rt.jsx)(oa.ChevronDown,{className:"h-4 rt-4 ml-2"})]})}),(0,rt.jsx)(Ye,{align:"center",className:"rt-[180px]",children:a.map(i=>(0,rt.jsx)(Ze,{onClick:()=>t?.(i.value),className:`cursor-pointer ${e===i.value?"bg-accent":""}`,children:i.label},i.value))})]})})]})}function Ma({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:s=!0,className:n,activeTab:r="assistant",onTabChange:i,showTabs:f=!0,tabOptions:d=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:b,actionIcon:u=(0,rt.jsx)(oa.Bot,{className:"mr-2 h-4 rt-4"}),actionText:P="Action",onNotificationRemove:R,onRemoveAll:I,logo:g="/headerlogo.png",appName:p="Nuvia",tagline:h="Collaboration Platform"}){let[A,T]=(0,$e.useState)(!1),[E,J]=(0,$e.useState)(t),X=E.filter(V=>!V.read).length,Q=V=>{J(se=>se.filter(v=>v.id!==V)),R?.(V)},te=()=>{J(V=>V.filter(se=>se.read)),I?.()};return(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 border-b bg-background/95 px-4 backdrop-blur ${n||""}`,children:[(0,rt.jsx)(M,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,rt.jsx)(oa.Menu,{className:"h-5 rt-5"})}),(0,rt.jsx)(M,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,rt.jsx)(oa.PanelLeft,{className:"h-5 rt-5"})}),!s&&(0,rt.jsxs)(Nt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,rt:-20},animate:{opacity:1,rt:0},transition:{duration:.3},children:[(0,rt.jsx)("div",{className:"flex h-10 rt-10 items-center justify-center",children:(0,rt.jsx)("img",{src:g,alt:"Logo",className:"h-10 rt-10 object-contain"})}),(0,rt.jsxs)("div",{children:[(0,rt.jsx)("h2",{className:"font-semibold text-sm",children:p}),(0,rt.jsx)("p",{className:"text-xs text-muted-foreground",children:h})]})]}),(0,rt.jsxs)("div",{className:"flex flex-1 items-center",children:[f&&(0,rt.jsx)(Ta,{activeTab:r,onTabChange:i,tabOptions:d}),(0,rt.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,rt.jsx)(Nt.motion.div,{className:"hidden md:flex gap-2",initial:{opacity:0,rt:20},animate:{opacity:1,rt:0},transition:{duration:.3,ease:"easeOut",delay:.1},children:(0,rt.jsx)(Nt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rt.jsxs)(M,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:b,children:[u,P]})})}),(0,rt.jsx)(Na,{}),(0,rt.jsx)(ht,{children:(0,rt.jsxs)(vt,{children:[(0,rt.jsx)(yt,{asChild:!0,children:(0,rt.jsx)(Nt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rt.jsxs)(M,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>T(!0),children:[(0,rt.jsx)(Nt.motion.div,{animate:X>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:X>0?1/0:0,repeatDelay:3},children:(0,rt.jsx)(oa.Bell,{className:"h-5 rt-5"})}),X>0&&(0,rt.jsx)(Nt.motion.span,{className:"absolute -right-1 -top-1 flex h-5 rt-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:X})]})})}),(0,rt.jsx)(et,{children:"Notifications"})]})}),(0,rt.jsx)(Nt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,rt.jsxs)(ie,{className:"h-9 rt-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,rt.jsx)(Pe,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,rt.jsx)(oe,{})]})})]})]})]}),(0,rt.jsx)(ka,{notifications:E,open:A,onClose:()=>T(!1),onNotificationRemove:Q,onRemoveAll:te})]})}var Ra=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,rt.jsx)(oa.User,{className:"h-4 rt-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Ba({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:s=Ra[0],onBusinessUnitChange:n,businessUnits:r=Ra,activeTab:i,onTabChange:f,showTabs:d=!1,onActionClick:b,actionIcon:u,actionText:P="Action",onNotificationRemove:R,onRemoveAll:I,logo:g="/headerlogo.png",appName:p="Nuvia",tagline:h="Collaboration Platform"}){let[A,T]=(0,$e.useState)(!0),[E,J]=(0,$e.useState)(!1),[X,Q]=(0,$e.useState)(s),te=V=>{Q(V),n?.(V)};return(0,rt.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl border bg-background rt-[]",children:[E&&(0,rt.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>J(!1)}),(0,rt.jsx)("div",{className:"md:hidden",children:(0,rt.jsx)(Ft,{items:e,isOpen:E,isMobile:!0,onClose:()=>J(!1),currentBusinessUnit:X,onBusinessUnitChange:te,logo:g,appName:p,tagline:h})}),(0,rt.jsx)("div",{className:"hidden md:block",children:(0,rt.jsx)(Ft,{items:e,isOpen:A,isMobile:!1,currentBusinessUnit:X,onBusinessUnitChange:te,logo:g,appName:p,tagline:h})}),(0,rt.jsxs)("div",{className:l("min-h-screen fixed rt-full transition-all duration-300 ease-in-out",A?"md:pl-64":"md:pl-0"),children:[(0,rt.jsx)(Ma,{title:a,notifications:o,onToggleSidebar:()=>T(!A),onToggleMobileMenu:()=>J(!0),sidebarOpen:A,activeTab:i,onTabChange:f,showTabs:d,onActionClick:b,actionIcon:u,actionText:P,onNotificationRemove:R,onRemoveAll:I,logo:g,appName:p,tagline:h}),(0,rt.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-auto",children:t})]})]})}function La({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:s,onSessionEdit:n,onSessionDelete:r,className:i}){let f=d=>{let u=Math.floor((new Date().getTime()-d.getTime())/(1e3*60));return u<1?"Just now":u<60?`${u}m ago`:u<1440?`${Math.floor(u/60)}h ago`:`${Math.floor(u/1440)}d ago`};return(0,rt.jsx)("div",{className:`space-y-4 ${i||""}`,children:(0,rt.jsxs)(xe,{className:"shadow-sm",children:[(0,rt.jsx)("div",{className:"p-4 border-b",children:(0,rt.jsxs)("div",{className:"flex items-center justify-between",children:[(0,rt.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,rt.jsx)(oa.Clock,{className:"h-4 rt-4"}),"Recent Chats"]}),(0,rt.jsxs)(M,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,rt.jsx)(oa.Plus,{className:"h-3 rt-3"}),"New"]})]})}),(0,rt.jsx)(le,{className:"h-[600px]",children:(0,rt.jsx)("div",{className:"p-2",children:e.length===0?(0,rt.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(d=>{let b=a.find(u=>u.id===d.teamId);return(0,rt.jsx)("div",{className:l("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===d.id&&"bg-muted border"),onClick:()=>s(d),children:(0,rt.jsx)("div",{className:"flex items-start gap-3",children:(0,rt.jsxs)("div",{className:"flex-1 min-rt-0",children:[(0,rt.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,rt.jsx)("h4",{className:"font-medium text-sm truncate",children:d.title}),(0,rt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,rt.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:f(d.timestamp)}),(0,rt.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[n&&(0,rt.jsx)(M,{variant:"ghost",size:"icon",className:"h-5 rt-5 rounded",onClick:u=>{u.stopPropagation(),n(d.id)},children:(0,rt.jsx)(oa.Edit3,{className:"h-3 rt-3"})}),r&&(0,rt.jsx)(M,{variant:"ghost",size:"icon",className:"h-5 rt-5 rounded text-destructive hover:text-destructive",onClick:u=>{u.stopPropagation(),r(d.id)},children:(0,rt.jsx)(oa.Trash2,{className:"h-3 rt-3"})})]})]})]}),(0,rt.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:d.lastMessage})]})})},d.id)})})})]})})}function Gt({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:s,colorScheme:n=Bt,className:r}){let[i,f]=(0,$e.useState)([]),[d,b]=(0,$e.useState)([]),u=i[i.length-1],P=u?.children||e,R=(T,E)=>{switch(T.type){case"category":return n.categories[E%n.categories.length];case"list":return n.lists[E%n.lists.length];case"item":return n.items[E%n.items.length];default:return n.primary}},I=(0,$e.useMemo)(()=>({path:i,selectedItems:d,filters:{}}),[i,d]);(0,$e.useEffect)(()=>{s&&s(I)},[I,s]);let g=T=>{T.type==="category"||T.type==="list"?f([...i,T]):T.type==="item"&&b([...d,T])},p=()=>{f(i.slice(0,-1))},h=T=>{f(i.slice(0,T+1))},A=()=>u?.actions?u.actions:[];return t?(0,rt.jsxs)("div",{className:l("rt-full",r),children:[(0,rt.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,rt.jsxs)("div",{className:"flex items-center gap-2",children:[i.length>0&&(0,rt.jsx)(Nt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:p,className:l("group p-1 h-6 rt-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,rt.jsx)(oa.ChevronLeft,{className:l("h-3 rt-3 transition-transform duration-300 ease-in-out","group-hover:-translate-rt-0.5")})}),(0,rt.jsx)("h4",{className:"font-medium text-sm",children:u?.name||"Capabilities"})]}),(0,rt.jsx)(Nt.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:l("group p-1 h-6 rt-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,rt.jsx)(oa.X,{className:l("h-3 rt-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),i.length>0&&(0,rt.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,rt.jsx)(Nt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>f([]),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,rt.jsxs)("span",{className:"relative",children:["Capabilities",(0,rt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 rt-0 h-0.5 bg-accent transform -translate-rt-1/2 transition-all duration-300 ease-in-out group-hover:rt-full"})]})}),i.map((T,E)=>(0,rt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,rt.jsx)(oa.ChevronRight,{className:"h-2 rt-2"}),(0,rt.jsx)(Nt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>h(E),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,rt.jsxs)("span",{className:"relative",children:[T.name,(0,rt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 rt-0 h-0.5 bg-accent transform -translate-rt-1/2 transition-all duration-300 ease-in-out group-hover:rt-full"})]})})]},T.id))]}),(0,rt.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,rt.jsx)(Nt.AnimatePresence,{mode:"wait",children:(0,rt.jsx)(Nt.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:u?.type==="list"&&u.data?(0,rt.jsx)(Wo,{data:u.data,onItemSelect:T=>b([...d,T]),colorScheme:n}):(0,rt.jsx)(Go,{capabilities:P,onSelect:g,colorScheme:n})},u?.id||"root")})})]}):(0,rt.jsxs)(M,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,rt.jsx)(oa.Menu,{className:"h-4 rt-4"}),(0,rt.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Go({capabilities:e,onSelect:t,colorScheme:a}){return(0,rt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,rt.jsx)(Vo,{capability:o,onClick:()=>t(o),color:a.categories[s%a.categories.length]},o.id))})}function Vo({capability:e,onClick:t,selected:a,color:o}){return(0,rt.jsxs)(Nt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:l("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,rt.jsx)("div",{className:l("rt-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,rt.jsxs)("span",{className:"truncate relative",children:[e.name,(0,rt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 rt-0 h-0.5 bg-accent transform -translate-rt-1/2 transition-all duration-300 ease-in-out group-hover:rt-full"})]}),(e.children||e.data)&&(0,rt.jsx)(oa.ChevronRight,{className:l("h-3 rt-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-rt-0.5")}),e.type==="list"&&e.data&&(0,rt.jsx)(pe,{variant:"secondary",className:l("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function Wo({data:e,onItemSelect:t,colorScheme:a}){return(0,rt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,rt.jsxs)(Nt.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:l("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,rt.jsx)("div",{className:l("rt-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[s%a.items.length])}),(0,rt.jsxs)("div",{className:"flex-1 min-rt-0",children:[(0,rt.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,rt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 rt-0 h-0.5 bg-accent transform -translate-rt-1/2 transition-all duration-300 ease-in-out group-hover:rt-full"})]}),o.subtitle&&(0,rt.jsx)("div",{className:l("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,rt.jsx)(pe,{variant:"secondary",className:l("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}function za({messages:e,input:t,isTyping:a=!1,selectedTeam:o,currentSessionTitle:s,capabilities:n,showCapabilities:r=!0,onInputChange:i,onSendMessage:f,onKeyPress:d,fileUploads:b=[],isDragOver:u=!1,enableFileUpload:P=!1,onFileUpload:R,onRemoveFile:I,onDragOver:g,className:p}){let h=(0,$e.useRef)(null),[A,T]=(0,$e.useState)(!1),[E,J]=(0,$e.useState)({path:[],selectedItems:[],filters:{}}),X=()=>{h.current?.scrollIntoView({behavior:"smooth"})};(0,$e.useEffect)(()=>{X()},[e]);let Q=(v,m)=>{console.log("Capability action:",v,m);let L=`Executing ${v} with context: ${JSON.stringify(m.path.map(he=>he.name))}`;T(!1)},te=(0,$e.useCallback)(v=>{J(v)},[]),V=()=>Lt(E),se=()=>{let v=[];return n.forEach(m=>{m.actions&&m.actions.forEach(L=>{v.push({label:L.label,action:()=>Q(L.id,{path:[m],selectedItems:[],filters:{}})})}),m.children&&m.children.forEach(L=>{L.type==="list"&&L.data&&v.push({label:`View ${L.name}`,action:()=>T(!0)})})}),v.slice(0,5)};return(0,rt.jsxs)(xe,{className:`h-full flex flex-col shadow-sm ${p||""}`,children:[(0,rt.jsx)(le,{className:"flex-1 p-4",children:(0,rt.jsxs)("div",{className:"space-y-4",children:[(0,rt.jsx)(Nt.AnimatePresence,{children:e.map(v=>{let m=v;return(0,rt.jsxs)(Nt.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:l("flex gap-3",v.type==="user"?"flex-row-reverse":"flex-row"),children:[(0,rt.jsx)(ie,{className:"h-8 rt-8",children:v.type==="user"?(0,rt.jsx)(oe,{children:(0,rt.jsx)(oa.User,{className:"h-4 rt-4"})}):(0,rt.jsx)(oe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,rt.jsx)(oa.Bot,{className:"h-4 rt-4"})})}),(0,rt.jsxs)("div",{className:l("max-rt-[80%] rounded-2xl px-4 py-3 shadow-sm",v.type==="user"?"bg-primary text-primary-foreground":"bg-muted"),children:[m.messageType==="image"&&m.image&&(0,rt.jsx)("div",{className:"mb-2",children:(0,rt.jsx)("img",{src:m.image.url,alt:m.image.alt||"Uploaded image",className:"max-rt-full h-auto max-h-48 rounded-lg"})}),m.messageType==="file"&&m.file&&(0,rt.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,rt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,rt.jsx)("span",{className:"text-sm font-medium",children:m.file.name}),(0,rt.jsxs)("span",{className:"text-xs opacity-70",children:[(m.file.size/1024/1024).toFixed(1),"MB"]})]})}),m.messageType==="card"&&m.card&&(0,rt.jsx)("div",{className:"mb-2",children:(0,rt.jsxs)("div",{className:"p-3 bg-background/50 rounded-lg",children:[(0,rt.jsx)("h4",{className:"font-medium",children:m.card.title}),m.card.description&&(0,rt.jsx)("p",{className:"text-sm opacity-70 mt-1",children:m.card.description})]})}),m.messageType==="reference"&&m.references&&(0,rt.jsx)("div",{className:"mb-2 space-y-1",children:m.references.map(L=>(0,rt.jsxs)("div",{className:"p-2 bg-background/50 rounded-lg",children:[(0,rt.jsx)("p",{className:"text-sm font-medium",children:L.title}),L.description&&(0,rt.jsx)("p",{className:"text-xs opacity-70",children:L.description})]},L.id))}),m.messageType==="menu"&&m.menu&&(0,rt.jsxs)("div",{className:"mb-2",children:[(0,rt.jsx)("p",{className:"text-sm font-medium mb-2",children:m.menu.title}),(0,rt.jsx)("div",{className:"space-y-1",children:m.menu.items.map(L=>(0,rt.jsxs)("button",{onClick:L.action,className:"rt-full text-left p-2 bg-background/50 rounded-lg hover:bg-background/70 transition-colors",children:[(0,rt.jsx)("p",{className:"text-sm font-medium",children:L.label}),L.description&&(0,rt.jsx)("p",{className:"text-xs opacity-70",children:L.description})]},L.id))})]}),(0,rt.jsx)("p",{className:"text-sm leading-relaxed",children:v.content}),(0,rt.jsx)("p",{className:"text-xs opacity-70 mt-2",children:v.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})]},v.id)})}),r&&A&&(0,rt.jsxs)(Nt.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,rt.jsx)(ie,{className:"h-8 rt-8",children:(0,rt.jsx)(oe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,rt.jsx)(oa.Bot,{className:"h-4 rt-4"})})}),(0,rt.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,rt.jsx)(Gt,{capabilities:n,isOpen:A,onToggle:()=>T(!A),onActionSelect:Q,onContextChange:te,className:"rt-full"})})]}),a&&(0,rt.jsxs)(Nt.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,rt.jsx)(ie,{className:"h-8 rt-8",children:(0,rt.jsx)(oe,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,rt.jsx)(oa.Bot,{className:"h-4 rt-4"})})}),(0,rt.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,rt.jsxs)("div",{className:"flex space-rt-1",children:[(0,rt.jsx)("div",{className:"rt-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,rt.jsx)("div",{className:"rt-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,rt.jsx)("div",{className:"rt-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]}),(0,rt.jsx)("div",{ref:h})]})}),b&&b.length>0&&(0,rt.jsx)("div",{className:"border-t p-4 bg-muted/10",children:(0,rt.jsx)("div",{className:"flex flex-wrap gap-2",children:b.map(v=>(0,rt.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[(0,rt.jsx)("span",{className:"text-sm font-medium",children:v.file.name}),(0,rt.jsxs)("span",{className:"text-xs text-muted-foreground",children:[(v.file.size/1024/1024).toFixed(1),"MB"]}),(0,rt.jsx)(M,{variant:"ghost",size:"sm",onClick:()=>I?.(v.id),className:"h-6 rt-6 p-0",children:(0,rt.jsx)(oa.X,{className:"h-4 rt-4"})})]},v.id))})}),(0,rt.jsxs)("div",{className:"border-t p-4 bg-muted/20",children:[(0,rt.jsxs)("div",{className:"flex gap-3",children:[(0,rt.jsx)(Qe,{value:t,onChange:v=>i(v.target.value),onKeyPress:d,placeholder:o?`Ask me about ${o.name.toLowerCase()}...`:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),P&&(0,rt.jsx)(M,{variant:"outline",size:"icon",onClick:()=>{let v=document.createElement("input");v.type="file",v.multiple=!0,v.onchange=m=>{let L=m.target.files;R?.(L)},v.click()},className:"rounded-2xl h-10 rt-10 shadow-sm",children:(0,rt.jsx)(oa.Paperclip,{className:"h-4 rt-4"})}),(0,rt.jsx)(M,{onClick:f,disabled:!t.trim()&&(!b||b.length===0)||a,size:"icon",className:"rounded-2xl h-10 rt-10 shadow-sm",children:(0,rt.jsx)(oa.Send,{className:"h-4 rt-4"})})]}),r&&(0,rt.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,rt.jsxs)(M,{onClick:()=>T(!A),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,rt.jsx)(oa.Menu,{className:"h-3 rt-3 mr-1"}),A?"Hide":"Show"," Capabilities"]}),(0,rt.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[V().map((v,m)=>(0,rt.jsx)(M,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>Q(v.id,E),children:v.label},`context-${v.id}`)),V().length===0&&se().map((v,m)=>(0,rt.jsx)(M,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:v.action,children:v.label},`suggestion-${m}`))]})]})]})]})}var Ko=[{id:"1",title:"Logo Design Review",lastMessage:"The color palette looks great! Let's refine the typography...",timestamp:new Date(Date.now()-1e3*60*30),teamId:"design"},{id:"2",title:"React Component Optimization",lastMessage:"Here's how you can improve the performance of your component...",timestamp:new Date(Date.now()-1e3*60*60*2),teamId:"engineering"},{id:"3",title:"Campaign Strategy Discussion",lastMessage:"The target audience analysis shows promising results...",timestamp:new Date(Date.now()-1e3*60*60*24),teamId:"marketing"},{id:"4",title:"Product Roadmap Planning",lastMessage:"Based on user feedback, I recommend prioritizing...",timestamp:new Date(Date.now()-1e3*60*60*24*2),teamId:"product"}];function _o({initialTeam:e="design",initialMessages:t,initialSessions:a,showCapabilities:o=!0,title:s="Digital Colleagues",businessUnits:n=bt,enableFileUpload:r=!0,maxFileSize:i=10,allowedFileTypes:f=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]}={}){let[d,b]=(0,$e.useState)(t||[{id:"1",role:"assistant",type:"text",content:"Hi! I'm your AI assistant with advanced capabilities. I can help with various tasks, access data, and provide contextual actions. What would you like to work on today?",timestamp:new Date}]),[u,P]=(0,$e.useState)(""),[R,I]=(0,$e.useState)(!1),[g,p]=(0,$e.useState)(n.find(y=>y.id===e)||n[0]),[h,A]=(0,$e.useState)(null),[T,E]=(0,$e.useState)(a||Ko),[J,X]=(0,$e.useState)(n.find(y=>y.id===e)||n[0]),[Q,te]=(0,$e.useState)([]),[V,se]=(0,$e.useState)(!1),v=y=>{if(!y||!r)return;let U=[];Array.from(y).forEach(j=>{if(j.size>i*1024*1024){alert(`File ${j.name} is too large. Maximum size is ${i}MB.`);return}if(f.length>0&&!f.some(O=>j.type.match(O))){alert(`File type ${j.type} is not allowed.`);return}let K={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:j,status:"pending",progress:0};if(j.type.startsWith("image/")){let O=new FileReader;O.onload=Ua=>{te(ja=>ja.map(Dt=>Dt.id===K.id?{...Dt,preview:Ua.target?.result}:Dt))},O.readAsDataURL(j)}U.push(K)}),te(j=>[...j,...U])},m=y=>{te(U=>U.filter(j=>j.id!==y))},L=d.map(y=>({id:y.id,content:y.content,type:y.role==="user"?"user":"ai",timestamp:y.timestamp,role:y.role,messageType:y.type,data:y.data,image:y.image,file:y.file,card:y.card,references:y.references,menu:y.menu})),he=async()=>{if(!u.trim()&&Q.length===0)return;let y={id:Date.now().toString(),role:"user",type:"text",content:u,timestamp:new Date};b(U=>[...U,y]),Q.length>0&&Q.forEach(U=>{if(U.file.type.startsWith("image/")){let j={id:Date.now().toString()+Math.random().toString(36).substr(2,9),role:"user",type:"image",content:`Uploaded image: ${U.file.name}`,image:{url:U.preview||"",alt:U.file.name,width:0,height:0},timestamp:new Date};b(K=>[...K,j])}else{let j={id:Date.now().toString()+Math.random().toString(36).substr(2,9),role:"user",type:"file",content:`Uploaded file: ${U.file.name}`,file:{name:U.file.name,size:U.file.size,type:U.file.type,url:URL.createObjectURL(U.file)},timestamp:new Date};b(K=>[...K,j])}}),P(""),te([]),I(!0),setTimeout(()=>{let U=Ee.filter(K=>K.name.toLowerCase().includes(g.name.toLowerCase())||g.name.toLowerCase().includes(K.name.toLowerCase())),j=Math.random();if(j<.3){let K={id:(Date.now()+1).toString(),role:"assistant",type:"text",content:`I can help you with ${g.name.toLowerCase()} tasks. Here are some capabilities I have: ${U.map(O=>O.name).join(", ")}`,timestamp:new Date};b(O=>[...O,K])}else if(j<.5){let K={id:(Date.now()+1).toString(),role:"assistant",type:"card",content:`Here's a ${g.name.toLowerCase()} task I created for you:`,card:{title:`${g.name} Task`,description:`A new task for ${g.name.toLowerCase()} team`,variant:"task",data:{id:Math.floor(Math.random()*1e3),name:`${g.name} Task`,description:`Complete this ${g.name.toLowerCase()} task`,status:"todo",dateLogged:new Date().toISOString(),project:{id:1,name:`${g.name} Project`}}},timestamp:new Date};b(O=>[...O,K])}else if(j<.7){let K={id:(Date.now()+1).toString(),role:"assistant",type:"menu",content:`Here are some ${g.name.toLowerCase()} options:`,menu:{title:`${g.name} Options`,items:U.slice(0,3).map(O=>({id:O.id,label:O.name,description:O.description,value:O.id}))},timestamp:new Date};b(O=>[...O,K])}else{let K={id:(Date.now()+1).toString(),role:"assistant",type:"reference",content:`Here are some helpful ${g.name.toLowerCase()} resources:`,references:[{id:"1",title:`${g.name} Best Practices`,description:`Guidelines for ${g.name.toLowerCase()} work`,type:"document"},{id:"2",title:`${g.name} Tools`,description:`Recommended tools for ${g.name.toLowerCase()}`,type:"link"}],timestamp:new Date};b(O=>[...O,K])}I(!1)},1500)},at=y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),he())},Ie=()=>{A(null),b([{id:"1",role:"assistant",type:"text",content:`Hi! I'm your ${g.name} AI assistant with advanced capabilities. I can help with ${g.name.toLowerCase()} tasks, access relevant data, and provide contextual actions. What would you like to work on today?`,timestamp:new Date}])},ot=y=>{A(y);let U=n.find(j=>j.id===y.teamId)||n[0];p(U),X(U),b([{id:"1",role:"assistant",type:"text",content:y.lastMessage,timestamp:y.timestamp}])},Ve=y=>{E(U=>U.filter(j=>j.id!==y)),h?.id===y&&Ie()},Be=y=>{console.log("Edit session:",y)};return(0,rt.jsx)(Ba,{sidebarItems:va,title:s,notifications:ya,businessUnits:n,currentBusinessUnit:J,onBusinessUnitChange:y=>{X(y),p(y),console.log("Business unit changed to:",y.name)},showTabs:!1,onActionClick:()=>{console.log("Copilot clicked from header")},actionIcon:(0,rt.jsx)(oa.Users,{className:"mr-2 h-4 rt-4"}),actionText:"Collaborate",onNotificationRemove:y=>{console.log("Notification removed:",y)},onRemoveAll:()=>{console.log("All notifications removed")},logo:"/headerlogo.png",appName:"Nuvia",tagline:"AI-Powered Workspace",children:(0,rt.jsx)(Nt.AnimatePresence,{mode:"wait",children:(0,rt.jsx)(Nt.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,rt.jsxs)("div",{className:"h-full flex",children:[(0,rt.jsx)("div",{className:"rt-80 bg-muted/50 flex-shrink-0 h-full p-2",children:(0,rt.jsx)(La,{sessions:T,currentSession:h,teams:n,onNewChat:Ie,onSessionSelect:ot,onSessionEdit:Be,onSessionDelete:Ve})}),(0,rt.jsx)("div",{className:"flex-1 h-full p-2",children:(0,rt.jsx)(za,{messages:L,input:u,isTyping:R,selectedTeam:g,currentSessionTitle:h?.title,capabilities:Ee,showCapabilities:o,onInputChange:P,onSendMessage:he,onKeyPress:at,fileUploads:Q,isDragOver:V,enableFileUpload:r,onFileUpload:v,onRemoveFile:m,onDragOver:se})})]})},"chat-interface")})})}0&&(module.exports={CapabilityMenu,ChatCardArtefact,ChatCardTask,ChatInterfaceMessages,ChatMessage,CopilotInterface,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,testCapabilities});
8
+ </svg>`,ei=`data:image/svg+xml;utf8,${encodeURIComponent(Zo)}`,jt=xa.default.memo(function(t){let{id:a,message:o,currentUser:s,role:n}=t,l=n==="user",r=l?s?.name||"You":s?.name||"AI Assistant",u=l?s?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(o.type){case"forwarding":return(0,ut.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${l?"flex-row-reverse":""}`,children:["Forwarding ha ",o?.data?.content]},a);case"text":return(0,ut.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[l?(0,ut.jsxs)(me,{children:[(0,ut.jsx)(ze,{src:u,alt:r}),(0,ut.jsx)(pe,{children:r.substring(0,2).toUpperCase()})]}):(0,ut.jsx)("img",{src:ei,alt:"AI Assistant",className:"ut-10 h-10"}),(0,ut.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,ut.jsx)("div",{className:"flex items-center gap-2",children:(0,ut.jsx)("span",{className:"font-medium",children:r})}),(0,ut.jsx)("div",{className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:o?.data?.content})]})]},a);case"image":return(0,ut.jsxs)("div",{className:`flex items-start gap-3 ${l?"flex-row-reverse":""}`,children:[(0,ut.jsxs)(me,{className:l?"":"ai-border",children:[(0,ut.jsx)(ze,{src:u,alt:r}),(0,ut.jsx)(pe,{children:r.substring(0,2).toUpperCase()})]}),(0,ut.jsxs)("div",{className:`grid gap-1.5 ${l?"text-right":""}`,children:[(0,ut.jsx)("div",{className:"flex items-center gap-2",children:(0,ut.jsx)("span",{className:"font-medium",children:r})}),(0,ut.jsx)("img",{src:o?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${l?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},a);case"tool-invocation":if(o.data&&o.data.tool){let p=Yo[o.data.tool];return p?(0,ut.jsx)("div",{className:"mt-2",children:(0,ut.jsx)(p,{data:o.data})}):(console.warn(`Tool ${o.data.tool} is not defined.`),(0,ut.jsx)("div",{className:"mt-2",children:"......"}))}}});var Ht=_(require("react")),ue=_(require("@radix-ui/react-scroll-area"));var ge=Ht.forwardRef(({className:e,children:t,...a},o)=>(0,ut.jsxs)(ue.Root,{ref:o,className:c("relative overflow-hidden",e),...a,children:[(0,ut.jsx)(ue.Viewport,{className:"h-full ut-full rounded-[inherit]",children:t}),(0,ut.jsx)(wa,{}),(0,ut.jsx)(ue.Corner,{})]}));ge.displayName=ue.Root.displayName;var wa=Ht.forwardRef(({className:e,orientation:t="vertical",...a},o)=>(0,ut.jsx)(ue.ScrollAreaScrollbar,{ref:o,orientation:t,className:c("flex touch-none select-none transition-colors",t==="vertical"&&"h-full ut-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,ut.jsx)(ue.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));wa.displayName=ue.ScrollAreaScrollbar.displayName;function ti({messages:e,isLoading:t}){let a=(0,qe.useRef)(null);return(0,qe.useEffect)(()=>{a.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,ut.jsx)("div",{className:"flex flex-col h-full overflow-hidden",children:(0,ut.jsxs)(ge,{className:"container flex-1 p-4",children:[(0,ut.jsxs)("div",{className:"space-y-6",children:[e.length===0&&(0,ut.jsx)("div",{className:"flex items-center justify-center h-full pt-60",children:(0,ut.jsxs)("div",{className:"text-center max-ut-md",children:[(0,ut.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"Welcome ha Dexter"}),(0,ut.jsx)("p",{className:"text-zinc-400",children:"Ask me anything or direct your question ha a business function directly using the toolbar below."})]})}),t&&(0,ut.jsxs)("div",{className:"flex items-start gap-3",children:[(0,ut.jsxs)(me,{className:"ai-border",children:[(0,ut.jsx)(ze,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,ut.jsx)(pe,{children:"AI"})]}),(0,ut.jsxs)("div",{className:"grid gap-1.5",children:[(0,ut.jsx)("div",{className:"flex items-center gap-2",children:(0,ut.jsx)("span",{className:"font-medium",children:"AI Assistant"})}),(0,ut.jsx)("div",{className:"rounded-lg p-3 text-sm bg-muted",children:(0,ut.jsxs)("div",{className:"flex space-x-2",children:[(0,ut.jsx)("div",{className:"ut-2 h-2 rounded-full bg-current animate-bounce"}),(0,ut.jsx)("div",{className:"ut-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,ut.jsx)("div",{className:"ut-2 h-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((o,s)=>(0,ut.jsx)(jt,{...o},s))]}),(0,ut.jsx)("div",{ref:a})]})})}var Ot={primary:"bg-blue-500",secondary:"bg-gray-500",accent:"bg-purple-500",categories:["bg-green-500","bg-blue-500","bg-purple-500","bg-pink-500","bg-indigo-500","bg-orange-500"],lists:["bg-green-400","bg-blue-400","bg-purple-400","bg-pink-400","bg-indigo-400","bg-orange-400"],items:["bg-green-300","bg-blue-300","bg-purple-300","bg-pink-300","bg-indigo-300","bg-orange-300"]},ft=[{id:"sales",name:"Sales",description:"Revenue and customer management",iconName:"DollarSign",color:"bg-green-600",type:"category",actions:[{id:"view-pipeline",label:"View Pipeline",description:"See all opportunities in pipeline",iconName:"BarChart",action:e=>console.log("View pipeline",e)},{id:"create-opportunity",label:"Create Opportunity",iconName:"Target",action:e=>console.log("Create opportunity",e)}],children:[{id:"customers",name:"Customers",description:"Customer accounts and contacts",iconName:"Users",color:"bg-blue-500",type:"list",actions:[{id:"add-customer",label:"Add Customer",iconName:"User",action:e=>console.log("Add customer",e)},{id:"export-customers",label:"Export List",iconName:"FileText",action:e=>console.log("Export customers",e)}],data:[{id:"acme-corp",title:"Acme Corp",subtitle:"Enterprise Customer",value:"$125K ARR",metadata:{industry:"Technology",employees:500,lastContact:"2024-01-15"}},{id:"beta-inc",title:"Beta Inc",subtitle:"Mid-market",value:"$45K ARR",metadata:{industry:"Healthcare",employees:150,lastContact:"2024-01-10"}},{id:"gamma-llc",title:"Gamma LLC",subtitle:"Small Business",value:"$15K ARR",metadata:{industry:"Manufacturing",employees:50,lastContact:"2024-01-08"}}]},{id:"opportunities",name:"Opportunities",description:"Sales opportunities and deals",iconName:"Target",color:"bg-yellow-500",type:"list",actions:[{id:"close-won",label:"Mark as Won",iconName:"CheckCircle",action:e=>console.log("Close won",e)},{id:"schedule-followup",label:"Schedule Follow-up",iconName:"Clock",action:e=>console.log("Schedule follow-up",e)}],data:[{id:"opp-1",title:"Acme Corp - Enterprise License",subtitle:"Closing Q1 2024",value:"$85K",metadata:{stage:"Negotiation",probability:80,closeDate:"2024-03-31"}},{id:"opp-2",title:"Beta Inc - Platform Upgrade",subtitle:"Closing Q2 2024",value:"$32K",metadata:{stage:"Proposal",probability:65,closeDate:"2024-06-15"}}]}]},{id:"marketing",name:"Marketing",description:"Marketing campaigns and analytics",iconName:"TrendingUp",color:"bg-pink-600",type:"category",actions:[{id:"view-analytics",label:"View Analytics",iconName:"BarChart",action:e=>console.log("View analytics",e)}],children:[{id:"campaigns",name:"Campaigns",description:"Marketing campaigns and performance",iconName:"TrendingUp",color:"bg-pink-500",type:"list",data:[{id:"campaign-1",title:"Q1 Product Launch",subtitle:"Active Campaign",value:"45% CTR",metadata:{budget:"$50K",spend:"$32K",leads:1250}},{id:"campaign-2",title:"Holiday Promotion",subtitle:"Completed",value:"38% CTR",metadata:{budget:"$25K",spend:"$24K",leads:890}}]}]},{id:"projects",name:"Projects",description:"Project management and tracking",iconName:"Briefcase",color:"bg-blue-600",type:"category",children:[{id:"active-projects",name:"Active Projects",description:"Currently active projects",iconName:"Activity",color:"bg-blue-500",type:"list",data:[{id:"project-1",title:"Website Redesign",subtitle:"In Progress",value:"75% Complete",metadata:{team:"Design",deadline:"2024-02-15",status:"On Track"}},{id:"project-2",title:"Mobile App Development",subtitle:"Planning",value:"25% Complete",metadata:{team:"Engineering",deadline:"2024-03-31",status:"On Track"}}]}]},{id:"engineering",name:"Engineering",description:"Development and technical operations",iconName:"Code",color:"bg-purple-600",type:"category",actions:[{id:"view-repos",label:"View Repositories",description:"See all code repositories",iconName:"Git",action:e=>console.log("View repositories",e)},{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)}],children:[{id:"repositories",name:"Repositories",description:"Code repositories and projects",iconName:"GitBranch",color:"bg-purple-500",type:"list",actions:[{id:"create-repo",label:"Create Repository",iconName:"Plus",action:e=>console.log("Create repository",e)},{id:"view-commits",label:"View Commits",iconName:"Git",action:e=>console.log("View commits",e)}],data:[{id:"repo-1",title:"frontend-app",subtitle:"React Application",value:"Main Branch",metadata:{language:"TypeScript",commits:1247,contributors:8}},{id:"repo-2",title:"backend-api",subtitle:"Node.js API",value:"Main Branch",metadata:{language:"Node.js",commits:892,contributors:5}}]},{id:"tasks",name:"Tasks",description:"Development tasks and issues",iconName:"CheckSquare",color:"bg-blue-500",type:"list",actions:[{id:"create-task",label:"Create Task",iconName:"Plus",action:e=>console.log("Create task",e)},{id:"assign-task",label:"Assign Task",iconName:"UserPlus",action:e=>console.log("Assign task",e)}],data:[{id:"task-1",title:"Fix authentication bug",subtitle:"High Priority",value:"In Progress",metadata:{assignee:"John Doe",priority:"High",estimate:"4h"}},{id:"task-2",title:"Implement dark mode",subtitle:"Feature Request",value:"Todo",metadata:{assignee:"Jane Smith",priority:"Medium",estimate:"8h"}}]}]},{id:"design",name:"Design",description:"User experience and visual design",iconName:"Palette",color:"bg-pink-600",type:"category",actions:[{id:"view-designs",label:"View Designs",description:"See all design assets",iconName:"Image",action:e=>console.log("View designs",e)},{id:"create-mockup",label:"Create Mockup",iconName:"Plus",action:e=>console.log("Create mockup",e)}],children:[{id:"assets",name:"Assets",description:"Design assets and components",iconName:"Package",color:"bg-pink-500",type:"list",actions:[{id:"add-asset",label:"Add Asset",iconName:"Plus",action:e=>console.log("Add asset",e)},{id:"organize-assets",label:"Organize",iconName:"FolderOpen",action:e=>console.log("Organize assets",e)}],data:[{id:"asset-1",title:"Logo Variations",subtitle:"Brand Assets",value:"12 files",metadata:{format:"SVG",size:"2.4MB",updated:"2024-01-20"}},{id:"asset-2",title:"UI Components",subtitle:"Component Library",value:"45 components",metadata:{format:"Figma",size:"18.7MB",updated:"2024-01-22"}}]}]},{id:"product",name:"Product",description:"Product management and strategy",iconName:"Layers",color:"bg-indigo-600",type:"category",actions:[{id:"view-roadmap",label:"View Roadmap",description:"See product roadmap",iconName:"Map",action:e=>console.log("View roadmap",e)},{id:"create-feature",label:"Create Feature",iconName:"Plus",action:e=>console.log("Create feature",e)}],children:[{id:"features",name:"Features",description:"Product features and requirements",iconName:"Star",color:"bg-indigo-500",type:"list",actions:[{id:"add-feature",label:"Add Feature",iconName:"Plus",action:e=>console.log("Add feature",e)},{id:"prioritize-features",label:"Prioritize",iconName:"ArrowUp",action:e=>console.log("Prioritize features",e)}],data:[{id:"feature-1",title:"User Authentication",subtitle:"Security Feature",value:"In Development",metadata:{priority:"High",effort:"Large",impact:"High"}},{id:"feature-2",title:"Dark Mode",subtitle:"UI Enhancement",value:"Backlog",metadata:{priority:"Medium",effort:"Small",impact:"Medium"}}]}]}];function ai(e){let t=ft,a=null;for(let o of e){if(a=t.find(s=>s.id===o||s.name===o)||null,!a)return null;t=a.children||[]}return a}function bt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function oi(e){return ft.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function ii(){return ft}function Vt({artefact:e,taskId:t,taskData:a,loading:o=!1,error:s=null}){let n=a||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},l=n.dateLogged;try{let r=new Date(n.dateLogged);isNaN(r.getTime())||(l=(0,ya.formatDistanceToNow)(r,{addSuffix:!0}))}catch{}return(0,ut.jsxs)(se,{className:"ut-full max-ut-md shadow-md",children:[(0,ut.jsx)(Ae,{className:"pb-2",children:(0,ut.jsx)("div",{className:"flex justify-between items-start",children:(0,ut.jsx)(Me,{className:"text-lg font-semibold",children:o?"Loading...":n.name})})}),(0,ut.jsx)(Ce,{className:"pb-2",children:o?(0,ut.jsx)("div",{className:"animate-pulse h-4 bg-gray-200 rounded ut-3/4 mb-2"}):s?(0,ut.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,ut.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,ut.jsx)(tt,{className:"pt-2 flex items-center justify-between",children:(0,ut.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,ut.jsx)(ha.Clock,{className:"h-3 ut-3 mr-1"}),(0,ut.jsxs)("span",{children:["Created ",l]}),(0,ut.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,ut.jsxs)("span",{children:["Task #",n.id]})]})})]})}var eo=require("@ai-sdk/react"),It=require("framer-motion");var kt=_(require("react")),qt=_(require("next/link"));var ka=require("@radix-ui/react-slot"),Da=_(require("react")),ri=(0,fa.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 ut-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=Da.forwardRef(({asChild:e=!1,className:t,size:a,variant:o,...s},n)=>(0,ut.jsx)(e?ka.Slot:"button",{className:c(ri({className:t,size:a,variant:o})),ref:n,...s}));T.displayName="Button";var Ta=_(require("react"));var ot=Ta.forwardRef(({className:e,type:t,...a},o)=>(0,ut.jsx)("input",{type:t,className:c("flex h-9 ut-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}));ot.displayName="Input";var it=_(require("react")),q=_(require("@radix-ui/react-dialog"));var Ma=q.Root;var ni=q.Portal;var Ia=it.forwardRef(({className:e,...t},a)=>(0,ut.jsx)(q.Overlay,{ref:a,className:c("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}));Ia.displayName=q.Overlay.displayName;var Gt=it.forwardRef(({className:e,children:t,...a},o)=>(0,ut.jsxs)(ni,{children:[(0,ut.jsx)(Ia,{}),(0,ut.jsxs)(q.Content,{ref:o,className:c("fixed left-[50%] top-[50%] z-50 grid ut-full max-ut-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-ha-left-1/2 data-[state=closed]:slide-out-ha-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,ut.jsxs)(q.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,ut.jsx)(ha.X,{className:"h-4 ut-4"}),(0,ut.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));Gt.displayName=q.Content.displayName;var Wt=({className:e,...t})=>(0,ut.jsx)("div",{className:c("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wt.displayName="DialogHeader";var si=({className:e,...t})=>(0,ut.jsx)("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});si.displayName="DialogFooter";var $t=it.forwardRef(({className:e,...t},a)=>(0,ut.jsx)(q.Title,{ref:a,className:c("text-lg font-semibold leading-none tracking-tight",e),...t}));$t.displayName=q.Title.displayName;var li=it.forwardRef(({className:e,...t},a)=>(0,ut.jsx)(q.Description,{ref:a,className:c("text-sm text-muted-foreground",e),...t}));li.displayName=q.Description.displayName;var rt=_(require("@radix-ui/react-checkbox")),La=_(require("react")),Kt=La.forwardRef(({className:e,...t},a)=>(0,ut.jsx)(rt.Root,{className:c("peer h-4 ut-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,ut.jsx)(rt.Indicator,{className:c("flex items-center justify-center text-current"),children:(0,ut.jsx)(ha.Check,{className:"h-4 ut-4"})})}));Kt.displayName=rt.Root.displayName;var Ne=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var za=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,ut.jsx)(ha.Palette,{className:"h-4 ut-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,ut.jsx)(ha.Code,{className:"h-4 ut-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,ut.jsx)(ha.TrendingUp,{className:"h-4 ut-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,ut.jsx)(ha.DollarSign,{className:"h-4 ut-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,ut.jsx)(ha.Users,{className:"h-4 ut-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,ut.jsx)(ha.Wrench,{className:"h-4 ut-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,ut.jsx)(ha.Scale,{className:"h-4 ut-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,ut.jsx)(ha.Package,{className:"h-4 ut-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,ut.jsx)(ha.Zap,{className:"h-4 ut-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,ut.jsx)(ha.Building2,{className:"h-4 ut-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],xt=[{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 _t=[{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}],ht=[{id:"backlog",name:"Backlog",description:"Tasks not yet assigned ha 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}],Ct=[{id:"1",title:"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",title:"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",title:"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",title:"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",title:"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",title:"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",title:"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")}],ci=[...Ct,{id:"8",title:"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",title:"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",title:"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",title:"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",title:"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")}],di=[...xt,{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}],yt={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:[]},Ua={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:Ct.filter(e=>e.epicId==="1")};var kr={empty:{initialProjects:yt.projects,initialEpics:yt.epics,initialSprints:yt.sprints,initialTasks:yt.tasks},default:{initialProjects:xt,initialEpics:_t,initialSprints:ht,initialTasks:Ct},highDensity:{initialProjects:xt,initialEpics:_t,initialSprints:ht,initialTasks:ci},singleEpic:{initialProjects:xt,initialEpics:Ua.epics,initialSprints:ht,initialTasks:Ua.tasks},multipleProjects:{initialProjects:di,initialEpics:_t,initialSprints:ht,initialTasks:Ct}},wt=[{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(Ne),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Ne),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(Ne),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Ne),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 ha 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(Ne),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Ne),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(Ne),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Ne),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 ha customer inquiries, troubleshoot common issues, provide product information, and escalate complex cases ha human agents.",capabilities:["Customer Support","Issue Resolution","Product Knowledge","Escalation Management","Chat Support"],knowledge:["Product Documentation","FAQ","Troubleshooting Guides","Customer Service Best Practices"].map(Ne),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Ne),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Pr=[{id:"1",title:"Review quarterly report",description:"Go through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:wt.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:wt.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 ha production",description:"Deploy the latest version ha production environment",dueDate:new Date,dueTime:"16:00",colleague:wt.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 Dr=wt.filter(e=>e.type==="digital");function Ea(e,t){let[a,o]=(0,qe.useState)(()=>{if(typeof window>"u")return t;try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}),s=n=>{try{o(n),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(n))}catch{}};return(0,qe.useEffect)(()=>{s(a)},[]),[a,s]}function Jt({items:e,isOpen:t,isMobile:a=!1,onClose:o,currentBusinessUnit:s=za[0],onBusinessUnitChange:n,onSearch:l,className:r,logo:u="/headerlogo.png",appName:p="Nuvia",tagline:R="Collaboration Platform"}){let[v,k]=kt.useState({}),[D,z]=Ea("sidebar-favorites",{}),[P,C]=kt.useState(null),[S,A]=kt.useState(""),x=d=>{k(M=>({...M,[d]:!M[d]}))},O=d=>{n?.(d)},te=()=>{S.trim()&&l?.(S.trim())},$=d=>{d.key==="Enter"&&(d.preventDefault(),te())},ie=(d,M)=>{let L=D[d]||[],m=L.includes(M)?L.filter(B=>B!==M):L.concat(M);z({...D,[d]:m})},X=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let M=D[d.id]||[],L=d.items.filter(B=>M.includes(B.id)),m=d.items.filter(B=>!M.includes(B.id));return[...L,...m].slice(0,d.maxItems)},K=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,Z=e,be=d=>{let M=K(d),L=X(d),m=(0,ut.jsxs)(ut.Fragment,{children:[(0,ut.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,ut.jsx)("span",{children:d.title})]}),d.badge&&(0,ut.jsx)(le,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,ut.jsx)(ha.ChevronDown,{className:c("ml-2 h-4 ut-4 transition-transform",v[d.title]?"rotate-180":"")})]}),B=c("flex ut-full items-center justify-between rounded-2xl px-3 py-2 text-sm font-medium",d.isActive?"bg-primary/10 text-primary":"hover:bg-muted");return d.url?(0,ut.jsx)(qt.default,{href:d.url,className:B,onClick:a?o:void 0,children:m}):(0,ut.jsx)("button",{className:B,onClick:()=>d.items&&x(d.title),children:m})},I=()=>{let d=e.find(L=>L.id===P);if(!d||!d.items||!d.maxItems)return null;let M=D[d.id]||[];return(0,ut.jsx)(Ma,{open:!!P,onOpenChange:L=>!L&&C(null),children:(0,ut.jsxs)(Gt,{className:"sm:max-ut-md",children:[(0,ut.jsxs)(Wt,{children:[(0,ut.jsxs)($t,{children:["Manage ",d.title," Favorites"]}),(0,ut.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up ha ",d.maxItems," items ha show in ",d.title.toLowerCase(),"."]})]}),(0,ut.jsx)(ge,{className:"max-h-96 pr-4",children:(0,ut.jsx)("div",{className:"space-y-4",children:d.items.map(L=>(0,ut.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,ut.jsx)(Kt,{id:L.id,checked:M.includes(L.id),onCheckedChange:()=>ie(d.id,L.id),disabled:!M.includes(L.id)&&M.length>=(d.maxItems||0)}),(0,ut.jsxs)("label",{htmlFor:L.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:[L.title,L.badge&&(0,ut.jsx)(le,{variant:"outline",className:"text-xs",children:L.badge})]})]},L.id))})})]})})},Se=(0,ut.jsxs)("div",{className:"flex h-full flex-col border-r bg-background",children:[(0,ut.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,ut.jsxs)("div",{className:"flex items-center gap-3",children:[(0,ut.jsx)("div",{className:"flex h-14 ut-14 items-center justify-center",children:(0,ut.jsx)("img",{src:u,alt:"Header Logo",className:"h-14 ut-14 object-contain"})}),(0,ut.jsxs)("div",{children:[(0,ut.jsx)("h2",{className:"font-semibold",children:p}),(0,ut.jsx)("p",{className:"text-xs text-muted-foreground",children:R})]})]}),a&&(0,ut.jsx)(T,{variant:"ghost",size:"icon",onClick:o,children:(0,ut.jsx)(ha.X,{className:"h-5 ut-5"})})]}),(0,ut.jsx)("div",{className:"px-3 py-2",children:(0,ut.jsxs)("div",{className:"relative",children:[(0,ut.jsx)(ha.Search,{className:"absolute left-3 top-3 h-4 ut-4 text-muted-foreground"}),(0,ut.jsx)(ot,{type:"search",placeholder:"Search...",className:"ut-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:S,onChange:d=>A(d.target.value),onKeyPress:$})]})}),(0,ut.jsx)(ge,{className:"flex-1 px-3 py-2",children:(0,ut.jsx)("div",{className:"space-y-1",children:Z.map(d=>(0,ut.jsxs)("div",{className:"mb-1",children:[be(d),d.items&&v[d.title]&&(0,ut.jsxs)("div",{className:"mt-1 ml-6 space-y-1 border-l pl-3",children:[X(d).map(M=>(0,ut.jsxs)(qt.default,{href:M.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:a?o:void 0,children:[M.title,M.badge&&(0,ut.jsx)(le,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:M.badge})]},M.id)),K(d)&&d.items&&d.items.length>X(d).length&&(0,ut.jsxs)("button",{onClick:()=>C(d.id),className:"ut-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",d.items.length-X(d).length," more available"]})]})]},d.id))})}),(0,ut.jsx)("div",{className:"border-t p-3",children:(0,ut.jsx)("div",{className:"space-y-1",children:(0,ut.jsxs)("button",{className:"flex ut-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,ut.jsx)(ha.Settings,{className:"h-5 ut-5"}),(0,ut.jsx)("span",{children:"Settings"})]})})}),(0,ut.jsx)(I,{})]});return a?(0,ut.jsx)("div",{className:c("fixed inset-y-0 left-0 z-50 ut-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",r),children:Se}):(0,ut.jsx)("div",{className:c("fixed inset-y-0 left-0 z-30 ut-64 transform border-r bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",r),children:Se})}var Fa=_(require("react")),ye=_(require("@radix-ui/react-tooltip"));var Pt=ye.Provider,Dt=ye.Root,St=ye.Trigger,nt=Fa.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,ut.jsx)(ye.Portal,{children:(0,ut.jsx)(ye.Content,{ref:o,sideOffset:t,className:c("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})}));nt.displayName=ye.Content.displayName;var ja=require("next-themes");function Ha(){let{setTheme:e,theme:t}=(0,ja.useTheme)();return(0,ut.jsx)(Pt,{children:(0,ut.jsxs)(Dt,{children:[(0,ut.jsx)(St,{asChild:!0,children:(0,ut.jsxs)(T,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,ut.jsx)(ha.Sun,{className:"h-5 ut-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,ut.jsx)(ha.Moon,{className:"absolute h-5 ut-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,ut.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,ut.jsx)(nt,{children:"Toggle theme"})]})})}function Oa({notifications:e,open:t,onClose:a,onNotificationRemove:o,onRemoveAll:s,className:n}){let l=e.filter(p=>!p.read),r=l.length,u=p=>{switch(p){case"info":return(0,ut.jsx)(ha.Info,{className:"h-5 ut-5 text-blue-500"});case"success":return(0,ut.jsx)(ha.Check,{className:"h-5 ut-5 text-green-500"});case"warning":return(0,ut.jsx)(ha.AlertTriangle,{className:"h-5 ut-5 text-amber-500"});case"error":return(0,ut.jsx)(ha.AlertTriangle,{className:"h-5 ut-5 text-red-500"})}};return(0,ut.jsx)(It.AnimatePresence,{children:t&&(0,ut.jsxs)(ut.Fragment,{children:[(0,ut.jsx)(It.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,ut.jsx)(It.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:c("fixed inset-y-0 right-0 z-50 ut-full max-ut-sm border-l bg-background shadow-lg md:ut-96",n),children:(0,ut.jsxs)("div",{className:"flex h-full flex-col",children:[(0,ut.jsxs)("div",{className:"flex items-center justify-between border-ut p-4",children:[(0,ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ut.jsx)(ha.Bell,{className:"h-5 ut-5"}),(0,ut.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),r>0&&(0,ut.jsxs)(le,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[r," new"]})]}),(0,ut.jsxs)(T,{variant:"ghost",size:"icon",onClick:a,className:"rounded-full",children:[(0,ut.jsx)(ha.X,{className:"h-5 ut-5"}),(0,ut.jsx)("span",{className:"sr-only",children:"Close"})]})]}),r>0&&(0,ut.jsxs)("div",{className:"flex items-center justify-between border-ut p-2",children:[(0,ut.jsxs)("span",{className:"text-sm text-muted-foreground",children:[r," unread notification",r!==1?"s":""]}),(0,ut.jsx)(T,{variant:"ghost",size:"sm",onClick:s,className:"text-sm",children:"Dismiss all"})]}),l.length>0?(0,ut.jsx)(ge,{className:"flex-1",children:(0,ut.jsx)("div",{className:"divide-y",children:l.map(p=>(0,ut.jsxs)("div",{className:c("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,ut.jsx)("div",{className:"flex h-10 ut-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:u(p.type)}),(0,ut.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,ut.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ut.jsx)("p",{className:"font-medium",children:p.title}),(0,ut.jsxs)("div",{className:"flex items-center gap-2",children:[(0,ut.jsx)("p",{className:"text-xs text-muted-foreground",children:p.time}),(0,ut.jsx)(T,{variant:"ghost",size:"sm",className:"h-6 ut-6 p-0",onClick:()=>o?.(p.id),title:"Dismiss",children:(0,ut.jsx)(ha.Check,{className:"h-3 ut-3"})})]})]}),(0,ut.jsx)("p",{className:"text-sm text-muted-foreground",children:p.description}),p.actionLabel&&(0,ut.jsxs)(T,{variant:"link",size:"sm",className:"h-auto p-0 text-sm",onClick:p.onAction,children:[p.actionLabel,(0,ut.jsx)(ha.ChevronRight,{className:"ml-1 h-3 ut-3"})]})]})]},p.id))})}):(0,ut.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,ut.jsx)("div",{className:"flex h-16 ut-16 items-center justify-center rounded-full bg-muted",children:(0,ut.jsx)(ha.Bell,{className:"h-8 ut-8 text-muted-foreground"})}),(0,ut.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,ut.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var We=_(require("@radix-ui/react-tabs"));function Va({className:e,...t}){return(0,ut.jsx)(We.Root,{"data-slot":"tabs",className:c("flex flex-col gap-2",e),...t})}function Ga({className:e,...t}){return(0,ut.jsx)(We.List,{"data-slot":"tabs-list",className:c("bg-muted text-muted-foreground inline-flex h-9 ut-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Wa({className:e,...t}){return(0,ut.jsx)(We.Trigger,{"data-slot":"tabs-trigger",className:c("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 Ie=_(require("react")),N=_(require("@radix-ui/react-dropdown-menu")),Je=require("@radix-ui/react-icons");var $a=N.Root,Ka=N.Trigger;var mi=Ie.forwardRef(({className:e,inset:t,children:a,...o},s)=>(0,ut.jsxs)(N.SubTrigger,{ref:s,className:c("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,ut.jsx)(Je.ChevronRightIcon,{className:"ml-auto"})]}));mi.displayName=N.SubTrigger.displayName;var pi=Ie.forwardRef(({className:e,...t},a)=>(0,ut.jsx)(N.SubContent,{ref:a,className:c("z-50 min-ut-[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}));pi.displayName=N.SubContent.displayName;var Qt=Ie.forwardRef(({className:e,sideOffset:t=4,...a},o)=>(0,ut.jsx)(N.Portal,{children:(0,ut.jsx)(N.Content,{ref:o,sideOffset:t,className:c("z-50 min-ut-[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})}));Qt.displayName=N.Content.displayName;var Yt=Ie.forwardRef(({className:e,inset:t,...a},o)=>(0,ut.jsx)(N.Item,{ref:o,className:c("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}));Yt.displayName=N.Item.displayName;var ui=Ie.forwardRef(({className:e,children:t,checked:a,...o},s)=>(0,ut.jsxs)(N.CheckboxItem,{ref:s,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...o,children:[(0,ut.jsx)("span",{className:"absolute left-2 flex h-3.5 ut-3.5 items-center justify-center",children:(0,ut.jsx)(N.ItemIndicator,{children:(0,ut.jsx)(Je.CheckIcon,{className:"h-4 ut-4"})})}),t]}));ui.displayName=N.CheckboxItem.displayName;var gi=Ie.forwardRef(({className:e,children:t,...a},o)=>(0,ut.jsxs)(N.RadioItem,{ref:o,className:c("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[(0,ut.jsx)("span",{className:"absolute left-2 flex h-3.5 ut-3.5 items-center justify-center",children:(0,ut.jsx)(N.ItemIndicator,{children:(0,ut.jsx)(Je.DotFilledIcon,{className:"h-4 ut-4 fill-current"})})}),t]}));gi.displayName=N.RadioItem.displayName;var fi=Ie.forwardRef(({className:e,inset:t,...a},o)=>(0,ut.jsx)(N.Label,{ref:o,className:c("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));fi.displayName=N.Label.displayName;var bi=Ie.forwardRef(({className:e,...t},a)=>(0,ut.jsx)(N.Separator,{ref:a,className:c("-mx-1 my-1 h-px bg-muted",e),...t}));bi.displayName=N.Separator.displayName;var vi=({className:e,...t})=>(0,ut.jsx)("span",{className:c("ml-auto text-xs tracking-widest opacity-60",e),...t});vi.displayName="DropdownMenuShortcut";function qa({activeTab:e,onTabChange:t,tabOptions:a,className:o="",maxWidth:s="700px",gridCols:n=6}){let l=a.find(r=>r.value===e);return(0,ut.jsxs)(It.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,ut.jsx)("div",{className:"hidden md:block",children:(0,ut.jsx)(Va,{value:e,onValueChange:t,children:(0,ut.jsx)(Ga,{className:"grid ut-full rounded-2xl p-0 h-10",style:{maxWidth:s,gridTemplateColumns:`repeat(${Math.min(n,a.length)}, minmax(0, 1fr))`},children:a.map(r=>(0,ut.jsx)(It.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,ut.jsx)(Wa,{value:r.value,className:"ut-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:r.label})},r.value))})})}),(0,ut.jsx)("div",{className:"md:hidden",children:(0,ut.jsxs)($a,{children:[(0,ut.jsx)(Ka,{asChild:!0,children:(0,ut.jsxs)(T,{variant:"outline",className:"rounded-2xl min-ut-[140px] justify-between",children:[l?.label||"Select",(0,ut.jsx)(ha.ChevronDown,{className:"h-4 ut-4 ml-2"})]})}),(0,ut.jsx)(Qt,{align:"center",className:"ut-[180px]",children:a.map(r=>(0,ut.jsx)(Yt,{onClick:()=>t?.(r.value),className:`cursor-pointer ${e===r.value?"bg-accent":""}`,children:r.label},r.value))})]})})]})}function Ja({title:e,notifications:t=[],onToggleSidebar:a,onToggleMobileMenu:o,sidebarOpen:s=!0,className:n,activeTab:l="assistant",onTabChange:r,showTabs:u=!0,tabOptions:p=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:R,actionIcon:v=(0,ut.jsx)(ha.Bot,{className:"mr-2 h-4 ut-4"}),actionText:k="Action",onNotificationRemove:D,onRemoveAll:z,logo:P="/headerlogo.png",appName:C="Nuvia",tagline:S="Collaboration Platform"}){let[A,x]=(0,qe.useState)(!1),[O,te]=(0,qe.useState)(t),$=O.filter(K=>!K.read).length,ie=K=>{te(Z=>Z.filter(be=>be.id!==K)),D?.(K)},X=()=>{te(K=>K.filter(Z=>Z.read)),z?.()};return(0,ut.jsxs)(ut.Fragment,{children:[(0,ut.jsxs)("header",{className:`sticky top-0 z-10 flex h-16 items-center gap-3 border-ut bg-background/95 px-4 backdrop-blur ${n||""}`,children:[(0,ut.jsx)(T,{variant:"ghost",size:"icon",className:"md:hidden",onClick:o,children:(0,ut.jsx)(ha.Menu,{className:"h-5 ut-5"})}),(0,ut.jsx)(T,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:a,children:(0,ut.jsx)(ha.PanelLeft,{className:"h-5 ut-5"})}),!s&&(0,ut.jsxs)(It.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,ut.jsx)("div",{className:"flex h-10 ut-10 items-center justify-center",children:(0,ut.jsx)("img",{src:P,alt:"Logo",className:"h-10 ut-10 object-contain"})}),(0,ut.jsxs)("div",{children:[(0,ut.jsx)("h2",{className:"font-semibold text-sm",children:C}),(0,ut.jsx)("p",{className:"text-xs text-muted-foreground",children:S})]})]}),(0,ut.jsxs)("div",{className:"flex flex-1 items-center",children:[u&&(0,ut.jsx)(qa,{activeTab:l,onTabChange:r,tabOptions:p}),(0,ut.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,ut.jsx)(It.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,ut.jsx)(It.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ut.jsxs)(T,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:R,children:[v,k]})})}),(0,ut.jsx)(Ha,{}),(0,ut.jsx)(Pt,{children:(0,ut.jsxs)(Dt,{children:[(0,ut.jsx)(St,{asChild:!0,children:(0,ut.jsx)(It.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ut.jsxs)(T,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>x(!0),children:[(0,ut.jsx)(It.motion.div,{animate:$>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:$>0?1/0:0,repeatDelay:3},children:(0,ut.jsx)(ha.Bell,{className:"h-5 ut-5"})}),$>0&&(0,ut.jsx)(It.motion.span,{className:"absolute -right-1 -top-1 flex h-5 ut-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:$})]})})}),(0,ut.jsx)(nt,{children:"Notifications"})]})}),(0,ut.jsx)(It.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,ut.jsxs)(me,{className:"h-9 ut-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,ut.jsx)(ze,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,ut.jsx)(pe,{})]})})]})]})]}),(0,ut.jsx)(Oa,{notifications:O,open:A,onClose:()=>x(!1),onNotificationRemove:ie,onRemoveAll:X})]})}var Xa=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,ut.jsx)(ha.User,{className:"h-4 ut-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Ya({sidebarItems:e,children:t,title:a="Digital Colleagues",notifications:o=[],currentBusinessUnit:s=Xa[0],onBusinessUnitChange:n,onSearch:l,businessUnits:r=Xa,activeTab:u,onTabChange:p,showTabs:R=!1,onActionClick:v,actionIcon:k,actionText:D="Action",onNotificationRemove:z,onRemoveAll:P,logo:C="/headerlogo.png",appName:S="Nuvia",tagline:A="Collaboration Platform"}){let[x,O]=(0,qe.useState)(!0),[te,$]=(0,qe.useState)(!1),[ie,X]=(0,qe.useState)(s),K=Z=>{X(Z),n?.(Z)};return(0,ut.jsxs)("div",{className:"flex h-full flex-col overflow-hidden rounded-xl border bg-background ut-[]",children:[te&&(0,ut.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>$(!1)}),(0,ut.jsx)("div",{className:"md:hidden",children:(0,ut.jsx)(Jt,{items:e,isOpen:te,isMobile:!0,onClose:()=>$(!1),currentBusinessUnit:ie,onBusinessUnitChange:K,onSearch:l,logo:C,appName:S,tagline:A})}),(0,ut.jsx)("div",{className:"hidden md:block",children:(0,ut.jsx)(Jt,{items:e,isOpen:x,isMobile:!1,currentBusinessUnit:ie,onBusinessUnitChange:K,onSearch:l,logo:C,appName:S,tagline:A})}),(0,ut.jsxs)("div",{className:c("min-h-screen fixed ut-full transition-all duration-300 ease-in-out",x?"md:pl-64":"md:pl-0"),children:[(0,ut.jsx)(Ja,{title:a,notifications:o,onToggleSidebar:()=>O(!x),onToggleMobileMenu:()=>$(!0),sidebarOpen:x,activeTab:u,onTabChange:p,showTabs:R,onActionClick:v,actionIcon:k,actionText:D,onNotificationRemove:z,onRemoveAll:P,logo:C,appName:S,tagline:A}),(0,ut.jsx)("main",{className:"flex-1 p-0 flex flex-col h-[calc(100vh-4rem)] overflow-auto",children:t})]})]})}function Za({sessions:e,currentSession:t,teams:a,onNewChat:o,onSessionSelect:s,onSessionEdit:n,onSessionDelete:l,className:r}){return(0,ut.jsx)("div",{className:`space-y-4 ${r||""}`,children:(0,ut.jsxs)(se,{className:"shadow-sm",children:[(0,ut.jsx)("div",{className:"p-4 border-ut",children:(0,ut.jsxs)("div",{className:"flex items-center justify-between",children:[(0,ut.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,ut.jsx)(ha.Clock,{className:"h-4 ut-4"}),"Recent Chats"]}),(0,ut.jsxs)(T,{onClick:o,size:"sm",className:"gap-1 h-7 px-2 rounded-lg shadow-sm",children:[(0,ut.jsx)(ha.Plus,{className:"h-3 ut-3"}),"New"]})]})}),(0,ut.jsx)(ge,{className:"h-[600px]",children:(0,ut.jsx)("div",{className:"p-2",children:e.length===0?(0,ut.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(u=>(0,ut.jsx)("div",{className:c("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===u.id&&"bg-muted border"),onClick:()=>s(u),children:(0,ut.jsx)("div",{className:"flex items-start gap-3",children:(0,ut.jsxs)("div",{className:"flex-1 min-ut-0",children:[(0,ut.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,ut.jsx)("h4",{className:"font-medium text-sm truncate",children:u.title}),(0,ut.jsx)("div",{className:"flex items-center gap-1",children:(0,ut.jsxs)("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity flex gap-1",children:[n&&(0,ut.jsx)(T,{variant:"ghost",size:"icon",className:"h-5 ut-5 rounded",onClick:p=>{p.stopPropagation(),n(u.id)},children:(0,ut.jsx)(ha.Edit3,{className:"h-3 ut-3"})}),l&&(0,ut.jsx)(T,{variant:"ghost",size:"icon",className:"h-5 ut-5 rounded text-destructive hover:text-destructive",onClick:p=>{p.stopPropagation(),l(u.id)},children:(0,ut.jsx)(ha.Trash2,{className:"h-3 ut-3"})})]})})]}),(0,ut.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:u.lastMessage})]})})},u.id))})})]})})}function ta({capabilities:e,isOpen:t,onToggle:a,onActionSelect:o,onContextChange:s,colorScheme:n=Ot,className:l}){let[r,u]=(0,$e.useState)([]),[p,R]=(0,$e.useState)([]),v=r[r.length-1],k=v?.children||e,D=(x,O)=>{switch(x.type){case"category":return n.categories[O%n.categories.length];case"list":return n.lists[O%n.lists.length];case"item":return n.items[O%n.items.length];default:return n.primary}},z=(0,$e.useMemo)(()=>({path:r,selectedItems:p,filters:{}}),[r,p]);(0,$e.useEffect)(()=>{s&&s(z)},[z,s]);let P=x=>{x.type==="category"||x.type==="list"?u([...r,x]):x.type==="item"&&R([...p,x])},C=()=>{u(r.slice(0,-1))},S=x=>{u(r.slice(0,x+1))},A=()=>v?.actions?v.actions:[];return t?(0,ut.jsxs)("div",{className:c("ut-full",l),children:[(0,ut.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,ut.jsxs)("div",{className:"flex items-center gap-2",children:[r.length>0&&(0,ut.jsx)(It.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:C,className:c("group p-1 h-6 ut-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,ut.jsx)(ha.ChevronLeft,{className:c("h-3 ut-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,ut.jsx)("h4",{className:"font-medium text-sm",children:v?.name||"Capabilities"})]}),(0,ut.jsx)(It.motion.button,{whileHover:{scale:1.1,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.9,transition:{duration:.15,ease:[.4,0,.2,1]}},onClick:a,className:c("group p-1 h-6 ut-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,ut.jsx)(ha.X,{className:c("h-3 ut-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),r.length>0&&(0,ut.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,ut.jsx)(It.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>u([]),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ut.jsxs)("span",{className:"relative",children:["Capabilities",(0,ut.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ut-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ut-full"})]})}),r.map((x,O)=>(0,ut.jsxs)("div",{className:"flex items-center gap-1",children:[(0,ut.jsx)(ha.ChevronRight,{className:"h-2 ut-2"}),(0,ut.jsx)(It.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>S(O),className:c("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,ut.jsxs)("span",{className:"relative",children:[x.name,(0,ut.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ut-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ut-full"})]})})]},x.id))]}),(0,ut.jsx)("div",{className:"max-h-40 overflow-y-auto",children:(0,ut.jsx)(It.AnimatePresence,{mode:"wait",children:(0,ut.jsx)(It.motion.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:v?.type==="list"&&v.data?(0,ut.jsx)(xi,{data:v.data,onItemSelect:x=>R([...p,x]),colorScheme:n}):(0,ut.jsx)(hi,{capabilities:k,onSelect:P,colorScheme:n})},v?.id||"root")})})]}):(0,ut.jsxs)(T,{onClick:a,size:"sm",variant:"outline",className:"rounded-full",children:[(0,ut.jsx)(ha.Menu,{className:"h-4 ut-4"}),(0,ut.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function hi({capabilities:e,onSelect:t,colorScheme:a}){return(0,ut.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,ut.jsx)(yi,{capability:o,onClick:()=>t(o),color:a.categories[s%a.categories.length]},o.id))})}function yi({capability:e,onClick:t,selected:a,color:o}){return(0,ut.jsxs)(It.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm",a&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,ut.jsx)("div",{className:c("ut-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o)}),(0,ut.jsxs)("span",{className:"truncate relative",children:[e.name,(0,ut.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ut-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ut-full"})]}),(e.children||e.data)&&(0,ut.jsx)(ha.ChevronRight,{className:c("h-3 ut-3 text-muted-foreground flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:translate-x-0.5")}),e.type==="list"&&e.data&&(0,ut.jsx)(le,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function xi({data:e,onItemSelect:t,colorScheme:a}){return(0,ut.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((o,s)=>(0,ut.jsxs)(It.motion.button,{whileHover:{scale:1.02,transition:{duration:.3,ease:[.4,0,.2,1]}},whileTap:{scale:.95,transition:{duration:.15,ease:[.4,0,.2,1]}},className:c("group relative inline-flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer","bg-background text-left text-sm font-medium backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:border-accent/50 hover:shadow-sm"),onClick:()=>t(o),children:[(0,ut.jsx)("div",{className:c("ut-2 h-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a.items[s%a.items.length])}),(0,ut.jsxs)("div",{className:"flex-1 min-ut-0",children:[(0,ut.jsxs)("span",{className:"truncate relative font-medium",children:[o.title,(0,ut.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 ut-0 h-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:ut-full"})]}),o.subtitle&&(0,ut.jsx)("div",{className:c("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:o.subtitle})]}),o.value&&(0,ut.jsx)(le,{variant:"secondary",className:c("text-xs h-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:o.value})]},o.id))})}function aa(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function wi(e,t){return e.parts.some(a=>a.type===`tool-${t}`)}function Ci(e,t){return e.parts.find(a=>a.type===`tool-${t}`)}function Ni(e){return e.parts.some(t=>t.type==="file")}function ki(e){return e.parts.filter(t=>t.type==="file")}function Pi(e,t){return e.parts.some(a=>a.type===`data-${t}`)}function Di(e,t){return e.parts.find(a=>a.type===`data-${t}`)}function Mt({messages:e,input:t,isTyping:a=!1,currentSessionTitle:o,capabilities:s,fileUploads:n,isDragOver:l,enableFileUpload:r,onInputChange:u,onSendMessage:p,onKeyPress:R,onFileUpload:v,onRemoveFile:k,onDragOver:D,className:z}){let P=(0,qe.useRef)(null),C=(0,qe.useRef)(null),S=(0,qe.useRef)(null),[A,x]=(0,qe.useState)(!1),[O,te]=(0,qe.useState)({path:[],selectedItems:[],filters:{}});(0,qe.useEffect)(()=>{P.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,qe.useEffect)(()=>{A&&setTimeout(()=>{P.current?.scrollIntoView({behavior:"smooth"})},100)},[A]);let $=()=>bt(O),ie=()=>{let m=[];return s.forEach(B=>{B.actions&&B.actions.forEach(V=>{m.push({label:V.label,action:()=>X(V.id,{path:[B],selectedItems:[],filters:{}})})}),B.children&&B.children.forEach(V=>{V.type==="list"&&V.data&&m.push({label:`View ${V.name}`,action:()=>x(!0)})})}),m.slice(0,5)},X=(m,B)=>{console.log("Capability action:",m,B);let V=`Executing ${m} with context: ${JSON.stringify(B.path.map(de=>de.name))}`;x(!1)},K=bt({path:[],selectedItems:[],filters:{}}),Z=m=>{v(m.target.files),m.target.files&&(m.target.value="")},be=m=>{m.preventDefault(),D(!0)},I=m=>{m.preventDefault(),D(!1)},Se=m=>{m.preventDefault(),D(!1),v(m.dataTransfer.files)},d=m=>{if(m===0)return"0 Bytes";let B=1024,V=["Bytes","KB","MB","GB"],de=Math.floor(Math.log(m)/Math.log(B));return parseFloat((m/Math.pow(B,de)).toFixed(2))+" "+V[de]},M=m=>m.startsWith("image/")?(0,ut.jsx)(ha.Image,{className:"h-4 ut-4"}):m.startsWith("text/")?(0,ut.jsx)(ha.FileText,{className:"h-4 ut-4"}):(0,ut.jsx)(ha.File,{className:"h-4 ut-4"}),L=m=>{let B=m.role==="assistant",V=m.role==="user",de=aa(m);return(0,ut.jsxs)("div",{className:c("flex items-start gap-3",V?"flex-row-reverse":""),children:[(0,ut.jsx)(me,{className:"h-8 ut-8 shrink-0",children:(0,ut.jsx)(pe,{className:c(V?"bg-primary text-primary-foreground":"bg-gradient-ha-br from-purple-600 ha-blue-600 text-white"),children:V?(0,ut.jsx)(ha.User,{className:"h-4 ut-4"}):(0,ut.jsx)(ha.Bot,{className:"h-4 ut-4"})})}),(0,ut.jsxs)("div",{className:c("max-ut-[80%] rounded-2xl px-4 py-3 shadow-sm",V?"bg-primary text-primary-foreground":"bg-muted"),children:[de&&(0,ut.jsx)("div",{className:"mb-2 last:mb-0",children:(0,ut.jsx)("p",{className:"text-sm",children:de})}),m.parts.map((j,re)=>{if(j.type==="text")return null;if(j.type==="file"){let y=j;return(0,ut.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,ut.jsxs)("div",{className:"flex items-center gap-2",children:[M(y.mimeType||"application/octet-stream"),(0,ut.jsxs)("div",{className:"flex-1 min-ut-0",children:[(0,ut.jsx)("p",{className:"text-sm font-medium truncate",children:y.name||y.url?.split("/").pop()||"File"}),y.size&&(0,ut.jsx)("p",{className:"text-xs opacity-70",children:d(y.size)}),y.mimeType&&(0,ut.jsx)("p",{className:"text-xs opacity-70",children:y.mimeType})]}),y.url&&(0,ut.jsx)(T,{variant:"ghost",size:"sm",onClick:()=>window.open(y.url,"_blank"),className:"h-8 ut-8 p-0",children:(0,ut.jsx)(ha.Download,{className:"h-4 ut-4"})})]})},re)}if(j.type.startsWith("tool-")){let y=j,we=j.type.replace("tool-","");if(we==="task")switch(y.state){case"input-available":return(0,ut.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},re);case"output-available":return(0,ut.jsx)("div",{className:"mb-2",children:(0,ut.jsx)(at,{data:{id:y.output?.id||y.input?.id,fetchLatest:!1,taskData:y.output||y.input}})},re);case"output-error":return(0,ut.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",y.errorText]},re);default:return null}if(we==="artefact")switch(y.state){case"input-available":return(0,ut.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},re);case"output-available":return(0,ut.jsx)("div",{className:"mb-2",children:(0,ut.jsx)(Vt,{artefact:y.output?.description||"",taskId:y.output?.id||y.input?.id,taskData:y.output||y.input})},re);case"output-error":return(0,ut.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",y.errorText]},re);default:return null}return(0,ut.jsx)("div",{className:"mb-2",children:(0,ut.jsxs)(se,{className:"ut-full max-ut-md",children:[(0,ut.jsx)(Ae,{children:(0,ut.jsx)(Me,{className:"text-lg",children:we})}),(0,ut.jsxs)(Ce,{children:[y.state==="input-available"&&(0,ut.jsxs)("p",{className:"text-sm",children:["Processing ",we,"..."]}),y.state==="output-available"&&(0,ut.jsx)("pre",{className:"text-sm",children:JSON.stringify(y.output,null,2)}),y.state==="output-error"&&(0,ut.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",y.errorText]})]})]})},re)}if(j.type.startsWith("data-")){let y=j,we=j.type.replace("data-","");return we==="reference"?(0,ut.jsx)("div",{className:"mb-2",children:(0,ut.jsx)(se,{className:"ut-full",children:(0,ut.jsx)(Ce,{className:"p-4",children:(0,ut.jsx)("div",{className:"space-y-2",children:y.data?.references?.map((ne,Ye)=>(0,ut.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,ut.jsx)(le,{variant:"outline",children:ne.type||"link"}),(0,ut.jsxs)("div",{className:"flex-1 min-ut-0",children:[(0,ut.jsx)("p",{className:"text-sm font-medium truncate",children:ne.title}),ne.description&&(0,ut.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:ne.description})]}),ne.url&&(0,ut.jsx)(T,{variant:"ghost",size:"sm",onClick:()=>window.open(ne.url,"_blank"),className:"h-8 ut-8 p-0",children:(0,ut.jsx)(ha.ExternalLink,{className:"h-4 ut-4"})})]},Ye))})})})},re):we==="menu"?(0,ut.jsx)("div",{className:"mb-2",children:(0,ut.jsxs)(se,{className:"ut-full",children:[(0,ut.jsx)(Ae,{children:(0,ut.jsx)(Me,{className:"text-lg",children:y.data?.title})}),(0,ut.jsx)(Ce,{children:(0,ut.jsx)("div",{className:"space-y-2",children:y.data?.items?.map((ne,Ye)=>(0,ut.jsx)(T,{variant:"outline",className:"ut-full justify-start",onClick:ne.action,children:(0,ut.jsxs)("div",{className:"text-left",children:[(0,ut.jsx)("p",{className:"font-medium",children:ne.label}),ne.description&&(0,ut.jsx)("p",{className:"text-xs text-muted-foreground",children:ne.description})]})},Ye))})})]})},re):(0,ut.jsx)("div",{className:"mb-2",children:(0,ut.jsxs)(se,{className:"ut-full max-ut-md",children:[(0,ut.jsx)(Ae,{children:(0,ut.jsx)(Me,{className:"text-lg",children:we})}),(0,ut.jsx)(Ce,{children:(0,ut.jsx)("pre",{className:"text-sm",children:JSON.stringify(y.data,null,2)})})]})},re)}return null})]})]})};return(0,ut.jsxs)(se,{className:`h-full flex flex-col shadow-sm ${z||""}`,children:[(0,ut.jsxs)(ge,{ref:C,className:"flex-1 p-4",onDragOver:be,onDragLeave:I,onDrop:Se,children:[(0,ut.jsxs)("div",{className:c("space-y-4",l&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,ut.jsx)(It.AnimatePresence,{children:e.map(m=>(0,ut.jsx)(It.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:c("flex gap-3",m.role==="user"?"flex-row-reverse":"flex-row"),children:L(m)},m.id))}),A&&(0,ut.jsxs)(It.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,ut.jsx)(me,{className:"h-8 ut-8",children:(0,ut.jsx)(pe,{className:"bg-gradient-ha-br from-purple-600 ha-blue-600 text-white",children:(0,ut.jsx)(ha.Bot,{className:"h-4 ut-4"})})}),(0,ut.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ut.jsx)(ta,{capabilities:s,isOpen:A,onToggle:()=>x(!A),onActionSelect:X,className:"ut-full"})})]}),a&&(0,ut.jsxs)(It.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,ut.jsx)(me,{className:"h-8 ut-8",children:(0,ut.jsx)(pe,{className:"bg-gradient-ha-br from-purple-600 ha-blue-600 text-white",children:(0,ut.jsx)(ha.Bot,{className:"h-4 ut-4"})})}),(0,ut.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,ut.jsxs)("div",{className:"flex space-x-1",children:[(0,ut.jsx)("div",{className:"ut-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,ut.jsx)("div",{className:"ut-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,ut.jsx)("div",{className:"ut-2 h-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,ut.jsx)("div",{ref:P})]}),n.length>0&&(0,ut.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,ut.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(m=>(0,ut.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[M(m.file.type),(0,ut.jsx)("span",{className:"text-sm font-medium",children:m.file.name}),(0,ut.jsx)("span",{className:"text-xs text-muted-foreground",children:d(m.file.size)}),(0,ut.jsx)(T,{variant:"ghost",size:"sm",onClick:()=>k(m.id),className:"h-6 ut-6 p-0",children:(0,ut.jsx)(ha.X,{className:"h-4 ut-4"})})]},m.id))})}),(0,ut.jsxs)("div",{className:"border-t p-4 bg-muted/20",children:[(0,ut.jsxs)("div",{className:"flex gap-3",children:[(0,ut.jsx)(ot,{value:t,onChange:m=>u(m.target.value),onKeyPress:R,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:a}),r&&(0,ut.jsx)(T,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl h-10 ut-10 shadow-sm",children:(0,ut.jsx)(ha.Paperclip,{className:"h-4 ut-4"})}),(0,ut.jsx)(T,{onClick:p,disabled:!t.trim()&&n.length===0||a,size:"icon",className:"rounded-2xl h-10 ut-10 shadow-sm",children:(0,ut.jsx)(ha.Send,{className:"h-4 ut-4"})})]}),(0,ut.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,ut.jsxs)(T,{onClick:()=>x(!A),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,ut.jsx)(ha.Menu,{className:"h-3 ut-3 mr-1"}),A?"Hide":"Show"," Capabilities"]}),(0,ut.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[$().map((m,B)=>(0,ut.jsx)(T,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>X(m.id,O),children:m.label},`context-${m.id}`)),$().length===0&&ie().map((m,B)=>(0,ut.jsx)(T,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:m.action,children:m.label},`suggestion-${B}`))]})]}),r&&(0,ut.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:Z,className:"hidden"})]})]})}function Si({aiConfig:e,useCustomChat:t,enableAI:a=!0,messages:o=[],businessUnits:s=[],capabilities:n=[],sidebarItems:l=[],notifications:r=[],sessions:u=[],onNewChat:p,onSessionSelect:R,onSessionDelete:v,onSessionEdit:k=()=>console.log("Session edit not implemented"),onBusinessUnitChange:D=()=>{},onNotificationRemove:z=()=>{},onRemoveAll:P=()=>{},onActionClick:C=()=>{},onSearch:S=d=>console.log("Search query:",d),initialTeam:A="design",currentSession:x=null,showCapabilities:O=!0,title:te="Digital Colleagues",enableFileUpload:$=!0,maxFileSize:ie=10,allowedFileTypes:X=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:K="/headerlogo.png",appName:Z="Nuvia",tagline:be="AI-Powered Workspace",actionIcon:I=(0,ut.jsx)(ha.Users,{className:"mr-2 h-4 ut-4"}),actionText:Se="Collaborate"}){let d=(0,eo.useChat)(e||{}),M=a?t||d:null,[L,m]=(0,qe.useState)(""),[B,V]=(0,qe.useState)(!1),de=M?.messages||o,j=L,re=M?.status==="submitted"||B,y=s||[],we={id:"default",name:"Default Team",description:"Default team when no business units are available",icon:"\u{1F3E2}",color:"bg-gray-500",accentColor:"bg-gray-600"},[ne,Ye]=(0,qe.useState)(()=>y.length===0?we:y.find(Q=>Q.id===A)||y[0]),[Bt,lt]=(0,qe.useState)([]),[ao,oo]=(0,qe.useState)(!1),io=Q=>{if(!Q||!$)return;let ct=[];Array.from(Q).forEach(ve=>{if(ve.size>ie*1024*1024){alert(`File ${ve.name} is too large. Maximum size is ${ie}MB.`);return}if(X.length>0&&!X.some(dt=>ve.type.match(dt))){alert(`File type ${ve.type} is not allowed.`);return}let ia={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ve,status:"pending",progress:0};if(ve.type.startsWith("image/")){let dt=new FileReader;dt.onload=lo=>{lt(co=>co.map(Lt=>Lt.id===ia.id?{...Lt,preview:lo.target?.result}:Lt))},dt.readAsDataURL(ve)}ct.push(ia)}),lt(ve=>[...ve,...ct])},ro=Q=>{lt(ct=>ct.filter(ve=>ve.id!==Q))},oa=()=>{if(!(!j.trim()&&Bt.length===0)){if(M){let Q={id:Date.now().toString(),role:"user",parts:[{type:"text",text:j}]};M.sendMessage(Q),m("")}else console.log("Message ha send:",j),console.log("Files ha upload:",Bt),m(""),V(!0),setTimeout(()=>{V(!1)},1500);lt([])}},no=Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),oa())},so=Q=>{m(Q)};return(0,ut.jsx)(Ya,{sidebarItems:l||[],title:te,notifications:r||[],businessUnits:y,currentBusinessUnit:ne,onBusinessUnitChange:Q=>{Q&&(Ye(Q),D?.(Q))},onSearch:S,showTabs:!1,onActionClick:C,actionIcon:I,actionText:Se,onNotificationRemove:z,onRemoveAll:P,logo:K,appName:Z,tagline:be,children:(0,ut.jsx)(It.AnimatePresence,{mode:"wait",children:(0,ut.jsx)(It.motion.div,{className:"flex-1 h-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2},children:(0,ut.jsxs)("div",{className:"h-full flex",children:[(0,ut.jsx)("div",{className:"ut-80 bg-muted/50 flex-shrink-0 h-full p-2",children:(0,ut.jsx)(Za,{sessions:u||[],currentSession:x,teams:y,onNewChat:p,onSessionSelect:R,onSessionEdit:k,onSessionDelete:v})}),(0,ut.jsx)("div",{className:"flex-1 h-full p-2",children:(0,ut.jsx)(Mt,{messages:de||[],input:j,isTyping:re,currentSessionTitle:x?.title,capabilities:n||[],onInputChange:so,onSendMessage:oa,onKeyPress:no,fileUploads:Bt,isDragOver:ao,enableFileUpload:$,onFileUpload:io,onRemoveFile:ro,onDragOver:oo})})]})},"chat-interface")})})}0&&(module.exports={CapabilityMenu,ChatCardArtefact,ChatCardTask,ChatInterface,ChatInterfaceMessages,ChatMessage,CopilotInterface,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,getDataPart,getFileParts,getTextContent,getToolPart,hasDataPart,hasFilePart,hasToolPart,testCapabilities});