cortex-react-components 2.27.0 → 2.28.1

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 (219) hide show
  1. package/dist/chunk-2TUBS2HM.mjs +4 -0
  2. package/dist/{chunk-JDIPWJBD.mjs → chunk-46N4YPMB.mjs} +1 -1
  3. package/dist/{chunk-FZX3ZPEU.mjs → chunk-4LUF5GZ6.mjs} +1 -1
  4. package/dist/chunk-6UULUGR2.mjs +1 -0
  5. package/dist/chunk-6ZMZX5TB.mjs +1 -0
  6. package/dist/{chunk-GHOL5L32.mjs → chunk-7BYNW77I.mjs} +1 -1
  7. package/dist/{chunk-ZEALRBXW.mjs → chunk-7DDFZ2M3.mjs} +1 -1
  8. package/dist/{chunk-C4RWEPVF.mjs → chunk-7MPZOMXK.mjs} +1 -1
  9. package/dist/{chunk-75F3LJMX.mjs → chunk-AABB4TFO.mjs} +1 -1
  10. package/dist/{chunk-GTZJWMZR.mjs → chunk-ALEPCEWP.mjs} +1 -1
  11. package/dist/{chunk-TJZVV3XH.mjs → chunk-ATPB5HSG.mjs} +1 -1
  12. package/dist/{chunk-RGOKBIQ5.mjs → chunk-CC57QZMB.mjs} +1 -1
  13. package/dist/{chunk-OQBCIB4L.mjs → chunk-CK2TD4BY.mjs} +1 -1
  14. package/dist/{chunk-NBJLXJQ3.mjs → chunk-COBOHCBL.mjs} +1 -1
  15. package/dist/chunk-DNMM3Q72.mjs +9 -0
  16. package/dist/{chunk-LJXTXROJ.mjs → chunk-EM4CGGGV.mjs} +1 -1
  17. package/dist/{chunk-AJQHGVZ5.mjs → chunk-FB5PBKLV.mjs} +1 -1
  18. package/dist/{chunk-TVTTUSWM.mjs → chunk-FBEHQRZ4.mjs} +1 -1
  19. package/dist/{chunk-VKCDLKYH.mjs → chunk-FJ2HHNPX.mjs} +1 -1
  20. package/dist/{chunk-TYARLEAC.mjs → chunk-G2DQLEAJ.mjs} +1 -1
  21. package/dist/chunk-G3BOVXUM.mjs +4 -0
  22. package/dist/{chunk-3Y7QG6VP.mjs → chunk-IISYRLNU.mjs} +1 -1
  23. package/dist/{chunk-NINFDOV5.mjs → chunk-ITNR7N47.mjs} +1 -1
  24. package/dist/chunk-IUVPH5LV.mjs +4 -0
  25. package/dist/chunk-JQL4XGAF.mjs +4 -0
  26. package/dist/{chunk-EM3T2XYC.mjs → chunk-L2OBO2VZ.mjs} +1 -1
  27. package/dist/chunk-LEZ6G4X7.mjs +4 -0
  28. package/dist/{chunk-2O54GV6Q.mjs → chunk-LJFBHY4P.mjs} +1 -1
  29. package/dist/chunk-MCOHKE2T.mjs +1 -0
  30. package/dist/{chunk-SWE754OC.mjs → chunk-MH4YPGH4.mjs} +1 -1
  31. package/dist/{chunk-RJGYVDOU.mjs → chunk-MU47F4UR.mjs} +1 -1
  32. package/dist/{chunk-4FEVXBNU.mjs → chunk-NCJAMNMQ.mjs} +1 -1
  33. package/dist/{chunk-WIRQ5IRT.mjs → chunk-NDBSSX6Q.mjs} +1 -1
  34. package/dist/{chunk-7NWIK57W.mjs → chunk-NXAXOI33.mjs} +1 -1
  35. package/dist/{chunk-3HNU2NYP.mjs → chunk-QDP657UR.mjs} +1 -1
  36. package/dist/{chunk-KEK763EH.mjs → chunk-QKDYTCZC.mjs} +1 -1
  37. package/dist/{chunk-FE7ZGUPU.mjs → chunk-RV4XL2CG.mjs} +1 -1
  38. package/dist/{chunk-2BRDNDUB.mjs → chunk-SME3D72Q.mjs} +1 -1
  39. package/dist/{chunk-LEF6M5ZD.mjs → chunk-SNFBF6KT.mjs} +1 -1
  40. package/dist/{chunk-7TSR2LQB.mjs → chunk-TIAA3ZN3.mjs} +1 -1
  41. package/dist/{chunk-3NRXQBBS.mjs → chunk-TIIYFAV6.mjs} +1 -1
  42. package/dist/{chunk-HSQAHQNP.mjs → chunk-TKCFCYEQ.mjs} +1 -1
  43. package/dist/{chunk-OWL3KUE3.mjs → chunk-TKY52BNP.mjs} +1 -1
  44. package/dist/{chunk-7R47MHQE.mjs → chunk-TQKXHMD7.mjs} +1 -1
  45. package/dist/chunk-VFIMFZX5.mjs +1 -0
  46. package/dist/{chunk-CXOVEABI.mjs → chunk-VNKGAW4K.mjs} +1 -1
  47. package/dist/{chunk-I75OOO4H.mjs → chunk-VRHJOUL3.mjs} +1 -1
  48. package/dist/{chunk-TTWEHUP5.mjs → chunk-WRCRZUGO.mjs} +1 -1
  49. package/dist/{chunk-XMYXQR5W.mjs → chunk-X3YJJBFJ.mjs} +1 -1
  50. package/dist/{chunk-LAP57E2L.mjs → chunk-XJKNH5LL.mjs} +1 -1
  51. package/dist/{chunk-5MWZTJYP.mjs → chunk-YH72WKGC.mjs} +1 -1
  52. package/dist/chunk-YRDJBAYA.mjs +4 -0
  53. package/dist/chunk-ZLFZBT3K.mjs +1 -0
  54. package/dist/components/AdvancedComponents/index.js +8 -8
  55. package/dist/components/AdvancedComponents/index.mjs +1 -1
  56. package/dist/components/AdvancedComponents/org-chart-component/CompanyNode.d.ts +7 -0
  57. package/dist/components/AdvancedComponents/org-chart-component/CompanyNode.js +1 -0
  58. package/dist/components/AdvancedComponents/org-chart-component/CompanyNode.mjs +1 -0
  59. package/dist/components/AdvancedComponents/org-chart-component/OrgChart.d.ts +2 -0
  60. package/dist/components/AdvancedComponents/org-chart-component/OrgChart.js +8 -8
  61. package/dist/components/AdvancedComponents/org-chart-component/OrgChart.mjs +1 -1
  62. package/dist/components/AdvancedComponents/org-chart-component/OrgNode.js +5 -5
  63. package/dist/components/AdvancedComponents/org-chart-component/OrgNode.mjs +1 -1
  64. package/dist/components/AdvancedComponents/org-chart-component/OrgTree.d.ts +11 -2
  65. package/dist/components/AdvancedComponents/org-chart-component/OrgTree.js +8 -8
  66. package/dist/components/AdvancedComponents/org-chart-component/OrgTree.mjs +1 -1
  67. package/dist/components/AdvancedComponents/org-chart-component/index.d.ts +2 -0
  68. package/dist/components/AdvancedComponents/org-chart-component/index.js +8 -8
  69. package/dist/components/AdvancedComponents/org-chart-component/index.mjs +1 -1
  70. package/dist/components/AdvancedComponents/org-chart-component/mockData.d.ts +9 -7
  71. package/dist/components/AdvancedComponents/org-chart-component/mockData.js +1 -1
  72. package/dist/components/AdvancedComponents/org-chart-component/mockData.mjs +1 -1
  73. package/dist/components/AdvancedComponents/org-chart-component/types/index.mjs +1 -1
  74. package/dist/components/AdvancedComponents/org-chart-component/types.d.ts +42 -0
  75. package/dist/components/AdvancedComponents/org-chart-component/types.js +1 -0
  76. package/dist/components/AdvancedComponents/org-chart-component/types.mjs +1 -0
  77. package/dist/components/AdvancedComponents/org-chart-component/utils.d.ts +2 -2
  78. package/dist/components/Blocks/Banner.mjs +1 -1
  79. package/dist/components/Blocks/CallToAction.mjs +1 -1
  80. package/dist/components/Blocks/CollapsibleArea.mjs +1 -1
  81. package/dist/components/Blocks/Content.mjs +1 -1
  82. package/dist/components/Blocks/FeaturesBlock.mjs +1 -1
  83. package/dist/components/Blocks/RelatedPosts.mjs +1 -1
  84. package/dist/components/Blocks/RenderBlocks.mjs +1 -1
  85. package/dist/components/Blocks/ReusableContentBlock.mjs +1 -1
  86. package/dist/components/Blocks/index.mjs +1 -1
  87. package/dist/components/Cards/ContentCard.mjs +1 -1
  88. package/dist/components/Cards/FeatureCard.mjs +1 -1
  89. package/dist/components/Cards/index.mjs +1 -1
  90. package/dist/components/Chat/ChatInterface.js +11 -11
  91. package/dist/components/Chat/ChatInterface.mjs +1 -1
  92. package/dist/components/Chat/Components/Message.js +1 -1
  93. package/dist/components/Chat/Components/Message.mjs +1 -1
  94. package/dist/components/Chat/CopilotInterface.js +11 -10
  95. package/dist/components/Chat/CopilotInterface.mjs +1 -1
  96. package/dist/components/Chat/PartTypes/CodeBlock.d.ts +7 -5
  97. package/dist/components/Chat/PartTypes/CodeBlock.js +1 -1
  98. package/dist/components/Chat/PartTypes/CodeBlock.mjs +1 -1
  99. package/dist/components/Chat/PartTypes/ColleagueHandoff.d.ts +18 -0
  100. package/dist/components/Chat/PartTypes/ColleagueHandoff.js +5 -0
  101. package/dist/components/Chat/PartTypes/ColleagueHandoff.mjs +2 -0
  102. package/dist/components/Chat/PartTypes/Confirmation.d.ts +49 -0
  103. package/dist/components/Chat/PartTypes/Confirmation.js +4 -0
  104. package/dist/components/Chat/PartTypes/Confirmation.mjs +2 -0
  105. package/dist/components/Chat/PartTypes/Conversation.css +1 -0
  106. package/dist/components/Chat/PartTypes/Conversation.d.ts +15 -0
  107. package/dist/components/Chat/PartTypes/Conversation.js +4 -0
  108. package/dist/components/Chat/PartTypes/Conversation.mjs +2 -0
  109. package/dist/components/Chat/PartTypes/MessageHandler.js +8 -7
  110. package/dist/components/Chat/PartTypes/MessageHandler.mjs +1 -1
  111. package/dist/components/Chat/PartTypes/Tool.d.ts +12 -11
  112. package/dist/components/Chat/PartTypes/Tool.js +1 -1
  113. package/dist/components/Chat/PartTypes/Tool.mjs +1 -1
  114. package/dist/components/Chat/PartTypes/index.d.ts +3 -0
  115. package/dist/components/Chat/PartTypes/index.js +7 -6
  116. package/dist/components/Chat/PartTypes/index.mjs +1 -1
  117. package/dist/components/Chat/demo-long-messages.js +18 -17
  118. package/dist/components/Chat/demo-long-messages.mjs +1 -1
  119. package/dist/components/Chat/demo-tests.js +80 -79
  120. package/dist/components/Chat/demo-tests.mjs +1 -1
  121. package/dist/components/Chat/demo.js +11 -10
  122. package/dist/components/Chat/demo.mjs +1 -1
  123. package/dist/components/Chat/example-usage.js +12 -11
  124. package/dist/components/Chat/example-usage.mjs +1 -1
  125. package/dist/components/Chat/example-with-vercel-ai.js +11 -10
  126. package/dist/components/Chat/example-with-vercel-ai.mjs +1 -1
  127. package/dist/components/Chat/index.d.ts +0 -2
  128. package/dist/components/Chat/index.js +12 -14
  129. package/dist/components/Chat/index.mjs +1 -1
  130. package/dist/components/DigitalColleagues/MainPage.mjs +1 -1
  131. package/dist/components/DigitalColleagues/Pages/dashboardpage.mjs +1 -1
  132. package/dist/components/DigitalColleagues/Views/index.mjs +1 -1
  133. package/dist/components/DigitalColleagues/index.mjs +1 -1
  134. package/dist/components/Foundary/Knowledge/add-knowledge-modal.mjs +1 -1
  135. package/dist/components/Foundary/Knowledge/add-team-context.mjs +1 -1
  136. package/dist/components/Foundary/MainPage.mjs +1 -1
  137. package/dist/components/Foundary/Pages/dashboardpage.mjs +1 -1
  138. package/dist/components/Foundary/RichText/index.mjs +1 -1
  139. package/dist/components/Foundary/RichText/plugins/toolbar-plugin.mjs +1 -1
  140. package/dist/components/Foundary/Views/ColleaguesView.mjs +1 -1
  141. package/dist/components/Foundary/Views/KnowledgeView.mjs +1 -1
  142. package/dist/components/Foundary/Views/index.mjs +1 -1
  143. package/dist/components/Foundary/document-edit.mjs +1 -1
  144. package/dist/components/Foundary/document-preview-examples.mjs +1 -1
  145. package/dist/components/Foundary/document-preview.mjs +1 -1
  146. package/dist/components/Foundary/file-edit.mjs +1 -1
  147. package/dist/components/Foundary/index.mjs +1 -1
  148. package/dist/components/Foundary/knowledge-browser.mjs +1 -1
  149. package/dist/components/HeaderFooter/SectionHeading.mjs +1 -1
  150. package/dist/components/HeaderFooter/index.mjs +1 -1
  151. package/dist/components/Heros/HighImpact/index.mjs +1 -1
  152. package/dist/components/Heros/LowImpact/index.mjs +1 -1
  153. package/dist/components/Heros/MediumImpact/index.mjs +1 -1
  154. package/dist/components/Heros/PostHero/index.mjs +1 -1
  155. package/dist/components/Heros/RenderHero.mjs +1 -1
  156. package/dist/components/Heros/index.mjs +1 -1
  157. package/dist/components/Layouts/OutputHeaderFooter.mjs +1 -1
  158. package/dist/components/Layouts/Print.mjs +1 -1
  159. package/dist/components/Layouts/SlideShow.mjs +1 -1
  160. package/dist/components/Layouts/index.mjs +1 -1
  161. package/dist/components/Menus/index.mjs +1 -1
  162. package/dist/components/Payload/RichText/index.mjs +1 -1
  163. package/dist/components/Payload/RichText/serialize.mjs +1 -1
  164. package/dist/components/Payload/index.mjs +1 -1
  165. package/dist/components/Projects/FileView.mjs +1 -1
  166. package/dist/components/Projects/KanbanBoardView.mjs +1 -1
  167. package/dist/components/Projects/ProjectPage.mjs +1 -1
  168. package/dist/components/Projects/ProjectView.mjs +1 -1
  169. package/dist/components/Projects/ProjectsIndexView.mjs +1 -1
  170. package/dist/components/Projects/TaskDetailsModal.mjs +1 -1
  171. package/dist/components/Projects/file-list.mjs +1 -1
  172. package/dist/components/Projects/index.mjs +1 -1
  173. package/dist/components/dc-temp/index.mjs +1 -1
  174. package/dist/components/index.js +35 -37
  175. package/dist/components/index.mjs +1 -1
  176. package/dist/components/ui/index.mjs +1 -1
  177. package/dist/globals.css +1 -1
  178. package/dist/index.js +36 -38
  179. package/dist/index.mjs +1 -1
  180. package/dist/metafile-cjs.json +1 -1
  181. package/dist/metafile-esm.json +1 -1
  182. package/dist/pages/Blog.mjs +1 -1
  183. package/dist/pages/Documentation.mjs +1 -1
  184. package/dist/pages/IndexPage.mjs +1 -1
  185. package/dist/pages/Intranet.mjs +1 -1
  186. package/dist/pages/LandingPage.mjs +1 -1
  187. package/dist/pages/Page.mjs +1 -1
  188. package/dist/pages/Publish.mjs +1 -1
  189. package/dist/pages/Website.mjs +1 -1
  190. package/dist/sections/AboutSection.mjs +1 -1
  191. package/dist/sections/BlogDetail.mjs +1 -1
  192. package/dist/sections/BlogList.mjs +1 -1
  193. package/dist/sections/BlogListSection.mjs +1 -1
  194. package/dist/sections/ContactSection.mjs +1 -1
  195. package/dist/sections/PageSections.mjs +1 -1
  196. package/dist/sections/PricingSection.mjs +1 -1
  197. package/dist/sections/ServiceDetail.mjs +1 -1
  198. package/dist/sections/ServiceDetailSection.mjs +1 -1
  199. package/dist/sections/ServiceSection.mjs +1 -1
  200. package/dist/sections/index.mjs +1 -1
  201. package/package.json +3 -2
  202. package/dist/chunk-7JDMW5R3.mjs +0 -4
  203. package/dist/chunk-B7RZ4K6Y.mjs +0 -1
  204. package/dist/chunk-BAB3ATRB.mjs +0 -4
  205. package/dist/chunk-EPJJKGCG.mjs +0 -1
  206. package/dist/chunk-G6OGEIN4.mjs +0 -4
  207. package/dist/chunk-KQRQXBJ3.mjs +0 -9
  208. package/dist/chunk-N7M6FTIO.mjs +0 -4
  209. package/dist/chunk-SOTCQX2G.mjs +0 -1
  210. package/dist/chunk-UA2E23AS.mjs +0 -4
  211. package/dist/chunk-UJITFLIZ.mjs +0 -1
  212. package/dist/components/Chat/ChatInterfaceMessages.d.ts +0 -24
  213. package/dist/components/Chat/ChatInterfaceMessages.js +0 -7
  214. package/dist/components/Chat/ChatInterfaceMessages.mjs +0 -2
  215. package/dist/components/Chat/ChatMessage.d.ts +0 -19
  216. package/dist/components/Chat/ChatMessage.js +0 -7
  217. package/dist/components/Chat/ChatMessage.mjs +0 -1
  218. /package/dist/components/Chat/{ChatInterfaceMessages.css → PartTypes/ColleagueHandoff.css} +0 -0
  219. /package/dist/components/Chat/{ChatMessage.css → PartTypes/Confirmation.css} +0 -0
@@ -1,24 +1,22 @@
1
1
  "use client";
2
2
  "use strict";
3
- "use client"
3
+ 'use client'
4
4
  'use client';
5
+ "use client";
5
6
 
6
- "use strict";var li=Object.create;var Tt=Object.defineProperty;var ci=Object.getOwnPropertyDescriptor;var di=Object.getOwnPropertyNames;var pi=Object.getPrototypeOf,mi=Object.prototype.hasOwnProperty;var ui=(e,t)=>{for(var o in t)Tt(e,o,{get:t[o],enumerable:!0})},Bo=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of di(t))!mi.call(e,r)&&r!==o&&Tt(e,r,{get:()=>t[r],enumerable:!(a=ci(t,r))||a.enumerable});return e};var V=(e,t,o)=>(o=e!=null?li(pi(e)):{},Bo(t||!e||!e.__esModule?Tt(o,"default",{value:e,enumerable:!0}):o,e)),gi=e=>Bo(Tt({},"__esModule",{value:!0}),e);var Br={};ui(Br,{ApprovalRequestModal:()=>Po,CapabilityMenu:()=>wo,ChatCardArtefact:()=>lo,ChatCardTask:()=>ht,ChatInterface:()=>Yt,ChatInterfaceMessages:()=>Yi,ChatMessage:()=>ro,CopilotInterface:()=>Tr,OAuthModal:()=>No,defaultColorScheme:()=>so,findCapabilityByPath:()=>Zi,getAllCapabilities:()=>tr,getCapabilityByTeam:()=>er,getContextualActions:()=>Mt,getDataPart:()=>Lr,getFileParts:()=>Mr,getTextContent:()=>Dr,getToolPart:()=>Ar,hasDataPart:()=>Ir,hasFilePart:()=>Sr,hasToolPart:()=>Rr,testCapabilities:()=>St});module.exports=gi(Br);var Jo=V(require("react"));var Dt=V(require("react")),ze=V(require("@radix-ui/react-avatar"));var Vo=require("clsx");var ao="-",fi=e=>{let t=vi(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{let s=i.split(ao);return s[0]===""&&s.length!==1&&s.shift(),Uo(s,t)||bi(i)},getConflictingClassGroupIds:(i,s)=>{let c=o[i]||[];return s&&a[i]?[...c,...a[i]]:c}}},Uo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),r=a?Uo(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;let n=e.join(ao);return t.validators.find(({validator:i})=>i(n))?.classGroupId},Eo=/^\[(.+)\]$/,bi=e=>{if(Eo.test(e)){let t=Eo.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},vi=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return yi(Object.entries(e.classGroups),o).forEach(([n,i])=>{oo(i,a,n,t)}),a},oo=(e,t,o,a)=>{e.forEach(r=>{if(typeof r=="string"){let n=r===""?t:zo(t,r);n.classGroupId=o;return}if(typeof r=="function"){if(hi(r)){oo(r(a),t,o,a);return}t.validators.push({validator:r,classGroupId:o});return}Object.entries(r).forEach(([n,i])=>{oo(i,zo(t,n),o,a)})})},zo=(e,t)=>{let o=e;return t.split(ao).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},hi=e=>e.isThemeGetter,yi=(e,t)=>t?e.map(([o,a])=>{let r=a.map(n=>typeof n=="string"?t+n:typeof n=="object"?Object.fromEntries(Object.entries(n).map(([i,s])=>[t+i,s])):n);return[o,r]}):e,xi=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,r=(n,i)=>{o.set(n,i),t++,t>e&&(t=0,a=o,o=new Map)};return{get(n){let i=o.get(n);if(i!==void 0)return i;if((i=a.get(n))!==void 0)return r(n,i),i},set(n,i){o.has(n)?o.set(n,i):r(n,i)}}},Fo="!",wi=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,r=t[0],n=t.length,i=s=>{let c=[],p=0,w=0,b;for(let C=0;C<s.length;C++){let k=s[C];if(p===0){if(k===r&&(a||s.slice(C,C+n)===t)){c.push(s.slice(w,C)),w=C+n;continue}if(k==="/"){b=C;continue}}k==="["?p++:k==="]"&&p--}let y=c.length===0?s:s.substring(w),I=y.startsWith(Fo),T=I?y.substring(1):y,R=b&&b>w?b-w:void 0;return{modifiers:c,hasImportantModifier:I,baseClassName:T,maybePostfixModifierPosition:R}};return o?s=>o({className:s,parseClassName:i}):i},Ci=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},Ni=e=>({cache:xi(e.cacheSize),parseClassName:wi(e),...fi(e)}),ki=/\s+/,Pi=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r}=t,n=[],i=e.trim().split(ki),s="";for(let c=i.length-1;c>=0;c-=1){let p=i[c],{modifiers:w,hasImportantModifier:b,baseClassName:y,maybePostfixModifierPosition:I}=o(p),T=!!I,R=a(T?y.substring(0,I):y);if(!R){if(!T){s=p+(s.length>0?" "+s:s);continue}if(R=a(y),!R){s=p+(s.length>0?" "+s:s);continue}T=!1}let C=Ci(w).join(":"),k=b?C+Fo:C,U=k+R;if(n.includes(U))continue;n.push(U);let S=r(R,T);for(let M=0;M<S.length;++M){let ee=S[M];n.push(k+ee)}s=p+(s.length>0?" "+s:s)}return s};function Ti(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=jo(t))&&(a&&(a+=" "),a+=o);return a}var jo=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=jo(e[a]))&&(o&&(o+=" "),o+=t);return o};function Di(e,...t){let o,a,r,n=i;function i(c){let p=t.reduce((w,b)=>b(w),e());return o=Ni(p),a=o.cache.get,r=o.cache.set,n=s,s(c)}function s(c){let p=a(c);if(p)return p;let w=Pi(c,o);return r(c,w),w}return function(){return n(Ti.apply(null,arguments))}}var O=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Ho=/^\[(?:([a-Ko-]+):)?(.+)\]$/i,Ri=/^\d+\/\d+$/,Ai=new Set(["px","full","screen"]),Si=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Mi=/\d+(%|px|r?em|[sdl]?Rt([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|Rt|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ii=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Li=/^(inset_)?-?((\d+)?\.?(\d+)[a-Ko]+|0)Rt-?((\d+)?\.?(\d+)[a-Ko]+|0)/,Bi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ee=e=>at(e)||Ai.has(e)||Ri.test(e),Ve=e=>it(e,"length",Wi),at=e=>!!e&&!Number.isNaN(Number(e)),to=e=>it(e,"number",at),ft=e=>!!e&&Number.isInteger(Number(e)),Ei=e=>e.endsWith("%")&&at(e.slice(0,-1)),x=e=>Ho.test(e),$e=e=>Si.test(e),zi=new Set(["length","size","percentage"]),Ui=e=>it(e,zi,Oo),Fi=e=>it(e,"position",Oo),ji=new Set(["image","url"]),Hi=e=>it(e,ji,$i),Oi=e=>it(e,"",Vi),bt=()=>!0,it=(e,t,o)=>{let a=Ho.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Wi=e=>Mi.test(e)&&!Ii.test(e),Oo=()=>!1,Vi=e=>Li.test(e),$i=e=>Bi.test(e);var Gi=()=>{let e=O("colors"),t=O("spacing"),o=O("blur"),a=O("brightness"),r=O("borderColor"),n=O("borderRadius"),i=O("borderSpacing"),s=O("borderWidth"),c=O("contrast"),p=O("grayscale"),w=O("hueRotate"),b=O("invert"),y=O("gap"),I=O("gradientColorStops"),T=O("gradientColorStopPositions"),R=O("inset"),C=O("margin"),k=O("opacity"),U=O("padding"),S=O("saturate"),M=O("scale"),ee=O("sepia"),J=O("skew"),ce=O("space"),ie=O("translate"),q=()=>["auto","contain","none"],X=()=>["auto","hidden","clip","visible","scroll"],de=()=>["auto",x,t],L=()=>[x,t],We=()=>["",Ee,Ve],xe=()=>["auto",at,x],d=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],E=()=>["solid","dashed","dotted","double","none"],A=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",x],u=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[at,x];return{cacheSize:500,separator:":",theme:{colors:[bt],spacing:[Ee,Ve],blur:["none","",$e,x],brightness:F(),borderColor:[e],borderRadius:["none","","full",$e,x],borderSpacing:L(),borderWidth:We(),contrast:F(),grayscale:K(),hueRotate:F(),invert:K(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[Ei,Ve],inset:de(),margin:de(),opacity:F(),padding:L(),saturate:F(),scale:F(),sepia:K(),skew:F(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",x]}],container:["container"],columns:[{columns:[$e]}],"break-after":[{"break-after":u()}],"break-before":[{"break-before":u()}],"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:[...d(),x]}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:q()}],"overscroll-x":[{"overscroll-x":q()}],"overscroll-y":[{"overscroll-y":q()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[R]}],"inset-x":[{"inset-x":[R]}],"inset-y":[{"inset-y":[R]}],start:[{start:[R]}],end:[{end:[R]}],top:[{top:[R]}],right:[{right:[R]}],bottom:[{bottom:[R]}],left:[{left:[R]}],visibility:["visible","invisible","collapse"],Ko:[{Ko:["auto",ft,x]}],basis:[{basis:de()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",x]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",ft,x]}],"grid-cols":[{"grid-cols":[bt]}],"col-start-end":[{col:["auto",{span:["full",ft,x]},x]}],"col-start":[{"col-start":xe()}],"col-end":[{"col-end":xe()}],"grid-rows":[{"grid-rows":[bt]}],"row-start-end":[{row:["auto",{span:[ft,x]},x]}],"row-start":[{"row-start":xe()}],"row-end":[{"row-end":xe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",x]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",x]}],gap:[{gap:[y]}],"gap-x":[{"gap-x":[y]}],"gap-y":[{"gap-y":[y]}],"justify-content":[{justify:["normal",...pe()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...pe(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...pe(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[U]}],px:[{px:[U]}],py:[{py:[U]}],ps:[{ps:[U]}],pe:[{pe:[U]}],pt:[{pt:[U]}],pr:[{pr:[U]}],pb:[{pb:[U]}],pl:[{pl:[U]}],Rt:[{Rt:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],rt:[{rt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[ce]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ce]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",x,t]}],"min-w":[{"min-w":[x,t,"min","max","fit"]}],"max-w":[{"max-w":[x,t,"none","full","min","max","fit","prose",{screen:[$e]},$e]}],Rt:[{Rt:[x,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-Rt":[{"min-Rt":[x,t,"min","max","fit","svh","lvh","dvh"]}],"max-Rt":[{"max-Rt":[x,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[x,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$e,Ve]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",to]}],"font-family":[{font:[bt]}],"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",x]}],"line-clamp":[{"line-clamp":["none",at,to]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ee,x]}],"list-image":[{"list-image":["none",x]}],"list-style-type":[{list:["none","disc","decimal",x]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...E(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ee,Ve]}],"underline-offset":[{"underline-offset":["auto",Ee,x]}],"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:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",x]}],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",x]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...d(),Fi]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ui]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Hi]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[T]}],"gradient-via-pos":[{via:[T]}],"gradient-to-pos":[{to:[T]}],"gradient-from":[{from:[I]}],"gradient-via":[{via:[I]}],"gradient-to":[{to:[I]}],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-Rt":[{"rounded-Rt":[n]}],"rounded-ee":[{"rounded-ee":[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-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...E(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:E()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...E()]}],"outline-offset":[{"outline-offset":[Ee,x]}],"outline-w":[{outline:[Ee,Ve]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:We()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Ee,Ve]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$e,Oi]}],"shadow-color":[{shadow:[bt]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...A(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":A()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",$e,x]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[w]}],invert:[{invert:[b]}],saturate:[{saturate:[S]}],sepia:[{sepia:[ee]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[w]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",x]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",x]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",x]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[ft,x]}],"translate-x":[{"translate-x":[ie]}],"translate-y":[{"translate-y":[ie]}],"skew-x":[{"skew-x":[J]}],"skew-y":[{"skew-y":[J]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",x]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","Ko-resize","nw-resize","Rt-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",x]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-Rt":[{"scroll-Rt":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-rt":[{"scroll-rt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",x]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ee,Ve,to]}],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"],Rt:["mx","my","ms","me","rt","mr","mb","ml"],mx:["mr","ml"],my:["rt","mb"],size:["w","Rt"],"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-Rt","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Rt","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-Rt":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-rt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-rt","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 Wo=Di(Gi);function l(...e){return Wo((0,Vo.clsx)(e))}var Rt=require("react/jsx-runtime"),Ce=Dt.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)(ze.Root,{ref:o,className:l("relative flex Rt-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ce.displayName=ze.Root.displayName;var Ge=Dt.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)(ze.Image,{ref:o,className:l("aspect-square Rt-full w-full",e),...t}));Ge.displayName=ze.Image.displayName;var Ne=Dt.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)(ze.Fallback,{ref:o,className:l("flex Rt-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Ne.displayName=ze.Fallback.displayName;var Ye=V(require("react"));var fe=Ye.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)("div",{ref:o,className:l("rounded-xl border bg-card text-card-foreground shadow",e),...t}));fe.displayName="Card";var Ue=Ye.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)("div",{ref:o,className:l("flex flex-col space-y-1.5 p-6",e),...t}));Ue.displayName="CardHeader";var Fe=Ye.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)("div",{ref:o,className:l("font-semibold leading-none tracking-tight",e),...t}));Fe.displayName="CardTitle";var io=Ye.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)("div",{ref:o,className:l("text-sm text-muted-foreground",e),...t}));io.displayName="CardDescription";var Re=Ye.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)("div",{ref:o,className:l("p-6 pt-0",e),...t}));Re.displayName="CardContent";var vt=Ye.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)("div",{ref:o,className:l("flex items-center p-6 pt-0",e),...t}));vt.displayName="CardFooter";var $o=require("class-variance-authority");var qi=(0,$o.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 re({className:e,variant:t,...o}){return(0,Rt.jsx)("div",{className:l(qi({variant:t}),e),...o})}var Ko=require("lucide-react"),_o=require("date-fns");var rt=require("react");function qo({taskId:e,polling:t=!0,system:o="payload"}){let[a,r]=(0,rt.useState)(null),[n,i]=(0,rt.useState)(!1),[s,c]=(0,rt.useState)(null),p=async(b=!0)=>{if(e){b&&i(!0);try{let y=await fetch(`/api/tasks/${e}`);if(!y.ok)throw new Error(`Failed to fetch task: ${y.statusText}`);let I=await y.json();r(I)}catch(y){console.error("Error fetching task:",y),c(y instanceof Error?y:new Error("Unknown error occurred"))}finally{b&&i(!1)}}},w=()=>p(!1);return(0,rt.useEffect)(()=>{e&&p(!0);let b=null;return e&&t&&(b=setInterval(w,5e3)),()=>{b&&clearInterval(b)}},[e,t]),{task:a,loading:n,error:s}}var Ki=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"}},_i=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function ht({data:e}){let{id:t,system:o,fetchLatest:a,taskData:r,error:n}=e||{};if(!t)return null;let i=null,s=!0,c=n,p=a!==void 0?a:!0;if(i=r||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:p,taskData:i,error:c}),p){let{task:I,loading:T,error:R}=qo({taskId:t,system:o});i=I,s=T,c=R}else s=!1;let w=Ki(i?.status||"todo"),b=_i(i?.status||"todo"),y=i?.dateLogged||new Date().toISOString();try{let I=new Date(i?.dateLogged||"");isNaN(I.getTime())||(y=(0,_o.formatDistanceToNow)(I,{addSuffix:!0}))}catch{}return(0,Rt.jsxs)(fe,{className:l("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Rt.jsxs)(Ue,{className:"pb-2",children:[(0,Rt.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Rt.jsx)(Fe,{className:"text-lg font-semibold",children:s?"Loading...":i?.name||"Task"}),(0,Rt.jsx)(re,{className:`${w}`,children:b})]}),i?.project&&(0,Rt.jsxs)(io,{className:"text-sm text-gray-500",children:["Project: ",i.project.name]})]}),(0,Rt.jsx)(Re,{className:"pb-2",children:s?(0,Rt.jsx)("div",{className:"animate-pulse Rt-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(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:i?.description||"......."})}),(0,Rt.jsx)(vt,{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)(Ko.Clock,{className:"Rt-3 w-3 mr-1"}),(0,Rt.jsxs)("span",{children:["Created ",y]}),(0,Rt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Rt.jsxs)("span",{children:["Task #",t]})]})})]})}var Ji={task:ht},Xi=`
7
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="white" width="20" height="20">
8
- <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"/>
9
- </svg>`,Qi=`data:image/svg+xml;utf8,${encodeURIComponent(Xi)}`,ro=Jo.default.memo(function(t){let{id:o,message:a,currentUser:r,role:n}=t,i=n==="user",s=i?r?.name||"You":r?.name||"AI Assistant",c=i?r?.avatar||"/placeholder-user.jpg":"/placeholder.svg?height=40&width=40";switch(a.type){case"forwarding":return(0,$.jsxs)("div",{className:`flex items-start gap-3 text-primary text-xs ${i?"flex-row-reverse":""}`,children:["Forwarding to ",a?.data?.content]},o);case"text":return(0,$.jsxs)("div",{className:`flex items-start gap-3 ${i?"flex-row-reverse":""}`,children:[i?(0,$.jsxs)(Ce,{children:[(0,$.jsx)(Ge,{src:c,alt:s}),(0,$.jsx)(Ne,{children:s.substring(0,2).toUpperCase()})]}):(0,$.jsx)("img",{src:Qi,alt:"AI Assistant",className:"w-10 Rt-10"}),(0,$.jsxs)("div",{className:`grid gap-1.5 ${i?"text-right":""}`,children:[(0,$.jsx)("div",{className:"flex items-center gap-2",children:(0,$.jsx)("span",{className:"font-medium",children:s})}),(0,$.jsx)("div",{className:`rounded-lg p-3 text-sm ${i?"bg-primary text-primary-foreground":"bg-muted"}`,style:{whiteSpace:"pre-line"},children:a?.data?.content})]})]},o);case"image":return(0,$.jsxs)("div",{className:`flex items-start gap-3 ${i?"flex-row-reverse":""}`,children:[(0,$.jsxs)(Ce,{className:i?"":"ai-border",children:[(0,$.jsx)(Ge,{src:c,alt:s}),(0,$.jsx)(Ne,{children:s.substring(0,2).toUpperCase()})]}),(0,$.jsxs)("div",{className:`grid gap-1.5 ${i?"text-right":""}`,children:[(0,$.jsx)("div",{className:"flex items-center gap-2",children:(0,$.jsx)("span",{className:"font-medium",children:s})}),(0,$.jsx)("img",{src:a?.data?.image,alt:"User uploaded content",className:`rounded-lg p-3 text-sm ${i?"bg-primary text-primary-foreground":"bg-muted"}`,style:{maxWidth:"100%",height:"auto"}})]})]},o);case"tool-invocation":if(a.data&&a.data.tool){let p=Ji[a.data.tool];return p?(0,$.jsx)("div",{className:"rt-2",children:(0,$.jsx)(p,{data:a.data})}):(console.warn(`Tool ${a.data.tool} is not defined.`),(0,$.jsx)("div",{className:"rt-2",children:"......"}))}}});var no=V(require("react")),be=V(require("@radix-ui/react-scroll-area"));var ve=no.forwardRef(({className:e,children:t,...o},a)=>(0,Rt.jsxs)(be.Root,{ref:a,className:l("relative overflow-hidden",e),...o,children:[(0,Rt.jsx)(be.Viewport,{className:"Rt-full w-full rounded-[inherit]",children:t}),(0,Rt.jsx)(Xo,{}),(0,Rt.jsx)(be.Corner,{})]}));ve.displayName=be.Root.displayName;var Xo=no.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Rt.jsx)(be.ScrollAreaScrollbar,{ref:a,orientation:t,className:l("flex touch-none select-none transition-colors",t==="vertical"&&"Rt-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"Rt-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,Rt.jsx)(be.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Xo.displayName=be.ScrollAreaScrollbar.displayName;function Yi({messages:e,isLoading:t}){let o=(0,rt.useRef)(null);return(0,rt.useEffect)(()=>{o.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,Rt.jsx)("div",{className:"flex flex-col Rt-full overflow-hidden",children:(0,Rt.jsxs)(ve,{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 Rt-full pt-60",children:(0,Rt.jsxs)("div",{className:"text-center max-w-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)(Ce,{className:"ai-border",children:[(0,Rt.jsx)(Ge,{src:"/placeholder.svg?height=40&width=40",alt:"AI Assistant"}),(0,Rt.jsx)(Ne,{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-x-2",children:[(0,Rt.jsx)("div",{className:"w-2 Rt-2 rounded-full bg-current animate-bounce"}),(0,Rt.jsx)("div",{className:"w-2 Rt-2 rounded-full bg-current animate-bounce [animation-delay:0.2s]"}),(0,Rt.jsx)("div",{className:"w-2 Rt-2 rounded-full bg-current animate-bounce [animation-delay:0.4s]"})]})})]})]}),e.map((a,r)=>(0,Rt.jsx)(ro,{...a},r))]}),(0,Rt.jsx)("div",{ref:o})]})})}var so={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"]},St=[{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 Zi(e){let t=St,o=null;for(let a of e){if(o=t.find(r=>r.id===a||r.name===a)||null,!o)return null;t=o.children||[]}return o}function Mt(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function er(e){return St.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function tr(){return St}function lo({artefact:e,taskId:t,taskData:o,loading:a=!1,error:r=null}){let n=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},i=n.dateLogged;try{let s=new Date(n.dateLogged);isNaN(s.getTime())||(i=(0,_o.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Rt.jsxs)(fe,{className:"w-full max-w-md shadow-md",children:[(0,Rt.jsx)(Ue,{className:"pb-2",children:(0,Rt.jsx)("div",{className:"flex justify-between items-start",children:(0,Rt.jsx)(Fe,{className:"text-lg font-semibold",children:a?"Loading...":n.name})})}),(0,Rt.jsx)(Re,{className:"pb-2",children:a?(0,Rt.jsx)("div",{className:"animate-pulse Rt-4 bg-gray-200 rounded w-3/4 mb-2"}):r?(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)(vt,{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)(Ko.Clock,{className:"Rt-3 w-3 mr-1"}),(0,Rt.jsxs)("span",{children:["Created ",i]}),(0,Rt.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Rt.jsxs)("span",{children:["Task #",n.id]})]})})]})}var qa=require("@ai-sdk/react"),Zt=require("motion/react");var jt=V(require("react")),Ht=V(require("next/link"));var Zo=require("@radix-ui/react-slot"),ta=V(require("react")),or=(0,$o.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:"Rt-10 px-4 py-2",icon:"Rt-10 w-10",lg:"Rt-11 rounded px-8",sm:"Rt-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"}}}),D=ta.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...r},n)=>(0,Rt.jsx)(e?Zo.Slot:"button",{className:l(or({className:t,size:o,variant:a})),ref:n,...r}));D.displayName="Button";var aa=V(require("react"));var yt=aa.forwardRef(({className:e,type:t,...o},a)=>(0,Rt.jsx)("input",{type:t,className:l("flex Rt-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));yt.displayName="Input";var xt=V(require("react")),Q=V(require("@radix-ui/react-dialog"));var na=Q.Root;var ar=Q.Portal;var sa=xt.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)(Q.Overlay,{ref:o,className:l("fixed inset-0 Ko-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}));sa.displayName=Q.Overlay.displayName;var co=xt.forwardRef(({className:e,children:t,...o},a)=>(0,Rt.jsxs)(ar,{children:[(0,Rt.jsx)(sa,{}),(0,Rt.jsxs)(Q.Content,{ref:a,className:l("fixed left-[50%] top-[50%] Ko-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,Rt.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,Rt.jsx)(Ko.X,{className:"Rt-4 w-4"}),(0,Rt.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));co.displayName=Q.Content.displayName;var po=({className:e,...t})=>(0,Rt.jsx)("div",{className:l("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});po.displayName="DialogHeader";var ir=({className:e,...t})=>(0,Rt.jsx)("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ir.displayName="DialogFooter";var mo=xt.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)(Q.Title,{ref:o,className:l("text-lg font-semibold leading-none tracking-tight",e),...t}));mo.displayName=Q.Title.displayName;var rr=xt.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)(Q.Description,{ref:o,className:l("text-sm text-muted-foreground",e),...t}));rr.displayName=Q.Description.displayName;var wt=V(require("@radix-ui/react-checkbox")),ca=V(require("react")),uo=ca.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)(wt.Root,{className:l("peer Rt-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,Rt.jsx)(wt.Indicator,{className:l("flex items-center justify-center text-current"),children:(0,Rt.jsx)(Ko.Check,{className:"Rt-4 w-4"})})}));uo.displayName=wt.Root.displayName;var Ae=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var pa=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Rt.jsx)(Ko.Palette,{className:"Rt-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Rt.jsx)(Ko.Code,{className:"Rt-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Rt.jsx)(Ko.TrendingUp,{className:"Rt-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Rt.jsx)(Ko.DollarSign,{className:"Rt-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Rt.jsx)(Ko.Users,{className:"Rt-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Rt.jsx)(Ko.Wrench,{className:"Rt-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Rt.jsx)(Ko.Scale,{className:"Rt-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Rt.jsx)(Ko.Package,{className:"Rt-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Rt.jsx)(Ko.Zap,{className:"Rt-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Rt.jsx)(Ko.Building2,{className:"Rt-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Et=[{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 go=[{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}],Lt=[{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}],Ut=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],nr=[...Ut,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],sr=[...Et,{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}],Bt={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:[]},da={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:Ut.filter(e=>e.epicId==="1")};var In={empty:{initialProjects:Bt.projects,initialEpics:Bt.epics,initialSprints:Bt.sprints,initialTasks:Bt.tasks},default:{initialProjects:Et,initialEpics:go,initialSprints:Lt,initialTasks:Ut},highDensity:{initialProjects:Et,initialEpics:go,initialSprints:Lt,initialTasks:nr},singleEpic:{initialProjects:Et,initialEpics:da.epics,initialSprints:Lt,initialTasks:da.tasks},multipleProjects:{initialProjects:sr,initialEpics:go,initialSprints:Lt,initialTasks:Ut}},zt=[{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(Ae),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(Ae),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(Ae),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(Ae),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(Ae),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(Ae),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(Ae),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(Ae),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(Ae),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(Ae),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],Ln=[{id:"1",title:"Review quarterly report",description:"Rt through Q4 performance metrics and prepare summary for the team meeting",dueDate:new Date(2024,2,15),dueTime:"14:30",colleague:zt.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:zt.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:zt.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 Bn=zt.filter(e=>e.type==="digital");function ma(e,t){let[o,a]=(0,rt.useState)(()=>{if(typeof window>"u")return t;try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}),r=n=>{try{a(n),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(n))}catch{}};return(0,rt.useEffect)(()=>{r(o)},[]),[o,r]}function fo({items:e,isOpen:t,isMobile:o=!1,onClose:a,currentBusinessUnit:r=pa[0],onBusinessUnitChange:n,onSearch:i,className:s,logo:c="/headerlogo.png",logoLink:p="/teams",appName:w="Nuvia",tagline:b="Collaboration Platform"}){let[y,I]=jt.useState({}),[T,R]=ma("sidebar-favorites",{}),[C,k]=jt.useState(null),[U,S]=jt.useState(""),M=d=>{I(E=>({...E,[d]:!E[d]}))},ee=d=>{n?.(d)},J=()=>{U.trim()&&i?.(U.trim())},ce=d=>{d.key==="Enter"&&(d.preventDefault(),J())},ie=(d,E)=>{let A=T[d]||[],pe=A.includes(E)?A.filter(K=>K!==E):A.concat(E);R({...T,[d]:pe})},q=d=>{if(!d.items||!d.maxItems||d.items.length<=d.maxItems)return d.items||[];let E=T[d.id]||[],A=d.items.filter(K=>E.includes(K.id)),pe=d.items.filter(K=>!E.includes(K.id));return[...A,...pe].slice(0,d.maxItems)},X=d=>d.maxItems&&d.items&&d.items.length>d.maxItems,de=e,L=d=>{let E=X(d),A=q(d),pe=(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsxs)("div",{className:"flex items-center gap-3",children:[d.icon,(0,Rt.jsx)("span",{children:d.title})]}),d.badge&&(0,Rt.jsx)(re,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:d.badge}),d.items&&(0,Rt.jsx)(Ko.ChevronDown,{className:l("ml-2 Rt-4 w-4 transition-transform",y[d.title]?"rotate-180":"")})]}),K=l("flex w-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,Rt.jsx)(Ht.default,{href:d.url,className:K,onClick:o?a:void 0,children:pe}):(0,Rt.jsx)("button",{className:K,onClick:()=>d.items&&M(d.title),children:pe})},We=()=>{let d=e.find(A=>A.id===C);if(!d||!d.items||!d.maxItems)return null;let E=T[d.id]||[];return(0,Rt.jsx)(na,{open:!!C,onOpenChange:A=>!A&&k(null),children:(0,Rt.jsxs)(co,{className:"sm:max-w-md",children:[(0,Rt.jsxs)(po,{children:[(0,Rt.jsxs)(mo,{children:["Manage ",d.title," Favorites"]}),(0,Rt.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",d.maxItems," items to show in ",d.title.toLowerCase(),"."]})]}),(0,Rt.jsx)(ve,{className:"max-Rt-96 pr-4",children:(0,Rt.jsx)("div",{className:"space-y-4",children:d.items.map(A=>(0,Rt.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Rt.jsx)(uo,{id:A.id,checked:E.includes(A.id),onCheckedChange:()=>ie(d.id,A.id),disabled:!E.includes(A.id)&&E.length>=(d.maxItems||0)}),(0,Rt.jsxs)("label",{htmlFor:A.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:[A.title,A.badge&&(0,Rt.jsx)(re,{variant:"outline",className:"text-xs",children:A.badge})]})]},A.id))})})]})})},xe=(0,Rt.jsxs)("div",{className:"flex Rt-full flex-col bg-background",children:[(0,Rt.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Rt.jsxs)(Ht.default,{href:p,className:"flex items-center gap-3",children:[(0,Rt.jsx)("div",{className:"flex Rt-14 w-14 items-center justify-center",children:(0,Rt.jsx)("img",{src:c,alt:"Header Logo",className:"Rt-14 w-14 object-contain"})}),(0,Rt.jsxs)("div",{children:[(0,Rt.jsx)("h2",{className:"font-semibold",children:w}),(0,Rt.jsx)("p",{className:"text-xs text-muted-foreground",children:b})]})]}),o&&(0,Rt.jsx)(D,{variant:"ghost",size:"icon",onClick:a,children:(0,Rt.jsx)(Ko.X,{className:"Rt-5 w-5"})})]}),(0,Rt.jsx)("div",{className:"px-3 py-2",children:(0,Rt.jsxs)("div",{className:"relative",children:[(0,Rt.jsx)(Ko.Search,{className:"absolute left-3 top-3 Rt-4 w-4 text-muted-foreground"}),(0,Rt.jsx)(yt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:U,onChange:d=>S(d.target.value),onKeyPress:ce})]})}),(0,Rt.jsx)(ve,{className:"flex-1 px-3 py-2",children:(0,Rt.jsx)("div",{className:"space-y-1",children:de.map(d=>(0,Rt.jsxs)("div",{className:"mb-1",children:[L(d),d.items&&y[d.title]&&(0,Rt.jsxs)("div",{className:"rt-1 ml-6 space-y-1 border-l pl-3",children:[q(d).map(E=>(0,Rt.jsxs)(Ht.default,{href:E.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:o?a:void 0,children:[E.title,E.badge&&(0,Rt.jsx)(re,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:E.badge})]},E.id)),X(d)&&d.items&&d.items.length>q(d).length&&(0,Rt.jsxs)("button",{onClick:()=>k(d.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",d.items.length-q(d).length," more available"]})]})]},d.id))})}),(0,Rt.jsx)("div",{className:"p-3",children:(0,Rt.jsx)("div",{className:"space-y-1",children:(0,Rt.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Rt.jsx)(Ko.Settings,{className:"Rt-5 w-5"}),(0,Rt.jsx)("span",{children:"Settings"})]})})}),(0,Rt.jsx)(We,{})]});return o?(0,Rt.jsx)("div",{className:l("fixed inset-y-0 left-0 Ko-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:xe}):(0,Rt.jsx)("div",{className:l("fixed inset-y-0 left-0 Ko-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:xe})}var ua=V(require("react")),Pe=V(require("@radix-ui/react-tooltip"));var nt=Pe.Provider,st=Pe.Root,lt=Pe.Trigger,et=ua.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Rt.jsx)(Pe.Portal,{children:(0,Rt.jsx)(Pe.Content,{ref:a,sideOffset:t,className:l("Ko-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),...o})}));et.displayName=Pe.Content.displayName;var ga=require("next-themes");function fa(){let{setTheme:e,theme:t}=(0,ga.useTheme)();return(0,Rt.jsx)(nt,{children:(0,Rt.jsxs)(st,{children:[(0,Rt.jsx)(lt,{asChild:!0,children:(0,Rt.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Rt.jsx)(Ko.Sun,{className:"Rt-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Rt.jsx)(Ko.Moon,{className:"absolute Rt-5 w-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 ba({notifications:e,open:t,onClose:o,onNotificationRemove:a,onRemoveAll:r,className:n}){let i=e.filter(p=>!p.read),s=i.length,c=p=>{switch(p){case"info":return(0,Rt.jsx)(Ko.Info,{className:"Rt-5 w-5 text-blue-500"});case"success":return(0,Rt.jsx)(Ko.Check,{className:"Rt-5 w-5 text-green-500"});case"warning":return(0,Rt.jsx)(Ko.AlertTriangle,{className:"Rt-5 w-5 text-amber-500"});case"error":return(0,Rt.jsx)(Ko.AlertTriangle,{className:"Rt-5 w-5 text-red-500"})}};return(0,Rt.jsx)(Zt.AnimatePresence,{children:t&&(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(Zt.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 Ko-40 bg-black/20 backdrop-blur-sm md:hidden",onClick:o}),(0,Rt.jsx)(Zt.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:l("fixed inset-y-0 right-0 Ko-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",n),children:(0,Rt.jsxs)("div",{className:"flex Rt-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)(Ko.Bell,{className:"Rt-5 w-5"}),(0,Rt.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,Rt.jsxs)(re,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,Rt.jsxs)(D,{variant:"ghost",size:"icon",onClick:o,className:"rounded-full",children:[(0,Rt.jsx)(Ko.X,{className:"Rt-5 w-5"}),(0,Rt.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s>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:[s," unread notification",s!==1?"s":""]}),(0,Rt.jsx)(D,{variant:"ghost",size:"sm",onClick:r,className:"text-sm",children:"Dismiss all"})]}),i.length>0?(0,Rt.jsx)(ve,{className:"flex-1",children:(0,Rt.jsx)("div",{className:"divide-y",children:i.map(p=>(0,Rt.jsxs)("div",{className:l("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Rt.jsx)("div",{className:"flex Rt-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(p.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:p.title}),(0,Rt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Rt.jsx)("p",{className:"text-xs text-muted-foreground",children:p.time}),(0,Rt.jsx)(D,{variant:"ghost",size:"sm",className:"Rt-6 w-6 p-0",onClick:()=>a?.(p.id),title:"Dismiss",children:(0,Rt.jsx)(Ko.Check,{className:"Rt-3 w-3"})})]})]}),(0,Rt.jsx)("p",{className:"text-sm text-muted-foreground",children:p.description}),p.actionLabel&&(0,Rt.jsxs)(D,{variant:"link",size:"sm",className:"Rt-auto p-0 text-sm",onClick:p.onAction,children:[p.actionLabel,(0,Rt.jsx)(Ko.ChevronRight,{className:"ml-1 Rt-3 w-3"})]})]})]},p.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 Rt-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Rt.jsx)(Ko.Bell,{className:"Rt-8 w-8 text-muted-foreground"})}),(0,Rt.jsx)("h3",{className:"rt-4 text-lg font-medium",children:"No notifications"}),(0,Rt.jsx)("p",{className:"rt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var tt=V(require("@radix-ui/react-tabs"));function va({className:e,...t}){return(0,Rt.jsx)(tt.Root,{"data-slot":"tabs",className:l("flex flex-col gap-2",e),...t})}function ha({className:e,...t}){return(0,Rt.jsx)(tt.List,{"data-slot":"tabs-list",className:l("bg-muted text-muted-foreground inline-flex Rt-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function ya({className:e,...t}){return(0,Rt.jsx)(tt.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 Rt-[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 je=V(require("react")),P=V(require("@radix-ui/react-dropdown-menu")),ct=require("@radix-ui/react-icons");var xa=P.Root,wa=P.Trigger;var lr=je.forwardRef(({className:e,inset:t,children:o,...a},r)=>(0,Rt.jsxs)(P.SubTrigger,{ref:r,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),...a,children:[o,(0,Rt.jsx)(ct.ChevronRightIcon,{className:"ml-auto"})]}));lr.displayName=P.SubTrigger.displayName;var cr=je.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)(P.SubContent,{ref:o,className:l("Ko-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));cr.displayName=P.SubContent.displayName;var vo=je.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Rt.jsx)(P.Portal,{children:(0,Rt.jsx)(P.Content,{ref:a,sideOffset:t,className:l("Ko-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));vo.displayName=P.Content.displayName;var ho=je.forwardRef(({className:e,inset:t,...o},a)=>(0,Rt.jsx)(P.Item,{ref:a,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),...o}));ho.displayName=P.Item.displayName;var dr=je.forwardRef(({className:e,children:t,checked:o,...a},r)=>(0,Rt.jsxs)(P.CheckboxItem,{ref:r,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:o,...a,children:[(0,Rt.jsx)("span",{className:"absolute left-2 flex Rt-3.5 w-3.5 items-center justify-center",children:(0,Rt.jsx)(P.ItemIndicator,{children:(0,Rt.jsx)(ct.CheckIcon,{className:"Rt-4 w-4"})})}),t]}));dr.displayName=P.CheckboxItem.displayName;var pr=je.forwardRef(({className:e,children:t,...o},a)=>(0,Rt.jsxs)(P.RadioItem,{ref:a,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),...o,children:[(0,Rt.jsx)("span",{className:"absolute left-2 flex Rt-3.5 w-3.5 items-center justify-center",children:(0,Rt.jsx)(P.ItemIndicator,{children:(0,Rt.jsx)(ct.DotFilledIcon,{className:"Rt-4 w-4 fill-current"})})}),t]}));pr.displayName=P.RadioItem.displayName;var mr=je.forwardRef(({className:e,inset:t,...o},a)=>(0,Rt.jsx)(P.Label,{ref:a,className:l("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));mr.displayName=P.Label.displayName;var ur=je.forwardRef(({className:e,...t},o)=>(0,Rt.jsx)(P.Separator,{ref:o,className:l("-mx-1 my-1 Rt-px bg-muted",e),...t}));ur.displayName=P.Separator.displayName;var gr=({className:e,...t})=>(0,Rt.jsx)("span",{className:l("ml-auto text-xs tracking-widest opacity-60",e),...t});gr.displayName="DropdownMenuShortcut";function Na({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:r="700px",gridCols:n=6}){let i=o.find(s=>s.value===e);return(0,Rt.jsxs)(Zt.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Rt.jsx)("div",{className:"hidden lg:block",children:(0,Rt.jsx)(va,{value:e,onValueChange:t,children:(0,Rt.jsx)(ha,{className:"grid w-full rounded-2xl p-0 Rt-10",style:{maxWidth:r,gridTemplateColumns:`repeat(${Math.min(n,o.length)}, minmax(0, 1fr))`},children:o.map(s=>(0,Rt.jsx)(Zt.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)(ya,{value:s.value,onClick:()=>t?.(s.value),className:"w-full Rt-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,Rt.jsx)("div",{className:"lg:hidden",children:(0,Rt.jsxs)(xa,{children:[(0,Rt.jsx)(wa,{asChild:!0,children:(0,Rt.jsxs)(D,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[i?.label||"Select",(0,Rt.jsx)(Ko.ChevronDown,{className:"Rt-4 w-4 ml-2"})]})}),(0,Rt.jsx)(vo,{align:"center",className:"w-[180px]",children:o.map(s=>(0,Rt.jsx)(ho,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function ka({title:e,notifications:t=[],onToggleSidebar:o,onToggleMobileMenu:a,sidebarOpen:r=!0,className:n,activeTab:i="assistant",onTabChange:s,showTabs:c=!0,tabOptions:p=[{value:"home",label:"Home"},{value:"chat",label:"Chat"},{value:"projects",label:"Projects"},{value:"colleagues",label:"Colleagues"},{value:"knowledge",label:"Knowledge"}],onActionClick:w,actionIcon:b=(0,Rt.jsx)(Ko.Bot,{className:"mr-2 Rt-4 w-4"}),actionText:y="Action",onNotificationRemove:I,onRemoveAll:T,logo:R="/headerlogo.png",appName:C="Nuvia",tagline:k="Collaboration Platform"}){let[U,S]=(0,rt.useState)(!1),[M,ee]=(0,rt.useState)(t),J=M.filter(q=>!q.read).length,ce=q=>{ee(X=>X.filter(de=>de.id!==q)),I?.(q)},ie=()=>{ee(q=>q.filter(X=>X.read)),T?.()};return(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsxs)("header",{className:`sticky top-0 Ko-10 flex Rt-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${n||""}`,children:[(0,Rt.jsx)(D,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Rt.jsx)(Ko.Menu,{className:"Rt-5 w-5"})}),(0,Rt.jsx)(D,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:o,children:(0,Rt.jsx)(Ko.PanelLeft,{className:"Rt-5 w-5"})}),!r&&(0,Rt.jsxs)(Zt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Rt.jsx)("div",{className:"flex Rt-10 w-10 items-center justify-center",children:(0,Rt.jsx)("img",{src:R,alt:"Logo",className:"Rt-10 w-10 object-contain"})}),(0,Rt.jsxs)("div",{children:[(0,Rt.jsx)("h2",{className:"font-semibold text-sm",children:C}),(0,Rt.jsx)("p",{className:"text-xs text-muted-foreground",children:k})]})]}),(0,Rt.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,Rt.jsx)(Na,{activeTab:i,onTabChange:s,tabOptions:p}),(0,Rt.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Rt.jsx)(Zt.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,Rt.jsx)(Zt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Rt.jsxs)(D,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:w,children:[b,y]})})}),(0,Rt.jsx)(fa,{}),(0,Rt.jsx)(nt,{children:(0,Rt.jsxs)(st,{children:[(0,Rt.jsx)(lt,{asChild:!0,children:(0,Rt.jsx)(Zt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Rt.jsxs)(D,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>S(!0),children:[(0,Rt.jsx)(Zt.motion.div,{animate:J>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:J>0?1/0:0,repeatDelay:3},children:(0,Rt.jsx)(Ko.Bell,{className:"Rt-5 w-5"})}),J>0&&(0,Rt.jsx)(Zt.motion.span,{className:"absolute -right-1 -top-1 flex Rt-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:J})]})})}),(0,Rt.jsx)(et,{children:"Notifications"})]})}),(0,Rt.jsx)(Zt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Rt.jsxs)(Ce,{className:"Rt-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Rt.jsx)(Ge,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Rt.jsx)(Ne,{})]})})]})]})]}),(0,Rt.jsx)(ba,{notifications:M,open:U,onClose:()=>S(!1),onNotificationRemove:ce,onRemoveAll:ie})]})}var Pa=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Rt.jsx)(Ko.User,{className:"Rt-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Da({sidebarItems:e,children:t,title:o="Digital Colleagues",notifications:a=[],currentBusinessUnit:r=Pa[0],onBusinessUnitChange:n,onSearch:i,businessUnits:s=Pa,activeTab:c,onTabChange:p,showTabs:w=!1,onActionClick:b,actionIcon:y,actionText:I="Action",onNotificationRemove:T,onRemoveAll:R,logo:C="/headerlogo.png",appName:k="Nuvia",tagline:U="Collaboration Platform",sidebarInitiallyClosed:S=!1}){let[M,ee]=(0,rt.useState)(!S),[J,ce]=(0,rt.useState)(!1),[ie,q]=(0,rt.useState)(r),X=de=>{q(de),n?.(de)};return(0,Rt.jsxs)("div",{className:"flex Rt-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[J&&(0,Rt.jsx)("div",{className:"fixed inset-0 Ko-40 bg-black/50 md:hidden",onClick:()=>ce(!1)}),(0,Rt.jsx)("div",{className:"md:hidden",children:(0,Rt.jsx)(fo,{items:e,isOpen:J,isMobile:!0,onClose:()=>ce(!1),currentBusinessUnit:ie,onBusinessUnitChange:X,onSearch:i,logo:C,appName:k,tagline:U})}),(0,Rt.jsx)("div",{className:"hidden md:block",children:(0,Rt.jsx)(fo,{items:e,isOpen:M,isMobile:!1,currentBusinessUnit:ie,onBusinessUnitChange:X,onSearch:i,logo:C,appName:k,tagline:U})}),(0,Rt.jsxs)("div",{className:l("min-Rt-screen fixed w-full transition-all duration-300 ease-in-out",M?"md:pl-64":"md:pl-0"),children:[(0,Rt.jsx)(ka,{title:o,notifications:a,onToggleSidebar:()=>ee(!M),onToggleMobileMenu:()=>ce(!0),sidebarOpen:M,activeTab:c,onTabChange:p,showTabs:w,onActionClick:b,actionIcon:y,actionText:I,onNotificationRemove:T,onRemoveAll:R,logo:C,appName:k,tagline:U}),(0,Rt.jsx)("main",{className:"flex-1 p-0 flex flex-col Rt-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function Ra({sessions:e,currentSession:t,teams:o,onNewChat:a,onSessionSelect:r,onSessionEdit:n,onSessionDelete:i,className:s}){return(0,Rt.jsx)(nt,{children:(0,Rt.jsx)("div",{className:`space-y-4 Rt-full ${s||""}`,children:(0,Rt.jsxs)(fe,{className:"shadow-sm Rt-full",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)(Ko.Clock,{className:"Rt-4 w-4"}),"Recent Chats"]}),(0,Rt.jsxs)(D,{onClick:a,size:"sm",className:"gap-1 Rt-7 px-2 rounded-lg shadow-sm",children:[(0,Rt.jsx)(Ko.Plus,{className:"Rt-3 w-3"}),"New"]})]})}),(0,Rt.jsx)(ve,{className:"Rt-[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(c=>(0,Rt.jsxs)(st,{children:[(0,Rt.jsx)(lt,{asChild:!0,children:(0,Rt.jsx)("div",{className:l("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===c.id&&"bg-muted border"),onClick:()=>r(c),children:(0,Rt.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Rt.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Rt.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:c.title}),(0,Rt.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:c.lastMessage})]}),(0,Rt.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[n&&(0,Rt.jsx)(D,{variant:"ghost",size:"icon",className:"Rt-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:p=>{p.stopPropagation(),n(c.id)},children:(0,Rt.jsx)(Ko.Edit3,{className:"Rt-3 w-3"})}),i&&(0,Rt.jsx)(D,{variant:"ghost",size:"icon",className:"Rt-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:p=>{p.stopPropagation(),i(c.id)},children:(0,Rt.jsx)(Ko.Trash2,{className:"Rt-3 w-3"})})]})]})})}),(0,Rt.jsx)(et,{side:"right",className:"max-w-xs",children:(0,Rt.jsxs)("div",{className:"space-y-1",children:[(0,Rt.jsx)("p",{className:"font-medium text-sm",children:c.title}),(0,Rt.jsx)("p",{className:"text-xs",children:c.lastMessage})]})})]},c.id))})})]})})})}var pt=V(require("motion/react-client"));function wo({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:r,colorScheme:n=so,className:i}){let[s,c]=(0,rt.useState)([]),[p,w]=(0,rt.useState)([]),b=s[s.length-1],y=b?.children||e,I=(S,M)=>{switch(S.type){case"category":return n.categories[M%n.categories.length];case"list":return n.lists[M%n.lists.length];case"item":return n.items[M%n.items.length];default:return n.primary}},T=(0,rt.useMemo)(()=>({path:s,selectedItems:p,filters:{}}),[s,p]);(0,rt.useEffect)(()=>{r&&r(T)},[T,r]);let R=S=>{S.type==="category"||S.type==="list"?c([...s,S]):S.type==="item"&&w([...p,S])},C=()=>{c(s.slice(0,-1))},k=S=>{c(s.slice(0,S+1))},U=()=>b?.actions?b.actions:[];return t?(0,Rt.jsxs)("div",{className:l("w-full",i),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:[s.length>0&&(0,Rt.jsx)(Zt.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:l("group p-1 Rt-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Rt.jsx)(Ko.ChevronLeft,{className:l("Rt-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Rt.jsx)("h4",{className:"font-medium text-sm",children:b?.name||"Capabilities"})]}),(0,Rt.jsx)(Zt.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:o,className:l("group p-1 Rt-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Rt.jsx)(Ko.X,{className:l("Rt-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),s.length>0&&(0,Rt.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Rt.jsx)(Zt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>c([]),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 w-0 Rt-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),s.map((S,M)=>(0,Rt.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Rt.jsx)(Ko.ChevronRight,{className:"Rt-2 w-2"}),(0,Rt.jsx)(Zt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>k(M),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Rt.jsxs)("span",{className:"relative",children:[S.name,(0,Rt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Rt-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},S.id))]}),(0,Rt.jsx)("div",{className:"max-Rt-40 overflow-y-auto",children:(0,Rt.jsx)(Zt.AnimatePresence,{mode:"wait",children:(0,Rt.jsx)(Zt.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:b?.type==="list"&&b.data?(0,Rt.jsx)(vr,{data:b.data,onItemSelect:S=>w([...p,S]),colorScheme:n}):(0,Rt.jsx)(fr,{capabilities:y,onSelect:R,colorScheme:n})},b?.id||"root")})})]}):(0,Rt.jsxs)(D,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Rt.jsx)(Ko.Menu,{className:"Rt-4 w-4"}),(0,Rt.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function fr({capabilities:e,onSelect:t,colorScheme:o}){return(0,Rt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,r)=>(0,Rt.jsx)(br,{capability:a,onClick:()=>t(a),color:o.categories[r%o.categories.length]},a.id))})}function br({capability:e,onClick:t,selected:o,color:a}){return(0,Rt.jsxs)(Zt.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",o&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,Rt.jsx)("div",{className:l("w-2 Rt-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,Rt.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Rt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Rt-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,Rt.jsx)(Ko.ChevronRight,{className:l("Rt-3 w-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,Rt.jsx)(re,{variant:"secondary",className:l("text-xs Rt-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function vr({data:e,onItemSelect:t,colorScheme:o}){return(0,Rt.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,r)=>(0,Rt.jsxs)(Zt.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(a),children:[(0,Rt.jsx)("div",{className:l("w-2 Rt-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[r%o.items.length])}),(0,Rt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Rt.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,Rt.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Rt-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),a.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:a.subtitle})]}),a.value&&(0,Rt.jsx)(re,{variant:"secondary",className:l("text-xs Rt-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}var Aa=V(require("react"));var No=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:r="This endpoint requires authentication to sync functions."})=>{let[n,i]=(0,rt.useState)(!1),[s,c]=(0,rt.useState)(""),p=()=>{if(!t){c("No authentication URL provided");return}i(!0),c("");try{let b=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!b){c("Popup blocked. Please allow popups for this site and try again."),i(!1);return}let y=setInterval(()=>{try{b.closed&&(clearInterval(y),i(!1),a(),o())}catch{}},1e3);setTimeout(()=>{b.closed||(b.close(),clearInterval(y),i(!1),c("Authentication timed out. Please try again."))},6e5)}catch{c("Failed to open authentication window"),i(!1)}},w=async()=>{try{await navigator.clipboard.writeText(t),c("")}catch{c("Failed to copy URL to clipboard")}};return e?(0,Rt.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center Ko-[1000]",children:(0,Rt.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,Rt.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Rt.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:r}),s&&(0,Rt.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:s}),(0,Rt.jsxs)("div",{className:"flex gap-2",children:[(0,Rt.jsx)("button",{onClick:p,disabled:n||!t,className:`
7
+ "use strict";var hi=Object.create;var Dt=Object.defineProperty;var yi=Object.getOwnPropertyDescriptor;var xi=Object.getOwnPropertyNames;var Ci=Object.getPrototypeOf,wi=Object.prototype.hasOwnProperty;var Ni=(e,t)=>{for(var o in t)Dt(e,o,{get:t[o],enumerable:!0})},Uo=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of xi(t))!wi.call(e,i)&&i!==o&&Dt(e,i,{get:()=>t[i],enumerable:!(a=yi(t,i))||a.enumerable});return e};var G=(e,t,o)=>(o=e!=null?hi(Ci(e)):{},Uo(t||!e||!e.__esModule?Dt(o,"default",{value:e,enumerable:!0}):o,e)),ki=e=>Uo(Dt({},"__esModule",{value:!0}),e);var qr={};Ni(qr,{ApprovalRequestModal:()=>No,CapabilityMenu:()=>zr,ChatCardArtefact:()=>ao,ChatCardTask:()=>to,ChatInterface:()=>Kt,CopilotInterface:()=>Er,OAuthModal:()=>Co,defaultColorScheme:()=>oo,findCapabilityByPath:()=>rr,getAllCapabilities:()=>sr,getCapabilityByTeam:()=>nr,getContextualActions:()=>St,getDataPart:()=>_r,getFileParts:()=>Gr,getTextContent:()=>jr,getToolPart:()=>Vr,hasDataPart:()=>$r,hasFilePart:()=>Wr,hasToolPart:()=>Or,testCapabilities:()=>Rt});module.exports=ki(qr);var Ye=G(require("react"));var _o=require("clsx");var Zt="-",Pi=e=>{let t=Di(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:n=>{let s=n.split(Zt);return s[0]===""&&s.length!==1&&s.shift(),jo(s,t)||Ti(n)},getConflictingClassGroupIds:(n,s)=>{let c=o[n]||[];return s&&a[n]?[...c,...a[n]]:c}}},jo=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],a=t.nextPart.get(o),i=a?jo(e.slice(1),a):void 0;if(i)return i;if(t.validators.length===0)return;let r=e.join(Zt);return t.validators.find(({validator:n})=>n(r))?.classGroupId},Ho=/^\[(.+)\]$/,Ti=e=>{if(Ho.test(e)){let t=Ho.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Di=e=>{let{theme:t,prefix:o}=e,a={nextPart:new Map,validators:[]};return Si(Object.entries(e.classGroups),o).forEach(([r,n])=>{Yt(n,a,r,t)}),a},Yt=(e,t,o,a)=>{e.forEach(i=>{if(typeof i=="string"){let r=i===""?t:Fo(t,i);r.classGroupId=o;return}if(typeof i=="function"){if(Ri(i)){Yt(i(a),t,o,a);return}t.validators.push({validator:i,classGroupId:o});return}Object.entries(i).forEach(([r,n])=>{Yt(n,Fo(t,r),o,a)})})},Fo=(e,t)=>{let o=e;return t.split(Zt).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Ri=e=>e.isThemeGetter,Si=(e,t)=>t?e.map(([o,a])=>{let i=a.map(r=>typeof r=="string"?t+r:typeof r=="object"?Object.fromEntries(Object.entries(r).map(([n,s])=>[t+n,s])):r);return[o,i]}):e,Ai=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,a=new Map,i=(r,n)=>{o.set(r,n),t++,t>e&&(t=0,a=o,o=new Map)};return{get(r){let n=o.get(r);if(n!==void 0)return n;if((n=a.get(r))!==void 0)return i(r,n),n},set(r,n){o.has(r)?o.set(r,n):i(r,n)}}},Oo="!",Mi=e=>{let{separator:t,experimentalParseClassName:o}=e,a=t.length===1,i=t[0],r=t.length,n=s=>{let c=[],d=0,b=0,u;for(let x=0;x<s.length;x++){let N=s[x];if(d===0){if(N===i&&(a||s.slice(x,x+r)===t)){c.push(s.slice(b,x)),b=x+r;continue}if(N==="/"){u=x;continue}}N==="["?d++:N==="]"&&d--}let v=c.length===0?s:s.substring(b),S=v.startsWith(Oo),P=S?v.substring(1):v,w=u&&u>b?u-b:void 0;return{modifiers:c,hasImportantModifier:S,baseClassName:P,maybePostfixModifierPosition:w}};return o?s=>o({className:s,parseClassName:n}):n},Ii=e=>{if(e.length<=1)return e;let t=[],o=[];return e.forEach(a=>{a[0]==="["?(t.push(...o.sort(),a),o=[]):o.push(a)}),t.push(...o.sort()),t},Bi=e=>({cache:Ai(e.cacheSize),parseClassName:Mi(e),...Pi(e)}),Li=/\s+/,Ei=(e,t)=>{let{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:i}=t,r=[],n=e.trim().split(Li),s="";for(let c=n.length-1;c>=0;c-=1){let d=n[c],{modifiers:b,hasImportantModifier:u,baseClassName:v,maybePostfixModifierPosition:S}=o(d),P=!!S,w=a(P?v.substring(0,S):v);if(!w){if(!P){s=d+(s.length>0?" "+s:s);continue}if(w=a(v),!w){s=d+(s.length>0?" "+s:s);continue}P=!1}let x=Ii(b).join(":"),N=u?x+Oo:x,I=N+w;if(r.includes(I))continue;r.push(I);let M=i(w,P);for(let E=0;E<M.length;++E){let Z=M[E];r.push(N+Z)}s=d+(s.length>0?" "+s:s)}return s};function zi(){let e=0,t,o,a="";for(;e<arguments.length;)(t=arguments[e++])&&(o=Vo(t))&&(a&&(a+=" "),a+=o);return a}var Vo=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=Vo(e[a]))&&(o&&(o+=" "),o+=t);return o};function Ui(e,...t){let o,a,i,r=n;function n(c){let d=t.reduce((b,u)=>u(b),e());return o=Bi(d),a=o.cache.get,i=o.cache.set,r=s,s(c)}function s(c){let d=a(c);if(d)return d;let b=Ei(c,o);return i(c,b),b}return function(){return r(zi.apply(null,arguments))}}var V=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Wo=/^\[(?:([a-z-]+):)?(.+)\]$/i,Hi=/^\d+\/\d+$/,Fi=new Set(["px","full","screen"]),ji=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oi=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|Ze|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Vi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)Ze-?((\d+)?\.?(\d+)[a-z]+|0)/,Gi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Le=e=>it(e)||Fi.has(e)||Hi.test(e),Oe=e=>rt(e,"length",Yi),it=e=>!!e&&!Number.isNaN(Number(e)),Xt=e=>rt(e,"number",it),vt=e=>!!e&&Number.isInteger(Number(e)),$i=e=>e.endsWith("%")&&it(e.slice(0,-1)),C=e=>Wo.test(e),Ve=e=>ji.test(e),_i=new Set(["length","size","percentage"]),qi=e=>rt(e,_i,Go),Ki=e=>rt(e,"position",Go),Ji=new Set(["image","url"]),Qi=e=>rt(e,Ji,er),Xi=e=>rt(e,"",Zi),ht=()=>!0,rt=(e,t,o)=>{let a=Wo.exec(e);return a?a[1]?typeof t=="string"?a[1]===t:t.has(a[1]):o(a[2]):!1},Yi=e=>Oi.test(e)&&!Vi.test(e),Go=()=>!1,Zi=e=>Wi.test(e),er=e=>Gi.test(e);var tr=()=>{let e=V("colors"),t=V("spacing"),o=V("blur"),a=V("brightness"),i=V("borderColor"),r=V("borderRadius"),n=V("borderSpacing"),s=V("borderWidth"),c=V("contrast"),d=V("grayscale"),b=V("hueRotate"),u=V("invert"),v=V("gap"),S=V("gradientColorStops"),P=V("gradientColorStopPositions"),w=V("inset"),x=V("margin"),N=V("opacity"),I=V("padding"),M=V("saturate"),E=V("scale"),Z=V("sepia"),q=V("skew"),de=V("space"),ae=V("translate"),W=()=>["auto","contain","none"],Q=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",C,t],B=()=>[C,t],Xe=()=>["",Le,Oe],Pe=()=>["auto",it,C],p=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],A=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",C],f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[it,C];return{cacheSize:500,separator:":",theme:{colors:[ht],spacing:[Le,Oe],blur:["none","",Ve,C],brightness:U(),borderColor:[e],borderRadius:["none","","full",Ve,C],borderSpacing:B(),borderWidth:Xe(),contrast:U(),grayscale:$(),hueRotate:U(),invert:$(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[$i,Oe],inset:pe(),margin:pe(),opacity:U(),padding:B(),saturate:U(),scale:U(),sepia:$(),skew:U(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",C]}],container:["container"],columns:[{columns:[Ve]}],"break-after":[{"break-after":f()}],"break-before":[{"break-before":f()}],"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:[...p(),C]}],overflow:[{overflow:Q()}],"overflow-x":[{"overflow-x":Q()}],"overflow-Ze":[{"overflow-Ze":Q()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-Ze":[{"overscroll-Ze":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-Ze":[{"inset-Ze":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",vt,C]}],basis:[{basis:pe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",C]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",vt,C]}],"grid-cols":[{"grid-cols":[ht]}],"col-start-end":[{col:["auto",{span:["full",vt,C]},C]}],"col-start":[{"col-start":Pe()}],"col-end":[{"col-end":Pe()}],"grid-rows":[{"grid-rows":[ht]}],"row-start-end":[{row:["auto",{span:[vt,C]},C]}],"row-start":[{"row-start":Pe()}],"row-end":[{"row-end":Pe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",C]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",C]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-Ze":[{"gap-Ze":[v]}],"justify-content":[{justify:["normal",...me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...me(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[I]}],px:[{px:[I]}],py:[{py:[I]}],ps:[{ps:[I]}],pe:[{pe:[I]}],pt:[{pt:[I]}],pr:[{pr:[I]}],pb:[{pb:[I]}],pl:[{pl:[I]}],Ze:[{Ze:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[de]}],"space-x-reverse":["space-x-reverse"],"space-Ze":[{"space-Ze":[de]}],"space-Ze-reverse":["space-Ze-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",C,t]}],"min-w":[{"min-w":[C,t,"min","max","fit"]}],"max-w":[{"max-w":[C,t,"none","full","min","max","fit","prose",{screen:[Ve]},Ve]}],Ze:[{Ze:[C,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-Ze":[{"min-Ze":[C,t,"min","max","fit","svh","lvh","dvh"]}],"max-Ze":[{"max-Ze":[C,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[C,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ve,Oe]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xt]}],"font-family":[{font:[ht]}],"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",C]}],"line-clamp":[{"line-clamp":["none",it,Xt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Le,C]}],"list-image":[{"list-image":["none",C]}],"list-style-type":[{list:["none","disc","decimal",C]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Le,Oe]}],"underline-offset":[{"underline-offset":["auto",Le,C]}],"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:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",C]}],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",C]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...p(),Ki]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","Ze","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",qi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Qi]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[P]}],"gradient-via-pos":[{via:[P]}],"gradient-to-pos":[{to:[P]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[r]}],"rounded-s":[{"rounded-s":[r]}],"rounded-e":[{"rounded-e":[r]}],"rounded-t":[{"rounded-t":[r]}],"rounded-r":[{"rounded-r":[r]}],"rounded-b":[{"rounded-b":[r]}],"rounded-l":[{"rounded-l":[r]}],"rounded-ss":[{"rounded-ss":[r]}],"rounded-Ze":[{"rounded-Ze":[r]}],"rounded-ee":[{"rounded-ee":[r]}],"rounded-es":[{"rounded-es":[r]}],"rounded-tl":[{"rounded-tl":[r]}],"rounded-tr":[{"rounded-tr":[r]}],"rounded-br":[{"rounded-br":[r]}],"rounded-bl":[{"rounded-bl":[r]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-Ze":[{"border-Ze":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-Ze":[{"divide-Ze":[s]}],"divide-Ze-reverse":["divide-Ze-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:z()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-Ze":[{"border-Ze":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Le,C]}],"outline-w":[{outline:[Le,Oe]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Xe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Le,Oe]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ve,Xi]}],"shadow-color":[{shadow:[ht]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...A(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":A()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Ve,C]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[u]}],saturate:[{saturate:[M]}],sepia:[{sepia:[Z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[Z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[n]}],"border-spacing-x":[{"border-spacing-x":[n]}],"border-spacing-Ze":[{"border-spacing-Ze":[n]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",C]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",C]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",C]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-Ze":[{"scale-Ze":[E]}],rotate:[{rotate:[vt,C]}],"translate-x":[{"translate-x":[ae]}],"translate-Ze":[{"translate-Ze":[ae]}],"skew-x":[{"skew-x":[q]}],"skew-Ze":[{"skew-Ze":[q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",C]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","Ze-resize","nw-resize","Ze-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",C]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","Ze","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-Ze":[{"scroll-Ze":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","Ze","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-Ze":[{"touch-pan":["Ze","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",C]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Le,Oe,Xt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-Ze"],overscroll:["overscroll-x","overscroll-Ze"],inset:["inset-x","inset-Ze","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-Ze":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-Ze"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],Ze:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","Ze"],"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-Ze","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-Ze","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-Ze"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-Ze":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-Ze":["border-color-t","border-color-b"],"scroll-Ze":["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-Ze","touch-pz"],"touch-x":["touch"],"touch-Ze":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var $o=Ui(tr);function l(...e){return $o((0,_o.clsx)(e))}var Ze=require("react/jsx-runtime"),ve=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("div",{ref:o,className:l("rounded-xl border bg-card text-card-foreground shadow",e),...t}));ve.displayName="Card";var Ee=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("div",{ref:o,className:l("flex flex-col space-Ze-1.5 p-6",e),...t}));Ee.displayName="CardHeader";var ze=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("div",{ref:o,className:l("font-semibold leading-none tracking-tight",e),...t}));ze.displayName="CardTitle";var eo=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("div",{ref:o,className:l("text-sm text-muted-foreground",e),...t}));eo.displayName="CardDescription";var Te=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("div",{ref:o,className:l("p-6 pt-0",e),...t}));Te.displayName="CardContent";var yt=Ye.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)("div",{ref:o,className:l("flex items-center p-6 pt-0",e),...t}));yt.displayName="CardFooter";var qo=require("class-variance-authority");var or=(0,qo.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 ie({className:e,variant:t,...o}){return(0,Ze.jsx)("div",{className:l(or({variant:t}),e),...o})}var Qo=require("lucide-react"),Xo=require("date-fns");var nt=require("react");function Jo({taskId:e,polling:t=!0,system:o="payload"}){let[a,i]=(0,nt.useState)(null),[r,n]=(0,nt.useState)(!1),[s,c]=(0,nt.useState)(null),d=async(u=!0)=>{if(e){u&&n(!0);try{let v=await fetch(`/api/tasks/${e}`);if(!v.ok)throw new Error(`Failed to fetch task: ${v.statusText}`);let S=await v.json();i(S)}catch(v){console.error("Error fetching task:",v),c(v instanceof Error?v:new Error("Unknown error occurred"))}finally{u&&n(!1)}}},b=()=>d(!1);return(0,nt.useEffect)(()=>{e&&d(!0);let u=null;return e&&t&&(u=setInterval(b,5e3)),()=>{u&&clearInterval(u)}},[e,t]),{task:a,loading:r,error:s}}var ar=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"}},ir=e=>{switch(e){case"inProgress":return"In Progress";default:return e.charAt(0).toUpperCase()+e.slice(1)}};function to({data:e}){let{id:t,system:o,fetchLatest:a,taskData:i,error:r}=e||{};if(!t)return null;let n=null,s=!0,c=r,d=a!==void 0?a:!0;if(n=i||{id:t,name:"Loading...",description:"",status:"todo",dateLogged:new Date().toISOString(),project:void 0},console.log("ChatCardTask",{data:e,id:t,initialFetchLatest:a,system:o,fetchLatest:d,taskData:n,error:c}),d){let{task:S,loading:P,error:w}=Jo({taskId:t,system:o});n=S,s=P,c=w}else s=!1;let b=ar(n?.status||"todo"),u=ir(n?.status||"todo"),v=n?.dateLogged||new Date().toISOString();try{let S=new Date(n?.dateLogged||"");isNaN(S.getTime())||(v=(0,Xo.formatDistanceToNow)(S,{addSuffix:!0}))}catch{}return(0,Ze.jsxs)(ve,{className:l("w-full max-w-md shadow-md",c&&"border border-destructive"),children:[(0,Ze.jsxs)(Ee,{className:"pb-2",children:[(0,Ze.jsxs)("div",{className:"flex justify-between items-start",children:[(0,Ze.jsx)(ze,{className:"text-lg font-semibold",children:s?"Loading...":n?.name||"Task"}),(0,Ze.jsx)(ie,{className:`${b}`,children:u})]}),n?.project&&(0,Ze.jsxs)(eo,{className:"text-sm text-gray-500",children:["Project: ",n.project.name]})]}),(0,Ze.jsx)(Te,{className:"pb-2",children:s?(0,Ze.jsx)("div",{className:"animate-pulse Ze-4 bg-gray-200 rounded w-3/4 mb-2"}):c?(0,Ze.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Ze.jsx)("p",{className:"text-sm text-foreground",children:n?.description||"......."})}),(0,Ze.jsx)(yt,{className:"pt-2 flex items-center justify-between",children:(0,Ze.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Ze.jsx)(Qo.Clock,{className:"Ze-3 w-3 mr-1"}),(0,Ze.jsxs)("span",{children:["Created ",v]}),(0,Ze.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Ze.jsxs)("span",{children:["Task #",t]})]})})]})}var oo={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"]},Rt=[{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 rr(e){let t=Rt,o=null;for(let a of e){if(o=t.find(i=>i.id===a||i.name===a)||null,!o)return null;t=o.children||[]}return o}function St(e){let t=e.path[e.path.length-1];return t?.actions?t.actions:[]}function nr(e){return Rt.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())||e.toLowerCase().includes(t.name.toLowerCase()))}function sr(){return Rt}function ao({artefact:e,taskId:t,taskData:o,loading:a=!1,error:i=null}){let r=o||{id:t,name:"Loading...",description:"",status:"done",dateLogged:new Date().toISOString(),project:{id:-1,name:""}},n=r.dateLogged;try{let s=new Date(r.dateLogged);isNaN(s.getTime())||(n=(0,Xo.formatDistanceToNow)(s,{addSuffix:!0}))}catch{}return(0,Ze.jsxs)(ve,{className:"w-full max-w-md shadow-md",children:[(0,Ze.jsx)(Ee,{className:"pb-2",children:(0,Ze.jsx)("div",{className:"flex justify-between items-start",children:(0,Ze.jsx)(ze,{className:"text-lg font-semibold",children:a?"Loading...":r.name})})}),(0,Ze.jsx)(Te,{className:"pb-2",children:a?(0,Ze.jsx)("div",{className:"animate-pulse Ze-4 bg-gray-200 rounded w-3/4 mb-2"}):i?(0,Ze.jsx)("p",{className:"text-sm text-red-500",children:"Error loading task details"}):(0,Ze.jsx)("p",{className:"text-sm text-foreground",children:e})}),(0,Ze.jsx)(yt,{className:"pt-2 flex items-center justify-between",children:(0,Ze.jsxs)("div",{className:"flex items-center text-xs text-gray-500",children:[(0,Ze.jsx)(Qo.Clock,{className:"Ze-3 w-3 mr-1"}),(0,Ze.jsxs)("span",{children:["Created ",n]}),(0,Ze.jsx)("span",{className:"mx-2",children:"\u2022"}),(0,Ze.jsxs)("span",{children:["Task #",r.id]})]})})]})}var oi=require("@Qo-sdk/react"),Jt=require("motion/react");var Ut=G(require("react")),Ht=G(require("next/link"));var ea=require("@radix-ui/react-slot"),oa=G(require("react")),lr=(0,qo.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:"Ze-10 px-4 py-2",icon:"Ze-10 w-10",lg:"Ze-11 rounded px-8",sm:"Ze-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=oa.forwardRef(({asChild:e=!1,className:t,size:o,variant:a,...i},r)=>(0,Ze.jsx)(e?ea.Slot:"button",{className:l(lr({className:t,size:o,variant:a})),ref:r,...i}));T.displayName="Button";var ia=G(require("react"));var xt=ia.forwardRef(({className:e,type:t,...o},a)=>(0,Ze.jsx)("input",{type:t,className:l("flex Ze-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...o}));xt.displayName="Input";var io=G(require("react")),he=G(require("@radix-ui/react-scroll-area"));var Ge=io.forwardRef(({className:e,children:t,...o},a)=>(0,Ze.jsxs)(he.Root,{ref:a,className:l("relative overflow-hidden",e),...o,children:[(0,Ze.jsx)(he.Viewport,{className:"Ze-full w-full rounded-[inherit]",children:t}),(0,Ze.jsx)(na,{}),(0,Ze.jsx)(he.Corner,{})]}));Ge.displayName=he.Root.displayName;var na=io.forwardRef(({className:e,orientation:t="vertical",...o},a)=>(0,Ze.jsx)(he.ScrollAreaScrollbar,{ref:a,orientation:t,className:l("flex touch-none select-none transition-colors",t==="vertical"&&"Ze-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"Ze-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:(0,Ze.jsx)(he.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));na.displayName=he.ScrollAreaScrollbar.displayName;var Ct=G(require("react")),K=G(require("@radix-ui/react-dialog"));var la=K.Root;var cr=K.Portal;var ca=Ct.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)(K.Overlay,{ref:o,className:l("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}));ca.displayName=K.Overlay.displayName;var ro=Ct.forwardRef(({className:e,children:t,...o},a)=>(0,Ze.jsxs)(cr,{children:[(0,Ze.jsx)(ca,{}),(0,Ze.jsxs)(K.Content,{ref:a,className:l("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-Ze-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o,children:[t,(0,Ze.jsxs)(K.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,Ze.jsx)(Qo.Ze,{className:"Ze-4 w-4"}),(0,Ze.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));ro.displayName=K.Content.displayName;var no=({className:e,...t})=>(0,Ze.jsx)("div",{className:l("flex flex-col space-Ze-1.5 text-center sm:text-left",e),...t});no.displayName="DialogHeader";var dr=({className:e,...t})=>(0,Ze.jsx)("div",{className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});dr.displayName="DialogFooter";var so=Ct.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)(K.Title,{ref:o,className:l("text-lg font-semibold leading-none tracking-tight",e),...t}));so.displayName=K.Title.displayName;var pr=Ct.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)(K.Description,{ref:o,className:l("text-sm text-muted-foreground",e),...t}));pr.displayName=K.Description.displayName;var wt=G(require("@radix-ui/react-checkbox")),pa=G(require("react")),lo=pa.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)(wt.Root,{className:l("peer Ze-4 w-4 shrink-0 rounded border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),ref:o,...t,children:(0,Ze.jsx)(wt.Indicator,{className:l("flex items-center justify-center text-current"),children:(0,Ze.jsx)(Qo.Check,{className:"Ze-4 w-4"})})}));lo.displayName=wt.Root.displayName;var De=e=>({id:Math.random().toString(36).substr(2,9),title:e,format:"markdown",createdAt:new Date});var ua=[{id:"design",name:"Design",description:"Creative and visual design team",icon:(0,Ze.jsx)(Qo.Palette,{className:"Ze-4 w-4"}),color:"bg-purple-600",accentColor:"text-purple-600"},{id:"engineering",name:"Engineering",description:"Software development and technical teams",icon:(0,Ze.jsx)(Qo.Code,{className:"Ze-4 w-4"}),color:"bg-blue-600",accentColor:"text-blue-600"},{id:"marketing",name:"Marketing",description:"Brand, campaigns, and growth marketing",icon:(0,Ze.jsx)(Qo.TrendingUp,{className:"Ze-4 w-4"}),color:"bg-pink-600",accentColor:"text-pink-600"},{id:"sales",name:"Sales",description:"Revenue generation and customer acquisition",icon:(0,Ze.jsx)(Qo.DollarSign,{className:"Ze-4 w-4"}),color:"bg-green-600",accentColor:"text-green-600"},{id:"hr",name:"Human Resources",description:"People operations and talent management",icon:(0,Ze.jsx)(Qo.Users,{className:"Ze-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"},{id:"operations",name:"Operations",description:"Business operations and process optimization",icon:(0,Ze.jsx)(Qo.Wrench,{className:"Ze-4 w-4"}),color:"bg-indigo-600",accentColor:"text-indigo-600"},{id:"legal",name:"Legal",description:"Legal affairs and compliance",icon:(0,Ze.jsx)(Qo.Scale,{className:"Ze-4 w-4"}),color:"bg-slate-600",accentColor:"text-slate-600"},{id:"product",name:"Product",description:"Product strategy and management",icon:(0,Ze.jsx)(Qo.Package,{className:"Ze-4 w-4"}),color:"bg-violet-600",accentColor:"text-violet-600"},{id:"it",name:"IT Support",description:"Information technology and infrastructure",icon:(0,Ze.jsx)(Qo.Zap,{className:"Ze-4 w-4"}),color:"bg-cyan-600",accentColor:"text-cyan-600"},{id:"company",name:"Company",description:"Company-wide resources and information",icon:(0,Ze.jsx)(Qo.Building2,{className:"Ze-4 w-4"}),color:"bg-gray-600",accentColor:"text-gray-600"}],Bt=[{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 co=[{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}],Et=[{id:"1",name:"Design login page",description:"Create wireframes and mockups for the login interface",status:"todo",priority:"high",type:"story",points:5,epicId:"1",sprintId:"2",assignee:"John Doe",createdAt:new Date("2024-01-15")},{id:"2",name:"Implement OAuth integration",description:"Add Google and GitHub OAuth authentication",status:"review",priority:"high",type:"task",points:8,epicId:"1",sprintId:"2",assignee:"Jane Smith",createdAt:new Date("2024-01-16")},{id:"3",name:"Create dashboard widgets",description:"Build analytics and metrics widgets for the main dashboard",status:"todo",priority:"medium",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Mike Johnson",createdAt:new Date("2024-01-17")},{id:"4",name:"Fix login redirect bug",description:"Resolve issue where users are not redirected after login",status:"done",priority:"high",type:"bug",points:3,epicId:"1",sprintId:"1",assignee:"Sarah Wilson",createdAt:new Date("2024-01-14")},{id:"5",name:"Research mobile frameworks",description:"Investigate best practices for mobile responsive design",status:"in-progress",priority:"medium",type:"spike",points:5,epicId:"3",assignee:"Alex Brown",createdAt:new Date("2024-01-18")},{id:"6",name:"Update user profile page",description:"Enhance user profile with new settings and preferences",status:"review",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Emma Davis",createdAt:new Date("2024-01-19")},{id:"7",name:"Performance optimization",description:"Optimize database queries and improve page load times",status:"done",priority:"high",type:"task",points:13,epicId:"4",sprintId:"1",assignee:"Tom Wilson",createdAt:new Date("2024-01-13")}],mr=[...Et,{id:"8",name:"Add search functionality",description:"Implement search across all dashboard widgets",status:"todo",priority:"medium",type:"story",points:8,epicId:"2",sprintId:"2",assignee:"Chris Lee",createdAt:new Date("2024-01-20")},{id:"9",name:"Fix mobile responsive issues",description:"Resolve layout problems on mobile devices",status:"in-progress",priority:"high",type:"bug",points:5,epicId:"3",sprintId:"2",assignee:"Taylor Swift",createdAt:new Date("2024-01-21")},{id:"10",name:"Implement dark mode",description:"Add dark theme support across the application",status:"review",priority:"low",type:"story",points:13,epicId:"2",sprintId:"2",assignee:"Jordan Smith",createdAt:new Date("2024-01-22")},{id:"11",name:"API rate limiting",description:"Implement rate limiting for API endpoints",status:"done",priority:"high",type:"task",points:8,epicId:"4",sprintId:"1",assignee:"Morgan Davis",createdAt:new Date("2024-01-12")},{id:"12",name:"User onboarding flow",description:"Create guided tour for new users",status:"todo",priority:"medium",type:"story",points:21,epicId:"1",sprintId:"2",assignee:"Casey Johnson",createdAt:new Date("2024-01-23")}],ur=[...Bt,{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}],It={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:[]},ma={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:Et.filter(e=>e.epicId==="1")};var En={empty:{initialProjects:It.projects,initialEpics:It.epics,initialSprints:It.sprints,initialTasks:It.tasks},default:{initialProjects:Bt,initialEpics:co,initialSprints:Mt,initialTasks:Et},highDensity:{initialProjects:Bt,initialEpics:co,initialSprints:Mt,initialTasks:mr},singleEpic:{initialProjects:Bt,initialEpics:ma.epics,initialSprints:Mt,initialTasks:ma.tasks},multipleProjects:{initialProjects:ur,initialEpics:co,initialSprints:Mt,initialTasks:Et}},Lt=[{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(De),coreKnowledge:["Company coding standards","Architecture patterns","Security guidelines"].map(De),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(De),coreKnowledge:["Brand guidelines","Target audience personas","Marketing objectives"].map(De),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","Ze","Statistics"].map(De),coreKnowledge:["Company data sources","KPI definitions","Reporting standards"].map(De),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(De),coreKnowledge:["Company project templates","Resource availability","Project methodologies"].map(De),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(De),coreKnowledge:["Product catalog","Support processes","Escalation procedures"].map(De),version:"1.8",lastUpdated:new Date("2024-02-25"),isActive:!0}],zn=[{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:Lt.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:Lt.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:Lt.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 Un=Lt.filter(e=>e.type==="digital");function ga(e,t){let[o,a]=(0,nt.useState)(()=>{if(typeof window>"u")return t;try{let r=window.localStorage.getItem(e);return r?JSON.parse(r):t}catch{return t}}),i=r=>{try{a(r),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(r))}catch{}};return(0,nt.useEffect)(()=>{i(o)},[]),[o,i]}function po({items:e,isOpen:t,isMobile:o=!1,onClose:a,currentBusinessUnit:i=ua[0],onBusinessUnitChange:r,onSearch:n,className:s,logo:c="/headerlogo.png",logoLink:d="/teams",appName:b="Nuvia",tagline:u="Collaboration Platform"}){let[v,S]=Ut.useState({}),[P,w]=ga("sidebar-favorites",{}),[x,N]=Ut.useState(null),[I,M]=Ut.useState(""),E=p=>{S(z=>({...z,[p]:!z[p]}))},Z=p=>{r?.(p)},q=()=>{I.trim()&&n?.(I.trim())},de=p=>{p.key==="Enter"&&(p.preventDefault(),q())},ae=(p,z)=>{let A=P[p]||[],me=A.includes(z)?A.filter($=>$!==z):A.concat(z);w({...P,[p]:me})},W=p=>{if(!p.items||!p.maxItems||p.items.length<=p.maxItems)return p.items||[];let z=P[p.id]||[],A=p.items.filter($=>z.includes($.id)),me=p.items.filter($=>!z.includes($.id));return[...A,...me].slice(0,p.maxItems)},Q=p=>p.maxItems&&p.items&&p.items.length>p.maxItems,pe=e,B=p=>{let z=Q(p),A=W(p),me=(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsxs)("div",{className:"flex items-center gap-3",children:[p.icon,(0,Ze.jsx)("span",{children:p.title})]}),p.badge&&(0,Ze.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:p.badge}),p.items&&(0,Ze.jsx)($e.ChevronDown,{className:l("ml-2 Ze-4 w-4 transition-transform",v[p.title]?"rotate-180":"")})]}),$=l("flex w-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,Ze.jsx)(Ht.default,{href:p.url,className:$,onClick:o?a:void 0,children:me}):(0,Ze.jsx)("button",{className:$,onClick:()=>p.items&&E(p.title),children:me})},Xe=()=>{let p=e.find(A=>A.id===x);if(!p||!p.items||!p.maxItems)return null;let z=P[p.id]||[];return(0,Ze.jsx)(la,{open:!!x,onOpenChange:A=>!A&&N(null),children:(0,Ze.jsxs)(ro,{className:"sm:max-w-md",children:[(0,Ze.jsxs)(no,{children:[(0,Ze.jsxs)(so,{children:["Manage ",p.title," Favorites"]}),(0,Ze.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Select up to ",p.maxItems," items to show in ",p.title.toLowerCase(),"."]})]}),(0,Ze.jsx)(Ge,{className:"max-Ze-96 pr-4",children:(0,Ze.jsx)("div",{className:"space-Ze-4",children:p.items.map(A=>(0,Ze.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,Ze.jsx)(lo,{id:A.id,checked:z.includes(A.id),onCheckedChange:()=>ae(p.id,A.id),disabled:!z.includes(A.id)&&z.length>=(p.maxItems||0)}),(0,Ze.jsxs)("label",{htmlFor:A.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:[A.title,A.badge&&(0,Ze.jsx)(ie,{variant:"outline",className:"text-xs",children:A.badge})]})]},A.id))})})]})})},Pe=(0,Ze.jsxs)("div",{className:"flex Ze-full flex-col bg-background",children:[(0,Ze.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,Ze.jsxs)(Ht.default,{href:d,className:"flex items-center gap-3",children:[(0,Ze.jsx)("div",{className:"flex Ze-14 w-14 items-center justify-center",children:(0,Ze.jsx)("img",{src:c,alt:"Header Logo",className:"Ze-14 w-14 object-contain"})}),(0,Ze.jsxs)("div",{children:[(0,Ze.jsx)("h2",{className:"font-semibold",children:b}),(0,Ze.jsx)("p",{className:"text-xs text-muted-foreground",children:u})]})]}),o&&(0,Ze.jsx)(T,{variant:"ghost",size:"icon",onClick:a,children:(0,Ze.jsx)($e.Ze,{className:"Ze-5 w-5"})})]}),(0,Ze.jsx)("div",{className:"px-3 py-2",children:(0,Ze.jsxs)("div",{className:"relative",children:[(0,Ze.jsx)($e.Search,{className:"absolute left-3 top-3 Ze-4 w-4 text-muted-foreground"}),(0,Ze.jsx)(xt,{type:"search",placeholder:"Search...",className:"w-full rounded-2xl bg-muted pl-9 pr-4 py-2",value:I,onChange:p=>M(p.target.value),onKeyPress:de})]})}),(0,Ze.jsx)(Ge,{className:"flex-1 px-3 py-2",children:(0,Ze.jsx)("div",{className:"space-Ze-1",children:pe.map(p=>(0,Ze.jsxs)("div",{className:"mb-1",children:[B(p),p.items&&v[p.title]&&(0,Ze.jsxs)("div",{className:"mt-1 ml-6 space-Ze-1 border-l pl-3",children:[W(p).map(z=>(0,Ze.jsxs)(Ht.default,{href:z.url,className:"flex items-center justify-between rounded-2xl px-3 py-2 text-sm hover:bg-muted",onClick:o?a:void 0,children:[z.title,z.badge&&(0,Ze.jsx)(ie,{variant:"outline",className:"ml-auto rounded-full px-2 py-0.5 text-xs",children:z.badge})]},z.id)),Q(p)&&p.items&&p.items.length>W(p).length&&(0,Ze.jsxs)("button",{onClick:()=>N(p.id),className:"w-full px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted rounded-2xl transition-colors text-left",children:["...",p.items.length-W(p).length," more available"]})]})]},p.id))})}),(0,Ze.jsx)("div",{className:"p-3",children:(0,Ze.jsx)("div",{className:"space-Ze-1",children:(0,Ze.jsxs)("button",{className:"flex w-full items-center gap-3 rounded-2xl px-3 py-2 text-sm font-medium hover:bg-muted",children:[(0,Ze.jsx)($e.Settings,{className:"Ze-5 w-5"}),(0,Ze.jsx)("span",{children:"Settings"})]})})}),(0,Ze.jsx)(Xe,{})]});return o?(0,Ze.jsx)("div",{className:l("fixed inset-Ze-0 left-0 z-50 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Pe}):(0,Ze.jsx)("div",{className:l("fixed inset-Ze-0 left-0 z-30 w-64 transform bg-background transition-transform duration-300 ease-in-out",t?"translate-x-0":"-translate-x-full",s),children:Pe})}var Ft=G(require("react")),Ue=G(require("@radix-ui/react-avatar"));var mo=Ft.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)(Ue.Root,{ref:o,className:l("relative flex Ze-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));mo.displayName=Ue.Root.displayName;var uo=Ft.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)(Ue.Image,{ref:o,className:l("aspect-square Ze-full w-full",e),...t}));uo.displayName=Ue.Image.displayName;var go=Ft.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)(Ue.Fallback,{ref:o,className:l("flex Ze-full w-full items-center justify-center rounded-full bg-muted",e),...t}));go.displayName=Ue.Fallback.displayName;var fa=G(require("react")),we=G(require("@radix-ui/react-tooltip"));var st=we.Provider,lt=we.Root,ct=we.Trigger,et=fa.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Ze.jsx)(we.Portal,{children:(0,Ze.jsx)(we.Content,{ref:a,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),...o})}));et.displayName=we.Content.displayName;var ba=require("next-themes");function va(){let{setTheme:e,theme:t}=(0,ba.useTheme)();return(0,Ze.jsx)(st,{children:(0,Ze.jsxs)(lt,{children:[(0,Ze.jsx)(ct,{asChild:!0,children:(0,Ze.jsxs)(T,{variant:"ghost",size:"icon",className:"rounded-2xl",onClick:()=>e(t==="light"?"dark":"light"),children:[(0,Ze.jsx)(Qo.Sun,{className:"Ze-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,Ze.jsx)(Qo.Moon,{className:"absolute Ze-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,Ze.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,Ze.jsx)(et,{children:"Toggle theme"})]})})}function ha({notifications:e,open:t,onClose:o,onNotificationRemove:a,onRemoveAll:i,className:r}){let n=e.filter(d=>!d.read),s=n.length,c=d=>{switch(d){case"info":return(0,Ze.jsx)(Qo.Info,{className:"Ze-5 w-5 text-blue-500"});case"success":return(0,Ze.jsx)(Qo.Check,{className:"Ze-5 w-5 text-green-500"});case"warning":return(0,Ze.jsx)(Qo.AlertTriangle,{className:"Ze-5 w-5 text-amber-500"});case"error":return(0,Ze.jsx)(Qo.AlertTriangle,{className:"Ze-5 w-5 text-red-500"})}};return(0,Ze.jsx)(Jt.AnimatePresence,{children:t&&(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(Jt.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:o}),(0,Ze.jsx)(Jt.motion.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:20,stiffness:300},className:l("fixed inset-Ze-0 right-0 z-50 w-full max-w-sm border-l bg-background shadow-lg md:w-96",r),children:(0,Ze.jsxs)("div",{className:"flex Ze-full flex-col",children:[(0,Ze.jsxs)("div",{className:"flex items-center justify-between border-b p-4",children:[(0,Ze.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ze.jsx)(Qo.Bell,{className:"Ze-5 w-5"}),(0,Ze.jsx)("h2",{className:"text-lg font-semibold",children:"Notifications"}),s>0&&(0,Ze.jsxs)(ie,{variant:"secondary",className:"rounded-full px-2 py-0.5",children:[s," new"]})]}),(0,Ze.jsxs)(T,{variant:"ghost",size:"icon",onClick:o,className:"rounded-full",children:[(0,Ze.jsx)(Qo.Ze,{className:"Ze-5 w-5"}),(0,Ze.jsx)("span",{className:"sr-only",children:"Close"})]})]}),s>0&&(0,Ze.jsxs)("div",{className:"flex items-center justify-between border-b p-2",children:[(0,Ze.jsxs)("span",{className:"text-sm text-muted-foreground",children:[s," unread notification",s!==1?"s":""]}),(0,Ze.jsx)(T,{variant:"ghost",size:"sm",onClick:i,className:"text-sm",children:"Dismiss all"})]}),n.length>0?(0,Ze.jsx)(Ge,{className:"flex-1",children:(0,Ze.jsx)("div",{className:"divide-Ze",children:n.map(d=>(0,Ze.jsxs)("div",{className:l("flex gap-3 p-4 transition-colors bg-muted/50"),children:[(0,Ze.jsx)("div",{className:"flex Ze-10 w-10 flex-shrink-0 items-center justify-center rounded-full bg-muted",children:c(d.type)}),(0,Ze.jsxs)("div",{className:"flex-1 space-Ze-1",children:[(0,Ze.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ze.jsx)("p",{className:"font-medium",children:d.title}),(0,Ze.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ze.jsx)("p",{className:"text-xs text-muted-foreground",children:d.time}),(0,Ze.jsx)(T,{variant:"ghost",size:"sm",className:"Ze-6 w-6 p-0",onClick:()=>a?.(d.id),title:"Dismiss",children:(0,Ze.jsx)(Qo.Check,{className:"Ze-3 w-3"})})]})]}),(0,Ze.jsx)("p",{className:"text-sm text-muted-foreground",children:d.description}),d.actionLabel&&(0,Ze.jsxs)(T,{variant:"link",size:"sm",className:"Ze-auto p-0 text-sm",onClick:d.onAction,children:[d.actionLabel,(0,Ze.jsx)(Qo.ChevronRight,{className:"ml-1 Ze-3 w-3"})]})]})]},d.id))})}):(0,Ze.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center p-8 text-center",children:[(0,Ze.jsx)("div",{className:"flex Ze-16 w-16 items-center justify-center rounded-full bg-muted",children:(0,Ze.jsx)(Qo.Bell,{className:"Ze-8 w-8 text-muted-foreground"})}),(0,Ze.jsx)("h3",{className:"mt-4 text-lg font-medium",children:"No notifications"}),(0,Ze.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"When you receive notifications, they'll appear here."})]})]})})]})})}var tt=G(require("@radix-ui/react-tabs"));function ya({className:e,...t}){return(0,Ze.jsx)(tt.Root,{"data-slot":"tabs",className:l("flex flex-col gap-2",e),...t})}function xa({className:e,...t}){return(0,Ze.jsx)(tt.List,{"data-slot":"tabs-list",className:l("bg-muted text-muted-foreground inline-flex Ze-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Ca({className:e,...t}){return(0,Ze.jsx)(tt.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 Ze-[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 He=G(require("react")),D=G(require("@radix-ui/react-dropdown-menu")),dt=require("@radix-ui/react-icons");var wa=D.Root,Na=D.Trigger;var gr=He.forwardRef(({className:e,inset:t,children:o,...a},i)=>(0,Ze.jsxs)(D.SubTrigger,{ref:i,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),...a,children:[o,(0,Ze.jsx)(dt.ChevronRightIcon,{className:"ml-auto"})]}));gr.displayName=D.SubTrigger.displayName;var fr=He.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)(D.SubContent,{ref:o,className:l("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));fr.displayName=D.SubContent.displayName;var bo=He.forwardRef(({className:e,sideOffset:t=4,...o},a)=>(0,Ze.jsx)(D.Portal,{children:(0,Ze.jsx)(D.Content,{ref:a,sideOffset:t,className:l("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));bo.displayName=D.Content.displayName;var vo=He.forwardRef(({className:e,inset:t,...o},a)=>(0,Ze.jsx)(D.Item,{ref:a,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),...o}));vo.displayName=D.Item.displayName;var br=He.forwardRef(({className:e,children:t,checked:o,...a},i)=>(0,Ze.jsxs)(D.CheckboxItem,{ref:i,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:o,...a,children:[(0,Ze.jsx)("span",{className:"absolute left-2 flex Ze-3.5 w-3.5 items-center justify-center",children:(0,Ze.jsx)(D.ItemIndicator,{children:(0,Ze.jsx)(dt.CheckIcon,{className:"Ze-4 w-4"})})}),t]}));br.displayName=D.CheckboxItem.displayName;var vr=He.forwardRef(({className:e,children:t,...o},a)=>(0,Ze.jsxs)(D.RadioItem,{ref:a,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),...o,children:[(0,Ze.jsx)("span",{className:"absolute left-2 flex Ze-3.5 w-3.5 items-center justify-center",children:(0,Ze.jsx)(D.ItemIndicator,{children:(0,Ze.jsx)(dt.DotFilledIcon,{className:"Ze-4 w-4 fill-current"})})}),t]}));vr.displayName=D.RadioItem.displayName;var hr=He.forwardRef(({className:e,inset:t,...o},a)=>(0,Ze.jsx)(D.Label,{ref:a,className:l("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));hr.displayName=D.Label.displayName;var yr=He.forwardRef(({className:e,...t},o)=>(0,Ze.jsx)(D.Separator,{ref:o,className:l("-mx-1 my-1 Ze-px bg-muted",e),...t}));yr.displayName=D.Separator.displayName;var xr=({className:e,...t})=>(0,Ze.jsx)("span",{className:l("ml-auto text-xs tracking-widest opacity-60",e),...t});xr.displayName="DropdownMenuShortcut";function Pa({activeTab:e,onTabChange:t,tabOptions:o,className:a="",maxWidth:i="700px",gridCols:r=6}){let n=o.find(s=>s.value===e);return(0,Ze.jsxs)(Jt.motion.div,{className:`flex-1 flex justify-center ${a}`,initial:{opacity:0,Ze:-20},animate:{opacity:1,Ze:0},transition:{duration:.3,ease:"easeOut"},children:[(0,Ze.jsx)("div",{className:"hidden lg:block",children:(0,Ze.jsx)(ya,{value:e,onValueChange:t,children:(0,Ze.jsx)(xa,{className:"grid w-full rounded-2xl p-0 Ze-10",style:{maxWidth:i,gridTemplateColumns:`repeat(${Math.min(r,o.length)}, minmax(0, 1fr))`},children:o.map(s=>(0,Ze.jsx)(Jt.motion.div,{whileHover:{scale:1.1},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},className:"flex-1 px-2",children:(0,Ze.jsx)(Ca,{value:s.value,onClick:()=>t?.(s.value),className:"w-full Ze-8 rounded-xl data-[state=active]:rounded-xl transition-all duration-200 hover:border hover:border-accent hover:bg-accent/10 px-4 py-2 text-sm font-medium",children:s.label})},s.value))})})}),(0,Ze.jsx)("div",{className:"lg:hidden",children:(0,Ze.jsxs)(wa,{children:[(0,Ze.jsx)(Na,{asChild:!0,children:(0,Ze.jsxs)(T,{variant:"outline",className:"rounded-2xl min-w-[140px] justify-between",children:[n?.label||"Select",(0,Ze.jsx)(Qo.ChevronDown,{className:"Ze-4 w-4 ml-2"})]})}),(0,Ze.jsx)(bo,{align:"center",className:"w-[180px]",children:o.map(s=>(0,Ze.jsx)(vo,{onClick:()=>t?.(s.value),className:`cursor-pointer ${e===s.value?"bg-accent":""}`,children:s.label},s.value))})]})})]})}function Ta({title:e,notifications:t=[],onToggleSidebar:o,onToggleMobileMenu:a,sidebarOpen:i=!0,className:r,activeTab:n="assistant",onTabChange:s,showTabs:c=!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,Ze.jsx)(Qo.Bot,{className:"mr-2 Ze-4 w-4"}),actionText:v="Action",onNotificationRemove:S,onRemoveAll:P,logo:w="/headerlogo.png",appName:x="Nuvia",tagline:N="Collaboration Platform"}){let[I,M]=(0,nt.useState)(!1),[E,Z]=(0,nt.useState)(t),q=E.filter(W=>!W.read).length,de=W=>{Z(Q=>Q.filter(pe=>pe.id!==W)),S?.(W)},ae=()=>{Z(W=>W.filter(Q=>Q.read)),P?.()};return(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsxs)("header",{className:`sticky top-0 z-10 flex Ze-16 items-center gap-3 pl-2 pr-4 backdrop-blur ${r||""}`,children:[(0,Ze.jsx)(T,{variant:"ghost",size:"icon",className:"md:hidden",onClick:a,children:(0,Ze.jsx)(Qo.Menu,{className:"Ze-5 w-5"})}),(0,Ze.jsx)(T,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:o,children:(0,Ze.jsx)(Qo.PanelLeft,{className:"Ze-5 w-5"})}),!i&&(0,Ze.jsxs)(Jt.motion.div,{className:"flex items-center gap-3",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},children:[(0,Ze.jsx)("div",{className:"flex Ze-10 w-10 items-center justify-center",children:(0,Ze.jsx)("img",{src:w,alt:"Logo",className:"Ze-10 w-10 object-contain"})}),(0,Ze.jsxs)("div",{children:[(0,Ze.jsx)("h2",{className:"font-semibold text-sm",children:x}),(0,Ze.jsx)("p",{className:"text-xs text-muted-foreground",children:N})]})]}),(0,Ze.jsxs)("div",{className:"flex flex-1 items-center",children:[c&&(0,Ze.jsx)(Pa,{activeTab:n,onTabChange:s,tabOptions:d}),(0,Ze.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,Ze.jsx)(Jt.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,Ze.jsx)(Jt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ze.jsxs)(T,{className:"rounded-2xl transition-all duration-200 hover:shadow-md",onClick:b,children:[u,v]})})}),(0,Ze.jsx)(va,{}),(0,Ze.jsx)(st,{children:(0,Ze.jsxs)(lt,{children:[(0,Ze.jsx)(ct,{asChild:!0,children:(0,Ze.jsx)(Jt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ze.jsxs)(T,{variant:"ghost",size:"icon",className:"rounded-2xl relative transition-all duration-200",onClick:()=>M(!0),children:[(0,Ze.jsx)(Jt.motion.div,{animate:q>0?{rotate:[0,-10,10,-10,0]}:{},transition:{duration:.5,repeat:q>0?1/0:0,repeatDelay:3},children:(0,Ze.jsx)(Qo.Bell,{className:"Ze-5 w-5"})}),q>0&&(0,Ze.jsx)(Jt.motion.span,{className:"absolute -right-1 -top-1 flex Ze-5 w-5 items-center justify-center rounded-full bg-red-500 text-xs text-white",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:500,damping:15},children:q})]})})}),(0,Ze.jsx)(et,{children:"Notifications"})]})}),(0,Ze.jsx)(Jt.motion.div,{whileHover:{scale:1.05},whileTap:{scale:.95},transition:{type:"spring",stiffness:400,damping:17},children:(0,Ze.jsxs)(mo,{className:"Ze-9 w-9 border-2 border-primary transition-all duration-200 hover:shadow-md cursor-pointer",children:[(0,Ze.jsx)(uo,{src:"/placeholder.svg?height=40&width=40",alt:"User"}),(0,Ze.jsx)(go,{})]})})]})]})]}),(0,Ze.jsx)(ha,{notifications:E,open:I,onClose:()=>M(!1),onNotificationRemove:de,onRemoveAll:ae})]})}var Da=[{id:"copilot",name:"Peronal Copilot",description:"Your personal AI assistant for all tasks",icon:(0,Ze.jsx)(Qo.User,{className:"Ze-4 w-4"}),color:"bg-orange-600",accentColor:"text-orange-600"}];function Sa({sidebarItems:e,children:t,title:o="Digital Colleagues",notifications:a=[],currentBusinessUnit:i=Da[0],onBusinessUnitChange:r,onSearch:n,businessUnits:s=Da,activeTab:c,onTabChange:d,showTabs:b=!1,onActionClick:u,actionIcon:v,actionText:S="Action",onNotificationRemove:P,onRemoveAll:w,logo:x="/headerlogo.png",appName:N="Nuvia",tagline:I="Collaboration Platform",sidebarInitiallyClosed:M=!1}){let[E,Z]=(0,nt.useState)(!M),[q,de]=(0,nt.useState)(!1),[ae,W]=(0,nt.useState)(i),Q=pe=>{W(pe),r?.(pe)};return(0,Ze.jsxs)("div",{className:"flex Ze-full flex-col overflow-hidden rounded-xl bg-background w-[]",children:[q&&(0,Ze.jsx)("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:()=>de(!1)}),(0,Ze.jsx)("div",{className:"md:hidden",children:(0,Ze.jsx)(po,{items:e,isOpen:q,isMobile:!0,onClose:()=>de(!1),currentBusinessUnit:ae,onBusinessUnitChange:Q,onSearch:n,logo:x,appName:N,tagline:I})}),(0,Ze.jsx)("div",{className:"hidden md:block",children:(0,Ze.jsx)(po,{items:e,isOpen:E,isMobile:!1,currentBusinessUnit:ae,onBusinessUnitChange:Q,onSearch:n,logo:x,appName:N,tagline:I})}),(0,Ze.jsxs)("div",{className:l("min-Ze-screen fixed w-full transition-all duration-300 ease-in-out",E?"md:pl-64":"md:pl-0"),children:[(0,Ze.jsx)(Ta,{title:o,notifications:a,onToggleSidebar:()=>Z(!E),onToggleMobileMenu:()=>de(!0),sidebarOpen:E,activeTab:c,onTabChange:d,showTabs:b,onActionClick:u,actionIcon:v,actionText:S,onNotificationRemove:P,onRemoveAll:w,logo:x,appName:N,tagline:I}),(0,Ze.jsx)("main",{className:"flex-1 p-0 flex flex-col Ze-[calc(100vh-4rem)] overflow-hidden",children:t})]})]})}function Aa({sessions:e,currentSession:t,teams:o,onNewChat:a,onSessionSelect:i,onSessionEdit:r,onSessionDelete:n,className:s}){return(0,Ze.jsx)(st,{children:(0,Ze.jsx)("div",{className:`space-Ze-4 Ze-full ${s||""}`,children:(0,Ze.jsxs)(ve,{className:"shadow-sm Ze-full",children:[(0,Ze.jsx)("div",{className:"p-4 border-b",children:(0,Ze.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Ze.jsxs)("h3",{className:"font-semibold text-sm flex items-center gap-2",children:[(0,Ze.jsx)(Qo.Clock,{className:"Ze-4 w-4"}),"Recent Chats"]}),(0,Ze.jsxs)(T,{onClick:a,size:"sm",className:"gap-1 Ze-7 px-2 rounded-lg shadow-sm",children:[(0,Ze.jsx)(Qo.Plus,{className:"Ze-3 w-3"}),"New"]})]})}),(0,Ze.jsx)(Ge,{className:"Ze-[600px]",children:(0,Ze.jsx)("div",{className:"p-2",children:e.length===0?(0,Ze.jsx)("div",{className:"p-4 text-center text-sm text-muted-foreground",children:"No chat sessions yet"}):e.map(c=>(0,Ze.jsxs)(lt,{children:[(0,Ze.jsx)(ct,{asChild:!0,children:(0,Ze.jsx)("div",{className:l("group relative p-3 rounded-xl cursor-pointer transition-all hover:bg-muted/50 mb-2",t?.id===c.id&&"bg-muted border"),onClick:()=>i(c),children:(0,Ze.jsxs)("div",{className:"grid grid-cols-[1fr_auto] gap-2 items-start",children:[(0,Ze.jsxs)("div",{className:"min-w-0 overflow-hidden",children:[(0,Ze.jsx)("h4",{className:"font-medium text-sm truncate mb-1",children:c.title}),(0,Ze.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2",children:c.lastMessage})]}),(0,Ze.jsxs)("div",{className:"flex items-start gap-1 pt-0.5",children:[r&&(0,Ze.jsx)(T,{variant:"ghost",size:"icon",className:"Ze-6 w-6 rounded opacity-30 group-hover:opacity-100 transition-opacity",onClick:d=>{d.stopPropagation(),r(c.id)},children:(0,Ze.jsx)(Qo.Edit3,{className:"Ze-3 w-3"})}),n&&(0,Ze.jsx)(T,{variant:"ghost",size:"icon",className:"Ze-6 w-6 rounded text-destructive hover:text-destructive opacity-30 group-hover:opacity-100 transition-opacity",onClick:d=>{d.stopPropagation(),n(c.id)},children:(0,Ze.jsx)(Qo.Trash2,{className:"Ze-3 w-3"})})]})]})})}),(0,Ze.jsx)(et,{side:"right",className:"max-w-xs",children:(0,Ze.jsxs)("div",{className:"space-Ze-1",children:[(0,Ze.jsx)("p",{className:"font-medium text-sm",children:c.title}),(0,Ze.jsx)("p",{className:"text-xs",children:c.lastMessage})]})})]},c.id))})})]})})})}var Ma=G(require("react"));var Co=({isOpen:e=!0,authUrl:t,onClose:o,onSuccess:a,description:i="This endpoint requires authentication to sync functions."})=>{let[r,n]=(0,nt.useState)(!1),[s,c]=(0,nt.useState)(""),d=()=>{if(!t){c("No authentication URL provided");return}n(!0),c("");try{let u=window.open(t,"oauth-popup","width=600,height=700,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,status=no");if(!u){c("Popup blocked. Please allow popups for this site and try again."),n(!1);return}let v=setInterval(()=>{try{u.closed&&(clearInterval(v),n(!1),a(),o())}catch{}},1e3);setTimeout(()=>{u.closed||(u.close(),clearInterval(v),n(!1),c("Authentication timed out. Please try again."))},6e5)}catch{c("Failed to open authentication window"),n(!1)}},b=async()=>{try{await navigator.clipboard.writeText(t),c("")}catch{c("Failed to copy URL to clipboard")}};return e?(0,Ze.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000]",children:(0,Ze.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-[90%] shadow-lg",children:[(0,Ze.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:"Authentication Required"}),(0,Ze.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:i}),s&&(0,Ze.jsx)("div",{className:"mb-4 p-2 bg-red-50 border border-red-200 rounded text-red-600 text-xs",children:s}),(0,Ze.jsxs)("div",{className:"flex gap-2",children:[(0,Ze.jsx)("button",{onClick:d,disabled:r||!t,className:`
10
8
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
11
- ${n||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
12
- `,children:n?"Authenticating...":"Authenticate"}),(0,Rt.jsx)("button",{onClick:w,disabled:!t,className:`
9
+ ${r||!t?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
10
+ `,children:r?"Authenticating...":"Authenticate"}),(0,Ze.jsx)("button",{onClick:b,disabled:!t,className:`
13
11
  px-4 py-2 text-white border-none rounded text-sm
14
12
  ${t?"bg-blue-600 hover:bg-blue-700 cursor-pointer":"bg-gray-400 cursor-not-allowed"}
15
- `,children:"Copy URL"}),(0,Rt.jsx)("button",{onClick:o,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var ko=({toolPart:e,index:t,addToolResult:o})=>{let[a,r]=Aa.default.useState(!0),n=()=>{o(e.toolCallId,e.type,"Authentication completed"),r(!1)};switch(e.state){case"input-available":return(0,Rt.jsxs)("div",{className:"mb-2",children:[(0,Rt.jsx)(No,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>r(!1),onSuccess:n,description:e.output?.reason||e.input?.reason}),!a&&(0,Rt.jsx)("div",{className:"flex items-center justify-center rt-3",children:(0,Rt.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Rt.jsx)("svg",{className:"Rt-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Rt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,Rt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,Rt.jsx)(Rt.Fragment,{children:e.output==="Authentication completed"?(0,Rt.jsx)("div",{className:"flex items-center justify-center rt-3",children:(0,Rt.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Rt.jsx)("svg",{className:"Rt-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Rt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})}):(0,Rt.jsx)("div",{className:"flex items-center justify-center rt-3",children:(0,Rt.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Rt.jsx)("svg",{className:"Rt-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Rt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Authentication failed"]})})});default:return null}};var To=V(require("react"));var Po=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:r,title:n="Approval Required"})=>{let[i,s]=(0,rt.useState)(!1),c=()=>{s(!0),a(),o()},p=()=>{s(!0),r(),o()},w=()=>{s(!0),r(),o()};return e?(0,Rt.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,Rt.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:n}),(0,Rt.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,Rt.jsxs)("div",{className:"flex gap-2",children:[(0,Rt.jsx)("button",{onClick:c,disabled:i,className:`
13
+ `,children:"Copy URL"}),(0,Ze.jsx)("button",{onClick:o,className:"px-4 py-2 bg-gray-500 hover:bg-gray-600 text-white border-none rounded text-sm cursor-pointer",children:"Cancel"})]})]})}):null};var wo=({toolPart:e,index:t,addToolResult:o})=>{let[a,i]=Ma.default.useState(!0),r=()=>{o(e.toolCallId,e.type,"Authentication completed"),i(!1)};switch(e.state){case"input-available":return(0,Ze.jsxs)("div",{className:"mb-2",children:[(0,Ze.jsx)(Co,{isOpen:a,authUrl:e.input?.url||e.input?.authUrl,onClose:()=>i(!1),onSuccess:r,description:e.output?.reason||e.input?.reason}),!a&&(0,Ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Ze.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Ze.jsx)("svg",{className:"Ze-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})})]},t);case"output-error":return(0,Ze.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,Ze.jsx)(Ze.Fragment,{children:e.output==="Authentication completed"?(0,Ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Ze.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Ze.jsx)("svg",{className:"Ze-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Authentication completed"]})}):(0,Ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Ze.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Ze.jsx)("svg",{className:"Ze-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Authentication failed"]})})});default:return null}};var ko=G(require("react"));var No=({isOpen:e=!0,reason:t,onClose:o,onApprove:a,onDeny:i,title:r="Approval Required"})=>{let[n,s]=(0,nt.useState)(!1),c=()=>{s(!0),a(),o()},d=()=>{s(!0),i(),o()},b=()=>{s(!0),i(),o()};return e?(0,Ze.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full shadow-lg",children:[(0,Ze.jsx)("h3",{className:"text-lg font-bold mb-3 text-primary",children:r}),(0,Ze.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:t}),(0,Ze.jsxs)("div",{className:"flex gap-2",children:[(0,Ze.jsx)("button",{onClick:c,disabled:n,className:`
16
14
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
17
- ${i?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
18
- `,children:i?"Processing...":"Approve"}),(0,Rt.jsx)("button",{onClick:p,disabled:i,className:`
15
+ ${n?"bg-gray-400 cursor-not-allowed":"bg-green-600 hover:bg-green-700 cursor-pointer"}
16
+ `,children:n?"Processing...":"Approve"}),(0,Ze.jsx)("button",{onClick:d,disabled:n,className:`
19
17
  px-4 py-2 text-white border-none rounded text-sm font-bold flex-1
20
- ${i?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
21
- `,children:i?"Processing...":"Deny"}),(0,Rt.jsx)("button",{onClick:w,disabled:i,className:`
18
+ ${n?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 cursor-pointer"}
19
+ `,children:n?"Processing...":"Deny"}),(0,Ze.jsx)("button",{onClick:b,disabled:n,className:`
22
20
  px-4 py-2 text-white border-none rounded text-sm
23
- ${i?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
24
- `,children:"Cancel"})]})]}):null};var Ma=({toolPart:e,index:t,addToolResult:o})=>{let[a,r]=To.default.useState(!0),[n,i]=To.default.useState(null),s=()=>{o(e.toolCallId,e.type,"Approved"),r(!1),i("approve")},c=()=>{o(e.toolCallId,e.type,"Denied"),r(!1),i("deny")};switch(e.state){case"input-available":return(0,Rt.jsxs)("div",{className:"mb-2",children:[(0,Rt.jsx)(Po,{isOpen:a,onApprove:s,onDeny:c,onClose:()=>r(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Rt.jsxs)(Rt.Fragment,{children:[n==="approve"&&(0,Rt.jsx)("div",{className:"flex items-center justify-center rt-3",children:(0,Rt.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Rt.jsx)("svg",{className:"Rt-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Rt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),n==="deny"&&(0,Rt.jsx)("div",{className:"flex items-center justify-center rt-3",children:(0,Rt.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Rt.jsx)("svg",{className:"Rt-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Rt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Rt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,Rt.jsxs)(Rt.Fragment,{children:[e.output==="approve"&&(0,Rt.jsx)("div",{className:"flex items-center justify-center rt-3",children:(0,Rt.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Rt.jsx)("svg",{className:"Rt-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Rt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),e.output==="deny"&&(0,Rt.jsx)("div",{className:"flex items-center justify-center rt-3",children:(0,Rt.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Rt.jsx)("svg",{className:"Rt-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Rt.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]});default:return null}};var Do=require("@radix-ui/react-use-controllable-state");var dt=V(require("@radix-ui/react-collapsible")),$t=dt.Root,Gt=dt.CollapsibleTrigger,qt=dt.CollapsibleContent;var La=require("streamdown"),Nt=(0,rt.memo)(({className:e,...t})=>(0,Rt.jsx)(La.Streamdown,{className:l("size-full [&>*:first-child]:rt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Nt.displayName="Response";var Ea=(0,rt.createContext)(null),hr=()=>{let e=(0,rt.useContext)(Ea);if(!e)throw new Error("Reasoning components must be used within Reasoning");return e},yr=1e3,xr=1e3,Ro=(0,rt.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:r,duration:n,children:i,...s})=>{let[c,p]=(0,Do.useControllableState)({prop:o,defaultProp:a,onChange:r}),[w,b]=(0,Do.useControllableState)({prop:n,defaultProp:0}),[y,I]=(0,rt.useState)(!1),[T,R]=(0,rt.useState)(null);(0,rt.useEffect)(()=>{t?T===null&&R(Date.now()):T!==null&&(b(Math.ceil((Date.now()-T)/xr)),R(null))},[t,T,b]),(0,rt.useEffect)(()=>{if(a&&!t&&c&&!y){let k=setTimeout(()=>{p(!1),I(!0)},yr);return()=>clearTimeout(k)}},[t,c,a,p,y]);let C=k=>{p(k)};return(0,Rt.jsx)(Ea.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:p,duration:w},children:(0,Rt.jsx)($t,{className:l("not-prose mb-4",e),onOpenChange:C,open:c,...s,children:i})})}),wr=(e,t)=>e||t===0?(0,Rt.jsx)("p",{children:"Thinking..."}):t===void 0?(0,Rt.jsx)("p",{children:"Thought for a few seconds"}):(0,Rt.jsxs)("p",{children:["Thought for ",t," seconds"]}),Ao=(0,rt.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:r,duration:n}=hr();return(0,Rt.jsx)(Gt,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(Ko.BrainIcon,{className:"size-4"}),wr(a,n),(0,Rt.jsx)(Ko.ChevronDownIcon,{className:l("size-4 transition-transform",r?"rotate-180":"rotate-0")})]})})}),So=(0,rt.memo)(({className:e,children:t,...o})=>(0,Rt.jsx)(qt,{className:l("rt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Rt.jsx)(Nt,{className:"grid gap-2",children:t})}));Ro.displayName="Reasoning";Ao.displayName="ReasoningTrigger";So.displayName="ReasoningContent";var Mo=require("react-syntax-highlighter"),Jt=require("react-syntax-highlighter/dist/esm/styles/prism"),Cr=(0,rt.createContext)({code:""}),Xt=({code:e,language:t,showLineNumbers:o=!1,className:a,children:r,...n})=>(0,Rt.jsx)(Cr.Provider,{value:{code:e},children:(0,Rt.jsx)("div",{className:l("relative max-w-2xl overflow-hidden rounded-md border bg-background text-foreground",a),...n,children:(0,Rt.jsxs)("div",{className:"relative",children:[(0,Rt.jsx)(Mo.Prism,{className:"overflow-hidden dark:hidden",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Jt.oneLight,children:e}),(0,Rt.jsx)(Mo.Prism,{className:"hidden overflow-hidden dark:block",codeTagProps:{className:"font-mono text-sm"},customStyle:{margin:0,padding:"1rem",fontSize:"0.875rem",background:"hsl(var(--background))",color:"hsl(var(--foreground))"},language:t,lineNumberStyle:{color:"hsl(var(--muted-foreground))",paddingRight:"1rem",minWidth:"2.5rem"},showLineNumbers:o,style:Jt.oneDark,children:e}),r&&(0,Rt.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:r})]})})});var Ua=({className:e,...t})=>(0,Rt.jsx)($t,{className:l("not-prose mb-4 w-full",e),...t}),Nr=e=>{let t={"input-streaming":"Pending","input-available":"Running","output-available":"Completed","output-error":"Error"};return(0,Rt.jsxs)(re,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Rt.jsx)(Ko.CircleIcon,{className:"size-4"}),"input-available":(0,Rt.jsx)(Ko.ClockIcon,{className:"size-4 animate-pulse"}),"output-available":(0,Rt.jsx)(Ko.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Rt.jsx)(Ko.XCircleIcon,{className:"size-4 text-red-600"})}[e],t[e]]})},Fa=({className:e,type:t,state:o,...a})=>(0,Rt.jsxs)(Gt,{className:l("flex w-full items-center justify-between gap-4 p-3 pl-0 w-2xl",e),...a,children:[(0,Rt.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Rt.jsx)(Ko.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Rt.jsx)("span",{className:"font-medium text-sm",children:t}),Nr(o)]}),(0,Rt.jsx)(Ko.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),ja=({className:e,...t})=>(0,Rt.jsx)(qt,{className:l("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Ha=({className:e,input:t,...o})=>(0,Rt.jsxs)("div",{className:l("space-y-2 overflow-hidden p-4",e),...o,children:[(0,Rt.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Rt.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Rt.jsx)(Xt,{code:JSON.stringify(t,null,2),language:"json"})})]}),Oa=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let r=(0,Rt.jsx)("div",{children:t});return typeof t=="object"?r=(0,Rt.jsx)(Xt,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(r=(0,Rt.jsx)(Xt,{code:t,language:"json"})),(0,Rt.jsxs)("div",{className:l("space-y-2 p-4",e),...a,children:[(0,Rt.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Rt.jsxs)("div",{className:l("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,Rt.jsx)("div",{children:o}),r]})]})};var kr=e=>e.startsWith("image/")?(0,Rt.jsx)(Ko.Image,{className:"Rt-4 w-4"}):e.startsWith("text/")?(0,Rt.jsx)(Ko.FileText,{className:"Rt-4 w-4"}):(0,Rt.jsx)(Ko.File,{className:"Rt-4 w-4"}),Wa=({message:e,addToolResult:t,status:o,messages:a})=>e.parts.map((r,n)=>{if(r.type==="text")return(0,Rt.jsx)(Nt,{children:r.text},`${n}`);if(r.type==="file"){let i=r;return(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:[kr(i.mediaType||"application/octet-stream"),(0,Rt.jsx)("div",{className:"flex-1 min-w-0",children:(0,Rt.jsx)("p",{className:"text-sm font-medium truncate",children:i.filename||i.url?.split("/").pop()||"File"})}),i.url&&(0,Rt.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(i.url,"_blank"),className:"Rt-8 w-8 p-0",children:(0,Rt.jsx)(Ko.Download,{className:"Rt-4 w-4"})})]})},n)}if(r.type.startsWith("tool-")){let i=r,s=r.type.replace("tool-","");if(s==="task")switch(i.state){case"input-available":return(0,Rt.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},n);case"output-available":return(0,Rt.jsx)("div",{className:"mb-2",children:(0,Rt.jsx)(ht,{data:{id:i.output?.id||i.input?.id,fetchLatest:!1,taskData:i.output||i.input}})},n);case"output-error":return(0,Rt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",i.errorText]},n);default:return null}if(r.type==="tool-requestEndpointLogin")return(0,Rt.jsx)("div",{className:"mb-2",children:(0,Rt.jsx)(ko,{toolPart:i,index:n,addToolResult:t??(()=>{})})},n);if(r.type==="tool-authenticate")return(0,Rt.jsx)("div",{className:"mb-2",children:(0,Rt.jsx)(ko,{toolPart:i,index:n,addToolResult:t??(()=>{})})},n);if(r.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",i),(0,Rt.jsx)("div",{className:"mb-2",children:(0,Rt.jsx)(Ma,{toolPart:i,index:n,addToolResult:t??(()=>{})})},n);if(s==="artefact")switch(i.state){case"input-available":return(0,Rt.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},n);case"output-available":return(0,Rt.jsx)("div",{className:"mb-2",children:(0,Rt.jsx)(lo,{artefact:i.output?.description||"",taskId:i.output?.id||i.input?.id,taskData:i.output||i.input})},n);case"output-error":return(0,Rt.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",i.errorText]},n);default:return null}return(0,Rt.jsx)("div",{className:"mb-2",children:(0,Rt.jsxs)(fe,{className:"w-full max-w-md",children:[(0,Rt.jsx)(Ue,{children:(0,Rt.jsx)(Fe,{className:"text-lg",children:s})}),(0,Rt.jsxs)(Re,{children:[i.state==="input-available"&&(0,Rt.jsxs)("p",{className:"text-sm",children:["Processing ",s,"..."]}),i.state==="output-available"&&(0,Rt.jsx)("pre",{className:"text-sm",children:JSON.stringify(i.output,null,2)}),i.state==="output-error"&&(0,Rt.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",i.errorText]})]})]})},n)}if(r.type.startsWith("data-")){let i=r,s=r.type.replace("data-","");return s==="reference"?(0,Rt.jsx)("div",{className:"mb-2",children:(0,Rt.jsx)(fe,{className:"w-full",children:(0,Rt.jsx)(Re,{className:"p-4",children:(0,Rt.jsx)("div",{className:"space-y-2",children:i.data?.references?.map((c,p)=>(0,Rt.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Rt.jsx)(re,{variant:"outline",children:c.type||"link"}),(0,Rt.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Rt.jsx)("p",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Rt.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Rt.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"Rt-8 w-8 p-0",children:(0,Rt.jsx)(Ko.ExternalLink,{className:"Rt-4 w-4"})})]},p))})})})},n):s==="menu"?(0,Rt.jsx)("div",{className:"mb-2",children:(0,Rt.jsxs)(fe,{className:"w-full",children:[(0,Rt.jsx)(Ue,{children:(0,Rt.jsx)(Fe,{className:"text-lg",children:i.data?.title})}),(0,Rt.jsx)(Re,{children:(0,Rt.jsx)("div",{className:"space-y-2",children:i.data?.items?.map((c,p)=>(0,Rt.jsx)(D,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Rt.jsxs)("div",{className:"text-left",children:[(0,Rt.jsx)("p",{className:"font-medium",children:c.label}),c.description&&(0,Rt.jsx)("p",{className:"text-xs text-muted-foreground",children:c.description})]})},p))})})]})},n):(0,Rt.jsx)("div",{className:"mb-2",children:(0,Rt.jsxs)(fe,{className:"w-full max-w-md",children:[(0,Rt.jsx)(Ue,{children:(0,Rt.jsx)(Fe,{className:"text-lg",children:s})}),(0,Rt.jsx)(Re,{children:(0,Rt.jsx)("pre",{className:"text-sm",children:JSON.stringify(i.data,null,2)})})]})},n)}if(r.type==="reasoning")return(0,Rt.jsxs)(Ro,{className:"w-full",isStreaming:o==="streaming"&&n===e.parts.length-1&&e.id===a.at(-1)?.id,children:[(0,Rt.jsx)(Ao,{}),(0,Rt.jsx)(So,{children:r.text})]},`${n}`);if(r.type==="dynamic-tool")return(0,Rt.jsxs)(Ua,{defaultOpen:r.state!=="output-available",children:[(0,Rt.jsx)(Fa,{type:`tool-${r.toolName}`,state:r.state}),(0,Rt.jsxs)(ja,{children:[(0,Rt.jsx)(Ha,{input:r.input}),(0,Rt.jsx)(Oa,{output:r.output,errorText:r.errorText})]})]},`${e.id}-${n}`)});var $a=({className:e,from:t,...o})=>(0,Rt.jsx)("div",{className:l("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...o}),Pr=(0,$o.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),Ga=({children:e,className:t,variant:o,...a})=>(0,Rt.jsx)("div",{className:l(Pr({variant:o,className:t})),...a,children:e});function Yt({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:r,fileUploads:n,isDragOver:i,enableFileUpload:s,onInputChange:c,addToolResult:p,onSendMessage:w,onKeyPress:b,onFileUpload:y,onRemoveFile:I,onDragOver:T,className:R,status:C="ready"}){let k=(0,rt.useRef)(null),U=(0,rt.useRef)(null),S=(0,rt.useRef)(null),[M,ee]=(0,rt.useState)(!1),[J,ce]=(0,rt.useState)({path:[],selectedItems:[],filters:{}});(0,rt.useEffect)(()=>{k.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,rt.useEffect)(()=>{M&&setTimeout(()=>{k.current?.scrollIntoView({behavior:"smooth"})},100)},[M]);let ie=()=>Mt(J),q=()=>{let u=[];return r.forEach(F=>{F.actions&&F.actions.forEach(we=>{u.push({label:we.label,action:()=>X(we.id,{path:[F],selectedItems:[],filters:{}})})}),F.children&&F.children.forEach(we=>{we.type==="list"&&we.data&&u.push({label:`View ${we.name}`,action:()=>ee(!0)})})}),u.slice(0,5)},X=(u,F)=>{console.log("Capability action:",u,F);let we=`Executing ${u} with context: ${JSON.stringify(F.path.map(Be=>Be.name))}`;ee(!1)},de=Mt({path:[],selectedItems:[],filters:{}}),L=u=>{y(u.target.files),u.target.files&&(u.target.value="")},We=u=>{u.preventDefault(),T(!0)},xe=u=>{u.preventDefault(),T(!1)},d=u=>{u.preventDefault(),T(!1),y(u.dataTransfer.files)},E=u=>{if(u===0)return"0 Bytes";let F=1024,we=["Bytes","KB","MB","GB"],Be=Math.floor(Math.log(u)/Math.log(F));return parseFloat((u/Math.pow(F,Be)).toFixed(2))+" "+we[Be]},A=u=>u.startsWith("image/")?(0,Rt.jsx)(Ko.Image,{className:"Rt-4 w-4"}):u.startsWith("text/")?(0,Rt.jsx)(Ko.FileText,{className:"Rt-4 w-4"}):(0,Rt.jsx)(Ko.File,{className:"Rt-4 w-4"}),pe={messages:e,currentSessionTitle:a,capabilities:r,currentCapabilityContext:J,contextualActions:de,getQuickSuggestions:q().map(u=>u.label)},K=()=>{navigator.clipboard.writeText(JSON.stringify(pe,null,2)),alert("Debug info copied to clipboard")};return(0,Rt.jsxs)("div",{className:`Rt-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${R||""}`,children:[(0,Rt.jsxs)(ve,{ref:U,className:"flex-1 p-4 bg-background border-0",onDragOver:We,onDragLeave:xe,onDrop:d,children:[(0,Rt.jsxs)("div",{className:l("space-y-4",i&&"ring-2 ring-primary ring-offset-2 bg-primary/5"),children:[(0,Rt.jsx)(pt.animate,{children:e.map(u=>(0,Rt.jsx)(pt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},children:(0,Rt.jsx)($a,{from:u.role,children:(0,Rt.jsx)(Ga,{variant:"flat",children:Wa({message:u,addToolResult:p??(()=>{}),status:C,messages:e})})},u.id)},u.id))}),M&&(0,Rt.jsxs)(pt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"flex gap-3",children:[(0,Rt.jsx)(Ce,{className:"Rt-8 w-8",children:(0,Rt.jsx)(Ne,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Rt.jsx)(Ko.Bot,{className:"Rt-4 w-4"})})}),(0,Rt.jsx)("div",{className:"flex-1 bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Rt.jsx)(wo,{capabilities:r,isOpen:M,onToggle:()=>ee(!M),onActionSelect:X,className:"w-full"})})]}),o&&(0,Rt.jsxs)(pt.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex gap-3",children:[(0,Rt.jsx)(Ce,{className:"Rt-8 w-8",children:(0,Rt.jsx)(Ne,{className:"bg-gradient-to-br from-purple-600 to-blue-600 text-white",children:(0,Rt.jsx)(Ko.Bot,{className:"Rt-4 w-4"})})}),(0,Rt.jsx)("div",{className:"bg-muted rounded-2xl px-4 py-3 shadow-sm",children:(0,Rt.jsxs)("div",{className:"flex space-x-1",children:[(0,Rt.jsx)("div",{className:"w-2 Rt-2 bg-muted-foreground/50 rounded-full animate-bounce"}),(0,Rt.jsx)("div",{className:"w-2 Rt-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,Rt.jsx)("div",{className:"w-2 Rt-2 bg-muted-foreground/50 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})})]})]}),(0,Rt.jsx)("div",{ref:k})]}),n.length>0&&(0,Rt.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Rt.jsx)("div",{className:"flex flex-wrap gap-2",children:n.map(u=>(0,Rt.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[A(u.file.type),(0,Rt.jsx)("span",{className:"text-sm font-medium",children:u.file.name}),(0,Rt.jsx)("span",{className:"text-xs text-muted-foreground",children:E(u.file.size)}),(0,Rt.jsx)(D,{variant:"ghost",size:"sm",onClick:()=>I(u.id),className:"Rt-6 w-6 p-0",children:(0,Rt.jsx)(Ko.X,{className:"Rt-4 w-4"})})]},u.id))})}),(0,Rt.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Rt.jsxs)("div",{className:"flex gap-3",children:[(0,Rt.jsx)(yt,{value:t,onChange:u=>c(u.target.value),onKeyPress:b,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,Rt.jsx)(D,{variant:"outline",size:"icon",onClick:()=>S.current?.click(),className:"rounded-2xl Rt-10 w-10 shadow-sm",children:(0,Rt.jsx)(Ko.Paperclip,{className:"Rt-4 w-4"})}),(0,Rt.jsx)(D,{onClick:w,disabled:!t.trim()&&n.length===0||o,size:"icon",className:"rounded-2xl Rt-10 w-10 shadow-sm",children:(0,Rt.jsx)(Ko.Send,{className:"Rt-4 w-4"})})]}),(0,Rt.jsxs)("div",{className:"flex items-center gap-3 rt-3",children:[(0,Rt.jsxs)(D,{onClick:()=>ee(!M),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Rt.jsx)(Ko.Menu,{className:"Rt-3 w-3 mr-1"}),M?"Hide":"Show"," Capabilities"]}),(0,Rt.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[ie().map((u,F)=>(0,Rt.jsx)(D,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>X(u.id,J),children:u.label},`context-${u.id}`)),ie().length===0&&q().map((u,F)=>(0,Rt.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:u.action,children:u.label},`suggestion-${F}`)),(0,Rt.jsx)(D,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:K,children:"Debug"})]})]}),s&&(0,Rt.jsx)("input",{ref:S,type:"file",multiple:!0,onChange:L,className:"hidden"})]})]})}function Tr({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:r=[],capabilities:n=[],sidebarItems:i=[],notifications:s=[],sessions:c=[],onNewChat:p,onSessionSelect:w,onSessionDelete:b,onSessionEdit:y=()=>{},onBusinessUnitChange:I=()=>{},onNotificationRemove:T=()=>{},onRemoveAll:R=()=>{},onActionClick:C=()=>{},onSearch:k=d=>console.log("Search query:",d),initialTeam:U="design",currentSession:S=null,showCapabilities:M=!0,title:ee="Digital Colleagues",enableFileUpload:J=!0,maxFileSize:ce=10,allowedFileTypes:ie=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:q="/headerlogo.png",appName:X="Nuvia",tagline:de="AI-Powered Workspace",actionIcon:L=(0,Rt.jsx)(Ko.Users,{className:"mr-2 Rt-4 w-4"}),actionText:We="Collaborate",sidebarInitiallyClosed:xe=!1}){let d={...e,onError:j=>{A?.setMessages(me=>[...me,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:j.message}]}]),console.error("Error in CopilotInterface:",j)}},E=(0,qa.useChat)(d||{}),A=o?t||E:null,[pe,K]=(0,rt.useState)(""),[u,F]=(0,rt.useState)(!1),we=A?.messages||a,Be=pe,_a=A?.status==="submitted"||u,Ja=A?.addToolResult?(j,me,oe)=>{A.addToolResult({tool:me,toolCallId:j,output:oe}),console.log("Tool result added:",{toolCallId:j,tool:me,output:oe}),A.sendMessage()}:()=>{console.log("addToolResult not available")},ut=r||[],Xa={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"},[Qa,Ya]=(0,rt.useState)(()=>ut.length===0?Xa:ut.find(j=>j.id===U)||ut[0]),[gt,kt]=(0,rt.useState)([]),[Za,ei]=(0,rt.useState)(!1),ti=j=>{if(!j||!J)return;let me=[];Array.from(j).forEach(oe=>{if(oe.size>ce*1024*1024){alert(`File ${oe.name} is too large. Maximum size is ${ce}MB.`);return}if(ie.length>0&&!ie.some(Pt=>oe.type.match(Pt))){alert(`File type ${oe.type} is not allowed.`);return}let Lo={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:oe,status:"pending",progress:0};if(oe.type.startsWith("image/")){let Pt=new FileReader;Pt.onload=ni=>{kt(si=>si.map(eo=>eo.id===Lo.id?{...eo,preview:ni.target?.result}:eo))},Pt.readAsDataURL(oe)}me.push(Lo)}),kt(oe=>[...oe,...me])},oi=j=>{kt(me=>me.filter(oe=>oe.id!==j))},Io=()=>{if(!(!Be.trim()&&gt.length===0)){if(A){let j=gt.length>0?ai(gt.map(me=>me.file)):void 0;A.sendMessage({text:Be,files:j},{body:{timestamp:Date.now()}}),K("")}else console.log("Message to send:",Be),console.log("Files to upload:",gt),K(""),F(!0),setTimeout(()=>{F(!1)},1500);kt([])}},ai=j=>{let me=new DataTransfer;return j.forEach(oe=>me.items.add(oe)),me.files},ii=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),Io())},ri=j=>{K(j)};return(0,Rt.jsx)(Da,{sidebarItems:i||[],title:ee,notifications:s||[],businessUnits:ut,currentBusinessUnit:Qa,onBusinessUnitChange:j=>{j&&(Ya(j),I?.(j))},onSearch:k,showTabs:!1,onActionClick:C,actionIcon:L,actionText:We,onNotificationRemove:T,onRemoveAll:R,logo:q,appName:X,tagline:de,sidebarInitiallyClosed:xe,children:(0,Rt.jsx)(Zt.AnimatePresence,{mode:"wait",children:(0,Rt.jsx)(Zt.motion.div,{className:"flex-1 Rt-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:"Rt-full flex",children:[(0,Rt.jsx)("div",{className:"w-80 flex-shrink-0 Rt-full p-2",children:(0,Rt.jsx)(Ra,{sessions:c||[],currentSession:S,teams:ut,onNewChat:p,onSessionSelect:w,onSessionEdit:y,onSessionDelete:b})}),(0,Rt.jsx)("div",{className:"flex-1 Rt-full p-2",children:(0,Rt.jsx)(Yt,{messages:we||[],input:Be,isTyping:_a,currentSessionTitle:S?.title,capabilities:n||[],onInputChange:ri,addToolResult:Ja,onSendMessage:Io,onKeyPress:ii,fileUploads:gt,isDragOver:Za,enableFileUpload:J,onFileUpload:ti,onRemoveFile:oi,onDragOver:ei})})]})},"chat-interface")})})}function Dr(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function Rr(e,t){return e.parts.some(o=>o.type===`tool-${t}`)}function Ar(e,t){return e.parts.find(o=>o.type===`tool-${t}`)}function Sr(e){return e.parts.some(t=>t.type==="file")}function Mr(e){return e.parts.filter(t=>t.type==="file")}function Ir(e,t){return e.parts.some(o=>o.type===`data-${t}`)}function Lr(e,t){return e.parts.find(o=>o.type===`data-${t}`)}0&&(module.exports={ApprovalRequestModal,CapabilityMenu,ChatCardArtefact,ChatCardTask,ChatInterface,ChatInterfaceMessages,ChatMessage,CopilotInterface,OAuthModal,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,getDataPart,getFileParts,getTextContent,getToolPart,hasDataPart,hasFilePart,hasToolPart,testCapabilities});
21
+ ${n?"bg-gray-400 cursor-not-allowed":"bg-gray-500 hover:bg-gray-600 cursor-pointer"}
22
+ `,children:"Cancel"})]})]}):null};var Ba=({toolPart:e,index:t,addToolResult:o})=>{let[a,i]=ko.default.useState(!0),[r,n]=ko.default.useState(null),s=()=>{o(e.toolCallId,e.type,"Approved"),i(!1),n("approve")},c=()=>{o(e.toolCallId,e.type,"Denied"),i(!1),n("deny")};switch(e.state){case"input-available":return(0,Ze.jsxs)("div",{className:"mb-2",children:[(0,Ze.jsx)(No,{isOpen:a,onApprove:s,onDeny:c,onClose:()=>i(!1),title:e.input?.title||"Approval Required",reason:e.output?.reason||e.input?.reason}),!a&&(0,Ze.jsxs)(Ze.Fragment,{children:[r==="approve"&&(0,Ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Ze.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Ze.jsx)("svg",{className:"Ze-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),r==="deny"&&(0,Ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Ze.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Ze.jsx)("svg",{className:"Ze-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]})]},t);case"output-error":return(0,Ze.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",e.errorText]},t);case"output-available":return(0,Ze.jsxs)(Ze.Fragment,{children:[e.output==="approve"&&(0,Ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Ze.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-green-100 text-green-800 text-sm font-medium border border-green-200",children:[(0,Ze.jsx)("svg",{className:"Ze-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Approved"]})}),e.output==="deny"&&(0,Ze.jsx)("div",{className:"flex items-center justify-center mt-3",children:(0,Ze.jsxs)("div",{className:"inline-flex items-center px-4 py-2 rounded-full bg-red-100 text-red-800 text-sm font-medium border border-red-200",children:[(0,Ze.jsx)("svg",{className:"Ze-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,Ze.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Denied"]})})]});default:return null}};var Po=require("@radix-ui/react-use-controllable-state");var pt=G(require("@radix-ui/react-collapsible")),mt=pt.Root,ut=pt.CollapsibleTrigger,ot=pt.CollapsibleContent;var Ea=require("streamdown"),Je=(0,nt.memo)(({className:e,...t})=>(0,Ze.jsx)(Ea.Streamdown,{className:l("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",e),...t}),(e,t)=>e.children===t.children);Je.displayName="Response";var Ua=(0,nt.createContext)(null),Cr=()=>{let e=(0,nt.useContext)(Ua);if(!e)throw new Error("Reasoning components must Ze used within Reasoning");return e},wr=1e3,Nr=1e3,To=(0,nt.memo)(({className:e,isStreaming:t=!1,open:o,defaultOpen:a=!0,onOpenChange:i,duration:r,children:n,...s})=>{let[c,d]=(0,Po.useControllableState)({prop:o,defaultProp:a,onChange:i}),[b,u]=(0,Po.useControllableState)({prop:r,defaultProp:0}),[v,S]=(0,nt.useState)(!1),[P,w]=(0,nt.useState)(null);(0,nt.useEffect)(()=>{t?P===null&&w(Date.now()):P!==null&&(u(Math.ceil((Date.now()-P)/Nr)),w(null))},[t,P,u]),(0,nt.useEffect)(()=>{if(a&&!t&&c&&!v){let N=setTimeout(()=>{d(!1),S(!0)},wr);return()=>clearTimeout(N)}},[t,c,a,d,v]);let x=N=>{d(N)};return(0,Ze.jsx)(Ua.Provider,{value:{isStreaming:t,isOpen:c,setIsOpen:d,duration:b},children:(0,Ze.jsx)(mt,{className:l("not-prose mb-4",e),onOpenChange:x,open:c,...s,children:n})})}),kr=(e,t)=>e||t===0?(0,Ze.jsx)("p",{children:"Thinking..."}):t===void 0?(0,Ze.jsx)("p",{children:"Thought for a few seconds"}):(0,Ze.jsxs)("p",{children:["Thought for ",t," seconds"]}),Do=(0,nt.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:i,duration:r}=Cr();return(0,Ze.jsx)(ut,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(Qo.BrainIcon,{className:"size-4"}),kr(a,r),(0,Ze.jsx)(Qo.ChevronDownIcon,{className:l("size-4 transition-transform",i?"rotate-180":"rotate-0")})]})})}),Ro=(0,nt.memo)(({className:e,children:t,...o})=>(0,Ze.jsx)(ot,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Ze.jsx)(Je,{className:"grid gap-2",children:t})}));To.displayName="Reasoning";Do.displayName="ReasoningTrigger";Ro.displayName="ReasoningContent";var So=require("shiki"),Pr=(0,nt.createContext)({code:""}),Tr={name:"line-numbers",line(e,t){e.children.unshift({type:"element",tagName:"span",properties:{className:["inline-block","min-w-10","mr-4","text-right","select-none","text-muted-foreground"]},children:[{type:"text",value:String(t)}]})}};async function Dr(e,t,o=!1){let a=o?[Tr]:[];return await Promise.all([(0,So.codeToHtml)(e,{lang:t,theme:"one-light",transformers:a}),(0,So.codeToHtml)(e,{lang:t,theme:"one-dark-pro",transformers:a})])}var $t=({code:e,language:t,showLineNumbers:o=!1,className:a,children:i,...r})=>{let[n,s]=(0,nt.useState)(""),[c,d]=(0,nt.useState)(""),b=(0,nt.useRef)(!1);return(0,nt.useEffect)(()=>(Dr(e,t,o).then(([u,v])=>{b.current||(s(u),d(v),b.current=!0)}),()=>{b.current=!1}),[e,t,o]),(0,Ze.jsx)(Pr.Provider,{value:{code:e},children:(0,Ze.jsx)("div",{className:l("group relative w-full overflow-hidden rounded-md border bg-background text-foreground",a),...r,children:(0,Ze.jsxs)("div",{className:"relative",children:[(0,Ze.jsx)("div",{className:"overflow-hidden dark:hidden [&>pre]:Ze-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",dangerouslySetInnerHTML:{__html:n}}),(0,Ze.jsx)("div",{className:"hidden overflow-hidden dark:block [&>pre]:Ze-0 [&>pre]:bg-background! [&>pre]:p-4 [&>pre]:text-foreground! [&>pre]:text-sm [&_code]:font-mono [&_code]:text-sm",dangerouslySetInnerHTML:{__html:c}}),i&&(0,Ze.jsx)("div",{className:"absolute top-2 right-2 flex items-center gap-2",children:i})]})})})};var ja=({className:e,...t})=>(0,Ze.jsx)(mt,{className:l("not-prose mb-4 w-full rounded-md border",e),...t}),Rr=e=>{let t={"input-streaming":"Pending","input-available":"Running","approval-requested":"Awaiting Approval","approval-responded":"Responded","output-available":"Completed","output-error":"Error","output-denied":"Denied"};return(0,Ze.jsxs)(ie,{className:"gap-1.5 rounded-full text-xs",variant:"secondary",children:[{"input-streaming":(0,Ze.jsx)(Qo.CircleIcon,{className:"size-4"}),"input-available":(0,Ze.jsx)(Qo.ClockIcon,{className:"size-4 animate-pulse"}),"approval-requested":(0,Ze.jsx)(Qo.ClockIcon,{className:"size-4 text-yellow-600"}),"approval-responded":(0,Ze.jsx)(Qo.CheckCircleIcon,{className:"size-4 text-blue-600"}),"output-available":(0,Ze.jsx)(Qo.CheckCircleIcon,{className:"size-4 text-green-600"}),"output-error":(0,Ze.jsx)(Qo.XCircleIcon,{className:"size-4 text-red-600"}),"output-denied":(0,Ze.jsx)(Qo.XCircleIcon,{className:"size-4 text-orange-600"})}[e],t[e]]})},Oa=({className:e,title:t,type:o,state:a,...i})=>(0,Ze.jsxs)(ut,{className:l("flex w-full items-center justify-between gap-4 p-3",e),...i,children:[(0,Ze.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Ze.jsx)(Qo.WrenchIcon,{className:"size-4 text-muted-foreground"}),(0,Ze.jsx)("span",{className:"font-medium text-sm",children:t??o.split("-").slice(1).join("-")}),Rr(a)]}),(0,Ze.jsx)(Qo.ChevronDownIcon,{className:"size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),Va=({className:e,...t})=>(0,Ze.jsx)(ot,{className:l("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...t}),Wa=({className:e,input:t,...o})=>(0,Ze.jsxs)("div",{className:l("space-Ze-2 overflow-hidden p-4",e),...o,children:[(0,Ze.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:"Parameters"}),(0,Ze.jsx)("div",{className:"rounded-md bg-muted/50",children:(0,Ze.jsx)($t,{code:JSON.stringify(t,null,2),language:"json"})})]}),Ga=({className:e,output:t,errorText:o,...a})=>{if(!(t||o))return null;let i=(0,Ze.jsx)("div",{children:t});return typeof t=="object"&&!(0,nt.isValidElement)(t)?i=(0,Ze.jsx)($t,{code:JSON.stringify(t,null,2),language:"json"}):typeof t=="string"&&(i=(0,Ze.jsx)($t,{code:t,language:"json"})),(0,Ze.jsxs)("div",{className:l("space-Ze-2 p-4",e),...a,children:[(0,Ze.jsx)("h4",{className:"font-medium text-muted-foreground text-xs uppercase tracking-wide",children:o?"Error":"Result"}),(0,Ze.jsxs)("div",{className:l("overflow-x-auto rounded-md text-xs [&_table]:w-full",o?"bg-destructive/10 text-destructive":"bg-muted/50 text-foreground"),children:[o&&(0,Ze.jsx)("div",{children:o}),i]})]})};var $a=(0,nt.createContext)(null),Sr=()=>{let e=(0,nt.useContext)($a);if(!e)throw new Error("ColleagueHandoff components must Ze used within ColleagueHandoff");return e},Ar=1e3,Mr=1e3,Mo=(0,nt.memo)(({className:e,isStreaming:t=!1,name:o="Digital Colleague",open:a,defaultOpen:i=!0,onOpenChange:r,duration:n,children:s,...c})=>{let[d,b]=(0,Po.useControllableState)({prop:a,defaultProp:i,onChange:r}),[u,v]=(0,Po.useControllableState)({prop:n,defaultProp:0}),[S,P]=(0,nt.useState)(!1),[w,x]=(0,nt.useState)(null);(0,nt.useEffect)(()=>{t?w===null&&x(Date.now()):w!==null&&(v(Math.ceil((Date.now()-w)/Mr)),x(null))},[t,w,v]),(0,nt.useEffect)(()=>{if(i&&!t&&d&&!S){let I=setTimeout(()=>{b(!1),P(!0)},Ar);return()=>clearTimeout(I)}},[t,d,i,b,S]);let N=I=>{b(I)};return(0,Ze.jsx)($a.Provider,{value:{isStreaming:t,name:o,isOpen:d,setIsOpen:b,duration:u},children:(0,Ze.jsx)(mt,{className:l("not-prose mb-4",e),onOpenChange:N,open:d,...c,children:s})})}),Ir=(e,t,o)=>e||o===0?(0,Ze.jsxs)("p",{children:["Asking our ",t,"..."]}):o===void 0?(0,Ze.jsxs)("p",{children:["Got an answer from our ",t]}):(0,Ze.jsxs)("p",{children:["Got an answer from our ",t," in ",o," seconds"]}),Io=(0,nt.memo)(({className:e,children:t,...o})=>{let{isStreaming:a,isOpen:i,name:r,duration:n}=Sr();return(0,Ze.jsx)(ut,{className:l("flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",e),...o,children:t??(0,Ze.jsxs)(Ze.Fragment,{children:[(0,Ze.jsx)(Qo.Users,{className:"size-4"}),Ir(a,r,n),(0,Ze.jsx)(Qo.ChevronDownIcon,{className:l("size-4 transition-transform",i?"rotate-180":"rotate-0")})]})})}),Bo=(0,nt.memo)(({className:e,children:t,...o})=>(0,Ze.jsx)(ot,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Ze.jsx)(Je,{className:"grid gap-2",children:t})})),Lo=(0,nt.memo)(({className:e,children:t,...o})=>(0,Ze.jsx)(ot,{className:l("mt-4 text-sm","data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",e),...o,children:(0,Ze.jsx)(Je,{className:"grid gap-2",children:t})}));Mo.displayName="ColleagueHandoff";Io.displayName="ColleagueHandoffTrigger";Bo.displayName="ColleagueHandoffContent";Lo.displayName="ColleagueHandoffQuery";var kt=require("use-stick-to-bottom"),Ka=({className:e,...t})=>(0,Ze.jsx)(kt.StickToBottom,{className:l("relative flex-1 overflow-Ze-hidden",e),initial:"smooth",resize:"smooth",role:"log",...t}),Ja=({className:e,...t})=>(0,Ze.jsx)(kt.StickToBottom.Content,{className:l("flex flex-col gap-8 p-4",e),...t}),Qa=({className:e,title:t="No messages yet",description:o="Start a conversation to see messages here",icon:a,children:i,...r})=>(0,Ze.jsx)("div",{className:l("flex size-full flex-col items-center justify-center gap-3 p-8 text-center",e),...r,children:i??(0,Ze.jsxs)(Ze.Fragment,{children:[a&&(0,Ze.jsx)("div",{className:"text-muted-foreground",children:a}),(0,Ze.jsxs)("div",{className:"space-Ze-1",children:[(0,Ze.jsx)("h3",{className:"font-medium text-sm",children:t}),o&&(0,Ze.jsx)("p",{className:"text-muted-foreground text-sm",children:o})]})]})}),Xa=({className:e,...t})=>{let{isAtBottom:o,scrollToBottom:a}=(0,kt.useStickToBottomContext)(),i=(0,nt.useCallback)(()=>{a()},[a]);return!o&&(0,Ze.jsx)(T,{className:l("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full",e),onClick:i,size:"icon",type:"button",variant:"outline",...t,children:(0,Ze.jsx)(Qo.ArrowDownIcon,{className:"size-4"})})};var Br=e=>e.startsWith("image/")?(0,Ze.jsx)(Qo.Image,{className:"Ze-4 w-4"}):e.startsWith("text/")?(0,Ze.jsx)(Qo.FileText,{className:"Ze-4 w-4"}):(0,Ze.jsx)(Qo.File,{className:"Ze-4 w-4"}),Ya=({message:e,addToolResult:t,status:o,messages:a})=>e.parts.map((i,r)=>{if(i.type==="text")return(0,Ze.jsx)(Je,{children:i.text},`${r}`);if(i.type==="file"){let n=i;return(0,Ze.jsx)("div",{className:"mb-2 p-2 bg-background/50 rounded-lg",children:(0,Ze.jsxs)("div",{className:"flex items-center gap-2",children:[Br(n.mediaType||"application/octet-stream"),(0,Ze.jsx)("div",{className:"flex-1 min-w-0",children:(0,Ze.jsx)("p",{className:"text-sm font-medium truncate",children:n.filename||n.url?.split("/").pop()||"File"})}),n.url&&(0,Ze.jsx)(T,{variant:"ghost",size:"sm",onClick:()=>window.open(n.url,"_blank"),className:"Ze-8 w-8 p-0",children:(0,Ze.jsx)(Qo.Download,{className:"Ze-4 w-4"})})]})},r)}if(i.type.startsWith("tool-")){let n=i,s=i.type.replace("tool-","");if(i.type.startsWith("tool-dc_a2a"))return(0,Ze.jsxs)(Mo,{name:n?.input?.dcName||"Digital Colleague",className:"w-full",isStreaming:o==="streaming"&&r===e.parts.length-1&&e.id===a.nt(-1)?.id,children:[(0,Ze.jsx)(Io,{}),(0,Ze.jsx)(Lo,{children:n?.input?.query}),(0,Ze.jsx)(Bo,{children:n?.output})]},`${r}`);if(s==="task")switch(n.state){case"input-available":return(0,Ze.jsx)("div",{className:"text-sm opacity-70",children:"Loading task..."},r);case"output-available":return(0,Ze.jsx)("div",{className:"mb-2",children:(0,Ze.jsx)(to,{data:{id:n.output?.id||n.input?.id,fetchLatest:!1,taskData:n.output||n.input}})},r);case"output-error":return(0,Ze.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},r);default:return null}if(i.type==="tool-requestEndpointLogin")return(0,Ze.jsx)("div",{className:"mb-2",children:(0,Ze.jsx)(wo,{toolPart:n,index:r,addToolResult:t??(()=>{})})},r);if(i.type==="tool-authenticate")return(0,Ze.jsx)("div",{className:"mb-2",children:(0,Ze.jsx)(wo,{toolPart:n,index:r,addToolResult:t??(()=>{})})},r);if(i.type==="tool-requestApproval")return console.log("Rendering PartApprovalTool with toolPart:",n),(0,Ze.jsx)("div",{className:"mb-2",children:(0,Ze.jsx)(Ba,{toolPart:n,index:r,addToolResult:t??(()=>{})})},r);if(s==="artefact")switch(n.state){case"input-available":return(0,Ze.jsx)("div",{className:"text-sm opacity-70",children:"Loading artefact..."},r);case"output-available":return(0,Ze.jsx)("div",{className:"mb-2",children:(0,Ze.jsx)(ao,{artefact:n.output?.description||"",taskId:n.output?.id||n.input?.id,taskData:n.output||n.input})},r);case"output-error":return(0,Ze.jsxs)("div",{className:"text-sm text-red-500",children:["Error: ",n.errorText]},r);default:return null}return(0,Ze.jsx)("div",{className:"mb-2",children:(0,Ze.jsxs)(ve,{className:"w-full max-w-md",children:[(0,Ze.jsx)(Ee,{children:(0,Ze.jsx)(ze,{className:"text-lg",children:s})}),(0,Ze.jsxs)(Te,{children:[n.state==="input-available"&&(0,Ze.jsxs)("p",{className:"text-sm",children:["Processing ",s,"..."]}),n.state==="output-available"&&(0,Ze.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.output,null,2)}),n.state==="output-error"&&(0,Ze.jsxs)("p",{className:"text-sm text-red-500",children:["Error: ",n.errorText]})]})]})},r)}if(i.type.startsWith("data-")){let n=i,s=i.type.replace("data-","");return s==="reference"?(0,Ze.jsx)("div",{className:"mb-2",children:(0,Ze.jsx)(ve,{className:"w-full",children:(0,Ze.jsx)(Te,{className:"p-4",children:(0,Ze.jsx)("div",{className:"space-Ze-2",children:n.data?.references?.map((c,d)=>(0,Ze.jsxs)("div",{className:"flex items-center gap-2 p-2 rounded-md bg-muted/50",children:[(0,Ze.jsx)(ie,{variant:"outline",children:c.type||"link"}),(0,Ze.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ze.jsx)("p",{className:"text-sm font-medium truncate",children:c.title}),c.description&&(0,Ze.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:c.description})]}),c.url&&(0,Ze.jsx)(T,{variant:"ghost",size:"sm",onClick:()=>window.open(c.url,"_blank"),className:"Ze-8 w-8 p-0",children:(0,Ze.jsx)(Qo.ExternalLink,{className:"Ze-4 w-4"})})]},d))})})})},r):s==="menu"?(0,Ze.jsx)("div",{className:"mb-2",children:(0,Ze.jsxs)(ve,{className:"w-full",children:[(0,Ze.jsx)(Ee,{children:(0,Ze.jsx)(ze,{className:"text-lg",children:n.data?.title})}),(0,Ze.jsx)(Te,{children:(0,Ze.jsx)("div",{className:"space-Ze-2",children:n.data?.items?.map((c,d)=>(0,Ze.jsx)(T,{variant:"outline",className:"w-full justify-start",onClick:c.action,children:(0,Ze.jsxs)("div",{className:"text-left",children:[(0,Ze.jsx)("p",{className:"font-medium",children:c.label}),c.description&&(0,Ze.jsx)("p",{className:"text-xs text-muted-foreground",children:c.description})]})},d))})})]})},r):(0,Ze.jsx)("div",{className:"mb-2",children:(0,Ze.jsxs)(ve,{className:"w-full max-w-md",children:[(0,Ze.jsx)(Ee,{children:(0,Ze.jsx)(ze,{className:"text-lg",children:s})}),(0,Ze.jsx)(Te,{children:(0,Ze.jsx)("pre",{className:"text-sm",children:JSON.stringify(n.data,null,2)})})]})},r)}if(i.type==="reasoning")return(0,Ze.jsxs)(To,{className:"w-full",isStreaming:o==="streaming"&&r===e.parts.length-1&&e.id===a.nt(-1)?.id,children:[(0,Ze.jsx)(Do,{}),(0,Ze.jsx)(Ro,{children:i.text})]},`${r}`);if(i.type==="dynamic-tool")return(0,Ze.jsxs)(ja,{defaultOpen:i.state!=="output-available",children:[(0,Ze.jsx)(Oa,{type:`tool-${i.toolName}`,state:i.state}),(0,Ze.jsxs)(Va,{children:[(0,Ze.jsx)(Wa,{input:i.input}),(0,Ze.jsx)(Ga,{output:i.output,errorText:i.errorText})]})]},`${e.id}-${r}`)});var ei=({className:e,from:t,...o})=>(0,Ze.jsx)("div",{className:l("group flex w-full items-end justify-end gap-2 py-4",t==="user"?"is-user":"is-assistant flex-row-reverse justify-end",e),...o}),Lr=(0,qo.cva)("is-user:dark flex flex-col gap-2 overflow-hidden rounded-lg text-sm",{variants:{variant:{contained:["max-w-[80%] px-4 py-3","group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground","group-[.is-assistant]:bg-card group-[.is-assistant]:text-card-foreground"],flat:["group-[.is-user]:max-w-[80%] group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground"]}},defaultVariants:{variant:"contained"}}),ti=({children:e,className:t,variant:o,...a})=>(0,Ze.jsx)("div",{className:l(Lr({variant:o,className:t})),...a,children:e});function Kt({messages:e,input:t,isTyping:o=!1,currentSessionTitle:a,capabilities:i,fileUploads:r,isDragOver:n,enableFileUpload:s,onInputChange:c,addToolResult:d,onSendMessage:b,onKeyPress:u,onFileUpload:v,onRemoveFile:S,onDragOver:P,className:w,status:x="ready"}){let N=(0,nt.useRef)(null),I=(0,nt.useRef)(null),M=(0,nt.useRef)(null),[E,Z]=(0,nt.useState)(!1),[q,de]=(0,nt.useState)({path:[],selectedItems:[],filters:{}});(0,nt.useEffect)(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[e]),(0,nt.useEffect)(()=>{E&&setTimeout(()=>{N.current?.scrollIntoView({behavior:"smooth"})},100)},[E]);let ae=()=>St(q),W=()=>{let f=[];return i.forEach(U=>{U.actions&&U.actions.forEach(xe=>{f.push({label:xe.label,action:()=>Q(xe.id,{path:[U],selectedItems:[],filters:{}})})}),U.children&&U.children.forEach(xe=>{xe.type==="list"&&xe.data&&f.push({label:`View ${xe.name}`,action:()=>Z(!0)})})}),f.slice(0,5)},Q=(f,U)=>{console.log("Capability action:",f,U);let xe=`Executing ${f} with context: ${JSON.stringify(U.path.map(Be=>Be.name))}`;Z(!1)},pe=St({path:[],selectedItems:[],filters:{}}),B=f=>{v(f.target.files),f.target.files&&(f.target.value="")},Xe=f=>{f.preventDefault(),P(!0)},Pe=f=>{f.preventDefault(),P(!1)},p=f=>{f.preventDefault(),P(!1),v(f.dataTransfer.files)},z=f=>{if(f===0)return"0 Bytes";let U=1024,xe=["Bytes","KB","MB","GB"],Be=Math.floor(Math.log(f)/Math.log(U));return parseFloat((f/Math.pow(U,Be)).toFixed(2))+" "+xe[Be]},A=f=>f.startsWith("image/")?(0,Ze.jsx)(Qo.Image,{className:"Ze-4 w-4"}):f.startsWith("text/")?(0,Ze.jsx)(Qo.FileText,{className:"Ze-4 w-4"}):(0,Ze.jsx)(Qo.File,{className:"Ze-4 w-4"}),me={messages:e,currentSessionTitle:a,capabilities:i,currentCapabilityContext:q,contextualActions:pe,getQuickSuggestions:W().map(f=>f.label)},$=()=>{navigator.clipboard.writeText(JSON.stringify(me,null,2)),alert("Debug info copied to clipboard")};return(0,Ze.jsxs)("div",{className:`Ze-full flex flex-col relative size-full shadow-sm max-w-4xl mx-auto ${w||""}`,children:[(0,Ze.jsxs)(Ka,{className:"relative flex-1 Ze-full size-full",children:[(0,Ze.jsx)(Ja,{children:e.length===0?(0,Ze.jsx)(Qa,{description:"Messages will appear here as the conversation progresses.",icon:(0,Ze.jsx)(Qo.MessageSquareIcon,{className:"size-6"}),title:"Start a conversation"}):e.map((f,U)=>(0,Ze.jsx)(ei,{from:f.role,children:(0,Ze.jsx)(ti,{children:Ya({message:f,addToolResult:d??(()=>{}),status:x,messages:e})})},U))}),(0,Ze.jsx)(Xa,{})]}),r.length>0&&(0,Ze.jsx)("div",{className:"p-4 border-t bg-muted/10",children:(0,Ze.jsx)("div",{className:"flex flex-wrap gap-2",children:r.map(f=>(0,Ze.jsxs)("div",{className:"flex items-center gap-2 bg-background rounded-lg p-2 border",children:[A(f.file.type),(0,Ze.jsx)("span",{className:"text-sm font-medium",children:f.file.name}),(0,Ze.jsx)("span",{className:"text-xs text-muted-foreground",children:z(f.file.size)}),(0,Ze.jsx)(T,{variant:"ghost",size:"sm",onClick:()=>S(f.id),className:"Ze-6 w-6 p-0",children:(0,Ze.jsx)(Qo.Ze,{className:"Ze-4 w-4"})})]},f.id))})}),(0,Ze.jsxs)("div",{className:"border rounded-2xl p-4 bg-muted/20",children:[(0,Ze.jsxs)("div",{className:"flex gap-3",children:[(0,Ze.jsx)(xt,{value:t,onChange:f=>c(f.target.value),onKeyPress:u,placeholder:"How can I help you today?",className:"flex-1 rounded-2xl bg-background shadow-sm",disabled:o}),s&&(0,Ze.jsx)(T,{variant:"outline",size:"icon",onClick:()=>M.current?.click(),className:"rounded-2xl Ze-10 w-10 shadow-sm",children:(0,Ze.jsx)(Qo.Paperclip,{className:"Ze-4 w-4"})}),(0,Ze.jsx)(T,{onClick:b,disabled:!t.trim()&&r.length===0||o,size:"icon",className:"rounded-2xl Ze-10 w-10 shadow-sm",children:(0,Ze.jsx)(Qo.Send,{className:"Ze-4 w-4"})})]}),(0,Ze.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,Ze.jsxs)(T,{onClick:()=>Z(!E),variant:"outline",size:"sm",className:"rounded-full text-xs flex-shrink-0",children:[(0,Ze.jsx)(Qo.Menu,{className:"Ze-3 w-3 mr-1"}),E?"Hide":"Show"," Capabilities"]}),(0,Ze.jsxs)("div",{className:"flex flex-wrap gap-2 overflow-hidden",children:[ae().map((f,U)=>(0,Ze.jsx)(T,{variant:"default",size:"sm",className:"rounded-full text-xs bg-accent hover:bg-accent/80",onClick:()=>Q(f.id,q),children:f.label},`context-${f.id}`)),ae().length===0&&W().map((f,U)=>(0,Ze.jsx)(T,{variant:"outline",size:"sm",className:"rounded-full text-xs",onClick:f.action,children:f.label},`suggestion-${U}`)),(0,Ze.jsx)(T,{variant:"outline",size:"sm",className:"rounded-full text-xs ml-auto",onClick:$,children:"Debug"})]})]}),s&&(0,Ze.jsx)("input",{ref:M,type:"file",multiple:!0,onChange:B,className:"hidden"})]})]})}function Er({aiConfig:e,useCustomChat:t,enableAI:o=!0,messages:a=[],businessUnits:i=[],capabilities:r=[],sidebarItems:n=[],notifications:s=[],sessions:c=[],onNewChat:d,onSessionSelect:b,onSessionDelete:u,onSessionEdit:v=()=>{},onBusinessUnitChange:S=()=>{},onNotificationRemove:P=()=>{},onRemoveAll:w=()=>{},onActionClick:x=()=>{},onSearch:N=p=>console.log("Search query:",p),initialTeam:I="design",currentSession:M=null,showCapabilities:E=!0,title:Z="Digital Colleagues",enableFileUpload:q=!0,maxFileSize:de=10,allowedFileTypes:ae=["image/*","text/*","application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],logo:W="/headerlogo.png",appName:Q="Nuvia",tagline:pe="AI-Powered Workspace",actionIcon:B=(0,Ze.jsx)(Qo.Users,{className:"mr-2 Ze-4 w-4"}),actionText:Xe="Collaborate",sidebarInitiallyClosed:Pe=!1}){let p={...e,onError:j=>{A?.setMessages(ue=>[...ue,{role:"assistant",id:`error-${Date.now()}`,createdAt:new Date,parts:[{type:"text",text:j.message}]}]),console.error("Error in CopilotInterface:",j)}},z=(0,oi.useChat)(p||{}),A=o?t||z:null,[me,$]=(0,nt.useState)(""),[f,U]=(0,nt.useState)(!1),xe=A?.messages||a,Be=me,ii=A?.status==="submitted"||f,ri=A?.addToolResult?(j,ue,ee)=>{A.addToolResult({tool:ue,toolCallId:j,output:ee}),console.log("Tool result added:",{toolCallId:j,tool:ue,output:ee}),A.sendMessage()}:()=>{console.log("addToolResult not available")},ft=i||[],ni={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"},[si,li]=(0,nt.useState)(()=>ft.length===0?ni:ft.find(j=>j.id===I)||ft[0]),[bt,Pt]=(0,nt.useState)([]),[ci,di]=(0,nt.useState)(!1),pi=j=>{if(!j||!q)return;let ue=[];Array.from(j).forEach(ee=>{if(ee.size>de*1024*1024){alert(`File ${ee.name} is too large. Maximum size is ${de}MB.`);return}if(ae.length>0&&!ae.some(Tt=>ee.type.match(Tt))){alert(`File type ${ee.type} is not allowed.`);return}let zo={id:Date.now().toString()+Math.random().toString(36).substr(2,9),file:ee,status:"pending",progress:0};if(ee.type.startsWith("image/")){let Tt=new FileReader;Tt.onload=bi=>{Pt(vi=>vi.map(Qt=>Qt.id===zo.id?{...Qt,preview:bi.target?.result}:Qt))},Tt.readAsDataURL(ee)}ue.push(zo)}),Pt(ee=>[...ee,...ue])},mi=j=>{Pt(ue=>ue.filter(ee=>ee.id!==j))},Eo=()=>{if(!(!Be.trim()&&bt.length===0)){if(A){let j=bt.length>0?ui(bt.map(ue=>ue.file)):void 0;A.sendMessage({text:Be,files:j},{body:{timestamp:Date.now()}}),$("")}else console.log("Message to send:",Be),console.log("Files to upload:",bt),$(""),U(!0),setTimeout(()=>{U(!1)},1500);Pt([])}},ui=j=>{let ue=new DataTransfer;return j.forEach(ee=>ue.items.add(ee)),ue.files},gi=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),Eo())},fi=j=>{$(j)};return(0,Ze.jsx)(Sa,{sidebarItems:n||[],title:Z,notifications:s||[],businessUnits:ft,currentBusinessUnit:si,onBusinessUnitChange:j=>{j&&(li(j),S?.(j))},onSearch:N,showTabs:!1,onActionClick:x,actionIcon:B,actionText:Xe,onNotificationRemove:P,onRemoveAll:w,logo:W,appName:Q,tagline:pe,sidebarInitiallyClosed:Pe,children:(0,Ze.jsx)(Jt.AnimatePresence,{mode:"wait",children:(0,Ze.jsx)(Jt.motion.div,{className:"flex-1 Ze-full",initial:{opacity:0,Ze:10},animate:{opacity:1,Ze:0},exit:{opacity:0,Ze:-10},transition:{duration:.2},children:(0,Ze.jsxs)("div",{className:"Ze-full flex",children:[(0,Ze.jsx)("div",{className:"w-80 flex-shrink-0 Ze-full p-2",children:(0,Ze.jsx)(Aa,{sessions:c||[],currentSession:M,teams:ft,onNewChat:d,onSessionSelect:b,onSessionEdit:v,onSessionDelete:u})}),(0,Ze.jsx)("div",{className:"flex-1 Ze-full p-2",children:(0,Ze.jsx)(Kt,{messages:xe||[],input:Be,isTyping:ii,currentSessionTitle:M?.title,capabilities:r||[],onInputChange:fi,addToolResult:ri,onSendMessage:Eo,onKeyPress:gi,fileUploads:bt,isDragOver:ci,enableFileUpload:q,onFileUpload:pi,onRemoveFile:mi,onDragOver:di})})]})},"chat-interface")})})}function zr({capabilities:e,isOpen:t,onToggle:o,onActionSelect:a,onContextChange:i,colorScheme:r=oo,className:n}){let[s,c]=(0,nt.useState)([]),[d,b]=(0,nt.useState)([]),u=s[s.length-1],v=u?.children||e,S=(M,E)=>{switch(M.type){case"category":return r.categories[E%r.categories.length];case"list":return r.lists[E%r.lists.length];case"item":return r.items[E%r.items.length];default:return r.primary}},P=(0,nt.useMemo)(()=>({path:s,selectedItems:d,filters:{}}),[s,d]);(0,nt.useEffect)(()=>{i&&i(P)},[P,i]);let w=M=>{M.type==="category"||M.type==="list"?c([...s,M]):M.type==="item"&&b([...d,M])},x=()=>{c(s.slice(0,-1))},N=M=>{c(s.slice(0,M+1))},I=()=>u?.actions?u.actions:[];return t?(0,Ze.jsxs)("div",{className:l("w-full",n),children:[(0,Ze.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,Ze.jsxs)("div",{className:"flex items-center gap-2",children:[s.length>0&&(0,Ze.jsx)(Jt.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:x,className:l("group p-1 Ze-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Ze.jsx)(Qo.ChevronLeft,{className:l("Ze-3 w-3 transition-transform duration-300 ease-in-out","group-hover:-translate-x-0.5")})}),(0,Ze.jsx)("h4",{className:"font-medium text-sm",children:u?.name||"Capabilities"})]}),(0,Ze.jsx)(Jt.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:o,className:l("group p-1 Ze-6 w-6 rounded-md backdrop-blur-sm","transition-all duration-300 ease-in-out","hover:bg-accent/50 hover:shadow-sm"),children:(0,Ze.jsx)(Qo.Ze,{className:l("Ze-3 w-3 transition-transform duration-300 ease-in-out","group-hover:rotate-90")})})]}),s.length>0&&(0,Ze.jsxs)("div",{className:"flex items-center gap-1 mb-3 text-xs text-muted-foreground",children:[(0,Ze.jsx)(Jt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>c([]),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Ze.jsxs)("span",{className:"relative",children:["Capabilities",(0,Ze.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ze-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})}),s.map((M,E)=>(0,Ze.jsxs)("div",{className:"flex items-center gap-1",children:[(0,Ze.jsx)(Qo.ChevronRight,{className:"Ze-2 w-2"}),(0,Ze.jsx)(Jt.motion.button,{whileHover:{scale:1.05,transition:{duration:.3,ease:[.4,0,.2,1]}},onClick:()=>N(E),className:l("group relative transition-colors duration-300 ease-in-out hover:text-accent"),children:(0,Ze.jsxs)("span",{className:"relative",children:[M.name,(0,Ze.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ze-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]})})]},M.id))]}),(0,Ze.jsx)("div",{className:"max-Ze-40 overflow-Ze-auto",children:(0,Ze.jsx)(Jt.AnimatePresence,{mode:"wait",children:(0,Ze.jsx)(Jt.motion.div,{initial:{opacity:0,Ze:-4},animate:{opacity:1,Ze:0},exit:{opacity:0,Ze:4},transition:{duration:.2,ease:[.4,0,.2,1]},children:u?.type==="list"&&u.data?(0,Ze.jsx)(Fr,{data:u.data,onItemSelect:M=>b([...d,M]),colorScheme:r}):(0,Ze.jsx)(Ur,{capabilities:v,onSelect:w,colorScheme:r})},u?.id||"root")})})]}):(0,Ze.jsxs)(T,{onClick:o,size:"sm",variant:"outline",className:"rounded-full",children:[(0,Ze.jsx)(Qo.Menu,{className:"Ze-4 w-4"}),(0,Ze.jsx)("span",{className:"ml-2",children:"Capabilities"})]})}function Ur({capabilities:e,onSelect:t,colorScheme:o}){return(0,Ze.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,i)=>(0,Ze.jsx)(Hr,{capability:a,onClick:()=>t(a),color:o.categories[i%o.categories.length]},a.id))})}function Hr({capability:e,onClick:t,selected:o,color:a}){return(0,Ze.jsxs)(Jt.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",o&&"border-primary bg-accent scale-105"),onClick:t,children:[(0,Ze.jsx)("div",{className:l("w-2 Ze-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",a)}),(0,Ze.jsxs)("span",{className:"truncate relative",children:[e.name,(0,Ze.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ze-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),(e.children||e.data)&&(0,Ze.jsx)(Qo.ChevronRight,{className:l("Ze-3 w-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,Ze.jsx)(ie,{variant:"secondary",className:l("text-xs Ze-5 px-1.5 flex-shrink-0","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:e.data.length})]})}function Fr({data:e,onItemSelect:t,colorScheme:o}){return(0,Ze.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map((a,i)=>(0,Ze.jsxs)(Jt.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(a),children:[(0,Ze.jsx)("div",{className:l("w-2 Ze-2 rounded-full flex-shrink-0 transition-transform duration-300 ease-in-out","group-hover:scale-125",o.items[i%o.items.length])}),(0,Ze.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,Ze.jsxs)("span",{className:"truncate relative font-medium",children:[a.title,(0,Ze.jsx)("span",{className:"absolute -bottom-0.5 left-1/2 w-0 Ze-0.5 bg-accent transform -translate-x-1/2 transition-all duration-300 ease-in-out group-hover:w-full"})]}),a.subtitle&&(0,Ze.jsx)("div",{className:l("text-xs text-muted-foreground truncate","transition-colors duration-300 ease-in-out group-hover:text-accent/80"),children:a.subtitle})]}),a.value&&(0,Ze.jsx)(ie,{variant:"secondary",className:l("text-xs Ze-5 px-1.5 flex-shrink-0 ml-2","transition-transform duration-300 ease-in-out group-hover:scale-110"),children:a.value})]},a.id))})}function jr(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join("")}function Or(e,t){return e.parts.some(o=>o.type===`tool-${t}`)}function Vr(e,t){return e.parts.find(o=>o.type===`tool-${t}`)}function Wr(e){return e.parts.some(t=>t.type==="file")}function Gr(e){return e.parts.filter(t=>t.type==="file")}function $r(e,t){return e.parts.some(o=>o.type===`data-${t}`)}function _r(e,t){return e.parts.find(o=>o.type===`data-${t}`)}0&&(module.exports={ApprovalRequestModal,CapabilityMenu,ChatCardArtefact,ChatCardTask,ChatInterface,CopilotInterface,OAuthModal,defaultColorScheme,findCapabilityByPath,getAllCapabilities,getCapabilityByTeam,getContextualActions,getDataPart,getFileParts,getTextContent,getToolPart,hasDataPart,hasFilePart,hasToolPart,testCapabilities});